From 5fed5f4a63fa1782f7dd99a08068af82454faba3 Mon Sep 17 00:00:00 2001 From: James Campos Date: Fri, 29 Apr 2011 20:41:14 -0700 Subject: [PATCH] fix verbose --- 4chan_x.js | 23 ++++++++++++----------- script.coffee | 23 ++++++++++++----------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 6b90a4b6a..3778d71c7 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1269,7 +1269,7 @@ updater = { init: function() { var autoUpT, checked, conf, dialog, html, input, interva, name, title, updNow, verbose, _i, _len, _ref; - html = "
"; + html = "
-" + ($.config('Interval')) + "
"; conf = config.updater.checkbox; for (name in conf) { title = conf[name][1]; @@ -1305,23 +1305,24 @@ }, cb: { verbose: function(e) { - var t; + var count, timer; + count = $('#count'); + timer = $('#timer'); if (this.checked) { - $.show($('#count')); - return $('#timer').textContent = (t = updater.timer) ? t : 'Thread Updater'; + count.textContent = '+0'; + return $.show(timer); } else { - $.hide($('#count')); - return $('#timer').textContent = 'Thread Updater'; + $.extend(count, { + className: '', + textContent: 'Thread Updater' + }); + return $.hide(timer); } }, autoUpdate: function(e) { - var timer; - timer = $('#timer'); if (this.checked) { - timer.textContent = '-' + $.config('Interval'); return updater.intervalID = window.setInterval(updater.timeout, 1000); } else { - timer.textContent = 'Thread Updater'; return window.clearInterval(updater.intervalID); } }, @@ -1355,8 +1356,8 @@ while ((reply = replies.pop()) && (reply.id > id)) { arr.push(reply.parentNode.parentNode.parentNode); } + timer.textContent = '-' + $.config('Interval'); if ($.config('Verbose')) { - timer.textContent = '-' + $.config('Interval'); count.textContent = '+' + arr.length; if (arr.length === 0) { count.className = ''; diff --git a/script.coffee b/script.coffee index f950145c9..9f154da2b 100644 --- a/script.coffee +++ b/script.coffee @@ -992,7 +992,7 @@ threadHiding = updater = init: -> - html = "
" + html = "
-#{$.config 'Interval'}
" conf = config.updater.checkbox for name of conf title = conf[name][1] @@ -1028,19 +1028,20 @@ updater = cb: verbose: (e) -> - if @checked - $.show $ '#count' - $('#timer').textContent = if t = updater.timer then t else 'Thread Updater' - else - $.hide $ '#count' - $('#timer').textContent = 'Thread Updater' - autoUpdate: (e) -> + count = $ '#count' timer = $ '#timer' 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 else - timer.textContent = 'Thread Updater' window.clearInterval updater.intervalID update: (e) -> count = $ '#count' @@ -1069,8 +1070,8 @@ updater = while (reply = replies.pop()) and (reply.id > id) arr.push reply.parentNode.parentNode.parentNode #table + timer.textContent = '-' + $.config 'Interval' if $.config 'Verbose' - timer.textContent = '-' + $.config 'Interval' count.textContent = '+' + arr.length if arr.length is 0 count.className = ''