Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
hacki11 committed Apr 18, 2019
2 parents 3fc8111 + 7022956 commit fcc04ae
Show file tree
Hide file tree
Showing 13 changed files with 6,845 additions and 117 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ os:

language: node_js
node_js:
- '6'
- '8'
- '10'

Expand Down
50 changes: 27 additions & 23 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>

<!-- Load ioBroker scripts and styles-->
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
<link rel="stylesheet" type="text/css" href="../../css/adapter.css"/>
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">

<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
Expand All @@ -14,28 +14,28 @@
<script type="text/javascript" src="../../js/adapter-settings.js"></script>

<!-- Load our own files -->
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="words.js"></script>

<script type="text/javascript">
// This will be called by the admin adapter when the settings page loads
function load(settings, onChange) {
// example: select elements with id=key and class=value and insert value
if (!settings) return;
$('.value').each(function () {
$(".value").each(function () {
var $key = $(this);
var id = $key.attr('id');
if ($key.attr('type') === 'checkbox') {
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', () => onChange())
;
$key.prop("checked", settings[id])
.on("change", () => onChange())
;
} else {
// do not call onChange direct, because onChange could expect some arguments
$key.val(settings[id])
.on('change', () => onChange())
.on('keyup', () => onChange())
;
.on("change", () => onChange())
.on("keyup", () => onChange())
;
}
});
onChange(false);
Expand All @@ -47,12 +47,12 @@
function save(callback) {
// example: select elements with class=value and build settings object
var obj = {};
$('.value').each(function () {
$(".value").each(function () {
var $this = $(this);
if ($this.attr('type') === 'checkbox') {
obj[$this.attr('id')] = $this.prop('checked');
if ($this.attr("type") === "checkbox") {
obj[$this.attr("id")] = $this.prop("checked");
} else {
obj[$this.attr('id')] = $this.val();
obj[$this.attr("id")] = $this.val();
}
});
callback(obj);
Expand All @@ -75,17 +75,21 @@

<!-- For example columns with settings: -->
<div class="row">
<div class="col s6 input-field">
<input type="checkbox" class="value" id="option1" />
<label for="option1" class="translate">option1</label>
<div class="col s12 m5">
<input id="host" class="value"/>
<label for="host" class="translate">Host</label>
</div>

<div class="col s6 input-field">
<input type="text" class="value" id="option2" />
<label for="option2" class="translate">option2</label>
<div class="col s12 m2">
<input id="port" type="number" min="1" max="65565" class="value"/>
<label for="port" class="translate">Port</label>
</div>
</div>
<div class="row">
<div class="col s12 m5">
<input id="interval" class="value"/>
<label for="interval" class="translate">Interval</label>
</div>
</div>

</div>

</body>
Expand Down
Binary file modified admin/valloxmv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 10 additions & 22 deletions admin/words.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,16 @@ systemDictionary = {
"pl": "Ustawienia adaptera dla valloxmv",
"zh-cn": "valloxmv的适配器设置"
},
"option1": {
"en": "option1",
"de": "Option 1",
"ru": "Опция 1",
"pt": "Opção 1",
"nl": "Optie 1",
"fr": "Option 1",
"it": "opzione 1",
"es": "Opción 1",
"pl": "opcja 1",
"zh-cn": "选项1"
"host": {
"en": "Host",
"de": "Host"
},
"option2": {
"en": "option2",
"de": "Option 2",
"ru": "option2",
"pt": "opção 2",
"nl": "Optie 2",
"fr": "Option 2",
"it": "opzione 2",
"es": "opcion 2",
"pl": "Opcja 2",
"zh-cn": "选项2"
"port": {
"en": "Port",
"de": "Port"
},
"interval": {
"en": "Interval",
"de": "Intervall"
}
};
5 changes: 3 additions & 2 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@
]
},
"native": {
"option1": true,
"option2": "42"
"host": "",
"port": "80",
"interval": "60"
},
"objects": [],
"instanceObjects": [
Expand Down
Loading

0 comments on commit fcc04ae

Please sign in to comment.