tweak updater notifications

This commit is contained in:
James Campos 2011-01-18 04:02:44 -08:00
parent 31f400715f
commit 0cf4819749
2 changed files with 12 additions and 6 deletions

View File

@ -871,7 +871,9 @@ updateTime = ->
time = 0 time = 0
g.req.abort() g.req.abort()
updateNow() updateNow()
span.textContent = time $("#updater #count").textContent = 'retry'
else
span.textContent = time
updateTitle = -> updateTitle = ->
len = g.replies.length len = g.replies.length
@ -901,8 +903,9 @@ updateNow = ->
url = location.href + '?' + new Date().getTime() # fool the cache url = location.href + '?' + new Date().getTime() # fool the cache
g.req = request url, updateCallback g.req = request url, updateCallback
count = $ '#updater #count' count = $ '#updater #count'
count.textContent = 'Updating...' count.textContent = ''
count.className = '' count.className = ''
$("#updater #timer").textContent = 0
updaterMake = -> updaterMake = ->
html = "<div class=move><span id=count></span> <span id=timer>Thread Updater</span></div>" html = "<div class=move><span id=count></span> <span id=timer>Thread Updater</span></div>"

View File

@ -1190,13 +1190,15 @@
span = $('#updater #timer'); span = $('#updater #timer');
time = Number(span.textContent); time = Number(span.textContent);
if (++time === 0) { if (++time === 0) {
updateNow(); return updateNow();
} else if (time > 10) { } else if (time > 10) {
time = 0; time = 0;
g.req.abort(); g.req.abort();
updateNow(); updateNow();
return $("#updater #count").textContent = 'retry';
} else {
return span.textContent = time;
} }
return span.textContent = time;
}; };
updateTitle = function() { updateTitle = function() {
var len; var len;
@ -1232,8 +1234,9 @@
url = location.href + '?' + new Date().getTime(); url = location.href + '?' + new Date().getTime();
g.req = request(url, updateCallback); g.req = request(url, updateCallback);
count = $('#updater #count'); count = $('#updater #count');
count.textContent = 'Updating...'; count.textContent = '';
return count.className = ''; count.className = '';
return $("#updater #timer").textContent = 0;
}; };
updaterMake = function() { updaterMake = function() {
var autoG, autoL, div, html, interval; var autoG, autoL, div, html, interval;