diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 55bc2f9d6..013df69bb 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -2522,7 +2522,7 @@ return $.addClass(Index.button, 'fa-spin'); }, load: function(e, pageNum) { - var err, nTimeout, notice, req, timeEl; + var err, nTimeout, notice, req, timeEl, _ref; $.rmClass(Index.button, 'fa-spin'); req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout; if (nTimeout) { @@ -2536,6 +2536,17 @@ notice.close(); return; } + if ((_ref = req.status) !== 200 && _ref !== 304) { + err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")"; + if (notice) { + notice.setType('warning'); + notice.el.lastElementChild.textContent = err; + setTimeout(notice.close, $.SECOND); + } else { + new Notice('warning', err, 1); + } + return; + } try { if (req.status === 200) { Index.parse(JSON.parse(req.response), pageNum); @@ -2548,9 +2559,9 @@ if (notice) { notice.setType('error'); notice.el.lastElementChild.textContent = 'Index refresh failed.'; - setTimeout(notice.close, 2 * $.SECOND); + setTimeout(notice.close, $.SECOND); } else { - new Notice('error', 'Index refresh failed.', 2); + new Notice('error', 'Index refresh failed.', 1); } return; } @@ -10074,8 +10085,8 @@ } }, { name: "4plebs", - boards: ["hr", "pol", "s4s", "tg", "tv", "x"], - files: ["hr", "pol", "s4s", "tg", "tv", "x"], + boards: ["hr", "o", "pol", "s4s", "tg", "tv", "x"], + files: ["hr", "o", "pol", "s4s", "tg", "tv", "x"], data: { domain: "archive.4plebs.org", http: true, diff --git a/builds/crx/script.js b/builds/crx/script.js index e9b844f44..d976d35c3 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -2532,7 +2532,7 @@ return $.addClass(Index.button, 'fa-spin'); }, load: function(e, pageNum) { - var err, nTimeout, notice, req, timeEl; + var err, nTimeout, notice, req, timeEl, _ref; $.rmClass(Index.button, 'fa-spin'); req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout; if (nTimeout) { @@ -2546,6 +2546,17 @@ notice.close(); return; } + if ((_ref = req.status) !== 200 && _ref !== 304) { + err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")"; + if (notice) { + notice.setType('warning'); + notice.el.lastElementChild.textContent = err; + setTimeout(notice.close, $.SECOND); + } else { + new Notice('warning', err, 1); + } + return; + } try { if (req.status === 200) { Index.parse(JSON.parse(req.response), pageNum); @@ -2558,9 +2569,9 @@ if (notice) { notice.setType('error'); notice.el.lastElementChild.textContent = 'Index refresh failed.'; - setTimeout(notice.close, 2 * $.SECOND); + setTimeout(notice.close, $.SECOND); } else { - new Notice('error', 'Index refresh failed.', 2); + new Notice('error', 'Index refresh failed.', 1); } return; } @@ -10063,8 +10074,8 @@ } }, { name: "4plebs", - boards: ["hr", "pol", "s4s", "tg", "tv", "x"], - files: ["hr", "pol", "s4s", "tg", "tv", "x"], + boards: ["hr", "o", "pol", "s4s", "tg", "tv", "x"], + files: ["hr", "o", "pol", "s4s", "tg", "tv", "x"], data: { domain: "archive.4plebs.org", http: true, diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 10a6ab163..ea2e26d70 100755 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -54,8 +54,8 @@ Redirect = software: "foolfuuka" , name: "4plebs" - boards: ["hr", "pol", "s4s", "tg", "tv", "x"] - files: ["hr", "pol", "s4s", "tg", "tv", "x"] + boards: ["hr", "o", "pol", "s4s", "tg", "tv", "x"] + files: ["hr", "o", "pol", "s4s", "tg", "tv", "x"] data: domain: "archive.4plebs.org" http: true diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 8a4a51da8..9341741f8 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -263,6 +263,16 @@ Index = notice.close() return + if req.status not in [200, 304] + err = "Index refresh failed. Error #{req.statusText} (#{req.status})" + if notice + notice.setType 'warning' + notice.el.lastElementChild.textContent = err + setTimeout notice.close, $.SECOND + else + new Notice 'warning', err, 1 + return + try if req.status is 200 Index.parse JSON.parse(req.response), pageNum @@ -274,9 +284,9 @@ Index = if notice notice.setType 'error' notice.el.lastElementChild.textContent = 'Index refresh failed.' - setTimeout notice.close, 2 * $.SECOND + setTimeout notice.close, $.SECOND else - new Notice 'error', 'Index refresh failed.', 2 + new Notice 'error', 'Index refresh failed.', 1 return timeEl = $ '#index-last-refresh', Index.navLinks