Initial commit

This commit is contained in:
2018-09-25 10:42:52 +08:00
commit 3d6226b615
48 changed files with 2540 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
{
"Auto": "Auto",
"Manual": "Manual",
"My select": "Mein Auswahl",
"on save adapter restarts with new config immediately": "Beim Speichern von Einstellungen der Adapter wird sofort neu gestartet.",
"template adapter settings": "Beispiel",
"test1": "Test 1",
"test2": "Test 2"
}

View File

@@ -0,0 +1,9 @@
{
"Auto": "Auto",
"Manual": "Manual",
"My select": "My select",
"on save adapter restarts with new config immediately": "on save adapter restarts with new config immediately",
"template adapter settings": "template adapter settings",
"test1": "Test 1",
"test2": "Test 2"
}

View File

@@ -0,0 +1,9 @@
{
"Auto": "Auto",
"Manual": "Manual",
"My select": "Mi seleccion",
"on save adapter restarts with new config immediately": "en el adaptador de guardar se reinicia con nueva configuración de inmediato",
"template adapter settings": "configuración del adaptador de plantilla",
"test1": "Prueba 1",
"test2": "Prueba 2"
}

View File

@@ -0,0 +1,9 @@
{
"Auto": "Auto",
"Manual": "Manuel",
"My select": "Mon choix",
"on save adapter restarts with new config immediately": "sur l'adaptateur de sauvegarde redémarre avec la nouvelle config immédiatement",
"template adapter settings": "paramètres de l'adaptateur de modèle",
"test1": "Test 1",
"test2": "Test 2"
}

View File

@@ -0,0 +1,9 @@
{
"Auto": "Auto",
"Manual": "Manuale",
"My select": "La mia selezione",
"on save adapter restarts with new config immediately": "su save adapter si riavvia immediatamente con la nuova configurazione",
"template adapter settings": "impostazioni dell'adattatore del modello",
"test1": "Test 1",
"test2": "Test 2"
}

View File

@@ -0,0 +1,9 @@
{
"Auto": "Auto",
"Manual": "Met de hand",
"My select": "Mijn select",
"on save adapter restarts with new config immediately": "on save-adapter wordt onmiddellijk opnieuw opgestart met nieuwe config",
"template adapter settings": "sjabloon-adapterinstellingen",
"test1": "Test 1",
"test2": "Test 2"
}

View File

@@ -0,0 +1,9 @@
{
"Auto": "Auto",
"Manual": "Manual",
"My select": "Meu selecionado",
"on save adapter restarts with new config immediately": "no adaptador de salvar reinicia com nova configuração imediatamente",
"template adapter settings": "configurações do adaptador de modelo",
"test1": "Teste 1",
"test2": "Teste 2"
}

View File

@@ -0,0 +1,9 @@
{
"Auto": "Автоматически",
"Manual": "Вручную",
"My select": "Выбор",
"on save adapter restarts with new config immediately": "При сохранении настроек адаптера он сразу же перезапускается",
"template adapter settings": "Пример",
"test1": "Тест 1",
"test2": "Тест 2"
}

89
admin/index.html Normal file
View File

@@ -0,0 +1,89 @@
<html>
<!-- This file is deprecated!!!!! Please use index_m.html -->
<!-- This file is required only for backward compatibility and will be deleted soon -->
<!-- these 4 files always have to be included -->
<link rel="stylesheet" type="text/css" href="../../lib/css/themes/jquery-ui/redmond/jquery-ui.min.css"/>
<script type="text/javascript" src="../../lib/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../../lib/js/jquery-ui-1.10.3.full.min.js"></script>
<!-- optional: use jqGrid
<link rel="stylesheet" type="text/css" href="../../lib/css/jqGrid/ui.jqgrid-4.5.4.css"/>
<script type="text/javascript" src="../../lib/js/jqGrid/jquery.jqGrid-4.5.4.min.js"></script>
<script type="text/javascript" src="../../lib/js/jqGrid/i18n/grid.locale-all.js"></script>
-->
<!-- optional: use multiselect
<link rel="stylesheet" type="text/css" href="../../lib/css/jquery.multiselect-1.13.css"/>
<script type="text/javascript" src="../../lib/js/jquery.multiselect-1.13.min.js"></script>
-->
<!-- these two file always have to be included -->
<link rel="stylesheet" type="text/css" href="../../css/adapter.css"/>
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
<script type="text/javascript" src="words.js"></script>
<!-- you have to define 2 functions in the global scope: -->
<script type="text/javascript">
// the function loadSettings has to exist ...
function load(settings, onChange) {
// example: select elements with id=key and class=value and insert value
if (!settings) return;
$('.value').each(function () {
var $key = $(this);
var id = $key.attr('id');
if ($key.attr('type') === 'checkbox') {
// do not call onChange direct, because onChange could expect some arguments
$key.prop('checked', settings[id]).change(function() {
onChange();
});
} else {
// do not call onChange direct, because onChange could expect some arguments
$key.val(settings[id]).change(function() {
onChange();
}).keyup(function() {
onChange();
});
}
});
onChange(false);
}
// ... and the function save has to exist.
// you have to make sure the callback is called with the settings object as first param!
function save(callback) {
// example: select elements with class=value and build settings object
var obj = {};
$('.value').each(function () {
var $this = $(this);
if ($this.attr('type') === 'checkbox') {
obj[$this.attr('id')] = $this.prop('checked');
} else {
obj[$this.attr('id')] = $this.val();
}
});
callback(obj);
}
</script>
<!-- you have to put your config page in a div with id adapter-container -->
<div id="adapter-container">
<table><tr>
<td><img src="template.png"/></td>
<td><h3 class="translate">template adapter settings</h3></td>
</tr></table>
<p>
<span><label for="test1" class="translate">test1</label></span><input class="value" id="test1"/><br>
<span><label for="test2" class="translate">test2</label></span><input class="value" id="test2"/><br>
</p>
<p class="translate">on save adapter restarts with new config immediately</p>
</div>
</html>

128
admin/index_m.html Normal file
View File

@@ -0,0 +1,128 @@
<html>
<head>
<!-- these 4 files always have to be included -->
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
<link rel="stylesheet" type="text/css" href="../../css/adapter.css"/>
<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<!-- these files always have to be included -->
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
<script type="text/javascript" src="words.js"></script>
<style>
.m .col .select-wrapper+label {
top: -26px;
}
.m span{
font-size: 0.9em;
}
</style>
<!-- you have to define 2 functions in the global scope: -->
<script type="text/javascript">
// the function loadSettings has to exist ...
function load(settings, onChange) {
// example: select elements with id=key and class=value and insert value
if (!settings) return;
$('.value').each(function () {
var $key = $(this);
var id = $key.attr('id');
if ($key.attr('type') === 'checkbox') {
// do not call onChange direct, because onChange could expect some arguments
$key.prop('checked', settings[id]).on('change', function() {
onChange();
});
} else {
// do not call onChange direct, because onChange could expect some arguments
$key.val(settings[id]).on('change', function() {
onChange();
}).on('keyup', function() {
onChange();
});
}
});
onChange(false);
M.updateTextFields(); // function Materialize.updateTextFields(); to reinitialize all the Materialize labels on the page if you are dynamically adding inputs.
}
// ... and the function save has to exist.
// you have to make sure the callback is called with the settings object as first param!
function save(callback) {
// example: select elements with class=value and build settings object
var obj = {};
$('.value').each(function () {
var $this = $(this);
if ($this.attr('type') === 'checkbox') {
obj[$this.attr('id')] = $this.prop('checked');
} else {
obj[$this.attr('id')] = $this.val();
}
});
callback(obj);
}
</script>
</head>
<body>
<!-- you have to put your config page in a div with id adapter-container -->
<div class="m adapter-container">
<div class="row">
<!-- Forms are the standard way to receive user inputted data.
Learn more http://materializecss.com/forms.html-->
<div class="row">
<div class="input-field col s6">
<img src="template.png" class="logo">
</div>
</div>
<div class="row">
<div class="input-field col s3">
<input class="value" id="test1" type="checkbox" />
<label for="test1" class="translate">test1</label>
</div>
</div>
<div class="row">
<div class="input-field col s12 m6 l4">
<input class="value" id="myText" type="text">
<label for="myText">Text</label>
<span class="translate">Descriptions of the input field</span>
</div>
<div class="input-field col s12 m6 l4">
<input type="number" class="value" id="test2" />
<label for="test2" class="translate">Number</label>
<!-- Important: label must come directly after input. Label is important. -->
<span class="translate">test2</span>
</div>
<div class="input-field col s12 m6 l4">
<input id="email" type="email" class="value validate">
<label for="email" data-error="wrong" data-success="right">Email</label>
<!-- You can add custom validation messages by adding either data-error or data-success attributes to your input field labels.-->
<span class="translate">Verification input</span>
</div>
</div>
<div class="row">
<div class="input-field col s12 m4">
<select class="value" id="mySelect">
<option value="auto" class="translate">Auto</option>
<option value="manual" class="translate">Manual</option>
</select>
<label for="mySelect" class="translate">My select</label>
<!-- Important: label must come directly after select. Label is important. -->
</div>
<div class="input-field col s12 m8">
<i class="material-icons prefix">mode_edit</i>
<textarea id="Textarea" class="value materialize-textarea"></textarea>
<label for="Textarea">Message</label>
</div>
</div>
<div class="row">
<div class="col s12">
<p class="translate">on save adapter restarts with new config immediately</p>
</div>
</div>
</div>
</div>
</body>
</html>

BIN
admin/template.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

13
admin/words.js Normal file
View File

@@ -0,0 +1,13 @@
// DO NOT EDIT THIS FILE!!! IT WILL BE AUTOMATICALLY GENERATED FROM src/i18n
/*global systemDictionary:true */
'use strict';
systemDictionary = {
"Auto": { "en": "Auto", "de": "Auto", "ru": "Автоматически", "pt": "Auto", "nl": "Auto", "fr": "Auto", "it": "Auto", "es": "Auto"},
"Manual": { "en": "Manual", "de": "Manual", "ru": "Вручную", "pt": "Manual", "nl": "Met de hand", "fr": "Manuel", "it": "Manuale", "es": "Manual"},
"My select": { "en": "My select", "de": "Mein Auswahl", "ru": "Выбор", "pt": "Meu selecionado", "nl": "Mijn select", "fr": "Mon choix", "it": "La mia selezione", "es": "Mi seleccion"},
"on save adapter restarts with new config immediately": {"en": "on save adapter restarts with new config immediately", "de": "Beim Speichern von Einstellungen der Adapter wird sofort neu gestartet.", "ru": "При сохранении настроек адаптера он сразу же перезапускается", "pt": "no adaptador de salvar reinicia com nova configuração imediatamente", "nl": "on save-adapter wordt onmiddellijk opnieuw opgestart met nieuwe config", "fr": "sur l'adaptateur de sauvegarde redémarre avec la nouvelle config immédiatement", "it": "su save adapter si riavvia immediatamente con la nuova configurazione", "es": "en el adaptador de guardar se reinicia con nueva configuración de inmediato"},
"template adapter settings": { "en": "template adapter settings", "de": "Beispiel", "ru": "Пример", "pt": "configurações do adaptador de modelo", "nl": "sjabloon-adapterinstellingen", "fr": "paramètres de l'adaptateur de modèle", "it": "impostazioni dell'adattatore del modello", "es": "configuración del adaptador de plantilla"},
"test1": { "en": "Test 1", "de": "Test 1", "ru": "Тест 1", "pt": "Teste 1", "nl": "Test 1", "fr": "Test 1", "it": "Test 1", "es": "Prueba 1"},
"test2": { "en": "Test 2", "de": "Test 2", "ru": "Тест 2", "pt": "Teste 2", "nl": "Test 2", "fr": "Test 2", "it": "Test 2", "es": "Prueba 2"}
};