Release 4chan X v1.11.24.0.
This commit is contained in:
parent
711d1914e4
commit
94502f64cb
@ -2,6 +2,13 @@
|
||||
|
||||
Sometimes the changelog has notes (not comprehensive) acknowledging people's work. This does not mean the changes are their fault, only that their code was used. All changes to the script are chosen by and the fault of the maintainer (ccd0).
|
||||
|
||||
### v1.11.24
|
||||
|
||||
**v1.11.24.0** *(2016-01-31)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.24.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.24.0/builds/4chan-X-noupdate.crx "Chromium version")]
|
||||
- Based on v1.11.23.2.
|
||||
- Bug fixes.
|
||||
- `JSON Navigation` option is now `JSON Index` to more accurately reflect what it does.
|
||||
|
||||
### v1.11.23
|
||||
|
||||
**v1.11.23.2** *(2016-01-28)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.23.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.23.2/builds/4chan-X-noupdate.crx "Chromium version")]
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X beta
|
||||
// @version 1.11.23.2
|
||||
// @version 1.11.24.0
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Generated by CoffeeScript
|
||||
// ==UserScript==
|
||||
// @name 4chan X beta
|
||||
// @version 1.11.23.2
|
||||
// @version 1.11.24.0
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
@ -125,7 +125,7 @@
|
||||
Config = {
|
||||
main: {
|
||||
'Miscellaneous': {
|
||||
'JSON Navigation': [true, 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'],
|
||||
'JSON Index': [true, 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'],
|
||||
'Use 4chan X Catalog': [true, 'Link to 4chan X\'s catalog instead of the native 4chan one.', 1],
|
||||
'Index Refresh Notifications': [false, 'Show a notice at the top of the page when the index is refreshed.', 1],
|
||||
'Open Threads in New Tab': [false, 'Make links to threads in the index / 4chan X catalog open in a new tab.'],
|
||||
@ -140,7 +140,7 @@
|
||||
'Time Formatting': [true, 'Localize and format timestamps.'],
|
||||
'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'],
|
||||
'Relative Date Title': [true, 'Show Relative Post Date only when hovering over dates.', 1],
|
||||
'Comment Expansion': [true, 'Expand comments that are too long to display on the index. Not applicable with JSON Navigation.'],
|
||||
'Comment Expansion': [true, 'Expand comments that are too long to display on the index. Not applicable with JSON Index.'],
|
||||
'File Info Formatting': [true, 'Reformat the file information.'],
|
||||
'Thread Expansion': [true, 'Add buttons to expand threads.'],
|
||||
'Index Navigation': [false, 'Add buttons to navigate between threads.'],
|
||||
@ -434,7 +434,7 @@
|
||||
doc = d.documentElement;
|
||||
|
||||
g = {
|
||||
VERSION: '1.11.23.2',
|
||||
VERSION: '1.11.24.0',
|
||||
NAMESPACE: '4chan X.',
|
||||
boards: {}
|
||||
};
|
||||
@ -539,12 +539,12 @@
|
||||
innerHTML: "4chan X was blocked from loading the following URL:<br><span></span><br>[<a href=\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions#why-was-4chan-x-blocked-from-loading-a-url\" target=\"_blank\">More info</a>]"
|
||||
});
|
||||
$('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
|
||||
return new Notice('error', message, 30, function() {
|
||||
return new Notice('warning', message, 30, function() {
|
||||
return delete blockedURLs[url];
|
||||
});
|
||||
};
|
||||
return function(url, options, extra) {
|
||||
var err, form, r, ref, type, upCallbacks, whenModified;
|
||||
var err, event, form, k, len1, r, ref, ref1, type, upCallbacks, whenModified;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
@ -560,13 +560,16 @@
|
||||
} catch (_error) {
|
||||
err = _error;
|
||||
blockedError(url);
|
||||
if (typeof options.onerror === "function") {
|
||||
options.onerror();
|
||||
ref = ['error', 'loadend'];
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
event = ref[k];
|
||||
r["on" + event] = options["on" + event];
|
||||
$.queueTask($.event, event, null, r);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (whenModified) {
|
||||
if (((ref = lastModified[whenModified]) != null ? ref[url] : void 0) != null) {
|
||||
if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
|
||||
r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
|
||||
}
|
||||
$.on(r, 'load', function() {
|
||||
@ -1990,7 +1993,9 @@
|
||||
|
||||
DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
|
||||
var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
|
||||
board = this.data.boards[boardID];
|
||||
if (!(board = this.data.boards[boardID])) {
|
||||
return;
|
||||
}
|
||||
threads = {};
|
||||
if (response1) {
|
||||
for (k = 0, len1 = response1.length; k < len1; k++) {
|
||||
@ -3267,7 +3272,7 @@
|
||||
changed: {},
|
||||
init: function() {
|
||||
var anchorEntry, input, k, label, len1, len2, name, pinEntry, q, ref, ref1, ref2, ref3, ref4, ref5, refNavEntry, repliesEntry, select;
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation'] || g.VIEW !== 'index') {
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Index'] || g.VIEW !== 'index') {
|
||||
return;
|
||||
}
|
||||
CatalogThread.callbacks.push({
|
||||
@ -3448,7 +3453,7 @@
|
||||
})(),
|
||||
menu: {
|
||||
init: function() {
|
||||
if (g.VIEW !== 'index' || !Conf['JSON Navigation'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
|
||||
if (g.VIEW !== 'index' || !Conf['JSON Index'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
|
||||
return;
|
||||
}
|
||||
return Menu.menu.addEntry({
|
||||
@ -3613,7 +3618,7 @@
|
||||
}
|
||||
},
|
||||
scrollToIndex: function() {
|
||||
return Header.scrollToIfNeeded(Index.navLinks);
|
||||
return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root));
|
||||
},
|
||||
getCurrentPage: function() {
|
||||
return +window.location.pathname.split(/\/+/)[2] || 1;
|
||||
@ -3829,6 +3834,7 @@
|
||||
return;
|
||||
}
|
||||
Index.req = $.ajax("//a.4cdn.org/" + g.BOARD + "/catalog.json", {
|
||||
onabort: Index.load,
|
||||
onloadend: Index.load
|
||||
}, {
|
||||
whenModified: 'Index'
|
||||
@ -3847,7 +3853,9 @@
|
||||
delete Index.notice;
|
||||
if (e.type === 'abort') {
|
||||
req.onloadend = null;
|
||||
notice.close();
|
||||
if (notice != null) {
|
||||
notice.close();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((ref = req.status) !== 200 && ref !== 304) {
|
||||
@ -3902,8 +3910,9 @@
|
||||
return Index.pageLoad();
|
||||
},
|
||||
parseThreadList: function(pages) {
|
||||
var ref;
|
||||
Index.pagesNum = pages.length;
|
||||
Index.threadsNumPerPage = pages[0].threads.length;
|
||||
Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1;
|
||||
Index.liveThreadData = pages.reduce((function(arr, next) {
|
||||
return arr.concat(next.threads);
|
||||
}), []);
|
||||
@ -3911,8 +3920,8 @@
|
||||
return data.no;
|
||||
});
|
||||
g.BOARD.threads.forEach(function(thread) {
|
||||
var ref;
|
||||
if (ref = thread.ID, indexOf.call(Index.liveThreadIDs, ref) < 0) {
|
||||
var ref1;
|
||||
if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) < 0) {
|
||||
return thread.collect();
|
||||
}
|
||||
});
|
||||
@ -4039,34 +4048,41 @@
|
||||
sort: function() {
|
||||
var k, len1, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
|
||||
liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
|
||||
sortedThreadIDs = {
|
||||
lastreply: slice.call(liveThreadData).sort(function(a, b) {
|
||||
var num;
|
||||
if ((num = a.last_replies)) {
|
||||
a = num[num.length - 1];
|
||||
}
|
||||
if ((num = b.last_replies)) {
|
||||
b = num[num.length - 1];
|
||||
}
|
||||
return b.no - a.no;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
}),
|
||||
bump: liveThreadIDs,
|
||||
birth: slice.call(liveThreadIDs).sort(function(a, b) {
|
||||
return b - a;
|
||||
}),
|
||||
replycount: slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.replies - a.replies;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
}),
|
||||
filecount: slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.images - a.images;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
})
|
||||
}[Conf['Index Sort']];
|
||||
sortedThreadIDs = (function() {
|
||||
switch (Conf['Index Sort']) {
|
||||
case 'lastreply':
|
||||
return slice.call(liveThreadData).sort(function(a, b) {
|
||||
var num;
|
||||
if ((num = a.last_replies)) {
|
||||
a = num[num.length - 1];
|
||||
}
|
||||
if ((num = b.last_replies)) {
|
||||
b = num[num.length - 1];
|
||||
}
|
||||
return b.no - a.no;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
});
|
||||
case 'bump':
|
||||
return liveThreadIDs;
|
||||
case 'birth':
|
||||
return slice.call(liveThreadIDs).sort(function(a, b) {
|
||||
return b - a;
|
||||
});
|
||||
case 'replycount':
|
||||
return slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.replies - a.replies;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
});
|
||||
case 'filecount':
|
||||
return slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.images - a.images;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
});
|
||||
}
|
||||
})();
|
||||
Index.sortedNodes = sortedNodes = [];
|
||||
nodes = Index.nodes;
|
||||
for (k = 0, len1 = sortedThreadIDs.length; k < len1; k++) {
|
||||
@ -4321,10 +4337,9 @@
|
||||
}
|
||||
return o;
|
||||
},
|
||||
parseComment: function(o) {
|
||||
var html;
|
||||
html = o.info.commentHTML.innerHTML.replace(/<br\b[^<]*>/gi, '\n').replace(/\n\n<span\b[^<]* class="abbr"[^]*$/i, '').replace(/^<b\b[^<]*>Rolled [^<]*<\/b>/i, '').replace(/<span\b[^<]* class="fortune"[^]*$/i, '').replace(/<[^>]*>/g, '');
|
||||
return o.info.comment = Build.unescape(html);
|
||||
parseComment: function(html) {
|
||||
html = html.replace(/<br\b[^<]*>/gi, '\n').replace(/\n\n<span\b[^<]* class="abbr"[^]*$/i, '').replace(/^<b\b[^<]*>Rolled [^<]*<\/b>/i, '').replace(/<span\b[^<]* class="fortune"[^]*$/i, '').replace(/<[^>]*>/g, '');
|
||||
return Build.unescape(html);
|
||||
},
|
||||
postFromObject: function(data, boardID, suppressThumb) {
|
||||
var o;
|
||||
@ -5413,8 +5428,8 @@
|
||||
return post.info.subject;
|
||||
},
|
||||
comment: function(post) {
|
||||
var ref;
|
||||
return (ref = post.info.comment) != null ? ref : Build.parseComment(post);
|
||||
var base1;
|
||||
return (base1 = post.info).comment != null ? base1.comment : base1.comment = Build.parseComment(post.info.commentHTML.innerHTML);
|
||||
},
|
||||
flag: function(post) {
|
||||
return post.info.flag;
|
||||
@ -5877,7 +5892,7 @@
|
||||
ThreadHiding = {
|
||||
init: function() {
|
||||
var ref;
|
||||
if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) {
|
||||
if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) {
|
||||
return;
|
||||
}
|
||||
this.db = new DataBoard('hiddenThreads');
|
||||
@ -5989,7 +6004,7 @@
|
||||
open: function(arg) {
|
||||
var isReply, thread;
|
||||
thread = arg.thread, isReply = arg.isReply;
|
||||
if (isReply || thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
|
||||
if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
|
||||
return false;
|
||||
}
|
||||
ThreadHiding.menu.thread = thread;
|
||||
@ -6015,7 +6030,7 @@
|
||||
open: function(arg) {
|
||||
var isReply, thread;
|
||||
thread = arg.thread, isReply = arg.isReply;
|
||||
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
|
||||
if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
|
||||
return false;
|
||||
}
|
||||
ThreadHiding.menu.thread = thread;
|
||||
@ -6033,7 +6048,7 @@
|
||||
open: function(arg) {
|
||||
var isReply, thread;
|
||||
thread = arg.thread, isReply = arg.isReply;
|
||||
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
|
||||
if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
|
||||
return false;
|
||||
}
|
||||
return ThreadHiding.menu.thread = thread;
|
||||
@ -6133,7 +6148,7 @@
|
||||
}
|
||||
threadRoot = thread.OP.nodes.root.parentNode;
|
||||
thread.isHidden = true;
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
Index.updateHideLabel();
|
||||
}
|
||||
if (!makeStub) {
|
||||
@ -6149,7 +6164,7 @@
|
||||
}
|
||||
threadRoot = thread.OP.nodes.root.parentNode;
|
||||
threadRoot.hidden = thread.isHidden = false;
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
return Index.updateHideLabel();
|
||||
}
|
||||
}
|
||||
@ -6176,7 +6191,7 @@
|
||||
if (this.isClone || !this.quotes.length || this.isRebuilt) {
|
||||
return;
|
||||
}
|
||||
markYours = Conf['Mark Quotes of You'] && ((ref = QR.db) != null ? ref.get({
|
||||
markYours = Conf['Mark Quotes of You'] && ((ref = QuoteYou.db) != null ? ref.get({
|
||||
boardID: this.board.ID,
|
||||
threadID: this.thread.ID,
|
||||
postID: this.ID
|
||||
@ -6745,9 +6760,26 @@
|
||||
QuoteYou = {
|
||||
init: function() {
|
||||
var ref;
|
||||
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Remember Your Posts'] && Conf['Quick Reply'])) {
|
||||
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Remember Your Posts'])) {
|
||||
return;
|
||||
}
|
||||
this.db = new DataBoard('yourPosts');
|
||||
$.sync('Remember Your Posts', function(enabled) {
|
||||
return Conf['Remember Your Posts'] = enabled;
|
||||
});
|
||||
$.on(d, 'QRPostSuccessful', function(e) {
|
||||
var boardID, postID, ref1, threadID;
|
||||
$.forceSync('Remember Your Posts');
|
||||
if (Conf['Remember Your Posts']) {
|
||||
ref1 = e.detail, boardID = ref1.boardID, threadID = ref1.threadID, postID = ref1.postID;
|
||||
return QuoteYou.db.set({
|
||||
boardID: boardID,
|
||||
threadID: threadID,
|
||||
postID: postID,
|
||||
val: true
|
||||
});
|
||||
}
|
||||
});
|
||||
if (Conf['Highlight Own Posts']) {
|
||||
$.addClass(doc, 'highlight-own');
|
||||
}
|
||||
@ -6768,7 +6800,7 @@
|
||||
if (this.isClone) {
|
||||
return;
|
||||
}
|
||||
if (QR.db.get({
|
||||
if (QuoteYou.db.get({
|
||||
boardID: this.board.ID,
|
||||
threadID: this.thread.ID,
|
||||
postID: this.ID
|
||||
@ -6781,7 +6813,7 @@
|
||||
ref = this.nodes.quotelinks;
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
quotelink = ref[k];
|
||||
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
|
||||
if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) {
|
||||
continue;
|
||||
}
|
||||
if (Conf['Mark Quotes of You']) {
|
||||
@ -6969,12 +7001,6 @@
|
||||
if (!Conf['Quick Reply']) {
|
||||
return;
|
||||
}
|
||||
if (Conf['Remember Your Posts']) {
|
||||
$.sync('Remember Your Posts', function(enabled) {
|
||||
return Conf['Remember Your Posts'] = enabled;
|
||||
});
|
||||
this.db = new DataBoard('yourPosts');
|
||||
}
|
||||
this.posts = [];
|
||||
if (g.VIEW === 'archive') {
|
||||
return;
|
||||
@ -7436,7 +7462,7 @@
|
||||
}
|
||||
QR.nodes.fileButton.focus();
|
||||
return CrossOrigin.file(url, function(blob) {
|
||||
if (blob) {
|
||||
if (blob && !/^text\//.test(blob.type)) {
|
||||
return QR.handleFiles([blob]);
|
||||
} else {
|
||||
return QR.error("Can't load file.");
|
||||
@ -7803,7 +7829,7 @@
|
||||
return QR.status();
|
||||
},
|
||||
response: function() {
|
||||
var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, ref3, req, resDoc, seconds, threadID;
|
||||
var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, req, resDoc, seconds, threadID;
|
||||
req = QR.req;
|
||||
delete QR.req;
|
||||
post = QR.posts[0];
|
||||
@ -7863,17 +7889,6 @@
|
||||
postID = +postID;
|
||||
threadID = +threadID || postID;
|
||||
isReply = threadID !== postID;
|
||||
$.forceSync('Remember Your Posts');
|
||||
if (Conf['Remember Your Posts']) {
|
||||
if ((ref3 = QR.db) != null) {
|
||||
ref3.set({
|
||||
boardID: g.BOARD.ID,
|
||||
threadID: threadID,
|
||||
postID: postID,
|
||||
val: true
|
||||
});
|
||||
}
|
||||
}
|
||||
$.event('QRPostSuccessful', {
|
||||
boardID: g.BOARD.ID,
|
||||
threadID: threadID,
|
||||
@ -7887,10 +7902,10 @@
|
||||
postsCount = QR.posts.length - 1;
|
||||
QR.cooldown.auto = postsCount && isReply;
|
||||
lastPostToThread = !((function() {
|
||||
var k, len1, p, ref4;
|
||||
ref4 = QR.posts.slice(1);
|
||||
for (k = 0, len1 = ref4.length; k < len1; k++) {
|
||||
p = ref4[k];
|
||||
var k, len1, p, ref3;
|
||||
ref3 = QR.posts.slice(1);
|
||||
for (k = 0, len1 = ref3.length; k < len1; k++) {
|
||||
p = ref3[k];
|
||||
if (p.thread === post.thread) {
|
||||
return true;
|
||||
}
|
||||
@ -8143,6 +8158,15 @@
|
||||
if (!(d.cookie.indexOf('pass_enabled=1') < 0)) {
|
||||
return;
|
||||
}
|
||||
if (location.hostname === 'sys.4chan.org' && /[?&]altc\b/.test(location.search) && Main.jsEnabled) {
|
||||
$.onExists(doc, 'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', function() {
|
||||
$.global(function() {
|
||||
return window.el.onload = null;
|
||||
});
|
||||
return Captcha.v1.create();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (((Conf['Use Recaptcha v1'] && location.hostname === 'boards.4chan.org') || (Conf['Use Recaptcha v1 in Reports'] && location.hostname === 'sys.4chan.org')) && Main.jsEnabled) {
|
||||
$.ready(Captcha.replace.v1);
|
||||
return;
|
||||
@ -8306,7 +8330,55 @@
|
||||
}
|
||||
},
|
||||
create: function() {
|
||||
return $.globalEval('(function() {\n var container = document.getElementById("captchaContainerAlt");\n if (container.firstChild) return;\n var options = {\n theme: "clean",\n tabindex: {"boards.4chan.org": 5, "sys.4chan.org": 3}[location.hostname]\n };\n if (window.Recaptcha) {\n window.Recaptcha.create("6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", container, options);\n } else {\n var script = document.head.querySelector(\'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]\');\n script.addEventListener(\'load\', function() {\n window.Recaptcha.create("6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", container, options);\n }, false);\n }\n})();');
|
||||
var cont, lang;
|
||||
cont = $.id('captchaContainerAlt');
|
||||
if (this.occupied) {
|
||||
return;
|
||||
}
|
||||
this.occupied = true;
|
||||
if ((lang = Conf['captchaLanguage'].trim())) {
|
||||
cont.dataset.lang = lang;
|
||||
}
|
||||
$.onExists(cont, '#recaptcha_image', function(image) {
|
||||
return $.on(image, 'click', function() {
|
||||
if ($.id('recaptcha_challenge_image')) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
$.onExists(cont, '#recaptcha_response_field', function(field) {
|
||||
$.on(field, 'keydown', function(e) {
|
||||
if (e.keyCode === 8 && !field.value) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
if (location.hostname === 'sys.4chan.org') {
|
||||
return field.focus();
|
||||
}
|
||||
});
|
||||
return $.global(function() {
|
||||
var container, options, script;
|
||||
container = document.getElementById('captchaContainerAlt');
|
||||
options = {
|
||||
theme: 'clean',
|
||||
tabindex: {
|
||||
"boards.4chan.org": 5
|
||||
}[location.hostname],
|
||||
lang: container.dataset.lang
|
||||
};
|
||||
if (window.Recaptcha) {
|
||||
return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
|
||||
} else {
|
||||
script = document.head.querySelector('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]');
|
||||
return script.addEventListener('load', function() {
|
||||
return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
|
||||
}, false);
|
||||
}
|
||||
});
|
||||
},
|
||||
cb: {
|
||||
focus: function() {
|
||||
@ -8359,7 +8431,11 @@
|
||||
return QR.captcha.lifetime = e.detail;
|
||||
};
|
||||
$.on(window, 'captcha:timeout', setLifetime);
|
||||
$.globalEval('window.dispatchEvent(new CustomEvent("captcha:timeout", {detail: RecaptchaState.timeout}))');
|
||||
$.global(function() {
|
||||
return window.dispatchEvent(new CustomEvent('captcha:timeout', {
|
||||
detail: window.RecaptchaState.timeout
|
||||
}));
|
||||
});
|
||||
$.off(window, 'captcha:timeout', setLifetime);
|
||||
ref = QR.captcha.nodes, img = ref.img, input = ref.input;
|
||||
img.parentNode.hidden = false;
|
||||
@ -8382,7 +8458,10 @@
|
||||
if (!this.script) {
|
||||
return;
|
||||
}
|
||||
$.globalEval('window.Recaptcha.destroy();');
|
||||
$.global(function() {
|
||||
return window.Recaptcha.destroy();
|
||||
});
|
||||
delete this.occupied;
|
||||
if (this.nodes) {
|
||||
return this.beforeSetup();
|
||||
}
|
||||
@ -8502,7 +8581,14 @@
|
||||
}
|
||||
},
|
||||
reload: function(focus) {
|
||||
$.globalEval('if (window.Recaptcha.type === "image") {\n window.Recaptcha.reload();\n} else {\n window.Recaptcha.switch_type("image");\n}\nwindow.Recaptcha.should_focus = false;');
|
||||
$.global(function() {
|
||||
if (window.Recaptcha.type === 'image') {
|
||||
window.Recaptcha.reload();
|
||||
} else {
|
||||
window.Recaptcha.switch_type('image');
|
||||
}
|
||||
return window.Recaptcha.should_focus = false;
|
||||
});
|
||||
if (focus) {
|
||||
return this.nodes.input.focus();
|
||||
}
|
||||
@ -8707,6 +8793,9 @@
|
||||
}
|
||||
},
|
||||
setupIFrame: function(iframe) {
|
||||
if (!doc.contains(iframe)) {
|
||||
return;
|
||||
}
|
||||
Captcha.replace.iframe(iframe);
|
||||
$.addClass(QR.nodes.el, 'captcha-open');
|
||||
this.fixQRPosition();
|
||||
@ -9583,9 +9672,7 @@
|
||||
QR.status();
|
||||
return this.updateFlashURL();
|
||||
case 'com':
|
||||
this.nodes.span.textContent = this.com;
|
||||
QR.captcha.onPostChange();
|
||||
QR.characterCount();
|
||||
this.updateComment();
|
||||
if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
|
||||
return QR.cooldown.auto = false;
|
||||
}
|
||||
@ -9617,6 +9704,24 @@
|
||||
}
|
||||
};
|
||||
|
||||
_Class.prototype.setComment = function(com) {
|
||||
this.com = com || null;
|
||||
if (this === QR.selected) {
|
||||
QR.nodes.com.value = this.com;
|
||||
}
|
||||
return this.updateComment();
|
||||
};
|
||||
|
||||
_Class.prototype.updateComment = function() {
|
||||
if (this === QR.selected) {
|
||||
QR.characterCount();
|
||||
}
|
||||
this.nodes.span.textContent = this.com;
|
||||
return $.queueTask(function() {
|
||||
return QR.captcha.onPostChange();
|
||||
});
|
||||
};
|
||||
|
||||
_Class.rmErrored = function(e) {
|
||||
var error, errors, k, len1, post, q, ref;
|
||||
e.stopPropagation();
|
||||
@ -9701,7 +9806,9 @@
|
||||
this.filesize = $.bytesToString(this.file.size);
|
||||
this.checkSize();
|
||||
$.addClass(this.nodes.el, 'has-file');
|
||||
QR.captcha.onPostChange();
|
||||
$.queueTask(function() {
|
||||
return QR.captcha.onPostChange();
|
||||
});
|
||||
URL.revokeObjectURL(this.URL);
|
||||
this.saveFilename();
|
||||
if (this === QR.selected) {
|
||||
@ -9883,7 +9990,7 @@
|
||||
};
|
||||
|
||||
_Class.prototype.updateFlashURL = function() {
|
||||
var oldURL, ref, url;
|
||||
var com, oldURL, ref, url;
|
||||
if (g.BOARD.ID !== 'f') {
|
||||
return;
|
||||
}
|
||||
@ -9899,14 +10006,9 @@
|
||||
}
|
||||
oldURL = this.flashURL || '';
|
||||
if (url !== oldURL) {
|
||||
this.com || (this.com = '');
|
||||
if (this.com.slice(0, oldURL.length) === oldURL) {
|
||||
this.com = this.com.slice(oldURL.length);
|
||||
}
|
||||
this.com = (url + this.com) || null;
|
||||
if (this === QR.selected) {
|
||||
QR.nodes.com.value = this.com;
|
||||
QR.characterCount();
|
||||
com = this.com || '';
|
||||
if (com.slice(0, oldURL.length) === oldURL) {
|
||||
this.setComment(url + com.slice(oldURL.length));
|
||||
}
|
||||
return this.flashURL = url;
|
||||
}
|
||||
@ -9918,17 +10020,9 @@
|
||||
reader = new FileReader();
|
||||
reader.onload = (function(_this) {
|
||||
return function(e) {
|
||||
var text;
|
||||
text = e.target.result;
|
||||
if (_this.com) {
|
||||
_this.com += "\n" + text;
|
||||
} else {
|
||||
_this.com = text;
|
||||
}
|
||||
if (QR.selected === _this) {
|
||||
QR.nodes.com.value = _this.com;
|
||||
}
|
||||
_this.nodes.span.textContent = _this.com;
|
||||
var result;
|
||||
result = e.target.result;
|
||||
_this.setComment((_this.com ? _this.com + "\n" + result : result));
|
||||
return delete _this.pasting;
|
||||
};
|
||||
})(this);
|
||||
@ -12859,7 +12953,12 @@
|
||||
if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) {
|
||||
a.textContent = 'Report';
|
||||
ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
|
||||
ReportLink.dims = Conf['Use Recaptcha v1 in Reports'] || d.cookie.indexOf('pass_enabled=1') >= 0 ? 'width=350,height=275' : 'width=400,height=550';
|
||||
if ((Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled) || d.cookie.indexOf('pass_enabled=1') >= 0) {
|
||||
ReportLink.url += '&altc=1';
|
||||
ReportLink.dims = 'width=350,height=275';
|
||||
} else {
|
||||
ReportLink.dims = 'width=400,height=550';
|
||||
}
|
||||
} else if (Conf['Archive Report']) {
|
||||
a.textContent = 'Report to archive';
|
||||
ReportLink.url = Redirect.to('report', {
|
||||
@ -13598,7 +13697,7 @@
|
||||
$.addClass(doc, 'toggleable-watcher');
|
||||
}
|
||||
ThreadWatcher.fetchAuto();
|
||||
if (g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
|
||||
if (g.VIEW === 'index' && Conf['JSON Index'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
|
||||
Menu.menu.addEntry({
|
||||
el: $.el('a', {
|
||||
href: 'javascript:;',
|
||||
@ -13849,7 +13948,7 @@
|
||||
var k, len1, ref, thread, threads;
|
||||
ThreadWatcher.db.forceSync();
|
||||
ThreadWatcher.unreaddb.forceSync();
|
||||
if ((ref = QR.db) != null) {
|
||||
if ((ref = QuoteYou.db) != null) {
|
||||
ref.forceSync();
|
||||
}
|
||||
if (!(threads = ThreadWatcher.getAll()).length) {
|
||||
@ -13911,7 +14010,7 @@
|
||||
if (!(postObj.no > lastReadPost)) {
|
||||
continue;
|
||||
}
|
||||
if ((ref1 = QR.db) != null ? ref1.get({
|
||||
if ((ref1 = QuoteYou.db) != null ? ref1.get({
|
||||
boardID: boardID,
|
||||
threadID: threadID,
|
||||
postID: postObj.no
|
||||
@ -13919,13 +14018,13 @@
|
||||
continue;
|
||||
}
|
||||
unread++;
|
||||
if (!(QR.db && postObj.com)) {
|
||||
if (!(QuoteYou.db && postObj.com)) {
|
||||
continue;
|
||||
}
|
||||
quotesYou = false;
|
||||
regexp = /<a [^>]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g;
|
||||
while (match = regexp.exec(postObj.com)) {
|
||||
if (QR.db.get({
|
||||
if (QuoteYou.db.get({
|
||||
boardID: match[1] || boardID,
|
||||
threadID: match[2] || threadID,
|
||||
postID: match[3] || match[2] || threadID
|
||||
@ -14439,7 +14538,7 @@
|
||||
return;
|
||||
}
|
||||
Unread.order.push(this);
|
||||
if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QR.db) != null ? ref.get({
|
||||
if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QuoteYou.db) != null ? ref.get({
|
||||
boardID: this.board.ID,
|
||||
threadID: this.thread.ID,
|
||||
postID: this.ID
|
||||
@ -14455,7 +14554,7 @@
|
||||
ref = post.nodes.quotelinks;
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
quotelink = ref[k];
|
||||
if (!((ref1 = QR.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
|
||||
if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
|
||||
continue;
|
||||
}
|
||||
Unread.postsQuotingYou.add(post.ID);
|
||||
@ -14524,7 +14623,7 @@
|
||||
count++;
|
||||
Unread.posts["delete"](ID);
|
||||
Unread.postsQuotingYou["delete"](ID);
|
||||
if ((ref1 = QR.db) != null ? ref1.get({
|
||||
if ((ref1 = QuoteYou.db) != null ? ref1.get({
|
||||
boardID: data.board.ID,
|
||||
threadID: data.thread.ID,
|
||||
postID: ID
|
||||
@ -15053,7 +15152,7 @@
|
||||
CatalogLinks = {
|
||||
init: function() {
|
||||
var el, input, selector;
|
||||
if ((Conf['External Catalog'] || Conf['JSON Navigation']) && !(Conf['JSON Navigation'] && g.VIEW === 'index')) {
|
||||
if ((Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) {
|
||||
selector = (function() {
|
||||
switch (g.VIEW) {
|
||||
case 'thread':
|
||||
@ -15072,7 +15171,7 @@
|
||||
link = ref[k];
|
||||
switch (link.pathname.replace(/\/+/g, '/')) {
|
||||
case "/" + g.BOARD + "/":
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
link.textContent = 'Index';
|
||||
}
|
||||
link.href = CatalogLinks.index();
|
||||
@ -15080,7 +15179,7 @@
|
||||
case "/" + g.BOARD + "/catalog":
|
||||
link.href = CatalogLinks.catalog();
|
||||
}
|
||||
if (g.VIEW === 'catalog' && Conf['JSON Navigation'] && Conf['Use 4chan X Catalog']) {
|
||||
if (g.VIEW === 'catalog' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
|
||||
catalogLink = link.parentNode.cloneNode(true);
|
||||
catalogLink.firstElementChild.textContent = '4chan X Catalog';
|
||||
catalogLink.firstElementChild.href = CatalogLinks.catalog();
|
||||
@ -15089,7 +15188,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
if (Conf['JSON Navigation'] && Conf['Use 4chan X Catalog']) {
|
||||
if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
|
||||
Post.callbacks.push({
|
||||
name: 'Catalog Link Rewrite',
|
||||
cb: this.node
|
||||
@ -15151,7 +15250,7 @@
|
||||
}
|
||||
if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) {
|
||||
return "http://catalog.neet.tv/" + board + "/";
|
||||
} else if (Conf['JSON Navigation'] && Conf['Use 4chan X Catalog']) {
|
||||
} else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
|
||||
if (g.BOARD.ID === board && g.VIEW === 'index') {
|
||||
return '#catalog';
|
||||
} else {
|
||||
@ -15165,7 +15264,7 @@
|
||||
if (board == null) {
|
||||
board = g.BOARD.ID;
|
||||
}
|
||||
if (Conf['JSON Navigation'] && board !== 'f') {
|
||||
if (Conf['JSON Index'] && board !== 'f') {
|
||||
if (g.BOARD.ID === board && g.VIEW === 'index') {
|
||||
return '#index';
|
||||
} else {
|
||||
@ -15203,7 +15302,7 @@
|
||||
|
||||
ExpandComment = {
|
||||
init: function() {
|
||||
if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Navigation']) {
|
||||
if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) {
|
||||
return;
|
||||
}
|
||||
if (g.BOARD.ID === 'g') {
|
||||
@ -15309,7 +15408,7 @@
|
||||
if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
return $.on(d, 'IndexRefresh', this.onIndexRefresh);
|
||||
} else {
|
||||
return Thread.callbacks.push({
|
||||
@ -15395,7 +15494,7 @@
|
||||
return;
|
||||
}
|
||||
replies = $$('.thread > .replyContainer', threadRoot);
|
||||
if (!Conf['JSON Navigation'] || Conf['Show Replies']) {
|
||||
if (!Conf['JSON Index'] || Conf['Show Replies']) {
|
||||
num = (function() {
|
||||
if (thread.isSticky) {
|
||||
return 1;
|
||||
@ -15823,7 +15922,7 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
|
||||
if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Index'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
|
||||
threadRoot = Nav.getThread();
|
||||
if (op = $('.op', threadRoot)) {
|
||||
thread = Get.postFromNode(op).thread;
|
||||
@ -15927,7 +16026,7 @@
|
||||
ThreadUpdater.update();
|
||||
break;
|
||||
case 'index':
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
Index.update();
|
||||
@ -15973,7 +16072,7 @@
|
||||
FappeTyme.toggle('werk');
|
||||
break;
|
||||
case Conf['Front page']:
|
||||
if (Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
|
||||
if (Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
|
||||
Index.userPageNav(1);
|
||||
} else {
|
||||
window.location = "/" + g.BOARD + "/";
|
||||
@ -15986,7 +16085,7 @@
|
||||
if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
@ -16001,7 +16100,7 @@
|
||||
if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
@ -16016,24 +16115,24 @@
|
||||
if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
searchInput = Conf['JSON Navigation'] ? Index.searchInput : $.id('search-box');
|
||||
searchInput = Conf['JSON Index'] ? Index.searchInput : $.id('search-box');
|
||||
Header.scrollToIfNeeded(searchInput);
|
||||
searchInput.focus();
|
||||
break;
|
||||
case Conf['Paged mode']:
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
|
||||
break;
|
||||
case Conf['Infinite scrolling mode']:
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
|
||||
break;
|
||||
case Conf['All pages mode']:
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
|
||||
@ -16045,7 +16144,7 @@
|
||||
window.location = CatalogLinks.catalog();
|
||||
break;
|
||||
case Conf['Cycle sort type']:
|
||||
if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
Index.cycleSortType();
|
||||
@ -16107,13 +16206,13 @@
|
||||
}
|
||||
break;
|
||||
case Conf['Previous Post Quoting You']:
|
||||
if (!(threadRoot && QR.db)) {
|
||||
if (!(threadRoot && QuoteYou.db)) {
|
||||
return;
|
||||
}
|
||||
QuoteYou.cb.seek('preceding');
|
||||
break;
|
||||
case Conf['Next Post Quoting You']:
|
||||
if (!(threadRoot && QR.db)) {
|
||||
if (!(threadRoot && QuoteYou.db)) {
|
||||
return;
|
||||
}
|
||||
QuoteYou.cb.seek('following');
|
||||
@ -16407,7 +16506,7 @@
|
||||
INTERVAL: $.MINUTE / 2,
|
||||
init: function() {
|
||||
var ref;
|
||||
if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
|
||||
if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Index'] && g.BOARD.ID !== 'f') {
|
||||
this.flush();
|
||||
$.on(d, 'visibilitychange ThreadUpdate', this.flush);
|
||||
}
|
||||
@ -16541,7 +16640,8 @@
|
||||
};
|
||||
|
||||
Report = {
|
||||
css: ":root:not(.js-enabled) #captchaContainerAlt {\n" +
|
||||
css: ":root:not(.js-enabled) #g-recaptcha,\n" +
|
||||
":root:not(.js-enabled) #captchaContainerAlt {\n" +
|
||||
" height: auto;\n" +
|
||||
"}\n" +
|
||||
"#captchaContainerAlt td:nth-child(2) {\n" +
|
||||
@ -16580,7 +16680,7 @@
|
||||
]);
|
||||
}
|
||||
if (!Conf['Use Recaptcha v1 in Reports'] && !Conf['Force Noscript Captcha'] && Main.jsEnabled) {
|
||||
new MutationObserver(function() {
|
||||
return new MutationObserver(function() {
|
||||
Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
|
||||
return Report.fit('body');
|
||||
}).observe(d.body, {
|
||||
@ -16589,27 +16689,7 @@
|
||||
subtree: true
|
||||
});
|
||||
} else {
|
||||
Report.fit('body');
|
||||
}
|
||||
if (Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled && d.cookie.indexOf('pass_enabled=1') < 0) {
|
||||
$.onExists(d.body, '#recaptcha_image', function(image) {
|
||||
return $.on(image, 'click', function() {
|
||||
if ($.id('recaptcha_challenge_image')) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return $.onExists(d.body, '#recaptcha_response_field', function(field) {
|
||||
return $.on(field, 'keydown', function(e) {
|
||||
if (e.keyCode === 8 && !field.value) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return Report.fit('body');
|
||||
}
|
||||
},
|
||||
fit: function(selector) {
|
||||
@ -17035,7 +17115,6 @@
|
||||
},
|
||||
"export": function() {
|
||||
return $.get(Conf, function(Conf) {
|
||||
delete Conf['archives'];
|
||||
return Settings.downloadExport({
|
||||
version: g.VERSION,
|
||||
date: Date.now(),
|
||||
@ -17302,6 +17381,11 @@
|
||||
set('Use Recaptcha v1 in Reports', true);
|
||||
}
|
||||
}
|
||||
if (compareString < '00001.00011.00024.00000') {
|
||||
if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) {
|
||||
set('JSON Index', data['JSON Navigation']);
|
||||
}
|
||||
}
|
||||
return changes;
|
||||
},
|
||||
loadSettings: function(data, cb) {
|
||||
@ -17702,6 +17786,7 @@
|
||||
Conf['selectedArchives'] = {};
|
||||
Conf['cooldowns'] = {};
|
||||
Conf['Except Archives from Encryption'] = false;
|
||||
Conf['JSON Navigation'] = true;
|
||||
items = {};
|
||||
for (key in Conf) {
|
||||
items[key] = void 0;
|
||||
@ -17885,6 +17970,7 @@
|
||||
setStyle = function() {
|
||||
var k, len1, styleSheet;
|
||||
$.rmClass(doc, style);
|
||||
style = null;
|
||||
for (k = 0, len1 = styleSheets.length; k < len1; k++) {
|
||||
styleSheet = styleSheets[k];
|
||||
if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) {
|
||||
@ -17892,7 +17978,9 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $.addClass(doc, style);
|
||||
if (style) {
|
||||
return $.addClass(doc, style);
|
||||
}
|
||||
};
|
||||
setStyle();
|
||||
if (!mainStyleSheet) {
|
||||
@ -17929,7 +18017,7 @@
|
||||
});
|
||||
new Notice('warning', msg);
|
||||
}
|
||||
if (!(Conf['JSON Navigation'] && g.VIEW === 'index')) {
|
||||
if (!(Conf['JSON Index'] && g.VIEW === 'index')) {
|
||||
return Main.initThread();
|
||||
} else {
|
||||
Main.expectInitFinished = true;
|
||||
@ -18744,6 +18832,7 @@
|
||||
".dialog {\n" +
|
||||
" border: 1px solid;\n" +
|
||||
" display: block;\n" +
|
||||
" background-color: inherit;\n" +
|
||||
"}\n" +
|
||||
".dialog:not(#qr):not(#thread-watcher):not(#header-bar) {\n" +
|
||||
" box-shadow: 0 1px 2px rgba(0, 0, 0, .15);\n" +
|
||||
|
||||
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
// Generated by CoffeeScript
|
||||
// ==UserScript==
|
||||
// @name 4chan X
|
||||
// @version 1.11.23.2
|
||||
// @version 1.11.24.0
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
@ -125,7 +125,7 @@
|
||||
Config = {
|
||||
main: {
|
||||
'Miscellaneous': {
|
||||
'JSON Navigation': [true, 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'],
|
||||
'JSON Index': [true, 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'],
|
||||
'Use 4chan X Catalog': [true, 'Link to 4chan X\'s catalog instead of the native 4chan one.', 1],
|
||||
'Index Refresh Notifications': [false, 'Show a notice at the top of the page when the index is refreshed.', 1],
|
||||
'Open Threads in New Tab': [false, 'Make links to threads in the index / 4chan X catalog open in a new tab.'],
|
||||
@ -140,7 +140,7 @@
|
||||
'Time Formatting': [true, 'Localize and format timestamps.'],
|
||||
'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'],
|
||||
'Relative Date Title': [true, 'Show Relative Post Date only when hovering over dates.', 1],
|
||||
'Comment Expansion': [true, 'Expand comments that are too long to display on the index. Not applicable with JSON Navigation.'],
|
||||
'Comment Expansion': [true, 'Expand comments that are too long to display on the index. Not applicable with JSON Index.'],
|
||||
'File Info Formatting': [true, 'Reformat the file information.'],
|
||||
'Thread Expansion': [true, 'Add buttons to expand threads.'],
|
||||
'Index Navigation': [false, 'Add buttons to navigate between threads.'],
|
||||
@ -434,7 +434,7 @@
|
||||
doc = d.documentElement;
|
||||
|
||||
g = {
|
||||
VERSION: '1.11.23.2',
|
||||
VERSION: '1.11.24.0',
|
||||
NAMESPACE: '4chan X.',
|
||||
boards: {}
|
||||
};
|
||||
@ -539,12 +539,12 @@
|
||||
innerHTML: "4chan X was blocked from loading the following URL:<br><span></span><br>[<a href=\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions#why-was-4chan-x-blocked-from-loading-a-url\" target=\"_blank\">More info</a>]"
|
||||
});
|
||||
$('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
|
||||
return new Notice('error', message, 30, function() {
|
||||
return new Notice('warning', message, 30, function() {
|
||||
return delete blockedURLs[url];
|
||||
});
|
||||
};
|
||||
return function(url, options, extra) {
|
||||
var err, form, r, ref, type, upCallbacks, whenModified;
|
||||
var err, event, form, k, len1, r, ref, ref1, type, upCallbacks, whenModified;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
@ -560,13 +560,16 @@
|
||||
} catch (_error) {
|
||||
err = _error;
|
||||
blockedError(url);
|
||||
if (typeof options.onerror === "function") {
|
||||
options.onerror();
|
||||
ref = ['error', 'loadend'];
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
event = ref[k];
|
||||
r["on" + event] = options["on" + event];
|
||||
$.queueTask($.event, event, null, r);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (whenModified) {
|
||||
if (((ref = lastModified[whenModified]) != null ? ref[url] : void 0) != null) {
|
||||
if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
|
||||
r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
|
||||
}
|
||||
$.on(r, 'load', function() {
|
||||
@ -1990,7 +1993,9 @@
|
||||
|
||||
DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
|
||||
var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
|
||||
board = this.data.boards[boardID];
|
||||
if (!(board = this.data.boards[boardID])) {
|
||||
return;
|
||||
}
|
||||
threads = {};
|
||||
if (response1) {
|
||||
for (k = 0, len1 = response1.length; k < len1; k++) {
|
||||
@ -3267,7 +3272,7 @@
|
||||
changed: {},
|
||||
init: function() {
|
||||
var anchorEntry, input, k, label, len1, len2, name, pinEntry, q, ref, ref1, ref2, ref3, ref4, ref5, refNavEntry, repliesEntry, select;
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation'] || g.VIEW !== 'index') {
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Index'] || g.VIEW !== 'index') {
|
||||
return;
|
||||
}
|
||||
CatalogThread.callbacks.push({
|
||||
@ -3448,7 +3453,7 @@
|
||||
})(),
|
||||
menu: {
|
||||
init: function() {
|
||||
if (g.VIEW !== 'index' || !Conf['JSON Navigation'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
|
||||
if (g.VIEW !== 'index' || !Conf['JSON Index'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
|
||||
return;
|
||||
}
|
||||
return Menu.menu.addEntry({
|
||||
@ -3613,7 +3618,7 @@
|
||||
}
|
||||
},
|
||||
scrollToIndex: function() {
|
||||
return Header.scrollToIfNeeded(Index.navLinks);
|
||||
return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root));
|
||||
},
|
||||
getCurrentPage: function() {
|
||||
return +window.location.pathname.split(/\/+/)[2] || 1;
|
||||
@ -3829,6 +3834,7 @@
|
||||
return;
|
||||
}
|
||||
Index.req = $.ajax("//a.4cdn.org/" + g.BOARD + "/catalog.json", {
|
||||
onabort: Index.load,
|
||||
onloadend: Index.load
|
||||
}, {
|
||||
whenModified: 'Index'
|
||||
@ -3847,7 +3853,9 @@
|
||||
delete Index.notice;
|
||||
if (e.type === 'abort') {
|
||||
req.onloadend = null;
|
||||
notice.close();
|
||||
if (notice != null) {
|
||||
notice.close();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((ref = req.status) !== 200 && ref !== 304) {
|
||||
@ -3902,8 +3910,9 @@
|
||||
return Index.pageLoad();
|
||||
},
|
||||
parseThreadList: function(pages) {
|
||||
var ref;
|
||||
Index.pagesNum = pages.length;
|
||||
Index.threadsNumPerPage = pages[0].threads.length;
|
||||
Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1;
|
||||
Index.liveThreadData = pages.reduce((function(arr, next) {
|
||||
return arr.concat(next.threads);
|
||||
}), []);
|
||||
@ -3911,8 +3920,8 @@
|
||||
return data.no;
|
||||
});
|
||||
g.BOARD.threads.forEach(function(thread) {
|
||||
var ref;
|
||||
if (ref = thread.ID, indexOf.call(Index.liveThreadIDs, ref) < 0) {
|
||||
var ref1;
|
||||
if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) < 0) {
|
||||
return thread.collect();
|
||||
}
|
||||
});
|
||||
@ -4039,34 +4048,41 @@
|
||||
sort: function() {
|
||||
var k, len1, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
|
||||
liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
|
||||
sortedThreadIDs = {
|
||||
lastreply: slice.call(liveThreadData).sort(function(a, b) {
|
||||
var num;
|
||||
if ((num = a.last_replies)) {
|
||||
a = num[num.length - 1];
|
||||
}
|
||||
if ((num = b.last_replies)) {
|
||||
b = num[num.length - 1];
|
||||
}
|
||||
return b.no - a.no;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
}),
|
||||
bump: liveThreadIDs,
|
||||
birth: slice.call(liveThreadIDs).sort(function(a, b) {
|
||||
return b - a;
|
||||
}),
|
||||
replycount: slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.replies - a.replies;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
}),
|
||||
filecount: slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.images - a.images;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
})
|
||||
}[Conf['Index Sort']];
|
||||
sortedThreadIDs = (function() {
|
||||
switch (Conf['Index Sort']) {
|
||||
case 'lastreply':
|
||||
return slice.call(liveThreadData).sort(function(a, b) {
|
||||
var num;
|
||||
if ((num = a.last_replies)) {
|
||||
a = num[num.length - 1];
|
||||
}
|
||||
if ((num = b.last_replies)) {
|
||||
b = num[num.length - 1];
|
||||
}
|
||||
return b.no - a.no;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
});
|
||||
case 'bump':
|
||||
return liveThreadIDs;
|
||||
case 'birth':
|
||||
return slice.call(liveThreadIDs).sort(function(a, b) {
|
||||
return b - a;
|
||||
});
|
||||
case 'replycount':
|
||||
return slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.replies - a.replies;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
});
|
||||
case 'filecount':
|
||||
return slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.images - a.images;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
});
|
||||
}
|
||||
})();
|
||||
Index.sortedNodes = sortedNodes = [];
|
||||
nodes = Index.nodes;
|
||||
for (k = 0, len1 = sortedThreadIDs.length; k < len1; k++) {
|
||||
@ -4321,10 +4337,9 @@
|
||||
}
|
||||
return o;
|
||||
},
|
||||
parseComment: function(o) {
|
||||
var html;
|
||||
html = o.info.commentHTML.innerHTML.replace(/<br\b[^<]*>/gi, '\n').replace(/\n\n<span\b[^<]* class="abbr"[^]*$/i, '').replace(/^<b\b[^<]*>Rolled [^<]*<\/b>/i, '').replace(/<span\b[^<]* class="fortune"[^]*$/i, '').replace(/<[^>]*>/g, '');
|
||||
return o.info.comment = Build.unescape(html);
|
||||
parseComment: function(html) {
|
||||
html = html.replace(/<br\b[^<]*>/gi, '\n').replace(/\n\n<span\b[^<]* class="abbr"[^]*$/i, '').replace(/^<b\b[^<]*>Rolled [^<]*<\/b>/i, '').replace(/<span\b[^<]* class="fortune"[^]*$/i, '').replace(/<[^>]*>/g, '');
|
||||
return Build.unescape(html);
|
||||
},
|
||||
postFromObject: function(data, boardID, suppressThumb) {
|
||||
var o;
|
||||
@ -5413,8 +5428,8 @@
|
||||
return post.info.subject;
|
||||
},
|
||||
comment: function(post) {
|
||||
var ref;
|
||||
return (ref = post.info.comment) != null ? ref : Build.parseComment(post);
|
||||
var base1;
|
||||
return (base1 = post.info).comment != null ? base1.comment : base1.comment = Build.parseComment(post.info.commentHTML.innerHTML);
|
||||
},
|
||||
flag: function(post) {
|
||||
return post.info.flag;
|
||||
@ -5877,7 +5892,7 @@
|
||||
ThreadHiding = {
|
||||
init: function() {
|
||||
var ref;
|
||||
if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) {
|
||||
if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) {
|
||||
return;
|
||||
}
|
||||
this.db = new DataBoard('hiddenThreads');
|
||||
@ -5989,7 +6004,7 @@
|
||||
open: function(arg) {
|
||||
var isReply, thread;
|
||||
thread = arg.thread, isReply = arg.isReply;
|
||||
if (isReply || thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
|
||||
if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
|
||||
return false;
|
||||
}
|
||||
ThreadHiding.menu.thread = thread;
|
||||
@ -6015,7 +6030,7 @@
|
||||
open: function(arg) {
|
||||
var isReply, thread;
|
||||
thread = arg.thread, isReply = arg.isReply;
|
||||
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
|
||||
if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
|
||||
return false;
|
||||
}
|
||||
ThreadHiding.menu.thread = thread;
|
||||
@ -6033,7 +6048,7 @@
|
||||
open: function(arg) {
|
||||
var isReply, thread;
|
||||
thread = arg.thread, isReply = arg.isReply;
|
||||
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
|
||||
if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
|
||||
return false;
|
||||
}
|
||||
return ThreadHiding.menu.thread = thread;
|
||||
@ -6133,7 +6148,7 @@
|
||||
}
|
||||
threadRoot = thread.OP.nodes.root.parentNode;
|
||||
thread.isHidden = true;
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
Index.updateHideLabel();
|
||||
}
|
||||
if (!makeStub) {
|
||||
@ -6149,7 +6164,7 @@
|
||||
}
|
||||
threadRoot = thread.OP.nodes.root.parentNode;
|
||||
threadRoot.hidden = thread.isHidden = false;
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
return Index.updateHideLabel();
|
||||
}
|
||||
}
|
||||
@ -6176,7 +6191,7 @@
|
||||
if (this.isClone || !this.quotes.length || this.isRebuilt) {
|
||||
return;
|
||||
}
|
||||
markYours = Conf['Mark Quotes of You'] && ((ref = QR.db) != null ? ref.get({
|
||||
markYours = Conf['Mark Quotes of You'] && ((ref = QuoteYou.db) != null ? ref.get({
|
||||
boardID: this.board.ID,
|
||||
threadID: this.thread.ID,
|
||||
postID: this.ID
|
||||
@ -6745,9 +6760,26 @@
|
||||
QuoteYou = {
|
||||
init: function() {
|
||||
var ref;
|
||||
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Remember Your Posts'] && Conf['Quick Reply'])) {
|
||||
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Remember Your Posts'])) {
|
||||
return;
|
||||
}
|
||||
this.db = new DataBoard('yourPosts');
|
||||
$.sync('Remember Your Posts', function(enabled) {
|
||||
return Conf['Remember Your Posts'] = enabled;
|
||||
});
|
||||
$.on(d, 'QRPostSuccessful', function(e) {
|
||||
var boardID, postID, ref1, threadID;
|
||||
$.forceSync('Remember Your Posts');
|
||||
if (Conf['Remember Your Posts']) {
|
||||
ref1 = e.detail, boardID = ref1.boardID, threadID = ref1.threadID, postID = ref1.postID;
|
||||
return QuoteYou.db.set({
|
||||
boardID: boardID,
|
||||
threadID: threadID,
|
||||
postID: postID,
|
||||
val: true
|
||||
});
|
||||
}
|
||||
});
|
||||
if (Conf['Highlight Own Posts']) {
|
||||
$.addClass(doc, 'highlight-own');
|
||||
}
|
||||
@ -6768,7 +6800,7 @@
|
||||
if (this.isClone) {
|
||||
return;
|
||||
}
|
||||
if (QR.db.get({
|
||||
if (QuoteYou.db.get({
|
||||
boardID: this.board.ID,
|
||||
threadID: this.thread.ID,
|
||||
postID: this.ID
|
||||
@ -6781,7 +6813,7 @@
|
||||
ref = this.nodes.quotelinks;
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
quotelink = ref[k];
|
||||
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
|
||||
if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) {
|
||||
continue;
|
||||
}
|
||||
if (Conf['Mark Quotes of You']) {
|
||||
@ -6969,12 +7001,6 @@
|
||||
if (!Conf['Quick Reply']) {
|
||||
return;
|
||||
}
|
||||
if (Conf['Remember Your Posts']) {
|
||||
$.sync('Remember Your Posts', function(enabled) {
|
||||
return Conf['Remember Your Posts'] = enabled;
|
||||
});
|
||||
this.db = new DataBoard('yourPosts');
|
||||
}
|
||||
this.posts = [];
|
||||
if (g.VIEW === 'archive') {
|
||||
return;
|
||||
@ -7436,7 +7462,7 @@
|
||||
}
|
||||
QR.nodes.fileButton.focus();
|
||||
return CrossOrigin.file(url, function(blob) {
|
||||
if (blob) {
|
||||
if (blob && !/^text\//.test(blob.type)) {
|
||||
return QR.handleFiles([blob]);
|
||||
} else {
|
||||
return QR.error("Can't load file.");
|
||||
@ -7803,7 +7829,7 @@
|
||||
return QR.status();
|
||||
},
|
||||
response: function() {
|
||||
var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, ref3, req, resDoc, seconds, threadID;
|
||||
var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, req, resDoc, seconds, threadID;
|
||||
req = QR.req;
|
||||
delete QR.req;
|
||||
post = QR.posts[0];
|
||||
@ -7863,17 +7889,6 @@
|
||||
postID = +postID;
|
||||
threadID = +threadID || postID;
|
||||
isReply = threadID !== postID;
|
||||
$.forceSync('Remember Your Posts');
|
||||
if (Conf['Remember Your Posts']) {
|
||||
if ((ref3 = QR.db) != null) {
|
||||
ref3.set({
|
||||
boardID: g.BOARD.ID,
|
||||
threadID: threadID,
|
||||
postID: postID,
|
||||
val: true
|
||||
});
|
||||
}
|
||||
}
|
||||
$.event('QRPostSuccessful', {
|
||||
boardID: g.BOARD.ID,
|
||||
threadID: threadID,
|
||||
@ -7887,10 +7902,10 @@
|
||||
postsCount = QR.posts.length - 1;
|
||||
QR.cooldown.auto = postsCount && isReply;
|
||||
lastPostToThread = !((function() {
|
||||
var k, len1, p, ref4;
|
||||
ref4 = QR.posts.slice(1);
|
||||
for (k = 0, len1 = ref4.length; k < len1; k++) {
|
||||
p = ref4[k];
|
||||
var k, len1, p, ref3;
|
||||
ref3 = QR.posts.slice(1);
|
||||
for (k = 0, len1 = ref3.length; k < len1; k++) {
|
||||
p = ref3[k];
|
||||
if (p.thread === post.thread) {
|
||||
return true;
|
||||
}
|
||||
@ -8143,6 +8158,15 @@
|
||||
if (!(d.cookie.indexOf('pass_enabled=1') < 0)) {
|
||||
return;
|
||||
}
|
||||
if (location.hostname === 'sys.4chan.org' && /[?&]altc\b/.test(location.search) && Main.jsEnabled) {
|
||||
$.onExists(doc, 'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', function() {
|
||||
$.global(function() {
|
||||
return window.el.onload = null;
|
||||
});
|
||||
return Captcha.v1.create();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (((Conf['Use Recaptcha v1'] && location.hostname === 'boards.4chan.org') || (Conf['Use Recaptcha v1 in Reports'] && location.hostname === 'sys.4chan.org')) && Main.jsEnabled) {
|
||||
$.ready(Captcha.replace.v1);
|
||||
return;
|
||||
@ -8306,7 +8330,55 @@
|
||||
}
|
||||
},
|
||||
create: function() {
|
||||
return $.globalEval('(function() {\n var container = document.getElementById("captchaContainerAlt");\n if (container.firstChild) return;\n var options = {\n theme: "clean",\n tabindex: {"boards.4chan.org": 5, "sys.4chan.org": 3}[location.hostname]\n };\n if (window.Recaptcha) {\n window.Recaptcha.create("6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", container, options);\n } else {\n var script = document.head.querySelector(\'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]\');\n script.addEventListener(\'load\', function() {\n window.Recaptcha.create("6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", container, options);\n }, false);\n }\n})();');
|
||||
var cont, lang;
|
||||
cont = $.id('captchaContainerAlt');
|
||||
if (this.occupied) {
|
||||
return;
|
||||
}
|
||||
this.occupied = true;
|
||||
if ((lang = Conf['captchaLanguage'].trim())) {
|
||||
cont.dataset.lang = lang;
|
||||
}
|
||||
$.onExists(cont, '#recaptcha_image', function(image) {
|
||||
return $.on(image, 'click', function() {
|
||||
if ($.id('recaptcha_challenge_image')) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
$.onExists(cont, '#recaptcha_response_field', function(field) {
|
||||
$.on(field, 'keydown', function(e) {
|
||||
if (e.keyCode === 8 && !field.value) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
if (location.hostname === 'sys.4chan.org') {
|
||||
return field.focus();
|
||||
}
|
||||
});
|
||||
return $.global(function() {
|
||||
var container, options, script;
|
||||
container = document.getElementById('captchaContainerAlt');
|
||||
options = {
|
||||
theme: 'clean',
|
||||
tabindex: {
|
||||
"boards.4chan.org": 5
|
||||
}[location.hostname],
|
||||
lang: container.dataset.lang
|
||||
};
|
||||
if (window.Recaptcha) {
|
||||
return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
|
||||
} else {
|
||||
script = document.head.querySelector('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]');
|
||||
return script.addEventListener('load', function() {
|
||||
return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
|
||||
}, false);
|
||||
}
|
||||
});
|
||||
},
|
||||
cb: {
|
||||
focus: function() {
|
||||
@ -8359,7 +8431,11 @@
|
||||
return QR.captcha.lifetime = e.detail;
|
||||
};
|
||||
$.on(window, 'captcha:timeout', setLifetime);
|
||||
$.globalEval('window.dispatchEvent(new CustomEvent("captcha:timeout", {detail: RecaptchaState.timeout}))');
|
||||
$.global(function() {
|
||||
return window.dispatchEvent(new CustomEvent('captcha:timeout', {
|
||||
detail: window.RecaptchaState.timeout
|
||||
}));
|
||||
});
|
||||
$.off(window, 'captcha:timeout', setLifetime);
|
||||
ref = QR.captcha.nodes, img = ref.img, input = ref.input;
|
||||
img.parentNode.hidden = false;
|
||||
@ -8382,7 +8458,10 @@
|
||||
if (!this.script) {
|
||||
return;
|
||||
}
|
||||
$.globalEval('window.Recaptcha.destroy();');
|
||||
$.global(function() {
|
||||
return window.Recaptcha.destroy();
|
||||
});
|
||||
delete this.occupied;
|
||||
if (this.nodes) {
|
||||
return this.beforeSetup();
|
||||
}
|
||||
@ -8502,7 +8581,14 @@
|
||||
}
|
||||
},
|
||||
reload: function(focus) {
|
||||
$.globalEval('if (window.Recaptcha.type === "image") {\n window.Recaptcha.reload();\n} else {\n window.Recaptcha.switch_type("image");\n}\nwindow.Recaptcha.should_focus = false;');
|
||||
$.global(function() {
|
||||
if (window.Recaptcha.type === 'image') {
|
||||
window.Recaptcha.reload();
|
||||
} else {
|
||||
window.Recaptcha.switch_type('image');
|
||||
}
|
||||
return window.Recaptcha.should_focus = false;
|
||||
});
|
||||
if (focus) {
|
||||
return this.nodes.input.focus();
|
||||
}
|
||||
@ -8707,6 +8793,9 @@
|
||||
}
|
||||
},
|
||||
setupIFrame: function(iframe) {
|
||||
if (!doc.contains(iframe)) {
|
||||
return;
|
||||
}
|
||||
Captcha.replace.iframe(iframe);
|
||||
$.addClass(QR.nodes.el, 'captcha-open');
|
||||
this.fixQRPosition();
|
||||
@ -9583,9 +9672,7 @@
|
||||
QR.status();
|
||||
return this.updateFlashURL();
|
||||
case 'com':
|
||||
this.nodes.span.textContent = this.com;
|
||||
QR.captcha.onPostChange();
|
||||
QR.characterCount();
|
||||
this.updateComment();
|
||||
if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
|
||||
return QR.cooldown.auto = false;
|
||||
}
|
||||
@ -9617,6 +9704,24 @@
|
||||
}
|
||||
};
|
||||
|
||||
_Class.prototype.setComment = function(com) {
|
||||
this.com = com || null;
|
||||
if (this === QR.selected) {
|
||||
QR.nodes.com.value = this.com;
|
||||
}
|
||||
return this.updateComment();
|
||||
};
|
||||
|
||||
_Class.prototype.updateComment = function() {
|
||||
if (this === QR.selected) {
|
||||
QR.characterCount();
|
||||
}
|
||||
this.nodes.span.textContent = this.com;
|
||||
return $.queueTask(function() {
|
||||
return QR.captcha.onPostChange();
|
||||
});
|
||||
};
|
||||
|
||||
_Class.rmErrored = function(e) {
|
||||
var error, errors, k, len1, post, q, ref;
|
||||
e.stopPropagation();
|
||||
@ -9701,7 +9806,9 @@
|
||||
this.filesize = $.bytesToString(this.file.size);
|
||||
this.checkSize();
|
||||
$.addClass(this.nodes.el, 'has-file');
|
||||
QR.captcha.onPostChange();
|
||||
$.queueTask(function() {
|
||||
return QR.captcha.onPostChange();
|
||||
});
|
||||
URL.revokeObjectURL(this.URL);
|
||||
this.saveFilename();
|
||||
if (this === QR.selected) {
|
||||
@ -9883,7 +9990,7 @@
|
||||
};
|
||||
|
||||
_Class.prototype.updateFlashURL = function() {
|
||||
var oldURL, ref, url;
|
||||
var com, oldURL, ref, url;
|
||||
if (g.BOARD.ID !== 'f') {
|
||||
return;
|
||||
}
|
||||
@ -9899,14 +10006,9 @@
|
||||
}
|
||||
oldURL = this.flashURL || '';
|
||||
if (url !== oldURL) {
|
||||
this.com || (this.com = '');
|
||||
if (this.com.slice(0, oldURL.length) === oldURL) {
|
||||
this.com = this.com.slice(oldURL.length);
|
||||
}
|
||||
this.com = (url + this.com) || null;
|
||||
if (this === QR.selected) {
|
||||
QR.nodes.com.value = this.com;
|
||||
QR.characterCount();
|
||||
com = this.com || '';
|
||||
if (com.slice(0, oldURL.length) === oldURL) {
|
||||
this.setComment(url + com.slice(oldURL.length));
|
||||
}
|
||||
return this.flashURL = url;
|
||||
}
|
||||
@ -9918,17 +10020,9 @@
|
||||
reader = new FileReader();
|
||||
reader.onload = (function(_this) {
|
||||
return function(e) {
|
||||
var text;
|
||||
text = e.target.result;
|
||||
if (_this.com) {
|
||||
_this.com += "\n" + text;
|
||||
} else {
|
||||
_this.com = text;
|
||||
}
|
||||
if (QR.selected === _this) {
|
||||
QR.nodes.com.value = _this.com;
|
||||
}
|
||||
_this.nodes.span.textContent = _this.com;
|
||||
var result;
|
||||
result = e.target.result;
|
||||
_this.setComment((_this.com ? _this.com + "\n" + result : result));
|
||||
return delete _this.pasting;
|
||||
};
|
||||
})(this);
|
||||
@ -12859,7 +12953,12 @@
|
||||
if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) {
|
||||
a.textContent = 'Report';
|
||||
ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
|
||||
ReportLink.dims = Conf['Use Recaptcha v1 in Reports'] || d.cookie.indexOf('pass_enabled=1') >= 0 ? 'width=350,height=275' : 'width=400,height=550';
|
||||
if ((Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled) || d.cookie.indexOf('pass_enabled=1') >= 0) {
|
||||
ReportLink.url += '&altc=1';
|
||||
ReportLink.dims = 'width=350,height=275';
|
||||
} else {
|
||||
ReportLink.dims = 'width=400,height=550';
|
||||
}
|
||||
} else if (Conf['Archive Report']) {
|
||||
a.textContent = 'Report to archive';
|
||||
ReportLink.url = Redirect.to('report', {
|
||||
@ -13598,7 +13697,7 @@
|
||||
$.addClass(doc, 'toggleable-watcher');
|
||||
}
|
||||
ThreadWatcher.fetchAuto();
|
||||
if (g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
|
||||
if (g.VIEW === 'index' && Conf['JSON Index'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
|
||||
Menu.menu.addEntry({
|
||||
el: $.el('a', {
|
||||
href: 'javascript:;',
|
||||
@ -13849,7 +13948,7 @@
|
||||
var k, len1, ref, thread, threads;
|
||||
ThreadWatcher.db.forceSync();
|
||||
ThreadWatcher.unreaddb.forceSync();
|
||||
if ((ref = QR.db) != null) {
|
||||
if ((ref = QuoteYou.db) != null) {
|
||||
ref.forceSync();
|
||||
}
|
||||
if (!(threads = ThreadWatcher.getAll()).length) {
|
||||
@ -13911,7 +14010,7 @@
|
||||
if (!(postObj.no > lastReadPost)) {
|
||||
continue;
|
||||
}
|
||||
if ((ref1 = QR.db) != null ? ref1.get({
|
||||
if ((ref1 = QuoteYou.db) != null ? ref1.get({
|
||||
boardID: boardID,
|
||||
threadID: threadID,
|
||||
postID: postObj.no
|
||||
@ -13919,13 +14018,13 @@
|
||||
continue;
|
||||
}
|
||||
unread++;
|
||||
if (!(QR.db && postObj.com)) {
|
||||
if (!(QuoteYou.db && postObj.com)) {
|
||||
continue;
|
||||
}
|
||||
quotesYou = false;
|
||||
regexp = /<a [^>]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g;
|
||||
while (match = regexp.exec(postObj.com)) {
|
||||
if (QR.db.get({
|
||||
if (QuoteYou.db.get({
|
||||
boardID: match[1] || boardID,
|
||||
threadID: match[2] || threadID,
|
||||
postID: match[3] || match[2] || threadID
|
||||
@ -14439,7 +14538,7 @@
|
||||
return;
|
||||
}
|
||||
Unread.order.push(this);
|
||||
if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QR.db) != null ? ref.get({
|
||||
if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QuoteYou.db) != null ? ref.get({
|
||||
boardID: this.board.ID,
|
||||
threadID: this.thread.ID,
|
||||
postID: this.ID
|
||||
@ -14455,7 +14554,7 @@
|
||||
ref = post.nodes.quotelinks;
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
quotelink = ref[k];
|
||||
if (!((ref1 = QR.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
|
||||
if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
|
||||
continue;
|
||||
}
|
||||
Unread.postsQuotingYou.add(post.ID);
|
||||
@ -14524,7 +14623,7 @@
|
||||
count++;
|
||||
Unread.posts["delete"](ID);
|
||||
Unread.postsQuotingYou["delete"](ID);
|
||||
if ((ref1 = QR.db) != null ? ref1.get({
|
||||
if ((ref1 = QuoteYou.db) != null ? ref1.get({
|
||||
boardID: data.board.ID,
|
||||
threadID: data.thread.ID,
|
||||
postID: ID
|
||||
@ -15053,7 +15152,7 @@
|
||||
CatalogLinks = {
|
||||
init: function() {
|
||||
var el, input, selector;
|
||||
if ((Conf['External Catalog'] || Conf['JSON Navigation']) && !(Conf['JSON Navigation'] && g.VIEW === 'index')) {
|
||||
if ((Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) {
|
||||
selector = (function() {
|
||||
switch (g.VIEW) {
|
||||
case 'thread':
|
||||
@ -15072,7 +15171,7 @@
|
||||
link = ref[k];
|
||||
switch (link.pathname.replace(/\/+/g, '/')) {
|
||||
case "/" + g.BOARD + "/":
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
link.textContent = 'Index';
|
||||
}
|
||||
link.href = CatalogLinks.index();
|
||||
@ -15080,7 +15179,7 @@
|
||||
case "/" + g.BOARD + "/catalog":
|
||||
link.href = CatalogLinks.catalog();
|
||||
}
|
||||
if (g.VIEW === 'catalog' && Conf['JSON Navigation'] && Conf['Use 4chan X Catalog']) {
|
||||
if (g.VIEW === 'catalog' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
|
||||
catalogLink = link.parentNode.cloneNode(true);
|
||||
catalogLink.firstElementChild.textContent = '4chan X Catalog';
|
||||
catalogLink.firstElementChild.href = CatalogLinks.catalog();
|
||||
@ -15089,7 +15188,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
if (Conf['JSON Navigation'] && Conf['Use 4chan X Catalog']) {
|
||||
if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
|
||||
Post.callbacks.push({
|
||||
name: 'Catalog Link Rewrite',
|
||||
cb: this.node
|
||||
@ -15151,7 +15250,7 @@
|
||||
}
|
||||
if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) {
|
||||
return "http://catalog.neet.tv/" + board + "/";
|
||||
} else if (Conf['JSON Navigation'] && Conf['Use 4chan X Catalog']) {
|
||||
} else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
|
||||
if (g.BOARD.ID === board && g.VIEW === 'index') {
|
||||
return '#catalog';
|
||||
} else {
|
||||
@ -15165,7 +15264,7 @@
|
||||
if (board == null) {
|
||||
board = g.BOARD.ID;
|
||||
}
|
||||
if (Conf['JSON Navigation'] && board !== 'f') {
|
||||
if (Conf['JSON Index'] && board !== 'f') {
|
||||
if (g.BOARD.ID === board && g.VIEW === 'index') {
|
||||
return '#index';
|
||||
} else {
|
||||
@ -15203,7 +15302,7 @@
|
||||
|
||||
ExpandComment = {
|
||||
init: function() {
|
||||
if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Navigation']) {
|
||||
if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) {
|
||||
return;
|
||||
}
|
||||
if (g.BOARD.ID === 'g') {
|
||||
@ -15309,7 +15408,7 @@
|
||||
if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
return $.on(d, 'IndexRefresh', this.onIndexRefresh);
|
||||
} else {
|
||||
return Thread.callbacks.push({
|
||||
@ -15395,7 +15494,7 @@
|
||||
return;
|
||||
}
|
||||
replies = $$('.thread > .replyContainer', threadRoot);
|
||||
if (!Conf['JSON Navigation'] || Conf['Show Replies']) {
|
||||
if (!Conf['JSON Index'] || Conf['Show Replies']) {
|
||||
num = (function() {
|
||||
if (thread.isSticky) {
|
||||
return 1;
|
||||
@ -15823,7 +15922,7 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
|
||||
if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Index'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
|
||||
threadRoot = Nav.getThread();
|
||||
if (op = $('.op', threadRoot)) {
|
||||
thread = Get.postFromNode(op).thread;
|
||||
@ -15927,7 +16026,7 @@
|
||||
ThreadUpdater.update();
|
||||
break;
|
||||
case 'index':
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
Index.update();
|
||||
@ -15973,7 +16072,7 @@
|
||||
FappeTyme.toggle('werk');
|
||||
break;
|
||||
case Conf['Front page']:
|
||||
if (Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
|
||||
if (Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
|
||||
Index.userPageNav(1);
|
||||
} else {
|
||||
window.location = "/" + g.BOARD + "/";
|
||||
@ -15986,7 +16085,7 @@
|
||||
if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
@ -16001,7 +16100,7 @@
|
||||
if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
@ -16016,24 +16115,24 @@
|
||||
if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
searchInput = Conf['JSON Navigation'] ? Index.searchInput : $.id('search-box');
|
||||
searchInput = Conf['JSON Index'] ? Index.searchInput : $.id('search-box');
|
||||
Header.scrollToIfNeeded(searchInput);
|
||||
searchInput.focus();
|
||||
break;
|
||||
case Conf['Paged mode']:
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
|
||||
break;
|
||||
case Conf['Infinite scrolling mode']:
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
|
||||
break;
|
||||
case Conf['All pages mode']:
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
|
||||
@ -16045,7 +16144,7 @@
|
||||
window.location = CatalogLinks.catalog();
|
||||
break;
|
||||
case Conf['Cycle sort type']:
|
||||
if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
Index.cycleSortType();
|
||||
@ -16107,13 +16206,13 @@
|
||||
}
|
||||
break;
|
||||
case Conf['Previous Post Quoting You']:
|
||||
if (!(threadRoot && QR.db)) {
|
||||
if (!(threadRoot && QuoteYou.db)) {
|
||||
return;
|
||||
}
|
||||
QuoteYou.cb.seek('preceding');
|
||||
break;
|
||||
case Conf['Next Post Quoting You']:
|
||||
if (!(threadRoot && QR.db)) {
|
||||
if (!(threadRoot && QuoteYou.db)) {
|
||||
return;
|
||||
}
|
||||
QuoteYou.cb.seek('following');
|
||||
@ -16407,7 +16506,7 @@
|
||||
INTERVAL: $.MINUTE / 2,
|
||||
init: function() {
|
||||
var ref;
|
||||
if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
|
||||
if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Index'] && g.BOARD.ID !== 'f') {
|
||||
this.flush();
|
||||
$.on(d, 'visibilitychange ThreadUpdate', this.flush);
|
||||
}
|
||||
@ -16541,7 +16640,8 @@
|
||||
};
|
||||
|
||||
Report = {
|
||||
css: ":root:not(.js-enabled) #captchaContainerAlt {\n" +
|
||||
css: ":root:not(.js-enabled) #g-recaptcha,\n" +
|
||||
":root:not(.js-enabled) #captchaContainerAlt {\n" +
|
||||
" height: auto;\n" +
|
||||
"}\n" +
|
||||
"#captchaContainerAlt td:nth-child(2) {\n" +
|
||||
@ -16580,7 +16680,7 @@
|
||||
]);
|
||||
}
|
||||
if (!Conf['Use Recaptcha v1 in Reports'] && !Conf['Force Noscript Captcha'] && Main.jsEnabled) {
|
||||
new MutationObserver(function() {
|
||||
return new MutationObserver(function() {
|
||||
Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
|
||||
return Report.fit('body');
|
||||
}).observe(d.body, {
|
||||
@ -16589,27 +16689,7 @@
|
||||
subtree: true
|
||||
});
|
||||
} else {
|
||||
Report.fit('body');
|
||||
}
|
||||
if (Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled && d.cookie.indexOf('pass_enabled=1') < 0) {
|
||||
$.onExists(d.body, '#recaptcha_image', function(image) {
|
||||
return $.on(image, 'click', function() {
|
||||
if ($.id('recaptcha_challenge_image')) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return $.onExists(d.body, '#recaptcha_response_field', function(field) {
|
||||
return $.on(field, 'keydown', function(e) {
|
||||
if (e.keyCode === 8 && !field.value) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return Report.fit('body');
|
||||
}
|
||||
},
|
||||
fit: function(selector) {
|
||||
@ -17035,7 +17115,6 @@
|
||||
},
|
||||
"export": function() {
|
||||
return $.get(Conf, function(Conf) {
|
||||
delete Conf['archives'];
|
||||
return Settings.downloadExport({
|
||||
version: g.VERSION,
|
||||
date: Date.now(),
|
||||
@ -17302,6 +17381,11 @@
|
||||
set('Use Recaptcha v1 in Reports', true);
|
||||
}
|
||||
}
|
||||
if (compareString < '00001.00011.00024.00000') {
|
||||
if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) {
|
||||
set('JSON Index', data['JSON Navigation']);
|
||||
}
|
||||
}
|
||||
return changes;
|
||||
},
|
||||
loadSettings: function(data, cb) {
|
||||
@ -17702,6 +17786,7 @@
|
||||
Conf['selectedArchives'] = {};
|
||||
Conf['cooldowns'] = {};
|
||||
Conf['Except Archives from Encryption'] = false;
|
||||
Conf['JSON Navigation'] = true;
|
||||
items = {};
|
||||
for (key in Conf) {
|
||||
items[key] = void 0;
|
||||
@ -17885,6 +17970,7 @@
|
||||
setStyle = function() {
|
||||
var k, len1, styleSheet;
|
||||
$.rmClass(doc, style);
|
||||
style = null;
|
||||
for (k = 0, len1 = styleSheets.length; k < len1; k++) {
|
||||
styleSheet = styleSheets[k];
|
||||
if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) {
|
||||
@ -17892,7 +17978,9 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $.addClass(doc, style);
|
||||
if (style) {
|
||||
return $.addClass(doc, style);
|
||||
}
|
||||
};
|
||||
setStyle();
|
||||
if (!mainStyleSheet) {
|
||||
@ -17929,7 +18017,7 @@
|
||||
});
|
||||
new Notice('warning', msg);
|
||||
}
|
||||
if (!(Conf['JSON Navigation'] && g.VIEW === 'index')) {
|
||||
if (!(Conf['JSON Index'] && g.VIEW === 'index')) {
|
||||
return Main.initThread();
|
||||
} else {
|
||||
Main.expectInitFinished = true;
|
||||
@ -18744,6 +18832,7 @@
|
||||
".dialog {\n" +
|
||||
" border: 1px solid;\n" +
|
||||
" display: block;\n" +
|
||||
" background-color: inherit;\n" +
|
||||
"}\n" +
|
||||
".dialog:not(#qr):not(#thread-watcher):not(#header-bar) {\n" +
|
||||
" box-shadow: 0 1px 2px rgba(0, 0, 0, .15);\n" +
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X
|
||||
// @version 1.11.23.2
|
||||
// @version 1.11.24.0
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Generated by CoffeeScript
|
||||
// ==UserScript==
|
||||
// @name 4chan X
|
||||
// @version 1.11.23.2
|
||||
// @version 1.11.24.0
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
@ -125,7 +125,7 @@
|
||||
Config = {
|
||||
main: {
|
||||
'Miscellaneous': {
|
||||
'JSON Navigation': [true, 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'],
|
||||
'JSON Index': [true, 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'],
|
||||
'Use 4chan X Catalog': [true, 'Link to 4chan X\'s catalog instead of the native 4chan one.', 1],
|
||||
'Index Refresh Notifications': [false, 'Show a notice at the top of the page when the index is refreshed.', 1],
|
||||
'Open Threads in New Tab': [false, 'Make links to threads in the index / 4chan X catalog open in a new tab.'],
|
||||
@ -140,7 +140,7 @@
|
||||
'Time Formatting': [true, 'Localize and format timestamps.'],
|
||||
'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'],
|
||||
'Relative Date Title': [true, 'Show Relative Post Date only when hovering over dates.', 1],
|
||||
'Comment Expansion': [true, 'Expand comments that are too long to display on the index. Not applicable with JSON Navigation.'],
|
||||
'Comment Expansion': [true, 'Expand comments that are too long to display on the index. Not applicable with JSON Index.'],
|
||||
'File Info Formatting': [true, 'Reformat the file information.'],
|
||||
'Thread Expansion': [true, 'Add buttons to expand threads.'],
|
||||
'Index Navigation': [false, 'Add buttons to navigate between threads.'],
|
||||
@ -434,7 +434,7 @@
|
||||
doc = d.documentElement;
|
||||
|
||||
g = {
|
||||
VERSION: '1.11.23.2',
|
||||
VERSION: '1.11.24.0',
|
||||
NAMESPACE: '4chan X.',
|
||||
boards: {}
|
||||
};
|
||||
@ -539,12 +539,12 @@
|
||||
innerHTML: "4chan X was blocked from loading the following URL:<br><span></span><br>[<a href=\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions#why-was-4chan-x-blocked-from-loading-a-url\" target=\"_blank\">More info</a>]"
|
||||
});
|
||||
$('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
|
||||
return new Notice('error', message, 30, function() {
|
||||
return new Notice('warning', message, 30, function() {
|
||||
return delete blockedURLs[url];
|
||||
});
|
||||
};
|
||||
return function(url, options, extra) {
|
||||
var err, form, r, ref, type, upCallbacks, whenModified;
|
||||
var err, event, form, k, len1, r, ref, ref1, type, upCallbacks, whenModified;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
@ -560,13 +560,16 @@
|
||||
} catch (_error) {
|
||||
err = _error;
|
||||
blockedError(url);
|
||||
if (typeof options.onerror === "function") {
|
||||
options.onerror();
|
||||
ref = ['error', 'loadend'];
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
event = ref[k];
|
||||
r["on" + event] = options["on" + event];
|
||||
$.queueTask($.event, event, null, r);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (whenModified) {
|
||||
if (((ref = lastModified[whenModified]) != null ? ref[url] : void 0) != null) {
|
||||
if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
|
||||
r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
|
||||
}
|
||||
$.on(r, 'load', function() {
|
||||
@ -1990,7 +1993,9 @@
|
||||
|
||||
DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
|
||||
var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
|
||||
board = this.data.boards[boardID];
|
||||
if (!(board = this.data.boards[boardID])) {
|
||||
return;
|
||||
}
|
||||
threads = {};
|
||||
if (response1) {
|
||||
for (k = 0, len1 = response1.length; k < len1; k++) {
|
||||
@ -3267,7 +3272,7 @@
|
||||
changed: {},
|
||||
init: function() {
|
||||
var anchorEntry, input, k, label, len1, len2, name, pinEntry, q, ref, ref1, ref2, ref3, ref4, ref5, refNavEntry, repliesEntry, select;
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation'] || g.VIEW !== 'index') {
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Index'] || g.VIEW !== 'index') {
|
||||
return;
|
||||
}
|
||||
CatalogThread.callbacks.push({
|
||||
@ -3448,7 +3453,7 @@
|
||||
})(),
|
||||
menu: {
|
||||
init: function() {
|
||||
if (g.VIEW !== 'index' || !Conf['JSON Navigation'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
|
||||
if (g.VIEW !== 'index' || !Conf['JSON Index'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
|
||||
return;
|
||||
}
|
||||
return Menu.menu.addEntry({
|
||||
@ -3613,7 +3618,7 @@
|
||||
}
|
||||
},
|
||||
scrollToIndex: function() {
|
||||
return Header.scrollToIfNeeded(Index.navLinks);
|
||||
return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root));
|
||||
},
|
||||
getCurrentPage: function() {
|
||||
return +window.location.pathname.split(/\/+/)[2] || 1;
|
||||
@ -3829,6 +3834,7 @@
|
||||
return;
|
||||
}
|
||||
Index.req = $.ajax("//a.4cdn.org/" + g.BOARD + "/catalog.json", {
|
||||
onabort: Index.load,
|
||||
onloadend: Index.load
|
||||
}, {
|
||||
whenModified: 'Index'
|
||||
@ -3847,7 +3853,9 @@
|
||||
delete Index.notice;
|
||||
if (e.type === 'abort') {
|
||||
req.onloadend = null;
|
||||
notice.close();
|
||||
if (notice != null) {
|
||||
notice.close();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((ref = req.status) !== 200 && ref !== 304) {
|
||||
@ -3902,8 +3910,9 @@
|
||||
return Index.pageLoad();
|
||||
},
|
||||
parseThreadList: function(pages) {
|
||||
var ref;
|
||||
Index.pagesNum = pages.length;
|
||||
Index.threadsNumPerPage = pages[0].threads.length;
|
||||
Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1;
|
||||
Index.liveThreadData = pages.reduce((function(arr, next) {
|
||||
return arr.concat(next.threads);
|
||||
}), []);
|
||||
@ -3911,8 +3920,8 @@
|
||||
return data.no;
|
||||
});
|
||||
g.BOARD.threads.forEach(function(thread) {
|
||||
var ref;
|
||||
if (ref = thread.ID, indexOf.call(Index.liveThreadIDs, ref) < 0) {
|
||||
var ref1;
|
||||
if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) < 0) {
|
||||
return thread.collect();
|
||||
}
|
||||
});
|
||||
@ -4039,34 +4048,41 @@
|
||||
sort: function() {
|
||||
var k, len1, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
|
||||
liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
|
||||
sortedThreadIDs = {
|
||||
lastreply: slice.call(liveThreadData).sort(function(a, b) {
|
||||
var num;
|
||||
if ((num = a.last_replies)) {
|
||||
a = num[num.length - 1];
|
||||
}
|
||||
if ((num = b.last_replies)) {
|
||||
b = num[num.length - 1];
|
||||
}
|
||||
return b.no - a.no;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
}),
|
||||
bump: liveThreadIDs,
|
||||
birth: slice.call(liveThreadIDs).sort(function(a, b) {
|
||||
return b - a;
|
||||
}),
|
||||
replycount: slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.replies - a.replies;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
}),
|
||||
filecount: slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.images - a.images;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
})
|
||||
}[Conf['Index Sort']];
|
||||
sortedThreadIDs = (function() {
|
||||
switch (Conf['Index Sort']) {
|
||||
case 'lastreply':
|
||||
return slice.call(liveThreadData).sort(function(a, b) {
|
||||
var num;
|
||||
if ((num = a.last_replies)) {
|
||||
a = num[num.length - 1];
|
||||
}
|
||||
if ((num = b.last_replies)) {
|
||||
b = num[num.length - 1];
|
||||
}
|
||||
return b.no - a.no;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
});
|
||||
case 'bump':
|
||||
return liveThreadIDs;
|
||||
case 'birth':
|
||||
return slice.call(liveThreadIDs).sort(function(a, b) {
|
||||
return b - a;
|
||||
});
|
||||
case 'replycount':
|
||||
return slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.replies - a.replies;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
});
|
||||
case 'filecount':
|
||||
return slice.call(liveThreadData).sort(function(a, b) {
|
||||
return b.images - a.images;
|
||||
}).map(function(post) {
|
||||
return post.no;
|
||||
});
|
||||
}
|
||||
})();
|
||||
Index.sortedNodes = sortedNodes = [];
|
||||
nodes = Index.nodes;
|
||||
for (k = 0, len1 = sortedThreadIDs.length; k < len1; k++) {
|
||||
@ -4321,10 +4337,9 @@
|
||||
}
|
||||
return o;
|
||||
},
|
||||
parseComment: function(o) {
|
||||
var html;
|
||||
html = o.info.commentHTML.innerHTML.replace(/<br\b[^<]*>/gi, '\n').replace(/\n\n<span\b[^<]* class="abbr"[^]*$/i, '').replace(/^<b\b[^<]*>Rolled [^<]*<\/b>/i, '').replace(/<span\b[^<]* class="fortune"[^]*$/i, '').replace(/<[^>]*>/g, '');
|
||||
return o.info.comment = Build.unescape(html);
|
||||
parseComment: function(html) {
|
||||
html = html.replace(/<br\b[^<]*>/gi, '\n').replace(/\n\n<span\b[^<]* class="abbr"[^]*$/i, '').replace(/^<b\b[^<]*>Rolled [^<]*<\/b>/i, '').replace(/<span\b[^<]* class="fortune"[^]*$/i, '').replace(/<[^>]*>/g, '');
|
||||
return Build.unescape(html);
|
||||
},
|
||||
postFromObject: function(data, boardID, suppressThumb) {
|
||||
var o;
|
||||
@ -5413,8 +5428,8 @@
|
||||
return post.info.subject;
|
||||
},
|
||||
comment: function(post) {
|
||||
var ref;
|
||||
return (ref = post.info.comment) != null ? ref : Build.parseComment(post);
|
||||
var base1;
|
||||
return (base1 = post.info).comment != null ? base1.comment : base1.comment = Build.parseComment(post.info.commentHTML.innerHTML);
|
||||
},
|
||||
flag: function(post) {
|
||||
return post.info.flag;
|
||||
@ -5877,7 +5892,7 @@
|
||||
ThreadHiding = {
|
||||
init: function() {
|
||||
var ref;
|
||||
if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) {
|
||||
if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) {
|
||||
return;
|
||||
}
|
||||
this.db = new DataBoard('hiddenThreads');
|
||||
@ -5989,7 +6004,7 @@
|
||||
open: function(arg) {
|
||||
var isReply, thread;
|
||||
thread = arg.thread, isReply = arg.isReply;
|
||||
if (isReply || thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
|
||||
if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
|
||||
return false;
|
||||
}
|
||||
ThreadHiding.menu.thread = thread;
|
||||
@ -6015,7 +6030,7 @@
|
||||
open: function(arg) {
|
||||
var isReply, thread;
|
||||
thread = arg.thread, isReply = arg.isReply;
|
||||
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
|
||||
if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
|
||||
return false;
|
||||
}
|
||||
ThreadHiding.menu.thread = thread;
|
||||
@ -6033,7 +6048,7 @@
|
||||
open: function(arg) {
|
||||
var isReply, thread;
|
||||
thread = arg.thread, isReply = arg.isReply;
|
||||
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
|
||||
if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
|
||||
return false;
|
||||
}
|
||||
return ThreadHiding.menu.thread = thread;
|
||||
@ -6133,7 +6148,7 @@
|
||||
}
|
||||
threadRoot = thread.OP.nodes.root.parentNode;
|
||||
thread.isHidden = true;
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
Index.updateHideLabel();
|
||||
}
|
||||
if (!makeStub) {
|
||||
@ -6149,7 +6164,7 @@
|
||||
}
|
||||
threadRoot = thread.OP.nodes.root.parentNode;
|
||||
threadRoot.hidden = thread.isHidden = false;
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
return Index.updateHideLabel();
|
||||
}
|
||||
}
|
||||
@ -6176,7 +6191,7 @@
|
||||
if (this.isClone || !this.quotes.length || this.isRebuilt) {
|
||||
return;
|
||||
}
|
||||
markYours = Conf['Mark Quotes of You'] && ((ref = QR.db) != null ? ref.get({
|
||||
markYours = Conf['Mark Quotes of You'] && ((ref = QuoteYou.db) != null ? ref.get({
|
||||
boardID: this.board.ID,
|
||||
threadID: this.thread.ID,
|
||||
postID: this.ID
|
||||
@ -6745,9 +6760,26 @@
|
||||
QuoteYou = {
|
||||
init: function() {
|
||||
var ref;
|
||||
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Remember Your Posts'] && Conf['Quick Reply'])) {
|
||||
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Remember Your Posts'])) {
|
||||
return;
|
||||
}
|
||||
this.db = new DataBoard('yourPosts');
|
||||
$.sync('Remember Your Posts', function(enabled) {
|
||||
return Conf['Remember Your Posts'] = enabled;
|
||||
});
|
||||
$.on(d, 'QRPostSuccessful', function(e) {
|
||||
var boardID, postID, ref1, threadID;
|
||||
$.forceSync('Remember Your Posts');
|
||||
if (Conf['Remember Your Posts']) {
|
||||
ref1 = e.detail, boardID = ref1.boardID, threadID = ref1.threadID, postID = ref1.postID;
|
||||
return QuoteYou.db.set({
|
||||
boardID: boardID,
|
||||
threadID: threadID,
|
||||
postID: postID,
|
||||
val: true
|
||||
});
|
||||
}
|
||||
});
|
||||
if (Conf['Highlight Own Posts']) {
|
||||
$.addClass(doc, 'highlight-own');
|
||||
}
|
||||
@ -6768,7 +6800,7 @@
|
||||
if (this.isClone) {
|
||||
return;
|
||||
}
|
||||
if (QR.db.get({
|
||||
if (QuoteYou.db.get({
|
||||
boardID: this.board.ID,
|
||||
threadID: this.thread.ID,
|
||||
postID: this.ID
|
||||
@ -6781,7 +6813,7 @@
|
||||
ref = this.nodes.quotelinks;
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
quotelink = ref[k];
|
||||
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
|
||||
if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) {
|
||||
continue;
|
||||
}
|
||||
if (Conf['Mark Quotes of You']) {
|
||||
@ -6969,12 +7001,6 @@
|
||||
if (!Conf['Quick Reply']) {
|
||||
return;
|
||||
}
|
||||
if (Conf['Remember Your Posts']) {
|
||||
$.sync('Remember Your Posts', function(enabled) {
|
||||
return Conf['Remember Your Posts'] = enabled;
|
||||
});
|
||||
this.db = new DataBoard('yourPosts');
|
||||
}
|
||||
this.posts = [];
|
||||
if (g.VIEW === 'archive') {
|
||||
return;
|
||||
@ -7436,7 +7462,7 @@
|
||||
}
|
||||
QR.nodes.fileButton.focus();
|
||||
return CrossOrigin.file(url, function(blob) {
|
||||
if (blob) {
|
||||
if (blob && !/^text\//.test(blob.type)) {
|
||||
return QR.handleFiles([blob]);
|
||||
} else {
|
||||
return QR.error("Can't load file.");
|
||||
@ -7803,7 +7829,7 @@
|
||||
return QR.status();
|
||||
},
|
||||
response: function() {
|
||||
var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, ref3, req, resDoc, seconds, threadID;
|
||||
var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, req, resDoc, seconds, threadID;
|
||||
req = QR.req;
|
||||
delete QR.req;
|
||||
post = QR.posts[0];
|
||||
@ -7863,17 +7889,6 @@
|
||||
postID = +postID;
|
||||
threadID = +threadID || postID;
|
||||
isReply = threadID !== postID;
|
||||
$.forceSync('Remember Your Posts');
|
||||
if (Conf['Remember Your Posts']) {
|
||||
if ((ref3 = QR.db) != null) {
|
||||
ref3.set({
|
||||
boardID: g.BOARD.ID,
|
||||
threadID: threadID,
|
||||
postID: postID,
|
||||
val: true
|
||||
});
|
||||
}
|
||||
}
|
||||
$.event('QRPostSuccessful', {
|
||||
boardID: g.BOARD.ID,
|
||||
threadID: threadID,
|
||||
@ -7887,10 +7902,10 @@
|
||||
postsCount = QR.posts.length - 1;
|
||||
QR.cooldown.auto = postsCount && isReply;
|
||||
lastPostToThread = !((function() {
|
||||
var k, len1, p, ref4;
|
||||
ref4 = QR.posts.slice(1);
|
||||
for (k = 0, len1 = ref4.length; k < len1; k++) {
|
||||
p = ref4[k];
|
||||
var k, len1, p, ref3;
|
||||
ref3 = QR.posts.slice(1);
|
||||
for (k = 0, len1 = ref3.length; k < len1; k++) {
|
||||
p = ref3[k];
|
||||
if (p.thread === post.thread) {
|
||||
return true;
|
||||
}
|
||||
@ -8143,6 +8158,15 @@
|
||||
if (!(d.cookie.indexOf('pass_enabled=1') < 0)) {
|
||||
return;
|
||||
}
|
||||
if (location.hostname === 'sys.4chan.org' && /[?&]altc\b/.test(location.search) && Main.jsEnabled) {
|
||||
$.onExists(doc, 'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', function() {
|
||||
$.global(function() {
|
||||
return window.el.onload = null;
|
||||
});
|
||||
return Captcha.v1.create();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (((Conf['Use Recaptcha v1'] && location.hostname === 'boards.4chan.org') || (Conf['Use Recaptcha v1 in Reports'] && location.hostname === 'sys.4chan.org')) && Main.jsEnabled) {
|
||||
$.ready(Captcha.replace.v1);
|
||||
return;
|
||||
@ -8306,7 +8330,55 @@
|
||||
}
|
||||
},
|
||||
create: function() {
|
||||
return $.globalEval('(function() {\n var container = document.getElementById("captchaContainerAlt");\n if (container.firstChild) return;\n var options = {\n theme: "clean",\n tabindex: {"boards.4chan.org": 5, "sys.4chan.org": 3}[location.hostname]\n };\n if (window.Recaptcha) {\n window.Recaptcha.create("6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", container, options);\n } else {\n var script = document.head.querySelector(\'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]\');\n script.addEventListener(\'load\', function() {\n window.Recaptcha.create("6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", container, options);\n }, false);\n }\n})();');
|
||||
var cont, lang;
|
||||
cont = $.id('captchaContainerAlt');
|
||||
if (this.occupied) {
|
||||
return;
|
||||
}
|
||||
this.occupied = true;
|
||||
if ((lang = Conf['captchaLanguage'].trim())) {
|
||||
cont.dataset.lang = lang;
|
||||
}
|
||||
$.onExists(cont, '#recaptcha_image', function(image) {
|
||||
return $.on(image, 'click', function() {
|
||||
if ($.id('recaptcha_challenge_image')) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
$.onExists(cont, '#recaptcha_response_field', function(field) {
|
||||
$.on(field, 'keydown', function(e) {
|
||||
if (e.keyCode === 8 && !field.value) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
if (location.hostname === 'sys.4chan.org') {
|
||||
return field.focus();
|
||||
}
|
||||
});
|
||||
return $.global(function() {
|
||||
var container, options, script;
|
||||
container = document.getElementById('captchaContainerAlt');
|
||||
options = {
|
||||
theme: 'clean',
|
||||
tabindex: {
|
||||
"boards.4chan.org": 5
|
||||
}[location.hostname],
|
||||
lang: container.dataset.lang
|
||||
};
|
||||
if (window.Recaptcha) {
|
||||
return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
|
||||
} else {
|
||||
script = document.head.querySelector('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]');
|
||||
return script.addEventListener('load', function() {
|
||||
return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
|
||||
}, false);
|
||||
}
|
||||
});
|
||||
},
|
||||
cb: {
|
||||
focus: function() {
|
||||
@ -8359,7 +8431,11 @@
|
||||
return QR.captcha.lifetime = e.detail;
|
||||
};
|
||||
$.on(window, 'captcha:timeout', setLifetime);
|
||||
$.globalEval('window.dispatchEvent(new CustomEvent("captcha:timeout", {detail: RecaptchaState.timeout}))');
|
||||
$.global(function() {
|
||||
return window.dispatchEvent(new CustomEvent('captcha:timeout', {
|
||||
detail: window.RecaptchaState.timeout
|
||||
}));
|
||||
});
|
||||
$.off(window, 'captcha:timeout', setLifetime);
|
||||
ref = QR.captcha.nodes, img = ref.img, input = ref.input;
|
||||
img.parentNode.hidden = false;
|
||||
@ -8382,7 +8458,10 @@
|
||||
if (!this.script) {
|
||||
return;
|
||||
}
|
||||
$.globalEval('window.Recaptcha.destroy();');
|
||||
$.global(function() {
|
||||
return window.Recaptcha.destroy();
|
||||
});
|
||||
delete this.occupied;
|
||||
if (this.nodes) {
|
||||
return this.beforeSetup();
|
||||
}
|
||||
@ -8502,7 +8581,14 @@
|
||||
}
|
||||
},
|
||||
reload: function(focus) {
|
||||
$.globalEval('if (window.Recaptcha.type === "image") {\n window.Recaptcha.reload();\n} else {\n window.Recaptcha.switch_type("image");\n}\nwindow.Recaptcha.should_focus = false;');
|
||||
$.global(function() {
|
||||
if (window.Recaptcha.type === 'image') {
|
||||
window.Recaptcha.reload();
|
||||
} else {
|
||||
window.Recaptcha.switch_type('image');
|
||||
}
|
||||
return window.Recaptcha.should_focus = false;
|
||||
});
|
||||
if (focus) {
|
||||
return this.nodes.input.focus();
|
||||
}
|
||||
@ -8707,6 +8793,9 @@
|
||||
}
|
||||
},
|
||||
setupIFrame: function(iframe) {
|
||||
if (!doc.contains(iframe)) {
|
||||
return;
|
||||
}
|
||||
Captcha.replace.iframe(iframe);
|
||||
$.addClass(QR.nodes.el, 'captcha-open');
|
||||
this.fixQRPosition();
|
||||
@ -9583,9 +9672,7 @@
|
||||
QR.status();
|
||||
return this.updateFlashURL();
|
||||
case 'com':
|
||||
this.nodes.span.textContent = this.com;
|
||||
QR.captcha.onPostChange();
|
||||
QR.characterCount();
|
||||
this.updateComment();
|
||||
if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
|
||||
return QR.cooldown.auto = false;
|
||||
}
|
||||
@ -9617,6 +9704,24 @@
|
||||
}
|
||||
};
|
||||
|
||||
_Class.prototype.setComment = function(com) {
|
||||
this.com = com || null;
|
||||
if (this === QR.selected) {
|
||||
QR.nodes.com.value = this.com;
|
||||
}
|
||||
return this.updateComment();
|
||||
};
|
||||
|
||||
_Class.prototype.updateComment = function() {
|
||||
if (this === QR.selected) {
|
||||
QR.characterCount();
|
||||
}
|
||||
this.nodes.span.textContent = this.com;
|
||||
return $.queueTask(function() {
|
||||
return QR.captcha.onPostChange();
|
||||
});
|
||||
};
|
||||
|
||||
_Class.rmErrored = function(e) {
|
||||
var error, errors, k, len1, post, q, ref;
|
||||
e.stopPropagation();
|
||||
@ -9701,7 +9806,9 @@
|
||||
this.filesize = $.bytesToString(this.file.size);
|
||||
this.checkSize();
|
||||
$.addClass(this.nodes.el, 'has-file');
|
||||
QR.captcha.onPostChange();
|
||||
$.queueTask(function() {
|
||||
return QR.captcha.onPostChange();
|
||||
});
|
||||
URL.revokeObjectURL(this.URL);
|
||||
this.saveFilename();
|
||||
if (this === QR.selected) {
|
||||
@ -9883,7 +9990,7 @@
|
||||
};
|
||||
|
||||
_Class.prototype.updateFlashURL = function() {
|
||||
var oldURL, ref, url;
|
||||
var com, oldURL, ref, url;
|
||||
if (g.BOARD.ID !== 'f') {
|
||||
return;
|
||||
}
|
||||
@ -9899,14 +10006,9 @@
|
||||
}
|
||||
oldURL = this.flashURL || '';
|
||||
if (url !== oldURL) {
|
||||
this.com || (this.com = '');
|
||||
if (this.com.slice(0, oldURL.length) === oldURL) {
|
||||
this.com = this.com.slice(oldURL.length);
|
||||
}
|
||||
this.com = (url + this.com) || null;
|
||||
if (this === QR.selected) {
|
||||
QR.nodes.com.value = this.com;
|
||||
QR.characterCount();
|
||||
com = this.com || '';
|
||||
if (com.slice(0, oldURL.length) === oldURL) {
|
||||
this.setComment(url + com.slice(oldURL.length));
|
||||
}
|
||||
return this.flashURL = url;
|
||||
}
|
||||
@ -9918,17 +10020,9 @@
|
||||
reader = new FileReader();
|
||||
reader.onload = (function(_this) {
|
||||
return function(e) {
|
||||
var text;
|
||||
text = e.target.result;
|
||||
if (_this.com) {
|
||||
_this.com += "\n" + text;
|
||||
} else {
|
||||
_this.com = text;
|
||||
}
|
||||
if (QR.selected === _this) {
|
||||
QR.nodes.com.value = _this.com;
|
||||
}
|
||||
_this.nodes.span.textContent = _this.com;
|
||||
var result;
|
||||
result = e.target.result;
|
||||
_this.setComment((_this.com ? _this.com + "\n" + result : result));
|
||||
return delete _this.pasting;
|
||||
};
|
||||
})(this);
|
||||
@ -12859,7 +12953,12 @@
|
||||
if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) {
|
||||
a.textContent = 'Report';
|
||||
ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
|
||||
ReportLink.dims = Conf['Use Recaptcha v1 in Reports'] || d.cookie.indexOf('pass_enabled=1') >= 0 ? 'width=350,height=275' : 'width=400,height=550';
|
||||
if ((Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled) || d.cookie.indexOf('pass_enabled=1') >= 0) {
|
||||
ReportLink.url += '&altc=1';
|
||||
ReportLink.dims = 'width=350,height=275';
|
||||
} else {
|
||||
ReportLink.dims = 'width=400,height=550';
|
||||
}
|
||||
} else if (Conf['Archive Report']) {
|
||||
a.textContent = 'Report to archive';
|
||||
ReportLink.url = Redirect.to('report', {
|
||||
@ -13598,7 +13697,7 @@
|
||||
$.addClass(doc, 'toggleable-watcher');
|
||||
}
|
||||
ThreadWatcher.fetchAuto();
|
||||
if (g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
|
||||
if (g.VIEW === 'index' && Conf['JSON Index'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
|
||||
Menu.menu.addEntry({
|
||||
el: $.el('a', {
|
||||
href: 'javascript:;',
|
||||
@ -13849,7 +13948,7 @@
|
||||
var k, len1, ref, thread, threads;
|
||||
ThreadWatcher.db.forceSync();
|
||||
ThreadWatcher.unreaddb.forceSync();
|
||||
if ((ref = QR.db) != null) {
|
||||
if ((ref = QuoteYou.db) != null) {
|
||||
ref.forceSync();
|
||||
}
|
||||
if (!(threads = ThreadWatcher.getAll()).length) {
|
||||
@ -13911,7 +14010,7 @@
|
||||
if (!(postObj.no > lastReadPost)) {
|
||||
continue;
|
||||
}
|
||||
if ((ref1 = QR.db) != null ? ref1.get({
|
||||
if ((ref1 = QuoteYou.db) != null ? ref1.get({
|
||||
boardID: boardID,
|
||||
threadID: threadID,
|
||||
postID: postObj.no
|
||||
@ -13919,13 +14018,13 @@
|
||||
continue;
|
||||
}
|
||||
unread++;
|
||||
if (!(QR.db && postObj.com)) {
|
||||
if (!(QuoteYou.db && postObj.com)) {
|
||||
continue;
|
||||
}
|
||||
quotesYou = false;
|
||||
regexp = /<a [^>]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g;
|
||||
while (match = regexp.exec(postObj.com)) {
|
||||
if (QR.db.get({
|
||||
if (QuoteYou.db.get({
|
||||
boardID: match[1] || boardID,
|
||||
threadID: match[2] || threadID,
|
||||
postID: match[3] || match[2] || threadID
|
||||
@ -14439,7 +14538,7 @@
|
||||
return;
|
||||
}
|
||||
Unread.order.push(this);
|
||||
if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QR.db) != null ? ref.get({
|
||||
if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QuoteYou.db) != null ? ref.get({
|
||||
boardID: this.board.ID,
|
||||
threadID: this.thread.ID,
|
||||
postID: this.ID
|
||||
@ -14455,7 +14554,7 @@
|
||||
ref = post.nodes.quotelinks;
|
||||
for (k = 0, len1 = ref.length; k < len1; k++) {
|
||||
quotelink = ref[k];
|
||||
if (!((ref1 = QR.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
|
||||
if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
|
||||
continue;
|
||||
}
|
||||
Unread.postsQuotingYou.add(post.ID);
|
||||
@ -14524,7 +14623,7 @@
|
||||
count++;
|
||||
Unread.posts["delete"](ID);
|
||||
Unread.postsQuotingYou["delete"](ID);
|
||||
if ((ref1 = QR.db) != null ? ref1.get({
|
||||
if ((ref1 = QuoteYou.db) != null ? ref1.get({
|
||||
boardID: data.board.ID,
|
||||
threadID: data.thread.ID,
|
||||
postID: ID
|
||||
@ -15053,7 +15152,7 @@
|
||||
CatalogLinks = {
|
||||
init: function() {
|
||||
var el, input, selector;
|
||||
if ((Conf['External Catalog'] || Conf['JSON Navigation']) && !(Conf['JSON Navigation'] && g.VIEW === 'index')) {
|
||||
if ((Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) {
|
||||
selector = (function() {
|
||||
switch (g.VIEW) {
|
||||
case 'thread':
|
||||
@ -15072,7 +15171,7 @@
|
||||
link = ref[k];
|
||||
switch (link.pathname.replace(/\/+/g, '/')) {
|
||||
case "/" + g.BOARD + "/":
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
link.textContent = 'Index';
|
||||
}
|
||||
link.href = CatalogLinks.index();
|
||||
@ -15080,7 +15179,7 @@
|
||||
case "/" + g.BOARD + "/catalog":
|
||||
link.href = CatalogLinks.catalog();
|
||||
}
|
||||
if (g.VIEW === 'catalog' && Conf['JSON Navigation'] && Conf['Use 4chan X Catalog']) {
|
||||
if (g.VIEW === 'catalog' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
|
||||
catalogLink = link.parentNode.cloneNode(true);
|
||||
catalogLink.firstElementChild.textContent = '4chan X Catalog';
|
||||
catalogLink.firstElementChild.href = CatalogLinks.catalog();
|
||||
@ -15089,7 +15188,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
if (Conf['JSON Navigation'] && Conf['Use 4chan X Catalog']) {
|
||||
if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
|
||||
Post.callbacks.push({
|
||||
name: 'Catalog Link Rewrite',
|
||||
cb: this.node
|
||||
@ -15151,7 +15250,7 @@
|
||||
}
|
||||
if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) {
|
||||
return "http://catalog.neet.tv/" + board + "/";
|
||||
} else if (Conf['JSON Navigation'] && Conf['Use 4chan X Catalog']) {
|
||||
} else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
|
||||
if (g.BOARD.ID === board && g.VIEW === 'index') {
|
||||
return '#catalog';
|
||||
} else {
|
||||
@ -15165,7 +15264,7 @@
|
||||
if (board == null) {
|
||||
board = g.BOARD.ID;
|
||||
}
|
||||
if (Conf['JSON Navigation'] && board !== 'f') {
|
||||
if (Conf['JSON Index'] && board !== 'f') {
|
||||
if (g.BOARD.ID === board && g.VIEW === 'index') {
|
||||
return '#index';
|
||||
} else {
|
||||
@ -15203,7 +15302,7 @@
|
||||
|
||||
ExpandComment = {
|
||||
init: function() {
|
||||
if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Navigation']) {
|
||||
if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) {
|
||||
return;
|
||||
}
|
||||
if (g.BOARD.ID === 'g') {
|
||||
@ -15309,7 +15408,7 @@
|
||||
if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
return $.on(d, 'IndexRefresh', this.onIndexRefresh);
|
||||
} else {
|
||||
return Thread.callbacks.push({
|
||||
@ -15395,7 +15494,7 @@
|
||||
return;
|
||||
}
|
||||
replies = $$('.thread > .replyContainer', threadRoot);
|
||||
if (!Conf['JSON Navigation'] || Conf['Show Replies']) {
|
||||
if (!Conf['JSON Index'] || Conf['Show Replies']) {
|
||||
num = (function() {
|
||||
if (thread.isSticky) {
|
||||
return 1;
|
||||
@ -15823,7 +15922,7 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
|
||||
if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Index'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
|
||||
threadRoot = Nav.getThread();
|
||||
if (op = $('.op', threadRoot)) {
|
||||
thread = Get.postFromNode(op).thread;
|
||||
@ -15927,7 +16026,7 @@
|
||||
ThreadUpdater.update();
|
||||
break;
|
||||
case 'index':
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
Index.update();
|
||||
@ -15973,7 +16072,7 @@
|
||||
FappeTyme.toggle('werk');
|
||||
break;
|
||||
case Conf['Front page']:
|
||||
if (Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
|
||||
if (Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
|
||||
Index.userPageNav(1);
|
||||
} else {
|
||||
window.location = "/" + g.BOARD + "/";
|
||||
@ -15986,7 +16085,7 @@
|
||||
if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
@ -16001,7 +16100,7 @@
|
||||
if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if (Conf['JSON Index']) {
|
||||
if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
@ -16016,24 +16115,24 @@
|
||||
if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
searchInput = Conf['JSON Navigation'] ? Index.searchInput : $.id('search-box');
|
||||
searchInput = Conf['JSON Index'] ? Index.searchInput : $.id('search-box');
|
||||
Header.scrollToIfNeeded(searchInput);
|
||||
searchInput.focus();
|
||||
break;
|
||||
case Conf['Paged mode']:
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
|
||||
break;
|
||||
case Conf['Infinite scrolling mode']:
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
|
||||
break;
|
||||
case Conf['All pages mode']:
|
||||
if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
|
||||
@ -16045,7 +16144,7 @@
|
||||
window.location = CatalogLinks.catalog();
|
||||
break;
|
||||
case Conf['Cycle sort type']:
|
||||
if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
if (!(Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
Index.cycleSortType();
|
||||
@ -16107,13 +16206,13 @@
|
||||
}
|
||||
break;
|
||||
case Conf['Previous Post Quoting You']:
|
||||
if (!(threadRoot && QR.db)) {
|
||||
if (!(threadRoot && QuoteYou.db)) {
|
||||
return;
|
||||
}
|
||||
QuoteYou.cb.seek('preceding');
|
||||
break;
|
||||
case Conf['Next Post Quoting You']:
|
||||
if (!(threadRoot && QR.db)) {
|
||||
if (!(threadRoot && QuoteYou.db)) {
|
||||
return;
|
||||
}
|
||||
QuoteYou.cb.seek('following');
|
||||
@ -16407,7 +16506,7 @@
|
||||
INTERVAL: $.MINUTE / 2,
|
||||
init: function() {
|
||||
var ref;
|
||||
if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
|
||||
if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Index'] && g.BOARD.ID !== 'f') {
|
||||
this.flush();
|
||||
$.on(d, 'visibilitychange ThreadUpdate', this.flush);
|
||||
}
|
||||
@ -16541,7 +16640,8 @@
|
||||
};
|
||||
|
||||
Report = {
|
||||
css: ":root:not(.js-enabled) #captchaContainerAlt {\n" +
|
||||
css: ":root:not(.js-enabled) #g-recaptcha,\n" +
|
||||
":root:not(.js-enabled) #captchaContainerAlt {\n" +
|
||||
" height: auto;\n" +
|
||||
"}\n" +
|
||||
"#captchaContainerAlt td:nth-child(2) {\n" +
|
||||
@ -16580,7 +16680,7 @@
|
||||
]);
|
||||
}
|
||||
if (!Conf['Use Recaptcha v1 in Reports'] && !Conf['Force Noscript Captcha'] && Main.jsEnabled) {
|
||||
new MutationObserver(function() {
|
||||
return new MutationObserver(function() {
|
||||
Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
|
||||
return Report.fit('body');
|
||||
}).observe(d.body, {
|
||||
@ -16589,27 +16689,7 @@
|
||||
subtree: true
|
||||
});
|
||||
} else {
|
||||
Report.fit('body');
|
||||
}
|
||||
if (Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled && d.cookie.indexOf('pass_enabled=1') < 0) {
|
||||
$.onExists(d.body, '#recaptcha_image', function(image) {
|
||||
return $.on(image, 'click', function() {
|
||||
if ($.id('recaptcha_challenge_image')) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return $.onExists(d.body, '#recaptcha_response_field', function(field) {
|
||||
return $.on(field, 'keydown', function(e) {
|
||||
if (e.keyCode === 8 && !field.value) {
|
||||
return $.global(function() {
|
||||
return window.Recaptcha.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return Report.fit('body');
|
||||
}
|
||||
},
|
||||
fit: function(selector) {
|
||||
@ -17035,7 +17115,6 @@
|
||||
},
|
||||
"export": function() {
|
||||
return $.get(Conf, function(Conf) {
|
||||
delete Conf['archives'];
|
||||
return Settings.downloadExport({
|
||||
version: g.VERSION,
|
||||
date: Date.now(),
|
||||
@ -17302,6 +17381,11 @@
|
||||
set('Use Recaptcha v1 in Reports', true);
|
||||
}
|
||||
}
|
||||
if (compareString < '00001.00011.00024.00000') {
|
||||
if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) {
|
||||
set('JSON Index', data['JSON Navigation']);
|
||||
}
|
||||
}
|
||||
return changes;
|
||||
},
|
||||
loadSettings: function(data, cb) {
|
||||
@ -17702,6 +17786,7 @@
|
||||
Conf['selectedArchives'] = {};
|
||||
Conf['cooldowns'] = {};
|
||||
Conf['Except Archives from Encryption'] = false;
|
||||
Conf['JSON Navigation'] = true;
|
||||
items = {};
|
||||
for (key in Conf) {
|
||||
items[key] = void 0;
|
||||
@ -17885,6 +17970,7 @@
|
||||
setStyle = function() {
|
||||
var k, len1, styleSheet;
|
||||
$.rmClass(doc, style);
|
||||
style = null;
|
||||
for (k = 0, len1 = styleSheets.length; k < len1; k++) {
|
||||
styleSheet = styleSheets[k];
|
||||
if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) {
|
||||
@ -17892,7 +17978,9 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $.addClass(doc, style);
|
||||
if (style) {
|
||||
return $.addClass(doc, style);
|
||||
}
|
||||
};
|
||||
setStyle();
|
||||
if (!mainStyleSheet) {
|
||||
@ -17929,7 +18017,7 @@
|
||||
});
|
||||
new Notice('warning', msg);
|
||||
}
|
||||
if (!(Conf['JSON Navigation'] && g.VIEW === 'index')) {
|
||||
if (!(Conf['JSON Index'] && g.VIEW === 'index')) {
|
||||
return Main.initThread();
|
||||
} else {
|
||||
Main.expectInitFinished = true;
|
||||
@ -18744,6 +18832,7 @@
|
||||
".dialog {\n" +
|
||||
" border: 1px solid;\n" +
|
||||
" display: block;\n" +
|
||||
" background-color: inherit;\n" +
|
||||
"}\n" +
|
||||
".dialog:not(#qr):not(#thread-watcher):not(#header-bar) {\n" +
|
||||
" box-shadow: 0 1px 2px rgba(0, 0, 0, .15);\n" +
|
||||
|
||||
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.11.23.2' />
|
||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.11.24.0' />
|
||||
</app>
|
||||
</gupdate>
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.11.23.2' />
|
||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.11.24.0' />
|
||||
</app>
|
||||
</gupdate>
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"version": "1.11.23.2",
|
||||
"date": "2016-01-28T16:54:58.905Z"
|
||||
"version": "1.11.24.0",
|
||||
"date": "2016-02-01T05:44:50.088Z"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user