This commit is contained in:
Nicolas Stepien 2012-05-18 05:15:36 +02:00
parent 611890237a
commit e6066a4db3
2 changed files with 16 additions and 16 deletions

View File

@ -2257,7 +2257,7 @@
}); });
for (key in obj) { for (key in obj) {
arr = obj[key]; arr = obj[key];
checked = Conf[key] ? 'checked' : ''; checked = $.get(key, Conf[key]) ? 'checked' : '';
description = arr[1]; description = arr[1];
li = $.el('li', { li = $.el('li', {
innerHTML: "<label><input type=checkbox name=\"" + key + "\" " + checked + ">" + key + "</label><span class=description>: " + description + "</span>" innerHTML: "<label><input type=checkbox name=\"" + key + "\" " + checked + ">" + key + "</label><span class=description>: " + description + "</span>"
@ -2277,12 +2277,12 @@
_ref1 = $$('textarea', dialog); _ref1 = $$('textarea', dialog);
for (_i = 0, _len = _ref1.length; _i < _len; _i++) { for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
ta = _ref1[_i]; ta = _ref1[_i];
ta.textContent = Conf[ta.name]; ta.textContent = $.get(ta.name, Conf[ta.name]);
$.on(ta, 'change', $.cb.value); $.on(ta, 'change', $.cb.value);
} }
(back = $('[name=backlink]', dialog)).value = Conf['backlink']; (back = $('[name=backlink]', dialog)).value = $.get('backlink', Conf['backlink']);
(time = $('[name=time]', dialog)).value = Conf['time']; (time = $('[name=time]', dialog)).value = $.get('time', Conf['time']);
(fileInfo = $('[name=fileInfo]', dialog)).value = Conf['fileInfo']; (fileInfo = $('[name=fileInfo]', dialog)).value = $.get('fileInfo', Conf['fileInfo']);
$.on(back, 'keyup', $.cb.value); $.on(back, 'keyup', $.cb.value);
$.on(back, 'keyup', Options.backlink); $.on(back, 'keyup', Options.backlink);
$.on(time, 'keyup', $.cb.value); $.on(time, 'keyup', $.cb.value);
@ -2290,7 +2290,7 @@
$.on(fileInfo, 'keyup', $.cb.value); $.on(fileInfo, 'keyup', $.cb.value);
$.on(fileInfo, 'keyup', Options.fileInfo); $.on(fileInfo, 'keyup', Options.fileInfo);
favicon = $('select', dialog); favicon = $('select', dialog);
favicon.value = Conf['favicon']; favicon.value = $.get('favicon', Conf['favicon']);
$.on(favicon, 'change', $.cb.value); $.on(favicon, 'change', $.cb.value);
$.on(favicon, 'change', Options.favicon); $.on(favicon, 'change', Options.favicon);
_ref2 = Config.hotkeys; _ref2 = Config.hotkeys;
@ -2300,7 +2300,7 @@
innerHTML: "<td>" + arr[1] + "</td><td><input name=" + key + "></td>" innerHTML: "<td>" + arr[1] + "</td><td><input name=" + key + "></td>"
}); });
input = $('input', tr); input = $('input', tr);
input.value = Conf[key]; input.value = $.get(key, Conf[key]);
$.on(input, 'keydown', Options.keybind); $.on(input, 'keydown', Options.keybind);
$.add($('#keybinds_tab + div tbody', dialog), tr); $.add($('#keybinds_tab + div tbody', dialog), tr);
} }
@ -2309,7 +2309,7 @@
for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
indicator = _ref3[_j]; indicator = _ref3[_j];
key = indicator.firstChild.textContent; key = indicator.firstChild.textContent;
indicator.hidden = Conf[key]; indicator.hidden = $.get(key, Conf[key]);
indicators[key] = indicator; indicators[key] = indicator;
$.on($("[name='" + key + "']", dialog), 'click', function() { $.on($("[name='" + key + "']", dialog), 'click', function() {
return indicators[this.name].hidden = this.checked; return indicators[this.name].hidden = this.checked;

View File

@ -1750,7 +1750,7 @@ Options =
ul = $.el 'ul', ul = $.el 'ul',
textContent: key textContent: key
for key, arr of obj for key, arr of obj
checked = if Conf[key] then 'checked' else '' checked = if $.get(key, Conf[key]) then 'checked' else ''
description = arr[1] description = arr[1]
li = $.el 'li', li = $.el 'li',
innerHTML: "<label><input type=checkbox name=\"#{key}\" #{checked}>#{key}</label><span class=description>: #{description}</span>" innerHTML: "<label><input type=checkbox name=\"#{key}\" #{checked}>#{key}</label><span class=description>: #{description}</span>"
@ -1767,13 +1767,13 @@ Options =
#filter & sauce #filter & sauce
for ta in $$ 'textarea', dialog for ta in $$ 'textarea', dialog
ta.textContent = Conf[ta.name] ta.textContent = $.get ta.name, Conf[ta.name]
$.on ta, 'change', $.cb.value $.on ta, 'change', $.cb.value
#rice #rice
(back = $ '[name=backlink]', dialog).value = Conf['backlink'] (back = $ '[name=backlink]', dialog).value = $.get 'backlink', Conf['backlink']
(time = $ '[name=time]', dialog).value = Conf['time'] (time = $ '[name=time]', dialog).value = $.get 'time', Conf['time']
(fileInfo = $ '[name=fileInfo]', dialog).value = Conf['fileInfo'] (fileInfo = $ '[name=fileInfo]', dialog).value = $.get 'fileInfo', Conf['fileInfo']
$.on back, 'keyup', $.cb.value $.on back, 'keyup', $.cb.value
$.on back, 'keyup', Options.backlink $.on back, 'keyup', Options.backlink
$.on time, 'keyup', $.cb.value $.on time, 'keyup', $.cb.value
@ -1781,7 +1781,7 @@ Options =
$.on fileInfo, 'keyup', $.cb.value $.on fileInfo, 'keyup', $.cb.value
$.on fileInfo, 'keyup', Options.fileInfo $.on fileInfo, 'keyup', Options.fileInfo
favicon = $ 'select', dialog favicon = $ 'select', dialog
favicon.value = Conf['favicon'] favicon.value = $.get 'favicon', Conf['favicon']
$.on favicon, 'change', $.cb.value $.on favicon, 'change', $.cb.value
$.on favicon, 'change', Options.favicon $.on favicon, 'change', Options.favicon
@ -1790,7 +1790,7 @@ Options =
tr = $.el 'tr', tr = $.el 'tr',
innerHTML: "<td>#{arr[1]}</td><td><input name=#{key}></td>" innerHTML: "<td>#{arr[1]}</td><td><input name=#{key}></td>"
input = $ 'input', tr input = $ 'input', tr
input.value = Conf[key] input.value = $.get key, Conf[key]
$.on input, 'keydown', Options.keybind $.on input, 'keydown', Options.keybind
$.add $('#keybinds_tab + div tbody', dialog), tr $.add $('#keybinds_tab + div tbody', dialog), tr
@ -1798,7 +1798,7 @@ Options =
indicators = {} indicators = {}
for indicator in $$ '.warning', dialog for indicator in $$ '.warning', dialog
key = indicator.firstChild.textContent key = indicator.firstChild.textContent
indicator.hidden = Conf[key] indicator.hidden = $.get key, Conf[key]
indicators[key] = indicator indicators[key] = indicator
$.on $("[name='#{key}']", dialog), 'click', -> $.on $("[name='#{key}']", dialog), 'click', ->
indicators[@name].hidden = @checked indicators[@name].hidden = @checked