Dynamic updater's settings
This commit is contained in:
parent
814e405fb0
commit
1c69ae5c93
@ -1561,7 +1561,7 @@
|
|||||||
};
|
};
|
||||||
updater = {
|
updater = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var autoUpT, checkbox, checked, dialog, html, input, interva, name, title, updNow, verbose, _i, _len, _ref;
|
var checkbox, checked, dialog, html, input, name, title, _i, _len, _ref;
|
||||||
html = "<div class=move><span id=count></span> <span id=timer>-" + conf['Interval'] + "</span></div>";
|
html = "<div class=move><span id=count></span> <span id=timer>-" + conf['Interval'] + "</span></div>";
|
||||||
checkbox = config.updater.checkbox;
|
checkbox = config.updater.checkbox;
|
||||||
for (name in checkbox) {
|
for (name in checkbox) {
|
||||||
@ -1575,29 +1575,34 @@
|
|||||||
bottom: '0',
|
bottom: '0',
|
||||||
right: '0'
|
right: '0'
|
||||||
}, html);
|
}, html);
|
||||||
_ref = $$('input[type=checkbox]', dialog);
|
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
|
||||||
input = _ref[_i];
|
|
||||||
$.bind(input, 'click', $.cb.checked);
|
|
||||||
}
|
|
||||||
verbose = $('input[name=Verbose]', dialog);
|
|
||||||
autoUpT = $('input[name$=This]', dialog);
|
|
||||||
interva = $('input[name=Interval]', dialog);
|
|
||||||
updNow = $('input[type=button]', dialog);
|
|
||||||
$.bind(verbose, 'click', updater.cb.verbose);
|
|
||||||
$.bind(autoUpT, 'click', updater.cb.autoUpdate);
|
|
||||||
$.bind(interva, 'change', updater.cb.interval);
|
|
||||||
$.bind(interva, 'change', $.cb.value);
|
|
||||||
$.bind(updNow, 'click', updater.updateNow);
|
|
||||||
updater.count = $('#count', dialog);
|
updater.count = $('#count', dialog);
|
||||||
updater.timer = $('#timer', dialog);
|
updater.timer = $('#timer', dialog);
|
||||||
$.append(d.body, dialog);
|
_ref = $$('input', dialog);
|
||||||
updater.cb.verbose.call(verbose);
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
return updater.cb.autoUpdate.call(autoUpT);
|
input = _ref[_i];
|
||||||
|
if (input.type === 'checkbox') {
|
||||||
|
$.bind(input, 'click', $.cb.checked);
|
||||||
|
$.bind(input, 'click', function() {
|
||||||
|
return conf[this.name] = this.checked;
|
||||||
|
});
|
||||||
|
if (input.name === 'Verbose') {
|
||||||
|
$.bind(input, 'click', updater.cb.verbose);
|
||||||
|
updater.cb.verbose.call(input);
|
||||||
|
} else if (input.name === 'Auto Update This') {
|
||||||
|
$.bind(input, 'click', updater.cb.autoUpdate);
|
||||||
|
updater.cb.autoUpdate.call(input);
|
||||||
|
}
|
||||||
|
} else if (input.name === 'Interval') {
|
||||||
|
$.bind(input, 'change', updater.cb.interval);
|
||||||
|
} else if (input.type === 'button') {
|
||||||
|
$.bind(input, 'click', updater.updateNow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $.append(d.body, dialog);
|
||||||
},
|
},
|
||||||
cb: {
|
cb: {
|
||||||
verbose: function() {
|
verbose: function() {
|
||||||
if (conf['Verbose'] = this.checked) {
|
if (conf['Verbose']) {
|
||||||
updater.count.textContent = '+0';
|
updater.count.textContent = '+0';
|
||||||
return $.show(updater.timer);
|
return $.show(updater.timer);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
github
|
github
|
||||||
|
- mayhem:
|
||||||
|
- Make updater's settings dynamic
|
||||||
|
|
||||||
|
2.16.1
|
||||||
- mayhem:
|
- mayhem:
|
||||||
- fix updater's custom settings
|
- fix updater's custom settings
|
||||||
|
|
||||||
|
|||||||
@ -1283,30 +1283,29 @@ updater =
|
|||||||
|
|
||||||
dialog = ui.dialog 'updater', bottom: '0', right: '0', html
|
dialog = ui.dialog 'updater', bottom: '0', right: '0', html
|
||||||
|
|
||||||
for input in $$ 'input[type=checkbox]', dialog
|
|
||||||
$.bind input, 'click', $.cb.checked
|
|
||||||
|
|
||||||
verbose = $ 'input[name=Verbose]', dialog
|
|
||||||
autoUpT = $ 'input[name$=This]', dialog
|
|
||||||
interva = $ 'input[name=Interval]', dialog
|
|
||||||
updNow = $ 'input[type=button]', dialog
|
|
||||||
$.bind verbose, 'click', updater.cb.verbose
|
|
||||||
$.bind autoUpT, 'click', updater.cb.autoUpdate
|
|
||||||
$.bind interva, 'change', updater.cb.interval
|
|
||||||
$.bind interva, 'change', $.cb.value
|
|
||||||
$.bind updNow, 'click', updater.updateNow
|
|
||||||
|
|
||||||
updater.count = $ '#count', dialog
|
updater.count = $ '#count', dialog
|
||||||
updater.timer = $ '#timer', dialog
|
updater.timer = $ '#timer', dialog
|
||||||
|
|
||||||
$.append d.body, dialog
|
for input in $$ 'input', dialog
|
||||||
|
if input.type is 'checkbox'
|
||||||
|
$.bind input, 'click', $.cb.checked
|
||||||
|
$.bind input, 'click', -> conf[@name] = @checked
|
||||||
|
if input.name is 'Verbose'
|
||||||
|
$.bind input, 'click', updater.cb.verbose
|
||||||
|
updater.cb.verbose.call input
|
||||||
|
else if input.name is 'Auto Update This'
|
||||||
|
$.bind input, 'click', updater.cb.autoUpdate
|
||||||
|
updater.cb.autoUpdate.call input
|
||||||
|
else if input.name is 'Interval'
|
||||||
|
$.bind input, 'change', updater.cb.interval
|
||||||
|
else if input.type is 'button'
|
||||||
|
$.bind input, 'click', updater.updateNow
|
||||||
|
|
||||||
updater.cb.verbose.call verbose
|
$.append d.body, dialog
|
||||||
updater.cb.autoUpdate.call autoUpT
|
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
verbose: ->
|
verbose: ->
|
||||||
if conf['Verbose'] = @checked
|
if conf['Verbose']
|
||||||
updater.count.textContent = '+0'
|
updater.count.textContent = '+0'
|
||||||
$.show updater.timer
|
$.show updater.timer
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user