Merge branch 'v3' into json
Conflicts: builds/4chan-X.user.js builds/crx/script.js src/Archive/Redirect.coffee
This commit is contained in:
commit
b3c33bb39b
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user