diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index d4e243afb..06b3ddda6 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -113,7 +113,6 @@
Array.prototype.indexOf = function(val) {
var i;
-
i = this.length;
while (i--) {
if (this[i] === val) {
@@ -375,7 +374,6 @@
$.extend = function(obj, prop) {
var key, val;
-
for (key in prop) {
val = prop[key];
if (prop.hasOwnProperty(key)) {
@@ -392,7 +390,6 @@
$.ready = function(fc) {
var cb;
-
if (d.readyState !== 'loading') {
$.queueTask(fc);
return;
@@ -406,7 +403,6 @@
$.formData = function(form) {
var fd, key, val;
-
if (form instanceof HTMLFormElement) {
return new FormData(form);
}
@@ -426,7 +422,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
object[key] = val;
@@ -435,11 +430,9 @@
$.ajax = (function() {
var lastModified;
-
lastModified = {};
return function(url, options, extra) {
var form, r, sync, type, upCallbacks, whenModified;
-
if (extra == null) {
extra = {};
}
@@ -464,11 +457,9 @@
$.cache = (function() {
var reqs;
-
reqs = {};
return function(url, cb, options) {
var err, req, rm;
-
if (req = reqs[url]) {
if (req.readyState === 4) {
cb.call(req, req.evt);
@@ -488,7 +479,6 @@
}
$.on(req, 'load', function(e) {
var _i, _len, _ref;
-
_ref = this.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
cb = _ref[_i];
@@ -524,7 +514,6 @@
$.addStyle = function(css, id) {
var style;
-
style = $.el('style', {
id: id,
textContent: css
@@ -571,7 +560,6 @@
} else {
return function(el) {
var _ref;
-
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
};
}
@@ -579,7 +567,6 @@
$.rmAll = function(root) {
var node, _i, _len, _ref;
-
_ref = __slice.call(root.childNodes);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
node = _ref[_i];
@@ -597,7 +584,6 @@
$.nodes = function(nodes) {
var frag, node, _i, _len;
-
if (!(nodes instanceof Array)) {
return nodes;
}
@@ -631,7 +617,6 @@
$.el = function(tag, properties) {
var el;
-
el = d.createElement(tag);
if (properties) {
$.extend(el, properties);
@@ -641,7 +626,6 @@
$.on = function(el, events, handler) {
var event, _i, _len, _ref;
-
_ref = events.split(' ');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
event = _ref[_i];
@@ -651,7 +635,6 @@
$.off = function(el, events, handler) {
var event, _i, _len, _ref;
-
_ref = events.split(' ');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
event = _ref[_i];
@@ -673,7 +656,6 @@
$.debounce = function(wait, fn) {
var args, exec, lastCall, that, timeout;
-
lastCall = 0;
timeout = null;
that = null;
@@ -695,11 +677,9 @@
$.queueTask = (function() {
var execTask, taskChannel, taskQueue;
-
taskQueue = [];
execTask = function() {
var args, func, task;
-
task = taskQueue.shift();
func = task[0];
args = Array.prototype.slice.call(task, 1);
@@ -722,7 +702,6 @@
$.globalEval = function(code) {
var script;
-
script = $.el('script', {
textContent: code
});
@@ -732,7 +711,6 @@
$.bytesToString = function(size) {
var unit;
-
unit = 0;
while (size >= 1024) {
size /= 1024;
@@ -748,7 +726,6 @@
$.item = function(key, val) {
var item;
-
item = {};
item[key] = val;
return item;
@@ -759,7 +736,6 @@
$.sync = (function() {
$.on(window, 'storage', function(_arg) {
var cb, key, newValue;
-
key = _arg.key, newValue = _arg.newValue;
if (cb = $.syncing[key]) {
return cb(JSON.parse(newValue), key);
@@ -772,7 +748,6 @@
$["delete"] = function(keys) {
var key, _i, _len;
-
if (!(keys instanceof Array)) {
keys = [keys];
}
@@ -786,7 +761,6 @@
$.get = function(key, val, cb) {
var items;
-
if (typeof cb === 'function') {
items = $.item(key, val);
} else {
@@ -805,7 +779,6 @@
$.set = (function() {
var set;
-
set = function(key, val) {
key = g.NAMESPACE + key;
val = JSON.stringify(val);
@@ -816,7 +789,6 @@
};
return function(keys, val) {
var key;
-
if (typeof keys === 'string') {
set(keys, val);
return;
@@ -872,7 +844,6 @@
Thread.prototype.setPage = function(pageNum) {
var icon, key, _i, _len, _ref;
-
icon = $('.page-num', this.OP.nodes.post);
_ref = ['title', 'textContent'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -883,7 +854,6 @@
Thread.prototype.setStatus = function(type, status) {
var icon, name, root, typeLC;
-
name = "is" + type;
if (this[name] === status) {
return;
@@ -914,7 +884,6 @@
Thread.prototype.collect = function() {
var post, postID, _i, _len, _ref;
-
_ref = this.posts;
for (post = _i = 0, _len = _ref.length; _i < _len; post = ++_i) {
postID = _ref[post];
@@ -937,7 +906,6 @@
function Post(root, thread, board, that) {
var capcode, date, email, flag, info, name, post, subject, tripcode, uniqueID;
-
this.thread = thread;
this.board = board;
if (that == null) {
@@ -1016,7 +984,6 @@
Post.prototype.parseComment = function() {
var bq, i, node, nodes, text;
-
this.nodes.comment.normalize();
bq = this.nodes.comment.cloneNode(true);
nodes = $$('.abbr, .exif, b', bq);
@@ -1035,7 +1002,6 @@
Post.prototype.parseQuotes = function() {
var quotelink, _i, _len, _ref;
-
this.quotes = [];
_ref = $$('.quotelink', this.nodes.comment);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -1046,7 +1012,6 @@
Post.prototype.parseQuote = function(quotelink) {
var fullID, match;
-
if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) {
return;
}
@@ -1062,7 +1027,6 @@
Post.prototype.parseFile = function(that) {
var anchor, fileEl, fileText, nameNode, size, thumb, unit;
-
if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) {
return;
}
@@ -1091,7 +1055,6 @@
Post.prototype.cleanup = function(root) {
var node, _i, _j, _len, _len1, _ref, _ref1;
-
_ref = $$('.mobile', root);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
node = _ref[_i];
@@ -1106,7 +1069,6 @@
Post.prototype.kill = function(file, now) {
var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
-
now || (now = new Date());
if (file) {
if (this.file.isDead) {
@@ -1155,7 +1117,6 @@
Post.prototype.resurrect = function() {
var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
-
delete this.isDead;
delete this.timeOfDeath;
$.rmClass(this.nodes.root, 'deleted-post');
@@ -1196,7 +1157,6 @@
Post.prototype.rmClone = function(index) {
var clone, _i, _len, _ref;
-
this.clones.splice(index, 1);
_ref = this.clones.slice(index);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -1214,7 +1174,6 @@
function Clone(origin, context) {
var file, info, inline, inlined, key, nodes, post, root, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;
-
this.origin = origin;
this.context = context;
_ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
@@ -1301,7 +1260,6 @@
function DataBoard(key, sync, dontClean) {
var init,
_this = this;
-
this.key = key;
this.onSync = __bind(this.onSync, this);
this.data = Conf[key];
@@ -1325,7 +1283,6 @@
DataBoard.prototype["delete"] = function(_arg) {
var boardID, postID, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID;
if (postID) {
delete this.data.boards[boardID][threadID][postID];
@@ -1346,7 +1303,6 @@
DataBoard.prototype.deleteIfEmpty = function(_arg) {
var boardID, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID;
if (threadID) {
if (!Object.keys(this.data.boards[boardID][threadID]).length) {
@@ -1362,7 +1318,6 @@
DataBoard.prototype.set = function(_arg) {
var boardID, postID, threadID, val, _base, _base1, _base2;
-
boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val;
if (postID !== void 0) {
((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val;
@@ -1376,7 +1331,6 @@
DataBoard.prototype.get = function(_arg) {
var ID, board, boardID, defaultValue, postID, thread, threadID, val, _i, _len;
-
boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, defaultValue = _arg.defaultValue;
if (board = this.data.boards[boardID]) {
if (!threadID) {
@@ -1400,7 +1354,6 @@
DataBoard.prototype.clean = function() {
var boardID, now, val, _ref;
-
_ref = this.data.boards;
for (boardID in _ref) {
val = _ref[boardID];
@@ -1420,10 +1373,8 @@
DataBoard.prototype.ajaxClean = function(boardID) {
var _this = this;
-
return $.cache("//a.4cdn.org/" + boardID + "/threads.json", function(e) {
var board, page, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (e.target.status !== 200) {
if (e.target.status === 404) {
_this["delete"](boardID);
@@ -1528,10 +1479,8 @@
},
toBlob: function() {
var _base;
-
return (_base = HTMLCanvasElement.prototype).toBlob || (_base.toBlob = function(cb) {
var data, i, l, ui8a, _i;
-
data = atob(this.toDataURL().slice(22));
l = data.length;
ui8a = new Uint8Array(l);
@@ -1569,7 +1518,6 @@
init: function() {
var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler,
_this = this;
-
this.menu = new UI.Menu('header');
menuButton = $.el('span', {
className: 'menu-button',
@@ -1680,7 +1628,6 @@
});
$.ready(function() {
var a, cs;
-
_this.footer = $.id('boardNavDesktopFoot');
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
a.className = 'current';
@@ -1715,7 +1662,6 @@
}),
setBoardList: function() {
var a, boardList, btn, fourchannav, fullBoardList;
-
fourchannav = $.id('boardNavDesktop');
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
a.className = 'current';
@@ -1737,7 +1683,6 @@
},
generateBoardList: function(text) {
var as, list, nodes;
-
list = $('#custom-board-list', Header.bar);
$.rmAll(list);
if (!text) {
@@ -1746,7 +1691,6 @@
as = $$('#full-board-list a[title]', Header.bar);
nodes = text.match(/[\w@]+((-(all|title|replace|full|index|catalog|url:"[^"]+[^"]"|text:"[^"]+")|\,"[^"]+[^"]"))*|[^\w@]+/g).map(function(t) {
var a, board, m, _i, _len;
-
if (/^[^\w@]/.test(t)) {
return $.tn(t);
}
@@ -1797,7 +1741,6 @@
},
toggleBoardList: function() {
var bar, custom, full, showBoardList;
-
bar = Header.bar;
custom = $('#custom-board-list', bar);
full = $('#full-board-list', bar);
@@ -1815,7 +1758,6 @@
},
toggleLinkJustify: function() {
var centered;
-
$.event('CloseMenu');
centered = this.nodeName === 'INPUT' ? this.checked : void 0;
Header.setLinkJustify(centered);
@@ -1859,7 +1801,6 @@
},
toggleBarVisibility: function() {
var hide, message;
-
hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
this.checked = hide;
$.set('Header auto-hide', Conf['Header auto-hide'] = hide);
@@ -1881,14 +1822,12 @@
},
toggleHideBarOnScroll: function(e) {
var hide;
-
hide = this.checked;
$.set('Header auto-hide on scroll', hide);
return Header.setHideBarOnScroll(hide);
},
hideBarOnScroll: function() {
var offsetY;
-
offsetY = window.pageYOffset;
if (offsetY > (Header.previousOffset || 0)) {
$.addClass(Header.bar, 'autohide');
@@ -1901,7 +1840,6 @@
},
setBarPosition: function(bottom) {
var args;
-
Header.barPositionToggler.checked = bottom;
$.event('CloseMenu');
args = bottom ? ['bottom-header', 'top-header', 'bottom', 'after'] : ['top-header', 'bottom-header', 'top', 'add'];
@@ -1920,7 +1858,6 @@
},
toggleFooterVisibility: function() {
var hide, message;
-
$.event('CloseMenu');
hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden;
Header.setFooterVisibility(hide);
@@ -1930,7 +1867,6 @@
},
setCustomNav: function(show) {
var btn, cust, full, _ref;
-
Header.customNavToggler.checked = show;
cust = $('#custom-board-list', Header.bar);
full = $('#full-board-list', Header.bar);
@@ -1943,14 +1879,12 @@
},
editCustomNav: function() {
var settings;
-
Settings.open('Advanced');
settings = $.id('fourchanx-settings');
return $('input[name=boardnav]', settings).focus();
},
hashScroll: function() {
var hash, post;
-
hash = this.location.hash.slice(1);
if (!(/^p\d+$/.test(hash) && (post = $.id(hash)))) {
return;
@@ -1962,7 +1896,6 @@
},
scrollTo: function(root, down, needed) {
var x;
-
if (down) {
x = Header.getBottomOf(root);
if (!(needed && x >= 0)) {
@@ -1980,7 +1913,6 @@
},
getTopOf: function(root) {
var headRect, top;
-
top = root.getBoundingClientRect().top;
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
headRect = Header.toggle.getBoundingClientRect();
@@ -1990,7 +1922,6 @@
},
getBottomOf: function(root) {
var bottom, clientHeight, headRect;
-
clientHeight = doc.clientHeight;
bottom = clientHeight - root.getBoundingClientRect().bottom;
if (Conf['Bottom Header']) {
@@ -2001,7 +1932,6 @@
},
addShortcut: function(el) {
var shortcut;
-
shortcut = $.el('span', {
className: 'shortcut brackets-wrap'
});
@@ -2013,7 +1943,6 @@
},
createNotification: function(e) {
var cb, content, lifetime, notice, type, _ref;
-
_ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb;
notice = new Notice(type, content, lifetime);
if (cb) {
@@ -2023,7 +1952,6 @@
areNotificationsEnabled: false,
enableDesktopNotifications: function() {
var authorize, disable, el, notice, _ref;
-
if (!(window.Notification && Conf['Desktop Notifications'])) {
return;
}
@@ -2058,7 +1986,6 @@
Index = {
init: function() {
var anchorEntry, input, label, modeEntry, name, refNavEntry, repliesEntry, sortEntry, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
-
if (g.VIEW !== 'index' || g.BOARD.ID === 'f') {
return;
}
@@ -2194,7 +2121,6 @@
return $('.board', doc) || d.readyState !== 'loading';
}), function() {
var board, navLink, _l, _len3, _ref3;
-
board = $('.board');
$.replace(board, Index.root);
d.implementation.createDocument(null, null, null).appendChild(board);
@@ -2228,7 +2154,6 @@
},
popstate: function(e) {
var pageNum;
-
pageNum = Index.getCurrentPage();
if (Index.currentPage !== pageNum) {
return Index.pageLoad(pageNum);
@@ -2236,7 +2161,6 @@
},
pageNav: function(e) {
var a;
-
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -2301,7 +2225,6 @@
},
buildPagelist: function() {
var a, i, maxPageNum, nodes, pagesRoot, _i;
-
pagesRoot = $('.pages', Index.pagelist);
maxPageNum = Index.getMaxPageNum();
if (pagesRoot.childElementCount !== maxPageNum + 1) {
@@ -2320,7 +2243,6 @@
},
setPage: function() {
var a, href, maxPageNum, next, pageNum, pagesRoot, prev, strong;
-
pageNum = Index.getCurrentPage();
maxPageNum = Index.getMaxPageNum();
pagesRoot = $('.pages', Index.pagelist);
@@ -2346,7 +2268,6 @@
},
update: function(pageNum) {
var now, onload, _ref, _ref1;
-
if (!navigator.onLine) {
return;
}
@@ -2385,7 +2306,6 @@
},
load: function(e, pageNum) {
var err, notice, req, timeEl;
-
$.rmClass(Index.button, 'fa-spin');
req = Index.req, notice = Index.notice;
delete Index.req;
@@ -2437,7 +2357,6 @@
},
parseThreadList: function(pages) {
var thread, threadID, _ref, _ref1;
-
Index.pagesNum = pages.length;
Index.threadsNumPerPage = pages[0].threads.length;
Index.liveThreadData = pages.reduce((function(arr, next) {
@@ -2456,7 +2375,6 @@
},
buildThreads: function() {
var err, errors, i, posts, thread, threadData, threadRoot, threads, _i, _len, _ref;
-
Index.nodes = [];
threads = [];
posts = [];
@@ -2499,7 +2417,6 @@
},
buildReplies: function(threadRoots) {
var data, err, errors, i, lastReplies, node, nodes, post, posts, thread, threadRoot, _i, _j, _len, _len1;
-
posts = [];
for (_i = 0, _len = threadRoots.length; _i < _len; _i += 2) {
threadRoot = threadRoots[_i];
@@ -2538,7 +2455,6 @@
},
sort: function() {
var i, sortedThreadIDs, threadID, _i, _len;
-
switch (Conf['Index Sort']) {
case 'bump':
sortedThreadIDs = Index.liveThreadIDs;
@@ -2600,7 +2516,6 @@
},
sortOnTop: function(match) {
var i, offset, threadRoot, _i, _len, _ref, _ref1;
-
offset = 0;
_ref = Index.sortedNodes;
for (i = _i = 0, _len = _ref.length; _i < _len; i = _i += 2) {
@@ -2612,7 +2527,6 @@
},
buildIndex: function() {
var nodes, nodesPerPage, pageNum;
-
if (Conf['Index Mode'] === 'paged') {
pageNum = Index.getCurrentPage();
nodesPerPage = Index.threadsNumPerPage * 2;
@@ -2635,7 +2549,6 @@
},
onSearchInput: function() {
var pageNum;
-
if (Index.isSearching = !!Index.searchInput.value.trim()) {
if (!Index.searchInput.dataset.searching) {
Index.searchInput.dataset.searching = 1;
@@ -2663,7 +2576,6 @@
},
querySearch: function(query) {
var keywords;
-
if (!(keywords = query.toLowerCase().match(/\S+/g))) {
return;
}
@@ -2671,7 +2583,6 @@
},
search: function(keywords) {
var found, i, threadRoot, _i, _len, _ref;
-
found = [];
_ref = Index.sortedNodes;
for (i = _i = 0, _len = _ref.length; _i < _len; i = _i += 2) {
@@ -2684,7 +2595,6 @@
},
searchMatch: function(thread, keywords) {
var file, info, key, keyword, text, _i, _j, _len, _len1, _ref, _ref1;
-
_ref = thread.OP, info = _ref.info, file = _ref.file;
text = [];
_ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
@@ -2714,7 +2624,6 @@
spoilerRange: {},
shortFilename: function(filename, isReply) {
var threshold;
-
threshold = isReply ? 30 : 40;
if (filename.length - 4 > threshold) {
return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3);
@@ -2724,7 +2633,6 @@
},
thumbRotate: (function() {
var n;
-
n = 0;
return function() {
return n = (n + 1) % 3;
@@ -2732,7 +2640,6 @@
})(),
postFromObject: function(data, boardID) {
var o;
-
o = {
postID: data.no,
threadID: data.resto || data.no,
@@ -2776,7 +2683,6 @@
*/
var a, boardID, capcode, capcodeClass, capcodeIcon, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, gifIcon, href, imgSrc, isClosed, isOP, isSticky, name, pageIcon, pageNum, postID, quote, replyLink, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref;
-
postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file;
isOP = postID === threadID;
staticPath = Build.staticPath, gifIcon = Build.gifIcon;
@@ -2870,7 +2776,6 @@
},
summary: function(boardID, threadID, posts, files) {
var text;
-
text = [];
text.push("" + posts + " post" + (posts > 1 ? 's' : ''));
if (files) {
@@ -2885,7 +2790,6 @@
},
thread: function(board, data) {
var OP, files, nodes, posts, root, _ref;
-
Build.spoilerRange[board] = data.custom_spoiler;
if ((OP = board.posts[data.no]) && (root = OP.nodes.root.parentNode)) {
$.rmAll(root);
@@ -2912,7 +2816,6 @@
Get = {
threadExcerpt: function(thread) {
var OP, excerpt, _ref;
-
OP = thread.OP;
excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || Conf['Anonymize'] && 'Anonymous' || $('.nameBlock', OP.nodes.info).textContent.trim();
if (excerpt.length > 70) {
@@ -2928,7 +2831,6 @@
},
postFromRoot: function(root) {
var boardID, index, link, post, postID;
-
link = $('a[title="Highlight this post"]', root);
boardID = link.pathname.split('/')[1];
postID = link.hash.slice(2);
@@ -2948,7 +2850,6 @@
},
postDataFromLink: function(link) {
var boardID, path, postID, threadID, _ref;
-
if (link.hostname === 'boards.4chan.org') {
path = link.pathname.split('/');
boardID = path[1];
@@ -2966,7 +2867,6 @@
},
allQuotelinksLinkingTo: function(post) {
var ID, quote, quotedPost, quotelinks, quoterPost, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4;
-
quotelinks = [];
_ref = g.posts;
for (ID in _ref) {
@@ -2995,14 +2895,12 @@
}
return quotelinks.filter(function(quotelink) {
var boardID, postID, _ref5;
-
_ref5 = Get.postDataFromLink(quotelink), boardID = _ref5.boardID, postID = _ref5.postID;
return boardID === post.board.ID && postID === post.ID;
});
},
postClone: function(boardID, threadID, postID, root, context) {
var post, url;
-
if (post = g.posts["" + boardID + "." + postID]) {
Get.insert(post, root, context);
return;
@@ -3025,7 +2923,6 @@
},
insert: function(post, root, context) {
var clone, nodes;
-
if (!root.parentNode) {
return;
}
@@ -3039,7 +2936,6 @@
},
fetchedPost: function(req, boardID, threadID, postID, root, context) {
var board, post, posts, status, thread, url, _i, _len;
-
if (post = g.posts["" + boardID + "." + postID]) {
Get.insert(post, root, context);
return;
@@ -3093,7 +2989,6 @@
},
archivedPost: function(req, boardID, postID, root, context) {
var board, bq, comment, data, o, post, thread, threadID, _ref;
-
if (post = g.posts["" + boardID + "." + postID]) {
Get.insert(post, root, context);
return;
@@ -3190,10 +3085,8 @@
UI = (function() {
var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove;
-
dialog = function(id, position, html) {
var child, el, move, _i, _len, _ref;
-
el = $.el('div', {
className: 'dialog',
innerHTML: html,
@@ -3235,7 +3128,6 @@
Menu.prototype.makeMenu = function() {
var menu;
-
menu = $.el('div', {
className: 'dialog',
id: 'menu',
@@ -3250,7 +3142,6 @@
Menu.prototype.toggle = function(e, button, data) {
var previousButton;
-
e.preventDefault();
e.stopPropagation();
if (currentMenu) {
@@ -3268,7 +3159,6 @@
Menu.prototype.open = function(button, data) {
var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2;
-
menu = this.makeMenu();
currentMenu = menu;
lastToggledButton = button;
@@ -3307,7 +3197,6 @@
Menu.prototype.insertEntry = function(entry, parent, data) {
var subEntry, submenu, _i, _len, _ref;
-
if (typeof entry.open === 'function') {
if (!entry.open(data)) {
return;
@@ -3341,7 +3230,6 @@
Menu.prototype.findNextEntry = function(entry, direction) {
var entries;
-
entries = __slice.call(entry.parentNode.children);
entries.sort(function(first, second) {
return first.style.order - second.style.order;
@@ -3351,7 +3239,6 @@
Menu.prototype.keybinds = function(e) {
var entry, next, nextPrev, subEntry, submenu;
-
entry = $('.focused', currentMenu);
while (subEntry = $('.focused', entry)) {
entry = subEntry;
@@ -3397,7 +3284,6 @@
Menu.prototype.focus = function(entry) {
var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2;
-
while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
$.rmClass(focused, 'focused');
}
@@ -3425,7 +3311,6 @@
Menu.prototype.addEntry = function(e) {
var entry;
-
entry = e.detail;
if (entry.type !== this.type) {
return;
@@ -3436,7 +3321,6 @@
Menu.prototype.parseEntry = function(entry) {
var el, subEntries, subEntry, _i, _len;
-
el = entry.el, subEntries = entry.subEntries;
$.addClass(el, 'entry');
$.on(el, 'focus mouseover', (function(e) {
@@ -3459,7 +3343,6 @@
})();
dragstart = function(e) {
var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
-
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -3498,7 +3381,6 @@
};
touchmove = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -3510,7 +3392,6 @@
};
drag = function(e) {
var bottom, clientX, clientY, left, right, style, top;
-
clientX = e.clientX, clientY = e.clientY;
left = clientX - this.dx;
left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%';
@@ -3526,7 +3407,6 @@
};
touchend = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -3548,7 +3428,6 @@
};
hoverstart = function(_arg) {
var asapTest, cb, el, endEvents, latestEvent, o, root;
-
root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb;
o = {
root: root,
@@ -3583,7 +3462,6 @@
};
hover = function(e) {
var clientX, clientY, height, left, right, style, top, _ref;
-
this.latestEvent = e;
height = this.el.offsetHeight;
clientX = e.clientX, clientY = e.clientY;
@@ -3627,7 +3505,6 @@
},
node: function() {
var email, name, tripcode, _ref;
-
if (this.info.capcode || this.isClone) {
return;
}
@@ -3650,7 +3527,6 @@
filters: {},
init: function() {
var boards, err, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
-
if (g.VIEW === 'catalog' || !Conf['Filter']) {
return;
}
@@ -3687,7 +3563,6 @@
op = ((_ref3 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref3[1] : void 0) || 'yes';
stub = (function() {
var _ref4;
-
switch ((_ref4 = filter.match(/stub:(yes|no)/)) != null ? _ref4[1] : void 0) {
case 'yes':
return true;
@@ -3718,7 +3593,6 @@
},
createFilter: function(regexp, op, stub, hl, top) {
var settings, test;
-
test = typeof regexp === 'string' ? function(value) {
return regexp === value;
} : function(value) {
@@ -3742,7 +3616,6 @@
},
node: function() {
var filter, key, result, value, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -3849,7 +3722,6 @@
menu: {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) {
return;
}
@@ -3875,7 +3747,6 @@
},
createSubEntry: function(text, type) {
var el;
-
el = $.el('a', {
href: 'javascript:;',
textContent: text
@@ -3886,7 +3757,6 @@
el: el,
open: function(post) {
var value;
-
value = Filter[type](post);
return value !== false;
}
@@ -3894,7 +3764,6 @@
},
makeFilter: function() {
var re, type, value;
-
type = this.dataset.type;
value = Filter[type](Filter.menu.post);
re = type === 'uniqueID' || type === 'MD5' ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
@@ -3909,7 +3778,6 @@
re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
return $.get(type, Conf[type], function(item) {
var save, section, select, ta, tl;
-
save = item[type];
save = save ? "" + save + "\n" + re : re;
$.set(type, save);
@@ -3943,7 +3811,6 @@
},
node: function() {
var data;
-
if (!this.isReply || this.isClone) {
return;
}
@@ -3967,7 +3834,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub, replies, thisPost;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
return;
}
@@ -4038,7 +3904,6 @@
order: 20,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -4070,7 +3935,6 @@
order: 15,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -4087,7 +3951,6 @@
},
hide: function() {
var makeStub, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -4106,7 +3969,6 @@
},
show: function() {
var data, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -4130,7 +3992,6 @@
},
hideStub: function() {
var post;
-
post = PostHiding.menu.post;
post.nodes.root.hidden = true;
$.event('CloseMenu');
@@ -4138,7 +3999,6 @@
},
makeButton: function(post, type) {
var a, span;
-
span = $.el('span', {
className: "brackets-wrap",
textContent: "\u00A0" + (type === 'hide' ? '-' : '+') + "\u00A0"
@@ -4153,7 +4013,6 @@
},
saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
var data;
-
data = {
boardID: post.board.ID,
threadID: post.thread.ID,
@@ -4172,14 +4031,12 @@
},
toggle: function() {
var post;
-
post = Get.postFromNode(this);
PostHiding[(post.isHidden ? 'show' : 'hide')](post);
return PostHiding.saveHiddenState(post, post.isHidden);
},
hide: function(post, makeStub, hideRecursively) {
var a, postInfo, quotelink, _i, _len, _ref;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -4217,7 +4074,6 @@
},
show: function(post, showRecursively) {
var quotelink, _i, _len, _ref;
-
if (showRecursively == null) {
showRecursively = Conf['Recursive Hiding'];
}
@@ -4253,7 +4109,6 @@
},
node: function() {
var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.isClone) {
return;
}
@@ -4271,7 +4126,6 @@
},
add: function() {
var args, obj, post, recursive, _base, _name;
-
recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = {
recursives: [],
@@ -4282,7 +4136,6 @@
},
rm: function(recursive, post) {
var i, obj, rec, _i, _len, _ref;
-
if (!(obj = Recursive.recursives[post.fullID])) {
return;
}
@@ -4297,7 +4150,6 @@
},
apply: function() {
var ID, args, fullID, post, recursive, _ref;
-
recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
fullID = post.fullID;
_ref = g.posts;
@@ -4325,7 +4177,6 @@
},
node: function() {
var data;
-
if (data = ThreadHiding.db.get({
boardID: this.board.ID,
threadID: this.ID
@@ -4339,7 +4190,6 @@
},
onIndexBuild: function(_arg) {
var i, nodes, root, thread, _i, _len;
-
nodes = _arg.detail;
for (i = _i = 0, _len = nodes.length; _i < _len; i = _i += 2) {
root = nodes[i];
@@ -4356,7 +4206,6 @@
},
syncCatalog: function() {
var hiddenThreads, hiddenThreadsOnCatalog, threadID;
-
hiddenThreads = ThreadHiding.db.get({
boardID: g.BOARD.ID,
defaultValue: {}
@@ -4383,7 +4232,6 @@
cleanCatalog: function(hiddenThreadsOnCatalog) {
return $.cache("//a.4cdn.org/" + g.BOARD + "/threads.json", function() {
var page, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.status !== 200) {
return;
}
@@ -4409,7 +4257,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub;
-
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
return;
}
@@ -4431,7 +4278,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || thread.isHidden) {
return false;
@@ -4459,7 +4305,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -4479,7 +4324,6 @@
order: 15,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -4490,7 +4334,6 @@
},
hide: function() {
var makeStub, thread;
-
makeStub = $('input', this.parentNode).checked;
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, makeStub);
@@ -4499,7 +4342,6 @@
},
show: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.show(thread);
ThreadHiding.saveHiddenState(thread);
@@ -4507,7 +4349,6 @@
},
hideStub: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, false);
$.event('CloseMenu');
@@ -4515,7 +4356,6 @@
},
makeButton: function(thread, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-thread-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -4527,7 +4367,6 @@
},
makeStub: function(thread, root) {
var a, numReplies, opInfo, summary;
-
numReplies = $$('.thread > .replyContainer', root).length;
if (summary = $('.summary', root)) {
numReplies += +summary.textContent.match(/\d+/);
@@ -4547,7 +4386,6 @@
},
saveHiddenState: function(thread, makeStub) {
var hiddenThreadsOnCatalog;
-
hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
if (thread.isHidden) {
ThreadHiding.db.set({
@@ -4580,7 +4418,6 @@
},
hide: function(thread, makeStub) {
var threadRoot;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -4596,7 +4433,6 @@
},
show: function(thread) {
var threadRoot;
-
if (thread.stub) {
$.rm(thread.stub);
delete thread.stub;
@@ -4609,7 +4445,6 @@
QuoteBacklink = {
init: function() {
var format;
-
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
return;
}
@@ -4627,7 +4462,6 @@
},
firstNode: function() {
var a, clone, container, containers, frag, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
-
if (this.isClone || !this.quotes.length) {
return;
}
@@ -4665,7 +4499,6 @@
},
secondNode: function() {
var container;
-
if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
this.nodes.backlinkContainer = $('.container', this.nodes.info);
return;
@@ -4679,7 +4512,6 @@
},
getContainer: function(id) {
var _base;
-
return (_base = this.containers)[id] || (_base[id] = $.el('span', {
className: 'container'
}));
@@ -4702,7 +4534,6 @@
},
node: function() {
var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -4732,7 +4563,6 @@
if (Conf['Quote Hash Navigation']) {
this.node = function() {
var link, _i, _len, _ref;
-
_ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks));
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];
@@ -4745,7 +4575,6 @@
} else {
this.node = function() {
var link, _i, _len, _ref;
-
_ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks));
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];
@@ -4772,7 +4601,6 @@
},
toggle: function(e) {
var boardID, context, postID, threadID, _ref;
-
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -4798,7 +4626,6 @@
},
add: function(quotelink, boardID, threadID, postID, context) {
var inline, isBacklink, post, qroot, root;
-
isBacklink = $.hasClass(quotelink, 'backlink');
inline = $.el('div', {
id: "i" + postID,
@@ -4823,7 +4650,6 @@
},
rm: function(quotelink, boardID, threadID, postID, context) {
var el, inlined, isBacklink, post, qroot, root, _ref;
-
isBacklink = $.hasClass(quotelink, 'backlink');
root = QuoteInline.findRoot(quotelink, isBacklink);
root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root);
@@ -4865,7 +4691,6 @@
},
node: function() {
var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref, _ref1;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -4908,7 +4733,6 @@
},
node: function() {
var link, _i, _len, _ref;
-
_ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks));
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];
@@ -4917,7 +4741,6 @@
},
mouseover: function(e) {
var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1;
-
if ($.hasClass(this, 'inlined')) {
return;
}
@@ -4961,7 +4784,6 @@
},
mouseout: function() {
var clone, post, root, _i, _len, _ref;
-
if (!(root = this.el.firstElementChild)) {
return;
}
@@ -4991,7 +4813,6 @@
},
node: function() {
var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone) {
return;
}
@@ -5014,7 +4835,6 @@
QuoteThreading = {
init: function() {
var input;
-
if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
return;
}
@@ -5037,7 +4857,6 @@
},
setup: function() {
var ID, post, posts;
-
$.off(d, '4chanXInitFinished', QuoteThreading.setup);
posts = g.posts;
for (ID in posts) {
@@ -5050,7 +4869,6 @@
},
node: function() {
var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len;
-
if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) {
return;
}
@@ -5080,7 +4898,6 @@
},
nodeinsert: function() {
var bottom, height, qpost, qroot, threadContainer, top, _ref;
-
qpost = g.posts[this.threaded];
delete this.threaded;
delete this.cb;
@@ -5109,7 +4926,6 @@
},
toggle: function() {
var container, containers, node, post, replies, reply, thread, _i, _j, _k, _len, _len1, _len2, _ref;
-
thread = $('.thread');
replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread);
QuoteThreading.enabled = this.checked;
@@ -5126,7 +4942,6 @@
} else {
replies.sort(function(a, b) {
var aID, bID;
-
aID = Number(a.id.slice(2));
bID = Number(b.id.slice(2));
return aID - bID;
@@ -5147,7 +4962,6 @@
},
kb: function() {
var control;
-
control = $.id('threadingControl');
return control.click();
}
@@ -5175,7 +4989,6 @@
},
node: function() {
var quotelink, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -5199,7 +5012,6 @@
cb: {
seek: function(type) {
var highlight, post, posts, result, str;
-
if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
@@ -5255,7 +5067,6 @@
},
node: function() {
var deadlink, _i, _len, _ref;
-
_ref = $$('.deadlink', this.nodes.comment);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
deadlink = _ref[_i];
@@ -5270,7 +5081,6 @@
},
parseDeadlink: function(deadlink) {
var a, boardID, m, post, postID, quote, quoteID, redirect, _ref;
-
if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
Quotify.fixDeadlink(deadlink);
return;
@@ -5340,7 +5150,6 @@
},
fixDeadlink: function(deadlink) {
var el, green;
-
if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') {
green = $.el('span', {
className: 'quote'
@@ -5355,7 +5164,6 @@
QR = {
init: function() {
var sc;
-
if (!Conf['Quick Reply']) {
return;
}
@@ -5403,7 +5211,6 @@
},
initReady: function() {
var link;
-
QR.postingIsEnabled = !!$.id('postForm');
if (!QR.postingIsEnabled) {
return;
@@ -5423,13 +5230,11 @@
$.before($.id('postForm'), link);
$.on(d, 'QRGetSelectedPost', function(_arg) {
var cb;
-
cb = _arg.detail;
return cb(QR.selected);
});
$.on(d, 'QRAddPreSubmitHook', function(_arg) {
var cb;
-
cb = _arg.detail;
return QR.preSubmitHooks.push(cb);
});
@@ -5463,7 +5268,6 @@
},
open: function() {
var err;
-
if (QR.nodes) {
QR.nodes.el.hidden = false;
QR.unhide();
@@ -5482,7 +5286,6 @@
},
close: function() {
var post, _i, _len, _ref;
-
if (QR.req) {
QR.abort();
return;
@@ -5537,7 +5340,6 @@
},
error: function(err) {
var el;
-
QR.open();
if (typeof err === 'string') {
el = $.tn(err);
@@ -5564,7 +5366,6 @@
},
notify: function(el) {
var notice, notif;
-
notice = new Notice('warning', el);
if (!(Header.areNotificationsEnabled && d.hidden)) {
return QR.notifications.push(notice);
@@ -5581,7 +5382,6 @@
notifications: [],
cleanNotifications: function() {
var notification, _i, _len, _ref;
-
_ref = QR.notifications;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
notification = _ref[_i];
@@ -5591,7 +5391,6 @@
},
status: function() {
var disabled, status, thread, value;
-
if (!QR.nodes) {
return;
}
@@ -5608,7 +5407,6 @@
},
quote: function(e) {
var caretPos, com, index, post, range, s, sel, text, thread, _ref;
-
if (e != null) {
e.preventDefault();
}
@@ -5646,7 +5444,6 @@
},
characterCount: function() {
var count, counter;
-
counter = QR.nodes.charCount;
count = QR.nodes.com.textLength;
counter.textContent = count;
@@ -5655,7 +5452,6 @@
},
drag: function(e) {
var toggle;
-
toggle = e.type === 'dragstart' ? $.off : $.on;
toggle(d, 'dragover', QR.dragOver);
return toggle(d, 'drop', QR.dropFile);
@@ -5674,7 +5470,6 @@
},
paste: function(e) {
var blob, files, item, _i, _len, _ref;
-
files = [];
_ref = e.clipboardData.items;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -5698,7 +5493,6 @@
},
handleFiles: function(files) {
var file, isSingle, max, _i, _len;
-
if (this !== QR) {
files = __slice.call(this.files);
this.value = null;
@@ -5719,7 +5513,6 @@
},
handleFile: function(file, isSingle, max) {
var post, _ref;
-
if (file.size > max) {
QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
return;
@@ -5745,7 +5538,6 @@
},
openFileInput: function(e) {
var _ref;
-
e.stopPropagation();
if (e.shiftKey && e.type === 'click') {
return QR.selected.rmFile();
@@ -5765,7 +5557,6 @@
},
generatePostableThreadsList: function() {
var list, options, thread, val;
-
if (!QR.nodes) {
return;
}
@@ -5788,7 +5579,6 @@
},
dialog: function() {
var check, dialog, elm, event, flagSelector, i, items, key, mimeTypes, name, node, nodes, save, value, _ref;
-
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top:0;right:0;', "
")
};
@@ -5915,7 +5705,6 @@
preSubmitHooks: [],
submit: function(e) {
var challenge, err, extra, filetag, formData, hook, options, post, response, textOnly, thread, threadID, _i, _len, _ref, _ref1;
-
if (e != null) {
e.preventDefault();
}
@@ -6030,7 +5819,6 @@
},
response: function() {
var URL, ban, board, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, req, resDoc, threadID, _, _ref, _ref1;
-
req = QR.req;
delete QR.req;
post = QR.posts[0];
@@ -6163,7 +5951,6 @@
ready: function() {
var imgContainer, input, setLifetime,
_this = this;
-
setLifetime = function(e) {
return _this.lifetime = e.detail;
};
@@ -6200,7 +5987,6 @@
});
$.get('captchas', [], function(_arg) {
var captchas;
-
captchas = _arg.captchas;
return _this.sync(captchas);
});
@@ -6217,7 +6003,6 @@
},
getOne: function() {
var captcha, challenge, response;
-
this.clear();
if (captcha = this.captchas.shift()) {
challenge = captcha.challenge, response = captcha.response;
@@ -6242,7 +6027,6 @@
},
save: function() {
var response;
-
if (!(response = this.nodes.input.value.trim())) {
return;
}
@@ -6257,7 +6041,6 @@
},
clear: function() {
var captcha, i, now, _i, _len, _ref;
-
now = Date.now();
_ref = this.captchas;
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
@@ -6275,7 +6058,6 @@
},
load: function() {
var challenge;
-
if (!this.nodes.challenge.firstChild) {
return;
}
@@ -6288,7 +6070,6 @@
},
count: function() {
var count;
-
count = this.captchas.length;
this.nodes.input.placeholder = (function() {
switch (count) {
@@ -6324,7 +6105,6 @@
init: function() {
var key, setTimers, type,
_this = this;
-
if (!Conf['Cooldown']) {
return;
}
@@ -6358,7 +6138,6 @@
},
sync: function(cooldowns) {
var id;
-
for (id in cooldowns) {
QR.cooldown.cooldowns[id] = cooldowns[id];
}
@@ -6366,7 +6145,6 @@
},
set: function(data) {
var cooldown, delay, isReply, post, req, start, threadID, upSpd;
-
if (!Conf['Cooldown']) {
return;
}
@@ -6401,7 +6179,6 @@
},
count: function() {
var cooldown, cooldowns, elapsed, hasFile, isReply, maxTimer, now, post, seconds, start, type, types, upSpd, upSpdAccuracy, update, _ref;
-
if (!Object.keys(QR.cooldown.cooldowns).length) {
$["delete"]("" + g.BOARD + ".cooldown");
delete QR.cooldown.isCounting;
@@ -6466,7 +6243,6 @@
QR.persona.getPassword();
return $.get('QR.personas', Conf['QR.personas'], function(_arg) {
var arr, item, personas, type, types, _i, _len, _ref;
-
personas = _arg['QR.personas'];
types = {
name: [],
@@ -6486,7 +6262,6 @@
},
parseItem: function(item, types) {
var boards, match, type, val, _ref, _ref1, _ref2;
-
if (item[0] === '#') {
return;
}
@@ -6515,7 +6290,6 @@
},
loadPersonas: function(type, arr) {
var list, val, _i, _len;
-
list = $("#list-" + type, QR.nodes.el);
for (_i = 0, _len = arr.length; _i < _len; _i++) {
val = arr[_i];
@@ -6528,7 +6302,6 @@
},
getPassword: function() {
var input, m;
-
if (!QR.persona.pwd) {
QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : $.id('delPassword').value;
}
@@ -6537,7 +6310,6 @@
get: function(cb) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
return cb(persona);
});
@@ -6545,7 +6317,6 @@
set: function(post) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
persona = {
name: post.name,
@@ -6563,7 +6334,6 @@
this.select = __bind(this.select, this);
var el, elm, event, prev, _i, _j, _len, _len1, _ref, _ref1,
_this = this;
-
el = $.el('a', {
className: 'qr-preview',
draggable: true,
@@ -6626,7 +6396,6 @@
_Class.prototype.rm = function() {
var index;
-
this["delete"]();
index = QR.posts.indexOf(this);
if (QR.posts.length === 1) {
@@ -6646,7 +6415,6 @@
_Class.prototype.lock = function(lock) {
var name, node, _i, _len, _ref;
-
if (lock == null) {
lock = true;
}
@@ -6673,7 +6441,6 @@
_Class.prototype.select = function() {
var rectEl, rectList;
-
if (QR.selected) {
QR.selected.nodes.el.id = null;
QR.selected.forceSave();
@@ -6690,7 +6457,6 @@
_Class.prototype.load = function() {
var name, node, _i, _len, _ref;
-
_ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
name = _ref[_i];
@@ -6705,7 +6471,6 @@
_Class.prototype.save = function(input) {
var name, _ref;
-
if (input.type === 'checkbox') {
this.spoiler = input.checked;
return;
@@ -6736,7 +6501,6 @@
_Class.prototype.forceSave = function() {
var name, node, _i, _len, _ref;
-
if (this !== QR.selected) {
return;
}
@@ -6771,11 +6535,9 @@
_Class.prototype.setThumbnail = function() {
var fileURL, img,
_this = this;
-
img = $.el('img');
img.onload = function() {
var cv, height, s, width;
-
s = 90 * 2 * window.devicePixelRatio;
if (_this.file.type === 'image/gif') {
s *= 3;
@@ -6826,7 +6588,6 @@
_Class.prototype.updateFilename = function() {
var long;
-
long = "" + this.filename + " (" + this.filesize + ")\nCtrl+click to edit filename. Shift+click to clear.";
this.nodes.el.title = long;
if (this !== QR.selected) {
@@ -6849,11 +6610,9 @@
_Class.prototype.pasteText = function(file) {
var reader,
_this = this;
-
reader = new FileReader();
reader.onload = function(e) {
var text;
-
text = e.target.result;
if (_this.com) {
_this.com += "\n" + text;
@@ -6892,7 +6651,6 @@
_Class.prototype.drop = function() {
var el, index, newIndex, oldIndex, post;
-
$.rmClass(this, 'over');
if (!this.draggable) {
return;
@@ -6916,7 +6674,6 @@
AutoGIF = {
init: function() {
var _ref;
-
if (g.VIEW === 'catalog' || !Conf['Auto-GIF'] || ((_ref = g.BOARD.ID) === 'gif' || _ref === 'wsg')) {
return;
}
@@ -6927,7 +6684,6 @@
},
node: function() {
var URL, gif, style, thumb, _ref, _ref1;
-
if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6950,7 +6706,6 @@
FappeTyme = {
init: function() {
var el, input, lc, type, _i, _len, _ref;
-
if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || g.VIEW === 'catalog' || g.BOARD === 'f') {
return;
}
@@ -7003,7 +6758,6 @@
Gallery = {
init: function() {
var el;
-
if (g.VIEW === 'catalog' || g.BOARD === 'f' || !Conf['Gallery']) {
return;
}
@@ -7023,7 +6777,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -7037,7 +6790,6 @@
},
build: function(image) {
var cb, createSubEntry, dialog, el, file, files, i, key, menuButton, name, nodes, value, _ref;
-
Gallery.images = [];
nodes = Gallery.nodes = {};
nodes.el = dialog = $.el('div', {
@@ -7097,7 +6849,6 @@
},
generateThumb: function(file) {
var double, post, thumb, title;
-
post = Get.postFromNode(file);
title = ($('.fileText a', file)).textContent;
thumb = post.file.thumb.parentNode.cloneNode(true);
@@ -7116,7 +6867,6 @@
cb: {
keybinds: function(e) {
var cb, key;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -7142,7 +6892,6 @@
},
open: function(e) {
var el, img, name, nodes, rect, top;
-
if (e) {
e.preventDefault();
}
@@ -7185,7 +6934,6 @@
},
error: function(img, thumb) {
var URL, post, revived, src;
-
post = Get.postFromLink($.el('a', {
href: img.dataset.post
}));
@@ -7216,7 +6964,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var i, postObj;
-
if (this.status !== 200) {
return;
}
@@ -7263,7 +7010,6 @@
menu: {
init: function() {
var createSubEntry, el, name, subEntries;
-
if (g.VIEW === 'catalog' || !Conf['Gallery']) {
return;
}
@@ -7285,7 +7031,6 @@
},
createSubEntry: function(name) {
var input, label;
-
label = $.el('label', {
innerHTML: " " + name
});
@@ -7323,7 +7068,6 @@
},
node: function() {
var thumb, _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -7348,7 +7092,6 @@
},
toggleAll: function() {
var ID, file, func, post, _i, _len, _ref, _ref1;
-
$.event('CloseMenu');
if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) {
ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress';
@@ -7382,7 +7125,6 @@
},
toggle: function(post) {
var headRect, left, root, thumb, top, x, y, _ref;
-
thumb = post.file.thumb;
if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) {
ImageExpand.expand(post);
@@ -7391,7 +7133,6 @@
root = post.nodes.root;
_ref = (Conf['Advance on contract'] ? (function() {
var next;
-
next = root;
while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
if ($('.stub', next) || next.offsetHeight === 0) {
@@ -7423,7 +7164,6 @@
},
expand: function(post, src) {
var img, thumb;
-
thumb = post.file.thumb;
if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) {
return;
@@ -7451,7 +7191,6 @@
},
completeExpand: function(post) {
var bottom, thumb;
-
thumb = post.file.thumb;
if (!$.hasClass(thumb, 'expanding')) {
return;
@@ -7474,7 +7213,6 @@
},
error: function() {
var URL, post, src, timeoutID;
-
post = Get.postFromNode(this);
$.rm(this);
delete post.file.fullImage;
@@ -7500,7 +7238,6 @@
return $.ajax("//a.4cdn.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -7524,7 +7261,6 @@
menu: {
init: function() {
var conf, createSubEntry, el, name, subEntries, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Image Expansion']) {
return;
}
@@ -7548,7 +7284,6 @@
},
createSubEntry: function(name, desc) {
var input, label;
-
label = $.el('label', {
innerHTML: " " + name,
title: desc
@@ -7579,7 +7314,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -7587,7 +7321,6 @@
},
mouseover: function(e) {
var el, post;
-
post = Get.postFromNode(this);
el = $.el('img', {
id: 'ihover',
@@ -7609,7 +7342,6 @@
error: function() {
var URL, post, src, timeoutID,
_this = this;
-
if (!doc.contains(this)) {
return;
}
@@ -7634,7 +7366,6 @@
return $.ajax("//a.4cdn.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -7660,7 +7391,6 @@
ImageLoader = {
init: function() {
var prefetch;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -7687,7 +7417,6 @@
},
node: function() {
var URL, img, string, style, thumb, type, _ref, _ref1;
-
if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -7709,7 +7438,6 @@
},
toggle: function() {
var enabled, id, post, _ref;
-
enabled = Conf['prefetch'] = this.checked;
if (enabled) {
_ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts;
@@ -7732,7 +7460,6 @@
},
node: function() {
var thumb, _ref;
-
if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) {
return;
}
@@ -7745,7 +7472,6 @@
Sauce = {
init: function() {
var err, link, links, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Sauce']) {
return;
}
@@ -7775,7 +7501,6 @@
},
createSauceLink: function(link) {
var m, text;
-
link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) {
switch (parameter) {
case '%TURL':
@@ -7796,7 +7521,6 @@
},
node: function() {
var link, nodes, _i, _len, _ref;
-
if (this.isClone || !this.file) {
return;
}
@@ -7829,7 +7553,6 @@
},
node: function() {
var data, el, end, endNode, i, index, items, length, link, links, node, result, saved, snapshot, space, test, word, _i, _len, _ref;
-
if (this.isClone) {
if (Conf['Embedding']) {
i = 0;
@@ -7906,7 +7629,6 @@
},
makeRange: function(startNode, endNode, startOffset, endOffset) {
var range;
-
range = document.createRange();
range.setStart(startNode, startOffset);
range.setEnd(endNode, endOffset);
@@ -7914,7 +7636,6 @@
},
makeLink: function(range) {
var a, char, i, text;
-
text = range.toString();
i = 0;
while (/[(\[{<>]/.test(text.charAt(i))) {
@@ -7960,7 +7681,6 @@
},
services: function(link) {
var href, key, match, type, _ref;
-
href = link.href;
_ref = Linkify.types;
for (key in _ref) {
@@ -7973,7 +7693,6 @@
},
embed: function(data) {
var embed, href, key, link, name, options, uid, value, _ref;
-
key = data[0], uid = data[1], options = data[2], link = data[3];
href = link.href;
embed = $.el('a', {
@@ -8002,7 +7721,6 @@
},
title: function(data) {
var embed, err, key, link, options, service, title, titles, uid;
-
key = data[0], uid = data[1], options = data[2], link = data[3], embed = data[4];
if (!(service = Linkify.types[key].title)) {
return;
@@ -8039,21 +7757,18 @@
cb: {
toggle: function() {
var string, _ref;
-
_ref = $.hasClass(this, "embedded") ? ['unembed', '(embed)'] : ['embed', '(unembed)'], string = _ref[0], this.textContent = _ref[1];
$.replace(this.previousElementSibling, Linkify.cb[string](this));
return $.toggleClass(this, 'embedded');
},
embed: function(a) {
var el, style, type;
-
el = (type = Linkify.types[a.dataset.key]).el(a);
el.style.cssText = (style = type.style) ? style : "border: 0; width: 640px; height: 390px";
return el;
},
unembed: function(a) {
var el;
-
el = $.el('a', {
rel: 'nofollow noreferrer',
target: 'blank',
@@ -8066,7 +7781,6 @@
},
title: function(response, data) {
var embed, key, link, options, service, text, uid;
-
key = data[0], uid = data[1], options = data[2], link = data[3], embed = data[4];
service = Linkify.types[key].title;
switch (response.status) {
@@ -8106,7 +7820,6 @@
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/,
el: function(a) {
var div;
-
return div = $.el('iframe', {
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + a.dataset.uid + ".js"
});
@@ -8117,7 +7830,6 @@
},
text: function(_arg) {
var file, files;
-
files = _arg.files;
for (file in files) {
if (files.hasOwnProperty(file)) {
@@ -8148,7 +7860,6 @@
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
el: function(a) {
var el;
-
el = $.el('iframe', {
width: "640",
height: "360",
@@ -8164,11 +7875,9 @@
style: 'border: 0;',
el: function(a) {
var el;
-
el = $.el('div');
$.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
var embed, file, files, status, type, _i, _j, _len, _len1, _ref;
-
status = this.status;
if (status !== 200 && status !== 304) {
return div.innerHTML = "ERROR " + status;
@@ -8217,7 +7926,6 @@
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/,
el: function(a) {
var div;
-
return div = $.el('iframe', {
src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid
});
@@ -8228,7 +7936,6 @@
style: 'height: auto; width: 500px; display: inline-block;',
el: function(a) {
var div;
-
div = $.el('div', {
className: "soundcloud",
name: "soundcloud"
@@ -8263,7 +7970,6 @@
style: "border: none; width: 640px; height: 360px;",
el: function(a) {
var channel, chapter, result, _;
-
if (result = /(\w+)\/(?:[a-z]\/)?(\d+)/i.exec(a.dataset.uid)) {
_ = result[0], channel = result[1], chapter = result[2];
return $.el('object', {
@@ -8317,7 +8023,6 @@
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
el: function(a) {
var el;
-
el = $.el('iframe', {
src: "//www.youtube.com/embed/" + a.dataset.uid + (a.dataset.option ? '#' + a.dataset.option : '') + "?wmode=opaque"
});
@@ -8339,7 +8044,6 @@
ArchiveLink = {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) {
return;
}
@@ -8352,7 +8056,6 @@
order: 90,
open: function(_arg) {
var ID, board, thread;
-
ID = _arg.ID, thread = _arg.thread, board = _arg.board;
return !!Redirect.to('thread', {
postID: ID,
@@ -8371,14 +8074,12 @@
},
createSubEntry: function(text, type) {
var el, open;
-
el = $.el('a', {
textContent: text,
target: '_blank'
});
open = type === 'post' ? function(_arg) {
var ID, board, thread;
-
ID = _arg.ID, thread = _arg.thread, board = _arg.board;
el.href = Redirect.to('thread', {
postID: ID,
@@ -8388,7 +8089,6 @@
return true;
} : function(post) {
var value;
-
value = Filter[type](post);
if (!value) {
return false;
@@ -8411,7 +8111,6 @@
DeleteLink = {
init: function() {
var div, fileEl, fileEntry, postEl, postEntry;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) {
return;
}
@@ -8439,7 +8138,6 @@
el: fileEl,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file || file.isDead) {
return false;
@@ -8455,7 +8153,6 @@
order: 40,
open: function(post) {
var node;
-
if (post.isDead) {
return false;
}
@@ -8470,7 +8167,6 @@
},
"delete": function() {
var fileOnly, form, link, post;
-
post = DeleteLink.post;
if (DeleteLink.cooldown.counting === post) {
return;
@@ -8500,7 +8196,6 @@
},
load: function(link, post, fileOnly, resDoc) {
var msg, s;
-
if (resDoc.title === '4chan - Banned') {
s = 'Banned!';
} else if (msg = resDoc.getElementById('errmsg')) {
@@ -8521,7 +8216,6 @@
cooldown: {
start: function(post, node) {
var length, seconds, _ref;
-
if (!((_ref = QR.db) != null ? _ref.get({
boardID: post.board.ID,
threadID: post.thread.ID,
@@ -8555,7 +8249,6 @@
DownloadLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) {
return;
}
@@ -8569,7 +8262,6 @@
order: 100,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file) {
return false;
@@ -8601,7 +8293,6 @@
},
makeButton: (function() {
var frag;
-
frag = $.nodes([
$.tn(' '), $.el('a', {
className: 'menu-button',
@@ -8611,7 +8302,6 @@
]);
return function() {
var clone;
-
clone = frag.cloneNode(true);
$.on(clone.lastElementChild, 'click', Menu.toggle);
return clone;
@@ -8619,7 +8309,6 @@
})(),
toggle: function(e) {
var post;
-
post = Get.postFromNode(this);
return Menu.menu.toggle(e, this, post);
}
@@ -8628,7 +8317,6 @@
ReportLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) {
return;
}
@@ -8650,7 +8338,6 @@
},
report: function() {
var id, post, set, url;
-
post = ReportLink.post;
url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
id = Date.now();
@@ -8663,7 +8350,6 @@
init: function() {
return $.ready(function() {
var href;
-
Favicon.el = $('link[rel="shortcut icon"]', d.head);
Favicon.el.type = 'image/x-icon';
href = Favicon.el.href;
@@ -8737,7 +8423,6 @@
init: function() {
var sc,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
return;
}
@@ -8766,7 +8451,6 @@
},
node: function() {
var ID, fileCount, post, postCount, _ref;
-
postCount = 0;
fileCount = 0;
_ref = this.posts;
@@ -8784,7 +8468,6 @@
},
onUpdate: function(e) {
var fileCount, postCount, _ref;
-
if (e.detail[404]) {
return;
}
@@ -8793,7 +8476,6 @@
},
update: function(postCount, fileCount) {
var fileCountEl, postCountEl, thread;
-
thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl;
postCountEl.textContent = postCount;
fileCountEl.textContent = fileCount;
@@ -8818,7 +8500,6 @@
},
onThreadsLoad: function() {
var page, pages, thread, _i, _j, _len, _len1, _ref;
-
if (!(Conf["Page Count in Stats"] && this.status === 200)) {
return;
}
@@ -8842,7 +8523,6 @@
init: function() {
var checked, conf, el, input, name, sc, settings, subEntries, _ref,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
return;
}
@@ -8983,7 +8663,6 @@
},
interval: function() {
var val;
-
val = parseInt(this.value, 10);
if (val < 1) {
val = 1;
@@ -8993,7 +8672,6 @@
},
load: function(e) {
var klass, req, text, _ref;
-
req = ThreadUpdater.req;
switch (req.status) {
case 200:
@@ -9025,7 +8703,6 @@
},
setInterval: function() {
var cur, i, j, limit;
-
i = ThreadUpdater.interval + 1;
if (Conf['Optional Increase']) {
cur = ThreadUpdater.outdateCount || 1;
@@ -9041,14 +8718,12 @@
},
intervalShortcut: function() {
var settings;
-
Settings.open('Advanced');
settings = $.id('fourchanx-settings');
return $('input[name=Interval]', settings).focus();
},
set: function(name, text, klass) {
var el, node;
-
el = ThreadUpdater[name];
if (node = el.firstChild) {
node.data = text;
@@ -9067,7 +8742,6 @@
},
timeout: function() {
var n;
-
ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
if (!(n = --ThreadUpdater.seconds)) {
return ThreadUpdater.update();
@@ -9080,7 +8754,6 @@
},
update: function() {
var url, _ref;
-
if (!navigator.onLine) {
return;
}
@@ -9102,7 +8775,6 @@
},
updateThreadStatus: function(type, status) {
var change, hasChanged;
-
if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) {
return;
}
@@ -9112,7 +8784,6 @@
},
parse: function(postObjects) {
var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref;
-
OP = postObjects[0];
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
@@ -9198,7 +8869,6 @@
}
$.queueTask(function() {
var length, threadID;
-
threadID = ThreadUpdater.thread.ID;
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
return Fourchan.parseThread(threadID, length - count, length);
@@ -9219,7 +8889,6 @@
ThreadWatcher = {
init: function() {
var now, sc;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -9264,7 +8933,6 @@
},
node: function() {
var toggler;
-
toggler = $.el('img', {
className: 'watch-thread-link'
});
@@ -9286,7 +8954,6 @@
}
return $.get('AutoWatch', 0, function(_arg) {
var AutoWatch, thread;
-
AutoWatch = _arg.AutoWatch;
if (!(thread = g.BOARD.threads[AutoWatch])) {
return;
@@ -9302,7 +8969,6 @@
cb: {
openAll: function() {
var a, _i, _len, _ref;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -9321,7 +8987,6 @@
},
pruneDeads: function() {
var boardID, data, threadID, _i, _len, _ref, _ref1;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -9345,13 +9010,11 @@
},
rm: function() {
var boardID, threadID, _ref;
-
_ref = this.parentNode.dataset.fullID.split('.'), boardID = _ref[0], threadID = _ref[1];
return ThreadWatcher.rm(boardID, +threadID);
},
post: function(e) {
var board, postID, threadID, _ref;
-
_ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID;
if (postID === threadID) {
if (Conf['Auto Watch']) {
@@ -9363,7 +9026,6 @@
},
onIndexRefresh: function() {
var boardID, data, db, threadID, _ref;
-
db = ThreadWatcher.db;
boardID = g.BOARD.ID;
_ref = db.data.boards[boardID];
@@ -9389,7 +9051,6 @@
},
onThreadRefresh: function(e) {
var thread;
-
thread = e.detail.thread;
if (!(e.detail[404] && ThreadWatcher.db.get({
boardID: thread.board.ID,
@@ -9406,7 +9067,6 @@
},
fetchAllStatus: function() {
var thread, threads, _i, _len;
-
if (!(threads = ThreadWatcher.getAll()).length) {
return;
}
@@ -9418,7 +9078,6 @@
},
fetchStatus: function(_arg) {
var boardID, data, fetchCount, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
if (data.isDead) {
return;
@@ -9428,7 +9087,6 @@
return $.ajax("//a.4cdn.org/" + boardID + "/res/" + threadID + ".json", {
onloadend: function() {
var status;
-
fetchCount.fetched++;
if (fetchCount.fetched === fetchCount.fetching) {
fetchCount.fetched = 0;
@@ -9462,7 +9120,6 @@
},
getAll: function() {
var all, boardID, data, threadID, threads, _ref;
-
all = [];
_ref = ThreadWatcher.db.data.boards;
for (boardID in _ref) {
@@ -9483,7 +9140,6 @@
},
makeLine: function(boardID, threadID, data) {
var div, fullID, href, link, x;
-
x = $.el('a', {
className: 'fa fa-times',
href: 'javascript:;'
@@ -9514,7 +9170,6 @@
},
refresh: function() {
var boardID, data, helper, list, nodes, refresher, thread, threadID, toggler, watched, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3;
-
nodes = [];
_ref = ThreadWatcher.getAll();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -9544,7 +9199,6 @@
},
toggle: function(thread) {
var boardID, threadID;
-
boardID = thread.board.ID;
threadID = thread.ID;
if (ThreadWatcher.db.get({
@@ -9558,7 +9212,6 @@
},
add: function(thread) {
var boardID, data, threadID;
-
data = {};
boardID = thread.board.ID;
threadID = thread.ID;
@@ -9589,7 +9242,6 @@
},
convert: function(oldFormat) {
var boardID, data, newFormat, threadID, threads;
-
newFormat = {};
for (boardID in oldFormat) {
threads = oldFormat[boardID];
@@ -9606,7 +9258,6 @@
refreshers: [],
init: function() {
var menu;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -9619,7 +9270,6 @@
},
addHeaderMenuEntry: function() {
var entryEl;
-
if (g.VIEW !== 'thread') {
return;
}
@@ -9636,7 +9286,6 @@
});
return this.refreshers.push(function() {
var addClass, rmClass, text, _ref;
-
_ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = _ref[0], rmClass = _ref[1], text = _ref[2];
$.addClass(entryEl, addClass);
$.rmClass(entryEl, rmClass);
@@ -9645,7 +9294,6 @@
},
addMenuEntries: function() {
var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1;
-
entries = [];
entries.push({
cb: ThreadWatcher.cb.openAll,
@@ -9714,7 +9362,6 @@
},
createSubEntry: function(name, desc) {
var entry, input;
-
entry = {
type: 'thread watcher',
el: $.el('label', {
@@ -9766,7 +9413,6 @@
},
ready: function() {
var ID, post, posts, _ref;
-
$.off(d, '4chanXInitFinished', Unread.ready);
posts = [];
_ref = Unread.thread.posts;
@@ -9781,7 +9427,6 @@
},
scroll: function() {
var down, hash, post, posts, root;
-
if (!Conf['Scroll to Last Read Post']) {
return;
}
@@ -9810,7 +9455,6 @@
},
sync: function() {
var lastReadPost;
-
lastReadPost = Unread.db.get({
boardID: Unread.thread.board.ID,
threadID: Unread.thread.ID,
@@ -9829,7 +9473,6 @@
},
addPosts: function(posts) {
var ID, data, post, _i, _len, _ref;
-
for (_i = 0, _len = posts.length; _i < _len; _i++) {
post = posts[_i];
ID = post.ID;
@@ -9857,7 +9500,6 @@
},
addPostQuotingYou: function(post) {
var quotelink, _i, _len, _ref;
-
if (!QR.db) {
return;
}
@@ -9874,7 +9516,6 @@
},
openNotification: function(post) {
var name, notif;
-
if (!Header.areNotificationsEnabled) {
return;
}
@@ -9902,7 +9543,6 @@
},
readSinglePost: function(post) {
var i;
-
if ((i = Unread.posts.indexOf(post)) === -1) {
return;
}
@@ -9918,7 +9558,6 @@
},
readArray: function(arr) {
var i, post, _i, _len;
-
for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) {
post = arr[i];
if (post.ID > Unread.lastReadPost) {
@@ -9929,7 +9568,6 @@
},
read: $.debounce(50, function(e) {
var ID, height, i, post, posts;
-
if (d.hidden || !Unread.posts.length) {
return;
}
@@ -9982,7 +9620,6 @@
}),
setLine: function(force) {
var post;
-
if (!(d.hidden || force === true)) {
return;
}
@@ -9995,7 +9632,6 @@
},
update: function() {
var count;
-
count = Unread.posts.length;
if (Conf['Unread Count']) {
d.title = "" + (Conf['Quoted Title'] && Unread.postsQuotingYou.length ? '(!) ' : '') + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title);
@@ -10016,7 +9652,6 @@
},
init: function() {
var archive, boardID, boards, data, id, name, type, _i, _len, _ref, _ref1, _ref2;
-
_ref = Conf['selectedArchives'];
for (boardID in _ref) {
data = _ref[boardID];
@@ -10141,7 +9776,6 @@
},
to: function(dest, data) {
var archive;
-
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
if (!archive) {
return '';
@@ -10150,7 +9784,6 @@
},
protocol: function(archive) {
var protocol;
-
protocol = location.protocol;
if (!archive[protocol.slice(0, -1)]) {
protocol = protocol === 'https:' ? 'http:' : 'https:';
@@ -10159,7 +9792,6 @@
},
thread: function(archive, _arg) {
var boardID, path, postID, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID;
path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID;
if (archive.software === 'foolfuuka') {
@@ -10172,7 +9804,6 @@
},
post: function(archive, _arg) {
var URL, boardID, postID;
-
boardID = _arg.boardID, postID = _arg.postID;
URL = new String("" + (Redirect.protocol(archive)) + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID);
URL.archive = archive;
@@ -10180,13 +9811,11 @@
},
file: function(archive, _arg) {
var boardID, filename;
-
boardID = _arg.boardID, filename = _arg.filename;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
},
search: function(archive, _arg) {
var boardID, path, type, value;
-
boardID = _arg.boardID, type = _arg.type, value = _arg.value;
type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type;
value = encodeURIComponent(value);
@@ -10205,7 +9834,6 @@
},
setup: function() {
var btn, entry, psa;
-
$.off(d, '4chanXInitFinished', PSAHiding.setup);
if (!(psa = $.id('globalMessage'))) {
$.rmClass(doc, 'hide-announcement');
@@ -10234,7 +9862,6 @@
$.on(btn, 'click', PSAHiding.toggle);
$.get('hiddenPSA', 0, function(_arg) {
var hiddenPSA;
-
hiddenPSA = _arg.hiddenPSA;
PSAHiding.sync(hiddenPSA);
$.before(psa, btn);
@@ -10244,7 +9871,6 @@
},
toggle: function(e) {
var UTC;
-
if ($.hasClass(this, 'hide-announcement')) {
UTC = +$.id('globalMessage').dataset.utc;
$.set('hiddenPSA', UTC);
@@ -10256,7 +9882,6 @@
},
sync: function(UTC) {
var hr, psa;
-
psa = $.id('globalMessage');
psa.hidden = PSAHiding.btn.hidden = UTC && UTC >= +psa.dataset.utc ? true : false;
if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') {
@@ -10277,7 +9902,6 @@
},
ready: function() {
var banner, child, children, i;
-
banner = $(".boardBanner");
children = banner.children;
i = 0;
@@ -10297,7 +9921,6 @@
cb: {
toggle: (function() {
var types;
-
types = {
jpg: 227,
png: 270,
@@ -10305,7 +9928,6 @@
};
return function() {
var num, type;
-
type = Object.keys(types)[Math.floor(3 * Math.random())];
num = Math.floor(types[type] * Math.random());
return this.src = "//static.4chan.org/image/title/" + num + "." + type;
@@ -10325,7 +9947,6 @@
},
focus: function() {
var items, string, string2;
-
this.textContent = this.innerHTML;
string = "" + g.BOARD + "." + this.className;
string2 = "" + string + ".orig";
@@ -10348,7 +9969,6 @@
},
custom: function(child) {
var cachedTest, string;
-
cachedTest = child.innerHTML;
string = "" + g.BOARD + "." + child.className;
$.on(child, 'click keydown focus blur', function(e) {
@@ -10356,7 +9976,6 @@
});
$.get(string, cachedTest, function(item) {
var string2, title;
-
if (!(title = item[string])) {
return;
}
@@ -10380,7 +9999,6 @@
CatalogLinks = {
init: function() {
var el, input;
-
if (!Conf['Catalog Links']) {
return;
}
@@ -10408,7 +10026,6 @@
},
set: function(useCatalog) {
var a, board, generateURL, path, _i, _len, _ref, _ref1;
-
path = useCatalog ? 'catalog' : '';
generateURL = useCatalog && Conf['External Catalog'] ? CatalogLinks.external : function(board) {
return a.href = "/" + board + "/" + path;
@@ -10523,7 +10140,6 @@
},
node: function() {
var dicestats, roll, _ref;
-
if (this.isClone || !(dicestats = (_ref = this.info.email) != null ? _ref.match(/dice[+\s](\d+)d(\d+)/) : void 0)) {
return;
}
@@ -10535,7 +10151,6 @@
Emoji = {
init: function() {
var css, icon, name, pos, _ref;
-
if (!Conf['Emoji']) {
return;
}
@@ -10606,7 +10221,6 @@
},
node: function() {
var a;
-
if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
return $.on(a, 'click', ExpandComment.cb);
}
@@ -10618,7 +10232,6 @@
},
expand: function(post) {
var a;
-
if (post.nodes.longComment && !post.nodes.longComment.parentNode) {
$.replace(post.nodes.shortComment, post.nodes.longComment);
post.nodes.comment = post.nodes.longComment;
@@ -10634,7 +10247,6 @@
},
contract: function(post) {
var a;
-
if (!post.nodes.shortComment) {
return;
}
@@ -10645,7 +10257,6 @@
},
parse: function(req, a, post) {
var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
-
status = req.status;
if (status !== 200 && status !== 304) {
a.textContent = "Error " + req.statusText + " (" + status + ")";
@@ -10700,7 +10311,6 @@
},
setButton: function(thread) {
var a;
-
if (!(a = $.x('following-sibling::a[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
return;
}
@@ -10709,7 +10319,6 @@
},
onIndexRefresh: function() {
var status, thread, threadID, _ref, _ref1, _ref2;
-
_ref = ExpandThread.statuses;
for (threadID in _ref) {
status = _ref[threadID];
@@ -10736,7 +10345,6 @@
},
toggle: function(thread) {
var a, threadRoot;
-
threadRoot = thread.OP.nodes.root.parentNode;
if (!(a = $('.summary', threadRoot))) {
return;
@@ -10749,7 +10357,6 @@
},
expand: function(thread, a, threadRoot) {
var status;
-
ExpandThread.statuses[thread] = status = {};
a.textContent = ExpandThread.text.apply(ExpandThread, ['...'].concat(__slice.call(a.textContent.match(/\d+/g))));
return status.req = $.cache("//a.4cdn.org/" + thread.board + "/res/" + thread + ".json", function() {
@@ -10759,7 +10366,6 @@
},
contract: function(thread, a, threadRoot) {
var filesCount, inlined, num, postsCount, replies, reply, status, _i, _len;
-
status = ExpandThread.statuses[thread];
delete ExpandThread.statuses[thread];
if (status.req) {
@@ -10807,7 +10413,6 @@
},
parse: function(req, thread, a) {
var data, filesCount, post, postData, posts, postsCount, postsRoot, root, _i, _len, _ref;
-
if ((_ref = req.status) !== 200 && _ref !== 304) {
a.textContent = "Error " + req.statusText + " (" + req.status + ")";
return;
@@ -10861,7 +10466,6 @@
},
createFunc: function(format) {
var code;
-
code = format.replace(/%(.)/g, function(s, c) {
if (c in FileInfo.formatters) {
return "' + FileInfo.formatters." + c + ".call(post) + '";
@@ -10873,7 +10477,6 @@
},
convertUnit: function(size, unit) {
var i;
-
if (unit === 'B') {
return "" + (size.toFixed()) + " Bytes";
}
@@ -10904,7 +10507,6 @@
},
n: function() {
var fullname, shortname;
-
fullname = this.file.name;
shortname = Build.shortFilename(this.file.name, this.isReply);
if (fullname === shortname) {
@@ -10948,7 +10550,6 @@
Fourchan = {
init: function() {
var board;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -10970,7 +10571,6 @@
},
code: function() {
var apply, pre, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -11013,7 +10613,6 @@
},
node: function() {
var rgb, span, style, uid;
-
if (this.isClone || !(uid = this.info.uniqueID)) {
return;
}
@@ -11030,7 +10629,6 @@
},
compute: function(uid) {
var hash, rgb;
-
if (IDColor.ids[uid]) {
return IDColor.ids[uid];
}
@@ -11041,7 +10639,6 @@
},
hash: function(uid) {
var i, msg;
-
msg = 0;
i = 0;
while (i < 8) {
@@ -11066,7 +10663,6 @@
},
scroll: $.debounce(100, function() {
var url;
-
if (InfiniScroll.isFetching || ((d.body.scrollTop || doc.scrollTop) <= doc.scrollHeight - (300 + window.innerHeight))) {
return;
}
@@ -11087,7 +10683,6 @@
}),
parse: function(response) {
var botPostForm, el, nodes, omitted_images, omitted_posts, op, post, postlink, posts, replylink, thread, threadID, threadNodes, threads, _i, _j, _len, _len1, _ref;
-
threads = InfiniScroll.parsePages(response);
threadNodes = [];
nodes = [];
@@ -11146,7 +10741,6 @@
},
parsePages: function(response) {
var newThreads, number, page, pages, thread, threads, _i, _len;
-
pages = JSON.parse(response);
newThreads = [];
for (number in pages) {
@@ -11170,7 +10764,6 @@
},
features: function(threadNodes) {
var err, errors, post, posts, thread, threadRoot, threads, _i, _j, _len, _len1, _ref;
-
posts = [];
threads = [];
for (_i = 0, _len = threadNodes.length; _i < _len; _i++) {
@@ -11202,7 +10795,6 @@
},
notice: (function() {
var notify, reset;
-
notify = false;
reset = function() {
return notify = false;
@@ -11232,7 +10824,6 @@
Keybinds = {
init: function() {
var hotkey, init;
-
if (g.VIEW === 'catalog' || !Conf['Keybinds']) {
return;
}
@@ -11241,7 +10832,6 @@
}
init = function() {
var node, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', init);
$.on(d, 'keydown', Keybinds.keydown);
_ref = $$('[accesskey]');
@@ -11257,7 +10847,6 @@
},
keydown: function(e) {
var key, notification, notifications, op, target, thread, threadRoot, _i, _len, _ref;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -11451,7 +11040,6 @@
},
keyCode: function(e) {
var kc, key;
-
key = (function() {
switch (kc = e.keyCode) {
case 8:
@@ -11507,7 +11095,6 @@
},
tags: function(tag, ta) {
var range, selEnd, selStart, value;
-
value = ta.value;
selStart = ta.selectionStart;
selEnd = ta.selectionEnd;
@@ -11518,13 +11105,11 @@
},
sage: function() {
var isSage;
-
isSage = /sage/i.test(QR.nodes.email.value);
return QR.nodes.email.value = isSage ? "" : "sage";
},
img: function(thread, all) {
var post;
-
if (all) {
return ImageExpand.cb.toggleAll();
} else {
@@ -11534,7 +11119,6 @@
},
open: function(thread, tab) {
var url;
-
if (g.VIEW !== 'index') {
return;
}
@@ -11547,7 +11131,6 @@
},
hl: function(delta, thread) {
var axis, height, next, postEl, replies, reply, root, _i, _len;
-
postEl = $('.reply.highlight', thread);
if (!delta) {
if (postEl) {
@@ -11590,7 +11173,6 @@
Nav = {
init: function() {
var append, next, prev, span;
-
switch (g.VIEW) {
case 'index':
if (!Conf['Index Navigation']) {
@@ -11641,7 +11223,6 @@
},
getThread: function() {
var thread, threadRoot, _i, _len, _ref;
-
_ref = $$('.thread');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
threadRoot = _ref[_i];
@@ -11657,7 +11238,6 @@
},
scroll: function(delta) {
var axis, next, thread, top;
-
thread = Nav.getThread();
axis = delta === +1 ? 'following' : 'preceding';
if (next = $.x("" + axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
@@ -11700,7 +11280,6 @@
},
node: function() {
var dateEl;
-
if (this.isClone) {
return;
}
@@ -11710,7 +11289,6 @@
},
relative: function(diff, now, date) {
var days, months, number, rounded, unit, years;
-
unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second');
rounded = Math.round(number);
if (rounded !== 1) {
@@ -11721,7 +11299,6 @@
stale: [],
flush: function() {
var data, now, _i, _len, _ref;
-
if (d.hidden) {
return;
}
@@ -11737,7 +11314,6 @@
},
update: function(data, now) {
var date, diff, isPost, relative, singlePost, _i, _len, _ref;
-
isPost = data instanceof Post;
date = isPost ? data.info.date : new Date(+data.dataset.utc);
now || (now = new Date());
@@ -11756,7 +11332,6 @@
},
setOwnTimeout: function(diff, data) {
var delay;
-
delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY;
return setTimeout(RelativeDates.markStale, delay, data);
},
@@ -11794,7 +11369,6 @@
},
node: function(post) {
var spoiler, spoilers, _i, _len;
-
spoilers = $$('s', this.nodes.comment);
for (_i = 0, _len = spoilers.length; _i < _len; _i++) {
spoiler = spoilers[_i];
@@ -11814,7 +11388,6 @@
},
ready: function() {
var field;
-
field = $.id('recaptcha_response_field');
$.on(field, 'keydown', function(e) {
if (e.keyCode === 8 && !field.value) {
@@ -11823,7 +11396,6 @@
});
return $.on($('form'), 'submit', function(e) {
var response;
-
e.preventDefault();
response = field.value.trim();
if (!/\s/.test(response)) {
@@ -11853,7 +11425,6 @@
},
createFunc: function(format) {
var code;
-
code = format.replace(/%([A-Za-z])/g, function(s, c) {
if (c in Time.formatters) {
return "' + Time.formatters." + c + ".call(date) + '";
@@ -11938,7 +11509,6 @@
Settings = {
init: function() {
var link, settings;
-
link = $.el('a', {
className: 'settings-link fa fa-wrench',
textContent: 'Settings',
@@ -11948,7 +11518,6 @@
Header.addShortcut(link);
$.get('previousversion', null, function(item) {
var changelog, el, previous;
-
if (previous = item['previousversion']) {
if (previous === g.VERSION) {
return;
@@ -11983,7 +11552,6 @@
},
open: function(openSection) {
var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', Settings.open);
if (Settings.dialog) {
return;
@@ -12036,7 +11604,6 @@
sections: [],
addSection: function(title, open) {
var hyphenatedTitle, _ref;
-
if (typeof title !== 'string') {
_ref = title.detail, title = _ref.title, open = _ref.open;
}
@@ -12049,7 +11616,6 @@
},
openSection: function() {
var section, selected;
-
if (selected = $('.tab-selected', Settings.dialog)) {
$.rmClass(selected, 'tab-selected');
}
@@ -12063,7 +11629,6 @@
},
main: function(section) {
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref;
-
items = {};
inputs = {};
_ref = Config.main;
@@ -12088,7 +11653,6 @@
}
$.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].checked = val;
@@ -12103,7 +11667,6 @@
boards: {}
}, function(item) {
var ID, board, thread, _ref1;
-
_ref1 = item.hiddenThreads.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -12118,7 +11681,6 @@
boards: {}
}, function(item) {
var ID, board, post, thread, _ref1;
-
_ref1 = item.hiddenPosts.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -12138,7 +11700,6 @@
boards: {}
}, function(item) {
var boardID;
-
for (boardID in item.hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
@@ -12149,7 +11710,6 @@
},
"export": function(now, data) {
var a, db, p, _i, _len, _ref;
-
if (typeof now !== 'number') {
now = Date.now();
data = {
@@ -12186,7 +11746,6 @@
},
onImport: function() {
var file, output, reader;
-
if (!(file = this.files[0])) {
return;
}
@@ -12198,7 +11757,6 @@
reader = new FileReader();
reader.onload = function(e) {
var data, err;
-
try {
data = JSON.parse(e.target.result);
Settings.loadSettings(data);
@@ -12215,7 +11773,6 @@
},
loadSettings: function(data) {
var key, val, version, _ref;
-
version = data.version.split('.');
if (version[0] === '2') {
data = Settings.convertSettings(data, {
@@ -12303,7 +11860,6 @@
},
convertSettings: function(data, map) {
var newKey, prevKey;
-
for (prevKey in map) {
newKey = map[prevKey];
if (newKey) {
@@ -12315,7 +11871,6 @@
},
filter: function(section) {
var select;
-
section.innerHTML = "";
select = $('select', section);
$.on(select, 'change', Settings.selectFilter);
@@ -12323,7 +11878,6 @@
},
selectFilter: function() {
var div, name, ta;
-
div = this.nextElementSibling;
if ((name = this.value) !== 'guide') {
$.rmAll(div);
@@ -12343,7 +11897,6 @@
},
sauce: function(section) {
var ta;
-
section.innerHTML = "Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%MD5: MD5 hash.%board: Current board.
";
ta = $('textarea', section);
$.get('sauces', Conf['sauces'], function(item) {
@@ -12353,7 +11906,6 @@
},
advanced: function(section) {
var archive, boardID, boardOptions, boardSelect, boards, data, event, input, inputs, item, items, name, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4;
-
section.innerHTML = "";
items = {};
inputs = {};
@@ -12373,7 +11925,6 @@
$.on(ta, 'change', $.cb.value);
$.get(items, function(items) {
var key, val;
-
for (key in items) {
val = items[key];
if (key === 'emojiPos') {
@@ -12444,7 +11995,6 @@
});
$.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
var option, selectedArchives, type;
-
selectedArchives = _arg.selectedArchives;
for (boardID in selectedArchives) {
data = selectedArchives[boardID];
@@ -12459,7 +12009,6 @@
},
addArchiveCell: function(boardID, data, type) {
var archive, i, length, options, select, td;
-
length = data[type].length;
td = $.el('td', {
className: 'archive-cell'
@@ -12489,10 +12038,8 @@
},
saveSelectedArchive: function() {
var _this = this;
-
return $.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
var selectedArchives, _name;
-
selectedArchives = _arg.selectedArchives;
(selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value;
return $.set('selectedArchives', selectedArchives);
@@ -12503,7 +12050,6 @@
},
time: function() {
var funk;
-
funk = Time.createFunc(this.value);
return this.nextElementSibling.textContent = funk(Time, new Date());
},
@@ -12512,7 +12058,6 @@
},
fileInfo: function() {
var data, funk;
-
data = {
isReply: true,
file: {
@@ -12551,7 +12096,6 @@
},
keybinds: function(section) {
var arr, input, inputs, items, key, tbody, tr, _ref;
-
section.innerHTML = "Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
";
tbody = $('tbody', section);
items = {};
@@ -12572,7 +12116,6 @@
}
return $.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].value = val;
@@ -12581,7 +12124,6 @@
},
keybind: function(e) {
var key;
-
if (e.keyCode === 9) {
return;
}
@@ -12598,10 +12140,8 @@
Main = {
init: function() {
var db, flatten, _i, _len, _ref;
-
flatten = function(parent, obj) {
var key, val;
-
if (obj instanceof Array) {
Conf[parent] = obj[0];
} else if (typeof obj === 'object') {
@@ -12634,7 +12174,6 @@
},
initFeatures: function() {
var init, pathname, _ref;
-
pathname = location.pathname.split('/');
g.BOARD = new Board(pathname[1]);
if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
@@ -12662,7 +12201,6 @@
case 'i.4cdn.org':
$.ready(function() {
var URL, _ref1;
-
if (Conf['404 Redirect'] && ((_ref1 = d.title) === '4chan - Temporarily Offline' || _ref1 === '4chan - 404 Not Found')) {
Redirect.init();
pathname = location.pathname.split('/');
@@ -12679,7 +12217,6 @@
}
init = function(features) {
var err, module, name;
-
for (name in features) {
module = features[name];
try {
@@ -12760,7 +12297,6 @@
},
initStyle: function() {
var mainStyleSheet, setStyle, style, styleSheets, _ref;
-
$.off(d, '4chanMainInit', Main.initStyle);
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return;
@@ -12782,7 +12318,6 @@
styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
setStyle = function() {
var styleSheet, _i, _len;
-
$.rmClass(doc, style);
for (_i = 0, _len = styleSheets.length; _i < _len; _i++) {
styleSheet = styleSheets[_i];
@@ -12804,7 +12339,6 @@
},
initReady: function() {
var GMver, err, errors, href, i, passLink, post, postRoot, posts, styleSelector, thread, threadRoot, v, _i, _j, _len, _len1, _ref, _ref1, _ref2;
-
if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
if (Conf['404 Redirect'] && g.VIEW === 'thread') {
href = Redirect.to('thread', {
@@ -12880,7 +12414,6 @@
},
callbackNodes: function(klass, nodes) {
var callback, err, errors, i, len, node, _i, _len, _ref;
-
len = nodes.length;
_ref = klass.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -12908,12 +12441,10 @@
},
callbackNodesDB: function(klass, nodes, cb) {
var errors, func, i, len, node, queue, softTask;
-
queue = [];
errors = null;
func = function(node) {
var callback, err, _i, _len, _ref;
-
_ref = klass.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
callback = _ref[_i];
@@ -12941,7 +12472,6 @@
};
softTask = function() {
var node;
-
node = queue.shift();
func(node);
if (!queue.length) {
@@ -12963,7 +12493,6 @@
},
addCallback: function(e) {
var Klass, obj;
-
obj = e.detail;
if (typeof obj.callback.name !== 'string') {
throw new Error("Invalid callback name: " + obj.callback.name);
@@ -12983,7 +12512,6 @@
},
handleErrors: function(errors) {
var div, error, logs, _i, _len;
-
if (!(errors instanceof Array)) {
error = errors;
} else if (errors.length === 1) {
@@ -12998,7 +12526,6 @@
});
$.on(div.lastElementChild, 'click', function() {
var _ref;
-
return _ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = _ref[0], logs.hidden = _ref[1], _ref;
});
logs = $.el('div', {
@@ -13012,7 +12539,6 @@
},
parseError: function(data) {
var error, message;
-
c.error(data.message, data.error.stack);
message = $.el('div', {
textContent: data.message
@@ -13024,7 +12550,6 @@
},
isThisPageLegit: function() {
var _ref;
-
if (!('thisPageIsLegit' in Main)) {
Main.thisPageIsLegit = location.hostname === 'boards.4chan.org' && !$('link[href*="favicon-status.ico"]', d.head) && ((_ref = d.title) !== '4chan - Temporarily Offline' && _ref !== '4chan - Error' && _ref !== '504 Gateway Time-out');
}
diff --git a/builds/crx/script.js b/builds/crx/script.js
index e954eb0ae..da3ea5048 100644
--- a/builds/crx/script.js
+++ b/builds/crx/script.js
@@ -91,7 +91,6 @@
Array.prototype.indexOf = function(val) {
var i;
-
i = this.length;
while (i--) {
if (this[i] === val) {
@@ -353,7 +352,6 @@
$.extend = function(obj, prop) {
var key, val;
-
for (key in prop) {
val = prop[key];
if (prop.hasOwnProperty(key)) {
@@ -370,7 +368,6 @@
$.ready = function(fc) {
var cb;
-
if (d.readyState !== 'loading') {
$.queueTask(fc);
return;
@@ -384,7 +381,6 @@
$.formData = function(form) {
var fd, key, val;
-
if (form instanceof HTMLFormElement) {
return new FormData(form);
}
@@ -404,7 +400,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
object[key] = val;
@@ -413,11 +408,9 @@
$.ajax = (function() {
var lastModified;
-
lastModified = {};
return function(url, options, extra) {
var form, r, sync, type, upCallbacks, whenModified;
-
if (extra == null) {
extra = {};
}
@@ -442,11 +435,9 @@
$.cache = (function() {
var reqs;
-
reqs = {};
return function(url, cb, options) {
var err, req, rm;
-
if (req = reqs[url]) {
if (req.readyState === 4) {
cb.call(req, req.evt);
@@ -466,7 +457,6 @@
}
$.on(req, 'load', function(e) {
var _i, _len, _ref;
-
_ref = this.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
cb = _ref[_i];
@@ -502,7 +492,6 @@
$.addStyle = function(css, id) {
var style;
-
style = $.el('style', {
id: id,
textContent: css
@@ -549,7 +538,6 @@
} else {
return function(el) {
var _ref;
-
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
};
}
@@ -557,7 +545,6 @@
$.rmAll = function(root) {
var node, _i, _len, _ref;
-
_ref = __slice.call(root.childNodes);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
node = _ref[_i];
@@ -575,7 +562,6 @@
$.nodes = function(nodes) {
var frag, node, _i, _len;
-
if (!(nodes instanceof Array)) {
return nodes;
}
@@ -609,7 +595,6 @@
$.el = function(tag, properties) {
var el;
-
el = d.createElement(tag);
if (properties) {
$.extend(el, properties);
@@ -619,7 +604,6 @@
$.on = function(el, events, handler) {
var event, _i, _len, _ref;
-
_ref = events.split(' ');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
event = _ref[_i];
@@ -629,7 +613,6 @@
$.off = function(el, events, handler) {
var event, _i, _len, _ref;
-
_ref = events.split(' ');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
event = _ref[_i];
@@ -653,7 +636,6 @@
$.debounce = function(wait, fn) {
var args, exec, lastCall, that, timeout;
-
lastCall = 0;
timeout = null;
that = null;
@@ -675,11 +657,9 @@
$.queueTask = (function() {
var execTask, taskChannel, taskQueue;
-
taskQueue = [];
execTask = function() {
var args, func, task;
-
task = taskQueue.shift();
func = task[0];
args = Array.prototype.slice.call(task, 1);
@@ -702,7 +682,6 @@
$.globalEval = function(code) {
var script;
-
script = $.el('script', {
textContent: code
});
@@ -712,7 +691,6 @@
$.bytesToString = function(size) {
var unit;
-
unit = 0;
while (size >= 1024) {
size /= 1024;
@@ -728,7 +706,6 @@
$.item = function(key, val) {
var item;
-
item = {};
item[key] = val;
return item;
@@ -739,7 +716,6 @@
$.sync = (function() {
chrome.storage.onChanged.addListener(function(changes) {
var cb, key;
-
for (key in changes) {
if (cb = $.syncing[key]) {
cb(changes[key].newValue, key);
@@ -759,7 +735,6 @@
$.get = function(key, val, cb) {
var count, done, items, localItems, syncItems;
-
if (typeof cb === 'function') {
items = $.item(key, val);
} else {
@@ -798,7 +773,6 @@
$.set = (function() {
var items, setAll, setArea, timeout;
-
items = {
sync: {},
local: {}
@@ -820,7 +794,6 @@
};
setAll = $.debounce($.SECOND, function() {
var err, key, _i, _len, _ref;
-
_ref = $.localKeys;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
@@ -891,7 +864,6 @@
Thread.prototype.setPage = function(pageNum) {
var icon, key, _i, _len, _ref;
-
icon = $('.page-num', this.OP.nodes.post);
_ref = ['title', 'textContent'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -902,7 +874,6 @@
Thread.prototype.setStatus = function(type, status) {
var icon, name, root, typeLC;
-
name = "is" + type;
if (this[name] === status) {
return;
@@ -933,7 +904,6 @@
Thread.prototype.collect = function() {
var post, postID, _i, _len, _ref;
-
_ref = this.posts;
for (post = _i = 0, _len = _ref.length; _i < _len; post = ++_i) {
postID = _ref[post];
@@ -956,7 +926,6 @@
function Post(root, thread, board, that) {
var capcode, date, email, flag, info, name, post, subject, tripcode, uniqueID;
-
this.thread = thread;
this.board = board;
if (that == null) {
@@ -1035,7 +1004,6 @@
Post.prototype.parseComment = function() {
var bq, i, node, nodes, text;
-
this.nodes.comment.normalize();
bq = this.nodes.comment.cloneNode(true);
nodes = $$('.abbr, .exif, b', bq);
@@ -1054,7 +1022,6 @@
Post.prototype.parseQuotes = function() {
var quotelink, _i, _len, _ref;
-
this.quotes = [];
_ref = $$('.quotelink', this.nodes.comment);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -1065,7 +1032,6 @@
Post.prototype.parseQuote = function(quotelink) {
var fullID, match;
-
if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) {
return;
}
@@ -1081,7 +1047,6 @@
Post.prototype.parseFile = function(that) {
var anchor, fileEl, fileText, nameNode, size, thumb, unit;
-
if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) {
return;
}
@@ -1111,7 +1076,6 @@
Post.prototype.cleanup = function(root) {
var node, _i, _j, _len, _len1, _ref, _ref1;
-
_ref = $$('.mobile', root);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
node = _ref[_i];
@@ -1126,7 +1090,6 @@
Post.prototype.kill = function(file, now) {
var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
-
now || (now = new Date());
if (file) {
if (this.file.isDead) {
@@ -1175,7 +1138,6 @@
Post.prototype.resurrect = function() {
var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
-
delete this.isDead;
delete this.timeOfDeath;
$.rmClass(this.nodes.root, 'deleted-post');
@@ -1216,7 +1178,6 @@
Post.prototype.rmClone = function(index) {
var clone, _i, _len, _ref;
-
this.clones.splice(index, 1);
_ref = this.clones.slice(index);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -1234,7 +1195,6 @@
function Clone(origin, context) {
var file, info, inline, inlined, key, nodes, post, root, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;
-
this.origin = origin;
this.context = context;
_ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
@@ -1321,7 +1281,6 @@
function DataBoard(key, sync, dontClean) {
var init,
_this = this;
-
this.key = key;
this.onSync = __bind(this.onSync, this);
this.data = Conf[key];
@@ -1345,7 +1304,6 @@
DataBoard.prototype["delete"] = function(_arg) {
var boardID, postID, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID;
if (postID) {
delete this.data.boards[boardID][threadID][postID];
@@ -1366,7 +1324,6 @@
DataBoard.prototype.deleteIfEmpty = function(_arg) {
var boardID, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID;
if (threadID) {
if (!Object.keys(this.data.boards[boardID][threadID]).length) {
@@ -1382,7 +1339,6 @@
DataBoard.prototype.set = function(_arg) {
var boardID, postID, threadID, val, _base, _base1, _base2;
-
boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val;
if (postID !== void 0) {
((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val;
@@ -1396,7 +1352,6 @@
DataBoard.prototype.get = function(_arg) {
var ID, board, boardID, defaultValue, postID, thread, threadID, val, _i, _len;
-
boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, defaultValue = _arg.defaultValue;
if (board = this.data.boards[boardID]) {
if (!threadID) {
@@ -1420,7 +1375,6 @@
DataBoard.prototype.clean = function() {
var boardID, now, val, _ref;
-
_ref = this.data.boards;
for (boardID in _ref) {
val = _ref[boardID];
@@ -1440,10 +1394,8 @@
DataBoard.prototype.ajaxClean = function(boardID) {
var _this = this;
-
return $.cache("//a.4cdn.org/" + boardID + "/threads.json", function(e) {
var board, page, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (e.target.status !== 200) {
if (e.target.status === 404) {
_this["delete"](boardID);
@@ -1552,10 +1504,8 @@
},
toBlob: function() {
var _base;
-
return (_base = HTMLCanvasElement.prototype).toBlob || (_base.toBlob = function(cb) {
var data, i, l, ui8a, _i;
-
data = atob(this.toDataURL().slice(22));
l = data.length;
ui8a = new Uint8Array(l);
@@ -1593,7 +1543,6 @@
init: function() {
var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler,
_this = this;
-
this.menu = new UI.Menu('header');
menuButton = $.el('span', {
className: 'menu-button',
@@ -1704,7 +1653,6 @@
});
$.ready(function() {
var a, cs;
-
_this.footer = $.id('boardNavDesktopFoot');
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
a.className = 'current';
@@ -1739,7 +1687,6 @@
}),
setBoardList: function() {
var a, boardList, btn, fourchannav, fullBoardList;
-
fourchannav = $.id('boardNavDesktop');
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
a.className = 'current';
@@ -1761,7 +1708,6 @@
},
generateBoardList: function(text) {
var as, list, nodes;
-
list = $('#custom-board-list', Header.bar);
$.rmAll(list);
if (!text) {
@@ -1770,7 +1716,6 @@
as = $$('#full-board-list a[title]', Header.bar);
nodes = text.match(/[\w@]+((-(all|title|replace|full|index|catalog|url:"[^"]+[^"]"|text:"[^"]+")|\,"[^"]+[^"]"))*|[^\w@]+/g).map(function(t) {
var a, board, m, _i, _len;
-
if (/^[^\w@]/.test(t)) {
return $.tn(t);
}
@@ -1821,7 +1766,6 @@
},
toggleBoardList: function() {
var bar, custom, full, showBoardList;
-
bar = Header.bar;
custom = $('#custom-board-list', bar);
full = $('#full-board-list', bar);
@@ -1839,7 +1783,6 @@
},
toggleLinkJustify: function() {
var centered;
-
$.event('CloseMenu');
centered = this.nodeName === 'INPUT' ? this.checked : void 0;
Header.setLinkJustify(centered);
@@ -1883,7 +1826,6 @@
},
toggleBarVisibility: function() {
var hide, message;
-
hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
this.checked = hide;
$.set('Header auto-hide', Conf['Header auto-hide'] = hide);
@@ -1905,14 +1847,12 @@
},
toggleHideBarOnScroll: function(e) {
var hide;
-
hide = this.checked;
$.set('Header auto-hide on scroll', hide);
return Header.setHideBarOnScroll(hide);
},
hideBarOnScroll: function() {
var offsetY;
-
offsetY = window.pageYOffset;
if (offsetY > (Header.previousOffset || 0)) {
$.addClass(Header.bar, 'autohide');
@@ -1925,7 +1865,6 @@
},
setBarPosition: function(bottom) {
var args;
-
Header.barPositionToggler.checked = bottom;
$.event('CloseMenu');
args = bottom ? ['bottom-header', 'top-header', 'bottom', 'after'] : ['top-header', 'bottom-header', 'top', 'add'];
@@ -1944,7 +1883,6 @@
},
toggleFooterVisibility: function() {
var hide, message;
-
$.event('CloseMenu');
hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden;
Header.setFooterVisibility(hide);
@@ -1954,7 +1892,6 @@
},
setCustomNav: function(show) {
var btn, cust, full, _ref;
-
Header.customNavToggler.checked = show;
cust = $('#custom-board-list', Header.bar);
full = $('#full-board-list', Header.bar);
@@ -1967,14 +1904,12 @@
},
editCustomNav: function() {
var settings;
-
Settings.open('Advanced');
settings = $.id('fourchanx-settings');
return $('input[name=boardnav]', settings).focus();
},
hashScroll: function() {
var hash, post;
-
hash = this.location.hash.slice(1);
if (!(/^p\d+$/.test(hash) && (post = $.id(hash)))) {
return;
@@ -1986,7 +1921,6 @@
},
scrollTo: function(root, down, needed) {
var x;
-
if (down) {
x = Header.getBottomOf(root);
if (!(needed && x >= 0)) {
@@ -2004,7 +1938,6 @@
},
getTopOf: function(root) {
var headRect, top;
-
top = root.getBoundingClientRect().top;
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
headRect = Header.toggle.getBoundingClientRect();
@@ -2014,7 +1947,6 @@
},
getBottomOf: function(root) {
var bottom, clientHeight, headRect;
-
clientHeight = doc.clientHeight;
bottom = clientHeight - root.getBoundingClientRect().bottom;
if (Conf['Bottom Header']) {
@@ -2025,7 +1957,6 @@
},
addShortcut: function(el) {
var shortcut;
-
shortcut = $.el('span', {
className: 'shortcut brackets-wrap'
});
@@ -2037,7 +1968,6 @@
},
createNotification: function(e) {
var cb, content, lifetime, notice, type, _ref;
-
_ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb;
notice = new Notice(type, content, lifetime);
if (cb) {
@@ -2047,7 +1977,6 @@
areNotificationsEnabled: false,
enableDesktopNotifications: function() {
var authorize, disable, el, notice, _ref;
-
if (!(window.Notification && Conf['Desktop Notifications'])) {
return;
}
@@ -2082,7 +2011,6 @@
Index = {
init: function() {
var anchorEntry, input, label, modeEntry, name, refNavEntry, repliesEntry, sortEntry, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
-
if (g.VIEW !== 'index' || g.BOARD.ID === 'f') {
return;
}
@@ -2218,7 +2146,6 @@
return $('.board', doc) || d.readyState !== 'loading';
}), function() {
var board, navLink, _l, _len3, _ref3;
-
board = $('.board');
$.replace(board, Index.root);
d.implementation.createDocument(null, null, null).appendChild(board);
@@ -2252,7 +2179,6 @@
},
popstate: function(e) {
var pageNum;
-
pageNum = Index.getCurrentPage();
if (Index.currentPage !== pageNum) {
return Index.pageLoad(pageNum);
@@ -2260,7 +2186,6 @@
},
pageNav: function(e) {
var a;
-
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -2325,7 +2250,6 @@
},
buildPagelist: function() {
var a, i, maxPageNum, nodes, pagesRoot, _i;
-
pagesRoot = $('.pages', Index.pagelist);
maxPageNum = Index.getMaxPageNum();
if (pagesRoot.childElementCount !== maxPageNum + 1) {
@@ -2344,7 +2268,6 @@
},
setPage: function() {
var a, href, maxPageNum, next, pageNum, pagesRoot, prev, strong;
-
pageNum = Index.getCurrentPage();
maxPageNum = Index.getMaxPageNum();
pagesRoot = $('.pages', Index.pagelist);
@@ -2370,7 +2293,6 @@
},
update: function(pageNum) {
var now, onload, _ref, _ref1;
-
if (!navigator.onLine) {
return;
}
@@ -2409,7 +2331,6 @@
},
load: function(e, pageNum) {
var err, notice, req, timeEl;
-
$.rmClass(Index.button, 'fa-spin');
req = Index.req, notice = Index.notice;
delete Index.req;
@@ -2461,7 +2382,6 @@
},
parseThreadList: function(pages) {
var thread, threadID, _ref, _ref1;
-
Index.pagesNum = pages.length;
Index.threadsNumPerPage = pages[0].threads.length;
Index.liveThreadData = pages.reduce((function(arr, next) {
@@ -2480,7 +2400,6 @@
},
buildThreads: function() {
var err, errors, i, posts, thread, threadData, threadRoot, threads, _i, _len, _ref;
-
Index.nodes = [];
threads = [];
posts = [];
@@ -2523,7 +2442,6 @@
},
buildReplies: function(threadRoots) {
var data, err, errors, i, lastReplies, node, nodes, post, posts, thread, threadRoot, _i, _j, _len, _len1;
-
posts = [];
for (_i = 0, _len = threadRoots.length; _i < _len; _i += 2) {
threadRoot = threadRoots[_i];
@@ -2562,7 +2480,6 @@
},
sort: function() {
var i, sortedThreadIDs, threadID, _i, _len;
-
switch (Conf['Index Sort']) {
case 'bump':
sortedThreadIDs = Index.liveThreadIDs;
@@ -2624,7 +2541,6 @@
},
sortOnTop: function(match) {
var i, offset, threadRoot, _i, _len, _ref, _ref1;
-
offset = 0;
_ref = Index.sortedNodes;
for (i = _i = 0, _len = _ref.length; _i < _len; i = _i += 2) {
@@ -2636,7 +2552,6 @@
},
buildIndex: function() {
var nodes, nodesPerPage, pageNum;
-
if (Conf['Index Mode'] === 'paged') {
pageNum = Index.getCurrentPage();
nodesPerPage = Index.threadsNumPerPage * 2;
@@ -2659,7 +2574,6 @@
},
onSearchInput: function() {
var pageNum;
-
if (Index.isSearching = !!Index.searchInput.value.trim()) {
if (!Index.searchInput.dataset.searching) {
Index.searchInput.dataset.searching = 1;
@@ -2687,7 +2601,6 @@
},
querySearch: function(query) {
var keywords;
-
if (!(keywords = query.toLowerCase().match(/\S+/g))) {
return;
}
@@ -2695,7 +2608,6 @@
},
search: function(keywords) {
var found, i, threadRoot, _i, _len, _ref;
-
found = [];
_ref = Index.sortedNodes;
for (i = _i = 0, _len = _ref.length; _i < _len; i = _i += 2) {
@@ -2708,7 +2620,6 @@
},
searchMatch: function(thread, keywords) {
var file, info, key, keyword, text, _i, _j, _len, _len1, _ref, _ref1;
-
_ref = thread.OP, info = _ref.info, file = _ref.file;
text = [];
_ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
@@ -2738,7 +2649,6 @@
spoilerRange: {},
shortFilename: function(filename, isReply) {
var threshold;
-
threshold = isReply ? 30 : 40;
if (filename.length - 4 > threshold) {
return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3);
@@ -2748,7 +2658,6 @@
},
thumbRotate: (function() {
var n;
-
n = 0;
return function() {
return n = (n + 1) % 3;
@@ -2756,7 +2665,6 @@
})(),
postFromObject: function(data, boardID) {
var o;
-
o = {
postID: data.no,
threadID: data.resto || data.no,
@@ -2800,7 +2708,6 @@
*/
var a, boardID, capcode, capcodeClass, capcodeIcon, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, gifIcon, href, imgSrc, isClosed, isOP, isSticky, name, pageIcon, pageNum, postID, quote, replyLink, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref;
-
postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file;
isOP = postID === threadID;
staticPath = Build.staticPath, gifIcon = Build.gifIcon;
@@ -2894,7 +2801,6 @@
},
summary: function(boardID, threadID, posts, files) {
var text;
-
text = [];
text.push("" + posts + " post" + (posts > 1 ? 's' : ''));
if (files) {
@@ -2909,7 +2815,6 @@
},
thread: function(board, data) {
var OP, files, nodes, posts, root, _ref;
-
Build.spoilerRange[board] = data.custom_spoiler;
if ((OP = board.posts[data.no]) && (root = OP.nodes.root.parentNode)) {
$.rmAll(root);
@@ -2936,7 +2841,6 @@
Get = {
threadExcerpt: function(thread) {
var OP, excerpt, _ref;
-
OP = thread.OP;
excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || Conf['Anonymize'] && 'Anonymous' || $('.nameBlock', OP.nodes.info).textContent.trim();
if (excerpt.length > 70) {
@@ -2952,7 +2856,6 @@
},
postFromRoot: function(root) {
var boardID, index, link, post, postID;
-
link = $('a[title="Highlight this post"]', root);
boardID = link.pathname.split('/')[1];
postID = link.hash.slice(2);
@@ -2972,7 +2875,6 @@
},
postDataFromLink: function(link) {
var boardID, path, postID, threadID, _ref;
-
if (link.hostname === 'boards.4chan.org') {
path = link.pathname.split('/');
boardID = path[1];
@@ -2990,7 +2892,6 @@
},
allQuotelinksLinkingTo: function(post) {
var ID, quote, quotedPost, quotelinks, quoterPost, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4;
-
quotelinks = [];
_ref = g.posts;
for (ID in _ref) {
@@ -3019,14 +2920,12 @@
}
return quotelinks.filter(function(quotelink) {
var boardID, postID, _ref5;
-
_ref5 = Get.postDataFromLink(quotelink), boardID = _ref5.boardID, postID = _ref5.postID;
return boardID === post.board.ID && postID === post.ID;
});
},
postClone: function(boardID, threadID, postID, root, context) {
var post, url;
-
if (post = g.posts["" + boardID + "." + postID]) {
Get.insert(post, root, context);
return;
@@ -3049,7 +2948,6 @@
},
insert: function(post, root, context) {
var clone, nodes;
-
if (!root.parentNode) {
return;
}
@@ -3063,7 +2961,6 @@
},
fetchedPost: function(req, boardID, threadID, postID, root, context) {
var board, post, posts, status, thread, url, _i, _len;
-
if (post = g.posts["" + boardID + "." + postID]) {
Get.insert(post, root, context);
return;
@@ -3117,7 +3014,6 @@
},
archivedPost: function(req, boardID, postID, root, context) {
var board, bq, comment, data, o, post, thread, threadID, _ref;
-
if (post = g.posts["" + boardID + "." + postID]) {
Get.insert(post, root, context);
return;
@@ -3214,10 +3110,8 @@
UI = (function() {
var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove;
-
dialog = function(id, position, html) {
var child, el, move, _i, _len, _ref;
-
el = $.el('div', {
className: 'dialog',
innerHTML: html,
@@ -3259,7 +3153,6 @@
Menu.prototype.makeMenu = function() {
var menu;
-
menu = $.el('div', {
className: 'dialog',
id: 'menu',
@@ -3274,7 +3167,6 @@
Menu.prototype.toggle = function(e, button, data) {
var previousButton;
-
e.preventDefault();
e.stopPropagation();
if (currentMenu) {
@@ -3292,7 +3184,6 @@
Menu.prototype.open = function(button, data) {
var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2;
-
menu = this.makeMenu();
currentMenu = menu;
lastToggledButton = button;
@@ -3331,7 +3222,6 @@
Menu.prototype.insertEntry = function(entry, parent, data) {
var subEntry, submenu, _i, _len, _ref;
-
if (typeof entry.open === 'function') {
if (!entry.open(data)) {
return;
@@ -3365,7 +3255,6 @@
Menu.prototype.findNextEntry = function(entry, direction) {
var entries;
-
entries = __slice.call(entry.parentNode.children);
entries.sort(function(first, second) {
return first.style.order - second.style.order;
@@ -3375,7 +3264,6 @@
Menu.prototype.keybinds = function(e) {
var entry, next, nextPrev, subEntry, submenu;
-
entry = $('.focused', currentMenu);
while (subEntry = $('.focused', entry)) {
entry = subEntry;
@@ -3421,7 +3309,6 @@
Menu.prototype.focus = function(entry) {
var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2;
-
while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
$.rmClass(focused, 'focused');
}
@@ -3449,7 +3336,6 @@
Menu.prototype.addEntry = function(e) {
var entry;
-
entry = e.detail;
if (entry.type !== this.type) {
return;
@@ -3460,7 +3346,6 @@
Menu.prototype.parseEntry = function(entry) {
var el, subEntries, subEntry, _i, _len;
-
el = entry.el, subEntries = entry.subEntries;
$.addClass(el, 'entry');
$.on(el, 'focus mouseover', (function(e) {
@@ -3483,7 +3368,6 @@
})();
dragstart = function(e) {
var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
-
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -3522,7 +3406,6 @@
};
touchmove = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -3534,7 +3417,6 @@
};
drag = function(e) {
var bottom, clientX, clientY, left, right, style, top;
-
clientX = e.clientX, clientY = e.clientY;
left = clientX - this.dx;
left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%';
@@ -3550,7 +3432,6 @@
};
touchend = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -3572,7 +3453,6 @@
};
hoverstart = function(_arg) {
var asapTest, cb, el, endEvents, latestEvent, o, root;
-
root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb;
o = {
root: root,
@@ -3601,7 +3481,6 @@
};
hover = function(e) {
var clientX, clientY, height, left, right, style, top, _ref;
-
this.latestEvent = e;
height = this.el.offsetHeight;
clientX = e.clientX, clientY = e.clientY;
@@ -3644,7 +3523,6 @@
},
node: function() {
var email, name, tripcode, _ref;
-
if (this.info.capcode || this.isClone) {
return;
}
@@ -3667,7 +3545,6 @@
filters: {},
init: function() {
var boards, err, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
-
if (g.VIEW === 'catalog' || !Conf['Filter']) {
return;
}
@@ -3704,7 +3581,6 @@
op = ((_ref3 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref3[1] : void 0) || 'yes';
stub = (function() {
var _ref4;
-
switch ((_ref4 = filter.match(/stub:(yes|no)/)) != null ? _ref4[1] : void 0) {
case 'yes':
return true;
@@ -3735,7 +3611,6 @@
},
createFilter: function(regexp, op, stub, hl, top) {
var settings, test;
-
test = typeof regexp === 'string' ? function(value) {
return regexp === value;
} : function(value) {
@@ -3759,7 +3634,6 @@
},
node: function() {
var filter, key, result, value, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -3866,7 +3740,6 @@
menu: {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) {
return;
}
@@ -3892,7 +3765,6 @@
},
createSubEntry: function(text, type) {
var el;
-
el = $.el('a', {
href: 'javascript:;',
textContent: text
@@ -3903,7 +3775,6 @@
el: el,
open: function(post) {
var value;
-
value = Filter[type](post);
return value !== false;
}
@@ -3911,7 +3782,6 @@
},
makeFilter: function() {
var re, type, value;
-
type = this.dataset.type;
value = Filter[type](Filter.menu.post);
re = type === 'uniqueID' || type === 'MD5' ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
@@ -3926,7 +3796,6 @@
re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
return $.get(type, Conf[type], function(item) {
var save, section, select, ta, tl;
-
save = item[type];
save = save ? "" + save + "\n" + re : re;
$.set(type, save);
@@ -3960,7 +3829,6 @@
},
node: function() {
var data;
-
if (!this.isReply || this.isClone) {
return;
}
@@ -3984,7 +3852,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub, replies, thisPost;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
return;
}
@@ -4055,7 +3922,6 @@
order: 20,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -4087,7 +3953,6 @@
order: 15,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -4104,7 +3969,6 @@
},
hide: function() {
var makeStub, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -4123,7 +3987,6 @@
},
show: function() {
var data, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -4147,7 +4010,6 @@
},
hideStub: function() {
var post;
-
post = PostHiding.menu.post;
post.nodes.root.hidden = true;
$.event('CloseMenu');
@@ -4155,7 +4017,6 @@
},
makeButton: function(post, type) {
var a, span;
-
span = $.el('span', {
className: "brackets-wrap",
textContent: "\u00A0" + (type === 'hide' ? '-' : '+') + "\u00A0"
@@ -4170,7 +4031,6 @@
},
saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
var data;
-
data = {
boardID: post.board.ID,
threadID: post.thread.ID,
@@ -4189,14 +4049,12 @@
},
toggle: function() {
var post;
-
post = Get.postFromNode(this);
PostHiding[(post.isHidden ? 'show' : 'hide')](post);
return PostHiding.saveHiddenState(post, post.isHidden);
},
hide: function(post, makeStub, hideRecursively) {
var a, postInfo, quotelink, _i, _len, _ref;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -4234,7 +4092,6 @@
},
show: function(post, showRecursively) {
var quotelink, _i, _len, _ref;
-
if (showRecursively == null) {
showRecursively = Conf['Recursive Hiding'];
}
@@ -4270,7 +4127,6 @@
},
node: function() {
var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.isClone) {
return;
}
@@ -4288,7 +4144,6 @@
},
add: function() {
var args, obj, post, recursive, _base, _name;
-
recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = {
recursives: [],
@@ -4299,7 +4154,6 @@
},
rm: function(recursive, post) {
var i, obj, rec, _i, _len, _ref;
-
if (!(obj = Recursive.recursives[post.fullID])) {
return;
}
@@ -4314,7 +4168,6 @@
},
apply: function() {
var ID, args, fullID, post, recursive, _ref;
-
recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
fullID = post.fullID;
_ref = g.posts;
@@ -4342,7 +4195,6 @@
},
node: function() {
var data;
-
if (data = ThreadHiding.db.get({
boardID: this.board.ID,
threadID: this.ID
@@ -4356,7 +4208,6 @@
},
onIndexBuild: function(_arg) {
var i, nodes, root, thread, _i, _len;
-
nodes = _arg.detail;
for (i = _i = 0, _len = nodes.length; _i < _len; i = _i += 2) {
root = nodes[i];
@@ -4373,7 +4224,6 @@
},
syncCatalog: function() {
var hiddenThreads, hiddenThreadsOnCatalog, threadID;
-
hiddenThreads = ThreadHiding.db.get({
boardID: g.BOARD.ID,
defaultValue: {}
@@ -4400,7 +4250,6 @@
cleanCatalog: function(hiddenThreadsOnCatalog) {
return $.cache("//a.4cdn.org/" + g.BOARD + "/threads.json", function() {
var page, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.status !== 200) {
return;
}
@@ -4426,7 +4275,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub;
-
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
return;
}
@@ -4448,7 +4296,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || thread.isHidden) {
return false;
@@ -4476,7 +4323,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -4496,7 +4342,6 @@
order: 15,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -4507,7 +4352,6 @@
},
hide: function() {
var makeStub, thread;
-
makeStub = $('input', this.parentNode).checked;
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, makeStub);
@@ -4516,7 +4360,6 @@
},
show: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.show(thread);
ThreadHiding.saveHiddenState(thread);
@@ -4524,7 +4367,6 @@
},
hideStub: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, false);
$.event('CloseMenu');
@@ -4532,7 +4374,6 @@
},
makeButton: function(thread, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-thread-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -4544,7 +4385,6 @@
},
makeStub: function(thread, root) {
var a, numReplies, opInfo, summary;
-
numReplies = $$('.thread > .replyContainer', root).length;
if (summary = $('.summary', root)) {
numReplies += +summary.textContent.match(/\d+/);
@@ -4564,7 +4404,6 @@
},
saveHiddenState: function(thread, makeStub) {
var hiddenThreadsOnCatalog;
-
hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
if (thread.isHidden) {
ThreadHiding.db.set({
@@ -4597,7 +4436,6 @@
},
hide: function(thread, makeStub) {
var threadRoot;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -4613,7 +4451,6 @@
},
show: function(thread) {
var threadRoot;
-
if (thread.stub) {
$.rm(thread.stub);
delete thread.stub;
@@ -4626,7 +4463,6 @@
QuoteBacklink = {
init: function() {
var format;
-
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
return;
}
@@ -4644,7 +4480,6 @@
},
firstNode: function() {
var a, clone, container, containers, frag, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
-
if (this.isClone || !this.quotes.length) {
return;
}
@@ -4682,7 +4517,6 @@
},
secondNode: function() {
var container;
-
if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
this.nodes.backlinkContainer = $('.container', this.nodes.info);
return;
@@ -4696,7 +4530,6 @@
},
getContainer: function(id) {
var _base;
-
return (_base = this.containers)[id] || (_base[id] = $.el('span', {
className: 'container'
}));
@@ -4719,7 +4552,6 @@
},
node: function() {
var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -4749,7 +4581,6 @@
if (Conf['Quote Hash Navigation']) {
this.node = function() {
var link, _i, _len, _ref;
-
_ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks));
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];
@@ -4762,7 +4593,6 @@
} else {
this.node = function() {
var link, _i, _len, _ref;
-
_ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks));
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];
@@ -4789,7 +4619,6 @@
},
toggle: function(e) {
var boardID, context, postID, threadID, _ref;
-
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -4815,7 +4644,6 @@
},
add: function(quotelink, boardID, threadID, postID, context) {
var inline, isBacklink, post, qroot, root;
-
isBacklink = $.hasClass(quotelink, 'backlink');
inline = $.el('div', {
id: "i" + postID,
@@ -4840,7 +4668,6 @@
},
rm: function(quotelink, boardID, threadID, postID, context) {
var el, inlined, isBacklink, post, qroot, root, _ref;
-
isBacklink = $.hasClass(quotelink, 'backlink');
root = QuoteInline.findRoot(quotelink, isBacklink);
root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root);
@@ -4882,7 +4709,6 @@
},
node: function() {
var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref, _ref1;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -4925,7 +4751,6 @@
},
node: function() {
var link, _i, _len, _ref;
-
_ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks));
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];
@@ -4934,7 +4759,6 @@
},
mouseover: function(e) {
var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1;
-
if ($.hasClass(this, 'inlined')) {
return;
}
@@ -4978,7 +4802,6 @@
},
mouseout: function() {
var clone, post, root, _i, _len, _ref;
-
if (!(root = this.el.firstElementChild)) {
return;
}
@@ -5008,7 +4831,6 @@
},
node: function() {
var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone) {
return;
}
@@ -5031,7 +4853,6 @@
QuoteThreading = {
init: function() {
var input;
-
if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
return;
}
@@ -5054,7 +4875,6 @@
},
setup: function() {
var ID, post, posts;
-
$.off(d, '4chanXInitFinished', QuoteThreading.setup);
posts = g.posts;
for (ID in posts) {
@@ -5067,7 +4887,6 @@
},
node: function() {
var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len;
-
if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) {
return;
}
@@ -5097,7 +4916,6 @@
},
nodeinsert: function() {
var bottom, height, qpost, qroot, threadContainer, top, _ref;
-
qpost = g.posts[this.threaded];
delete this.threaded;
delete this.cb;
@@ -5126,7 +4944,6 @@
},
toggle: function() {
var container, containers, node, post, replies, reply, thread, _i, _j, _k, _len, _len1, _len2, _ref;
-
thread = $('.thread');
replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread);
QuoteThreading.enabled = this.checked;
@@ -5143,7 +4960,6 @@
} else {
replies.sort(function(a, b) {
var aID, bID;
-
aID = Number(a.id.slice(2));
bID = Number(b.id.slice(2));
return aID - bID;
@@ -5164,7 +4980,6 @@
},
kb: function() {
var control;
-
control = $.id('threadingControl');
return control.click();
}
@@ -5192,7 +5007,6 @@
},
node: function() {
var quotelink, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -5216,7 +5030,6 @@
cb: {
seek: function(type) {
var highlight, post, posts, result, str;
-
if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
@@ -5272,7 +5085,6 @@
},
node: function() {
var deadlink, _i, _len, _ref;
-
_ref = $$('.deadlink', this.nodes.comment);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
deadlink = _ref[_i];
@@ -5287,7 +5099,6 @@
},
parseDeadlink: function(deadlink) {
var a, boardID, m, post, postID, quote, quoteID, redirect, _ref;
-
if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
Quotify.fixDeadlink(deadlink);
return;
@@ -5357,7 +5168,6 @@
},
fixDeadlink: function(deadlink) {
var el, green;
-
if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') {
green = $.el('span', {
className: 'quote'
@@ -5372,7 +5182,6 @@
QR = {
init: function() {
var sc;
-
if (!Conf['Quick Reply']) {
return;
}
@@ -5420,7 +5229,6 @@
},
initReady: function() {
var link;
-
QR.postingIsEnabled = !!$.id('postForm');
if (!QR.postingIsEnabled) {
return;
@@ -5440,13 +5248,11 @@
$.before($.id('postForm'), link);
$.on(d, 'QRGetSelectedPost', function(_arg) {
var cb;
-
cb = _arg.detail;
return cb(QR.selected);
});
$.on(d, 'QRAddPreSubmitHook', function(_arg) {
var cb;
-
cb = _arg.detail;
return QR.preSubmitHooks.push(cb);
});
@@ -5481,7 +5287,6 @@
},
open: function() {
var err;
-
if (QR.nodes) {
QR.nodes.el.hidden = false;
QR.unhide();
@@ -5500,7 +5305,6 @@
},
close: function() {
var post, _i, _len, _ref;
-
if (QR.req) {
QR.abort();
return;
@@ -5550,7 +5354,6 @@
},
error: function(err) {
var el;
-
QR.open();
if (typeof err === 'string') {
el = $.tn(err);
@@ -5577,7 +5380,6 @@
},
notify: function(el) {
var notice, notif;
-
notice = new Notice('warning', el);
if (!(Header.areNotificationsEnabled && d.hidden)) {
return QR.notifications.push(notice);
@@ -5603,7 +5405,6 @@
notifications: [],
cleanNotifications: function() {
var notification, _i, _len, _ref;
-
_ref = QR.notifications;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
notification = _ref[_i];
@@ -5613,7 +5414,6 @@
},
status: function() {
var disabled, status, thread, value;
-
if (!QR.nodes) {
return;
}
@@ -5630,7 +5430,6 @@
},
quote: function(e) {
var caretPos, com, index, post, range, s, sel, text, thread, _ref;
-
if (e != null) {
e.preventDefault();
}
@@ -5668,7 +5467,6 @@
},
characterCount: function() {
var count, counter;
-
counter = QR.nodes.charCount;
count = QR.nodes.com.textLength;
counter.textContent = count;
@@ -5677,7 +5475,6 @@
},
drag: function(e) {
var toggle;
-
toggle = e.type === 'dragstart' ? $.off : $.on;
toggle(d, 'dragover', QR.dragOver);
return toggle(d, 'drop', QR.dropFile);
@@ -5696,7 +5493,6 @@
},
paste: function(e) {
var blob, files, item, _i, _len, _ref;
-
files = [];
_ref = e.clipboardData.items;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -5720,7 +5516,6 @@
},
handleFiles: function(files) {
var file, isSingle, max, _i, _len;
-
if (this !== QR) {
files = __slice.call(this.files);
this.value = null;
@@ -5741,7 +5536,6 @@
},
handleFile: function(file, isSingle, max) {
var post, _ref;
-
if (file.size > max) {
QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
return;
@@ -5767,7 +5561,6 @@
},
openFileInput: function(e) {
var _ref;
-
e.stopPropagation();
if (e.shiftKey && e.type === 'click') {
return QR.selected.rmFile();
@@ -5787,7 +5580,6 @@
},
generatePostableThreadsList: function() {
var list, options, thread, val;
-
if (!QR.nodes) {
return;
}
@@ -5810,7 +5602,6 @@
},
dialog: function() {
var check, dialog, event, flagSelector, i, items, key, mimeTypes, name, node, nodes, save, value, _ref;
-
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top:0;right:0;', " ")
};
@@ -5920,7 +5711,6 @@
preSubmitHooks: [],
submit: function(e) {
var challenge, err, extra, filetag, formData, hook, options, post, response, textOnly, thread, threadID, _i, _len, _ref, _ref1;
-
if (e != null) {
e.preventDefault();
}
@@ -6035,7 +5825,6 @@
},
response: function() {
var URL, ban, board, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, req, resDoc, threadID, _, _ref, _ref1;
-
req = QR.req;
delete QR.req;
post = QR.posts[0];
@@ -6168,7 +5957,6 @@
ready: function() {
var imgContainer, input, setLifetime,
_this = this;
-
setLifetime = function(e) {
return _this.lifetime = e.detail;
};
@@ -6205,7 +5993,6 @@
});
$.get('captchas', [], function(_arg) {
var captchas;
-
captchas = _arg.captchas;
return _this.sync(captchas);
});
@@ -6220,7 +6007,6 @@
},
getOne: function() {
var captcha, challenge, response;
-
this.clear();
if (captcha = this.captchas.shift()) {
challenge = captcha.challenge, response = captcha.response;
@@ -6245,7 +6031,6 @@
},
save: function() {
var response;
-
if (!(response = this.nodes.input.value.trim())) {
return;
}
@@ -6260,7 +6045,6 @@
},
clear: function() {
var captcha, i, now, _i, _len, _ref;
-
now = Date.now();
_ref = this.captchas;
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
@@ -6278,7 +6062,6 @@
},
load: function() {
var challenge;
-
if (!this.nodes.challenge.firstChild) {
return;
}
@@ -6291,7 +6074,6 @@
},
count: function() {
var count;
-
count = this.captchas.length;
this.nodes.input.placeholder = (function() {
switch (count) {
@@ -6327,7 +6109,6 @@
init: function() {
var key, setTimers, type,
_this = this;
-
if (!Conf['Cooldown']) {
return;
}
@@ -6361,7 +6142,6 @@
},
sync: function(cooldowns) {
var id;
-
for (id in cooldowns) {
QR.cooldown.cooldowns[id] = cooldowns[id];
}
@@ -6369,7 +6149,6 @@
},
set: function(data) {
var cooldown, delay, isReply, post, req, start, threadID, upSpd;
-
if (!Conf['Cooldown']) {
return;
}
@@ -6404,7 +6183,6 @@
},
count: function() {
var cooldown, cooldowns, elapsed, hasFile, isReply, maxTimer, now, post, seconds, start, type, types, upSpd, upSpdAccuracy, update, _ref;
-
if (!Object.keys(QR.cooldown.cooldowns).length) {
$["delete"]("" + g.BOARD + ".cooldown");
delete QR.cooldown.isCounting;
@@ -6469,7 +6247,6 @@
QR.persona.getPassword();
return $.get('QR.personas', Conf['QR.personas'], function(_arg) {
var arr, item, personas, type, types, _i, _len, _ref;
-
personas = _arg['QR.personas'];
types = {
name: [],
@@ -6489,7 +6266,6 @@
},
parseItem: function(item, types) {
var boards, match, type, val, _ref, _ref1, _ref2;
-
if (item[0] === '#') {
return;
}
@@ -6518,7 +6294,6 @@
},
loadPersonas: function(type, arr) {
var list, val, _i, _len;
-
list = $("#list-" + type, QR.nodes.el);
for (_i = 0, _len = arr.length; _i < _len; _i++) {
val = arr[_i];
@@ -6531,7 +6306,6 @@
},
getPassword: function() {
var input, m;
-
if (!QR.persona.pwd) {
QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : $.id('delPassword').value;
}
@@ -6540,7 +6314,6 @@
get: function(cb) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
return cb(persona);
});
@@ -6548,7 +6321,6 @@
set: function(post) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
persona = {
name: post.name,
@@ -6566,7 +6338,6 @@
this.select = __bind(this.select, this);
var el, event, prev, _i, _len, _ref,
_this = this;
-
el = $.el('a', {
className: 'qr-preview',
draggable: true,
@@ -6623,7 +6394,6 @@
_Class.prototype.rm = function() {
var index;
-
this["delete"]();
index = QR.posts.indexOf(this);
if (QR.posts.length === 1) {
@@ -6643,7 +6413,6 @@
_Class.prototype.lock = function(lock) {
var name, node, _i, _len, _ref;
-
if (lock == null) {
lock = true;
}
@@ -6670,7 +6439,6 @@
_Class.prototype.select = function() {
var rectEl, rectList;
-
if (QR.selected) {
QR.selected.nodes.el.id = null;
QR.selected.forceSave();
@@ -6687,7 +6455,6 @@
_Class.prototype.load = function() {
var name, node, _i, _len, _ref;
-
_ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
name = _ref[_i];
@@ -6702,7 +6469,6 @@
_Class.prototype.save = function(input) {
var name, _ref;
-
if (input.type === 'checkbox') {
this.spoiler = input.checked;
return;
@@ -6733,7 +6499,6 @@
_Class.prototype.forceSave = function() {
var name, node, _i, _len, _ref;
-
if (this !== QR.selected) {
return;
}
@@ -6768,11 +6533,9 @@
_Class.prototype.setThumbnail = function() {
var fileURL, img,
_this = this;
-
img = $.el('img');
img.onload = function() {
var cv, height, s, width;
-
s = 90 * 2 * window.devicePixelRatio;
if (_this.file.type === 'image/gif') {
s *= 3;
@@ -6823,7 +6586,6 @@
_Class.prototype.updateFilename = function() {
var long;
-
long = "" + this.filename + " (" + this.filesize + ")\nCtrl+click to edit filename. Shift+click to clear.";
this.nodes.el.title = long;
if (this !== QR.selected) {
@@ -6846,11 +6608,9 @@
_Class.prototype.pasteText = function(file) {
var reader,
_this = this;
-
reader = new FileReader();
reader.onload = function(e) {
var text;
-
text = e.target.result;
if (_this.com) {
_this.com += "\n" + text;
@@ -6889,7 +6649,6 @@
_Class.prototype.drop = function() {
var el, index, newIndex, oldIndex, post;
-
$.rmClass(this, 'over');
if (!this.draggable) {
return;
@@ -6913,7 +6672,6 @@
AutoGIF = {
init: function() {
var _ref;
-
if (g.VIEW === 'catalog' || !Conf['Auto-GIF'] || ((_ref = g.BOARD.ID) === 'gif' || _ref === 'wsg')) {
return;
}
@@ -6924,7 +6682,6 @@
},
node: function() {
var URL, gif, style, thumb, _ref, _ref1;
-
if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6947,7 +6704,6 @@
FappeTyme = {
init: function() {
var el, input, lc, type, _i, _len, _ref;
-
if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || g.VIEW === 'catalog' || g.BOARD === 'f') {
return;
}
@@ -7000,7 +6756,6 @@
Gallery = {
init: function() {
var el;
-
if (g.VIEW === 'catalog' || g.BOARD === 'f' || !Conf['Gallery']) {
return;
}
@@ -7020,7 +6775,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -7034,7 +6788,6 @@
},
build: function(image) {
var cb, createSubEntry, dialog, el, file, files, i, key, menuButton, name, nodes, value, _ref;
-
Gallery.images = [];
nodes = Gallery.nodes = {};
nodes.el = dialog = $.el('div', {
@@ -7094,7 +6847,6 @@
},
generateThumb: function(file) {
var double, post, thumb, title;
-
post = Get.postFromNode(file);
title = ($('.fileText a', file)).textContent;
thumb = post.file.thumb.parentNode.cloneNode(true);
@@ -7113,7 +6865,6 @@
cb: {
keybinds: function(e) {
var cb, key;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -7139,7 +6890,6 @@
},
open: function(e) {
var el, img, name, nodes, rect, top;
-
if (e) {
e.preventDefault();
}
@@ -7182,7 +6932,6 @@
},
error: function(img, thumb) {
var URL, post, revived, src;
-
post = Get.postFromLink($.el('a', {
href: img.dataset.post
}));
@@ -7213,7 +6962,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var i, postObj;
-
if (this.status !== 200) {
return;
}
@@ -7260,7 +7008,6 @@
menu: {
init: function() {
var createSubEntry, el, name, subEntries;
-
if (g.VIEW === 'catalog' || !Conf['Gallery']) {
return;
}
@@ -7282,7 +7029,6 @@
},
createSubEntry: function(name) {
var input, label;
-
label = $.el('label', {
innerHTML: " " + name
});
@@ -7320,7 +7066,6 @@
},
node: function() {
var thumb, _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -7345,7 +7090,6 @@
},
toggleAll: function() {
var ID, file, func, post, _i, _len, _ref, _ref1;
-
$.event('CloseMenu');
if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) {
ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress';
@@ -7379,7 +7123,6 @@
},
toggle: function(post) {
var headRect, left, root, thumb, top, x, y, _ref;
-
thumb = post.file.thumb;
if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) {
ImageExpand.expand(post);
@@ -7388,7 +7131,6 @@
root = post.nodes.root;
_ref = (Conf['Advance on contract'] ? (function() {
var next;
-
next = root;
while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
if ($('.stub', next) || next.offsetHeight === 0) {
@@ -7420,7 +7162,6 @@
},
expand: function(post, src) {
var img, thumb;
-
thumb = post.file.thumb;
if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) {
return;
@@ -7448,7 +7189,6 @@
},
completeExpand: function(post) {
var bottom, thumb;
-
thumb = post.file.thumb;
if (!$.hasClass(thumb, 'expanding')) {
return;
@@ -7471,7 +7211,6 @@
},
error: function() {
var URL, post, src, timeoutID;
-
post = Get.postFromNode(this);
$.rm(this);
delete post.file.fullImage;
@@ -7497,7 +7236,6 @@
return $.ajax("//a.4cdn.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -7521,7 +7259,6 @@
menu: {
init: function() {
var conf, createSubEntry, el, name, subEntries, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Image Expansion']) {
return;
}
@@ -7545,7 +7282,6 @@
},
createSubEntry: function(name, desc) {
var input, label;
-
label = $.el('label', {
innerHTML: " " + name,
title: desc
@@ -7576,7 +7312,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -7584,7 +7319,6 @@
},
mouseover: function(e) {
var el, post;
-
post = Get.postFromNode(this);
el = $.el('img', {
id: 'ihover',
@@ -7606,7 +7340,6 @@
error: function() {
var URL, post, src, timeoutID,
_this = this;
-
if (!doc.contains(this)) {
return;
}
@@ -7631,7 +7364,6 @@
return $.ajax("//a.4cdn.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -7657,7 +7389,6 @@
ImageLoader = {
init: function() {
var prefetch;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -7684,7 +7415,6 @@
},
node: function() {
var URL, img, string, style, thumb, type, _ref, _ref1;
-
if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -7706,7 +7436,6 @@
},
toggle: function() {
var enabled, id, post, _ref;
-
enabled = Conf['prefetch'] = this.checked;
if (enabled) {
_ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts;
@@ -7729,7 +7458,6 @@
},
node: function() {
var thumb, _ref;
-
if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) {
return;
}
@@ -7742,7 +7470,6 @@
Sauce = {
init: function() {
var err, link, links, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Sauce']) {
return;
}
@@ -7772,7 +7499,6 @@
},
createSauceLink: function(link) {
var m, text;
-
link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) {
switch (parameter) {
case '%TURL':
@@ -7793,7 +7519,6 @@
},
node: function() {
var link, nodes, _i, _len, _ref;
-
if (this.isClone || !this.file) {
return;
}
@@ -7826,7 +7551,6 @@
},
node: function() {
var data, el, end, endNode, i, index, items, length, link, links, node, result, saved, snapshot, space, test, word, _i, _len, _ref;
-
if (this.isClone) {
if (Conf['Embedding']) {
i = 0;
@@ -7903,7 +7627,6 @@
},
makeRange: function(startNode, endNode, startOffset, endOffset) {
var range;
-
range = document.createRange();
range.setStart(startNode, startOffset);
range.setEnd(endNode, endOffset);
@@ -7911,7 +7634,6 @@
},
makeLink: function(range) {
var a, char, i, text;
-
text = range.toString();
i = 0;
while (/[(\[{<>]/.test(text.charAt(i))) {
@@ -7957,7 +7679,6 @@
},
services: function(link) {
var href, key, match, type, _ref;
-
href = link.href;
_ref = Linkify.types;
for (key in _ref) {
@@ -7970,7 +7691,6 @@
},
embed: function(data) {
var embed, href, key, link, name, options, uid, value, _ref;
-
key = data[0], uid = data[1], options = data[2], link = data[3];
href = link.href;
embed = $.el('a', {
@@ -7999,7 +7719,6 @@
},
title: function(data) {
var embed, err, key, link, options, service, title, titles, uid;
-
key = data[0], uid = data[1], options = data[2], link = data[3], embed = data[4];
if (!(service = Linkify.types[key].title)) {
return;
@@ -8036,21 +7755,18 @@
cb: {
toggle: function() {
var string, _ref;
-
_ref = $.hasClass(this, "embedded") ? ['unembed', '(embed)'] : ['embed', '(unembed)'], string = _ref[0], this.textContent = _ref[1];
$.replace(this.previousElementSibling, Linkify.cb[string](this));
return $.toggleClass(this, 'embedded');
},
embed: function(a) {
var el, style, type;
-
el = (type = Linkify.types[a.dataset.key]).el(a);
el.style.cssText = (style = type.style) ? style : "border: 0; width: 640px; height: 390px";
return el;
},
unembed: function(a) {
var el;
-
el = $.el('a', {
rel: 'nofollow noreferrer',
target: 'blank',
@@ -8063,7 +7779,6 @@
},
title: function(response, data) {
var embed, key, link, options, service, text, uid;
-
key = data[0], uid = data[1], options = data[2], link = data[3], embed = data[4];
service = Linkify.types[key].title;
switch (response.status) {
@@ -8103,7 +7818,6 @@
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/,
el: function(a) {
var div;
-
return div = $.el('iframe', {
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + a.dataset.uid + ".js"
});
@@ -8114,7 +7828,6 @@
},
text: function(_arg) {
var file, files;
-
files = _arg.files;
for (file in files) {
if (files.hasOwnProperty(file)) {
@@ -8145,7 +7858,6 @@
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
el: function(a) {
var el;
-
el = $.el('iframe', {
width: "640",
height: "360",
@@ -8161,11 +7873,9 @@
style: 'border: 0;',
el: function(a) {
var el;
-
el = $.el('div');
$.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
var embed, file, files, status, type, _i, _j, _len, _len1, _ref;
-
status = this.status;
if (status !== 200 && status !== 304) {
return div.innerHTML = "ERROR " + status;
@@ -8214,7 +7924,6 @@
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/,
el: function(a) {
var div;
-
return div = $.el('iframe', {
src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid
});
@@ -8225,7 +7934,6 @@
style: 'height: auto; width: 500px; display: inline-block;',
el: function(a) {
var div;
-
div = $.el('div', {
className: "soundcloud",
name: "soundcloud"
@@ -8260,7 +7968,6 @@
style: "border: none; width: 640px; height: 360px;",
el: function(a) {
var channel, chapter, result, _;
-
if (result = /(\w+)\/(?:[a-z]\/)?(\d+)/i.exec(a.dataset.uid)) {
_ = result[0], channel = result[1], chapter = result[2];
return $.el('object', {
@@ -8314,7 +8021,6 @@
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
el: function(a) {
var el;
-
el = $.el('iframe', {
src: "//www.youtube.com/embed/" + a.dataset.uid + (a.dataset.option ? '#' + a.dataset.option : '') + "?wmode=opaque"
});
@@ -8336,7 +8042,6 @@
ArchiveLink = {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) {
return;
}
@@ -8349,7 +8054,6 @@
order: 90,
open: function(_arg) {
var ID, board, thread;
-
ID = _arg.ID, thread = _arg.thread, board = _arg.board;
return !!Redirect.to('thread', {
postID: ID,
@@ -8368,14 +8072,12 @@
},
createSubEntry: function(text, type) {
var el, open;
-
el = $.el('a', {
textContent: text,
target: '_blank'
});
open = type === 'post' ? function(_arg) {
var ID, board, thread;
-
ID = _arg.ID, thread = _arg.thread, board = _arg.board;
el.href = Redirect.to('thread', {
postID: ID,
@@ -8385,7 +8087,6 @@
return true;
} : function(post) {
var value;
-
value = Filter[type](post);
if (!value) {
return false;
@@ -8408,7 +8109,6 @@
DeleteLink = {
init: function() {
var div, fileEl, fileEntry, postEl, postEntry;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) {
return;
}
@@ -8436,7 +8136,6 @@
el: fileEl,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file || file.isDead) {
return false;
@@ -8452,7 +8151,6 @@
order: 40,
open: function(post) {
var node;
-
if (post.isDead) {
return false;
}
@@ -8467,7 +8165,6 @@
},
"delete": function() {
var fileOnly, form, link, post;
-
post = DeleteLink.post;
if (DeleteLink.cooldown.counting === post) {
return;
@@ -8497,7 +8194,6 @@
},
load: function(link, post, fileOnly, resDoc) {
var msg, s;
-
if (resDoc.title === '4chan - Banned') {
s = 'Banned!';
} else if (msg = resDoc.getElementById('errmsg')) {
@@ -8518,7 +8214,6 @@
cooldown: {
start: function(post, node) {
var length, seconds, _ref;
-
if (!((_ref = QR.db) != null ? _ref.get({
boardID: post.board.ID,
threadID: post.thread.ID,
@@ -8552,7 +8247,6 @@
DownloadLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) {
return;
}
@@ -8566,7 +8260,6 @@
order: 100,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file) {
return false;
@@ -8598,7 +8291,6 @@
},
makeButton: (function() {
var frag;
-
frag = $.nodes([
$.tn(' '), $.el('a', {
className: 'menu-button',
@@ -8608,7 +8300,6 @@
]);
return function() {
var clone;
-
clone = frag.cloneNode(true);
$.on(clone.lastElementChild, 'click', Menu.toggle);
return clone;
@@ -8616,7 +8307,6 @@
})(),
toggle: function(e) {
var post;
-
post = Get.postFromNode(this);
return Menu.menu.toggle(e, this, post);
}
@@ -8625,7 +8315,6 @@
ReportLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) {
return;
}
@@ -8647,7 +8336,6 @@
},
report: function() {
var id, post, set, url;
-
post = ReportLink.post;
url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
id = Date.now();
@@ -8660,7 +8348,6 @@
init: function() {
return $.ready(function() {
var href;
-
Favicon.el = $('link[rel="shortcut icon"]', d.head);
Favicon.el.type = 'image/x-icon';
href = Favicon.el.href;
@@ -8734,7 +8421,6 @@
init: function() {
var sc,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
return;
}
@@ -8763,7 +8449,6 @@
},
node: function() {
var ID, fileCount, post, postCount, _ref;
-
postCount = 0;
fileCount = 0;
_ref = this.posts;
@@ -8781,7 +8466,6 @@
},
onUpdate: function(e) {
var fileCount, postCount, _ref;
-
if (e.detail[404]) {
return;
}
@@ -8790,7 +8474,6 @@
},
update: function(postCount, fileCount) {
var fileCountEl, postCountEl, thread;
-
thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl;
postCountEl.textContent = postCount;
fileCountEl.textContent = fileCount;
@@ -8815,7 +8498,6 @@
},
onThreadsLoad: function() {
var page, pages, thread, _i, _j, _len, _len1, _ref;
-
if (!(Conf["Page Count in Stats"] && this.status === 200)) {
return;
}
@@ -8839,7 +8521,6 @@
init: function() {
var checked, conf, el, input, name, sc, settings, subEntries, _ref,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
return;
}
@@ -8980,7 +8661,6 @@
},
interval: function() {
var val;
-
val = parseInt(this.value, 10);
if (val < 1) {
val = 1;
@@ -8990,7 +8670,6 @@
},
load: function(e) {
var klass, req, text, _ref;
-
req = ThreadUpdater.req;
switch (req.status) {
case 200:
@@ -9022,7 +8701,6 @@
},
setInterval: function() {
var cur, i, j, limit;
-
i = ThreadUpdater.interval + 1;
if (Conf['Optional Increase']) {
cur = ThreadUpdater.outdateCount || 1;
@@ -9038,14 +8716,12 @@
},
intervalShortcut: function() {
var settings;
-
Settings.open('Advanced');
settings = $.id('fourchanx-settings');
return $('input[name=Interval]', settings).focus();
},
set: function(name, text, klass) {
var el, node;
-
el = ThreadUpdater[name];
if (node = el.firstChild) {
node.data = text;
@@ -9064,7 +8740,6 @@
},
timeout: function() {
var n;
-
ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
if (!(n = --ThreadUpdater.seconds)) {
return ThreadUpdater.update();
@@ -9077,7 +8752,6 @@
},
update: function() {
var url, _ref;
-
if (!navigator.onLine) {
return;
}
@@ -9099,7 +8773,6 @@
},
updateThreadStatus: function(type, status) {
var change, hasChanged;
-
if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) {
return;
}
@@ -9109,7 +8782,6 @@
},
parse: function(postObjects) {
var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref;
-
OP = postObjects[0];
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
@@ -9195,7 +8867,6 @@
}
$.queueTask(function() {
var length, threadID;
-
threadID = ThreadUpdater.thread.ID;
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
return Fourchan.parseThread(threadID, length - count, length);
@@ -9216,7 +8887,6 @@
ThreadWatcher = {
init: function() {
var now, sc;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -9261,7 +8931,6 @@
},
node: function() {
var toggler;
-
toggler = $.el('img', {
className: 'watch-thread-link'
});
@@ -9283,7 +8952,6 @@
}
return $.get('AutoWatch', 0, function(_arg) {
var AutoWatch, thread;
-
AutoWatch = _arg.AutoWatch;
if (!(thread = g.BOARD.threads[AutoWatch])) {
return;
@@ -9299,7 +8967,6 @@
cb: {
openAll: function() {
var a, _i, _len, _ref;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -9318,7 +8985,6 @@
},
pruneDeads: function() {
var boardID, data, threadID, _i, _len, _ref, _ref1;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -9342,13 +9008,11 @@
},
rm: function() {
var boardID, threadID, _ref;
-
_ref = this.parentNode.dataset.fullID.split('.'), boardID = _ref[0], threadID = _ref[1];
return ThreadWatcher.rm(boardID, +threadID);
},
post: function(e) {
var board, postID, threadID, _ref;
-
_ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID;
if (postID === threadID) {
if (Conf['Auto Watch']) {
@@ -9360,7 +9024,6 @@
},
onIndexRefresh: function() {
var boardID, data, db, threadID, _ref;
-
db = ThreadWatcher.db;
boardID = g.BOARD.ID;
_ref = db.data.boards[boardID];
@@ -9386,7 +9049,6 @@
},
onThreadRefresh: function(e) {
var thread;
-
thread = e.detail.thread;
if (!(e.detail[404] && ThreadWatcher.db.get({
boardID: thread.board.ID,
@@ -9403,7 +9065,6 @@
},
fetchAllStatus: function() {
var thread, threads, _i, _len;
-
if (!(threads = ThreadWatcher.getAll()).length) {
return;
}
@@ -9415,7 +9076,6 @@
},
fetchStatus: function(_arg) {
var boardID, data, fetchCount, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
if (data.isDead) {
return;
@@ -9425,7 +9085,6 @@
return $.ajax("//a.4cdn.org/" + boardID + "/res/" + threadID + ".json", {
onloadend: function() {
var status;
-
fetchCount.fetched++;
if (fetchCount.fetched === fetchCount.fetching) {
fetchCount.fetched = 0;
@@ -9459,7 +9118,6 @@
},
getAll: function() {
var all, boardID, data, threadID, threads, _ref;
-
all = [];
_ref = ThreadWatcher.db.data.boards;
for (boardID in _ref) {
@@ -9480,7 +9138,6 @@
},
makeLine: function(boardID, threadID, data) {
var div, fullID, href, link, x;
-
x = $.el('a', {
className: 'fa fa-times',
href: 'javascript:;'
@@ -9511,7 +9168,6 @@
},
refresh: function() {
var boardID, data, helper, list, nodes, refresher, thread, threadID, toggler, watched, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3;
-
nodes = [];
_ref = ThreadWatcher.getAll();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -9541,7 +9197,6 @@
},
toggle: function(thread) {
var boardID, threadID;
-
boardID = thread.board.ID;
threadID = thread.ID;
if (ThreadWatcher.db.get({
@@ -9555,7 +9210,6 @@
},
add: function(thread) {
var boardID, data, threadID;
-
data = {};
boardID = thread.board.ID;
threadID = thread.ID;
@@ -9586,7 +9240,6 @@
},
convert: function(oldFormat) {
var boardID, data, newFormat, threadID, threads;
-
newFormat = {};
for (boardID in oldFormat) {
threads = oldFormat[boardID];
@@ -9603,7 +9256,6 @@
refreshers: [],
init: function() {
var menu;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -9616,7 +9268,6 @@
},
addHeaderMenuEntry: function() {
var entryEl;
-
if (g.VIEW !== 'thread') {
return;
}
@@ -9633,7 +9284,6 @@
});
return this.refreshers.push(function() {
var addClass, rmClass, text, _ref;
-
_ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = _ref[0], rmClass = _ref[1], text = _ref[2];
$.addClass(entryEl, addClass);
$.rmClass(entryEl, rmClass);
@@ -9642,7 +9292,6 @@
},
addMenuEntries: function() {
var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1;
-
entries = [];
entries.push({
cb: ThreadWatcher.cb.openAll,
@@ -9711,7 +9360,6 @@
},
createSubEntry: function(name, desc) {
var entry, input;
-
entry = {
type: 'thread watcher',
el: $.el('label', {
@@ -9763,7 +9411,6 @@
},
ready: function() {
var ID, post, posts, _ref;
-
$.off(d, '4chanXInitFinished', Unread.ready);
posts = [];
_ref = Unread.thread.posts;
@@ -9778,7 +9425,6 @@
},
scroll: function() {
var down, hash, post, posts, root;
-
if (!Conf['Scroll to Last Read Post']) {
return;
}
@@ -9807,7 +9453,6 @@
},
sync: function() {
var lastReadPost;
-
lastReadPost = Unread.db.get({
boardID: Unread.thread.board.ID,
threadID: Unread.thread.ID,
@@ -9826,7 +9471,6 @@
},
addPosts: function(posts) {
var ID, data, post, _i, _len, _ref;
-
for (_i = 0, _len = posts.length; _i < _len; _i++) {
post = posts[_i];
ID = post.ID;
@@ -9854,7 +9498,6 @@
},
addPostQuotingYou: function(post) {
var quotelink, _i, _len, _ref;
-
if (!QR.db) {
return;
}
@@ -9871,7 +9514,6 @@
},
openNotification: function(post) {
var name, notif;
-
if (!Header.areNotificationsEnabled) {
return;
}
@@ -9899,7 +9541,6 @@
},
readSinglePost: function(post) {
var i;
-
if ((i = Unread.posts.indexOf(post)) === -1) {
return;
}
@@ -9915,7 +9556,6 @@
},
readArray: function(arr) {
var i, post, _i, _len;
-
for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) {
post = arr[i];
if (post.ID > Unread.lastReadPost) {
@@ -9926,7 +9566,6 @@
},
read: $.debounce(50, function(e) {
var ID, height, i, post, posts;
-
if (d.hidden || !Unread.posts.length) {
return;
}
@@ -9979,7 +9618,6 @@
}),
setLine: function(force) {
var post;
-
if (!(d.hidden || force === true)) {
return;
}
@@ -9992,7 +9630,6 @@
},
update: function(dontrepeat) {
var count;
-
count = Unread.posts.length;
if (Conf['Unread Count']) {
d.title = "" + (Conf['Quoted Title'] && Unread.postsQuotingYou.length ? '(!) ' : '') + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title);
@@ -10019,7 +9656,6 @@
},
init: function() {
var archive, boardID, boards, data, id, name, type, _i, _len, _ref, _ref1, _ref2;
-
_ref = Conf['selectedArchives'];
for (boardID in _ref) {
data = _ref[boardID];
@@ -10144,7 +9780,6 @@
},
to: function(dest, data) {
var archive;
-
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
if (!archive) {
return '';
@@ -10153,7 +9788,6 @@
},
protocol: function(archive) {
var protocol;
-
protocol = location.protocol;
if (!archive[protocol.slice(0, -1)]) {
protocol = protocol === 'https:' ? 'http:' : 'https:';
@@ -10162,7 +9796,6 @@
},
thread: function(archive, _arg) {
var boardID, path, postID, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID;
path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID;
if (archive.software === 'foolfuuka') {
@@ -10175,7 +9808,6 @@
},
post: function(archive, _arg) {
var URL, boardID, postID;
-
boardID = _arg.boardID, postID = _arg.postID;
URL = new String("" + (Redirect.protocol(archive)) + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID);
URL.archive = archive;
@@ -10183,13 +9815,11 @@
},
file: function(archive, _arg) {
var boardID, filename;
-
boardID = _arg.boardID, filename = _arg.filename;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
},
search: function(archive, _arg) {
var boardID, path, type, value;
-
boardID = _arg.boardID, type = _arg.type, value = _arg.value;
type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type;
value = encodeURIComponent(value);
@@ -10208,7 +9838,6 @@
},
setup: function() {
var btn, entry, psa;
-
$.off(d, '4chanXInitFinished', PSAHiding.setup);
if (!(psa = $.id('globalMessage'))) {
$.rmClass(doc, 'hide-announcement');
@@ -10237,7 +9866,6 @@
$.on(btn, 'click', PSAHiding.toggle);
$.get('hiddenPSA', 0, function(_arg) {
var hiddenPSA;
-
hiddenPSA = _arg.hiddenPSA;
PSAHiding.sync(hiddenPSA);
$.before(psa, btn);
@@ -10247,7 +9875,6 @@
},
toggle: function(e) {
var UTC;
-
if ($.hasClass(this, 'hide-announcement')) {
UTC = +$.id('globalMessage').dataset.utc;
$.set('hiddenPSA', UTC);
@@ -10259,7 +9886,6 @@
},
sync: function(UTC) {
var hr, psa;
-
psa = $.id('globalMessage');
psa.hidden = PSAHiding.btn.hidden = UTC && UTC >= +psa.dataset.utc ? true : false;
if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') {
@@ -10280,7 +9906,6 @@
},
ready: function() {
var banner, child, children, i;
-
banner = $(".boardBanner");
children = banner.children;
i = 0;
@@ -10300,7 +9925,6 @@
cb: {
toggle: (function() {
var types;
-
types = {
jpg: 227,
png: 270,
@@ -10308,7 +9932,6 @@
};
return function() {
var num, type;
-
type = Object.keys(types)[Math.floor(3 * Math.random())];
num = Math.floor(types[type] * Math.random());
return this.src = "//static.4chan.org/image/title/" + num + "." + type;
@@ -10328,7 +9951,6 @@
},
focus: function() {
var items, string, string2;
-
this.textContent = this.innerHTML;
string = "" + g.BOARD + "." + this.className;
string2 = "" + string + ".orig";
@@ -10351,7 +9973,6 @@
},
custom: function(child) {
var cachedTest, string;
-
cachedTest = child.innerHTML;
string = "" + g.BOARD + "." + child.className;
$.on(child, 'click keydown focus blur', function(e) {
@@ -10359,7 +9980,6 @@
});
$.get(string, cachedTest, function(item) {
var string2, title;
-
if (!(title = item[string])) {
return;
}
@@ -10383,7 +10003,6 @@
CatalogLinks = {
init: function() {
var el, input;
-
if (!Conf['Catalog Links']) {
return;
}
@@ -10411,7 +10030,6 @@
},
set: function(useCatalog) {
var a, board, generateURL, path, _i, _len, _ref, _ref1;
-
path = useCatalog ? 'catalog' : '';
generateURL = useCatalog && Conf['External Catalog'] ? CatalogLinks.external : function(board) {
return a.href = "/" + board + "/" + path;
@@ -10526,7 +10144,6 @@
},
node: function() {
var dicestats, roll, _ref;
-
if (this.isClone || !(dicestats = (_ref = this.info.email) != null ? _ref.match(/dice[+\s](\d+)d(\d+)/) : void 0)) {
return;
}
@@ -10538,7 +10155,6 @@
Emoji = {
init: function() {
var css, icon, name, pos, _ref;
-
if (!Conf['Emoji']) {
return;
}
@@ -10609,7 +10225,6 @@
},
node: function() {
var a;
-
if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
return $.on(a, 'click', ExpandComment.cb);
}
@@ -10621,7 +10236,6 @@
},
expand: function(post) {
var a;
-
if (post.nodes.longComment && !post.nodes.longComment.parentNode) {
$.replace(post.nodes.shortComment, post.nodes.longComment);
post.nodes.comment = post.nodes.longComment;
@@ -10637,7 +10251,6 @@
},
contract: function(post) {
var a;
-
if (!post.nodes.shortComment) {
return;
}
@@ -10648,7 +10261,6 @@
},
parse: function(req, a, post) {
var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
-
status = req.status;
if (status !== 200 && status !== 304) {
a.textContent = "Error " + req.statusText + " (" + status + ")";
@@ -10703,7 +10315,6 @@
},
setButton: function(thread) {
var a;
-
if (!(a = $.x('following-sibling::a[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
return;
}
@@ -10712,7 +10323,6 @@
},
onIndexRefresh: function() {
var status, thread, threadID, _ref, _ref1, _ref2;
-
_ref = ExpandThread.statuses;
for (threadID in _ref) {
status = _ref[threadID];
@@ -10739,7 +10349,6 @@
},
toggle: function(thread) {
var a, threadRoot;
-
threadRoot = thread.OP.nodes.root.parentNode;
if (!(a = $('.summary', threadRoot))) {
return;
@@ -10752,7 +10361,6 @@
},
expand: function(thread, a, threadRoot) {
var status;
-
ExpandThread.statuses[thread] = status = {};
a.textContent = ExpandThread.text.apply(ExpandThread, ['...'].concat(__slice.call(a.textContent.match(/\d+/g))));
return status.req = $.cache("//a.4cdn.org/" + thread.board + "/res/" + thread + ".json", function() {
@@ -10762,7 +10370,6 @@
},
contract: function(thread, a, threadRoot) {
var filesCount, inlined, num, postsCount, replies, reply, status, _i, _len;
-
status = ExpandThread.statuses[thread];
delete ExpandThread.statuses[thread];
if (status.req) {
@@ -10810,7 +10417,6 @@
},
parse: function(req, thread, a) {
var data, filesCount, post, postData, posts, postsCount, postsRoot, root, _i, _len, _ref;
-
if ((_ref = req.status) !== 200 && _ref !== 304) {
a.textContent = "Error " + req.statusText + " (" + req.status + ")";
return;
@@ -10864,7 +10470,6 @@
},
createFunc: function(format) {
var code;
-
code = format.replace(/%(.)/g, function(s, c) {
if (c in FileInfo.formatters) {
return "' + FileInfo.formatters." + c + ".call(post) + '";
@@ -10876,7 +10481,6 @@
},
convertUnit: function(size, unit) {
var i;
-
if (unit === 'B') {
return "" + (size.toFixed()) + " Bytes";
}
@@ -10907,7 +10511,6 @@
},
n: function() {
var fullname, shortname;
-
fullname = this.file.name;
shortname = Build.shortFilename(this.file.name, this.isReply);
if (fullname === shortname) {
@@ -10951,7 +10554,6 @@
Fourchan = {
init: function() {
var board;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -10973,7 +10575,6 @@
},
code: function() {
var apply, pre, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -11016,7 +10617,6 @@
},
node: function() {
var rgb, span, style, uid;
-
if (this.isClone || !(uid = this.info.uniqueID)) {
return;
}
@@ -11033,7 +10633,6 @@
},
compute: function(uid) {
var hash, rgb;
-
if (IDColor.ids[uid]) {
return IDColor.ids[uid];
}
@@ -11044,7 +10643,6 @@
},
hash: function(uid) {
var i, msg;
-
msg = 0;
i = 0;
while (i < 8) {
@@ -11069,7 +10667,6 @@
},
scroll: $.debounce(100, function() {
var url;
-
if (InfiniScroll.isFetching || ((d.body.scrollTop || doc.scrollTop) <= doc.scrollHeight - (300 + window.innerHeight))) {
return;
}
@@ -11090,7 +10687,6 @@
}),
parse: function(response) {
var botPostForm, el, nodes, omitted_images, omitted_posts, op, post, postlink, posts, replylink, thread, threadID, threadNodes, threads, _i, _j, _len, _len1, _ref;
-
threads = InfiniScroll.parsePages(response);
threadNodes = [];
nodes = [];
@@ -11149,7 +10745,6 @@
},
parsePages: function(response) {
var newThreads, number, page, pages, thread, threads, _i, _len;
-
pages = JSON.parse(response);
newThreads = [];
for (number in pages) {
@@ -11173,7 +10768,6 @@
},
features: function(threadNodes) {
var err, errors, post, posts, thread, threadRoot, threads, _i, _j, _len, _len1, _ref;
-
posts = [];
threads = [];
for (_i = 0, _len = threadNodes.length; _i < _len; _i++) {
@@ -11205,7 +10799,6 @@
},
notice: (function() {
var notify, reset;
-
notify = false;
reset = function() {
return notify = false;
@@ -11235,7 +10828,6 @@
Keybinds = {
init: function() {
var hotkey, init;
-
if (g.VIEW === 'catalog' || !Conf['Keybinds']) {
return;
}
@@ -11244,7 +10836,6 @@
}
init = function() {
var node, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', init);
$.on(d, 'keydown', Keybinds.keydown);
_ref = $$('[accesskey]');
@@ -11260,7 +10851,6 @@
},
keydown: function(e) {
var key, notification, notifications, op, target, thread, threadRoot, _i, _len, _ref;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -11454,7 +11044,6 @@
},
keyCode: function(e) {
var kc, key;
-
key = (function() {
switch (kc = e.keyCode) {
case 8:
@@ -11510,7 +11099,6 @@
},
tags: function(tag, ta) {
var range, selEnd, selStart, value;
-
value = ta.value;
selStart = ta.selectionStart;
selEnd = ta.selectionEnd;
@@ -11521,13 +11109,11 @@
},
sage: function() {
var isSage;
-
isSage = /sage/i.test(QR.nodes.email.value);
return QR.nodes.email.value = isSage ? "" : "sage";
},
img: function(thread, all) {
var post;
-
if (all) {
return ImageExpand.cb.toggleAll();
} else {
@@ -11537,7 +11123,6 @@
},
open: function(thread, tab) {
var url;
-
if (g.VIEW !== 'index') {
return;
}
@@ -11550,7 +11135,6 @@
},
hl: function(delta, thread) {
var axis, height, next, postEl, replies, reply, root, _i, _len;
-
postEl = $('.reply.highlight', thread);
if (!delta) {
if (postEl) {
@@ -11593,7 +11177,6 @@
Nav = {
init: function() {
var append, next, prev, span;
-
switch (g.VIEW) {
case 'index':
if (!Conf['Index Navigation']) {
@@ -11644,7 +11227,6 @@
},
getThread: function() {
var thread, threadRoot, _i, _len, _ref;
-
_ref = $$('.thread');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
threadRoot = _ref[_i];
@@ -11660,7 +11242,6 @@
},
scroll: function(delta) {
var axis, next, thread, top;
-
thread = Nav.getThread();
axis = delta === +1 ? 'following' : 'preceding';
if (next = $.x("" + axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
@@ -11703,7 +11284,6 @@
},
node: function() {
var dateEl;
-
if (this.isClone) {
return;
}
@@ -11713,7 +11293,6 @@
},
relative: function(diff, now, date) {
var days, months, number, rounded, unit, years;
-
unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second');
rounded = Math.round(number);
if (rounded !== 1) {
@@ -11724,7 +11303,6 @@
stale: [],
flush: function() {
var data, now, _i, _len, _ref;
-
if (d.hidden) {
return;
}
@@ -11740,7 +11318,6 @@
},
update: function(data, now) {
var date, diff, isPost, relative, singlePost, _i, _len, _ref;
-
isPost = data instanceof Post;
date = isPost ? data.info.date : new Date(+data.dataset.utc);
now || (now = new Date());
@@ -11759,7 +11336,6 @@
},
setOwnTimeout: function(diff, data) {
var delay;
-
delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY;
return setTimeout(RelativeDates.markStale, delay, data);
},
@@ -11797,7 +11373,6 @@
},
node: function(post) {
var spoiler, spoilers, _i, _len;
-
spoilers = $$('s', this.nodes.comment);
for (_i = 0, _len = spoilers.length; _i < _len; _i++) {
spoiler = spoilers[_i];
@@ -11817,7 +11392,6 @@
},
ready: function() {
var field;
-
field = $.id('recaptcha_response_field');
$.on(field, 'keydown', function(e) {
if (e.keyCode === 8 && !field.value) {
@@ -11826,7 +11400,6 @@
});
return $.on($('form'), 'submit', function(e) {
var response;
-
e.preventDefault();
response = field.value.trim();
if (!/\s/.test(response)) {
@@ -11856,7 +11429,6 @@
},
createFunc: function(format) {
var code;
-
code = format.replace(/%([A-Za-z])/g, function(s, c) {
if (c in Time.formatters) {
return "' + Time.formatters." + c + ".call(date) + '";
@@ -11941,7 +11513,6 @@
Settings = {
init: function() {
var link, settings;
-
link = $.el('a', {
className: 'settings-link fa fa-wrench',
textContent: 'Settings',
@@ -11951,7 +11522,6 @@
Header.addShortcut(link);
$.get('previousversion', null, function(item) {
var changelog, el, previous;
-
if (previous = item['previousversion']) {
if (previous === g.VERSION) {
return;
@@ -11986,7 +11556,6 @@
},
open: function(openSection) {
var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', Settings.open);
if (Settings.dialog) {
return;
@@ -12039,7 +11608,6 @@
sections: [],
addSection: function(title, open) {
var hyphenatedTitle, _ref;
-
if (typeof title !== 'string') {
_ref = title.detail, title = _ref.title, open = _ref.open;
}
@@ -12052,7 +11620,6 @@
},
openSection: function() {
var section, selected;
-
if (selected = $('.tab-selected', Settings.dialog)) {
$.rmClass(selected, 'tab-selected');
}
@@ -12066,7 +11633,6 @@
},
main: function(section) {
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref;
-
items = {};
inputs = {};
_ref = Config.main;
@@ -12091,7 +11657,6 @@
}
$.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].checked = val;
@@ -12106,7 +11671,6 @@
boards: {}
}, function(item) {
var ID, board, thread, _ref1;
-
_ref1 = item.hiddenThreads.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -12121,7 +11685,6 @@
boards: {}
}, function(item) {
var ID, board, post, thread, _ref1;
-
_ref1 = item.hiddenPosts.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -12141,7 +11704,6 @@
boards: {}
}, function(item) {
var boardID;
-
for (boardID in item.hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
@@ -12152,7 +11714,6 @@
},
"export": function(now, data) {
var a, db, _i, _len, _ref;
-
if (typeof now !== 'number') {
now = Date.now();
data = {
@@ -12187,7 +11748,6 @@
},
onImport: function() {
var file, output, reader;
-
if (!(file = this.files[0])) {
return;
}
@@ -12199,7 +11759,6 @@
reader = new FileReader();
reader.onload = function(e) {
var data, err;
-
try {
data = JSON.parse(e.target.result);
Settings.loadSettings(data);
@@ -12216,7 +11775,6 @@
},
loadSettings: function(data) {
var key, val, version, _ref;
-
version = data.version.split('.');
if (version[0] === '2') {
data = Settings.convertSettings(data, {
@@ -12304,7 +11862,6 @@
},
convertSettings: function(data, map) {
var newKey, prevKey;
-
for (prevKey in map) {
newKey = map[prevKey];
if (newKey) {
@@ -12316,7 +11873,6 @@
},
filter: function(section) {
var select;
-
section.innerHTML = "";
select = $('select', section);
$.on(select, 'change', Settings.selectFilter);
@@ -12324,7 +11880,6 @@
},
selectFilter: function() {
var div, name, ta;
-
div = this.nextElementSibling;
if ((name = this.value) !== 'guide') {
$.rmAll(div);
@@ -12344,7 +11899,6 @@
},
sauce: function(section) {
var ta;
-
section.innerHTML = "Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%MD5: MD5 hash.%board: Current board.
";
ta = $('textarea', section);
$.get('sauces', Conf['sauces'], function(item) {
@@ -12354,7 +11908,6 @@
},
advanced: function(section) {
var archive, boardID, boardOptions, boardSelect, boards, data, event, input, inputs, item, items, name, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4;
-
section.innerHTML = "";
items = {};
inputs = {};
@@ -12374,7 +11927,6 @@
$.on(ta, 'change', $.cb.value);
$.get(items, function(items) {
var key, val;
-
for (key in items) {
val = items[key];
if (key === 'emojiPos') {
@@ -12445,7 +11997,6 @@
});
$.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
var option, selectedArchives, type;
-
selectedArchives = _arg.selectedArchives;
for (boardID in selectedArchives) {
data = selectedArchives[boardID];
@@ -12460,7 +12011,6 @@
},
addArchiveCell: function(boardID, data, type) {
var archive, i, length, options, select, td;
-
length = data[type].length;
td = $.el('td', {
className: 'archive-cell'
@@ -12490,10 +12040,8 @@
},
saveSelectedArchive: function() {
var _this = this;
-
return $.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
var selectedArchives, _name;
-
selectedArchives = _arg.selectedArchives;
(selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value;
return $.set('selectedArchives', selectedArchives);
@@ -12504,7 +12052,6 @@
},
time: function() {
var funk;
-
funk = Time.createFunc(this.value);
return this.nextElementSibling.textContent = funk(Time, new Date());
},
@@ -12513,7 +12060,6 @@
},
fileInfo: function() {
var data, funk;
-
data = {
isReply: true,
file: {
@@ -12552,7 +12098,6 @@
},
keybinds: function(section) {
var arr, input, inputs, items, key, tbody, tr, _ref;
-
section.innerHTML = "Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
";
tbody = $('tbody', section);
items = {};
@@ -12573,7 +12118,6 @@
}
return $.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].value = val;
@@ -12582,7 +12126,6 @@
},
keybind: function(e) {
var key;
-
if (e.keyCode === 9) {
return;
}
@@ -12599,10 +12142,8 @@
Main = {
init: function() {
var db, flatten, _i, _len, _ref;
-
flatten = function(parent, obj) {
var key, val;
-
if (obj instanceof Array) {
Conf[parent] = obj[0];
} else if (typeof obj === 'object') {
@@ -12635,7 +12176,6 @@
},
initFeatures: function() {
var init, pathname, _ref;
-
pathname = location.pathname.split('/');
g.BOARD = new Board(pathname[1]);
if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
@@ -12663,7 +12203,6 @@
case 'i.4cdn.org':
$.ready(function() {
var URL, _ref1;
-
if (Conf['404 Redirect'] && ((_ref1 = d.title) === '4chan - Temporarily Offline' || _ref1 === '4chan - 404 Not Found')) {
Redirect.init();
pathname = location.pathname.split('/');
@@ -12680,7 +12219,6 @@
}
init = function(features) {
var err, module, name;
-
for (name in features) {
module = features[name];
try {
@@ -12761,7 +12299,6 @@
},
initStyle: function() {
var mainStyleSheet, setStyle, style, styleSheets, _ref;
-
$.off(d, '4chanMainInit', Main.initStyle);
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return;
@@ -12783,7 +12320,6 @@
styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
setStyle = function() {
var styleSheet, _i, _len;
-
$.rmClass(doc, style);
for (_i = 0, _len = styleSheets.length; _i < _len; _i++) {
styleSheet = styleSheets[_i];
@@ -12805,7 +12341,6 @@
},
initReady: function() {
var err, errors, href, passLink, post, postRoot, posts, styleSelector, thread, threadRoot, _i, _len, _ref, _ref1;
-
if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
if (Conf['404 Redirect'] && g.VIEW === 'thread') {
href = Redirect.to('thread', {
@@ -12868,7 +12403,6 @@
},
callbackNodes: function(klass, nodes) {
var callback, err, errors, i, len, node, _i, _len, _ref;
-
len = nodes.length;
_ref = klass.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -12896,12 +12430,10 @@
},
callbackNodesDB: function(klass, nodes, cb) {
var errors, func, i, len, node, queue, softTask;
-
queue = [];
errors = null;
func = function(node) {
var callback, err, _i, _len, _ref;
-
_ref = klass.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
callback = _ref[_i];
@@ -12929,7 +12461,6 @@
};
softTask = function() {
var node;
-
node = queue.shift();
func(node);
if (!queue.length) {
@@ -12951,7 +12482,6 @@
},
addCallback: function(e) {
var Klass, obj;
-
obj = e.detail;
if (typeof obj.callback.name !== 'string') {
throw new Error("Invalid callback name: " + obj.callback.name);
@@ -12971,7 +12501,6 @@
},
handleErrors: function(errors) {
var div, error, logs, _i, _len;
-
if (!(errors instanceof Array)) {
error = errors;
} else if (errors.length === 1) {
@@ -12986,7 +12515,6 @@
});
$.on(div.lastElementChild, 'click', function() {
var _ref;
-
return _ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = _ref[0], logs.hidden = _ref[1], _ref;
});
logs = $.el('div', {
@@ -13000,7 +12528,6 @@
},
parseError: function(data) {
var error, message;
-
c.error(data.message, data.error.stack);
message = $.el('div', {
textContent: data.message
@@ -13012,7 +12539,6 @@
},
isThisPageLegit: function() {
var _ref;
-
if (!('thisPageIsLegit' in Main)) {
Main.thisPageIsLegit = location.hostname === 'boards.4chan.org' && !$('link[href*="favicon-status.ico"]', d.head) && ((_ref = d.title) !== '4chan - Temporarily Offline' && _ref !== '4chan - Error' && _ref !== '504 Gateway Time-out');
}