diff --git a/LICENSE b/LICENSE index 619d7bdb6..4bfe213cb 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.3.0 - 2014-01-10 +* 4chan X - Version 1.3.0 - 2014-01-11 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 602ab9497..051c866e4 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -22,7 +22,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.3.0 - 2014-01-10 +* 4chan X - Version 1.3.0 - 2014-01-11 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -2435,7 +2435,7 @@ return $.addClass(Index.button, 'fa-spin'); }, load: function(e, pageNum) { - var err, notice, req, timeEl; + var err, notice, req, timeEl, _ref; $.rmClass(Index.button, 'fa-spin'); req = Index.req, notice = Index.notice; delete Index.req; @@ -2445,6 +2445,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); @@ -2457,9 +2468,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; } @@ -9850,8 +9861,8 @@ } }, "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 4aa074777..4a489b534 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.3.0 - 2014-01-10 +* 4chan X - Version 1.3.0 - 2014-01-11 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -2445,7 +2445,7 @@ return $.addClass(Index.button, 'fa-spin'); }, load: function(e, pageNum) { - var err, notice, req, timeEl; + var err, notice, req, timeEl, _ref; $.rmClass(Index.button, 'fa-spin'); req = Index.req, notice = Index.notice; delete Index.req; @@ -2455,6 +2455,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); @@ -2467,9 +2478,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; } @@ -9839,8 +9850,8 @@ } }, "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 5ac5b80db..c0fff1af3 100755 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -52,8 +52,8 @@ Redirect = software: "foolfuuka" "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 ab1f36b28..fdf52b5ed 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -222,6 +222,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 @@ -233,9 +243,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