Release 4chan X v1.11.16.0.

This commit is contained in:
ccd0 2015-11-08 21:07:54 -08:00
parent 3db91b3118
commit d9f9cfde05
13 changed files with 753 additions and 931 deletions

View File

@ -2,6 +2,15 @@
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). 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.16
**v1.11.16.0** *(2015-11-08)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.16.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.16.0/builds/4chan-X-noupdate.crx "Chromium version")]
- Based on v1.11.15.7.
- 4chan X no longer requires local storage to be enabled when using Chromium-based browsers. In Firefox, local storage is still needed to sync settings between tabs, but it is no longer essential. Warnings about local storage being disabled can be turned off by disabling the `Show Support Message` setting. Local storage is still required in userscript engines that do not support the Greasemonkey API.
- The link to pass login window is now optional, controlled by `Pass Link` setting.
- The style changes to the board title have been moved to custom CSS (now on by default) so that users can easily remove them if they wish.
- Refactoring and bug fixes.
### v1.11.15 ### v1.11.15
**v1.11.15.7** *(2015-11-07)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.15.7/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.15.7/builds/4chan-X-noupdate.crx "Chromium version")] **v1.11.15.7** *(2015-11-07)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.15.7/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.15.7/builds/4chan-X-noupdate.crx "Chromium version")]

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.11.15.7 // @version 1.11.16.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -10,8 +10,6 @@
// @include https://boards.4chan.org/* // @include https://boards.4chan.org/*
// @include http://sys.4chan.org/* // @include http://sys.4chan.org/*
// @include https://sys.4chan.org/* // @include https://sys.4chan.org/*
// @include http://a.4cdn.org/*
// @include https://a.4cdn.org/*
// @include http://i.4cdn.org/* // @include http://i.4cdn.org/*
// @include https://i.4cdn.org/* // @include https://i.4cdn.org/*
// @include http://www.4chan.org/banned // @include http://www.4chan.org/banned

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.11.15.7 // @version 1.11.16.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -11,8 +11,6 @@
// @include https://boards.4chan.org/* // @include https://boards.4chan.org/*
// @include http://sys.4chan.org/* // @include http://sys.4chan.org/*
// @include https://sys.4chan.org/* // @include https://sys.4chan.org/*
// @include http://a.4cdn.org/*
// @include https://a.4cdn.org/*
// @include http://i.4cdn.org/* // @include http://i.4cdn.org/*
// @include https://i.4cdn.org/* // @include https://i.4cdn.org/*
// @include http://www.4chan.org/banned // @include http://www.4chan.org/banned
@ -117,7 +115,7 @@
'use strict'; 'use strict';
(function() { (function() {
var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g, var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, NormalizeURL, Notice, PSAHiding, PassLink, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, err, g,
slice = [].slice, slice = [].slice,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
@ -154,7 +152,7 @@
'Remove Spoilers': [false, 'Remove all spoilers in text.'], 'Remove Spoilers': [false, 'Remove all spoilers in text.'],
'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'], 'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'],
'Show Support Message': [true, 'Warn if your browser or configuration is unsupported and may cause 4chan X to not operate correctly.'], 'Show Support Message': [true, 'Warn if your browser or configuration is unsupported and may cause 4chan X to not operate correctly.'],
'Normalize URL': [true, 'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'], 'Normalize URL': [true, 'Rewrite the URL of the current page, removing slugs and excess slashes, and changing /res/ to /thread/.'],
'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'], 'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'],
'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'], 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'],
'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.'] 'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.']
@ -250,7 +248,8 @@
'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1], 'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1],
'Captcha Fixes': [true, 'Make captcha easier to use, especially with the keyboard.'], 'Captcha Fixes': [true, 'Make captcha easier to use, especially with the keyboard.'],
'Use Recaptcha v1': [false, 'Use the old text version of Recaptcha.'], 'Use Recaptcha v1': [false, 'Use the old text version of Recaptcha.'],
'Use Recaptcha v2 in Reports': [false, 'Use the image selection captcha in the report window.'] 'Use Recaptcha v2 in Reports': [false, 'Use the image selection captcha in the report window.'],
'Pass Link': [true, 'Add a 4chan Pass login link to the bottom of the page.']
}, },
'Quote Links': { 'Quote Links': {
'Quote Backlinks': [true, 'Add quote backlinks.'], 'Quote Backlinks': [true, 'Add quote backlinks.'],
@ -313,7 +312,7 @@
FappeT: { FappeT: {
werk: false werk: false
}, },
'Custom CSS': false, 'Custom CSS': true,
Index: { Index: {
'Index Mode': 'paged', 'Index Mode': 'paged',
'Previous Index Mode': 'paged', 'Previous Index Mode': 'paged',
@ -345,7 +344,26 @@
backlink: '>>%id', backlink: '>>%id',
fileInfo: '%l (%p%s, %r%g)', fileInfo: '%l (%p%s, %r%g)',
favicon: 'ferongr', favicon: 'ferongr',
usercss: '', usercss: "/* Board title rice */\n" +
"div.boardTitle {\n" +
" font-weight: 400 !important;\n" +
"}\n" +
":root.yotsuba div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(100,0,0,0.6);\n" +
"}\n" +
":root.yotsuba-b div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n" +
"}\n" +
":root.photon div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n" +
"}\n" +
":root.tomorrow div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n" +
"}",
hotkeys: { hotkeys: {
'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'], 'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'],
'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'], 'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'],
@ -415,7 +433,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.11.15.7', VERSION: '1.11.16.0',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -942,6 +960,14 @@
} }
})(); })();
try {
localStorage.getItem('x');
$.hasStorage = true;
} catch (_error) {
err = _error;
$.hasStorage = false;
}
$.item = function(key, val) { $.item = function(key, val) {
var item; var item;
item = {}; item = {};
@ -956,7 +982,7 @@
$.listValues = function() { $.listValues = function() {
return GM_listValues(); return GM_listValues();
}; };
} else { } else if ($.hasStorage) {
$.getValue = function(key) { $.getValue = function(key) {
return localStorage[key]; return localStorage[key];
}; };
@ -970,6 +996,11 @@
} }
return results; return results;
}; };
} else {
$.getValue = function() {};
$.listValues = function() {
return [];
};
} }
if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
@ -981,17 +1012,24 @@
GM_setValue(key, val); GM_setValue(key, val);
if (key in $.syncing) { if (key in $.syncing) {
$.oldValue[key] = val; $.oldValue[key] = val;
return localStorage[key] = val; if ($.hasStorage) {
return localStorage[key] = val;
}
} }
}; };
$.deleteValue = function(key) { $.deleteValue = function(key) {
GM_deleteValue(key); GM_deleteValue(key);
if (key in $.syncing) { if (key in $.syncing) {
delete $.oldValue[key]; delete $.oldValue[key];
return delete localStorage[key]; if ($.hasStorage) {
return delete localStorage[key];
}
} }
}; };
} else { if (!$.hasStorage) {
$.cantSync = true;
}
} else if ($.hasStorage) {
$.oldValue = {}; $.oldValue = {};
$.setValue = function(key, val) { $.setValue = function(key, val) {
if (key in $.syncing) { if (key in $.syncing) {
@ -1005,6 +1043,10 @@
} }
return delete localStorage[key]; return delete localStorage[key];
}; };
} else {
$.setValue = function() {};
$.deleteValue = function() {};
$.cantSync = $.cantSet = true;
} }
if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
@ -1019,7 +1061,7 @@
}); });
}; };
$.forceSync = function() {}; $.forceSync = function() {};
} else { } else if ($.hasStorage) {
$.sync = function(key, cb) { $.sync = function(key, cb) {
key = g.NAMESPACE + key; key = g.NAMESPACE + key;
$.syncing[key] = cb; $.syncing[key] = cb;
@ -1053,6 +1095,9 @@
return onChange(g.NAMESPACE + key); return onChange(g.NAMESPACE + key);
}; };
})(); })();
} else {
$.sync = function() {};
$.forceSync = function() {};
} }
$["delete"] = function(keys) { $["delete"] = function(keys) {
@ -1143,7 +1188,7 @@
}; };
Callbacks.prototype.execute = function(node, keys) { Callbacks.prototype.execute = function(node, keys) {
var err, errors, k, len1, name, ref; var errors, k, len1, name, ref;
if (keys == null) { if (keys == null) {
keys = this.keys; keys = this.keys;
} }
@ -1891,17 +1936,17 @@
DataBoard.prototype.ajaxClean = function(boardID) { DataBoard.prototype.ajaxClean = function(boardID) {
return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) { return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) {
return function(e1) { return function(e1) {
if (e1.target.status === 200) { var ref;
if (boardID === 'b' || boardID === 'f' || boardID === 'trash') { if ((ref = e1.target.status) !== 200 && ref !== 404) {
return _this.ajaxCleanParse(boardID, e1.target.response); return;
} else {
return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
if (e2.target.status === 200) {
return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
}
});
}
} }
return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
var ref1;
if ((ref1 = e2.target.status) !== 200 && ref1 !== 404) {
return;
}
return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
});
}; };
})(this)); })(this));
}; };
@ -1910,14 +1955,16 @@
var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u; var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
board = this.data.boards[boardID]; board = this.data.boards[boardID];
threads = {}; threads = {};
for (k = 0, len1 = response1.length; k < len1; k++) { if (response1) {
page = response1[k]; for (k = 0, len1 = response1.length; k < len1; k++) {
ref = page.threads; page = response1[k];
for (q = 0, len2 = ref.length; q < len2; q++) { ref = page.threads;
thread = ref[q]; for (q = 0, len2 = ref.length; q < len2; q++) {
ID = thread.no; thread = ref[q];
if (ID in board) { ID = thread.no;
threads[ID] = board[ID]; if (ID in board) {
threads[ID] = board[ID];
}
} }
} }
} }
@ -3756,7 +3803,7 @@
return $.addClass(Index.button, 'fa-spin'); return $.addClass(Index.button, 'fa-spin');
}, },
load: function(e, state) { load: function(e, state) {
var err, nTimeout, notice, ref, req, timeEl; var nTimeout, notice, ref, req, timeEl;
$.rmClass(Index.button, 'fa-spin'); $.rmClass(Index.button, 'fa-spin');
req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout; req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
if (nTimeout) { if (nTimeout) {
@ -3840,7 +3887,7 @@
}); });
}, },
buildThreads: function() { buildThreads: function() {
var err, errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads; var errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads;
Index.nodes = []; Index.nodes = [];
threads = []; threads = [];
posts = []; posts = [];
@ -3887,7 +3934,7 @@
return $.event('IndexRefresh'); return $.event('IndexRefresh');
}, },
buildReplies: function(threadRoots) { buildReplies: function(threadRoots) {
var data, err, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot; var data, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot;
posts = []; posts = [];
for (k = 0, len1 = threadRoots.length; k < len1; k++) { for (k = 0, len1 = threadRoots.length; k < len1; k++) {
threadRoot = threadRoots[k]; threadRoot = threadRoots[k];
@ -4681,7 +4728,7 @@
}; };
Menu.prototype.insertEntry = function(entry, parent, data) { Menu.prototype.insertEntry = function(entry, parent, data) {
var err, k, len1, ref, subEntry, submenu; var k, len1, ref, subEntry, submenu;
if (typeof entry.open === 'function') { if (typeof entry.open === 'function') {
try { try {
if (!entry.open(data)) { if (!entry.open(data)) {
@ -5172,7 +5219,7 @@
Filter = { Filter = {
filters: {}, filters: {},
init: function() { init: function() {
var boards, err, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, regexp, stub, top; var boards, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, regexp, stub, top;
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) { if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
return; return;
} }
@ -5811,6 +5858,9 @@
}, },
catalogSet: function(board) { catalogSet: function(board) {
var hiddenThreads, threadID; var hiddenThreads, threadID;
if (!$.hasStorage) {
return;
}
hiddenThreads = ThreadHiding.db.get({ hiddenThreads = ThreadHiding.db.get({
boardID: board.ID, boardID: board.ID,
defaultValue: {} defaultValue: {}
@ -5821,8 +5871,11 @@
return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads)); return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads));
}, },
catalogWatch: function() { catalogWatch: function() {
if (!$.hasStorage) {
return;
}
this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
return $.ready(function() { return Main.ready(function() {
return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), { return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), {
attributes: true, attributes: true,
subtree: true, subtree: true,
@ -6998,7 +7051,6 @@
} }
}, },
open: function() { open: function() {
var err;
if (QR.nodes) { if (QR.nodes) {
if (QR.nodes.el.hidden) { if (QR.nodes.el.hidden) {
QR.captcha.setup(); QR.captcha.setup();
@ -7608,7 +7660,7 @@
return $.event('QRDialogCreation', null, dialog); return $.event('QRDialogCreation', null, dialog);
}, },
submit: function(e) { submit: function(e) {
var captcha, cb, err, extra, filetag, formData, options, post, ref, textOnly, thread, threadID; var captcha, cb, extra, filetag, formData, options, post, ref, textOnly, thread, threadID;
if (e != null) { if (e != null) {
e.preventDefault(); e.preventDefault();
} }
@ -7742,7 +7794,7 @@
return QR.status(); return QR.status();
}, },
response: function() { response: function() {
var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, seconds, threadID; var URL, _, ban, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, seconds, threadID;
req = QR.req; req = QR.req;
delete QR.req; delete QR.req;
post = QR.posts[0]; post = QR.posts[0];
@ -8559,7 +8611,7 @@
return this.conn.target = iframe; return this.conn.target = iframe;
}, },
setupJS: function() { setupJS: function() {
return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: (document.documentElement.classList.contains(\'tomorrow\') || document.documentElement.classList.contains(\'spooky\')) ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();'); return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: document.documentElement.classList.contains(\'tomorrow\') ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();');
}, },
afterSetup: function(mutations) { afterSetup: function(mutations) {
var iframe, k, len1, len2, mutation, node, q, ref, textarea; var iframe, k, len1, len2, mutation, node, q, ref, textarea;
@ -8754,6 +8806,31 @@
} }
}; };
PassLink = {
init: function() {
if (!Conf['Pass Link']) {
return;
}
return Main.ready(this.ready);
},
ready: function() {
var passLink, styleSelector;
if (!(styleSelector = $.id('styleSelector'))) {
return;
}
passLink = $.el('span', {
className: 'brackets-wrap pass-link-container'
});
$.extend(passLink, {
innerHTML: "<a href=\"javascript:;\">4chan Pass</a>"
});
$.on(passLink.firstElementChild, 'click', function() {
return window.open('//sys.4chan.org/auth', Date.now(), 'width=500,height=280,toolbar=0');
});
return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]);
}
};
PostSuccessful = { PostSuccessful = {
init: function() { init: function() {
return $.ready(this.ready); return $.ready(this.ready);
@ -11327,7 +11404,7 @@
Sauce = { Sauce = {
init: function() { init: function() {
var err, k, len1, link, links, ref, ref1; var k, len1, link, links, ref, ref1;
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) { if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
return; return;
} }
@ -15403,7 +15480,22 @@
} }
}, },
initReady: function() { initReady: function() {
return $.globalEval('if (JSON.parse(localStorage["4chan-settings"] || "{}").disableAll) SWFEmbed.init();'); if ($.hasStorage) {
return $.global(function() {
if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) {
return window.SWFEmbed.init();
}
});
} else {
if (g.VIEW === 'thread') {
$.global(function() {
return window.Main.tid = location.pathname.split(/\/+/)[3];
});
}
return $.global(function() {
return window.SWFEmbed.init();
});
}
} }
}; };
@ -16157,6 +16249,28 @@
} }
}; };
NormalizeURL = {
init: function() {
var pathname;
if (!Conf['Normalize URL']) {
return;
}
pathname = location.pathname.split(/\/+/);
switch (g.VIEW) {
case 'thread':
pathname[2] = 'thread';
pathname = pathname.slice(0, 4);
break;
case 'index':
pathname = pathname.slice(0, 3);
}
pathname = pathname.join('/');
if (location.pathname !== pathname) {
return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
}
}
};
RelativeDates = { RelativeDates = {
INTERVAL: $.MINUTE / 2, INTERVAL: $.MINUTE / 2,
init: function() { init: function() {
@ -16300,7 +16414,7 @@
"}", "}",
init: function() { init: function() {
var match; var match;
if (!(/\bmode=report\b/.test(location.search) && (match = location.search.match(/\bno=(\d+)/)))) { if (!(match = location.search.match(/\bno=(\d+)/))) {
return; return;
} }
Captcha.replace.init(); Captcha.replace.init();
@ -16521,12 +16635,20 @@
return Settings.open(e.detail); return Settings.open(e.detail);
}); });
if (Conf['Disable Native Extension']) { if (Conf['Disable Native Extension']) {
settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; if ($.hasStorage) {
if (settings.disableAll) { settings = JSON.parse(localStorage.getItem('4chan-settings')) || {};
return; if (settings.disableAll) {
return;
}
settings.disableAll = true;
return localStorage.setItem('4chan-settings', JSON.stringify(settings));
} else {
return $.onExists(doc, 'body', false, function() {
return $.global(function() {
return window.Config.disableAll = true;
});
});
} }
settings.disableAll = true;
return localStorage.setItem('4chan-settings', JSON.stringify(settings));
} }
}, },
open: function(openSection) { open: function(openSection) {
@ -16693,8 +16815,10 @@
return $.get('hiddenThreads', {}, function(arg) { return $.get('hiddenThreads', {}, function(arg) {
var boardID, hiddenThreads; var boardID, hiddenThreads;
hiddenThreads = arg.hiddenThreads; hiddenThreads = arg.hiddenThreads;
for (boardID in hiddenThreads.boards) { if ($.hasStorage) {
localStorage.removeItem("4chan-hide-t-" + boardID); for (boardID in hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
} }
return $["delete"](['hiddenThreads', 'hiddenPosts']); return $["delete"](['hiddenThreads', 'hiddenPosts']);
}); });
@ -16738,7 +16862,6 @@
} }
reader = new FileReader(); reader = new FileReader();
reader.onload = function(e) { reader.onload = function(e) {
var err;
try { try {
return Settings.loadSettings(JSON.parse(e.target.result), function(err) { return Settings.loadSettings(JSON.parse(e.target.result), function(err) {
if (err) { if (err) {
@ -16870,7 +16993,7 @@
} }
}, },
upgrade: function(data, version) { upgrade: function(data, version) {
var boardID, changes, compareString, name, record, ref, ref1, ref2, type, uids; var boardID, changes, compareString, name, record, ref, ref1, ref2, rice, type, uids;
changes = {}; changes = {};
compareString = version.replace(/\d+/g, function(x) { compareString = version.replace(/\d+/g, function(x) {
return ('0000' + x).slice(-5); return ('0000' + x).slice(-5);
@ -16911,6 +17034,13 @@
} }
} }
} }
if (compareString < '00001.00011.00016.00000') {
if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) {
if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) {
changes['usercss'] = rice + '\n\n' + data['usercss'];
}
}
}
return changes; return changes;
}, },
loadSettings: function(data, cb) { loadSettings: function(data, cb) {
@ -17259,7 +17389,7 @@
Main = { Main = {
init: function() { init: function() {
var db, flatten, items, k, key, len1, pathname, ref, ref1, ref2; var db, flatten, items, k, key, len1, ref;
if (d.body && !$('title', d.head)) { if (d.body && !$('title', d.head)) {
return; return;
} }
@ -17284,35 +17414,6 @@
}); });
return; return;
} }
g.threads = new SimpleDict();
g.posts = new SimpleDict();
pathname = location.pathname.split(/\/+/);
g.BOARD = new Board(pathname[1]);
if ((ref = g.BOARD.ID) === 'z' || ref === 'fk') {
return;
}
g.VIEW = (function() {
switch (pathname[2]) {
case 'res':
case 'thread':
return 'thread';
case 'catalog':
case 'archive':
case 'post':
return pathname[2];
default:
return 'index';
}
})();
if (g.VIEW === 'catalog' && g.BOARD.ID === 'f') {
return;
}
if (g.VIEW === 'archive' && ((ref1 = g.BOARD.ID) === 'b' || ref1 === 'f' || ref1 === 'trash')) {
return;
}
if (g.VIEW === 'thread') {
g.THREADID = +pathname[3];
}
flatten = function(parent, obj) { flatten = function(parent, obj) {
var key, val; var key, val;
if (obj instanceof Array) { if (obj instanceof Array) {
@ -17327,9 +17428,9 @@
} }
}; };
flatten(null, Config); flatten(null, Config);
ref2 = DataBoard.keys; ref = DataBoard.keys;
for (k = 0, len1 = ref2.length; k < len1; k++) { for (k = 0, len1 = ref.length; k < len1; k++) {
db = ref2[k]; db = ref[k];
Conf[db] = { Conf[db] = {
boards: {} boards: {}
}; };
@ -17342,12 +17443,14 @@
items[key] = void 0; items[key] = void 0;
} }
items['previousversion'] = void 0; items['previousversion'] = void 0;
$.get(items, function(items) { return $.get(items, function(items) {
return $.asap((function() { return $.asap((function() {
return doc = d.documentElement; return doc = d.documentElement;
}), function() { }), function() {
var ref3, val; var ref1, val;
if (items.previousversion == null) { if ($.cantSet) {
} else if (items.previousversion == null) {
Main.ready(function() { Main.ready(function() {
$.set('previousversion', g.VERSION); $.set('previousversion', g.VERSION);
return Settings.open(); return Settings.open();
@ -17357,16 +17460,11 @@
} }
for (key in Conf) { for (key in Conf) {
val = Conf[key]; val = Conf[key];
Conf[key] = (ref3 = items[key]) != null ? ref3 : val; Conf[key] = (ref1 = items[key]) != null ? ref1 : val;
} }
return Main.initFeatures(); return Main.initFeatures();
}); });
}); });
return $.asap((function() {
return doc = d.documentElement;
}), function() {
return $.onExists(doc, 'body', false, Main.initStyle);
});
}, },
upgrade: function(items) { upgrade: function(items) {
var changes, previousversion; var changes, previousversion;
@ -17387,43 +17485,50 @@
}); });
}, },
initFeatures: function() { initFeatures: function() {
var err, feature, k, len1, match, name, pathname, ref, ref1, ref2; var feature, hostname, k, len1, match, name, pathname, ref, ref1, ref2, ref3, search;
if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'sys.4chan.org' || ref === 'www.4chan.org') { hostname = location.hostname, search = location.search;
pathname = location.pathname.split(/\/+/);
if (hostname !== 'www.4chan.org') {
g.BOARD = new Board(pathname[1]);
}
if (hostname === 'boards.4chan.org' || hostname === 'sys.4chan.org' || hostname === 'www.4chan.org') {
$.global(function() { $.global(function() {
document.documentElement.classList.add('js-enabled'); document.documentElement.classList.add('js-enabled');
return window.FCX = {}; return window.FCX = {};
}); });
} }
switch (location.hostname) { switch (hostname) {
case 'www.4chan.org': case 'www.4chan.org':
Captcha.replace.init(); Captcha.replace.init();
return; return;
case 'a.4cdn.org':
return;
case 'sys.4chan.org': case 'sys.4chan.org':
Report.init(); if (pathname[2] === 'imgboard.php') {
if (g.VIEW === 'post') { if (/\bmode=report\b/.test(search)) {
Report.init();
} else if ((match = search.match(/\bres=(\d+)/))) {
$.ready(function() {
var ref;
if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') {
return Redirect.navigate('thread', {
boardID: g.BOARD.ID,
postID: +match[1]
});
}
});
}
} else if (pathname[2] === 'post') {
PostSuccessful.init(); PostSuccessful.init();
} }
if (Conf['404 Redirect'] && /\/imgboard\.php$/.test(location.pathname) && (match = location.search.match(/\bres=(\d+)/))) {
$.ready(function() {
var ref1;
if (((ref1 = $.id('errmsg')) != null ? ref1.textContent : void 0) === 'Error: Specified thread does not exist.') {
return Redirect.navigate('thread', {
boardID: g.BOARD.ID,
postID: +match[1]
});
}
});
}
return; return;
case 'i.4cdn.org': case 'i.4cdn.org':
if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) {
return;
}
$.asap((function() { $.asap((function() {
return d.readyState !== 'loading'; return d.readyState !== 'loading';
}), function() { }), function() {
var pathname, ref1, video; var ref, video;
if (Conf['404 Redirect'] && ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found')) { if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
pathname = location.pathname.split(/\/+/);
return Redirect.navigate('file', { return Redirect.navigate('file', {
boardID: g.BOARD.ID, boardID: g.BOARD.ID,
filename: pathname[pathname.length - 1] filename: pathname[pathname.length - 1]
@ -17442,24 +17547,22 @@
}); });
return; return;
} }
if (Conf['Normalize URL']) { if ((ref = pathname[2]) === 'thread' || ref === 'res') {
pathname = location.pathname.split(/\/+/); g.VIEW = 'thread';
switch (g.VIEW) { g.THREADID = +pathname[3];
case 'thread': } else if ((ref1 = pathname[2]) === 'catalog' || ref1 === 'archive') {
pathname[2] = 'thread'; g.VIEW = pathname[2];
pathname = pathname.slice(0, 4); } else if (pathname[2].match(/^\d*$/)) {
break; g.VIEW = 'index';
case 'index': } else {
pathname = pathname.slice(0, 3); return;
}
pathname = pathname.join('/');
if (location.pathname !== pathname) {
history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
}
} }
ref1 = Main.features; g.threads = new SimpleDict();
for (k = 0, len1 = ref1.length; k < len1; k++) { g.posts = new SimpleDict();
ref2 = ref1[k], name = ref2[0], feature = ref2[1]; $.onExists(doc, 'body', false, Main.initStyle);
ref2 = Main.features;
for (k = 0, len1 = ref2.length; k < len1; k++) {
ref3 = ref2[k], name = ref3[0], feature = ref3[1];
try { try {
feature.init(); feature.init();
} catch (_error) { } catch (_error) {
@ -17474,9 +17577,6 @@
}, },
initStyle: function() { initStyle: function() {
var keyboard, ref; var keyboard, ref;
if (location.hostname === 'www.4chan.org') {
$.addStyle(Main.cssWWW);
}
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return; return;
} }
@ -17504,14 +17604,7 @@
return Main.setClass(); return Main.setClass();
}, },
setClass: function() { setClass: function() {
var mainStyleSheet, setStyle, spooky, style, styleSheets; var mainStyleSheet, setStyle, style, styleSheets;
if ((spooky = $('link[rel="stylesheet"][href^="//s.4cdn.org/css/spooky."]', d.head))) {
spooky.removeAttribute('media');
if (getComputedStyle(d.body).color === 'rgb(196, 151, 86)') {
$.addClass(doc, 'spooky');
return;
}
}
if (g.VIEW === 'catalog') { if (g.VIEW === 'catalog') {
$.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-')); $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-'));
return; return;
@ -17541,7 +17634,7 @@
}); });
}, },
initReady: function() { initReady: function() {
var err, passLink, ref, ref1, styleSelector; var ref, ref1, why;
if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) { if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) {
ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
if (Conf['404 Redirect']) { if (Conf['404 Redirect']) {
@ -17557,32 +17650,20 @@
if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') { if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') {
return; return;
} }
if (styleSelector = $.id('styleSelector')) {
passLink = $.el('a', {
textContent: '4chan Pass',
href: 'javascript:;'
});
$.on(passLink, 'click', function() {
return window.open('//sys.4chan.org/auth', 'This will steal your data.', 'left=0,top=0,width=500,height=255,toolbar=0,resizable=0');
});
$.before(styleSelector.previousSibling, [$.tn('['), passLink, $.tn(']\u00A0\u00A0')]);
}
if (!(Conf['JSON Navigation'] && g.VIEW === 'index')) { if (!(Conf['JSON Navigation'] && g.VIEW === 'index')) {
Main.initThread(); Main.initThread();
} else { } else {
$.event('4chanXInitFinished'); $.event('4chanXInitFinished');
} }
if (Conf['Show Support Message']) { if (Conf['Show Support Message']) {
try { if ($.cantSync) {
return localStorage.getItem('4chan-settings'); why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs';
} catch (_error) { return new Notice('warning', "4chan X needs local storage to " + why + ".\nEnable it on boards.4chan.org in your browser's privacy settings\n(may be listed as part of \"local data\" or \"cookies\").");
err = _error;
return new Notice('warning', 'Cookies need to be enabled on 4chan for 4chan X to operate properly.', 30);
} }
} }
}, },
initThread: function() { initThread: function() {
var board, err, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads; var board, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads;
if (board = $('.board')) { if (board = $('.board')) {
threads = []; threads = [];
posts = []; posts = [];
@ -18809,6 +18890,7 @@
" max-height: 200px;\n" + " max-height: 200px;\n" +
" width: 100%;\n" + " width: 100%;\n" +
" overflow: auto;\n" + " overflow: auto;\n" +
" white-space: pre-line;\n" +
"}\n" + "}\n" +
"/* Settings */\n" + "/* Settings */\n" +
":root.fourchan-x body {\n" + ":root.fourchan-x body {\n" +
@ -20100,9 +20182,6 @@
".boardSubtitle[contenteditable=\"true\"] {\n" + ".boardSubtitle[contenteditable=\"true\"] {\n" +
" cursor: text !important;\n" + " cursor: text !important;\n" +
"}\n" + "}\n" +
"div.boardTitle {\n" +
" font-weight: 400 !important;\n" +
"}\n" +
"/* Link Title Favicons */\n" + "/* Link Title Favicons */\n" +
".linkify.audio {\n" + ".linkify.audio {\n" +
" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" + " background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
@ -20482,11 +20561,6 @@
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(128,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(128,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" + "}\n" +
"/* Board Title */\n" +
":root.yotsuba div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(100,0,0,0.6);\n" +
"}\n" +
"/* General */\n" + "/* General */\n" +
":root.yotsuba-b .dialog {\n" + ":root.yotsuba-b .dialog {\n" +
" background-color: #D6DAF0;\n" + " background-color: #D6DAF0;\n" +
@ -20558,11 +20632,6 @@
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(0,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(0,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" + "}\n" +
"/* Board Title */\n" +
":root.yotsuba-b div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n" +
"}\n" +
"/* General */\n" + "/* General */\n" +
":root.futaba .dialog {\n" + ":root.futaba .dialog {\n" +
" background-color: #F0E0D6;\n" + " background-color: #F0E0D6;\n" +
@ -20846,11 +20915,6 @@
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(197,200,198)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(197,200,198)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" + "}\n" +
"/* Board Title */\n" +
":root.tomorrow div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n" +
"}\n" +
"/* General */\n" + "/* General */\n" +
":root.photon .dialog {\n" + ":root.photon .dialog {\n" +
" background-color: #DDD;\n" + " background-color: #DDD;\n" +
@ -20928,133 +20992,8 @@
":root.photon .watch-thread-link\n" + ":root.photon .watch-thread-link\n" +
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(51,51,51)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(51,51,51)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" +
"/* Board Title */\n" +
":root.photon div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n" +
"}\n" +
"/* General */\n" +
":root.spooky .dialog {\n" +
" background-color: #171526;\n" +
" border-color: #707070;\n" +
"}\n" +
":root.spooky .field:focus,\n" +
":root.spooky .field.focus {\n" +
" border-color: #98E;\n" +
"}\n" +
"/* Header */\n" +
":root.spooky #header-bar.dialog {\n" +
" background-color: rgba(23,21,38,0.98);\n" +
"}\n" +
":root.spooky:not(.fixed) #header-bar, :root.spooky #notifications {\n" +
" font-size: 9pt;\n" +
"}\n" +
":root.spooky #header-bar, :root.spooky #notifications {\n" +
" color: #C49756;\n" +
"}\n" +
":root.spooky #board-list a, :root.spooky #shortcuts a {\n" +
" color: #FE9600;\n" +
"}\n" +
"/* Settings */\n" +
":root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before {\n" +
" border-color: #707070;\n" +
"}\n" +
":root.spooky .suboption-list > div:last-of-type {\n" +
" background-color: #171526;\n" +
"}\n" +
"/* Quote */\n" +
":root.spooky .catalog-thread > .comment > span.quote, :root.spooky #arc-list span.quote {\n" +
" color: #634C2C;\n" +
"}\n" +
":root.spooky .backlink.deadlink {\n" +
" color: #FE9600 !important;\n" +
"}\n" +
":root.spooky .inline {\n" +
" border-color: #707070;\n" +
" background-color: rgba(255, 255, 255, .14);\n" +
"}\n" +
"/* QR */\n" +
".spooky #dump-list::-webkit-scrollbar-thumb {\n" +
" background-color: #171526;\n" +
" border-color: #707070;\n" +
"}\n" +
":root.spooky .qr-preview {\n" +
" background-color: rgba(0, 0, 0, .15);\n" +
"}\n" +
":root.spooky #qr .field {\n" +
" background-color: rgb(26, 27, 29);\n" +
" color: rgb(197,200,198);\n" +
" border-color: rgb(40, 41, 42);\n" +
"}\n" +
":root.spooky #qr .field:focus,\n" +
":root.spooky #qr .field.focus {\n" +
" border-color: rgb(254, 150, 0) !important;\n" +
" background-color: rgb(30,32,36);\n" +
"}\n" +
":root.spooky .persona button {\n" +
" background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;\n" +
" color: rgb(197,200,198);\n" +
" border-color: rgb(40, 41, 42);\n" +
" outline: none;\n" +
"}\n" +
":root.spooky .persona button::-moz-focus-inner {\n" +
" border: none;\n" +
"}\n" +
":root.spooky .persona button:focus {\n" +
" border-color: rgb(254, 150, 0);\n" +
"}\n" +
":root.spooky #qr.sjis-preview #sjis-toggle,\n" +
":root.spooky #qr.tex-preview #tex-preview-button {\n" +
" background: rgb(26, 27, 29);\n" +
"}\n" +
":root.spooky #qr select,\n" +
":root.spooky #file-n-submit > input,\n" +
":root.spooky #qr-draw-button {\n" +
" border-color: rgb(40, 41, 42);\n" +
"}\n" +
":root.spooky #qr-filename {\n" +
" color: rgb(197,200,198);\n" +
"}\n" +
":root.spooky .qr-link {\n" +
" border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8);\n" +
" background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent;\n" +
"}\n" +
":root.spooky .qr-link:hover {\n" +
" background: #1A1829;\n" +
"}\n" +
"/* Menu */\n" +
":root.spooky #menu {\n" +
" color: #FE9600;\n" +
"}\n" +
":root.spooky .entry {\n" +
" font-size: 10pt;\n" +
"}\n" +
":root.spooky .focused.entry {\n" +
" background: rgba(255, 255, 255, .33);\n" +
"}\n" +
"/* Unread */\n" +
":root.spooky #unread-line {\n" +
" border-color: rgb(197, 200, 198);\n" +
"}\n" +
"/* Thread Watcher */\n" +
":root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.disabled.replies-quoting-you {\n" +
" color: #F00 !important;\n" +
"}\n" +
"/* Watcher Favicon */\n" +
":root.spooky .watch-thread-link\n" +
"{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(254,150,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" +
"/* Board Title */\n" +
":root.spooky div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n" +
"}", "}",
cssWWW: "#captcha-cnt {\n" + features: [['Polyfill', Polyfill], ['Normalize URL', NormalizeURL], ['Captcha Replacement', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Oekaki Links', QR.oekaki], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash]]
" height: auto;\n" +
"}",
features: [['Polyfill', Polyfill], ['Captcha Replacement', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Oekaki Links', QR.oekaki], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash]]
}; };
Main.init(); Main.init();

Binary file not shown.

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.11.15.7 // @version 1.11.16.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -11,8 +11,6 @@
// @include https://boards.4chan.org/* // @include https://boards.4chan.org/*
// @include http://sys.4chan.org/* // @include http://sys.4chan.org/*
// @include https://sys.4chan.org/* // @include https://sys.4chan.org/*
// @include http://a.4cdn.org/*
// @include https://a.4cdn.org/*
// @include http://i.4cdn.org/* // @include http://i.4cdn.org/*
// @include https://i.4cdn.org/* // @include https://i.4cdn.org/*
// @include http://www.4chan.org/banned // @include http://www.4chan.org/banned
@ -117,7 +115,7 @@
'use strict'; 'use strict';
(function() { (function() {
var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g, var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, NormalizeURL, Notice, PSAHiding, PassLink, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, err, g,
slice = [].slice, slice = [].slice,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
@ -154,7 +152,7 @@
'Remove Spoilers': [false, 'Remove all spoilers in text.'], 'Remove Spoilers': [false, 'Remove all spoilers in text.'],
'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'], 'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'],
'Show Support Message': [true, 'Warn if your browser or configuration is unsupported and may cause 4chan X to not operate correctly.'], 'Show Support Message': [true, 'Warn if your browser or configuration is unsupported and may cause 4chan X to not operate correctly.'],
'Normalize URL': [true, 'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'], 'Normalize URL': [true, 'Rewrite the URL of the current page, removing slugs and excess slashes, and changing /res/ to /thread/.'],
'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'], 'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'],
'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'], 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'],
'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.'] 'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.']
@ -250,7 +248,8 @@
'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1], 'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1],
'Captcha Fixes': [true, 'Make captcha easier to use, especially with the keyboard.'], 'Captcha Fixes': [true, 'Make captcha easier to use, especially with the keyboard.'],
'Use Recaptcha v1': [false, 'Use the old text version of Recaptcha.'], 'Use Recaptcha v1': [false, 'Use the old text version of Recaptcha.'],
'Use Recaptcha v2 in Reports': [false, 'Use the image selection captcha in the report window.'] 'Use Recaptcha v2 in Reports': [false, 'Use the image selection captcha in the report window.'],
'Pass Link': [true, 'Add a 4chan Pass login link to the bottom of the page.']
}, },
'Quote Links': { 'Quote Links': {
'Quote Backlinks': [true, 'Add quote backlinks.'], 'Quote Backlinks': [true, 'Add quote backlinks.'],
@ -313,7 +312,7 @@
FappeT: { FappeT: {
werk: false werk: false
}, },
'Custom CSS': false, 'Custom CSS': true,
Index: { Index: {
'Index Mode': 'paged', 'Index Mode': 'paged',
'Previous Index Mode': 'paged', 'Previous Index Mode': 'paged',
@ -345,7 +344,26 @@
backlink: '>>%id', backlink: '>>%id',
fileInfo: '%l (%p%s, %r%g)', fileInfo: '%l (%p%s, %r%g)',
favicon: 'ferongr', favicon: 'ferongr',
usercss: '', usercss: "/* Board title rice */\n" +
"div.boardTitle {\n" +
" font-weight: 400 !important;\n" +
"}\n" +
":root.yotsuba div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(100,0,0,0.6);\n" +
"}\n" +
":root.yotsuba-b div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n" +
"}\n" +
":root.photon div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n" +
"}\n" +
":root.tomorrow div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n" +
"}",
hotkeys: { hotkeys: {
'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'], 'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'],
'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'], 'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'],
@ -415,7 +433,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.11.15.7', VERSION: '1.11.16.0',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -942,6 +960,14 @@
} }
})(); })();
try {
localStorage.getItem('x');
$.hasStorage = true;
} catch (_error) {
err = _error;
$.hasStorage = false;
}
$.item = function(key, val) { $.item = function(key, val) {
var item; var item;
item = {}; item = {};
@ -956,7 +982,7 @@
$.listValues = function() { $.listValues = function() {
return GM_listValues(); return GM_listValues();
}; };
} else { } else if ($.hasStorage) {
$.getValue = function(key) { $.getValue = function(key) {
return localStorage[key]; return localStorage[key];
}; };
@ -970,6 +996,11 @@
} }
return results; return results;
}; };
} else {
$.getValue = function() {};
$.listValues = function() {
return [];
};
} }
if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
@ -981,17 +1012,24 @@
GM_setValue(key, val); GM_setValue(key, val);
if (key in $.syncing) { if (key in $.syncing) {
$.oldValue[key] = val; $.oldValue[key] = val;
return localStorage[key] = val; if ($.hasStorage) {
return localStorage[key] = val;
}
} }
}; };
$.deleteValue = function(key) { $.deleteValue = function(key) {
GM_deleteValue(key); GM_deleteValue(key);
if (key in $.syncing) { if (key in $.syncing) {
delete $.oldValue[key]; delete $.oldValue[key];
return delete localStorage[key]; if ($.hasStorage) {
return delete localStorage[key];
}
} }
}; };
} else { if (!$.hasStorage) {
$.cantSync = true;
}
} else if ($.hasStorage) {
$.oldValue = {}; $.oldValue = {};
$.setValue = function(key, val) { $.setValue = function(key, val) {
if (key in $.syncing) { if (key in $.syncing) {
@ -1005,6 +1043,10 @@
} }
return delete localStorage[key]; return delete localStorage[key];
}; };
} else {
$.setValue = function() {};
$.deleteValue = function() {};
$.cantSync = $.cantSet = true;
} }
if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
@ -1019,7 +1061,7 @@
}); });
}; };
$.forceSync = function() {}; $.forceSync = function() {};
} else { } else if ($.hasStorage) {
$.sync = function(key, cb) { $.sync = function(key, cb) {
key = g.NAMESPACE + key; key = g.NAMESPACE + key;
$.syncing[key] = cb; $.syncing[key] = cb;
@ -1053,6 +1095,9 @@
return onChange(g.NAMESPACE + key); return onChange(g.NAMESPACE + key);
}; };
})(); })();
} else {
$.sync = function() {};
$.forceSync = function() {};
} }
$["delete"] = function(keys) { $["delete"] = function(keys) {
@ -1143,7 +1188,7 @@
}; };
Callbacks.prototype.execute = function(node, keys) { Callbacks.prototype.execute = function(node, keys) {
var err, errors, k, len1, name, ref; var errors, k, len1, name, ref;
if (keys == null) { if (keys == null) {
keys = this.keys; keys = this.keys;
} }
@ -1891,17 +1936,17 @@
DataBoard.prototype.ajaxClean = function(boardID) { DataBoard.prototype.ajaxClean = function(boardID) {
return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) { return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) {
return function(e1) { return function(e1) {
if (e1.target.status === 200) { var ref;
if (boardID === 'b' || boardID === 'f' || boardID === 'trash') { if ((ref = e1.target.status) !== 200 && ref !== 404) {
return _this.ajaxCleanParse(boardID, e1.target.response); return;
} else {
return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
if (e2.target.status === 200) {
return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
}
});
}
} }
return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
var ref1;
if ((ref1 = e2.target.status) !== 200 && ref1 !== 404) {
return;
}
return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
});
}; };
})(this)); })(this));
}; };
@ -1910,14 +1955,16 @@
var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u; var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
board = this.data.boards[boardID]; board = this.data.boards[boardID];
threads = {}; threads = {};
for (k = 0, len1 = response1.length; k < len1; k++) { if (response1) {
page = response1[k]; for (k = 0, len1 = response1.length; k < len1; k++) {
ref = page.threads; page = response1[k];
for (q = 0, len2 = ref.length; q < len2; q++) { ref = page.threads;
thread = ref[q]; for (q = 0, len2 = ref.length; q < len2; q++) {
ID = thread.no; thread = ref[q];
if (ID in board) { ID = thread.no;
threads[ID] = board[ID]; if (ID in board) {
threads[ID] = board[ID];
}
} }
} }
} }
@ -3756,7 +3803,7 @@
return $.addClass(Index.button, 'fa-spin'); return $.addClass(Index.button, 'fa-spin');
}, },
load: function(e, state) { load: function(e, state) {
var err, nTimeout, notice, ref, req, timeEl; var nTimeout, notice, ref, req, timeEl;
$.rmClass(Index.button, 'fa-spin'); $.rmClass(Index.button, 'fa-spin');
req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout; req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
if (nTimeout) { if (nTimeout) {
@ -3840,7 +3887,7 @@
}); });
}, },
buildThreads: function() { buildThreads: function() {
var err, errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads; var errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads;
Index.nodes = []; Index.nodes = [];
threads = []; threads = [];
posts = []; posts = [];
@ -3887,7 +3934,7 @@
return $.event('IndexRefresh'); return $.event('IndexRefresh');
}, },
buildReplies: function(threadRoots) { buildReplies: function(threadRoots) {
var data, err, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot; var data, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot;
posts = []; posts = [];
for (k = 0, len1 = threadRoots.length; k < len1; k++) { for (k = 0, len1 = threadRoots.length; k < len1; k++) {
threadRoot = threadRoots[k]; threadRoot = threadRoots[k];
@ -4681,7 +4728,7 @@
}; };
Menu.prototype.insertEntry = function(entry, parent, data) { Menu.prototype.insertEntry = function(entry, parent, data) {
var err, k, len1, ref, subEntry, submenu; var k, len1, ref, subEntry, submenu;
if (typeof entry.open === 'function') { if (typeof entry.open === 'function') {
try { try {
if (!entry.open(data)) { if (!entry.open(data)) {
@ -5172,7 +5219,7 @@
Filter = { Filter = {
filters: {}, filters: {},
init: function() { init: function() {
var boards, err, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, regexp, stub, top; var boards, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, regexp, stub, top;
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) { if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
return; return;
} }
@ -5811,6 +5858,9 @@
}, },
catalogSet: function(board) { catalogSet: function(board) {
var hiddenThreads, threadID; var hiddenThreads, threadID;
if (!$.hasStorage) {
return;
}
hiddenThreads = ThreadHiding.db.get({ hiddenThreads = ThreadHiding.db.get({
boardID: board.ID, boardID: board.ID,
defaultValue: {} defaultValue: {}
@ -5821,8 +5871,11 @@
return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads)); return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads));
}, },
catalogWatch: function() { catalogWatch: function() {
if (!$.hasStorage) {
return;
}
this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
return $.ready(function() { return Main.ready(function() {
return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), { return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), {
attributes: true, attributes: true,
subtree: true, subtree: true,
@ -6998,7 +7051,6 @@
} }
}, },
open: function() { open: function() {
var err;
if (QR.nodes) { if (QR.nodes) {
if (QR.nodes.el.hidden) { if (QR.nodes.el.hidden) {
QR.captcha.setup(); QR.captcha.setup();
@ -7608,7 +7660,7 @@
return $.event('QRDialogCreation', null, dialog); return $.event('QRDialogCreation', null, dialog);
}, },
submit: function(e) { submit: function(e) {
var captcha, cb, err, extra, filetag, formData, options, post, ref, textOnly, thread, threadID; var captcha, cb, extra, filetag, formData, options, post, ref, textOnly, thread, threadID;
if (e != null) { if (e != null) {
e.preventDefault(); e.preventDefault();
} }
@ -7742,7 +7794,7 @@
return QR.status(); return QR.status();
}, },
response: function() { response: function() {
var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, seconds, threadID; var URL, _, ban, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, seconds, threadID;
req = QR.req; req = QR.req;
delete QR.req; delete QR.req;
post = QR.posts[0]; post = QR.posts[0];
@ -8559,7 +8611,7 @@
return this.conn.target = iframe; return this.conn.target = iframe;
}, },
setupJS: function() { setupJS: function() {
return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: (document.documentElement.classList.contains(\'tomorrow\') || document.documentElement.classList.contains(\'spooky\')) ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();'); return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: document.documentElement.classList.contains(\'tomorrow\') ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();');
}, },
afterSetup: function(mutations) { afterSetup: function(mutations) {
var iframe, k, len1, len2, mutation, node, q, ref, textarea; var iframe, k, len1, len2, mutation, node, q, ref, textarea;
@ -8754,6 +8806,31 @@
} }
}; };
PassLink = {
init: function() {
if (!Conf['Pass Link']) {
return;
}
return Main.ready(this.ready);
},
ready: function() {
var passLink, styleSelector;
if (!(styleSelector = $.id('styleSelector'))) {
return;
}
passLink = $.el('span', {
className: 'brackets-wrap pass-link-container'
});
$.extend(passLink, {
innerHTML: "<a href=\"javascript:;\">4chan Pass</a>"
});
$.on(passLink.firstElementChild, 'click', function() {
return window.open('//sys.4chan.org/auth', Date.now(), 'width=500,height=280,toolbar=0');
});
return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]);
}
};
PostSuccessful = { PostSuccessful = {
init: function() { init: function() {
return $.ready(this.ready); return $.ready(this.ready);
@ -11327,7 +11404,7 @@
Sauce = { Sauce = {
init: function() { init: function() {
var err, k, len1, link, links, ref, ref1; var k, len1, link, links, ref, ref1;
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) { if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
return; return;
} }
@ -15403,7 +15480,22 @@
} }
}, },
initReady: function() { initReady: function() {
return $.globalEval('if (JSON.parse(localStorage["4chan-settings"] || "{}").disableAll) SWFEmbed.init();'); if ($.hasStorage) {
return $.global(function() {
if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) {
return window.SWFEmbed.init();
}
});
} else {
if (g.VIEW === 'thread') {
$.global(function() {
return window.Main.tid = location.pathname.split(/\/+/)[3];
});
}
return $.global(function() {
return window.SWFEmbed.init();
});
}
} }
}; };
@ -16157,6 +16249,28 @@
} }
}; };
NormalizeURL = {
init: function() {
var pathname;
if (!Conf['Normalize URL']) {
return;
}
pathname = location.pathname.split(/\/+/);
switch (g.VIEW) {
case 'thread':
pathname[2] = 'thread';
pathname = pathname.slice(0, 4);
break;
case 'index':
pathname = pathname.slice(0, 3);
}
pathname = pathname.join('/');
if (location.pathname !== pathname) {
return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
}
}
};
RelativeDates = { RelativeDates = {
INTERVAL: $.MINUTE / 2, INTERVAL: $.MINUTE / 2,
init: function() { init: function() {
@ -16300,7 +16414,7 @@
"}", "}",
init: function() { init: function() {
var match; var match;
if (!(/\bmode=report\b/.test(location.search) && (match = location.search.match(/\bno=(\d+)/)))) { if (!(match = location.search.match(/\bno=(\d+)/))) {
return; return;
} }
Captcha.replace.init(); Captcha.replace.init();
@ -16521,12 +16635,20 @@
return Settings.open(e.detail); return Settings.open(e.detail);
}); });
if (Conf['Disable Native Extension']) { if (Conf['Disable Native Extension']) {
settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; if ($.hasStorage) {
if (settings.disableAll) { settings = JSON.parse(localStorage.getItem('4chan-settings')) || {};
return; if (settings.disableAll) {
return;
}
settings.disableAll = true;
return localStorage.setItem('4chan-settings', JSON.stringify(settings));
} else {
return $.onExists(doc, 'body', false, function() {
return $.global(function() {
return window.Config.disableAll = true;
});
});
} }
settings.disableAll = true;
return localStorage.setItem('4chan-settings', JSON.stringify(settings));
} }
}, },
open: function(openSection) { open: function(openSection) {
@ -16693,8 +16815,10 @@
return $.get('hiddenThreads', {}, function(arg) { return $.get('hiddenThreads', {}, function(arg) {
var boardID, hiddenThreads; var boardID, hiddenThreads;
hiddenThreads = arg.hiddenThreads; hiddenThreads = arg.hiddenThreads;
for (boardID in hiddenThreads.boards) { if ($.hasStorage) {
localStorage.removeItem("4chan-hide-t-" + boardID); for (boardID in hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
} }
return $["delete"](['hiddenThreads', 'hiddenPosts']); return $["delete"](['hiddenThreads', 'hiddenPosts']);
}); });
@ -16738,7 +16862,6 @@
} }
reader = new FileReader(); reader = new FileReader();
reader.onload = function(e) { reader.onload = function(e) {
var err;
try { try {
return Settings.loadSettings(JSON.parse(e.target.result), function(err) { return Settings.loadSettings(JSON.parse(e.target.result), function(err) {
if (err) { if (err) {
@ -16870,7 +16993,7 @@
} }
}, },
upgrade: function(data, version) { upgrade: function(data, version) {
var boardID, changes, compareString, name, record, ref, ref1, ref2, type, uids; var boardID, changes, compareString, name, record, ref, ref1, ref2, rice, type, uids;
changes = {}; changes = {};
compareString = version.replace(/\d+/g, function(x) { compareString = version.replace(/\d+/g, function(x) {
return ('0000' + x).slice(-5); return ('0000' + x).slice(-5);
@ -16911,6 +17034,13 @@
} }
} }
} }
if (compareString < '00001.00011.00016.00000') {
if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) {
if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) {
changes['usercss'] = rice + '\n\n' + data['usercss'];
}
}
}
return changes; return changes;
}, },
loadSettings: function(data, cb) { loadSettings: function(data, cb) {
@ -17259,7 +17389,7 @@
Main = { Main = {
init: function() { init: function() {
var db, flatten, items, k, key, len1, pathname, ref, ref1, ref2; var db, flatten, items, k, key, len1, ref;
if (d.body && !$('title', d.head)) { if (d.body && !$('title', d.head)) {
return; return;
} }
@ -17284,35 +17414,6 @@
}); });
return; return;
} }
g.threads = new SimpleDict();
g.posts = new SimpleDict();
pathname = location.pathname.split(/\/+/);
g.BOARD = new Board(pathname[1]);
if ((ref = g.BOARD.ID) === 'z' || ref === 'fk') {
return;
}
g.VIEW = (function() {
switch (pathname[2]) {
case 'res':
case 'thread':
return 'thread';
case 'catalog':
case 'archive':
case 'post':
return pathname[2];
default:
return 'index';
}
})();
if (g.VIEW === 'catalog' && g.BOARD.ID === 'f') {
return;
}
if (g.VIEW === 'archive' && ((ref1 = g.BOARD.ID) === 'b' || ref1 === 'f' || ref1 === 'trash')) {
return;
}
if (g.VIEW === 'thread') {
g.THREADID = +pathname[3];
}
flatten = function(parent, obj) { flatten = function(parent, obj) {
var key, val; var key, val;
if (obj instanceof Array) { if (obj instanceof Array) {
@ -17327,9 +17428,9 @@
} }
}; };
flatten(null, Config); flatten(null, Config);
ref2 = DataBoard.keys; ref = DataBoard.keys;
for (k = 0, len1 = ref2.length; k < len1; k++) { for (k = 0, len1 = ref.length; k < len1; k++) {
db = ref2[k]; db = ref[k];
Conf[db] = { Conf[db] = {
boards: {} boards: {}
}; };
@ -17342,12 +17443,14 @@
items[key] = void 0; items[key] = void 0;
} }
items['previousversion'] = void 0; items['previousversion'] = void 0;
$.get(items, function(items) { return $.get(items, function(items) {
return $.asap((function() { return $.asap((function() {
return doc = d.documentElement; return doc = d.documentElement;
}), function() { }), function() {
var ref3, val; var ref1, val;
if (items.previousversion == null) { if ($.cantSet) {
} else if (items.previousversion == null) {
Main.ready(function() { Main.ready(function() {
$.set('previousversion', g.VERSION); $.set('previousversion', g.VERSION);
return Settings.open(); return Settings.open();
@ -17357,16 +17460,11 @@
} }
for (key in Conf) { for (key in Conf) {
val = Conf[key]; val = Conf[key];
Conf[key] = (ref3 = items[key]) != null ? ref3 : val; Conf[key] = (ref1 = items[key]) != null ? ref1 : val;
} }
return Main.initFeatures(); return Main.initFeatures();
}); });
}); });
return $.asap((function() {
return doc = d.documentElement;
}), function() {
return $.onExists(doc, 'body', false, Main.initStyle);
});
}, },
upgrade: function(items) { upgrade: function(items) {
var changes, previousversion; var changes, previousversion;
@ -17387,43 +17485,50 @@
}); });
}, },
initFeatures: function() { initFeatures: function() {
var err, feature, k, len1, match, name, pathname, ref, ref1, ref2; var feature, hostname, k, len1, match, name, pathname, ref, ref1, ref2, ref3, search;
if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'sys.4chan.org' || ref === 'www.4chan.org') { hostname = location.hostname, search = location.search;
pathname = location.pathname.split(/\/+/);
if (hostname !== 'www.4chan.org') {
g.BOARD = new Board(pathname[1]);
}
if (hostname === 'boards.4chan.org' || hostname === 'sys.4chan.org' || hostname === 'www.4chan.org') {
$.global(function() { $.global(function() {
document.documentElement.classList.add('js-enabled'); document.documentElement.classList.add('js-enabled');
return window.FCX = {}; return window.FCX = {};
}); });
} }
switch (location.hostname) { switch (hostname) {
case 'www.4chan.org': case 'www.4chan.org':
Captcha.replace.init(); Captcha.replace.init();
return; return;
case 'a.4cdn.org':
return;
case 'sys.4chan.org': case 'sys.4chan.org':
Report.init(); if (pathname[2] === 'imgboard.php') {
if (g.VIEW === 'post') { if (/\bmode=report\b/.test(search)) {
Report.init();
} else if ((match = search.match(/\bres=(\d+)/))) {
$.ready(function() {
var ref;
if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') {
return Redirect.navigate('thread', {
boardID: g.BOARD.ID,
postID: +match[1]
});
}
});
}
} else if (pathname[2] === 'post') {
PostSuccessful.init(); PostSuccessful.init();
} }
if (Conf['404 Redirect'] && /\/imgboard\.php$/.test(location.pathname) && (match = location.search.match(/\bres=(\d+)/))) {
$.ready(function() {
var ref1;
if (((ref1 = $.id('errmsg')) != null ? ref1.textContent : void 0) === 'Error: Specified thread does not exist.') {
return Redirect.navigate('thread', {
boardID: g.BOARD.ID,
postID: +match[1]
});
}
});
}
return; return;
case 'i.4cdn.org': case 'i.4cdn.org':
if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) {
return;
}
$.asap((function() { $.asap((function() {
return d.readyState !== 'loading'; return d.readyState !== 'loading';
}), function() { }), function() {
var pathname, ref1, video; var ref, video;
if (Conf['404 Redirect'] && ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found')) { if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
pathname = location.pathname.split(/\/+/);
return Redirect.navigate('file', { return Redirect.navigate('file', {
boardID: g.BOARD.ID, boardID: g.BOARD.ID,
filename: pathname[pathname.length - 1] filename: pathname[pathname.length - 1]
@ -17442,24 +17547,22 @@
}); });
return; return;
} }
if (Conf['Normalize URL']) { if ((ref = pathname[2]) === 'thread' || ref === 'res') {
pathname = location.pathname.split(/\/+/); g.VIEW = 'thread';
switch (g.VIEW) { g.THREADID = +pathname[3];
case 'thread': } else if ((ref1 = pathname[2]) === 'catalog' || ref1 === 'archive') {
pathname[2] = 'thread'; g.VIEW = pathname[2];
pathname = pathname.slice(0, 4); } else if (pathname[2].match(/^\d*$/)) {
break; g.VIEW = 'index';
case 'index': } else {
pathname = pathname.slice(0, 3); return;
}
pathname = pathname.join('/');
if (location.pathname !== pathname) {
history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
}
} }
ref1 = Main.features; g.threads = new SimpleDict();
for (k = 0, len1 = ref1.length; k < len1; k++) { g.posts = new SimpleDict();
ref2 = ref1[k], name = ref2[0], feature = ref2[1]; $.onExists(doc, 'body', false, Main.initStyle);
ref2 = Main.features;
for (k = 0, len1 = ref2.length; k < len1; k++) {
ref3 = ref2[k], name = ref3[0], feature = ref3[1];
try { try {
feature.init(); feature.init();
} catch (_error) { } catch (_error) {
@ -17474,9 +17577,6 @@
}, },
initStyle: function() { initStyle: function() {
var keyboard, ref; var keyboard, ref;
if (location.hostname === 'www.4chan.org') {
$.addStyle(Main.cssWWW);
}
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return; return;
} }
@ -17504,14 +17604,7 @@
return Main.setClass(); return Main.setClass();
}, },
setClass: function() { setClass: function() {
var mainStyleSheet, setStyle, spooky, style, styleSheets; var mainStyleSheet, setStyle, style, styleSheets;
if ((spooky = $('link[rel="stylesheet"][href^="//s.4cdn.org/css/spooky."]', d.head))) {
spooky.removeAttribute('media');
if (getComputedStyle(d.body).color === 'rgb(196, 151, 86)') {
$.addClass(doc, 'spooky');
return;
}
}
if (g.VIEW === 'catalog') { if (g.VIEW === 'catalog') {
$.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-')); $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-'));
return; return;
@ -17541,7 +17634,7 @@
}); });
}, },
initReady: function() { initReady: function() {
var err, passLink, ref, ref1, styleSelector; var ref, ref1, why;
if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) { if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) {
ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
if (Conf['404 Redirect']) { if (Conf['404 Redirect']) {
@ -17557,32 +17650,20 @@
if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') { if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') {
return; return;
} }
if (styleSelector = $.id('styleSelector')) {
passLink = $.el('a', {
textContent: '4chan Pass',
href: 'javascript:;'
});
$.on(passLink, 'click', function() {
return window.open('//sys.4chan.org/auth', 'This will steal your data.', 'left=0,top=0,width=500,height=255,toolbar=0,resizable=0');
});
$.before(styleSelector.previousSibling, [$.tn('['), passLink, $.tn(']\u00A0\u00A0')]);
}
if (!(Conf['JSON Navigation'] && g.VIEW === 'index')) { if (!(Conf['JSON Navigation'] && g.VIEW === 'index')) {
Main.initThread(); Main.initThread();
} else { } else {
$.event('4chanXInitFinished'); $.event('4chanXInitFinished');
} }
if (Conf['Show Support Message']) { if (Conf['Show Support Message']) {
try { if ($.cantSync) {
return localStorage.getItem('4chan-settings'); why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs';
} catch (_error) { return new Notice('warning', "4chan X needs local storage to " + why + ".\nEnable it on boards.4chan.org in your browser's privacy settings\n(may be listed as part of \"local data\" or \"cookies\").");
err = _error;
return new Notice('warning', 'Cookies need to be enabled on 4chan for 4chan X to operate properly.', 30);
} }
} }
}, },
initThread: function() { initThread: function() {
var board, err, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads; var board, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads;
if (board = $('.board')) { if (board = $('.board')) {
threads = []; threads = [];
posts = []; posts = [];
@ -18809,6 +18890,7 @@
" max-height: 200px;\n" + " max-height: 200px;\n" +
" width: 100%;\n" + " width: 100%;\n" +
" overflow: auto;\n" + " overflow: auto;\n" +
" white-space: pre-line;\n" +
"}\n" + "}\n" +
"/* Settings */\n" + "/* Settings */\n" +
":root.fourchan-x body {\n" + ":root.fourchan-x body {\n" +
@ -20100,9 +20182,6 @@
".boardSubtitle[contenteditable=\"true\"] {\n" + ".boardSubtitle[contenteditable=\"true\"] {\n" +
" cursor: text !important;\n" + " cursor: text !important;\n" +
"}\n" + "}\n" +
"div.boardTitle {\n" +
" font-weight: 400 !important;\n" +
"}\n" +
"/* Link Title Favicons */\n" + "/* Link Title Favicons */\n" +
".linkify.audio {\n" + ".linkify.audio {\n" +
" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" + " background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
@ -20482,11 +20561,6 @@
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(128,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(128,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" + "}\n" +
"/* Board Title */\n" +
":root.yotsuba div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(100,0,0,0.6);\n" +
"}\n" +
"/* General */\n" + "/* General */\n" +
":root.yotsuba-b .dialog {\n" + ":root.yotsuba-b .dialog {\n" +
" background-color: #D6DAF0;\n" + " background-color: #D6DAF0;\n" +
@ -20558,11 +20632,6 @@
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(0,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(0,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" + "}\n" +
"/* Board Title */\n" +
":root.yotsuba-b div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n" +
"}\n" +
"/* General */\n" + "/* General */\n" +
":root.futaba .dialog {\n" + ":root.futaba .dialog {\n" +
" background-color: #F0E0D6;\n" + " background-color: #F0E0D6;\n" +
@ -20846,11 +20915,6 @@
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(197,200,198)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(197,200,198)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" + "}\n" +
"/* Board Title */\n" +
":root.tomorrow div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n" +
"}\n" +
"/* General */\n" + "/* General */\n" +
":root.photon .dialog {\n" + ":root.photon .dialog {\n" +
" background-color: #DDD;\n" + " background-color: #DDD;\n" +
@ -20928,133 +20992,8 @@
":root.photon .watch-thread-link\n" + ":root.photon .watch-thread-link\n" +
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(51,51,51)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(51,51,51)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" +
"/* Board Title */\n" +
":root.photon div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n" +
"}\n" +
"/* General */\n" +
":root.spooky .dialog {\n" +
" background-color: #171526;\n" +
" border-color: #707070;\n" +
"}\n" +
":root.spooky .field:focus,\n" +
":root.spooky .field.focus {\n" +
" border-color: #98E;\n" +
"}\n" +
"/* Header */\n" +
":root.spooky #header-bar.dialog {\n" +
" background-color: rgba(23,21,38,0.98);\n" +
"}\n" +
":root.spooky:not(.fixed) #header-bar, :root.spooky #notifications {\n" +
" font-size: 9pt;\n" +
"}\n" +
":root.spooky #header-bar, :root.spooky #notifications {\n" +
" color: #C49756;\n" +
"}\n" +
":root.spooky #board-list a, :root.spooky #shortcuts a {\n" +
" color: #FE9600;\n" +
"}\n" +
"/* Settings */\n" +
":root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before {\n" +
" border-color: #707070;\n" +
"}\n" +
":root.spooky .suboption-list > div:last-of-type {\n" +
" background-color: #171526;\n" +
"}\n" +
"/* Quote */\n" +
":root.spooky .catalog-thread > .comment > span.quote, :root.spooky #arc-list span.quote {\n" +
" color: #634C2C;\n" +
"}\n" +
":root.spooky .backlink.deadlink {\n" +
" color: #FE9600 !important;\n" +
"}\n" +
":root.spooky .inline {\n" +
" border-color: #707070;\n" +
" background-color: rgba(255, 255, 255, .14);\n" +
"}\n" +
"/* QR */\n" +
".spooky #dump-list::-webkit-scrollbar-thumb {\n" +
" background-color: #171526;\n" +
" border-color: #707070;\n" +
"}\n" +
":root.spooky .qr-preview {\n" +
" background-color: rgba(0, 0, 0, .15);\n" +
"}\n" +
":root.spooky #qr .field {\n" +
" background-color: rgb(26, 27, 29);\n" +
" color: rgb(197,200,198);\n" +
" border-color: rgb(40, 41, 42);\n" +
"}\n" +
":root.spooky #qr .field:focus,\n" +
":root.spooky #qr .field.focus {\n" +
" border-color: rgb(254, 150, 0) !important;\n" +
" background-color: rgb(30,32,36);\n" +
"}\n" +
":root.spooky .persona button {\n" +
" background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;\n" +
" color: rgb(197,200,198);\n" +
" border-color: rgb(40, 41, 42);\n" +
" outline: none;\n" +
"}\n" +
":root.spooky .persona button::-moz-focus-inner {\n" +
" border: none;\n" +
"}\n" +
":root.spooky .persona button:focus {\n" +
" border-color: rgb(254, 150, 0);\n" +
"}\n" +
":root.spooky #qr.sjis-preview #sjis-toggle,\n" +
":root.spooky #qr.tex-preview #tex-preview-button {\n" +
" background: rgb(26, 27, 29);\n" +
"}\n" +
":root.spooky #qr select,\n" +
":root.spooky #file-n-submit > input,\n" +
":root.spooky #qr-draw-button {\n" +
" border-color: rgb(40, 41, 42);\n" +
"}\n" +
":root.spooky #qr-filename {\n" +
" color: rgb(197,200,198);\n" +
"}\n" +
":root.spooky .qr-link {\n" +
" border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8);\n" +
" background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent;\n" +
"}\n" +
":root.spooky .qr-link:hover {\n" +
" background: #1A1829;\n" +
"}\n" +
"/* Menu */\n" +
":root.spooky #menu {\n" +
" color: #FE9600;\n" +
"}\n" +
":root.spooky .entry {\n" +
" font-size: 10pt;\n" +
"}\n" +
":root.spooky .focused.entry {\n" +
" background: rgba(255, 255, 255, .33);\n" +
"}\n" +
"/* Unread */\n" +
":root.spooky #unread-line {\n" +
" border-color: rgb(197, 200, 198);\n" +
"}\n" +
"/* Thread Watcher */\n" +
":root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.disabled.replies-quoting-you {\n" +
" color: #F00 !important;\n" +
"}\n" +
"/* Watcher Favicon */\n" +
":root.spooky .watch-thread-link\n" +
"{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(254,150,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" +
"/* Board Title */\n" +
":root.spooky div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n" +
"}", "}",
cssWWW: "#captcha-cnt {\n" + features: [['Polyfill', Polyfill], ['Normalize URL', NormalizeURL], ['Captcha Replacement', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Oekaki Links', QR.oekaki], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash]]
" height: auto;\n" +
"}",
features: [['Polyfill', Polyfill], ['Captcha Replacement', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Oekaki Links', QR.oekaki], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash]]
}; };
Main.init(); Main.init();

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.11.15.7 // @version 1.11.16.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -10,8 +10,6 @@
// @include https://boards.4chan.org/* // @include https://boards.4chan.org/*
// @include http://sys.4chan.org/* // @include http://sys.4chan.org/*
// @include https://sys.4chan.org/* // @include https://sys.4chan.org/*
// @include http://a.4cdn.org/*
// @include https://a.4cdn.org/*
// @include http://i.4cdn.org/* // @include http://i.4cdn.org/*
// @include https://i.4cdn.org/* // @include https://i.4cdn.org/*
// @include http://www.4chan.org/banned // @include http://www.4chan.org/banned

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.11.15.7 // @version 1.11.16.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -11,8 +11,6 @@
// @include https://boards.4chan.org/* // @include https://boards.4chan.org/*
// @include http://sys.4chan.org/* // @include http://sys.4chan.org/*
// @include https://sys.4chan.org/* // @include https://sys.4chan.org/*
// @include http://a.4cdn.org/*
// @include https://a.4cdn.org/*
// @include http://i.4cdn.org/* // @include http://i.4cdn.org/*
// @include https://i.4cdn.org/* // @include https://i.4cdn.org/*
// @include http://www.4chan.org/banned // @include http://www.4chan.org/banned
@ -117,7 +115,7 @@
'use strict'; 'use strict';
(function() { (function() {
var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g, var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, NormalizeURL, Notice, PSAHiding, PassLink, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, err, g,
slice = [].slice, slice = [].slice,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
@ -154,7 +152,7 @@
'Remove Spoilers': [false, 'Remove all spoilers in text.'], 'Remove Spoilers': [false, 'Remove all spoilers in text.'],
'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'], 'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'],
'Show Support Message': [true, 'Warn if your browser or configuration is unsupported and may cause 4chan X to not operate correctly.'], 'Show Support Message': [true, 'Warn if your browser or configuration is unsupported and may cause 4chan X to not operate correctly.'],
'Normalize URL': [true, 'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'], 'Normalize URL': [true, 'Rewrite the URL of the current page, removing slugs and excess slashes, and changing /res/ to /thread/.'],
'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'], 'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'],
'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'], 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'],
'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.'] 'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.']
@ -250,7 +248,8 @@
'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1], 'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1],
'Captcha Fixes': [true, 'Make captcha easier to use, especially with the keyboard.'], 'Captcha Fixes': [true, 'Make captcha easier to use, especially with the keyboard.'],
'Use Recaptcha v1': [false, 'Use the old text version of Recaptcha.'], 'Use Recaptcha v1': [false, 'Use the old text version of Recaptcha.'],
'Use Recaptcha v2 in Reports': [false, 'Use the image selection captcha in the report window.'] 'Use Recaptcha v2 in Reports': [false, 'Use the image selection captcha in the report window.'],
'Pass Link': [true, 'Add a 4chan Pass login link to the bottom of the page.']
}, },
'Quote Links': { 'Quote Links': {
'Quote Backlinks': [true, 'Add quote backlinks.'], 'Quote Backlinks': [true, 'Add quote backlinks.'],
@ -313,7 +312,7 @@
FappeT: { FappeT: {
werk: false werk: false
}, },
'Custom CSS': false, 'Custom CSS': true,
Index: { Index: {
'Index Mode': 'paged', 'Index Mode': 'paged',
'Previous Index Mode': 'paged', 'Previous Index Mode': 'paged',
@ -345,7 +344,26 @@
backlink: '>>%id', backlink: '>>%id',
fileInfo: '%l (%p%s, %r%g)', fileInfo: '%l (%p%s, %r%g)',
favicon: 'ferongr', favicon: 'ferongr',
usercss: '', usercss: "/* Board title rice */\n" +
"div.boardTitle {\n" +
" font-weight: 400 !important;\n" +
"}\n" +
":root.yotsuba div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(100,0,0,0.6);\n" +
"}\n" +
":root.yotsuba-b div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n" +
"}\n" +
":root.photon div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n" +
"}\n" +
":root.tomorrow div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n" +
"}",
hotkeys: { hotkeys: {
'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'], 'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'],
'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'], 'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'],
@ -415,7 +433,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.11.15.7', VERSION: '1.11.16.0',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -942,6 +960,14 @@
} }
})(); })();
try {
localStorage.getItem('x');
$.hasStorage = true;
} catch (_error) {
err = _error;
$.hasStorage = false;
}
$.item = function(key, val) { $.item = function(key, val) {
var item; var item;
item = {}; item = {};
@ -956,7 +982,7 @@
$.listValues = function() { $.listValues = function() {
return GM_listValues(); return GM_listValues();
}; };
} else { } else if ($.hasStorage) {
$.getValue = function(key) { $.getValue = function(key) {
return localStorage[key]; return localStorage[key];
}; };
@ -970,6 +996,11 @@
} }
return results; return results;
}; };
} else {
$.getValue = function() {};
$.listValues = function() {
return [];
};
} }
if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
@ -981,17 +1012,24 @@
GM_setValue(key, val); GM_setValue(key, val);
if (key in $.syncing) { if (key in $.syncing) {
$.oldValue[key] = val; $.oldValue[key] = val;
return localStorage[key] = val; if ($.hasStorage) {
return localStorage[key] = val;
}
} }
}; };
$.deleteValue = function(key) { $.deleteValue = function(key) {
GM_deleteValue(key); GM_deleteValue(key);
if (key in $.syncing) { if (key in $.syncing) {
delete $.oldValue[key]; delete $.oldValue[key];
return delete localStorage[key]; if ($.hasStorage) {
return delete localStorage[key];
}
} }
}; };
} else { if (!$.hasStorage) {
$.cantSync = true;
}
} else if ($.hasStorage) {
$.oldValue = {}; $.oldValue = {};
$.setValue = function(key, val) { $.setValue = function(key, val) {
if (key in $.syncing) { if (key in $.syncing) {
@ -1005,6 +1043,10 @@
} }
return delete localStorage[key]; return delete localStorage[key];
}; };
} else {
$.setValue = function() {};
$.deleteValue = function() {};
$.cantSync = $.cantSet = true;
} }
if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
@ -1019,7 +1061,7 @@
}); });
}; };
$.forceSync = function() {}; $.forceSync = function() {};
} else { } else if ($.hasStorage) {
$.sync = function(key, cb) { $.sync = function(key, cb) {
key = g.NAMESPACE + key; key = g.NAMESPACE + key;
$.syncing[key] = cb; $.syncing[key] = cb;
@ -1053,6 +1095,9 @@
return onChange(g.NAMESPACE + key); return onChange(g.NAMESPACE + key);
}; };
})(); })();
} else {
$.sync = function() {};
$.forceSync = function() {};
} }
$["delete"] = function(keys) { $["delete"] = function(keys) {
@ -1143,7 +1188,7 @@
}; };
Callbacks.prototype.execute = function(node, keys) { Callbacks.prototype.execute = function(node, keys) {
var err, errors, k, len1, name, ref; var errors, k, len1, name, ref;
if (keys == null) { if (keys == null) {
keys = this.keys; keys = this.keys;
} }
@ -1891,17 +1936,17 @@
DataBoard.prototype.ajaxClean = function(boardID) { DataBoard.prototype.ajaxClean = function(boardID) {
return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) { return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) {
return function(e1) { return function(e1) {
if (e1.target.status === 200) { var ref;
if (boardID === 'b' || boardID === 'f' || boardID === 'trash') { if ((ref = e1.target.status) !== 200 && ref !== 404) {
return _this.ajaxCleanParse(boardID, e1.target.response); return;
} else {
return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
if (e2.target.status === 200) {
return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
}
});
}
} }
return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
var ref1;
if ((ref1 = e2.target.status) !== 200 && ref1 !== 404) {
return;
}
return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
});
}; };
})(this)); })(this));
}; };
@ -1910,14 +1955,16 @@
var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u; var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
board = this.data.boards[boardID]; board = this.data.boards[boardID];
threads = {}; threads = {};
for (k = 0, len1 = response1.length; k < len1; k++) { if (response1) {
page = response1[k]; for (k = 0, len1 = response1.length; k < len1; k++) {
ref = page.threads; page = response1[k];
for (q = 0, len2 = ref.length; q < len2; q++) { ref = page.threads;
thread = ref[q]; for (q = 0, len2 = ref.length; q < len2; q++) {
ID = thread.no; thread = ref[q];
if (ID in board) { ID = thread.no;
threads[ID] = board[ID]; if (ID in board) {
threads[ID] = board[ID];
}
} }
} }
} }
@ -3756,7 +3803,7 @@
return $.addClass(Index.button, 'fa-spin'); return $.addClass(Index.button, 'fa-spin');
}, },
load: function(e, state) { load: function(e, state) {
var err, nTimeout, notice, ref, req, timeEl; var nTimeout, notice, ref, req, timeEl;
$.rmClass(Index.button, 'fa-spin'); $.rmClass(Index.button, 'fa-spin');
req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout; req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
if (nTimeout) { if (nTimeout) {
@ -3840,7 +3887,7 @@
}); });
}, },
buildThreads: function() { buildThreads: function() {
var err, errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads; var errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads;
Index.nodes = []; Index.nodes = [];
threads = []; threads = [];
posts = []; posts = [];
@ -3887,7 +3934,7 @@
return $.event('IndexRefresh'); return $.event('IndexRefresh');
}, },
buildReplies: function(threadRoots) { buildReplies: function(threadRoots) {
var data, err, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot; var data, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot;
posts = []; posts = [];
for (k = 0, len1 = threadRoots.length; k < len1; k++) { for (k = 0, len1 = threadRoots.length; k < len1; k++) {
threadRoot = threadRoots[k]; threadRoot = threadRoots[k];
@ -4681,7 +4728,7 @@
}; };
Menu.prototype.insertEntry = function(entry, parent, data) { Menu.prototype.insertEntry = function(entry, parent, data) {
var err, k, len1, ref, subEntry, submenu; var k, len1, ref, subEntry, submenu;
if (typeof entry.open === 'function') { if (typeof entry.open === 'function') {
try { try {
if (!entry.open(data)) { if (!entry.open(data)) {
@ -5172,7 +5219,7 @@
Filter = { Filter = {
filters: {}, filters: {},
init: function() { init: function() {
var boards, err, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, regexp, stub, top; var boards, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, regexp, stub, top;
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) { if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
return; return;
} }
@ -5811,6 +5858,9 @@
}, },
catalogSet: function(board) { catalogSet: function(board) {
var hiddenThreads, threadID; var hiddenThreads, threadID;
if (!$.hasStorage) {
return;
}
hiddenThreads = ThreadHiding.db.get({ hiddenThreads = ThreadHiding.db.get({
boardID: board.ID, boardID: board.ID,
defaultValue: {} defaultValue: {}
@ -5821,8 +5871,11 @@
return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads)); return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads));
}, },
catalogWatch: function() { catalogWatch: function() {
if (!$.hasStorage) {
return;
}
this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
return $.ready(function() { return Main.ready(function() {
return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), { return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), {
attributes: true, attributes: true,
subtree: true, subtree: true,
@ -6998,7 +7051,6 @@
} }
}, },
open: function() { open: function() {
var err;
if (QR.nodes) { if (QR.nodes) {
if (QR.nodes.el.hidden) { if (QR.nodes.el.hidden) {
QR.captcha.setup(); QR.captcha.setup();
@ -7608,7 +7660,7 @@
return $.event('QRDialogCreation', null, dialog); return $.event('QRDialogCreation', null, dialog);
}, },
submit: function(e) { submit: function(e) {
var captcha, cb, err, extra, filetag, formData, options, post, ref, textOnly, thread, threadID; var captcha, cb, extra, filetag, formData, options, post, ref, textOnly, thread, threadID;
if (e != null) { if (e != null) {
e.preventDefault(); e.preventDefault();
} }
@ -7742,7 +7794,7 @@
return QR.status(); return QR.status();
}, },
response: function() { response: function() {
var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, seconds, threadID; var URL, _, ban, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, req, resDoc, seconds, threadID;
req = QR.req; req = QR.req;
delete QR.req; delete QR.req;
post = QR.posts[0]; post = QR.posts[0];
@ -8559,7 +8611,7 @@
return this.conn.target = iframe; return this.conn.target = iframe;
}, },
setupJS: function() { setupJS: function() {
return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: (document.documentElement.classList.contains(\'tomorrow\') || document.documentElement.classList.contains(\'spooky\')) ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();'); return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: document.documentElement.classList.contains(\'tomorrow\') ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();');
}, },
afterSetup: function(mutations) { afterSetup: function(mutations) {
var iframe, k, len1, len2, mutation, node, q, ref, textarea; var iframe, k, len1, len2, mutation, node, q, ref, textarea;
@ -8754,6 +8806,31 @@
} }
}; };
PassLink = {
init: function() {
if (!Conf['Pass Link']) {
return;
}
return Main.ready(this.ready);
},
ready: function() {
var passLink, styleSelector;
if (!(styleSelector = $.id('styleSelector'))) {
return;
}
passLink = $.el('span', {
className: 'brackets-wrap pass-link-container'
});
$.extend(passLink, {
innerHTML: "<a href=\"javascript:;\">4chan Pass</a>"
});
$.on(passLink.firstElementChild, 'click', function() {
return window.open('//sys.4chan.org/auth', Date.now(), 'width=500,height=280,toolbar=0');
});
return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]);
}
};
PostSuccessful = { PostSuccessful = {
init: function() { init: function() {
return $.ready(this.ready); return $.ready(this.ready);
@ -11327,7 +11404,7 @@
Sauce = { Sauce = {
init: function() { init: function() {
var err, k, len1, link, links, ref, ref1; var k, len1, link, links, ref, ref1;
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) { if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
return; return;
} }
@ -15403,7 +15480,22 @@
} }
}, },
initReady: function() { initReady: function() {
return $.globalEval('if (JSON.parse(localStorage["4chan-settings"] || "{}").disableAll) SWFEmbed.init();'); if ($.hasStorage) {
return $.global(function() {
if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) {
return window.SWFEmbed.init();
}
});
} else {
if (g.VIEW === 'thread') {
$.global(function() {
return window.Main.tid = location.pathname.split(/\/+/)[3];
});
}
return $.global(function() {
return window.SWFEmbed.init();
});
}
} }
}; };
@ -16157,6 +16249,28 @@
} }
}; };
NormalizeURL = {
init: function() {
var pathname;
if (!Conf['Normalize URL']) {
return;
}
pathname = location.pathname.split(/\/+/);
switch (g.VIEW) {
case 'thread':
pathname[2] = 'thread';
pathname = pathname.slice(0, 4);
break;
case 'index':
pathname = pathname.slice(0, 3);
}
pathname = pathname.join('/');
if (location.pathname !== pathname) {
return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
}
}
};
RelativeDates = { RelativeDates = {
INTERVAL: $.MINUTE / 2, INTERVAL: $.MINUTE / 2,
init: function() { init: function() {
@ -16300,7 +16414,7 @@
"}", "}",
init: function() { init: function() {
var match; var match;
if (!(/\bmode=report\b/.test(location.search) && (match = location.search.match(/\bno=(\d+)/)))) { if (!(match = location.search.match(/\bno=(\d+)/))) {
return; return;
} }
Captcha.replace.init(); Captcha.replace.init();
@ -16521,12 +16635,20 @@
return Settings.open(e.detail); return Settings.open(e.detail);
}); });
if (Conf['Disable Native Extension']) { if (Conf['Disable Native Extension']) {
settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; if ($.hasStorage) {
if (settings.disableAll) { settings = JSON.parse(localStorage.getItem('4chan-settings')) || {};
return; if (settings.disableAll) {
return;
}
settings.disableAll = true;
return localStorage.setItem('4chan-settings', JSON.stringify(settings));
} else {
return $.onExists(doc, 'body', false, function() {
return $.global(function() {
return window.Config.disableAll = true;
});
});
} }
settings.disableAll = true;
return localStorage.setItem('4chan-settings', JSON.stringify(settings));
} }
}, },
open: function(openSection) { open: function(openSection) {
@ -16693,8 +16815,10 @@
return $.get('hiddenThreads', {}, function(arg) { return $.get('hiddenThreads', {}, function(arg) {
var boardID, hiddenThreads; var boardID, hiddenThreads;
hiddenThreads = arg.hiddenThreads; hiddenThreads = arg.hiddenThreads;
for (boardID in hiddenThreads.boards) { if ($.hasStorage) {
localStorage.removeItem("4chan-hide-t-" + boardID); for (boardID in hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
} }
return $["delete"](['hiddenThreads', 'hiddenPosts']); return $["delete"](['hiddenThreads', 'hiddenPosts']);
}); });
@ -16738,7 +16862,6 @@
} }
reader = new FileReader(); reader = new FileReader();
reader.onload = function(e) { reader.onload = function(e) {
var err;
try { try {
return Settings.loadSettings(JSON.parse(e.target.result), function(err) { return Settings.loadSettings(JSON.parse(e.target.result), function(err) {
if (err) { if (err) {
@ -16870,7 +16993,7 @@
} }
}, },
upgrade: function(data, version) { upgrade: function(data, version) {
var boardID, changes, compareString, name, record, ref, ref1, ref2, type, uids; var boardID, changes, compareString, name, record, ref, ref1, ref2, rice, type, uids;
changes = {}; changes = {};
compareString = version.replace(/\d+/g, function(x) { compareString = version.replace(/\d+/g, function(x) {
return ('0000' + x).slice(-5); return ('0000' + x).slice(-5);
@ -16911,6 +17034,13 @@
} }
} }
} }
if (compareString < '00001.00011.00016.00000') {
if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) {
if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) {
changes['usercss'] = rice + '\n\n' + data['usercss'];
}
}
}
return changes; return changes;
}, },
loadSettings: function(data, cb) { loadSettings: function(data, cb) {
@ -17259,7 +17389,7 @@
Main = { Main = {
init: function() { init: function() {
var db, flatten, items, k, key, len1, pathname, ref, ref1, ref2; var db, flatten, items, k, key, len1, ref;
if (d.body && !$('title', d.head)) { if (d.body && !$('title', d.head)) {
return; return;
} }
@ -17284,35 +17414,6 @@
}); });
return; return;
} }
g.threads = new SimpleDict();
g.posts = new SimpleDict();
pathname = location.pathname.split(/\/+/);
g.BOARD = new Board(pathname[1]);
if ((ref = g.BOARD.ID) === 'z' || ref === 'fk') {
return;
}
g.VIEW = (function() {
switch (pathname[2]) {
case 'res':
case 'thread':
return 'thread';
case 'catalog':
case 'archive':
case 'post':
return pathname[2];
default:
return 'index';
}
})();
if (g.VIEW === 'catalog' && g.BOARD.ID === 'f') {
return;
}
if (g.VIEW === 'archive' && ((ref1 = g.BOARD.ID) === 'b' || ref1 === 'f' || ref1 === 'trash')) {
return;
}
if (g.VIEW === 'thread') {
g.THREADID = +pathname[3];
}
flatten = function(parent, obj) { flatten = function(parent, obj) {
var key, val; var key, val;
if (obj instanceof Array) { if (obj instanceof Array) {
@ -17327,9 +17428,9 @@
} }
}; };
flatten(null, Config); flatten(null, Config);
ref2 = DataBoard.keys; ref = DataBoard.keys;
for (k = 0, len1 = ref2.length; k < len1; k++) { for (k = 0, len1 = ref.length; k < len1; k++) {
db = ref2[k]; db = ref[k];
Conf[db] = { Conf[db] = {
boards: {} boards: {}
}; };
@ -17342,12 +17443,14 @@
items[key] = void 0; items[key] = void 0;
} }
items['previousversion'] = void 0; items['previousversion'] = void 0;
$.get(items, function(items) { return $.get(items, function(items) {
return $.asap((function() { return $.asap((function() {
return doc = d.documentElement; return doc = d.documentElement;
}), function() { }), function() {
var ref3, val; var ref1, val;
if (items.previousversion == null) { if ($.cantSet) {
} else if (items.previousversion == null) {
Main.ready(function() { Main.ready(function() {
$.set('previousversion', g.VERSION); $.set('previousversion', g.VERSION);
return Settings.open(); return Settings.open();
@ -17357,16 +17460,11 @@
} }
for (key in Conf) { for (key in Conf) {
val = Conf[key]; val = Conf[key];
Conf[key] = (ref3 = items[key]) != null ? ref3 : val; Conf[key] = (ref1 = items[key]) != null ? ref1 : val;
} }
return Main.initFeatures(); return Main.initFeatures();
}); });
}); });
return $.asap((function() {
return doc = d.documentElement;
}), function() {
return $.onExists(doc, 'body', false, Main.initStyle);
});
}, },
upgrade: function(items) { upgrade: function(items) {
var changes, previousversion; var changes, previousversion;
@ -17387,43 +17485,50 @@
}); });
}, },
initFeatures: function() { initFeatures: function() {
var err, feature, k, len1, match, name, pathname, ref, ref1, ref2; var feature, hostname, k, len1, match, name, pathname, ref, ref1, ref2, ref3, search;
if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'sys.4chan.org' || ref === 'www.4chan.org') { hostname = location.hostname, search = location.search;
pathname = location.pathname.split(/\/+/);
if (hostname !== 'www.4chan.org') {
g.BOARD = new Board(pathname[1]);
}
if (hostname === 'boards.4chan.org' || hostname === 'sys.4chan.org' || hostname === 'www.4chan.org') {
$.global(function() { $.global(function() {
document.documentElement.classList.add('js-enabled'); document.documentElement.classList.add('js-enabled');
return window.FCX = {}; return window.FCX = {};
}); });
} }
switch (location.hostname) { switch (hostname) {
case 'www.4chan.org': case 'www.4chan.org':
Captcha.replace.init(); Captcha.replace.init();
return; return;
case 'a.4cdn.org':
return;
case 'sys.4chan.org': case 'sys.4chan.org':
Report.init(); if (pathname[2] === 'imgboard.php') {
if (g.VIEW === 'post') { if (/\bmode=report\b/.test(search)) {
Report.init();
} else if ((match = search.match(/\bres=(\d+)/))) {
$.ready(function() {
var ref;
if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') {
return Redirect.navigate('thread', {
boardID: g.BOARD.ID,
postID: +match[1]
});
}
});
}
} else if (pathname[2] === 'post') {
PostSuccessful.init(); PostSuccessful.init();
} }
if (Conf['404 Redirect'] && /\/imgboard\.php$/.test(location.pathname) && (match = location.search.match(/\bres=(\d+)/))) {
$.ready(function() {
var ref1;
if (((ref1 = $.id('errmsg')) != null ? ref1.textContent : void 0) === 'Error: Specified thread does not exist.') {
return Redirect.navigate('thread', {
boardID: g.BOARD.ID,
postID: +match[1]
});
}
});
}
return; return;
case 'i.4cdn.org': case 'i.4cdn.org':
if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) {
return;
}
$.asap((function() { $.asap((function() {
return d.readyState !== 'loading'; return d.readyState !== 'loading';
}), function() { }), function() {
var pathname, ref1, video; var ref, video;
if (Conf['404 Redirect'] && ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found')) { if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
pathname = location.pathname.split(/\/+/);
return Redirect.navigate('file', { return Redirect.navigate('file', {
boardID: g.BOARD.ID, boardID: g.BOARD.ID,
filename: pathname[pathname.length - 1] filename: pathname[pathname.length - 1]
@ -17442,24 +17547,22 @@
}); });
return; return;
} }
if (Conf['Normalize URL']) { if ((ref = pathname[2]) === 'thread' || ref === 'res') {
pathname = location.pathname.split(/\/+/); g.VIEW = 'thread';
switch (g.VIEW) { g.THREADID = +pathname[3];
case 'thread': } else if ((ref1 = pathname[2]) === 'catalog' || ref1 === 'archive') {
pathname[2] = 'thread'; g.VIEW = pathname[2];
pathname = pathname.slice(0, 4); } else if (pathname[2].match(/^\d*$/)) {
break; g.VIEW = 'index';
case 'index': } else {
pathname = pathname.slice(0, 3); return;
}
pathname = pathname.join('/');
if (location.pathname !== pathname) {
history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
}
} }
ref1 = Main.features; g.threads = new SimpleDict();
for (k = 0, len1 = ref1.length; k < len1; k++) { g.posts = new SimpleDict();
ref2 = ref1[k], name = ref2[0], feature = ref2[1]; $.onExists(doc, 'body', false, Main.initStyle);
ref2 = Main.features;
for (k = 0, len1 = ref2.length; k < len1; k++) {
ref3 = ref2[k], name = ref3[0], feature = ref3[1];
try { try {
feature.init(); feature.init();
} catch (_error) { } catch (_error) {
@ -17474,9 +17577,6 @@
}, },
initStyle: function() { initStyle: function() {
var keyboard, ref; var keyboard, ref;
if (location.hostname === 'www.4chan.org') {
$.addStyle(Main.cssWWW);
}
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return; return;
} }
@ -17504,14 +17604,7 @@
return Main.setClass(); return Main.setClass();
}, },
setClass: function() { setClass: function() {
var mainStyleSheet, setStyle, spooky, style, styleSheets; var mainStyleSheet, setStyle, style, styleSheets;
if ((spooky = $('link[rel="stylesheet"][href^="//s.4cdn.org/css/spooky."]', d.head))) {
spooky.removeAttribute('media');
if (getComputedStyle(d.body).color === 'rgb(196, 151, 86)') {
$.addClass(doc, 'spooky');
return;
}
}
if (g.VIEW === 'catalog') { if (g.VIEW === 'catalog') {
$.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-')); $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-'));
return; return;
@ -17541,7 +17634,7 @@
}); });
}, },
initReady: function() { initReady: function() {
var err, passLink, ref, ref1, styleSelector; var ref, ref1, why;
if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) { if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) {
ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
if (Conf['404 Redirect']) { if (Conf['404 Redirect']) {
@ -17557,32 +17650,20 @@
if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') { if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') {
return; return;
} }
if (styleSelector = $.id('styleSelector')) {
passLink = $.el('a', {
textContent: '4chan Pass',
href: 'javascript:;'
});
$.on(passLink, 'click', function() {
return window.open('//sys.4chan.org/auth', 'This will steal your data.', 'left=0,top=0,width=500,height=255,toolbar=0,resizable=0');
});
$.before(styleSelector.previousSibling, [$.tn('['), passLink, $.tn(']\u00A0\u00A0')]);
}
if (!(Conf['JSON Navigation'] && g.VIEW === 'index')) { if (!(Conf['JSON Navigation'] && g.VIEW === 'index')) {
Main.initThread(); Main.initThread();
} else { } else {
$.event('4chanXInitFinished'); $.event('4chanXInitFinished');
} }
if (Conf['Show Support Message']) { if (Conf['Show Support Message']) {
try { if ($.cantSync) {
return localStorage.getItem('4chan-settings'); why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs';
} catch (_error) { return new Notice('warning', "4chan X needs local storage to " + why + ".\nEnable it on boards.4chan.org in your browser's privacy settings\n(may be listed as part of \"local data\" or \"cookies\").");
err = _error;
return new Notice('warning', 'Cookies need to be enabled on 4chan for 4chan X to operate properly.', 30);
} }
} }
}, },
initThread: function() { initThread: function() {
var board, err, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads; var board, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads;
if (board = $('.board')) { if (board = $('.board')) {
threads = []; threads = [];
posts = []; posts = [];
@ -18809,6 +18890,7 @@
" max-height: 200px;\n" + " max-height: 200px;\n" +
" width: 100%;\n" + " width: 100%;\n" +
" overflow: auto;\n" + " overflow: auto;\n" +
" white-space: pre-line;\n" +
"}\n" + "}\n" +
"/* Settings */\n" + "/* Settings */\n" +
":root.fourchan-x body {\n" + ":root.fourchan-x body {\n" +
@ -20100,9 +20182,6 @@
".boardSubtitle[contenteditable=\"true\"] {\n" + ".boardSubtitle[contenteditable=\"true\"] {\n" +
" cursor: text !important;\n" + " cursor: text !important;\n" +
"}\n" + "}\n" +
"div.boardTitle {\n" +
" font-weight: 400 !important;\n" +
"}\n" +
"/* Link Title Favicons */\n" + "/* Link Title Favicons */\n" +
".linkify.audio {\n" + ".linkify.audio {\n" +
" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" + " background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
@ -20482,11 +20561,6 @@
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(128,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(128,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" + "}\n" +
"/* Board Title */\n" +
":root.yotsuba div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(100,0,0,0.6);\n" +
"}\n" +
"/* General */\n" + "/* General */\n" +
":root.yotsuba-b .dialog {\n" + ":root.yotsuba-b .dialog {\n" +
" background-color: #D6DAF0;\n" + " background-color: #D6DAF0;\n" +
@ -20558,11 +20632,6 @@
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(0,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(0,0,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" + "}\n" +
"/* Board Title */\n" +
":root.yotsuba-b div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n" +
"}\n" +
"/* General */\n" + "/* General */\n" +
":root.futaba .dialog {\n" + ":root.futaba .dialog {\n" +
" background-color: #F0E0D6;\n" + " background-color: #F0E0D6;\n" +
@ -20846,11 +20915,6 @@
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(197,200,198)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(197,200,198)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" + "}\n" +
"/* Board Title */\n" +
":root.tomorrow div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n" +
"}\n" +
"/* General */\n" + "/* General */\n" +
":root.photon .dialog {\n" + ":root.photon .dialog {\n" +
" background-color: #DDD;\n" + " background-color: #DDD;\n" +
@ -20928,133 +20992,8 @@
":root.photon .watch-thread-link\n" + ":root.photon .watch-thread-link\n" +
"{\n" + "{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(51,51,51)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" + " background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(51,51,51)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" +
"/* Board Title */\n" +
":root.photon div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n" +
"}\n" +
"/* General */\n" +
":root.spooky .dialog {\n" +
" background-color: #171526;\n" +
" border-color: #707070;\n" +
"}\n" +
":root.spooky .field:focus,\n" +
":root.spooky .field.focus {\n" +
" border-color: #98E;\n" +
"}\n" +
"/* Header */\n" +
":root.spooky #header-bar.dialog {\n" +
" background-color: rgba(23,21,38,0.98);\n" +
"}\n" +
":root.spooky:not(.fixed) #header-bar, :root.spooky #notifications {\n" +
" font-size: 9pt;\n" +
"}\n" +
":root.spooky #header-bar, :root.spooky #notifications {\n" +
" color: #C49756;\n" +
"}\n" +
":root.spooky #board-list a, :root.spooky #shortcuts a {\n" +
" color: #FE9600;\n" +
"}\n" +
"/* Settings */\n" +
":root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before {\n" +
" border-color: #707070;\n" +
"}\n" +
":root.spooky .suboption-list > div:last-of-type {\n" +
" background-color: #171526;\n" +
"}\n" +
"/* Quote */\n" +
":root.spooky .catalog-thread > .comment > span.quote, :root.spooky #arc-list span.quote {\n" +
" color: #634C2C;\n" +
"}\n" +
":root.spooky .backlink.deadlink {\n" +
" color: #FE9600 !important;\n" +
"}\n" +
":root.spooky .inline {\n" +
" border-color: #707070;\n" +
" background-color: rgba(255, 255, 255, .14);\n" +
"}\n" +
"/* QR */\n" +
".spooky #dump-list::-webkit-scrollbar-thumb {\n" +
" background-color: #171526;\n" +
" border-color: #707070;\n" +
"}\n" +
":root.spooky .qr-preview {\n" +
" background-color: rgba(0, 0, 0, .15);\n" +
"}\n" +
":root.spooky #qr .field {\n" +
" background-color: rgb(26, 27, 29);\n" +
" color: rgb(197,200,198);\n" +
" border-color: rgb(40, 41, 42);\n" +
"}\n" +
":root.spooky #qr .field:focus,\n" +
":root.spooky #qr .field.focus {\n" +
" border-color: rgb(254, 150, 0) !important;\n" +
" background-color: rgb(30,32,36);\n" +
"}\n" +
":root.spooky .persona button {\n" +
" background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;\n" +
" color: rgb(197,200,198);\n" +
" border-color: rgb(40, 41, 42);\n" +
" outline: none;\n" +
"}\n" +
":root.spooky .persona button::-moz-focus-inner {\n" +
" border: none;\n" +
"}\n" +
":root.spooky .persona button:focus {\n" +
" border-color: rgb(254, 150, 0);\n" +
"}\n" +
":root.spooky #qr.sjis-preview #sjis-toggle,\n" +
":root.spooky #qr.tex-preview #tex-preview-button {\n" +
" background: rgb(26, 27, 29);\n" +
"}\n" +
":root.spooky #qr select,\n" +
":root.spooky #file-n-submit > input,\n" +
":root.spooky #qr-draw-button {\n" +
" border-color: rgb(40, 41, 42);\n" +
"}\n" +
":root.spooky #qr-filename {\n" +
" color: rgb(197,200,198);\n" +
"}\n" +
":root.spooky .qr-link {\n" +
" border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8);\n" +
" background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent;\n" +
"}\n" +
":root.spooky .qr-link:hover {\n" +
" background: #1A1829;\n" +
"}\n" +
"/* Menu */\n" +
":root.spooky #menu {\n" +
" color: #FE9600;\n" +
"}\n" +
":root.spooky .entry {\n" +
" font-size: 10pt;\n" +
"}\n" +
":root.spooky .focused.entry {\n" +
" background: rgba(255, 255, 255, .33);\n" +
"}\n" +
"/* Unread */\n" +
":root.spooky #unread-line {\n" +
" border-color: rgb(197, 200, 198);\n" +
"}\n" +
"/* Thread Watcher */\n" +
":root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.disabled.replies-quoting-you {\n" +
" color: #F00 !important;\n" +
"}\n" +
"/* Watcher Favicon */\n" +
":root.spooky .watch-thread-link\n" +
"{\n" +
" background-image: url(\"data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(254,150,0)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>\");\n" +
"}\n" +
"/* Board Title */\n" +
":root.spooky div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n" +
"}", "}",
cssWWW: "#captcha-cnt {\n" + features: [['Polyfill', Polyfill], ['Normalize URL', NormalizeURL], ['Captcha Replacement', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Oekaki Links', QR.oekaki], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash]]
" height: auto;\n" +
"}",
features: [['Polyfill', Polyfill], ['Captcha Replacement', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Oekaki Links', QR.oekaki], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash]]
}; };
Main.init(); Main.init();

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'> <app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.11.15.7' /> <updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.11.16.0' />
</app> </app>
</gupdate> </gupdate>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'> <app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.11.15.7' /> <updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.11.16.0' />
</app> </app>
</gupdate> </gupdate>

View File

@ -1,4 +1,4 @@
{ {
"version": "1.11.15.7", "version": "1.11.16.0",
"date": "2015-11-07T21:55:38.769Z" "date": "2015-11-09T05:06:57.649Z"
} }