From 31f400715fe0c76c7cb3de7f7cb1c70e62134618 Mon Sep 17 00:00:00 2001 From: James Campos Date: Tue, 18 Jan 2011 04:00:04 -0800 Subject: [PATCH] Revert "tweak updater notifications" This reverts commit d20a08080fd660b49f47940a5add990dbd3465f0. --- 4chan_x.coffee | 12 +++++------- 4chan_x.js | 20 +++++++++----------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/4chan_x.coffee b/4chan_x.coffee index 00b1e2534..9c9c2d5f1 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -865,17 +865,13 @@ updateFavicon = -> updateTime = -> span = $ '#updater #timer' time = Number span.textContent - count = $ '#updater #count' - count.textContent = '' - count.className = '' if ++time is 0 updateNow() else if time > 10 + time = 0 g.req.abort() updateNow() - count.textContent = 'retry' - else - span.textContent = time + span.textContent = time updateTitle = -> len = g.replies.length @@ -902,9 +898,11 @@ updateInterval = -> span.textContent = -1 * num updateNow = -> - $("#updater #timer").textContent = 0 url = location.href + '?' + new Date().getTime() # fool the cache g.req = request url, updateCallback + count = $ '#updater #count' + count.textContent = 'Updating...' + count.className = '' updaterMake = -> html = "
Thread Updater
" diff --git a/4chan_x.js b/4chan_x.js index c2ec73cb5..3b41c4b56 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1186,21 +1186,17 @@ return replace(favicon, clone); }; updateTime = function() { - var count, span, time; + var span, time; span = $('#updater #timer'); time = Number(span.textContent); - count = $('#updater #count'); - count.textContent = ''; - count.className = ''; if (++time === 0) { - return updateNow(); + updateNow(); } else if (time > 10) { + time = 0; g.req.abort(); updateNow(); - return count.textContent = 'retry'; - } else { - return span.textContent = time; } + return span.textContent = time; }; updateTitle = function() { var len; @@ -1232,10 +1228,12 @@ } }; updateNow = function() { - var url; - $("#updater #timer").textContent = 0; + var count, url; url = location.href + '?' + new Date().getTime(); - return g.req = request(url, updateCallback); + g.req = request(url, updateCallback); + count = $('#updater #count'); + count.textContent = 'Updating...'; + return count.className = ''; }; updaterMake = function() { var autoG, autoL, div, html, interval;