From 875a546668b027da89970afcc179bdb62a12ff86 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 8 Jan 2014 21:03:10 -0700 Subject: [PATCH] Remove index refresh notifications, re-order some menus --- builds/4chan-X.user.js | 14 ++++---------- builds/crx/script.js | 14 ++++---------- src/General/Index.coffee | 11 ++--------- 3 files changed, 10 insertions(+), 29 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 0e60c522d..265fba179 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -2229,8 +2229,8 @@ el: $.el('span', { textContent: 'Index Navigation' }), - order: 90, - subEntries: [modeEntry, sortEntry, repliesEntry, anchorEntry, refNavEntry] + order: 98, + subEntries: [repliesEntry, anchorEntry, refNavEntry, modeEntry, sortEntry] }); $.addClass(doc, 'index-loading'); this.update(); @@ -2420,15 +2420,14 @@ _ref1.close(); } if (d.readyState !== 'loading') { - Index.notice = new Notice('info', 'Refreshing index...'); + } else { now = Date.now(); $.ready(function() { return setTimeout((function() { if (!(Index.req && !Index.notice)) { - return; + } - return Index.notice = new Notice('info', 'Refreshing index...'); }), 5 * $.SECOND - (Date.now() - now)); }); } @@ -2475,11 +2474,6 @@ } return; } - if (notice) { - notice.setType('success'); - notice.el.lastElementChild.textContent = 'Index refreshed!'; - setTimeout(notice.close, $.SECOND); - } timeEl = $('#index-last-refresh', Index.navLinks); timeEl.dataset.utc = Date.parse(req.getResponseHeader('Last-Modified')); RelativeDates.update(timeEl); diff --git a/builds/crx/script.js b/builds/crx/script.js index 679b025d5..eaadf0f31 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -2239,8 +2239,8 @@ el: $.el('span', { textContent: 'Index Navigation' }), - order: 90, - subEntries: [modeEntry, sortEntry, repliesEntry, anchorEntry, refNavEntry] + order: 98, + subEntries: [repliesEntry, anchorEntry, refNavEntry, modeEntry, sortEntry] }); $.addClass(doc, 'index-loading'); this.update(); @@ -2430,15 +2430,14 @@ _ref1.close(); } if (d.readyState !== 'loading') { - Index.notice = new Notice('info', 'Refreshing index...'); + } else { now = Date.now(); $.ready(function() { return setTimeout((function() { if (!(Index.req && !Index.notice)) { - return; + } - return Index.notice = new Notice('info', 'Refreshing index...'); }), 5 * $.SECOND - (Date.now() - now)); }); } @@ -2485,11 +2484,6 @@ } return; } - if (notice) { - notice.setType('success'); - notice.el.lastElementChild.textContent = 'Index refreshed!'; - setTimeout(notice.close, $.SECOND); - } timeEl = $('#index-last-refresh', Index.navLinks); timeEl.dataset.utc = Date.parse(req.getResponseHeader('Last-Modified')); RelativeDates.update(timeEl); diff --git a/src/General/Index.coffee b/src/General/Index.coffee index a3f54c8e5..d0925bbaa 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -63,8 +63,8 @@ Index = type: 'header' el: $.el 'span', textContent: 'Index Navigation' - order: 90 - subEntries: [modeEntry, sortEntry, repliesEntry, anchorEntry, refNavEntry] + order: 98 + subEntries: [repliesEntry, anchorEntry, refNavEntry, modeEntry, sortEntry] $.addClass doc, 'index-loading' @update() @@ -203,7 +203,6 @@ Index = Index.req?.abort() Index.notice?.close() if d.readyState isnt 'loading' - Index.notice = new Notice 'info', 'Refreshing index...' else # Delay the notice on initial page load # and only display it for slow connections. @@ -211,7 +210,6 @@ Index = $.ready -> setTimeout (-> return unless Index.req and !Index.notice - Index.notice = new Notice 'info', 'Refreshing index...' ), 5 * $.SECOND - (Date.now() - now) pageNum = null if typeof pageNum isnt 'number' # event onload = (e) -> Index.load e, pageNum @@ -248,11 +246,6 @@ Index = new Notice 'error', 'Index refresh failed.', 2 return - if notice - notice.setType 'success' - notice.el.lastElementChild.textContent = 'Index refreshed!' - setTimeout notice.close, $.SECOND - timeEl = $ '#index-last-refresh', Index.navLinks timeEl.dataset.utc = Date.parse req.getResponseHeader 'Last-Modified' RelativeDates.update timeEl