fix verbose

This commit is contained in:
James Campos 2011-04-29 20:41:14 -07:00
parent dfb80ef16a
commit 5fed5f4a63
2 changed files with 24 additions and 22 deletions

View File

@ -1269,7 +1269,7 @@
updater = { updater = {
init: function() { init: function() {
var autoUpT, checked, conf, dialog, html, input, interva, name, title, updNow, verbose, _i, _len, _ref; var autoUpT, checked, conf, dialog, html, input, interva, name, title, updNow, verbose, _i, _len, _ref;
html = "<div class=move><span id=count></span> <span id=timer></span></div>"; html = "<div class=move><span id=count></span> <span id=timer>-" + ($.config('Interval')) + "</span></div>";
conf = config.updater.checkbox; conf = config.updater.checkbox;
for (name in conf) { for (name in conf) {
title = conf[name][1]; title = conf[name][1];
@ -1305,23 +1305,24 @@
}, },
cb: { cb: {
verbose: function(e) { verbose: function(e) {
var t; var count, timer;
count = $('#count');
timer = $('#timer');
if (this.checked) { if (this.checked) {
$.show($('#count')); count.textContent = '+0';
return $('#timer').textContent = (t = updater.timer) ? t : 'Thread Updater'; return $.show(timer);
} else { } else {
$.hide($('#count')); $.extend(count, {
return $('#timer').textContent = 'Thread Updater'; className: '',
textContent: 'Thread Updater'
});
return $.hide(timer);
} }
}, },
autoUpdate: function(e) { autoUpdate: function(e) {
var timer;
timer = $('#timer');
if (this.checked) { if (this.checked) {
timer.textContent = '-' + $.config('Interval');
return updater.intervalID = window.setInterval(updater.timeout, 1000); return updater.intervalID = window.setInterval(updater.timeout, 1000);
} else { } else {
timer.textContent = 'Thread Updater';
return window.clearInterval(updater.intervalID); return window.clearInterval(updater.intervalID);
} }
}, },
@ -1355,8 +1356,8 @@
while ((reply = replies.pop()) && (reply.id > id)) { while ((reply = replies.pop()) && (reply.id > id)) {
arr.push(reply.parentNode.parentNode.parentNode); arr.push(reply.parentNode.parentNode.parentNode);
} }
timer.textContent = '-' + $.config('Interval');
if ($.config('Verbose')) { if ($.config('Verbose')) {
timer.textContent = '-' + $.config('Interval');
count.textContent = '+' + arr.length; count.textContent = '+' + arr.length;
if (arr.length === 0) { if (arr.length === 0) {
count.className = ''; count.className = '';

View File

@ -992,7 +992,7 @@ threadHiding =
updater = updater =
init: -> init: ->
html = "<div class=move><span id=count></span> <span id=timer></span></div>" html = "<div class=move><span id=count></span> <span id=timer>-#{$.config 'Interval'}</span></div>"
conf = config.updater.checkbox conf = config.updater.checkbox
for name of conf for name of conf
title = conf[name][1] title = conf[name][1]
@ -1028,19 +1028,20 @@ updater =
cb: cb:
verbose: (e) -> verbose: (e) ->
if @checked count = $ '#count'
$.show $ '#count'
$('#timer').textContent = if t = updater.timer then t else 'Thread Updater'
else
$.hide $ '#count'
$('#timer').textContent = 'Thread Updater'
autoUpdate: (e) ->
timer = $ '#timer' timer = $ '#timer'
if @checked if @checked
timer.textContent = '-' + $.config 'Interval' count.textContent = '+0'
$.show timer
else
$.extend count,
className: ''
textContent: 'Thread Updater'
$.hide timer
autoUpdate: (e) ->
if @checked
updater.intervalID = window.setInterval updater.timeout, 1000 updater.intervalID = window.setInterval updater.timeout, 1000
else else
timer.textContent = 'Thread Updater'
window.clearInterval updater.intervalID window.clearInterval updater.intervalID
update: (e) -> update: (e) ->
count = $ '#count' count = $ '#count'
@ -1069,8 +1070,8 @@ updater =
while (reply = replies.pop()) and (reply.id > id) while (reply = replies.pop()) and (reply.id > id)
arr.push reply.parentNode.parentNode.parentNode #table arr.push reply.parentNode.parentNode.parentNode #table
timer.textContent = '-' + $.config 'Interval'
if $.config 'Verbose' if $.config 'Verbose'
timer.textContent = '-' + $.config 'Interval'
count.textContent = '+' + arr.length count.textContent = '+' + arr.length
if arr.length is 0 if arr.length is 0
count.className = '' count.className = ''