diff --git a/LICENSE b/LICENSE
index 57a02b06c..3a3500b90 100755
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
/*
-* 4chan X - Version 1.2.35 - 2013-08-23
+* 4chan X - Version 1.2.35 - 2013-08-24
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index cae9bba0e..b99a70246 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -22,7 +22,7 @@
// ==/UserScript==
/*
-* 4chan X - Version 1.2.35 - 2013-08-23
+* 4chan X - Version 1.2.35 - 2013-08-24
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@@ -345,7 +345,6 @@
Array.prototype.indexOf = function(object) {
var i;
-
i = this.length;
while (i--) {
if (this[i] === object) {
@@ -364,7 +363,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
if (!properties.hasOwnProperty(key)) {
@@ -382,7 +380,6 @@
$.ready = function(fc) {
var cb;
-
if (d.readyState !== 'loading') {
$.queueTask(fc);
return;
@@ -396,7 +393,6 @@
$.formData = function(form) {
var fd, key, val;
-
if (form instanceof HTMLFormElement) {
return new FormData(form);
}
@@ -416,7 +412,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
object[key] = val;
@@ -425,11 +420,9 @@
$.ajax = (function() {
var lastModified;
-
lastModified = {};
return function(url, options, extra) {
var form, r, sync, type, upCallbacks, whenModified;
-
if (extra == null) {
extra = {};
}
@@ -452,11 +445,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);
@@ -476,7 +467,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];
@@ -512,7 +502,6 @@
$.addStyle = function(css, id) {
var style;
-
style = $.el('style', {
id: id,
textContent: css
@@ -559,7 +548,6 @@
} else {
return function(el) {
var _ref;
-
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
};
}
@@ -567,7 +555,6 @@
$.rmAll = function(root) {
var node;
-
while (node = root.firstChild) {
root.removeChild(node);
}
@@ -583,7 +570,6 @@
$.nodes = function(nodes) {
var frag, node, _i, _len;
-
if (!(nodes instanceof Array)) {
return nodes;
}
@@ -617,7 +603,6 @@
$.el = function(tag, properties) {
var el;
-
el = d.createElement(tag);
if (properties) {
$.extend(el, properties);
@@ -627,7 +612,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];
@@ -637,7 +621,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];
@@ -659,7 +642,6 @@
$.debounce = function(wait, fn) {
var args, exec, lastCall, that, timeout;
-
lastCall = 0;
timeout = null;
that = null;
@@ -681,11 +663,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);
@@ -708,7 +688,6 @@
$.globalEval = function(code) {
var script;
-
script = $.el('script', {
textContent: code
});
@@ -718,7 +697,6 @@
$.bytesToString = function(size) {
var unit;
-
unit = 0;
while (size >= 1024) {
size /= 1024;
@@ -734,7 +712,6 @@
$.item = function(key, val) {
var item;
-
item = {};
item[key] = val;
return item;
@@ -745,7 +722,6 @@
$.sync = (function() {
$.on(window, 'storage', function(e) {
var cb;
-
if (cb = $.syncing[e.key]) {
return cb(JSON.parse(e.newValue));
}
@@ -757,7 +733,6 @@
$["delete"] = function(keys) {
var key, _i, _len;
-
if (!(keys instanceof Array)) {
keys = [keys];
}
@@ -771,7 +746,6 @@
$.get = function(key, val, cb) {
var items;
-
if (typeof cb === 'function') {
items = $.item(key, val);
} else {
@@ -790,7 +764,6 @@
$.set = (function() {
var set;
-
set = function(key, val) {
key = g.NAMESPACE + key;
val = JSON.stringify(val);
@@ -801,7 +774,6 @@
};
return function(keys, val) {
var key;
-
if (typeof keys === 'string') {
set(keys, val);
return;
@@ -869,7 +841,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) {
@@ -945,7 +916,6 @@
Post.prototype.parseComment = function() {
var bq, i, node, nodes, text;
-
this.nodes.comment.normalize();
bq = this.nodes.comment.cloneNode(true);
nodes = $$('.abbr, .capcodeReplies, .exif, b', bq);
@@ -964,7 +934,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++) {
@@ -975,7 +944,6 @@
Post.prototype.parseQuote = function(quotelink) {
var fullID, match;
-
if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) {
return;
}
@@ -991,7 +959,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;
}
@@ -1022,7 +989,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) {
@@ -1071,7 +1037,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');
@@ -1105,7 +1070,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++) {
@@ -1123,7 +1087,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'];
@@ -1211,7 +1174,6 @@
function DataBoard(key, sync, dontClean) {
var init,
_this = this;
-
this.key = key;
this.onSync = __bind(this.onSync, this);
this.data = Conf[key];
@@ -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) {
@@ -1436,10 +1391,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);
@@ -1477,7 +1430,6 @@
init: function() {
var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, shortcutToggler,
_this = this;
-
this.menu = new UI.Menu('header');
menuButton = $.el('span', {
className: 'menu-button',
@@ -1578,7 +1530,6 @@
});
$.ready(function() {
var a, cs;
-
_this.footer = $.id('boardNavDesktopFoot');
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
a.className = 'current';
@@ -1613,7 +1564,6 @@
}),
setBoardList: function() {
var a, boardList, btn, fourchannav, fullBoardList;
-
fourchannav = $.id('boardNavDesktop');
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
a.className = 'current';
@@ -1635,7 +1585,6 @@
},
generateBoardList: function(text) {
var as, list, nodes;
-
list = $('#custom-board-list', Header.bar);
$.rmAll(list);
if (!text) {
@@ -1644,7 +1593,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);
}
@@ -1695,7 +1643,6 @@
},
toggleBoardList: function() {
var bar, custom, full, showBoardList;
-
bar = Header.bar;
custom = $('#custom-board-list', bar);
full = $('#full-board-list', bar);
@@ -1731,7 +1678,6 @@
},
toggleLinkJustify: function() {
var centered;
-
$.event('CloseMenu');
centered = this.nodeName === 'INPUT' ? this.checked : void 0;
Header.setLinkJustify(centered);
@@ -1775,7 +1721,6 @@
},
toggleBarVisibility: function() {
var hide, message;
-
hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
this.checked = hide;
$.set('Header auto-hide', Conf['Header auto-hide'] = hide);
@@ -1789,7 +1734,6 @@
},
toggleFooterVisibility: function() {
var hide, message;
-
$.event('CloseMenu');
hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden;
Header.setFooterVisibility(hide);
@@ -1799,7 +1743,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);
@@ -1812,14 +1755,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;
}
@@ -1830,7 +1771,6 @@
},
scrollToPost: function(post) {
var headRect, top;
-
top = post.getBoundingClientRect().top;
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
headRect = Header.bar.getBoundingClientRect();
@@ -1840,7 +1780,6 @@
},
addShortcut: function(el) {
var shortcut;
-
shortcut = $.el('span', {
className: 'shortcut brackets-wrap'
});
@@ -1852,7 +1791,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 Notice(type, content, lifetime);
if (cb) {
@@ -1862,7 +1800,6 @@
areNotificationsEnabled: false,
enableDesktopNotifications: function() {
var authorize, disable, el, notice, _ref;
-
if (!(window.Notification && Conf['Desktop Notifications'])) {
return;
}
@@ -1898,7 +1835,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);
@@ -1908,7 +1844,6 @@
},
postFromObject: function(data, boardID) {
var o;
-
o = {
postID: data.no,
threadID: data.resto || data.no,
@@ -1953,7 +1888,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/';
@@ -2052,7 +1986,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;
@@ -2089,7 +2022,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) {
@@ -2105,7 +2037,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);
@@ -2125,7 +2056,6 @@
},
postDataFromLink: function(link) {
var boardID, path, postID, threadID, _ref;
-
if (link.hostname === 'boards.4chan.org') {
path = link.pathname.split('/');
boardID = path[1];
@@ -2143,7 +2073,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) {
@@ -2172,14 +2101,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;
@@ -2202,7 +2129,6 @@
},
insert: function(post, root, context) {
var clone, nodes;
-
if (!root.parentNode) {
return;
}
@@ -2216,7 +2142,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;
@@ -2270,7 +2195,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;
@@ -2367,10 +2291,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,
@@ -2412,7 +2334,6 @@
Menu.prototype.makeMenu = function() {
var menu;
-
menu = $.el('div', {
className: 'dialog',
id: 'menu',
@@ -2427,7 +2348,6 @@
Menu.prototype.toggle = function(e, button, data) {
var previousButton;
-
e.preventDefault();
e.stopPropagation();
if (currentMenu) {
@@ -2445,7 +2365,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;
@@ -2484,7 +2403,6 @@
Menu.prototype.insertEntry = function(entry, parent, data) {
var subEntry, submenu, _i, _len, _ref;
-
if (typeof entry.open === 'function') {
if (!entry.open(data)) {
return;
@@ -2518,7 +2436,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);
@@ -2528,7 +2445,6 @@
Menu.prototype.keybinds = function(e) {
var entry, next, nextPrev, subEntry, submenu;
-
entry = $('.focused', currentMenu);
while (subEntry = $('.focused', entry)) {
entry = subEntry;
@@ -2574,7 +2490,6 @@
Menu.prototype.focus = function(entry) {
var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2;
-
while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
$.rmClass(focused, 'focused');
}
@@ -2602,7 +2517,6 @@
Menu.prototype.addEntry = function(e) {
var entry;
-
entry = e.detail;
if (entry.type !== this.type) {
return;
@@ -2613,7 +2527,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) {
@@ -2637,7 +2550,6 @@
})();
dragstart = function(e) {
var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
-
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -2676,7 +2588,6 @@
};
touchmove = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -2688,7 +2599,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 + '%';
@@ -2704,7 +2614,6 @@
};
touchend = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -2726,7 +2635,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,
@@ -2761,7 +2669,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;
@@ -2805,7 +2712,6 @@
},
node: function() {
var email, name, tripcode, _ref;
-
if (this.info.capcode || this.isClone) {
return;
}
@@ -2832,7 +2738,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;
}
@@ -2869,7 +2774,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;
@@ -2900,7 +2804,6 @@
},
createFilter: function(regexp, op, stub, hl, top) {
var settings, test;
-
test = typeof regexp === 'string' ? function(value) {
return regexp === value;
} : function(value) {
@@ -2924,7 +2827,6 @@
},
node: function() {
var filter, firstThread, key, result, thisThread, value, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -3036,7 +2938,6 @@
menu: {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) {
return;
}
@@ -3062,7 +2963,6 @@
},
createSubEntry: function(text, type) {
var el;
-
el = $.el('a', {
href: 'javascript:;',
textContent: text
@@ -3073,7 +2973,6 @@
el: el,
open: function(post) {
var value;
-
value = Filter[type](post);
return value !== false;
}
@@ -3081,7 +2980,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) {
@@ -3096,7 +2994,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);
@@ -3130,7 +3027,6 @@
},
node: function() {
var data;
-
if (!this.isReply || this.isClone) {
return;
}
@@ -3154,7 +3050,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub, replies, thisPost;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
return;
}
@@ -3225,7 +3120,6 @@
order: 20,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -3257,7 +3151,6 @@
order: 15,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -3274,7 +3167,6 @@
},
hide: function() {
var makeStub, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -3293,7 +3185,6 @@
},
show: function() {
var data, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -3317,7 +3208,6 @@
},
hideStub: function() {
var post;
-
post = PostHiding.menu.post;
post.nodes.root.hidden = true;
$.event('CloseMenu');
@@ -3325,7 +3215,6 @@
},
makeButton: function(post, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-reply-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -3336,7 +3225,6 @@
},
saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
var data;
-
data = {
boardID: post.board.ID,
threadID: post.thread.ID,
@@ -3355,14 +3243,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'];
}
@@ -3397,7 +3283,6 @@
},
show: function(post, showRecursively) {
var quotelink, _i, _len, _ref;
-
if (showRecursively == null) {
showRecursively = Conf['Recursive Hiding'];
}
@@ -3433,7 +3318,6 @@
},
node: function() {
var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.isClone) {
return;
}
@@ -3451,7 +3335,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: [],
@@ -3462,7 +3345,6 @@
},
rm: function(recursive, post) {
var i, obj, rec, _i, _len, _ref;
-
if (!(obj = Recursive.recursives[post.fullID])) {
return;
}
@@ -3477,7 +3359,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;
@@ -3504,7 +3385,6 @@
},
node: function() {
var data;
-
if (data = ThreadHiding.db.get({
boardID: this.board.ID,
threadID: this.ID
@@ -3518,7 +3398,6 @@
},
syncCatalog: function() {
var hiddenThreads, hiddenThreadsOnCatalog, threadID;
-
hiddenThreads = ThreadHiding.db.get({
boardID: g.BOARD.ID,
defaultValue: {}
@@ -3545,7 +3424,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;
}
@@ -3571,7 +3449,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub;
-
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
return;
}
@@ -3593,7 +3470,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || thread.isHidden) {
return false;
@@ -3621,7 +3497,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -3641,7 +3516,6 @@
order: 15,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -3652,7 +3526,6 @@
},
hide: function() {
var makeStub, thread;
-
makeStub = $('input', this.parentNode).checked;
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, makeStub);
@@ -3661,7 +3534,6 @@
},
show: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.show(thread);
ThreadHiding.saveHiddenState(thread);
@@ -3669,7 +3541,6 @@
},
hideStub: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, false);
$.event('CloseMenu');
@@ -3677,7 +3548,6 @@
},
makeButton: function(thread, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-thread-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -3689,7 +3559,6 @@
},
saveHiddenState: function(thread, makeStub) {
var hiddenThreadsOnCatalog;
-
hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
if (thread.isHidden) {
ThreadHiding.db.set({
@@ -3722,7 +3591,6 @@
},
hide: function(thread, makeStub) {
var OP, a, numReplies, opInfo, span, threadRoot;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -3746,7 +3614,6 @@
},
show: function(thread) {
var threadRoot;
-
if (thread.stub) {
$.rm(thread.stub);
delete thread.stub;
@@ -3759,7 +3626,6 @@
QuoteBacklink = {
init: function() {
var format;
-
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
return;
}
@@ -3777,7 +3643,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;
}
@@ -3815,7 +3680,6 @@
},
secondNode: function() {
var container;
-
if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
this.nodes.backlinkContainer = $('.container', this.nodes.info);
return;
@@ -3829,7 +3693,6 @@
},
getContainer: function(id) {
var _base;
-
return (_base = this.containers)[id] || (_base[id] = $.el('span', {
className: 'container'
}));
@@ -3852,7 +3715,6 @@
},
node: function() {
var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -3882,7 +3744,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];
@@ -3895,7 +3756,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];
@@ -3922,7 +3782,6 @@
},
toggle: function(e) {
var boardID, context, postID, threadID, _ref;
-
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -3948,7 +3807,6 @@
},
add: function(quotelink, boardID, threadID, postID, context) {
var inline, isBacklink, post, qroot, root;
-
isBacklink = $.hasClass(quotelink, 'backlink');
inline = $.el('div', {
id: "i" + postID,
@@ -3973,7 +3831,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);
@@ -4015,7 +3872,6 @@
},
node: function() {
var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -4058,7 +3914,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];
@@ -4067,7 +3922,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;
}
@@ -4111,7 +3965,6 @@
},
mouseout: function() {
var clone, post, root, _i, _len, _ref;
-
if (!(root = this.el.firstElementChild)) {
return;
}
@@ -4141,7 +3994,6 @@
},
node: function() {
var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone) {
return;
}
@@ -4164,7 +4016,6 @@
QuoteThreading = {
init: function() {
var input;
-
if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
return;
}
@@ -4187,7 +4038,6 @@
},
setup: function() {
var ID, post, posts;
-
$.off(d, '4chanXInitFinished', QuoteThreading.setup);
posts = g.posts;
for (ID in posts) {
@@ -4200,7 +4050,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;
}
@@ -4230,7 +4079,6 @@
},
nodeinsert: function() {
var bottom, height, qpost, qroot, threadContainer, top, _ref;
-
qpost = g.posts[this.threaded];
delete this.threaded;
delete this.cb;
@@ -4259,7 +4107,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;
@@ -4276,7 +4123,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;
@@ -4297,7 +4143,6 @@
},
kb: function() {
var control;
-
control = $.id('threadingControl');
return control.click();
}
@@ -4324,7 +4169,6 @@
},
node: function() {
var quotelink, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -4348,7 +4192,6 @@
cb: {
seek: function(type) {
var highlight, post, posts, result, str;
-
if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
@@ -4404,7 +4247,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];
@@ -4419,7 +4261,6 @@
},
parseDeadlink: function(deadlink) {
var a, boardID, m, post, postID, quote, quoteID, redirect, _ref;
-
if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
Quotify.fixDeadlink(deadlink);
return;
@@ -4512,7 +4353,6 @@
},
node: function() {
var data, el, end, endNode, i, index, items, length, link, links, node, result, saved, snapshot, space, test, word, _i, _len, _ref;
-
if (this.isClone) {
if (Conf['Embedding']) {
i = 0;
@@ -4589,7 +4429,6 @@
},
makeRange: function(startNode, endNode, startOffset, endOffset) {
var range;
-
range = document.createRange();
range.setStart(startNode, startOffset);
range.setEnd(endNode, endOffset);
@@ -4597,7 +4436,6 @@
},
makeLink: function(range) {
var a, char, i, text;
-
text = range.toString();
i = 0;
while (/[(\[{<>]/.test(text.charAt(i))) {
@@ -4643,7 +4481,6 @@
},
services: function(link) {
var href, key, match, type, _ref;
-
href = link.href;
_ref = Linkify.types;
for (key in _ref) {
@@ -4656,7 +4493,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', {
@@ -4685,7 +4521,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;
@@ -4722,21 +4557,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',
@@ -4749,7 +4581,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) {
@@ -4789,7 +4620,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"
});
@@ -4800,7 +4630,6 @@
},
text: function(_arg) {
var file, files;
-
files = _arg.files;
for (file in files) {
if (files.hasOwnProperty(file)) {
@@ -4848,7 +4677,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
});
@@ -4859,7 +4687,6 @@
style: 'height: auto; width: 500px; display: inline-block;',
el: function(a) {
var div;
-
div = $.el('div', {
className: "soundcloud",
name: "soundcloud"
@@ -4885,7 +4712,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', {
@@ -4957,7 +4783,6 @@
QR = {
init: function() {
var sc;
-
if (!Conf['Quick Reply']) {
return;
}
@@ -5004,7 +4829,6 @@
},
initReady: function() {
var link;
-
QR.postingIsEnabled = !!$.id('postForm');
if (!QR.postingIsEnabled) {
return;
@@ -5024,13 +4848,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);
});
@@ -5059,7 +4881,6 @@
},
open: function() {
var err;
-
if (QR.nodes) {
QR.nodes.el.hidden = false;
QR.unhide();
@@ -5078,7 +4899,6 @@
},
close: function() {
var post, _i, _len, _ref;
-
if (QR.req) {
QR.abort();
return;
@@ -5133,7 +4953,6 @@
},
error: function(err) {
var el;
-
QR.open();
if (typeof err === 'string') {
el = $.tn(err);
@@ -5160,7 +4979,6 @@
},
notify: function(el) {
var notice, notif;
-
notice = new Notice('warning', el);
QR.notifications.push(notice);
if (!Header.areNotificationsEnabled) {
@@ -5177,7 +4995,6 @@
notifications: [],
cleanNotifications: function() {
var notification, _i, _len, _ref;
-
_ref = QR.notifications;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
notification = _ref[_i];
@@ -5187,7 +5004,6 @@
},
status: function() {
var disabled, status, thread, value;
-
if (!QR.nodes) {
return;
}
@@ -5209,7 +5025,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: [],
@@ -5229,7 +5044,6 @@
},
parseItem: function(item, types) {
var boards, match, type, val, _ref, _ref1;
-
if (item[0] === '#') {
return;
}
@@ -5258,7 +5072,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];
@@ -5271,7 +5084,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;
}
@@ -5280,7 +5092,6 @@
get: function(cb) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
return cb(persona);
});
@@ -5288,7 +5099,6 @@
set: function(post) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
persona = {
name: post.name,
@@ -5302,7 +5112,6 @@
cooldown: {
init: function() {
var board;
-
if (!Conf['Cooldown']) {
return;
}
@@ -5344,7 +5153,6 @@
},
sync: function(cooldowns) {
var id;
-
for (id in cooldowns) {
QR.cooldown.cooldowns[id] = cooldowns[id];
}
@@ -5352,7 +5160,6 @@
},
set: function(data) {
var cooldown, delay, hasFile, isReply, isSage, post, req, start, type, upSpd;
-
if (!Conf['Cooldown']) {
return;
}
@@ -5392,7 +5199,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;
@@ -5446,7 +5252,6 @@
},
quote: function(e) {
var caretPos, com, index, post, range, s, sel, text, thread, _ref;
-
if (e != null) {
e.preventDefault();
}
@@ -5484,7 +5289,6 @@
},
characterCount: function() {
var count, counter;
-
counter = QR.nodes.charCount;
count = QR.nodes.com.textLength;
counter.textContent = count;
@@ -5493,7 +5297,6 @@
},
drag: function(e) {
var toggle;
-
toggle = e.type === 'dragstart' ? $.off : $.on;
toggle(d, 'dragover', QR.dragOver);
return toggle(d, 'drop', QR.dropFile);
@@ -5513,7 +5316,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++) {
@@ -5537,7 +5339,6 @@
},
handleFiles: function(files) {
var file, isSingle, max, _i, _len;
-
if (this !== QR) {
files = __slice.call(this.files);
this.value = null;
@@ -5558,7 +5359,6 @@
},
handleFile: function(file, isSingle, max) {
var post;
-
if (file.size > max) {
QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
return;
@@ -5583,6 +5383,9 @@
return post.setFile(file);
},
openFileInput: function(e) {
+ if (e.keyCode && e.keyCode !== 32) {
+ return;
+ }
e.stopPropagation();
if (e.shiftKey && e.type === 'click') {
return QR.selected.rmFile();
@@ -5606,7 +5409,6 @@
this.select = __bind(this.select, this);
var el, elm, event, prev, _i, _j, _len, _len1, _ref, _ref1,
_this = this;
-
el = $.el('a', {
className: 'qr-preview',
draggable: true,
@@ -5666,7 +5468,6 @@
_Class.prototype.rm = function() {
var index;
-
this["delete"]();
index = QR.posts.indexOf(this);
if (QR.posts.length === 1) {
@@ -5686,7 +5487,6 @@
_Class.prototype.lock = function(lock) {
var name, _i, _len, _ref;
-
if (lock == null) {
lock = true;
}
@@ -5711,7 +5511,6 @@
_Class.prototype.select = function() {
var rectEl, rectList;
-
if (QR.selected) {
QR.selected.nodes.el.id = null;
QR.selected.forceSave();
@@ -5728,7 +5527,6 @@
_Class.prototype.load = function() {
var name, _i, _len, _ref;
-
_ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
name = _ref[_i];
@@ -5740,7 +5538,6 @@
_Class.prototype.save = function(input) {
var name, _ref;
-
if (input.type === 'checkbox') {
this.spoiler = input.checked;
return;
@@ -5771,7 +5568,6 @@
_Class.prototype.forceSave = function() {
var name, _i, _len, _ref;
-
if (this !== QR.selected) {
return;
}
@@ -5801,11 +5597,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;
@@ -5856,7 +5650,6 @@
_Class.prototype.updateFilename = function() {
var long;
-
long = "" + this.filename + " (" + this.filesize + ")\nCtrl+click to edit filename. Shift+click to clear.";
this.nodes.el.title = long;
if (this !== QR.selected) {
@@ -5879,11 +5672,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;
@@ -5922,7 +5713,6 @@
_Class.prototype.drop = function() {
var el, index, newIndex, oldIndex, post;
-
$.rmClass(this, 'over');
if (!this.draggable) {
return;
@@ -5957,7 +5747,6 @@
ready: function() {
var imgContainer, input, setLifetime,
_this = this;
-
setLifetime = function(e) {
return _this.lifetime = e.detail;
};
@@ -5994,7 +5783,6 @@
});
$.get('captchas', [], function(_arg) {
var captchas;
-
captchas = _arg.captchas;
return _this.sync(captchas);
});
@@ -6011,7 +5799,6 @@
},
getOne: function() {
var captcha, challenge, response;
-
this.clear();
if (captcha = this.captchas.shift()) {
challenge = captcha.challenge, response = captcha.response;
@@ -6036,7 +5823,6 @@
},
save: function() {
var response;
-
if (!(response = this.nodes.input.value.trim())) {
return;
}
@@ -6051,7 +5837,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) {
@@ -6069,7 +5854,6 @@
},
load: function() {
var challenge;
-
if (!this.nodes.challenge.firstChild) {
return;
}
@@ -6082,7 +5866,6 @@
},
count: function() {
var count;
-
count = this.captchas.length;
this.nodes.input.placeholder = (function() {
switch (count) {
@@ -6115,7 +5898,6 @@
},
dialog: function() {
var check, dialog, elm, i, items, key, mimeTypes, name, nodes, thread, value, _ref;
-
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top:0;right:0;', "
")
};
@@ -6238,7 +6020,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();
}
@@ -6352,7 +6133,6 @@
},
response: function() {
var URL, ban, board, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, req, resDoc, threadID, _, _ref, _ref1;
-
req = QR.req;
delete QR.req;
post = QR.posts[0];
@@ -6466,7 +6246,6 @@
FappeTyme = {
init: function() {
var el, input;
-
if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') {
return;
}
@@ -6501,7 +6280,6 @@
Gallery = {
init: function() {
var el;
-
if (g.VIEW === 'catalog' || g.BOARD === 'f' || !Conf['Gallery']) {
return;
}
@@ -6521,7 +6299,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6535,7 +6312,6 @@
},
build: function(image) {
var dialog, file, files, i, key, value, _ref;
-
Gallery.el = dialog = $.el('div', {
id: 'a-gallery',
innerHTML: "\n
×\n
\n
/ \n
\n
\n
![]()
\n
\n
\n
\n"
@@ -6576,7 +6352,6 @@
},
generateThumb: function(file) {
var double, thumb, title;
-
title = ($('.fileText a', file)).textContent;
thumb = ($('.fileThumb', file)).cloneNode(true);
if (double = $('img + img', thumb)) {
@@ -6593,7 +6368,6 @@
cb: {
keybinds: function(e) {
var cb, key;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -6619,7 +6393,6 @@
},
open: function(e) {
var el, img;
-
if (e) {
e.preventDefault();
}
@@ -6687,7 +6460,6 @@
},
node: function() {
var thumb, _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6712,7 +6484,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 fourchanx-icon icon-resize-small';
@@ -6746,7 +6517,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);
@@ -6756,7 +6526,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) {
@@ -6787,7 +6556,6 @@
},
expand: function(post, src) {
var img, thumb;
-
thumb = post.file.thumb;
if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) {
return;
@@ -6815,7 +6583,6 @@
},
completeExpand: function(post) {
var prev, thumb;
-
thumb = post.file.thumb;
if (!$.hasClass(thumb, 'expanding')) {
return;
@@ -6829,7 +6596,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)) {
@@ -6841,7 +6607,6 @@
},
error: function() {
var URL, post, src, timeoutID;
-
post = Get.postFromNode(this);
$.rm(this);
delete post.file.fullImage;
@@ -6867,7 +6632,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -6891,7 +6655,6 @@
menu: {
init: function() {
var conf, createSubEntry, el, name, subEntries, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Image Expansion']) {
return;
}
@@ -6915,7 +6678,6 @@
},
createSubEntry: function(name, desc) {
var input, label;
-
label = $.el('label', {
innerHTML: " " + name,
title: desc
@@ -6949,7 +6711,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6957,7 +6718,6 @@
},
mouseover: function(e) {
var el, post;
-
post = Get.postFromNode(this);
el = $.el('img', {
id: 'ihover',
@@ -6979,7 +6739,6 @@
error: function() {
var URL, post, src, timeoutID,
_this = this;
-
if (!doc.contains(this)) {
return;
}
@@ -7004,7 +6763,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -7030,7 +6788,6 @@
ImageLoader = {
init: function() {
var prefetch;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -7057,7 +6814,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;
}
@@ -7079,7 +6835,6 @@
},
toggle: function() {
var enabled, id, post, _ref;
-
enabled = Conf['prefetch'] = this.checked;
if (enabled) {
_ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts;
@@ -7103,7 +6858,6 @@
},
node: function() {
var thumb, _ref;
-
if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) {
return;
}
@@ -7116,7 +6870,6 @@
Sauce = {
init: function() {
var err, link, links, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Sauce']) {
return;
}
@@ -7146,7 +6899,6 @@
},
createSauceLink: function(link) {
var m, text;
-
link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) {
switch (parameter) {
case '%TURL':
@@ -7167,7 +6919,6 @@
},
node: function() {
var link, nodes, _i, _len, _ref;
-
if (this.isClone || !this.file) {
return;
}
@@ -7184,7 +6935,6 @@
ArchiveLink = {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) {
return;
}
@@ -7197,7 +6947,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,
@@ -7216,14 +6965,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,
@@ -7233,7 +6980,6 @@
return true;
} : function(post) {
var value;
-
value = Filter[type](post);
if (!value) {
return false;
@@ -7256,7 +7002,6 @@
DeleteLink = {
init: function() {
var div, fileEl, fileEntry, postEl, postEntry;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) {
return;
}
@@ -7284,7 +7029,6 @@
el: fileEl,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file || file.isDead) {
return false;
@@ -7300,7 +7044,6 @@
order: 40,
open: function(post) {
var node;
-
if (post.isDead || post.board.ID === 'q') {
return false;
}
@@ -7315,7 +7058,6 @@
},
"delete": function() {
var fileOnly, form, link, post;
-
post = DeleteLink.post;
if (DeleteLink.cooldown.counting === post) {
return;
@@ -7345,7 +7087,6 @@
},
load: function(link, post, fileOnly, resDoc) {
var msg, s;
-
if (resDoc.title === '4chan - Banned') {
s = 'Banned!';
} else if (msg = resDoc.getElementById('errmsg')) {
@@ -7366,7 +7107,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,
@@ -7400,7 +7140,6 @@
DownloadLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) {
return;
}
@@ -7414,7 +7153,6 @@
order: 100,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file) {
return false;
@@ -7447,7 +7185,6 @@
},
makeButton: (function() {
var a;
-
a = $.el('a', {
className: 'menu-button brackets-wrap',
innerHTML: '',
@@ -7455,7 +7192,6 @@
});
return function() {
var button;
-
button = a.cloneNode(true);
$.on(button, 'click', Menu.toggle);
return button;
@@ -7463,7 +7199,6 @@
})(),
toggle: function(e) {
var post;
-
post = Get.postFromNode(this);
return Menu.menu.toggle(e, this, post);
}
@@ -7472,7 +7207,6 @@
ReportLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) {
return;
}
@@ -7494,7 +7228,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();
@@ -7507,7 +7240,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;
@@ -7581,7 +7313,6 @@
init: function() {
var sc,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
return;
}
@@ -7610,7 +7341,6 @@
},
node: function() {
var ID, fileCount, post, postCount, _ref;
-
postCount = 0;
fileCount = 0;
_ref = this.posts;
@@ -7628,7 +7358,6 @@
},
onUpdate: function(e) {
var fileCount, postCount, _ref;
-
if (e.detail[404]) {
return;
}
@@ -7637,7 +7366,6 @@
},
update: function(postCount, fileCount) {
var fileCountEl, postCountEl, thread;
-
thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl;
postCountEl.textContent = postCount;
fileCountEl.textContent = fileCount;
@@ -7662,7 +7390,6 @@
},
onThreadsLoad: function() {
var page, pages, thread, _i, _j, _len, _len1, _ref;
-
if (!(Conf["Page Count in Stats"] && this.status === 200)) {
return;
}
@@ -7686,7 +7413,6 @@
init: function() {
var checked, conf, el, input, name, sc, settings, subEntries, _ref,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
return;
}
@@ -7836,7 +7562,6 @@
},
interval: function() {
var val;
-
val = +this.value;
if (val < 1) {
val = 1;
@@ -7846,7 +7571,6 @@
},
load: function() {
var klass, req, text, _ref;
-
req = ThreadUpdater.req;
switch (req.status) {
case 200:
@@ -7879,7 +7603,6 @@
},
getInterval: function() {
var i, j;
-
i = ThreadUpdater.interval;
j = Math.min(ThreadUpdater.outdateCount, 10);
if (!d.hidden) {
@@ -7889,14 +7612,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;
@@ -7909,7 +7630,6 @@
},
timeout: function() {
var n;
-
ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
if (!(n = --ThreadUpdater.seconds)) {
return ThreadUpdater.update();
@@ -7922,7 +7642,6 @@
},
update: function() {
var url;
-
if (!ThreadUpdater.online) {
return;
}
@@ -7945,7 +7664,6 @@
},
updateThreadStatus: function(title, OP) {
var icon, message, root, titleLC;
-
titleLC = title.toLowerCase();
if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) {
return;
@@ -7972,7 +7690,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);
@@ -8058,7 +7775,6 @@
}
$.queueTask(function() {
var length, threadID;
-
threadID = ThreadUpdater.thread.ID;
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
return Fourchan.parseThread(threadID, length - count, length);
@@ -8079,7 +7795,6 @@
ThreadWatcher = {
init: function() {
var now, sc;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -8112,7 +7827,6 @@
}
$.get('WatchedThreads', null, function(_arg) {
var WatchedThreads, boardID, data, threadID, threads, _ref;
-
WatchedThreads = _arg.WatchedThreads;
if (!WatchedThreads) {
return;
@@ -8138,7 +7852,6 @@
},
node: function() {
var toggler;
-
toggler = $.el('img', {
className: 'watch-thread-link'
});
@@ -8160,7 +7873,6 @@
}
return $.get('AutoWatch', 0, function(_arg) {
var AutoWatch, thread;
-
AutoWatch = _arg.AutoWatch;
if (!(thread = g.BOARD.threads[AutoWatch])) {
return;
@@ -8176,7 +7888,6 @@
cb: {
openAll: function() {
var a, _i, _len, _ref;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -8195,7 +7906,6 @@
},
pruneDeads: function() {
var boardID, data, threadID, _i, _len, _ref, _ref1;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -8219,13 +7929,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']) {
@@ -8237,7 +7945,6 @@
},
threadUpdate: function(e) {
var thread;
-
thread = e.detail.thread;
if (!(e.detail[404] && ThreadWatcher.db.get({
boardID: thread.board.ID,
@@ -8254,7 +7961,6 @@
},
fetchAllStatus: function() {
var thread, threads, _i, _len;
-
if (!(threads = ThreadWatcher.getAll()).length) {
return;
}
@@ -8266,7 +7972,6 @@
},
fetchStatus: function(_arg) {
var boardID, data, fetchCount, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
if (data.isDead) {
return;
@@ -8276,7 +7981,6 @@
return $.ajax("//api.4chan.org/" + boardID + "/res/" + threadID + ".json", {
onloadend: function() {
var status;
-
fetchCount.fetched++;
if (fetchCount.fetched === fetchCount.fetching) {
fetchCount.fetched = 0;
@@ -8307,7 +8011,6 @@
},
getAll: function() {
var all, boardID, data, threadID, threads, _ref;
-
all = [];
_ref = ThreadWatcher.db.data.boards;
for (boardID in _ref) {
@@ -8328,7 +8031,6 @@
},
makeLine: function(boardID, threadID, data) {
var div, fullID, href, link, x;
-
x = $.el('a', {
textContent: '×',
href: 'javascript:;'
@@ -8359,7 +8061,6 @@
},
refresh: function() {
var boardID, data, helper, list, nodes, refresher, thread, threadID, toggler, watched, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3;
-
nodes = [];
_ref = ThreadWatcher.getAll();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -8389,7 +8090,6 @@
},
toggle: function(thread) {
var boardID, threadID;
-
boardID = thread.board.ID;
threadID = thread.ID;
if (ThreadWatcher.db.get({
@@ -8403,7 +8103,6 @@
},
add: function(thread) {
var boardID, data, threadID;
-
data = {};
boardID = thread.board.ID;
threadID = thread.ID;
@@ -8434,7 +8133,6 @@
},
convert: function(oldFormat) {
var boardID, data, newFormat, threadID, threads;
-
newFormat = {};
for (boardID in oldFormat) {
threads = oldFormat[boardID];
@@ -8451,7 +8149,6 @@
refreshers: [],
init: function() {
var menu;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -8464,7 +8161,6 @@
},
addHeaderMenuEntry: function() {
var entryEl;
-
if (g.VIEW !== 'thread') {
return;
}
@@ -8481,7 +8177,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);
@@ -8490,7 +8185,6 @@
},
addMenuEntries: function() {
var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1, _results;
-
entries = [];
entries.push({
cb: ThreadWatcher.cb.openAll,
@@ -8561,7 +8255,6 @@
},
createSubEntry: function(name, desc) {
var entry, input;
-
entry = {
type: 'thread watcher',
el: $.el('label', {
@@ -8613,7 +8306,6 @@
},
ready: function() {
var ID, post, posts, _ref;
-
$.off(d, '4chanXInitFinished', Unread.ready);
posts = [];
_ref = Unread.thread.posts;
@@ -8628,7 +8320,6 @@
},
scroll: function() {
var checkPosition, hash, onload, post, posts, root;
-
if (!Conf['Scroll to Last Read Post']) {
return;
}
@@ -8665,7 +8356,6 @@
},
sync: function() {
var lastReadPost;
-
lastReadPost = Unread.db.get({
boardID: Unread.thread.board.ID,
threadID: Unread.thread.ID,
@@ -8684,7 +8374,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;
@@ -8712,7 +8401,6 @@
},
addPostQuotingYou: function(post) {
var quotelink, _i, _len, _ref;
-
if (!QR.db) {
return;
}
@@ -8728,7 +8416,6 @@
},
openNotification: function(post) {
var name, notif;
-
if (!Header.areNotificationsEnabled) {
return;
}
@@ -8754,7 +8441,6 @@
},
readSinglePost: function(post) {
var i;
-
if ((i = Unread.posts.indexOf(post)) === -1) {
return;
}
@@ -8770,7 +8456,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) {
@@ -8781,7 +8466,6 @@
},
read: $.debounce(50, function(e) {
var ID, height, i, post, posts;
-
if (d.hidden || !Unread.posts.length) {
return;
}
@@ -8834,7 +8518,6 @@
}),
setLine: function(force) {
var post;
-
if (!(d.hidden || force === true)) {
return;
}
@@ -8847,7 +8530,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);
@@ -8868,7 +8550,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];
@@ -9000,7 +8681,6 @@
},
to: function(dest, data) {
var archive;
-
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
if (!archive) {
return '';
@@ -9009,7 +8689,6 @@
},
protocol: function(archive) {
var protocol;
-
protocol = location.protocol;
if (!archive[protocol.slice(0, -1)]) {
protocol = protocol === 'https:' ? 'http:' : 'https:';
@@ -9018,7 +8697,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') {
@@ -9031,7 +8709,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)) {
@@ -9043,13 +8720,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);
@@ -9068,7 +8743,6 @@
},
setup: function() {
var btn, entry, psa;
-
$.off(d, '4chanXInitFinished', PSAHiding.setup);
if (!(psa = $.id('globalMessage'))) {
$.rmClass(doc, 'hide-announcement');
@@ -9097,7 +8771,6 @@
$.on(btn, 'click', PSAHiding.toggle);
$.get('hiddenPSA', 0, function(_arg) {
var hiddenPSA;
-
hiddenPSA = _arg.hiddenPSA;
PSAHiding.sync(hiddenPSA);
$.before(psa, btn);
@@ -9107,7 +8780,6 @@
},
toggle: function(e) {
var UTC;
-
if ($.hasClass(this, 'hide-announcement')) {
UTC = +$.id('globalMessage').dataset.utc;
$.set('hiddenPSA', UTC);
@@ -9119,7 +8791,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') {
@@ -9140,7 +8811,6 @@
},
ready: function() {
var banner, child, children, i;
-
banner = $(".boardBanner");
children = banner.children;
i = 0;
@@ -9160,7 +8830,6 @@
cb: {
toggle: (function() {
var types;
-
types = {
jpg: 227,
png: 270,
@@ -9168,7 +8837,6 @@
};
return function() {
var num, type;
-
type = Object.keys(types)[Math.floor(3 * Math.random())];
num = Math.floor(types[type] * Math.random());
return this.src = "//static.4chan.org/image/title/" + num + "." + type;
@@ -9188,7 +8856,6 @@
},
focus: function() {
var items, string, string2;
-
this.textContent = this.innerHTML;
string = "" + g.BOARD + "." + this.className;
string2 = "" + string + ".orig";
@@ -9211,7 +8878,6 @@
},
custom: function(child) {
var cachedTest, string;
-
cachedTest = child.innerHTML;
string = "" + g.BOARD + "." + child.className;
$.on(child, 'click keydown focus blur', function(e) {
@@ -9219,7 +8885,6 @@
});
$.get(string, cachedTest, function(item) {
var string2, title;
-
if (!(title = item[string])) {
return;
}
@@ -9243,7 +8908,6 @@
CatalogLinks = {
init: function() {
var el, input;
-
if (!Conf['Catalog Links']) {
return;
}
@@ -9267,14 +8931,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++) {
@@ -9309,7 +8971,6 @@
},
node: function() {
var str, uid;
-
if (this.isClone || !(str = this.info.uniqueID)) {
return;
}
@@ -9321,7 +8982,6 @@
},
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;
@@ -9333,7 +8993,6 @@
},
hash: function(str) {
var i, msg;
-
msg = 0;
i = 0;
while (i < 8) {
@@ -9379,7 +9038,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;
}
@@ -9391,7 +9049,6 @@
Emoji = {
init: function() {
var css, icon, name, pos, _ref;
-
if (!Conf['Emoji']) {
return;
}
@@ -9461,7 +9118,6 @@
},
node: function() {
var a;
-
if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
return $.on(a, 'click', ExpandComment.cb);
}
@@ -9473,7 +9129,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;
@@ -9489,7 +9144,6 @@
},
contract: function(post) {
var a;
-
if (!post.nodes.shortComment) {
return;
}
@@ -9500,7 +9154,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 + ")";
@@ -9563,7 +9216,6 @@
},
node: function() {
var a, files, posts, span, _ref;
-
if (!(span = $.x('following-sibling::span[contains(@class,"summary")][1]', this.OP.nodes.root))) {
return;
}
@@ -9584,7 +9236,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) {
@@ -9662,7 +9313,6 @@
},
parse: function(req, thread, a) {
var filesCount, link, post, posts, postsCount, postsObj, postsRoot, reply, root, spoilerRange, _i, _len;
-
if (a.textContent[0] === '+') {
return;
}
@@ -9726,7 +9376,6 @@
},
createFunc: function(format) {
var code;
-
code = format.replace(/%(.)/g, function(s, c) {
if (c in FileInfo.formatters) {
return "' + FileInfo.formatters." + c + ".call(post) + '";
@@ -9738,7 +9387,6 @@
},
convertUnit: function(size, unit) {
var i;
-
if (unit === 'B') {
return "" + (size.toFixed()) + " Bytes";
}
@@ -9769,7 +9417,6 @@
},
n: function() {
var fullname, shortname;
-
fullname = this.file.name;
shortname = Build.shortFilename(this.file.name, this.isReply);
if (fullname === shortname) {
@@ -9813,7 +9460,6 @@
Fourchan = {
init: function() {
var board;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -9835,7 +9481,6 @@
},
code: function() {
var pre, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -9864,13 +9509,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]');
@@ -9883,7 +9526,6 @@
},
keydown: function(e) {
var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -10061,7 +9703,6 @@
},
keyCode: function(e) {
var kc, key;
-
key = (function() {
switch (kc = e.keyCode) {
case 8:
@@ -10117,7 +9758,6 @@
},
tags: function(tag, ta) {
var range, selEnd, selStart, value;
-
value = ta.value;
selStart = ta.selectionStart;
selEnd = ta.selectionEnd;
@@ -10128,13 +9768,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 {
@@ -10144,7 +9782,6 @@
},
open: function(thread, tab) {
var url;
-
if (g.VIEW !== 'index') {
return;
}
@@ -10157,7 +9794,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');
@@ -10217,7 +9853,6 @@
Nav = {
init: function() {
var append, next, prev, span;
-
switch (g.VIEW) {
case 'index':
if (!Conf['Index Navigation']) {
@@ -10268,7 +9903,6 @@
},
getThread: function(full) {
var headRect, i, rect, thread, threads, topMargin, _i, _len;
-
if (Conf['Bottom header'] || !Conf['Fixed Header']) {
topMargin = 0;
} else {
@@ -10294,7 +9928,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)) {
@@ -10319,7 +9952,6 @@
},
node: function() {
var dateEl;
-
if (this.isClone) {
return;
}
@@ -10329,7 +9961,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) {
@@ -10340,7 +9971,6 @@
stale: [],
flush: function() {
var now, update, _i, _len, _ref;
-
if (d.hidden) {
return;
}
@@ -10356,16 +9986,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);
@@ -10406,7 +10033,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];
@@ -10426,7 +10052,6 @@
},
ready: function() {
var field;
-
field = $.id('recaptcha_response_field');
$.on(field, 'keydown', function(e) {
if (e.keyCode === 8 && !field.value) {
@@ -10435,7 +10060,6 @@
});
return $.on($('form'), 'submit', function(e) {
var response;
-
e.preventDefault();
response = field.value.trim();
if (!/\s/.test(response)) {
@@ -10465,7 +10089,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) + '";
@@ -10550,7 +10173,6 @@
Settings = {
init: function() {
var link, settings;
-
link = $.el('a', {
className: 'settings-link fourchanx-icon icon-wrench',
textContent: 'Settings',
@@ -10560,7 +10182,6 @@
Header.addShortcut(link);
$.get('previousversion', null, function(item) {
var changelog, el, previous;
-
if (previous = item['previousversion']) {
if (previous === g.VERSION) {
return;
@@ -10595,7 +10216,6 @@
},
open: function(openSection) {
var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', Settings.open);
if (Settings.dialog) {
return;
@@ -10648,7 +10268,6 @@
sections: [],
addSection: function(title, open) {
var hyphenatedTitle, _ref;
-
if (typeof title !== 'string') {
_ref = title.detail, title = _ref.title, open = _ref.open;
}
@@ -10661,7 +10280,6 @@
},
openSection: function() {
var section, selected;
-
if (selected = $('.tab-selected', Settings.dialog)) {
$.rmClass(selected, 'tab-selected');
}
@@ -10675,7 +10293,6 @@
},
main: function(section) {
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref;
-
items = {};
inputs = {};
_ref = Config.main;
@@ -10700,7 +10317,6 @@
}
$.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].checked = val;
@@ -10715,7 +10331,6 @@
boards: {}
}, function(item) {
var ID, board, thread, _ref1;
-
_ref1 = item.hiddenThreads.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -10730,7 +10345,6 @@
boards: {}
}, function(item) {
var ID, board, post, thread, _ref1;
-
_ref1 = item.hiddenPosts.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -10750,7 +10364,6 @@
boards: {}
}, function(item) {
var boardID;
-
for (boardID in item.hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
@@ -10761,7 +10374,6 @@
},
"export": function(now, data) {
var a, db, p, _i, _len, _ref;
-
if (typeof now !== 'number') {
now = Date.now();
data = {
@@ -10798,7 +10410,6 @@
},
onImport: function() {
var file, output, reader;
-
if (!(file = this.files[0])) {
return;
}
@@ -10810,7 +10421,6 @@
reader = new FileReader();
reader.onload = function(e) {
var data, err;
-
try {
data = JSON.parse(e.target.result);
Settings.loadSettings(data);
@@ -10827,7 +10437,6 @@
},
loadSettings: function(data) {
var key, val, version, _ref;
-
version = data.version.split('.');
if (version[0] === '2') {
data = Settings.convertSettings(data, {
@@ -10915,7 +10524,6 @@
},
convertSettings: function(data, map) {
var newKey, prevKey;
-
for (prevKey in map) {
newKey = map[prevKey];
if (newKey) {
@@ -10927,7 +10535,6 @@
},
filter: function(section) {
var select;
-
section.innerHTML = "";
select = $('select', section);
$.on(select, 'change', Settings.selectFilter);
@@ -10935,7 +10542,6 @@
},
selectFilter: function() {
var div, name, ta;
-
div = this.nextElementSibling;
if ((name = this.value) !== 'guide') {
$.rmAll(div);
@@ -10955,7 +10561,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) {
@@ -10965,7 +10570,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 = {};
@@ -10985,7 +10589,6 @@
$.on(ta, 'change', $.cb.value);
$.get(items, function(items) {
var key, val;
-
for (key in items) {
val = items[key];
if (['emojiPos'].contains(key)) {
@@ -11056,7 +10659,6 @@
});
$.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
var option, selectedArchives, type;
-
selectedArchives = _arg.selectedArchives;
for (boardID in selectedArchives) {
data = selectedArchives[boardID];
@@ -11071,7 +10673,6 @@
},
addArchiveCell: function(boardID, data, type) {
var archive, i, length, options, select, td;
-
length = data[type].length;
td = $.el('td', {
className: 'archive-cell'
@@ -11101,10 +10702,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);
@@ -11115,7 +10714,6 @@
},
time: function() {
var funk;
-
funk = Time.createFunc(this.value);
return this.nextElementSibling.textContent = funk(Time, new Date());
},
@@ -11124,7 +10722,6 @@
},
fileInfo: function() {
var data, funk;
-
data = {
isReply: true,
file: {
@@ -11163,7 +10760,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 = {};
@@ -11184,7 +10780,6 @@
}
return $.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].value = val;
@@ -11193,7 +10788,6 @@
},
keybind: function(e) {
var key;
-
if (e.keyCode === 9) {
return;
}
@@ -11210,10 +10804,8 @@
Main = {
init: function() {
var db, flatten, _i, _len, _ref;
-
flatten = function(parent, obj) {
var key, val;
-
if (obj instanceof Array) {
Conf[parent] = obj[0];
} else if (typeof obj === 'object') {
@@ -11246,7 +10838,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') {
@@ -11274,7 +10865,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('/');
@@ -11291,7 +10881,6 @@
}
init = function(features) {
var err, module, name;
-
for (name in features) {
module = features[name];
try {
@@ -11371,7 +10960,6 @@
},
initStyle: function() {
var mainStyleSheet, setStyle, style, styleSheets, _ref;
-
$.off(d, '4chanMainInit', Main.initStyle);
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return;
@@ -11393,7 +10981,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];
@@ -11415,7 +11002,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', {
@@ -11483,7 +11069,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++) {
@@ -11511,11 +11096,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);
@@ -11534,7 +11117,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];
@@ -11568,7 +11150,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);
@@ -11588,7 +11169,6 @@
},
handleErrors: function(errors) {
var div, error, logs, _i, _len;
-
if (!(errors instanceof Array)) {
error = errors;
} else if (errors.length === 1) {
@@ -11603,7 +11183,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', {
@@ -11617,7 +11196,6 @@
},
parseError: function(data) {
var error, message;
-
Main.logError(data);
message = $.el('div', {
textContent: data.message
@@ -11634,7 +11212,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 e18779f3b..b78dabf71 100644
--- a/builds/crx/script.js
+++ b/builds/crx/script.js
@@ -1,6 +1,6 @@
// Generated by CoffeeScript
/*
-* 4chan X - Version 1.2.35 - 2013-08-23
+* 4chan X - Version 1.2.35 - 2013-08-24
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@@ -324,7 +324,6 @@
Array.prototype.indexOf = function(object) {
var i;
-
i = this.length;
while (i--) {
if (this[i] === object) {
@@ -343,7 +342,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
if (!properties.hasOwnProperty(key)) {
@@ -361,7 +359,6 @@
$.ready = function(fc) {
var cb;
-
if (d.readyState !== 'loading') {
$.queueTask(fc);
return;
@@ -375,7 +372,6 @@
$.formData = function(form) {
var fd, key, val;
-
if (form instanceof HTMLFormElement) {
return new FormData(form);
}
@@ -395,7 +391,6 @@
$.extend = function(object, properties) {
var key, val;
-
for (key in properties) {
val = properties[key];
object[key] = val;
@@ -404,11 +399,9 @@
$.ajax = (function() {
var lastModified;
-
lastModified = {};
return function(url, options, extra) {
var form, r, sync, type, upCallbacks, whenModified;
-
if (extra == null) {
extra = {};
}
@@ -431,11 +424,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);
@@ -455,7 +446,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];
@@ -491,7 +481,6 @@
$.addStyle = function(css, id) {
var style;
-
style = $.el('style', {
id: id,
textContent: css
@@ -538,7 +527,6 @@
} else {
return function(el) {
var _ref;
-
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
};
}
@@ -546,7 +534,6 @@
$.rmAll = function(root) {
var node;
-
while (node = root.firstChild) {
root.removeChild(node);
}
@@ -562,7 +549,6 @@
$.nodes = function(nodes) {
var frag, node, _i, _len;
-
if (!(nodes instanceof Array)) {
return nodes;
}
@@ -596,7 +582,6 @@
$.el = function(tag, properties) {
var el;
-
el = d.createElement(tag);
if (properties) {
$.extend(el, properties);
@@ -606,7 +591,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];
@@ -616,7 +600,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];
@@ -640,7 +623,6 @@
$.debounce = function(wait, fn) {
var args, exec, lastCall, that, timeout;
-
lastCall = 0;
timeout = null;
that = null;
@@ -662,11 +644,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);
@@ -689,7 +669,6 @@
$.globalEval = function(code) {
var script;
-
script = $.el('script', {
textContent: code
});
@@ -699,7 +678,6 @@
$.bytesToString = function(size) {
var unit;
-
unit = 0;
while (size >= 1024) {
size /= 1024;
@@ -715,7 +693,6 @@
$.item = function(key, val) {
var item;
-
item = {};
item[key] = val;
return item;
@@ -726,7 +703,6 @@
$.sync = (function() {
chrome.storage.onChanged.addListener(function(changes) {
var cb, key;
-
for (key in changes) {
if (cb = $.syncing[key]) {
cb(changes[key].newValue);
@@ -746,7 +722,6 @@
$.get = function(key, val, cb) {
var count, done, items, localItems, syncItems;
-
if (typeof cb === 'function') {
items = $.item(key, val);
} else {
@@ -766,7 +741,6 @@
count = 0;
done = function(item) {
var lastError;
-
lastError = chrome.runtime.lastError;
if (lastError) {
c.error(lastError, lastError.message || 'No message.');
@@ -788,12 +762,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];
@@ -878,7 +850,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) {
@@ -954,7 +925,6 @@
Post.prototype.parseComment = function() {
var bq, i, node, nodes, text;
-
this.nodes.comment.normalize();
bq = this.nodes.comment.cloneNode(true);
nodes = $$('.abbr, .capcodeReplies, .exif, b', bq);
@@ -973,7 +943,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++) {
@@ -984,7 +953,6 @@
Post.prototype.parseQuote = function(quotelink) {
var fullID, match;
-
if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) {
return;
}
@@ -1000,7 +968,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;
}
@@ -1032,7 +999,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) {
@@ -1081,7 +1047,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');
@@ -1115,7 +1080,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++) {
@@ -1133,7 +1097,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'];
@@ -1221,7 +1184,6 @@
function DataBoard(key, sync, dontClean) {
var init,
_this = this;
-
this.key = key;
this.onSync = __bind(this.onSync, this);
this.data = Conf[key];
@@ -1245,7 +1207,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];
@@ -1266,7 +1227,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) {
@@ -1282,7 +1242,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;
@@ -1296,7 +1255,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) {
@@ -1320,7 +1278,6 @@
DataBoard.prototype.clean = function() {
var boardID, now, val, _ref;
-
_ref = this.data.boards;
for (boardID in _ref) {
val = _ref[boardID];
@@ -1340,10 +1297,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) {
@@ -1450,10 +1405,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);
@@ -1491,7 +1444,6 @@
init: function() {
var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, shortcutToggler,
_this = this;
-
this.menu = new UI.Menu('header');
menuButton = $.el('span', {
className: 'menu-button',
@@ -1592,7 +1544,6 @@
});
$.ready(function() {
var a, cs;
-
_this.footer = $.id('boardNavDesktopFoot');
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
a.className = 'current';
@@ -1627,7 +1578,6 @@
}),
setBoardList: function() {
var a, boardList, btn, fourchannav, fullBoardList;
-
fourchannav = $.id('boardNavDesktop');
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
a.className = 'current';
@@ -1649,7 +1599,6 @@
},
generateBoardList: function(text) {
var as, list, nodes;
-
list = $('#custom-board-list', Header.bar);
$.rmAll(list);
if (!text) {
@@ -1658,7 +1607,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);
}
@@ -1709,7 +1657,6 @@
},
toggleBoardList: function() {
var bar, custom, full, showBoardList;
-
bar = Header.bar;
custom = $('#custom-board-list', bar);
full = $('#full-board-list', bar);
@@ -1745,7 +1692,6 @@
},
toggleLinkJustify: function() {
var centered;
-
$.event('CloseMenu');
centered = this.nodeName === 'INPUT' ? this.checked : void 0;
Header.setLinkJustify(centered);
@@ -1789,7 +1735,6 @@
},
toggleBarVisibility: function() {
var hide, message;
-
hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
this.checked = hide;
$.set('Header auto-hide', Conf['Header auto-hide'] = hide);
@@ -1803,7 +1748,6 @@
},
toggleFooterVisibility: function() {
var hide, message;
-
$.event('CloseMenu');
hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden;
Header.setFooterVisibility(hide);
@@ -1813,7 +1757,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);
@@ -1826,14 +1769,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;
}
@@ -1844,7 +1785,6 @@
},
scrollToPost: function(post) {
var headRect, top;
-
top = post.getBoundingClientRect().top;
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
headRect = Header.bar.getBoundingClientRect();
@@ -1854,7 +1794,6 @@
},
addShortcut: function(el) {
var shortcut;
-
shortcut = $.el('span', {
className: 'shortcut brackets-wrap'
});
@@ -1866,7 +1805,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 Notice(type, content, lifetime);
if (cb) {
@@ -1876,7 +1814,6 @@
areNotificationsEnabled: false,
enableDesktopNotifications: function() {
var authorize, disable, el, notice, _ref;
-
if (!(window.Notification && Conf['Desktop Notifications'])) {
return;
}
@@ -1912,7 +1849,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);
@@ -1922,7 +1858,6 @@
},
postFromObject: function(data, boardID) {
var o;
-
o = {
postID: data.no,
threadID: data.resto || data.no,
@@ -1967,7 +1902,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/';
@@ -2066,7 +2000,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;
@@ -2103,7 +2036,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) {
@@ -2119,7 +2051,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);
@@ -2139,7 +2070,6 @@
},
postDataFromLink: function(link) {
var boardID, path, postID, threadID, _ref;
-
if (link.hostname === 'boards.4chan.org') {
path = link.pathname.split('/');
boardID = path[1];
@@ -2157,7 +2087,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) {
@@ -2186,14 +2115,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;
@@ -2216,7 +2143,6 @@
},
insert: function(post, root, context) {
var clone, nodes;
-
if (!root.parentNode) {
return;
}
@@ -2230,7 +2156,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;
@@ -2284,7 +2209,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;
@@ -2381,10 +2305,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,
@@ -2426,7 +2348,6 @@
Menu.prototype.makeMenu = function() {
var menu;
-
menu = $.el('div', {
className: 'dialog',
id: 'menu',
@@ -2441,7 +2362,6 @@
Menu.prototype.toggle = function(e, button, data) {
var previousButton;
-
e.preventDefault();
e.stopPropagation();
if (currentMenu) {
@@ -2459,7 +2379,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;
@@ -2498,7 +2417,6 @@
Menu.prototype.insertEntry = function(entry, parent, data) {
var subEntry, submenu, _i, _len, _ref;
-
if (typeof entry.open === 'function') {
if (!entry.open(data)) {
return;
@@ -2532,7 +2450,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);
@@ -2542,7 +2459,6 @@
Menu.prototype.keybinds = function(e) {
var entry, next, nextPrev, subEntry, submenu;
-
entry = $('.focused', currentMenu);
while (subEntry = $('.focused', entry)) {
entry = subEntry;
@@ -2588,7 +2504,6 @@
Menu.prototype.focus = function(entry) {
var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2;
-
while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
$.rmClass(focused, 'focused');
}
@@ -2616,7 +2531,6 @@
Menu.prototype.addEntry = function(e) {
var entry;
-
entry = e.detail;
if (entry.type !== this.type) {
return;
@@ -2627,7 +2541,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) {
@@ -2651,7 +2564,6 @@
})();
dragstart = function(e) {
var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
-
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -2690,7 +2602,6 @@
};
touchmove = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -2702,7 +2613,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 + '%';
@@ -2718,7 +2628,6 @@
};
touchend = function(e) {
var touch, _i, _len, _ref;
-
_ref = e.changedTouches;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
touch = _ref[_i];
@@ -2740,7 +2649,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,
@@ -2769,7 +2677,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;
@@ -2812,7 +2719,6 @@
},
node: function() {
var email, name, tripcode, _ref;
-
if (this.info.capcode || this.isClone) {
return;
}
@@ -2839,7 +2745,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;
}
@@ -2876,7 +2781,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;
@@ -2907,7 +2811,6 @@
},
createFilter: function(regexp, op, stub, hl, top) {
var settings, test;
-
test = typeof regexp === 'string' ? function(value) {
return regexp === value;
} : function(value) {
@@ -2931,7 +2834,6 @@
},
node: function() {
var filter, firstThread, key, result, thisThread, value, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -3043,7 +2945,6 @@
menu: {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) {
return;
}
@@ -3069,7 +2970,6 @@
},
createSubEntry: function(text, type) {
var el;
-
el = $.el('a', {
href: 'javascript:;',
textContent: text
@@ -3080,7 +2980,6 @@
el: el,
open: function(post) {
var value;
-
value = Filter[type](post);
return value !== false;
}
@@ -3088,7 +2987,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) {
@@ -3103,7 +3001,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);
@@ -3137,7 +3034,6 @@
},
node: function() {
var data;
-
if (!this.isReply || this.isClone) {
return;
}
@@ -3161,7 +3057,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub, replies, thisPost;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
return;
}
@@ -3232,7 +3127,6 @@
order: 20,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -3264,7 +3158,6 @@
order: 15,
open: function(post) {
var data;
-
if (!post.isReply || post.isClone || !post.isHidden) {
return false;
}
@@ -3281,7 +3174,6 @@
},
hide: function() {
var makeStub, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -3300,7 +3192,6 @@
},
show: function() {
var data, parent, post, replies, thisPost;
-
parent = this.parentNode;
thisPost = $('input[name=thisPost]', parent).checked;
replies = $('input[name=replies]', parent).checked;
@@ -3324,7 +3215,6 @@
},
hideStub: function() {
var post;
-
post = PostHiding.menu.post;
post.nodes.root.hidden = true;
$.event('CloseMenu');
@@ -3332,7 +3222,6 @@
},
makeButton: function(post, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-reply-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -3343,7 +3232,6 @@
},
saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
var data;
-
data = {
boardID: post.board.ID,
threadID: post.thread.ID,
@@ -3362,14 +3250,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'];
}
@@ -3404,7 +3290,6 @@
},
show: function(post, showRecursively) {
var quotelink, _i, _len, _ref;
-
if (showRecursively == null) {
showRecursively = Conf['Recursive Hiding'];
}
@@ -3440,7 +3325,6 @@
},
node: function() {
var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
-
if (this.isClone) {
return;
}
@@ -3458,7 +3342,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: [],
@@ -3469,7 +3352,6 @@
},
rm: function(recursive, post) {
var i, obj, rec, _i, _len, _ref;
-
if (!(obj = Recursive.recursives[post.fullID])) {
return;
}
@@ -3484,7 +3366,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;
@@ -3511,7 +3392,6 @@
},
node: function() {
var data;
-
if (data = ThreadHiding.db.get({
boardID: this.board.ID,
threadID: this.ID
@@ -3525,7 +3405,6 @@
},
syncCatalog: function() {
var hiddenThreads, hiddenThreadsOnCatalog, threadID;
-
hiddenThreads = ThreadHiding.db.get({
boardID: g.BOARD.ID,
defaultValue: {}
@@ -3552,7 +3431,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;
}
@@ -3578,7 +3456,6 @@
menu: {
init: function() {
var apply, div, hideStubLink, makeStub;
-
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
return;
}
@@ -3600,7 +3477,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || thread.isHidden) {
return false;
@@ -3628,7 +3504,6 @@
order: 20,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -3648,7 +3523,6 @@
order: 15,
open: function(_arg) {
var isReply, thread;
-
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
@@ -3659,7 +3533,6 @@
},
hide: function() {
var makeStub, thread;
-
makeStub = $('input', this.parentNode).checked;
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, makeStub);
@@ -3668,7 +3541,6 @@
},
show: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.show(thread);
ThreadHiding.saveHiddenState(thread);
@@ -3676,7 +3548,6 @@
},
hideStub: function() {
var thread;
-
thread = ThreadHiding.menu.thread;
ThreadHiding.hide(thread, false);
$.event('CloseMenu');
@@ -3684,7 +3555,6 @@
},
makeButton: function(thread, type) {
var a;
-
a = $.el('a', {
className: "" + type + "-thread-button",
innerHTML: " " + (type === 'hide' ? '-' : '+') + " ",
@@ -3696,7 +3566,6 @@
},
saveHiddenState: function(thread, makeStub) {
var hiddenThreadsOnCatalog;
-
hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
if (thread.isHidden) {
ThreadHiding.db.set({
@@ -3729,7 +3598,6 @@
},
hide: function(thread, makeStub) {
var OP, a, numReplies, opInfo, span, threadRoot;
-
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -3753,7 +3621,6 @@
},
show: function(thread) {
var threadRoot;
-
if (thread.stub) {
$.rm(thread.stub);
delete thread.stub;
@@ -3766,7 +3633,6 @@
QuoteBacklink = {
init: function() {
var format;
-
if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) {
return;
}
@@ -3784,7 +3650,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;
}
@@ -3822,7 +3687,6 @@
},
secondNode: function() {
var container;
-
if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
this.nodes.backlinkContainer = $('.container', this.nodes.info);
return;
@@ -3836,7 +3700,6 @@
},
getContainer: function(id) {
var _base;
-
return (_base = this.containers)[id] || (_base[id] = $.el('span', {
className: 'container'
}));
@@ -3859,7 +3722,6 @@
},
node: function() {
var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -3889,7 +3751,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];
@@ -3902,7 +3763,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];
@@ -3929,7 +3789,6 @@
},
toggle: function(e) {
var boardID, context, postID, threadID, _ref;
-
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -3955,7 +3814,6 @@
},
add: function(quotelink, boardID, threadID, postID, context) {
var inline, isBacklink, post, qroot, root;
-
isBacklink = $.hasClass(quotelink, 'backlink');
inline = $.el('div', {
id: "i" + postID,
@@ -3980,7 +3838,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);
@@ -4022,7 +3879,6 @@
},
node: function() {
var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref;
-
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -4065,7 +3921,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];
@@ -4074,7 +3929,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;
}
@@ -4118,7 +3972,6 @@
},
mouseout: function() {
var clone, post, root, _i, _len, _ref;
-
if (!(root = this.el.firstElementChild)) {
return;
}
@@ -4148,7 +4001,6 @@
},
node: function() {
var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
-
if (this.isClone) {
return;
}
@@ -4171,7 +4023,6 @@
QuoteThreading = {
init: function() {
var input;
-
if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
return;
}
@@ -4194,7 +4045,6 @@
},
setup: function() {
var ID, post, posts;
-
$.off(d, '4chanXInitFinished', QuoteThreading.setup);
posts = g.posts;
for (ID in posts) {
@@ -4207,7 +4057,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;
}
@@ -4237,7 +4086,6 @@
},
nodeinsert: function() {
var bottom, height, qpost, qroot, threadContainer, top, _ref;
-
qpost = g.posts[this.threaded];
delete this.threaded;
delete this.cb;
@@ -4266,7 +4114,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;
@@ -4283,7 +4130,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;
@@ -4304,7 +4150,6 @@
},
kb: function() {
var control;
-
control = $.id('threadingControl');
return control.click();
}
@@ -4331,7 +4176,6 @@
},
node: function() {
var quotelink, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -4355,7 +4199,6 @@
cb: {
seek: function(type) {
var highlight, post, posts, result, str;
-
if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
@@ -4411,7 +4254,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];
@@ -4426,7 +4268,6 @@
},
parseDeadlink: function(deadlink) {
var a, boardID, m, post, postID, quote, quoteID, redirect, _ref;
-
if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
Quotify.fixDeadlink(deadlink);
return;
@@ -4519,7 +4360,6 @@
},
node: function() {
var data, el, end, endNode, i, index, items, length, link, links, node, result, saved, snapshot, space, test, word, _i, _len, _ref;
-
if (this.isClone) {
if (Conf['Embedding']) {
i = 0;
@@ -4596,7 +4436,6 @@
},
makeRange: function(startNode, endNode, startOffset, endOffset) {
var range;
-
range = document.createRange();
range.setStart(startNode, startOffset);
range.setEnd(endNode, endOffset);
@@ -4604,7 +4443,6 @@
},
makeLink: function(range) {
var a, char, i, text;
-
text = range.toString();
i = 0;
while (/[(\[{<>]/.test(text.charAt(i))) {
@@ -4650,7 +4488,6 @@
},
services: function(link) {
var href, key, match, type, _ref;
-
href = link.href;
_ref = Linkify.types;
for (key in _ref) {
@@ -4663,7 +4500,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', {
@@ -4692,7 +4528,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;
@@ -4729,21 +4564,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',
@@ -4756,7 +4588,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) {
@@ -4796,7 +4627,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"
});
@@ -4807,7 +4637,6 @@
},
text: function(_arg) {
var file, files;
-
files = _arg.files;
for (file in files) {
if (files.hasOwnProperty(file)) {
@@ -4855,7 +4684,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
});
@@ -4866,7 +4694,6 @@
style: 'height: auto; width: 500px; display: inline-block;',
el: function(a) {
var div;
-
div = $.el('div', {
className: "soundcloud",
name: "soundcloud"
@@ -4892,7 +4719,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', {
@@ -4964,7 +4790,6 @@
QR = {
init: function() {
var sc;
-
if (!Conf['Quick Reply']) {
return;
}
@@ -5011,7 +4836,6 @@
},
initReady: function() {
var link;
-
QR.postingIsEnabled = !!$.id('postForm');
if (!QR.postingIsEnabled) {
return;
@@ -5031,13 +4855,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);
});
@@ -5067,7 +4889,6 @@
},
open: function() {
var err;
-
if (QR.nodes) {
QR.nodes.el.hidden = false;
QR.unhide();
@@ -5086,7 +4907,6 @@
},
close: function() {
var post, _i, _len, _ref;
-
if (QR.req) {
QR.abort();
return;
@@ -5136,7 +4956,6 @@
},
error: function(err) {
var el;
-
QR.open();
if (typeof err === 'string') {
el = $.tn(err);
@@ -5163,7 +4982,6 @@
},
notify: function(el) {
var notice, notif;
-
notice = new Notice('warning', el);
QR.notifications.push(notice);
if (!Header.areNotificationsEnabled) {
@@ -5187,7 +5005,6 @@
notifications: [],
cleanNotifications: function() {
var notification, _i, _len, _ref;
-
_ref = QR.notifications;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
notification = _ref[_i];
@@ -5197,7 +5014,6 @@
},
status: function() {
var disabled, status, thread, value;
-
if (!QR.nodes) {
return;
}
@@ -5219,7 +5035,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: [],
@@ -5239,7 +5054,6 @@
},
parseItem: function(item, types) {
var boards, match, type, val, _ref, _ref1;
-
if (item[0] === '#') {
return;
}
@@ -5268,7 +5082,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];
@@ -5281,7 +5094,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;
}
@@ -5290,7 +5102,6 @@
get: function(cb) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
return cb(persona);
});
@@ -5298,7 +5109,6 @@
set: function(post) {
return $.get('QR.persona', {}, function(_arg) {
var persona;
-
persona = _arg['QR.persona'];
persona = {
name: post.name,
@@ -5312,7 +5122,6 @@
cooldown: {
init: function() {
var board;
-
if (!Conf['Cooldown']) {
return;
}
@@ -5354,7 +5163,6 @@
},
sync: function(cooldowns) {
var id;
-
for (id in cooldowns) {
QR.cooldown.cooldowns[id] = cooldowns[id];
}
@@ -5362,7 +5170,6 @@
},
set: function(data) {
var cooldown, delay, hasFile, isReply, isSage, post, req, start, type, upSpd;
-
if (!Conf['Cooldown']) {
return;
}
@@ -5402,7 +5209,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;
@@ -5456,7 +5262,6 @@
},
quote: function(e) {
var caretPos, com, index, post, range, s, sel, text, thread, _ref;
-
if (e != null) {
e.preventDefault();
}
@@ -5494,7 +5299,6 @@
},
characterCount: function() {
var count, counter;
-
counter = QR.nodes.charCount;
count = QR.nodes.com.textLength;
counter.textContent = count;
@@ -5503,7 +5307,6 @@
},
drag: function(e) {
var toggle;
-
toggle = e.type === 'dragstart' ? $.off : $.on;
toggle(d, 'dragover', QR.dragOver);
return toggle(d, 'drop', QR.dropFile);
@@ -5523,7 +5326,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++) {
@@ -5547,7 +5349,6 @@
},
handleFiles: function(files) {
var file, isSingle, max, _i, _len;
-
if (this !== QR) {
files = __slice.call(this.files);
this.value = null;
@@ -5568,7 +5369,6 @@
},
handleFile: function(file, isSingle, max) {
var post;
-
if (file.size > max) {
QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
return;
@@ -5593,6 +5393,9 @@
return post.setFile(file);
},
openFileInput: function(e) {
+ if (e.keyCode && e.keyCode !== 32) {
+ return;
+ }
e.stopPropagation();
if (e.shiftKey && e.type === 'click') {
return QR.selected.rmFile();
@@ -5616,7 +5419,6 @@
this.select = __bind(this.select, this);
var el, event, prev, _i, _len, _ref,
_this = this;
-
el = $.el('a', {
className: 'qr-preview',
draggable: true,
@@ -5670,7 +5472,6 @@
_Class.prototype.rm = function() {
var index;
-
this["delete"]();
index = QR.posts.indexOf(this);
if (QR.posts.length === 1) {
@@ -5690,7 +5491,6 @@
_Class.prototype.lock = function(lock) {
var name, _i, _len, _ref;
-
if (lock == null) {
lock = true;
}
@@ -5715,7 +5515,6 @@
_Class.prototype.select = function() {
var rectEl, rectList;
-
if (QR.selected) {
QR.selected.nodes.el.id = null;
QR.selected.forceSave();
@@ -5732,7 +5531,6 @@
_Class.prototype.load = function() {
var name, _i, _len, _ref;
-
_ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
name = _ref[_i];
@@ -5744,7 +5542,6 @@
_Class.prototype.save = function(input) {
var name, _ref;
-
if (input.type === 'checkbox') {
this.spoiler = input.checked;
return;
@@ -5775,7 +5572,6 @@
_Class.prototype.forceSave = function() {
var name, _i, _len, _ref;
-
if (this !== QR.selected) {
return;
}
@@ -5805,11 +5601,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;
@@ -5860,7 +5654,6 @@
_Class.prototype.updateFilename = function() {
var long;
-
long = "" + this.filename + " (" + this.filesize + ")\nCtrl+click to edit filename. Shift+click to clear.";
this.nodes.el.title = long;
if (this !== QR.selected) {
@@ -5883,11 +5676,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;
@@ -5926,7 +5717,6 @@
_Class.prototype.drop = function() {
var el, index, newIndex, oldIndex, post;
-
$.rmClass(this, 'over');
if (!this.draggable) {
return;
@@ -5961,7 +5751,6 @@
ready: function() {
var imgContainer, input, setLifetime,
_this = this;
-
setLifetime = function(e) {
return _this.lifetime = e.detail;
};
@@ -5998,7 +5787,6 @@
});
$.get('captchas', [], function(_arg) {
var captchas;
-
captchas = _arg.captchas;
return _this.sync(captchas);
});
@@ -6013,7 +5801,6 @@
},
getOne: function() {
var captcha, challenge, response;
-
this.clear();
if (captcha = this.captchas.shift()) {
challenge = captcha.challenge, response = captcha.response;
@@ -6038,7 +5825,6 @@
},
save: function() {
var response;
-
if (!(response = this.nodes.input.value.trim())) {
return;
}
@@ -6053,7 +5839,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) {
@@ -6071,7 +5856,6 @@
},
load: function() {
var challenge;
-
if (!this.nodes.challenge.firstChild) {
return;
}
@@ -6084,7 +5868,6 @@
},
count: function() {
var count;
-
count = this.captchas.length;
this.nodes.input.placeholder = (function() {
switch (count) {
@@ -6117,7 +5900,6 @@
},
dialog: function() {
var check, dialog, i, items, key, mimeTypes, name, nodes, thread, value, _ref;
-
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top:0;right:0;', " ")
};
@@ -6223,7 +6005,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();
}
@@ -6337,7 +6118,6 @@
},
response: function() {
var URL, ban, board, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, req, resDoc, threadID, _, _ref, _ref1;
-
req = QR.req;
delete QR.req;
post = QR.posts[0];
@@ -6451,7 +6231,6 @@
FappeTyme = {
init: function() {
var el, input;
-
if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') {
return;
}
@@ -6486,7 +6265,6 @@
Gallery = {
init: function() {
var el;
-
if (g.VIEW === 'catalog' || g.BOARD === 'f' || !Conf['Gallery']) {
return;
}
@@ -6506,7 +6284,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6520,7 +6297,6 @@
},
build: function(image) {
var dialog, file, files, i, key, value, _ref;
-
Gallery.el = dialog = $.el('div', {
id: 'a-gallery',
innerHTML: "\n
×\n
\n
/ \n
\n
\n
![]()
\n
\n
\n
\n"
@@ -6561,7 +6337,6 @@
},
generateThumb: function(file) {
var double, thumb, title;
-
title = ($('.fileText a', file)).textContent;
thumb = ($('.fileThumb', file)).cloneNode(true);
if (double = $('img + img', thumb)) {
@@ -6578,7 +6353,6 @@
cb: {
keybinds: function(e) {
var cb, key;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -6604,7 +6378,6 @@
},
open: function(e) {
var el, img;
-
if (e) {
e.preventDefault();
}
@@ -6672,7 +6445,6 @@
},
node: function() {
var thumb, _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6697,7 +6469,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 fourchanx-icon icon-resize-small';
@@ -6731,7 +6502,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);
@@ -6741,7 +6511,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) {
@@ -6772,7 +6541,6 @@
},
expand: function(post, src) {
var img, thumb;
-
thumb = post.file.thumb;
if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) {
return;
@@ -6800,7 +6568,6 @@
},
completeExpand: function(post) {
var prev, thumb;
-
thumb = post.file.thumb;
if (!$.hasClass(thumb, 'expanding')) {
return;
@@ -6814,7 +6581,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)) {
@@ -6826,7 +6592,6 @@
},
error: function() {
var URL, post, src, timeoutID;
-
post = Get.postFromNode(this);
$.rm(this);
delete post.file.fullImage;
@@ -6852,7 +6617,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -6876,7 +6640,6 @@
menu: {
init: function() {
var conf, createSubEntry, el, name, subEntries, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Image Expansion']) {
return;
}
@@ -6900,7 +6663,6 @@
},
createSubEntry: function(name, desc) {
var input, label;
-
label = $.el('label', {
innerHTML: " " + name,
title: desc
@@ -6934,7 +6696,6 @@
},
node: function() {
var _ref;
-
if (!((_ref = this.file) != null ? _ref.isImage : void 0)) {
return;
}
@@ -6942,7 +6703,6 @@
},
mouseover: function(e) {
var el, post;
-
post = Get.postFromNode(this);
el = $.el('img', {
id: 'ihover',
@@ -6964,7 +6724,6 @@
error: function() {
var URL, post, src, timeoutID,
_this = this;
-
if (!doc.contains(this)) {
return;
}
@@ -6989,7 +6748,6 @@
return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", {
onload: function() {
var postObj, _i, _len, _ref;
-
if (this.status !== 200) {
return;
}
@@ -7015,7 +6773,6 @@
ImageLoader = {
init: function() {
var prefetch;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -7042,7 +6799,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;
}
@@ -7064,7 +6820,6 @@
},
toggle: function() {
var enabled, id, post, _ref;
-
enabled = Conf['prefetch'] = this.checked;
if (enabled) {
_ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts;
@@ -7088,7 +6843,6 @@
},
node: function() {
var thumb, _ref;
-
if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) {
return;
}
@@ -7101,7 +6855,6 @@
Sauce = {
init: function() {
var err, link, links, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Sauce']) {
return;
}
@@ -7131,7 +6884,6 @@
},
createSauceLink: function(link) {
var m, text;
-
link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) {
switch (parameter) {
case '%TURL':
@@ -7152,7 +6904,6 @@
},
node: function() {
var link, nodes, _i, _len, _ref;
-
if (this.isClone || !this.file) {
return;
}
@@ -7169,7 +6920,6 @@
ArchiveLink = {
init: function() {
var div, entry, type, _i, _len, _ref;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) {
return;
}
@@ -7182,7 +6932,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,
@@ -7201,14 +6950,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,
@@ -7218,7 +6965,6 @@
return true;
} : function(post) {
var value;
-
value = Filter[type](post);
if (!value) {
return false;
@@ -7241,7 +6987,6 @@
DeleteLink = {
init: function() {
var div, fileEl, fileEntry, postEl, postEntry;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) {
return;
}
@@ -7269,7 +7014,6 @@
el: fileEl,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file || file.isDead) {
return false;
@@ -7285,7 +7029,6 @@
order: 40,
open: function(post) {
var node;
-
if (post.isDead || post.board.ID === 'q') {
return false;
}
@@ -7300,7 +7043,6 @@
},
"delete": function() {
var fileOnly, form, link, post;
-
post = DeleteLink.post;
if (DeleteLink.cooldown.counting === post) {
return;
@@ -7330,7 +7072,6 @@
},
load: function(link, post, fileOnly, resDoc) {
var msg, s;
-
if (resDoc.title === '4chan - Banned') {
s = 'Banned!';
} else if (msg = resDoc.getElementById('errmsg')) {
@@ -7351,7 +7092,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,
@@ -7385,7 +7125,6 @@
DownloadLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) {
return;
}
@@ -7399,7 +7138,6 @@
order: 100,
open: function(_arg) {
var file;
-
file = _arg.file;
if (!file) {
return false;
@@ -7432,7 +7170,6 @@
},
makeButton: (function() {
var a;
-
a = $.el('a', {
className: 'menu-button brackets-wrap',
innerHTML: '',
@@ -7440,7 +7177,6 @@
});
return function() {
var button;
-
button = a.cloneNode(true);
$.on(button, 'click', Menu.toggle);
return button;
@@ -7448,7 +7184,6 @@
})(),
toggle: function(e) {
var post;
-
post = Get.postFromNode(this);
return Menu.menu.toggle(e, this, post);
}
@@ -7457,7 +7192,6 @@
ReportLink = {
init: function() {
var a;
-
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) {
return;
}
@@ -7479,7 +7213,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();
@@ -7492,7 +7225,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;
@@ -7566,7 +7298,6 @@
init: function() {
var sc,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
return;
}
@@ -7595,7 +7326,6 @@
},
node: function() {
var ID, fileCount, post, postCount, _ref;
-
postCount = 0;
fileCount = 0;
_ref = this.posts;
@@ -7613,7 +7343,6 @@
},
onUpdate: function(e) {
var fileCount, postCount, _ref;
-
if (e.detail[404]) {
return;
}
@@ -7622,7 +7351,6 @@
},
update: function(postCount, fileCount) {
var fileCountEl, postCountEl, thread;
-
thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl;
postCountEl.textContent = postCount;
fileCountEl.textContent = fileCount;
@@ -7647,7 +7375,6 @@
},
onThreadsLoad: function() {
var page, pages, thread, _i, _j, _len, _len1, _ref;
-
if (!(Conf["Page Count in Stats"] && this.status === 200)) {
return;
}
@@ -7671,7 +7398,6 @@
init: function() {
var checked, conf, el, input, name, sc, settings, subEntries, _ref,
_this = this;
-
if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
return;
}
@@ -7821,7 +7547,6 @@
},
interval: function() {
var val;
-
val = +this.value;
if (val < 1) {
val = 1;
@@ -7831,7 +7556,6 @@
},
load: function() {
var klass, req, text, _ref;
-
req = ThreadUpdater.req;
switch (req.status) {
case 200:
@@ -7864,7 +7588,6 @@
},
getInterval: function() {
var i, j;
-
i = ThreadUpdater.interval;
j = Math.min(ThreadUpdater.outdateCount, 10);
if (!d.hidden) {
@@ -7874,14 +7597,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;
@@ -7894,7 +7615,6 @@
},
timeout: function() {
var n;
-
ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
if (!(n = --ThreadUpdater.seconds)) {
return ThreadUpdater.update();
@@ -7907,7 +7627,6 @@
},
update: function() {
var url;
-
if (!ThreadUpdater.online) {
return;
}
@@ -7930,7 +7649,6 @@
},
updateThreadStatus: function(title, OP) {
var icon, message, root, titleLC;
-
titleLC = title.toLowerCase();
if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) {
return;
@@ -7957,7 +7675,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);
@@ -8043,7 +7760,6 @@
}
$.queueTask(function() {
var length, threadID;
-
threadID = ThreadUpdater.thread.ID;
length = $$('.thread > .postContainer', ThreadUpdater.root).length;
return Fourchan.parseThread(threadID, length - count, length);
@@ -8064,7 +7780,6 @@
ThreadWatcher = {
init: function() {
var now, sc;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -8097,7 +7812,6 @@
}
$.get('WatchedThreads', null, function(_arg) {
var WatchedThreads, boardID, data, threadID, threads, _ref;
-
WatchedThreads = _arg.WatchedThreads;
if (!WatchedThreads) {
return;
@@ -8123,7 +7837,6 @@
},
node: function() {
var toggler;
-
toggler = $.el('img', {
className: 'watch-thread-link'
});
@@ -8145,7 +7858,6 @@
}
return $.get('AutoWatch', 0, function(_arg) {
var AutoWatch, thread;
-
AutoWatch = _arg.AutoWatch;
if (!(thread = g.BOARD.threads[AutoWatch])) {
return;
@@ -8161,7 +7873,6 @@
cb: {
openAll: function() {
var a, _i, _len, _ref;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -8180,7 +7891,6 @@
},
pruneDeads: function() {
var boardID, data, threadID, _i, _len, _ref, _ref1;
-
if ($.hasClass(this, 'disabled')) {
return;
}
@@ -8204,13 +7914,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']) {
@@ -8222,7 +7930,6 @@
},
threadUpdate: function(e) {
var thread;
-
thread = e.detail.thread;
if (!(e.detail[404] && ThreadWatcher.db.get({
boardID: thread.board.ID,
@@ -8239,7 +7946,6 @@
},
fetchAllStatus: function() {
var thread, threads, _i, _len;
-
if (!(threads = ThreadWatcher.getAll()).length) {
return;
}
@@ -8251,7 +7957,6 @@
},
fetchStatus: function(_arg) {
var boardID, data, fetchCount, threadID;
-
boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
if (data.isDead) {
return;
@@ -8261,7 +7966,6 @@
return $.ajax("//api.4chan.org/" + boardID + "/res/" + threadID + ".json", {
onloadend: function() {
var status;
-
fetchCount.fetched++;
if (fetchCount.fetched === fetchCount.fetching) {
fetchCount.fetched = 0;
@@ -8292,7 +7996,6 @@
},
getAll: function() {
var all, boardID, data, threadID, threads, _ref;
-
all = [];
_ref = ThreadWatcher.db.data.boards;
for (boardID in _ref) {
@@ -8313,7 +8016,6 @@
},
makeLine: function(boardID, threadID, data) {
var div, fullID, href, link, x;
-
x = $.el('a', {
textContent: '×',
href: 'javascript:;'
@@ -8344,7 +8046,6 @@
},
refresh: function() {
var boardID, data, helper, list, nodes, refresher, thread, threadID, toggler, watched, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3;
-
nodes = [];
_ref = ThreadWatcher.getAll();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -8374,7 +8075,6 @@
},
toggle: function(thread) {
var boardID, threadID;
-
boardID = thread.board.ID;
threadID = thread.ID;
if (ThreadWatcher.db.get({
@@ -8388,7 +8088,6 @@
},
add: function(thread) {
var boardID, data, threadID;
-
data = {};
boardID = thread.board.ID;
threadID = thread.ID;
@@ -8419,7 +8118,6 @@
},
convert: function(oldFormat) {
var boardID, data, newFormat, threadID, threads;
-
newFormat = {};
for (boardID in oldFormat) {
threads = oldFormat[boardID];
@@ -8436,7 +8134,6 @@
refreshers: [],
init: function() {
var menu;
-
if (!Conf['Thread Watcher']) {
return;
}
@@ -8449,7 +8146,6 @@
},
addHeaderMenuEntry: function() {
var entryEl;
-
if (g.VIEW !== 'thread') {
return;
}
@@ -8466,7 +8162,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);
@@ -8475,7 +8170,6 @@
},
addMenuEntries: function() {
var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1, _results;
-
entries = [];
entries.push({
cb: ThreadWatcher.cb.openAll,
@@ -8546,7 +8240,6 @@
},
createSubEntry: function(name, desc) {
var entry, input;
-
entry = {
type: 'thread watcher',
el: $.el('label', {
@@ -8598,7 +8291,6 @@
},
ready: function() {
var ID, post, posts, _ref;
-
$.off(d, '4chanXInitFinished', Unread.ready);
posts = [];
_ref = Unread.thread.posts;
@@ -8613,7 +8305,6 @@
},
scroll: function() {
var checkPosition, hash, onload, post, posts, root;
-
if (!Conf['Scroll to Last Read Post']) {
return;
}
@@ -8650,7 +8341,6 @@
},
sync: function() {
var lastReadPost;
-
lastReadPost = Unread.db.get({
boardID: Unread.thread.board.ID,
threadID: Unread.thread.ID,
@@ -8669,7 +8359,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;
@@ -8697,7 +8386,6 @@
},
addPostQuotingYou: function(post) {
var quotelink, _i, _len, _ref;
-
if (!QR.db) {
return;
}
@@ -8713,7 +8401,6 @@
},
openNotification: function(post) {
var name, notif;
-
if (!Header.areNotificationsEnabled) {
return;
}
@@ -8739,7 +8426,6 @@
},
readSinglePost: function(post) {
var i;
-
if ((i = Unread.posts.indexOf(post)) === -1) {
return;
}
@@ -8755,7 +8441,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) {
@@ -8766,7 +8451,6 @@
},
read: $.debounce(50, function(e) {
var ID, height, i, post, posts;
-
if (d.hidden || !Unread.posts.length) {
return;
}
@@ -8819,7 +8503,6 @@
}),
setLine: function(force) {
var post;
-
if (!(d.hidden || force === true)) {
return;
}
@@ -8832,7 +8515,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);
@@ -8859,7 +8541,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];
@@ -8991,7 +8672,6 @@
},
to: function(dest, data) {
var archive;
-
archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
if (!archive) {
return '';
@@ -9000,7 +8680,6 @@
},
protocol: function(archive) {
var protocol;
-
protocol = location.protocol;
if (!archive[protocol.slice(0, -1)]) {
protocol = protocol === 'https:' ? 'http:' : 'https:';
@@ -9009,7 +8688,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') {
@@ -9022,7 +8700,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)) {
@@ -9034,13 +8711,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);
@@ -9059,7 +8734,6 @@
},
setup: function() {
var btn, entry, psa;
-
$.off(d, '4chanXInitFinished', PSAHiding.setup);
if (!(psa = $.id('globalMessage'))) {
$.rmClass(doc, 'hide-announcement');
@@ -9088,7 +8762,6 @@
$.on(btn, 'click', PSAHiding.toggle);
$.get('hiddenPSA', 0, function(_arg) {
var hiddenPSA;
-
hiddenPSA = _arg.hiddenPSA;
PSAHiding.sync(hiddenPSA);
$.before(psa, btn);
@@ -9098,7 +8771,6 @@
},
toggle: function(e) {
var UTC;
-
if ($.hasClass(this, 'hide-announcement')) {
UTC = +$.id('globalMessage').dataset.utc;
$.set('hiddenPSA', UTC);
@@ -9110,7 +8782,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') {
@@ -9131,7 +8802,6 @@
},
ready: function() {
var banner, child, children, i;
-
banner = $(".boardBanner");
children = banner.children;
i = 0;
@@ -9151,7 +8821,6 @@
cb: {
toggle: (function() {
var types;
-
types = {
jpg: 227,
png: 270,
@@ -9159,7 +8828,6 @@
};
return function() {
var num, type;
-
type = Object.keys(types)[Math.floor(3 * Math.random())];
num = Math.floor(types[type] * Math.random());
return this.src = "//static.4chan.org/image/title/" + num + "." + type;
@@ -9179,7 +8847,6 @@
},
focus: function() {
var items, string, string2;
-
this.textContent = this.innerHTML;
string = "" + g.BOARD + "." + this.className;
string2 = "" + string + ".orig";
@@ -9202,7 +8869,6 @@
},
custom: function(child) {
var cachedTest, string;
-
cachedTest = child.innerHTML;
string = "" + g.BOARD + "." + child.className;
$.on(child, 'click keydown focus blur', function(e) {
@@ -9210,7 +8876,6 @@
});
$.get(string, cachedTest, function(item) {
var string2, title;
-
if (!(title = item[string])) {
return;
}
@@ -9234,7 +8899,6 @@
CatalogLinks = {
init: function() {
var el, input;
-
if (!Conf['Catalog Links']) {
return;
}
@@ -9258,14 +8922,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++) {
@@ -9300,7 +8962,6 @@
},
node: function() {
var str, uid;
-
if (this.isClone || !(str = this.info.uniqueID)) {
return;
}
@@ -9312,7 +8973,6 @@
},
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;
@@ -9324,7 +8984,6 @@
},
hash: function(str) {
var i, msg;
-
msg = 0;
i = 0;
while (i < 8) {
@@ -9370,7 +9029,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;
}
@@ -9382,7 +9040,6 @@
Emoji = {
init: function() {
var css, icon, name, pos, _ref;
-
if (!Conf['Emoji']) {
return;
}
@@ -9452,7 +9109,6 @@
},
node: function() {
var a;
-
if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
return $.on(a, 'click', ExpandComment.cb);
}
@@ -9464,7 +9120,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;
@@ -9480,7 +9135,6 @@
},
contract: function(post) {
var a;
-
if (!post.nodes.shortComment) {
return;
}
@@ -9491,7 +9145,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 + ")";
@@ -9554,7 +9207,6 @@
},
node: function() {
var a, files, posts, span, _ref;
-
if (!(span = $.x('following-sibling::span[contains(@class,"summary")][1]', this.OP.nodes.root))) {
return;
}
@@ -9575,7 +9227,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) {
@@ -9653,7 +9304,6 @@
},
parse: function(req, thread, a) {
var filesCount, link, post, posts, postsCount, postsObj, postsRoot, reply, root, spoilerRange, _i, _len;
-
if (a.textContent[0] === '+') {
return;
}
@@ -9717,7 +9367,6 @@
},
createFunc: function(format) {
var code;
-
code = format.replace(/%(.)/g, function(s, c) {
if (c in FileInfo.formatters) {
return "' + FileInfo.formatters." + c + ".call(post) + '";
@@ -9729,7 +9378,6 @@
},
convertUnit: function(size, unit) {
var i;
-
if (unit === 'B') {
return "" + (size.toFixed()) + " Bytes";
}
@@ -9760,7 +9408,6 @@
},
n: function() {
var fullname, shortname;
-
fullname = this.file.name;
shortname = Build.shortFilename(this.file.name, this.isReply);
if (fullname === shortname) {
@@ -9804,7 +9451,6 @@
Fourchan = {
init: function() {
var board;
-
if (g.VIEW === 'catalog') {
return;
}
@@ -9826,7 +9472,6 @@
},
code: function() {
var pre, _i, _len, _ref;
-
if (this.isClone) {
return;
}
@@ -9855,13 +9500,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]');
@@ -9874,7 +9517,6 @@
},
keydown: function(e) {
var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len;
-
if (!(key = Keybinds.keyCode(e))) {
return;
}
@@ -10052,7 +9694,6 @@
},
keyCode: function(e) {
var kc, key;
-
key = (function() {
switch (kc = e.keyCode) {
case 8:
@@ -10108,7 +9749,6 @@
},
tags: function(tag, ta) {
var range, selEnd, selStart, value;
-
value = ta.value;
selStart = ta.selectionStart;
selEnd = ta.selectionEnd;
@@ -10119,13 +9759,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 {
@@ -10135,7 +9773,6 @@
},
open: function(thread, tab) {
var url;
-
if (g.VIEW !== 'index') {
return;
}
@@ -10148,7 +9785,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');
@@ -10208,7 +9844,6 @@
Nav = {
init: function() {
var append, next, prev, span;
-
switch (g.VIEW) {
case 'index':
if (!Conf['Index Navigation']) {
@@ -10259,7 +9894,6 @@
},
getThread: function(full) {
var headRect, i, rect, thread, threads, topMargin, _i, _len;
-
if (Conf['Bottom header'] || !Conf['Fixed Header']) {
topMargin = 0;
} else {
@@ -10285,7 +9919,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)) {
@@ -10310,7 +9943,6 @@
},
node: function() {
var dateEl;
-
if (this.isClone) {
return;
}
@@ -10320,7 +9952,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) {
@@ -10331,7 +9962,6 @@
stale: [],
flush: function() {
var now, update, _i, _len, _ref;
-
if (d.hidden) {
return;
}
@@ -10347,16 +9977,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);
@@ -10397,7 +10024,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];
@@ -10417,7 +10043,6 @@
},
ready: function() {
var field;
-
field = $.id('recaptcha_response_field');
$.on(field, 'keydown', function(e) {
if (e.keyCode === 8 && !field.value) {
@@ -10426,7 +10051,6 @@
});
return $.on($('form'), 'submit', function(e) {
var response;
-
e.preventDefault();
response = field.value.trim();
if (!/\s/.test(response)) {
@@ -10456,7 +10080,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) + '";
@@ -10541,7 +10164,6 @@
Settings = {
init: function() {
var link, settings;
-
link = $.el('a', {
className: 'settings-link fourchanx-icon icon-wrench',
textContent: 'Settings',
@@ -10551,7 +10173,6 @@
Header.addShortcut(link);
$.get('previousversion', null, function(item) {
var changelog, el, previous;
-
if (previous = item['previousversion']) {
if (previous === g.VERSION) {
return;
@@ -10586,7 +10207,6 @@
},
open: function(openSection) {
var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
-
$.off(d, '4chanXInitFinished', Settings.open);
if (Settings.dialog) {
return;
@@ -10639,7 +10259,6 @@
sections: [],
addSection: function(title, open) {
var hyphenatedTitle, _ref;
-
if (typeof title !== 'string') {
_ref = title.detail, title = _ref.title, open = _ref.open;
}
@@ -10652,7 +10271,6 @@
},
openSection: function() {
var section, selected;
-
if (selected = $('.tab-selected', Settings.dialog)) {
$.rmClass(selected, 'tab-selected');
}
@@ -10666,7 +10284,6 @@
},
main: function(section) {
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref;
-
items = {};
inputs = {};
_ref = Config.main;
@@ -10691,7 +10308,6 @@
}
$.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].checked = val;
@@ -10706,7 +10322,6 @@
boards: {}
}, function(item) {
var ID, board, thread, _ref1;
-
_ref1 = item.hiddenThreads.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -10721,7 +10336,6 @@
boards: {}
}, function(item) {
var ID, board, post, thread, _ref1;
-
_ref1 = item.hiddenPosts.boards;
for (ID in _ref1) {
board = _ref1[ID];
@@ -10741,7 +10355,6 @@
boards: {}
}, function(item) {
var boardID;
-
for (boardID in item.hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
@@ -10752,7 +10365,6 @@
},
"export": function(now, data) {
var a, db, _i, _len, _ref;
-
if (typeof now !== 'number') {
now = Date.now();
data = {
@@ -10787,7 +10399,6 @@
},
onImport: function() {
var file, output, reader;
-
if (!(file = this.files[0])) {
return;
}
@@ -10799,7 +10410,6 @@
reader = new FileReader();
reader.onload = function(e) {
var data, err;
-
try {
data = JSON.parse(e.target.result);
Settings.loadSettings(data);
@@ -10816,7 +10426,6 @@
},
loadSettings: function(data) {
var key, val, version, _ref;
-
version = data.version.split('.');
if (version[0] === '2') {
data = Settings.convertSettings(data, {
@@ -10904,7 +10513,6 @@
},
convertSettings: function(data, map) {
var newKey, prevKey;
-
for (prevKey in map) {
newKey = map[prevKey];
if (newKey) {
@@ -10916,7 +10524,6 @@
},
filter: function(section) {
var select;
-
section.innerHTML = "";
select = $('select', section);
$.on(select, 'change', Settings.selectFilter);
@@ -10924,7 +10531,6 @@
},
selectFilter: function() {
var div, name, ta;
-
div = this.nextElementSibling;
if ((name = this.value) !== 'guide') {
$.rmAll(div);
@@ -10944,7 +10550,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) {
@@ -10954,7 +10559,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 = {};
@@ -10974,7 +10578,6 @@
$.on(ta, 'change', $.cb.value);
$.get(items, function(items) {
var key, val;
-
for (key in items) {
val = items[key];
if (['emojiPos'].contains(key)) {
@@ -11045,7 +10648,6 @@
});
$.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
var option, selectedArchives, type;
-
selectedArchives = _arg.selectedArchives;
for (boardID in selectedArchives) {
data = selectedArchives[boardID];
@@ -11060,7 +10662,6 @@
},
addArchiveCell: function(boardID, data, type) {
var archive, i, length, options, select, td;
-
length = data[type].length;
td = $.el('td', {
className: 'archive-cell'
@@ -11090,10 +10691,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);
@@ -11104,7 +10703,6 @@
},
time: function() {
var funk;
-
funk = Time.createFunc(this.value);
return this.nextElementSibling.textContent = funk(Time, new Date());
},
@@ -11113,7 +10711,6 @@
},
fileInfo: function() {
var data, funk;
-
data = {
isReply: true,
file: {
@@ -11152,7 +10749,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 = {};
@@ -11173,7 +10769,6 @@
}
return $.get(items, function(items) {
var val;
-
for (key in items) {
val = items[key];
inputs[key].value = val;
@@ -11182,7 +10777,6 @@
},
keybind: function(e) {
var key;
-
if (e.keyCode === 9) {
return;
}
@@ -11199,10 +10793,8 @@
Main = {
init: function() {
var db, flatten, _i, _len, _ref;
-
flatten = function(parent, obj) {
var key, val;
-
if (obj instanceof Array) {
Conf[parent] = obj[0];
} else if (typeof obj === 'object') {
@@ -11244,7 +10836,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') {
@@ -11272,7 +10863,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('/');
@@ -11289,7 +10879,6 @@
}
init = function(features) {
var err, module, name;
-
for (name in features) {
module = features[name];
try {
@@ -11369,7 +10958,6 @@
},
initStyle: function() {
var mainStyleSheet, setStyle, style, styleSheets, _ref;
-
$.off(d, '4chanMainInit', Main.initStyle);
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return;
@@ -11391,7 +10979,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];
@@ -11413,7 +11000,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', {
@@ -11481,7 +11067,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++) {
@@ -11509,11 +11094,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);
@@ -11532,7 +11115,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];
@@ -11566,7 +11148,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);
@@ -11586,7 +11167,6 @@
},
handleErrors: function(errors) {
var div, error, logs, _i, _len;
-
if (!(errors instanceof Array)) {
error = errors;
} else if (errors.length === 1) {
@@ -11601,7 +11181,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', {
@@ -11615,7 +11194,6 @@
},
parseError: function(data) {
var error, message;
-
Main.logError(data);
message = $.el('div', {
textContent: data.message
@@ -11632,7 +11210,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/Posting/QuickReply.coffee b/src/Posting/QuickReply.coffee
index 4a9ad2e92..e5d6738f5 100755
--- a/src/Posting/QuickReply.coffee
+++ b/src/Posting/QuickReply.coffee
@@ -496,6 +496,7 @@ QR =
post.setFile file
openFileInput: (e) ->
+ return if e.keyCode and e.keyCode isnt 32
e.stopPropagation()
if e.shiftKey and e.type is 'click'
return QR.selected.rmFile()