diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 6dd8f0796..444f6e8df 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -347,7 +347,6 @@
Array.prototype.indexOf = function(object) {
var i;
-
i = this.length;
while (i--) {
if (this[i] === object) {
@@ -366,7 +365,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
if (!properties.hasOwnProperty(key)) {
@@ -384,7 +382,6 @@
$.ready = function(fc) {
var cb;
-
if (d.readyState !== 'loading') {
$.queueTask(fc);
return;
@@ -398,7 +395,6 @@
$.formData = function(form) {
var fd, key, val;
-
if (form instanceof HTMLFormElement) {
return new FormData(form);
}
@@ -418,7 +414,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
object[key] = val;
@@ -427,11 +422,9 @@
$.ajax = (function() {
var lastModified;
-
lastModified = {};
return function(url, options, extra) {
var form, r, sync, type, upCallbacks, whenModified;
-
if (extra == null) {
extra = {};
}
@@ -454,11 +447,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);
@@ -478,7 +469,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];
@@ -514,7 +504,6 @@
$.addStyle = function(css, id) {
var style;
-
style = $.el('style', {
id: id,
textContent: css
@@ -561,7 +550,6 @@
} else {
return function(el) {
var _ref;
-
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
};
}
@@ -569,7 +557,6 @@
$.rmAll = function(root) {
var node;
-
while (node = root.firstChild) {
root.removeChild(node);
}
@@ -585,7 +572,6 @@
$.nodes = function(nodes) {
var frag, node, _i, _len;
-
if (!(nodes instanceof Array)) {
return nodes;
}
@@ -619,7 +605,6 @@
$.el = function(tag, properties) {
var el;
-
el = d.createElement(tag);
if (properties) {
$.extend(el, properties);
@@ -629,7 +614,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];
@@ -639,7 +623,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];
@@ -661,7 +644,6 @@
$.debounce = function(wait, fn) {
var args, exec, lastCall, that, timeout;
-
lastCall = 0;
timeout = null;
that = null;
@@ -683,11 +665,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);
@@ -710,7 +690,6 @@
$.globalEval = function(code) {
var script;
-
script = $.el('script', {
textContent: code
});
@@ -720,7 +699,6 @@
$.bytesToString = function(size) {
var unit;
-
unit = 0;
while (size >= 1024) {
size /= 1024;
@@ -736,7 +714,6 @@
$.item = function(key, val) {
var item;
-
item = {};
item[key] = val;
return item;
@@ -747,7 +724,6 @@
$.sync = (function() {
$.on(window, 'storage', function(e) {
var cb;
-
if (cb = $.syncing[e.key]) {
return cb(JSON.parse(e.newValue));
}
@@ -759,7 +735,6 @@
$["delete"] = function(keys) {
var key, _i, _len;
-
if (!(keys instanceof Array)) {
keys = [keys];
}
@@ -773,7 +748,6 @@
$.get = function(key, val, cb) {
var items;
-
if (typeof cb === 'function') {
items = $.item(key, val);
} else {
@@ -792,7 +766,6 @@
$.set = (function() {
var set;
-
set = function(key, val) {
key = g.NAMESPACE + key;
val = JSON.stringify(val);
@@ -803,7 +776,6 @@
};
return function(keys, val) {
var key;
-
if (typeof keys === 'string') {
set(keys, val);
return;
@@ -871,7 +843,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) {
@@ -947,7 +918,6 @@
Post.prototype.parseComment = function() {
var bq, i, node, nodes, text;
-
bq = this.nodes.comment.cloneNode(true);
nodes = $$('.abbr, .capcodeReplies, .exif, b', bq);
i = 0;
@@ -965,7 +935,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++) {
@@ -976,7 +945,6 @@
Post.prototype.parseQuote = function(quotelink) {
var fullID, match;
-
if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) {
return;
}
@@ -992,7 +960,6 @@
Post.prototype.parseFile = function(that) {
var alt, anchor, fileEl, fileInfo, size, thumb, unit;
-
if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) {
return;
}
@@ -1023,7 +990,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) {
@@ -1072,7 +1038,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');
@@ -1106,7 +1071,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++) {
@@ -1124,7 +1088,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'];
@@ -1212,7 +1175,6 @@
function DataBoard(key, sync, dontClean) {
var init,
_this = this;
-
this.key = key;
this.data = Conf[key];
$.sync(key, this.onSync.bind(this));
@@ -1235,7 +1197,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];
@@ -1256,7 +1217,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) {
@@ -1272,7 +1232,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;
@@ -1286,7 +1245,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) {
@@ -1310,7 +1268,6 @@
DataBoard.prototype.clean = function() {
var boardID, now, val, _ref;
-
_ref = this.data.boards;
for (boardID in _ref) {
val = _ref[boardID];
@@ -1330,10 +1287,8 @@
DataBoard.prototype.ajaxClean = function(boardID) {
var _this = this;
-
return $.cache("//api.4chan.org/" + boardID + "/threads.json", function(e) {
var board, page, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (e.target.status === 404) {
_this["delete"](boardID);
} else if (e.target.status === 200) {
@@ -1418,10 +1373,8 @@
init: function() {},
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);
@@ -1459,7 +1412,6 @@
init: function() {
var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton,
_this = this;
-
this.menu = new UI.Menu('header');
menuButton = $.el('span', {
className: 'menu-button',
@@ -1550,7 +1502,6 @@
});
return $.ready(function() {
var a, cs;
-
_this.footer = $.id('boardNavDesktopFoot');
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
a.className = 'current';
@@ -1584,7 +1535,6 @@
}),
setBoardList: function() {
var a, boardList, btn, fourchannav, fullBoardList;
-
fourchannav = $.id('boardNavDesktop');
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
a.className = 'current';
@@ -1606,7 +1556,6 @@
},
generateBoardList: function(text) {
var as, list, nodes;
-
list = $('#custom-board-list', Header.bar);
$.rmAll(list);
if (!text) {
@@ -1615,7 +1564,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);
}
@@ -1666,7 +1614,6 @@
},
toggleBoardList: function() {
var bar, custom, full, showBoardList;
-
bar = Header.bar;
custom = $('#custom-board-list', bar);
full = $('#full-board-list', bar);
@@ -1702,7 +1649,6 @@
},
toggleLinkJustify: function() {
var centered;
-
$.event('CloseMenu');
centered = this.nodeName === 'INPUT' ? this.checked : void 0;
Header.setLinkJustify(centered);
@@ -1732,7 +1678,6 @@
},
toggleBarVisibility: function(e) {
var hide, message;
-
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -1749,7 +1694,6 @@
},
toggleFooterVisibility: function() {
var hide, message;
-
$.event('CloseMenu');
hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden;
Header.setFooterVisibility(hide);
@@ -1759,7 +1703,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);
@@ -1772,14 +1715,12 @@
},
editCustomNav: function() {
var settings;
-
Settings.open('Advanced');
settings = $.id('fourchanx-settings');
return $('input[name=boardnav]', settings).focus();
},
hashScroll: function() {
var hash, post;
-
if (!((hash = this.location.hash.slice(1)) && (post = $.id(hash)))) {
return;
}
@@ -1790,7 +1731,6 @@
},
scrollToPost: function(post) {
var headRect, top;
-
top = post.getBoundingClientRect().top;
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
headRect = Header.bar.getBoundingClientRect();
@@ -1800,7 +1740,6 @@
},
addShortcut: function(el) {
var shortcut;
-
shortcut = $.el('span', {
className: 'shortcut brackets-wrap'
});
@@ -1812,7 +1751,6 @@
},
createNotification: function(e) {
var cb, content, lifetime, notif, type, _ref;
-
_ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb;
notif = new Notification(type, content, lifetime);
if (cb) {
@@ -1825,7 +1763,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);
@@ -1835,7 +1772,6 @@
},
postFromObject: function(data, boardID) {
var o;
-
o = {
postID: data.no,
threadID: data.resto || data.no,
@@ -1880,7 +1816,6 @@
*/
var a, boardID, capcode, capcodeClass, capcodeReplies, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, 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, capcodeReplies = o.capcodeReplies, file = o.file;
isOP = postID === threadID;
staticPath = '//static.4chan.org/image/';
@@ -1979,7 +1914,6 @@
},
capcodeReplies: function(_arg) {
var array, boardID, bq, capcodeReplies, capcodeType, generateCapcodeReplies, html, root, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, bq = _arg.bq, root = _arg.root, capcodeReplies = _arg.capcodeReplies;
if (!capcodeReplies) {
return;
@@ -2016,7 +1950,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) {
@@ -2032,7 +1965,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);
@@ -2052,7 +1984,6 @@
},
postDataFromLink: function(link) {
var boardID, path, postID, threadID, _ref;
-
if (link.hostname === 'boards.4chan.org') {
path = link.pathname.split('/');
boardID = path[1];
@@ -2070,7 +2001,6 @@
},
allQuotelinksLinkingTo: function(post) {
var ID, quote, quotedPost, quotelinks, quoterPost, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;
-
quotelinks = [];
_ref = g.posts;
for (ID in _ref) {
@@ -2099,14 +2029,12 @@
}
return quotelinks.filter(function(quotelink) {
var boardID, postID, _ref4;
-
_ref4 = Get.postDataFromLink(quotelink), boardID = _ref4.boardID, postID = _ref4.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;
@@ -2129,7 +2057,6 @@
},
insert: function(post, root, context) {
var clone, nodes;
-
if (!root.parentNode) {
return;
}
@@ -2143,7 +2070,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;
@@ -2197,7 +2123,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;
@@ -2292,10 +2217,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,
@@ -2335,7 +2258,6 @@
Menu.prototype.makeMenu = function() {
var menu;
-
menu = $.el('div', {
className: 'dialog',
id: 'menu',
@@ -2350,7 +2272,6 @@
Menu.prototype.toggle = function(e, button, data) {
var previousButton;
-
e.preventDefault();
e.stopPropagation();
if (currentMenu) {
@@ -2368,7 +2289,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;
@@ -2407,7 +2327,6 @@
Menu.prototype.insertEntry = function(entry, parent, data) {
var subEntry, submenu, _i, _len, _ref;
-
if (typeof entry.open === 'function') {
if (!entry.open(data)) {
return;
@@ -2441,7 +2360,6 @@
Menu.prototype.findNextEntry = function(entry, direction) {
var entries;
-
entries = __slice.call(entry.parentNode.children);
entries.sort(function(first, second) {
return +(first.style.order || first.style.webkitOrder) - +(second.style.order || second.style.webkitOrder);
@@ -2451,7 +2369,6 @@
Menu.prototype.keybinds = function(e) {
var entry, next, nextPrev, subEntry, submenu;
-
entry = $('.focused', currentMenu);
while (subEntry = $('.focused', entry)) {
entry = subEntry;
@@ -2497,7 +2414,6 @@
Menu.prototype.focus = function(entry) {
var cHeight, cWidth, eRect, focused, sRect, submenu, _i, _len, _ref;
-
while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
$.rmClass(focused, 'focused');
}
@@ -2532,7 +2448,6 @@
Menu.prototype.addEntry = function(e) {
var entry;
-
entry = e.detail;
if (entry.type !== this.type) {
return;
@@ -2543,7 +2458,6 @@
Menu.prototype.parseEntry = function(entry) {
var el, style, subEntries, subEntry, _i, _len;
-
el = entry.el, subEntries = entry.subEntries;
$.addClass(el, 'entry');
$.on(el, 'focus mouseover', (function(e) {
@@ -2567,7 +2481,6 @@
})();
dragstart = function(e) {
var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
-
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -2606,7 +2519,6 @@
};
touchmove = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -2618,7 +2530,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 + '%';
@@ -2634,7 +2545,6 @@
};
touchend = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -2656,7 +2566,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,
@@ -2691,7 +2600,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;
@@ -2735,7 +2643,6 @@
},
node: function() {
var email, name, tripcode, _ref;
-
if (this.info.capcode || this.isClone) {
return;
}
@@ -2762,7 +2669,6 @@
filters: {},
init: function() {
var boards, err, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4;
-
if (g.VIEW === 'catalog' || !Conf['Filter']) {
return;
}
@@ -2799,7 +2705,6 @@
op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'yes';
stub = (function() {
var _ref3;
-
switch ((_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0) {
case 'yes':
return true;
@@ -2830,7 +2735,6 @@
},
createFilter: function(regexp, op, stub, hl, top) {
var settings, test;
-
test = typeof regexp === 'string' ? function(value) {
return regexp === value;
} : function(value) {
@@ -2854,7 +2758,6 @@
},
node: function() {
var filter, firstThread, key, result, thisThread, value, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -2966,7 +2869,6 @@
menu: {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) {
return;
}
@@ -2992,7 +2894,6 @@
},
createSubEntry: function(text, type) {
var el;
-
el = $.el('a', {
href: 'javascript:;',
textContent: text
@@ -3003,7 +2904,6 @@
el: el,
open: function(post) {
var value;
-
value = Filter[type](post);
return value !== false;
}
@@ -3011,7 +2911,6 @@
},
makeFilter: function() {
var re, type, value;
-
type = this.dataset.type;
value = Filter[type](Filter.menu.post);
re = ['uniqueID', 'MD5'].contains(type) ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
@@ -3026,7 +2925,6 @@
re = ['uniqueID', 'MD5'].contains(type) ? "/" + 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);
@@ -3060,7 +2958,6 @@
},
node: function() {
var data;
-
if (!this.isReply || this.isClone) {
return;
}
@@ -3084,7 +2981,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub, replies, thisPost;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
return;
}
@@ -3155,7 +3051,6 @@
order: 20,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -3187,7 +3082,6 @@
order: 15,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -3204,7 +3098,6 @@
},
hide: function() {
var makeStub, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -3223,7 +3116,6 @@
},
show: function() {
var data, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -3247,7 +3139,6 @@
},
hideStub: function() {
var post;
-
post = PostHiding.menu.post;
post.nodes.root.hidden = true;
$.event('CloseMenu');
@@ -3255,7 +3146,6 @@
},
makeButton: function(post, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-reply-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -3266,7 +3156,6 @@
},
saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
var data;
-
data = {
boardID: post.board.ID,
threadID: post.thread.ID,
@@ -3285,14 +3174,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, button, postInfo, quotelink, _i, _len, _ref;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -3327,7 +3214,6 @@
},
show: function(post, showRecursively) {
var quotelink, _i, _len, _ref;
-
if (showRecursively == null) {
showRecursively = Conf['Recursive Hiding'];
}
@@ -3363,7 +3249,6 @@
},
node: function() {
var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.isClone) {
return;
}
@@ -3381,7 +3266,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: [],
@@ -3392,7 +3276,6 @@
},
rm: function(recursive, post) {
var i, obj, rec, _i, _len, _ref;
-
if (!(obj = Recursive.recursives[post.fullID])) {
return;
}
@@ -3407,7 +3290,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;
@@ -3434,7 +3316,6 @@
},
node: function() {
var data;
-
if (data = ThreadHiding.db.get({
boardID: this.board.ID,
threadID: this.ID
@@ -3448,7 +3329,6 @@
},
syncCatalog: function() {
var hiddenThreads, hiddenThreadsOnCatalog, threadID;
-
hiddenThreads = ThreadHiding.db.get({
boardID: g.BOARD.ID,
defaultValue: {}
@@ -3475,7 +3355,6 @@
cleanCatalog: function(hiddenThreadsOnCatalog) {
return $.cache("//api.4chan.org/" + g.BOARD + "/threads.json", function() {
var page, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.status !== 200) {
return;
}
@@ -3501,7 +3380,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub;
-
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
return;
}
@@ -3523,7 +3401,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || thread.isHidden) {
return false;
@@ -3553,7 +3430,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -3573,7 +3449,6 @@
order: 15,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -3584,7 +3459,6 @@
},
hide: function() {
var makeStub, thread;
-
makeStub = $('input', this.parentNode).checked;
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, makeStub);
@@ -3593,7 +3467,6 @@
},
show: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.show(thread);
ThreadHiding.saveHiddenState(thread);
@@ -3601,7 +3474,6 @@
},
hideStub: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, false);
$.event('CloseMenu');
@@ -3609,7 +3481,6 @@
},
makeButton: function(thread, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-thread-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -3621,7 +3492,6 @@
},
saveHiddenState: function(thread, makeStub) {
var hiddenThreadsOnCatalog;
-
hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
if (thread.isHidden) {
ThreadHiding.db.set({
@@ -3654,7 +3524,6 @@
},
hide: function(thread, makeStub) {
var OP, a, numReplies, opInfo, span, threadRoot;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -3678,7 +3547,6 @@
},
show: function(thread) {
var threadRoot;
-
if (thread.stub) {
$.rm(thread.stub);
delete thread.stub;
@@ -3691,7 +3559,6 @@
QuoteBacklink = {
init: function() {
var format;
-
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
return;
}
@@ -3709,7 +3576,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;
}
@@ -3747,7 +3613,6 @@
},
secondNode: function() {
var container;
-
if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
this.nodes.backlinkContainer = $('.container', this.nodes.info);
return;
@@ -3761,7 +3626,6 @@
},
getContainer: function(id) {
var _base;
-
return (_base = this.containers)[id] || (_base[id] = $.el('span', {
className: 'container'
}));
@@ -3784,7 +3648,6 @@
},
node: function() {
var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -3814,7 +3677,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];
@@ -3827,7 +3689,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];
@@ -3854,7 +3715,6 @@
},
toggle: function(e) {
var boardID, context, postID, threadID, _ref;
-
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -3880,7 +3740,6 @@
},
add: function(quotelink, boardID, threadID, postID, context) {
var inline, isBacklink, post, qroot, root;
-
isBacklink = $.hasClass(quotelink, 'backlink');
inline = $.el('div', {
id: "i" + postID,
@@ -3905,7 +3764,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);
@@ -3947,7 +3805,6 @@
},
node: function() {
var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -3990,7 +3847,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];
@@ -3999,7 +3855,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;
}
@@ -4043,7 +3898,6 @@
},
mouseout: function() {
var clone, post, root, _i, _len, _ref;
-
if (!(root = this.el.firstElementChild)) {
return;
}
@@ -4073,7 +3927,6 @@
},
node: function() {
var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone) {
return;
}
@@ -4096,7 +3949,6 @@
QuoteThreading = {
init: function() {
var input;
-
if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
return;
}
@@ -4119,7 +3971,6 @@
},
setup: function() {
var ID, post, posts;
-
$.off(d, '4chanXInitFinished', QuoteThreading.setup);
posts = g.posts;
for (ID in posts) {
@@ -4132,7 +3983,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;
}
@@ -4162,7 +4012,6 @@
},
nodeinsert: function() {
var bottom, height, qpost, qroot, threadContainer, top, _ref;
-
qpost = g.posts[this.threaded];
delete this.threaded;
delete this.cb;
@@ -4191,7 +4040,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;
@@ -4208,7 +4056,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;
@@ -4229,7 +4076,6 @@
},
kb: function() {
var control;
-
control = $.id('threadingControl');
return control.click();
}
@@ -4256,7 +4102,6 @@
},
node: function() {
var quotelink, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -4279,7 +4124,6 @@
cb: {
seek: function(type) {
var highlight, post, posts, result, str;
-
if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
@@ -4335,7 +4179,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];
@@ -4350,7 +4193,6 @@
},
parseDeadlink: function(deadlink) {
var a, boardID, m, post, postID, quote, quoteID, redirect, _ref;
-
if (deadlink.parentNode.className === 'prettyprint') {
Quotify.fixDeadlink(deadlink);
return;
@@ -4429,7 +4271,7 @@
if (g.VIEW === 'catalog' || !Conf['Linkify']) {
return;
}
- this.regString = /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|co\.jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly)|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i;
+ this.regString = /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|co\.jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly|info)|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i;
if (Conf['Comment Expansion']) {
ExpandComment.callbacks.push(this.node);
}
@@ -4443,7 +4285,6 @@
},
node: function() {
var data, el, end, endNode, i, index, items, length, link, links, node, range, result, saved, snapshot, space, test, _i, _len, _ref;
-
if (this.isClone) {
if (Conf['Embedding']) {
i = 0;
@@ -4522,7 +4363,6 @@
},
makeRange: function(startNode, endNode, startOffset, endOffset) {
var range;
-
range = document.createRange();
range.setStart(startNode, startOffset);
range.setEnd(endNode, endOffset);
@@ -4530,7 +4370,6 @@
},
makeLink: function(range) {
var a, char, i, text;
-
text = range.toString();
i = 0;
while (/[(\[{<>]/.test(text.charAt(i))) {
@@ -4574,7 +4413,6 @@
},
services: function(link) {
var href, key, match, type, _ref;
-
href = link.href;
_ref = Linkify.types;
for (key in _ref) {
@@ -4587,7 +4425,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', {
@@ -4616,7 +4453,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;
@@ -4653,21 +4489,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',
@@ -4680,7 +4513,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) {
@@ -4720,7 +4552,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"
});
@@ -4731,7 +4562,6 @@
},
text: function(_arg) {
var file, files;
-
files = _arg.files;
for (file in files) {
if (files.hasOwnProperty(file)) {
@@ -4779,7 +4609,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
});
@@ -4790,7 +4619,6 @@
style: 'height: auto; width: 500px; display: inline-block;',
el: function(a) {
var div;
-
div = $.el('div', {
className: "soundcloud",
name: "soundcloud"
@@ -4816,7 +4644,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', {
@@ -4888,7 +4715,6 @@
QR = {
init: function() {
var sc;
-
if (!Conf['Quick Reply']) {
return;
}
@@ -4935,7 +4761,6 @@
},
initReady: function() {
var link;
-
QR.postingIsEnabled = !!$.id('postForm');
if (!QR.postingIsEnabled) {
return;
@@ -4955,13 +4780,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);
});
@@ -4990,7 +4813,6 @@
},
open: function() {
var err;
-
if (QR.nodes) {
QR.nodes.el.hidden = false;
QR.unhide();
@@ -5009,7 +4831,6 @@
},
close: function() {
var post, _i, _len, _ref;
-
if (QR.req) {
QR.abort();
return;
@@ -5057,7 +4878,6 @@
},
error: function(err) {
var el;
-
QR.open();
if (typeof err === 'string') {
el = $.tn(err);
@@ -5085,7 +4905,6 @@
notifications: [],
cleanNotifications: function() {
var notification, _i, _len, _ref;
-
_ref = QR.notifications;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
notification = _ref[_i];
@@ -5095,7 +4914,6 @@
},
status: function() {
var disabled, status, thread, value;
-
if (!QR.nodes) {
return;
}
@@ -5117,7 +4935,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: [],
@@ -5137,7 +4954,6 @@
},
parseItem: function(item, types) {
var boards, match, type, val, _ref, _ref1;
-
if (item[0] === '#') {
return;
}
@@ -5166,7 +4982,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];
@@ -5179,7 +4994,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;
}
@@ -5188,7 +5002,6 @@
get: function(cb) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
return cb(persona);
});
@@ -5196,7 +5009,6 @@
set: function(post) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
persona = {
name: post.name,
@@ -5210,7 +5022,6 @@
cooldown: {
init: function() {
var board;
-
if (!Conf['Cooldown']) {
return;
}
@@ -5252,7 +5063,6 @@
},
sync: function(cooldowns) {
var id;
-
for (id in cooldowns) {
QR.cooldown.cooldowns[id] = cooldowns[id];
}
@@ -5260,7 +5070,6 @@
},
set: function(data) {
var cooldown, delay, hasFile, isReply, isSage, post, req, start, type, upSpd;
-
if (!Conf['Cooldown']) {
return;
}
@@ -5300,7 +5109,6 @@
},
count: function() {
var cooldown, cooldowns, elapsed, hasFile, isReply, isSage, 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;
@@ -5354,7 +5162,6 @@
},
quote: function(e) {
var caretPos, com, index, post, range, s, sel, text, thread, _ref;
-
if (e != null) {
e.preventDefault();
}
@@ -5392,7 +5199,6 @@
},
characterCount: function() {
var count, counter;
-
counter = QR.nodes.charCount;
count = QR.nodes.com.textLength;
counter.textContent = count;
@@ -5401,7 +5207,6 @@
},
drag: function(e) {
var toggle;
-
toggle = e.type === 'dragstart' ? $.off : $.on;
toggle(d, 'dragover', QR.dragOver);
return toggle(d, 'drop', QR.dropFile);
@@ -5421,7 +5226,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++) {
@@ -5449,7 +5253,6 @@
},
fileInput: function(files) {
var file, length, max, post, _i, _len;
-
if (files instanceof Event) {
files = __slice.call(this.files);
QR.nodes.fileInput.value = null;
@@ -5498,7 +5301,6 @@
function _Class(select) {
var el, elm, event, prev, _i, _j, _len, _len1, _ref, _ref1,
_this = this;
-
el = $.el('a', {
className: 'qr-preview',
draggable: true,
@@ -5558,7 +5360,6 @@
_Class.prototype.rm = function() {
var index;
-
this["delete"]();
index = QR.posts.indexOf(this);
if (QR.posts.length === 1) {
@@ -5578,7 +5379,6 @@
_Class.prototype.lock = function(lock) {
var name, _i, _len, _ref;
-
if (lock == null) {
lock = true;
}
@@ -5603,7 +5403,6 @@
_Class.prototype.select = function() {
var rectEl, rectList;
-
if (QR.selected) {
QR.selected.nodes.el.id = null;
QR.selected.forceSave();
@@ -5620,7 +5419,6 @@
_Class.prototype.load = function() {
var name, _i, _len, _ref;
-
_ref = ['thread', 'name', 'email', 'sub', 'com'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
name = _ref[_i];
@@ -5632,7 +5430,6 @@
_Class.prototype.save = function(input) {
var name, _ref;
-
if (input.type === 'checkbox') {
this.spoiler = input.checked;
return;
@@ -5653,7 +5450,6 @@
_Class.prototype.forceSave = function() {
var name, _i, _len, _ref;
-
if (this !== QR.selected) {
return;
}
@@ -5683,11 +5479,9 @@
_Class.prototype.setThumbnail = function() {
var fileURL, img,
_this = this;
-
img = $.el('img');
img.onload = function() {
var cv, height, s, width;
-
s = 90 * 2;
if (_this.file.type === 'image/gif') {
s *= 3;
@@ -5745,11 +5539,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;
@@ -5787,7 +5579,6 @@
_Class.prototype.drop = function() {
var el, index, newIndex, oldIndex, post;
-
$.rmClass(this, 'over');
if (!this.draggable) {
return;
@@ -5822,7 +5613,6 @@
ready: function() {
var imgContainer, input, setLifetime,
_this = this;
-
setLifetime = function(e) {
return _this.lifetime = e.detail;
};
@@ -5859,7 +5649,6 @@
});
$.get('captchas', [], function(_arg) {
var captchas;
-
captchas = _arg.captchas;
return _this.sync(captchas);
});
@@ -5876,7 +5665,6 @@
},
getOne: function() {
var captcha, challenge, response;
-
this.clear();
if (captcha = this.captchas.shift()) {
challenge = captcha.challenge, response = captcha.response;
@@ -5901,7 +5689,6 @@
},
save: function() {
var response;
-
if (!(response = this.nodes.input.value.trim())) {
return;
}
@@ -5916,7 +5703,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) {
@@ -5934,7 +5720,6 @@
},
load: function() {
var challenge;
-
if (!this.nodes.challenge.firstChild) {
return;
}
@@ -5947,7 +5732,6 @@
},
count: function() {
var count;
-
count = this.captchas.length;
this.nodes.input.placeholder = (function() {
switch (count) {
@@ -5980,7 +5764,6 @@
},
dialog: function() {
var dialog, elm, i, items, mimeTypes, name, nodes, thread;
-
dialog = UI.dialog('qr', 'top:0;right:0;', "
");
QR.nodes = nodes = {
el: dialog,
@@ -6099,7 +5882,6 @@
preSubmitHooks: [],
submit: function(e) {
var challenge, err, extra, filetag, hook, options, post, postData, response, textOnly, thread, threadID, _i, _len, _ref, _ref1;
-
if (e != null) {
e.preventDefault();
}
@@ -6213,7 +5995,6 @@
},
response: function() {
var URL, ban, board, err, h1, isReply, m, post, postID, req, resDoc, threadID, _, _ref, _ref1;
-
req = QR.req;
delete QR.req;
post = QR.posts[0];
@@ -6311,7 +6092,6 @@
FappeTyme = {
init: function() {
var el, input;
-
if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') {
return;
}
@@ -6363,7 +6143,6 @@
},
node: function() {
var thumb, _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6388,7 +6167,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';
@@ -6422,7 +6200,6 @@
},
toggle: function(post) {
var headRect, rect, root, thumb, x, y;
-
thumb = post.file.thumb;
if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) {
ImageExpand.expand(post);
@@ -6432,7 +6209,6 @@
root = post.nodes.root;
rect = (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) {
@@ -6463,7 +6239,6 @@
},
expand: function(post, src) {
var img, thumb;
-
thumb = post.file.thumb;
if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) {
return;
@@ -6491,7 +6266,6 @@
},
completeExpand: function(post) {
var prev, thumb;
-
thumb = post.file.thumb;
if (!$.hasClass(thumb, 'expanding')) {
return;
@@ -6505,7 +6279,6 @@
prev = post.nodes.root.getBoundingClientRect();
return $.queueTask(function() {
var curr;
-
$.addClass(post.nodes.root, 'expanded-image');
$.rmClass(post.file.thumb, 'expanding');
if (!(prev.top + prev.height <= 0)) {
@@ -6517,7 +6290,6 @@
},
error: function() {
var URL, post, src, timeoutID;
-
post = Get.postFromNode(this);
$.rm(this);
delete post.file.fullImage;
@@ -6543,7 +6315,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -6567,7 +6338,6 @@
menu: {
init: function() {
var conf, createSubEntry, el, name, subEntries, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Image Expansion']) {
return;
}
@@ -6591,7 +6361,6 @@
},
createSubEntry: function(name, desc) {
var input, label;
-
label = $.el('label', {
innerHTML: " " + name,
title: desc
@@ -6625,7 +6394,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6633,7 +6401,6 @@
},
mouseover: function(e) {
var el, post;
-
post = Get.postFromNode(this);
el = $.el('img', {
id: 'ihover',
@@ -6655,7 +6422,6 @@
error: function() {
var URL, post, src, timeoutID,
_this = this;
-
if (!doc.contains(this)) {
return;
}
@@ -6680,7 +6446,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -6706,7 +6471,6 @@
ImageLoader = {
init: function() {
var prefetch;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -6733,7 +6497,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;
}
@@ -6755,7 +6518,6 @@
},
toggle: function() {
var enabled, id, post, _ref;
-
enabled = Conf['prefetch'] = this.checked;
if (enabled) {
_ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts;
@@ -6779,7 +6541,6 @@
},
node: function() {
var thumb, _ref;
-
if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) {
return;
}
@@ -6792,7 +6553,6 @@
Sauce = {
init: function() {
var err, link, links, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Sauce']) {
return;
}
@@ -6822,7 +6582,6 @@
},
createSauceLink: function(link) {
var m, text;
-
link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) {
switch (parameter) {
case '%TURL':
@@ -6843,7 +6602,6 @@
},
node: function() {
var link, nodes, _i, _len, _ref;
-
if (this.isClone || !this.file) {
return;
}
@@ -6860,7 +6618,6 @@
ArchiveLink = {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) {
return;
}
@@ -6873,7 +6630,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,
@@ -6892,14 +6648,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,
@@ -6909,7 +6663,6 @@
return true;
} : function(post) {
var value;
-
value = Filter[type](post);
if (!value) {
return false;
@@ -6932,7 +6685,6 @@
DeleteLink = {
init: function() {
var div, fileEl, fileEntry, postEl, postEntry;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) {
return;
}
@@ -6960,7 +6712,6 @@
el: fileEl,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file || file.isDead) {
return false;
@@ -6976,7 +6727,6 @@
order: 40,
open: function(post) {
var node;
-
if (post.isDead || post.board.ID === 'q') {
return false;
}
@@ -6991,7 +6741,6 @@
},
"delete": function() {
var fileOnly, form, link, post;
-
post = DeleteLink.post;
if (DeleteLink.cooldown.counting === post) {
return;
@@ -7021,7 +6770,6 @@
},
load: function(link, post, fileOnly, resDoc) {
var msg, s;
-
if (resDoc.title === '4chan - Banned') {
s = 'Banned!';
} else if (msg = resDoc.getElementById('errmsg')) {
@@ -7042,7 +6790,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,
@@ -7076,7 +6823,6 @@
DownloadLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) {
return;
}
@@ -7090,7 +6836,6 @@
order: 100,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file) {
return false;
@@ -7123,7 +6868,6 @@
},
makeButton: (function() {
var a;
-
a = $.el('a', {
className: 'menu-button brackets-wrap',
innerHTML: '',
@@ -7131,7 +6875,6 @@
});
return function() {
var button;
-
button = a.cloneNode(true);
$.on(button, 'click', Menu.toggle);
return button;
@@ -7139,7 +6882,6 @@
})(),
toggle: function(e) {
var post;
-
post = Get.postFromNode(this);
return Menu.menu.toggle(e, this, post);
}
@@ -7148,7 +6890,6 @@
ReportLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) {
return;
}
@@ -7170,7 +6911,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();
@@ -7183,7 +6923,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;
@@ -7256,7 +6995,6 @@
init: function() {
var sc,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
return;
}
@@ -7285,7 +7023,6 @@
},
node: function() {
var ID, fileCount, post, postCount, _ref;
-
postCount = 0;
fileCount = 0;
_ref = this.posts;
@@ -7303,7 +7040,6 @@
},
onUpdate: function(e) {
var fileCount, postCount, _ref;
-
if (e.detail[404]) {
return;
}
@@ -7312,7 +7048,6 @@
},
update: function(postCount, fileCount) {
var fileCountEl, postCountEl, thread;
-
thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl;
postCountEl.textContent = postCount;
fileCountEl.textContent = fileCount;
@@ -7337,7 +7072,6 @@
},
onThreadsLoad: function() {
var page, pages, thread, _i, _j, _len, _len1, _ref;
-
if (!(Conf["Page Count in Stats"] && this.status === 200)) {
return;
}
@@ -7361,7 +7095,6 @@
init: function() {
var checked, conf, el, input, name, sc, settings, subEntries, _ref,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
return;
}
@@ -7511,7 +7244,6 @@
},
interval: function() {
var val;
-
val = +this.value;
if (val < 1) {
val = 1;
@@ -7521,7 +7253,6 @@
},
load: function() {
var klass, req, text, _ref;
-
req = ThreadUpdater.req;
switch (req.status) {
case 200:
@@ -7554,7 +7285,6 @@
},
getInterval: function() {
var i, j;
-
i = ThreadUpdater.interval;
j = Math.min(ThreadUpdater.outdateCount, 10);
if (!d.hidden) {
@@ -7564,14 +7294,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;
@@ -7584,7 +7312,6 @@
},
timeout: function() {
var n;
-
ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
if (!(n = --ThreadUpdater.seconds)) {
return ThreadUpdater.update();
@@ -7597,7 +7324,6 @@
},
update: function() {
var url;
-
if (!ThreadUpdater.online) {
return;
}
@@ -7620,7 +7346,6 @@
},
updateThreadStatus: function(title, OP) {
var icon, message, root, titleLC;
-
titleLC = title.toLowerCase();
if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) {
return;
@@ -7647,7 +7372,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);
@@ -7733,7 +7457,6 @@
}
$.queueTask(function() {
var length, threadID;
-
threadID = ThreadUpdater.thread.ID;
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
return Fourchan.parseThread(threadID, length - count, length);
@@ -7754,7 +7477,6 @@
ThreadWatcher = {
init: function() {
var now, sc;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -7787,7 +7509,6 @@
}
$.get('WatchedThreads', null, function(_arg) {
var WatchedThreads, boardID, data, threadID, threads, _ref;
-
WatchedThreads = _arg.WatchedThreads;
if (!WatchedThreads) {
return;
@@ -7813,7 +7534,6 @@
},
node: function() {
var toggler;
-
toggler = $.el('img', {
className: 'watch-thread-link'
});
@@ -7835,7 +7555,6 @@
}
return $.get('AutoWatch', 0, function(_arg) {
var AutoWatch, thread;
-
AutoWatch = _arg.AutoWatch;
if (!(thread = g.BOARD.threads[AutoWatch])) {
return;
@@ -7851,7 +7570,6 @@
cb: {
openAll: function() {
var a, _i, _len, _ref;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -7870,7 +7588,6 @@
},
pruneDeads: function() {
var boardID, data, threadID, _i, _len, _ref, _ref1;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -7894,13 +7611,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']) {
@@ -7912,7 +7627,6 @@
},
threadUpdate: function(e) {
var thread;
-
thread = e.detail.thread;
if (!(e.detail[404] && ThreadWatcher.db.get({
boardID: thread.board.ID,
@@ -7929,7 +7643,6 @@
},
fetchAllStatus: function() {
var thread, threads, _i, _len;
-
if (!(threads = ThreadWatcher.getAll()).length) {
return;
}
@@ -7941,7 +7654,6 @@
},
fetchStatus: function(_arg) {
var boardID, data, fetchCount, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
if (data.isDead) {
return;
@@ -7951,7 +7663,6 @@
return $.ajax("//api.4chan.org/" + boardID + "/res/" + threadID + ".json", {
onloadend: function() {
var status;
-
fetchCount.fetched++;
if (fetchCount.fetched === fetchCount.fetching) {
fetchCount.fetched = 0;
@@ -7982,7 +7693,6 @@
},
getAll: function() {
var all, boardID, data, threadID, threads, _ref;
-
all = [];
_ref = ThreadWatcher.db.data.boards;
for (boardID in _ref) {
@@ -8003,7 +7713,6 @@
},
makeLine: function(boardID, threadID, data) {
var div, fullID, href, link, x;
-
x = $.el('a', {
textContent: '×',
href: 'javascript:;'
@@ -8034,7 +7743,6 @@
},
refresh: function() {
var boardID, data, 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++) {
@@ -8062,7 +7770,6 @@
},
toggle: function(thread) {
var boardID, threadID;
-
boardID = thread.board.ID;
threadID = thread.ID;
if (ThreadWatcher.db.get({
@@ -8076,7 +7783,6 @@
},
add: function(thread) {
var boardID, data, threadID;
-
data = {};
boardID = thread.board.ID;
threadID = thread.ID;
@@ -8107,7 +7813,6 @@
},
convert: function(oldFormat) {
var boardID, data, newFormat, threadID, threads;
-
newFormat = {};
for (boardID in oldFormat) {
threads = oldFormat[boardID];
@@ -8124,7 +7829,6 @@
refreshers: [],
init: function() {
var menu;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -8137,7 +7841,6 @@
},
addHeaderMenuEntry: function() {
var entryEl;
-
if (g.VIEW !== 'thread') {
return;
}
@@ -8154,7 +7857,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);
@@ -8163,7 +7865,6 @@
},
addMenuEntries: function() {
var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1, _results;
-
entries = [];
entries.push({
cb: ThreadWatcher.cb.openAll,
@@ -8234,7 +7935,6 @@
},
createSubEntry: function(name, desc) {
var entry, input;
-
entry = {
type: 'thread watcher',
el: $.el('label', {
@@ -8286,7 +7986,6 @@
},
ready: function() {
var ID, post, posts, _ref;
-
$.off(d, '4chanXInitFinished', Unread.ready);
posts = [];
_ref = Unread.thread.posts;
@@ -8303,7 +8002,6 @@
},
scroll: function() {
var checkPosition, hash, onload, post, posts, root;
-
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
return;
}
@@ -8333,7 +8031,6 @@
}
checkPosition = function(target) {
var height, top, _ref;
-
_ref = target.getBoundingClientRect(), top = _ref.top, height = _ref.height;
return top + height - doc.clientHeight > 0;
};
@@ -8341,7 +8038,6 @@
},
sync: function() {
var lastReadPost;
-
lastReadPost = Unread.db.get({
boardID: Unread.thread.board.ID,
threadID: Unread.thread.ID,
@@ -8358,7 +8054,6 @@
},
addPosts: function(posts) {
var ID, data, post, _i, _len;
-
for (_i = 0, _len = posts.length; _i < _len; _i++) {
post = posts[_i];
ID = post.ID;
@@ -8386,7 +8081,6 @@
},
addPostQuotingYou: function(post) {
var quotelink, _i, _len, _ref;
-
if (!QR.db) {
return;
}
@@ -8407,7 +8101,6 @@
},
readSinglePost: function(post) {
var i;
-
if ((i = Unread.posts.indexOf(post)) === -1) {
return;
}
@@ -8423,7 +8116,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) {
@@ -8434,7 +8126,6 @@
},
read: $.debounce(50, function(e) {
var ID, bottom, height, i, post, posts;
-
if (d.hidden || !Unread.posts.length) {
return;
}
@@ -8490,7 +8181,6 @@
}),
setLine: function(force) {
var post, root;
-
if (!(d.hidden || force === true)) {
return;
}
@@ -8505,7 +8195,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);
@@ -8526,7 +8215,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];
@@ -8658,7 +8346,6 @@
},
to: function(dest, data) {
var archive;
-
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
if (!archive) {
return '';
@@ -8667,7 +8354,6 @@
},
protocol: function(archive) {
var protocol;
-
protocol = location.protocol;
if (!archive[protocol.slice(0, -1)]) {
protocol = protocol === 'https:' ? 'http:' : 'https:';
@@ -8676,7 +8362,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') {
@@ -8689,7 +8374,6 @@
},
post: function(archive, _arg) {
var URL, boardID, postID, protocol;
-
boardID = _arg.boardID, postID = _arg.postID;
protocol = Redirect.protocol(archive);
if (['Foolz', 'NSFW Foolz'].contains(archive.name)) {
@@ -8701,13 +8385,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);
@@ -8726,7 +8408,6 @@
},
setup: function() {
var btn, entry, psa;
-
$.off(d, '4chanXInitFinished', PSAHiding.setup);
if (!(psa = $.id('globalMessage'))) {
$.rmClass(doc, 'hide-announcement');
@@ -8755,7 +8436,6 @@
$.on(btn, 'click', PSAHiding.toggle);
$.get('hiddenPSA', 0, function(_arg) {
var hiddenPSA;
-
hiddenPSA = _arg.hiddenPSA;
PSAHiding.sync(hiddenPSA);
$.before(psa, btn);
@@ -8765,7 +8445,6 @@
},
toggle: function(e) {
var UTC;
-
if ($.hasClass(this, 'hide-announcement')) {
UTC = +$.id('globalMessage').dataset.utc;
$.set('hiddenPSA', UTC);
@@ -8777,7 +8456,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') {
@@ -8789,7 +8467,6 @@
CatalogLinks = {
init: function() {
var el, input;
-
if (!Conf['Catalog Links']) {
return;
}
@@ -8813,14 +8490,12 @@
},
toggle: function() {
var useCatalog;
-
$.event('CloseMenu');
$.set('Header catalog links', useCatalog = this.checked);
return CatalogLinks.set(useCatalog);
},
set: function(useCatalog) {
var a, board, path, _i, _len, _ref;
-
path = useCatalog ? 'catalog' : '';
_ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -8854,7 +8529,6 @@
},
node: function() {
var str, uid;
-
if (this.isClone || !(str = this.info.uniqueID)) {
return;
}
@@ -8867,7 +8541,6 @@
ids: {},
compute: function(str) {
var hash, rgb;
-
hash = IDColor.hash(str);
rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125;
@@ -8879,7 +8552,6 @@
},
hash: function(str) {
var i, j, msg;
-
msg = 0;
i = 0;
j = str.length;
@@ -8927,7 +8599,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;
}
@@ -8939,7 +8610,6 @@
Emoji = {
init: function() {
var css, icon, name, pos, _ref;
-
if (!Conf['Emoji']) {
return;
}
@@ -9009,7 +8679,6 @@
},
node: function() {
var a;
-
if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
return $.on(a, 'click', ExpandComment.cb);
}
@@ -9021,7 +8690,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;
@@ -9037,7 +8705,6 @@
},
contract: function(post) {
var a;
-
if (!post.nodes.shortComment) {
return;
}
@@ -9048,7 +8715,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 (![200, 304].contains(status)) {
a.textContent = "Error " + req.statusText + " (" + status + ")";
@@ -9111,7 +8777,6 @@
},
node: function() {
var a, files, posts, span, _ref;
-
if (!(span = $.x('following-sibling::span[contains(@class,"summary")][1]', this.OP.nodes.root))) {
return;
}
@@ -9132,7 +8797,6 @@
},
toggle: function(thread) {
var a, files, filesCount, inlined, num, post, posts, postsCount, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4;
-
threadRoot = thread.OP.nodes.root.parentNode;
a = $('.summary', threadRoot);
switch (thread.isExpanded) {
@@ -9210,7 +8874,6 @@
},
parse: function(req, thread, a) {
var filesCount, link, post, posts, postsCount, postsObj, postsRoot, reply, root, spoilerRange, _i, _len;
-
if (a.textContent[0] === '+') {
return;
}
@@ -9274,7 +8937,6 @@
},
createFunc: function(format) {
var code;
-
code = format.replace(/%(.)/g, function(s, c) {
if (c in FileInfo.formatters) {
return "' + FileInfo.formatters." + c + ".call(post) + '";
@@ -9286,7 +8948,6 @@
},
convertUnit: function(size, unit) {
var i;
-
if (unit === 'B') {
return "" + (size.toFixed()) + " Bytes";
}
@@ -9317,7 +8978,6 @@
},
n: function() {
var fullname, shortname;
-
fullname = this.file.name;
shortname = Build.shortFilename(this.file.name, this.isReply);
if (fullname === shortname) {
@@ -9361,7 +9021,6 @@
Fourchan = {
init: function() {
var board;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -9383,7 +9042,6 @@
},
code: function() {
var pre, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -9413,13 +9071,11 @@
Keybinds = {
init: function() {
var init;
-
if (g.VIEW === 'catalog' || !Conf['Keybinds']) {
return;
}
init = function() {
var node, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', init);
$.on(d, 'keydown', Keybinds.keydown);
_ref = $$('[accesskey]');
@@ -9432,7 +9088,6 @@
},
keydown: function(e) {
var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -9613,7 +9268,6 @@
},
keyCode: function(e) {
var kc, key;
-
key = (function() {
switch (kc = e.keyCode) {
case 8:
@@ -9669,7 +9323,6 @@
},
tags: function(tag, ta) {
var range, selEnd, selStart, value;
-
value = ta.value;
selStart = ta.selectionStart;
selEnd = ta.selectionEnd;
@@ -9680,13 +9333,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 {
@@ -9696,7 +9347,6 @@
},
open: function(thread, tab) {
var url;
-
if (g.VIEW !== 'index') {
return;
}
@@ -9709,7 +9359,6 @@
},
hl: function(delta, thread) {
var axe, headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len;
-
if (!delta) {
if (postEl = $('.reply.highlight', thread)) {
$.rmClass(postEl, 'highlight');
@@ -9769,7 +9418,6 @@
Nav = {
init: function() {
var append, next, prev, span;
-
switch (g.VIEW) {
case 'index':
if (!Conf['Index Navigation']) {
@@ -9820,7 +9468,6 @@
},
getThread: function(full) {
var headRect, i, rect, thread, threads, topMargin, _i, _len;
-
if (Conf['Bottom header'] || !Conf['Fixed Header']) {
topMargin = 0;
} else {
@@ -9846,7 +9493,6 @@
},
scroll: function(delta) {
var i, rect, thread, threads, top, topMargin, _ref, _ref1;
-
_ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4];
top = rect.top - topMargin;
if ((delta === -1 && top > -5) || (delta === +1 && top < 5)) {
@@ -9871,7 +9517,6 @@
},
node: function() {
var dateEl;
-
if (this.isClone) {
return;
}
@@ -9881,7 +9526,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) {
@@ -9892,7 +9536,6 @@
stale: [],
flush: function() {
var now, update, _i, _len, _ref;
-
if (d.hidden) {
return;
}
@@ -9908,16 +9551,13 @@
},
setUpdate: function(post) {
var markStale, setOwnTimeout, update;
-
setOwnTimeout = function(diff) {
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(markStale, delay);
};
update = function(now) {
var date, diff, relative, singlePost, _i, _len, _ref;
-
date = post.info.date;
diff = now - date;
relative = RelativeDates.relative(diff, now, date);
@@ -9958,7 +9598,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];
@@ -9978,7 +9617,6 @@
},
ready: function() {
var field;
-
field = $.id('recaptcha_response_field');
$.on(field, 'keydown', function(e) {
if (e.keyCode === 8 && !field.value) {
@@ -9987,7 +9625,6 @@
});
return $.on($('form'), 'submit', function(e) {
var response;
-
e.preventDefault();
response = field.value.trim();
if (!/\s/.test(response)) {
@@ -10017,7 +9654,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) + '";
@@ -10102,7 +9738,6 @@
Settings = {
init: function() {
var link, settings;
-
link = $.el('a', {
className: 'settings-link',
textContent: 'Settings',
@@ -10112,7 +9747,6 @@
Header.addShortcut(link);
$.get('previousversion', null, function(item) {
var changelog, el, previous;
-
if (previous = item['previousversion']) {
if (previous === g.VERSION) {
return;
@@ -10150,7 +9784,6 @@
},
open: function(openSection) {
var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', Settings.open);
if (Settings.dialog) {
return;
@@ -10203,7 +9836,6 @@
sections: [],
addSection: function(title, open) {
var hyphenatedTitle, _ref;
-
if (typeof title !== 'string') {
_ref = title.detail, title = _ref.title, open = _ref.open;
}
@@ -10216,7 +9848,6 @@
},
openSection: function() {
var section, selected;
-
if (selected = $('.tab-selected', Settings.dialog)) {
$.rmClass(selected, 'tab-selected');
}
@@ -10230,7 +9861,6 @@
},
main: function(section) {
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref;
-
items = {};
inputs = {};
_ref = Config.main;
@@ -10255,7 +9885,6 @@
}
$.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].checked = val;
@@ -10270,7 +9899,6 @@
boards: {}
}, function(item) {
var ID, board, thread, _ref1;
-
_ref1 = item.hiddenThreads.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -10285,7 +9913,6 @@
boards: {}
}, function(item) {
var ID, board, post, thread, _ref1;
-
_ref1 = item.hiddenPosts.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -10305,7 +9932,6 @@
boards: {}
}, function(item) {
var boardID;
-
for (boardID in item.hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
@@ -10316,7 +9942,6 @@
},
"export": function(now, data) {
var a, db, p, _i, _len;
-
if (typeof now !== 'number') {
now = Date.now();
data = {
@@ -10352,7 +9977,6 @@
},
onImport: function() {
var file, output, reader;
-
if (!(file = this.files[0])) {
return;
}
@@ -10364,7 +9988,6 @@
reader = new FileReader();
reader.onload = function(e) {
var data, err;
-
try {
data = JSON.parse(e.target.result);
Settings.loadSettings(data);
@@ -10381,7 +10004,6 @@
},
loadSettings: function(data) {
var key, val, version, _ref;
-
version = data.version.split('.');
if (version[0] === '2') {
data = Settings.convertSettings(data, {
@@ -10469,7 +10091,6 @@
},
convertSettings: function(data, map) {
var newKey, prevKey;
-
for (prevKey in map) {
newKey = map[prevKey];
if (newKey) {
@@ -10481,7 +10102,6 @@
},
filter: function(section) {
var select;
-
section.innerHTML = "";
select = $('select', section);
$.on(select, 'change', Settings.selectFilter);
@@ -10489,7 +10109,6 @@
},
selectFilter: function() {
var div, name, ta;
-
div = this.nextElementSibling;
if ((name = this.value) !== 'guide') {
$.rmAll(div);
@@ -10509,7 +10128,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:\n%TURL: Thumbnail URL.%URL: Full image URL.%MD5: MD5 hash.%board: Current board.
";
ta = $('textarea', section);
$.get('sauces', Conf['sauces'], function(item) {
@@ -10519,7 +10137,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 = {};
@@ -10539,7 +10156,6 @@
$.on(ta, 'change', $.cb.value);
$.get(items, function(items) {
var key, val;
-
for (key in items) {
val = items[key];
if (['emojiPos'].contains(key)) {
@@ -10610,7 +10226,6 @@
});
$.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
var option, selectedArchives, type;
-
selectedArchives = _arg.selectedArchives;
for (boardID in selectedArchives) {
data = selectedArchives[boardID];
@@ -10625,7 +10240,6 @@
},
addArchiveCell: function(boardID, data, type) {
var archive, i, length, options, select, td;
-
length = data[type].length;
td = $.el('td', {
className: 'archive-cell'
@@ -10655,10 +10269,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);
@@ -10669,7 +10281,6 @@
},
time: function() {
var funk;
-
funk = Time.createFunc(this.value);
return this.nextElementSibling.textContent = funk(Time, new Date());
},
@@ -10678,7 +10289,6 @@
},
fileInfo: function() {
var data, funk;
-
data = {
isReply: true,
file: {
@@ -10717,7 +10327,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 = {};
@@ -10738,7 +10347,6 @@
}
return $.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].value = val;
@@ -10747,7 +10355,6 @@
},
keybind: function(e) {
var key;
-
if (e.keyCode === 9) {
return;
}
@@ -10764,10 +10371,8 @@
Main = {
init: function() {
var db, flatten, _i, _len;
-
flatten = function(parent, obj) {
var key, val;
-
if (obj instanceof Array) {
Conf[parent] = obj[0];
} else if (typeof obj === 'object') {
@@ -10799,7 +10404,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') {
@@ -10827,7 +10431,6 @@
case 'images.4chan.org':
$.ready(function() {
var URL;
-
if (Conf['404 Redirect'] && ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) {
Redirect.init();
pathname = location.pathname.split('/');
@@ -10844,7 +10447,6 @@
}
init = function(features) {
var err, module, name;
-
for (name in features) {
module = features[name];
try {
@@ -10922,7 +10524,6 @@
},
initStyle: function() {
var mainStyleSheet, setStyle, style, styleSheets, _ref;
-
$.off(d, '4chanMainInit', Main.initStyle);
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return;
@@ -10932,6 +10533,7 @@
}
$.addClass(doc, 'gecko');
$.addClass(doc, 'fourchan-x');
+ $.addClass(doc, 'seaweedchan');
$.addClass(doc, g.VIEW);
$.addStyle(Main.css);
if (g.VIEW === 'catalog') {
@@ -10943,7 +10545,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];
@@ -10965,7 +10566,6 @@
},
initReady: function() {
var board, err, errors, href, passLink, postRoot, posts, styleSelector, thread, threadRoot, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) {
if (Conf['404 Redirect'] && g.VIEW === 'thread') {
href = Redirect.to('thread', {
@@ -11032,7 +10632,6 @@
},
callbackNodes: function(klass, nodes) {
var callback, err, errors, i, len, node, _i, _len, _ref;
-
len = nodes.length;
_ref = klass.prototype.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -11060,11 +10659,9 @@
},
callbackNodesDB: function(klass, nodes, cb) {
var errors, func, i, len, node, queue, softTask;
-
queue = [];
softTask = function() {
var args, func, task;
-
task = queue.shift();
func = task[0];
args = Array.prototype.slice.call(task, 1);
@@ -11083,7 +10680,6 @@
errors = null;
func = function(node, i) {
var callback, err, _i, _len, _ref;
-
_ref = klass.prototype.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
callback = _ref[_i];
@@ -11117,7 +10713,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);
@@ -11137,7 +10732,6 @@
},
handleErrors: function(errors) {
var div, error, logs, _i, _len;
-
if (!(errors instanceof Array)) {
error = errors;
} else if (errors.length === 1) {
@@ -11152,7 +10746,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', {
@@ -11166,7 +10759,6 @@
},
parseError: function(data) {
var error, message;
-
Main.logError(data);
message = $.el('div', {
textContent: data.message
@@ -11183,7 +10775,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 89c94910f..b4b5e1a17 100644
--- a/builds/crx/script.js
+++ b/builds/crx/script.js
@@ -329,7 +329,6 @@
Array.prototype.indexOf = function(object) {
var i;
-
i = this.length;
while (i--) {
if (this[i] === object) {
@@ -348,7 +347,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
if (!properties.hasOwnProperty(key)) {
@@ -366,7 +364,6 @@
$.ready = function(fc) {
var cb;
-
if (d.readyState !== 'loading') {
$.queueTask(fc);
return;
@@ -380,7 +377,6 @@
$.formData = function(form) {
var fd, key, val;
-
if (form instanceof HTMLFormElement) {
return new FormData(form);
}
@@ -400,7 +396,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
object[key] = val;
@@ -409,11 +404,9 @@
$.ajax = (function() {
var lastModified;
-
lastModified = {};
return function(url, options, extra) {
var form, r, sync, type, upCallbacks, whenModified;
-
if (extra == null) {
extra = {};
}
@@ -436,11 +429,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);
@@ -460,7 +451,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];
@@ -496,7 +486,6 @@
$.addStyle = function(css, id) {
var style;
-
style = $.el('style', {
id: id,
textContent: css
@@ -543,7 +532,6 @@
} else {
return function(el) {
var _ref;
-
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
};
}
@@ -551,7 +539,6 @@
$.rmAll = function(root) {
var node;
-
while (node = root.firstChild) {
root.removeChild(node);
}
@@ -567,7 +554,6 @@
$.nodes = function(nodes) {
var frag, node, _i, _len;
-
if (!(nodes instanceof Array)) {
return nodes;
}
@@ -601,7 +587,6 @@
$.el = function(tag, properties) {
var el;
-
el = d.createElement(tag);
if (properties) {
$.extend(el, properties);
@@ -611,7 +596,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];
@@ -621,7 +605,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];
@@ -645,7 +628,6 @@
$.debounce = function(wait, fn) {
var args, exec, lastCall, that, timeout;
-
lastCall = 0;
timeout = null;
that = null;
@@ -667,11 +649,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);
@@ -694,7 +674,6 @@
$.globalEval = function(code) {
var script;
-
script = $.el('script', {
textContent: code
});
@@ -704,7 +683,6 @@
$.bytesToString = function(size) {
var unit;
-
unit = 0;
while (size >= 1024) {
size /= 1024;
@@ -720,7 +698,6 @@
$.item = function(key, val) {
var item;
-
item = {};
item[key] = val;
return item;
@@ -731,7 +708,6 @@
$.sync = (function() {
chrome.storage.onChanged.addListener(function(changes) {
var cb, key;
-
for (key in changes) {
if (cb = $.syncing[key]) {
cb(changes[key].newValue);
@@ -751,7 +727,6 @@
$.get = function(key, val, cb) {
var count, done, items, localItems, syncItems;
-
if (typeof cb === 'function') {
items = $.item(key, val);
} else {
@@ -771,7 +746,6 @@
count = 0;
done = function(item) {
var lastError;
-
lastError = chrome.runtime.lastError;
if (lastError) {
c.error(lastError, lastError.message || 'No message.');
@@ -793,12 +767,10 @@
$.set = (function() {
var items, localItems, set;
-
items = {};
localItems = {};
set = $.debounce($.SECOND, function() {
var err, key, _i, _len, _ref;
-
_ref = $.localKeys;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
@@ -883,7 +855,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) {
@@ -959,7 +930,6 @@
Post.prototype.parseComment = function() {
var bq, i, node, nodes, text;
-
bq = this.nodes.comment.cloneNode(true);
nodes = $$('.abbr, .capcodeReplies, .exif, b', bq);
i = 0;
@@ -977,7 +947,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++) {
@@ -988,7 +957,6 @@
Post.prototype.parseQuote = function(quotelink) {
var fullID, match;
-
if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) {
return;
}
@@ -1004,7 +972,6 @@
Post.prototype.parseFile = function(that) {
var alt, anchor, fileEl, fileInfo, size, thumb, unit;
-
if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) {
return;
}
@@ -1036,7 +1003,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) {
@@ -1085,7 +1051,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');
@@ -1119,7 +1084,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++) {
@@ -1137,7 +1101,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'];
@@ -1225,7 +1188,6 @@
function DataBoard(key, sync, dontClean) {
var init,
_this = this;
-
this.key = key;
this.data = Conf[key];
$.sync(key, this.onSync.bind(this));
@@ -1248,7 +1210,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];
@@ -1269,7 +1230,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) {
@@ -1285,7 +1245,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;
@@ -1299,7 +1258,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) {
@@ -1323,7 +1281,6 @@
DataBoard.prototype.clean = function() {
var boardID, now, val, _ref;
-
_ref = this.data.boards;
for (boardID in _ref) {
val = _ref[boardID];
@@ -1343,10 +1300,8 @@
DataBoard.prototype.ajaxClean = function(boardID) {
var _this = this;
-
return $.cache("//api.4chan.org/" + boardID + "/threads.json", function(e) {
var board, page, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (e.target.status === 404) {
_this["delete"](boardID);
} else if (e.target.status === 200) {
@@ -1434,10 +1389,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);
@@ -1475,7 +1428,6 @@
init: function() {
var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton,
_this = this;
-
this.menu = new UI.Menu('header');
menuButton = $.el('span', {
className: 'menu-button',
@@ -1566,7 +1518,6 @@
});
return $.ready(function() {
var a, cs;
-
_this.footer = $.id('boardNavDesktopFoot');
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
a.className = 'current';
@@ -1600,7 +1551,6 @@
}),
setBoardList: function() {
var a, boardList, btn, fourchannav, fullBoardList;
-
fourchannav = $.id('boardNavDesktop');
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
a.className = 'current';
@@ -1622,7 +1572,6 @@
},
generateBoardList: function(text) {
var as, list, nodes;
-
list = $('#custom-board-list', Header.bar);
$.rmAll(list);
if (!text) {
@@ -1631,7 +1580,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);
}
@@ -1682,7 +1630,6 @@
},
toggleBoardList: function() {
var bar, custom, full, showBoardList;
-
bar = Header.bar;
custom = $('#custom-board-list', bar);
full = $('#full-board-list', bar);
@@ -1718,7 +1665,6 @@
},
toggleLinkJustify: function() {
var centered;
-
$.event('CloseMenu');
centered = this.nodeName === 'INPUT' ? this.checked : void 0;
Header.setLinkJustify(centered);
@@ -1748,7 +1694,6 @@
},
toggleBarVisibility: function(e) {
var hide, message;
-
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -1765,7 +1710,6 @@
},
toggleFooterVisibility: function() {
var hide, message;
-
$.event('CloseMenu');
hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden;
Header.setFooterVisibility(hide);
@@ -1775,7 +1719,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);
@@ -1788,14 +1731,12 @@
},
editCustomNav: function() {
var settings;
-
Settings.open('Advanced');
settings = $.id('fourchanx-settings');
return $('input[name=boardnav]', settings).focus();
},
hashScroll: function() {
var hash, post;
-
if (!((hash = this.location.hash.slice(1)) && (post = $.id(hash)))) {
return;
}
@@ -1806,7 +1747,6 @@
},
scrollToPost: function(post) {
var headRect, top;
-
top = post.getBoundingClientRect().top;
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
headRect = Header.bar.getBoundingClientRect();
@@ -1816,7 +1756,6 @@
},
addShortcut: function(el) {
var shortcut;
-
shortcut = $.el('span', {
className: 'shortcut brackets-wrap'
});
@@ -1828,7 +1767,6 @@
},
createNotification: function(e) {
var cb, content, lifetime, notif, type, _ref;
-
_ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb;
notif = new Notification(type, content, lifetime);
if (cb) {
@@ -1841,7 +1779,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);
@@ -1851,7 +1788,6 @@
},
postFromObject: function(data, boardID) {
var o;
-
o = {
postID: data.no,
threadID: data.resto || data.no,
@@ -1896,7 +1832,6 @@
*/
var a, boardID, capcode, capcodeClass, capcodeReplies, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, 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, capcodeReplies = o.capcodeReplies, file = o.file;
isOP = postID === threadID;
staticPath = '//static.4chan.org/image/';
@@ -1995,7 +1930,6 @@
},
capcodeReplies: function(_arg) {
var array, boardID, bq, capcodeReplies, capcodeType, generateCapcodeReplies, html, root, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, bq = _arg.bq, root = _arg.root, capcodeReplies = _arg.capcodeReplies;
if (!capcodeReplies) {
return;
@@ -2032,7 +1966,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) {
@@ -2048,7 +1981,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);
@@ -2068,7 +2000,6 @@
},
postDataFromLink: function(link) {
var boardID, path, postID, threadID, _ref;
-
if (link.hostname === 'boards.4chan.org') {
path = link.pathname.split('/');
boardID = path[1];
@@ -2086,7 +2017,6 @@
},
allQuotelinksLinkingTo: function(post) {
var ID, quote, quotedPost, quotelinks, quoterPost, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;
-
quotelinks = [];
_ref = g.posts;
for (ID in _ref) {
@@ -2115,14 +2045,12 @@
}
return quotelinks.filter(function(quotelink) {
var boardID, postID, _ref4;
-
_ref4 = Get.postDataFromLink(quotelink), boardID = _ref4.boardID, postID = _ref4.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;
@@ -2145,7 +2073,6 @@
},
insert: function(post, root, context) {
var clone, nodes;
-
if (!root.parentNode) {
return;
}
@@ -2159,7 +2086,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;
@@ -2213,7 +2139,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;
@@ -2308,10 +2233,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,
@@ -2351,7 +2274,6 @@
Menu.prototype.makeMenu = function() {
var menu;
-
menu = $.el('div', {
className: 'dialog',
id: 'menu',
@@ -2366,7 +2288,6 @@
Menu.prototype.toggle = function(e, button, data) {
var previousButton;
-
e.preventDefault();
e.stopPropagation();
if (currentMenu) {
@@ -2384,7 +2305,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;
@@ -2423,7 +2343,6 @@
Menu.prototype.insertEntry = function(entry, parent, data) {
var subEntry, submenu, _i, _len, _ref;
-
if (typeof entry.open === 'function') {
if (!entry.open(data)) {
return;
@@ -2457,7 +2376,6 @@
Menu.prototype.findNextEntry = function(entry, direction) {
var entries;
-
entries = __slice.call(entry.parentNode.children);
entries.sort(function(first, second) {
return +(first.style.order || first.style.webkitOrder) - +(second.style.order || second.style.webkitOrder);
@@ -2467,7 +2385,6 @@
Menu.prototype.keybinds = function(e) {
var entry, next, nextPrev, subEntry, submenu;
-
entry = $('.focused', currentMenu);
while (subEntry = $('.focused', entry)) {
entry = subEntry;
@@ -2513,7 +2430,6 @@
Menu.prototype.focus = function(entry) {
var cHeight, cWidth, eRect, focused, sRect, submenu, _i, _len, _ref;
-
while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
$.rmClass(focused, 'focused');
}
@@ -2548,7 +2464,6 @@
Menu.prototype.addEntry = function(e) {
var entry;
-
entry = e.detail;
if (entry.type !== this.type) {
return;
@@ -2559,7 +2474,6 @@
Menu.prototype.parseEntry = function(entry) {
var el, style, subEntries, subEntry, _i, _len;
-
el = entry.el, subEntries = entry.subEntries;
$.addClass(el, 'entry');
$.on(el, 'focus mouseover', (function(e) {
@@ -2583,7 +2497,6 @@
})();
dragstart = function(e) {
var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
-
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -2622,7 +2535,6 @@
};
touchmove = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -2634,7 +2546,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 + '%';
@@ -2650,7 +2561,6 @@
};
touchend = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -2672,7 +2582,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,
@@ -2701,7 +2610,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;
@@ -2744,7 +2652,6 @@
},
node: function() {
var email, name, tripcode, _ref;
-
if (this.info.capcode || this.isClone) {
return;
}
@@ -2771,7 +2678,6 @@
filters: {},
init: function() {
var boards, err, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4;
-
if (g.VIEW === 'catalog' || !Conf['Filter']) {
return;
}
@@ -2808,7 +2714,6 @@
op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'yes';
stub = (function() {
var _ref3;
-
switch ((_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0) {
case 'yes':
return true;
@@ -2839,7 +2744,6 @@
},
createFilter: function(regexp, op, stub, hl, top) {
var settings, test;
-
test = typeof regexp === 'string' ? function(value) {
return regexp === value;
} : function(value) {
@@ -2863,7 +2767,6 @@
},
node: function() {
var filter, firstThread, key, result, thisThread, value, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -2975,7 +2878,6 @@
menu: {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) {
return;
}
@@ -3001,7 +2903,6 @@
},
createSubEntry: function(text, type) {
var el;
-
el = $.el('a', {
href: 'javascript:;',
textContent: text
@@ -3012,7 +2913,6 @@
el: el,
open: function(post) {
var value;
-
value = Filter[type](post);
return value !== false;
}
@@ -3020,7 +2920,6 @@
},
makeFilter: function() {
var re, type, value;
-
type = this.dataset.type;
value = Filter[type](Filter.menu.post);
re = ['uniqueID', 'MD5'].contains(type) ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
@@ -3035,7 +2934,6 @@
re = ['uniqueID', 'MD5'].contains(type) ? "/" + 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);
@@ -3069,7 +2967,6 @@
},
node: function() {
var data;
-
if (!this.isReply || this.isClone) {
return;
}
@@ -3093,7 +2990,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub, replies, thisPost;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
return;
}
@@ -3164,7 +3060,6 @@
order: 20,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -3196,7 +3091,6 @@
order: 15,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -3213,7 +3107,6 @@
},
hide: function() {
var makeStub, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -3232,7 +3125,6 @@
},
show: function() {
var data, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -3256,7 +3148,6 @@
},
hideStub: function() {
var post;
-
post = PostHiding.menu.post;
post.nodes.root.hidden = true;
$.event('CloseMenu');
@@ -3264,7 +3155,6 @@
},
makeButton: function(post, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-reply-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -3275,7 +3165,6 @@
},
saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
var data;
-
data = {
boardID: post.board.ID,
threadID: post.thread.ID,
@@ -3294,14 +3183,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, button, postInfo, quotelink, _i, _len, _ref;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -3336,7 +3223,6 @@
},
show: function(post, showRecursively) {
var quotelink, _i, _len, _ref;
-
if (showRecursively == null) {
showRecursively = Conf['Recursive Hiding'];
}
@@ -3372,7 +3258,6 @@
},
node: function() {
var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.isClone) {
return;
}
@@ -3390,7 +3275,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: [],
@@ -3401,7 +3285,6 @@
},
rm: function(recursive, post) {
var i, obj, rec, _i, _len, _ref;
-
if (!(obj = Recursive.recursives[post.fullID])) {
return;
}
@@ -3416,7 +3299,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;
@@ -3443,7 +3325,6 @@
},
node: function() {
var data;
-
if (data = ThreadHiding.db.get({
boardID: this.board.ID,
threadID: this.ID
@@ -3457,7 +3338,6 @@
},
syncCatalog: function() {
var hiddenThreads, hiddenThreadsOnCatalog, threadID;
-
hiddenThreads = ThreadHiding.db.get({
boardID: g.BOARD.ID,
defaultValue: {}
@@ -3484,7 +3364,6 @@
cleanCatalog: function(hiddenThreadsOnCatalog) {
return $.cache("//api.4chan.org/" + g.BOARD + "/threads.json", function() {
var page, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.status !== 200) {
return;
}
@@ -3510,7 +3389,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub;
-
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
return;
}
@@ -3532,7 +3410,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || thread.isHidden) {
return false;
@@ -3562,7 +3439,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -3582,7 +3458,6 @@
order: 15,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -3593,7 +3468,6 @@
},
hide: function() {
var makeStub, thread;
-
makeStub = $('input', this.parentNode).checked;
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, makeStub);
@@ -3602,7 +3476,6 @@
},
show: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.show(thread);
ThreadHiding.saveHiddenState(thread);
@@ -3610,7 +3483,6 @@
},
hideStub: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, false);
$.event('CloseMenu');
@@ -3618,7 +3490,6 @@
},
makeButton: function(thread, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-thread-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -3630,7 +3501,6 @@
},
saveHiddenState: function(thread, makeStub) {
var hiddenThreadsOnCatalog;
-
hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
if (thread.isHidden) {
ThreadHiding.db.set({
@@ -3663,7 +3533,6 @@
},
hide: function(thread, makeStub) {
var OP, a, numReplies, opInfo, span, threadRoot;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -3687,7 +3556,6 @@
},
show: function(thread) {
var threadRoot;
-
if (thread.stub) {
$.rm(thread.stub);
delete thread.stub;
@@ -3700,7 +3568,6 @@
QuoteBacklink = {
init: function() {
var format;
-
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
return;
}
@@ -3718,7 +3585,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;
}
@@ -3756,7 +3622,6 @@
},
secondNode: function() {
var container;
-
if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
this.nodes.backlinkContainer = $('.container', this.nodes.info);
return;
@@ -3770,7 +3635,6 @@
},
getContainer: function(id) {
var _base;
-
return (_base = this.containers)[id] || (_base[id] = $.el('span', {
className: 'container'
}));
@@ -3793,7 +3657,6 @@
},
node: function() {
var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -3823,7 +3686,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];
@@ -3836,7 +3698,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];
@@ -3863,7 +3724,6 @@
},
toggle: function(e) {
var boardID, context, postID, threadID, _ref;
-
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -3889,7 +3749,6 @@
},
add: function(quotelink, boardID, threadID, postID, context) {
var inline, isBacklink, post, qroot, root;
-
isBacklink = $.hasClass(quotelink, 'backlink');
inline = $.el('div', {
id: "i" + postID,
@@ -3914,7 +3773,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);
@@ -3956,7 +3814,6 @@
},
node: function() {
var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -3999,7 +3856,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];
@@ -4008,7 +3864,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;
}
@@ -4052,7 +3907,6 @@
},
mouseout: function() {
var clone, post, root, _i, _len, _ref;
-
if (!(root = this.el.firstElementChild)) {
return;
}
@@ -4082,7 +3936,6 @@
},
node: function() {
var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone) {
return;
}
@@ -4105,7 +3958,6 @@
QuoteThreading = {
init: function() {
var input;
-
if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
return;
}
@@ -4128,7 +3980,6 @@
},
setup: function() {
var ID, post, posts;
-
$.off(d, '4chanXInitFinished', QuoteThreading.setup);
posts = g.posts;
for (ID in posts) {
@@ -4141,7 +3992,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;
}
@@ -4171,7 +4021,6 @@
},
nodeinsert: function() {
var bottom, height, qpost, qroot, threadContainer, top, _ref;
-
qpost = g.posts[this.threaded];
delete this.threaded;
delete this.cb;
@@ -4200,7 +4049,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;
@@ -4217,7 +4065,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;
@@ -4238,7 +4085,6 @@
},
kb: function() {
var control;
-
control = $.id('threadingControl');
return control.click();
}
@@ -4265,7 +4111,6 @@
},
node: function() {
var quotelink, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -4288,7 +4133,6 @@
cb: {
seek: function(type) {
var highlight, post, posts, result, str;
-
if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
@@ -4344,7 +4188,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];
@@ -4359,7 +4202,6 @@
},
parseDeadlink: function(deadlink) {
var a, boardID, m, post, postID, quote, quoteID, redirect, _ref;
-
if (deadlink.parentNode.className === 'prettyprint') {
Quotify.fixDeadlink(deadlink);
return;
@@ -4438,7 +4280,7 @@
if (g.VIEW === 'catalog' || !Conf['Linkify']) {
return;
}
- this.regString = /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|co\.jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly)|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i;
+ this.regString = /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|co\.jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly|info)|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i;
if (Conf['Comment Expansion']) {
ExpandComment.callbacks.push(this.node);
}
@@ -4452,7 +4294,6 @@
},
node: function() {
var data, el, end, endNode, i, index, items, length, link, links, node, range, result, saved, snapshot, space, test, _i, _len, _ref;
-
if (this.isClone) {
if (Conf['Embedding']) {
i = 0;
@@ -4531,7 +4372,6 @@
},
makeRange: function(startNode, endNode, startOffset, endOffset) {
var range;
-
range = document.createRange();
range.setStart(startNode, startOffset);
range.setEnd(endNode, endOffset);
@@ -4539,7 +4379,6 @@
},
makeLink: function(range) {
var a, char, i, text;
-
text = range.toString();
i = 0;
while (/[(\[{<>]/.test(text.charAt(i))) {
@@ -4583,7 +4422,6 @@
},
services: function(link) {
var href, key, match, type, _ref;
-
href = link.href;
_ref = Linkify.types;
for (key in _ref) {
@@ -4596,7 +4434,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', {
@@ -4625,7 +4462,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;
@@ -4662,21 +4498,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',
@@ -4689,7 +4522,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) {
@@ -4729,7 +4561,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"
});
@@ -4740,7 +4571,6 @@
},
text: function(_arg) {
var file, files;
-
files = _arg.files;
for (file in files) {
if (files.hasOwnProperty(file)) {
@@ -4788,7 +4618,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
});
@@ -4799,7 +4628,6 @@
style: 'height: auto; width: 500px; display: inline-block;',
el: function(a) {
var div;
-
div = $.el('div', {
className: "soundcloud",
name: "soundcloud"
@@ -4825,7 +4653,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', {
@@ -4897,7 +4724,6 @@
QR = {
init: function() {
var sc;
-
if (!Conf['Quick Reply']) {
return;
}
@@ -4944,7 +4770,6 @@
},
initReady: function() {
var link;
-
QR.postingIsEnabled = !!$.id('postForm');
if (!QR.postingIsEnabled) {
return;
@@ -4964,13 +4789,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);
});
@@ -5000,7 +4823,6 @@
},
open: function() {
var err;
-
if (QR.nodes) {
QR.nodes.el.hidden = false;
QR.unhide();
@@ -5019,7 +4841,6 @@
},
close: function() {
var post, _i, _len, _ref;
-
if (QR.req) {
QR.abort();
return;
@@ -5067,7 +4888,6 @@
},
error: function(err) {
var el;
-
QR.open();
if (typeof err === 'string') {
el = $.tn(err);
@@ -5095,7 +4915,6 @@
notifications: [],
cleanNotifications: function() {
var notification, _i, _len, _ref;
-
_ref = QR.notifications;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
notification = _ref[_i];
@@ -5105,7 +4924,6 @@
},
status: function() {
var disabled, status, thread, value;
-
if (!QR.nodes) {
return;
}
@@ -5127,7 +4945,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: [],
@@ -5147,7 +4964,6 @@
},
parseItem: function(item, types) {
var boards, match, type, val, _ref, _ref1;
-
if (item[0] === '#') {
return;
}
@@ -5176,7 +4992,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];
@@ -5189,7 +5004,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;
}
@@ -5198,7 +5012,6 @@
get: function(cb) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
return cb(persona);
});
@@ -5206,7 +5019,6 @@
set: function(post) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
persona = {
name: post.name,
@@ -5220,7 +5032,6 @@
cooldown: {
init: function() {
var board;
-
if (!Conf['Cooldown']) {
return;
}
@@ -5262,7 +5073,6 @@
},
sync: function(cooldowns) {
var id;
-
for (id in cooldowns) {
QR.cooldown.cooldowns[id] = cooldowns[id];
}
@@ -5270,7 +5080,6 @@
},
set: function(data) {
var cooldown, delay, hasFile, isReply, isSage, post, req, start, type, upSpd;
-
if (!Conf['Cooldown']) {
return;
}
@@ -5310,7 +5119,6 @@
},
count: function() {
var cooldown, cooldowns, elapsed, hasFile, isReply, isSage, 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;
@@ -5364,7 +5172,6 @@
},
quote: function(e) {
var caretPos, com, index, post, range, s, sel, text, thread, _ref;
-
if (e != null) {
e.preventDefault();
}
@@ -5402,7 +5209,6 @@
},
characterCount: function() {
var count, counter;
-
counter = QR.nodes.charCount;
count = QR.nodes.com.textLength;
counter.textContent = count;
@@ -5411,7 +5217,6 @@
},
drag: function(e) {
var toggle;
-
toggle = e.type === 'dragstart' ? $.off : $.on;
toggle(d, 'dragover', QR.dragOver);
return toggle(d, 'drop', QR.dropFile);
@@ -5431,7 +5236,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++) {
@@ -5459,7 +5263,6 @@
},
fileInput: function(files) {
var file, length, max, post, _i, _len;
-
if (files instanceof Event) {
files = __slice.call(this.files);
QR.nodes.fileInput.value = null;
@@ -5508,7 +5311,6 @@
function _Class(select) {
var el, event, prev, _i, _len, _ref,
_this = this;
-
el = $.el('a', {
className: 'qr-preview',
draggable: true,
@@ -5562,7 +5364,6 @@
_Class.prototype.rm = function() {
var index;
-
this["delete"]();
index = QR.posts.indexOf(this);
if (QR.posts.length === 1) {
@@ -5582,7 +5383,6 @@
_Class.prototype.lock = function(lock) {
var name, _i, _len, _ref;
-
if (lock == null) {
lock = true;
}
@@ -5607,7 +5407,6 @@
_Class.prototype.select = function() {
var rectEl, rectList;
-
if (QR.selected) {
QR.selected.nodes.el.id = null;
QR.selected.forceSave();
@@ -5624,7 +5423,6 @@
_Class.prototype.load = function() {
var name, _i, _len, _ref;
-
_ref = ['thread', 'name', 'email', 'sub', 'com'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
name = _ref[_i];
@@ -5636,7 +5434,6 @@
_Class.prototype.save = function(input) {
var name, _ref;
-
if (input.type === 'checkbox') {
this.spoiler = input.checked;
return;
@@ -5657,7 +5454,6 @@
_Class.prototype.forceSave = function() {
var name, _i, _len, _ref;
-
if (this !== QR.selected) {
return;
}
@@ -5687,11 +5483,9 @@
_Class.prototype.setThumbnail = function() {
var fileURL, img,
_this = this;
-
img = $.el('img');
img.onload = function() {
var cv, height, s, width;
-
s = 90 * 2;
if (_this.file.type === 'image/gif') {
s *= 3;
@@ -5749,11 +5543,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;
@@ -5791,7 +5583,6 @@
_Class.prototype.drop = function() {
var el, index, newIndex, oldIndex, post;
-
$.rmClass(this, 'over');
if (!this.draggable) {
return;
@@ -5826,7 +5617,6 @@
ready: function() {
var imgContainer, input, setLifetime,
_this = this;
-
setLifetime = function(e) {
return _this.lifetime = e.detail;
};
@@ -5863,7 +5653,6 @@
});
$.get('captchas', [], function(_arg) {
var captchas;
-
captchas = _arg.captchas;
return _this.sync(captchas);
});
@@ -5878,7 +5667,6 @@
},
getOne: function() {
var captcha, challenge, response;
-
this.clear();
if (captcha = this.captchas.shift()) {
challenge = captcha.challenge, response = captcha.response;
@@ -5903,7 +5691,6 @@
},
save: function() {
var response;
-
if (!(response = this.nodes.input.value.trim())) {
return;
}
@@ -5918,7 +5705,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) {
@@ -5936,7 +5722,6 @@
},
load: function() {
var challenge;
-
if (!this.nodes.challenge.firstChild) {
return;
}
@@ -5949,7 +5734,6 @@
},
count: function() {
var count;
-
count = this.captchas.length;
this.nodes.input.placeholder = (function() {
switch (count) {
@@ -5982,7 +5766,6 @@
},
dialog: function() {
var dialog, i, items, mimeTypes, name, nodes, thread;
-
dialog = UI.dialog('qr', 'top:0;right:0;', " ");
QR.nodes = nodes = {
el: dialog,
@@ -6084,7 +5867,6 @@
preSubmitHooks: [],
submit: function(e) {
var challenge, err, extra, filetag, hook, options, post, postData, response, textOnly, thread, threadID, _i, _len, _ref, _ref1;
-
if (e != null) {
e.preventDefault();
}
@@ -6198,7 +5980,6 @@
},
response: function() {
var URL, ban, board, err, h1, isReply, m, post, postID, req, resDoc, threadID, _, _ref, _ref1;
-
req = QR.req;
delete QR.req;
post = QR.posts[0];
@@ -6296,7 +6077,6 @@
FappeTyme = {
init: function() {
var el, input;
-
if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') {
return;
}
@@ -6348,7 +6128,6 @@
},
node: function() {
var thumb, _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6373,7 +6152,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';
@@ -6407,7 +6185,6 @@
},
toggle: function(post) {
var headRect, rect, root, thumb, x, y;
-
thumb = post.file.thumb;
if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) {
ImageExpand.expand(post);
@@ -6417,7 +6194,6 @@
root = post.nodes.root;
rect = (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) {
@@ -6448,7 +6224,6 @@
},
expand: function(post, src) {
var img, thumb;
-
thumb = post.file.thumb;
if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) {
return;
@@ -6476,7 +6251,6 @@
},
completeExpand: function(post) {
var prev, thumb;
-
thumb = post.file.thumb;
if (!$.hasClass(thumb, 'expanding')) {
return;
@@ -6490,7 +6264,6 @@
prev = post.nodes.root.getBoundingClientRect();
return $.queueTask(function() {
var curr;
-
$.addClass(post.nodes.root, 'expanded-image');
$.rmClass(post.file.thumb, 'expanding');
if (!(prev.top + prev.height <= 0)) {
@@ -6502,7 +6275,6 @@
},
error: function() {
var URL, post, src, timeoutID;
-
post = Get.postFromNode(this);
$.rm(this);
delete post.file.fullImage;
@@ -6528,7 +6300,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -6552,7 +6323,6 @@
menu: {
init: function() {
var conf, createSubEntry, el, name, subEntries, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Image Expansion']) {
return;
}
@@ -6576,7 +6346,6 @@
},
createSubEntry: function(name, desc) {
var input, label;
-
label = $.el('label', {
innerHTML: " " + name,
title: desc
@@ -6610,7 +6379,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6618,7 +6386,6 @@
},
mouseover: function(e) {
var el, post;
-
post = Get.postFromNode(this);
el = $.el('img', {
id: 'ihover',
@@ -6640,7 +6407,6 @@
error: function() {
var URL, post, src, timeoutID,
_this = this;
-
if (!doc.contains(this)) {
return;
}
@@ -6665,7 +6431,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -6691,7 +6456,6 @@
ImageLoader = {
init: function() {
var prefetch;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -6718,7 +6482,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;
}
@@ -6740,7 +6503,6 @@
},
toggle: function() {
var enabled, id, post, _ref;
-
enabled = Conf['prefetch'] = this.checked;
if (enabled) {
_ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts;
@@ -6764,7 +6526,6 @@
},
node: function() {
var thumb, _ref;
-
if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) {
return;
}
@@ -6777,7 +6538,6 @@
Sauce = {
init: function() {
var err, link, links, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Sauce']) {
return;
}
@@ -6807,7 +6567,6 @@
},
createSauceLink: function(link) {
var m, text;
-
link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) {
switch (parameter) {
case '%TURL':
@@ -6828,7 +6587,6 @@
},
node: function() {
var link, nodes, _i, _len, _ref;
-
if (this.isClone || !this.file) {
return;
}
@@ -6845,7 +6603,6 @@
ArchiveLink = {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) {
return;
}
@@ -6858,7 +6615,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,
@@ -6877,14 +6633,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,
@@ -6894,7 +6648,6 @@
return true;
} : function(post) {
var value;
-
value = Filter[type](post);
if (!value) {
return false;
@@ -6917,7 +6670,6 @@
DeleteLink = {
init: function() {
var div, fileEl, fileEntry, postEl, postEntry;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) {
return;
}
@@ -6945,7 +6697,6 @@
el: fileEl,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file || file.isDead) {
return false;
@@ -6961,7 +6712,6 @@
order: 40,
open: function(post) {
var node;
-
if (post.isDead || post.board.ID === 'q') {
return false;
}
@@ -6976,7 +6726,6 @@
},
"delete": function() {
var fileOnly, form, link, post;
-
post = DeleteLink.post;
if (DeleteLink.cooldown.counting === post) {
return;
@@ -7006,7 +6755,6 @@
},
load: function(link, post, fileOnly, resDoc) {
var msg, s;
-
if (resDoc.title === '4chan - Banned') {
s = 'Banned!';
} else if (msg = resDoc.getElementById('errmsg')) {
@@ -7027,7 +6775,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,
@@ -7061,7 +6808,6 @@
DownloadLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) {
return;
}
@@ -7075,7 +6821,6 @@
order: 100,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file) {
return false;
@@ -7108,7 +6853,6 @@
},
makeButton: (function() {
var a;
-
a = $.el('a', {
className: 'menu-button brackets-wrap',
innerHTML: '',
@@ -7116,7 +6860,6 @@
});
return function() {
var button;
-
button = a.cloneNode(true);
$.on(button, 'click', Menu.toggle);
return button;
@@ -7124,7 +6867,6 @@
})(),
toggle: function(e) {
var post;
-
post = Get.postFromNode(this);
return Menu.menu.toggle(e, this, post);
}
@@ -7133,7 +6875,6 @@
ReportLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) {
return;
}
@@ -7155,7 +6896,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();
@@ -7168,7 +6908,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;
@@ -7241,7 +6980,6 @@
init: function() {
var sc,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
return;
}
@@ -7270,7 +7008,6 @@
},
node: function() {
var ID, fileCount, post, postCount, _ref;
-
postCount = 0;
fileCount = 0;
_ref = this.posts;
@@ -7288,7 +7025,6 @@
},
onUpdate: function(e) {
var fileCount, postCount, _ref;
-
if (e.detail[404]) {
return;
}
@@ -7297,7 +7033,6 @@
},
update: function(postCount, fileCount) {
var fileCountEl, postCountEl, thread;
-
thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl;
postCountEl.textContent = postCount;
fileCountEl.textContent = fileCount;
@@ -7322,7 +7057,6 @@
},
onThreadsLoad: function() {
var page, pages, thread, _i, _j, _len, _len1, _ref;
-
if (!(Conf["Page Count in Stats"] && this.status === 200)) {
return;
}
@@ -7346,7 +7080,6 @@
init: function() {
var checked, conf, el, input, name, sc, settings, subEntries, _ref,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
return;
}
@@ -7496,7 +7229,6 @@
},
interval: function() {
var val;
-
val = +this.value;
if (val < 1) {
val = 1;
@@ -7506,7 +7238,6 @@
},
load: function() {
var klass, req, text, _ref;
-
req = ThreadUpdater.req;
switch (req.status) {
case 200:
@@ -7539,7 +7270,6 @@
},
getInterval: function() {
var i, j;
-
i = ThreadUpdater.interval;
j = Math.min(ThreadUpdater.outdateCount, 10);
if (!d.hidden) {
@@ -7549,14 +7279,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;
@@ -7569,7 +7297,6 @@
},
timeout: function() {
var n;
-
ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
if (!(n = --ThreadUpdater.seconds)) {
return ThreadUpdater.update();
@@ -7582,7 +7309,6 @@
},
update: function() {
var url;
-
if (!ThreadUpdater.online) {
return;
}
@@ -7605,7 +7331,6 @@
},
updateThreadStatus: function(title, OP) {
var icon, message, root, titleLC;
-
titleLC = title.toLowerCase();
if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) {
return;
@@ -7632,7 +7357,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);
@@ -7718,7 +7442,6 @@
}
$.queueTask(function() {
var length, threadID;
-
threadID = ThreadUpdater.thread.ID;
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
return Fourchan.parseThread(threadID, length - count, length);
@@ -7739,7 +7462,6 @@
ThreadWatcher = {
init: function() {
var now, sc;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -7772,7 +7494,6 @@
}
$.get('WatchedThreads', null, function(_arg) {
var WatchedThreads, boardID, data, threadID, threads, _ref;
-
WatchedThreads = _arg.WatchedThreads;
if (!WatchedThreads) {
return;
@@ -7798,7 +7519,6 @@
},
node: function() {
var toggler;
-
toggler = $.el('img', {
className: 'watch-thread-link'
});
@@ -7820,7 +7540,6 @@
}
return $.get('AutoWatch', 0, function(_arg) {
var AutoWatch, thread;
-
AutoWatch = _arg.AutoWatch;
if (!(thread = g.BOARD.threads[AutoWatch])) {
return;
@@ -7836,7 +7555,6 @@
cb: {
openAll: function() {
var a, _i, _len, _ref;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -7855,7 +7573,6 @@
},
pruneDeads: function() {
var boardID, data, threadID, _i, _len, _ref, _ref1;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -7879,13 +7596,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']) {
@@ -7897,7 +7612,6 @@
},
threadUpdate: function(e) {
var thread;
-
thread = e.detail.thread;
if (!(e.detail[404] && ThreadWatcher.db.get({
boardID: thread.board.ID,
@@ -7914,7 +7628,6 @@
},
fetchAllStatus: function() {
var thread, threads, _i, _len;
-
if (!(threads = ThreadWatcher.getAll()).length) {
return;
}
@@ -7926,7 +7639,6 @@
},
fetchStatus: function(_arg) {
var boardID, data, fetchCount, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
if (data.isDead) {
return;
@@ -7936,7 +7648,6 @@
return $.ajax("//api.4chan.org/" + boardID + "/res/" + threadID + ".json", {
onloadend: function() {
var status;
-
fetchCount.fetched++;
if (fetchCount.fetched === fetchCount.fetching) {
fetchCount.fetched = 0;
@@ -7967,7 +7678,6 @@
},
getAll: function() {
var all, boardID, data, threadID, threads, _ref;
-
all = [];
_ref = ThreadWatcher.db.data.boards;
for (boardID in _ref) {
@@ -7988,7 +7698,6 @@
},
makeLine: function(boardID, threadID, data) {
var div, fullID, href, link, x;
-
x = $.el('a', {
textContent: '×',
href: 'javascript:;'
@@ -8019,7 +7728,6 @@
},
refresh: function() {
var boardID, data, 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++) {
@@ -8047,7 +7755,6 @@
},
toggle: function(thread) {
var boardID, threadID;
-
boardID = thread.board.ID;
threadID = thread.ID;
if (ThreadWatcher.db.get({
@@ -8061,7 +7768,6 @@
},
add: function(thread) {
var boardID, data, threadID;
-
data = {};
boardID = thread.board.ID;
threadID = thread.ID;
@@ -8092,7 +7798,6 @@
},
convert: function(oldFormat) {
var boardID, data, newFormat, threadID, threads;
-
newFormat = {};
for (boardID in oldFormat) {
threads = oldFormat[boardID];
@@ -8109,7 +7814,6 @@
refreshers: [],
init: function() {
var menu;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -8122,7 +7826,6 @@
},
addHeaderMenuEntry: function() {
var entryEl;
-
if (g.VIEW !== 'thread') {
return;
}
@@ -8139,7 +7842,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);
@@ -8148,7 +7850,6 @@
},
addMenuEntries: function() {
var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1, _results;
-
entries = [];
entries.push({
cb: ThreadWatcher.cb.openAll,
@@ -8219,7 +7920,6 @@
},
createSubEntry: function(name, desc) {
var entry, input;
-
entry = {
type: 'thread watcher',
el: $.el('label', {
@@ -8271,7 +7971,6 @@
},
ready: function() {
var ID, post, posts, _ref;
-
$.off(d, '4chanXInitFinished', Unread.ready);
posts = [];
_ref = Unread.thread.posts;
@@ -8288,7 +7987,6 @@
},
scroll: function() {
var checkPosition, hash, onload, post, posts, root;
-
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
return;
}
@@ -8318,7 +8016,6 @@
}
checkPosition = function(target) {
var height, top, _ref;
-
_ref = target.getBoundingClientRect(), top = _ref.top, height = _ref.height;
return top + height - doc.clientHeight > 0;
};
@@ -8326,7 +8023,6 @@
},
sync: function() {
var lastReadPost;
-
lastReadPost = Unread.db.get({
boardID: Unread.thread.board.ID,
threadID: Unread.thread.ID,
@@ -8343,7 +8039,6 @@
},
addPosts: function(posts) {
var ID, data, post, _i, _len;
-
for (_i = 0, _len = posts.length; _i < _len; _i++) {
post = posts[_i];
ID = post.ID;
@@ -8371,7 +8066,6 @@
},
addPostQuotingYou: function(post) {
var quotelink, _i, _len, _ref;
-
if (!QR.db) {
return;
}
@@ -8392,7 +8086,6 @@
},
readSinglePost: function(post) {
var i;
-
if ((i = Unread.posts.indexOf(post)) === -1) {
return;
}
@@ -8408,7 +8101,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) {
@@ -8419,7 +8111,6 @@
},
read: $.debounce(50, function(e) {
var ID, bottom, height, i, post, posts;
-
if (d.hidden || !Unread.posts.length) {
return;
}
@@ -8475,7 +8166,6 @@
}),
setLine: function(force) {
var post, root;
-
if (!(d.hidden || force === true)) {
return;
}
@@ -8490,7 +8180,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);
@@ -8516,7 +8205,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];
@@ -8648,7 +8336,6 @@
},
to: function(dest, data) {
var archive;
-
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
if (!archive) {
return '';
@@ -8657,7 +8344,6 @@
},
protocol: function(archive) {
var protocol;
-
protocol = location.protocol;
if (!archive[protocol.slice(0, -1)]) {
protocol = protocol === 'https:' ? 'http:' : 'https:';
@@ -8666,7 +8352,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') {
@@ -8679,7 +8364,6 @@
},
post: function(archive, _arg) {
var URL, boardID, postID, protocol;
-
boardID = _arg.boardID, postID = _arg.postID;
protocol = Redirect.protocol(archive);
if (['Foolz', 'NSFW Foolz'].contains(archive.name)) {
@@ -8691,13 +8375,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);
@@ -8716,7 +8398,6 @@
},
setup: function() {
var btn, entry, psa;
-
$.off(d, '4chanXInitFinished', PSAHiding.setup);
if (!(psa = $.id('globalMessage'))) {
$.rmClass(doc, 'hide-announcement');
@@ -8745,7 +8426,6 @@
$.on(btn, 'click', PSAHiding.toggle);
$.get('hiddenPSA', 0, function(_arg) {
var hiddenPSA;
-
hiddenPSA = _arg.hiddenPSA;
PSAHiding.sync(hiddenPSA);
$.before(psa, btn);
@@ -8755,7 +8435,6 @@
},
toggle: function(e) {
var UTC;
-
if ($.hasClass(this, 'hide-announcement')) {
UTC = +$.id('globalMessage').dataset.utc;
$.set('hiddenPSA', UTC);
@@ -8767,7 +8446,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') {
@@ -8779,7 +8457,6 @@
CatalogLinks = {
init: function() {
var el, input;
-
if (!Conf['Catalog Links']) {
return;
}
@@ -8803,14 +8480,12 @@
},
toggle: function() {
var useCatalog;
-
$.event('CloseMenu');
$.set('Header catalog links', useCatalog = this.checked);
return CatalogLinks.set(useCatalog);
},
set: function(useCatalog) {
var a, board, path, _i, _len, _ref;
-
path = useCatalog ? 'catalog' : '';
_ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -8844,7 +8519,6 @@
},
node: function() {
var str, uid;
-
if (this.isClone || !(str = this.info.uniqueID)) {
return;
}
@@ -8857,7 +8531,6 @@
ids: {},
compute: function(str) {
var hash, rgb;
-
hash = IDColor.hash(str);
rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125;
@@ -8869,7 +8542,6 @@
},
hash: function(str) {
var i, j, msg;
-
msg = 0;
i = 0;
j = str.length;
@@ -8917,7 +8589,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;
}
@@ -8929,7 +8600,6 @@
Emoji = {
init: function() {
var css, icon, name, pos, _ref;
-
if (!Conf['Emoji']) {
return;
}
@@ -8999,7 +8669,6 @@
},
node: function() {
var a;
-
if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
return $.on(a, 'click', ExpandComment.cb);
}
@@ -9011,7 +8680,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;
@@ -9027,7 +8695,6 @@
},
contract: function(post) {
var a;
-
if (!post.nodes.shortComment) {
return;
}
@@ -9038,7 +8705,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 (![200, 304].contains(status)) {
a.textContent = "Error " + req.statusText + " (" + status + ")";
@@ -9101,7 +8767,6 @@
},
node: function() {
var a, files, posts, span, _ref;
-
if (!(span = $.x('following-sibling::span[contains(@class,"summary")][1]', this.OP.nodes.root))) {
return;
}
@@ -9122,7 +8787,6 @@
},
toggle: function(thread) {
var a, files, filesCount, inlined, num, post, posts, postsCount, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4;
-
threadRoot = thread.OP.nodes.root.parentNode;
a = $('.summary', threadRoot);
switch (thread.isExpanded) {
@@ -9200,7 +8864,6 @@
},
parse: function(req, thread, a) {
var filesCount, link, post, posts, postsCount, postsObj, postsRoot, reply, root, spoilerRange, _i, _len;
-
if (a.textContent[0] === '+') {
return;
}
@@ -9264,7 +8927,6 @@
},
createFunc: function(format) {
var code;
-
code = format.replace(/%(.)/g, function(s, c) {
if (c in FileInfo.formatters) {
return "' + FileInfo.formatters." + c + ".call(post) + '";
@@ -9276,7 +8938,6 @@
},
convertUnit: function(size, unit) {
var i;
-
if (unit === 'B') {
return "" + (size.toFixed()) + " Bytes";
}
@@ -9307,7 +8968,6 @@
},
n: function() {
var fullname, shortname;
-
fullname = this.file.name;
shortname = Build.shortFilename(this.file.name, this.isReply);
if (fullname === shortname) {
@@ -9351,7 +9011,6 @@
Fourchan = {
init: function() {
var board;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -9373,7 +9032,6 @@
},
code: function() {
var pre, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -9403,13 +9061,11 @@
Keybinds = {
init: function() {
var init;
-
if (g.VIEW === 'catalog' || !Conf['Keybinds']) {
return;
}
init = function() {
var node, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', init);
$.on(d, 'keydown', Keybinds.keydown);
_ref = $$('[accesskey]');
@@ -9422,7 +9078,6 @@
},
keydown: function(e) {
var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -9603,7 +9258,6 @@
},
keyCode: function(e) {
var kc, key;
-
key = (function() {
switch (kc = e.keyCode) {
case 8:
@@ -9659,7 +9313,6 @@
},
tags: function(tag, ta) {
var range, selEnd, selStart, value;
-
value = ta.value;
selStart = ta.selectionStart;
selEnd = ta.selectionEnd;
@@ -9670,13 +9323,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 {
@@ -9686,7 +9337,6 @@
},
open: function(thread, tab) {
var url;
-
if (g.VIEW !== 'index') {
return;
}
@@ -9699,7 +9349,6 @@
},
hl: function(delta, thread) {
var axe, headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len;
-
if (!delta) {
if (postEl = $('.reply.highlight', thread)) {
$.rmClass(postEl, 'highlight');
@@ -9759,7 +9408,6 @@
Nav = {
init: function() {
var append, next, prev, span;
-
switch (g.VIEW) {
case 'index':
if (!Conf['Index Navigation']) {
@@ -9810,7 +9458,6 @@
},
getThread: function(full) {
var headRect, i, rect, thread, threads, topMargin, _i, _len;
-
if (Conf['Bottom header'] || !Conf['Fixed Header']) {
topMargin = 0;
} else {
@@ -9836,7 +9483,6 @@
},
scroll: function(delta) {
var i, rect, thread, threads, top, topMargin, _ref, _ref1;
-
_ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4];
top = rect.top - topMargin;
if ((delta === -1 && top > -5) || (delta === +1 && top < 5)) {
@@ -9861,7 +9507,6 @@
},
node: function() {
var dateEl;
-
if (this.isClone) {
return;
}
@@ -9871,7 +9516,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) {
@@ -9882,7 +9526,6 @@
stale: [],
flush: function() {
var now, update, _i, _len, _ref;
-
if (d.hidden) {
return;
}
@@ -9898,16 +9541,13 @@
},
setUpdate: function(post) {
var markStale, setOwnTimeout, update;
-
setOwnTimeout = function(diff) {
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(markStale, delay);
};
update = function(now) {
var date, diff, relative, singlePost, _i, _len, _ref;
-
date = post.info.date;
diff = now - date;
relative = RelativeDates.relative(diff, now, date);
@@ -9948,7 +9588,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];
@@ -9968,7 +9607,6 @@
},
ready: function() {
var field;
-
field = $.id('recaptcha_response_field');
$.on(field, 'keydown', function(e) {
if (e.keyCode === 8 && !field.value) {
@@ -9977,7 +9615,6 @@
});
return $.on($('form'), 'submit', function(e) {
var response;
-
e.preventDefault();
response = field.value.trim();
if (!/\s/.test(response)) {
@@ -10007,7 +9644,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) + '";
@@ -10092,7 +9728,6 @@
Settings = {
init: function() {
var link, settings;
-
link = $.el('a', {
className: 'settings-link',
textContent: 'Settings',
@@ -10102,7 +9737,6 @@
Header.addShortcut(link);
$.get('previousversion', null, function(item) {
var changelog, el, previous;
-
if (previous = item['previousversion']) {
if (previous === g.VERSION) {
return;
@@ -10140,7 +9774,6 @@
},
open: function(openSection) {
var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', Settings.open);
if (Settings.dialog) {
return;
@@ -10193,7 +9826,6 @@
sections: [],
addSection: function(title, open) {
var hyphenatedTitle, _ref;
-
if (typeof title !== 'string') {
_ref = title.detail, title = _ref.title, open = _ref.open;
}
@@ -10206,7 +9838,6 @@
},
openSection: function() {
var section, selected;
-
if (selected = $('.tab-selected', Settings.dialog)) {
$.rmClass(selected, 'tab-selected');
}
@@ -10220,7 +9851,6 @@
},
main: function(section) {
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref;
-
items = {};
inputs = {};
_ref = Config.main;
@@ -10245,7 +9875,6 @@
}
$.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].checked = val;
@@ -10260,7 +9889,6 @@
boards: {}
}, function(item) {
var ID, board, thread, _ref1;
-
_ref1 = item.hiddenThreads.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -10275,7 +9903,6 @@
boards: {}
}, function(item) {
var ID, board, post, thread, _ref1;
-
_ref1 = item.hiddenPosts.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -10295,7 +9922,6 @@
boards: {}
}, function(item) {
var boardID;
-
for (boardID in item.hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
@@ -10306,7 +9932,6 @@
},
"export": function(now, data) {
var a, db, _i, _len;
-
if (typeof now !== 'number') {
now = Date.now();
data = {
@@ -10340,7 +9965,6 @@
},
onImport: function() {
var file, output, reader;
-
if (!(file = this.files[0])) {
return;
}
@@ -10352,7 +9976,6 @@
reader = new FileReader();
reader.onload = function(e) {
var data, err;
-
try {
data = JSON.parse(e.target.result);
Settings.loadSettings(data);
@@ -10369,7 +9992,6 @@
},
loadSettings: function(data) {
var key, val, version, _ref;
-
version = data.version.split('.');
if (version[0] === '2') {
data = Settings.convertSettings(data, {
@@ -10457,7 +10079,6 @@
},
convertSettings: function(data, map) {
var newKey, prevKey;
-
for (prevKey in map) {
newKey = map[prevKey];
if (newKey) {
@@ -10469,7 +10090,6 @@
},
filter: function(section) {
var select;
-
section.innerHTML = "";
select = $('select', section);
$.on(select, 'change', Settings.selectFilter);
@@ -10477,7 +10097,6 @@
},
selectFilter: function() {
var div, name, ta;
-
div = this.nextElementSibling;
if ((name = this.value) !== 'guide') {
$.rmAll(div);
@@ -10497,7 +10116,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:\n%TURL: Thumbnail URL.%URL: Full image URL.%MD5: MD5 hash.%board: Current board.
";
ta = $('textarea', section);
$.get('sauces', Conf['sauces'], function(item) {
@@ -10507,7 +10125,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 = {};
@@ -10527,7 +10144,6 @@
$.on(ta, 'change', $.cb.value);
$.get(items, function(items) {
var key, val;
-
for (key in items) {
val = items[key];
if (['emojiPos'].contains(key)) {
@@ -10598,7 +10214,6 @@
});
$.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
var option, selectedArchives, type;
-
selectedArchives = _arg.selectedArchives;
for (boardID in selectedArchives) {
data = selectedArchives[boardID];
@@ -10613,7 +10228,6 @@
},
addArchiveCell: function(boardID, data, type) {
var archive, i, length, options, select, td;
-
length = data[type].length;
td = $.el('td', {
className: 'archive-cell'
@@ -10643,10 +10257,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);
@@ -10657,7 +10269,6 @@
},
time: function() {
var funk;
-
funk = Time.createFunc(this.value);
return this.nextElementSibling.textContent = funk(Time, new Date());
},
@@ -10666,7 +10277,6 @@
},
fileInfo: function() {
var data, funk;
-
data = {
isReply: true,
file: {
@@ -10705,7 +10315,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 = {};
@@ -10726,7 +10335,6 @@
}
return $.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].value = val;
@@ -10735,7 +10343,6 @@
},
keybind: function(e) {
var key;
-
if (e.keyCode === 9) {
return;
}
@@ -10752,10 +10359,8 @@
Main = {
init: function() {
var db, flatten, _i, _len;
-
flatten = function(parent, obj) {
var key, val;
-
if (obj instanceof Array) {
Conf[parent] = obj[0];
} else if (typeof obj === 'object') {
@@ -10796,7 +10401,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') {
@@ -10824,7 +10428,6 @@
case 'images.4chan.org':
$.ready(function() {
var URL;
-
if (Conf['404 Redirect'] && ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) {
Redirect.init();
pathname = location.pathname.split('/');
@@ -10841,7 +10444,6 @@
}
init = function(features) {
var err, module, name;
-
for (name in features) {
module = features[name];
try {
@@ -10919,7 +10521,6 @@
},
initStyle: function() {
var mainStyleSheet, setStyle, style, styleSheets, _ref;
-
$.off(d, '4chanMainInit', Main.initStyle);
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return;
@@ -10929,6 +10530,7 @@
}
$.addClass(doc, 'blink');
$.addClass(doc, 'fourchan-x');
+ $.addClass(doc, 'seaweedchan');
$.addClass(doc, g.VIEW);
$.addStyle(Main.css);
if (g.VIEW === 'catalog') {
@@ -10940,7 +10542,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];
@@ -10962,7 +10563,6 @@
},
initReady: function() {
var board, err, errors, href, passLink, postRoot, posts, styleSelector, thread, threadRoot, threads, _i, _j, _len, _len1, _ref, _ref1;
-
if (['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) {
if (Conf['404 Redirect'] && g.VIEW === 'thread') {
href = Redirect.to('thread', {
@@ -11029,7 +10629,6 @@
},
callbackNodes: function(klass, nodes) {
var callback, err, errors, i, len, node, _i, _len, _ref;
-
len = nodes.length;
_ref = klass.prototype.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -11057,11 +10656,9 @@
},
callbackNodesDB: function(klass, nodes, cb) {
var errors, func, i, len, node, queue, softTask;
-
queue = [];
softTask = function() {
var args, func, task;
-
task = queue.shift();
func = task[0];
args = Array.prototype.slice.call(task, 1);
@@ -11080,7 +10677,6 @@
errors = null;
func = function(node, i) {
var callback, err, _i, _len, _ref;
-
_ref = klass.prototype.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
callback = _ref[_i];
@@ -11114,7 +10710,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);
@@ -11134,7 +10729,6 @@
},
handleErrors: function(errors) {
var div, error, logs, _i, _len;
-
if (!(errors instanceof Array)) {
error = errors;
} else if (errors.length === 1) {
@@ -11149,7 +10743,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', {
@@ -11163,7 +10756,6 @@
},
parseError: function(data) {
var error, message;
-
Main.logError(data);
message = $.el('div', {
textContent: data.message
@@ -11180,7 +10772,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/src/General/Main.coffee b/src/General/Main.coffee
index 39844c3a6..9036e1762 100755
--- a/src/General/Main.coffee
+++ b/src/General/Main.coffee
@@ -160,6 +160,7 @@ Main =
$.addClass doc, 'gecko'
<% } %>
$.addClass doc, 'fourchan-x'
+ $.addClass doc, 'seaweedchan'
$.addClass doc, g.VIEW
$.addStyle Main.css
diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee
index 5017c71d2..23f8c2b5e 100755
--- a/src/Linkification/Linkify.coffee
+++ b/src/Linkification/Linkify.coffee
@@ -14,7 +14,7 @@ Linkify =
# This should account for virtually all links posted without www or http:
# If it misses any, screw it. No, I will not add canv.as
[-a-z\d.]+[.](
- com|net|org|co\.jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly
+ com|net|org|co\.jp|us|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi|mp|ly|info
)
|
# IPv4 Addresses