Skip to content

Commit 9f24b1e

Browse files
committed
Empty commands are no longer excecuted
1 parent c65c4e5 commit 9f24b1e

File tree

8 files changed

+507
-645
lines changed

8 files changed

+507
-645
lines changed

Gruntfile.js

-177
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ After installation, you have to confirm the new connection on your TV
2626
### License
2727
The MIT License (MIT)
2828

29-
Copyright (c) 2015 soef <[email protected]>
29+
Copyright (c) 2015-2016 soef <[email protected]>
3030

3131
Permission is hereby granted, free of charge, to any person obtaining a copy
3232
of this software and associated documentation files (the "Software"), to deal

admin/index.html

+71-29
Original file line numberDiff line numberDiff line change
@@ -24,67 +24,109 @@
2424
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
2525

2626

27-
<!-- you have to define 2 functions in the global scope: -->
2827
<script type="text/javascript">
2928

30-
// Dictionary (systemDictionary is global variable from adapter-settings.js)
3129
systemDictionary = {
3230
"samsung adapter settings": {"de": "Samsung Einstellungen", "ru": "Samsung"},
33-
"IP": {"en": "IP", "de": "IP", "ru": "IP"},
34-
"test2": {"en": "Test 2", "de": "Test 2", "ru": "Тест 2"},
31+
"IP": {
32+
"en": "IP",
33+
"de": "IP",
34+
"ru": "IP"
35+
},
36+
"Info": {
37+
"de": "Hinweis",
38+
"en": "Info"
39+
},
40+
"Settings": {
41+
"de": "Einstellungen",
42+
"en": "Settings"
43+
},
3544
"on save adapter restarts with new config immediately": {
36-
"de": "Beim Speichern von Einstellungen der Adapter wird sofort neu gestartet.",
45+
"de": "Beim Speichern der Einstellungen wird der Adapter automatisch neu gestartet.",
3746
"ru": "Сразу после сохранения настроек драйвер перезапуститься с новыми значениями"
3847
}
3948
};
4049

41-
// the function loadSettings has to exist ...
4250
function load(settings, onChange) {
43-
// example: select elements with id=key and class=value and insert value
4451
for (var key in settings) {
45-
// example: select elements with id=key and class=value and insert value
4652
if ($('#' + key + '.value').attr('type') == 'checkbox') {
4753
$('#' + key + '.value').prop('checked', settings[key]).change(function () {
48-
onChange();
49-
});
54+
onChange();
55+
});
5056
} else {
5157
$('#' + key + '.value').val(settings[key]).change(function () {
52-
onChange();
53-
}).keyup(function () {
54-
$(this).trigger('change');
55-
});
58+
onChange();
59+
}).keyup(function () {
60+
$(this).trigger('change');
61+
});
5662
}
5763
}
58-
// Signal to admin, that no changes yet
5964
onChange(false);
6065
}
6166

62-
// ... and the function save has to exist.
63-
// you have to make sure the callback is called with the settings object as first param!
6467
function save(callback) {
65-
// example: select elements with class=value and build settings object
6668
var obj = {};
6769
$('.value').each(function () {
6870
var $this = $(this);
69-
obj[$this.attr('id')] = $this.val();
71+
var id = $this.attr('id');
72+
73+
if ($this.attr('type') == 'checkbox') {
74+
obj[$this.attr('id')] = $this.prop('checked');
75+
} else {
76+
obj[$this.attr('id')] = $this.val();
77+
}
7078
});
7179
callback(obj);
7280
}
81+
7382
</script>
7483

75-
<!-- you have to put your config page in a div with id adapter-container -->
76-
<div id="adapter-container">
84+
<style>
85+
td {
86+
font-size: 13px;
87+
padding-left:1px;
88+
padding-right: 4px;
89+
padding-top: 3px;
90+
padding-bottom: 3px;
91+
}
92+
input {
93+
font-size: 13px;
94+
}
95+
h1 {
96+
font-size: 11px;
97+
color: #505050;
98+
font-weight: bold;
99+
width: 100%;
100+
padding-left:6px;
101+
padding-right: 5px;
102+
padding-top: 5px;
103+
padding-bottom: 5px;
104+
background-color: #e0e0e0;
105+
/*background-image: linear-gradient(to right, #e0e0e0, rgba(224,224,224,0.0));*/
106+
/*background-image: linear-gradient(to right, #e0e0e0, #e8e8e8 50%, #e0e0e0);*/
107+
}
108+
</style>
109+
110+
111+
<div id="adapter-container" style="padding-left: 6px; padding-right: 0px; width: 97%;">
112+
113+
<table>
114+
<td><img src="samsung.png" /></td>
115+
<td style="padding-top: 20px;padding-left: 10px"><h3 class="translate">samsung adapter settings</h3></td>
116+
</table>
117+
118+
<h1 class="translate">Settings</h1>
77119

78-
<table><tr>
79-
<td><img src="samsung.png"/></td>
80-
<td><h3 class="translate">samsung adapter settings</h3></td>
81-
</tr></table>
82-
<p>
83-
<span class="translate">IP</span> <input class="value" id="IP"/><br>
84-
</p>
120+
<table>
121+
<tr><td class="translate">IP</td><td><input class="value" id="ip" type="input" size="15" /></td></tr>
122+
</table>
85123

86-
<p class="translate">on save adapter restarts with new config immediately</p>
124+
<div style="padding: 10px"></div>
125+
<h1 class="translate">Info</h1>
87126

127+
<table>
128+
<tr><td class="translate">on save adapter restarts with new config immediately</td></tr>
129+
</table>
88130
</div>
89131

90132
</html>

io-package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"common": {
33
"name": "samsung",
4-
"version": "0.0.9",
4+
"version": "0.0.10",
55
"title": "Samsung TV Adapter",
66
"desc": {
77
"en": "Control Samsung TV devices",

0 commit comments

Comments
 (0)