Only save settings on change, not when opening the options.

This commit is contained in:
Nicolas Stepien 2011-12-11 03:53:26 +01:00
parent 898b2b0f19
commit f7af32247f
2 changed files with 7 additions and 7 deletions

View File

@ -1370,7 +1370,9 @@
(back = $('[name=backlink]', dialog)).value = conf['backlink'];
(time = $('[name=time]', dialog)).value = conf['time'];
$.on(back, 'keyup', options.backlink);
$.on(back, 'keyup', $.cb.value);
$.on(time, 'keyup', options.time);
$.on(time, 'keyup', $.cb.value);
favicon = $('select', dialog);
_ref3 = favicon.options;
for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) {
@ -1381,6 +1383,7 @@
}
}
$.on(favicon, 'change', options.favicon);
$.on(favicon, 'change', $.cb.value);
_ref4 = $$('#keybinds_tab + div input', dialog);
for (_k = 0, _len3 = _ref4.length; _k < _len3; _k++) {
input = _ref4[_k];
@ -1428,17 +1431,14 @@
return $.cb.value.call(this);
},
time: function() {
$.cb.value.call(this);
Time.foo();
Time.date = new Date();
return $('#timePreview').textContent = Time.funk(Time);
},
backlink: function() {
$.cb.value.call(this);
return $('#backlinkPreview').textContent = conf['backlink'].replace(/%id/, '123456789');
},
favicon: function() {
$.cb.value.call(this);
Favicon["switch"]();
if (g.REPLY && conf['Unread Count']) Favicon.update();
return this.nextElementSibling.innerHTML = "<img src=" + Favicon.unreadSFW + "> <img src=" + Favicon.unreadNSFW + "> <img src=" + Favicon.unreadDead + ">";

View File

@ -1020,13 +1020,16 @@ options =
(back = $ '[name=backlink]', dialog).value = conf['backlink']
(time = $ '[name=time]', dialog).value = conf['time']
$.on back, 'keyup', options.backlink
$.on back, 'keyup', $.cb.value
$.on time, 'keyup', options.time
$.on time, 'keyup', $.cb.value
favicon = $ 'select', dialog
for option in favicon.options
if option.textContent is conf['favicon']
option.selected = true
break
$.on favicon, 'change', options.favicon
$.on favicon, 'change', $.cb.value
#keybinds
for input in $$ '#keybinds_tab + div input', dialog
@ -1045,7 +1048,7 @@ options =
overlay = $.el 'div', id: 'overlay'
$.on overlay, 'click', -> $.rm overlay
$.on dialog, 'click', (e) -> e.stopPropagation()
$.on dialog, 'click', (e) -> e.stopPropagation()
$.add overlay, dialog
$.add d.body, overlay
@ -1067,15 +1070,12 @@ options =
@value = key
$.cb.value.call @
time: ->
$.cb.value.call @
Time.foo()
Time.date = new Date()
$('#timePreview').textContent = Time.funk Time
backlink: ->
$.cb.value.call @
$('#backlinkPreview').textContent = conf['backlink'].replace /%id/, '123456789'
favicon: ->
$.cb.value.call @
Favicon.switch()
Favicon.update() if g.REPLY and conf['Unread Count']
@nextElementSibling.innerHTML = "<img src=#{Favicon.unreadSFW}> <img src=#{Favicon.unreadNSFW}> <img src=#{Favicon.unreadDead}>"