diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8e014f2bd..c07d1fa55 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,14 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor
The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x).
+### v1.10.2
+
+**v1.10.2.0** *(2015-02-22)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.2.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.2.0/builds/4chan-X-noupdate.crx "Chromium version")]
+- Remove `Unique ID` from the archive search menu as IDs on /pol/ no longer persist between threads.
+- (AchtBit) `Custom Cooldown Time` (in the advanced settings): Allows setting a cooldown time between posts longer than 4chan's cooldowns.
+- Make highlighting of posts more consistent.
+- (ccd0, Nebukazar, hotdogman, fgsfdss) Various aesthetic tweaks.
+
### v1.10.1
**v1.10.1.14** *(2015-02-22)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.1.14/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.1.14/builds/4chan-X-noupdate.crx "Chromium version")]
diff --git a/LICENSE b/LICENSE
index 433d5ca39..bf9999b22 100755
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
/*
-* 4chan X - Version 1.10.1.14
+* 4chan X - Version 1.10.2.0
*
* Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx
index 42d7d8bd6..881f7b965 100644
Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ
diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js
index 0a250e162..49ee4d425 100644
--- a/builds/4chan-X-beta.meta.js
+++ b/builds/4chan-X-beta.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
-// @version 1.10.1.14
+// @version 1.10.2.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js
index 2304210aa..837977aeb 100644
--- a/builds/4chan-X-beta.user.js
+++ b/builds/4chan-X-beta.user.js
@@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X beta
-// @version 1.10.1.14
+// @version 1.10.2.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -26,7 +26,7 @@
// ==/UserScript==
/*
-* 4chan X - Version 1.10.1.14
+* 4chan X - Version 1.10.2.0
*
* Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
@@ -110,26 +110,11 @@
(function() {
var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g,
- __slice = [].slice,
- __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
-
- Array.prototype.indexOf = function(val, i) {
- var len;
- i || (i = 0);
- len = this.length;
- while (i < len) {
- if (this[i] === val) {
- return i;
- }
- i++;
- }
- return -1;
- };
-
- __indexOf = [].indexOf;
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
Config = {
main: {
@@ -394,7 +379,9 @@
'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.']
},
'Interval': 30
- }
+ },
+ customCooldown: 0,
+ customCooldownEnabled: true
};
Conf = {};
@@ -406,7 +393,7 @@
doc = d.documentElement;
g = {
- VERSION: '1.10.1.14',
+ VERSION: '1.10.2.0',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@@ -567,10 +554,10 @@
return;
}
$.on(req, 'load', function(e) {
- var _i, _len, _ref;
- _ref = this.callbacks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- cb = _ref[_i];
+ var k, len1, ref;
+ ref = this.callbacks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ cb = ref[k];
cb.call(this, e);
}
this.evt = e;
@@ -652,19 +639,19 @@
};
$.addClass = function() {
- var className, classNames, el, _i, _len;
- el = arguments[0], classNames = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- for (_i = 0, _len = classNames.length; _i < _len; _i++) {
- className = classNames[_i];
+ var className, classNames, el, k, len1;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (k = 0, len1 = classNames.length; k < len1; k++) {
+ className = classNames[k];
el.classList.add(className);
}
};
$.rmClass = function() {
- var className, classNames, el, _i, _len;
- el = arguments[0], classNames = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- for (_i = 0, _len = classNames.length; _i < _len; _i++) {
- className = classNames[_i];
+ var className, classNames, el, k, len1;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (k = 0, len1 = classNames.length; k < len1; k++) {
+ className = classNames[k];
el.classList.remove(className);
}
};
@@ -674,7 +661,7 @@
};
$.hasClass = function(el, className) {
- return __indexOf.call(el.classList, className) >= 0;
+ return indexOf.call(el.classList, className) >= 0;
};
$.rm = function(el) {
@@ -694,13 +681,13 @@
};
$.nodes = function(nodes) {
- var frag, node, _i, _len;
+ var frag, k, len1, node;
if (!(nodes instanceof Array)) {
return nodes;
}
frag = $.frag();
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- node = nodes[_i];
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ node = nodes[k];
frag.appendChild(node);
}
return frag;
@@ -736,19 +723,19 @@
};
$.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];
+ var event, k, len1, ref;
+ ref = events.split(' ');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
el.addEventListener(event, handler, false);
}
};
$.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];
+ var event, k, len1, ref;
+ ref = events.split(' ');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
el.removeEventListener(event, handler, false);
}
};
@@ -840,7 +827,7 @@
unit++;
}
size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size);
- return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit];
+ return size + " " + ['B', 'KB', 'MB', 'GB'][unit];
};
$.minmax = function(value, min, max) {
@@ -887,9 +874,9 @@
return cb(void 0, key);
}
};
- $.on(window, 'storage', function(_arg) {
+ $.on(window, 'storage', function(arg) {
var key;
- key = _arg.key;
+ key = arg.key;
return onChange(key);
});
return $.forceSync = function(key) {
@@ -898,12 +885,12 @@
})();
$["delete"] = function(keys) {
- var key, _i, _len;
+ var k, key, len1;
if (!(keys instanceof Array)) {
keys = [keys];
}
- for (_i = 0, _len = keys.length; _i < _len; _i++) {
- key = keys[_i];
+ for (k = 0, len1 = keys.length; k < len1; k++) {
+ key = keys[k];
key = g.NAMESPACE + key;
GM_deleteValue(key);
if (key in $.syncing) {
@@ -962,34 +949,34 @@
$["delete"](Object.keys(Conf));
$["delete"](['previousversion', 'AutoWatch', 'cooldown.global', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']);
$["delete"]((function() {
- var _i, _len, _ref, _results;
- _ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- id = _ref[_i];
- _results.push("" + id + ".position");
+ var k, len1, ref, results;
+ ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ id = ref[k];
+ results.push(id + ".position");
}
- return _results;
+ return results;
})());
boards = (function() {
- var _i, _len, _ref, _results;
- _ref = $$('#boardNavDesktop > .boardList > a');
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
- _results.push(a.textContent);
+ var k, len1, ref, results;
+ ref = $$('#boardNavDesktop > .boardList > a');
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
+ results.push(a.textContent);
}
- return _results;
+ return results;
})();
boards.push('qa');
$["delete"]((function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = boards.length; _i < _len; _i++) {
- board = boards[_i];
- _results.push("cooldown." + board);
+ var k, len1, results;
+ results = [];
+ for (k = 0, len1 = boards.length; k < len1; k++) {
+ board = boards[k];
+ results.push("cooldown." + board);
}
- return _results;
+ return results;
})());
try {
$["delete"](GM_listValues().map(function(key) {
@@ -1003,18 +990,18 @@
if (root == null) {
root = d.body;
}
- return __slice.call(root.querySelectorAll(selector));
+ return slice.call(root.querySelectorAll(selector));
};
Callbacks = (function() {
- function Callbacks(type) {
- this.type = type;
+ function Callbacks(type1) {
+ this.type = type1;
this.keys = [];
}
- Callbacks.prototype.push = function(_arg) {
+ Callbacks.prototype.push = function(arg) {
var cb, name;
- name = _arg.name, cb = _arg.cb;
+ name = arg.name, cb = arg.cb;
if (!this[name]) {
this.keys.push(name);
}
@@ -1022,10 +1009,10 @@
};
Callbacks.prototype.execute = function(node) {
- var err, errors, name, _i, _len, _ref;
- _ref = this.keys;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ var err, errors, k, len1, name, ref;
+ ref = this.keys;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
try {
this[name].call(node);
} catch (_error) {
@@ -1053,8 +1040,8 @@
return this.ID;
};
- function Board(ID) {
- this.ID = ID;
+ function Board(ID1) {
+ this.ID = ID1;
this.threads = new SimpleDict();
this.posts = new SimpleDict();
g.boards[this] = this;
@@ -1071,10 +1058,10 @@
return this.ID;
};
- function Thread(ID, board) {
- this.ID = ID;
- this.board = board;
- this.fullID = "" + this.board + "." + this.ID;
+ function Thread(ID1, board1) {
+ this.ID = ID1;
+ this.board = board1;
+ this.fullID = this.board + "." + this.ID;
this.posts = new SimpleDict();
this.isDead = false;
this.isHidden = false;
@@ -1087,12 +1074,13 @@
this.ipCount = void 0;
this.OP = null;
this.catalogView = null;
- g.threads.push(this.fullID, board.threads.push(this, this));
+ this.board.threads.push(this.ID, this);
+ g.threads.push(this.fullID, this);
}
Thread.prototype.setPage = function(pageNum) {
- var icon, info, quote, _ref;
- _ref = this.OP.nodes, info = _ref.info, quote = _ref.quote;
+ var icon, info, quote, ref;
+ ref = this.OP.nodes, info = ref.info, quote = ref.quote;
if (!(icon = $('.page-num', info))) {
icon = $.el('span', {
className: 'page-num'
@@ -1111,7 +1099,7 @@
if (!this.catalogView) {
return;
}
- el = this.catalogView.nodes["" + type + "Count"];
+ el = this.catalogView.nodes[type + "Count"];
el.textContent = count;
return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning');
};
@@ -1150,7 +1138,7 @@
src: "" + Build.staticPath + typeLC + Build.gifIcon,
alt: type,
title: type,
- className: "" + typeLC + "Icon retina"
+ className: typeLC + "Icon retina"
});
root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote;
$.after(root, [$.tn(' '), icon]);
@@ -1183,8 +1171,8 @@
return this.ID;
};
- function CatalogThread(root, thread) {
- this.thread = thread;
+ function CatalogThread(root, thread1) {
+ this.thread = thread1;
this.ID = this.thread.ID;
this.board = this.thread.board;
this.nodes = {
@@ -1210,12 +1198,12 @@
return this.ID;
};
- function Post(root, thread, board) {
- var capcode, clone, date, email, flag, info, name, post, subject, tripcode, uniqueID, _i, _len, _ref;
- this.thread = thread;
- this.board = board;
+ function Post(root, thread1, board1) {
+ var capcode, clone, date, email, flag, info, k, len1, name, post, ref, subject, tripcode, uniqueID;
+ this.thread = thread1;
+ this.board = board1;
this.ID = +root.id.slice(2);
- this.fullID = "" + this.board + "." + this.ID;
+ this.fullID = this.board + "." + this.ID;
post = $('.post', root);
info = $('.postInfo', post);
this.nodes = {
@@ -1281,31 +1269,33 @@
if (g.posts[this.fullID]) {
this.isRebuilt = true;
this.clones = g.posts[this.fullID].clones;
- _ref = this.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.origin = this;
}
}
- g.posts.push(this.fullID, thread.posts.push(this, board.posts.push(this, this)));
+ this.board.posts.push(this.ID, this);
+ this.thread.posts.push(this.ID, this);
+ g.posts.push(this.fullID, this);
}
Post.prototype.parseComment = function() {
- var bq, node, spoilers, _i, _len, _ref;
+ var bq, k, len1, node, ref, spoilers;
this.nodes.comment.normalize();
bq = this.nodes.comment.cloneNode(true);
- _ref = $$('.abbr, .exif, b, marquee', bq);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $$('.abbr, .exif, b, marquee', bq);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
$.rm(node);
}
this.info.comment = this.nodesToText(bq);
spoilers = $$('s', bq);
return this.info.commentSpoilered = (function() {
- var _j, _len1;
+ var len2, q;
if (spoilers.length) {
- for (_j = 0, _len1 = spoilers.length; _j < _len1; _j++) {
- node = spoilers[_j];
+ for (q = 0, len2 = spoilers.length; q < len2; q++) {
+ node = spoilers[q];
$.replace(node, $.tn('[spoiler]'));
}
return this.nodesToText(bq);
@@ -1327,11 +1317,11 @@
};
Post.prototype.parseQuotes = function() {
- var quotelink, _i, _len, _ref;
+ var k, len1, quotelink, ref;
this.quotes = [];
- _ref = $$(':not(pre) > .quotelink', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = $$(':not(pre) > .quotelink', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
this.parseQuote(quotelink);
}
};
@@ -1345,8 +1335,8 @@
if (this.isClone) {
return;
}
- fullID = "" + match[1] + "." + match[2];
- if (__indexOf.call(this.quotes, fullID) < 0) {
+ fullID = match[1] + "." + match[2];
+ if (indexOf.call(this.quotes, fullID) < 0) {
return this.quotes.push(fullID);
}
};
@@ -1372,7 +1362,7 @@
size *= 1024;
}
this.file.sizeInBytes = size;
- this.file.thumbURL = "" + location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
+ this.file.thumbURL = location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
this.file.isImage = /(jpg|png|gif)$/i.test(this.file.URL);
this.file.isVideo = /webm$/i.test(this.file.URL);
nameNode = $('a', fileText);
@@ -1383,7 +1373,7 @@
};
Post.prototype.kill = function(file) {
- var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
+ var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
if (file) {
if (this.file.isDead) {
return;
@@ -1408,17 +1398,17 @@
if (this.isClone) {
return;
}
- _ref = this.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.kill(file);
}
if (file) {
return;
}
- _ref1 = Get.allQuotelinksLinkingTo(this);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- quotelink = _ref1[_j];
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ quotelink = ref1[q];
if (!(!$.hasClass(quotelink, 'deadlink'))) {
continue;
}
@@ -1428,7 +1418,7 @@
};
Post.prototype.resurrect = function() {
- var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
+ var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
delete this.isDead;
$.rmClass(this.nodes.root, 'deleted-post');
strong = $('strong.warning', this.nodes.info);
@@ -1440,14 +1430,14 @@
if (this.isClone) {
return;
}
- _ref = this.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.resurrect();
}
- _ref1 = Get.allQuotelinksLinkingTo(this);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- quotelink = _ref1[_j];
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ quotelink = ref1[q];
if (!($.hasClass(quotelink, 'deadlink'))) {
continue;
}
@@ -1468,11 +1458,11 @@
};
Post.prototype.rmClone = function(index) {
- var clone, _i, _len, _ref;
+ var clone, k, len1, ref;
this.clones.splice(index, 1);
- _ref = this.clones.slice(index);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones.slice(index);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.nodes.root.dataset.clone = index++;
}
};
@@ -1481,19 +1471,19 @@
})();
- Clone = (function(_super) {
- __extends(Clone, _super);
+ Clone = (function(superClass) {
+ extend(Clone, superClass);
- function Clone(origin, context, contractThumb) {
- 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'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- key = _ref[_i];
- this[key] = origin[key];
+ function Clone(origin1, context1, contractThumb) {
+ var file, info, inline, inlined, k, key, len1, len2, len3, nodes, post, q, ref, ref1, ref2, ref3, root, u, val;
+ this.origin = origin1;
+ this.context = context1;
+ ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ key = ref[k];
+ this[key] = this.origin[key];
}
- nodes = origin.nodes;
+ nodes = this.origin.nodes;
root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true);
post = $('.post', root);
info = $('.postInfo', post);
@@ -1507,14 +1497,14 @@
quotelinks: [],
backlinks: info.getElementsByClassName('backlink')
};
- _ref1 = $$('.inline', post);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- inline = _ref1[_j];
+ ref1 = $$('.inline', post);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ inline = ref1[q];
$.rm(inline);
}
- _ref2 = $$('.inlined', post);
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- inlined = _ref2[_k];
+ ref2 = $$('.inlined', post);
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ inlined = ref2[u];
$.rmClass(inlined, 'inlined');
}
root.hidden = false;
@@ -1545,11 +1535,11 @@
this.nodes.date = $('.dateTime', info);
}
this.parseQuotes();
- if (origin.file) {
+ if (this.origin.file) {
this.file = {};
- _ref3 = origin.file;
- for (key in _ref3) {
- val = _ref3[key];
+ ref3 = this.origin.file;
+ for (key in ref3) {
+ val = ref3[key];
this.file[key] = val;
}
file = $('.file', post);
@@ -1564,22 +1554,22 @@
ImageExpand.contract(this);
}
}
- if (origin.isDead) {
+ if (this.origin.isDead) {
this.isDead = true;
}
this.isClone = true;
- root.dataset.clone = origin.clones.push(this) - 1;
+ root.dataset.clone = this.origin.clones.push(this) - 1;
}
Clone.prototype.cloneWithoutVideo = function(node) {
- var child, clone, _i, _len, _ref;
+ var child, clone, k, len1, ref;
if (node.tagName === 'VIDEO' && !node.dataset.md5) {
return [];
} else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) {
clone = node.cloneNode(false);
- _ref = node.childNodes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- child = _ref[_i];
+ ref = node.childNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ child = ref[k];
$.add(clone, this.cloneWithoutVideo(child));
}
return clone;
@@ -1595,12 +1585,12 @@
DataBoard = (function() {
DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'customTitles'];
- function DataBoard(key, sync, dontClean) {
+ function DataBoard(key1, sync, dontClean) {
var init;
- this.key = key;
- this.onSync = __bind(this.onSync, this);
- this.data = Conf[key];
- $.sync(key, this.onSync);
+ this.key = key1;
+ this.onSync = bind(this.onSync, this);
+ this.data = Conf[this.key];
+ $.sync(this.key, this.onSync);
if (!dontClean) {
this.clean();
}
@@ -1620,12 +1610,12 @@
return $.set(this.key, this.data, cb);
};
- DataBoard.prototype["delete"] = function(_arg) {
- var boardID, postID, threadID, _ref;
- boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID;
+ DataBoard.prototype["delete"] = function(arg) {
+ var boardID, postID, ref, threadID;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
$.forceSync(this.key);
if (postID) {
- if (!((_ref = this.data.boards[boardID]) != null ? _ref[threadID] : void 0)) {
+ if (!((ref = this.data.boards[boardID]) != null ? ref[threadID] : void 0)) {
return;
}
delete this.data.boards[boardID][threadID][postID];
@@ -1647,9 +1637,9 @@
return this.save();
};
- DataBoard.prototype.deleteIfEmpty = function(_arg) {
+ DataBoard.prototype.deleteIfEmpty = function(arg) {
var boardID, threadID;
- boardID = _arg.boardID, threadID = _arg.threadID;
+ boardID = arg.boardID, threadID = arg.threadID;
$.forceSync(this.key);
if (threadID) {
if (!Object.keys(this.data.boards[boardID][threadID]).length) {
@@ -1663,27 +1653,27 @@
}
};
- DataBoard.prototype.set = function(_arg, cb) {
- var boardID, postID, threadID, val, _base, _base1, _base2;
- boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val;
+ DataBoard.prototype.set = function(arg, cb) {
+ var base1, base2, base3, boardID, postID, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val;
$.forceSync(this.key);
if (postID !== void 0) {
- ((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val;
+ ((base1 = ((base2 = this.data.boards)[boardID] || (base2[boardID] = {})))[threadID] || (base1[threadID] = {}))[postID] = val;
} else if (threadID !== void 0) {
- ((_base2 = this.data.boards)[boardID] || (_base2[boardID] = {}))[threadID] = val;
+ ((base3 = this.data.boards)[boardID] || (base3[boardID] = {}))[threadID] = val;
} else {
this.data.boards[boardID] = val;
}
return this.save(cb);
};
- 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;
+ DataBoard.prototype.get = function(arg) {
+ var ID, board, boardID, defaultValue, k, len1, postID, thread, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue;
if (board = this.data.boards[boardID]) {
if (!threadID) {
if (postID) {
- for (thread = _i = 0, _len = board.length; _i < _len; thread = ++_i) {
+ for (thread = k = 0, len1 = board.length; k < len1; thread = ++k) {
ID = board[thread];
if (postID in thread) {
val = thread[postID];
@@ -1705,11 +1695,11 @@
};
DataBoard.prototype.clean = function() {
- var boardID, now, val, _ref;
+ var boardID, now, ref, val;
$.forceSync(this.key);
- _ref = this.data.boards;
- for (boardID in _ref) {
- val = _ref[boardID];
+ ref = this.data.boards;
+ for (boardID in ref) {
+ val = ref[boardID];
this.deleteIfEmpty({
boardID: boardID
});
@@ -1742,14 +1732,14 @@
};
DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
- var ID, board, page, thread, threads, _i, _j, _k, _len, _len1, _len2, _ref;
+ var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
board = this.data.boards[boardID];
threads = {};
- for (_i = 0, _len = response1.length; _i < _len; _i++) {
- page = response1[_i];
- _ref = page.threads;
- for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
- thread = _ref[_j];
+ for (k = 0, len1 = response1.length; k < len1; k++) {
+ page = response1[k];
+ ref = page.threads;
+ for (q = 0, len2 = ref.length; q < len2; q++) {
+ thread = ref[q];
ID = thread.no;
if (ID in board) {
threads[ID] = board[ID];
@@ -1757,8 +1747,8 @@
}
}
if (response2) {
- for (_k = 0, _len2 = response2.length; _k < _len2; _k++) {
- ID = response2[_k];
+ for (u = 0, len3 = response2.length; u < len3; u++) {
+ ID = response2[u];
if (ID in board) {
threads[ID] = board[ID];
}
@@ -1783,11 +1773,11 @@
})();
Notice = (function() {
- function Notice(type, content, timeout, onclose) {
- this.timeout = timeout;
+ function Notice(type, content, timeout1, onclose) {
+ this.timeout = timeout1;
this.onclose = onclose;
- this.close = __bind(this.close, this);
- this.add = __bind(this.add, this);
+ this.close = bind(this.close, this);
+ this.add = bind(this.add, this);
this.el = $.el('div', {
innerHTML: "
"
});
@@ -1831,11 +1821,11 @@
RandomAccessList = (function() {
function RandomAccessList(items) {
- var item, _i, _len;
+ var item, k, len1;
this.length = 0;
if (items) {
- for (_i = 0, _len = items.length; _i < _len; _i++) {
- item = items[_i];
+ for (k = 0, len1 = items.length; k < len1; k++) {
+ item = items[k];
this.push(item);
}
}
@@ -1979,10 +1969,10 @@
};
SimpleDict.prototype.forEach = function(fn) {
- var key, _i, _len, _ref;
- _ref = __slice.call(this.keys);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- key = _ref[_i];
+ var k, key, len1, ref;
+ ref = slice.call(this.keys);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ key = ref[k];
fn(this[key]);
}
};
@@ -2026,12 +2016,12 @@
}
Connection = (function() {
- function Connection(target, origin, cb) {
- this.target = target;
- this.origin = origin;
- this.cb = cb;
- this.onMessage = __bind(this.onMessage, this);
- this.send = __bind(this.send, this);
+ function Connection(target1, origin1, cb1) {
+ this.target = target1;
+ this.origin = origin1;
+ this.cb = cb1;
+ this.onMessage = bind(this.onMessage, this);
+ this.send = bind(this.send, this);
$.on(window, 'message', this.onMessage);
}
@@ -2040,15 +2030,15 @@
};
Connection.prototype.onMessage = function(e) {
- var data, type, value, _base;
+ var base1, data, type, value;
if (!(e.source === this.target && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) {
return;
}
data = JSON.parse(e.data.slice(g.NAMESPACE.length));
for (type in data) {
value = data[type];
- if (typeof (_base = this.cb)[type] === "function") {
- _base[type](value);
+ if (typeof (base1 = this.cb)[type] === "function") {
+ base1[type](value);
}
}
};
@@ -2058,14 +2048,14 @@
})();
Fetcher = (function() {
- function Fetcher(boardID, threadID, postID, root, context) {
+ function Fetcher(boardID1, threadID1, postID1, root1, context1) {
var post;
- this.boardID = boardID;
- this.threadID = threadID;
- this.postID = postID;
- this.root = root;
- this.context = context;
- if (post = g.posts["" + this.boardID + "." + this.postID]) {
+ this.boardID = boardID1;
+ this.threadID = threadID1;
+ this.postID = postID1;
+ this.root = root1;
+ this.context = context1;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
this.insert(post);
return;
}
@@ -2097,8 +2087,8 @@
};
Fetcher.prototype.fetchedPost = function(req) {
- var api, board, post, posts, status, thread, _i, _len;
- if (post = g.posts["" + this.boardID + "." + this.postID]) {
+ var api, board, k, len1, post, posts, status, thread;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
this.insert(post);
return;
}
@@ -2113,8 +2103,8 @@
}
posts = req.response.posts;
Build.spoilerRange[this.boardID] = posts[0].custom_spoiler;
- for (_i = 0, _len = posts.length; _i < _len; _i++) {
- post = posts[_i];
+ for (k = 0, len1 = posts.length; k < len1; k++) {
+ post = posts[k];
if (post.no === this.postID) {
break;
}
@@ -2140,7 +2130,7 @@
return;
}
board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads["" + this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
post = new Post(Build.postFromObject(post, this.boardID), thread, board);
post.isFetchedQuote = true;
Main.callbackNodes(Post, [post]);
@@ -2171,12 +2161,12 @@
} else if (Conf['Except Archives from Encryption']) {
CrossOrigin.json(url, (function(_this) {
return function(response) {
- var key, media, _ref;
+ var key, media, ref;
media = response.media;
if (media) {
for (key in media) {
if (/_link$/.test(key)) {
- if (!((media[key] != null) && (_ref = media[key].match(/^(http:\/\/[^\/]+\/)?/)[0], __indexOf.call(url.archive.imagehosts, _ref) >= 0))) {
+ if (!((media[key] != null) && (ref = media[key].match(/^(http:\/\/[^\/]+\/)?/)[0], indexOf.call(url.archive.imagehosts, ref) >= 0))) {
delete media[key];
}
}
@@ -2191,8 +2181,8 @@
};
Fetcher.prototype.parseArchivedPost = function(data) {
- var board, comment, greentext, i, j, o, post, text, text2, thread, _ref;
- if (post = g.posts["" + this.boardID + "." + this.postID]) {
+ var board, comment, greentext, i, j, o, post, ref, text, text2, thread;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
this.insert(post);
return;
}
@@ -2203,32 +2193,32 @@
}
comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned)\])/);
comment = (function() {
- var _i, _len, _results;
- _results = [];
- for (i = _i = 0, _len = comment.length; _i < _len; i = ++_i) {
+ var k, len1, results;
+ results = [];
+ for (i = k = 0, len1 = comment.length; k < len1; i = ++k) {
text = comment[i];
if (i % 2 === 1) {
- _results.push(this.archiveTags[text]);
+ results.push(this.archiveTags[text]);
} else {
greentext = text[0] === '>';
text = text.replace(/(\[\/?[a-z]+):lit(\])/, '$1$2');
text = (function() {
- var _j, _len1, _ref, _results1;
- _ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
- _results1 = [];
- for (j = _j = 0, _len1 = _ref.length; _j < _len1; j = ++_j) {
- text2 = _ref[j];
+ var len2, q, ref, results1;
+ ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
+ results1 = [];
+ for (j = q = 0, len2 = ref.length; q < len2; j = ++q) {
+ text2 = ref[j];
if (j % 2 === 1) {
- _results1.push({
+ results1.push({
innerHTML: "" + E(text2) + ""
});
} else {
- _results1.push({
+ results1.push({
innerHTML: E(text2)
});
}
}
- return _results1;
+ return results1;
})();
text = {
innerHTML: text.map(function(x) {
@@ -2240,10 +2230,10 @@
innerHTML: "" + text.innerHTML + ""
};
}
- _results.push(text);
+ results.push(text);
}
}
- return _results;
+ return results;
}).call(this);
comment = {
innerHTML: comment.map(function(x) {
@@ -2276,7 +2266,7 @@
dateUTC: data.timestamp,
comment: comment
};
- if ((_ref = data.media) != null ? _ref.media_filename : void 0) {
+ if ((ref = data.media) != null ? ref.media_filename : void 0) {
o.file = {
name: data.media.media_filename,
timestamp: data.media.media_orig,
@@ -2295,7 +2285,7 @@
}
}
board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads["" + this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
post = new Post(Build.post(o), thread, board);
post.kill();
if (post.file) {
@@ -2370,13 +2360,13 @@
});
},
toBlob: function() {
- var _base;
- return (_base = HTMLCanvasElement.prototype).toBlob || (_base.toBlob = function(cb) {
- var data, i, l, ui8a, _i;
+ var base1;
+ return (base1 = HTMLCanvasElement.prototype).toBlob || (base1.toBlob = function(cb) {
+ var data, i, k, l, ref, ui8a;
data = atob(this.toDataURL().slice(22));
l = data.length;
ui8a = new Uint8Array(l);
- for (i = _i = 0; _i < l; i = _i += 1) {
+ for (i = k = 0, ref = l; k < ref; i = k += 1) {
ui8a[i] = data.charCodeAt(i);
}
return cb(new Blob([ui8a], {
@@ -2565,7 +2555,7 @@
id: 'scroll-marker'
}),
setBoardList: function() {
- var a, boardList, btn, chr, node, nodes, spacer, span, _i, _j, _len, _len1, _ref, _ref1;
+ var a, boardList, btn, chr, k, len1, len2, node, nodes, q, ref, ref1, spacer, span;
Header.boardList = boardList = $.el('span', {
id: 'board-list'
});
@@ -2580,14 +2570,14 @@
className: 'spacer'
});
};
- _ref = $('#boardNavDesktop > .boardList').childNodes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $('#boardNavDesktop > .boardList').childNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
switch (node.nodeName) {
case '#text':
- _ref1 = node.nodeValue;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- chr = _ref1[_j];
+ ref1 = node.nodeValue;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ chr = ref1[q];
span = $.el('span', {
textContent: chr
});
@@ -2629,14 +2619,14 @@
as = $$('#full-board-list a[title]', Header.boardList);
re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
nodes = (function() {
- var _i, _len, _ref, _results;
- _ref = boardnav.match(re);
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- t = _ref[_i];
- _results.push(Header.mapCustomNavigation(t, as));
+ var k, len1, ref, results;
+ ref = boardnav.match(re);
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ t = ref[k];
+ results.push(Header.mapCustomNavigation(t, as));
}
- return _results;
+ return results;
})();
$.add(list, nodes);
return $.ready(CatalogLinks.initBoardList);
@@ -2674,7 +2664,7 @@
boardID = g.BOARD.ID;
}
a = (function() {
- var _i, _len, _ref;
+ var k, len1, ref;
if (boardID === '@') {
return $.el('a', {
href: 'https://twitter.com/4chan',
@@ -2682,8 +2672,8 @@
textContent: '@'
});
}
- for (_i = 0, _len = as.length; _i < _len; _i++) {
- a = as[_i];
+ for (k = 0, len1 = as.length; k < len1; k++) {
+ a = as[k];
if (a.textContent === boardID) {
return a.cloneNode(true);
}
@@ -2692,7 +2682,7 @@
href: "/" + boardID + "/",
textContent: boardID
});
- if ((_ref = g.VIEW) === 'catalog' || _ref === 'archive') {
+ if ((ref = g.VIEW) === 'catalog' || ref === 'archive') {
a.href += g.VIEW;
}
if (boardID === g.BOARD.ID) {
@@ -2853,12 +2843,12 @@
return new Notice('info', message, 2);
},
setCustomNav: function(show) {
- var btn, cust, full, _ref;
+ var btn, cust, full, ref;
Header.customNavToggler.checked = show;
cust = $('#custom-board-list', Header.bar);
full = $('#full-board-list', Header.bar);
btn = $('.hide-board-list-container', full);
- return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], btn.hidden = _ref[2], _ref;
+ return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref;
},
toggleCustomNav: function() {
$.cb.checked.call(this);
@@ -2973,13 +2963,13 @@
return Header.menu.toggle(e, this, g);
},
createNotification: function(e) {
- var content, lifetime, notice, type, _ref;
- _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime;
+ var content, lifetime, notice, ref, type;
+ ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime;
return notice = new Notice(type, content, lifetime);
},
areNotificationsEnabled: false,
enableDesktopNotifications: function() {
- var authorize, disable, el, notice, _ref;
+ var authorize, disable, el, notice, ref;
if (!(window.Notification && Conf['Desktop Notifications'])) {
return;
}
@@ -2993,7 +2983,7 @@
el = $.el('span', {
innerHTML: E(g.NAME) + " needs your permission to show desktop notifications. [FAQ]
or "
});
- _ref = $$('button', el), authorize = _ref[0], disable = _ref[1];
+ ref = $$('button', el), authorize = ref[0], disable = ref[1];
$.on(authorize, 'click', function() {
return Notification.requestPermission(function(status) {
Header.areNotificationsEnabled = status === 'granted';
@@ -3014,7 +3004,7 @@
Index = {
showHiddenThreads: false,
init: function() {
- var anchorEntry, input, label, name, pinEntry, refNavEntry, repliesEntry, select, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
+ var anchorEntry, input, k, label, len1, len2, name, pinEntry, q, ref, ref1, ref2, ref3, ref4, ref5, refNavEntry, repliesEntry, select;
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation'] || g.VIEW !== 'index') {
return;
}
@@ -3023,13 +3013,13 @@
name: 'Catalog Features',
cb: this.catalogNode
});
- this.search = ((_ref = history.state) != null ? _ref.search : void 0) || '';
- if ((_ref1 = history.state) != null ? _ref1.mode : void 0) {
- Conf['Index Mode'] = (_ref2 = history.state) != null ? _ref2.mode : void 0;
+ this.search = ((ref = history.state) != null ? ref.search : void 0) || '';
+ if ((ref1 = history.state) != null ? ref1.mode : void 0) {
+ Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0;
}
this.currentPage = this.getCurrentPage();
this.pushState({
- command: (_ref3 = location.href.match(/#(.*)/)) != null ? _ref3[1] : void 0,
+ command: (ref3 = location.href.match(/#(.*)/)) != null ? ref3[1] : void 0,
replace: true
});
this.button = $.el('a', {
@@ -3057,9 +3047,9 @@
pinEntry.el.title = 'Move watched threads to the start of the index.';
anchorEntry.el.title = 'Move hidden threads to the end of the index.';
refNavEntry.el.title = 'Refresh index when navigating through pages.';
- _ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
- for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
- label = _ref4[_i];
+ ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
+ for (k = 0, len1 = ref4.length; k < len1; k++) {
+ label = ref4[k];
input = label.el.firstChild;
name = input.name;
$.on(input, 'change', $.cb.checked);
@@ -3079,7 +3069,7 @@
order: 98,
subEntries: [repliesEntry, pinEntry, anchorEntry, refNavEntry]
});
- $.addClass(doc, 'index-loading', "" + (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
+ $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
this.root = $.el('div', {
className: 'board'
});
@@ -3115,9 +3105,9 @@
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
$.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
$.on(this.selectMode, 'change', this.cb.mode);
- _ref5 = [this.selectMode, this.selectSort, this.selectSize];
- for (_j = 0, _len1 = _ref5.length; _j < _len1; _j++) {
- select = _ref5[_j];
+ ref5 = [this.selectMode, this.selectSort, this.selectSize];
+ for (q = 0, len2 = ref5.length; q < len2; q++) {
+ select = ref5[q];
select.value = Conf[select.name];
$.on(select, 'change', $.cb.value);
}
@@ -3132,15 +3122,15 @@
$.asap((function() {
return $('.board > .thread > .postContainer', doc) || d.readyState !== 'loading';
}), function() {
- var board, el, threadRoot, topNavPos, _k, _l, _len2, _len3, _ref6, _ref7, _ref8;
+ var board, el, len3, len4, ref6, ref7, ref8, threadRoot, topNavPos, u, w;
if (!Main.isThisPageLegit()) {
return;
}
Index.hat = $('.board > .thread > img:first-child');
if (Index.hat && Index.nodes) {
- _ref6 = Index.nodes;
- for (_k = 0, _len2 = _ref6.length; _k < _len2; _k++) {
- threadRoot = _ref6[_k];
+ ref6 = Index.nodes;
+ for (u = 0, len3 = ref6.length; u < len3; u++) {
+ threadRoot = ref6[u];
$.prepend(threadRoot, Index.hat.cloneNode(false));
}
}
@@ -3148,13 +3138,13 @@
$.replace(board, Index.root);
$.event('PostsInserted');
d.implementation.createDocument(null, null, null).appendChild(board);
- _ref7 = $$('.navLinks');
- for (_l = 0, _len3 = _ref7.length; _l < _len3; _l++) {
- el = _ref7[_l];
+ ref7 = $$('.navLinks');
+ for (w = 0, len4 = ref7.length; w < len4; w++) {
+ el = ref7[w];
$.rm(el);
}
- if ((_ref8 = $.id('search-box')) != null) {
- _ref8.parentNode.remove();
+ if ((ref8 = $.id('search-box')) != null) {
+ ref8.parentNode.remove();
}
topNavPos = $.id('delform').previousElementSibling;
$.before(topNavPos, $.el('hr'));
@@ -3218,9 +3208,9 @@
href: 'javascript:;'
}),
order: 20,
- open: function(_arg) {
+ open: function(arg) {
var thread;
- thread = _arg.thread;
+ thread = arg.thread;
if (Conf['Index Mode'] !== 'catalog') {
return false;
}
@@ -3270,11 +3260,11 @@
return ThreadHiding.saveHiddenState(thread);
},
cycleSortType: function() {
- var i, type, types, _i, _len;
- types = __slice.call(Index.selectSort.options).filter(function(option) {
+ var i, k, len1, type, types;
+ types = slice.call(Index.selectSort.options).filter(function(option) {
return !option.disabled;
});
- for (i = _i = 0, _len = types.length; _i < _len; i = ++_i) {
+ for (i = k = 0, len1 = types.length; k < len1; i = ++k) {
type = types[i];
if (type.selected) {
break;
@@ -3325,9 +3315,9 @@
return Index.buildIndex();
},
popstate: function(e) {
- var mode, page, search, state, _ref, _ref1;
+ var mode, page, ref, ref1, search, state;
if (e != null ? e.state : void 0) {
- _ref = e.state, search = _ref.search, mode = _ref.mode;
+ ref = e.state, search = ref.search, mode = ref.mode;
page = Index.getCurrentPage();
state = {};
if (Index.search !== search) {
@@ -3345,7 +3335,7 @@
}
} else {
state = Index.pushState({
- command: (_ref1 = location.href.match(/#(.*)/)) != null ? _ref1[1] : void 0,
+ command: (ref1 = location.href.match(/#(.*)/)) != null ? ref1[1] : void 0,
replace: true,
scroll: true
});
@@ -3381,8 +3371,8 @@
return Header.scrollToIfNeeded(Index.navLinks);
},
getCurrentPage: function() {
- var _ref;
- if ((_ref = Conf['Index Mode']) === 'all pages' || _ref === 'catalog') {
+ var ref;
+ if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') {
return 1;
} else {
return +window.location.pathname.split('/')[2] || 1;
@@ -3403,9 +3393,9 @@
}
},
pushState: function(state) {
- var command, hash, mode, page, pageBeforeSearch, pathname, search, _ref;
+ var command, hash, mode, page, pageBeforeSearch, pathname, ref, search;
pathname = location.pathname, hash = location.hash;
- pageBeforeSearch = (_ref = history.state) != null ? _ref.oldpage : void 0;
+ pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0;
if (state.command != null) {
command = state.command;
if (command === 'paged' || command === 'infinite' || command === 'all-pages' || command === 'catalog') {
@@ -3467,9 +3457,9 @@
return $.set('Previous Index Mode', mode);
}
},
- pageLoad: function(_arg) {
+ pageLoad: function(arg) {
var mode, scroll, search, sort;
- sort = _arg.sort, search = _arg.search, mode = _arg.mode, scroll = _arg.scroll;
+ sort = arg.sort, search = arg.search, mode = arg.mode, scroll = arg.scroll;
if (sort || (search != null)) {
Index.sort();
Index.buildPagelist();
@@ -3487,11 +3477,11 @@
}
},
applyMode: function() {
- var mode, _i, _len, _ref;
- _ref = ['paged', 'infinite', 'all pages', 'catalog'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- mode = _ref[_i];
- $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, "" + (mode.replace(/\ /g, '-')) + "-mode");
+ var k, len1, mode, ref;
+ ref = ['paged', 'infinite', 'all pages', 'catalog'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ mode = ref[k];
+ $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode");
}
Index.selectMode.value = Conf['Index Mode'];
Index.cb.size();
@@ -3509,12 +3499,12 @@
return Math.max(1, Index.getPagesNum());
},
buildPagelist: function() {
- var a, i, maxPageNum, nodes, pagesRoot, _i;
+ var a, i, k, maxPageNum, nodes, pagesRoot, ref;
pagesRoot = $('.pages', Index.pagelist);
maxPageNum = Index.getMaxPageNum();
if (pagesRoot.childElementCount !== maxPageNum) {
nodes = [];
- for (i = _i = 1; _i <= maxPageNum; i = _i += 1) {
+ for (i = k = 1, ref = maxPageNum; k <= ref; i = k += 1) {
a = $.el('a', {
textContent: i,
href: i === 1 ? './' : i
@@ -3551,13 +3541,13 @@
return $.add(strong, a);
},
updateHideLabel: function() {
- var hiddenCount, thread, threadID, _ref, _ref1;
+ var hiddenCount, ref, ref1, thread, threadID;
hiddenCount = 0;
- _ref = g.BOARD.threads;
- for (threadID in _ref) {
- thread = _ref[threadID];
+ ref = g.BOARD.threads;
+ for (threadID in ref) {
+ thread = ref[threadID];
if (thread.isHidden) {
- if (_ref1 = thread.ID, __indexOf.call(Index.liveThreadIDs, _ref1) >= 0) {
+ if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) >= 0) {
hiddenCount++;
}
}
@@ -3570,19 +3560,19 @@
return;
}
Index.hideLabel.hidden = false;
- return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : "" + hiddenCount + " hidden threads";
+ return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads";
},
update: function(state) {
- var now, _ref, _ref1;
+ var now, ref, ref1;
if (!navigator.onLine) {
return;
}
delete Index.pageNum;
- if ((_ref = Index.req) != null) {
- _ref.abort();
+ if ((ref = Index.req) != null) {
+ ref.abort();
}
- if ((_ref1 = Index.notice) != null) {
- _ref1.close();
+ if ((ref1 = Index.notice) != null) {
+ ref1.close();
}
now = Date.now();
$.ready(function() {
@@ -3602,7 +3592,7 @@
return $.addClass(Index.button, 'fa-spin');
},
load: function(e, state) {
- var err, nTimeout, notice, req, timeEl, _ref;
+ var err, nTimeout, notice, ref, req, timeEl;
$.rmClass(Index.button, 'fa-spin');
req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
if (nTimeout) {
@@ -3616,7 +3606,7 @@
notice.close();
return;
}
- if ((_ref = req.status) !== 200 && _ref !== 304) {
+ if ((ref = req.status) !== 200 && ref !== 304) {
err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
if (notice) {
notice.setType('warning');
@@ -3670,20 +3660,20 @@
return data.no;
});
g.BOARD.threads.forEach(function(thread) {
- var _ref;
- if (_ref = thread.ID, __indexOf.call(Index.liveThreadIDs, _ref) < 0) {
+ var ref;
+ if (ref = thread.ID, indexOf.call(Index.liveThreadIDs, ref) < 0) {
return thread.collect();
}
});
},
buildThreads: function() {
- var err, errors, i, posts, thread, threadData, threadRoot, threads, _i, _len, _ref;
+ var err, errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads;
Index.nodes = [];
threads = [];
posts = [];
- _ref = Index.liveThreadData;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- threadData = _ref[i];
+ ref = Index.liveThreadData;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ threadData = ref[i];
try {
threadRoot = Build.thread(g.BOARD, threadData);
if (Index.hat) {
@@ -3724,18 +3714,18 @@
return $.event('IndexRefresh');
},
buildReplies: function(threadRoots) {
- var data, err, errors, i, lastReplies, node, nodes, post, posts, thread, threadRoot, _i, _j, _len, _len1;
+ var data, err, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot;
posts = [];
- for (_i = 0, _len = threadRoots.length; _i < _len; _i++) {
- threadRoot = threadRoots[_i];
+ for (k = 0, len1 = threadRoots.length; k < len1; k++) {
+ threadRoot = threadRoots[k];
thread = Get.threadFromRoot(threadRoot);
i = Index.liveThreadIDs.indexOf(thread.ID);
if (!(lastReplies = Index.liveThreadData[i].last_replies)) {
continue;
}
nodes = [];
- for (_j = 0, _len1 = lastReplies.length; _j < _len1; _j++) {
- data = lastReplies[_j];
+ for (q = 0, len2 = lastReplies.length; q < len2; q++) {
+ data = lastReplies[q];
if (post = thread.posts[data.no]) {
nodes.push(post.nodes.root);
continue;
@@ -3762,15 +3752,15 @@
return Main.callbackNodes(Post, posts);
},
buildCatalogViews: function() {
- var catalogThreads, thread, threads, _i, _len;
+ var catalogThreads, k, len1, thread, threads;
threads = Index.sortedNodes.map(function(threadRoot) {
return Get.threadFromRoot(threadRoot);
}).filter(function(thread) {
return !thread.isHidden !== Index.showHiddenThreads;
});
catalogThreads = [];
- for (_i = 0, _len = threads.length; _i < _len; _i++) {
- thread = threads[_i];
+ for (k = 0, len1 = threads.length; k < len1; k++) {
+ thread = threads[k];
if (!thread.catalogView) {
catalogThreads.push(new CatalogThread(Build.catalogThread(thread), thread));
}
@@ -3781,12 +3771,12 @@
});
},
sizeCatalogViews: function(nodes) {
- var height, node, ratio, size, thumb, width, _i, _len, _ref;
+ var height, k, len1, node, ratio, ref, size, thumb, width;
size = Conf['Index Size'] === 'small' ? 150 : 250;
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- node = nodes[_i];
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ node = nodes[k];
thumb = $('.catalog-thumb', node);
- _ref = thumb.dataset, width = _ref.width, height = _ref.height;
+ ref = thumb.dataset, width = ref.width, height = ref.height;
if (!width) {
continue;
}
@@ -3796,10 +3786,10 @@
}
},
sort: function() {
- var liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID, _i, _len;
+ var k, len1, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
sortedThreadIDs = {
- lastreply: __slice.call(liveThreadData).sort(function(a, b) {
+ lastreply: slice.call(liveThreadData).sort(function(a, b) {
var num;
if ((num = a.last_replies)) {
a = num[num.length - 1];
@@ -3812,15 +3802,15 @@
return post.no;
}),
bump: liveThreadIDs,
- birth: __slice.call(liveThreadIDs).sort(function(a, b) {
+ birth: slice.call(liveThreadIDs).sort(function(a, b) {
return b - a;
}),
- replycount: __slice.call(liveThreadData).sort(function(a, b) {
+ replycount: slice.call(liveThreadData).sort(function(a, b) {
return b.replies - a.replies;
}).map(function(post) {
return post.no;
}),
- filecount: __slice.call(liveThreadData).sort(function(a, b) {
+ filecount: slice.call(liveThreadData).sort(function(a, b) {
return b.images - a.images;
}).map(function(post) {
return post.no;
@@ -3828,8 +3818,8 @@
}[Conf['Index Sort']];
Index.sortedNodes = sortedNodes = [];
nodes = Index.nodes;
- for (_i = 0, _len = sortedThreadIDs.length; _i < _len; _i++) {
- threadID = sortedThreadIDs[_i];
+ for (k = 0, len1 = sortedThreadIDs.length; k < len1; k++) {
+ threadID = sortedThreadIDs[k];
sortedNodes.push(nodes[Index.liveThreadIDs.indexOf(threadID)]);
}
if (Index.search && (nodes = Index.querySearch(Index.search))) {
@@ -3848,12 +3838,12 @@
}
},
sortOnTop: function(match) {
- var bottomNodes, threadRoot, topNodes, _i, _len, _ref;
+ var bottomNodes, k, len1, ref, threadRoot, topNodes;
topNodes = [];
bottomNodes = [];
- _ref = Index.sortedNodes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- threadRoot = _ref[_i];
+ ref = Index.sortedNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ threadRoot = ref[k];
(match(Get.threadFromRoot(threadRoot)) ? topNodes : bottomNodes).push(threadRoot);
}
return Index.sortedNodes = topNodes.concat(bottomNodes);
@@ -3892,7 +3882,7 @@
Index.buildReplies(nodes);
}
Index.buildStructure(nodes);
- if ((Index.followedThreadID != null) && (post = g.posts["" + g.BOARD + "." + Index.followedThreadID])) {
+ if ((Index.followedThreadID != null) && (post = g.posts[g.BOARD + "." + Index.followedThreadID])) {
return Header.scrollTo(post.nodes.root);
}
}
@@ -3904,9 +3894,9 @@
return Index.sortedNodes.slice(offset, offset + nodesPerPage);
},
buildStructure: function(nodes) {
- var node, _i, _len;
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- node = nodes[_i];
+ var k, len1, node;
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ node = nodes[k];
$.add(Index.root, [node, $.el('hr')]);
}
if (doc.contains(Index.root)) {
@@ -3950,12 +3940,12 @@
});
},
searchMatch: function(thread, keywords) {
- var file, info, key, keyword, text, _i, _j, _len, _len1, _ref, _ref1;
- _ref = thread.OP, info = _ref.info, file = _ref.file;
+ var file, info, k, key, keyword, len1, len2, q, ref, ref1, text;
+ ref = thread.OP, info = ref.info, file = ref.file;
text = [];
- _ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- key = _ref1[_i];
+ ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ key = ref1[k];
if (key in info) {
text.push(info[key]);
}
@@ -3964,8 +3954,8 @@
text.push(file.name);
}
text = text.join(' ').toLowerCase();
- for (_j = 0, _len1 = keywords.length; _j < _len1; _j++) {
- keyword = keywords[_j];
+ for (q = 0, len2 = keywords.length; q < len2; q++) {
+ keyword = keywords[q];
if (-1 === text.indexOf(keyword)) {
return false;
}
@@ -3997,7 +3987,7 @@
threshold = 30;
ext = filename.match(/\.?[^\.]*$/)[0];
if (filename.length - ext.length > threshold) {
- return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
+ return filename.slice(0, threshold - 5) + "(...)" + ext;
} else {
return filename;
}
@@ -4064,7 +4054,7 @@
This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS).
@license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
*/
- var boardID, capcode, capcodeClass, capcodeIcon, capcodeStart, comment, container, date, dateUTC, desktop2, email, emailField, emailProcessed, file, fileBlock, fileCont, fileDims, fileLink, fileSize, fileText, fileThumb, flag, flagCode, flagName, gifIcon, highlightPost, href, icons, isOP, match, message, name, nameBlock, nameClass, postID, postInfo, postLink, quote, quoteLink, replyLink, shortFilename, spoilerRange, staticPath, subject, subjectField, threadID, tripcode, tripcodeField, type, typeLC, uniqueID, userID, wholePost, _i, _len, _ref;
+ var boardID, capcode, capcodeClass, capcodeIcon, capcodeStart, comment, container, date, dateUTC, desktop2, email, emailField, emailProcessed, file, fileBlock, fileCont, fileDims, fileLink, fileSize, fileText, fileThumb, flag, flagCode, flagName, gifIcon, highlightPost, href, icons, isOP, k, len1, match, message, name, nameBlock, nameClass, postID, postInfo, postLink, quote, quoteLink, ref, replyLink, shortFilename, spoilerRange, staticPath, subject, subjectField, threadID, tripcode, tripcodeField, type, typeLC, uniqueID, userID, wholePost;
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, comment = o.comment, file = o.file;
name || (name = '');
subject || (subject = '');
@@ -4169,20 +4159,20 @@
postLink = Build.postURL(boardID, threadID, postID);
quoteLink = Build.sameThread(boardID, threadID) ? "javascript:quote('" + (+postID) + "');" : "/" + boardID + "/thread/" + threadID + "#q" + postID;
icons = (function() {
- var _i, _len, _ref, _results;
- _ref = ['Sticky', 'Closed', 'Archived'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
+ var k, len1, ref, results;
+ ref = ['Sticky', 'Closed', 'Archived'];
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
if (!(o["is" + type] && !(type === 'Closed' && o.isArchived))) {
continue;
}
typeLC = type.toLowerCase();
- _results.push({
+ results.push({
innerHTML: "
"
});
}
- return _results;
+ return results;
})();
replyLink = isOP && g.VIEW === 'index' ? {
innerHTML: " [Reply]"
@@ -4200,7 +4190,7 @@
innerHTML: "
"
} : file && boardID === 'f' ? {
innerHTML: "File: " + E(file.name) + "-(" + E($.bytesToString(file.size)) + ", " + E(file.width) + "x" + E(file.height) + ", " + E(file.tag) + ") "
- } : file ? (file.isSpoiler ? (shortFilename = 'Spoiler Image', (spoilerRange = Build.spoilerRange[boardID]) ? fileThumb = "" + staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png" : fileThumb = "" + staticPath + "spoiler.png", file.twidth = file.theight = 100) : (shortFilename = Build.shortFilename(file.name, !isOP), fileThumb = file.turl), fileSize = $.bytesToString(file.size), fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : "" + file.width + "x" + file.height, fileLink = file.isSpoiler || file.name === shortFilename ? {
+ } : file ? (file.isSpoiler ? (shortFilename = 'Spoiler Image', (spoilerRange = Build.spoilerRange[boardID]) ? fileThumb = staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png" : fileThumb = staticPath + "spoiler.png", file.twidth = file.theight = 100) : (shortFilename = Build.shortFilename(file.name, !isOP), fileThumb = file.turl), fileSize = $.bytesToString(file.size), fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : file.width + "x" + file.height, fileLink = file.isSpoiler || file.name === shortFilename ? {
innerHTML: "" + E(shortFilename) + ""
} : {
innerHTML: "" + E(shortFilename) + ""
@@ -4232,9 +4222,9 @@
id: "pc" + postID
});
$.extend(container, wholePost);
- _ref = $$('.quotelink', container);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = $$('.quotelink', container);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
href = quote.getAttribute('href');
if ((href[0] === '#') && !(Build.sameThread(boardID, threadID))) {
quote.href = ("/" + boardID + "/thread/" + threadID) + href;
@@ -4247,7 +4237,7 @@
summary: function(boardID, threadID, posts, files) {
var text;
text = [];
- text.push("" + posts + " post" + (posts > 1 ? 's' : ''));
+ text.push(posts + " post" + (posts > 1 ? 's' : ''));
if (files) {
text.push("and " + files + " image repl" + (files > 1 ? 'ies' : 'y'));
}
@@ -4273,14 +4263,14 @@
return root;
},
excerptThread: function(board, data, OP) {
- var files, nodes, posts, _ref;
+ var files, nodes, posts, ref;
nodes = [OP ? OP.nodes.root : Build.postFromObject(data, board.ID)];
if (data.omitted_posts || !Conf['Show Replies'] && data.replies) {
- _ref = Conf['Show Replies'] ? [
+ ref = Conf['Show Replies'] ? [
data.omitted_posts, data.images - data.last_replies.filter(function(data) {
return !!data.ext;
}).length
- ] : [data.replies, data.images], posts = _ref[0], files = _ref[1];
+ ] : [data.replies, data.images], posts = ref[0], files = ref[1];
nodes.push(Build.summary(board.ID, data.no, posts, files));
}
return nodes;
@@ -4289,23 +4279,23 @@
return Build.postFromObject(data, board.ID);
},
catalogThread: function(thread) {
- var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, pageCount, postCount, pp, quote, root, spoilerRange, src, staticPath, subject, thumb, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4;
+ var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, subject, thumb, u, w;
staticPath = Build.staticPath, gifIcon = Build.gifIcon;
data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)];
if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) {
- src = "" + staticPath + "spoiler";
+ src = staticPath + "spoiler";
if (spoilerRange = Build.spoilerRange[thread.board]) {
src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random());
}
src += '.png';
imgClass = 'spoiler-file';
} else if (data.filedeleted) {
- src = "" + staticPath + "filedeleted-res" + gifIcon;
+ src = staticPath + "filedeleted-res" + gifIcon;
imgClass = 'deleted-file';
} else if (thread.OP.file) {
src = thread.OP.file.thumbURL;
} else {
- src = "" + staticPath + "nofile.png";
+ src = staticPath + "nofile.png";
imgClass = 'no-file';
}
thumb = imgClass ? {
@@ -4332,47 +4322,47 @@
});
root.dataset.fullID = thread.fullID;
if (thread.OP.highlights) {
- $.addClass.apply($, [root].concat(__slice.call(thread.OP.highlights)));
+ $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights)));
}
- _ref = $$('.quotelink', root.lastElementChild);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = $$('.quotelink', root.lastElementChild);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
href = quote.getAttribute('href');
if (href[0] === '#') {
quote.href = ("/" + thread.board + "/thread/" + thread.ID) + href;
}
}
- _ref1 = $$('.abbr, .exif', root.lastElementChild);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- exif = _ref1[_j];
+ ref1 = $$('.abbr, .exif', root.lastElementChild);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ exif = ref1[q];
$.rm(exif);
}
- _ref2 = $$('.prettyprint', root.lastElementChild);
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- pp = _ref2[_k];
+ ref2 = $$('.prettyprint', root.lastElementChild);
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ pp = ref2[u];
cc = $.el('span', {
className: 'catalog-code'
});
- $.add(cc, __slice.call(pp.childNodes));
+ $.add(cc, slice.call(pp.childNodes));
$.replace(pp, cc);
}
- _ref3 = $$('br', root.lastElementChild);
- for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
- br = _ref3[_l];
- if (((_ref4 = br.previousSibling) != null ? _ref4.nodeName : void 0) === 'BR') {
+ ref3 = $$('br', root.lastElementChild);
+ for (w = 0, len4 = ref3.length; w < len4; w++) {
+ br = ref3[w];
+ if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') {
$.rm(br);
}
}
if (thread.isSticky) {
$.add($('.catalog-icons', root), $.el('img', {
- src: "" + staticPath + "sticky" + gifIcon,
+ src: staticPath + "sticky" + gifIcon,
className: 'stickyIcon',
title: 'Sticky'
}));
}
if (thread.isClosed) {
$.add($('.catalog-icons', root), $.el('img', {
- src: "" + staticPath + "closed" + gifIcon,
+ src: staticPath + "closed" + gifIcon,
className: 'closedIcon',
title: 'Closed'
}));
@@ -4389,16 +4379,16 @@
Get = {
threadExcerpt: function(thread) {
- var OP, excerpt, _ref;
+ var OP, excerpt, ref;
OP = thread.OP;
- excerpt = ("/" + thread.board + "/ - ") + (((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.info.nameBlock);
+ excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.info.nameBlock);
if (excerpt.length > 73) {
- return "" + excerpt.slice(0, 70) + "...";
+ return excerpt.slice(0, 70) + "...";
}
return excerpt;
},
threadFromRoot: function(root) {
- return g.threads["" + g.BOARD + "." + root.id.slice(1)];
+ return g.threads[g.BOARD + "." + root.id.slice(1)];
},
threadFromNode: function(node) {
return Get.threadFromRoot($.x('ancestor::div[@class="thread"]', node));
@@ -4409,7 +4399,7 @@
boardID = link.pathname.split('/')[1];
postID = link.hash.slice(2);
index = root.dataset.clone;
- post = g.posts["" + boardID + "." + postID];
+ post = g.posts[boardID + "." + postID];
if (index) {
return post.clones[index];
} else {
@@ -4423,14 +4413,14 @@
return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', node));
},
postDataFromLink: function(link) {
- var boardID, path, postID, threadID, _ref;
+ var boardID, path, postID, ref, threadID;
if (link.hostname === 'boards.4chan.org') {
path = link.pathname.split('/');
boardID = path[1];
threadID = path[3];
postID = link.hash.slice(2);
} else {
- _ref = link.dataset, boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
threadID || (threadID = 0);
}
return {
@@ -4440,44 +4430,44 @@
};
},
allQuotelinksLinkingTo: function(post) {
- var fullID, handleQuotes, posts, qPost, quote, quotelinks, _i, _len, _ref;
+ var fullID, handleQuotes, k, len1, posts, qPost, quote, quotelinks, ref;
quotelinks = [];
posts = g.posts;
fullID = post.fullID;
handleQuotes = function(qPost, type) {
- var clone, _i, _len, _ref;
+ var clone, k, len1, ref;
quotelinks.push.apply(quotelinks, qPost.nodes[type]);
- _ref = qPost.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = qPost.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
quotelinks.push.apply(quotelinks, clone.nodes[type]);
}
};
posts.forEach(function(qPost) {
- if (__indexOf.call(qPost.quotes, fullID) >= 0) {
+ if (indexOf.call(qPost.quotes, fullID) >= 0) {
return handleQuotes(qPost, 'quotelinks');
}
});
if (Conf['Quote Backlinks']) {
- _ref = post.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = post.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
if (qPost = posts[quote]) {
handleQuotes(qPost, 'backlinks');
}
}
}
return quotelinks.filter(function(quotelink) {
- var boardID, postID, _ref1;
- _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
+ var boardID, postID, ref1;
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
return boardID === post.board.ID && postID === post.ID;
});
},
scriptData: function() {
- var script, _i, _len, _ref;
- _ref = $$('script:not([src])', d.head);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- script = _ref[_i];
+ var k, len1, ref, script;
+ ref = $$('script:not([src])', d.head);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ script = ref[k];
if (/\bcooldowns *=/.test(script.textContent)) {
return script.textContent;
}
@@ -4489,21 +4479,21 @@
UI = (function() {
var Menu, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove;
dialog = function(id, position, properties) {
- var child, el, move, _i, _len, _ref;
+ var child, el, k, len1, move, ref;
el = $.el('div', {
className: 'dialog',
id: id
});
$.extend(el, properties);
el.style.cssText = position;
- $.get("" + id + ".position", position, function(item) {
- return el.style.cssText = item["" + id + ".position"];
+ $.get(id + ".position", position, function(item) {
+ return el.style.cssText = item[id + ".position"];
});
move = $('.move', el);
$.on(move, 'touchstart mousedown', dragstart);
- _ref = move.children;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- child = _ref[_i];
+ ref = move.children;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ child = ref[k];
if (!child.tagName) {
continue;
}
@@ -4520,16 +4510,16 @@
lastToggledButton = null;
- function Menu(type) {
- this.type = type;
- this.addEntry = __bind(this.addEntry, this);
- this.onFocus = __bind(this.onFocus, this);
- this.keybinds = __bind(this.keybinds, this);
- this.close = __bind(this.close, this);
+ function Menu(type1) {
+ this.type = type1;
+ this.addEntry = bind(this.addEntry, this);
+ this.onFocus = bind(this.onFocus, this);
+ this.keybinds = bind(this.keybinds, this);
+ this.close = bind(this.close, this);
$.on(d, 'AddMenuEntry', (function(_this) {
- return function(_arg) {
+ return function(arg) {
var detail;
- detail = _arg.detail;
+ detail = arg.detail;
if (detail.type !== _this.type) {
return;
}
@@ -4572,16 +4562,16 @@
};
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;
+ var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, k, left, len1, mRect, menu, ref, ref1, ref2, right, style, top;
menu = this.menu = this.makeMenu();
currentMenu = this;
lastToggledButton = button;
this.entries.sort(function(first, second) {
return first.order - second.order;
});
- _ref = this.entries;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- entry = _ref[_i];
+ ref = this.entries;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ entry = ref[k];
this.insertEntry(entry, menu, data);
}
$.addClass(lastToggledButton, 'active');
@@ -4593,13 +4583,13 @@
bLeft = window.scrollX + bRect.left;
cHeight = doc.clientHeight;
cWidth = doc.clientWidth;
- _ref1 = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom, null] : [null, cHeight - bRect.top], top = _ref1[0], bottom = _ref1[1];
- _ref2 = bRect.left + mRect.width < cWidth ? [bRect.left, null] : [null, cWidth - bRect.right], left = _ref2[0], right = _ref2[1];
+ ref1 = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom, null] : [null, cHeight - bRect.top], top = ref1[0], bottom = ref1[1];
+ ref2 = bRect.left + mRect.width < cWidth ? [bRect.left, null] : [null, cWidth - bRect.right], left = ref2[0], right = ref2[1];
style = menu.style;
- style.top = "" + top + "px";
- style.right = "" + right + "px";
- style.bottom = "" + bottom + "px";
- style.left = "" + left + "px";
+ style.top = top + "px";
+ style.right = right + "px";
+ style.bottom = bottom + "px";
+ style.left = left + "px";
if (right) {
$.addClass(menu, 'left');
}
@@ -4609,7 +4599,7 @@
};
Menu.prototype.insertEntry = function(entry, parent, data) {
- var subEntry, submenu, _i, _len, _ref;
+ var k, len1, ref, subEntry, submenu;
if (typeof entry.open === 'function') {
if (!entry.open(data)) {
return;
@@ -4625,9 +4615,9 @@
submenu = $.el('div', {
className: 'dialog submenu'
});
- _ref = entry.subEntries;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- subEntry = _ref[_i];
+ ref = entry.subEntries;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ subEntry = ref[k];
this.insertEntry(subEntry, submenu, data);
}
$.add(entry.el, submenu);
@@ -4644,7 +4634,7 @@
Menu.prototype.findNextEntry = function(entry, direction) {
var entries;
- entries = __slice.call(entry.parentNode.children);
+ entries = slice.call(entry.parentNode.children);
entries.sort(function(first, second) {
return first.style.order - second.style.order;
});
@@ -4702,13 +4692,13 @@
};
Menu.prototype.focus = function(entry) {
- var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2;
+ var bottom, cHeight, cWidth, eRect, focused, k, left, len1, ref, ref1, ref2, right, sRect, style, submenu, top;
while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
$.rmClass(focused, 'focused');
}
- _ref = $$('.focused', entry);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- focused = _ref[_i];
+ ref = $$('.focused', entry);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ focused = ref[k];
$.rmClass(focused, 'focused');
}
$.addClass(entry, 'focused');
@@ -4719,8 +4709,8 @@
eRect = entry.getBoundingClientRect();
cHeight = doc.clientHeight;
cWidth = doc.clientWidth;
- _ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = _ref1[0], bottom = _ref1[1];
- _ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = _ref2[0], right = _ref2[1];
+ ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1];
+ ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1];
style = submenu.style;
style.top = top;
style.bottom = bottom;
@@ -4734,7 +4724,7 @@
};
Menu.prototype.parseEntry = function(entry) {
- var el, subEntries, subEntry, _i, _len;
+ var el, k, len1, subEntries, subEntry;
el = entry.el, subEntries = entry.subEntries;
$.addClass(el, 'entry');
$.on(el, 'focus mouseover', this.onFocus);
@@ -4743,8 +4733,8 @@
return;
}
$.addClass(el, 'has-submenu');
- for (_i = 0, _len = subEntries.length; _i < _len; _i++) {
- subEntry = subEntries[_i];
+ for (k = 0, len1 = subEntries.length; k < len1; k++) {
+ subEntry = subEntries[k];
this.parseEntry(subEntry);
}
};
@@ -4753,7 +4743,7 @@
})();
dragstart = function(e) {
- var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
+ var el, isTouching, o, rect, ref, screenHeight, screenWidth;
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -4776,7 +4766,7 @@
screenWidth: screenWidth,
isTouching: isTouching
};
- _ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = _ref[0], o.bottomBorder = _ref[1];
+ ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1];
if (isTouching) {
o.identifier = e.identifier;
o.move = touchmove.bind(o);
@@ -4791,10 +4781,10 @@
}
};
touchmove = function(e) {
- var touch, _i, _len, _ref;
- _ref = e.changedTouches;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- touch = _ref[_i];
+ var k, len1, ref, touch;
+ ref = e.changedTouches;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ touch = ref[k];
if (touch.identifier === this.identifier) {
drag.call(this, touch);
return;
@@ -4817,10 +4807,10 @@
return style.bottom = bottom;
};
touchend = function(e) {
- var touch, _i, _len, _ref;
- _ref = e.changedTouches;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- touch = _ref[_i];
+ var k, len1, ref, touch;
+ ref = e.changedTouches;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ touch = ref[k];
if (touch.identifier === this.identifier) {
dragend.call(this);
return;
@@ -4835,16 +4825,16 @@
$.off(d, 'mousemove', this.move);
$.off(d, 'mouseup', this.up);
}
- return $.set("" + this.id + ".position", this.style.cssText);
+ return $.set(this.id + ".position", this.style.cssText);
};
- hoverstart = function(_arg) {
- var asapTest, cb, el, endEvents, height, latestEvent, noRemove, o, root, _ref;
- root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, height = _arg.height, cb = _arg.cb, noRemove = _arg.noRemove;
+ hoverstart = function(arg) {
+ var asapTest, cb, el, endEvents, height, latestEvent, noRemove, o, ref, root;
+ root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, asapTest = arg.asapTest, height = arg.height, cb = arg.cb, noRemove = arg.noRemove;
o = {
root: root,
el: el,
style: el.style,
- isImage: (_ref = el.nodeName) === 'IMG' || _ref === 'VIDEO',
+ isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO',
cb: cb,
endEvents: endEvents,
latestEvent: latestEvent,
@@ -4875,7 +4865,7 @@
return $.on(doc, 'mousemove', o.workaround);
};
hover = function(e) {
- var clientX, clientY, height, left, right, style, threshold, top, _ref;
+ var clientX, clientY, height, left, ref, right, style, threshold, top;
this.latestEvent = e;
height = this.height || this.el.offsetHeight;
clientX = e.clientX, clientY = e.clientY;
@@ -4884,7 +4874,7 @@
if (!this.isImage) {
threshold = Math.max(threshold, this.clientWidth - 400);
}
- _ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = _ref[0], right = _ref[1];
+ ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
style = this.style;
style.top = top + 'px';
style.left = left;
@@ -4939,7 +4929,7 @@
headers: headers,
overrideMimeType: "text/plain; charset=x-user-defined",
onload: function(xhr) {
- var contentDisposition, contentType, data, i, r, _ref, _ref1;
+ var contentDisposition, contentType, data, i, r, ref, ref1;
r = xhr.responseText;
data = new Uint8Array(r.length);
i = 0;
@@ -4947,8 +4937,8 @@
data[i] = r.charCodeAt(i);
i++;
}
- contentType = (_ref = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? _ref[1] : void 0;
- contentDisposition = (_ref1 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? _ref1[1] : void 0;
+ contentType = (ref = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref[1] : void 0;
+ contentDisposition = (ref1 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref1[1] : void 0;
return cb(data, contentType, contentDisposition);
},
onerror: function() {
@@ -4961,13 +4951,13 @@
},
file: function(url, cb) {
return CrossOrigin.binary(url, function(data, contentType, contentDisposition) {
- var blob, match, mime, name, _ref, _ref1, _ref2;
+ var blob, match, mime, name, ref, ref1, ref2;
if (data == null) {
return cb(null);
}
- name = (_ref = url.match(/([^\/]+)\/*$/)) != null ? _ref[1] : void 0;
+ name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0;
mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream';
- match = (contentDisposition != null ? (_ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? _ref1[1] : void 0 : void 0) || (contentType != null ? (_ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? _ref2[1] : void 0 : void 0);
+ match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0);
if (match) {
name = match.replace(/\\"/g, '"');
}
@@ -4996,11 +4986,11 @@
method: "GET",
url: url + '',
onload: function(xhr) {
- var response, _i, _len, _ref;
+ var k, len1, ref, response;
response = JSON.parse(xhr.responseText);
- _ref = callbacks[url];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- cb = _ref[_i];
+ ref = callbacks[url];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ cb = ref[k];
cb(response);
}
delete callbacks[url];
@@ -5020,8 +5010,8 @@
Anonymize = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread' || _ref === 'archive') && Conf['Anonymize'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Anonymize'])) {
return;
}
if (g.VIEW === 'archive') {
@@ -5033,11 +5023,11 @@
});
},
node: function() {
- var email, name, tripcode, _ref;
+ var email, name, ref, tripcode;
if (this.info.capcode || this.isClone) {
return;
}
- _ref = this.nodes, name = _ref.name, tripcode = _ref.tripcode, email = _ref.email;
+ ref = this.nodes, name = ref.name, tripcode = ref.tripcode, email = ref.email;
if (this.info.name !== 'Anonymous') {
name.textContent = 'Anonymous';
}
@@ -5052,15 +5042,15 @@
},
archive: function() {
return $.ready(function() {
- var name, trip, _i, _j, _len, _len1, _ref, _ref1;
- _ref = $$('.name');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ var k, len1, len2, name, q, ref, ref1, trip;
+ ref = $$('.name');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
name.textContent = 'Anonymous';
}
- _ref1 = $$('.postertrip');
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- trip = _ref1[_j];
+ ref1 = $$('.postertrip');
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ trip = ref1[q];
$.rm(trip);
}
});
@@ -5070,8 +5060,8 @@
Filter = {
filters: {},
init: function() {
- var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Filter'])) {
+ var boards, err, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, regexp, stub, top;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
return;
}
if (!Conf['Filtered Backlinks']) {
@@ -5079,9 +5069,9 @@
}
for (key in Config.filter) {
this.filters[key] = [];
- _ref1 = Conf[key].split('\n');
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- line = _ref1[_i];
+ ref1 = Conf[key].split('\n');
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ line = ref1[k];
if (line[0] === '#') {
continue;
}
@@ -5089,8 +5079,8 @@
continue;
}
filter = line.replace(regexp[0], '');
- boards = ((_ref2 = filter.match(/boards:([^;]+)/)) != null ? _ref2[1].toLowerCase() : void 0) || 'global';
- if (boards !== 'global' && (_ref3 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref3) < 0)) {
+ boards = ((ref2 = filter.match(/boards:([^;]+)/)) != null ? ref2[1].toLowerCase() : void 0) || 'global';
+ if (boards !== 'global' && (ref3 = g.BOARD.ID, indexOf.call(boards.split(','), ref3) < 0)) {
continue;
}
if (key === 'uniqueID' || key === 'MD5') {
@@ -5104,10 +5094,10 @@
continue;
}
}
- op = ((_ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref4[1] : void 0) || 'yes';
+ op = ((ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? ref4[1] : void 0) || 'yes';
stub = (function() {
- var _ref5;
- switch ((_ref5 = filter.match(/stub:(yes|no)/)) != null ? _ref5[1] : void 0) {
+ var ref5;
+ switch ((ref5 = filter.match(/stub:(yes|no)/)) != null ? ref5[1] : void 0) {
case 'yes':
return true;
case 'no':
@@ -5117,8 +5107,8 @@
}
})();
if (hl = /highlight/.test(filter)) {
- hl = ((_ref5 = filter.match(/highlight:([\w-]+)/)) != null ? _ref5[1] : void 0) || 'filter-highlight';
- top = ((_ref6 = filter.match(/top:(yes|no)/)) != null ? _ref6[1] : void 0) || 'yes';
+ hl = ((ref5 = filter.match(/highlight:([\w-]+)/)) != null ? ref5[1] : void 0) || 'filter-highlight';
+ top = ((ref6 = filter.match(/top:(yes|no)/)) != null ? ref6[1] : void 0) || 'yes';
top = top === 'yes';
}
this.filters[key].push(this.createFilter(regexp, op, stub, hl, top));
@@ -5159,15 +5149,15 @@
};
},
node: function() {
- var filter, key, result, value, _i, _len, _ref, _ref1;
+ var filter, k, key, len1, ref, ref1, result, value;
if (this.isClone || this.isFetchedQuote) {
return;
}
for (key in Filter.filters) {
if ((value = Filter[key](this)) !== false) {
- _ref = Filter.filters[key];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- filter = _ref[_i];
+ ref = Filter.filters[key];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ filter = ref[k];
if (!(result = filter(value, this.isReply))) {
continue;
}
@@ -5182,7 +5172,7 @@
return;
}
$.addClass(this.nodes.root, result["class"]);
- if (!(this.highlights && (_ref1 = result["class"], __indexOf.call(this.highlights, _ref1) >= 0))) {
+ if (!(this.highlights && (ref1 = result["class"], indexOf.call(this.highlights, ref1) >= 0))) {
(this.highlights || (this.highlights = [])).push(result["class"]);
}
if (!this.isReply && result.top) {
@@ -5262,8 +5252,8 @@
},
menu: {
init: function() {
- var div, entry, type, _i, _len, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
+ var div, entry, k, len1, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
return;
}
div = $.el('div', {
@@ -5278,9 +5268,9 @@
},
subEntries: []
};
- _ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- type = _ref1[_i];
+ ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ type = ref1[k];
entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1]));
}
return Menu.menu.addEntry(entry);
@@ -5319,7 +5309,7 @@
return $.get(type, Conf[type], function(item) {
var save, section, select, ta, tl;
save = item[type];
- save = save ? "" + save + "\n" + re : re;
+ save = save ? save + "\n" + re : re;
$.set(type, save);
Settings.open('Filter');
section = $('.section-container');
@@ -5337,8 +5327,8 @@
PostHiding = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
return;
}
if (Conf['Reply Hiding Buttons']) {
@@ -5376,8 +5366,8 @@
},
menu: {
init: function() {
- var apply, div, hideStubLink, makeStub, replies, thisPost, _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
+ var apply, div, hideStubLink, makeStub, ref, replies, thisPost;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
return;
}
div = $.el('div', {
@@ -5542,7 +5532,7 @@
textContent: ""
});
a = $.el('a', {
- className: "" + type + "-reply-button",
+ className: type + "-reply-button",
href: 'javascript:;'
});
$.add(a, span);
@@ -5574,7 +5564,7 @@
return PostHiding.saveHiddenState(post, post.isHidden);
},
hide: function(post, makeStub, hideRecursively) {
- var a, quotelink, _i, _len, _ref;
+ var a, k, len1, quotelink, ref;
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -5589,9 +5579,9 @@
Recursive.apply(PostHiding.hide, post, makeStub, true);
Recursive.add(PostHiding.hide, post, makeStub, true);
}
- _ref = Get.allQuotelinksLinkingTo(post);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
$.addClass(quotelink, 'filtered');
}
if (!makeStub) {
@@ -5610,7 +5600,7 @@
return $.prepend(post.nodes.root, post.nodes.stub);
},
show: function(post, showRecursively) {
- var quotelink, _i, _len, _ref;
+ var k, len1, quotelink, ref;
if (showRecursively == null) {
showRecursively = Conf['Recursive Hiding'];
}
@@ -5625,9 +5615,9 @@
Recursive.apply(PostHiding.show, post, true);
Recursive.rm(PostHiding.hide, post);
}
- _ref = Get.allQuotelinksLinkingTo(post);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
$.rmClass(quotelink, 'filtered');
}
}
@@ -5636,8 +5626,8 @@
Recursive = {
recursives: {},
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
return Post.callbacks.push({
@@ -5646,26 +5636,26 @@
});
},
node: function() {
- var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
+ var i, k, len1, len2, obj, q, quote, recursive, ref, ref1;
if (this.isClone || this.isFetchedQuote) {
return;
}
- _ref = this.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = this.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
if (obj = Recursive.recursives[quote]) {
- _ref1 = obj.recursives;
- for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) {
- recursive = _ref1[i];
- recursive.apply(null, [this].concat(__slice.call(obj.args[i])));
+ ref1 = obj.recursives;
+ for (i = q = 0, len2 = ref1.length; q < len2; i = ++q) {
+ recursive = ref1[i];
+ recursive.apply(null, [this].concat(slice.call(obj.args[i])));
}
}
}
},
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] = {
+ var args, base1, name1, obj, post, recursive;
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
+ obj = (base1 = Recursive.recursives)[name1 = post.fullID] || (base1[name1] = {
recursives: [],
args: []
});
@@ -5673,13 +5663,13 @@
return obj.args.push(args);
},
rm: function(recursive, post) {
- var i, obj, rec, _i, _len, _ref;
+ var i, k, len1, obj, rec, ref;
if (!(obj = Recursive.recursives[post.fullID])) {
return;
}
- _ref = obj.recursives;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- rec = _ref[i];
+ ref = obj.recursives;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ rec = ref[i];
if (!(rec === recursive)) {
continue;
}
@@ -5689,11 +5679,11 @@
},
apply: function() {
var args, fullID, post, recursive;
- recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
fullID = post.fullID;
return g.posts.forEach(function(post) {
- if (__indexOf.call(post.quotes, fullID) >= 0) {
- return recursive.apply(null, [post].concat(__slice.call(args)));
+ if (indexOf.call(post.quotes, fullID) >= 0) {
+ return recursive.apply(null, [post].concat(slice.call(args)));
}
});
}
@@ -5701,8 +5691,8 @@
ThreadHiding = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) {
return;
}
this.db = new DataBoard('hiddenThreads');
@@ -5774,9 +5764,9 @@
return $.prepend(this.OP.nodes.root, ThreadHiding.makeButton(this, 'hide'));
},
onIndexBuild: function(nodes) {
- var root, thread, _i, _len;
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- root = nodes[_i];
+ var k, len1, root, thread;
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ root = nodes[k];
thread = Get.threadFromRoot(root);
if (thread.isHidden && thread.stub && !root.contains(thread.stub)) {
ThreadHiding.makeStub(thread, root);
@@ -5802,9 +5792,9 @@
Menu.menu.addEntry({
el: div,
order: 20,
- open: function(_arg) {
+ open: function(arg) {
var isReply, thread;
- thread = _arg.thread, isReply = _arg.isReply;
+ thread = arg.thread, isReply = arg.isReply;
if (isReply || thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
return false;
}
@@ -5828,9 +5818,9 @@
Menu.menu.addEntry({
el: div,
order: 20,
- open: function(_arg) {
+ open: function(arg) {
var isReply, thread;
- thread = _arg.thread, isReply = _arg.isReply;
+ thread = arg.thread, isReply = arg.isReply;
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
return false;
}
@@ -5846,9 +5836,9 @@
return Menu.menu.addEntry({
el: hideStubLink,
order: 15,
- open: function(_arg) {
+ open: function(arg) {
var isReply, thread;
- thread = _arg.thread, isReply = _arg.isReply;
+ thread = arg.thread, isReply = arg.isReply;
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
return false;
}
@@ -5883,7 +5873,7 @@
makeButton: function(thread, type) {
var a;
a = $.el('a', {
- className: "" + type + "-thread-button",
+ className: type + "-thread-button",
href: 'javascript:;'
});
$.extend(a, {
@@ -5900,7 +5890,7 @@
numReplies += +summary.textContent.match(/\d+/);
}
a = ThreadHiding.makeButton(thread, 'show');
- $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : "" + numReplies + " replies") + ")"));
+ $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")"));
thread.stub = $.el('div', {
className: 'stub'
});
@@ -5974,8 +5964,8 @@
QuoteBacklink = {
containers: {},
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Backlinks']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) {
return;
}
Post.callbacks.push({
@@ -5988,7 +5978,7 @@
});
},
firstNode: function() {
- var a, clone, container, containers, hash, link, markYours, nodes, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
+ var a, clone, container, containers, hash, k, len1, len2, len3, link, markYours, nodes, post, q, quote, ref, ref1, u;
if (this.isClone || !this.quotes.length || this.isRebuilt) {
return;
}
@@ -6009,19 +5999,19 @@
};
})(this)) + (markYours ? '\u00A0(You)' : '')
});
- _ref = this.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = this.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
containers = [QuoteBacklink.getContainer(quote)];
if ((post = g.posts[quote]) && post.nodes.backlinkContainer) {
- _ref1 = post.clones;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- clone = _ref1[_j];
+ ref1 = post.clones;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ clone = ref1[q];
containers.push(clone.nodes.backlinkContainer);
}
}
- for (_k = 0, _len2 = containers.length; _k < _len2; _k++) {
- container = containers[_k];
+ for (u = 0, len3 = containers.length; u < len3; u++) {
+ container = containers[u];
nodes = [$.tn(' '), link = a.cloneNode(true)];
if (Conf['Quote Previewing']) {
$.on(link, 'mouseover', QuotePreview.mouseover);
@@ -6051,8 +6041,8 @@
return $.add(this.nodes.info, container);
},
getContainer: function(id) {
- var _base;
- return (_base = this.containers)[id] || (_base[id] = $.el('span', {
+ var base1;
+ return (base1 = this.containers)[id] || (base1[id] = $.el('span', {
className: 'container'
}));
}
@@ -6060,8 +6050,8 @@
QuoteCT = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6074,15 +6064,15 @@
});
},
node: function() {
- var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2;
+ var board, boardID, k, len1, quotelink, ref, ref1, ref2, thread, threadID;
if (this.isClone && this.thread === this.context.thread) {
return;
}
- _ref = this.isClone ? this.context : this, board = _ref.board, thread = _ref.thread;
- _ref1 = this.nodes.quotelinks;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- quotelink = _ref1[_i];
- _ref2 = Get.postDataFromLink(quotelink), boardID = _ref2.boardID, threadID = _ref2.threadID;
+ ref = this.isClone ? this.context : this, board = ref.board, thread = ref.thread;
+ ref1 = this.nodes.quotelinks;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ quotelink = ref1[k];
+ ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID;
if (!threadID) {
continue;
}
@@ -6098,8 +6088,8 @@
QuoteInline = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Inlining']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) {
return;
}
this.process = Conf['Quote Hash Navigation'] ? function(link, clone) {
@@ -6119,17 +6109,17 @@
});
},
node: function() {
- var isClone, link, process, _i, _j, _len, _len1, _ref, _ref1;
+ var isClone, k, len1, len2, link, process, q, ref, ref1;
process = QuoteInline.process;
isClone = this.isClone;
- _ref = this.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- link = _ref[_i];
+ ref = this.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
process(link, isClone);
}
- _ref1 = this.nodes.backlinks;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- link = _ref1[_j];
+ ref1 = this.nodes.backlinks;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ link = ref1[q];
process(link, isClone);
}
},
@@ -6146,12 +6136,12 @@
});
},
toggle: function(e) {
- var boardID, context, postID, threadID, _ref;
+ var boardID, context, postID, ref, threadID;
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
e.preventDefault();
- _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
context = Get.contextFromNode(this);
if ($.hasClass(this, 'inlined')) {
QuoteInline.rm(this, boardID, threadID, postID, context);
@@ -6182,7 +6172,7 @@
qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
$.addClass(qroot, 'hasInline');
new Fetcher(boardID, threadID, postID, inline, context);
- if (!((post = g.posts["" + boardID + "." + postID]) && context.thread === post.thread)) {
+ if (!((post = g.posts[boardID + "." + postID]) && context.thread === post.thread)) {
return;
}
if (isBacklink && Conf['Forward Hiding']) {
@@ -6195,7 +6185,7 @@
return Unread.readSinglePost(post);
},
rm: function(quotelink, boardID, threadID, postID, context) {
- var el, inlined, isBacklink, post, qroot, root, _ref;
+ var el, inlined, isBacklink, post, qroot, ref, root;
isBacklink = $.hasClass(quotelink, 'backlink');
root = QuoteInline.findRoot(quotelink, isBacklink);
root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root);
@@ -6207,14 +6197,14 @@
if (!(el = root.firstElementChild)) {
return;
}
- post = g.posts["" + boardID + "." + postID];
+ post = g.posts[boardID + "." + postID];
post.rmClone(el.dataset.clone);
- if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads["" + boardID + "." + threadID] && !--post.forwarded) {
+ if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads[boardID + "." + threadID] && !--post.forwarded) {
delete post.forwarded;
$.rmClass(post.nodes.root, 'forwarded');
}
while (inlined = $('.inlined', el)) {
- _ref = Get.postDataFromLink(inlined), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
QuoteInline.rm(inlined, boardID, threadID, postID, context);
$.rmClass(inlined, 'inlined');
}
@@ -6223,8 +6213,8 @@
QuoteOP = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark OP Quotes']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6237,7 +6227,7 @@
});
},
node: function() {
- var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref, _ref1;
+ var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1;
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -6245,20 +6235,20 @@
return;
}
quotelinks = this.nodes.quotelinks;
- if (this.isClone && (_ref = this.thread.fullID, __indexOf.call(quotes, _ref) >= 0)) {
+ if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) {
i = 0;
while (quotelink = quotelinks[i++]) {
quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, '');
}
}
fullID = (this.isClone ? this.context : this).thread.fullID;
- if (__indexOf.call(quotes, fullID) < 0) {
+ if (indexOf.call(quotes, fullID) < 0) {
return;
}
i = 0;
while (quotelink = quotelinks[i++]) {
- _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
- if (("" + boardID + "." + postID) === fullID) {
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((boardID + "." + postID) === fullID) {
$.add(quotelink, $.tn(QuoteOP.text));
}
}
@@ -6267,8 +6257,8 @@
QuotePreview = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Quote Previewing'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Quote Previewing'])) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6280,19 +6270,19 @@
});
},
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];
+ var k, len1, link, ref;
+ ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
$.on(link, 'mouseover', QuotePreview.mouseover);
}
},
mouseover: function(e) {
- var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1;
+ var boardID, clone, k, len1, len2, origin, post, postID, posts, q, qp, quote, quoterID, ref, ref1, threadID;
if ($.hasClass(this, 'inlined')) {
return;
}
- _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
qp = $.el('div', {
id: 'qp',
className: 'dialog'
@@ -6309,29 +6299,29 @@
return qp.firstElementChild;
}
});
- if (!(origin = g.posts["" + boardID + "." + postID])) {
+ if (!(origin = g.posts[boardID + "." + postID])) {
return;
}
if (Conf['Quote Highlighting']) {
posts = [origin].concat(origin.clones);
posts.pop();
- for (_i = 0, _len = posts.length; _i < _len; _i++) {
- post = posts[_i];
+ for (k = 0, len1 = posts.length; k < len1; k++) {
+ post = posts[k];
$.addClass(post.nodes.post, 'qphl');
}
}
quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0];
clone = Get.postFromRoot(qp.firstChild);
- _ref1 = clone.nodes.quotelinks.concat(__slice.call(clone.nodes.backlinks));
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- quote = _ref1[_j];
+ ref1 = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks));
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ quote = ref1[q];
if (quote.hash.slice(2) === quoterID) {
$.addClass(quote, 'forwardlink');
}
}
},
mouseout: function() {
- var clone, post, root, _i, _len, _ref;
+ var clone, k, len1, post, ref, root;
if (!(root = this.el.firstElementChild)) {
return;
}
@@ -6341,9 +6331,9 @@
if (!Conf['Quote Highlighting']) {
return;
}
- _ref = [post].concat(post.clones);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ ref = [post].concat(post.clones);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
$.rmClass(post.nodes.post, 'qphl');
}
}
@@ -6351,8 +6341,8 @@
QuoteStrikeThrough = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
return;
}
return Post.callbacks.push({
@@ -6361,15 +6351,15 @@
});
},
node: function() {
- var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
+ var boardID, k, len1, postID, quotelink, ref, ref1, ref2;
if (this.isClone) {
return;
}
- _ref = this.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
- _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
- if ((_ref2 = g.posts["" + boardID + "." + postID]) != null ? _ref2.isHidden : void 0) {
+ ref = this.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((ref2 = g.posts[boardID + "." + postID]) != null ? ref2.isHidden : void 0) {
$.addClass(quotelink, 'filtered');
}
}
@@ -6425,15 +6415,15 @@
});
},
node: function() {
- var ancestor, lastParent, parent, parents, quote, _i, _len, _ref;
+ var ancestor, k, lastParent, len1, parent, parents, quote, ref;
if (this.isFetchedQuote || this.isClone || !this.isReply) {
return;
}
parents = new Set();
lastParent = null;
- _ref = this.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = this.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
if (parent = g.posts[quote]) {
if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) {
parents.add(parent.ID);
@@ -6455,27 +6445,27 @@
}
},
descendants: function(post) {
- var child, children, posts, _i, _len;
+ var child, children, k, len1, posts;
posts = [post];
if (children = QuoteThreading.children[post.fullID]) {
- for (_i = 0, _len = children.length; _i < _len; _i++) {
- child = children[_i];
+ for (k = 0, len1 = children.length; k < len1; k++) {
+ child = children[k];
posts = posts.concat(QuoteThreading.descendants(child));
}
}
return posts;
},
insert: function(post) {
- var child, children, descendants, i, next, nodes, order, parent, prev, prev2, threadContainer, x, _base, _i, _j, _k, _len, _name;
+ var base1, child, children, descendants, i, k, len1, name1, next, nodes, order, parent, prev, prev2, q, threadContainer, u, x;
if (!(QuoteThreading.enabled && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) {
return false;
}
descendants = QuoteThreading.descendants(post);
if (!Unread.posts.has(parent.ID)) {
if ((function() {
- var x, _i, _len;
- for (_i = 0, _len = descendants.length; _i < _len; _i++) {
- x = descendants[_i];
+ var k, len1, x;
+ for (k = 0, len1 = descendants.length; k < len1; k++) {
+ x = descendants[k];
if (Unread.posts.has(x.ID)) {
return true;
}
@@ -6486,7 +6476,7 @@
}
}
order = Unread.order;
- children = ((_base = QuoteThreading.children)[_name = parent.fullID] || (_base[_name] = []));
+ children = ((base1 = QuoteThreading.children)[name1 = parent.fullID] || (base1[name1] = []));
threadContainer = parent.nodes.threadContainer || $.el('div', {
className: 'threadContainer'
});
@@ -6495,16 +6485,16 @@
nodes.push(post.nodes.threadContainer);
}
i = children.length;
- for (_i = children.length - 1; _i >= 0; _i += -1) {
- child = children[_i];
+ for (k = children.length - 1; k >= 0; k += -1) {
+ child = children[k];
if (child.ID >= post.ID) {
i--;
}
}
if (i !== children.length) {
next = children[i];
- for (_j = 0, _len = descendants.length; _j < _len; _j++) {
- x = descendants[_j];
+ for (q = 0, len1 = descendants.length; q < len1; q++) {
+ x = descendants[q];
order.before(order[next.ID], order[x.ID]);
}
children.splice(i, 0, post);
@@ -6514,8 +6504,8 @@
while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
prev = prev2[prev2.length - 1];
}
- for (_k = descendants.length - 1; _k >= 0; _k += -1) {
- x = descendants[_k];
+ for (u = descendants.length - 1; u >= 0; u += -1) {
+ x = descendants[u];
order.after(order[prev.ID], order[x.ID]);
}
children.push(post);
@@ -6567,8 +6557,8 @@
QuoteYou = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
if (Conf['Highlight Own Posts']) {
@@ -6587,7 +6577,7 @@
});
},
node: function() {
- var quotelink, _i, _len, _ref;
+ var k, len1, quotelink, ref;
if (this.isClone) {
return;
}
@@ -6601,9 +6591,9 @@
if (!this.quotes.length) {
return;
}
- _ref = this.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = this.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
continue;
}
@@ -6632,7 +6622,7 @@
} else {
post = QuoteYou.lastRead;
}
- str = "" + type + "::div[contains(@class,'quotesYou')]";
+ str = type + "::div[contains(@class,'quotesYou')]";
while (post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0)) {
if (QuoteYou.cb.scroll(post)) {
return;
@@ -6657,8 +6647,8 @@
Quotify = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Resurrect Quotes']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6670,10 +6660,10 @@
});
},
node: function() {
- var deadlink, _i, _len, _ref;
- _ref = $$('.deadlink', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- deadlink = _ref[_i];
+ var deadlink, k, len1, ref;
+ ref = $$('.deadlink', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ deadlink = ref[k];
if (this.isClone) {
if ($.hasClass(deadlink, 'quotelink')) {
this.nodes.quotelinks.push(deadlink);
@@ -6684,13 +6674,13 @@
}
},
parseDeadlink: function(deadlink) {
- var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, _ref;
+ var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref;
if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
Quotify.fixDeadlink(deadlink);
return;
}
quote = deadlink.textContent;
- if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) {
+ if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) {
return;
}
if (postID[0] === '0') {
@@ -6698,7 +6688,7 @@
return;
}
boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID;
- quoteID = "" + boardID + "." + postID;
+ quoteID = boardID + "." + postID;
if (post = g.posts[quoteID]) {
if (!post.isDead) {
a = $.el('a', {
@@ -6711,7 +6701,7 @@
href: Build.postURL(boardID, post.thread.ID, postID),
className: 'quotelink deadlink',
target: '_blank',
- textContent: "" + quote + "\u00A0(Dead)"
+ textContent: quote + "\u00A0(Dead)"
});
$.extend(a.dataset, {
boardID: boardID,
@@ -6734,7 +6724,7 @@
href: redirect || 'javascript:;',
className: 'deadlink',
target: '_blank',
- textContent: "" + quote + "\u00A0(Dead)"
+ textContent: quote + "\u00A0(Dead)"
});
if (fetchable) {
$.addClass(a, 'quotelink');
@@ -6745,11 +6735,11 @@
}
}
}
- if (__indexOf.call(this.quotes, quoteID) < 0) {
+ if (indexOf.call(this.quotes, quoteID) < 0) {
this.quotes.push(quoteID);
}
if (!a) {
- deadlink.textContent = "" + quote + "\u00A0(Dead)";
+ deadlink.textContent = quote + "\u00A0(Dead)";
return;
}
$.replace(deadlink, a);
@@ -6766,7 +6756,7 @@
$.before(deadlink, green);
$.add(green, deadlink);
}
- return $.replace(deadlink, __slice.call(deadlink.childNodes));
+ return $.replace(deadlink, slice.call(deadlink.childNodes));
}
};
@@ -6786,9 +6776,6 @@
noscript = Conf['Force Noscript Captcha'] || !doc.dataset.jsEnabled;
this.captcha = Captcha[noscript ? 'noscript' : 'v2'];
$.on(d, '4chanXInitFinished', this.initReady);
- window.addEventListener('focus', this.focus, true);
- window.addEventListener('blur', this.focus, true);
- $.on(d, 'click', this.focus);
Post.callbacks.push({
name: 'Quick Reply',
cb: this.node
@@ -6872,7 +6859,7 @@
return;
}
thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads["" + g.BOARD + "." + thread].isDead) {
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
return QR.abort();
} else {
return QR.status();
@@ -6910,7 +6897,7 @@
}
},
close: function() {
- var post, _i, _len, _ref;
+ var k, len1, post, ref;
if (QR.req) {
QR.abort();
return;
@@ -6923,9 +6910,9 @@
$.addClass(QR.shortcut, 'disabled');
}
new QR.post(true);
- _ref = QR.posts.splice(0, QR.posts.length - 1);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ ref = QR.posts.splice(0, QR.posts.length - 1);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
post["delete"]();
}
QR.cooldown.auto = false;
@@ -6935,9 +6922,6 @@
focus: function() {
$.queueTask(function() {
var focus;
- if (!QR.nodes) {
- return;
- }
if (!$$('.goog-bubble-content > iframe').some(function(el) {
return el.getBoundingClientRect().top >= 0;
})) {
@@ -6977,6 +6961,17 @@
return QR.unhide();
}
},
+ setCustomCooldown: function(enabled) {
+ Conf['customCooldownEnabled'] = enabled;
+ QR.cooldown.customCooldown = enabled;
+ return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);
+ },
+ toggleCustomCooldown: function() {
+ var enabled;
+ enabled = $.hasClass(this, 'disabled');
+ QR.setCustomCooldown(enabled);
+ return $.set('customCooldownEnabled', enabled);
+ },
error: function(err) {
var el;
QR.open();
@@ -7013,10 +7008,10 @@
},
notifications: [],
cleanNotifications: function() {
- var notification, _i, _len, _ref;
- _ref = QR.notifications;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- notification = _ref[_i];
+ var k, len1, notification, ref;
+ ref = QR.notifications;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ notification = ref[k];
notification.close();
}
return QR.notifications = [];
@@ -7027,7 +7022,7 @@
return;
}
thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads["" + g.BOARD + "." + thread].isDead) {
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
value = 'Dead';
disabled = true;
QR.cooldown.auto = false;
@@ -7038,7 +7033,7 @@
return status.disabled = disabled || false;
},
quote: function(e) {
- var ancestor, caretPos, com, frag, index, insideCode, node, post, range, sel, text, thread, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
+ var ancestor, caretPos, com, frag, index, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, w, y, z;
if (e != null) {
e.preventDefault();
}
@@ -7060,37 +7055,37 @@
$.prepend(frag, $.tn('[code]'));
$.add(frag, $.tn('[/code]'));
}
- _ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
$.replace(node, $.tn('\n'));
}
- _ref1 = $$('br', frag);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- node = _ref1[_j];
+ ref1 = $$('br', frag);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ node = ref1[q];
if (node !== frag.lastChild) {
$.replace(node, $.tn('\n>'));
}
}
- _ref2 = $$('s, .removed-spoiler', frag);
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- node = _ref2[_k];
- $.replace(node, [$.tn('[spoiler]')].concat(__slice.call(node.childNodes), [$.tn('[/spoiler]')]));
+ ref2 = $$('s, .removed-spoiler', frag);
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ node = ref2[u];
+ $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')]));
}
- _ref3 = $$('.prettyprint', frag);
- for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
- node = _ref3[_l];
- $.replace(node, [$.tn('[code]')].concat(__slice.call(node.childNodes), [$.tn('[/code]')]));
+ ref3 = $$('.prettyprint', frag);
+ for (w = 0, len4 = ref3.length; w < len4; w++) {
+ node = ref3[w];
+ $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')]));
}
- _ref4 = $$('.linkify[data-original]', frag);
- for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) {
- node = _ref4[_m];
+ ref4 = $$('.linkify[data-original]', frag);
+ for (y = 0, len5 = ref4.length; y < len5; y++) {
+ node = ref4[y];
$.replace(node, $.tn(node.dataset.original));
}
- _ref5 = $$('.embedder', frag);
- for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) {
- node = _ref5[_n];
- if (((_ref6 = node.previousSibling) != null ? _ref6.nodeValue : void 0) === ' ') {
+ ref5 = $$('.embedder', frag);
+ for (z = 0, len6 = ref5.length; z < len6; z++) {
+ node = ref5[z];
+ if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') {
$.rm(node.previousSibling);
}
$.rm(node);
@@ -7104,7 +7099,7 @@
$.addClass(QR.nodes.el, 'dump');
QR.cooldown.auto = true;
}
- _ref7 = QR.nodes, com = _ref7.com, thread = _ref7.thread;
+ ref7 = QR.nodes, com = ref7.com, thread = ref7.thread;
if (!com.value) {
thread.value = Get.threadFromNode(this);
}
@@ -7143,14 +7138,14 @@
return QR.handleFiles(e.dataTransfer.files);
},
paste: function(e) {
- var blob, files, item, _i, _len, _ref;
+ var blob, files, item, k, len1, ref;
if (!e.clipboardData.items) {
return;
}
files = [];
- _ref = e.clipboardData.items;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
+ ref = e.clipboardData.items;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
if (!(item.kind === 'file')) {
continue;
}
@@ -7183,16 +7178,16 @@
});
},
handleFiles: function(files) {
- var file, i, _i, _len;
+ var file, i, k, len1;
if (this !== QR) {
- files = __slice.call(this.files);
+ files = slice.call(this.files);
this.value = null;
}
if (!files.length) {
return;
}
QR.cleanNotifications();
- for (i = _i = 0, _len = files.length; _i < _len; i = ++_i) {
+ for (i = k = 0, len1 = files.length; k < len1; i = ++k) {
file = files[i];
QR.handleFile(file, i, files.length);
}
@@ -7201,7 +7196,7 @@
}
},
handleFile: function(file, index, nfiles) {
- var isNewPost, isSingle, max, post, _ref;
+ var isNewPost, isSingle, max, post, ref;
isSingle = nfiles === 1;
if (/^text\//.test(file.type)) {
if (isSingle) {
@@ -7212,8 +7207,8 @@
post.pasteText(file);
return;
}
- if (_ref = file.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
- QR.error("" + file.name + ": Unsupported file type.");
+ if (ref = file.type, indexOf.call(QR.mimeTypes, ref) < 0) {
+ QR.error(file.name + ": Unsupported file type.");
if (!isSingle) {
return;
}
@@ -7223,7 +7218,7 @@
max = Math.min(max, QR.max_size_video);
}
if (file.size > max) {
- QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
+ QR.error(file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
if (!isSingle) {
return;
}
@@ -7255,11 +7250,11 @@
height = img.height, width = img.width;
pass = true;
if (height > QR.max_height || width > QR.max_width) {
- QR.error("" + file.name + ": Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
+ QR.error(file.name + ": Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
pass = false;
}
if (height < QR.min_height || width < QR.min_width) {
- QR.error("" + file.name + ": Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ QR.error(file.name + ": Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
pass = false;
}
return cb(pass, img);
@@ -7271,7 +7266,7 @@
} else if (/^video\//.test(file.type)) {
video = $.el('video');
$.on(video, 'loadeddata', function() {
- var duration, max_height, max_width, pass, videoHeight, videoWidth, _ref;
+ var duration, max_height, max_width, pass, ref, videoHeight, videoWidth;
if (!cb) {
return;
}
@@ -7280,34 +7275,34 @@
max_width = Math.min(QR.max_width, QR.max_width_video);
pass = true;
if (videoHeight > max_height || videoWidth > max_width) {
- QR.error("" + file.name + ": Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
+ QR.error(file.name + ": Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
pass = false;
}
if (videoHeight < QR.min_height || videoWidth < QR.min_width) {
- QR.error("" + file.name + ": Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ QR.error(file.name + ": Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
pass = false;
}
if (!isFinite(duration)) {
- QR.error("" + file.name + ": Video lacks duration metadata (try remuxing)");
+ QR.error(file.name + ": Video lacks duration metadata (try remuxing)");
pass = false;
} else if (duration > QR.max_duration_video) {
- QR.error("" + file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
+ QR.error(file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
pass = false;
}
- if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && $.hasAudio(video)) {
- QR.error("" + file.name + ": Audio not allowed");
+ if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg') && $.hasAudio(video)) {
+ QR.error(file.name + ": Audio not allowed");
pass = false;
}
cb(pass, video);
return cb = null;
});
$.on(video, 'error', function() {
- var _ref;
+ var ref;
if (!cb) {
return;
}
- if (_ref = file.type, __indexOf.call(QR.mimeTypes, _ref) >= 0) {
- QR.error("" + file.name + ": Video appears corrupt");
+ if (ref = file.type, indexOf.call(QR.mimeTypes, ref) >= 0) {
+ QR.error(file.name + ": Video appears corrupt");
}
URL.revokeObjectURL(file);
cb(false, null);
@@ -7319,7 +7314,7 @@
}
},
openFileInput: function(e) {
- var _ref;
+ var ref;
e.stopPropagation();
if (e.shiftKey && e.type === 'click') {
return QR.selected.rmFile();
@@ -7328,22 +7323,22 @@
$.addClass(QR.nodes.filename, 'edit');
QR.nodes.filename.focus();
}
- if (e.target.nodeName === 'INPUT' || (e.keyCode && ((_ref = e.keyCode) !== 32 && _ref !== 13)) || e.ctrlKey) {
+ if (e.target.nodeName === 'INPUT' || (e.keyCode && ((ref = e.keyCode) !== 32 && ref !== 13)) || e.ctrlKey) {
return;
}
e.preventDefault();
return QR.nodes.fileInput.click();
},
generatePostableThreadsList: function() {
- var list, options, thread, val, _i, _len, _ref;
+ var k, len1, list, options, ref, thread, val;
if (!QR.nodes) {
return;
}
list = QR.nodes.thread;
options = [list.firstElementChild];
- _ref = g.BOARD.threads.keys;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- thread = _ref[_i];
+ ref = g.BOARD.threads.keys;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ thread = ref[k];
options.push($.el('option', {
value: thread,
textContent: "Thread No." + thread
@@ -7360,10 +7355,10 @@
return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
},
dialog: function() {
- var dialog, event, i, items, m, match_max, match_min, name, node, nodes, rules, save, setNode, _ref;
+ var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, setNode;
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
- innerHTML: " "
+ innerHTML: " "
})
};
setNode = function(name, query) {
@@ -7393,6 +7388,7 @@
setNode('spoilerPar', '#qr-spoiler-label');
setNode('status', '[type=submit]');
setNode('fileInput', '[type=file]');
+ setNode('customCooldown', '#custom-cooldown-button');
rules = $('ul.rules').textContent.trim();
match_min = rules.match(/.+smaller than (\d+)x(\d+).+/);
match_max = rules.match(/.+greater than (\d+)x(\d+).+/);
@@ -7403,7 +7399,7 @@
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value;
QR.max_size_video = (m = Get.scriptData().match(/\bmaxWebmFilesize *= *(\d+)\b/)) ? +m[1] : +nodes.fileInput.max;
QR.max_width_video = QR.max_height_video = 2048;
- QR.max_duration_video = (_ref = g.BOARD.ID) === 'gif' || _ref === 'wsg' ? 300 : 120;
+ QR.max_duration_video = (ref = g.BOARD.ID) === 'gif' || ref === 'wsg' ? 300 : 120;
if (Conf['Show New Thread Option in Threads']) {
$.addClass(QR.nodes.el, 'show-new-thread-option');
}
@@ -7422,6 +7418,15 @@
} else {
nodes.spoiler.parentElement.hidden = true;
}
+ if (parseInt(Conf['customCooldown'], 10) > 0) {
+ $.addClass(QR.nodes.fileSubmit, 'custom-cooldown');
+ $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) {
+ var customCooldownEnabled;
+ customCooldownEnabled = arg.customCooldownEnabled;
+ QR.setCustomCooldown(customCooldownEnabled);
+ return $.sync('customCooldownEnabled', QR.setCustomCooldown);
+ });
+ }
if (g.BOARD.ID === 'f' && g.VIEW !== 'thread') {
nodes.flashTag = $.el('select', {
name: 'filetag'
@@ -7456,6 +7461,10 @@
return QR.selected.nodes.spoiler.click();
});
$.on(nodes.fileInput, 'change', QR.handleFiles);
+ $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);
+ window.addEventListener('focus', QR.focus, true);
+ window.addEventListener('blur', QR.focus, true);
+ $.on(d, 'click', QR.focus);
items = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
i = 0;
save = function() {
@@ -7582,7 +7591,7 @@
return QR.status();
},
onprogress: function(e) {
- QR.req.progress = "" + (Math.round(e.loaded / e.total * 100)) + "%";
+ QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%";
return QR.status();
}
}
@@ -7617,7 +7626,7 @@
return QR.status();
},
response: function() {
- var URL, ban, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, req, resDoc, threadID, _, _ref, _ref1;
+ var URL, _, ban, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, ref, ref1, req, resDoc, threadID;
req = QR.req;
delete QR.req;
post = QR.posts[0];
@@ -7630,8 +7639,8 @@
innerHTML: "You were issued a warning on " + $(".board", resDoc).innerHTML + " as " + $(".nameBlock", resDoc).innerHTML + ".
Reason: " + $(".reason", resDoc).innerHTML
});
} else if (err = resDoc.getElementById('errmsg')) {
- if ((_ref = $('a', err)) != null) {
- _ref.target = '_blank';
+ if ((ref = $('a', err)) != null) {
+ ref.target = '_blank';
}
} else if (resDoc.title !== 'Post successful!') {
err = 'Connection error with sys.4chan.org.';
@@ -7664,7 +7673,7 @@
QR.notifications.push(new Notice('success', h1.textContent, 5));
}
QR.persona.set(post);
- _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
+ ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref1[0], threadID = ref1[1], postID = ref1[2];
postID = +postID;
threadID = +threadID || postID;
isReply = threadID !== postID;
@@ -7710,7 +7719,7 @@
QR.captcha.setup(d.activeElement === QR.nodes.status);
}
QR.cooldown.add(req.uploadEndTime, threadID, postID);
- URL = threadID === postID ? "" + window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? "" + window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
+ URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
if (URL) {
if (Conf['Open Post in New Tab'] || postsCount) {
$.open(URL);
@@ -7766,7 +7775,7 @@
return _this.nodes.input.focus();
};
})(this));
- this.conn = new Connection(null, "" + location.protocol + "//www.google.com", {
+ this.conn = new Connection(null, location.protocol + "//www.google.com", {
challenge: this.load.bind(this),
token: this.save.bind(this),
error: this.error.bind(this)
@@ -7774,9 +7783,9 @@
$.addClass(QR.nodes.el, 'has-captcha');
$.after(QR.nodes.com.parentNode, [container, input]);
this.captchas = [];
- $.get('captchas', [], function(_arg) {
+ $.get('captchas', [], function(arg) {
var captchas;
- captchas = _arg.captchas;
+ captchas = arg.captchas;
QR.captcha.sync(captchas);
return QR.captcha.clear();
});
@@ -7785,16 +7794,16 @@
return this.setup();
},
initFrame: function() {
- var cb, conn, img, _ref, _ref1;
- conn = new Connection(window.top, "" + location.protocol + "//boards.4chan.org", {
+ var cb, conn, img, ref, ref1;
+ conn = new Connection(window.top, location.protocol + "//boards.4chan.org", {
response: function(response) {
$.id('response').value = response;
return $('.fbc-challenge > form').submit();
}
});
conn.send({
- token: (_ref = $('.fbc-verification-token > textarea')) != null ? _ref.value : void 0,
- error: (_ref1 = $('.fbc-error')) != null ? _ref1.textContent : void 0
+ token: (ref = $('.fbc-verification-token > textarea')) != null ? ref.value : void 0,
+ error: (ref1 = $('.fbc-error')) != null ? ref1.textContent : void 0
});
if (!(img = $('.fbc-payload > img'))) {
return;
@@ -7822,8 +7831,8 @@
}
},
beforeSetup: function() {
- var container, input, _ref;
- _ref = this.nodes, container = _ref.container, input = _ref.input;
+ var container, input, ref;
+ ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = true;
input.value = '';
input.placeholder = 'Focus to load reCAPTCHA';
@@ -7864,8 +7873,8 @@
}
},
afterSetup: function() {
- var container, input, _ref;
- _ref = this.nodes, container = _ref.container, input = _ref.input;
+ var container, input, ref;
+ ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = false;
input.placeholder = 'Verification';
this.count();
@@ -7968,15 +7977,15 @@
return $.rmClass(this.nodes.input, 'error');
},
clear: function() {
- var captcha, i, now, _i, _len, _ref;
+ var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
return;
}
$.forceSync('captchas');
now = Date.now();
- _ref = this.captchas;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- captcha = _ref[i];
+ ref = this.captchas;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ captcha = ref[i];
if (captcha.timeout > now) {
break;
}
@@ -7989,8 +7998,8 @@
return $.set('captchas', this.captchas);
},
load: function(src) {
- var container, img, input, _ref;
- _ref = this.nodes, container = _ref.container, input = _ref.input, img = _ref.img;
+ var container, img, input, ref;
+ ref = this.nodes, container = ref.container, input = ref.input, img = ref.img;
this.occupied = true;
this.timeout = Date.now() + this.lifetime;
if (!img) {
@@ -8037,17 +8046,17 @@
if (!this.nodes.iframe) {
return;
}
- if (this.needed() || d.activeElement === this.nodes.input) {
+ if (!d.hidden && (this.needed() || d.activeElement === this.nodes.input)) {
return this.reload();
} else {
return this.destroy();
}
},
reload: function() {
- var _ref;
+ var ref;
this.nodes.iframe.src = this.iframeURL;
this.occupied = true;
- return (_ref = this.nodes.img) != null ? _ref.hidden = true : void 0;
+ return (ref = this.nodes.img) != null ? ref.hidden = true : void 0;
},
keydown: function(e) {
if (e.keyCode === 8 && !this.nodes.input.value) {
@@ -8076,9 +8085,9 @@
return;
}
this.captchas = [];
- $.get('captchas', [], function(_arg) {
+ $.get('captchas', [], function(arg) {
var captchas;
- captchas = _arg.captchas;
+ captchas = arg.captchas;
return QR.captcha.sync(captchas);
});
$.sync('captchas', this.sync.bind(this));
@@ -8183,12 +8192,12 @@
return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: document.documentElement.classList.contains(\'tomorrow\') ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();');
},
afterSetup: function(mutations) {
- var iframe, mutation, node, textarea, _i, _j, _len, _len1, _ref;
- for (_i = 0, _len = mutations.length; _i < _len; _i++) {
- mutation = mutations[_i];
- _ref = mutation.addedNodes;
- for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
- node = _ref[_j];
+ var iframe, k, len1, len2, mutation, node, q, ref, textarea;
+ for (k = 0, len1 = mutations.length; k < len1; k++) {
+ mutation = mutations[k];
+ ref = mutation.addedNodes;
+ for (q = 0, len2 = ref.length; q < len2; q++) {
+ node = ref[q];
if (iframe = $.x('./descendant-or-self::iframe', node)) {
this.setupIFrame(iframe);
}
@@ -8247,7 +8256,7 @@
}
},
save: function(pasted) {
- var _base;
+ var base1;
$.forceSync('captchas');
this.captchas.push({
response: $('textarea', this.nodes.container).value,
@@ -8266,8 +8275,8 @@
if (pasted) {
this.destroy();
} else {
- if ((_base = this.timeouts).destroy == null) {
- _base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
+ if ((base1 = this.timeouts).destroy == null) {
+ base1.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
}
}
QR.nodes.status.focus();
@@ -8280,15 +8289,15 @@
return QR.notify(el);
},
clear: function() {
- var captcha, i, now, _i, _len, _ref;
+ var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
return;
}
$.forceSync('captchas');
now = Date.now();
- _ref = this.captchas;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- captcha = _ref[i];
+ ref = this.captchas;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ captcha = ref[i];
if (captcha.timeout > now) {
break;
}
@@ -8316,7 +8325,7 @@
QR.cooldown = {
seconds: 0,
init: function() {
- var delay, items, key, keys, m, scope, type, _ref, _results;
+ var delay, items, key, keys, m, ref, results, scope, type;
if (!Conf['Cooldown']) {
return;
}
@@ -8328,9 +8337,9 @@
image_intra: 0
};
QR.cooldown.maxDelay = 0;
- _ref = QR.cooldown.delays;
- for (type in _ref) {
- delay = _ref[type];
+ ref = QR.cooldown.delays;
+ for (type in ref) {
+ delay = ref[type];
if (type !== 'thread') {
QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay);
}
@@ -8352,12 +8361,12 @@
}
return QR.cooldown.start();
});
- _results = [];
+ results = [];
for (scope in keys) {
key = keys[scope];
- _results.push($.sync(key, QR.cooldown.sync(scope)));
+ results.push($.sync(key, QR.cooldown.sync(scope)));
}
- return _results;
+ return results;
},
start: function() {
if (QR.cooldown.isCounting || Object.keys(QR.cooldown.local).length + Object.keys(QR.cooldown.global).length === 0) {
@@ -8402,14 +8411,14 @@
return QR.cooldown.start();
},
"delete": function(post) {
- var cooldown, id, _ref;
+ var cooldown, id, ref;
if (!(Conf['Cooldown'] && g.BOARD.ID === post.board.ID)) {
return;
}
$.forceSync(QR.cooldown.keys.local);
- _ref = QR.cooldown.local;
- for (id in _ref) {
- cooldown = _ref[id];
+ ref = QR.cooldown.local;
+ for (id in ref) {
+ cooldown = ref[id];
if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
delete QR.cooldown.local[id];
}
@@ -8441,18 +8450,18 @@
}
},
count: function() {
- var cooldown, elapsed, key, maxDelay, now, save, scope, seconds, start, suffix, threadID, type, update, _ref, _ref1, _ref2;
+ var cooldown, elapsed, key, maxDelay, now, ref, ref1, ref2, save, scope, seconds, start, suffix, threadID, type, update;
now = Date.now();
- _ref = QR.cooldown.categorize(QR.posts[0]), type = _ref.type, threadID = _ref.threadID;
+ ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID;
seconds = 0;
- _ref1 = QR.cooldown.keys;
- for (scope in _ref1) {
- key = _ref1[scope];
+ ref1 = QR.cooldown.keys;
+ for (scope in ref1) {
+ key = ref1[scope];
$.forceSync(key);
save = false;
- _ref2 = QR.cooldown[scope];
- for (start in _ref2) {
- cooldown = _ref2[start];
+ ref2 = QR.cooldown[scope];
+ for (start in ref2) {
+ cooldown = ref2[start];
start = +start;
elapsed = Math.floor((now - start) / $.SECOND);
if (elapsed < 0) {
@@ -8470,6 +8479,9 @@
continue;
}
maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread'];
+ if (QR.cooldown.customCooldown) {
+ maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10));
+ }
if (maxDelay <= elapsed) {
delete QR.cooldown[scope][start];
save = true;
@@ -8479,6 +8491,9 @@
suffix = scope === 'global' ? '_global' : type !== 'thread' && threadID === cooldown.threadID ? '_intra' : '';
seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed);
}
+ if (QR.cooldown.customCooldown) {
+ seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed);
+ }
}
if (save) {
QR.cooldown.save(scope);
@@ -8506,17 +8521,17 @@
always: {},
init: function() {
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'];
+ return $.get('QR.personas', Conf['QR.personas'], function(arg) {
+ var arr, item, k, len1, personas, ref, type, types;
+ personas = arg['QR.personas'];
types = {
name: [],
email: [],
sub: []
};
- _ref = personas.split('\n');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
+ ref = personas.split('\n');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
QR.persona.parseItem(item.trim(), types);
}
for (type in types) {
@@ -8526,17 +8541,17 @@
});
},
parseItem: function(item, types) {
- var boards, match, type, val, _ref, _ref1, _ref2;
+ var boards, match, ref, ref1, ref2, type, val;
if (item[0] === '#') {
return;
}
if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) {
return;
}
- _ref = match, match = _ref[0], type = _ref[1], val = _ref[2];
+ ref = match, match = ref[0], type = ref[1], val = ref[2];
item = item.replace(match, '');
- boards = ((_ref1 = item.match(/boards:([^;]+)/i)) != null ? _ref1[1].toLowerCase() : void 0) || 'global';
- if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) {
+ boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global';
+ if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) {
return;
}
if (type === 'password') {
@@ -8552,15 +8567,15 @@
if (/always/i.test(item)) {
QR.persona.always[type] = val;
}
- if (__indexOf.call(types[type], val) < 0) {
+ if (indexOf.call(types[type], val) < 0) {
return types[type].push(val);
}
},
loadPersonas: function(type, arr) {
- var list, val, _i, _len;
+ var k, len1, list, val;
list = $("#list-" + type, QR.nodes.el);
- for (_i = 0, _len = arr.length; _i < _len; _i++) {
- val = arr[_i];
+ for (k = 0, len1 = arr.length; k < len1; k++) {
+ val = arr[k];
if (val) {
$.add(list, $.el('option', {
textContent: val
@@ -8569,23 +8584,23 @@
}
},
getPassword: function() {
- var input, m, _ref;
+ var input, m, ref;
if (!QR.persona.pwd) {
- QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : ((_ref = $.id('delPassword')) != null ? _ref.value : void 0) || '';
+ QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : ((ref = $.id('delPassword')) != null ? ref.value : void 0) || '';
}
return QR.persona.pwd;
},
get: function(cb) {
- return $.get('QR.persona', {}, function(_arg) {
+ return $.get('QR.persona', {}, function(arg) {
var persona;
- persona = _arg['QR.persona'];
+ persona = arg['QR.persona'];
return cb(persona);
});
},
set: function(post) {
- return $.get('QR.persona', {}, function(_arg) {
+ return $.get('QR.persona', {}, function(arg) {
var persona;
- persona = _arg['QR.persona'];
+ persona = arg['QR.persona'];
persona = {
name: post.name,
email: /^sage$/.test(post.email) ? persona.email : post.email
@@ -8597,8 +8612,8 @@
QR.post = (function() {
function _Class(select) {
- this.select = __bind(this.select, this);
- var el, event, prev, _i, _len, _ref;
+ this.select = bind(this.select, this);
+ var el, event, k, len1, prev, ref;
el = $.el('a', {
className: 'qr-preview',
draggable: true,
@@ -8633,9 +8648,9 @@
};
})(this));
$.add(QR.nodes.dumpList, el);
- _ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- event = _ref[_i];
+ ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
$.on(el, event.toLowerCase(), this[event]);
}
this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
@@ -8681,7 +8696,7 @@
};
_Class.prototype.lock = function(lock) {
- var name, node, _i, _len, _ref;
+ var k, len1, name, node, ref;
if (lock == null) {
lock = true;
}
@@ -8689,9 +8704,9 @@
if (this !== QR.selected) {
return;
}
- _ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
if (node = QR.nodes[name]) {
node.disabled = lock;
}
@@ -8722,10 +8737,10 @@
};
_Class.prototype.load = function() {
- var name, node, _i, _len, _ref;
- _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ var k, len1, name, node, ref;
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
if (!(node = QR.nodes[name])) {
continue;
}
@@ -8737,7 +8752,7 @@
};
_Class.prototype.save = function(input) {
- var name, _ref;
+ var name, ref;
if (input.type === 'checkbox') {
this.spoiler = input.checked;
return;
@@ -8752,7 +8767,7 @@
this.nodes.span.textContent = this.com;
QR.captcha.onPostChange();
QR.characterCount();
- if (QR.cooldown.auto && this === QR.posts[0] && (0 < (_ref = QR.cooldown.seconds) && _ref <= 5)) {
+ if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
return QR.cooldown.auto = false;
}
break;
@@ -8760,7 +8775,7 @@
if (!this.file) {
return;
}
- this.file.newName = this.filename.replace(/[/\\]/g, '-');
+ this.file.newName = this.filename.replace(/[\/\\]/g, '-');
if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) {
this.file.newName += '.jpg';
}
@@ -8769,13 +8784,13 @@
};
_Class.prototype.forceSave = function() {
- var name, node, _i, _len, _ref;
+ var k, len1, name, node, ref;
if (this !== QR.selected) {
return;
}
- _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
if (!(node = QR.nodes[name])) {
continue;
}
@@ -8783,10 +8798,10 @@
}
};
- _Class.prototype.setFile = function(file, el) {
- this.file = file;
- this.filename = file.name;
- this.filesize = $.bytesToString(file.size);
+ _Class.prototype.setFile = function(file1, el) {
+ this.file = file1;
+ this.filename = this.file.name;
+ this.filesize = $.bytesToString(this.file.size);
if (QR.spoiler) {
this.nodes.label.hidden = false;
}
@@ -8861,7 +8876,7 @@
_Class.prototype.updateFilename = function() {
var long;
- long = "" + this.filename + " (" + this.filesize + ")\nCtrl/\u2318+click to edit filename. Shift+click to clear.";
+ long = this.filename + " (" + this.filesize + ")\nCtrl/\u2318+click to edit filename. Shift+click to clear.";
this.nodes.el.title = long;
if (this !== QR.selected) {
return;
@@ -8931,7 +8946,7 @@
}
el = $('.drag', this.parentNode);
index = function(el) {
- return __slice.call(el.parentNode.children).indexOf(el);
+ return slice.call(el.parentNode.children).indexOf(el);
};
oldIndex = index(el);
newIndex = index(this);
@@ -8947,8 +8962,8 @@
FappeTyme = {
init: function() {
- var el, lc, type, _i, _len, _ref, _ref1;
- if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var el, k, lc, len1, ref, ref1, type;
+ if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
this.nodes = {};
@@ -8956,15 +8971,15 @@
fappe: false,
werk: Conf['werk']
};
- _ref1 = ["Fappe", "Werk"];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- type = _ref1[_i];
- if (!Conf["" + type + " Tyme"]) {
+ ref1 = ["Fappe", "Werk"];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ type = ref1[k];
+ if (!Conf[type + " Tyme"]) {
continue;
}
lc = type.toLowerCase();
- el = UI.checkbox(lc, "" + type + " Tyme", false);
- el.title = "" + type + " Tyme";
+ el = UI.checkbox(lc, type + " Tyme", false);
+ el.title = type + " Tyme";
this.nodes[lc] = el.firstElementChild;
if (Conf[lc]) {
this.set(lc, true);
@@ -9007,7 +9022,7 @@
},
set: function(type, enabled) {
this.enabled[type] = this.nodes[type].checked = enabled;
- return $["" + (enabled ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme");
+ return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme");
},
toggle: function(type) {
this.set(type, !this.enabled[type]);
@@ -9019,8 +9034,8 @@
Gallery = {
init: function() {
- var el, _ref;
- if (!(this.enabled = Conf['Gallery'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var el, ref;
+ if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
this.delay = Conf['Slide Delay'];
@@ -9051,7 +9066,7 @@
}
},
build: function(image) {
- var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, thumb, value, _i, _j, _len, _len1, _ref, _ref1, _ref2;
+ var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, thumb, value;
if (Conf['Fullscreen Gallery']) {
$.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
@@ -9073,7 +9088,7 @@
$.extend(dialog, {
innerHTML: ""
});
- _ref = {
+ ref = {
buttons: '.gal-buttons',
frame: '.gal-image',
name: '.gal-name',
@@ -9083,8 +9098,8 @@
next: '.gal-image a',
current: '.gal-image img'
};
- for (key in _ref) {
- value = _ref[key];
+ for (key in ref) {
+ value = ref[key];
nodes[key] = $(value, dialog);
}
menuButton = $('.menu-button', dialog);
@@ -9104,9 +9119,9 @@
$.on(menuButton, 'click', function(e) {
return nodes.menu.toggle(e, this, g);
});
- _ref1 = Gallery.menu.createSubEntries();
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- entry = _ref1[_i];
+ ref1 = Gallery.menu.createSubEntries();
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ entry = ref1[k];
entry.order = 0;
nodes.menu.addEntry(entry);
}
@@ -9114,9 +9129,9 @@
if (Conf['Keybinds']) {
$.off(d, 'keydown', Keybinds.keydown);
}
- _ref2 = $$('.post .file');
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- file = _ref2[_j];
+ ref2 = $$('.post .file');
+ for (q = 0, len2 = ref2.length; q < len2; q++) {
+ file = ref2[q];
post = Get.postFromNode(file);
if (!post.file) {
continue;
@@ -9171,7 +9186,7 @@
return $.add(Gallery.nodes.thumbs, thumb);
},
open: function(thumb) {
- var el, elType, file, name, newID, nodes, oldID, post, slideshow, _ref;
+ var el, elType, file, name, newID, nodes, oldID, post, ref, slideshow;
nodes = Gallery.nodes;
name = nodes.name;
oldID = +nodes.current.dataset.id;
@@ -9211,14 +9226,14 @@
} else {
Gallery.cb.stop();
}
- if (Conf['Scroll to Post'] && (post = (_ref = (post = g.posts[file.dataset.post])) != null ? _ref.nodes.root : void 0)) {
+ if (Conf['Scroll to Post'] && (post = (ref = (post = g.posts[file.dataset.post])) != null ? ref.nodes.root : void 0)) {
Header.scrollTo(post);
}
return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
},
error: function() {
- var _ref;
- if (((_ref = this.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
+ var ref;
+ if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
return new Notice('error', 'Corrupt or unplayable video', 30);
}
if (this.src.split('/')[2] !== 'i.4cdn.org') {
@@ -9433,14 +9448,14 @@
createSubEntries: function() {
var delayInput, delayLabel, item, subEntries;
subEntries = (function() {
- var _i, _len, _ref, _results;
- _ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Scroll to Post'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
- _results.push(Gallery.menu.createSubEntry(item));
+ var k, len1, ref, results;
+ ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Scroll to Post'];
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
+ results.push(Gallery.menu.createSubEntry(item));
}
- return _results;
+ return results;
})();
delayLabel = $.el('label', {
innerHTML: "Slide Delay: "
@@ -9494,8 +9509,8 @@
}
},
decodeError: function(file, post) {
- var message, _ref;
- if (((_ref = file.error) != null ? _ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
+ var message, ref;
+ if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
return false;
}
if (!(message = $('.warning', post.file.thumb.parentNode))) {
@@ -9538,16 +9553,16 @@
};
return $.ajax("//a.4cdn.org/" + post.board + "/thread/" + post.thread + ".json", {
onload: function() {
- var postObj, _i, _len, _ref;
+ var k, len1, postObj, ref;
if (this.status === 404) {
post.kill();
}
if (this.status !== 200) {
return redirect();
}
- _ref = this.response.posts;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- postObj = _ref[_i];
+ ref = this.response.posts;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ postObj = ref[k];
if (postObj.no === post.ID) {
break;
}
@@ -9601,8 +9616,8 @@
ImageExpand = {
init: function() {
- var _ref;
- if (!(this.enabled = Conf['Image Expansion'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var ref;
+ if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
this.EAI = $.el('a', {
@@ -9626,7 +9641,7 @@
});
},
node: function() {
- var _ref;
+ var ref;
if (!(this.file && (this.file.isImage || this.file.isVideo))) {
return;
}
@@ -9638,7 +9653,7 @@
} else if (this.file.isExpanded && this.file.isVideo) {
Volume.setup(this.file.fullImage);
ImageExpand.setupVideoCB(this);
- return ImageExpand.setupVideo(this, !((_ref = this.origin.file.fullImage) != null ? _ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
+ return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
}
} else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) {
return ImageExpand.expand(this);
@@ -9646,7 +9661,7 @@
},
cb: {
toggle: function(e) {
- var file, post, _ref;
+ var file, post, ref;
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -9656,7 +9671,7 @@
return;
}
e.preventDefault();
- if ((_ref = file.fullImage) != null ? _ref.paused : void 0) {
+ if ((ref = file.fullImage) != null ? ref.paused : void 0) {
return file.fullImage.play();
} else {
return ImageExpand.toggle(post);
@@ -9686,20 +9701,20 @@
func = ImageExpand.contract;
}
return g.posts.forEach(function(post) {
- var _i, _len, _ref;
- _ref = [post].concat(__slice.call(post.clones));
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ var k, len1, ref;
+ ref = [post].concat(slice.call(post.clones));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
toggle(post);
}
});
},
playVideos: function() {
return g.posts.forEach(function(post) {
- var file, video, visible, _i, _len, _ref;
- _ref = [post].concat(__slice.call(post.clones));
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ var file, k, len1, ref, video, visible;
+ ref = [post].concat(slice.call(post.clones));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
file = post.file;
if (!(file && file.isVideo && file.isExpanded)) {
continue;
@@ -9741,7 +9756,7 @@
}
},
contract: function(post) {
- var bottom, cb, el, eventName, file, oldHeight, scrollY, top, x, _i, _len, _ref, _ref1;
+ var bottom, cb, el, eventName, file, k, len1, oldHeight, ref, ref1, scrollY, top, x;
file = post.file;
if (el = file.fullImage) {
top = Header.getTopOf(el);
@@ -9756,9 +9771,9 @@
}
file.thumb.parentNode.href = file.URL;
file.thumb.parentNode.target = '_blank';
- _ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- x = _ref[_i];
+ ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ x = ref[k];
delete file[x];
}
if (!el) {
@@ -9778,9 +9793,9 @@
ImageCommon.pushCache(el);
if (file.isVideo) {
ImageCommon.pause(el);
- _ref1 = ImageExpand.videoCB;
- for (eventName in _ref1) {
- cb = _ref1[eventName];
+ ref1 = ImageExpand.videoCB;
+ for (eventName in ref1) {
+ cb = ref1[eventName];
$.off(el, eventName, cb);
}
}
@@ -9800,7 +9815,7 @@
});
},
expand: function(post, src) {
- var el, file, isVideo, thumb, _ref;
+ var el, file, isVideo, ref, thumb;
file = post.file;
thumb = file.thumb, isVideo = file.isVideo;
if (post.isHidden || file.isExpanding || file.isExpanded) {
@@ -9810,7 +9825,7 @@
file.isExpanding = true;
if (file.fullImage) {
el = file.fullImage;
- } else if (((_ref = ImageCommon.cache) != null ? _ref.dataset.fullID : void 0) === post.fullID) {
+ } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
el = file.fullImage = ImageCommon.popCache();
$.on(el, 'error', ImageExpand.error);
if (Conf['Restart when Opened'] && el.id !== 'ihover') {
@@ -9923,10 +9938,10 @@
};
})(),
setupVideoCB: function(post) {
- var cb, eventName, _ref;
- _ref = ImageExpand.videoCB;
- for (eventName in _ref) {
- cb = _ref[eventName];
+ var cb, eventName, ref;
+ ref = ImageExpand.videoCB;
+ for (eventName in ref) {
+ cb = ref[eventName];
$.on(post.file.fullImage, eventName, cb);
}
if (post.file.videoControls) {
@@ -9960,7 +9975,7 @@
},
menu: {
init: function() {
- var conf, createSubEntry, el, name, subEntries, _ref;
+ var conf, createSubEntry, el, name, ref, subEntries;
if (!ImageExpand.enabled) {
return;
}
@@ -9970,9 +9985,9 @@
});
createSubEntry = ImageExpand.menu.createSubEntry;
subEntries = [];
- _ref = Config.imageExpansion;
- for (name in _ref) {
- conf = _ref[name];
+ ref = Config.imageExpansion;
+ for (name in ref) {
+ conf = ref[name];
subEntries.push(createSubEntry(name, conf[1]));
}
return Header.menu.addEntry({
@@ -10000,8 +10015,8 @@
ImageHover = {
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
if (Conf['Image Hover']) {
@@ -10033,7 +10048,7 @@
},
mouseover: function(post) {
return function(e) {
- var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, right, scale, width, x, _ref, _ref1, _ref2;
+ var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, ref, ref1, ref2, right, scale, width, x;
if (!doc.contains(this)) {
return;
}
@@ -10043,7 +10058,7 @@
return;
}
error = ImageHover.error(post);
- if (((_ref = ImageCommon.cache) != null ? _ref.dataset.fullID : void 0) === post.fullID) {
+ if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
el = ImageCommon.popCache();
$.on(el, 'error', error);
} else {
@@ -10066,23 +10081,23 @@
el.play();
}
}
- _ref1 = (function() {
- var _i, _len, _ref1, _results;
- _ref1 = file.dimensions.split('x');
- _results = [];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- x = _ref1[_i];
- _results.push(+x);
+ ref1 = (function() {
+ var k, len1, ref1, results;
+ ref1 = file.dimensions.split('x');
+ results = [];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ x = ref1[k];
+ results.push(+x);
}
- return _results;
- })(), width = _ref1[0], height = _ref1[1];
- _ref2 = this.getBoundingClientRect(), left = _ref2.left, right = _ref2.right;
+ return results;
+ })(), width = ref1[0], height = ref1[1];
+ ref2 = this.getBoundingClientRect(), left = ref2.left, right = ref2.right;
padding = 16;
maxWidth = Math.max(left, doc.clientWidth - right);
maxHeight = doc.clientHeight - padding;
scale = Math.min(1, maxWidth / width, maxHeight / height);
- el.style.maxWidth = "" + (scale * width) + "px";
- el.style.maxHeight = "" + (scale * height) + "px";
+ el.style.maxWidth = (scale * width) + "px";
+ el.style.maxHeight = (scale * height) + "px";
return UI.hover({
root: this,
el: el,
@@ -10123,8 +10138,8 @@
ImageLoader = {
init: function() {
- var prefetch, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var prefetch, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
@@ -10163,7 +10178,7 @@
return ImageLoader.prefetch(this);
},
replaceVideo: function(post) {
- var attr, file, thumb, video, _i, _len, _ref;
+ var attr, file, k, len1, ref, thumb, video;
file = post.file;
thumb = file.thumb;
video = $.el('video', {
@@ -10176,9 +10191,9 @@
});
video.setAttribute('muted', 'muted');
video.dataset.md5 = thumb.dataset.md5;
- _ref = ['height', 'width', 'maxHeight', 'maxWidth'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- attr = _ref[_i];
+ ref = ['height', 'width', 'maxHeight', 'maxWidth'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ attr = ref[k];
video.style[attr] = thumb.style[attr];
}
video.src = file.URL;
@@ -10187,7 +10202,7 @@
return file.videoThumb = true;
},
prefetch: function(post) {
- var URL, clone, el, file, isImage, isVideo, match, replace, thumb, type, _i, _len, _ref;
+ var URL, clone, el, file, isImage, isVideo, k, len1, match, ref, replace, thumb, type;
file = post.file;
if (!file) {
return;
@@ -10201,16 +10216,16 @@
if (!(replace || Conf['prefetch'])) {
return;
}
- if (![post].concat(__slice.call(post.clones)).some(function(clone) {
+ if (![post].concat(slice.call(post.clones)).some(function(clone) {
return doc.contains(clone.nodes.root);
})) {
return;
}
file.isPrefetched = true;
if (file.videoThumb) {
- _ref = post.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = post.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.file.thumb.preload = 'auto';
}
thumb.preload = 'auto';
@@ -10224,10 +10239,10 @@
el = $.el(isImage ? 'img' : 'video');
if (replace && isImage) {
$.on(el, 'load', function() {
- var _j, _len1, _ref1;
- _ref1 = post.clones;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- clone = _ref1[_j];
+ var len2, q, ref1;
+ ref1 = post.clones;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ clone = ref1[q];
clone.file.thumb.src = URL;
}
return thumb.src = URL;
@@ -10241,14 +10256,14 @@
}
},
playVideos: function() {
- var qpClone, _ref;
- qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
+ var qpClone, ref;
+ qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0;
return g.posts.forEach(function(post) {
- var thumb, _i, _len, _ref1, _ref2;
- _ref1 = [post].concat(__slice.call(post.clones));
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- post = _ref1[_i];
- if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) {
+ var k, len1, ref1, ref2, thumb;
+ ref1 = [post].concat(slice.call(post.clones));
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ post = ref1[k];
+ if (!((ref2 = post.file) != null ? ref2.videoThumb : void 0)) {
continue;
}
thumb = post.file.thumb;
@@ -10264,8 +10279,8 @@
Metadata = {
init: function() {
- var _ref;
- if (!(Conf['WEBM Metadata'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var ref;
+ if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
return Post.callbacks.push({
@@ -10358,8 +10373,8 @@
RevealSpoilers = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
return;
}
return Post.callbacks.push({
@@ -10368,8 +10383,8 @@
});
},
node: function() {
- var thumb, _ref;
- if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) {
+ var ref, thumb;
+ if (this.isClone || !((ref = this.file) != null ? ref.isSpoiler : void 0)) {
return;
}
thumb = this.file.thumb;
@@ -10381,14 +10396,14 @@
Sauce = {
init: function() {
- var err, link, links, _i, _len, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Sauce'])) {
+ var err, k, len1, link, links, ref, ref1;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
return;
}
links = [];
- _ref1 = Conf['sauces'].split('\n');
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- link = _ref1[_i];
+ ref1 = Conf['sauces'].split('\n');
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ link = ref1[k];
try {
if (link[0] !== '#') {
links.push(link.trim());
@@ -10410,11 +10425,11 @@
});
},
createSauceLink: function(link, post) {
- var a, ext, i, key, m, part, parts, _i, _len, _ref, _ref1, _ref2, _ref3;
+ var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, ref3;
parts = {};
- _ref = link.split(/;(?=(?:text|boards|types):)/);
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- part = _ref[i];
+ ref = link.split(/;(?=(?:text|boards|types):)/);
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ part = ref[i];
if (i === 0) {
parts['url'] = part;
} else {
@@ -10422,7 +10437,7 @@
parts[m[1]] = m[2];
}
}
- parts['text'] || (parts['text'] = ((_ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? _ref1[1] : void 0) || '?');
+ parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
for (key in parts) {
parts[key] = parts[key].replace(/%(T?URL|MD5|board|name|%|semi)/g, function(parameter) {
var type;
@@ -10444,11 +10459,11 @@
return type;
});
}
- ext = ((_ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? _ref2[1] : void 0) || '';
- if (!(!parts['boards'] || (_ref3 = post.board.ID, __indexOf.call(parts['boards'].split(','), _ref3) >= 0))) {
+ ext = ((ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? ref2[1] : void 0) || '';
+ if (!(!parts['boards'] || (ref3 = post.board.ID, indexOf.call(parts['boards'].split(','), ref3) >= 0))) {
return null;
}
- if (!(!parts['types'] || __indexOf.call(parts['types'].split(','), ext) >= 0)) {
+ if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
return null;
}
a = Sauce.link.cloneNode(true);
@@ -10460,14 +10475,14 @@
return a;
},
node: function() {
- var link, node, nodes, _i, _len, _ref;
+ var k, len1, link, node, nodes, ref;
if (this.isClone || !this.file) {
return;
}
nodes = [];
- _ref = Sauce.links;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- link = _ref[_i];
+ ref = Sauce.links;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
if (node = Sauce.createSauceLink(link, this)) {
nodes.push($.tn('\u00A0'), node);
}
@@ -10478,19 +10493,19 @@
Volume = {
init: function() {
- var unmuteEntry, volumeEntry, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
+ var ref, ref1, unmuteEntry, volumeEntry;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
return;
}
$.sync('Allow Sound', function(x) {
- var _ref1;
+ var ref1;
Conf['Allow Sound'] = x;
- return (_ref1 = Volume.inputs) != null ? _ref1.unmute.checked = x : void 0;
+ return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0;
});
$.sync('Default Volume', function(x) {
- var _ref1;
+ var ref1;
Conf['Default Volume'] = x;
- return (_ref1 = Volume.inputs) != null ? _ref1.volume.value = x : void 0;
+ return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0;
});
if (Conf['Mouse Wheel Volume']) {
Post.callbacks.push({
@@ -10498,7 +10513,7 @@
cb: this.node
});
}
- if ((_ref1 = g.BOARD.ID) !== 'gif' && _ref1 !== 'wsg') {
+ if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg') {
return;
}
if (Conf['Mouse Wheel Volume']) {
@@ -10556,8 +10571,8 @@
}
},
node: function() {
- var _ref, _ref1;
- if (!(((_ref = this.board.ID) === 'gif' || _ref === 'wsg') && ((_ref1 = this.file) != null ? _ref1.isVideo : void 0))) {
+ var ref, ref1;
+ if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) {
return;
}
$.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover));
@@ -10593,14 +10608,14 @@
Embedding = {
init: function() {
- var type, _i, _len, _ref;
+ var k, len1, ref, type;
if (!(Conf['Embedding'] || Conf['Link Title'])) {
return;
}
this.types = {};
- _ref = this.ordered_types;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
+ ref = this.ordered_types;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
this.types[type.key] = type;
}
if (Conf['Floating Embeds']) {
@@ -10612,11 +10627,11 @@
}
if (Conf['Link Title']) {
return $.on(d, '4chanXInitFinished PostsInserted', function() {
- var key, service, _ref1, _ref2;
- _ref1 = Embedding.types;
- for (key in _ref1) {
- service = _ref1[key];
- if ((_ref2 = service.title) != null ? _ref2.batchSize : void 0) {
+ var key, ref1, ref2, service;
+ ref1 = Embedding.types;
+ for (key in ref1) {
+ service = ref1[key];
+ if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
Embedding.flushTitles(service.title);
}
}
@@ -10656,11 +10671,11 @@
}
},
services: function(link) {
- var href, match, type, _i, _len, _ref;
+ var href, k, len1, match, ref, type;
href = link.href;
- _ref = Embedding.ordered_types;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
+ ref = Embedding.ordered_types;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
if (!(match = type.regExp.exec(href))) {
continue;
}
@@ -10676,7 +10691,7 @@
}
},
embed: function(data) {
- var embed, href, key, link, name, options, post, uid, value, _ref;
+ var embed, href, key, link, name, options, post, ref, uid, value;
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
href = link.href;
$.addClass(link, key.toLowerCase());
@@ -10684,7 +10699,7 @@
embed = $.el('a', {
href: "http://boards.4chan.org/" + post.board + "/thread/" + post.thread + "#p" + post,
textContent: '(HTTP)',
- title: "" + key + " does not support HTTPS."
+ title: key + " does not support HTTPS."
});
$.after(link, [$.tn(' '), embed]);
return;
@@ -10694,14 +10709,14 @@
href: 'javascript:;',
textContent: '(embed)'
});
- _ref = {
+ ref = {
key: key,
uid: uid,
options: options,
href: href
};
- for (name in _ref) {
- value = _ref[name];
+ for (name in ref) {
+ value = ref[name];
embed.dataset[name] = value;
}
$.on(embed, 'click', Embedding.cb.toggle);
@@ -10767,32 +10782,32 @@
}
},
flushTitles: function(service) {
- var cb, data, queue, _i, _len;
+ var cb, data, k, len1, queue;
queue = service.queue;
if (!(queue != null ? queue.length : void 0)) {
return;
}
service.queue = [];
cb = function() {
- var data, _i, _len;
- for (_i = 0, _len = queue.length; _i < _len; _i++) {
- data = queue[_i];
+ var data, k, len1;
+ for (k = 0, len1 = queue.length; k < len1; k++) {
+ data = queue[k];
Embedding.cb.title(this, data);
}
};
if (!$.cache(service.api((function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = queue.length; _i < _len; _i++) {
- data = queue[_i];
- _results.push(data.uid);
+ var k, len1, results;
+ results = [];
+ for (k = 0, len1 = queue.length; k < len1; k++) {
+ data = queue[k];
+ results.push(data.uid);
}
- return _results;
+ return results;
})()), cb, {
responseType: 'json'
})) {
- for (_i = 0, _len = queue.length; _i < _len; _i++) {
- data = queue[_i];
+ for (k = 0, len1 = queue.length; k < len1; k++) {
+ data = queue[k];
$.extend(data.link, {
innerHTML: "[" + E(data.key) + "] Title Link Blocked (are you using NoScript?)"
});
@@ -10831,7 +10846,7 @@
return container;
},
title: function(req, data) {
- var key, link, link2, options, post, post2, service, status, text, uid, _base, _i, _j, _len, _len1, _ref, _ref1;
+ var base1, k, key, len1, len2, link, link2, options, post, post2, q, ref, ref1, service, status, text, uid;
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
status = req.status;
service = Embedding.types[key].title;
@@ -10845,22 +10860,22 @@
case 403:
return "Forbidden or Private";
default:
- return "" + status + "'d";
+ return status + "'d";
}
})());
link.dataset.original = link.textContent;
link.textContent = text;
- _ref = post.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post2 = _ref[_i];
- _ref1 = $$('a.linkify', post2.nodes.comment);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- link2 = _ref1[_j];
+ ref = post.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post2 = ref[k];
+ ref1 = $$('a.linkify', post2.nodes.comment);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ link2 = ref1[q];
if (!(link2.href === link.href)) {
continue;
}
- if ((_base = link2.dataset).original == null) {
- _base.original = link2.textContent;
+ if ((base1 = link2.dataset).original == null) {
+ base1.original = link2.textContent;
}
link2.textContent = text;
}
@@ -10896,9 +10911,9 @@
api: function(uid) {
return "https://api.github.com/gists/" + uid;
},
- text: function(_arg) {
+ text: function(arg) {
var file, files;
- files = _arg.files;
+ files = arg.files;
for (file in files) {
if (files.hasOwnProperty(file)) {
return file;
@@ -10955,7 +10970,7 @@
el = $.el('div');
$.queueTask(function() {
return $.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
- var embed, ext, file, files, i, status, type, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
+ var embed, ext, file, files, i, k, len1, len2, len3, q, ref, ref1, status, type, u;
if (!doc.contains(el)) {
return;
}
@@ -10964,11 +10979,11 @@
return el.textContent = "ERROR " + status;
}
files = this.response.files;
- _ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
- for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
- file = files[_j];
+ ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
+ for (q = 0, len2 = files.length; q < len2; q++) {
+ file = files[q];
if (file.type === type) {
embed = file;
break;
@@ -10988,9 +11003,9 @@
$.extend(el, {
innerHTML: ""
});
- _ref1 = ['mp4', 'webm'];
- for (i = _k = 0, _len2 = _ref1.length; _k < _len2; i = ++_k) {
- ext = _ref1[i];
+ ref1 = ['mp4', 'webm'];
+ for (i = u = 0, len3 = ref1.length; u < len3; i = ++u) {
+ ext = ref1[i];
el.firstChild.children[i].src = "https://mediacru.sh/" + a.dataset.uid + "." + ext;
}
break;
@@ -11067,7 +11082,7 @@
httpOnly: true,
style: "border: none; width: 640px; height: 360px;",
el: function(a) {
- var channel, id, idparam, obj, result, type, _;
+ var _, channel, id, idparam, obj, result, type;
if (result = /(\w+)\/([bc])\/(\d+)/i.exec(a.dataset.uid)) {
_ = result[0], channel = result[1], type = result[2], id = result[3];
idparam = {
@@ -11158,10 +11173,10 @@
return "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + ids + "&fields=items%28id%2Csnippet%28title%29%29&key=" + key;
},
text: function(data, uid) {
- var item, _i, _len, _ref;
- _ref = data.items;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
+ var item, k, len1, ref;
+ ref = data.items;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
if (item.id === uid) {
return item.snippet.title;
}
@@ -11174,19 +11189,19 @@
regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/((?:pf|kd|lv|mc|gd|gh|db|nn)\/[\w\-]+(,[\w\-]+)*|fc\/\w+\/\d+)/,
style: 'max-width: 80vw; max-height: 80vh;',
el: function(a) {
- var base, el, host, name, names, type, types, url, _, _i, _j, _len, _len1, _ref, _ref1;
+ var _, base, el, host, k, len1, len2, name, names, q, ref, ref1, type, types, url;
el = $.el('video', {
controls: true,
preload: 'auto',
loop: true
});
- _ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = _ref[0], host = _ref[1], names = _ref[2];
+ ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
types = host === 'gd' || host === 'fc' ? [''] : ['.webm', '.mp4'];
- _ref1 = names.split(',');
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- name = _ref1[_i];
- for (_j = 0, _len1 = types.length; _j < _len1; _j++) {
- type = types[_j];
+ ref1 = names.split(',');
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ name = ref1[k];
+ for (q = 0, len2 = types.length; q < len2; q++) {
+ type = types[q];
base = "" + name + type;
url = (function() {
switch (host) {
@@ -11253,8 +11268,8 @@
Linkify = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Linkify']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Linkify']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -11271,7 +11286,7 @@
return Embedding.init();
},
node: function() {
- var link, links, _i, _len;
+ var k, len1, link, links;
if (this.isClone) {
return Embedding.events(this);
}
@@ -11279,8 +11294,8 @@
return;
}
links = Linkify.process(this.nodes.comment);
- for (_i = 0, _len = links.length; _i < _len; _i++) {
- link = links[_i];
+ for (k = 0, len1 = links.length; k < len1; k++) {
+ link = links[k];
Embedding.process(link, this);
}
},
@@ -11394,8 +11409,8 @@
ArchiveLink = {
init: function() {
- var div, entry, type, _i, _len, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
+ var div, entry, k, len1, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
return;
}
div = $.el('div', {
@@ -11404,9 +11419,9 @@
entry = {
el: div,
order: 90,
- open: function(_arg) {
+ open: function(arg) {
var ID, board, thread;
- ID = _arg.ID, thread = _arg.thread, board = _arg.board;
+ ID = arg.ID, thread = arg.thread, board = arg.board;
return !!Redirect.to('thread', {
postID: ID,
threadID: thread.ID,
@@ -11415,9 +11430,9 @@
},
subEntries: []
};
- _ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Unique ID', 'uniqueID'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- type = _ref1[_i];
+ ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ type = ref1[k];
entry.subEntries.push(this.createSubEntry(type[0], type[1]));
}
return Menu.menu.addEntry(entry);
@@ -11428,9 +11443,9 @@
textContent: text,
target: '_blank'
});
- open = type === 'post' ? function(_arg) {
+ open = type === 'post' ? function(arg) {
var ID, board, thread;
- ID = _arg.ID, thread = _arg.thread, board = _arg.board;
+ ID = arg.ID, thread = arg.thread, board = arg.board;
el.href = Redirect.to('thread', {
postID: ID,
threadID: thread.ID,
@@ -11460,8 +11475,8 @@
DeleteLink = {
init: function() {
- var div, fileEl, fileEntry, postEl, postEntry, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
+ var div, fileEl, fileEntry, postEl, postEntry, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
return;
}
div = $.el('div', {
@@ -11486,9 +11501,9 @@
};
fileEntry = {
el: fileEl,
- open: function(_arg) {
+ open: function(arg) {
var file;
- file = _arg.file;
+ file = arg.file;
if (!file || file.isDead) {
return false;
}
@@ -11565,8 +11580,8 @@
},
cooldown: {
start: function(post, node) {
- var length, seconds, _ref;
- if (!((_ref = QR.db) != null ? _ref.get({
+ var length, ref, seconds;
+ if (!((ref = QR.db) != null ? ref.get({
boardID: post.board.ID,
threadID: post.thread.ID,
postID: post.ID
@@ -11598,8 +11613,8 @@
DownloadLink = {
init: function() {
- var a, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
return;
}
a = $.el('a', {
@@ -11610,9 +11625,9 @@
return Menu.menu.addEntry({
el: a,
order: 100,
- open: function(_arg) {
+ open: function(arg) {
var file;
- file = _arg.file;
+ file = arg.file;
if (!file) {
return false;
}
@@ -11626,8 +11641,8 @@
Menu = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) {
return;
}
this.button = $.el('a', {
@@ -11668,8 +11683,8 @@
ReportLink = {
init: function() {
- var a, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
return;
}
a = $.el('a', {
@@ -11757,34 +11772,34 @@
var x;
MarkNewIPs.ipCount = this.ipCount;
MarkNewIPs.postIDs = (function() {
- var _i, _len, _ref, _results;
- _ref = this.posts.keys;
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- x = _ref[_i];
- _results.push(+x);
+ var k, len1, ref, results;
+ ref = this.posts.keys;
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ x = ref[k];
+ results.push(+x);
}
- return _results;
+ return results;
}).call(this);
return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
},
onUpdate: function(e) {
- var added, fullID, i, ipCount, newPosts, obj, postIDs, removed, x, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1;
- _ref = e.detail, ipCount = _ref.ipCount, newPosts = _ref.newPosts;
+ var added, fullID, i, ipCount, k, len1, len2, len3, len4, newPosts, obj, postIDs, q, ref, ref1, removed, u, w, x;
+ ref = e.detail, ipCount = ref.ipCount, newPosts = ref.newPosts;
postIDs = ThreadUpdater.postIDs;
if (ipCount == null) {
return;
}
if (newPosts.length) {
obj = {};
- _ref1 = MarkNewIPs.postIDs;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- x = _ref1[_i];
+ ref1 = MarkNewIPs.postIDs;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ x = ref1[k];
obj[x] = true;
}
added = 0;
- for (_j = 0, _len1 = postIDs.length; _j < _len1; _j++) {
- x = postIDs[_j];
+ for (q = 0, len2 = postIDs.length; q < len2; q++) {
+ x = postIDs[q];
if (!(x in obj)) {
added++;
}
@@ -11793,14 +11808,14 @@
switch (ipCount - MarkNewIPs.ipCount) {
case added:
i = MarkNewIPs.ipCount;
- for (_k = 0, _len2 = newPosts.length; _k < _len2; _k++) {
- fullID = newPosts[_k];
+ for (u = 0, len3 = newPosts.length; u < len3; u++) {
+ fullID = newPosts[u];
MarkNewIPs.markNew(g.posts[fullID], ++i);
}
break;
case -removed:
- for (_l = 0, _len3 = newPosts.length; _l < _len3; _l++) {
- fullID = newPosts[_l];
+ for (w = 0, len4 = newPosts.length; w < len4; w++) {
+ fullID = newPosts[w];
MarkNewIPs.markOld(g.posts[fullID]);
}
}
@@ -11908,11 +11923,11 @@
return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate);
},
onUpdate: function(e) {
- var fileCount, ipCount, newPosts, postCount, _ref, _ref1;
+ var fileCount, ipCount, newPosts, postCount, ref, ref1;
if (e.detail[404]) {
return;
}
- _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount, ipCount = _ref.ipCount, newPosts = _ref.newPosts;
+ ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount, ipCount = ref.ipCount, newPosts = ref.newPosts;
ThreadStats.update(postCount, fileCount, ipCount);
if (!Conf["Page Count in Stats"]) {
return;
@@ -11920,7 +11935,7 @@
if (newPosts.length) {
ThreadStats.lastPost = g.posts[newPosts[newPosts.length - 1]].info.date;
}
- if (ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((_ref1 = ThreadStats.pageCountEl) != null ? _ref1.textContent : void 0) !== '1') {
+ if (ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((ref1 = ThreadStats.pageCountEl) != null ? ref1.textContent : void 0) !== '1') {
return ThreadStats.fetchPage();
}
},
@@ -11953,16 +11968,16 @@
});
},
onThreadsLoad: function() {
- var page, thread, _i, _j, _len, _len1, _ref, _ref1;
+ var k, len1, len2, page, q, ref, ref1, thread;
if (!(Conf["Page Count in Stats"] && this.status === 200)) {
return;
}
- _ref = this.response;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- page = _ref[_i];
- _ref1 = page.threads;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- thread = _ref1[_j];
+ ref = this.response;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ page = ref[k];
+ ref1 = page.threads;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ thread = ref1[q];
if (!(thread.no === ThreadStats.thread.ID)) {
continue;
}
@@ -11977,7 +11992,7 @@
ThreadUpdater = {
init: function() {
- var conf, el, input, name, sc, subEntries, updateLink, _ref;
+ var conf, el, input, name, ref, sc, subEntries, updateLink;
if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
return;
}
@@ -12017,9 +12032,9 @@
});
$.on(updateLink.firstElementChild, 'click', this.update);
subEntries = [];
- _ref = Config.updater.checkbox;
- for (name in _ref) {
- conf = _ref[name];
+ ref = Config.updater.checkbox;
+ for (name in ref) {
+ conf = ref[name];
el = UI.checkbox(name, name);
el.title = conf[1];
input = el.firstElementChild;
@@ -12154,15 +12169,15 @@
case 404:
$.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/catalog.json", {
onloadend: function() {
- var confirmed, page, thread, _i, _j, _len, _len1, _ref, _ref1;
+ var confirmed, k, len1, len2, page, q, ref, ref1, thread;
if (this.status === 200) {
confirmed = true;
- _ref = this.response;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- page = _ref[_i];
- _ref1 = page.threads;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- thread = _ref1[_j];
+ ref = this.response;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ page = ref[k];
+ ref1 = page.threads;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ thread = ref1[q];
if (thread.no === ThreadUpdater.thread.ID) {
confirmed = false;
break;
@@ -12199,9 +12214,9 @@
});
},
error: function(req) {
- var klass, text, _ref;
+ var klass, ref, text;
ThreadUpdater.setInterval();
- _ref = req.status === 304 ? ['', ''] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1];
+ ref = req.status === 304 ? ['', ''] : [req.statusText + " (" + req.status + ")", 'warning'], text = ref[0], klass = ref[1];
return ThreadUpdater.set('status', text, klass);
},
setInterval: function() {
@@ -12257,7 +12272,7 @@
}
},
update: function() {
- var _ref;
+ var ref;
if (!navigator.onLine) {
return;
}
@@ -12267,8 +12282,8 @@
} else {
ThreadUpdater.set('timer', 'Update');
}
- if ((_ref = ThreadUpdater.req) != null) {
- _ref.abort();
+ if ((ref = ThreadUpdater.req) != null) {
+ ref.abort();
}
return ThreadUpdater.req = $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/thread/" + ThreadUpdater.thread + ".json", {
onloadend: ThreadUpdater.cb.load,
@@ -12290,7 +12305,7 @@
return new Notice('info', "The thread is " + change + ".", 30);
},
parse: function(postObjects) {
- var OP, count, files, index, ipCountEl, node, num, post, postObject, posts, root, scroll, _i, _j, _len, _len1;
+ var OP, count, files, index, ipCountEl, k, len1, len2, node, num, post, postObject, posts, q, root, scroll;
OP = postObjects[0];
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
ThreadUpdater.thread.setStatus('Archived', !!+OP.archived);
@@ -12305,8 +12320,8 @@
index = [];
files = [];
count = 0;
- for (_i = 0, _len = postObjects.length; _i < _len; _i++) {
- postObject = postObjects[_i];
+ for (k = 0, len1 = postObjects.length; k < len1; k++) {
+ postObject = postObjects[k];
num = postObject.no;
index.push(num);
if (postObject.fsize) {
@@ -12323,11 +12338,11 @@
var ID;
ID = +post.ID;
if (!(post.info.date > Date.now() - 60 * $.SECOND)) {
- if (__indexOf.call(index, ID) < 0) {
+ if (indexOf.call(index, ID) < 0) {
post.kill();
} else if (post.isDead) {
post.resurrect();
- } else if (post.file && !(post.file.isDead || __indexOf.call(files, ID) >= 0)) {
+ } else if (post.file && !(post.file.isDead || indexOf.call(files, ID) >= 0)) {
post.kill(true);
}
}
@@ -12351,8 +12366,8 @@
ThreadUpdater.lastPost = posts[count - 1].ID;
Main.callbackNodes(Post, posts);
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
- for (_j = 0, _len1 = posts.length; _j < _len1; _j++) {
- post = posts[_j];
+ for (q = 0, len2 = posts.length; q < len2; q++) {
+ post = posts[q];
root = post.nodes.root;
if (!QuoteThreading.insert(post)) {
$.add(ThreadUpdater.root, post.nodes.root);
@@ -12379,13 +12394,13 @@
404: false,
threadID: ThreadUpdater.thread.fullID,
newPosts: (function() {
- var _k, _len2, _results;
- _results = [];
- for (_k = 0, _len2 = posts.length; _k < _len2; _k++) {
- post = posts[_k];
- _results.push(post.fullID);
+ var len3, results, u;
+ results = [];
+ for (u = 0, len3 = posts.length; u < len3; u++) {
+ post = posts[u];
+ results.push(post.fullID);
}
- return _results;
+ return results;
})(),
postCount: OP.replies + 1,
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead),
@@ -12438,9 +12453,9 @@
href: 'javascript:;'
}),
order: 6,
- open: function(_arg) {
+ open: function(arg) {
var thread;
- thread = _arg.thread;
+ thread = arg.thread;
if (Conf['Index Mode'] !== 'catalog') {
return false;
}
@@ -12467,8 +12482,8 @@
});
},
isWatched: function(thread) {
- var _ref;
- return (_ref = ThreadWatcher.db) != null ? _ref.get({
+ var ref;
+ return (ref = ThreadWatcher.db) != null ? ref.get({
boardID: thread.board.ID,
threadID: thread.ID
}) : void 0;
@@ -12516,9 +12531,9 @@
if (!Conf['Auto Watch']) {
return;
}
- return $.get('AutoWatch', 0, function(_arg) {
+ return $.get('AutoWatch', 0, function(arg) {
var AutoWatch, thread;
- AutoWatch = _arg.AutoWatch;
+ AutoWatch = arg.AutoWatch;
if (!(thread = g.BOARD.threads[AutoWatch])) {
return;
}
@@ -12532,26 +12547,26 @@
},
cb: {
openAll: function() {
- var a, _i, _len, _ref;
+ var a, k, len1, ref;
if ($.hasClass(this, 'disabled')) {
return;
}
- _ref = $$('a[title]', ThreadWatcher.list);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
+ ref = $$('a[title]', ThreadWatcher.list);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
$.open(a.href);
}
return $.event('CloseMenu');
},
pruneDeads: function() {
- var boardID, data, threadID, _i, _len, _ref, _ref1;
+ var boardID, data, k, len1, ref, ref1, threadID;
if ($.hasClass(this, 'disabled')) {
return;
}
ThreadWatcher.db.forceSync();
- _ref = ThreadWatcher.getAll();
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- _ref1 = _ref[_i], boardID = _ref1.boardID, threadID = _ref1.threadID, data = _ref1.data;
+ ref = ThreadWatcher.getAll();
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
if (!data.isDead) {
continue;
}
@@ -12572,13 +12587,13 @@
return delete Index.followedThreadID;
},
rm: function() {
- var boardID, threadID, _ref;
- _ref = this.parentNode.dataset.fullID.split('.'), boardID = _ref[0], threadID = _ref[1];
+ var boardID, ref, threadID;
+ ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1];
return ThreadWatcher.rm(boardID, +threadID);
},
post: function(e) {
- var boardID, postID, threadID, _ref;
- _ref = e.detail, boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ var boardID, postID, ref, threadID;
+ ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
if (postID === threadID) {
if (Conf['Auto Watch']) {
return $.set('AutoWatch', threadID);
@@ -12588,13 +12603,13 @@
}
},
onIndexRefresh: function() {
- var boardID, data, db, threadID, _ref;
+ var boardID, data, db, ref, threadID;
db = ThreadWatcher.db;
boardID = g.BOARD.ID;
db.forceSync();
- _ref = db.data.boards[boardID];
- for (threadID in _ref) {
- data = _ref[threadID];
+ ref = db.data.boards[boardID];
+ for (threadID in ref) {
+ data = ref[threadID];
if (!data.isDead && !(threadID in g.BOARD.threads)) {
if (Conf['Auto Prune']) {
ThreadWatcher.db["delete"]({
@@ -12646,17 +12661,17 @@
return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);
},
fetchAllStatus: function() {
- var thread, threads, _i, _len, _ref;
+ var k, len1, ref, thread, threads;
ThreadWatcher.db.forceSync();
ThreadWatcher.unreaddb.forceSync();
- if ((_ref = QR.db) != null) {
- _ref.forceSync();
+ if ((ref = QR.db) != null) {
+ ref.forceSync();
}
if (!(threads = ThreadWatcher.getAll()).length) {
return;
}
- for (_i = 0, _len = threads.length; _i < _len; _i++) {
- thread = threads[_i];
+ for (k = 0, len1 = threads.length; k < len1; k++) {
+ thread = threads[k];
ThreadWatcher.fetchStatus(thread);
}
},
@@ -12678,9 +12693,9 @@
}
});
},
- parseStatus: function(_arg) {
- var boardID, data, fetchCount, isDead, lastReadPost, match, postObj, quotingYou, regexp, status, threadID, unread, _i, _len, _ref, _ref1;
- boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
+ parseStatus: function(arg) {
+ var boardID, data, fetchCount, isDead, k, lastReadPost, len1, match, postObj, quotingYou, ref, ref1, regexp, status, threadID, unread;
+ boardID = arg.boardID, threadID = arg.threadID, data = arg.data;
fetchCount = ThreadWatcher.fetchCount;
fetchCount.fetched++;
if (fetchCount.fetched === fetchCount.fetching) {
@@ -12689,7 +12704,7 @@
status = '';
$.rmClass(ThreadWatcher.refreshButton, 'fa-spin');
} else {
- status = "" + (Math.round(fetchCount.fetched / fetchCount.fetching * 100)) + "%";
+ status = (Math.round(fetchCount.fetched / fetchCount.fetching * 100)) + "%";
}
ThreadWatcher.status.textContent = status;
if (this.status === 200 && this.response) {
@@ -12708,13 +12723,13 @@
defaultValue: 0
});
unread = quotingYou = 0;
- _ref = this.response.posts;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- postObj = _ref[_i];
+ ref = this.response.posts;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ postObj = ref[k];
if (!(postObj.no > lastReadPost)) {
continue;
}
- if ((_ref1 = QR.db) != null ? _ref1.get({
+ if ((ref1 = QR.db) != null ? ref1.get({
boardID: boardID,
threadID: threadID,
postID: postObj.no
@@ -12768,11 +12783,11 @@
}
},
getAll: function() {
- var all, boardID, data, threadID, threads, _ref;
+ var all, boardID, data, ref, threadID, threads;
all = [];
- _ref = ThreadWatcher.db.data.boards;
- for (boardID in _ref) {
- threads = _ref[boardID];
+ ref = ThreadWatcher.db.data.boards;
+ for (boardID in ref) {
+ threads = ref[boardID];
if (Conf['Current Board'] && boardID !== g.BOARD.ID) {
continue;
}
@@ -12812,9 +12827,9 @@
});
$.add(link, title);
div = $.el('div');
- fullID = "" + boardID + "." + threadID;
+ fullID = boardID + "." + threadID;
div.dataset.fullID = fullID;
- if (g.VIEW === 'thread' && fullID === ("" + g.BOARD + "." + g.THREADID)) {
+ if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) {
$.addClass(div, 'current');
}
if (data.isDead) {
@@ -12832,26 +12847,26 @@
return div;
},
refresh: function() {
- var boardID, data, list, nodes, refresher, threadID, _i, _j, _len, _len1, _ref, _ref1, _ref2;
+ var boardID, data, k, len1, len2, list, nodes, q, ref, ref1, ref2, refresher, threadID;
nodes = [];
- _ref = ThreadWatcher.getAll();
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- _ref1 = _ref[_i], boardID = _ref1.boardID, threadID = _ref1.threadID, data = _ref1.data;
+ ref = ThreadWatcher.getAll();
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
nodes.push(ThreadWatcher.makeLine(boardID, threadID, data));
}
list = ThreadWatcher.list;
$.rmAll(list);
$.add(list, nodes);
g.threads.forEach(function(thread) {
- var helper, post, toggler, _j, _len1, _ref2;
+ var helper, len2, post, q, ref2, toggler;
helper = ThreadWatcher.isWatched(thread) ? ['addClass', 'Unwatch'] : ['rmClass', 'Watch'];
if (thread.OP) {
- _ref2 = [thread.OP].concat(__slice.call(thread.OP.clones));
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- post = _ref2[_j];
+ ref2 = [thread.OP].concat(slice.call(thread.OP.clones));
+ for (q = 0, len2 = ref2.length; q < len2; q++) {
+ post = ref2[q];
toggler = $('.watch-thread-link', post.nodes.post);
$[helper[0]](toggler, 'watched');
- toggler.title = "" + helper[1] + " Thread";
+ toggler.title = helper[1] + " Thread";
}
}
if (thread.catalogView) {
@@ -12859,9 +12874,9 @@
}
});
ThreadWatcher.refreshIcon();
- _ref2 = ThreadWatcher.menu.refreshers;
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- refresher = _ref2[_j];
+ ref2 = ThreadWatcher.menu.refreshers;
+ for (q = 0, len2 = ref2.length; q < len2; q++) {
+ refresher = ref2[q];
refresher();
}
if (Index.nodes && Conf['Pin Watched Threads']) {
@@ -12870,16 +12885,16 @@
}
},
refreshIcon: function() {
- var className, _i, _len, _ref;
- _ref = ['replies-unread', 'replies-quoting-you'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- className = _ref[_i];
+ var className, k, len1, ref;
+ ref = ['replies-unread', 'replies-quoting-you'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ className = ref[k];
ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog));
}
},
update: function(boardID, threadID, newData) {
- var data, key, line, n, newLine, val, _ref;
- if (!(data = (_ref = ThreadWatcher.db) != null ? _ref.get({
+ var data, key, line, n, newLine, ref, val;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
boardID: boardID,
threadID: threadID
}) : void 0)) {
@@ -12925,8 +12940,8 @@
}
},
set404: function(boardID, threadID, cb) {
- var data, _ref;
- if (!(data = (_ref = ThreadWatcher.db) != null ? _ref.get({
+ var data, ref;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
boardID: boardID,
threadID: threadID
}) : void 0)) {
@@ -13042,18 +13057,18 @@
order: 60
});
$.on(entryEl, 'click', function() {
- return ThreadWatcher.toggle(g.threads["" + g.BOARD + "." + g.THREADID]);
+ return ThreadWatcher.toggle(g.threads[g.BOARD + "." + g.THREADID]);
});
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];
+ var addClass, ref, rmClass, text;
+ 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);
return entryEl.textContent = text;
});
},
addMenuEntries: function() {
- var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1;
+ var cb, conf, entries, entry, k, len1, name, ref, ref1, refresh, subEntries;
entries = [];
entries.push({
cb: ThreadWatcher.cb.openAll,
@@ -13078,9 +13093,9 @@
}
});
subEntries = [];
- _ref = Config.threadWatcher;
- for (name in _ref) {
- conf = _ref[name];
+ ref = Config.threadWatcher;
+ for (name in ref) {
+ conf = ref[name];
subEntries.push(this.createSubEntry(name, conf[1]));
}
entries.push({
@@ -13091,8 +13106,8 @@
subEntries: subEntries
}
});
- for (_i = 0, _len = entries.length; _i < _len; _i++) {
- _ref1 = entries[_i], entry = _ref1.entry, cb = _ref1.cb, refresh = _ref1.refresh;
+ for (k = 0, len1 = entries.length; k < len1; k++) {
+ ref1 = entries[k], entry = ref1.entry, cb = ref1.cb, refresh = ref1.refresh;
if (entry.el.nodeName === 'A') {
entry.el.href = 'javascript:;';
}
@@ -13148,7 +13163,7 @@
});
},
node: function() {
- var ID, _i, _len, _ref;
+ var ID, k, len1, ref;
Unread.thread = this;
Unread.title = d.title;
Unread.lastReadPost = Unread.db.get({
@@ -13157,9 +13172,9 @@
defaultValue: 0
});
Unread.readCount = 0;
- _ref = this.posts.keys;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- ID = _ref[_i];
+ ref = this.posts.keys;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ID = ref[k];
if (+ID <= Unread.lastReadPost) {
Unread.readCount++;
}
@@ -13203,7 +13218,7 @@
}
},
sync: function() {
- var ID, i, lastReadPost, postIDs, _i, _ref, _ref1;
+ var ID, i, k, lastReadPost, postIDs, ref, ref1;
if (Unread.lastReadPost == null) {
return;
}
@@ -13217,7 +13232,7 @@
}
Unread.lastReadPost = lastReadPost;
postIDs = Unread.thread.posts.keys;
- for (i = _i = _ref = Unread.readCount, _ref1 = postIDs.length; _i < _ref1; i = _i += 1) {
+ for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
ID = +postIDs[i];
if (!Unread.thread.posts[ID].isFetchedQuote) {
if (ID > Unread.lastReadPost) {
@@ -13233,12 +13248,12 @@
return Unread.update();
},
addPost: function() {
- var _ref;
+ var ref;
if (this.isFetchedQuote || this.isClone) {
return;
}
Unread.order.push(this);
- if (this.ID <= Unread.lastReadPost || this.isHidden || ((_ref = QR.db) != null ? _ref.get({
+ if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QR.db) != null ? ref.get({
boardID: this.board.ID,
threadID: this.thread.ID,
postID: this.ID
@@ -13250,11 +13265,11 @@
return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
},
addPostQuotingYou: function(post) {
- var quotelink, _i, _len, _ref, _ref1;
- _ref = post.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
- if (!((_ref1 = QR.db) != null ? _ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
+ var k, len1, quotelink, ref, ref1;
+ ref = post.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
+ if (!((ref1 = QR.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
continue;
}
Unread.postsQuotingYou.add(post.ID);
@@ -13267,7 +13282,7 @@
if (!Header.areNotificationsEnabled) {
return;
}
- notif = new Notification("" + post.info.nameBlock + " replied to you", {
+ notif = new Notification(post.info.nameBlock + " replied to you", {
body: post.info[Conf['Remove Spoilers'] || Conf['Reveal Spoilers'] ? 'comment' : 'commentSpoilered'],
icon: Favicon.logo
});
@@ -13301,14 +13316,14 @@
return Unread.update();
},
read: $.debounce(100, function(e) {
- var ID, count, data, height, root, _ref, _ref1;
+ var ID, count, data, height, ref, ref1, root;
if (d.hidden || !Unread.posts.size) {
return;
}
height = doc.clientHeight;
count = 0;
while (Unread.position) {
- _ref = Unread.position, ID = _ref.ID, data = _ref.data;
+ ref = Unread.position, ID = ref.ID, data = ref.data;
root = data.nodes.root;
if (!(!root.getBoundingClientRect().height || Header.getBottomOf(root) > -1)) {
break;
@@ -13316,7 +13331,7 @@
count++;
Unread.posts["delete"](ID);
Unread.postsQuotingYou["delete"](ID);
- if (Conf['Mark Quotes of You'] && ((_ref1 = QR.db) != null ? _ref1.get({
+ if (Conf['Mark Quotes of You'] && ((ref1 = QR.db) != null ? ref1.get({
boardID: data.board.ID,
threadID: data.thread.ID,
postID: ID
@@ -13340,9 +13355,9 @@
}
},
saveLastReadPost: $.debounce(2 * $.SECOND, function() {
- var ID, i, postIDs, _i, _ref, _ref1;
+ var ID, i, k, postIDs, ref, ref1;
postIDs = Unread.thread.posts.keys;
- for (i = _i = _ref = Unread.readCount, _ref1 = postIDs.length; _i < _ref1; i = _i += 1) {
+ for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
ID = +postIDs[i];
if (!Unread.thread.posts[ID].isFetchedQuote) {
if (Unread.posts.has(ID)) {
@@ -13402,20 +13417,20 @@
Redirect = {
init: function() {
- var archive, archives, boardID, boards, data, files, id, name, o, record, software, type, withCredentials, _i, _j, _len, _len1, _ref, _ref1;
+ var archive, archives, boardID, boards, data, files, id, k, len1, len2, name, o, q, record, ref, ref1, software, type, withCredentials;
o = {
thread: {},
post: {},
file: {}
};
archives = {};
- _ref = Redirect.archives;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- data = _ref[_i];
+ ref = Redirect.archives;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ data = ref[k];
name = data.name, boards = data.boards, files = data.files, software = data.software, withCredentials = data.withCredentials;
archives[name] = data;
- for (_j = 0, _len1 = boards.length; _j < _len1; _j++) {
- boardID = boards[_j];
+ for (q = 0, len2 = boards.length; q < len2; q++) {
+ boardID = boards[q];
if (!(!withCredentials)) {
continue;
}
@@ -13425,21 +13440,21 @@
if (!(boardID in o.post || software !== 'foolfuuka')) {
o.post[boardID] = data;
}
- if (!(boardID in o.file || __indexOf.call(files, boardID) < 0)) {
+ if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) {
o.file[boardID] = data;
}
}
}
- _ref1 = Conf['selectedArchives'];
- for (boardID in _ref1) {
- record = _ref1[boardID];
+ ref1 = Conf['selectedArchives'];
+ for (boardID in ref1) {
+ record = ref1[boardID];
for (type in record) {
id = record[type];
if (id === 'disabled') {
delete o[type][boardID];
} else if (archive = archives[id]) {
boards = type === 'file' ? archive.files : archive.boards;
- if (__indexOf.call(boards, boardID) >= 0) {
+ if (indexOf.call(boards, boardID) >= 0) {
o[type][boardID] = archive;
}
}
@@ -13462,12 +13477,12 @@
if (!archive[protocol.slice(0, -1)]) {
protocol = protocol === 'https:' ? 'http:' : 'https:';
}
- return "" + protocol + "//";
+ return protocol + "//";
},
- thread: function(archive, _arg) {
+ 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;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
+ path = threadID ? boardID + "/thread/" + threadID : boardID + "/post/" + postID;
if (archive.software === 'foolfuuka') {
path += '/';
}
@@ -13476,9 +13491,9 @@
}
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
},
- post: function(archive, _arg) {
+ post: function(archive, arg) {
var URL, boardID, postID, protocol;
- boardID = _arg.boardID, postID = _arg.postID;
+ boardID = arg.boardID, postID = arg.postID;
protocol = Redirect.protocol(archive);
URL = new String("" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID);
if (!Redirect.securityCheck(URL)) {
@@ -13487,22 +13502,22 @@
URL.archive = archive;
return URL;
},
- file: function(archive, _arg) {
+ file: function(archive, arg) {
var boardID, filename;
- boardID = _arg.boardID, filename = _arg.filename;
+ boardID = arg.boardID, filename = arg.filename;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
},
- board: function(archive, _arg) {
+ board: function(archive, arg) {
var boardID;
- boardID = _arg.boardID;
+ boardID = arg.boardID;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/";
},
- search: function(archive, _arg) {
+ search: function(archive, arg) {
var boardID, path, type, value;
- boardID = _arg.boardID, type = _arg.type, value = _arg.value;
- type = type === 'name' ? 'username' : type === 'uniqueID' ? 'uid' : type === 'MD5' ? 'image' : type;
+ boardID = arg.boardID, type = arg.type, value = arg.value;
+ type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type;
value = encodeURIComponent(value);
- path = archive.software === 'foolfuuka' ? "" + boardID + "/search/" + type + "/" + value : "" + boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value;
+ path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value : boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
},
securityCheck: function(URL) {
@@ -13526,12 +13541,12 @@
return $.one(d, '4chanXInitFinished', this.setup);
},
setup: function() {
- var btn, entry, hr, psa, _ref;
+ var btn, entry, hr, psa, ref;
if (!(psa = PSAHiding.psa = $.id('globalMessage'))) {
$.rmClass(doc, 'hide-announcement');
return;
}
- if ((hr = (_ref = $.id('globalToggle')) != null ? _ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
+ if ((hr = (ref = $.id('globalToggle')) != null ? ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
PSAHiding.hr = hr;
}
entry = {
@@ -13555,9 +13570,9 @@
innerHTML: "[Dismiss]"
});
$.on(btn, 'click', PSAHiding.toggle);
- $.get('hiddenPSA', 0, function(_arg) {
+ $.get('hiddenPSA', 0, function(arg) {
var hiddenPSA;
- hiddenPSA = _arg.hiddenPSA;
+ hiddenPSA = arg.hiddenPSA;
PSAHiding.sync(hiddenPSA);
$.add(psa, btn);
return $.rmClass(doc, 'hide-announcement');
@@ -13576,7 +13591,7 @@
return PSAHiding.sync(UTC);
},
sync: function(UTC) {
- var psa, _ref;
+ var psa, ref;
psa = PSAHiding.psa;
PSAHiding.hidden = PSAHiding.btn.hidden = (UTC != null) && UTC >= +psa.dataset.utc;
if (PSAHiding.hidden) {
@@ -13584,22 +13599,22 @@
} else {
$.after($.id('globalToggle'), psa);
}
- if ((_ref = PSAHiding.hr) != null) {
- _ref.hidden = PSAHiding.hidden;
+ if ((ref = PSAHiding.hr) != null) {
+ ref.hidden = PSAHiding.hidden;
}
}
};
AntiAutoplay = {
init: function() {
- var audio, _i, _len, _ref;
+ var audio, k, len1, ref;
if (!Conf['Disable Autoplaying Sounds']) {
return;
}
$.addClass(doc, 'anti-autoplay');
- _ref = $$('audio[autoplay]', doc);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- audio = _ref[_i];
+ ref = $$('audio[autoplay]', doc);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ audio = ref[k];
this.stop(audio);
}
window.addEventListener('loadstart', ((function(_this) {
@@ -13637,15 +13652,15 @@
return AntiAutoplay.process(this.nodes.root);
},
process: function(root) {
- var iframe, object, _i, _j, _len, _len1, _ref, _ref1;
- _ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- iframe = _ref[_i];
+ var iframe, k, len1, len2, object, q, ref, ref1;
+ ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ iframe = ref[k];
iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
}
- _ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- object = _ref1[_j];
+ ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ object = ref1[q];
object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
}
}
@@ -13707,8 +13722,8 @@
},
cb: {
toggle: function() {
- var banner, i, _ref;
- if (!((_ref = Banner.choices) != null ? _ref.length : void 0)) {
+ var banner, i, ref;
+ if (!((ref = Banner.choices) != null ? ref.length : void 0)) {
Banner.choices = Banner.banners.slice();
}
i = Math.floor(Banner.choices.length * Math.random());
@@ -13716,17 +13731,17 @@
return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner;
},
click: function(e) {
- var br, _base, _i, _len, _name, _ref;
+ var base1, br, k, len1, name1, ref;
if (!(e.ctrlKey || e.metaKey)) {
return;
}
- if ((_base = Banner.original)[_name = this.className] == null) {
- _base[_name] = this.cloneNode(true);
+ if ((base1 = Banner.original)[name1 = this.className] == null) {
+ base1[name1] = this.cloneNode(true);
}
this.contentEditable = true;
- _ref = $$('br', this);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- br = _ref[_i];
+ ref = $$('br', this);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ br = ref[k];
$.replace(br, $.tn('\n'));
}
return this.focus();
@@ -13738,10 +13753,10 @@
}
},
blur: function() {
- var br, _i, _len, _ref;
- _ref = $$('br', this);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- br = _ref[_i];
+ var br, k, len1, ref;
+ ref = $$('br', this);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ br = ref[k];
$.replace(br, $.tn('\n'));
}
if (this.textContent = this.textContent.replace(/\n*$/, '')) {
@@ -13756,7 +13771,7 @@
});
} else {
$.rmAll(this);
- $.add(this, __slice.call(Banner.original[this.className].cloneNode(true).childNodes));
+ $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes));
return Banner.db["delete"]({
boardID: g.BOARD.ID,
threadID: this.className
@@ -13766,17 +13781,17 @@
},
original: {},
custom: function(child) {
- var className, data, event, items, string, string2, _i, _len, _ref;
+ var className, data, event, items, k, len1, ref, string, string2;
className = child.className;
child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase());
child.spellcheck = false;
- _ref = ['click', 'keydown', 'blur'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- event = _ref[_i];
+ ref = ['click', 'keydown', 'blur'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
$.on(child, event, Banner.cb[event]);
}
- string = "" + g.BOARD + "." + className;
- string2 = "" + string + ".orig";
+ string = g.BOARD + "." + className;
+ string2 = string + ".orig";
items = {};
items[string] = '';
items[string2] = child.textContent;
@@ -13826,10 +13841,10 @@
}
})();
$.ready(function() {
- var catalogLink, link, _i, _len, _ref;
- _ref = $$(selector);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- link = _ref[_i];
+ var catalogLink, k, len1, link, ref;
+ ref = $$(selector);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
switch (link.pathname) {
case "/" + g.BOARD + "/":
if (Conf['JSON Navigation']) {
@@ -13872,10 +13887,10 @@
}
},
node: function() {
- var a, m, _i, _len, _ref;
- _ref = $$('a', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
+ var a, k, len1, m, ref;
+ ref = $$('a', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
}
@@ -13893,11 +13908,11 @@
return CatalogLinks.set(this.checked);
},
set: function(useCatalog) {
- var a, board, _i, _len, _ref, _ref1;
- _ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
- if (((_ref1 = a.hostname) !== 'boards.4chan.org' && _ref1 !== 'catalog.neet.tv' && _ref1 !== '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
+ var a, board, k, len1, ref, ref1;
+ ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
+ if (((ref1 = a.hostname) !== 'boards.4chan.org' && ref1 !== 'catalog.neet.tv' && ref1 !== '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
continue;
}
a.href = useCatalog ? CatalogLinks.catalog(board) : "/" + board + "/";
@@ -14016,7 +14031,7 @@
return post.nodes.comment = post.nodes.shortComment;
},
parse: function(req, a, post) {
- var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
+ var callback, clone, comment, href, k, len1, len2, len3, postObj, posts, q, quote, ref, ref1, spoilerRange, status, u;
status = req.status;
if (status !== 200 && status !== 304) {
a.textContent = "Error " + req.statusText + " (" + status + ")";
@@ -14026,8 +14041,8 @@
if (spoilerRange = posts[0].custom_spoiler) {
Build.spoilerRange[g.BOARD] = spoilerRange;
}
- for (_i = 0, _len = posts.length; _i < _len; _i++) {
- postObj = posts[_i];
+ for (k = 0, len1 = posts.length; k < len1; k++) {
+ postObj = posts[k];
if (postObj.no === post.ID) {
break;
}
@@ -14039,9 +14054,9 @@
comment = post.nodes.comment;
clone = comment.cloneNode(false);
clone.innerHTML = postObj.com;
- _ref = $$('.quotelink', clone);
- for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
- quote = _ref[_j];
+ ref = $$('.quotelink', clone);
+ for (q = 0, len2 = ref.length; q < len2; q++) {
+ quote = ref[q];
href = quote.getAttribute('href');
if (href[0] === '/') {
continue;
@@ -14049,7 +14064,7 @@
if (href[0] === '#') {
quote.href = "" + (a.pathname.split('/').splice(0, 4).join('/')) + href;
} else {
- quote.href = "" + (a.pathname.split('/').splice(0, 3).join('/')) + "/" + href;
+ quote.href = (a.pathname.split('/').splice(0, 3).join('/')) + "/" + href;
}
}
post.nodes.shortComment = comment;
@@ -14057,9 +14072,9 @@
post.nodes.comment = post.nodes.longComment = clone;
post.parseComment();
post.parseQuotes();
- _ref1 = ExpandComment.callbacks;
- for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
- callback = _ref1[_k];
+ ref1 = ExpandComment.callbacks;
+ for (u = 0, len3 = ref1.length; u < len3; u++) {
+ callback = ref1[u];
callback.call(post);
}
}
@@ -14087,20 +14102,20 @@
if (!(a = $.x('following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
return;
}
- a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(__slice.call(a.textContent.match(/\d+/g))));
+ a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
a.style.cursor = 'pointer';
return $.on(a, 'click', ExpandThread.cbToggle);
},
disconnect: function(refresh) {
- var status, threadID, _ref, _ref1;
+ var ref, ref1, status, threadID;
if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
return;
}
- _ref = ExpandThread.statuses;
- for (threadID in _ref) {
- status = _ref[threadID];
- if ((_ref1 = status.req) != null) {
- _ref1.abort();
+ ref = ExpandThread.statuses;
+ for (threadID in ref) {
+ status = ref[threadID];
+ if ((ref1 = status.req) != null) {
+ ref1.abort();
}
delete ExpandThread.statuses[threadID];
}
@@ -14115,7 +14130,7 @@
});
},
text: function(status, posts, files) {
- return ("" + status + " " + posts + " post" + (posts > 1 ? 's' : '')) + (+files ? " and " + files + " image repl" + (files > 1 ? 'ies' : 'y') : "") + (" " + (status === '-' ? 'shown' : 'omitted') + ".");
+ return (status + " " + posts + " post" + (posts > 1 ? 's' : '')) + (+files ? " and " + files + " image repl" + (files > 1 ? 'ies' : 'y') : "") + (" " + (status === '-' ? 'shown' : 'omitted') + ".");
},
cbToggle: function(e) {
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
@@ -14139,20 +14154,20 @@
expand: function(thread, a) {
var status;
ExpandThread.statuses[thread] = status = {};
- a.textContent = ExpandThread.text.apply(ExpandThread, ['...'].concat(__slice.call(a.textContent.match(/\d+/g))));
+ a.textContent = ExpandThread.text.apply(ExpandThread, ['...'].concat(slice.call(a.textContent.match(/\d+/g))));
return status.req = $.cache("//a.4cdn.org/" + thread.board + "/thread/" + thread + ".json", function() {
delete status.req;
return ExpandThread.parse(this, thread, a);
});
},
contract: function(thread, a, threadRoot) {
- var filesCount, inlined, num, postsCount, replies, reply, status, _i, _len;
+ var filesCount, inlined, k, len1, num, postsCount, replies, reply, status;
status = ExpandThread.statuses[thread];
delete ExpandThread.statuses[thread];
if (status.req) {
status.req.abort();
if (a) {
- a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(__slice.call(a.textContent.match(/\d+/g))));
+ a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
}
return;
}
@@ -14177,8 +14192,8 @@
}
postsCount = 0;
filesCount = 0;
- for (_i = 0, _len = replies.length; _i < _len; _i++) {
- reply = replies[_i];
+ for (k = 0, len1 = replies.length; k < len1; k++) {
+ reply = replies[k];
if (Conf['Quote Inlining']) {
while (inlined = $('.inlined', reply)) {
inlined.click();
@@ -14193,8 +14208,8 @@
return a.textContent = ExpandThread.text('+', postsCount, filesCount);
},
parse: function(req, thread, a) {
- var filesCount, post, postData, posts, postsCount, postsRoot, root, _i, _len, _ref, _ref1;
- if ((_ref = req.status) !== 200 && _ref !== 304) {
+ var filesCount, k, len1, post, postData, posts, postsCount, postsRoot, ref, ref1, root;
+ if ((ref = req.status) !== 200 && ref !== 304) {
a.textContent = "Error " + req.statusText + " (" + req.status + ")";
return;
}
@@ -14202,9 +14217,9 @@
posts = [];
postsRoot = [];
filesCount = 0;
- _ref1 = req.response.posts;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- postData = _ref1[_i];
+ ref1 = req.response.posts;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ postData = ref1[k];
if (postData.no === thread.ID) {
continue;
}
@@ -14233,8 +14248,8 @@
FileInfo = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['File Info Formatting']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['File Info Formatting']) {
return;
}
return Post.callbacks.push({
@@ -14352,8 +14367,8 @@
Fourchan = {
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
if (g.BOARD.ID === 'g') {
@@ -14379,7 +14394,7 @@
});
},
code: function() {
- var apply, pre, _i, _len, _ref;
+ var apply, k, len1, pre, ref;
if (this.isClone) {
return;
}
@@ -14388,9 +14403,9 @@
return $.addClass(pre, 'prettyprinted');
};
$.on(window, 'prettyprint:cb', apply);
- _ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- pre = _ref[_i];
+ ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ pre = ref[k];
$.event('prettyprint', pre.innerHTML, window);
}
$.off(window, 'prettyprint:cb', apply);
@@ -14413,8 +14428,8 @@
IDColor = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Color User IDs'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) {
return;
}
this.ids = {
@@ -14456,8 +14471,8 @@
IDHighlight = {
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
return Post.callbacks.push({
@@ -14502,12 +14517,12 @@
$.sync(hotkey, Keybinds.sync);
}
init = function() {
- var node, _i, _len, _ref;
+ var k, len1, node, ref;
$.off(d, '4chanXInitFinished', init);
$.on(d, 'keydown', Keybinds.keydown);
- _ref = $$('[accesskey]');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $$('[accesskey]');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
node.removeAttribute('accesskey');
}
};
@@ -14517,17 +14532,17 @@
return Conf[hotkey] = key;
},
keydown: function(e) {
- var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
+ var form, k, key, len1, notification, notifications, op, ref, ref1, ref2, ref3, ref4, ref5, searchInput, target, thread, threadRoot;
if (!(key = Keybinds.keyCode(e))) {
return;
}
target = e.target;
- if ((_ref = target.nodeName) === 'INPUT' || _ref === 'TEXTAREA') {
+ if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') {
if (!/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key)) {
return;
}
}
- if (!(((_ref1 = g.VIEW) !== 'index' && _ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
+ if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
threadRoot = Nav.getThread();
if (op = $('.op', threadRoot)) {
thread = Get.postFromNode(op).thread;
@@ -14562,8 +14577,8 @@
if (Settings.dialog) {
Settings.close();
} else if ((notifications = $$('.notification')).length) {
- for (_i = 0, _len = notifications.length; _i < _len; _i++) {
- notification = notifications[_i];
+ for (k = 0, len1 = notifications.length; k < len1; k++) {
+ notification = notifications[k];
$('.close', notification).click();
}
} else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) {
@@ -14659,13 +14674,13 @@
Gallery.cb.toggle();
break;
case Conf['fappeTyme']:
- if (!(Conf['Fappe Tyme'] && ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
FappeTyme.toggle('fappe');
break;
case Conf['werkTyme']:
- if (!(Conf['Werk Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
FappeTyme.toggle('werk');
@@ -14685,7 +14700,7 @@
return;
}
if (Conf['JSON Navigation']) {
- if ((_ref4 = Conf['Index Mode']) !== 'paged' && _ref4 !== 'infinite') {
+ if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
return;
}
$('.next button', Index.pagelist).click();
@@ -14700,7 +14715,7 @@
return;
}
if (Conf['JSON Navigation']) {
- if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
+ if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
return;
}
$('.prev button', Index.pagelist).click();
@@ -14919,7 +14934,7 @@
}
},
hl: function(delta, thread) {
- var axis, height, next, postEl, replies, reply, root, _i, _len;
+ var axis, height, k, len1, next, postEl, replies, reply, root;
postEl = $('.reply.highlight', thread);
if (!delta) {
if (postEl) {
@@ -14932,7 +14947,7 @@
if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
root = postEl.parentNode;
axis = delta === +1 ? 'following' : 'preceding';
- if (!(next = $.x("" + axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
+ if (!(next = $.x(axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
return;
}
Header.scrollToIfNeeded(next, delta === +1);
@@ -14946,8 +14961,8 @@
if (delta === -1) {
replies.reverse();
}
- for (_i = 0, _len = replies.length; _i < _len; _i++) {
- reply = replies[_i];
+ for (k = 0, len1 = replies.length; k < len1; k++) {
+ reply = replies[k];
if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) {
this.focus(reply);
return;
@@ -15011,10 +15026,10 @@
}
},
getThread: function() {
- var thread, threadRoot, _i, _len, _ref;
- _ref = $$('.thread');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- threadRoot = _ref[_i];
+ var k, len1, ref, thread, threadRoot;
+ ref = $$('.thread');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ threadRoot = ref[k];
thread = Get.threadFromRoot(threadRoot);
if (thread.isHidden && !thread.stub) {
continue;
@@ -15026,13 +15041,13 @@
return $('.board');
},
scroll: function(delta) {
- var axis, extra, next, thread, top, _ref;
- if ((_ref = d.activeElement) != null) {
- _ref.blur();
+ var axis, extra, next, ref, thread, top;
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
}
thread = Nav.getThread();
axis = delta === +1 ? 'following' : 'preceding';
- if (next = $.x("" + axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
+ if (next = $.x(axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
top = Header.getTopOf(thread);
if (delta === +1 && top < 5 || delta === -1 && top > -5) {
thread = next;
@@ -15040,7 +15055,7 @@
}
extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom;
if (extra > 0) {
- d.body.style.marginBottom = "" + extra + "px";
+ d.body.style.marginBottom = extra + "px";
}
Header.scrollTo(thread);
if (extra > 0 && !Nav.haveExtra) {
@@ -15052,7 +15067,7 @@
var extra;
extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;
if (extra > 0) {
- return d.body.style.marginBottom = "" + extra + "px";
+ return d.body.style.marginBottom = extra + "px";
} else {
d.body.style.marginBottom = null;
delete Nav.haveExtra;
@@ -15064,8 +15079,8 @@
RelativeDates = {
INTERVAL: $.MINUTE / 2,
init: function() {
- var _ref;
- if (((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
+ var ref;
+ if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
this.flush();
$.on(d, 'visibilitychange ThreadUpdate', this.flush);
}
@@ -15100,18 +15115,18 @@
if (rounded !== 1) {
unit += 's';
}
- return "" + rounded + " " + unit + " ago";
+ return rounded + " " + unit + " ago";
},
stale: [],
flush: function() {
- var data, now, _i, _len, _ref;
+ var data, k, len1, now, ref;
if (d.hidden) {
return;
}
now = new Date();
- _ref = RelativeDates.stale;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- data = _ref[_i];
+ ref = RelativeDates.stale;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ data = ref[k];
RelativeDates.update(data, now);
}
RelativeDates.stale = [];
@@ -15126,16 +15141,16 @@
return post.nodes.date.title = RelativeDates.relative(diff, now, date);
},
update: function(data, now) {
- var date, diff, isPost, relative, singlePost, _i, _len, _ref;
+ var date, diff, isPost, k, len1, ref, relative, singlePost;
isPost = data instanceof Post;
date = isPost ? data.info.date : new Date(+data.dataset.utc);
now || (now = new Date());
diff = now - date;
relative = RelativeDates.relative(diff, now, date);
if (isPost) {
- _ref = [data].concat(data.clones);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- singlePost = _ref[_i];
+ ref = [data].concat(data.clones);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ singlePost = ref[k];
singlePost.nodes.date.firstChild.textContent = relative;
}
} else {
@@ -15149,7 +15164,7 @@
return setTimeout(RelativeDates.markStale, delay, data);
},
markStale: function(data) {
- if (__indexOf.call(RelativeDates.stale, data) >= 0) {
+ if (indexOf.call(RelativeDates.stale, data) >= 0) {
return;
}
if (data instanceof Post && !g.posts[data.fullID]) {
@@ -15185,23 +15200,23 @@
return RemoveSpoilers.unspoiler(this.nodes.comment);
},
unspoiler: function(el) {
- var span, spoiler, spoilers, _i, _len;
+ var k, len1, span, spoiler, spoilers;
spoilers = $$('s', el);
- for (_i = 0, _len = spoilers.length; _i < _len; _i++) {
- spoiler = spoilers[_i];
+ for (k = 0, len1 = spoilers.length; k < len1; k++) {
+ spoiler = spoilers[k];
span = $.el('span', {
className: 'removed-spoiler'
});
$.replace(spoiler, span);
- $.add(span, __slice.call(spoiler.childNodes));
+ $.add(span, slice.call(spoiler.childNodes));
}
}
};
Time = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Time Formatting'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Time Formatting'])) {
return;
}
return Post.callbacks.push({
@@ -15330,7 +15345,7 @@
}
},
open: function(openSection) {
- var dialog, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
+ var dialog, k, len1, link, links, overlay, ref, section, sectionToOpen;
if (Settings.overlay) {
return;
}
@@ -15351,9 +15366,9 @@
$.on($('.reset', dialog), 'click', Settings.reset);
$.on($('input', dialog), 'change', Settings.onImport);
links = [];
- _ref = Settings.sections;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- section = _ref[_i];
+ ref = Settings.sections;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ section = ref[k];
link = $.el('a', {
className: "tab-" + section.hyphenatedTitle,
textContent: section.title,
@@ -15376,12 +15391,12 @@
return $.event('OpenSettings', null, dialog);
},
close: function() {
- var _ref;
+ var ref;
if (!Settings.dialog) {
return;
}
- if ((_ref = d.activeElement) != null) {
- _ref.blur();
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
}
$.rm(Settings.overlay);
$.rm(Settings.dialog);
@@ -15390,9 +15405,9 @@
},
sections: [],
addSection: function(title, open) {
- var hyphenatedTitle, _ref;
+ var hyphenatedTitle, ref;
if (typeof title !== 'string') {
- _ref = title.detail, title = _ref.title, open = _ref.open;
+ ref = title.detail, title = ref.title, open = ref.open;
}
hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-');
return Settings.sections.push({
@@ -15415,12 +15430,12 @@
return $.event('OpenSettings', null, section);
},
main: function(section) {
- var arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, _ref;
+ var arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, ref;
items = {};
inputs = {};
- _ref = Config.main;
- for (key in _ref) {
- obj = _ref[key];
+ ref = Config.main;
+ for (key in ref) {
+ obj = ref[key];
fs = $.el('fieldset', {
innerHTML: ""
});
@@ -15467,18 +15482,18 @@
$.get({
hiddenThreads: {},
hiddenPosts: {}
- }, function(_arg) {
- var ID, board, hiddenNum, hiddenPosts, hiddenThreads, thread, _ref1, _ref2;
- hiddenThreads = _arg.hiddenThreads, hiddenPosts = _arg.hiddenPosts;
+ }, function(arg) {
+ var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref1, ref2, thread;
+ hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts;
hiddenNum = 0;
- _ref1 = hiddenThreads.boards;
- for (ID in _ref1) {
- board = _ref1[ID];
+ ref1 = hiddenThreads.boards;
+ for (ID in ref1) {
+ board = ref1[ID];
hiddenNum += Object.keys(board).length;
}
- _ref2 = hiddenPosts.boards;
- for (ID in _ref2) {
- board = _ref2[ID];
+ ref2 = hiddenPosts.boards;
+ for (ID in ref2) {
+ board = ref2[ID];
for (ID in board) {
thread = board[ID];
hiddenNum += Object.keys(thread).length;
@@ -15488,9 +15503,9 @@
});
$.on(button, 'click', function() {
this.textContent = 'Hidden: 0';
- return $.get('hiddenThreads', {}, function(_arg) {
+ return $.get('hiddenThreads', {}, function(arg) {
var boardID, hiddenThreads;
- hiddenThreads = _arg.hiddenThreads;
+ hiddenThreads = arg.hiddenThreads;
for (boardID in hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
@@ -15553,7 +15568,7 @@
return reader.readAsText(file);
},
loadSettings: function(data, cb) {
- var convertSettings, key, val, version, _ref;
+ var convertSettings, key, ref, val, version;
version = data.version.split('.');
if (version[0] === '2') {
convertSettings = function(data, map) {
@@ -15633,9 +15648,9 @@
return c;
}
});
- _ref = Config.hotkeys;
- for (key in _ref) {
- val = _ref[key];
+ ref = Config.hotkeys;
+ for (key in ref) {
+ val = ref[key];
if (key in data.Conf) {
data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) {
return "" + (s[0].toUpperCase()) + s.slice(1);
@@ -15714,20 +15729,20 @@
return $.on(ta, 'change', $.cb.value);
},
advanced: function(section) {
- var applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, name, o, row, rows, software, ta, table, warning, withCredentials, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _len6, _m, _n, _o, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
+ var aa, applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, w, warning, withCredentials, y, z;
$.extend(section, {
- innerHTML: ""
+ innerHTML: ""
});
- _ref = $$('.warning', section);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- warning = _ref[_i];
+ ref = $$('.warning', section);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ warning = ref[k];
warning.hidden = Conf[warning.dataset.feature];
}
items = {};
inputs = {};
- _ref1 = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss'];
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- name = _ref1[_j];
+ ref1 = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'customCooldown'];
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ name = ref1[q];
input = $("[name='" + name + "']", section);
items[name] = Conf[name];
inputs[name] = input;
@@ -15752,7 +15767,7 @@
val = items[key];
input = inputs[key];
input.value = val;
- if (key === 'usercss') {
+ if (key === 'usercss' || key === 'customCooldown') {
continue;
}
Settings[key].call(input);
@@ -15769,11 +15784,11 @@
$.on(customCSS, 'change', Settings.togglecss);
$.on(applyCSS, 'click', Settings.usercss);
archBoards = {};
- _ref2 = Redirect.archives;
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- _ref3 = _ref2[_k], name = _ref3.name, boards = _ref3.boards, files = _ref3.files, software = _ref3.software, withCredentials = _ref3.withCredentials;
- for (_l = 0, _len3 = boards.length; _l < _len3; _l++) {
- boardID = boards[_l];
+ ref2 = Redirect.archives;
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ ref3 = ref2[u], name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials;
+ for (w = 0, len4 = boards.length; w < len4; w++) {
+ boardID = boards[w];
o = archBoards[boardID] || (archBoards[boardID] = {
thread: [[], []],
post: [[], []],
@@ -15784,16 +15799,16 @@
if (software === 'foolfuuka') {
o.post[i].push(name);
}
- if (__indexOf.call(files, boardID) >= 0) {
+ if (indexOf.call(files, boardID) >= 0) {
o.file[i].push(name);
}
}
}
for (boardID in archBoards) {
o = archBoards[boardID];
- _ref4 = ['thread', 'post', 'file'];
- for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) {
- item = _ref4[_m];
+ ref4 = ['thread', 'post', 'file'];
+ for (y = 0, len5 = ref4.length; y < len5; y++) {
+ item = ref4[y];
i = o[item][0].length ? 1 : 0;
o[item][i].push('disabled');
o[item] = o[item][0].concat(o[item][1]);
@@ -15801,9 +15816,9 @@
}
rows = [];
boardOptions = [];
- _ref5 = Object.keys(archBoards).sort();
- for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) {
- boardID = _ref5[_n];
+ ref5 = Object.keys(archBoards).sort();
+ for (z = 0, len6 = ref5.length; z < len6; z++) {
+ boardID = ref5[z];
row = $.el('tr', {
className: "board-" + boardID
});
@@ -15814,9 +15829,9 @@
selected: boardID === g.BOARD.ID
}));
o = archBoards[boardID];
- _ref6 = ['thread', 'post', 'file'];
- for (_o = 0, _len6 = _ref6.length; _o < _len6; _o++) {
- item = _ref6[_o];
+ ref6 = ['thread', 'post', 'file'];
+ for (aa = 0, len7 = ref6.length; aa < len7; aa++) {
+ item = ref6[aa];
$.add(row, Settings.addArchiveCell(boardID, o, item));
}
rows.push(row);
@@ -15832,9 +15847,9 @@
$('tbody > :not([hidden])', table).hidden = true;
return $("tbody > ." + this.value, table).hidden = false;
});
- $.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
+ $.get('selectedArchives', Conf['selectedArchives'], function(arg) {
var data, option, selectedArchives, type;
- selectedArchives = _arg.selectedArchives;
+ selectedArchives = arg.selectedArchives;
for (boardID in selectedArchives) {
data = selectedArchives[boardID];
for (type in data) {
@@ -15879,10 +15894,10 @@
},
saveSelectedArchive: function() {
return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) {
- return function(_arg) {
- var selectedArchives, _name;
- selectedArchives = _arg.selectedArchives;
- (selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value;
+ return function(arg) {
+ var name1, selectedArchives;
+ selectedArchives = arg.selectedArchives;
+ (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = {}))[_this.dataset.type] = _this.value;
return $.set('selectedArchives', selectedArchives);
};
})(this));
@@ -15941,7 +15956,7 @@
return CustomCSS.update();
},
keybinds: function(section) {
- var arr, input, inputs, items, key, tbody, tr, _ref;
+ var arr, input, inputs, items, key, ref, tbody, tr;
$.extend(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.
"
});
@@ -15949,9 +15964,9 @@
tbody = $('tbody', section);
items = {};
inputs = {};
- _ref = Config.hotkeys;
- for (key in _ref) {
- arr = _ref[key];
+ ref = Config.hotkeys;
+ for (key in ref) {
+ arr = ref[key];
tr = $.el('tr', {
innerHTML: "" + E(arr[1]) + " | | "
});
@@ -15988,7 +16003,7 @@
Main = {
init: function() {
- var db, flatten, pathname, type, _i, _len, _ref, _ref1;
+ var db, flatten, k, len1, pathname, ref, ref1, type;
if (location.hostname === 'www.google.com') {
type = location.pathname === '/recaptcha/api/fallback' ? 'noscript' : 'v2';
return $.ready(function() {
@@ -15999,7 +16014,7 @@
g.posts = new SimpleDict();
pathname = location.pathname.split('/');
g.BOARD = new Board(pathname[1]);
- if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
+ if ((ref = g.BOARD.ID) === 'z' || ref === 'fk') {
return;
}
g.VIEW = (function() {
@@ -16032,9 +16047,9 @@
}
};
flatten(null, Config);
- _ref1 = DataBoard.keys;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- db = _ref1[_i];
+ ref1 = DataBoard.keys;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ db = ref1[k];
Conf[db] = {
boards: {}
};
@@ -16053,7 +16068,7 @@
});
},
initFeatures: function() {
- var err, feature, name, pathname, _i, _len, _ref, _ref1;
+ var err, feature, k, len1, name, pathname, ref, ref1;
switch (location.hostname) {
case 'a.4cdn.org':
return;
@@ -16063,8 +16078,8 @@
$.asap((function() {
return d.readyState !== 'loading';
}), function() {
- var URL, pathname, video, _ref;
- if (Conf['404 Redirect'] && ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found')) {
+ var URL, pathname, ref, video;
+ if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
Redirect.init();
pathname = location.pathname.split('/');
URL = Redirect.to('file', {
@@ -16093,9 +16108,9 @@
history.replaceState(null, '', pathname.slice(0, 4).join('/') + location.hash);
}
}
- _ref = Main.features;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- _ref1 = _ref[_i], name = _ref1[0], feature = _ref1[1];
+ ref = Main.features;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ref1 = ref[k], name = ref1[0], feature = ref1[1];
try {
feature.init();
} catch (_error) {
@@ -16109,12 +16124,12 @@
return $.ready(Main.initReady);
},
initStyle: function() {
- var _ref;
+ var ref;
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return;
}
- if ((_ref = $('link[href*=mobile]', d.head)) != null) {
- _ref.disabled = true;
+ if ((ref = $('link[href*=mobile]', d.head)) != null) {
+ ref.disabled = true;
}
$.addClass(doc, 'fourchan-x', 'seaweedchan');
$.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW);
@@ -16132,10 +16147,10 @@
mainStyleSheet = $('link[title=switch]', d.head);
styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
setStyle = function() {
- var styleSheet, _i, _len;
+ var k, len1, styleSheet;
$.rmClass(doc, style);
- for (_i = 0, _len = styleSheets.length; _i < _len; _i++) {
- styleSheet = styleSheets[_i];
+ for (k = 0, len1 = styleSheets.length; k < len1; k++) {
+ styleSheet = styleSheets[k];
if (styleSheet.href === mainStyleSheet.href) {
style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-');
break;
@@ -16153,8 +16168,8 @@
});
},
initReady: function() {
- var GMver, err, i, passLink, styleSelector, v, _i, _len, _ref, _ref1;
- if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
+ var GMver, err, i, k, len1, passLink, ref, ref1, styleSelector, v;
+ if ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') {
if (g.VIEW === 'thread') {
ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
var href;
@@ -16185,9 +16200,9 @@
} else {
$.event('4chanXInitFinished');
}
- $.get('previousversion', null, function(_arg) {
+ $.get('previousversion', null, function(arg) {
var el, previousversion;
- previousversion = _arg.previousversion;
+ previousversion = arg.previousversion;
if (previousversion === g.VERSION) {
return;
}
@@ -16203,9 +16218,9 @@
});
if (Conf['Show Support Message']) {
GMver = GM_info.version.split('.');
- _ref1 = "1.14".split('.');
- for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) {
- v = _ref1[i];
+ ref1 = "1.14".split('.');
+ for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) {
+ v = ref1[i];
if (v === GMver[i]) {
continue;
}
@@ -16221,18 +16236,18 @@
}
},
initThread: function() {
- var board, err, errors, m, postRoot, posts, scriptData, thread, threadRoot, threads, _i, _j, _len, _len1, _ref, _ref1;
+ var board, err, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads;
if (board = $('.board')) {
threads = [];
posts = [];
- _ref = $$('.board > .thread', board);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- threadRoot = _ref[_i];
+ ref = $$('.board > .thread', board);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ threadRoot = ref[k];
thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
threads.push(thread);
- _ref1 = $$('.thread > .postContainer', threadRoot);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- postRoot = _ref1[_j];
+ ref1 = $$('.thread > .postContainer', threadRoot);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ postRoot = ref1[q];
try {
posts.push(new Post(postRoot, thread, g.BOARD));
} catch (_error) {
@@ -16258,9 +16273,9 @@
}
Main.callbackNodes(Thread, threads);
return Main.callbackNodesDB(Post, posts, function() {
- var post, _k, _len2;
- for (_k = 0, _len2 = posts.length; _k < _len2; _k++) {
- post = posts[_k];
+ var len3, post, u;
+ for (u = 0, len3 = posts.length; u < len3; u++) {
+ post = posts[u];
QuoteThreading.insert(post);
}
return $.event('4chanXInitFinished');
@@ -16304,7 +16319,7 @@
return softTask();
},
handleErrors: function(errors) {
- var div, error, logs, _i, _len;
+ var div, error, k, len1, logs;
if (!(errors instanceof Array)) {
error = errors;
} else if (errors.length === 1) {
@@ -16318,14 +16333,14 @@
innerHTML: E(errors.length) + " errors occurred. [show]"
});
$.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;
+ var ref;
+ return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref;
});
logs = $.el('div', {
hidden: true
});
- for (_i = 0, _len = errors.length; _i < _len; _i++) {
- error = errors[_i];
+ for (k = 0, len1 = errors.length; k < len1; k++) {
+ error = errors[k];
$.add(logs, Main.parseError(error));
}
return new Notice('error', [div, logs], 30);
@@ -16337,14 +16352,14 @@
textContent: data.message
});
error = $.el('div', {
- textContent: "" + (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
+ textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
});
return [message, error];
},
isThisPageLegit: function() {
- var _ref;
+ 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');
+ 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');
}
return Main.thisPageIsLegit;
},
@@ -17230,6 +17245,47 @@
" bottom: auto;\n" +
" top: 1px;\n" +
"}\n" +
+"@media (min-width: 1300px) {\n" +
+" :root.fixed:not(.centered-links) #header-bar {\n" +
+" font-size: 12px;\n" +
+" white-space: nowrap;\n" +
+" display: flex;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #board-list {\n" +
+" flex: auto;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list {\n" +
+" display: flex;\n" +
+" line-height: 15px;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) .hide-board-list-container {\n" +
+" flex: none;\n" +
+" margin-right: 5px;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList {\n" +
+" flex: auto;\n" +
+" display: flex;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > a,\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {\n" +
+" flex: none;\n" +
+" padding: .17em;\n" +
+" margin: -.17em -.32em;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span {\n" +
+" pointer-events: none;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span.space {\n" +
+" flex: 0 .63 .63em;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {\n" +
+" flex: 0 .38 .38em;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #shortcuts {\n" +
+" float: initial;\n" +
+" flex: none;\n" +
+" }\n" +
+"}\n" +
"/* 4chan X link brackets */\n" +
".brackets-wrap::before {\n" +
" content: \"[\";\n" +
@@ -17802,13 +17858,6 @@
" max-height: 80vh;\n" +
" max-width: 50vw;\n" +
"}\n" +
-".qphl {\n" +
-" outline: 2px solid rgba(216, 94, 49, .7);\n" +
-"}\n" +
-":root.highlight-own .yourPost > .reply,\n" +
-":root.highlight-you .quotesYou > .reply {\n" +
-" border-left: 2px solid rgba(221,0,0,.5);\n" +
-"}\n" +
"/* Quote Threading */\n" +
".threadContainer {\n" +
" margin-left: 20px;\n" +
@@ -17899,10 +17948,6 @@
" -webkit-align-self: stretch;\n" +
" align-self: stretch;\n" +
"}\n" +
-".catalog-thread.watched .werkTyme-filename,\n" +
-".filter-highlight .werkTyme-filename {\n" +
-" border: 2px solid rgba(255, 0, 0, .5);\n" +
-"}\n" +
"/* Index/Reply Navigation */\n" +
"#navlinks {\n" +
" font-size: 16px;\n" +
@@ -17912,16 +17957,37 @@
":root.catalog-mode #navlinks {\n" +
" display: none;\n" +
"}\n" +
-"/* Filter */\n" +
-".opContainer.filter-highlight {\n" +
-" box-shadow: inset 5px 0 rgba(255, 0, 0, .5);\n" +
+"/* Highlighting */\n" +
+".qphl {\n" +
+" outline: 2px solid rgba(216, 94, 49, .8);\n" +
"}\n" +
+":root.highlight-own .yourPost > .reply,\n" +
+":root.highlight-you .quotesYou > .reply,\n" +
".filter-highlight > .reply {\n" +
-" box-shadow: -5px 0 rgba(255, 0, 0, .5);\n" +
+" border-left: 3px solid rgba(221, 0, 0, .8);\n" +
+"}\n" +
+":root.highlight-own .yourPost > div.sideArrows,\n" +
+":root.highlight-you .quotesYou > div.sideArrows,\n" +
+".filter-highlight > div.sideArrows {\n" +
+" color: rgba(221, 0, 0, .8);\n" +
+"}\n" +
+":root.highlight-own .yourPost.opContainer,\n" +
+":root.highlight-you .quotesYou.opContainer,\n" +
+".filter-highlight.opContainer {\n" +
+" border-left: 3px solid rgba(221, 0, 0, .8);\n" +
+"}\n" +
+":root.highlight-own .yourPost.opContainer::after,\n" +
+":root.highlight-you .quotesYou.opContainer::after,\n" +
+".filter-highlight.opContainer::after {\n" +
+" content: \"\";\n" +
+" display: block;\n" +
+" clear: both;\n" +
"}\n" +
".catalog-thread.watched .catalog-thumb,\n" +
-".filter-highlight .catalog-thumb {\n" +
-" border: 2px solid rgba(255, 0, 0, .5);\n" +
+".filter-highlight .catalog-thumb,\n" +
+".catalog-thread.watched .werkTyme-filename,\n" +
+".filter-highlight .werkTyme-filename {\n" +
+" border: 2px solid rgba(221, 0, 0, .8);\n" +
"}\n" +
"/* Spoiler text */\n" +
":root.reveal-spoilers s,\n" +
@@ -17976,8 +18042,9 @@
" display: none !important;\n" +
"}\n" +
"#qr select,\n" +
-"#dump-button,\n" +
"#url-button,\n" +
+"#custom-cooldown-button,\n" +
+"#dump-button,\n" +
".remove,\n" +
".captcha-img {\n" +
" cursor: pointer;\n" +
@@ -18032,7 +18099,7 @@
" -webkit-flex-direction: row;\n" +
" flex-direction: row;\n" +
"}\n" +
-"#dump-button {\n" +
+"#url-button, #custom-cooldown-button, #dump-button {\n" +
" width: 10%;\n" +
" margin: 0;\n" +
" margin-right: 4px;\n" +
@@ -18040,13 +18107,8 @@
" padding: 1px 0px 2px;\n" +
" opacity: 0.6;\n" +
"}\n" +
-"#url-button {\n" +
-" width: 10%;\n" +
-" margin: 0;\n" +
-" margin-right: 4px;\n" +
-" font: 13px sans-serif;\n" +
-" padding: 1px 0px 2px;\n" +
-" opacity: 0.6;\n" +
+"#custom-cooldown-button.disabled {\n" +
+" opacity: 0.27;\n" +
"}\n" +
".persona .field {\n" +
" -webkit-flex: 1;\n" +
@@ -18191,6 +18253,9 @@
"#file-n-submit {\n" +
" height: 23px;\n" +
"}\n" +
+"#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {\n" +
+" display: none;\n" +
+"}\n" +
"#qr input[type=\"file\"] {\n" +
" visibility: hidden;\n" +
" position: absolute;\n" +
@@ -18758,9 +18823,6 @@
":root.yotsuba #board-list a, :root.yotsuba #shortcuts a {\n" +
" color: #800000;\n" +
"}\n" +
-":root.yotsuba.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(178,0,0,0.2);\n" +
-"}\n" +
":root.yotsuba.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -18837,9 +18899,6 @@
":root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a {\n" +
" color: #34345C;\n" +
"}\n" +
-":root.yotsuba-b.fixed #custom-board-list .current {\n" +
-" border-bottom: 1px solid rgba(30, 30, 255, 0.2);\n" +
-"}\n" +
":root.yotsuba-b.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -18916,9 +18975,6 @@
":root.futaba #header-bar a, :root.futaba #notifications a {\n" +
" color: #800000;\n" +
"}\n" +
-":root.futaba.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(178,0,0,0.2);\n" +
-"}\n" +
":root.futaba.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -18990,9 +19046,6 @@
":root.burichan #header-bar a, :root.burichan #header-bar #notifications a {\n" +
" color: #34345C;\n" +
"}\n" +
-":root.burichan.fixed #custom-board-list .current {\n" +
-" border-bottom: 1px solid rgba(30, 30, 255, 0.2);\n" +
-"}\n" +
":root.burichan.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -19064,9 +19117,6 @@
":root.tomorrow #header-bar a, :root.tomorrow #notifications a {\n" +
" color: #81A2BE;\n" +
"}\n" +
-":root.tomorrow.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(83,124,160,0.4);\n" +
-"}\n" +
":root.tomorrow.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(95,137,172,0.4);\n" +
"}\n" +
@@ -19092,6 +19142,31 @@
" border-color: #111;\n" +
" background-color: rgba(0, 0, 0, .14);\n" +
"}\n" +
+"/* Highlighting */\n" +
+":root.tomorrow .qphl {\n" +
+" outline: 2px solid rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow.highlight-own .yourPost > .reply,\n" +
+":root.tomorrow.highlight-you .quotesYou > .reply,\n" +
+":root.tomorrow .filter-highlight > .reply {\n" +
+" border-left: 3px solid rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow.highlight-own .yourPost > div.sideArrows,\n" +
+":root.tomorrow.highlight-you .quotesYou > div.sideArrows,\n" +
+":root.tomorrow .filter-highlight > div.sideArrows {\n" +
+" color: rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow.highlight-own .yourPost.opContainer,\n" +
+":root.tomorrow.highlight-you .quotesYou.opContainer,\n" +
+":root.tomorrow .opContainer.filter-highlight {\n" +
+" border-left: 3px solid rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow .catalog-thread.watched .catalog-thumb,\n" +
+":root.tomorrow .filter-highlight .catalog-thumb,\n" +
+":root.tomorrow .catalog-thread.watched .werkTyme-filename,\n" +
+":root.tomorrow .filter-highlight .werkTyme-filename {\n" +
+" border: 2px solid rgb(64, 192, 255);\n" +
+"}\n" +
"/* QR */\n" +
".tomorrow #dump-list::-webkit-scrollbar-thumb {\n" +
" background-color: #282A2E;\n" +
@@ -19129,6 +19204,10 @@
":root.tomorrow .focused.entry {\n" +
" background: rgba(0, 0, 0, .33);\n" +
"}\n" +
+"/* Unread */\n" +
+":root.tomorrow #unread-line {\n" +
+" border-color: rgb(197, 200, 198);\n" +
+"}\n" +
"/* Thread Watcher */\n" +
":root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.disabled.replies-quoting-you {\n" +
" color: #F00 !important;\n" +
@@ -19162,9 +19241,6 @@
":root.photon #header-bar a, :root.photon #notifications a {\n" +
" color: #FF6600;\n" +
"}\n" +
-":root.photon.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(0,74,153,0.2);\n" +
-"}\n" +
":root.photon.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,51,0,0.2);\n" +
"}\n" +
diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx
index 6124ed7a7..0a4341b3f 100644
Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ
diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js
index 3e3a2fb79..603baf41c 100644
--- a/builds/4chan-X-noupdate.user.js
+++ b/builds/4chan-X-noupdate.user.js
@@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
-// @version 1.10.1.14
+// @version 1.10.2.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -25,7 +25,7 @@
// ==/UserScript==
/*
-* 4chan X - Version 1.10.1.14
+* 4chan X - Version 1.10.2.0
*
* Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
@@ -109,26 +109,11 @@
(function() {
var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g,
- __slice = [].slice,
- __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
-
- Array.prototype.indexOf = function(val, i) {
- var len;
- i || (i = 0);
- len = this.length;
- while (i < len) {
- if (this[i] === val) {
- return i;
- }
- i++;
- }
- return -1;
- };
-
- __indexOf = [].indexOf;
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
Config = {
main: {
@@ -393,7 +378,9 @@
'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.']
},
'Interval': 30
- }
+ },
+ customCooldown: 0,
+ customCooldownEnabled: true
};
Conf = {};
@@ -405,7 +392,7 @@
doc = d.documentElement;
g = {
- VERSION: '1.10.1.14',
+ VERSION: '1.10.2.0',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@@ -566,10 +553,10 @@
return;
}
$.on(req, 'load', function(e) {
- var _i, _len, _ref;
- _ref = this.callbacks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- cb = _ref[_i];
+ var k, len1, ref;
+ ref = this.callbacks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ cb = ref[k];
cb.call(this, e);
}
this.evt = e;
@@ -651,19 +638,19 @@
};
$.addClass = function() {
- var className, classNames, el, _i, _len;
- el = arguments[0], classNames = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- for (_i = 0, _len = classNames.length; _i < _len; _i++) {
- className = classNames[_i];
+ var className, classNames, el, k, len1;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (k = 0, len1 = classNames.length; k < len1; k++) {
+ className = classNames[k];
el.classList.add(className);
}
};
$.rmClass = function() {
- var className, classNames, el, _i, _len;
- el = arguments[0], classNames = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- for (_i = 0, _len = classNames.length; _i < _len; _i++) {
- className = classNames[_i];
+ var className, classNames, el, k, len1;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (k = 0, len1 = classNames.length; k < len1; k++) {
+ className = classNames[k];
el.classList.remove(className);
}
};
@@ -673,7 +660,7 @@
};
$.hasClass = function(el, className) {
- return __indexOf.call(el.classList, className) >= 0;
+ return indexOf.call(el.classList, className) >= 0;
};
$.rm = function(el) {
@@ -693,13 +680,13 @@
};
$.nodes = function(nodes) {
- var frag, node, _i, _len;
+ var frag, k, len1, node;
if (!(nodes instanceof Array)) {
return nodes;
}
frag = $.frag();
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- node = nodes[_i];
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ node = nodes[k];
frag.appendChild(node);
}
return frag;
@@ -735,19 +722,19 @@
};
$.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];
+ var event, k, len1, ref;
+ ref = events.split(' ');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
el.addEventListener(event, handler, false);
}
};
$.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];
+ var event, k, len1, ref;
+ ref = events.split(' ');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
el.removeEventListener(event, handler, false);
}
};
@@ -839,7 +826,7 @@
unit++;
}
size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size);
- return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit];
+ return size + " " + ['B', 'KB', 'MB', 'GB'][unit];
};
$.minmax = function(value, min, max) {
@@ -886,9 +873,9 @@
return cb(void 0, key);
}
};
- $.on(window, 'storage', function(_arg) {
+ $.on(window, 'storage', function(arg) {
var key;
- key = _arg.key;
+ key = arg.key;
return onChange(key);
});
return $.forceSync = function(key) {
@@ -897,12 +884,12 @@
})();
$["delete"] = function(keys) {
- var key, _i, _len;
+ var k, key, len1;
if (!(keys instanceof Array)) {
keys = [keys];
}
- for (_i = 0, _len = keys.length; _i < _len; _i++) {
- key = keys[_i];
+ for (k = 0, len1 = keys.length; k < len1; k++) {
+ key = keys[k];
key = g.NAMESPACE + key;
GM_deleteValue(key);
if (key in $.syncing) {
@@ -961,34 +948,34 @@
$["delete"](Object.keys(Conf));
$["delete"](['previousversion', 'AutoWatch', 'cooldown.global', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']);
$["delete"]((function() {
- var _i, _len, _ref, _results;
- _ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- id = _ref[_i];
- _results.push("" + id + ".position");
+ var k, len1, ref, results;
+ ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ id = ref[k];
+ results.push(id + ".position");
}
- return _results;
+ return results;
})());
boards = (function() {
- var _i, _len, _ref, _results;
- _ref = $$('#boardNavDesktop > .boardList > a');
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
- _results.push(a.textContent);
+ var k, len1, ref, results;
+ ref = $$('#boardNavDesktop > .boardList > a');
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
+ results.push(a.textContent);
}
- return _results;
+ return results;
})();
boards.push('qa');
$["delete"]((function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = boards.length; _i < _len; _i++) {
- board = boards[_i];
- _results.push("cooldown." + board);
+ var k, len1, results;
+ results = [];
+ for (k = 0, len1 = boards.length; k < len1; k++) {
+ board = boards[k];
+ results.push("cooldown." + board);
}
- return _results;
+ return results;
})());
try {
$["delete"](GM_listValues().map(function(key) {
@@ -1002,18 +989,18 @@
if (root == null) {
root = d.body;
}
- return __slice.call(root.querySelectorAll(selector));
+ return slice.call(root.querySelectorAll(selector));
};
Callbacks = (function() {
- function Callbacks(type) {
- this.type = type;
+ function Callbacks(type1) {
+ this.type = type1;
this.keys = [];
}
- Callbacks.prototype.push = function(_arg) {
+ Callbacks.prototype.push = function(arg) {
var cb, name;
- name = _arg.name, cb = _arg.cb;
+ name = arg.name, cb = arg.cb;
if (!this[name]) {
this.keys.push(name);
}
@@ -1021,10 +1008,10 @@
};
Callbacks.prototype.execute = function(node) {
- var err, errors, name, _i, _len, _ref;
- _ref = this.keys;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ var err, errors, k, len1, name, ref;
+ ref = this.keys;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
try {
this[name].call(node);
} catch (_error) {
@@ -1052,8 +1039,8 @@
return this.ID;
};
- function Board(ID) {
- this.ID = ID;
+ function Board(ID1) {
+ this.ID = ID1;
this.threads = new SimpleDict();
this.posts = new SimpleDict();
g.boards[this] = this;
@@ -1070,10 +1057,10 @@
return this.ID;
};
- function Thread(ID, board) {
- this.ID = ID;
- this.board = board;
- this.fullID = "" + this.board + "." + this.ID;
+ function Thread(ID1, board1) {
+ this.ID = ID1;
+ this.board = board1;
+ this.fullID = this.board + "." + this.ID;
this.posts = new SimpleDict();
this.isDead = false;
this.isHidden = false;
@@ -1086,12 +1073,13 @@
this.ipCount = void 0;
this.OP = null;
this.catalogView = null;
- g.threads.push(this.fullID, board.threads.push(this, this));
+ this.board.threads.push(this.ID, this);
+ g.threads.push(this.fullID, this);
}
Thread.prototype.setPage = function(pageNum) {
- var icon, info, quote, _ref;
- _ref = this.OP.nodes, info = _ref.info, quote = _ref.quote;
+ var icon, info, quote, ref;
+ ref = this.OP.nodes, info = ref.info, quote = ref.quote;
if (!(icon = $('.page-num', info))) {
icon = $.el('span', {
className: 'page-num'
@@ -1110,7 +1098,7 @@
if (!this.catalogView) {
return;
}
- el = this.catalogView.nodes["" + type + "Count"];
+ el = this.catalogView.nodes[type + "Count"];
el.textContent = count;
return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning');
};
@@ -1149,7 +1137,7 @@
src: "" + Build.staticPath + typeLC + Build.gifIcon,
alt: type,
title: type,
- className: "" + typeLC + "Icon retina"
+ className: typeLC + "Icon retina"
});
root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote;
$.after(root, [$.tn(' '), icon]);
@@ -1182,8 +1170,8 @@
return this.ID;
};
- function CatalogThread(root, thread) {
- this.thread = thread;
+ function CatalogThread(root, thread1) {
+ this.thread = thread1;
this.ID = this.thread.ID;
this.board = this.thread.board;
this.nodes = {
@@ -1209,12 +1197,12 @@
return this.ID;
};
- function Post(root, thread, board) {
- var capcode, clone, date, email, flag, info, name, post, subject, tripcode, uniqueID, _i, _len, _ref;
- this.thread = thread;
- this.board = board;
+ function Post(root, thread1, board1) {
+ var capcode, clone, date, email, flag, info, k, len1, name, post, ref, subject, tripcode, uniqueID;
+ this.thread = thread1;
+ this.board = board1;
this.ID = +root.id.slice(2);
- this.fullID = "" + this.board + "." + this.ID;
+ this.fullID = this.board + "." + this.ID;
post = $('.post', root);
info = $('.postInfo', post);
this.nodes = {
@@ -1280,31 +1268,33 @@
if (g.posts[this.fullID]) {
this.isRebuilt = true;
this.clones = g.posts[this.fullID].clones;
- _ref = this.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.origin = this;
}
}
- g.posts.push(this.fullID, thread.posts.push(this, board.posts.push(this, this)));
+ this.board.posts.push(this.ID, this);
+ this.thread.posts.push(this.ID, this);
+ g.posts.push(this.fullID, this);
}
Post.prototype.parseComment = function() {
- var bq, node, spoilers, _i, _len, _ref;
+ var bq, k, len1, node, ref, spoilers;
this.nodes.comment.normalize();
bq = this.nodes.comment.cloneNode(true);
- _ref = $$('.abbr, .exif, b, marquee', bq);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $$('.abbr, .exif, b, marquee', bq);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
$.rm(node);
}
this.info.comment = this.nodesToText(bq);
spoilers = $$('s', bq);
return this.info.commentSpoilered = (function() {
- var _j, _len1;
+ var len2, q;
if (spoilers.length) {
- for (_j = 0, _len1 = spoilers.length; _j < _len1; _j++) {
- node = spoilers[_j];
+ for (q = 0, len2 = spoilers.length; q < len2; q++) {
+ node = spoilers[q];
$.replace(node, $.tn('[spoiler]'));
}
return this.nodesToText(bq);
@@ -1326,11 +1316,11 @@
};
Post.prototype.parseQuotes = function() {
- var quotelink, _i, _len, _ref;
+ var k, len1, quotelink, ref;
this.quotes = [];
- _ref = $$(':not(pre) > .quotelink', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = $$(':not(pre) > .quotelink', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
this.parseQuote(quotelink);
}
};
@@ -1344,8 +1334,8 @@
if (this.isClone) {
return;
}
- fullID = "" + match[1] + "." + match[2];
- if (__indexOf.call(this.quotes, fullID) < 0) {
+ fullID = match[1] + "." + match[2];
+ if (indexOf.call(this.quotes, fullID) < 0) {
return this.quotes.push(fullID);
}
};
@@ -1371,7 +1361,7 @@
size *= 1024;
}
this.file.sizeInBytes = size;
- this.file.thumbURL = "" + location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
+ this.file.thumbURL = location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
this.file.isImage = /(jpg|png|gif)$/i.test(this.file.URL);
this.file.isVideo = /webm$/i.test(this.file.URL);
nameNode = $('a', fileText);
@@ -1382,7 +1372,7 @@
};
Post.prototype.kill = function(file) {
- var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
+ var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
if (file) {
if (this.file.isDead) {
return;
@@ -1407,17 +1397,17 @@
if (this.isClone) {
return;
}
- _ref = this.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.kill(file);
}
if (file) {
return;
}
- _ref1 = Get.allQuotelinksLinkingTo(this);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- quotelink = _ref1[_j];
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ quotelink = ref1[q];
if (!(!$.hasClass(quotelink, 'deadlink'))) {
continue;
}
@@ -1427,7 +1417,7 @@
};
Post.prototype.resurrect = function() {
- var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
+ var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
delete this.isDead;
$.rmClass(this.nodes.root, 'deleted-post');
strong = $('strong.warning', this.nodes.info);
@@ -1439,14 +1429,14 @@
if (this.isClone) {
return;
}
- _ref = this.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.resurrect();
}
- _ref1 = Get.allQuotelinksLinkingTo(this);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- quotelink = _ref1[_j];
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ quotelink = ref1[q];
if (!($.hasClass(quotelink, 'deadlink'))) {
continue;
}
@@ -1467,11 +1457,11 @@
};
Post.prototype.rmClone = function(index) {
- var clone, _i, _len, _ref;
+ var clone, k, len1, ref;
this.clones.splice(index, 1);
- _ref = this.clones.slice(index);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones.slice(index);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.nodes.root.dataset.clone = index++;
}
};
@@ -1480,19 +1470,19 @@
})();
- Clone = (function(_super) {
- __extends(Clone, _super);
+ Clone = (function(superClass) {
+ extend(Clone, superClass);
- function Clone(origin, context, contractThumb) {
- 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'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- key = _ref[_i];
- this[key] = origin[key];
+ function Clone(origin1, context1, contractThumb) {
+ var file, info, inline, inlined, k, key, len1, len2, len3, nodes, post, q, ref, ref1, ref2, ref3, root, u, val;
+ this.origin = origin1;
+ this.context = context1;
+ ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ key = ref[k];
+ this[key] = this.origin[key];
}
- nodes = origin.nodes;
+ nodes = this.origin.nodes;
root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true);
post = $('.post', root);
info = $('.postInfo', post);
@@ -1506,14 +1496,14 @@
quotelinks: [],
backlinks: info.getElementsByClassName('backlink')
};
- _ref1 = $$('.inline', post);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- inline = _ref1[_j];
+ ref1 = $$('.inline', post);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ inline = ref1[q];
$.rm(inline);
}
- _ref2 = $$('.inlined', post);
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- inlined = _ref2[_k];
+ ref2 = $$('.inlined', post);
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ inlined = ref2[u];
$.rmClass(inlined, 'inlined');
}
root.hidden = false;
@@ -1544,11 +1534,11 @@
this.nodes.date = $('.dateTime', info);
}
this.parseQuotes();
- if (origin.file) {
+ if (this.origin.file) {
this.file = {};
- _ref3 = origin.file;
- for (key in _ref3) {
- val = _ref3[key];
+ ref3 = this.origin.file;
+ for (key in ref3) {
+ val = ref3[key];
this.file[key] = val;
}
file = $('.file', post);
@@ -1563,22 +1553,22 @@
ImageExpand.contract(this);
}
}
- if (origin.isDead) {
+ if (this.origin.isDead) {
this.isDead = true;
}
this.isClone = true;
- root.dataset.clone = origin.clones.push(this) - 1;
+ root.dataset.clone = this.origin.clones.push(this) - 1;
}
Clone.prototype.cloneWithoutVideo = function(node) {
- var child, clone, _i, _len, _ref;
+ var child, clone, k, len1, ref;
if (node.tagName === 'VIDEO' && !node.dataset.md5) {
return [];
} else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) {
clone = node.cloneNode(false);
- _ref = node.childNodes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- child = _ref[_i];
+ ref = node.childNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ child = ref[k];
$.add(clone, this.cloneWithoutVideo(child));
}
return clone;
@@ -1594,12 +1584,12 @@
DataBoard = (function() {
DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'customTitles'];
- function DataBoard(key, sync, dontClean) {
+ function DataBoard(key1, sync, dontClean) {
var init;
- this.key = key;
- this.onSync = __bind(this.onSync, this);
- this.data = Conf[key];
- $.sync(key, this.onSync);
+ this.key = key1;
+ this.onSync = bind(this.onSync, this);
+ this.data = Conf[this.key];
+ $.sync(this.key, this.onSync);
if (!dontClean) {
this.clean();
}
@@ -1619,12 +1609,12 @@
return $.set(this.key, this.data, cb);
};
- DataBoard.prototype["delete"] = function(_arg) {
- var boardID, postID, threadID, _ref;
- boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID;
+ DataBoard.prototype["delete"] = function(arg) {
+ var boardID, postID, ref, threadID;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
$.forceSync(this.key);
if (postID) {
- if (!((_ref = this.data.boards[boardID]) != null ? _ref[threadID] : void 0)) {
+ if (!((ref = this.data.boards[boardID]) != null ? ref[threadID] : void 0)) {
return;
}
delete this.data.boards[boardID][threadID][postID];
@@ -1646,9 +1636,9 @@
return this.save();
};
- DataBoard.prototype.deleteIfEmpty = function(_arg) {
+ DataBoard.prototype.deleteIfEmpty = function(arg) {
var boardID, threadID;
- boardID = _arg.boardID, threadID = _arg.threadID;
+ boardID = arg.boardID, threadID = arg.threadID;
$.forceSync(this.key);
if (threadID) {
if (!Object.keys(this.data.boards[boardID][threadID]).length) {
@@ -1662,27 +1652,27 @@
}
};
- DataBoard.prototype.set = function(_arg, cb) {
- var boardID, postID, threadID, val, _base, _base1, _base2;
- boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val;
+ DataBoard.prototype.set = function(arg, cb) {
+ var base1, base2, base3, boardID, postID, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val;
$.forceSync(this.key);
if (postID !== void 0) {
- ((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val;
+ ((base1 = ((base2 = this.data.boards)[boardID] || (base2[boardID] = {})))[threadID] || (base1[threadID] = {}))[postID] = val;
} else if (threadID !== void 0) {
- ((_base2 = this.data.boards)[boardID] || (_base2[boardID] = {}))[threadID] = val;
+ ((base3 = this.data.boards)[boardID] || (base3[boardID] = {}))[threadID] = val;
} else {
this.data.boards[boardID] = val;
}
return this.save(cb);
};
- 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;
+ DataBoard.prototype.get = function(arg) {
+ var ID, board, boardID, defaultValue, k, len1, postID, thread, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue;
if (board = this.data.boards[boardID]) {
if (!threadID) {
if (postID) {
- for (thread = _i = 0, _len = board.length; _i < _len; thread = ++_i) {
+ for (thread = k = 0, len1 = board.length; k < len1; thread = ++k) {
ID = board[thread];
if (postID in thread) {
val = thread[postID];
@@ -1704,11 +1694,11 @@
};
DataBoard.prototype.clean = function() {
- var boardID, now, val, _ref;
+ var boardID, now, ref, val;
$.forceSync(this.key);
- _ref = this.data.boards;
- for (boardID in _ref) {
- val = _ref[boardID];
+ ref = this.data.boards;
+ for (boardID in ref) {
+ val = ref[boardID];
this.deleteIfEmpty({
boardID: boardID
});
@@ -1741,14 +1731,14 @@
};
DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
- var ID, board, page, thread, threads, _i, _j, _k, _len, _len1, _len2, _ref;
+ var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
board = this.data.boards[boardID];
threads = {};
- for (_i = 0, _len = response1.length; _i < _len; _i++) {
- page = response1[_i];
- _ref = page.threads;
- for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
- thread = _ref[_j];
+ for (k = 0, len1 = response1.length; k < len1; k++) {
+ page = response1[k];
+ ref = page.threads;
+ for (q = 0, len2 = ref.length; q < len2; q++) {
+ thread = ref[q];
ID = thread.no;
if (ID in board) {
threads[ID] = board[ID];
@@ -1756,8 +1746,8 @@
}
}
if (response2) {
- for (_k = 0, _len2 = response2.length; _k < _len2; _k++) {
- ID = response2[_k];
+ for (u = 0, len3 = response2.length; u < len3; u++) {
+ ID = response2[u];
if (ID in board) {
threads[ID] = board[ID];
}
@@ -1782,11 +1772,11 @@
})();
Notice = (function() {
- function Notice(type, content, timeout, onclose) {
- this.timeout = timeout;
+ function Notice(type, content, timeout1, onclose) {
+ this.timeout = timeout1;
this.onclose = onclose;
- this.close = __bind(this.close, this);
- this.add = __bind(this.add, this);
+ this.close = bind(this.close, this);
+ this.add = bind(this.add, this);
this.el = $.el('div', {
innerHTML: ""
});
@@ -1830,11 +1820,11 @@
RandomAccessList = (function() {
function RandomAccessList(items) {
- var item, _i, _len;
+ var item, k, len1;
this.length = 0;
if (items) {
- for (_i = 0, _len = items.length; _i < _len; _i++) {
- item = items[_i];
+ for (k = 0, len1 = items.length; k < len1; k++) {
+ item = items[k];
this.push(item);
}
}
@@ -1978,10 +1968,10 @@
};
SimpleDict.prototype.forEach = function(fn) {
- var key, _i, _len, _ref;
- _ref = __slice.call(this.keys);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- key = _ref[_i];
+ var k, key, len1, ref;
+ ref = slice.call(this.keys);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ key = ref[k];
fn(this[key]);
}
};
@@ -2025,12 +2015,12 @@
}
Connection = (function() {
- function Connection(target, origin, cb) {
- this.target = target;
- this.origin = origin;
- this.cb = cb;
- this.onMessage = __bind(this.onMessage, this);
- this.send = __bind(this.send, this);
+ function Connection(target1, origin1, cb1) {
+ this.target = target1;
+ this.origin = origin1;
+ this.cb = cb1;
+ this.onMessage = bind(this.onMessage, this);
+ this.send = bind(this.send, this);
$.on(window, 'message', this.onMessage);
}
@@ -2039,15 +2029,15 @@
};
Connection.prototype.onMessage = function(e) {
- var data, type, value, _base;
+ var base1, data, type, value;
if (!(e.source === this.target && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) {
return;
}
data = JSON.parse(e.data.slice(g.NAMESPACE.length));
for (type in data) {
value = data[type];
- if (typeof (_base = this.cb)[type] === "function") {
- _base[type](value);
+ if (typeof (base1 = this.cb)[type] === "function") {
+ base1[type](value);
}
}
};
@@ -2057,14 +2047,14 @@
})();
Fetcher = (function() {
- function Fetcher(boardID, threadID, postID, root, context) {
+ function Fetcher(boardID1, threadID1, postID1, root1, context1) {
var post;
- this.boardID = boardID;
- this.threadID = threadID;
- this.postID = postID;
- this.root = root;
- this.context = context;
- if (post = g.posts["" + this.boardID + "." + this.postID]) {
+ this.boardID = boardID1;
+ this.threadID = threadID1;
+ this.postID = postID1;
+ this.root = root1;
+ this.context = context1;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
this.insert(post);
return;
}
@@ -2096,8 +2086,8 @@
};
Fetcher.prototype.fetchedPost = function(req) {
- var api, board, post, posts, status, thread, _i, _len;
- if (post = g.posts["" + this.boardID + "." + this.postID]) {
+ var api, board, k, len1, post, posts, status, thread;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
this.insert(post);
return;
}
@@ -2112,8 +2102,8 @@
}
posts = req.response.posts;
Build.spoilerRange[this.boardID] = posts[0].custom_spoiler;
- for (_i = 0, _len = posts.length; _i < _len; _i++) {
- post = posts[_i];
+ for (k = 0, len1 = posts.length; k < len1; k++) {
+ post = posts[k];
if (post.no === this.postID) {
break;
}
@@ -2139,7 +2129,7 @@
return;
}
board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads["" + this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
post = new Post(Build.postFromObject(post, this.boardID), thread, board);
post.isFetchedQuote = true;
Main.callbackNodes(Post, [post]);
@@ -2170,12 +2160,12 @@
} else if (Conf['Except Archives from Encryption']) {
CrossOrigin.json(url, (function(_this) {
return function(response) {
- var key, media, _ref;
+ var key, media, ref;
media = response.media;
if (media) {
for (key in media) {
if (/_link$/.test(key)) {
- if (!((media[key] != null) && (_ref = media[key].match(/^(http:\/\/[^\/]+\/)?/)[0], __indexOf.call(url.archive.imagehosts, _ref) >= 0))) {
+ if (!((media[key] != null) && (ref = media[key].match(/^(http:\/\/[^\/]+\/)?/)[0], indexOf.call(url.archive.imagehosts, ref) >= 0))) {
delete media[key];
}
}
@@ -2190,8 +2180,8 @@
};
Fetcher.prototype.parseArchivedPost = function(data) {
- var board, comment, greentext, i, j, o, post, text, text2, thread, _ref;
- if (post = g.posts["" + this.boardID + "." + this.postID]) {
+ var board, comment, greentext, i, j, o, post, ref, text, text2, thread;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
this.insert(post);
return;
}
@@ -2202,32 +2192,32 @@
}
comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned)\])/);
comment = (function() {
- var _i, _len, _results;
- _results = [];
- for (i = _i = 0, _len = comment.length; _i < _len; i = ++_i) {
+ var k, len1, results;
+ results = [];
+ for (i = k = 0, len1 = comment.length; k < len1; i = ++k) {
text = comment[i];
if (i % 2 === 1) {
- _results.push(this.archiveTags[text]);
+ results.push(this.archiveTags[text]);
} else {
greentext = text[0] === '>';
text = text.replace(/(\[\/?[a-z]+):lit(\])/, '$1$2');
text = (function() {
- var _j, _len1, _ref, _results1;
- _ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
- _results1 = [];
- for (j = _j = 0, _len1 = _ref.length; _j < _len1; j = ++_j) {
- text2 = _ref[j];
+ var len2, q, ref, results1;
+ ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
+ results1 = [];
+ for (j = q = 0, len2 = ref.length; q < len2; j = ++q) {
+ text2 = ref[j];
if (j % 2 === 1) {
- _results1.push({
+ results1.push({
innerHTML: "" + E(text2) + ""
});
} else {
- _results1.push({
+ results1.push({
innerHTML: E(text2)
});
}
}
- return _results1;
+ return results1;
})();
text = {
innerHTML: text.map(function(x) {
@@ -2239,10 +2229,10 @@
innerHTML: "" + text.innerHTML + ""
};
}
- _results.push(text);
+ results.push(text);
}
}
- return _results;
+ return results;
}).call(this);
comment = {
innerHTML: comment.map(function(x) {
@@ -2275,7 +2265,7 @@
dateUTC: data.timestamp,
comment: comment
};
- if ((_ref = data.media) != null ? _ref.media_filename : void 0) {
+ if ((ref = data.media) != null ? ref.media_filename : void 0) {
o.file = {
name: data.media.media_filename,
timestamp: data.media.media_orig,
@@ -2294,7 +2284,7 @@
}
}
board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads["" + this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
post = new Post(Build.post(o), thread, board);
post.kill();
if (post.file) {
@@ -2369,13 +2359,13 @@
});
},
toBlob: function() {
- var _base;
- return (_base = HTMLCanvasElement.prototype).toBlob || (_base.toBlob = function(cb) {
- var data, i, l, ui8a, _i;
+ var base1;
+ return (base1 = HTMLCanvasElement.prototype).toBlob || (base1.toBlob = function(cb) {
+ var data, i, k, l, ref, ui8a;
data = atob(this.toDataURL().slice(22));
l = data.length;
ui8a = new Uint8Array(l);
- for (i = _i = 0; _i < l; i = _i += 1) {
+ for (i = k = 0, ref = l; k < ref; i = k += 1) {
ui8a[i] = data.charCodeAt(i);
}
return cb(new Blob([ui8a], {
@@ -2564,7 +2554,7 @@
id: 'scroll-marker'
}),
setBoardList: function() {
- var a, boardList, btn, chr, node, nodes, spacer, span, _i, _j, _len, _len1, _ref, _ref1;
+ var a, boardList, btn, chr, k, len1, len2, node, nodes, q, ref, ref1, spacer, span;
Header.boardList = boardList = $.el('span', {
id: 'board-list'
});
@@ -2579,14 +2569,14 @@
className: 'spacer'
});
};
- _ref = $('#boardNavDesktop > .boardList').childNodes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $('#boardNavDesktop > .boardList').childNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
switch (node.nodeName) {
case '#text':
- _ref1 = node.nodeValue;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- chr = _ref1[_j];
+ ref1 = node.nodeValue;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ chr = ref1[q];
span = $.el('span', {
textContent: chr
});
@@ -2628,14 +2618,14 @@
as = $$('#full-board-list a[title]', Header.boardList);
re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
nodes = (function() {
- var _i, _len, _ref, _results;
- _ref = boardnav.match(re);
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- t = _ref[_i];
- _results.push(Header.mapCustomNavigation(t, as));
+ var k, len1, ref, results;
+ ref = boardnav.match(re);
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ t = ref[k];
+ results.push(Header.mapCustomNavigation(t, as));
}
- return _results;
+ return results;
})();
$.add(list, nodes);
return $.ready(CatalogLinks.initBoardList);
@@ -2673,7 +2663,7 @@
boardID = g.BOARD.ID;
}
a = (function() {
- var _i, _len, _ref;
+ var k, len1, ref;
if (boardID === '@') {
return $.el('a', {
href: 'https://twitter.com/4chan',
@@ -2681,8 +2671,8 @@
textContent: '@'
});
}
- for (_i = 0, _len = as.length; _i < _len; _i++) {
- a = as[_i];
+ for (k = 0, len1 = as.length; k < len1; k++) {
+ a = as[k];
if (a.textContent === boardID) {
return a.cloneNode(true);
}
@@ -2691,7 +2681,7 @@
href: "/" + boardID + "/",
textContent: boardID
});
- if ((_ref = g.VIEW) === 'catalog' || _ref === 'archive') {
+ if ((ref = g.VIEW) === 'catalog' || ref === 'archive') {
a.href += g.VIEW;
}
if (boardID === g.BOARD.ID) {
@@ -2852,12 +2842,12 @@
return new Notice('info', message, 2);
},
setCustomNav: function(show) {
- var btn, cust, full, _ref;
+ var btn, cust, full, ref;
Header.customNavToggler.checked = show;
cust = $('#custom-board-list', Header.bar);
full = $('#full-board-list', Header.bar);
btn = $('.hide-board-list-container', full);
- return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], btn.hidden = _ref[2], _ref;
+ return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref;
},
toggleCustomNav: function() {
$.cb.checked.call(this);
@@ -2972,13 +2962,13 @@
return Header.menu.toggle(e, this, g);
},
createNotification: function(e) {
- var content, lifetime, notice, type, _ref;
- _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime;
+ var content, lifetime, notice, ref, type;
+ ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime;
return notice = new Notice(type, content, lifetime);
},
areNotificationsEnabled: false,
enableDesktopNotifications: function() {
- var authorize, disable, el, notice, _ref;
+ var authorize, disable, el, notice, ref;
if (!(window.Notification && Conf['Desktop Notifications'])) {
return;
}
@@ -2992,7 +2982,7 @@
el = $.el('span', {
innerHTML: E(g.NAME) + " needs your permission to show desktop notifications. [FAQ]
or "
});
- _ref = $$('button', el), authorize = _ref[0], disable = _ref[1];
+ ref = $$('button', el), authorize = ref[0], disable = ref[1];
$.on(authorize, 'click', function() {
return Notification.requestPermission(function(status) {
Header.areNotificationsEnabled = status === 'granted';
@@ -3013,7 +3003,7 @@
Index = {
showHiddenThreads: false,
init: function() {
- var anchorEntry, input, label, name, pinEntry, refNavEntry, repliesEntry, select, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
+ var anchorEntry, input, k, label, len1, len2, name, pinEntry, q, ref, ref1, ref2, ref3, ref4, ref5, refNavEntry, repliesEntry, select;
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation'] || g.VIEW !== 'index') {
return;
}
@@ -3022,13 +3012,13 @@
name: 'Catalog Features',
cb: this.catalogNode
});
- this.search = ((_ref = history.state) != null ? _ref.search : void 0) || '';
- if ((_ref1 = history.state) != null ? _ref1.mode : void 0) {
- Conf['Index Mode'] = (_ref2 = history.state) != null ? _ref2.mode : void 0;
+ this.search = ((ref = history.state) != null ? ref.search : void 0) || '';
+ if ((ref1 = history.state) != null ? ref1.mode : void 0) {
+ Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0;
}
this.currentPage = this.getCurrentPage();
this.pushState({
- command: (_ref3 = location.href.match(/#(.*)/)) != null ? _ref3[1] : void 0,
+ command: (ref3 = location.href.match(/#(.*)/)) != null ? ref3[1] : void 0,
replace: true
});
this.button = $.el('a', {
@@ -3056,9 +3046,9 @@
pinEntry.el.title = 'Move watched threads to the start of the index.';
anchorEntry.el.title = 'Move hidden threads to the end of the index.';
refNavEntry.el.title = 'Refresh index when navigating through pages.';
- _ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
- for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
- label = _ref4[_i];
+ ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
+ for (k = 0, len1 = ref4.length; k < len1; k++) {
+ label = ref4[k];
input = label.el.firstChild;
name = input.name;
$.on(input, 'change', $.cb.checked);
@@ -3078,7 +3068,7 @@
order: 98,
subEntries: [repliesEntry, pinEntry, anchorEntry, refNavEntry]
});
- $.addClass(doc, 'index-loading', "" + (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
+ $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
this.root = $.el('div', {
className: 'board'
});
@@ -3114,9 +3104,9 @@
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
$.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
$.on(this.selectMode, 'change', this.cb.mode);
- _ref5 = [this.selectMode, this.selectSort, this.selectSize];
- for (_j = 0, _len1 = _ref5.length; _j < _len1; _j++) {
- select = _ref5[_j];
+ ref5 = [this.selectMode, this.selectSort, this.selectSize];
+ for (q = 0, len2 = ref5.length; q < len2; q++) {
+ select = ref5[q];
select.value = Conf[select.name];
$.on(select, 'change', $.cb.value);
}
@@ -3131,15 +3121,15 @@
$.asap((function() {
return $('.board > .thread > .postContainer', doc) || d.readyState !== 'loading';
}), function() {
- var board, el, threadRoot, topNavPos, _k, _l, _len2, _len3, _ref6, _ref7, _ref8;
+ var board, el, len3, len4, ref6, ref7, ref8, threadRoot, topNavPos, u, w;
if (!Main.isThisPageLegit()) {
return;
}
Index.hat = $('.board > .thread > img:first-child');
if (Index.hat && Index.nodes) {
- _ref6 = Index.nodes;
- for (_k = 0, _len2 = _ref6.length; _k < _len2; _k++) {
- threadRoot = _ref6[_k];
+ ref6 = Index.nodes;
+ for (u = 0, len3 = ref6.length; u < len3; u++) {
+ threadRoot = ref6[u];
$.prepend(threadRoot, Index.hat.cloneNode(false));
}
}
@@ -3147,13 +3137,13 @@
$.replace(board, Index.root);
$.event('PostsInserted');
d.implementation.createDocument(null, null, null).appendChild(board);
- _ref7 = $$('.navLinks');
- for (_l = 0, _len3 = _ref7.length; _l < _len3; _l++) {
- el = _ref7[_l];
+ ref7 = $$('.navLinks');
+ for (w = 0, len4 = ref7.length; w < len4; w++) {
+ el = ref7[w];
$.rm(el);
}
- if ((_ref8 = $.id('search-box')) != null) {
- _ref8.parentNode.remove();
+ if ((ref8 = $.id('search-box')) != null) {
+ ref8.parentNode.remove();
}
topNavPos = $.id('delform').previousElementSibling;
$.before(topNavPos, $.el('hr'));
@@ -3217,9 +3207,9 @@
href: 'javascript:;'
}),
order: 20,
- open: function(_arg) {
+ open: function(arg) {
var thread;
- thread = _arg.thread;
+ thread = arg.thread;
if (Conf['Index Mode'] !== 'catalog') {
return false;
}
@@ -3269,11 +3259,11 @@
return ThreadHiding.saveHiddenState(thread);
},
cycleSortType: function() {
- var i, type, types, _i, _len;
- types = __slice.call(Index.selectSort.options).filter(function(option) {
+ var i, k, len1, type, types;
+ types = slice.call(Index.selectSort.options).filter(function(option) {
return !option.disabled;
});
- for (i = _i = 0, _len = types.length; _i < _len; i = ++_i) {
+ for (i = k = 0, len1 = types.length; k < len1; i = ++k) {
type = types[i];
if (type.selected) {
break;
@@ -3324,9 +3314,9 @@
return Index.buildIndex();
},
popstate: function(e) {
- var mode, page, search, state, _ref, _ref1;
+ var mode, page, ref, ref1, search, state;
if (e != null ? e.state : void 0) {
- _ref = e.state, search = _ref.search, mode = _ref.mode;
+ ref = e.state, search = ref.search, mode = ref.mode;
page = Index.getCurrentPage();
state = {};
if (Index.search !== search) {
@@ -3344,7 +3334,7 @@
}
} else {
state = Index.pushState({
- command: (_ref1 = location.href.match(/#(.*)/)) != null ? _ref1[1] : void 0,
+ command: (ref1 = location.href.match(/#(.*)/)) != null ? ref1[1] : void 0,
replace: true,
scroll: true
});
@@ -3380,8 +3370,8 @@
return Header.scrollToIfNeeded(Index.navLinks);
},
getCurrentPage: function() {
- var _ref;
- if ((_ref = Conf['Index Mode']) === 'all pages' || _ref === 'catalog') {
+ var ref;
+ if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') {
return 1;
} else {
return +window.location.pathname.split('/')[2] || 1;
@@ -3402,9 +3392,9 @@
}
},
pushState: function(state) {
- var command, hash, mode, page, pageBeforeSearch, pathname, search, _ref;
+ var command, hash, mode, page, pageBeforeSearch, pathname, ref, search;
pathname = location.pathname, hash = location.hash;
- pageBeforeSearch = (_ref = history.state) != null ? _ref.oldpage : void 0;
+ pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0;
if (state.command != null) {
command = state.command;
if (command === 'paged' || command === 'infinite' || command === 'all-pages' || command === 'catalog') {
@@ -3466,9 +3456,9 @@
return $.set('Previous Index Mode', mode);
}
},
- pageLoad: function(_arg) {
+ pageLoad: function(arg) {
var mode, scroll, search, sort;
- sort = _arg.sort, search = _arg.search, mode = _arg.mode, scroll = _arg.scroll;
+ sort = arg.sort, search = arg.search, mode = arg.mode, scroll = arg.scroll;
if (sort || (search != null)) {
Index.sort();
Index.buildPagelist();
@@ -3486,11 +3476,11 @@
}
},
applyMode: function() {
- var mode, _i, _len, _ref;
- _ref = ['paged', 'infinite', 'all pages', 'catalog'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- mode = _ref[_i];
- $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, "" + (mode.replace(/\ /g, '-')) + "-mode");
+ var k, len1, mode, ref;
+ ref = ['paged', 'infinite', 'all pages', 'catalog'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ mode = ref[k];
+ $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode");
}
Index.selectMode.value = Conf['Index Mode'];
Index.cb.size();
@@ -3508,12 +3498,12 @@
return Math.max(1, Index.getPagesNum());
},
buildPagelist: function() {
- var a, i, maxPageNum, nodes, pagesRoot, _i;
+ var a, i, k, maxPageNum, nodes, pagesRoot, ref;
pagesRoot = $('.pages', Index.pagelist);
maxPageNum = Index.getMaxPageNum();
if (pagesRoot.childElementCount !== maxPageNum) {
nodes = [];
- for (i = _i = 1; _i <= maxPageNum; i = _i += 1) {
+ for (i = k = 1, ref = maxPageNum; k <= ref; i = k += 1) {
a = $.el('a', {
textContent: i,
href: i === 1 ? './' : i
@@ -3550,13 +3540,13 @@
return $.add(strong, a);
},
updateHideLabel: function() {
- var hiddenCount, thread, threadID, _ref, _ref1;
+ var hiddenCount, ref, ref1, thread, threadID;
hiddenCount = 0;
- _ref = g.BOARD.threads;
- for (threadID in _ref) {
- thread = _ref[threadID];
+ ref = g.BOARD.threads;
+ for (threadID in ref) {
+ thread = ref[threadID];
if (thread.isHidden) {
- if (_ref1 = thread.ID, __indexOf.call(Index.liveThreadIDs, _ref1) >= 0) {
+ if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) >= 0) {
hiddenCount++;
}
}
@@ -3569,19 +3559,19 @@
return;
}
Index.hideLabel.hidden = false;
- return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : "" + hiddenCount + " hidden threads";
+ return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads";
},
update: function(state) {
- var now, _ref, _ref1;
+ var now, ref, ref1;
if (!navigator.onLine) {
return;
}
delete Index.pageNum;
- if ((_ref = Index.req) != null) {
- _ref.abort();
+ if ((ref = Index.req) != null) {
+ ref.abort();
}
- if ((_ref1 = Index.notice) != null) {
- _ref1.close();
+ if ((ref1 = Index.notice) != null) {
+ ref1.close();
}
now = Date.now();
$.ready(function() {
@@ -3601,7 +3591,7 @@
return $.addClass(Index.button, 'fa-spin');
},
load: function(e, state) {
- var err, nTimeout, notice, req, timeEl, _ref;
+ var err, nTimeout, notice, ref, req, timeEl;
$.rmClass(Index.button, 'fa-spin');
req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
if (nTimeout) {
@@ -3615,7 +3605,7 @@
notice.close();
return;
}
- if ((_ref = req.status) !== 200 && _ref !== 304) {
+ if ((ref = req.status) !== 200 && ref !== 304) {
err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
if (notice) {
notice.setType('warning');
@@ -3669,20 +3659,20 @@
return data.no;
});
g.BOARD.threads.forEach(function(thread) {
- var _ref;
- if (_ref = thread.ID, __indexOf.call(Index.liveThreadIDs, _ref) < 0) {
+ var ref;
+ if (ref = thread.ID, indexOf.call(Index.liveThreadIDs, ref) < 0) {
return thread.collect();
}
});
},
buildThreads: function() {
- var err, errors, i, posts, thread, threadData, threadRoot, threads, _i, _len, _ref;
+ var err, errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads;
Index.nodes = [];
threads = [];
posts = [];
- _ref = Index.liveThreadData;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- threadData = _ref[i];
+ ref = Index.liveThreadData;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ threadData = ref[i];
try {
threadRoot = Build.thread(g.BOARD, threadData);
if (Index.hat) {
@@ -3723,18 +3713,18 @@
return $.event('IndexRefresh');
},
buildReplies: function(threadRoots) {
- var data, err, errors, i, lastReplies, node, nodes, post, posts, thread, threadRoot, _i, _j, _len, _len1;
+ var data, err, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot;
posts = [];
- for (_i = 0, _len = threadRoots.length; _i < _len; _i++) {
- threadRoot = threadRoots[_i];
+ for (k = 0, len1 = threadRoots.length; k < len1; k++) {
+ threadRoot = threadRoots[k];
thread = Get.threadFromRoot(threadRoot);
i = Index.liveThreadIDs.indexOf(thread.ID);
if (!(lastReplies = Index.liveThreadData[i].last_replies)) {
continue;
}
nodes = [];
- for (_j = 0, _len1 = lastReplies.length; _j < _len1; _j++) {
- data = lastReplies[_j];
+ for (q = 0, len2 = lastReplies.length; q < len2; q++) {
+ data = lastReplies[q];
if (post = thread.posts[data.no]) {
nodes.push(post.nodes.root);
continue;
@@ -3761,15 +3751,15 @@
return Main.callbackNodes(Post, posts);
},
buildCatalogViews: function() {
- var catalogThreads, thread, threads, _i, _len;
+ var catalogThreads, k, len1, thread, threads;
threads = Index.sortedNodes.map(function(threadRoot) {
return Get.threadFromRoot(threadRoot);
}).filter(function(thread) {
return !thread.isHidden !== Index.showHiddenThreads;
});
catalogThreads = [];
- for (_i = 0, _len = threads.length; _i < _len; _i++) {
- thread = threads[_i];
+ for (k = 0, len1 = threads.length; k < len1; k++) {
+ thread = threads[k];
if (!thread.catalogView) {
catalogThreads.push(new CatalogThread(Build.catalogThread(thread), thread));
}
@@ -3780,12 +3770,12 @@
});
},
sizeCatalogViews: function(nodes) {
- var height, node, ratio, size, thumb, width, _i, _len, _ref;
+ var height, k, len1, node, ratio, ref, size, thumb, width;
size = Conf['Index Size'] === 'small' ? 150 : 250;
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- node = nodes[_i];
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ node = nodes[k];
thumb = $('.catalog-thumb', node);
- _ref = thumb.dataset, width = _ref.width, height = _ref.height;
+ ref = thumb.dataset, width = ref.width, height = ref.height;
if (!width) {
continue;
}
@@ -3795,10 +3785,10 @@
}
},
sort: function() {
- var liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID, _i, _len;
+ var k, len1, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
sortedThreadIDs = {
- lastreply: __slice.call(liveThreadData).sort(function(a, b) {
+ lastreply: slice.call(liveThreadData).sort(function(a, b) {
var num;
if ((num = a.last_replies)) {
a = num[num.length - 1];
@@ -3811,15 +3801,15 @@
return post.no;
}),
bump: liveThreadIDs,
- birth: __slice.call(liveThreadIDs).sort(function(a, b) {
+ birth: slice.call(liveThreadIDs).sort(function(a, b) {
return b - a;
}),
- replycount: __slice.call(liveThreadData).sort(function(a, b) {
+ replycount: slice.call(liveThreadData).sort(function(a, b) {
return b.replies - a.replies;
}).map(function(post) {
return post.no;
}),
- filecount: __slice.call(liveThreadData).sort(function(a, b) {
+ filecount: slice.call(liveThreadData).sort(function(a, b) {
return b.images - a.images;
}).map(function(post) {
return post.no;
@@ -3827,8 +3817,8 @@
}[Conf['Index Sort']];
Index.sortedNodes = sortedNodes = [];
nodes = Index.nodes;
- for (_i = 0, _len = sortedThreadIDs.length; _i < _len; _i++) {
- threadID = sortedThreadIDs[_i];
+ for (k = 0, len1 = sortedThreadIDs.length; k < len1; k++) {
+ threadID = sortedThreadIDs[k];
sortedNodes.push(nodes[Index.liveThreadIDs.indexOf(threadID)]);
}
if (Index.search && (nodes = Index.querySearch(Index.search))) {
@@ -3847,12 +3837,12 @@
}
},
sortOnTop: function(match) {
- var bottomNodes, threadRoot, topNodes, _i, _len, _ref;
+ var bottomNodes, k, len1, ref, threadRoot, topNodes;
topNodes = [];
bottomNodes = [];
- _ref = Index.sortedNodes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- threadRoot = _ref[_i];
+ ref = Index.sortedNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ threadRoot = ref[k];
(match(Get.threadFromRoot(threadRoot)) ? topNodes : bottomNodes).push(threadRoot);
}
return Index.sortedNodes = topNodes.concat(bottomNodes);
@@ -3891,7 +3881,7 @@
Index.buildReplies(nodes);
}
Index.buildStructure(nodes);
- if ((Index.followedThreadID != null) && (post = g.posts["" + g.BOARD + "." + Index.followedThreadID])) {
+ if ((Index.followedThreadID != null) && (post = g.posts[g.BOARD + "." + Index.followedThreadID])) {
return Header.scrollTo(post.nodes.root);
}
}
@@ -3903,9 +3893,9 @@
return Index.sortedNodes.slice(offset, offset + nodesPerPage);
},
buildStructure: function(nodes) {
- var node, _i, _len;
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- node = nodes[_i];
+ var k, len1, node;
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ node = nodes[k];
$.add(Index.root, [node, $.el('hr')]);
}
if (doc.contains(Index.root)) {
@@ -3949,12 +3939,12 @@
});
},
searchMatch: function(thread, keywords) {
- var file, info, key, keyword, text, _i, _j, _len, _len1, _ref, _ref1;
- _ref = thread.OP, info = _ref.info, file = _ref.file;
+ var file, info, k, key, keyword, len1, len2, q, ref, ref1, text;
+ ref = thread.OP, info = ref.info, file = ref.file;
text = [];
- _ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- key = _ref1[_i];
+ ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ key = ref1[k];
if (key in info) {
text.push(info[key]);
}
@@ -3963,8 +3953,8 @@
text.push(file.name);
}
text = text.join(' ').toLowerCase();
- for (_j = 0, _len1 = keywords.length; _j < _len1; _j++) {
- keyword = keywords[_j];
+ for (q = 0, len2 = keywords.length; q < len2; q++) {
+ keyword = keywords[q];
if (-1 === text.indexOf(keyword)) {
return false;
}
@@ -3996,7 +3986,7 @@
threshold = 30;
ext = filename.match(/\.?[^\.]*$/)[0];
if (filename.length - ext.length > threshold) {
- return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
+ return filename.slice(0, threshold - 5) + "(...)" + ext;
} else {
return filename;
}
@@ -4063,7 +4053,7 @@
This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS).
@license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
*/
- var boardID, capcode, capcodeClass, capcodeIcon, capcodeStart, comment, container, date, dateUTC, desktop2, email, emailField, emailProcessed, file, fileBlock, fileCont, fileDims, fileLink, fileSize, fileText, fileThumb, flag, flagCode, flagName, gifIcon, highlightPost, href, icons, isOP, match, message, name, nameBlock, nameClass, postID, postInfo, postLink, quote, quoteLink, replyLink, shortFilename, spoilerRange, staticPath, subject, subjectField, threadID, tripcode, tripcodeField, type, typeLC, uniqueID, userID, wholePost, _i, _len, _ref;
+ var boardID, capcode, capcodeClass, capcodeIcon, capcodeStart, comment, container, date, dateUTC, desktop2, email, emailField, emailProcessed, file, fileBlock, fileCont, fileDims, fileLink, fileSize, fileText, fileThumb, flag, flagCode, flagName, gifIcon, highlightPost, href, icons, isOP, k, len1, match, message, name, nameBlock, nameClass, postID, postInfo, postLink, quote, quoteLink, ref, replyLink, shortFilename, spoilerRange, staticPath, subject, subjectField, threadID, tripcode, tripcodeField, type, typeLC, uniqueID, userID, wholePost;
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, comment = o.comment, file = o.file;
name || (name = '');
subject || (subject = '');
@@ -4168,20 +4158,20 @@
postLink = Build.postURL(boardID, threadID, postID);
quoteLink = Build.sameThread(boardID, threadID) ? "javascript:quote('" + (+postID) + "');" : "/" + boardID + "/thread/" + threadID + "#q" + postID;
icons = (function() {
- var _i, _len, _ref, _results;
- _ref = ['Sticky', 'Closed', 'Archived'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
+ var k, len1, ref, results;
+ ref = ['Sticky', 'Closed', 'Archived'];
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
if (!(o["is" + type] && !(type === 'Closed' && o.isArchived))) {
continue;
}
typeLC = type.toLowerCase();
- _results.push({
+ results.push({
innerHTML: "
"
});
}
- return _results;
+ return results;
})();
replyLink = isOP && g.VIEW === 'index' ? {
innerHTML: " [Reply]"
@@ -4199,7 +4189,7 @@
innerHTML: "
"
} : file && boardID === 'f' ? {
innerHTML: "File: " + E(file.name) + "-(" + E($.bytesToString(file.size)) + ", " + E(file.width) + "x" + E(file.height) + ", " + E(file.tag) + ") "
- } : file ? (file.isSpoiler ? (shortFilename = 'Spoiler Image', (spoilerRange = Build.spoilerRange[boardID]) ? fileThumb = "" + staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png" : fileThumb = "" + staticPath + "spoiler.png", file.twidth = file.theight = 100) : (shortFilename = Build.shortFilename(file.name, !isOP), fileThumb = file.turl), fileSize = $.bytesToString(file.size), fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : "" + file.width + "x" + file.height, fileLink = file.isSpoiler || file.name === shortFilename ? {
+ } : file ? (file.isSpoiler ? (shortFilename = 'Spoiler Image', (spoilerRange = Build.spoilerRange[boardID]) ? fileThumb = staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png" : fileThumb = staticPath + "spoiler.png", file.twidth = file.theight = 100) : (shortFilename = Build.shortFilename(file.name, !isOP), fileThumb = file.turl), fileSize = $.bytesToString(file.size), fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : file.width + "x" + file.height, fileLink = file.isSpoiler || file.name === shortFilename ? {
innerHTML: "" + E(shortFilename) + ""
} : {
innerHTML: "" + E(shortFilename) + ""
@@ -4231,9 +4221,9 @@
id: "pc" + postID
});
$.extend(container, wholePost);
- _ref = $$('.quotelink', container);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = $$('.quotelink', container);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
href = quote.getAttribute('href');
if ((href[0] === '#') && !(Build.sameThread(boardID, threadID))) {
quote.href = ("/" + boardID + "/thread/" + threadID) + href;
@@ -4246,7 +4236,7 @@
summary: function(boardID, threadID, posts, files) {
var text;
text = [];
- text.push("" + posts + " post" + (posts > 1 ? 's' : ''));
+ text.push(posts + " post" + (posts > 1 ? 's' : ''));
if (files) {
text.push("and " + files + " image repl" + (files > 1 ? 'ies' : 'y'));
}
@@ -4272,14 +4262,14 @@
return root;
},
excerptThread: function(board, data, OP) {
- var files, nodes, posts, _ref;
+ var files, nodes, posts, ref;
nodes = [OP ? OP.nodes.root : Build.postFromObject(data, board.ID)];
if (data.omitted_posts || !Conf['Show Replies'] && data.replies) {
- _ref = Conf['Show Replies'] ? [
+ ref = Conf['Show Replies'] ? [
data.omitted_posts, data.images - data.last_replies.filter(function(data) {
return !!data.ext;
}).length
- ] : [data.replies, data.images], posts = _ref[0], files = _ref[1];
+ ] : [data.replies, data.images], posts = ref[0], files = ref[1];
nodes.push(Build.summary(board.ID, data.no, posts, files));
}
return nodes;
@@ -4288,23 +4278,23 @@
return Build.postFromObject(data, board.ID);
},
catalogThread: function(thread) {
- var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, pageCount, postCount, pp, quote, root, spoilerRange, src, staticPath, subject, thumb, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4;
+ var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, subject, thumb, u, w;
staticPath = Build.staticPath, gifIcon = Build.gifIcon;
data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)];
if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) {
- src = "" + staticPath + "spoiler";
+ src = staticPath + "spoiler";
if (spoilerRange = Build.spoilerRange[thread.board]) {
src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random());
}
src += '.png';
imgClass = 'spoiler-file';
} else if (data.filedeleted) {
- src = "" + staticPath + "filedeleted-res" + gifIcon;
+ src = staticPath + "filedeleted-res" + gifIcon;
imgClass = 'deleted-file';
} else if (thread.OP.file) {
src = thread.OP.file.thumbURL;
} else {
- src = "" + staticPath + "nofile.png";
+ src = staticPath + "nofile.png";
imgClass = 'no-file';
}
thumb = imgClass ? {
@@ -4331,47 +4321,47 @@
});
root.dataset.fullID = thread.fullID;
if (thread.OP.highlights) {
- $.addClass.apply($, [root].concat(__slice.call(thread.OP.highlights)));
+ $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights)));
}
- _ref = $$('.quotelink', root.lastElementChild);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = $$('.quotelink', root.lastElementChild);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
href = quote.getAttribute('href');
if (href[0] === '#') {
quote.href = ("/" + thread.board + "/thread/" + thread.ID) + href;
}
}
- _ref1 = $$('.abbr, .exif', root.lastElementChild);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- exif = _ref1[_j];
+ ref1 = $$('.abbr, .exif', root.lastElementChild);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ exif = ref1[q];
$.rm(exif);
}
- _ref2 = $$('.prettyprint', root.lastElementChild);
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- pp = _ref2[_k];
+ ref2 = $$('.prettyprint', root.lastElementChild);
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ pp = ref2[u];
cc = $.el('span', {
className: 'catalog-code'
});
- $.add(cc, __slice.call(pp.childNodes));
+ $.add(cc, slice.call(pp.childNodes));
$.replace(pp, cc);
}
- _ref3 = $$('br', root.lastElementChild);
- for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
- br = _ref3[_l];
- if (((_ref4 = br.previousSibling) != null ? _ref4.nodeName : void 0) === 'BR') {
+ ref3 = $$('br', root.lastElementChild);
+ for (w = 0, len4 = ref3.length; w < len4; w++) {
+ br = ref3[w];
+ if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') {
$.rm(br);
}
}
if (thread.isSticky) {
$.add($('.catalog-icons', root), $.el('img', {
- src: "" + staticPath + "sticky" + gifIcon,
+ src: staticPath + "sticky" + gifIcon,
className: 'stickyIcon',
title: 'Sticky'
}));
}
if (thread.isClosed) {
$.add($('.catalog-icons', root), $.el('img', {
- src: "" + staticPath + "closed" + gifIcon,
+ src: staticPath + "closed" + gifIcon,
className: 'closedIcon',
title: 'Closed'
}));
@@ -4388,16 +4378,16 @@
Get = {
threadExcerpt: function(thread) {
- var OP, excerpt, _ref;
+ var OP, excerpt, ref;
OP = thread.OP;
- excerpt = ("/" + thread.board + "/ - ") + (((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.info.nameBlock);
+ excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.info.nameBlock);
if (excerpt.length > 73) {
- return "" + excerpt.slice(0, 70) + "...";
+ return excerpt.slice(0, 70) + "...";
}
return excerpt;
},
threadFromRoot: function(root) {
- return g.threads["" + g.BOARD + "." + root.id.slice(1)];
+ return g.threads[g.BOARD + "." + root.id.slice(1)];
},
threadFromNode: function(node) {
return Get.threadFromRoot($.x('ancestor::div[@class="thread"]', node));
@@ -4408,7 +4398,7 @@
boardID = link.pathname.split('/')[1];
postID = link.hash.slice(2);
index = root.dataset.clone;
- post = g.posts["" + boardID + "." + postID];
+ post = g.posts[boardID + "." + postID];
if (index) {
return post.clones[index];
} else {
@@ -4422,14 +4412,14 @@
return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', node));
},
postDataFromLink: function(link) {
- var boardID, path, postID, threadID, _ref;
+ var boardID, path, postID, ref, threadID;
if (link.hostname === 'boards.4chan.org') {
path = link.pathname.split('/');
boardID = path[1];
threadID = path[3];
postID = link.hash.slice(2);
} else {
- _ref = link.dataset, boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
threadID || (threadID = 0);
}
return {
@@ -4439,44 +4429,44 @@
};
},
allQuotelinksLinkingTo: function(post) {
- var fullID, handleQuotes, posts, qPost, quote, quotelinks, _i, _len, _ref;
+ var fullID, handleQuotes, k, len1, posts, qPost, quote, quotelinks, ref;
quotelinks = [];
posts = g.posts;
fullID = post.fullID;
handleQuotes = function(qPost, type) {
- var clone, _i, _len, _ref;
+ var clone, k, len1, ref;
quotelinks.push.apply(quotelinks, qPost.nodes[type]);
- _ref = qPost.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = qPost.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
quotelinks.push.apply(quotelinks, clone.nodes[type]);
}
};
posts.forEach(function(qPost) {
- if (__indexOf.call(qPost.quotes, fullID) >= 0) {
+ if (indexOf.call(qPost.quotes, fullID) >= 0) {
return handleQuotes(qPost, 'quotelinks');
}
});
if (Conf['Quote Backlinks']) {
- _ref = post.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = post.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
if (qPost = posts[quote]) {
handleQuotes(qPost, 'backlinks');
}
}
}
return quotelinks.filter(function(quotelink) {
- var boardID, postID, _ref1;
- _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
+ var boardID, postID, ref1;
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
return boardID === post.board.ID && postID === post.ID;
});
},
scriptData: function() {
- var script, _i, _len, _ref;
- _ref = $$('script:not([src])', d.head);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- script = _ref[_i];
+ var k, len1, ref, script;
+ ref = $$('script:not([src])', d.head);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ script = ref[k];
if (/\bcooldowns *=/.test(script.textContent)) {
return script.textContent;
}
@@ -4488,21 +4478,21 @@
UI = (function() {
var Menu, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove;
dialog = function(id, position, properties) {
- var child, el, move, _i, _len, _ref;
+ var child, el, k, len1, move, ref;
el = $.el('div', {
className: 'dialog',
id: id
});
$.extend(el, properties);
el.style.cssText = position;
- $.get("" + id + ".position", position, function(item) {
- return el.style.cssText = item["" + id + ".position"];
+ $.get(id + ".position", position, function(item) {
+ return el.style.cssText = item[id + ".position"];
});
move = $('.move', el);
$.on(move, 'touchstart mousedown', dragstart);
- _ref = move.children;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- child = _ref[_i];
+ ref = move.children;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ child = ref[k];
if (!child.tagName) {
continue;
}
@@ -4519,16 +4509,16 @@
lastToggledButton = null;
- function Menu(type) {
- this.type = type;
- this.addEntry = __bind(this.addEntry, this);
- this.onFocus = __bind(this.onFocus, this);
- this.keybinds = __bind(this.keybinds, this);
- this.close = __bind(this.close, this);
+ function Menu(type1) {
+ this.type = type1;
+ this.addEntry = bind(this.addEntry, this);
+ this.onFocus = bind(this.onFocus, this);
+ this.keybinds = bind(this.keybinds, this);
+ this.close = bind(this.close, this);
$.on(d, 'AddMenuEntry', (function(_this) {
- return function(_arg) {
+ return function(arg) {
var detail;
- detail = _arg.detail;
+ detail = arg.detail;
if (detail.type !== _this.type) {
return;
}
@@ -4571,16 +4561,16 @@
};
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;
+ var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, k, left, len1, mRect, menu, ref, ref1, ref2, right, style, top;
menu = this.menu = this.makeMenu();
currentMenu = this;
lastToggledButton = button;
this.entries.sort(function(first, second) {
return first.order - second.order;
});
- _ref = this.entries;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- entry = _ref[_i];
+ ref = this.entries;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ entry = ref[k];
this.insertEntry(entry, menu, data);
}
$.addClass(lastToggledButton, 'active');
@@ -4592,13 +4582,13 @@
bLeft = window.scrollX + bRect.left;
cHeight = doc.clientHeight;
cWidth = doc.clientWidth;
- _ref1 = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom, null] : [null, cHeight - bRect.top], top = _ref1[0], bottom = _ref1[1];
- _ref2 = bRect.left + mRect.width < cWidth ? [bRect.left, null] : [null, cWidth - bRect.right], left = _ref2[0], right = _ref2[1];
+ ref1 = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom, null] : [null, cHeight - bRect.top], top = ref1[0], bottom = ref1[1];
+ ref2 = bRect.left + mRect.width < cWidth ? [bRect.left, null] : [null, cWidth - bRect.right], left = ref2[0], right = ref2[1];
style = menu.style;
- style.top = "" + top + "px";
- style.right = "" + right + "px";
- style.bottom = "" + bottom + "px";
- style.left = "" + left + "px";
+ style.top = top + "px";
+ style.right = right + "px";
+ style.bottom = bottom + "px";
+ style.left = left + "px";
if (right) {
$.addClass(menu, 'left');
}
@@ -4608,7 +4598,7 @@
};
Menu.prototype.insertEntry = function(entry, parent, data) {
- var subEntry, submenu, _i, _len, _ref;
+ var k, len1, ref, subEntry, submenu;
if (typeof entry.open === 'function') {
if (!entry.open(data)) {
return;
@@ -4624,9 +4614,9 @@
submenu = $.el('div', {
className: 'dialog submenu'
});
- _ref = entry.subEntries;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- subEntry = _ref[_i];
+ ref = entry.subEntries;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ subEntry = ref[k];
this.insertEntry(subEntry, submenu, data);
}
$.add(entry.el, submenu);
@@ -4643,7 +4633,7 @@
Menu.prototype.findNextEntry = function(entry, direction) {
var entries;
- entries = __slice.call(entry.parentNode.children);
+ entries = slice.call(entry.parentNode.children);
entries.sort(function(first, second) {
return first.style.order - second.style.order;
});
@@ -4701,13 +4691,13 @@
};
Menu.prototype.focus = function(entry) {
- var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2;
+ var bottom, cHeight, cWidth, eRect, focused, k, left, len1, ref, ref1, ref2, right, sRect, style, submenu, top;
while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
$.rmClass(focused, 'focused');
}
- _ref = $$('.focused', entry);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- focused = _ref[_i];
+ ref = $$('.focused', entry);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ focused = ref[k];
$.rmClass(focused, 'focused');
}
$.addClass(entry, 'focused');
@@ -4718,8 +4708,8 @@
eRect = entry.getBoundingClientRect();
cHeight = doc.clientHeight;
cWidth = doc.clientWidth;
- _ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = _ref1[0], bottom = _ref1[1];
- _ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = _ref2[0], right = _ref2[1];
+ ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1];
+ ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1];
style = submenu.style;
style.top = top;
style.bottom = bottom;
@@ -4733,7 +4723,7 @@
};
Menu.prototype.parseEntry = function(entry) {
- var el, subEntries, subEntry, _i, _len;
+ var el, k, len1, subEntries, subEntry;
el = entry.el, subEntries = entry.subEntries;
$.addClass(el, 'entry');
$.on(el, 'focus mouseover', this.onFocus);
@@ -4742,8 +4732,8 @@
return;
}
$.addClass(el, 'has-submenu');
- for (_i = 0, _len = subEntries.length; _i < _len; _i++) {
- subEntry = subEntries[_i];
+ for (k = 0, len1 = subEntries.length; k < len1; k++) {
+ subEntry = subEntries[k];
this.parseEntry(subEntry);
}
};
@@ -4752,7 +4742,7 @@
})();
dragstart = function(e) {
- var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
+ var el, isTouching, o, rect, ref, screenHeight, screenWidth;
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -4775,7 +4765,7 @@
screenWidth: screenWidth,
isTouching: isTouching
};
- _ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = _ref[0], o.bottomBorder = _ref[1];
+ ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1];
if (isTouching) {
o.identifier = e.identifier;
o.move = touchmove.bind(o);
@@ -4790,10 +4780,10 @@
}
};
touchmove = function(e) {
- var touch, _i, _len, _ref;
- _ref = e.changedTouches;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- touch = _ref[_i];
+ var k, len1, ref, touch;
+ ref = e.changedTouches;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ touch = ref[k];
if (touch.identifier === this.identifier) {
drag.call(this, touch);
return;
@@ -4816,10 +4806,10 @@
return style.bottom = bottom;
};
touchend = function(e) {
- var touch, _i, _len, _ref;
- _ref = e.changedTouches;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- touch = _ref[_i];
+ var k, len1, ref, touch;
+ ref = e.changedTouches;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ touch = ref[k];
if (touch.identifier === this.identifier) {
dragend.call(this);
return;
@@ -4834,16 +4824,16 @@
$.off(d, 'mousemove', this.move);
$.off(d, 'mouseup', this.up);
}
- return $.set("" + this.id + ".position", this.style.cssText);
+ return $.set(this.id + ".position", this.style.cssText);
};
- hoverstart = function(_arg) {
- var asapTest, cb, el, endEvents, height, latestEvent, noRemove, o, root, _ref;
- root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, height = _arg.height, cb = _arg.cb, noRemove = _arg.noRemove;
+ hoverstart = function(arg) {
+ var asapTest, cb, el, endEvents, height, latestEvent, noRemove, o, ref, root;
+ root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, asapTest = arg.asapTest, height = arg.height, cb = arg.cb, noRemove = arg.noRemove;
o = {
root: root,
el: el,
style: el.style,
- isImage: (_ref = el.nodeName) === 'IMG' || _ref === 'VIDEO',
+ isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO',
cb: cb,
endEvents: endEvents,
latestEvent: latestEvent,
@@ -4874,7 +4864,7 @@
return $.on(doc, 'mousemove', o.workaround);
};
hover = function(e) {
- var clientX, clientY, height, left, right, style, threshold, top, _ref;
+ var clientX, clientY, height, left, ref, right, style, threshold, top;
this.latestEvent = e;
height = this.height || this.el.offsetHeight;
clientX = e.clientX, clientY = e.clientY;
@@ -4883,7 +4873,7 @@
if (!this.isImage) {
threshold = Math.max(threshold, this.clientWidth - 400);
}
- _ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = _ref[0], right = _ref[1];
+ ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
style = this.style;
style.top = top + 'px';
style.left = left;
@@ -4938,7 +4928,7 @@
headers: headers,
overrideMimeType: "text/plain; charset=x-user-defined",
onload: function(xhr) {
- var contentDisposition, contentType, data, i, r, _ref, _ref1;
+ var contentDisposition, contentType, data, i, r, ref, ref1;
r = xhr.responseText;
data = new Uint8Array(r.length);
i = 0;
@@ -4946,8 +4936,8 @@
data[i] = r.charCodeAt(i);
i++;
}
- contentType = (_ref = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? _ref[1] : void 0;
- contentDisposition = (_ref1 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? _ref1[1] : void 0;
+ contentType = (ref = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref[1] : void 0;
+ contentDisposition = (ref1 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref1[1] : void 0;
return cb(data, contentType, contentDisposition);
},
onerror: function() {
@@ -4960,13 +4950,13 @@
},
file: function(url, cb) {
return CrossOrigin.binary(url, function(data, contentType, contentDisposition) {
- var blob, match, mime, name, _ref, _ref1, _ref2;
+ var blob, match, mime, name, ref, ref1, ref2;
if (data == null) {
return cb(null);
}
- name = (_ref = url.match(/([^\/]+)\/*$/)) != null ? _ref[1] : void 0;
+ name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0;
mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream';
- match = (contentDisposition != null ? (_ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? _ref1[1] : void 0 : void 0) || (contentType != null ? (_ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? _ref2[1] : void 0 : void 0);
+ match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0);
if (match) {
name = match.replace(/\\"/g, '"');
}
@@ -4995,11 +4985,11 @@
method: "GET",
url: url + '',
onload: function(xhr) {
- var response, _i, _len, _ref;
+ var k, len1, ref, response;
response = JSON.parse(xhr.responseText);
- _ref = callbacks[url];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- cb = _ref[_i];
+ ref = callbacks[url];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ cb = ref[k];
cb(response);
}
delete callbacks[url];
@@ -5019,8 +5009,8 @@
Anonymize = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread' || _ref === 'archive') && Conf['Anonymize'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Anonymize'])) {
return;
}
if (g.VIEW === 'archive') {
@@ -5032,11 +5022,11 @@
});
},
node: function() {
- var email, name, tripcode, _ref;
+ var email, name, ref, tripcode;
if (this.info.capcode || this.isClone) {
return;
}
- _ref = this.nodes, name = _ref.name, tripcode = _ref.tripcode, email = _ref.email;
+ ref = this.nodes, name = ref.name, tripcode = ref.tripcode, email = ref.email;
if (this.info.name !== 'Anonymous') {
name.textContent = 'Anonymous';
}
@@ -5051,15 +5041,15 @@
},
archive: function() {
return $.ready(function() {
- var name, trip, _i, _j, _len, _len1, _ref, _ref1;
- _ref = $$('.name');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ var k, len1, len2, name, q, ref, ref1, trip;
+ ref = $$('.name');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
name.textContent = 'Anonymous';
}
- _ref1 = $$('.postertrip');
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- trip = _ref1[_j];
+ ref1 = $$('.postertrip');
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ trip = ref1[q];
$.rm(trip);
}
});
@@ -5069,8 +5059,8 @@
Filter = {
filters: {},
init: function() {
- var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Filter'])) {
+ var boards, err, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, regexp, stub, top;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
return;
}
if (!Conf['Filtered Backlinks']) {
@@ -5078,9 +5068,9 @@
}
for (key in Config.filter) {
this.filters[key] = [];
- _ref1 = Conf[key].split('\n');
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- line = _ref1[_i];
+ ref1 = Conf[key].split('\n');
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ line = ref1[k];
if (line[0] === '#') {
continue;
}
@@ -5088,8 +5078,8 @@
continue;
}
filter = line.replace(regexp[0], '');
- boards = ((_ref2 = filter.match(/boards:([^;]+)/)) != null ? _ref2[1].toLowerCase() : void 0) || 'global';
- if (boards !== 'global' && (_ref3 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref3) < 0)) {
+ boards = ((ref2 = filter.match(/boards:([^;]+)/)) != null ? ref2[1].toLowerCase() : void 0) || 'global';
+ if (boards !== 'global' && (ref3 = g.BOARD.ID, indexOf.call(boards.split(','), ref3) < 0)) {
continue;
}
if (key === 'uniqueID' || key === 'MD5') {
@@ -5103,10 +5093,10 @@
continue;
}
}
- op = ((_ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref4[1] : void 0) || 'yes';
+ op = ((ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? ref4[1] : void 0) || 'yes';
stub = (function() {
- var _ref5;
- switch ((_ref5 = filter.match(/stub:(yes|no)/)) != null ? _ref5[1] : void 0) {
+ var ref5;
+ switch ((ref5 = filter.match(/stub:(yes|no)/)) != null ? ref5[1] : void 0) {
case 'yes':
return true;
case 'no':
@@ -5116,8 +5106,8 @@
}
})();
if (hl = /highlight/.test(filter)) {
- hl = ((_ref5 = filter.match(/highlight:([\w-]+)/)) != null ? _ref5[1] : void 0) || 'filter-highlight';
- top = ((_ref6 = filter.match(/top:(yes|no)/)) != null ? _ref6[1] : void 0) || 'yes';
+ hl = ((ref5 = filter.match(/highlight:([\w-]+)/)) != null ? ref5[1] : void 0) || 'filter-highlight';
+ top = ((ref6 = filter.match(/top:(yes|no)/)) != null ? ref6[1] : void 0) || 'yes';
top = top === 'yes';
}
this.filters[key].push(this.createFilter(regexp, op, stub, hl, top));
@@ -5158,15 +5148,15 @@
};
},
node: function() {
- var filter, key, result, value, _i, _len, _ref, _ref1;
+ var filter, k, key, len1, ref, ref1, result, value;
if (this.isClone || this.isFetchedQuote) {
return;
}
for (key in Filter.filters) {
if ((value = Filter[key](this)) !== false) {
- _ref = Filter.filters[key];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- filter = _ref[_i];
+ ref = Filter.filters[key];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ filter = ref[k];
if (!(result = filter(value, this.isReply))) {
continue;
}
@@ -5181,7 +5171,7 @@
return;
}
$.addClass(this.nodes.root, result["class"]);
- if (!(this.highlights && (_ref1 = result["class"], __indexOf.call(this.highlights, _ref1) >= 0))) {
+ if (!(this.highlights && (ref1 = result["class"], indexOf.call(this.highlights, ref1) >= 0))) {
(this.highlights || (this.highlights = [])).push(result["class"]);
}
if (!this.isReply && result.top) {
@@ -5261,8 +5251,8 @@
},
menu: {
init: function() {
- var div, entry, type, _i, _len, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
+ var div, entry, k, len1, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
return;
}
div = $.el('div', {
@@ -5277,9 +5267,9 @@
},
subEntries: []
};
- _ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- type = _ref1[_i];
+ ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ type = ref1[k];
entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1]));
}
return Menu.menu.addEntry(entry);
@@ -5318,7 +5308,7 @@
return $.get(type, Conf[type], function(item) {
var save, section, select, ta, tl;
save = item[type];
- save = save ? "" + save + "\n" + re : re;
+ save = save ? save + "\n" + re : re;
$.set(type, save);
Settings.open('Filter');
section = $('.section-container');
@@ -5336,8 +5326,8 @@
PostHiding = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
return;
}
if (Conf['Reply Hiding Buttons']) {
@@ -5375,8 +5365,8 @@
},
menu: {
init: function() {
- var apply, div, hideStubLink, makeStub, replies, thisPost, _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
+ var apply, div, hideStubLink, makeStub, ref, replies, thisPost;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
return;
}
div = $.el('div', {
@@ -5541,7 +5531,7 @@
textContent: ""
});
a = $.el('a', {
- className: "" + type + "-reply-button",
+ className: type + "-reply-button",
href: 'javascript:;'
});
$.add(a, span);
@@ -5573,7 +5563,7 @@
return PostHiding.saveHiddenState(post, post.isHidden);
},
hide: function(post, makeStub, hideRecursively) {
- var a, quotelink, _i, _len, _ref;
+ var a, k, len1, quotelink, ref;
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -5588,9 +5578,9 @@
Recursive.apply(PostHiding.hide, post, makeStub, true);
Recursive.add(PostHiding.hide, post, makeStub, true);
}
- _ref = Get.allQuotelinksLinkingTo(post);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
$.addClass(quotelink, 'filtered');
}
if (!makeStub) {
@@ -5609,7 +5599,7 @@
return $.prepend(post.nodes.root, post.nodes.stub);
},
show: function(post, showRecursively) {
- var quotelink, _i, _len, _ref;
+ var k, len1, quotelink, ref;
if (showRecursively == null) {
showRecursively = Conf['Recursive Hiding'];
}
@@ -5624,9 +5614,9 @@
Recursive.apply(PostHiding.show, post, true);
Recursive.rm(PostHiding.hide, post);
}
- _ref = Get.allQuotelinksLinkingTo(post);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
$.rmClass(quotelink, 'filtered');
}
}
@@ -5635,8 +5625,8 @@
Recursive = {
recursives: {},
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
return Post.callbacks.push({
@@ -5645,26 +5635,26 @@
});
},
node: function() {
- var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
+ var i, k, len1, len2, obj, q, quote, recursive, ref, ref1;
if (this.isClone || this.isFetchedQuote) {
return;
}
- _ref = this.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = this.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
if (obj = Recursive.recursives[quote]) {
- _ref1 = obj.recursives;
- for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) {
- recursive = _ref1[i];
- recursive.apply(null, [this].concat(__slice.call(obj.args[i])));
+ ref1 = obj.recursives;
+ for (i = q = 0, len2 = ref1.length; q < len2; i = ++q) {
+ recursive = ref1[i];
+ recursive.apply(null, [this].concat(slice.call(obj.args[i])));
}
}
}
},
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] = {
+ var args, base1, name1, obj, post, recursive;
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
+ obj = (base1 = Recursive.recursives)[name1 = post.fullID] || (base1[name1] = {
recursives: [],
args: []
});
@@ -5672,13 +5662,13 @@
return obj.args.push(args);
},
rm: function(recursive, post) {
- var i, obj, rec, _i, _len, _ref;
+ var i, k, len1, obj, rec, ref;
if (!(obj = Recursive.recursives[post.fullID])) {
return;
}
- _ref = obj.recursives;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- rec = _ref[i];
+ ref = obj.recursives;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ rec = ref[i];
if (!(rec === recursive)) {
continue;
}
@@ -5688,11 +5678,11 @@
},
apply: function() {
var args, fullID, post, recursive;
- recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
fullID = post.fullID;
return g.posts.forEach(function(post) {
- if (__indexOf.call(post.quotes, fullID) >= 0) {
- return recursive.apply(null, [post].concat(__slice.call(args)));
+ if (indexOf.call(post.quotes, fullID) >= 0) {
+ return recursive.apply(null, [post].concat(slice.call(args)));
}
});
}
@@ -5700,8 +5690,8 @@
ThreadHiding = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) {
return;
}
this.db = new DataBoard('hiddenThreads');
@@ -5773,9 +5763,9 @@
return $.prepend(this.OP.nodes.root, ThreadHiding.makeButton(this, 'hide'));
},
onIndexBuild: function(nodes) {
- var root, thread, _i, _len;
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- root = nodes[_i];
+ var k, len1, root, thread;
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ root = nodes[k];
thread = Get.threadFromRoot(root);
if (thread.isHidden && thread.stub && !root.contains(thread.stub)) {
ThreadHiding.makeStub(thread, root);
@@ -5801,9 +5791,9 @@
Menu.menu.addEntry({
el: div,
order: 20,
- open: function(_arg) {
+ open: function(arg) {
var isReply, thread;
- thread = _arg.thread, isReply = _arg.isReply;
+ thread = arg.thread, isReply = arg.isReply;
if (isReply || thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
return false;
}
@@ -5827,9 +5817,9 @@
Menu.menu.addEntry({
el: div,
order: 20,
- open: function(_arg) {
+ open: function(arg) {
var isReply, thread;
- thread = _arg.thread, isReply = _arg.isReply;
+ thread = arg.thread, isReply = arg.isReply;
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
return false;
}
@@ -5845,9 +5835,9 @@
return Menu.menu.addEntry({
el: hideStubLink,
order: 15,
- open: function(_arg) {
+ open: function(arg) {
var isReply, thread;
- thread = _arg.thread, isReply = _arg.isReply;
+ thread = arg.thread, isReply = arg.isReply;
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
return false;
}
@@ -5882,7 +5872,7 @@
makeButton: function(thread, type) {
var a;
a = $.el('a', {
- className: "" + type + "-thread-button",
+ className: type + "-thread-button",
href: 'javascript:;'
});
$.extend(a, {
@@ -5899,7 +5889,7 @@
numReplies += +summary.textContent.match(/\d+/);
}
a = ThreadHiding.makeButton(thread, 'show');
- $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : "" + numReplies + " replies") + ")"));
+ $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")"));
thread.stub = $.el('div', {
className: 'stub'
});
@@ -5973,8 +5963,8 @@
QuoteBacklink = {
containers: {},
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Backlinks']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) {
return;
}
Post.callbacks.push({
@@ -5987,7 +5977,7 @@
});
},
firstNode: function() {
- var a, clone, container, containers, hash, link, markYours, nodes, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
+ var a, clone, container, containers, hash, k, len1, len2, len3, link, markYours, nodes, post, q, quote, ref, ref1, u;
if (this.isClone || !this.quotes.length || this.isRebuilt) {
return;
}
@@ -6008,19 +5998,19 @@
};
})(this)) + (markYours ? '\u00A0(You)' : '')
});
- _ref = this.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = this.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
containers = [QuoteBacklink.getContainer(quote)];
if ((post = g.posts[quote]) && post.nodes.backlinkContainer) {
- _ref1 = post.clones;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- clone = _ref1[_j];
+ ref1 = post.clones;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ clone = ref1[q];
containers.push(clone.nodes.backlinkContainer);
}
}
- for (_k = 0, _len2 = containers.length; _k < _len2; _k++) {
- container = containers[_k];
+ for (u = 0, len3 = containers.length; u < len3; u++) {
+ container = containers[u];
nodes = [$.tn(' '), link = a.cloneNode(true)];
if (Conf['Quote Previewing']) {
$.on(link, 'mouseover', QuotePreview.mouseover);
@@ -6050,8 +6040,8 @@
return $.add(this.nodes.info, container);
},
getContainer: function(id) {
- var _base;
- return (_base = this.containers)[id] || (_base[id] = $.el('span', {
+ var base1;
+ return (base1 = this.containers)[id] || (base1[id] = $.el('span', {
className: 'container'
}));
}
@@ -6059,8 +6049,8 @@
QuoteCT = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6073,15 +6063,15 @@
});
},
node: function() {
- var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2;
+ var board, boardID, k, len1, quotelink, ref, ref1, ref2, thread, threadID;
if (this.isClone && this.thread === this.context.thread) {
return;
}
- _ref = this.isClone ? this.context : this, board = _ref.board, thread = _ref.thread;
- _ref1 = this.nodes.quotelinks;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- quotelink = _ref1[_i];
- _ref2 = Get.postDataFromLink(quotelink), boardID = _ref2.boardID, threadID = _ref2.threadID;
+ ref = this.isClone ? this.context : this, board = ref.board, thread = ref.thread;
+ ref1 = this.nodes.quotelinks;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ quotelink = ref1[k];
+ ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID;
if (!threadID) {
continue;
}
@@ -6097,8 +6087,8 @@
QuoteInline = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Inlining']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) {
return;
}
this.process = Conf['Quote Hash Navigation'] ? function(link, clone) {
@@ -6118,17 +6108,17 @@
});
},
node: function() {
- var isClone, link, process, _i, _j, _len, _len1, _ref, _ref1;
+ var isClone, k, len1, len2, link, process, q, ref, ref1;
process = QuoteInline.process;
isClone = this.isClone;
- _ref = this.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- link = _ref[_i];
+ ref = this.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
process(link, isClone);
}
- _ref1 = this.nodes.backlinks;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- link = _ref1[_j];
+ ref1 = this.nodes.backlinks;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ link = ref1[q];
process(link, isClone);
}
},
@@ -6145,12 +6135,12 @@
});
},
toggle: function(e) {
- var boardID, context, postID, threadID, _ref;
+ var boardID, context, postID, ref, threadID;
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
e.preventDefault();
- _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
context = Get.contextFromNode(this);
if ($.hasClass(this, 'inlined')) {
QuoteInline.rm(this, boardID, threadID, postID, context);
@@ -6181,7 +6171,7 @@
qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
$.addClass(qroot, 'hasInline');
new Fetcher(boardID, threadID, postID, inline, context);
- if (!((post = g.posts["" + boardID + "." + postID]) && context.thread === post.thread)) {
+ if (!((post = g.posts[boardID + "." + postID]) && context.thread === post.thread)) {
return;
}
if (isBacklink && Conf['Forward Hiding']) {
@@ -6194,7 +6184,7 @@
return Unread.readSinglePost(post);
},
rm: function(quotelink, boardID, threadID, postID, context) {
- var el, inlined, isBacklink, post, qroot, root, _ref;
+ var el, inlined, isBacklink, post, qroot, ref, root;
isBacklink = $.hasClass(quotelink, 'backlink');
root = QuoteInline.findRoot(quotelink, isBacklink);
root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root);
@@ -6206,14 +6196,14 @@
if (!(el = root.firstElementChild)) {
return;
}
- post = g.posts["" + boardID + "." + postID];
+ post = g.posts[boardID + "." + postID];
post.rmClone(el.dataset.clone);
- if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads["" + boardID + "." + threadID] && !--post.forwarded) {
+ if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads[boardID + "." + threadID] && !--post.forwarded) {
delete post.forwarded;
$.rmClass(post.nodes.root, 'forwarded');
}
while (inlined = $('.inlined', el)) {
- _ref = Get.postDataFromLink(inlined), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
QuoteInline.rm(inlined, boardID, threadID, postID, context);
$.rmClass(inlined, 'inlined');
}
@@ -6222,8 +6212,8 @@
QuoteOP = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark OP Quotes']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6236,7 +6226,7 @@
});
},
node: function() {
- var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref, _ref1;
+ var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1;
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -6244,20 +6234,20 @@
return;
}
quotelinks = this.nodes.quotelinks;
- if (this.isClone && (_ref = this.thread.fullID, __indexOf.call(quotes, _ref) >= 0)) {
+ if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) {
i = 0;
while (quotelink = quotelinks[i++]) {
quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, '');
}
}
fullID = (this.isClone ? this.context : this).thread.fullID;
- if (__indexOf.call(quotes, fullID) < 0) {
+ if (indexOf.call(quotes, fullID) < 0) {
return;
}
i = 0;
while (quotelink = quotelinks[i++]) {
- _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
- if (("" + boardID + "." + postID) === fullID) {
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((boardID + "." + postID) === fullID) {
$.add(quotelink, $.tn(QuoteOP.text));
}
}
@@ -6266,8 +6256,8 @@
QuotePreview = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Quote Previewing'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Quote Previewing'])) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6279,19 +6269,19 @@
});
},
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];
+ var k, len1, link, ref;
+ ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
$.on(link, 'mouseover', QuotePreview.mouseover);
}
},
mouseover: function(e) {
- var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1;
+ var boardID, clone, k, len1, len2, origin, post, postID, posts, q, qp, quote, quoterID, ref, ref1, threadID;
if ($.hasClass(this, 'inlined')) {
return;
}
- _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
qp = $.el('div', {
id: 'qp',
className: 'dialog'
@@ -6308,29 +6298,29 @@
return qp.firstElementChild;
}
});
- if (!(origin = g.posts["" + boardID + "." + postID])) {
+ if (!(origin = g.posts[boardID + "." + postID])) {
return;
}
if (Conf['Quote Highlighting']) {
posts = [origin].concat(origin.clones);
posts.pop();
- for (_i = 0, _len = posts.length; _i < _len; _i++) {
- post = posts[_i];
+ for (k = 0, len1 = posts.length; k < len1; k++) {
+ post = posts[k];
$.addClass(post.nodes.post, 'qphl');
}
}
quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0];
clone = Get.postFromRoot(qp.firstChild);
- _ref1 = clone.nodes.quotelinks.concat(__slice.call(clone.nodes.backlinks));
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- quote = _ref1[_j];
+ ref1 = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks));
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ quote = ref1[q];
if (quote.hash.slice(2) === quoterID) {
$.addClass(quote, 'forwardlink');
}
}
},
mouseout: function() {
- var clone, post, root, _i, _len, _ref;
+ var clone, k, len1, post, ref, root;
if (!(root = this.el.firstElementChild)) {
return;
}
@@ -6340,9 +6330,9 @@
if (!Conf['Quote Highlighting']) {
return;
}
- _ref = [post].concat(post.clones);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ ref = [post].concat(post.clones);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
$.rmClass(post.nodes.post, 'qphl');
}
}
@@ -6350,8 +6340,8 @@
QuoteStrikeThrough = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
return;
}
return Post.callbacks.push({
@@ -6360,15 +6350,15 @@
});
},
node: function() {
- var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
+ var boardID, k, len1, postID, quotelink, ref, ref1, ref2;
if (this.isClone) {
return;
}
- _ref = this.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
- _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
- if ((_ref2 = g.posts["" + boardID + "." + postID]) != null ? _ref2.isHidden : void 0) {
+ ref = this.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((ref2 = g.posts[boardID + "." + postID]) != null ? ref2.isHidden : void 0) {
$.addClass(quotelink, 'filtered');
}
}
@@ -6424,15 +6414,15 @@
});
},
node: function() {
- var ancestor, lastParent, parent, parents, quote, _i, _len, _ref;
+ var ancestor, k, lastParent, len1, parent, parents, quote, ref;
if (this.isFetchedQuote || this.isClone || !this.isReply) {
return;
}
parents = new Set();
lastParent = null;
- _ref = this.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = this.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
if (parent = g.posts[quote]) {
if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) {
parents.add(parent.ID);
@@ -6454,27 +6444,27 @@
}
},
descendants: function(post) {
- var child, children, posts, _i, _len;
+ var child, children, k, len1, posts;
posts = [post];
if (children = QuoteThreading.children[post.fullID]) {
- for (_i = 0, _len = children.length; _i < _len; _i++) {
- child = children[_i];
+ for (k = 0, len1 = children.length; k < len1; k++) {
+ child = children[k];
posts = posts.concat(QuoteThreading.descendants(child));
}
}
return posts;
},
insert: function(post) {
- var child, children, descendants, i, next, nodes, order, parent, prev, prev2, threadContainer, x, _base, _i, _j, _k, _len, _name;
+ var base1, child, children, descendants, i, k, len1, name1, next, nodes, order, parent, prev, prev2, q, threadContainer, u, x;
if (!(QuoteThreading.enabled && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) {
return false;
}
descendants = QuoteThreading.descendants(post);
if (!Unread.posts.has(parent.ID)) {
if ((function() {
- var x, _i, _len;
- for (_i = 0, _len = descendants.length; _i < _len; _i++) {
- x = descendants[_i];
+ var k, len1, x;
+ for (k = 0, len1 = descendants.length; k < len1; k++) {
+ x = descendants[k];
if (Unread.posts.has(x.ID)) {
return true;
}
@@ -6485,7 +6475,7 @@
}
}
order = Unread.order;
- children = ((_base = QuoteThreading.children)[_name = parent.fullID] || (_base[_name] = []));
+ children = ((base1 = QuoteThreading.children)[name1 = parent.fullID] || (base1[name1] = []));
threadContainer = parent.nodes.threadContainer || $.el('div', {
className: 'threadContainer'
});
@@ -6494,16 +6484,16 @@
nodes.push(post.nodes.threadContainer);
}
i = children.length;
- for (_i = children.length - 1; _i >= 0; _i += -1) {
- child = children[_i];
+ for (k = children.length - 1; k >= 0; k += -1) {
+ child = children[k];
if (child.ID >= post.ID) {
i--;
}
}
if (i !== children.length) {
next = children[i];
- for (_j = 0, _len = descendants.length; _j < _len; _j++) {
- x = descendants[_j];
+ for (q = 0, len1 = descendants.length; q < len1; q++) {
+ x = descendants[q];
order.before(order[next.ID], order[x.ID]);
}
children.splice(i, 0, post);
@@ -6513,8 +6503,8 @@
while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
prev = prev2[prev2.length - 1];
}
- for (_k = descendants.length - 1; _k >= 0; _k += -1) {
- x = descendants[_k];
+ for (u = descendants.length - 1; u >= 0; u += -1) {
+ x = descendants[u];
order.after(order[prev.ID], order[x.ID]);
}
children.push(post);
@@ -6566,8 +6556,8 @@
QuoteYou = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
if (Conf['Highlight Own Posts']) {
@@ -6586,7 +6576,7 @@
});
},
node: function() {
- var quotelink, _i, _len, _ref;
+ var k, len1, quotelink, ref;
if (this.isClone) {
return;
}
@@ -6600,9 +6590,9 @@
if (!this.quotes.length) {
return;
}
- _ref = this.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = this.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
continue;
}
@@ -6631,7 +6621,7 @@
} else {
post = QuoteYou.lastRead;
}
- str = "" + type + "::div[contains(@class,'quotesYou')]";
+ str = type + "::div[contains(@class,'quotesYou')]";
while (post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0)) {
if (QuoteYou.cb.scroll(post)) {
return;
@@ -6656,8 +6646,8 @@
Quotify = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Resurrect Quotes']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6669,10 +6659,10 @@
});
},
node: function() {
- var deadlink, _i, _len, _ref;
- _ref = $$('.deadlink', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- deadlink = _ref[_i];
+ var deadlink, k, len1, ref;
+ ref = $$('.deadlink', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ deadlink = ref[k];
if (this.isClone) {
if ($.hasClass(deadlink, 'quotelink')) {
this.nodes.quotelinks.push(deadlink);
@@ -6683,13 +6673,13 @@
}
},
parseDeadlink: function(deadlink) {
- var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, _ref;
+ var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref;
if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
Quotify.fixDeadlink(deadlink);
return;
}
quote = deadlink.textContent;
- if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) {
+ if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) {
return;
}
if (postID[0] === '0') {
@@ -6697,7 +6687,7 @@
return;
}
boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID;
- quoteID = "" + boardID + "." + postID;
+ quoteID = boardID + "." + postID;
if (post = g.posts[quoteID]) {
if (!post.isDead) {
a = $.el('a', {
@@ -6710,7 +6700,7 @@
href: Build.postURL(boardID, post.thread.ID, postID),
className: 'quotelink deadlink',
target: '_blank',
- textContent: "" + quote + "\u00A0(Dead)"
+ textContent: quote + "\u00A0(Dead)"
});
$.extend(a.dataset, {
boardID: boardID,
@@ -6733,7 +6723,7 @@
href: redirect || 'javascript:;',
className: 'deadlink',
target: '_blank',
- textContent: "" + quote + "\u00A0(Dead)"
+ textContent: quote + "\u00A0(Dead)"
});
if (fetchable) {
$.addClass(a, 'quotelink');
@@ -6744,11 +6734,11 @@
}
}
}
- if (__indexOf.call(this.quotes, quoteID) < 0) {
+ if (indexOf.call(this.quotes, quoteID) < 0) {
this.quotes.push(quoteID);
}
if (!a) {
- deadlink.textContent = "" + quote + "\u00A0(Dead)";
+ deadlink.textContent = quote + "\u00A0(Dead)";
return;
}
$.replace(deadlink, a);
@@ -6765,7 +6755,7 @@
$.before(deadlink, green);
$.add(green, deadlink);
}
- return $.replace(deadlink, __slice.call(deadlink.childNodes));
+ return $.replace(deadlink, slice.call(deadlink.childNodes));
}
};
@@ -6785,9 +6775,6 @@
noscript = Conf['Force Noscript Captcha'] || !doc.dataset.jsEnabled;
this.captcha = Captcha[noscript ? 'noscript' : 'v2'];
$.on(d, '4chanXInitFinished', this.initReady);
- window.addEventListener('focus', this.focus, true);
- window.addEventListener('blur', this.focus, true);
- $.on(d, 'click', this.focus);
Post.callbacks.push({
name: 'Quick Reply',
cb: this.node
@@ -6871,7 +6858,7 @@
return;
}
thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads["" + g.BOARD + "." + thread].isDead) {
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
return QR.abort();
} else {
return QR.status();
@@ -6909,7 +6896,7 @@
}
},
close: function() {
- var post, _i, _len, _ref;
+ var k, len1, post, ref;
if (QR.req) {
QR.abort();
return;
@@ -6922,9 +6909,9 @@
$.addClass(QR.shortcut, 'disabled');
}
new QR.post(true);
- _ref = QR.posts.splice(0, QR.posts.length - 1);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ ref = QR.posts.splice(0, QR.posts.length - 1);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
post["delete"]();
}
QR.cooldown.auto = false;
@@ -6934,9 +6921,6 @@
focus: function() {
$.queueTask(function() {
var focus;
- if (!QR.nodes) {
- return;
- }
if (!$$('.goog-bubble-content > iframe').some(function(el) {
return el.getBoundingClientRect().top >= 0;
})) {
@@ -6976,6 +6960,17 @@
return QR.unhide();
}
},
+ setCustomCooldown: function(enabled) {
+ Conf['customCooldownEnabled'] = enabled;
+ QR.cooldown.customCooldown = enabled;
+ return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);
+ },
+ toggleCustomCooldown: function() {
+ var enabled;
+ enabled = $.hasClass(this, 'disabled');
+ QR.setCustomCooldown(enabled);
+ return $.set('customCooldownEnabled', enabled);
+ },
error: function(err) {
var el;
QR.open();
@@ -7012,10 +7007,10 @@
},
notifications: [],
cleanNotifications: function() {
- var notification, _i, _len, _ref;
- _ref = QR.notifications;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- notification = _ref[_i];
+ var k, len1, notification, ref;
+ ref = QR.notifications;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ notification = ref[k];
notification.close();
}
return QR.notifications = [];
@@ -7026,7 +7021,7 @@
return;
}
thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads["" + g.BOARD + "." + thread].isDead) {
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
value = 'Dead';
disabled = true;
QR.cooldown.auto = false;
@@ -7037,7 +7032,7 @@
return status.disabled = disabled || false;
},
quote: function(e) {
- var ancestor, caretPos, com, frag, index, insideCode, node, post, range, sel, text, thread, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
+ var ancestor, caretPos, com, frag, index, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, w, y, z;
if (e != null) {
e.preventDefault();
}
@@ -7059,37 +7054,37 @@
$.prepend(frag, $.tn('[code]'));
$.add(frag, $.tn('[/code]'));
}
- _ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
$.replace(node, $.tn('\n'));
}
- _ref1 = $$('br', frag);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- node = _ref1[_j];
+ ref1 = $$('br', frag);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ node = ref1[q];
if (node !== frag.lastChild) {
$.replace(node, $.tn('\n>'));
}
}
- _ref2 = $$('s, .removed-spoiler', frag);
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- node = _ref2[_k];
- $.replace(node, [$.tn('[spoiler]')].concat(__slice.call(node.childNodes), [$.tn('[/spoiler]')]));
+ ref2 = $$('s, .removed-spoiler', frag);
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ node = ref2[u];
+ $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')]));
}
- _ref3 = $$('.prettyprint', frag);
- for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
- node = _ref3[_l];
- $.replace(node, [$.tn('[code]')].concat(__slice.call(node.childNodes), [$.tn('[/code]')]));
+ ref3 = $$('.prettyprint', frag);
+ for (w = 0, len4 = ref3.length; w < len4; w++) {
+ node = ref3[w];
+ $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')]));
}
- _ref4 = $$('.linkify[data-original]', frag);
- for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) {
- node = _ref4[_m];
+ ref4 = $$('.linkify[data-original]', frag);
+ for (y = 0, len5 = ref4.length; y < len5; y++) {
+ node = ref4[y];
$.replace(node, $.tn(node.dataset.original));
}
- _ref5 = $$('.embedder', frag);
- for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) {
- node = _ref5[_n];
- if (((_ref6 = node.previousSibling) != null ? _ref6.nodeValue : void 0) === ' ') {
+ ref5 = $$('.embedder', frag);
+ for (z = 0, len6 = ref5.length; z < len6; z++) {
+ node = ref5[z];
+ if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') {
$.rm(node.previousSibling);
}
$.rm(node);
@@ -7103,7 +7098,7 @@
$.addClass(QR.nodes.el, 'dump');
QR.cooldown.auto = true;
}
- _ref7 = QR.nodes, com = _ref7.com, thread = _ref7.thread;
+ ref7 = QR.nodes, com = ref7.com, thread = ref7.thread;
if (!com.value) {
thread.value = Get.threadFromNode(this);
}
@@ -7142,14 +7137,14 @@
return QR.handleFiles(e.dataTransfer.files);
},
paste: function(e) {
- var blob, files, item, _i, _len, _ref;
+ var blob, files, item, k, len1, ref;
if (!e.clipboardData.items) {
return;
}
files = [];
- _ref = e.clipboardData.items;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
+ ref = e.clipboardData.items;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
if (!(item.kind === 'file')) {
continue;
}
@@ -7182,16 +7177,16 @@
});
},
handleFiles: function(files) {
- var file, i, _i, _len;
+ var file, i, k, len1;
if (this !== QR) {
- files = __slice.call(this.files);
+ files = slice.call(this.files);
this.value = null;
}
if (!files.length) {
return;
}
QR.cleanNotifications();
- for (i = _i = 0, _len = files.length; _i < _len; i = ++_i) {
+ for (i = k = 0, len1 = files.length; k < len1; i = ++k) {
file = files[i];
QR.handleFile(file, i, files.length);
}
@@ -7200,7 +7195,7 @@
}
},
handleFile: function(file, index, nfiles) {
- var isNewPost, isSingle, max, post, _ref;
+ var isNewPost, isSingle, max, post, ref;
isSingle = nfiles === 1;
if (/^text\//.test(file.type)) {
if (isSingle) {
@@ -7211,8 +7206,8 @@
post.pasteText(file);
return;
}
- if (_ref = file.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
- QR.error("" + file.name + ": Unsupported file type.");
+ if (ref = file.type, indexOf.call(QR.mimeTypes, ref) < 0) {
+ QR.error(file.name + ": Unsupported file type.");
if (!isSingle) {
return;
}
@@ -7222,7 +7217,7 @@
max = Math.min(max, QR.max_size_video);
}
if (file.size > max) {
- QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
+ QR.error(file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
if (!isSingle) {
return;
}
@@ -7254,11 +7249,11 @@
height = img.height, width = img.width;
pass = true;
if (height > QR.max_height || width > QR.max_width) {
- QR.error("" + file.name + ": Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
+ QR.error(file.name + ": Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
pass = false;
}
if (height < QR.min_height || width < QR.min_width) {
- QR.error("" + file.name + ": Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ QR.error(file.name + ": Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
pass = false;
}
return cb(pass, img);
@@ -7270,7 +7265,7 @@
} else if (/^video\//.test(file.type)) {
video = $.el('video');
$.on(video, 'loadeddata', function() {
- var duration, max_height, max_width, pass, videoHeight, videoWidth, _ref;
+ var duration, max_height, max_width, pass, ref, videoHeight, videoWidth;
if (!cb) {
return;
}
@@ -7279,34 +7274,34 @@
max_width = Math.min(QR.max_width, QR.max_width_video);
pass = true;
if (videoHeight > max_height || videoWidth > max_width) {
- QR.error("" + file.name + ": Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
+ QR.error(file.name + ": Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
pass = false;
}
if (videoHeight < QR.min_height || videoWidth < QR.min_width) {
- QR.error("" + file.name + ": Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ QR.error(file.name + ": Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
pass = false;
}
if (!isFinite(duration)) {
- QR.error("" + file.name + ": Video lacks duration metadata (try remuxing)");
+ QR.error(file.name + ": Video lacks duration metadata (try remuxing)");
pass = false;
} else if (duration > QR.max_duration_video) {
- QR.error("" + file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
+ QR.error(file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
pass = false;
}
- if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && $.hasAudio(video)) {
- QR.error("" + file.name + ": Audio not allowed");
+ if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg') && $.hasAudio(video)) {
+ QR.error(file.name + ": Audio not allowed");
pass = false;
}
cb(pass, video);
return cb = null;
});
$.on(video, 'error', function() {
- var _ref;
+ var ref;
if (!cb) {
return;
}
- if (_ref = file.type, __indexOf.call(QR.mimeTypes, _ref) >= 0) {
- QR.error("" + file.name + ": Video appears corrupt");
+ if (ref = file.type, indexOf.call(QR.mimeTypes, ref) >= 0) {
+ QR.error(file.name + ": Video appears corrupt");
}
URL.revokeObjectURL(file);
cb(false, null);
@@ -7318,7 +7313,7 @@
}
},
openFileInput: function(e) {
- var _ref;
+ var ref;
e.stopPropagation();
if (e.shiftKey && e.type === 'click') {
return QR.selected.rmFile();
@@ -7327,22 +7322,22 @@
$.addClass(QR.nodes.filename, 'edit');
QR.nodes.filename.focus();
}
- if (e.target.nodeName === 'INPUT' || (e.keyCode && ((_ref = e.keyCode) !== 32 && _ref !== 13)) || e.ctrlKey) {
+ if (e.target.nodeName === 'INPUT' || (e.keyCode && ((ref = e.keyCode) !== 32 && ref !== 13)) || e.ctrlKey) {
return;
}
e.preventDefault();
return QR.nodes.fileInput.click();
},
generatePostableThreadsList: function() {
- var list, options, thread, val, _i, _len, _ref;
+ var k, len1, list, options, ref, thread, val;
if (!QR.nodes) {
return;
}
list = QR.nodes.thread;
options = [list.firstElementChild];
- _ref = g.BOARD.threads.keys;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- thread = _ref[_i];
+ ref = g.BOARD.threads.keys;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ thread = ref[k];
options.push($.el('option', {
value: thread,
textContent: "Thread No." + thread
@@ -7359,10 +7354,10 @@
return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
},
dialog: function() {
- var dialog, event, i, items, m, match_max, match_min, name, node, nodes, rules, save, setNode, _ref;
+ var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, setNode;
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
- innerHTML: " "
+ innerHTML: " "
})
};
setNode = function(name, query) {
@@ -7392,6 +7387,7 @@
setNode('spoilerPar', '#qr-spoiler-label');
setNode('status', '[type=submit]');
setNode('fileInput', '[type=file]');
+ setNode('customCooldown', '#custom-cooldown-button');
rules = $('ul.rules').textContent.trim();
match_min = rules.match(/.+smaller than (\d+)x(\d+).+/);
match_max = rules.match(/.+greater than (\d+)x(\d+).+/);
@@ -7402,7 +7398,7 @@
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value;
QR.max_size_video = (m = Get.scriptData().match(/\bmaxWebmFilesize *= *(\d+)\b/)) ? +m[1] : +nodes.fileInput.max;
QR.max_width_video = QR.max_height_video = 2048;
- QR.max_duration_video = (_ref = g.BOARD.ID) === 'gif' || _ref === 'wsg' ? 300 : 120;
+ QR.max_duration_video = (ref = g.BOARD.ID) === 'gif' || ref === 'wsg' ? 300 : 120;
if (Conf['Show New Thread Option in Threads']) {
$.addClass(QR.nodes.el, 'show-new-thread-option');
}
@@ -7421,6 +7417,15 @@
} else {
nodes.spoiler.parentElement.hidden = true;
}
+ if (parseInt(Conf['customCooldown'], 10) > 0) {
+ $.addClass(QR.nodes.fileSubmit, 'custom-cooldown');
+ $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) {
+ var customCooldownEnabled;
+ customCooldownEnabled = arg.customCooldownEnabled;
+ QR.setCustomCooldown(customCooldownEnabled);
+ return $.sync('customCooldownEnabled', QR.setCustomCooldown);
+ });
+ }
if (g.BOARD.ID === 'f' && g.VIEW !== 'thread') {
nodes.flashTag = $.el('select', {
name: 'filetag'
@@ -7455,6 +7460,10 @@
return QR.selected.nodes.spoiler.click();
});
$.on(nodes.fileInput, 'change', QR.handleFiles);
+ $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);
+ window.addEventListener('focus', QR.focus, true);
+ window.addEventListener('blur', QR.focus, true);
+ $.on(d, 'click', QR.focus);
items = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
i = 0;
save = function() {
@@ -7581,7 +7590,7 @@
return QR.status();
},
onprogress: function(e) {
- QR.req.progress = "" + (Math.round(e.loaded / e.total * 100)) + "%";
+ QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%";
return QR.status();
}
}
@@ -7616,7 +7625,7 @@
return QR.status();
},
response: function() {
- var URL, ban, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, req, resDoc, threadID, _, _ref, _ref1;
+ var URL, _, ban, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, ref, ref1, req, resDoc, threadID;
req = QR.req;
delete QR.req;
post = QR.posts[0];
@@ -7629,8 +7638,8 @@
innerHTML: "You were issued a warning on " + $(".board", resDoc).innerHTML + " as " + $(".nameBlock", resDoc).innerHTML + ".
Reason: " + $(".reason", resDoc).innerHTML
});
} else if (err = resDoc.getElementById('errmsg')) {
- if ((_ref = $('a', err)) != null) {
- _ref.target = '_blank';
+ if ((ref = $('a', err)) != null) {
+ ref.target = '_blank';
}
} else if (resDoc.title !== 'Post successful!') {
err = 'Connection error with sys.4chan.org.';
@@ -7663,7 +7672,7 @@
QR.notifications.push(new Notice('success', h1.textContent, 5));
}
QR.persona.set(post);
- _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
+ ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref1[0], threadID = ref1[1], postID = ref1[2];
postID = +postID;
threadID = +threadID || postID;
isReply = threadID !== postID;
@@ -7709,7 +7718,7 @@
QR.captcha.setup(d.activeElement === QR.nodes.status);
}
QR.cooldown.add(req.uploadEndTime, threadID, postID);
- URL = threadID === postID ? "" + window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? "" + window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
+ URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
if (URL) {
if (Conf['Open Post in New Tab'] || postsCount) {
$.open(URL);
@@ -7765,7 +7774,7 @@
return _this.nodes.input.focus();
};
})(this));
- this.conn = new Connection(null, "" + location.protocol + "//www.google.com", {
+ this.conn = new Connection(null, location.protocol + "//www.google.com", {
challenge: this.load.bind(this),
token: this.save.bind(this),
error: this.error.bind(this)
@@ -7773,9 +7782,9 @@
$.addClass(QR.nodes.el, 'has-captcha');
$.after(QR.nodes.com.parentNode, [container, input]);
this.captchas = [];
- $.get('captchas', [], function(_arg) {
+ $.get('captchas', [], function(arg) {
var captchas;
- captchas = _arg.captchas;
+ captchas = arg.captchas;
QR.captcha.sync(captchas);
return QR.captcha.clear();
});
@@ -7784,16 +7793,16 @@
return this.setup();
},
initFrame: function() {
- var cb, conn, img, _ref, _ref1;
- conn = new Connection(window.top, "" + location.protocol + "//boards.4chan.org", {
+ var cb, conn, img, ref, ref1;
+ conn = new Connection(window.top, location.protocol + "//boards.4chan.org", {
response: function(response) {
$.id('response').value = response;
return $('.fbc-challenge > form').submit();
}
});
conn.send({
- token: (_ref = $('.fbc-verification-token > textarea')) != null ? _ref.value : void 0,
- error: (_ref1 = $('.fbc-error')) != null ? _ref1.textContent : void 0
+ token: (ref = $('.fbc-verification-token > textarea')) != null ? ref.value : void 0,
+ error: (ref1 = $('.fbc-error')) != null ? ref1.textContent : void 0
});
if (!(img = $('.fbc-payload > img'))) {
return;
@@ -7821,8 +7830,8 @@
}
},
beforeSetup: function() {
- var container, input, _ref;
- _ref = this.nodes, container = _ref.container, input = _ref.input;
+ var container, input, ref;
+ ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = true;
input.value = '';
input.placeholder = 'Focus to load reCAPTCHA';
@@ -7863,8 +7872,8 @@
}
},
afterSetup: function() {
- var container, input, _ref;
- _ref = this.nodes, container = _ref.container, input = _ref.input;
+ var container, input, ref;
+ ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = false;
input.placeholder = 'Verification';
this.count();
@@ -7967,15 +7976,15 @@
return $.rmClass(this.nodes.input, 'error');
},
clear: function() {
- var captcha, i, now, _i, _len, _ref;
+ var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
return;
}
$.forceSync('captchas');
now = Date.now();
- _ref = this.captchas;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- captcha = _ref[i];
+ ref = this.captchas;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ captcha = ref[i];
if (captcha.timeout > now) {
break;
}
@@ -7988,8 +7997,8 @@
return $.set('captchas', this.captchas);
},
load: function(src) {
- var container, img, input, _ref;
- _ref = this.nodes, container = _ref.container, input = _ref.input, img = _ref.img;
+ var container, img, input, ref;
+ ref = this.nodes, container = ref.container, input = ref.input, img = ref.img;
this.occupied = true;
this.timeout = Date.now() + this.lifetime;
if (!img) {
@@ -8036,17 +8045,17 @@
if (!this.nodes.iframe) {
return;
}
- if (this.needed() || d.activeElement === this.nodes.input) {
+ if (!d.hidden && (this.needed() || d.activeElement === this.nodes.input)) {
return this.reload();
} else {
return this.destroy();
}
},
reload: function() {
- var _ref;
+ var ref;
this.nodes.iframe.src = this.iframeURL;
this.occupied = true;
- return (_ref = this.nodes.img) != null ? _ref.hidden = true : void 0;
+ return (ref = this.nodes.img) != null ? ref.hidden = true : void 0;
},
keydown: function(e) {
if (e.keyCode === 8 && !this.nodes.input.value) {
@@ -8075,9 +8084,9 @@
return;
}
this.captchas = [];
- $.get('captchas', [], function(_arg) {
+ $.get('captchas', [], function(arg) {
var captchas;
- captchas = _arg.captchas;
+ captchas = arg.captchas;
return QR.captcha.sync(captchas);
});
$.sync('captchas', this.sync.bind(this));
@@ -8182,12 +8191,12 @@
return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: document.documentElement.classList.contains(\'tomorrow\') ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();');
},
afterSetup: function(mutations) {
- var iframe, mutation, node, textarea, _i, _j, _len, _len1, _ref;
- for (_i = 0, _len = mutations.length; _i < _len; _i++) {
- mutation = mutations[_i];
- _ref = mutation.addedNodes;
- for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
- node = _ref[_j];
+ var iframe, k, len1, len2, mutation, node, q, ref, textarea;
+ for (k = 0, len1 = mutations.length; k < len1; k++) {
+ mutation = mutations[k];
+ ref = mutation.addedNodes;
+ for (q = 0, len2 = ref.length; q < len2; q++) {
+ node = ref[q];
if (iframe = $.x('./descendant-or-self::iframe', node)) {
this.setupIFrame(iframe);
}
@@ -8246,7 +8255,7 @@
}
},
save: function(pasted) {
- var _base;
+ var base1;
$.forceSync('captchas');
this.captchas.push({
response: $('textarea', this.nodes.container).value,
@@ -8265,8 +8274,8 @@
if (pasted) {
this.destroy();
} else {
- if ((_base = this.timeouts).destroy == null) {
- _base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
+ if ((base1 = this.timeouts).destroy == null) {
+ base1.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
}
}
QR.nodes.status.focus();
@@ -8279,15 +8288,15 @@
return QR.notify(el);
},
clear: function() {
- var captcha, i, now, _i, _len, _ref;
+ var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
return;
}
$.forceSync('captchas');
now = Date.now();
- _ref = this.captchas;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- captcha = _ref[i];
+ ref = this.captchas;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ captcha = ref[i];
if (captcha.timeout > now) {
break;
}
@@ -8315,7 +8324,7 @@
QR.cooldown = {
seconds: 0,
init: function() {
- var delay, items, key, keys, m, scope, type, _ref, _results;
+ var delay, items, key, keys, m, ref, results, scope, type;
if (!Conf['Cooldown']) {
return;
}
@@ -8327,9 +8336,9 @@
image_intra: 0
};
QR.cooldown.maxDelay = 0;
- _ref = QR.cooldown.delays;
- for (type in _ref) {
- delay = _ref[type];
+ ref = QR.cooldown.delays;
+ for (type in ref) {
+ delay = ref[type];
if (type !== 'thread') {
QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay);
}
@@ -8351,12 +8360,12 @@
}
return QR.cooldown.start();
});
- _results = [];
+ results = [];
for (scope in keys) {
key = keys[scope];
- _results.push($.sync(key, QR.cooldown.sync(scope)));
+ results.push($.sync(key, QR.cooldown.sync(scope)));
}
- return _results;
+ return results;
},
start: function() {
if (QR.cooldown.isCounting || Object.keys(QR.cooldown.local).length + Object.keys(QR.cooldown.global).length === 0) {
@@ -8401,14 +8410,14 @@
return QR.cooldown.start();
},
"delete": function(post) {
- var cooldown, id, _ref;
+ var cooldown, id, ref;
if (!(Conf['Cooldown'] && g.BOARD.ID === post.board.ID)) {
return;
}
$.forceSync(QR.cooldown.keys.local);
- _ref = QR.cooldown.local;
- for (id in _ref) {
- cooldown = _ref[id];
+ ref = QR.cooldown.local;
+ for (id in ref) {
+ cooldown = ref[id];
if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
delete QR.cooldown.local[id];
}
@@ -8440,18 +8449,18 @@
}
},
count: function() {
- var cooldown, elapsed, key, maxDelay, now, save, scope, seconds, start, suffix, threadID, type, update, _ref, _ref1, _ref2;
+ var cooldown, elapsed, key, maxDelay, now, ref, ref1, ref2, save, scope, seconds, start, suffix, threadID, type, update;
now = Date.now();
- _ref = QR.cooldown.categorize(QR.posts[0]), type = _ref.type, threadID = _ref.threadID;
+ ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID;
seconds = 0;
- _ref1 = QR.cooldown.keys;
- for (scope in _ref1) {
- key = _ref1[scope];
+ ref1 = QR.cooldown.keys;
+ for (scope in ref1) {
+ key = ref1[scope];
$.forceSync(key);
save = false;
- _ref2 = QR.cooldown[scope];
- for (start in _ref2) {
- cooldown = _ref2[start];
+ ref2 = QR.cooldown[scope];
+ for (start in ref2) {
+ cooldown = ref2[start];
start = +start;
elapsed = Math.floor((now - start) / $.SECOND);
if (elapsed < 0) {
@@ -8469,6 +8478,9 @@
continue;
}
maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread'];
+ if (QR.cooldown.customCooldown) {
+ maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10));
+ }
if (maxDelay <= elapsed) {
delete QR.cooldown[scope][start];
save = true;
@@ -8478,6 +8490,9 @@
suffix = scope === 'global' ? '_global' : type !== 'thread' && threadID === cooldown.threadID ? '_intra' : '';
seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed);
}
+ if (QR.cooldown.customCooldown) {
+ seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed);
+ }
}
if (save) {
QR.cooldown.save(scope);
@@ -8505,17 +8520,17 @@
always: {},
init: function() {
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'];
+ return $.get('QR.personas', Conf['QR.personas'], function(arg) {
+ var arr, item, k, len1, personas, ref, type, types;
+ personas = arg['QR.personas'];
types = {
name: [],
email: [],
sub: []
};
- _ref = personas.split('\n');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
+ ref = personas.split('\n');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
QR.persona.parseItem(item.trim(), types);
}
for (type in types) {
@@ -8525,17 +8540,17 @@
});
},
parseItem: function(item, types) {
- var boards, match, type, val, _ref, _ref1, _ref2;
+ var boards, match, ref, ref1, ref2, type, val;
if (item[0] === '#') {
return;
}
if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) {
return;
}
- _ref = match, match = _ref[0], type = _ref[1], val = _ref[2];
+ ref = match, match = ref[0], type = ref[1], val = ref[2];
item = item.replace(match, '');
- boards = ((_ref1 = item.match(/boards:([^;]+)/i)) != null ? _ref1[1].toLowerCase() : void 0) || 'global';
- if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) {
+ boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global';
+ if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) {
return;
}
if (type === 'password') {
@@ -8551,15 +8566,15 @@
if (/always/i.test(item)) {
QR.persona.always[type] = val;
}
- if (__indexOf.call(types[type], val) < 0) {
+ if (indexOf.call(types[type], val) < 0) {
return types[type].push(val);
}
},
loadPersonas: function(type, arr) {
- var list, val, _i, _len;
+ var k, len1, list, val;
list = $("#list-" + type, QR.nodes.el);
- for (_i = 0, _len = arr.length; _i < _len; _i++) {
- val = arr[_i];
+ for (k = 0, len1 = arr.length; k < len1; k++) {
+ val = arr[k];
if (val) {
$.add(list, $.el('option', {
textContent: val
@@ -8568,23 +8583,23 @@
}
},
getPassword: function() {
- var input, m, _ref;
+ var input, m, ref;
if (!QR.persona.pwd) {
- QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : ((_ref = $.id('delPassword')) != null ? _ref.value : void 0) || '';
+ QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : ((ref = $.id('delPassword')) != null ? ref.value : void 0) || '';
}
return QR.persona.pwd;
},
get: function(cb) {
- return $.get('QR.persona', {}, function(_arg) {
+ return $.get('QR.persona', {}, function(arg) {
var persona;
- persona = _arg['QR.persona'];
+ persona = arg['QR.persona'];
return cb(persona);
});
},
set: function(post) {
- return $.get('QR.persona', {}, function(_arg) {
+ return $.get('QR.persona', {}, function(arg) {
var persona;
- persona = _arg['QR.persona'];
+ persona = arg['QR.persona'];
persona = {
name: post.name,
email: /^sage$/.test(post.email) ? persona.email : post.email
@@ -8596,8 +8611,8 @@
QR.post = (function() {
function _Class(select) {
- this.select = __bind(this.select, this);
- var el, event, prev, _i, _len, _ref;
+ this.select = bind(this.select, this);
+ var el, event, k, len1, prev, ref;
el = $.el('a', {
className: 'qr-preview',
draggable: true,
@@ -8632,9 +8647,9 @@
};
})(this));
$.add(QR.nodes.dumpList, el);
- _ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- event = _ref[_i];
+ ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
$.on(el, event.toLowerCase(), this[event]);
}
this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
@@ -8680,7 +8695,7 @@
};
_Class.prototype.lock = function(lock) {
- var name, node, _i, _len, _ref;
+ var k, len1, name, node, ref;
if (lock == null) {
lock = true;
}
@@ -8688,9 +8703,9 @@
if (this !== QR.selected) {
return;
}
- _ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
if (node = QR.nodes[name]) {
node.disabled = lock;
}
@@ -8721,10 +8736,10 @@
};
_Class.prototype.load = function() {
- var name, node, _i, _len, _ref;
- _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ var k, len1, name, node, ref;
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
if (!(node = QR.nodes[name])) {
continue;
}
@@ -8736,7 +8751,7 @@
};
_Class.prototype.save = function(input) {
- var name, _ref;
+ var name, ref;
if (input.type === 'checkbox') {
this.spoiler = input.checked;
return;
@@ -8751,7 +8766,7 @@
this.nodes.span.textContent = this.com;
QR.captcha.onPostChange();
QR.characterCount();
- if (QR.cooldown.auto && this === QR.posts[0] && (0 < (_ref = QR.cooldown.seconds) && _ref <= 5)) {
+ if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
return QR.cooldown.auto = false;
}
break;
@@ -8759,7 +8774,7 @@
if (!this.file) {
return;
}
- this.file.newName = this.filename.replace(/[/\\]/g, '-');
+ this.file.newName = this.filename.replace(/[\/\\]/g, '-');
if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) {
this.file.newName += '.jpg';
}
@@ -8768,13 +8783,13 @@
};
_Class.prototype.forceSave = function() {
- var name, node, _i, _len, _ref;
+ var k, len1, name, node, ref;
if (this !== QR.selected) {
return;
}
- _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
if (!(node = QR.nodes[name])) {
continue;
}
@@ -8782,10 +8797,10 @@
}
};
- _Class.prototype.setFile = function(file, el) {
- this.file = file;
- this.filename = file.name;
- this.filesize = $.bytesToString(file.size);
+ _Class.prototype.setFile = function(file1, el) {
+ this.file = file1;
+ this.filename = this.file.name;
+ this.filesize = $.bytesToString(this.file.size);
if (QR.spoiler) {
this.nodes.label.hidden = false;
}
@@ -8860,7 +8875,7 @@
_Class.prototype.updateFilename = function() {
var long;
- long = "" + this.filename + " (" + this.filesize + ")\nCtrl/\u2318+click to edit filename. Shift+click to clear.";
+ long = this.filename + " (" + this.filesize + ")\nCtrl/\u2318+click to edit filename. Shift+click to clear.";
this.nodes.el.title = long;
if (this !== QR.selected) {
return;
@@ -8930,7 +8945,7 @@
}
el = $('.drag', this.parentNode);
index = function(el) {
- return __slice.call(el.parentNode.children).indexOf(el);
+ return slice.call(el.parentNode.children).indexOf(el);
};
oldIndex = index(el);
newIndex = index(this);
@@ -8946,8 +8961,8 @@
FappeTyme = {
init: function() {
- var el, lc, type, _i, _len, _ref, _ref1;
- if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var el, k, lc, len1, ref, ref1, type;
+ if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
this.nodes = {};
@@ -8955,15 +8970,15 @@
fappe: false,
werk: Conf['werk']
};
- _ref1 = ["Fappe", "Werk"];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- type = _ref1[_i];
- if (!Conf["" + type + " Tyme"]) {
+ ref1 = ["Fappe", "Werk"];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ type = ref1[k];
+ if (!Conf[type + " Tyme"]) {
continue;
}
lc = type.toLowerCase();
- el = UI.checkbox(lc, "" + type + " Tyme", false);
- el.title = "" + type + " Tyme";
+ el = UI.checkbox(lc, type + " Tyme", false);
+ el.title = type + " Tyme";
this.nodes[lc] = el.firstElementChild;
if (Conf[lc]) {
this.set(lc, true);
@@ -9006,7 +9021,7 @@
},
set: function(type, enabled) {
this.enabled[type] = this.nodes[type].checked = enabled;
- return $["" + (enabled ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme");
+ return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme");
},
toggle: function(type) {
this.set(type, !this.enabled[type]);
@@ -9018,8 +9033,8 @@
Gallery = {
init: function() {
- var el, _ref;
- if (!(this.enabled = Conf['Gallery'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var el, ref;
+ if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
this.delay = Conf['Slide Delay'];
@@ -9050,7 +9065,7 @@
}
},
build: function(image) {
- var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, thumb, value, _i, _j, _len, _len1, _ref, _ref1, _ref2;
+ var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, thumb, value;
if (Conf['Fullscreen Gallery']) {
$.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
@@ -9072,7 +9087,7 @@
$.extend(dialog, {
innerHTML: ""
});
- _ref = {
+ ref = {
buttons: '.gal-buttons',
frame: '.gal-image',
name: '.gal-name',
@@ -9082,8 +9097,8 @@
next: '.gal-image a',
current: '.gal-image img'
};
- for (key in _ref) {
- value = _ref[key];
+ for (key in ref) {
+ value = ref[key];
nodes[key] = $(value, dialog);
}
menuButton = $('.menu-button', dialog);
@@ -9103,9 +9118,9 @@
$.on(menuButton, 'click', function(e) {
return nodes.menu.toggle(e, this, g);
});
- _ref1 = Gallery.menu.createSubEntries();
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- entry = _ref1[_i];
+ ref1 = Gallery.menu.createSubEntries();
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ entry = ref1[k];
entry.order = 0;
nodes.menu.addEntry(entry);
}
@@ -9113,9 +9128,9 @@
if (Conf['Keybinds']) {
$.off(d, 'keydown', Keybinds.keydown);
}
- _ref2 = $$('.post .file');
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- file = _ref2[_j];
+ ref2 = $$('.post .file');
+ for (q = 0, len2 = ref2.length; q < len2; q++) {
+ file = ref2[q];
post = Get.postFromNode(file);
if (!post.file) {
continue;
@@ -9170,7 +9185,7 @@
return $.add(Gallery.nodes.thumbs, thumb);
},
open: function(thumb) {
- var el, elType, file, name, newID, nodes, oldID, post, slideshow, _ref;
+ var el, elType, file, name, newID, nodes, oldID, post, ref, slideshow;
nodes = Gallery.nodes;
name = nodes.name;
oldID = +nodes.current.dataset.id;
@@ -9210,14 +9225,14 @@
} else {
Gallery.cb.stop();
}
- if (Conf['Scroll to Post'] && (post = (_ref = (post = g.posts[file.dataset.post])) != null ? _ref.nodes.root : void 0)) {
+ if (Conf['Scroll to Post'] && (post = (ref = (post = g.posts[file.dataset.post])) != null ? ref.nodes.root : void 0)) {
Header.scrollTo(post);
}
return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
},
error: function() {
- var _ref;
- if (((_ref = this.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
+ var ref;
+ if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
return new Notice('error', 'Corrupt or unplayable video', 30);
}
if (this.src.split('/')[2] !== 'i.4cdn.org') {
@@ -9432,14 +9447,14 @@
createSubEntries: function() {
var delayInput, delayLabel, item, subEntries;
subEntries = (function() {
- var _i, _len, _ref, _results;
- _ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Scroll to Post'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
- _results.push(Gallery.menu.createSubEntry(item));
+ var k, len1, ref, results;
+ ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Scroll to Post'];
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
+ results.push(Gallery.menu.createSubEntry(item));
}
- return _results;
+ return results;
})();
delayLabel = $.el('label', {
innerHTML: "Slide Delay: "
@@ -9493,8 +9508,8 @@
}
},
decodeError: function(file, post) {
- var message, _ref;
- if (((_ref = file.error) != null ? _ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
+ var message, ref;
+ if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
return false;
}
if (!(message = $('.warning', post.file.thumb.parentNode))) {
@@ -9537,16 +9552,16 @@
};
return $.ajax("//a.4cdn.org/" + post.board + "/thread/" + post.thread + ".json", {
onload: function() {
- var postObj, _i, _len, _ref;
+ var k, len1, postObj, ref;
if (this.status === 404) {
post.kill();
}
if (this.status !== 200) {
return redirect();
}
- _ref = this.response.posts;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- postObj = _ref[_i];
+ ref = this.response.posts;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ postObj = ref[k];
if (postObj.no === post.ID) {
break;
}
@@ -9600,8 +9615,8 @@
ImageExpand = {
init: function() {
- var _ref;
- if (!(this.enabled = Conf['Image Expansion'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var ref;
+ if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
this.EAI = $.el('a', {
@@ -9625,7 +9640,7 @@
});
},
node: function() {
- var _ref;
+ var ref;
if (!(this.file && (this.file.isImage || this.file.isVideo))) {
return;
}
@@ -9637,7 +9652,7 @@
} else if (this.file.isExpanded && this.file.isVideo) {
Volume.setup(this.file.fullImage);
ImageExpand.setupVideoCB(this);
- return ImageExpand.setupVideo(this, !((_ref = this.origin.file.fullImage) != null ? _ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
+ return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
}
} else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) {
return ImageExpand.expand(this);
@@ -9645,7 +9660,7 @@
},
cb: {
toggle: function(e) {
- var file, post, _ref;
+ var file, post, ref;
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -9655,7 +9670,7 @@
return;
}
e.preventDefault();
- if ((_ref = file.fullImage) != null ? _ref.paused : void 0) {
+ if ((ref = file.fullImage) != null ? ref.paused : void 0) {
return file.fullImage.play();
} else {
return ImageExpand.toggle(post);
@@ -9685,20 +9700,20 @@
func = ImageExpand.contract;
}
return g.posts.forEach(function(post) {
- var _i, _len, _ref;
- _ref = [post].concat(__slice.call(post.clones));
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ var k, len1, ref;
+ ref = [post].concat(slice.call(post.clones));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
toggle(post);
}
});
},
playVideos: function() {
return g.posts.forEach(function(post) {
- var file, video, visible, _i, _len, _ref;
- _ref = [post].concat(__slice.call(post.clones));
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ var file, k, len1, ref, video, visible;
+ ref = [post].concat(slice.call(post.clones));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
file = post.file;
if (!(file && file.isVideo && file.isExpanded)) {
continue;
@@ -9740,7 +9755,7 @@
}
},
contract: function(post) {
- var bottom, cb, el, eventName, file, oldHeight, scrollY, top, x, _i, _len, _ref, _ref1;
+ var bottom, cb, el, eventName, file, k, len1, oldHeight, ref, ref1, scrollY, top, x;
file = post.file;
if (el = file.fullImage) {
top = Header.getTopOf(el);
@@ -9755,9 +9770,9 @@
}
file.thumb.parentNode.href = file.URL;
file.thumb.parentNode.target = '_blank';
- _ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- x = _ref[_i];
+ ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ x = ref[k];
delete file[x];
}
if (!el) {
@@ -9777,9 +9792,9 @@
ImageCommon.pushCache(el);
if (file.isVideo) {
ImageCommon.pause(el);
- _ref1 = ImageExpand.videoCB;
- for (eventName in _ref1) {
- cb = _ref1[eventName];
+ ref1 = ImageExpand.videoCB;
+ for (eventName in ref1) {
+ cb = ref1[eventName];
$.off(el, eventName, cb);
}
}
@@ -9799,7 +9814,7 @@
});
},
expand: function(post, src) {
- var el, file, isVideo, thumb, _ref;
+ var el, file, isVideo, ref, thumb;
file = post.file;
thumb = file.thumb, isVideo = file.isVideo;
if (post.isHidden || file.isExpanding || file.isExpanded) {
@@ -9809,7 +9824,7 @@
file.isExpanding = true;
if (file.fullImage) {
el = file.fullImage;
- } else if (((_ref = ImageCommon.cache) != null ? _ref.dataset.fullID : void 0) === post.fullID) {
+ } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
el = file.fullImage = ImageCommon.popCache();
$.on(el, 'error', ImageExpand.error);
if (Conf['Restart when Opened'] && el.id !== 'ihover') {
@@ -9922,10 +9937,10 @@
};
})(),
setupVideoCB: function(post) {
- var cb, eventName, _ref;
- _ref = ImageExpand.videoCB;
- for (eventName in _ref) {
- cb = _ref[eventName];
+ var cb, eventName, ref;
+ ref = ImageExpand.videoCB;
+ for (eventName in ref) {
+ cb = ref[eventName];
$.on(post.file.fullImage, eventName, cb);
}
if (post.file.videoControls) {
@@ -9959,7 +9974,7 @@
},
menu: {
init: function() {
- var conf, createSubEntry, el, name, subEntries, _ref;
+ var conf, createSubEntry, el, name, ref, subEntries;
if (!ImageExpand.enabled) {
return;
}
@@ -9969,9 +9984,9 @@
});
createSubEntry = ImageExpand.menu.createSubEntry;
subEntries = [];
- _ref = Config.imageExpansion;
- for (name in _ref) {
- conf = _ref[name];
+ ref = Config.imageExpansion;
+ for (name in ref) {
+ conf = ref[name];
subEntries.push(createSubEntry(name, conf[1]));
}
return Header.menu.addEntry({
@@ -9999,8 +10014,8 @@
ImageHover = {
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
if (Conf['Image Hover']) {
@@ -10032,7 +10047,7 @@
},
mouseover: function(post) {
return function(e) {
- var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, right, scale, width, x, _ref, _ref1, _ref2;
+ var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, ref, ref1, ref2, right, scale, width, x;
if (!doc.contains(this)) {
return;
}
@@ -10042,7 +10057,7 @@
return;
}
error = ImageHover.error(post);
- if (((_ref = ImageCommon.cache) != null ? _ref.dataset.fullID : void 0) === post.fullID) {
+ if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
el = ImageCommon.popCache();
$.on(el, 'error', error);
} else {
@@ -10065,23 +10080,23 @@
el.play();
}
}
- _ref1 = (function() {
- var _i, _len, _ref1, _results;
- _ref1 = file.dimensions.split('x');
- _results = [];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- x = _ref1[_i];
- _results.push(+x);
+ ref1 = (function() {
+ var k, len1, ref1, results;
+ ref1 = file.dimensions.split('x');
+ results = [];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ x = ref1[k];
+ results.push(+x);
}
- return _results;
- })(), width = _ref1[0], height = _ref1[1];
- _ref2 = this.getBoundingClientRect(), left = _ref2.left, right = _ref2.right;
+ return results;
+ })(), width = ref1[0], height = ref1[1];
+ ref2 = this.getBoundingClientRect(), left = ref2.left, right = ref2.right;
padding = 16;
maxWidth = Math.max(left, doc.clientWidth - right);
maxHeight = doc.clientHeight - padding;
scale = Math.min(1, maxWidth / width, maxHeight / height);
- el.style.maxWidth = "" + (scale * width) + "px";
- el.style.maxHeight = "" + (scale * height) + "px";
+ el.style.maxWidth = (scale * width) + "px";
+ el.style.maxHeight = (scale * height) + "px";
return UI.hover({
root: this,
el: el,
@@ -10122,8 +10137,8 @@
ImageLoader = {
init: function() {
- var prefetch, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var prefetch, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
@@ -10162,7 +10177,7 @@
return ImageLoader.prefetch(this);
},
replaceVideo: function(post) {
- var attr, file, thumb, video, _i, _len, _ref;
+ var attr, file, k, len1, ref, thumb, video;
file = post.file;
thumb = file.thumb;
video = $.el('video', {
@@ -10175,9 +10190,9 @@
});
video.setAttribute('muted', 'muted');
video.dataset.md5 = thumb.dataset.md5;
- _ref = ['height', 'width', 'maxHeight', 'maxWidth'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- attr = _ref[_i];
+ ref = ['height', 'width', 'maxHeight', 'maxWidth'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ attr = ref[k];
video.style[attr] = thumb.style[attr];
}
video.src = file.URL;
@@ -10186,7 +10201,7 @@
return file.videoThumb = true;
},
prefetch: function(post) {
- var URL, clone, el, file, isImage, isVideo, match, replace, thumb, type, _i, _len, _ref;
+ var URL, clone, el, file, isImage, isVideo, k, len1, match, ref, replace, thumb, type;
file = post.file;
if (!file) {
return;
@@ -10200,16 +10215,16 @@
if (!(replace || Conf['prefetch'])) {
return;
}
- if (![post].concat(__slice.call(post.clones)).some(function(clone) {
+ if (![post].concat(slice.call(post.clones)).some(function(clone) {
return doc.contains(clone.nodes.root);
})) {
return;
}
file.isPrefetched = true;
if (file.videoThumb) {
- _ref = post.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = post.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.file.thumb.preload = 'auto';
}
thumb.preload = 'auto';
@@ -10223,10 +10238,10 @@
el = $.el(isImage ? 'img' : 'video');
if (replace && isImage) {
$.on(el, 'load', function() {
- var _j, _len1, _ref1;
- _ref1 = post.clones;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- clone = _ref1[_j];
+ var len2, q, ref1;
+ ref1 = post.clones;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ clone = ref1[q];
clone.file.thumb.src = URL;
}
return thumb.src = URL;
@@ -10240,14 +10255,14 @@
}
},
playVideos: function() {
- var qpClone, _ref;
- qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
+ var qpClone, ref;
+ qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0;
return g.posts.forEach(function(post) {
- var thumb, _i, _len, _ref1, _ref2;
- _ref1 = [post].concat(__slice.call(post.clones));
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- post = _ref1[_i];
- if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) {
+ var k, len1, ref1, ref2, thumb;
+ ref1 = [post].concat(slice.call(post.clones));
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ post = ref1[k];
+ if (!((ref2 = post.file) != null ? ref2.videoThumb : void 0)) {
continue;
}
thumb = post.file.thumb;
@@ -10263,8 +10278,8 @@
Metadata = {
init: function() {
- var _ref;
- if (!(Conf['WEBM Metadata'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var ref;
+ if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
return Post.callbacks.push({
@@ -10357,8 +10372,8 @@
RevealSpoilers = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
return;
}
return Post.callbacks.push({
@@ -10367,8 +10382,8 @@
});
},
node: function() {
- var thumb, _ref;
- if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) {
+ var ref, thumb;
+ if (this.isClone || !((ref = this.file) != null ? ref.isSpoiler : void 0)) {
return;
}
thumb = this.file.thumb;
@@ -10380,14 +10395,14 @@
Sauce = {
init: function() {
- var err, link, links, _i, _len, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Sauce'])) {
+ var err, k, len1, link, links, ref, ref1;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
return;
}
links = [];
- _ref1 = Conf['sauces'].split('\n');
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- link = _ref1[_i];
+ ref1 = Conf['sauces'].split('\n');
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ link = ref1[k];
try {
if (link[0] !== '#') {
links.push(link.trim());
@@ -10409,11 +10424,11 @@
});
},
createSauceLink: function(link, post) {
- var a, ext, i, key, m, part, parts, _i, _len, _ref, _ref1, _ref2, _ref3;
+ var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, ref3;
parts = {};
- _ref = link.split(/;(?=(?:text|boards|types):)/);
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- part = _ref[i];
+ ref = link.split(/;(?=(?:text|boards|types):)/);
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ part = ref[i];
if (i === 0) {
parts['url'] = part;
} else {
@@ -10421,7 +10436,7 @@
parts[m[1]] = m[2];
}
}
- parts['text'] || (parts['text'] = ((_ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? _ref1[1] : void 0) || '?');
+ parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
for (key in parts) {
parts[key] = parts[key].replace(/%(T?URL|MD5|board|name|%|semi)/g, function(parameter) {
var type;
@@ -10443,11 +10458,11 @@
return type;
});
}
- ext = ((_ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? _ref2[1] : void 0) || '';
- if (!(!parts['boards'] || (_ref3 = post.board.ID, __indexOf.call(parts['boards'].split(','), _ref3) >= 0))) {
+ ext = ((ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? ref2[1] : void 0) || '';
+ if (!(!parts['boards'] || (ref3 = post.board.ID, indexOf.call(parts['boards'].split(','), ref3) >= 0))) {
return null;
}
- if (!(!parts['types'] || __indexOf.call(parts['types'].split(','), ext) >= 0)) {
+ if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
return null;
}
a = Sauce.link.cloneNode(true);
@@ -10459,14 +10474,14 @@
return a;
},
node: function() {
- var link, node, nodes, _i, _len, _ref;
+ var k, len1, link, node, nodes, ref;
if (this.isClone || !this.file) {
return;
}
nodes = [];
- _ref = Sauce.links;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- link = _ref[_i];
+ ref = Sauce.links;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
if (node = Sauce.createSauceLink(link, this)) {
nodes.push($.tn('\u00A0'), node);
}
@@ -10477,19 +10492,19 @@
Volume = {
init: function() {
- var unmuteEntry, volumeEntry, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
+ var ref, ref1, unmuteEntry, volumeEntry;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
return;
}
$.sync('Allow Sound', function(x) {
- var _ref1;
+ var ref1;
Conf['Allow Sound'] = x;
- return (_ref1 = Volume.inputs) != null ? _ref1.unmute.checked = x : void 0;
+ return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0;
});
$.sync('Default Volume', function(x) {
- var _ref1;
+ var ref1;
Conf['Default Volume'] = x;
- return (_ref1 = Volume.inputs) != null ? _ref1.volume.value = x : void 0;
+ return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0;
});
if (Conf['Mouse Wheel Volume']) {
Post.callbacks.push({
@@ -10497,7 +10512,7 @@
cb: this.node
});
}
- if ((_ref1 = g.BOARD.ID) !== 'gif' && _ref1 !== 'wsg') {
+ if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg') {
return;
}
if (Conf['Mouse Wheel Volume']) {
@@ -10555,8 +10570,8 @@
}
},
node: function() {
- var _ref, _ref1;
- if (!(((_ref = this.board.ID) === 'gif' || _ref === 'wsg') && ((_ref1 = this.file) != null ? _ref1.isVideo : void 0))) {
+ var ref, ref1;
+ if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) {
return;
}
$.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover));
@@ -10592,14 +10607,14 @@
Embedding = {
init: function() {
- var type, _i, _len, _ref;
+ var k, len1, ref, type;
if (!(Conf['Embedding'] || Conf['Link Title'])) {
return;
}
this.types = {};
- _ref = this.ordered_types;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
+ ref = this.ordered_types;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
this.types[type.key] = type;
}
if (Conf['Floating Embeds']) {
@@ -10611,11 +10626,11 @@
}
if (Conf['Link Title']) {
return $.on(d, '4chanXInitFinished PostsInserted', function() {
- var key, service, _ref1, _ref2;
- _ref1 = Embedding.types;
- for (key in _ref1) {
- service = _ref1[key];
- if ((_ref2 = service.title) != null ? _ref2.batchSize : void 0) {
+ var key, ref1, ref2, service;
+ ref1 = Embedding.types;
+ for (key in ref1) {
+ service = ref1[key];
+ if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
Embedding.flushTitles(service.title);
}
}
@@ -10655,11 +10670,11 @@
}
},
services: function(link) {
- var href, match, type, _i, _len, _ref;
+ var href, k, len1, match, ref, type;
href = link.href;
- _ref = Embedding.ordered_types;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
+ ref = Embedding.ordered_types;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
if (!(match = type.regExp.exec(href))) {
continue;
}
@@ -10675,7 +10690,7 @@
}
},
embed: function(data) {
- var embed, href, key, link, name, options, post, uid, value, _ref;
+ var embed, href, key, link, name, options, post, ref, uid, value;
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
href = link.href;
$.addClass(link, key.toLowerCase());
@@ -10683,7 +10698,7 @@
embed = $.el('a', {
href: "http://boards.4chan.org/" + post.board + "/thread/" + post.thread + "#p" + post,
textContent: '(HTTP)',
- title: "" + key + " does not support HTTPS."
+ title: key + " does not support HTTPS."
});
$.after(link, [$.tn(' '), embed]);
return;
@@ -10693,14 +10708,14 @@
href: 'javascript:;',
textContent: '(embed)'
});
- _ref = {
+ ref = {
key: key,
uid: uid,
options: options,
href: href
};
- for (name in _ref) {
- value = _ref[name];
+ for (name in ref) {
+ value = ref[name];
embed.dataset[name] = value;
}
$.on(embed, 'click', Embedding.cb.toggle);
@@ -10766,32 +10781,32 @@
}
},
flushTitles: function(service) {
- var cb, data, queue, _i, _len;
+ var cb, data, k, len1, queue;
queue = service.queue;
if (!(queue != null ? queue.length : void 0)) {
return;
}
service.queue = [];
cb = function() {
- var data, _i, _len;
- for (_i = 0, _len = queue.length; _i < _len; _i++) {
- data = queue[_i];
+ var data, k, len1;
+ for (k = 0, len1 = queue.length; k < len1; k++) {
+ data = queue[k];
Embedding.cb.title(this, data);
}
};
if (!$.cache(service.api((function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = queue.length; _i < _len; _i++) {
- data = queue[_i];
- _results.push(data.uid);
+ var k, len1, results;
+ results = [];
+ for (k = 0, len1 = queue.length; k < len1; k++) {
+ data = queue[k];
+ results.push(data.uid);
}
- return _results;
+ return results;
})()), cb, {
responseType: 'json'
})) {
- for (_i = 0, _len = queue.length; _i < _len; _i++) {
- data = queue[_i];
+ for (k = 0, len1 = queue.length; k < len1; k++) {
+ data = queue[k];
$.extend(data.link, {
innerHTML: "[" + E(data.key) + "] Title Link Blocked (are you using NoScript?)"
});
@@ -10830,7 +10845,7 @@
return container;
},
title: function(req, data) {
- var key, link, link2, options, post, post2, service, status, text, uid, _base, _i, _j, _len, _len1, _ref, _ref1;
+ var base1, k, key, len1, len2, link, link2, options, post, post2, q, ref, ref1, service, status, text, uid;
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
status = req.status;
service = Embedding.types[key].title;
@@ -10844,22 +10859,22 @@
case 403:
return "Forbidden or Private";
default:
- return "" + status + "'d";
+ return status + "'d";
}
})());
link.dataset.original = link.textContent;
link.textContent = text;
- _ref = post.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post2 = _ref[_i];
- _ref1 = $$('a.linkify', post2.nodes.comment);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- link2 = _ref1[_j];
+ ref = post.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post2 = ref[k];
+ ref1 = $$('a.linkify', post2.nodes.comment);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ link2 = ref1[q];
if (!(link2.href === link.href)) {
continue;
}
- if ((_base = link2.dataset).original == null) {
- _base.original = link2.textContent;
+ if ((base1 = link2.dataset).original == null) {
+ base1.original = link2.textContent;
}
link2.textContent = text;
}
@@ -10895,9 +10910,9 @@
api: function(uid) {
return "https://api.github.com/gists/" + uid;
},
- text: function(_arg) {
+ text: function(arg) {
var file, files;
- files = _arg.files;
+ files = arg.files;
for (file in files) {
if (files.hasOwnProperty(file)) {
return file;
@@ -10954,7 +10969,7 @@
el = $.el('div');
$.queueTask(function() {
return $.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
- var embed, ext, file, files, i, status, type, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
+ var embed, ext, file, files, i, k, len1, len2, len3, q, ref, ref1, status, type, u;
if (!doc.contains(el)) {
return;
}
@@ -10963,11 +10978,11 @@
return el.textContent = "ERROR " + status;
}
files = this.response.files;
- _ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
- for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
- file = files[_j];
+ ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
+ for (q = 0, len2 = files.length; q < len2; q++) {
+ file = files[q];
if (file.type === type) {
embed = file;
break;
@@ -10987,9 +11002,9 @@
$.extend(el, {
innerHTML: ""
});
- _ref1 = ['mp4', 'webm'];
- for (i = _k = 0, _len2 = _ref1.length; _k < _len2; i = ++_k) {
- ext = _ref1[i];
+ ref1 = ['mp4', 'webm'];
+ for (i = u = 0, len3 = ref1.length; u < len3; i = ++u) {
+ ext = ref1[i];
el.firstChild.children[i].src = "https://mediacru.sh/" + a.dataset.uid + "." + ext;
}
break;
@@ -11066,7 +11081,7 @@
httpOnly: true,
style: "border: none; width: 640px; height: 360px;",
el: function(a) {
- var channel, id, idparam, obj, result, type, _;
+ var _, channel, id, idparam, obj, result, type;
if (result = /(\w+)\/([bc])\/(\d+)/i.exec(a.dataset.uid)) {
_ = result[0], channel = result[1], type = result[2], id = result[3];
idparam = {
@@ -11157,10 +11172,10 @@
return "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + ids + "&fields=items%28id%2Csnippet%28title%29%29&key=" + key;
},
text: function(data, uid) {
- var item, _i, _len, _ref;
- _ref = data.items;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
+ var item, k, len1, ref;
+ ref = data.items;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
if (item.id === uid) {
return item.snippet.title;
}
@@ -11173,19 +11188,19 @@
regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/((?:pf|kd|lv|mc|gd|gh|db|nn)\/[\w\-]+(,[\w\-]+)*|fc\/\w+\/\d+)/,
style: 'max-width: 80vw; max-height: 80vh;',
el: function(a) {
- var base, el, host, name, names, type, types, url, _, _i, _j, _len, _len1, _ref, _ref1;
+ var _, base, el, host, k, len1, len2, name, names, q, ref, ref1, type, types, url;
el = $.el('video', {
controls: true,
preload: 'auto',
loop: true
});
- _ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = _ref[0], host = _ref[1], names = _ref[2];
+ ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
types = host === 'gd' || host === 'fc' ? [''] : ['.webm', '.mp4'];
- _ref1 = names.split(',');
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- name = _ref1[_i];
- for (_j = 0, _len1 = types.length; _j < _len1; _j++) {
- type = types[_j];
+ ref1 = names.split(',');
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ name = ref1[k];
+ for (q = 0, len2 = types.length; q < len2; q++) {
+ type = types[q];
base = "" + name + type;
url = (function() {
switch (host) {
@@ -11252,8 +11267,8 @@
Linkify = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Linkify']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Linkify']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -11270,7 +11285,7 @@
return Embedding.init();
},
node: function() {
- var link, links, _i, _len;
+ var k, len1, link, links;
if (this.isClone) {
return Embedding.events(this);
}
@@ -11278,8 +11293,8 @@
return;
}
links = Linkify.process(this.nodes.comment);
- for (_i = 0, _len = links.length; _i < _len; _i++) {
- link = links[_i];
+ for (k = 0, len1 = links.length; k < len1; k++) {
+ link = links[k];
Embedding.process(link, this);
}
},
@@ -11393,8 +11408,8 @@
ArchiveLink = {
init: function() {
- var div, entry, type, _i, _len, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
+ var div, entry, k, len1, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
return;
}
div = $.el('div', {
@@ -11403,9 +11418,9 @@
entry = {
el: div,
order: 90,
- open: function(_arg) {
+ open: function(arg) {
var ID, board, thread;
- ID = _arg.ID, thread = _arg.thread, board = _arg.board;
+ ID = arg.ID, thread = arg.thread, board = arg.board;
return !!Redirect.to('thread', {
postID: ID,
threadID: thread.ID,
@@ -11414,9 +11429,9 @@
},
subEntries: []
};
- _ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Unique ID', 'uniqueID'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- type = _ref1[_i];
+ ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ type = ref1[k];
entry.subEntries.push(this.createSubEntry(type[0], type[1]));
}
return Menu.menu.addEntry(entry);
@@ -11427,9 +11442,9 @@
textContent: text,
target: '_blank'
});
- open = type === 'post' ? function(_arg) {
+ open = type === 'post' ? function(arg) {
var ID, board, thread;
- ID = _arg.ID, thread = _arg.thread, board = _arg.board;
+ ID = arg.ID, thread = arg.thread, board = arg.board;
el.href = Redirect.to('thread', {
postID: ID,
threadID: thread.ID,
@@ -11459,8 +11474,8 @@
DeleteLink = {
init: function() {
- var div, fileEl, fileEntry, postEl, postEntry, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
+ var div, fileEl, fileEntry, postEl, postEntry, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
return;
}
div = $.el('div', {
@@ -11485,9 +11500,9 @@
};
fileEntry = {
el: fileEl,
- open: function(_arg) {
+ open: function(arg) {
var file;
- file = _arg.file;
+ file = arg.file;
if (!file || file.isDead) {
return false;
}
@@ -11564,8 +11579,8 @@
},
cooldown: {
start: function(post, node) {
- var length, seconds, _ref;
- if (!((_ref = QR.db) != null ? _ref.get({
+ var length, ref, seconds;
+ if (!((ref = QR.db) != null ? ref.get({
boardID: post.board.ID,
threadID: post.thread.ID,
postID: post.ID
@@ -11597,8 +11612,8 @@
DownloadLink = {
init: function() {
- var a, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
return;
}
a = $.el('a', {
@@ -11609,9 +11624,9 @@
return Menu.menu.addEntry({
el: a,
order: 100,
- open: function(_arg) {
+ open: function(arg) {
var file;
- file = _arg.file;
+ file = arg.file;
if (!file) {
return false;
}
@@ -11625,8 +11640,8 @@
Menu = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) {
return;
}
this.button = $.el('a', {
@@ -11667,8 +11682,8 @@
ReportLink = {
init: function() {
- var a, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
return;
}
a = $.el('a', {
@@ -11756,34 +11771,34 @@
var x;
MarkNewIPs.ipCount = this.ipCount;
MarkNewIPs.postIDs = (function() {
- var _i, _len, _ref, _results;
- _ref = this.posts.keys;
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- x = _ref[_i];
- _results.push(+x);
+ var k, len1, ref, results;
+ ref = this.posts.keys;
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ x = ref[k];
+ results.push(+x);
}
- return _results;
+ return results;
}).call(this);
return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
},
onUpdate: function(e) {
- var added, fullID, i, ipCount, newPosts, obj, postIDs, removed, x, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1;
- _ref = e.detail, ipCount = _ref.ipCount, newPosts = _ref.newPosts;
+ var added, fullID, i, ipCount, k, len1, len2, len3, len4, newPosts, obj, postIDs, q, ref, ref1, removed, u, w, x;
+ ref = e.detail, ipCount = ref.ipCount, newPosts = ref.newPosts;
postIDs = ThreadUpdater.postIDs;
if (ipCount == null) {
return;
}
if (newPosts.length) {
obj = {};
- _ref1 = MarkNewIPs.postIDs;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- x = _ref1[_i];
+ ref1 = MarkNewIPs.postIDs;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ x = ref1[k];
obj[x] = true;
}
added = 0;
- for (_j = 0, _len1 = postIDs.length; _j < _len1; _j++) {
- x = postIDs[_j];
+ for (q = 0, len2 = postIDs.length; q < len2; q++) {
+ x = postIDs[q];
if (!(x in obj)) {
added++;
}
@@ -11792,14 +11807,14 @@
switch (ipCount - MarkNewIPs.ipCount) {
case added:
i = MarkNewIPs.ipCount;
- for (_k = 0, _len2 = newPosts.length; _k < _len2; _k++) {
- fullID = newPosts[_k];
+ for (u = 0, len3 = newPosts.length; u < len3; u++) {
+ fullID = newPosts[u];
MarkNewIPs.markNew(g.posts[fullID], ++i);
}
break;
case -removed:
- for (_l = 0, _len3 = newPosts.length; _l < _len3; _l++) {
- fullID = newPosts[_l];
+ for (w = 0, len4 = newPosts.length; w < len4; w++) {
+ fullID = newPosts[w];
MarkNewIPs.markOld(g.posts[fullID]);
}
}
@@ -11907,11 +11922,11 @@
return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate);
},
onUpdate: function(e) {
- var fileCount, ipCount, newPosts, postCount, _ref, _ref1;
+ var fileCount, ipCount, newPosts, postCount, ref, ref1;
if (e.detail[404]) {
return;
}
- _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount, ipCount = _ref.ipCount, newPosts = _ref.newPosts;
+ ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount, ipCount = ref.ipCount, newPosts = ref.newPosts;
ThreadStats.update(postCount, fileCount, ipCount);
if (!Conf["Page Count in Stats"]) {
return;
@@ -11919,7 +11934,7 @@
if (newPosts.length) {
ThreadStats.lastPost = g.posts[newPosts[newPosts.length - 1]].info.date;
}
- if (ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((_ref1 = ThreadStats.pageCountEl) != null ? _ref1.textContent : void 0) !== '1') {
+ if (ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((ref1 = ThreadStats.pageCountEl) != null ? ref1.textContent : void 0) !== '1') {
return ThreadStats.fetchPage();
}
},
@@ -11952,16 +11967,16 @@
});
},
onThreadsLoad: function() {
- var page, thread, _i, _j, _len, _len1, _ref, _ref1;
+ var k, len1, len2, page, q, ref, ref1, thread;
if (!(Conf["Page Count in Stats"] && this.status === 200)) {
return;
}
- _ref = this.response;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- page = _ref[_i];
- _ref1 = page.threads;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- thread = _ref1[_j];
+ ref = this.response;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ page = ref[k];
+ ref1 = page.threads;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ thread = ref1[q];
if (!(thread.no === ThreadStats.thread.ID)) {
continue;
}
@@ -11976,7 +11991,7 @@
ThreadUpdater = {
init: function() {
- var conf, el, input, name, sc, subEntries, updateLink, _ref;
+ var conf, el, input, name, ref, sc, subEntries, updateLink;
if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
return;
}
@@ -12016,9 +12031,9 @@
});
$.on(updateLink.firstElementChild, 'click', this.update);
subEntries = [];
- _ref = Config.updater.checkbox;
- for (name in _ref) {
- conf = _ref[name];
+ ref = Config.updater.checkbox;
+ for (name in ref) {
+ conf = ref[name];
el = UI.checkbox(name, name);
el.title = conf[1];
input = el.firstElementChild;
@@ -12153,15 +12168,15 @@
case 404:
$.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/catalog.json", {
onloadend: function() {
- var confirmed, page, thread, _i, _j, _len, _len1, _ref, _ref1;
+ var confirmed, k, len1, len2, page, q, ref, ref1, thread;
if (this.status === 200) {
confirmed = true;
- _ref = this.response;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- page = _ref[_i];
- _ref1 = page.threads;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- thread = _ref1[_j];
+ ref = this.response;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ page = ref[k];
+ ref1 = page.threads;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ thread = ref1[q];
if (thread.no === ThreadUpdater.thread.ID) {
confirmed = false;
break;
@@ -12198,9 +12213,9 @@
});
},
error: function(req) {
- var klass, text, _ref;
+ var klass, ref, text;
ThreadUpdater.setInterval();
- _ref = req.status === 304 ? ['', ''] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1];
+ ref = req.status === 304 ? ['', ''] : [req.statusText + " (" + req.status + ")", 'warning'], text = ref[0], klass = ref[1];
return ThreadUpdater.set('status', text, klass);
},
setInterval: function() {
@@ -12256,7 +12271,7 @@
}
},
update: function() {
- var _ref;
+ var ref;
if (!navigator.onLine) {
return;
}
@@ -12266,8 +12281,8 @@
} else {
ThreadUpdater.set('timer', 'Update');
}
- if ((_ref = ThreadUpdater.req) != null) {
- _ref.abort();
+ if ((ref = ThreadUpdater.req) != null) {
+ ref.abort();
}
return ThreadUpdater.req = $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/thread/" + ThreadUpdater.thread + ".json", {
onloadend: ThreadUpdater.cb.load,
@@ -12289,7 +12304,7 @@
return new Notice('info', "The thread is " + change + ".", 30);
},
parse: function(postObjects) {
- var OP, count, files, index, ipCountEl, node, num, post, postObject, posts, root, scroll, _i, _j, _len, _len1;
+ var OP, count, files, index, ipCountEl, k, len1, len2, node, num, post, postObject, posts, q, root, scroll;
OP = postObjects[0];
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
ThreadUpdater.thread.setStatus('Archived', !!+OP.archived);
@@ -12304,8 +12319,8 @@
index = [];
files = [];
count = 0;
- for (_i = 0, _len = postObjects.length; _i < _len; _i++) {
- postObject = postObjects[_i];
+ for (k = 0, len1 = postObjects.length; k < len1; k++) {
+ postObject = postObjects[k];
num = postObject.no;
index.push(num);
if (postObject.fsize) {
@@ -12322,11 +12337,11 @@
var ID;
ID = +post.ID;
if (!(post.info.date > Date.now() - 60 * $.SECOND)) {
- if (__indexOf.call(index, ID) < 0) {
+ if (indexOf.call(index, ID) < 0) {
post.kill();
} else if (post.isDead) {
post.resurrect();
- } else if (post.file && !(post.file.isDead || __indexOf.call(files, ID) >= 0)) {
+ } else if (post.file && !(post.file.isDead || indexOf.call(files, ID) >= 0)) {
post.kill(true);
}
}
@@ -12350,8 +12365,8 @@
ThreadUpdater.lastPost = posts[count - 1].ID;
Main.callbackNodes(Post, posts);
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
- for (_j = 0, _len1 = posts.length; _j < _len1; _j++) {
- post = posts[_j];
+ for (q = 0, len2 = posts.length; q < len2; q++) {
+ post = posts[q];
root = post.nodes.root;
if (!QuoteThreading.insert(post)) {
$.add(ThreadUpdater.root, post.nodes.root);
@@ -12378,13 +12393,13 @@
404: false,
threadID: ThreadUpdater.thread.fullID,
newPosts: (function() {
- var _k, _len2, _results;
- _results = [];
- for (_k = 0, _len2 = posts.length; _k < _len2; _k++) {
- post = posts[_k];
- _results.push(post.fullID);
+ var len3, results, u;
+ results = [];
+ for (u = 0, len3 = posts.length; u < len3; u++) {
+ post = posts[u];
+ results.push(post.fullID);
}
- return _results;
+ return results;
})(),
postCount: OP.replies + 1,
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead),
@@ -12437,9 +12452,9 @@
href: 'javascript:;'
}),
order: 6,
- open: function(_arg) {
+ open: function(arg) {
var thread;
- thread = _arg.thread;
+ thread = arg.thread;
if (Conf['Index Mode'] !== 'catalog') {
return false;
}
@@ -12466,8 +12481,8 @@
});
},
isWatched: function(thread) {
- var _ref;
- return (_ref = ThreadWatcher.db) != null ? _ref.get({
+ var ref;
+ return (ref = ThreadWatcher.db) != null ? ref.get({
boardID: thread.board.ID,
threadID: thread.ID
}) : void 0;
@@ -12515,9 +12530,9 @@
if (!Conf['Auto Watch']) {
return;
}
- return $.get('AutoWatch', 0, function(_arg) {
+ return $.get('AutoWatch', 0, function(arg) {
var AutoWatch, thread;
- AutoWatch = _arg.AutoWatch;
+ AutoWatch = arg.AutoWatch;
if (!(thread = g.BOARD.threads[AutoWatch])) {
return;
}
@@ -12531,26 +12546,26 @@
},
cb: {
openAll: function() {
- var a, _i, _len, _ref;
+ var a, k, len1, ref;
if ($.hasClass(this, 'disabled')) {
return;
}
- _ref = $$('a[title]', ThreadWatcher.list);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
+ ref = $$('a[title]', ThreadWatcher.list);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
$.open(a.href);
}
return $.event('CloseMenu');
},
pruneDeads: function() {
- var boardID, data, threadID, _i, _len, _ref, _ref1;
+ var boardID, data, k, len1, ref, ref1, threadID;
if ($.hasClass(this, 'disabled')) {
return;
}
ThreadWatcher.db.forceSync();
- _ref = ThreadWatcher.getAll();
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- _ref1 = _ref[_i], boardID = _ref1.boardID, threadID = _ref1.threadID, data = _ref1.data;
+ ref = ThreadWatcher.getAll();
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
if (!data.isDead) {
continue;
}
@@ -12571,13 +12586,13 @@
return delete Index.followedThreadID;
},
rm: function() {
- var boardID, threadID, _ref;
- _ref = this.parentNode.dataset.fullID.split('.'), boardID = _ref[0], threadID = _ref[1];
+ var boardID, ref, threadID;
+ ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1];
return ThreadWatcher.rm(boardID, +threadID);
},
post: function(e) {
- var boardID, postID, threadID, _ref;
- _ref = e.detail, boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ var boardID, postID, ref, threadID;
+ ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
if (postID === threadID) {
if (Conf['Auto Watch']) {
return $.set('AutoWatch', threadID);
@@ -12587,13 +12602,13 @@
}
},
onIndexRefresh: function() {
- var boardID, data, db, threadID, _ref;
+ var boardID, data, db, ref, threadID;
db = ThreadWatcher.db;
boardID = g.BOARD.ID;
db.forceSync();
- _ref = db.data.boards[boardID];
- for (threadID in _ref) {
- data = _ref[threadID];
+ ref = db.data.boards[boardID];
+ for (threadID in ref) {
+ data = ref[threadID];
if (!data.isDead && !(threadID in g.BOARD.threads)) {
if (Conf['Auto Prune']) {
ThreadWatcher.db["delete"]({
@@ -12645,17 +12660,17 @@
return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);
},
fetchAllStatus: function() {
- var thread, threads, _i, _len, _ref;
+ var k, len1, ref, thread, threads;
ThreadWatcher.db.forceSync();
ThreadWatcher.unreaddb.forceSync();
- if ((_ref = QR.db) != null) {
- _ref.forceSync();
+ if ((ref = QR.db) != null) {
+ ref.forceSync();
}
if (!(threads = ThreadWatcher.getAll()).length) {
return;
}
- for (_i = 0, _len = threads.length; _i < _len; _i++) {
- thread = threads[_i];
+ for (k = 0, len1 = threads.length; k < len1; k++) {
+ thread = threads[k];
ThreadWatcher.fetchStatus(thread);
}
},
@@ -12677,9 +12692,9 @@
}
});
},
- parseStatus: function(_arg) {
- var boardID, data, fetchCount, isDead, lastReadPost, match, postObj, quotingYou, regexp, status, threadID, unread, _i, _len, _ref, _ref1;
- boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
+ parseStatus: function(arg) {
+ var boardID, data, fetchCount, isDead, k, lastReadPost, len1, match, postObj, quotingYou, ref, ref1, regexp, status, threadID, unread;
+ boardID = arg.boardID, threadID = arg.threadID, data = arg.data;
fetchCount = ThreadWatcher.fetchCount;
fetchCount.fetched++;
if (fetchCount.fetched === fetchCount.fetching) {
@@ -12688,7 +12703,7 @@
status = '';
$.rmClass(ThreadWatcher.refreshButton, 'fa-spin');
} else {
- status = "" + (Math.round(fetchCount.fetched / fetchCount.fetching * 100)) + "%";
+ status = (Math.round(fetchCount.fetched / fetchCount.fetching * 100)) + "%";
}
ThreadWatcher.status.textContent = status;
if (this.status === 200 && this.response) {
@@ -12707,13 +12722,13 @@
defaultValue: 0
});
unread = quotingYou = 0;
- _ref = this.response.posts;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- postObj = _ref[_i];
+ ref = this.response.posts;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ postObj = ref[k];
if (!(postObj.no > lastReadPost)) {
continue;
}
- if ((_ref1 = QR.db) != null ? _ref1.get({
+ if ((ref1 = QR.db) != null ? ref1.get({
boardID: boardID,
threadID: threadID,
postID: postObj.no
@@ -12767,11 +12782,11 @@
}
},
getAll: function() {
- var all, boardID, data, threadID, threads, _ref;
+ var all, boardID, data, ref, threadID, threads;
all = [];
- _ref = ThreadWatcher.db.data.boards;
- for (boardID in _ref) {
- threads = _ref[boardID];
+ ref = ThreadWatcher.db.data.boards;
+ for (boardID in ref) {
+ threads = ref[boardID];
if (Conf['Current Board'] && boardID !== g.BOARD.ID) {
continue;
}
@@ -12811,9 +12826,9 @@
});
$.add(link, title);
div = $.el('div');
- fullID = "" + boardID + "." + threadID;
+ fullID = boardID + "." + threadID;
div.dataset.fullID = fullID;
- if (g.VIEW === 'thread' && fullID === ("" + g.BOARD + "." + g.THREADID)) {
+ if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) {
$.addClass(div, 'current');
}
if (data.isDead) {
@@ -12831,26 +12846,26 @@
return div;
},
refresh: function() {
- var boardID, data, list, nodes, refresher, threadID, _i, _j, _len, _len1, _ref, _ref1, _ref2;
+ var boardID, data, k, len1, len2, list, nodes, q, ref, ref1, ref2, refresher, threadID;
nodes = [];
- _ref = ThreadWatcher.getAll();
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- _ref1 = _ref[_i], boardID = _ref1.boardID, threadID = _ref1.threadID, data = _ref1.data;
+ ref = ThreadWatcher.getAll();
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
nodes.push(ThreadWatcher.makeLine(boardID, threadID, data));
}
list = ThreadWatcher.list;
$.rmAll(list);
$.add(list, nodes);
g.threads.forEach(function(thread) {
- var helper, post, toggler, _j, _len1, _ref2;
+ var helper, len2, post, q, ref2, toggler;
helper = ThreadWatcher.isWatched(thread) ? ['addClass', 'Unwatch'] : ['rmClass', 'Watch'];
if (thread.OP) {
- _ref2 = [thread.OP].concat(__slice.call(thread.OP.clones));
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- post = _ref2[_j];
+ ref2 = [thread.OP].concat(slice.call(thread.OP.clones));
+ for (q = 0, len2 = ref2.length; q < len2; q++) {
+ post = ref2[q];
toggler = $('.watch-thread-link', post.nodes.post);
$[helper[0]](toggler, 'watched');
- toggler.title = "" + helper[1] + " Thread";
+ toggler.title = helper[1] + " Thread";
}
}
if (thread.catalogView) {
@@ -12858,9 +12873,9 @@
}
});
ThreadWatcher.refreshIcon();
- _ref2 = ThreadWatcher.menu.refreshers;
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- refresher = _ref2[_j];
+ ref2 = ThreadWatcher.menu.refreshers;
+ for (q = 0, len2 = ref2.length; q < len2; q++) {
+ refresher = ref2[q];
refresher();
}
if (Index.nodes && Conf['Pin Watched Threads']) {
@@ -12869,16 +12884,16 @@
}
},
refreshIcon: function() {
- var className, _i, _len, _ref;
- _ref = ['replies-unread', 'replies-quoting-you'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- className = _ref[_i];
+ var className, k, len1, ref;
+ ref = ['replies-unread', 'replies-quoting-you'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ className = ref[k];
ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog));
}
},
update: function(boardID, threadID, newData) {
- var data, key, line, n, newLine, val, _ref;
- if (!(data = (_ref = ThreadWatcher.db) != null ? _ref.get({
+ var data, key, line, n, newLine, ref, val;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
boardID: boardID,
threadID: threadID
}) : void 0)) {
@@ -12924,8 +12939,8 @@
}
},
set404: function(boardID, threadID, cb) {
- var data, _ref;
- if (!(data = (_ref = ThreadWatcher.db) != null ? _ref.get({
+ var data, ref;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
boardID: boardID,
threadID: threadID
}) : void 0)) {
@@ -13041,18 +13056,18 @@
order: 60
});
$.on(entryEl, 'click', function() {
- return ThreadWatcher.toggle(g.threads["" + g.BOARD + "." + g.THREADID]);
+ return ThreadWatcher.toggle(g.threads[g.BOARD + "." + g.THREADID]);
});
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];
+ var addClass, ref, rmClass, text;
+ 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);
return entryEl.textContent = text;
});
},
addMenuEntries: function() {
- var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1;
+ var cb, conf, entries, entry, k, len1, name, ref, ref1, refresh, subEntries;
entries = [];
entries.push({
cb: ThreadWatcher.cb.openAll,
@@ -13077,9 +13092,9 @@
}
});
subEntries = [];
- _ref = Config.threadWatcher;
- for (name in _ref) {
- conf = _ref[name];
+ ref = Config.threadWatcher;
+ for (name in ref) {
+ conf = ref[name];
subEntries.push(this.createSubEntry(name, conf[1]));
}
entries.push({
@@ -13090,8 +13105,8 @@
subEntries: subEntries
}
});
- for (_i = 0, _len = entries.length; _i < _len; _i++) {
- _ref1 = entries[_i], entry = _ref1.entry, cb = _ref1.cb, refresh = _ref1.refresh;
+ for (k = 0, len1 = entries.length; k < len1; k++) {
+ ref1 = entries[k], entry = ref1.entry, cb = ref1.cb, refresh = ref1.refresh;
if (entry.el.nodeName === 'A') {
entry.el.href = 'javascript:;';
}
@@ -13147,7 +13162,7 @@
});
},
node: function() {
- var ID, _i, _len, _ref;
+ var ID, k, len1, ref;
Unread.thread = this;
Unread.title = d.title;
Unread.lastReadPost = Unread.db.get({
@@ -13156,9 +13171,9 @@
defaultValue: 0
});
Unread.readCount = 0;
- _ref = this.posts.keys;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- ID = _ref[_i];
+ ref = this.posts.keys;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ID = ref[k];
if (+ID <= Unread.lastReadPost) {
Unread.readCount++;
}
@@ -13202,7 +13217,7 @@
}
},
sync: function() {
- var ID, i, lastReadPost, postIDs, _i, _ref, _ref1;
+ var ID, i, k, lastReadPost, postIDs, ref, ref1;
if (Unread.lastReadPost == null) {
return;
}
@@ -13216,7 +13231,7 @@
}
Unread.lastReadPost = lastReadPost;
postIDs = Unread.thread.posts.keys;
- for (i = _i = _ref = Unread.readCount, _ref1 = postIDs.length; _i < _ref1; i = _i += 1) {
+ for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
ID = +postIDs[i];
if (!Unread.thread.posts[ID].isFetchedQuote) {
if (ID > Unread.lastReadPost) {
@@ -13232,12 +13247,12 @@
return Unread.update();
},
addPost: function() {
- var _ref;
+ var ref;
if (this.isFetchedQuote || this.isClone) {
return;
}
Unread.order.push(this);
- if (this.ID <= Unread.lastReadPost || this.isHidden || ((_ref = QR.db) != null ? _ref.get({
+ if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QR.db) != null ? ref.get({
boardID: this.board.ID,
threadID: this.thread.ID,
postID: this.ID
@@ -13249,11 +13264,11 @@
return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
},
addPostQuotingYou: function(post) {
- var quotelink, _i, _len, _ref, _ref1;
- _ref = post.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
- if (!((_ref1 = QR.db) != null ? _ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
+ var k, len1, quotelink, ref, ref1;
+ ref = post.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
+ if (!((ref1 = QR.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
continue;
}
Unread.postsQuotingYou.add(post.ID);
@@ -13266,7 +13281,7 @@
if (!Header.areNotificationsEnabled) {
return;
}
- notif = new Notification("" + post.info.nameBlock + " replied to you", {
+ notif = new Notification(post.info.nameBlock + " replied to you", {
body: post.info[Conf['Remove Spoilers'] || Conf['Reveal Spoilers'] ? 'comment' : 'commentSpoilered'],
icon: Favicon.logo
});
@@ -13300,14 +13315,14 @@
return Unread.update();
},
read: $.debounce(100, function(e) {
- var ID, count, data, height, root, _ref, _ref1;
+ var ID, count, data, height, ref, ref1, root;
if (d.hidden || !Unread.posts.size) {
return;
}
height = doc.clientHeight;
count = 0;
while (Unread.position) {
- _ref = Unread.position, ID = _ref.ID, data = _ref.data;
+ ref = Unread.position, ID = ref.ID, data = ref.data;
root = data.nodes.root;
if (!(!root.getBoundingClientRect().height || Header.getBottomOf(root) > -1)) {
break;
@@ -13315,7 +13330,7 @@
count++;
Unread.posts["delete"](ID);
Unread.postsQuotingYou["delete"](ID);
- if (Conf['Mark Quotes of You'] && ((_ref1 = QR.db) != null ? _ref1.get({
+ if (Conf['Mark Quotes of You'] && ((ref1 = QR.db) != null ? ref1.get({
boardID: data.board.ID,
threadID: data.thread.ID,
postID: ID
@@ -13339,9 +13354,9 @@
}
},
saveLastReadPost: $.debounce(2 * $.SECOND, function() {
- var ID, i, postIDs, _i, _ref, _ref1;
+ var ID, i, k, postIDs, ref, ref1;
postIDs = Unread.thread.posts.keys;
- for (i = _i = _ref = Unread.readCount, _ref1 = postIDs.length; _i < _ref1; i = _i += 1) {
+ for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
ID = +postIDs[i];
if (!Unread.thread.posts[ID].isFetchedQuote) {
if (Unread.posts.has(ID)) {
@@ -13401,20 +13416,20 @@
Redirect = {
init: function() {
- var archive, archives, boardID, boards, data, files, id, name, o, record, software, type, withCredentials, _i, _j, _len, _len1, _ref, _ref1;
+ var archive, archives, boardID, boards, data, files, id, k, len1, len2, name, o, q, record, ref, ref1, software, type, withCredentials;
o = {
thread: {},
post: {},
file: {}
};
archives = {};
- _ref = Redirect.archives;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- data = _ref[_i];
+ ref = Redirect.archives;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ data = ref[k];
name = data.name, boards = data.boards, files = data.files, software = data.software, withCredentials = data.withCredentials;
archives[name] = data;
- for (_j = 0, _len1 = boards.length; _j < _len1; _j++) {
- boardID = boards[_j];
+ for (q = 0, len2 = boards.length; q < len2; q++) {
+ boardID = boards[q];
if (!(!withCredentials)) {
continue;
}
@@ -13424,21 +13439,21 @@
if (!(boardID in o.post || software !== 'foolfuuka')) {
o.post[boardID] = data;
}
- if (!(boardID in o.file || __indexOf.call(files, boardID) < 0)) {
+ if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) {
o.file[boardID] = data;
}
}
}
- _ref1 = Conf['selectedArchives'];
- for (boardID in _ref1) {
- record = _ref1[boardID];
+ ref1 = Conf['selectedArchives'];
+ for (boardID in ref1) {
+ record = ref1[boardID];
for (type in record) {
id = record[type];
if (id === 'disabled') {
delete o[type][boardID];
} else if (archive = archives[id]) {
boards = type === 'file' ? archive.files : archive.boards;
- if (__indexOf.call(boards, boardID) >= 0) {
+ if (indexOf.call(boards, boardID) >= 0) {
o[type][boardID] = archive;
}
}
@@ -13461,12 +13476,12 @@
if (!archive[protocol.slice(0, -1)]) {
protocol = protocol === 'https:' ? 'http:' : 'https:';
}
- return "" + protocol + "//";
+ return protocol + "//";
},
- thread: function(archive, _arg) {
+ 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;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
+ path = threadID ? boardID + "/thread/" + threadID : boardID + "/post/" + postID;
if (archive.software === 'foolfuuka') {
path += '/';
}
@@ -13475,9 +13490,9 @@
}
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
},
- post: function(archive, _arg) {
+ post: function(archive, arg) {
var URL, boardID, postID, protocol;
- boardID = _arg.boardID, postID = _arg.postID;
+ boardID = arg.boardID, postID = arg.postID;
protocol = Redirect.protocol(archive);
URL = new String("" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID);
if (!Redirect.securityCheck(URL)) {
@@ -13486,22 +13501,22 @@
URL.archive = archive;
return URL;
},
- file: function(archive, _arg) {
+ file: function(archive, arg) {
var boardID, filename;
- boardID = _arg.boardID, filename = _arg.filename;
+ boardID = arg.boardID, filename = arg.filename;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
},
- board: function(archive, _arg) {
+ board: function(archive, arg) {
var boardID;
- boardID = _arg.boardID;
+ boardID = arg.boardID;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/";
},
- search: function(archive, _arg) {
+ search: function(archive, arg) {
var boardID, path, type, value;
- boardID = _arg.boardID, type = _arg.type, value = _arg.value;
- type = type === 'name' ? 'username' : type === 'uniqueID' ? 'uid' : type === 'MD5' ? 'image' : type;
+ boardID = arg.boardID, type = arg.type, value = arg.value;
+ type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type;
value = encodeURIComponent(value);
- path = archive.software === 'foolfuuka' ? "" + boardID + "/search/" + type + "/" + value : "" + boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value;
+ path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value : boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
},
securityCheck: function(URL) {
@@ -13525,12 +13540,12 @@
return $.one(d, '4chanXInitFinished', this.setup);
},
setup: function() {
- var btn, entry, hr, psa, _ref;
+ var btn, entry, hr, psa, ref;
if (!(psa = PSAHiding.psa = $.id('globalMessage'))) {
$.rmClass(doc, 'hide-announcement');
return;
}
- if ((hr = (_ref = $.id('globalToggle')) != null ? _ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
+ if ((hr = (ref = $.id('globalToggle')) != null ? ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
PSAHiding.hr = hr;
}
entry = {
@@ -13554,9 +13569,9 @@
innerHTML: "[Dismiss]"
});
$.on(btn, 'click', PSAHiding.toggle);
- $.get('hiddenPSA', 0, function(_arg) {
+ $.get('hiddenPSA', 0, function(arg) {
var hiddenPSA;
- hiddenPSA = _arg.hiddenPSA;
+ hiddenPSA = arg.hiddenPSA;
PSAHiding.sync(hiddenPSA);
$.add(psa, btn);
return $.rmClass(doc, 'hide-announcement');
@@ -13575,7 +13590,7 @@
return PSAHiding.sync(UTC);
},
sync: function(UTC) {
- var psa, _ref;
+ var psa, ref;
psa = PSAHiding.psa;
PSAHiding.hidden = PSAHiding.btn.hidden = (UTC != null) && UTC >= +psa.dataset.utc;
if (PSAHiding.hidden) {
@@ -13583,22 +13598,22 @@
} else {
$.after($.id('globalToggle'), psa);
}
- if ((_ref = PSAHiding.hr) != null) {
- _ref.hidden = PSAHiding.hidden;
+ if ((ref = PSAHiding.hr) != null) {
+ ref.hidden = PSAHiding.hidden;
}
}
};
AntiAutoplay = {
init: function() {
- var audio, _i, _len, _ref;
+ var audio, k, len1, ref;
if (!Conf['Disable Autoplaying Sounds']) {
return;
}
$.addClass(doc, 'anti-autoplay');
- _ref = $$('audio[autoplay]', doc);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- audio = _ref[_i];
+ ref = $$('audio[autoplay]', doc);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ audio = ref[k];
this.stop(audio);
}
window.addEventListener('loadstart', ((function(_this) {
@@ -13636,15 +13651,15 @@
return AntiAutoplay.process(this.nodes.root);
},
process: function(root) {
- var iframe, object, _i, _j, _len, _len1, _ref, _ref1;
- _ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- iframe = _ref[_i];
+ var iframe, k, len1, len2, object, q, ref, ref1;
+ ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ iframe = ref[k];
iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
}
- _ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- object = _ref1[_j];
+ ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ object = ref1[q];
object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
}
}
@@ -13706,8 +13721,8 @@
},
cb: {
toggle: function() {
- var banner, i, _ref;
- if (!((_ref = Banner.choices) != null ? _ref.length : void 0)) {
+ var banner, i, ref;
+ if (!((ref = Banner.choices) != null ? ref.length : void 0)) {
Banner.choices = Banner.banners.slice();
}
i = Math.floor(Banner.choices.length * Math.random());
@@ -13715,17 +13730,17 @@
return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner;
},
click: function(e) {
- var br, _base, _i, _len, _name, _ref;
+ var base1, br, k, len1, name1, ref;
if (!(e.ctrlKey || e.metaKey)) {
return;
}
- if ((_base = Banner.original)[_name = this.className] == null) {
- _base[_name] = this.cloneNode(true);
+ if ((base1 = Banner.original)[name1 = this.className] == null) {
+ base1[name1] = this.cloneNode(true);
}
this.contentEditable = true;
- _ref = $$('br', this);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- br = _ref[_i];
+ ref = $$('br', this);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ br = ref[k];
$.replace(br, $.tn('\n'));
}
return this.focus();
@@ -13737,10 +13752,10 @@
}
},
blur: function() {
- var br, _i, _len, _ref;
- _ref = $$('br', this);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- br = _ref[_i];
+ var br, k, len1, ref;
+ ref = $$('br', this);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ br = ref[k];
$.replace(br, $.tn('\n'));
}
if (this.textContent = this.textContent.replace(/\n*$/, '')) {
@@ -13755,7 +13770,7 @@
});
} else {
$.rmAll(this);
- $.add(this, __slice.call(Banner.original[this.className].cloneNode(true).childNodes));
+ $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes));
return Banner.db["delete"]({
boardID: g.BOARD.ID,
threadID: this.className
@@ -13765,17 +13780,17 @@
},
original: {},
custom: function(child) {
- var className, data, event, items, string, string2, _i, _len, _ref;
+ var className, data, event, items, k, len1, ref, string, string2;
className = child.className;
child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase());
child.spellcheck = false;
- _ref = ['click', 'keydown', 'blur'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- event = _ref[_i];
+ ref = ['click', 'keydown', 'blur'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
$.on(child, event, Banner.cb[event]);
}
- string = "" + g.BOARD + "." + className;
- string2 = "" + string + ".orig";
+ string = g.BOARD + "." + className;
+ string2 = string + ".orig";
items = {};
items[string] = '';
items[string2] = child.textContent;
@@ -13825,10 +13840,10 @@
}
})();
$.ready(function() {
- var catalogLink, link, _i, _len, _ref;
- _ref = $$(selector);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- link = _ref[_i];
+ var catalogLink, k, len1, link, ref;
+ ref = $$(selector);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
switch (link.pathname) {
case "/" + g.BOARD + "/":
if (Conf['JSON Navigation']) {
@@ -13871,10 +13886,10 @@
}
},
node: function() {
- var a, m, _i, _len, _ref;
- _ref = $$('a', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
+ var a, k, len1, m, ref;
+ ref = $$('a', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
}
@@ -13892,11 +13907,11 @@
return CatalogLinks.set(this.checked);
},
set: function(useCatalog) {
- var a, board, _i, _len, _ref, _ref1;
- _ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
- if (((_ref1 = a.hostname) !== 'boards.4chan.org' && _ref1 !== 'catalog.neet.tv' && _ref1 !== '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
+ var a, board, k, len1, ref, ref1;
+ ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
+ if (((ref1 = a.hostname) !== 'boards.4chan.org' && ref1 !== 'catalog.neet.tv' && ref1 !== '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
continue;
}
a.href = useCatalog ? CatalogLinks.catalog(board) : "/" + board + "/";
@@ -14015,7 +14030,7 @@
return post.nodes.comment = post.nodes.shortComment;
},
parse: function(req, a, post) {
- var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
+ var callback, clone, comment, href, k, len1, len2, len3, postObj, posts, q, quote, ref, ref1, spoilerRange, status, u;
status = req.status;
if (status !== 200 && status !== 304) {
a.textContent = "Error " + req.statusText + " (" + status + ")";
@@ -14025,8 +14040,8 @@
if (spoilerRange = posts[0].custom_spoiler) {
Build.spoilerRange[g.BOARD] = spoilerRange;
}
- for (_i = 0, _len = posts.length; _i < _len; _i++) {
- postObj = posts[_i];
+ for (k = 0, len1 = posts.length; k < len1; k++) {
+ postObj = posts[k];
if (postObj.no === post.ID) {
break;
}
@@ -14038,9 +14053,9 @@
comment = post.nodes.comment;
clone = comment.cloneNode(false);
clone.innerHTML = postObj.com;
- _ref = $$('.quotelink', clone);
- for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
- quote = _ref[_j];
+ ref = $$('.quotelink', clone);
+ for (q = 0, len2 = ref.length; q < len2; q++) {
+ quote = ref[q];
href = quote.getAttribute('href');
if (href[0] === '/') {
continue;
@@ -14048,7 +14063,7 @@
if (href[0] === '#') {
quote.href = "" + (a.pathname.split('/').splice(0, 4).join('/')) + href;
} else {
- quote.href = "" + (a.pathname.split('/').splice(0, 3).join('/')) + "/" + href;
+ quote.href = (a.pathname.split('/').splice(0, 3).join('/')) + "/" + href;
}
}
post.nodes.shortComment = comment;
@@ -14056,9 +14071,9 @@
post.nodes.comment = post.nodes.longComment = clone;
post.parseComment();
post.parseQuotes();
- _ref1 = ExpandComment.callbacks;
- for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
- callback = _ref1[_k];
+ ref1 = ExpandComment.callbacks;
+ for (u = 0, len3 = ref1.length; u < len3; u++) {
+ callback = ref1[u];
callback.call(post);
}
}
@@ -14086,20 +14101,20 @@
if (!(a = $.x('following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
return;
}
- a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(__slice.call(a.textContent.match(/\d+/g))));
+ a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
a.style.cursor = 'pointer';
return $.on(a, 'click', ExpandThread.cbToggle);
},
disconnect: function(refresh) {
- var status, threadID, _ref, _ref1;
+ var ref, ref1, status, threadID;
if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
return;
}
- _ref = ExpandThread.statuses;
- for (threadID in _ref) {
- status = _ref[threadID];
- if ((_ref1 = status.req) != null) {
- _ref1.abort();
+ ref = ExpandThread.statuses;
+ for (threadID in ref) {
+ status = ref[threadID];
+ if ((ref1 = status.req) != null) {
+ ref1.abort();
}
delete ExpandThread.statuses[threadID];
}
@@ -14114,7 +14129,7 @@
});
},
text: function(status, posts, files) {
- return ("" + status + " " + posts + " post" + (posts > 1 ? 's' : '')) + (+files ? " and " + files + " image repl" + (files > 1 ? 'ies' : 'y') : "") + (" " + (status === '-' ? 'shown' : 'omitted') + ".");
+ return (status + " " + posts + " post" + (posts > 1 ? 's' : '')) + (+files ? " and " + files + " image repl" + (files > 1 ? 'ies' : 'y') : "") + (" " + (status === '-' ? 'shown' : 'omitted') + ".");
},
cbToggle: function(e) {
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
@@ -14138,20 +14153,20 @@
expand: function(thread, a) {
var status;
ExpandThread.statuses[thread] = status = {};
- a.textContent = ExpandThread.text.apply(ExpandThread, ['...'].concat(__slice.call(a.textContent.match(/\d+/g))));
+ a.textContent = ExpandThread.text.apply(ExpandThread, ['...'].concat(slice.call(a.textContent.match(/\d+/g))));
return status.req = $.cache("//a.4cdn.org/" + thread.board + "/thread/" + thread + ".json", function() {
delete status.req;
return ExpandThread.parse(this, thread, a);
});
},
contract: function(thread, a, threadRoot) {
- var filesCount, inlined, num, postsCount, replies, reply, status, _i, _len;
+ var filesCount, inlined, k, len1, num, postsCount, replies, reply, status;
status = ExpandThread.statuses[thread];
delete ExpandThread.statuses[thread];
if (status.req) {
status.req.abort();
if (a) {
- a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(__slice.call(a.textContent.match(/\d+/g))));
+ a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
}
return;
}
@@ -14176,8 +14191,8 @@
}
postsCount = 0;
filesCount = 0;
- for (_i = 0, _len = replies.length; _i < _len; _i++) {
- reply = replies[_i];
+ for (k = 0, len1 = replies.length; k < len1; k++) {
+ reply = replies[k];
if (Conf['Quote Inlining']) {
while (inlined = $('.inlined', reply)) {
inlined.click();
@@ -14192,8 +14207,8 @@
return a.textContent = ExpandThread.text('+', postsCount, filesCount);
},
parse: function(req, thread, a) {
- var filesCount, post, postData, posts, postsCount, postsRoot, root, _i, _len, _ref, _ref1;
- if ((_ref = req.status) !== 200 && _ref !== 304) {
+ var filesCount, k, len1, post, postData, posts, postsCount, postsRoot, ref, ref1, root;
+ if ((ref = req.status) !== 200 && ref !== 304) {
a.textContent = "Error " + req.statusText + " (" + req.status + ")";
return;
}
@@ -14201,9 +14216,9 @@
posts = [];
postsRoot = [];
filesCount = 0;
- _ref1 = req.response.posts;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- postData = _ref1[_i];
+ ref1 = req.response.posts;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ postData = ref1[k];
if (postData.no === thread.ID) {
continue;
}
@@ -14232,8 +14247,8 @@
FileInfo = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['File Info Formatting']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['File Info Formatting']) {
return;
}
return Post.callbacks.push({
@@ -14351,8 +14366,8 @@
Fourchan = {
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
if (g.BOARD.ID === 'g') {
@@ -14378,7 +14393,7 @@
});
},
code: function() {
- var apply, pre, _i, _len, _ref;
+ var apply, k, len1, pre, ref;
if (this.isClone) {
return;
}
@@ -14387,9 +14402,9 @@
return $.addClass(pre, 'prettyprinted');
};
$.on(window, 'prettyprint:cb', apply);
- _ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- pre = _ref[_i];
+ ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ pre = ref[k];
$.event('prettyprint', pre.innerHTML, window);
}
$.off(window, 'prettyprint:cb', apply);
@@ -14412,8 +14427,8 @@
IDColor = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Color User IDs'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) {
return;
}
this.ids = {
@@ -14455,8 +14470,8 @@
IDHighlight = {
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
return Post.callbacks.push({
@@ -14501,12 +14516,12 @@
$.sync(hotkey, Keybinds.sync);
}
init = function() {
- var node, _i, _len, _ref;
+ var k, len1, node, ref;
$.off(d, '4chanXInitFinished', init);
$.on(d, 'keydown', Keybinds.keydown);
- _ref = $$('[accesskey]');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $$('[accesskey]');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
node.removeAttribute('accesskey');
}
};
@@ -14516,17 +14531,17 @@
return Conf[hotkey] = key;
},
keydown: function(e) {
- var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
+ var form, k, key, len1, notification, notifications, op, ref, ref1, ref2, ref3, ref4, ref5, searchInput, target, thread, threadRoot;
if (!(key = Keybinds.keyCode(e))) {
return;
}
target = e.target;
- if ((_ref = target.nodeName) === 'INPUT' || _ref === 'TEXTAREA') {
+ if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') {
if (!/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key)) {
return;
}
}
- if (!(((_ref1 = g.VIEW) !== 'index' && _ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
+ if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
threadRoot = Nav.getThread();
if (op = $('.op', threadRoot)) {
thread = Get.postFromNode(op).thread;
@@ -14561,8 +14576,8 @@
if (Settings.dialog) {
Settings.close();
} else if ((notifications = $$('.notification')).length) {
- for (_i = 0, _len = notifications.length; _i < _len; _i++) {
- notification = notifications[_i];
+ for (k = 0, len1 = notifications.length; k < len1; k++) {
+ notification = notifications[k];
$('.close', notification).click();
}
} else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) {
@@ -14658,13 +14673,13 @@
Gallery.cb.toggle();
break;
case Conf['fappeTyme']:
- if (!(Conf['Fappe Tyme'] && ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
FappeTyme.toggle('fappe');
break;
case Conf['werkTyme']:
- if (!(Conf['Werk Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
FappeTyme.toggle('werk');
@@ -14684,7 +14699,7 @@
return;
}
if (Conf['JSON Navigation']) {
- if ((_ref4 = Conf['Index Mode']) !== 'paged' && _ref4 !== 'infinite') {
+ if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
return;
}
$('.next button', Index.pagelist).click();
@@ -14699,7 +14714,7 @@
return;
}
if (Conf['JSON Navigation']) {
- if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
+ if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
return;
}
$('.prev button', Index.pagelist).click();
@@ -14918,7 +14933,7 @@
}
},
hl: function(delta, thread) {
- var axis, height, next, postEl, replies, reply, root, _i, _len;
+ var axis, height, k, len1, next, postEl, replies, reply, root;
postEl = $('.reply.highlight', thread);
if (!delta) {
if (postEl) {
@@ -14931,7 +14946,7 @@
if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
root = postEl.parentNode;
axis = delta === +1 ? 'following' : 'preceding';
- if (!(next = $.x("" + axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
+ if (!(next = $.x(axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
return;
}
Header.scrollToIfNeeded(next, delta === +1);
@@ -14945,8 +14960,8 @@
if (delta === -1) {
replies.reverse();
}
- for (_i = 0, _len = replies.length; _i < _len; _i++) {
- reply = replies[_i];
+ for (k = 0, len1 = replies.length; k < len1; k++) {
+ reply = replies[k];
if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) {
this.focus(reply);
return;
@@ -15010,10 +15025,10 @@
}
},
getThread: function() {
- var thread, threadRoot, _i, _len, _ref;
- _ref = $$('.thread');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- threadRoot = _ref[_i];
+ var k, len1, ref, thread, threadRoot;
+ ref = $$('.thread');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ threadRoot = ref[k];
thread = Get.threadFromRoot(threadRoot);
if (thread.isHidden && !thread.stub) {
continue;
@@ -15025,13 +15040,13 @@
return $('.board');
},
scroll: function(delta) {
- var axis, extra, next, thread, top, _ref;
- if ((_ref = d.activeElement) != null) {
- _ref.blur();
+ var axis, extra, next, ref, thread, top;
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
}
thread = Nav.getThread();
axis = delta === +1 ? 'following' : 'preceding';
- if (next = $.x("" + axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
+ if (next = $.x(axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
top = Header.getTopOf(thread);
if (delta === +1 && top < 5 || delta === -1 && top > -5) {
thread = next;
@@ -15039,7 +15054,7 @@
}
extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom;
if (extra > 0) {
- d.body.style.marginBottom = "" + extra + "px";
+ d.body.style.marginBottom = extra + "px";
}
Header.scrollTo(thread);
if (extra > 0 && !Nav.haveExtra) {
@@ -15051,7 +15066,7 @@
var extra;
extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;
if (extra > 0) {
- return d.body.style.marginBottom = "" + extra + "px";
+ return d.body.style.marginBottom = extra + "px";
} else {
d.body.style.marginBottom = null;
delete Nav.haveExtra;
@@ -15063,8 +15078,8 @@
RelativeDates = {
INTERVAL: $.MINUTE / 2,
init: function() {
- var _ref;
- if (((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
+ var ref;
+ if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
this.flush();
$.on(d, 'visibilitychange ThreadUpdate', this.flush);
}
@@ -15099,18 +15114,18 @@
if (rounded !== 1) {
unit += 's';
}
- return "" + rounded + " " + unit + " ago";
+ return rounded + " " + unit + " ago";
},
stale: [],
flush: function() {
- var data, now, _i, _len, _ref;
+ var data, k, len1, now, ref;
if (d.hidden) {
return;
}
now = new Date();
- _ref = RelativeDates.stale;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- data = _ref[_i];
+ ref = RelativeDates.stale;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ data = ref[k];
RelativeDates.update(data, now);
}
RelativeDates.stale = [];
@@ -15125,16 +15140,16 @@
return post.nodes.date.title = RelativeDates.relative(diff, now, date);
},
update: function(data, now) {
- var date, diff, isPost, relative, singlePost, _i, _len, _ref;
+ var date, diff, isPost, k, len1, ref, relative, singlePost;
isPost = data instanceof Post;
date = isPost ? data.info.date : new Date(+data.dataset.utc);
now || (now = new Date());
diff = now - date;
relative = RelativeDates.relative(diff, now, date);
if (isPost) {
- _ref = [data].concat(data.clones);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- singlePost = _ref[_i];
+ ref = [data].concat(data.clones);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ singlePost = ref[k];
singlePost.nodes.date.firstChild.textContent = relative;
}
} else {
@@ -15148,7 +15163,7 @@
return setTimeout(RelativeDates.markStale, delay, data);
},
markStale: function(data) {
- if (__indexOf.call(RelativeDates.stale, data) >= 0) {
+ if (indexOf.call(RelativeDates.stale, data) >= 0) {
return;
}
if (data instanceof Post && !g.posts[data.fullID]) {
@@ -15184,23 +15199,23 @@
return RemoveSpoilers.unspoiler(this.nodes.comment);
},
unspoiler: function(el) {
- var span, spoiler, spoilers, _i, _len;
+ var k, len1, span, spoiler, spoilers;
spoilers = $$('s', el);
- for (_i = 0, _len = spoilers.length; _i < _len; _i++) {
- spoiler = spoilers[_i];
+ for (k = 0, len1 = spoilers.length; k < len1; k++) {
+ spoiler = spoilers[k];
span = $.el('span', {
className: 'removed-spoiler'
});
$.replace(spoiler, span);
- $.add(span, __slice.call(spoiler.childNodes));
+ $.add(span, slice.call(spoiler.childNodes));
}
}
};
Time = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Time Formatting'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Time Formatting'])) {
return;
}
return Post.callbacks.push({
@@ -15329,7 +15344,7 @@
}
},
open: function(openSection) {
- var dialog, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
+ var dialog, k, len1, link, links, overlay, ref, section, sectionToOpen;
if (Settings.overlay) {
return;
}
@@ -15350,9 +15365,9 @@
$.on($('.reset', dialog), 'click', Settings.reset);
$.on($('input', dialog), 'change', Settings.onImport);
links = [];
- _ref = Settings.sections;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- section = _ref[_i];
+ ref = Settings.sections;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ section = ref[k];
link = $.el('a', {
className: "tab-" + section.hyphenatedTitle,
textContent: section.title,
@@ -15375,12 +15390,12 @@
return $.event('OpenSettings', null, dialog);
},
close: function() {
- var _ref;
+ var ref;
if (!Settings.dialog) {
return;
}
- if ((_ref = d.activeElement) != null) {
- _ref.blur();
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
}
$.rm(Settings.overlay);
$.rm(Settings.dialog);
@@ -15389,9 +15404,9 @@
},
sections: [],
addSection: function(title, open) {
- var hyphenatedTitle, _ref;
+ var hyphenatedTitle, ref;
if (typeof title !== 'string') {
- _ref = title.detail, title = _ref.title, open = _ref.open;
+ ref = title.detail, title = ref.title, open = ref.open;
}
hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-');
return Settings.sections.push({
@@ -15414,12 +15429,12 @@
return $.event('OpenSettings', null, section);
},
main: function(section) {
- var arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, _ref;
+ var arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, ref;
items = {};
inputs = {};
- _ref = Config.main;
- for (key in _ref) {
- obj = _ref[key];
+ ref = Config.main;
+ for (key in ref) {
+ obj = ref[key];
fs = $.el('fieldset', {
innerHTML: ""
});
@@ -15466,18 +15481,18 @@
$.get({
hiddenThreads: {},
hiddenPosts: {}
- }, function(_arg) {
- var ID, board, hiddenNum, hiddenPosts, hiddenThreads, thread, _ref1, _ref2;
- hiddenThreads = _arg.hiddenThreads, hiddenPosts = _arg.hiddenPosts;
+ }, function(arg) {
+ var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref1, ref2, thread;
+ hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts;
hiddenNum = 0;
- _ref1 = hiddenThreads.boards;
- for (ID in _ref1) {
- board = _ref1[ID];
+ ref1 = hiddenThreads.boards;
+ for (ID in ref1) {
+ board = ref1[ID];
hiddenNum += Object.keys(board).length;
}
- _ref2 = hiddenPosts.boards;
- for (ID in _ref2) {
- board = _ref2[ID];
+ ref2 = hiddenPosts.boards;
+ for (ID in ref2) {
+ board = ref2[ID];
for (ID in board) {
thread = board[ID];
hiddenNum += Object.keys(thread).length;
@@ -15487,9 +15502,9 @@
});
$.on(button, 'click', function() {
this.textContent = 'Hidden: 0';
- return $.get('hiddenThreads', {}, function(_arg) {
+ return $.get('hiddenThreads', {}, function(arg) {
var boardID, hiddenThreads;
- hiddenThreads = _arg.hiddenThreads;
+ hiddenThreads = arg.hiddenThreads;
for (boardID in hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
@@ -15552,7 +15567,7 @@
return reader.readAsText(file);
},
loadSettings: function(data, cb) {
- var convertSettings, key, val, version, _ref;
+ var convertSettings, key, ref, val, version;
version = data.version.split('.');
if (version[0] === '2') {
convertSettings = function(data, map) {
@@ -15632,9 +15647,9 @@
return c;
}
});
- _ref = Config.hotkeys;
- for (key in _ref) {
- val = _ref[key];
+ ref = Config.hotkeys;
+ for (key in ref) {
+ val = ref[key];
if (key in data.Conf) {
data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) {
return "" + (s[0].toUpperCase()) + s.slice(1);
@@ -15713,20 +15728,20 @@
return $.on(ta, 'change', $.cb.value);
},
advanced: function(section) {
- var applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, name, o, row, rows, software, ta, table, warning, withCredentials, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _len6, _m, _n, _o, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
+ var aa, applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, w, warning, withCredentials, y, z;
$.extend(section, {
- innerHTML: ""
+ innerHTML: ""
});
- _ref = $$('.warning', section);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- warning = _ref[_i];
+ ref = $$('.warning', section);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ warning = ref[k];
warning.hidden = Conf[warning.dataset.feature];
}
items = {};
inputs = {};
- _ref1 = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss'];
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- name = _ref1[_j];
+ ref1 = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'customCooldown'];
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ name = ref1[q];
input = $("[name='" + name + "']", section);
items[name] = Conf[name];
inputs[name] = input;
@@ -15751,7 +15766,7 @@
val = items[key];
input = inputs[key];
input.value = val;
- if (key === 'usercss') {
+ if (key === 'usercss' || key === 'customCooldown') {
continue;
}
Settings[key].call(input);
@@ -15768,11 +15783,11 @@
$.on(customCSS, 'change', Settings.togglecss);
$.on(applyCSS, 'click', Settings.usercss);
archBoards = {};
- _ref2 = Redirect.archives;
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- _ref3 = _ref2[_k], name = _ref3.name, boards = _ref3.boards, files = _ref3.files, software = _ref3.software, withCredentials = _ref3.withCredentials;
- for (_l = 0, _len3 = boards.length; _l < _len3; _l++) {
- boardID = boards[_l];
+ ref2 = Redirect.archives;
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ ref3 = ref2[u], name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials;
+ for (w = 0, len4 = boards.length; w < len4; w++) {
+ boardID = boards[w];
o = archBoards[boardID] || (archBoards[boardID] = {
thread: [[], []],
post: [[], []],
@@ -15783,16 +15798,16 @@
if (software === 'foolfuuka') {
o.post[i].push(name);
}
- if (__indexOf.call(files, boardID) >= 0) {
+ if (indexOf.call(files, boardID) >= 0) {
o.file[i].push(name);
}
}
}
for (boardID in archBoards) {
o = archBoards[boardID];
- _ref4 = ['thread', 'post', 'file'];
- for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) {
- item = _ref4[_m];
+ ref4 = ['thread', 'post', 'file'];
+ for (y = 0, len5 = ref4.length; y < len5; y++) {
+ item = ref4[y];
i = o[item][0].length ? 1 : 0;
o[item][i].push('disabled');
o[item] = o[item][0].concat(o[item][1]);
@@ -15800,9 +15815,9 @@
}
rows = [];
boardOptions = [];
- _ref5 = Object.keys(archBoards).sort();
- for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) {
- boardID = _ref5[_n];
+ ref5 = Object.keys(archBoards).sort();
+ for (z = 0, len6 = ref5.length; z < len6; z++) {
+ boardID = ref5[z];
row = $.el('tr', {
className: "board-" + boardID
});
@@ -15813,9 +15828,9 @@
selected: boardID === g.BOARD.ID
}));
o = archBoards[boardID];
- _ref6 = ['thread', 'post', 'file'];
- for (_o = 0, _len6 = _ref6.length; _o < _len6; _o++) {
- item = _ref6[_o];
+ ref6 = ['thread', 'post', 'file'];
+ for (aa = 0, len7 = ref6.length; aa < len7; aa++) {
+ item = ref6[aa];
$.add(row, Settings.addArchiveCell(boardID, o, item));
}
rows.push(row);
@@ -15831,9 +15846,9 @@
$('tbody > :not([hidden])', table).hidden = true;
return $("tbody > ." + this.value, table).hidden = false;
});
- $.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
+ $.get('selectedArchives', Conf['selectedArchives'], function(arg) {
var data, option, selectedArchives, type;
- selectedArchives = _arg.selectedArchives;
+ selectedArchives = arg.selectedArchives;
for (boardID in selectedArchives) {
data = selectedArchives[boardID];
for (type in data) {
@@ -15878,10 +15893,10 @@
},
saveSelectedArchive: function() {
return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) {
- return function(_arg) {
- var selectedArchives, _name;
- selectedArchives = _arg.selectedArchives;
- (selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value;
+ return function(arg) {
+ var name1, selectedArchives;
+ selectedArchives = arg.selectedArchives;
+ (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = {}))[_this.dataset.type] = _this.value;
return $.set('selectedArchives', selectedArchives);
};
})(this));
@@ -15940,7 +15955,7 @@
return CustomCSS.update();
},
keybinds: function(section) {
- var arr, input, inputs, items, key, tbody, tr, _ref;
+ var arr, input, inputs, items, key, ref, tbody, tr;
$.extend(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.
"
});
@@ -15948,9 +15963,9 @@
tbody = $('tbody', section);
items = {};
inputs = {};
- _ref = Config.hotkeys;
- for (key in _ref) {
- arr = _ref[key];
+ ref = Config.hotkeys;
+ for (key in ref) {
+ arr = ref[key];
tr = $.el('tr', {
innerHTML: "" + E(arr[1]) + " | | "
});
@@ -15987,7 +16002,7 @@
Main = {
init: function() {
- var db, flatten, pathname, type, _i, _len, _ref, _ref1;
+ var db, flatten, k, len1, pathname, ref, ref1, type;
if (location.hostname === 'www.google.com') {
type = location.pathname === '/recaptcha/api/fallback' ? 'noscript' : 'v2';
return $.ready(function() {
@@ -15998,7 +16013,7 @@
g.posts = new SimpleDict();
pathname = location.pathname.split('/');
g.BOARD = new Board(pathname[1]);
- if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
+ if ((ref = g.BOARD.ID) === 'z' || ref === 'fk') {
return;
}
g.VIEW = (function() {
@@ -16031,9 +16046,9 @@
}
};
flatten(null, Config);
- _ref1 = DataBoard.keys;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- db = _ref1[_i];
+ ref1 = DataBoard.keys;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ db = ref1[k];
Conf[db] = {
boards: {}
};
@@ -16052,7 +16067,7 @@
});
},
initFeatures: function() {
- var err, feature, name, pathname, _i, _len, _ref, _ref1;
+ var err, feature, k, len1, name, pathname, ref, ref1;
switch (location.hostname) {
case 'a.4cdn.org':
return;
@@ -16062,8 +16077,8 @@
$.asap((function() {
return d.readyState !== 'loading';
}), function() {
- var URL, pathname, video, _ref;
- if (Conf['404 Redirect'] && ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found')) {
+ var URL, pathname, ref, video;
+ if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
Redirect.init();
pathname = location.pathname.split('/');
URL = Redirect.to('file', {
@@ -16092,9 +16107,9 @@
history.replaceState(null, '', pathname.slice(0, 4).join('/') + location.hash);
}
}
- _ref = Main.features;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- _ref1 = _ref[_i], name = _ref1[0], feature = _ref1[1];
+ ref = Main.features;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ref1 = ref[k], name = ref1[0], feature = ref1[1];
try {
feature.init();
} catch (_error) {
@@ -16108,12 +16123,12 @@
return $.ready(Main.initReady);
},
initStyle: function() {
- var _ref;
+ var ref;
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return;
}
- if ((_ref = $('link[href*=mobile]', d.head)) != null) {
- _ref.disabled = true;
+ if ((ref = $('link[href*=mobile]', d.head)) != null) {
+ ref.disabled = true;
}
$.addClass(doc, 'fourchan-x', 'seaweedchan');
$.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW);
@@ -16131,10 +16146,10 @@
mainStyleSheet = $('link[title=switch]', d.head);
styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
setStyle = function() {
- var styleSheet, _i, _len;
+ var k, len1, styleSheet;
$.rmClass(doc, style);
- for (_i = 0, _len = styleSheets.length; _i < _len; _i++) {
- styleSheet = styleSheets[_i];
+ for (k = 0, len1 = styleSheets.length; k < len1; k++) {
+ styleSheet = styleSheets[k];
if (styleSheet.href === mainStyleSheet.href) {
style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-');
break;
@@ -16152,8 +16167,8 @@
});
},
initReady: function() {
- var GMver, err, i, passLink, styleSelector, v, _i, _len, _ref, _ref1;
- if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
+ var GMver, err, i, k, len1, passLink, ref, ref1, styleSelector, v;
+ if ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') {
if (g.VIEW === 'thread') {
ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
var href;
@@ -16184,9 +16199,9 @@
} else {
$.event('4chanXInitFinished');
}
- $.get('previousversion', null, function(_arg) {
+ $.get('previousversion', null, function(arg) {
var el, previousversion;
- previousversion = _arg.previousversion;
+ previousversion = arg.previousversion;
if (previousversion === g.VERSION) {
return;
}
@@ -16202,9 +16217,9 @@
});
if (Conf['Show Support Message']) {
GMver = GM_info.version.split('.');
- _ref1 = "1.14".split('.');
- for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) {
- v = _ref1[i];
+ ref1 = "1.14".split('.');
+ for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) {
+ v = ref1[i];
if (v === GMver[i]) {
continue;
}
@@ -16220,18 +16235,18 @@
}
},
initThread: function() {
- var board, err, errors, m, postRoot, posts, scriptData, thread, threadRoot, threads, _i, _j, _len, _len1, _ref, _ref1;
+ var board, err, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads;
if (board = $('.board')) {
threads = [];
posts = [];
- _ref = $$('.board > .thread', board);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- threadRoot = _ref[_i];
+ ref = $$('.board > .thread', board);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ threadRoot = ref[k];
thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
threads.push(thread);
- _ref1 = $$('.thread > .postContainer', threadRoot);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- postRoot = _ref1[_j];
+ ref1 = $$('.thread > .postContainer', threadRoot);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ postRoot = ref1[q];
try {
posts.push(new Post(postRoot, thread, g.BOARD));
} catch (_error) {
@@ -16257,9 +16272,9 @@
}
Main.callbackNodes(Thread, threads);
return Main.callbackNodesDB(Post, posts, function() {
- var post, _k, _len2;
- for (_k = 0, _len2 = posts.length; _k < _len2; _k++) {
- post = posts[_k];
+ var len3, post, u;
+ for (u = 0, len3 = posts.length; u < len3; u++) {
+ post = posts[u];
QuoteThreading.insert(post);
}
return $.event('4chanXInitFinished');
@@ -16303,7 +16318,7 @@
return softTask();
},
handleErrors: function(errors) {
- var div, error, logs, _i, _len;
+ var div, error, k, len1, logs;
if (!(errors instanceof Array)) {
error = errors;
} else if (errors.length === 1) {
@@ -16317,14 +16332,14 @@
innerHTML: E(errors.length) + " errors occurred. [show]"
});
$.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;
+ var ref;
+ return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref;
});
logs = $.el('div', {
hidden: true
});
- for (_i = 0, _len = errors.length; _i < _len; _i++) {
- error = errors[_i];
+ for (k = 0, len1 = errors.length; k < len1; k++) {
+ error = errors[k];
$.add(logs, Main.parseError(error));
}
return new Notice('error', [div, logs], 30);
@@ -16336,14 +16351,14 @@
textContent: data.message
});
error = $.el('div', {
- textContent: "" + (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
+ textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
});
return [message, error];
},
isThisPageLegit: function() {
- var _ref;
+ 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');
+ 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');
}
return Main.thisPageIsLegit;
},
@@ -17229,6 +17244,47 @@
" bottom: auto;\n" +
" top: 1px;\n" +
"}\n" +
+"@media (min-width: 1300px) {\n" +
+" :root.fixed:not(.centered-links) #header-bar {\n" +
+" font-size: 12px;\n" +
+" white-space: nowrap;\n" +
+" display: flex;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #board-list {\n" +
+" flex: auto;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list {\n" +
+" display: flex;\n" +
+" line-height: 15px;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) .hide-board-list-container {\n" +
+" flex: none;\n" +
+" margin-right: 5px;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList {\n" +
+" flex: auto;\n" +
+" display: flex;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > a,\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {\n" +
+" flex: none;\n" +
+" padding: .17em;\n" +
+" margin: -.17em -.32em;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span {\n" +
+" pointer-events: none;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span.space {\n" +
+" flex: 0 .63 .63em;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {\n" +
+" flex: 0 .38 .38em;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #shortcuts {\n" +
+" float: initial;\n" +
+" flex: none;\n" +
+" }\n" +
+"}\n" +
"/* 4chan X link brackets */\n" +
".brackets-wrap::before {\n" +
" content: \"[\";\n" +
@@ -17801,13 +17857,6 @@
" max-height: 80vh;\n" +
" max-width: 50vw;\n" +
"}\n" +
-".qphl {\n" +
-" outline: 2px solid rgba(216, 94, 49, .7);\n" +
-"}\n" +
-":root.highlight-own .yourPost > .reply,\n" +
-":root.highlight-you .quotesYou > .reply {\n" +
-" border-left: 2px solid rgba(221,0,0,.5);\n" +
-"}\n" +
"/* Quote Threading */\n" +
".threadContainer {\n" +
" margin-left: 20px;\n" +
@@ -17898,10 +17947,6 @@
" -webkit-align-self: stretch;\n" +
" align-self: stretch;\n" +
"}\n" +
-".catalog-thread.watched .werkTyme-filename,\n" +
-".filter-highlight .werkTyme-filename {\n" +
-" border: 2px solid rgba(255, 0, 0, .5);\n" +
-"}\n" +
"/* Index/Reply Navigation */\n" +
"#navlinks {\n" +
" font-size: 16px;\n" +
@@ -17911,16 +17956,37 @@
":root.catalog-mode #navlinks {\n" +
" display: none;\n" +
"}\n" +
-"/* Filter */\n" +
-".opContainer.filter-highlight {\n" +
-" box-shadow: inset 5px 0 rgba(255, 0, 0, .5);\n" +
+"/* Highlighting */\n" +
+".qphl {\n" +
+" outline: 2px solid rgba(216, 94, 49, .8);\n" +
"}\n" +
+":root.highlight-own .yourPost > .reply,\n" +
+":root.highlight-you .quotesYou > .reply,\n" +
".filter-highlight > .reply {\n" +
-" box-shadow: -5px 0 rgba(255, 0, 0, .5);\n" +
+" border-left: 3px solid rgba(221, 0, 0, .8);\n" +
+"}\n" +
+":root.highlight-own .yourPost > div.sideArrows,\n" +
+":root.highlight-you .quotesYou > div.sideArrows,\n" +
+".filter-highlight > div.sideArrows {\n" +
+" color: rgba(221, 0, 0, .8);\n" +
+"}\n" +
+":root.highlight-own .yourPost.opContainer,\n" +
+":root.highlight-you .quotesYou.opContainer,\n" +
+".filter-highlight.opContainer {\n" +
+" border-left: 3px solid rgba(221, 0, 0, .8);\n" +
+"}\n" +
+":root.highlight-own .yourPost.opContainer::after,\n" +
+":root.highlight-you .quotesYou.opContainer::after,\n" +
+".filter-highlight.opContainer::after {\n" +
+" content: \"\";\n" +
+" display: block;\n" +
+" clear: both;\n" +
"}\n" +
".catalog-thread.watched .catalog-thumb,\n" +
-".filter-highlight .catalog-thumb {\n" +
-" border: 2px solid rgba(255, 0, 0, .5);\n" +
+".filter-highlight .catalog-thumb,\n" +
+".catalog-thread.watched .werkTyme-filename,\n" +
+".filter-highlight .werkTyme-filename {\n" +
+" border: 2px solid rgba(221, 0, 0, .8);\n" +
"}\n" +
"/* Spoiler text */\n" +
":root.reveal-spoilers s,\n" +
@@ -17975,8 +18041,9 @@
" display: none !important;\n" +
"}\n" +
"#qr select,\n" +
-"#dump-button,\n" +
"#url-button,\n" +
+"#custom-cooldown-button,\n" +
+"#dump-button,\n" +
".remove,\n" +
".captcha-img {\n" +
" cursor: pointer;\n" +
@@ -18031,7 +18098,7 @@
" -webkit-flex-direction: row;\n" +
" flex-direction: row;\n" +
"}\n" +
-"#dump-button {\n" +
+"#url-button, #custom-cooldown-button, #dump-button {\n" +
" width: 10%;\n" +
" margin: 0;\n" +
" margin-right: 4px;\n" +
@@ -18039,13 +18106,8 @@
" padding: 1px 0px 2px;\n" +
" opacity: 0.6;\n" +
"}\n" +
-"#url-button {\n" +
-" width: 10%;\n" +
-" margin: 0;\n" +
-" margin-right: 4px;\n" +
-" font: 13px sans-serif;\n" +
-" padding: 1px 0px 2px;\n" +
-" opacity: 0.6;\n" +
+"#custom-cooldown-button.disabled {\n" +
+" opacity: 0.27;\n" +
"}\n" +
".persona .field {\n" +
" -webkit-flex: 1;\n" +
@@ -18190,6 +18252,9 @@
"#file-n-submit {\n" +
" height: 23px;\n" +
"}\n" +
+"#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {\n" +
+" display: none;\n" +
+"}\n" +
"#qr input[type=\"file\"] {\n" +
" visibility: hidden;\n" +
" position: absolute;\n" +
@@ -18757,9 +18822,6 @@
":root.yotsuba #board-list a, :root.yotsuba #shortcuts a {\n" +
" color: #800000;\n" +
"}\n" +
-":root.yotsuba.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(178,0,0,0.2);\n" +
-"}\n" +
":root.yotsuba.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -18836,9 +18898,6 @@
":root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a {\n" +
" color: #34345C;\n" +
"}\n" +
-":root.yotsuba-b.fixed #custom-board-list .current {\n" +
-" border-bottom: 1px solid rgba(30, 30, 255, 0.2);\n" +
-"}\n" +
":root.yotsuba-b.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -18915,9 +18974,6 @@
":root.futaba #header-bar a, :root.futaba #notifications a {\n" +
" color: #800000;\n" +
"}\n" +
-":root.futaba.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(178,0,0,0.2);\n" +
-"}\n" +
":root.futaba.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -18989,9 +19045,6 @@
":root.burichan #header-bar a, :root.burichan #header-bar #notifications a {\n" +
" color: #34345C;\n" +
"}\n" +
-":root.burichan.fixed #custom-board-list .current {\n" +
-" border-bottom: 1px solid rgba(30, 30, 255, 0.2);\n" +
-"}\n" +
":root.burichan.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -19063,9 +19116,6 @@
":root.tomorrow #header-bar a, :root.tomorrow #notifications a {\n" +
" color: #81A2BE;\n" +
"}\n" +
-":root.tomorrow.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(83,124,160,0.4);\n" +
-"}\n" +
":root.tomorrow.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(95,137,172,0.4);\n" +
"}\n" +
@@ -19091,6 +19141,31 @@
" border-color: #111;\n" +
" background-color: rgba(0, 0, 0, .14);\n" +
"}\n" +
+"/* Highlighting */\n" +
+":root.tomorrow .qphl {\n" +
+" outline: 2px solid rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow.highlight-own .yourPost > .reply,\n" +
+":root.tomorrow.highlight-you .quotesYou > .reply,\n" +
+":root.tomorrow .filter-highlight > .reply {\n" +
+" border-left: 3px solid rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow.highlight-own .yourPost > div.sideArrows,\n" +
+":root.tomorrow.highlight-you .quotesYou > div.sideArrows,\n" +
+":root.tomorrow .filter-highlight > div.sideArrows {\n" +
+" color: rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow.highlight-own .yourPost.opContainer,\n" +
+":root.tomorrow.highlight-you .quotesYou.opContainer,\n" +
+":root.tomorrow .opContainer.filter-highlight {\n" +
+" border-left: 3px solid rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow .catalog-thread.watched .catalog-thumb,\n" +
+":root.tomorrow .filter-highlight .catalog-thumb,\n" +
+":root.tomorrow .catalog-thread.watched .werkTyme-filename,\n" +
+":root.tomorrow .filter-highlight .werkTyme-filename {\n" +
+" border: 2px solid rgb(64, 192, 255);\n" +
+"}\n" +
"/* QR */\n" +
".tomorrow #dump-list::-webkit-scrollbar-thumb {\n" +
" background-color: #282A2E;\n" +
@@ -19128,6 +19203,10 @@
":root.tomorrow .focused.entry {\n" +
" background: rgba(0, 0, 0, .33);\n" +
"}\n" +
+"/* Unread */\n" +
+":root.tomorrow #unread-line {\n" +
+" border-color: rgb(197, 200, 198);\n" +
+"}\n" +
"/* Thread Watcher */\n" +
":root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.disabled.replies-quoting-you {\n" +
" color: #F00 !important;\n" +
@@ -19161,9 +19240,6 @@
":root.photon #header-bar a, :root.photon #notifications a {\n" +
" color: #FF6600;\n" +
"}\n" +
-":root.photon.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(0,74,153,0.2);\n" +
-"}\n" +
":root.photon.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,51,0,0.2);\n" +
"}\n" +
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index 1dbf372dc..d53517013 100644
Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ
diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js
index 2a9bfe5ca..273d316e7 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.10.1.14
+// @version 1.10.2.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 565857be1..badc4d6fd 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
-// @version 1.10.1.14
+// @version 1.10.2.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -26,7 +26,7 @@
// ==/UserScript==
/*
-* 4chan X - Version 1.10.1.14
+* 4chan X - Version 1.10.2.0
*
* Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
@@ -110,26 +110,11 @@
(function() {
var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g,
- __slice = [].slice,
- __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
-
- Array.prototype.indexOf = function(val, i) {
- var len;
- i || (i = 0);
- len = this.length;
- while (i < len) {
- if (this[i] === val) {
- return i;
- }
- i++;
- }
- return -1;
- };
-
- __indexOf = [].indexOf;
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
Config = {
main: {
@@ -394,7 +379,9 @@
'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.']
},
'Interval': 30
- }
+ },
+ customCooldown: 0,
+ customCooldownEnabled: true
};
Conf = {};
@@ -406,7 +393,7 @@
doc = d.documentElement;
g = {
- VERSION: '1.10.1.14',
+ VERSION: '1.10.2.0',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@@ -567,10 +554,10 @@
return;
}
$.on(req, 'load', function(e) {
- var _i, _len, _ref;
- _ref = this.callbacks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- cb = _ref[_i];
+ var k, len1, ref;
+ ref = this.callbacks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ cb = ref[k];
cb.call(this, e);
}
this.evt = e;
@@ -652,19 +639,19 @@
};
$.addClass = function() {
- var className, classNames, el, _i, _len;
- el = arguments[0], classNames = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- for (_i = 0, _len = classNames.length; _i < _len; _i++) {
- className = classNames[_i];
+ var className, classNames, el, k, len1;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (k = 0, len1 = classNames.length; k < len1; k++) {
+ className = classNames[k];
el.classList.add(className);
}
};
$.rmClass = function() {
- var className, classNames, el, _i, _len;
- el = arguments[0], classNames = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
- for (_i = 0, _len = classNames.length; _i < _len; _i++) {
- className = classNames[_i];
+ var className, classNames, el, k, len1;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (k = 0, len1 = classNames.length; k < len1; k++) {
+ className = classNames[k];
el.classList.remove(className);
}
};
@@ -674,7 +661,7 @@
};
$.hasClass = function(el, className) {
- return __indexOf.call(el.classList, className) >= 0;
+ return indexOf.call(el.classList, className) >= 0;
};
$.rm = function(el) {
@@ -694,13 +681,13 @@
};
$.nodes = function(nodes) {
- var frag, node, _i, _len;
+ var frag, k, len1, node;
if (!(nodes instanceof Array)) {
return nodes;
}
frag = $.frag();
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- node = nodes[_i];
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ node = nodes[k];
frag.appendChild(node);
}
return frag;
@@ -736,19 +723,19 @@
};
$.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];
+ var event, k, len1, ref;
+ ref = events.split(' ');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
el.addEventListener(event, handler, false);
}
};
$.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];
+ var event, k, len1, ref;
+ ref = events.split(' ');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
el.removeEventListener(event, handler, false);
}
};
@@ -840,7 +827,7 @@
unit++;
}
size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size);
- return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit];
+ return size + " " + ['B', 'KB', 'MB', 'GB'][unit];
};
$.minmax = function(value, min, max) {
@@ -887,9 +874,9 @@
return cb(void 0, key);
}
};
- $.on(window, 'storage', function(_arg) {
+ $.on(window, 'storage', function(arg) {
var key;
- key = _arg.key;
+ key = arg.key;
return onChange(key);
});
return $.forceSync = function(key) {
@@ -898,12 +885,12 @@
})();
$["delete"] = function(keys) {
- var key, _i, _len;
+ var k, key, len1;
if (!(keys instanceof Array)) {
keys = [keys];
}
- for (_i = 0, _len = keys.length; _i < _len; _i++) {
- key = keys[_i];
+ for (k = 0, len1 = keys.length; k < len1; k++) {
+ key = keys[k];
key = g.NAMESPACE + key;
GM_deleteValue(key);
if (key in $.syncing) {
@@ -962,34 +949,34 @@
$["delete"](Object.keys(Conf));
$["delete"](['previousversion', 'AutoWatch', 'cooldown.global', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']);
$["delete"]((function() {
- var _i, _len, _ref, _results;
- _ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- id = _ref[_i];
- _results.push("" + id + ".position");
+ var k, len1, ref, results;
+ ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ id = ref[k];
+ results.push(id + ".position");
}
- return _results;
+ return results;
})());
boards = (function() {
- var _i, _len, _ref, _results;
- _ref = $$('#boardNavDesktop > .boardList > a');
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
- _results.push(a.textContent);
+ var k, len1, ref, results;
+ ref = $$('#boardNavDesktop > .boardList > a');
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
+ results.push(a.textContent);
}
- return _results;
+ return results;
})();
boards.push('qa');
$["delete"]((function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = boards.length; _i < _len; _i++) {
- board = boards[_i];
- _results.push("cooldown." + board);
+ var k, len1, results;
+ results = [];
+ for (k = 0, len1 = boards.length; k < len1; k++) {
+ board = boards[k];
+ results.push("cooldown." + board);
}
- return _results;
+ return results;
})());
try {
$["delete"](GM_listValues().map(function(key) {
@@ -1003,18 +990,18 @@
if (root == null) {
root = d.body;
}
- return __slice.call(root.querySelectorAll(selector));
+ return slice.call(root.querySelectorAll(selector));
};
Callbacks = (function() {
- function Callbacks(type) {
- this.type = type;
+ function Callbacks(type1) {
+ this.type = type1;
this.keys = [];
}
- Callbacks.prototype.push = function(_arg) {
+ Callbacks.prototype.push = function(arg) {
var cb, name;
- name = _arg.name, cb = _arg.cb;
+ name = arg.name, cb = arg.cb;
if (!this[name]) {
this.keys.push(name);
}
@@ -1022,10 +1009,10 @@
};
Callbacks.prototype.execute = function(node) {
- var err, errors, name, _i, _len, _ref;
- _ref = this.keys;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ var err, errors, k, len1, name, ref;
+ ref = this.keys;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
try {
this[name].call(node);
} catch (_error) {
@@ -1053,8 +1040,8 @@
return this.ID;
};
- function Board(ID) {
- this.ID = ID;
+ function Board(ID1) {
+ this.ID = ID1;
this.threads = new SimpleDict();
this.posts = new SimpleDict();
g.boards[this] = this;
@@ -1071,10 +1058,10 @@
return this.ID;
};
- function Thread(ID, board) {
- this.ID = ID;
- this.board = board;
- this.fullID = "" + this.board + "." + this.ID;
+ function Thread(ID1, board1) {
+ this.ID = ID1;
+ this.board = board1;
+ this.fullID = this.board + "." + this.ID;
this.posts = new SimpleDict();
this.isDead = false;
this.isHidden = false;
@@ -1087,12 +1074,13 @@
this.ipCount = void 0;
this.OP = null;
this.catalogView = null;
- g.threads.push(this.fullID, board.threads.push(this, this));
+ this.board.threads.push(this.ID, this);
+ g.threads.push(this.fullID, this);
}
Thread.prototype.setPage = function(pageNum) {
- var icon, info, quote, _ref;
- _ref = this.OP.nodes, info = _ref.info, quote = _ref.quote;
+ var icon, info, quote, ref;
+ ref = this.OP.nodes, info = ref.info, quote = ref.quote;
if (!(icon = $('.page-num', info))) {
icon = $.el('span', {
className: 'page-num'
@@ -1111,7 +1099,7 @@
if (!this.catalogView) {
return;
}
- el = this.catalogView.nodes["" + type + "Count"];
+ el = this.catalogView.nodes[type + "Count"];
el.textContent = count;
return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning');
};
@@ -1150,7 +1138,7 @@
src: "" + Build.staticPath + typeLC + Build.gifIcon,
alt: type,
title: type,
- className: "" + typeLC + "Icon retina"
+ className: typeLC + "Icon retina"
});
root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote;
$.after(root, [$.tn(' '), icon]);
@@ -1183,8 +1171,8 @@
return this.ID;
};
- function CatalogThread(root, thread) {
- this.thread = thread;
+ function CatalogThread(root, thread1) {
+ this.thread = thread1;
this.ID = this.thread.ID;
this.board = this.thread.board;
this.nodes = {
@@ -1210,12 +1198,12 @@
return this.ID;
};
- function Post(root, thread, board) {
- var capcode, clone, date, email, flag, info, name, post, subject, tripcode, uniqueID, _i, _len, _ref;
- this.thread = thread;
- this.board = board;
+ function Post(root, thread1, board1) {
+ var capcode, clone, date, email, flag, info, k, len1, name, post, ref, subject, tripcode, uniqueID;
+ this.thread = thread1;
+ this.board = board1;
this.ID = +root.id.slice(2);
- this.fullID = "" + this.board + "." + this.ID;
+ this.fullID = this.board + "." + this.ID;
post = $('.post', root);
info = $('.postInfo', post);
this.nodes = {
@@ -1281,31 +1269,33 @@
if (g.posts[this.fullID]) {
this.isRebuilt = true;
this.clones = g.posts[this.fullID].clones;
- _ref = this.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.origin = this;
}
}
- g.posts.push(this.fullID, thread.posts.push(this, board.posts.push(this, this)));
+ this.board.posts.push(this.ID, this);
+ this.thread.posts.push(this.ID, this);
+ g.posts.push(this.fullID, this);
}
Post.prototype.parseComment = function() {
- var bq, node, spoilers, _i, _len, _ref;
+ var bq, k, len1, node, ref, spoilers;
this.nodes.comment.normalize();
bq = this.nodes.comment.cloneNode(true);
- _ref = $$('.abbr, .exif, b, marquee', bq);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $$('.abbr, .exif, b, marquee', bq);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
$.rm(node);
}
this.info.comment = this.nodesToText(bq);
spoilers = $$('s', bq);
return this.info.commentSpoilered = (function() {
- var _j, _len1;
+ var len2, q;
if (spoilers.length) {
- for (_j = 0, _len1 = spoilers.length; _j < _len1; _j++) {
- node = spoilers[_j];
+ for (q = 0, len2 = spoilers.length; q < len2; q++) {
+ node = spoilers[q];
$.replace(node, $.tn('[spoiler]'));
}
return this.nodesToText(bq);
@@ -1327,11 +1317,11 @@
};
Post.prototype.parseQuotes = function() {
- var quotelink, _i, _len, _ref;
+ var k, len1, quotelink, ref;
this.quotes = [];
- _ref = $$(':not(pre) > .quotelink', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = $$(':not(pre) > .quotelink', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
this.parseQuote(quotelink);
}
};
@@ -1345,8 +1335,8 @@
if (this.isClone) {
return;
}
- fullID = "" + match[1] + "." + match[2];
- if (__indexOf.call(this.quotes, fullID) < 0) {
+ fullID = match[1] + "." + match[2];
+ if (indexOf.call(this.quotes, fullID) < 0) {
return this.quotes.push(fullID);
}
};
@@ -1372,7 +1362,7 @@
size *= 1024;
}
this.file.sizeInBytes = size;
- this.file.thumbURL = "" + location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
+ this.file.thumbURL = location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
this.file.isImage = /(jpg|png|gif)$/i.test(this.file.URL);
this.file.isVideo = /webm$/i.test(this.file.URL);
nameNode = $('a', fileText);
@@ -1383,7 +1373,7 @@
};
Post.prototype.kill = function(file) {
- var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
+ var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
if (file) {
if (this.file.isDead) {
return;
@@ -1408,17 +1398,17 @@
if (this.isClone) {
return;
}
- _ref = this.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.kill(file);
}
if (file) {
return;
}
- _ref1 = Get.allQuotelinksLinkingTo(this);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- quotelink = _ref1[_j];
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ quotelink = ref1[q];
if (!(!$.hasClass(quotelink, 'deadlink'))) {
continue;
}
@@ -1428,7 +1418,7 @@
};
Post.prototype.resurrect = function() {
- var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1;
+ var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
delete this.isDead;
$.rmClass(this.nodes.root, 'deleted-post');
strong = $('strong.warning', this.nodes.info);
@@ -1440,14 +1430,14 @@
if (this.isClone) {
return;
}
- _ref = this.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.resurrect();
}
- _ref1 = Get.allQuotelinksLinkingTo(this);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- quotelink = _ref1[_j];
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ quotelink = ref1[q];
if (!($.hasClass(quotelink, 'deadlink'))) {
continue;
}
@@ -1468,11 +1458,11 @@
};
Post.prototype.rmClone = function(index) {
- var clone, _i, _len, _ref;
+ var clone, k, len1, ref;
this.clones.splice(index, 1);
- _ref = this.clones.slice(index);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = this.clones.slice(index);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.nodes.root.dataset.clone = index++;
}
};
@@ -1481,19 +1471,19 @@
})();
- Clone = (function(_super) {
- __extends(Clone, _super);
+ Clone = (function(superClass) {
+ extend(Clone, superClass);
- function Clone(origin, context, contractThumb) {
- 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'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- key = _ref[_i];
- this[key] = origin[key];
+ function Clone(origin1, context1, contractThumb) {
+ var file, info, inline, inlined, k, key, len1, len2, len3, nodes, post, q, ref, ref1, ref2, ref3, root, u, val;
+ this.origin = origin1;
+ this.context = context1;
+ ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ key = ref[k];
+ this[key] = this.origin[key];
}
- nodes = origin.nodes;
+ nodes = this.origin.nodes;
root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true);
post = $('.post', root);
info = $('.postInfo', post);
@@ -1507,14 +1497,14 @@
quotelinks: [],
backlinks: info.getElementsByClassName('backlink')
};
- _ref1 = $$('.inline', post);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- inline = _ref1[_j];
+ ref1 = $$('.inline', post);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ inline = ref1[q];
$.rm(inline);
}
- _ref2 = $$('.inlined', post);
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- inlined = _ref2[_k];
+ ref2 = $$('.inlined', post);
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ inlined = ref2[u];
$.rmClass(inlined, 'inlined');
}
root.hidden = false;
@@ -1545,11 +1535,11 @@
this.nodes.date = $('.dateTime', info);
}
this.parseQuotes();
- if (origin.file) {
+ if (this.origin.file) {
this.file = {};
- _ref3 = origin.file;
- for (key in _ref3) {
- val = _ref3[key];
+ ref3 = this.origin.file;
+ for (key in ref3) {
+ val = ref3[key];
this.file[key] = val;
}
file = $('.file', post);
@@ -1564,22 +1554,22 @@
ImageExpand.contract(this);
}
}
- if (origin.isDead) {
+ if (this.origin.isDead) {
this.isDead = true;
}
this.isClone = true;
- root.dataset.clone = origin.clones.push(this) - 1;
+ root.dataset.clone = this.origin.clones.push(this) - 1;
}
Clone.prototype.cloneWithoutVideo = function(node) {
- var child, clone, _i, _len, _ref;
+ var child, clone, k, len1, ref;
if (node.tagName === 'VIDEO' && !node.dataset.md5) {
return [];
} else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) {
clone = node.cloneNode(false);
- _ref = node.childNodes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- child = _ref[_i];
+ ref = node.childNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ child = ref[k];
$.add(clone, this.cloneWithoutVideo(child));
}
return clone;
@@ -1595,12 +1585,12 @@
DataBoard = (function() {
DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'customTitles'];
- function DataBoard(key, sync, dontClean) {
+ function DataBoard(key1, sync, dontClean) {
var init;
- this.key = key;
- this.onSync = __bind(this.onSync, this);
- this.data = Conf[key];
- $.sync(key, this.onSync);
+ this.key = key1;
+ this.onSync = bind(this.onSync, this);
+ this.data = Conf[this.key];
+ $.sync(this.key, this.onSync);
if (!dontClean) {
this.clean();
}
@@ -1620,12 +1610,12 @@
return $.set(this.key, this.data, cb);
};
- DataBoard.prototype["delete"] = function(_arg) {
- var boardID, postID, threadID, _ref;
- boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID;
+ DataBoard.prototype["delete"] = function(arg) {
+ var boardID, postID, ref, threadID;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
$.forceSync(this.key);
if (postID) {
- if (!((_ref = this.data.boards[boardID]) != null ? _ref[threadID] : void 0)) {
+ if (!((ref = this.data.boards[boardID]) != null ? ref[threadID] : void 0)) {
return;
}
delete this.data.boards[boardID][threadID][postID];
@@ -1647,9 +1637,9 @@
return this.save();
};
- DataBoard.prototype.deleteIfEmpty = function(_arg) {
+ DataBoard.prototype.deleteIfEmpty = function(arg) {
var boardID, threadID;
- boardID = _arg.boardID, threadID = _arg.threadID;
+ boardID = arg.boardID, threadID = arg.threadID;
$.forceSync(this.key);
if (threadID) {
if (!Object.keys(this.data.boards[boardID][threadID]).length) {
@@ -1663,27 +1653,27 @@
}
};
- DataBoard.prototype.set = function(_arg, cb) {
- var boardID, postID, threadID, val, _base, _base1, _base2;
- boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val;
+ DataBoard.prototype.set = function(arg, cb) {
+ var base1, base2, base3, boardID, postID, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val;
$.forceSync(this.key);
if (postID !== void 0) {
- ((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val;
+ ((base1 = ((base2 = this.data.boards)[boardID] || (base2[boardID] = {})))[threadID] || (base1[threadID] = {}))[postID] = val;
} else if (threadID !== void 0) {
- ((_base2 = this.data.boards)[boardID] || (_base2[boardID] = {}))[threadID] = val;
+ ((base3 = this.data.boards)[boardID] || (base3[boardID] = {}))[threadID] = val;
} else {
this.data.boards[boardID] = val;
}
return this.save(cb);
};
- 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;
+ DataBoard.prototype.get = function(arg) {
+ var ID, board, boardID, defaultValue, k, len1, postID, thread, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue;
if (board = this.data.boards[boardID]) {
if (!threadID) {
if (postID) {
- for (thread = _i = 0, _len = board.length; _i < _len; thread = ++_i) {
+ for (thread = k = 0, len1 = board.length; k < len1; thread = ++k) {
ID = board[thread];
if (postID in thread) {
val = thread[postID];
@@ -1705,11 +1695,11 @@
};
DataBoard.prototype.clean = function() {
- var boardID, now, val, _ref;
+ var boardID, now, ref, val;
$.forceSync(this.key);
- _ref = this.data.boards;
- for (boardID in _ref) {
- val = _ref[boardID];
+ ref = this.data.boards;
+ for (boardID in ref) {
+ val = ref[boardID];
this.deleteIfEmpty({
boardID: boardID
});
@@ -1742,14 +1732,14 @@
};
DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
- var ID, board, page, thread, threads, _i, _j, _k, _len, _len1, _len2, _ref;
+ var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
board = this.data.boards[boardID];
threads = {};
- for (_i = 0, _len = response1.length; _i < _len; _i++) {
- page = response1[_i];
- _ref = page.threads;
- for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
- thread = _ref[_j];
+ for (k = 0, len1 = response1.length; k < len1; k++) {
+ page = response1[k];
+ ref = page.threads;
+ for (q = 0, len2 = ref.length; q < len2; q++) {
+ thread = ref[q];
ID = thread.no;
if (ID in board) {
threads[ID] = board[ID];
@@ -1757,8 +1747,8 @@
}
}
if (response2) {
- for (_k = 0, _len2 = response2.length; _k < _len2; _k++) {
- ID = response2[_k];
+ for (u = 0, len3 = response2.length; u < len3; u++) {
+ ID = response2[u];
if (ID in board) {
threads[ID] = board[ID];
}
@@ -1783,11 +1773,11 @@
})();
Notice = (function() {
- function Notice(type, content, timeout, onclose) {
- this.timeout = timeout;
+ function Notice(type, content, timeout1, onclose) {
+ this.timeout = timeout1;
this.onclose = onclose;
- this.close = __bind(this.close, this);
- this.add = __bind(this.add, this);
+ this.close = bind(this.close, this);
+ this.add = bind(this.add, this);
this.el = $.el('div', {
innerHTML: ""
});
@@ -1831,11 +1821,11 @@
RandomAccessList = (function() {
function RandomAccessList(items) {
- var item, _i, _len;
+ var item, k, len1;
this.length = 0;
if (items) {
- for (_i = 0, _len = items.length; _i < _len; _i++) {
- item = items[_i];
+ for (k = 0, len1 = items.length; k < len1; k++) {
+ item = items[k];
this.push(item);
}
}
@@ -1979,10 +1969,10 @@
};
SimpleDict.prototype.forEach = function(fn) {
- var key, _i, _len, _ref;
- _ref = __slice.call(this.keys);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- key = _ref[_i];
+ var k, key, len1, ref;
+ ref = slice.call(this.keys);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ key = ref[k];
fn(this[key]);
}
};
@@ -2026,12 +2016,12 @@
}
Connection = (function() {
- function Connection(target, origin, cb) {
- this.target = target;
- this.origin = origin;
- this.cb = cb;
- this.onMessage = __bind(this.onMessage, this);
- this.send = __bind(this.send, this);
+ function Connection(target1, origin1, cb1) {
+ this.target = target1;
+ this.origin = origin1;
+ this.cb = cb1;
+ this.onMessage = bind(this.onMessage, this);
+ this.send = bind(this.send, this);
$.on(window, 'message', this.onMessage);
}
@@ -2040,15 +2030,15 @@
};
Connection.prototype.onMessage = function(e) {
- var data, type, value, _base;
+ var base1, data, type, value;
if (!(e.source === this.target && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) {
return;
}
data = JSON.parse(e.data.slice(g.NAMESPACE.length));
for (type in data) {
value = data[type];
- if (typeof (_base = this.cb)[type] === "function") {
- _base[type](value);
+ if (typeof (base1 = this.cb)[type] === "function") {
+ base1[type](value);
}
}
};
@@ -2058,14 +2048,14 @@
})();
Fetcher = (function() {
- function Fetcher(boardID, threadID, postID, root, context) {
+ function Fetcher(boardID1, threadID1, postID1, root1, context1) {
var post;
- this.boardID = boardID;
- this.threadID = threadID;
- this.postID = postID;
- this.root = root;
- this.context = context;
- if (post = g.posts["" + this.boardID + "." + this.postID]) {
+ this.boardID = boardID1;
+ this.threadID = threadID1;
+ this.postID = postID1;
+ this.root = root1;
+ this.context = context1;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
this.insert(post);
return;
}
@@ -2097,8 +2087,8 @@
};
Fetcher.prototype.fetchedPost = function(req) {
- var api, board, post, posts, status, thread, _i, _len;
- if (post = g.posts["" + this.boardID + "." + this.postID]) {
+ var api, board, k, len1, post, posts, status, thread;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
this.insert(post);
return;
}
@@ -2113,8 +2103,8 @@
}
posts = req.response.posts;
Build.spoilerRange[this.boardID] = posts[0].custom_spoiler;
- for (_i = 0, _len = posts.length; _i < _len; _i++) {
- post = posts[_i];
+ for (k = 0, len1 = posts.length; k < len1; k++) {
+ post = posts[k];
if (post.no === this.postID) {
break;
}
@@ -2140,7 +2130,7 @@
return;
}
board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads["" + this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
post = new Post(Build.postFromObject(post, this.boardID), thread, board);
post.isFetchedQuote = true;
Main.callbackNodes(Post, [post]);
@@ -2171,12 +2161,12 @@
} else if (Conf['Except Archives from Encryption']) {
CrossOrigin.json(url, (function(_this) {
return function(response) {
- var key, media, _ref;
+ var key, media, ref;
media = response.media;
if (media) {
for (key in media) {
if (/_link$/.test(key)) {
- if (!((media[key] != null) && (_ref = media[key].match(/^(http:\/\/[^\/]+\/)?/)[0], __indexOf.call(url.archive.imagehosts, _ref) >= 0))) {
+ if (!((media[key] != null) && (ref = media[key].match(/^(http:\/\/[^\/]+\/)?/)[0], indexOf.call(url.archive.imagehosts, ref) >= 0))) {
delete media[key];
}
}
@@ -2191,8 +2181,8 @@
};
Fetcher.prototype.parseArchivedPost = function(data) {
- var board, comment, greentext, i, j, o, post, text, text2, thread, _ref;
- if (post = g.posts["" + this.boardID + "." + this.postID]) {
+ var board, comment, greentext, i, j, o, post, ref, text, text2, thread;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
this.insert(post);
return;
}
@@ -2203,32 +2193,32 @@
}
comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned)\])/);
comment = (function() {
- var _i, _len, _results;
- _results = [];
- for (i = _i = 0, _len = comment.length; _i < _len; i = ++_i) {
+ var k, len1, results;
+ results = [];
+ for (i = k = 0, len1 = comment.length; k < len1; i = ++k) {
text = comment[i];
if (i % 2 === 1) {
- _results.push(this.archiveTags[text]);
+ results.push(this.archiveTags[text]);
} else {
greentext = text[0] === '>';
text = text.replace(/(\[\/?[a-z]+):lit(\])/, '$1$2');
text = (function() {
- var _j, _len1, _ref, _results1;
- _ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
- _results1 = [];
- for (j = _j = 0, _len1 = _ref.length; _j < _len1; j = ++_j) {
- text2 = _ref[j];
+ var len2, q, ref, results1;
+ ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
+ results1 = [];
+ for (j = q = 0, len2 = ref.length; q < len2; j = ++q) {
+ text2 = ref[j];
if (j % 2 === 1) {
- _results1.push({
+ results1.push({
innerHTML: "" + E(text2) + ""
});
} else {
- _results1.push({
+ results1.push({
innerHTML: E(text2)
});
}
}
- return _results1;
+ return results1;
})();
text = {
innerHTML: text.map(function(x) {
@@ -2240,10 +2230,10 @@
innerHTML: "" + text.innerHTML + ""
};
}
- _results.push(text);
+ results.push(text);
}
}
- return _results;
+ return results;
}).call(this);
comment = {
innerHTML: comment.map(function(x) {
@@ -2276,7 +2266,7 @@
dateUTC: data.timestamp,
comment: comment
};
- if ((_ref = data.media) != null ? _ref.media_filename : void 0) {
+ if ((ref = data.media) != null ? ref.media_filename : void 0) {
o.file = {
name: data.media.media_filename,
timestamp: data.media.media_orig,
@@ -2295,7 +2285,7 @@
}
}
board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads["" + this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
post = new Post(Build.post(o), thread, board);
post.kill();
if (post.file) {
@@ -2370,13 +2360,13 @@
});
},
toBlob: function() {
- var _base;
- return (_base = HTMLCanvasElement.prototype).toBlob || (_base.toBlob = function(cb) {
- var data, i, l, ui8a, _i;
+ var base1;
+ return (base1 = HTMLCanvasElement.prototype).toBlob || (base1.toBlob = function(cb) {
+ var data, i, k, l, ref, ui8a;
data = atob(this.toDataURL().slice(22));
l = data.length;
ui8a = new Uint8Array(l);
- for (i = _i = 0; _i < l; i = _i += 1) {
+ for (i = k = 0, ref = l; k < ref; i = k += 1) {
ui8a[i] = data.charCodeAt(i);
}
return cb(new Blob([ui8a], {
@@ -2565,7 +2555,7 @@
id: 'scroll-marker'
}),
setBoardList: function() {
- var a, boardList, btn, chr, node, nodes, spacer, span, _i, _j, _len, _len1, _ref, _ref1;
+ var a, boardList, btn, chr, k, len1, len2, node, nodes, q, ref, ref1, spacer, span;
Header.boardList = boardList = $.el('span', {
id: 'board-list'
});
@@ -2580,14 +2570,14 @@
className: 'spacer'
});
};
- _ref = $('#boardNavDesktop > .boardList').childNodes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $('#boardNavDesktop > .boardList').childNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
switch (node.nodeName) {
case '#text':
- _ref1 = node.nodeValue;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- chr = _ref1[_j];
+ ref1 = node.nodeValue;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ chr = ref1[q];
span = $.el('span', {
textContent: chr
});
@@ -2629,14 +2619,14 @@
as = $$('#full-board-list a[title]', Header.boardList);
re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
nodes = (function() {
- var _i, _len, _ref, _results;
- _ref = boardnav.match(re);
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- t = _ref[_i];
- _results.push(Header.mapCustomNavigation(t, as));
+ var k, len1, ref, results;
+ ref = boardnav.match(re);
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ t = ref[k];
+ results.push(Header.mapCustomNavigation(t, as));
}
- return _results;
+ return results;
})();
$.add(list, nodes);
return $.ready(CatalogLinks.initBoardList);
@@ -2674,7 +2664,7 @@
boardID = g.BOARD.ID;
}
a = (function() {
- var _i, _len, _ref;
+ var k, len1, ref;
if (boardID === '@') {
return $.el('a', {
href: 'https://twitter.com/4chan',
@@ -2682,8 +2672,8 @@
textContent: '@'
});
}
- for (_i = 0, _len = as.length; _i < _len; _i++) {
- a = as[_i];
+ for (k = 0, len1 = as.length; k < len1; k++) {
+ a = as[k];
if (a.textContent === boardID) {
return a.cloneNode(true);
}
@@ -2692,7 +2682,7 @@
href: "/" + boardID + "/",
textContent: boardID
});
- if ((_ref = g.VIEW) === 'catalog' || _ref === 'archive') {
+ if ((ref = g.VIEW) === 'catalog' || ref === 'archive') {
a.href += g.VIEW;
}
if (boardID === g.BOARD.ID) {
@@ -2853,12 +2843,12 @@
return new Notice('info', message, 2);
},
setCustomNav: function(show) {
- var btn, cust, full, _ref;
+ var btn, cust, full, ref;
Header.customNavToggler.checked = show;
cust = $('#custom-board-list', Header.bar);
full = $('#full-board-list', Header.bar);
btn = $('.hide-board-list-container', full);
- return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], btn.hidden = _ref[2], _ref;
+ return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref;
},
toggleCustomNav: function() {
$.cb.checked.call(this);
@@ -2973,13 +2963,13 @@
return Header.menu.toggle(e, this, g);
},
createNotification: function(e) {
- var content, lifetime, notice, type, _ref;
- _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime;
+ var content, lifetime, notice, ref, type;
+ ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime;
return notice = new Notice(type, content, lifetime);
},
areNotificationsEnabled: false,
enableDesktopNotifications: function() {
- var authorize, disable, el, notice, _ref;
+ var authorize, disable, el, notice, ref;
if (!(window.Notification && Conf['Desktop Notifications'])) {
return;
}
@@ -2993,7 +2983,7 @@
el = $.el('span', {
innerHTML: E(g.NAME) + " needs your permission to show desktop notifications. [FAQ]
or "
});
- _ref = $$('button', el), authorize = _ref[0], disable = _ref[1];
+ ref = $$('button', el), authorize = ref[0], disable = ref[1];
$.on(authorize, 'click', function() {
return Notification.requestPermission(function(status) {
Header.areNotificationsEnabled = status === 'granted';
@@ -3014,7 +3004,7 @@
Index = {
showHiddenThreads: false,
init: function() {
- var anchorEntry, input, label, name, pinEntry, refNavEntry, repliesEntry, select, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
+ var anchorEntry, input, k, label, len1, len2, name, pinEntry, q, ref, ref1, ref2, ref3, ref4, ref5, refNavEntry, repliesEntry, select;
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation'] || g.VIEW !== 'index') {
return;
}
@@ -3023,13 +3013,13 @@
name: 'Catalog Features',
cb: this.catalogNode
});
- this.search = ((_ref = history.state) != null ? _ref.search : void 0) || '';
- if ((_ref1 = history.state) != null ? _ref1.mode : void 0) {
- Conf['Index Mode'] = (_ref2 = history.state) != null ? _ref2.mode : void 0;
+ this.search = ((ref = history.state) != null ? ref.search : void 0) || '';
+ if ((ref1 = history.state) != null ? ref1.mode : void 0) {
+ Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0;
}
this.currentPage = this.getCurrentPage();
this.pushState({
- command: (_ref3 = location.href.match(/#(.*)/)) != null ? _ref3[1] : void 0,
+ command: (ref3 = location.href.match(/#(.*)/)) != null ? ref3[1] : void 0,
replace: true
});
this.button = $.el('a', {
@@ -3057,9 +3047,9 @@
pinEntry.el.title = 'Move watched threads to the start of the index.';
anchorEntry.el.title = 'Move hidden threads to the end of the index.';
refNavEntry.el.title = 'Refresh index when navigating through pages.';
- _ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
- for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
- label = _ref4[_i];
+ ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
+ for (k = 0, len1 = ref4.length; k < len1; k++) {
+ label = ref4[k];
input = label.el.firstChild;
name = input.name;
$.on(input, 'change', $.cb.checked);
@@ -3079,7 +3069,7 @@
order: 98,
subEntries: [repliesEntry, pinEntry, anchorEntry, refNavEntry]
});
- $.addClass(doc, 'index-loading', "" + (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
+ $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
this.root = $.el('div', {
className: 'board'
});
@@ -3115,9 +3105,9 @@
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
$.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
$.on(this.selectMode, 'change', this.cb.mode);
- _ref5 = [this.selectMode, this.selectSort, this.selectSize];
- for (_j = 0, _len1 = _ref5.length; _j < _len1; _j++) {
- select = _ref5[_j];
+ ref5 = [this.selectMode, this.selectSort, this.selectSize];
+ for (q = 0, len2 = ref5.length; q < len2; q++) {
+ select = ref5[q];
select.value = Conf[select.name];
$.on(select, 'change', $.cb.value);
}
@@ -3132,15 +3122,15 @@
$.asap((function() {
return $('.board > .thread > .postContainer', doc) || d.readyState !== 'loading';
}), function() {
- var board, el, threadRoot, topNavPos, _k, _l, _len2, _len3, _ref6, _ref7, _ref8;
+ var board, el, len3, len4, ref6, ref7, ref8, threadRoot, topNavPos, u, w;
if (!Main.isThisPageLegit()) {
return;
}
Index.hat = $('.board > .thread > img:first-child');
if (Index.hat && Index.nodes) {
- _ref6 = Index.nodes;
- for (_k = 0, _len2 = _ref6.length; _k < _len2; _k++) {
- threadRoot = _ref6[_k];
+ ref6 = Index.nodes;
+ for (u = 0, len3 = ref6.length; u < len3; u++) {
+ threadRoot = ref6[u];
$.prepend(threadRoot, Index.hat.cloneNode(false));
}
}
@@ -3148,13 +3138,13 @@
$.replace(board, Index.root);
$.event('PostsInserted');
d.implementation.createDocument(null, null, null).appendChild(board);
- _ref7 = $$('.navLinks');
- for (_l = 0, _len3 = _ref7.length; _l < _len3; _l++) {
- el = _ref7[_l];
+ ref7 = $$('.navLinks');
+ for (w = 0, len4 = ref7.length; w < len4; w++) {
+ el = ref7[w];
$.rm(el);
}
- if ((_ref8 = $.id('search-box')) != null) {
- _ref8.parentNode.remove();
+ if ((ref8 = $.id('search-box')) != null) {
+ ref8.parentNode.remove();
}
topNavPos = $.id('delform').previousElementSibling;
$.before(topNavPos, $.el('hr'));
@@ -3218,9 +3208,9 @@
href: 'javascript:;'
}),
order: 20,
- open: function(_arg) {
+ open: function(arg) {
var thread;
- thread = _arg.thread;
+ thread = arg.thread;
if (Conf['Index Mode'] !== 'catalog') {
return false;
}
@@ -3270,11 +3260,11 @@
return ThreadHiding.saveHiddenState(thread);
},
cycleSortType: function() {
- var i, type, types, _i, _len;
- types = __slice.call(Index.selectSort.options).filter(function(option) {
+ var i, k, len1, type, types;
+ types = slice.call(Index.selectSort.options).filter(function(option) {
return !option.disabled;
});
- for (i = _i = 0, _len = types.length; _i < _len; i = ++_i) {
+ for (i = k = 0, len1 = types.length; k < len1; i = ++k) {
type = types[i];
if (type.selected) {
break;
@@ -3325,9 +3315,9 @@
return Index.buildIndex();
},
popstate: function(e) {
- var mode, page, search, state, _ref, _ref1;
+ var mode, page, ref, ref1, search, state;
if (e != null ? e.state : void 0) {
- _ref = e.state, search = _ref.search, mode = _ref.mode;
+ ref = e.state, search = ref.search, mode = ref.mode;
page = Index.getCurrentPage();
state = {};
if (Index.search !== search) {
@@ -3345,7 +3335,7 @@
}
} else {
state = Index.pushState({
- command: (_ref1 = location.href.match(/#(.*)/)) != null ? _ref1[1] : void 0,
+ command: (ref1 = location.href.match(/#(.*)/)) != null ? ref1[1] : void 0,
replace: true,
scroll: true
});
@@ -3381,8 +3371,8 @@
return Header.scrollToIfNeeded(Index.navLinks);
},
getCurrentPage: function() {
- var _ref;
- if ((_ref = Conf['Index Mode']) === 'all pages' || _ref === 'catalog') {
+ var ref;
+ if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') {
return 1;
} else {
return +window.location.pathname.split('/')[2] || 1;
@@ -3403,9 +3393,9 @@
}
},
pushState: function(state) {
- var command, hash, mode, page, pageBeforeSearch, pathname, search, _ref;
+ var command, hash, mode, page, pageBeforeSearch, pathname, ref, search;
pathname = location.pathname, hash = location.hash;
- pageBeforeSearch = (_ref = history.state) != null ? _ref.oldpage : void 0;
+ pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0;
if (state.command != null) {
command = state.command;
if (command === 'paged' || command === 'infinite' || command === 'all-pages' || command === 'catalog') {
@@ -3467,9 +3457,9 @@
return $.set('Previous Index Mode', mode);
}
},
- pageLoad: function(_arg) {
+ pageLoad: function(arg) {
var mode, scroll, search, sort;
- sort = _arg.sort, search = _arg.search, mode = _arg.mode, scroll = _arg.scroll;
+ sort = arg.sort, search = arg.search, mode = arg.mode, scroll = arg.scroll;
if (sort || (search != null)) {
Index.sort();
Index.buildPagelist();
@@ -3487,11 +3477,11 @@
}
},
applyMode: function() {
- var mode, _i, _len, _ref;
- _ref = ['paged', 'infinite', 'all pages', 'catalog'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- mode = _ref[_i];
- $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, "" + (mode.replace(/\ /g, '-')) + "-mode");
+ var k, len1, mode, ref;
+ ref = ['paged', 'infinite', 'all pages', 'catalog'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ mode = ref[k];
+ $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode");
}
Index.selectMode.value = Conf['Index Mode'];
Index.cb.size();
@@ -3509,12 +3499,12 @@
return Math.max(1, Index.getPagesNum());
},
buildPagelist: function() {
- var a, i, maxPageNum, nodes, pagesRoot, _i;
+ var a, i, k, maxPageNum, nodes, pagesRoot, ref;
pagesRoot = $('.pages', Index.pagelist);
maxPageNum = Index.getMaxPageNum();
if (pagesRoot.childElementCount !== maxPageNum) {
nodes = [];
- for (i = _i = 1; _i <= maxPageNum; i = _i += 1) {
+ for (i = k = 1, ref = maxPageNum; k <= ref; i = k += 1) {
a = $.el('a', {
textContent: i,
href: i === 1 ? './' : i
@@ -3551,13 +3541,13 @@
return $.add(strong, a);
},
updateHideLabel: function() {
- var hiddenCount, thread, threadID, _ref, _ref1;
+ var hiddenCount, ref, ref1, thread, threadID;
hiddenCount = 0;
- _ref = g.BOARD.threads;
- for (threadID in _ref) {
- thread = _ref[threadID];
+ ref = g.BOARD.threads;
+ for (threadID in ref) {
+ thread = ref[threadID];
if (thread.isHidden) {
- if (_ref1 = thread.ID, __indexOf.call(Index.liveThreadIDs, _ref1) >= 0) {
+ if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) >= 0) {
hiddenCount++;
}
}
@@ -3570,19 +3560,19 @@
return;
}
Index.hideLabel.hidden = false;
- return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : "" + hiddenCount + " hidden threads";
+ return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads";
},
update: function(state) {
- var now, _ref, _ref1;
+ var now, ref, ref1;
if (!navigator.onLine) {
return;
}
delete Index.pageNum;
- if ((_ref = Index.req) != null) {
- _ref.abort();
+ if ((ref = Index.req) != null) {
+ ref.abort();
}
- if ((_ref1 = Index.notice) != null) {
- _ref1.close();
+ if ((ref1 = Index.notice) != null) {
+ ref1.close();
}
now = Date.now();
$.ready(function() {
@@ -3602,7 +3592,7 @@
return $.addClass(Index.button, 'fa-spin');
},
load: function(e, state) {
- var err, nTimeout, notice, req, timeEl, _ref;
+ var err, nTimeout, notice, ref, req, timeEl;
$.rmClass(Index.button, 'fa-spin');
req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
if (nTimeout) {
@@ -3616,7 +3606,7 @@
notice.close();
return;
}
- if ((_ref = req.status) !== 200 && _ref !== 304) {
+ if ((ref = req.status) !== 200 && ref !== 304) {
err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
if (notice) {
notice.setType('warning');
@@ -3670,20 +3660,20 @@
return data.no;
});
g.BOARD.threads.forEach(function(thread) {
- var _ref;
- if (_ref = thread.ID, __indexOf.call(Index.liveThreadIDs, _ref) < 0) {
+ var ref;
+ if (ref = thread.ID, indexOf.call(Index.liveThreadIDs, ref) < 0) {
return thread.collect();
}
});
},
buildThreads: function() {
- var err, errors, i, posts, thread, threadData, threadRoot, threads, _i, _len, _ref;
+ var err, errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads;
Index.nodes = [];
threads = [];
posts = [];
- _ref = Index.liveThreadData;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- threadData = _ref[i];
+ ref = Index.liveThreadData;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ threadData = ref[i];
try {
threadRoot = Build.thread(g.BOARD, threadData);
if (Index.hat) {
@@ -3724,18 +3714,18 @@
return $.event('IndexRefresh');
},
buildReplies: function(threadRoots) {
- var data, err, errors, i, lastReplies, node, nodes, post, posts, thread, threadRoot, _i, _j, _len, _len1;
+ var data, err, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot;
posts = [];
- for (_i = 0, _len = threadRoots.length; _i < _len; _i++) {
- threadRoot = threadRoots[_i];
+ for (k = 0, len1 = threadRoots.length; k < len1; k++) {
+ threadRoot = threadRoots[k];
thread = Get.threadFromRoot(threadRoot);
i = Index.liveThreadIDs.indexOf(thread.ID);
if (!(lastReplies = Index.liveThreadData[i].last_replies)) {
continue;
}
nodes = [];
- for (_j = 0, _len1 = lastReplies.length; _j < _len1; _j++) {
- data = lastReplies[_j];
+ for (q = 0, len2 = lastReplies.length; q < len2; q++) {
+ data = lastReplies[q];
if (post = thread.posts[data.no]) {
nodes.push(post.nodes.root);
continue;
@@ -3762,15 +3752,15 @@
return Main.callbackNodes(Post, posts);
},
buildCatalogViews: function() {
- var catalogThreads, thread, threads, _i, _len;
+ var catalogThreads, k, len1, thread, threads;
threads = Index.sortedNodes.map(function(threadRoot) {
return Get.threadFromRoot(threadRoot);
}).filter(function(thread) {
return !thread.isHidden !== Index.showHiddenThreads;
});
catalogThreads = [];
- for (_i = 0, _len = threads.length; _i < _len; _i++) {
- thread = threads[_i];
+ for (k = 0, len1 = threads.length; k < len1; k++) {
+ thread = threads[k];
if (!thread.catalogView) {
catalogThreads.push(new CatalogThread(Build.catalogThread(thread), thread));
}
@@ -3781,12 +3771,12 @@
});
},
sizeCatalogViews: function(nodes) {
- var height, node, ratio, size, thumb, width, _i, _len, _ref;
+ var height, k, len1, node, ratio, ref, size, thumb, width;
size = Conf['Index Size'] === 'small' ? 150 : 250;
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- node = nodes[_i];
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ node = nodes[k];
thumb = $('.catalog-thumb', node);
- _ref = thumb.dataset, width = _ref.width, height = _ref.height;
+ ref = thumb.dataset, width = ref.width, height = ref.height;
if (!width) {
continue;
}
@@ -3796,10 +3786,10 @@
}
},
sort: function() {
- var liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID, _i, _len;
+ var k, len1, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
sortedThreadIDs = {
- lastreply: __slice.call(liveThreadData).sort(function(a, b) {
+ lastreply: slice.call(liveThreadData).sort(function(a, b) {
var num;
if ((num = a.last_replies)) {
a = num[num.length - 1];
@@ -3812,15 +3802,15 @@
return post.no;
}),
bump: liveThreadIDs,
- birth: __slice.call(liveThreadIDs).sort(function(a, b) {
+ birth: slice.call(liveThreadIDs).sort(function(a, b) {
return b - a;
}),
- replycount: __slice.call(liveThreadData).sort(function(a, b) {
+ replycount: slice.call(liveThreadData).sort(function(a, b) {
return b.replies - a.replies;
}).map(function(post) {
return post.no;
}),
- filecount: __slice.call(liveThreadData).sort(function(a, b) {
+ filecount: slice.call(liveThreadData).sort(function(a, b) {
return b.images - a.images;
}).map(function(post) {
return post.no;
@@ -3828,8 +3818,8 @@
}[Conf['Index Sort']];
Index.sortedNodes = sortedNodes = [];
nodes = Index.nodes;
- for (_i = 0, _len = sortedThreadIDs.length; _i < _len; _i++) {
- threadID = sortedThreadIDs[_i];
+ for (k = 0, len1 = sortedThreadIDs.length; k < len1; k++) {
+ threadID = sortedThreadIDs[k];
sortedNodes.push(nodes[Index.liveThreadIDs.indexOf(threadID)]);
}
if (Index.search && (nodes = Index.querySearch(Index.search))) {
@@ -3848,12 +3838,12 @@
}
},
sortOnTop: function(match) {
- var bottomNodes, threadRoot, topNodes, _i, _len, _ref;
+ var bottomNodes, k, len1, ref, threadRoot, topNodes;
topNodes = [];
bottomNodes = [];
- _ref = Index.sortedNodes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- threadRoot = _ref[_i];
+ ref = Index.sortedNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ threadRoot = ref[k];
(match(Get.threadFromRoot(threadRoot)) ? topNodes : bottomNodes).push(threadRoot);
}
return Index.sortedNodes = topNodes.concat(bottomNodes);
@@ -3892,7 +3882,7 @@
Index.buildReplies(nodes);
}
Index.buildStructure(nodes);
- if ((Index.followedThreadID != null) && (post = g.posts["" + g.BOARD + "." + Index.followedThreadID])) {
+ if ((Index.followedThreadID != null) && (post = g.posts[g.BOARD + "." + Index.followedThreadID])) {
return Header.scrollTo(post.nodes.root);
}
}
@@ -3904,9 +3894,9 @@
return Index.sortedNodes.slice(offset, offset + nodesPerPage);
},
buildStructure: function(nodes) {
- var node, _i, _len;
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- node = nodes[_i];
+ var k, len1, node;
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ node = nodes[k];
$.add(Index.root, [node, $.el('hr')]);
}
if (doc.contains(Index.root)) {
@@ -3950,12 +3940,12 @@
});
},
searchMatch: function(thread, keywords) {
- var file, info, key, keyword, text, _i, _j, _len, _len1, _ref, _ref1;
- _ref = thread.OP, info = _ref.info, file = _ref.file;
+ var file, info, k, key, keyword, len1, len2, q, ref, ref1, text;
+ ref = thread.OP, info = ref.info, file = ref.file;
text = [];
- _ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- key = _ref1[_i];
+ ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ key = ref1[k];
if (key in info) {
text.push(info[key]);
}
@@ -3964,8 +3954,8 @@
text.push(file.name);
}
text = text.join(' ').toLowerCase();
- for (_j = 0, _len1 = keywords.length; _j < _len1; _j++) {
- keyword = keywords[_j];
+ for (q = 0, len2 = keywords.length; q < len2; q++) {
+ keyword = keywords[q];
if (-1 === text.indexOf(keyword)) {
return false;
}
@@ -3997,7 +3987,7 @@
threshold = 30;
ext = filename.match(/\.?[^\.]*$/)[0];
if (filename.length - ext.length > threshold) {
- return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
+ return filename.slice(0, threshold - 5) + "(...)" + ext;
} else {
return filename;
}
@@ -4064,7 +4054,7 @@
This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS).
@license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
*/
- var boardID, capcode, capcodeClass, capcodeIcon, capcodeStart, comment, container, date, dateUTC, desktop2, email, emailField, emailProcessed, file, fileBlock, fileCont, fileDims, fileLink, fileSize, fileText, fileThumb, flag, flagCode, flagName, gifIcon, highlightPost, href, icons, isOP, match, message, name, nameBlock, nameClass, postID, postInfo, postLink, quote, quoteLink, replyLink, shortFilename, spoilerRange, staticPath, subject, subjectField, threadID, tripcode, tripcodeField, type, typeLC, uniqueID, userID, wholePost, _i, _len, _ref;
+ var boardID, capcode, capcodeClass, capcodeIcon, capcodeStart, comment, container, date, dateUTC, desktop2, email, emailField, emailProcessed, file, fileBlock, fileCont, fileDims, fileLink, fileSize, fileText, fileThumb, flag, flagCode, flagName, gifIcon, highlightPost, href, icons, isOP, k, len1, match, message, name, nameBlock, nameClass, postID, postInfo, postLink, quote, quoteLink, ref, replyLink, shortFilename, spoilerRange, staticPath, subject, subjectField, threadID, tripcode, tripcodeField, type, typeLC, uniqueID, userID, wholePost;
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, comment = o.comment, file = o.file;
name || (name = '');
subject || (subject = '');
@@ -4169,20 +4159,20 @@
postLink = Build.postURL(boardID, threadID, postID);
quoteLink = Build.sameThread(boardID, threadID) ? "javascript:quote('" + (+postID) + "');" : "/" + boardID + "/thread/" + threadID + "#q" + postID;
icons = (function() {
- var _i, _len, _ref, _results;
- _ref = ['Sticky', 'Closed', 'Archived'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
+ var k, len1, ref, results;
+ ref = ['Sticky', 'Closed', 'Archived'];
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
if (!(o["is" + type] && !(type === 'Closed' && o.isArchived))) {
continue;
}
typeLC = type.toLowerCase();
- _results.push({
+ results.push({
innerHTML: "
"
});
}
- return _results;
+ return results;
})();
replyLink = isOP && g.VIEW === 'index' ? {
innerHTML: " [Reply]"
@@ -4200,7 +4190,7 @@
innerHTML: "
"
} : file && boardID === 'f' ? {
innerHTML: "File: " + E(file.name) + "-(" + E($.bytesToString(file.size)) + ", " + E(file.width) + "x" + E(file.height) + ", " + E(file.tag) + ") "
- } : file ? (file.isSpoiler ? (shortFilename = 'Spoiler Image', (spoilerRange = Build.spoilerRange[boardID]) ? fileThumb = "" + staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png" : fileThumb = "" + staticPath + "spoiler.png", file.twidth = file.theight = 100) : (shortFilename = Build.shortFilename(file.name, !isOP), fileThumb = file.turl), fileSize = $.bytesToString(file.size), fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : "" + file.width + "x" + file.height, fileLink = file.isSpoiler || file.name === shortFilename ? {
+ } : file ? (file.isSpoiler ? (shortFilename = 'Spoiler Image', (spoilerRange = Build.spoilerRange[boardID]) ? fileThumb = staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png" : fileThumb = staticPath + "spoiler.png", file.twidth = file.theight = 100) : (shortFilename = Build.shortFilename(file.name, !isOP), fileThumb = file.turl), fileSize = $.bytesToString(file.size), fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : file.width + "x" + file.height, fileLink = file.isSpoiler || file.name === shortFilename ? {
innerHTML: "" + E(shortFilename) + ""
} : {
innerHTML: "" + E(shortFilename) + ""
@@ -4232,9 +4222,9 @@
id: "pc" + postID
});
$.extend(container, wholePost);
- _ref = $$('.quotelink', container);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = $$('.quotelink', container);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
href = quote.getAttribute('href');
if ((href[0] === '#') && !(Build.sameThread(boardID, threadID))) {
quote.href = ("/" + boardID + "/thread/" + threadID) + href;
@@ -4247,7 +4237,7 @@
summary: function(boardID, threadID, posts, files) {
var text;
text = [];
- text.push("" + posts + " post" + (posts > 1 ? 's' : ''));
+ text.push(posts + " post" + (posts > 1 ? 's' : ''));
if (files) {
text.push("and " + files + " image repl" + (files > 1 ? 'ies' : 'y'));
}
@@ -4273,14 +4263,14 @@
return root;
},
excerptThread: function(board, data, OP) {
- var files, nodes, posts, _ref;
+ var files, nodes, posts, ref;
nodes = [OP ? OP.nodes.root : Build.postFromObject(data, board.ID)];
if (data.omitted_posts || !Conf['Show Replies'] && data.replies) {
- _ref = Conf['Show Replies'] ? [
+ ref = Conf['Show Replies'] ? [
data.omitted_posts, data.images - data.last_replies.filter(function(data) {
return !!data.ext;
}).length
- ] : [data.replies, data.images], posts = _ref[0], files = _ref[1];
+ ] : [data.replies, data.images], posts = ref[0], files = ref[1];
nodes.push(Build.summary(board.ID, data.no, posts, files));
}
return nodes;
@@ -4289,23 +4279,23 @@
return Build.postFromObject(data, board.ID);
},
catalogThread: function(thread) {
- var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, pageCount, postCount, pp, quote, root, spoilerRange, src, staticPath, subject, thumb, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4;
+ var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, subject, thumb, u, w;
staticPath = Build.staticPath, gifIcon = Build.gifIcon;
data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)];
if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) {
- src = "" + staticPath + "spoiler";
+ src = staticPath + "spoiler";
if (spoilerRange = Build.spoilerRange[thread.board]) {
src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random());
}
src += '.png';
imgClass = 'spoiler-file';
} else if (data.filedeleted) {
- src = "" + staticPath + "filedeleted-res" + gifIcon;
+ src = staticPath + "filedeleted-res" + gifIcon;
imgClass = 'deleted-file';
} else if (thread.OP.file) {
src = thread.OP.file.thumbURL;
} else {
- src = "" + staticPath + "nofile.png";
+ src = staticPath + "nofile.png";
imgClass = 'no-file';
}
thumb = imgClass ? {
@@ -4332,47 +4322,47 @@
});
root.dataset.fullID = thread.fullID;
if (thread.OP.highlights) {
- $.addClass.apply($, [root].concat(__slice.call(thread.OP.highlights)));
+ $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights)));
}
- _ref = $$('.quotelink', root.lastElementChild);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = $$('.quotelink', root.lastElementChild);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
href = quote.getAttribute('href');
if (href[0] === '#') {
quote.href = ("/" + thread.board + "/thread/" + thread.ID) + href;
}
}
- _ref1 = $$('.abbr, .exif', root.lastElementChild);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- exif = _ref1[_j];
+ ref1 = $$('.abbr, .exif', root.lastElementChild);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ exif = ref1[q];
$.rm(exif);
}
- _ref2 = $$('.prettyprint', root.lastElementChild);
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- pp = _ref2[_k];
+ ref2 = $$('.prettyprint', root.lastElementChild);
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ pp = ref2[u];
cc = $.el('span', {
className: 'catalog-code'
});
- $.add(cc, __slice.call(pp.childNodes));
+ $.add(cc, slice.call(pp.childNodes));
$.replace(pp, cc);
}
- _ref3 = $$('br', root.lastElementChild);
- for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
- br = _ref3[_l];
- if (((_ref4 = br.previousSibling) != null ? _ref4.nodeName : void 0) === 'BR') {
+ ref3 = $$('br', root.lastElementChild);
+ for (w = 0, len4 = ref3.length; w < len4; w++) {
+ br = ref3[w];
+ if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') {
$.rm(br);
}
}
if (thread.isSticky) {
$.add($('.catalog-icons', root), $.el('img', {
- src: "" + staticPath + "sticky" + gifIcon,
+ src: staticPath + "sticky" + gifIcon,
className: 'stickyIcon',
title: 'Sticky'
}));
}
if (thread.isClosed) {
$.add($('.catalog-icons', root), $.el('img', {
- src: "" + staticPath + "closed" + gifIcon,
+ src: staticPath + "closed" + gifIcon,
className: 'closedIcon',
title: 'Closed'
}));
@@ -4389,16 +4379,16 @@
Get = {
threadExcerpt: function(thread) {
- var OP, excerpt, _ref;
+ var OP, excerpt, ref;
OP = thread.OP;
- excerpt = ("/" + thread.board + "/ - ") + (((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.info.nameBlock);
+ excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.info.nameBlock);
if (excerpt.length > 73) {
- return "" + excerpt.slice(0, 70) + "...";
+ return excerpt.slice(0, 70) + "...";
}
return excerpt;
},
threadFromRoot: function(root) {
- return g.threads["" + g.BOARD + "." + root.id.slice(1)];
+ return g.threads[g.BOARD + "." + root.id.slice(1)];
},
threadFromNode: function(node) {
return Get.threadFromRoot($.x('ancestor::div[@class="thread"]', node));
@@ -4409,7 +4399,7 @@
boardID = link.pathname.split('/')[1];
postID = link.hash.slice(2);
index = root.dataset.clone;
- post = g.posts["" + boardID + "." + postID];
+ post = g.posts[boardID + "." + postID];
if (index) {
return post.clones[index];
} else {
@@ -4423,14 +4413,14 @@
return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', node));
},
postDataFromLink: function(link) {
- var boardID, path, postID, threadID, _ref;
+ var boardID, path, postID, ref, threadID;
if (link.hostname === 'boards.4chan.org') {
path = link.pathname.split('/');
boardID = path[1];
threadID = path[3];
postID = link.hash.slice(2);
} else {
- _ref = link.dataset, boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
threadID || (threadID = 0);
}
return {
@@ -4440,44 +4430,44 @@
};
},
allQuotelinksLinkingTo: function(post) {
- var fullID, handleQuotes, posts, qPost, quote, quotelinks, _i, _len, _ref;
+ var fullID, handleQuotes, k, len1, posts, qPost, quote, quotelinks, ref;
quotelinks = [];
posts = g.posts;
fullID = post.fullID;
handleQuotes = function(qPost, type) {
- var clone, _i, _len, _ref;
+ var clone, k, len1, ref;
quotelinks.push.apply(quotelinks, qPost.nodes[type]);
- _ref = qPost.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = qPost.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
quotelinks.push.apply(quotelinks, clone.nodes[type]);
}
};
posts.forEach(function(qPost) {
- if (__indexOf.call(qPost.quotes, fullID) >= 0) {
+ if (indexOf.call(qPost.quotes, fullID) >= 0) {
return handleQuotes(qPost, 'quotelinks');
}
});
if (Conf['Quote Backlinks']) {
- _ref = post.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = post.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
if (qPost = posts[quote]) {
handleQuotes(qPost, 'backlinks');
}
}
}
return quotelinks.filter(function(quotelink) {
- var boardID, postID, _ref1;
- _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
+ var boardID, postID, ref1;
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
return boardID === post.board.ID && postID === post.ID;
});
},
scriptData: function() {
- var script, _i, _len, _ref;
- _ref = $$('script:not([src])', d.head);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- script = _ref[_i];
+ var k, len1, ref, script;
+ ref = $$('script:not([src])', d.head);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ script = ref[k];
if (/\bcooldowns *=/.test(script.textContent)) {
return script.textContent;
}
@@ -4489,21 +4479,21 @@
UI = (function() {
var Menu, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove;
dialog = function(id, position, properties) {
- var child, el, move, _i, _len, _ref;
+ var child, el, k, len1, move, ref;
el = $.el('div', {
className: 'dialog',
id: id
});
$.extend(el, properties);
el.style.cssText = position;
- $.get("" + id + ".position", position, function(item) {
- return el.style.cssText = item["" + id + ".position"];
+ $.get(id + ".position", position, function(item) {
+ return el.style.cssText = item[id + ".position"];
});
move = $('.move', el);
$.on(move, 'touchstart mousedown', dragstart);
- _ref = move.children;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- child = _ref[_i];
+ ref = move.children;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ child = ref[k];
if (!child.tagName) {
continue;
}
@@ -4520,16 +4510,16 @@
lastToggledButton = null;
- function Menu(type) {
- this.type = type;
- this.addEntry = __bind(this.addEntry, this);
- this.onFocus = __bind(this.onFocus, this);
- this.keybinds = __bind(this.keybinds, this);
- this.close = __bind(this.close, this);
+ function Menu(type1) {
+ this.type = type1;
+ this.addEntry = bind(this.addEntry, this);
+ this.onFocus = bind(this.onFocus, this);
+ this.keybinds = bind(this.keybinds, this);
+ this.close = bind(this.close, this);
$.on(d, 'AddMenuEntry', (function(_this) {
- return function(_arg) {
+ return function(arg) {
var detail;
- detail = _arg.detail;
+ detail = arg.detail;
if (detail.type !== _this.type) {
return;
}
@@ -4572,16 +4562,16 @@
};
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;
+ var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, k, left, len1, mRect, menu, ref, ref1, ref2, right, style, top;
menu = this.menu = this.makeMenu();
currentMenu = this;
lastToggledButton = button;
this.entries.sort(function(first, second) {
return first.order - second.order;
});
- _ref = this.entries;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- entry = _ref[_i];
+ ref = this.entries;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ entry = ref[k];
this.insertEntry(entry, menu, data);
}
$.addClass(lastToggledButton, 'active');
@@ -4593,13 +4583,13 @@
bLeft = window.scrollX + bRect.left;
cHeight = doc.clientHeight;
cWidth = doc.clientWidth;
- _ref1 = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom, null] : [null, cHeight - bRect.top], top = _ref1[0], bottom = _ref1[1];
- _ref2 = bRect.left + mRect.width < cWidth ? [bRect.left, null] : [null, cWidth - bRect.right], left = _ref2[0], right = _ref2[1];
+ ref1 = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom, null] : [null, cHeight - bRect.top], top = ref1[0], bottom = ref1[1];
+ ref2 = bRect.left + mRect.width < cWidth ? [bRect.left, null] : [null, cWidth - bRect.right], left = ref2[0], right = ref2[1];
style = menu.style;
- style.top = "" + top + "px";
- style.right = "" + right + "px";
- style.bottom = "" + bottom + "px";
- style.left = "" + left + "px";
+ style.top = top + "px";
+ style.right = right + "px";
+ style.bottom = bottom + "px";
+ style.left = left + "px";
if (right) {
$.addClass(menu, 'left');
}
@@ -4609,7 +4599,7 @@
};
Menu.prototype.insertEntry = function(entry, parent, data) {
- var subEntry, submenu, _i, _len, _ref;
+ var k, len1, ref, subEntry, submenu;
if (typeof entry.open === 'function') {
if (!entry.open(data)) {
return;
@@ -4625,9 +4615,9 @@
submenu = $.el('div', {
className: 'dialog submenu'
});
- _ref = entry.subEntries;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- subEntry = _ref[_i];
+ ref = entry.subEntries;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ subEntry = ref[k];
this.insertEntry(subEntry, submenu, data);
}
$.add(entry.el, submenu);
@@ -4644,7 +4634,7 @@
Menu.prototype.findNextEntry = function(entry, direction) {
var entries;
- entries = __slice.call(entry.parentNode.children);
+ entries = slice.call(entry.parentNode.children);
entries.sort(function(first, second) {
return first.style.order - second.style.order;
});
@@ -4702,13 +4692,13 @@
};
Menu.prototype.focus = function(entry) {
- var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2;
+ var bottom, cHeight, cWidth, eRect, focused, k, left, len1, ref, ref1, ref2, right, sRect, style, submenu, top;
while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
$.rmClass(focused, 'focused');
}
- _ref = $$('.focused', entry);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- focused = _ref[_i];
+ ref = $$('.focused', entry);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ focused = ref[k];
$.rmClass(focused, 'focused');
}
$.addClass(entry, 'focused');
@@ -4719,8 +4709,8 @@
eRect = entry.getBoundingClientRect();
cHeight = doc.clientHeight;
cWidth = doc.clientWidth;
- _ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = _ref1[0], bottom = _ref1[1];
- _ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = _ref2[0], right = _ref2[1];
+ ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1];
+ ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1];
style = submenu.style;
style.top = top;
style.bottom = bottom;
@@ -4734,7 +4724,7 @@
};
Menu.prototype.parseEntry = function(entry) {
- var el, subEntries, subEntry, _i, _len;
+ var el, k, len1, subEntries, subEntry;
el = entry.el, subEntries = entry.subEntries;
$.addClass(el, 'entry');
$.on(el, 'focus mouseover', this.onFocus);
@@ -4743,8 +4733,8 @@
return;
}
$.addClass(el, 'has-submenu');
- for (_i = 0, _len = subEntries.length; _i < _len; _i++) {
- subEntry = subEntries[_i];
+ for (k = 0, len1 = subEntries.length; k < len1; k++) {
+ subEntry = subEntries[k];
this.parseEntry(subEntry);
}
};
@@ -4753,7 +4743,7 @@
})();
dragstart = function(e) {
- var el, isTouching, o, rect, screenHeight, screenWidth, _ref;
+ var el, isTouching, o, rect, ref, screenHeight, screenWidth;
if (e.type === 'mousedown' && e.button !== 0) {
return;
}
@@ -4776,7 +4766,7 @@
screenWidth: screenWidth,
isTouching: isTouching
};
- _ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = _ref[0], o.bottomBorder = _ref[1];
+ ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1];
if (isTouching) {
o.identifier = e.identifier;
o.move = touchmove.bind(o);
@@ -4791,10 +4781,10 @@
}
};
touchmove = function(e) {
- var touch, _i, _len, _ref;
- _ref = e.changedTouches;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- touch = _ref[_i];
+ var k, len1, ref, touch;
+ ref = e.changedTouches;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ touch = ref[k];
if (touch.identifier === this.identifier) {
drag.call(this, touch);
return;
@@ -4817,10 +4807,10 @@
return style.bottom = bottom;
};
touchend = function(e) {
- var touch, _i, _len, _ref;
- _ref = e.changedTouches;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- touch = _ref[_i];
+ var k, len1, ref, touch;
+ ref = e.changedTouches;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ touch = ref[k];
if (touch.identifier === this.identifier) {
dragend.call(this);
return;
@@ -4835,16 +4825,16 @@
$.off(d, 'mousemove', this.move);
$.off(d, 'mouseup', this.up);
}
- return $.set("" + this.id + ".position", this.style.cssText);
+ return $.set(this.id + ".position", this.style.cssText);
};
- hoverstart = function(_arg) {
- var asapTest, cb, el, endEvents, height, latestEvent, noRemove, o, root, _ref;
- root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, height = _arg.height, cb = _arg.cb, noRemove = _arg.noRemove;
+ hoverstart = function(arg) {
+ var asapTest, cb, el, endEvents, height, latestEvent, noRemove, o, ref, root;
+ root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, asapTest = arg.asapTest, height = arg.height, cb = arg.cb, noRemove = arg.noRemove;
o = {
root: root,
el: el,
style: el.style,
- isImage: (_ref = el.nodeName) === 'IMG' || _ref === 'VIDEO',
+ isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO',
cb: cb,
endEvents: endEvents,
latestEvent: latestEvent,
@@ -4875,7 +4865,7 @@
return $.on(doc, 'mousemove', o.workaround);
};
hover = function(e) {
- var clientX, clientY, height, left, right, style, threshold, top, _ref;
+ var clientX, clientY, height, left, ref, right, style, threshold, top;
this.latestEvent = e;
height = this.height || this.el.offsetHeight;
clientX = e.clientX, clientY = e.clientY;
@@ -4884,7 +4874,7 @@
if (!this.isImage) {
threshold = Math.max(threshold, this.clientWidth - 400);
}
- _ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = _ref[0], right = _ref[1];
+ ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
style = this.style;
style.top = top + 'px';
style.left = left;
@@ -4939,7 +4929,7 @@
headers: headers,
overrideMimeType: "text/plain; charset=x-user-defined",
onload: function(xhr) {
- var contentDisposition, contentType, data, i, r, _ref, _ref1;
+ var contentDisposition, contentType, data, i, r, ref, ref1;
r = xhr.responseText;
data = new Uint8Array(r.length);
i = 0;
@@ -4947,8 +4937,8 @@
data[i] = r.charCodeAt(i);
i++;
}
- contentType = (_ref = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? _ref[1] : void 0;
- contentDisposition = (_ref1 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? _ref1[1] : void 0;
+ contentType = (ref = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref[1] : void 0;
+ contentDisposition = (ref1 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref1[1] : void 0;
return cb(data, contentType, contentDisposition);
},
onerror: function() {
@@ -4961,13 +4951,13 @@
},
file: function(url, cb) {
return CrossOrigin.binary(url, function(data, contentType, contentDisposition) {
- var blob, match, mime, name, _ref, _ref1, _ref2;
+ var blob, match, mime, name, ref, ref1, ref2;
if (data == null) {
return cb(null);
}
- name = (_ref = url.match(/([^\/]+)\/*$/)) != null ? _ref[1] : void 0;
+ name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0;
mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream';
- match = (contentDisposition != null ? (_ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? _ref1[1] : void 0 : void 0) || (contentType != null ? (_ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? _ref2[1] : void 0 : void 0);
+ match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0);
if (match) {
name = match.replace(/\\"/g, '"');
}
@@ -4996,11 +4986,11 @@
method: "GET",
url: url + '',
onload: function(xhr) {
- var response, _i, _len, _ref;
+ var k, len1, ref, response;
response = JSON.parse(xhr.responseText);
- _ref = callbacks[url];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- cb = _ref[_i];
+ ref = callbacks[url];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ cb = ref[k];
cb(response);
}
delete callbacks[url];
@@ -5020,8 +5010,8 @@
Anonymize = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread' || _ref === 'archive') && Conf['Anonymize'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Anonymize'])) {
return;
}
if (g.VIEW === 'archive') {
@@ -5033,11 +5023,11 @@
});
},
node: function() {
- var email, name, tripcode, _ref;
+ var email, name, ref, tripcode;
if (this.info.capcode || this.isClone) {
return;
}
- _ref = this.nodes, name = _ref.name, tripcode = _ref.tripcode, email = _ref.email;
+ ref = this.nodes, name = ref.name, tripcode = ref.tripcode, email = ref.email;
if (this.info.name !== 'Anonymous') {
name.textContent = 'Anonymous';
}
@@ -5052,15 +5042,15 @@
},
archive: function() {
return $.ready(function() {
- var name, trip, _i, _j, _len, _len1, _ref, _ref1;
- _ref = $$('.name');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ var k, len1, len2, name, q, ref, ref1, trip;
+ ref = $$('.name');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
name.textContent = 'Anonymous';
}
- _ref1 = $$('.postertrip');
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- trip = _ref1[_j];
+ ref1 = $$('.postertrip');
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ trip = ref1[q];
$.rm(trip);
}
});
@@ -5070,8 +5060,8 @@
Filter = {
filters: {},
init: function() {
- var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Filter'])) {
+ var boards, err, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, regexp, stub, top;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
return;
}
if (!Conf['Filtered Backlinks']) {
@@ -5079,9 +5069,9 @@
}
for (key in Config.filter) {
this.filters[key] = [];
- _ref1 = Conf[key].split('\n');
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- line = _ref1[_i];
+ ref1 = Conf[key].split('\n');
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ line = ref1[k];
if (line[0] === '#') {
continue;
}
@@ -5089,8 +5079,8 @@
continue;
}
filter = line.replace(regexp[0], '');
- boards = ((_ref2 = filter.match(/boards:([^;]+)/)) != null ? _ref2[1].toLowerCase() : void 0) || 'global';
- if (boards !== 'global' && (_ref3 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref3) < 0)) {
+ boards = ((ref2 = filter.match(/boards:([^;]+)/)) != null ? ref2[1].toLowerCase() : void 0) || 'global';
+ if (boards !== 'global' && (ref3 = g.BOARD.ID, indexOf.call(boards.split(','), ref3) < 0)) {
continue;
}
if (key === 'uniqueID' || key === 'MD5') {
@@ -5104,10 +5094,10 @@
continue;
}
}
- op = ((_ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref4[1] : void 0) || 'yes';
+ op = ((ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? ref4[1] : void 0) || 'yes';
stub = (function() {
- var _ref5;
- switch ((_ref5 = filter.match(/stub:(yes|no)/)) != null ? _ref5[1] : void 0) {
+ var ref5;
+ switch ((ref5 = filter.match(/stub:(yes|no)/)) != null ? ref5[1] : void 0) {
case 'yes':
return true;
case 'no':
@@ -5117,8 +5107,8 @@
}
})();
if (hl = /highlight/.test(filter)) {
- hl = ((_ref5 = filter.match(/highlight:([\w-]+)/)) != null ? _ref5[1] : void 0) || 'filter-highlight';
- top = ((_ref6 = filter.match(/top:(yes|no)/)) != null ? _ref6[1] : void 0) || 'yes';
+ hl = ((ref5 = filter.match(/highlight:([\w-]+)/)) != null ? ref5[1] : void 0) || 'filter-highlight';
+ top = ((ref6 = filter.match(/top:(yes|no)/)) != null ? ref6[1] : void 0) || 'yes';
top = top === 'yes';
}
this.filters[key].push(this.createFilter(regexp, op, stub, hl, top));
@@ -5159,15 +5149,15 @@
};
},
node: function() {
- var filter, key, result, value, _i, _len, _ref, _ref1;
+ var filter, k, key, len1, ref, ref1, result, value;
if (this.isClone || this.isFetchedQuote) {
return;
}
for (key in Filter.filters) {
if ((value = Filter[key](this)) !== false) {
- _ref = Filter.filters[key];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- filter = _ref[_i];
+ ref = Filter.filters[key];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ filter = ref[k];
if (!(result = filter(value, this.isReply))) {
continue;
}
@@ -5182,7 +5172,7 @@
return;
}
$.addClass(this.nodes.root, result["class"]);
- if (!(this.highlights && (_ref1 = result["class"], __indexOf.call(this.highlights, _ref1) >= 0))) {
+ if (!(this.highlights && (ref1 = result["class"], indexOf.call(this.highlights, ref1) >= 0))) {
(this.highlights || (this.highlights = [])).push(result["class"]);
}
if (!this.isReply && result.top) {
@@ -5262,8 +5252,8 @@
},
menu: {
init: function() {
- var div, entry, type, _i, _len, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
+ var div, entry, k, len1, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
return;
}
div = $.el('div', {
@@ -5278,9 +5268,9 @@
},
subEntries: []
};
- _ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- type = _ref1[_i];
+ ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ type = ref1[k];
entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1]));
}
return Menu.menu.addEntry(entry);
@@ -5319,7 +5309,7 @@
return $.get(type, Conf[type], function(item) {
var save, section, select, ta, tl;
save = item[type];
- save = save ? "" + save + "\n" + re : re;
+ save = save ? save + "\n" + re : re;
$.set(type, save);
Settings.open('Filter');
section = $('.section-container');
@@ -5337,8 +5327,8 @@
PostHiding = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
return;
}
if (Conf['Reply Hiding Buttons']) {
@@ -5376,8 +5366,8 @@
},
menu: {
init: function() {
- var apply, div, hideStubLink, makeStub, replies, thisPost, _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
+ var apply, div, hideStubLink, makeStub, ref, replies, thisPost;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
return;
}
div = $.el('div', {
@@ -5542,7 +5532,7 @@
textContent: ""
});
a = $.el('a', {
- className: "" + type + "-reply-button",
+ className: type + "-reply-button",
href: 'javascript:;'
});
$.add(a, span);
@@ -5574,7 +5564,7 @@
return PostHiding.saveHiddenState(post, post.isHidden);
},
hide: function(post, makeStub, hideRecursively) {
- var a, quotelink, _i, _len, _ref;
+ var a, k, len1, quotelink, ref;
if (makeStub == null) {
makeStub = Conf['Stubs'];
}
@@ -5589,9 +5579,9 @@
Recursive.apply(PostHiding.hide, post, makeStub, true);
Recursive.add(PostHiding.hide, post, makeStub, true);
}
- _ref = Get.allQuotelinksLinkingTo(post);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
$.addClass(quotelink, 'filtered');
}
if (!makeStub) {
@@ -5610,7 +5600,7 @@
return $.prepend(post.nodes.root, post.nodes.stub);
},
show: function(post, showRecursively) {
- var quotelink, _i, _len, _ref;
+ var k, len1, quotelink, ref;
if (showRecursively == null) {
showRecursively = Conf['Recursive Hiding'];
}
@@ -5625,9 +5615,9 @@
Recursive.apply(PostHiding.show, post, true);
Recursive.rm(PostHiding.hide, post);
}
- _ref = Get.allQuotelinksLinkingTo(post);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
$.rmClass(quotelink, 'filtered');
}
}
@@ -5636,8 +5626,8 @@
Recursive = {
recursives: {},
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
return Post.callbacks.push({
@@ -5646,26 +5636,26 @@
});
},
node: function() {
- var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1;
+ var i, k, len1, len2, obj, q, quote, recursive, ref, ref1;
if (this.isClone || this.isFetchedQuote) {
return;
}
- _ref = this.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = this.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
if (obj = Recursive.recursives[quote]) {
- _ref1 = obj.recursives;
- for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) {
- recursive = _ref1[i];
- recursive.apply(null, [this].concat(__slice.call(obj.args[i])));
+ ref1 = obj.recursives;
+ for (i = q = 0, len2 = ref1.length; q < len2; i = ++q) {
+ recursive = ref1[i];
+ recursive.apply(null, [this].concat(slice.call(obj.args[i])));
}
}
}
},
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] = {
+ var args, base1, name1, obj, post, recursive;
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
+ obj = (base1 = Recursive.recursives)[name1 = post.fullID] || (base1[name1] = {
recursives: [],
args: []
});
@@ -5673,13 +5663,13 @@
return obj.args.push(args);
},
rm: function(recursive, post) {
- var i, obj, rec, _i, _len, _ref;
+ var i, k, len1, obj, rec, ref;
if (!(obj = Recursive.recursives[post.fullID])) {
return;
}
- _ref = obj.recursives;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- rec = _ref[i];
+ ref = obj.recursives;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ rec = ref[i];
if (!(rec === recursive)) {
continue;
}
@@ -5689,11 +5679,11 @@
},
apply: function() {
var args, fullID, post, recursive;
- recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
fullID = post.fullID;
return g.posts.forEach(function(post) {
- if (__indexOf.call(post.quotes, fullID) >= 0) {
- return recursive.apply(null, [post].concat(__slice.call(args)));
+ if (indexOf.call(post.quotes, fullID) >= 0) {
+ return recursive.apply(null, [post].concat(slice.call(args)));
}
});
}
@@ -5701,8 +5691,8 @@
ThreadHiding = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) {
return;
}
this.db = new DataBoard('hiddenThreads');
@@ -5774,9 +5764,9 @@
return $.prepend(this.OP.nodes.root, ThreadHiding.makeButton(this, 'hide'));
},
onIndexBuild: function(nodes) {
- var root, thread, _i, _len;
- for (_i = 0, _len = nodes.length; _i < _len; _i++) {
- root = nodes[_i];
+ var k, len1, root, thread;
+ for (k = 0, len1 = nodes.length; k < len1; k++) {
+ root = nodes[k];
thread = Get.threadFromRoot(root);
if (thread.isHidden && thread.stub && !root.contains(thread.stub)) {
ThreadHiding.makeStub(thread, root);
@@ -5802,9 +5792,9 @@
Menu.menu.addEntry({
el: div,
order: 20,
- open: function(_arg) {
+ open: function(arg) {
var isReply, thread;
- thread = _arg.thread, isReply = _arg.isReply;
+ thread = arg.thread, isReply = arg.isReply;
if (isReply || thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
return false;
}
@@ -5828,9 +5818,9 @@
Menu.menu.addEntry({
el: div,
order: 20,
- open: function(_arg) {
+ open: function(arg) {
var isReply, thread;
- thread = _arg.thread, isReply = _arg.isReply;
+ thread = arg.thread, isReply = arg.isReply;
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
return false;
}
@@ -5846,9 +5836,9 @@
return Menu.menu.addEntry({
el: hideStubLink,
order: 15,
- open: function(_arg) {
+ open: function(arg) {
var isReply, thread;
- thread = _arg.thread, isReply = _arg.isReply;
+ thread = arg.thread, isReply = arg.isReply;
if (isReply || !thread.isHidden || Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog') {
return false;
}
@@ -5883,7 +5873,7 @@
makeButton: function(thread, type) {
var a;
a = $.el('a', {
- className: "" + type + "-thread-button",
+ className: type + "-thread-button",
href: 'javascript:;'
});
$.extend(a, {
@@ -5900,7 +5890,7 @@
numReplies += +summary.textContent.match(/\d+/);
}
a = ThreadHiding.makeButton(thread, 'show');
- $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : "" + numReplies + " replies") + ")"));
+ $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")"));
thread.stub = $.el('div', {
className: 'stub'
});
@@ -5974,8 +5964,8 @@
QuoteBacklink = {
containers: {},
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Backlinks']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) {
return;
}
Post.callbacks.push({
@@ -5988,7 +5978,7 @@
});
},
firstNode: function() {
- var a, clone, container, containers, hash, link, markYours, nodes, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
+ var a, clone, container, containers, hash, k, len1, len2, len3, link, markYours, nodes, post, q, quote, ref, ref1, u;
if (this.isClone || !this.quotes.length || this.isRebuilt) {
return;
}
@@ -6009,19 +5999,19 @@
};
})(this)) + (markYours ? '\u00A0(You)' : '')
});
- _ref = this.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = this.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
containers = [QuoteBacklink.getContainer(quote)];
if ((post = g.posts[quote]) && post.nodes.backlinkContainer) {
- _ref1 = post.clones;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- clone = _ref1[_j];
+ ref1 = post.clones;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ clone = ref1[q];
containers.push(clone.nodes.backlinkContainer);
}
}
- for (_k = 0, _len2 = containers.length; _k < _len2; _k++) {
- container = containers[_k];
+ for (u = 0, len3 = containers.length; u < len3; u++) {
+ container = containers[u];
nodes = [$.tn(' '), link = a.cloneNode(true)];
if (Conf['Quote Previewing']) {
$.on(link, 'mouseover', QuotePreview.mouseover);
@@ -6051,8 +6041,8 @@
return $.add(this.nodes.info, container);
},
getContainer: function(id) {
- var _base;
- return (_base = this.containers)[id] || (_base[id] = $.el('span', {
+ var base1;
+ return (base1 = this.containers)[id] || (base1[id] = $.el('span', {
className: 'container'
}));
}
@@ -6060,8 +6050,8 @@
QuoteCT = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6074,15 +6064,15 @@
});
},
node: function() {
- var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2;
+ var board, boardID, k, len1, quotelink, ref, ref1, ref2, thread, threadID;
if (this.isClone && this.thread === this.context.thread) {
return;
}
- _ref = this.isClone ? this.context : this, board = _ref.board, thread = _ref.thread;
- _ref1 = this.nodes.quotelinks;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- quotelink = _ref1[_i];
- _ref2 = Get.postDataFromLink(quotelink), boardID = _ref2.boardID, threadID = _ref2.threadID;
+ ref = this.isClone ? this.context : this, board = ref.board, thread = ref.thread;
+ ref1 = this.nodes.quotelinks;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ quotelink = ref1[k];
+ ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID;
if (!threadID) {
continue;
}
@@ -6098,8 +6088,8 @@
QuoteInline = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Inlining']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) {
return;
}
this.process = Conf['Quote Hash Navigation'] ? function(link, clone) {
@@ -6119,17 +6109,17 @@
});
},
node: function() {
- var isClone, link, process, _i, _j, _len, _len1, _ref, _ref1;
+ var isClone, k, len1, len2, link, process, q, ref, ref1;
process = QuoteInline.process;
isClone = this.isClone;
- _ref = this.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- link = _ref[_i];
+ ref = this.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
process(link, isClone);
}
- _ref1 = this.nodes.backlinks;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- link = _ref1[_j];
+ ref1 = this.nodes.backlinks;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ link = ref1[q];
process(link, isClone);
}
},
@@ -6146,12 +6136,12 @@
});
},
toggle: function(e) {
- var boardID, context, postID, threadID, _ref;
+ var boardID, context, postID, ref, threadID;
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
e.preventDefault();
- _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
context = Get.contextFromNode(this);
if ($.hasClass(this, 'inlined')) {
QuoteInline.rm(this, boardID, threadID, postID, context);
@@ -6182,7 +6172,7 @@
qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
$.addClass(qroot, 'hasInline');
new Fetcher(boardID, threadID, postID, inline, context);
- if (!((post = g.posts["" + boardID + "." + postID]) && context.thread === post.thread)) {
+ if (!((post = g.posts[boardID + "." + postID]) && context.thread === post.thread)) {
return;
}
if (isBacklink && Conf['Forward Hiding']) {
@@ -6195,7 +6185,7 @@
return Unread.readSinglePost(post);
},
rm: function(quotelink, boardID, threadID, postID, context) {
- var el, inlined, isBacklink, post, qroot, root, _ref;
+ var el, inlined, isBacklink, post, qroot, ref, root;
isBacklink = $.hasClass(quotelink, 'backlink');
root = QuoteInline.findRoot(quotelink, isBacklink);
root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root);
@@ -6207,14 +6197,14 @@
if (!(el = root.firstElementChild)) {
return;
}
- post = g.posts["" + boardID + "." + postID];
+ post = g.posts[boardID + "." + postID];
post.rmClone(el.dataset.clone);
- if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads["" + boardID + "." + threadID] && !--post.forwarded) {
+ if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads[boardID + "." + threadID] && !--post.forwarded) {
delete post.forwarded;
$.rmClass(post.nodes.root, 'forwarded');
}
while (inlined = $('.inlined', el)) {
- _ref = Get.postDataFromLink(inlined), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
QuoteInline.rm(inlined, boardID, threadID, postID, context);
$.rmClass(inlined, 'inlined');
}
@@ -6223,8 +6213,8 @@
QuoteOP = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark OP Quotes']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6237,7 +6227,7 @@
});
},
node: function() {
- var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref, _ref1;
+ var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1;
if (this.isClone && this.thread === this.context.thread) {
return;
}
@@ -6245,20 +6235,20 @@
return;
}
quotelinks = this.nodes.quotelinks;
- if (this.isClone && (_ref = this.thread.fullID, __indexOf.call(quotes, _ref) >= 0)) {
+ if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) {
i = 0;
while (quotelink = quotelinks[i++]) {
quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, '');
}
}
fullID = (this.isClone ? this.context : this).thread.fullID;
- if (__indexOf.call(quotes, fullID) < 0) {
+ if (indexOf.call(quotes, fullID) < 0) {
return;
}
i = 0;
while (quotelink = quotelinks[i++]) {
- _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
- if (("" + boardID + "." + postID) === fullID) {
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((boardID + "." + postID) === fullID) {
$.add(quotelink, $.tn(QuoteOP.text));
}
}
@@ -6267,8 +6257,8 @@
QuotePreview = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Quote Previewing'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Quote Previewing'])) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6280,19 +6270,19 @@
});
},
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];
+ var k, len1, link, ref;
+ ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
$.on(link, 'mouseover', QuotePreview.mouseover);
}
},
mouseover: function(e) {
- var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1;
+ var boardID, clone, k, len1, len2, origin, post, postID, posts, q, qp, quote, quoterID, ref, ref1, threadID;
if ($.hasClass(this, 'inlined')) {
return;
}
- _ref = Get.postDataFromLink(this), boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
qp = $.el('div', {
id: 'qp',
className: 'dialog'
@@ -6309,29 +6299,29 @@
return qp.firstElementChild;
}
});
- if (!(origin = g.posts["" + boardID + "." + postID])) {
+ if (!(origin = g.posts[boardID + "." + postID])) {
return;
}
if (Conf['Quote Highlighting']) {
posts = [origin].concat(origin.clones);
posts.pop();
- for (_i = 0, _len = posts.length; _i < _len; _i++) {
- post = posts[_i];
+ for (k = 0, len1 = posts.length; k < len1; k++) {
+ post = posts[k];
$.addClass(post.nodes.post, 'qphl');
}
}
quoterID = $.x('ancestor::*[@id][1]', this).id.match(/\d+$/)[0];
clone = Get.postFromRoot(qp.firstChild);
- _ref1 = clone.nodes.quotelinks.concat(__slice.call(clone.nodes.backlinks));
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- quote = _ref1[_j];
+ ref1 = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks));
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ quote = ref1[q];
if (quote.hash.slice(2) === quoterID) {
$.addClass(quote, 'forwardlink');
}
}
},
mouseout: function() {
- var clone, post, root, _i, _len, _ref;
+ var clone, k, len1, post, ref, root;
if (!(root = this.el.firstElementChild)) {
return;
}
@@ -6341,9 +6331,9 @@
if (!Conf['Quote Highlighting']) {
return;
}
- _ref = [post].concat(post.clones);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ ref = [post].concat(post.clones);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
$.rmClass(post.nodes.post, 'qphl');
}
}
@@ -6351,8 +6341,8 @@
QuoteStrikeThrough = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
return;
}
return Post.callbacks.push({
@@ -6361,15 +6351,15 @@
});
},
node: function() {
- var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2;
+ var boardID, k, len1, postID, quotelink, ref, ref1, ref2;
if (this.isClone) {
return;
}
- _ref = this.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
- _ref1 = Get.postDataFromLink(quotelink), boardID = _ref1.boardID, postID = _ref1.postID;
- if ((_ref2 = g.posts["" + boardID + "." + postID]) != null ? _ref2.isHidden : void 0) {
+ ref = this.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((ref2 = g.posts[boardID + "." + postID]) != null ? ref2.isHidden : void 0) {
$.addClass(quotelink, 'filtered');
}
}
@@ -6425,15 +6415,15 @@
});
},
node: function() {
- var ancestor, lastParent, parent, parents, quote, _i, _len, _ref;
+ var ancestor, k, lastParent, len1, parent, parents, quote, ref;
if (this.isFetchedQuote || this.isClone || !this.isReply) {
return;
}
parents = new Set();
lastParent = null;
- _ref = this.quotes;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quote = _ref[_i];
+ ref = this.quotes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quote = ref[k];
if (parent = g.posts[quote]) {
if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) {
parents.add(parent.ID);
@@ -6455,27 +6445,27 @@
}
},
descendants: function(post) {
- var child, children, posts, _i, _len;
+ var child, children, k, len1, posts;
posts = [post];
if (children = QuoteThreading.children[post.fullID]) {
- for (_i = 0, _len = children.length; _i < _len; _i++) {
- child = children[_i];
+ for (k = 0, len1 = children.length; k < len1; k++) {
+ child = children[k];
posts = posts.concat(QuoteThreading.descendants(child));
}
}
return posts;
},
insert: function(post) {
- var child, children, descendants, i, next, nodes, order, parent, prev, prev2, threadContainer, x, _base, _i, _j, _k, _len, _name;
+ var base1, child, children, descendants, i, k, len1, name1, next, nodes, order, parent, prev, prev2, q, threadContainer, u, x;
if (!(QuoteThreading.enabled && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) {
return false;
}
descendants = QuoteThreading.descendants(post);
if (!Unread.posts.has(parent.ID)) {
if ((function() {
- var x, _i, _len;
- for (_i = 0, _len = descendants.length; _i < _len; _i++) {
- x = descendants[_i];
+ var k, len1, x;
+ for (k = 0, len1 = descendants.length; k < len1; k++) {
+ x = descendants[k];
if (Unread.posts.has(x.ID)) {
return true;
}
@@ -6486,7 +6476,7 @@
}
}
order = Unread.order;
- children = ((_base = QuoteThreading.children)[_name = parent.fullID] || (_base[_name] = []));
+ children = ((base1 = QuoteThreading.children)[name1 = parent.fullID] || (base1[name1] = []));
threadContainer = parent.nodes.threadContainer || $.el('div', {
className: 'threadContainer'
});
@@ -6495,16 +6485,16 @@
nodes.push(post.nodes.threadContainer);
}
i = children.length;
- for (_i = children.length - 1; _i >= 0; _i += -1) {
- child = children[_i];
+ for (k = children.length - 1; k >= 0; k += -1) {
+ child = children[k];
if (child.ID >= post.ID) {
i--;
}
}
if (i !== children.length) {
next = children[i];
- for (_j = 0, _len = descendants.length; _j < _len; _j++) {
- x = descendants[_j];
+ for (q = 0, len1 = descendants.length; q < len1; q++) {
+ x = descendants[q];
order.before(order[next.ID], order[x.ID]);
}
children.splice(i, 0, post);
@@ -6514,8 +6504,8 @@
while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
prev = prev2[prev2.length - 1];
}
- for (_k = descendants.length - 1; _k >= 0; _k += -1) {
- x = descendants[_k];
+ for (u = descendants.length - 1; u >= 0; u += -1) {
+ x = descendants[u];
order.after(order[prev.ID], order[x.ID]);
}
children.push(post);
@@ -6567,8 +6557,8 @@
QuoteYou = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
if (Conf['Highlight Own Posts']) {
@@ -6587,7 +6577,7 @@
});
},
node: function() {
- var quotelink, _i, _len, _ref;
+ var k, len1, quotelink, ref;
if (this.isClone) {
return;
}
@@ -6601,9 +6591,9 @@
if (!this.quotes.length) {
return;
}
- _ref = this.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
+ ref = this.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
if (!(QR.db.get(Get.postDataFromLink(quotelink)))) {
continue;
}
@@ -6632,7 +6622,7 @@
} else {
post = QuoteYou.lastRead;
}
- str = "" + type + "::div[contains(@class,'quotesYou')]";
+ str = type + "::div[contains(@class,'quotesYou')]";
while (post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0)) {
if (QuoteYou.cb.scroll(post)) {
return;
@@ -6657,8 +6647,8 @@
Quotify = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Resurrect Quotes']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -6670,10 +6660,10 @@
});
},
node: function() {
- var deadlink, _i, _len, _ref;
- _ref = $$('.deadlink', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- deadlink = _ref[_i];
+ var deadlink, k, len1, ref;
+ ref = $$('.deadlink', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ deadlink = ref[k];
if (this.isClone) {
if ($.hasClass(deadlink, 'quotelink')) {
this.nodes.quotelinks.push(deadlink);
@@ -6684,13 +6674,13 @@
}
},
parseDeadlink: function(deadlink) {
- var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, _ref;
+ var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref;
if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
Quotify.fixDeadlink(deadlink);
return;
}
quote = deadlink.textContent;
- if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) {
+ if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) {
return;
}
if (postID[0] === '0') {
@@ -6698,7 +6688,7 @@
return;
}
boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID;
- quoteID = "" + boardID + "." + postID;
+ quoteID = boardID + "." + postID;
if (post = g.posts[quoteID]) {
if (!post.isDead) {
a = $.el('a', {
@@ -6711,7 +6701,7 @@
href: Build.postURL(boardID, post.thread.ID, postID),
className: 'quotelink deadlink',
target: '_blank',
- textContent: "" + quote + "\u00A0(Dead)"
+ textContent: quote + "\u00A0(Dead)"
});
$.extend(a.dataset, {
boardID: boardID,
@@ -6734,7 +6724,7 @@
href: redirect || 'javascript:;',
className: 'deadlink',
target: '_blank',
- textContent: "" + quote + "\u00A0(Dead)"
+ textContent: quote + "\u00A0(Dead)"
});
if (fetchable) {
$.addClass(a, 'quotelink');
@@ -6745,11 +6735,11 @@
}
}
}
- if (__indexOf.call(this.quotes, quoteID) < 0) {
+ if (indexOf.call(this.quotes, quoteID) < 0) {
this.quotes.push(quoteID);
}
if (!a) {
- deadlink.textContent = "" + quote + "\u00A0(Dead)";
+ deadlink.textContent = quote + "\u00A0(Dead)";
return;
}
$.replace(deadlink, a);
@@ -6766,7 +6756,7 @@
$.before(deadlink, green);
$.add(green, deadlink);
}
- return $.replace(deadlink, __slice.call(deadlink.childNodes));
+ return $.replace(deadlink, slice.call(deadlink.childNodes));
}
};
@@ -6786,9 +6776,6 @@
noscript = Conf['Force Noscript Captcha'] || !doc.dataset.jsEnabled;
this.captcha = Captcha[noscript ? 'noscript' : 'v2'];
$.on(d, '4chanXInitFinished', this.initReady);
- window.addEventListener('focus', this.focus, true);
- window.addEventListener('blur', this.focus, true);
- $.on(d, 'click', this.focus);
Post.callbacks.push({
name: 'Quick Reply',
cb: this.node
@@ -6872,7 +6859,7 @@
return;
}
thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads["" + g.BOARD + "." + thread].isDead) {
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
return QR.abort();
} else {
return QR.status();
@@ -6910,7 +6897,7 @@
}
},
close: function() {
- var post, _i, _len, _ref;
+ var k, len1, post, ref;
if (QR.req) {
QR.abort();
return;
@@ -6923,9 +6910,9 @@
$.addClass(QR.shortcut, 'disabled');
}
new QR.post(true);
- _ref = QR.posts.splice(0, QR.posts.length - 1);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ ref = QR.posts.splice(0, QR.posts.length - 1);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
post["delete"]();
}
QR.cooldown.auto = false;
@@ -6935,9 +6922,6 @@
focus: function() {
$.queueTask(function() {
var focus;
- if (!QR.nodes) {
- return;
- }
if (!$$('.goog-bubble-content > iframe').some(function(el) {
return el.getBoundingClientRect().top >= 0;
})) {
@@ -6977,6 +6961,17 @@
return QR.unhide();
}
},
+ setCustomCooldown: function(enabled) {
+ Conf['customCooldownEnabled'] = enabled;
+ QR.cooldown.customCooldown = enabled;
+ return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);
+ },
+ toggleCustomCooldown: function() {
+ var enabled;
+ enabled = $.hasClass(this, 'disabled');
+ QR.setCustomCooldown(enabled);
+ return $.set('customCooldownEnabled', enabled);
+ },
error: function(err) {
var el;
QR.open();
@@ -7013,10 +7008,10 @@
},
notifications: [],
cleanNotifications: function() {
- var notification, _i, _len, _ref;
- _ref = QR.notifications;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- notification = _ref[_i];
+ var k, len1, notification, ref;
+ ref = QR.notifications;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ notification = ref[k];
notification.close();
}
return QR.notifications = [];
@@ -7027,7 +7022,7 @@
return;
}
thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads["" + g.BOARD + "." + thread].isDead) {
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
value = 'Dead';
disabled = true;
QR.cooldown.auto = false;
@@ -7038,7 +7033,7 @@
return status.disabled = disabled || false;
},
quote: function(e) {
- var ancestor, caretPos, com, frag, index, insideCode, node, post, range, sel, text, thread, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
+ var ancestor, caretPos, com, frag, index, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, w, y, z;
if (e != null) {
e.preventDefault();
}
@@ -7060,37 +7055,37 @@
$.prepend(frag, $.tn('[code]'));
$.add(frag, $.tn('[/code]'));
}
- _ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
$.replace(node, $.tn('\n'));
}
- _ref1 = $$('br', frag);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- node = _ref1[_j];
+ ref1 = $$('br', frag);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ node = ref1[q];
if (node !== frag.lastChild) {
$.replace(node, $.tn('\n>'));
}
}
- _ref2 = $$('s, .removed-spoiler', frag);
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- node = _ref2[_k];
- $.replace(node, [$.tn('[spoiler]')].concat(__slice.call(node.childNodes), [$.tn('[/spoiler]')]));
+ ref2 = $$('s, .removed-spoiler', frag);
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ node = ref2[u];
+ $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')]));
}
- _ref3 = $$('.prettyprint', frag);
- for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
- node = _ref3[_l];
- $.replace(node, [$.tn('[code]')].concat(__slice.call(node.childNodes), [$.tn('[/code]')]));
+ ref3 = $$('.prettyprint', frag);
+ for (w = 0, len4 = ref3.length; w < len4; w++) {
+ node = ref3[w];
+ $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')]));
}
- _ref4 = $$('.linkify[data-original]', frag);
- for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) {
- node = _ref4[_m];
+ ref4 = $$('.linkify[data-original]', frag);
+ for (y = 0, len5 = ref4.length; y < len5; y++) {
+ node = ref4[y];
$.replace(node, $.tn(node.dataset.original));
}
- _ref5 = $$('.embedder', frag);
- for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) {
- node = _ref5[_n];
- if (((_ref6 = node.previousSibling) != null ? _ref6.nodeValue : void 0) === ' ') {
+ ref5 = $$('.embedder', frag);
+ for (z = 0, len6 = ref5.length; z < len6; z++) {
+ node = ref5[z];
+ if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') {
$.rm(node.previousSibling);
}
$.rm(node);
@@ -7104,7 +7099,7 @@
$.addClass(QR.nodes.el, 'dump');
QR.cooldown.auto = true;
}
- _ref7 = QR.nodes, com = _ref7.com, thread = _ref7.thread;
+ ref7 = QR.nodes, com = ref7.com, thread = ref7.thread;
if (!com.value) {
thread.value = Get.threadFromNode(this);
}
@@ -7143,14 +7138,14 @@
return QR.handleFiles(e.dataTransfer.files);
},
paste: function(e) {
- var blob, files, item, _i, _len, _ref;
+ var blob, files, item, k, len1, ref;
if (!e.clipboardData.items) {
return;
}
files = [];
- _ref = e.clipboardData.items;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
+ ref = e.clipboardData.items;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
if (!(item.kind === 'file')) {
continue;
}
@@ -7183,16 +7178,16 @@
});
},
handleFiles: function(files) {
- var file, i, _i, _len;
+ var file, i, k, len1;
if (this !== QR) {
- files = __slice.call(this.files);
+ files = slice.call(this.files);
this.value = null;
}
if (!files.length) {
return;
}
QR.cleanNotifications();
- for (i = _i = 0, _len = files.length; _i < _len; i = ++_i) {
+ for (i = k = 0, len1 = files.length; k < len1; i = ++k) {
file = files[i];
QR.handleFile(file, i, files.length);
}
@@ -7201,7 +7196,7 @@
}
},
handleFile: function(file, index, nfiles) {
- var isNewPost, isSingle, max, post, _ref;
+ var isNewPost, isSingle, max, post, ref;
isSingle = nfiles === 1;
if (/^text\//.test(file.type)) {
if (isSingle) {
@@ -7212,8 +7207,8 @@
post.pasteText(file);
return;
}
- if (_ref = file.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
- QR.error("" + file.name + ": Unsupported file type.");
+ if (ref = file.type, indexOf.call(QR.mimeTypes, ref) < 0) {
+ QR.error(file.name + ": Unsupported file type.");
if (!isSingle) {
return;
}
@@ -7223,7 +7218,7 @@
max = Math.min(max, QR.max_size_video);
}
if (file.size > max) {
- QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
+ QR.error(file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
if (!isSingle) {
return;
}
@@ -7255,11 +7250,11 @@
height = img.height, width = img.width;
pass = true;
if (height > QR.max_height || width > QR.max_width) {
- QR.error("" + file.name + ": Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
+ QR.error(file.name + ": Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
pass = false;
}
if (height < QR.min_height || width < QR.min_width) {
- QR.error("" + file.name + ": Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ QR.error(file.name + ": Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
pass = false;
}
return cb(pass, img);
@@ -7271,7 +7266,7 @@
} else if (/^video\//.test(file.type)) {
video = $.el('video');
$.on(video, 'loadeddata', function() {
- var duration, max_height, max_width, pass, videoHeight, videoWidth, _ref;
+ var duration, max_height, max_width, pass, ref, videoHeight, videoWidth;
if (!cb) {
return;
}
@@ -7280,34 +7275,34 @@
max_width = Math.min(QR.max_width, QR.max_width_video);
pass = true;
if (videoHeight > max_height || videoWidth > max_width) {
- QR.error("" + file.name + ": Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
+ QR.error(file.name + ": Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
pass = false;
}
if (videoHeight < QR.min_height || videoWidth < QR.min_width) {
- QR.error("" + file.name + ": Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ QR.error(file.name + ": Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
pass = false;
}
if (!isFinite(duration)) {
- QR.error("" + file.name + ": Video lacks duration metadata (try remuxing)");
+ QR.error(file.name + ": Video lacks duration metadata (try remuxing)");
pass = false;
} else if (duration > QR.max_duration_video) {
- QR.error("" + file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
+ QR.error(file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
pass = false;
}
- if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && $.hasAudio(video)) {
- QR.error("" + file.name + ": Audio not allowed");
+ if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg') && $.hasAudio(video)) {
+ QR.error(file.name + ": Audio not allowed");
pass = false;
}
cb(pass, video);
return cb = null;
});
$.on(video, 'error', function() {
- var _ref;
+ var ref;
if (!cb) {
return;
}
- if (_ref = file.type, __indexOf.call(QR.mimeTypes, _ref) >= 0) {
- QR.error("" + file.name + ": Video appears corrupt");
+ if (ref = file.type, indexOf.call(QR.mimeTypes, ref) >= 0) {
+ QR.error(file.name + ": Video appears corrupt");
}
URL.revokeObjectURL(file);
cb(false, null);
@@ -7319,7 +7314,7 @@
}
},
openFileInput: function(e) {
- var _ref;
+ var ref;
e.stopPropagation();
if (e.shiftKey && e.type === 'click') {
return QR.selected.rmFile();
@@ -7328,22 +7323,22 @@
$.addClass(QR.nodes.filename, 'edit');
QR.nodes.filename.focus();
}
- if (e.target.nodeName === 'INPUT' || (e.keyCode && ((_ref = e.keyCode) !== 32 && _ref !== 13)) || e.ctrlKey) {
+ if (e.target.nodeName === 'INPUT' || (e.keyCode && ((ref = e.keyCode) !== 32 && ref !== 13)) || e.ctrlKey) {
return;
}
e.preventDefault();
return QR.nodes.fileInput.click();
},
generatePostableThreadsList: function() {
- var list, options, thread, val, _i, _len, _ref;
+ var k, len1, list, options, ref, thread, val;
if (!QR.nodes) {
return;
}
list = QR.nodes.thread;
options = [list.firstElementChild];
- _ref = g.BOARD.threads.keys;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- thread = _ref[_i];
+ ref = g.BOARD.threads.keys;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ thread = ref[k];
options.push($.el('option', {
value: thread,
textContent: "Thread No." + thread
@@ -7360,10 +7355,10 @@
return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
},
dialog: function() {
- var dialog, event, i, items, m, match_max, match_min, name, node, nodes, rules, save, setNode, _ref;
+ var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, setNode;
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
- innerHTML: " "
+ innerHTML: " "
})
};
setNode = function(name, query) {
@@ -7393,6 +7388,7 @@
setNode('spoilerPar', '#qr-spoiler-label');
setNode('status', '[type=submit]');
setNode('fileInput', '[type=file]');
+ setNode('customCooldown', '#custom-cooldown-button');
rules = $('ul.rules').textContent.trim();
match_min = rules.match(/.+smaller than (\d+)x(\d+).+/);
match_max = rules.match(/.+greater than (\d+)x(\d+).+/);
@@ -7403,7 +7399,7 @@
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value;
QR.max_size_video = (m = Get.scriptData().match(/\bmaxWebmFilesize *= *(\d+)\b/)) ? +m[1] : +nodes.fileInput.max;
QR.max_width_video = QR.max_height_video = 2048;
- QR.max_duration_video = (_ref = g.BOARD.ID) === 'gif' || _ref === 'wsg' ? 300 : 120;
+ QR.max_duration_video = (ref = g.BOARD.ID) === 'gif' || ref === 'wsg' ? 300 : 120;
if (Conf['Show New Thread Option in Threads']) {
$.addClass(QR.nodes.el, 'show-new-thread-option');
}
@@ -7422,6 +7418,15 @@
} else {
nodes.spoiler.parentElement.hidden = true;
}
+ if (parseInt(Conf['customCooldown'], 10) > 0) {
+ $.addClass(QR.nodes.fileSubmit, 'custom-cooldown');
+ $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) {
+ var customCooldownEnabled;
+ customCooldownEnabled = arg.customCooldownEnabled;
+ QR.setCustomCooldown(customCooldownEnabled);
+ return $.sync('customCooldownEnabled', QR.setCustomCooldown);
+ });
+ }
if (g.BOARD.ID === 'f' && g.VIEW !== 'thread') {
nodes.flashTag = $.el('select', {
name: 'filetag'
@@ -7456,6 +7461,10 @@
return QR.selected.nodes.spoiler.click();
});
$.on(nodes.fileInput, 'change', QR.handleFiles);
+ $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);
+ window.addEventListener('focus', QR.focus, true);
+ window.addEventListener('blur', QR.focus, true);
+ $.on(d, 'click', QR.focus);
items = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
i = 0;
save = function() {
@@ -7582,7 +7591,7 @@
return QR.status();
},
onprogress: function(e) {
- QR.req.progress = "" + (Math.round(e.loaded / e.total * 100)) + "%";
+ QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%";
return QR.status();
}
}
@@ -7617,7 +7626,7 @@
return QR.status();
},
response: function() {
- var URL, ban, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, req, resDoc, threadID, _, _ref, _ref1;
+ var URL, _, ban, captchasCount, err, h1, isReply, m, notif, post, postID, postsCount, ref, ref1, req, resDoc, threadID;
req = QR.req;
delete QR.req;
post = QR.posts[0];
@@ -7630,8 +7639,8 @@
innerHTML: "You were issued a warning on " + $(".board", resDoc).innerHTML + " as " + $(".nameBlock", resDoc).innerHTML + ".
Reason: " + $(".reason", resDoc).innerHTML
});
} else if (err = resDoc.getElementById('errmsg')) {
- if ((_ref = $('a', err)) != null) {
- _ref.target = '_blank';
+ if ((ref = $('a', err)) != null) {
+ ref.target = '_blank';
}
} else if (resDoc.title !== 'Post successful!') {
err = 'Connection error with sys.4chan.org.';
@@ -7664,7 +7673,7 @@
QR.notifications.push(new Notice('success', h1.textContent, 5));
}
QR.persona.set(post);
- _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
+ ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref1[0], threadID = ref1[1], postID = ref1[2];
postID = +postID;
threadID = +threadID || postID;
isReply = threadID !== postID;
@@ -7710,7 +7719,7 @@
QR.captcha.setup(d.activeElement === QR.nodes.status);
}
QR.cooldown.add(req.uploadEndTime, threadID, postID);
- URL = threadID === postID ? "" + window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? "" + window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
+ URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
if (URL) {
if (Conf['Open Post in New Tab'] || postsCount) {
$.open(URL);
@@ -7766,7 +7775,7 @@
return _this.nodes.input.focus();
};
})(this));
- this.conn = new Connection(null, "" + location.protocol + "//www.google.com", {
+ this.conn = new Connection(null, location.protocol + "//www.google.com", {
challenge: this.load.bind(this),
token: this.save.bind(this),
error: this.error.bind(this)
@@ -7774,9 +7783,9 @@
$.addClass(QR.nodes.el, 'has-captcha');
$.after(QR.nodes.com.parentNode, [container, input]);
this.captchas = [];
- $.get('captchas', [], function(_arg) {
+ $.get('captchas', [], function(arg) {
var captchas;
- captchas = _arg.captchas;
+ captchas = arg.captchas;
QR.captcha.sync(captchas);
return QR.captcha.clear();
});
@@ -7785,16 +7794,16 @@
return this.setup();
},
initFrame: function() {
- var cb, conn, img, _ref, _ref1;
- conn = new Connection(window.top, "" + location.protocol + "//boards.4chan.org", {
+ var cb, conn, img, ref, ref1;
+ conn = new Connection(window.top, location.protocol + "//boards.4chan.org", {
response: function(response) {
$.id('response').value = response;
return $('.fbc-challenge > form').submit();
}
});
conn.send({
- token: (_ref = $('.fbc-verification-token > textarea')) != null ? _ref.value : void 0,
- error: (_ref1 = $('.fbc-error')) != null ? _ref1.textContent : void 0
+ token: (ref = $('.fbc-verification-token > textarea')) != null ? ref.value : void 0,
+ error: (ref1 = $('.fbc-error')) != null ? ref1.textContent : void 0
});
if (!(img = $('.fbc-payload > img'))) {
return;
@@ -7822,8 +7831,8 @@
}
},
beforeSetup: function() {
- var container, input, _ref;
- _ref = this.nodes, container = _ref.container, input = _ref.input;
+ var container, input, ref;
+ ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = true;
input.value = '';
input.placeholder = 'Focus to load reCAPTCHA';
@@ -7864,8 +7873,8 @@
}
},
afterSetup: function() {
- var container, input, _ref;
- _ref = this.nodes, container = _ref.container, input = _ref.input;
+ var container, input, ref;
+ ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = false;
input.placeholder = 'Verification';
this.count();
@@ -7968,15 +7977,15 @@
return $.rmClass(this.nodes.input, 'error');
},
clear: function() {
- var captcha, i, now, _i, _len, _ref;
+ var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
return;
}
$.forceSync('captchas');
now = Date.now();
- _ref = this.captchas;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- captcha = _ref[i];
+ ref = this.captchas;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ captcha = ref[i];
if (captcha.timeout > now) {
break;
}
@@ -7989,8 +7998,8 @@
return $.set('captchas', this.captchas);
},
load: function(src) {
- var container, img, input, _ref;
- _ref = this.nodes, container = _ref.container, input = _ref.input, img = _ref.img;
+ var container, img, input, ref;
+ ref = this.nodes, container = ref.container, input = ref.input, img = ref.img;
this.occupied = true;
this.timeout = Date.now() + this.lifetime;
if (!img) {
@@ -8037,17 +8046,17 @@
if (!this.nodes.iframe) {
return;
}
- if (this.needed() || d.activeElement === this.nodes.input) {
+ if (!d.hidden && (this.needed() || d.activeElement === this.nodes.input)) {
return this.reload();
} else {
return this.destroy();
}
},
reload: function() {
- var _ref;
+ var ref;
this.nodes.iframe.src = this.iframeURL;
this.occupied = true;
- return (_ref = this.nodes.img) != null ? _ref.hidden = true : void 0;
+ return (ref = this.nodes.img) != null ? ref.hidden = true : void 0;
},
keydown: function(e) {
if (e.keyCode === 8 && !this.nodes.input.value) {
@@ -8076,9 +8085,9 @@
return;
}
this.captchas = [];
- $.get('captchas', [], function(_arg) {
+ $.get('captchas', [], function(arg) {
var captchas;
- captchas = _arg.captchas;
+ captchas = arg.captchas;
return QR.captcha.sync(captchas);
});
$.sync('captchas', this.sync.bind(this));
@@ -8183,12 +8192,12 @@
return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: document.documentElement.classList.contains(\'tomorrow\') ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();');
},
afterSetup: function(mutations) {
- var iframe, mutation, node, textarea, _i, _j, _len, _len1, _ref;
- for (_i = 0, _len = mutations.length; _i < _len; _i++) {
- mutation = mutations[_i];
- _ref = mutation.addedNodes;
- for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
- node = _ref[_j];
+ var iframe, k, len1, len2, mutation, node, q, ref, textarea;
+ for (k = 0, len1 = mutations.length; k < len1; k++) {
+ mutation = mutations[k];
+ ref = mutation.addedNodes;
+ for (q = 0, len2 = ref.length; q < len2; q++) {
+ node = ref[q];
if (iframe = $.x('./descendant-or-self::iframe', node)) {
this.setupIFrame(iframe);
}
@@ -8247,7 +8256,7 @@
}
},
save: function(pasted) {
- var _base;
+ var base1;
$.forceSync('captchas');
this.captchas.push({
response: $('textarea', this.nodes.container).value,
@@ -8266,8 +8275,8 @@
if (pasted) {
this.destroy();
} else {
- if ((_base = this.timeouts).destroy == null) {
- _base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
+ if ((base1 = this.timeouts).destroy == null) {
+ base1.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
}
}
QR.nodes.status.focus();
@@ -8280,15 +8289,15 @@
return QR.notify(el);
},
clear: function() {
- var captcha, i, now, _i, _len, _ref;
+ var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
return;
}
$.forceSync('captchas');
now = Date.now();
- _ref = this.captchas;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- captcha = _ref[i];
+ ref = this.captchas;
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ captcha = ref[i];
if (captcha.timeout > now) {
break;
}
@@ -8316,7 +8325,7 @@
QR.cooldown = {
seconds: 0,
init: function() {
- var delay, items, key, keys, m, scope, type, _ref, _results;
+ var delay, items, key, keys, m, ref, results, scope, type;
if (!Conf['Cooldown']) {
return;
}
@@ -8328,9 +8337,9 @@
image_intra: 0
};
QR.cooldown.maxDelay = 0;
- _ref = QR.cooldown.delays;
- for (type in _ref) {
- delay = _ref[type];
+ ref = QR.cooldown.delays;
+ for (type in ref) {
+ delay = ref[type];
if (type !== 'thread') {
QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay);
}
@@ -8352,12 +8361,12 @@
}
return QR.cooldown.start();
});
- _results = [];
+ results = [];
for (scope in keys) {
key = keys[scope];
- _results.push($.sync(key, QR.cooldown.sync(scope)));
+ results.push($.sync(key, QR.cooldown.sync(scope)));
}
- return _results;
+ return results;
},
start: function() {
if (QR.cooldown.isCounting || Object.keys(QR.cooldown.local).length + Object.keys(QR.cooldown.global).length === 0) {
@@ -8402,14 +8411,14 @@
return QR.cooldown.start();
},
"delete": function(post) {
- var cooldown, id, _ref;
+ var cooldown, id, ref;
if (!(Conf['Cooldown'] && g.BOARD.ID === post.board.ID)) {
return;
}
$.forceSync(QR.cooldown.keys.local);
- _ref = QR.cooldown.local;
- for (id in _ref) {
- cooldown = _ref[id];
+ ref = QR.cooldown.local;
+ for (id in ref) {
+ cooldown = ref[id];
if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
delete QR.cooldown.local[id];
}
@@ -8441,18 +8450,18 @@
}
},
count: function() {
- var cooldown, elapsed, key, maxDelay, now, save, scope, seconds, start, suffix, threadID, type, update, _ref, _ref1, _ref2;
+ var cooldown, elapsed, key, maxDelay, now, ref, ref1, ref2, save, scope, seconds, start, suffix, threadID, type, update;
now = Date.now();
- _ref = QR.cooldown.categorize(QR.posts[0]), type = _ref.type, threadID = _ref.threadID;
+ ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID;
seconds = 0;
- _ref1 = QR.cooldown.keys;
- for (scope in _ref1) {
- key = _ref1[scope];
+ ref1 = QR.cooldown.keys;
+ for (scope in ref1) {
+ key = ref1[scope];
$.forceSync(key);
save = false;
- _ref2 = QR.cooldown[scope];
- for (start in _ref2) {
- cooldown = _ref2[start];
+ ref2 = QR.cooldown[scope];
+ for (start in ref2) {
+ cooldown = ref2[start];
start = +start;
elapsed = Math.floor((now - start) / $.SECOND);
if (elapsed < 0) {
@@ -8470,6 +8479,9 @@
continue;
}
maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread'];
+ if (QR.cooldown.customCooldown) {
+ maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10));
+ }
if (maxDelay <= elapsed) {
delete QR.cooldown[scope][start];
save = true;
@@ -8479,6 +8491,9 @@
suffix = scope === 'global' ? '_global' : type !== 'thread' && threadID === cooldown.threadID ? '_intra' : '';
seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed);
}
+ if (QR.cooldown.customCooldown) {
+ seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed);
+ }
}
if (save) {
QR.cooldown.save(scope);
@@ -8506,17 +8521,17 @@
always: {},
init: function() {
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'];
+ return $.get('QR.personas', Conf['QR.personas'], function(arg) {
+ var arr, item, k, len1, personas, ref, type, types;
+ personas = arg['QR.personas'];
types = {
name: [],
email: [],
sub: []
};
- _ref = personas.split('\n');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
+ ref = personas.split('\n');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
QR.persona.parseItem(item.trim(), types);
}
for (type in types) {
@@ -8526,17 +8541,17 @@
});
},
parseItem: function(item, types) {
- var boards, match, type, val, _ref, _ref1, _ref2;
+ var boards, match, ref, ref1, ref2, type, val;
if (item[0] === '#') {
return;
}
if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) {
return;
}
- _ref = match, match = _ref[0], type = _ref[1], val = _ref[2];
+ ref = match, match = ref[0], type = ref[1], val = ref[2];
item = item.replace(match, '');
- boards = ((_ref1 = item.match(/boards:([^;]+)/i)) != null ? _ref1[1].toLowerCase() : void 0) || 'global';
- if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) {
+ boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global';
+ if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) {
return;
}
if (type === 'password') {
@@ -8552,15 +8567,15 @@
if (/always/i.test(item)) {
QR.persona.always[type] = val;
}
- if (__indexOf.call(types[type], val) < 0) {
+ if (indexOf.call(types[type], val) < 0) {
return types[type].push(val);
}
},
loadPersonas: function(type, arr) {
- var list, val, _i, _len;
+ var k, len1, list, val;
list = $("#list-" + type, QR.nodes.el);
- for (_i = 0, _len = arr.length; _i < _len; _i++) {
- val = arr[_i];
+ for (k = 0, len1 = arr.length; k < len1; k++) {
+ val = arr[k];
if (val) {
$.add(list, $.el('option', {
textContent: val
@@ -8569,23 +8584,23 @@
}
},
getPassword: function() {
- var input, m, _ref;
+ var input, m, ref;
if (!QR.persona.pwd) {
- QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : ((_ref = $.id('delPassword')) != null ? _ref.value : void 0) || '';
+ QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : ((ref = $.id('delPassword')) != null ? ref.value : void 0) || '';
}
return QR.persona.pwd;
},
get: function(cb) {
- return $.get('QR.persona', {}, function(_arg) {
+ return $.get('QR.persona', {}, function(arg) {
var persona;
- persona = _arg['QR.persona'];
+ persona = arg['QR.persona'];
return cb(persona);
});
},
set: function(post) {
- return $.get('QR.persona', {}, function(_arg) {
+ return $.get('QR.persona', {}, function(arg) {
var persona;
- persona = _arg['QR.persona'];
+ persona = arg['QR.persona'];
persona = {
name: post.name,
email: /^sage$/.test(post.email) ? persona.email : post.email
@@ -8597,8 +8612,8 @@
QR.post = (function() {
function _Class(select) {
- this.select = __bind(this.select, this);
- var el, event, prev, _i, _len, _ref;
+ this.select = bind(this.select, this);
+ var el, event, k, len1, prev, ref;
el = $.el('a', {
className: 'qr-preview',
draggable: true,
@@ -8633,9 +8648,9 @@
};
})(this));
$.add(QR.nodes.dumpList, el);
- _ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- event = _ref[_i];
+ ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
$.on(el, event.toLowerCase(), this[event]);
}
this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
@@ -8681,7 +8696,7 @@
};
_Class.prototype.lock = function(lock) {
- var name, node, _i, _len, _ref;
+ var k, len1, name, node, ref;
if (lock == null) {
lock = true;
}
@@ -8689,9 +8704,9 @@
if (this !== QR.selected) {
return;
}
- _ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
if (node = QR.nodes[name]) {
node.disabled = lock;
}
@@ -8722,10 +8737,10 @@
};
_Class.prototype.load = function() {
- var name, node, _i, _len, _ref;
- _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ var k, len1, name, node, ref;
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
if (!(node = QR.nodes[name])) {
continue;
}
@@ -8737,7 +8752,7 @@
};
_Class.prototype.save = function(input) {
- var name, _ref;
+ var name, ref;
if (input.type === 'checkbox') {
this.spoiler = input.checked;
return;
@@ -8752,7 +8767,7 @@
this.nodes.span.textContent = this.com;
QR.captcha.onPostChange();
QR.characterCount();
- if (QR.cooldown.auto && this === QR.posts[0] && (0 < (_ref = QR.cooldown.seconds) && _ref <= 5)) {
+ if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
return QR.cooldown.auto = false;
}
break;
@@ -8760,7 +8775,7 @@
if (!this.file) {
return;
}
- this.file.newName = this.filename.replace(/[/\\]/g, '-');
+ this.file.newName = this.filename.replace(/[\/\\]/g, '-');
if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) {
this.file.newName += '.jpg';
}
@@ -8769,13 +8784,13 @@
};
_Class.prototype.forceSave = function() {
- var name, node, _i, _len, _ref;
+ var k, len1, name, node, ref;
if (this !== QR.selected) {
return;
}
- _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ name = ref[k];
if (!(node = QR.nodes[name])) {
continue;
}
@@ -8783,10 +8798,10 @@
}
};
- _Class.prototype.setFile = function(file, el) {
- this.file = file;
- this.filename = file.name;
- this.filesize = $.bytesToString(file.size);
+ _Class.prototype.setFile = function(file1, el) {
+ this.file = file1;
+ this.filename = this.file.name;
+ this.filesize = $.bytesToString(this.file.size);
if (QR.spoiler) {
this.nodes.label.hidden = false;
}
@@ -8861,7 +8876,7 @@
_Class.prototype.updateFilename = function() {
var long;
- long = "" + this.filename + " (" + this.filesize + ")\nCtrl/\u2318+click to edit filename. Shift+click to clear.";
+ long = this.filename + " (" + this.filesize + ")\nCtrl/\u2318+click to edit filename. Shift+click to clear.";
this.nodes.el.title = long;
if (this !== QR.selected) {
return;
@@ -8931,7 +8946,7 @@
}
el = $('.drag', this.parentNode);
index = function(el) {
- return __slice.call(el.parentNode.children).indexOf(el);
+ return slice.call(el.parentNode.children).indexOf(el);
};
oldIndex = index(el);
newIndex = index(this);
@@ -8947,8 +8962,8 @@
FappeTyme = {
init: function() {
- var el, lc, type, _i, _len, _ref, _ref1;
- if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var el, k, lc, len1, ref, ref1, type;
+ if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
this.nodes = {};
@@ -8956,15 +8971,15 @@
fappe: false,
werk: Conf['werk']
};
- _ref1 = ["Fappe", "Werk"];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- type = _ref1[_i];
- if (!Conf["" + type + " Tyme"]) {
+ ref1 = ["Fappe", "Werk"];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ type = ref1[k];
+ if (!Conf[type + " Tyme"]) {
continue;
}
lc = type.toLowerCase();
- el = UI.checkbox(lc, "" + type + " Tyme", false);
- el.title = "" + type + " Tyme";
+ el = UI.checkbox(lc, type + " Tyme", false);
+ el.title = type + " Tyme";
this.nodes[lc] = el.firstElementChild;
if (Conf[lc]) {
this.set(lc, true);
@@ -9007,7 +9022,7 @@
},
set: function(type, enabled) {
this.enabled[type] = this.nodes[type].checked = enabled;
- return $["" + (enabled ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme");
+ return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme");
},
toggle: function(type) {
this.set(type, !this.enabled[type]);
@@ -9019,8 +9034,8 @@
Gallery = {
init: function() {
- var el, _ref;
- if (!(this.enabled = Conf['Gallery'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var el, ref;
+ if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
this.delay = Conf['Slide Delay'];
@@ -9051,7 +9066,7 @@
}
},
build: function(image) {
- var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, thumb, value, _i, _j, _len, _len1, _ref, _ref1, _ref2;
+ var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, thumb, value;
if (Conf['Fullscreen Gallery']) {
$.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
@@ -9073,7 +9088,7 @@
$.extend(dialog, {
innerHTML: ""
});
- _ref = {
+ ref = {
buttons: '.gal-buttons',
frame: '.gal-image',
name: '.gal-name',
@@ -9083,8 +9098,8 @@
next: '.gal-image a',
current: '.gal-image img'
};
- for (key in _ref) {
- value = _ref[key];
+ for (key in ref) {
+ value = ref[key];
nodes[key] = $(value, dialog);
}
menuButton = $('.menu-button', dialog);
@@ -9104,9 +9119,9 @@
$.on(menuButton, 'click', function(e) {
return nodes.menu.toggle(e, this, g);
});
- _ref1 = Gallery.menu.createSubEntries();
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- entry = _ref1[_i];
+ ref1 = Gallery.menu.createSubEntries();
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ entry = ref1[k];
entry.order = 0;
nodes.menu.addEntry(entry);
}
@@ -9114,9 +9129,9 @@
if (Conf['Keybinds']) {
$.off(d, 'keydown', Keybinds.keydown);
}
- _ref2 = $$('.post .file');
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- file = _ref2[_j];
+ ref2 = $$('.post .file');
+ for (q = 0, len2 = ref2.length; q < len2; q++) {
+ file = ref2[q];
post = Get.postFromNode(file);
if (!post.file) {
continue;
@@ -9171,7 +9186,7 @@
return $.add(Gallery.nodes.thumbs, thumb);
},
open: function(thumb) {
- var el, elType, file, name, newID, nodes, oldID, post, slideshow, _ref;
+ var el, elType, file, name, newID, nodes, oldID, post, ref, slideshow;
nodes = Gallery.nodes;
name = nodes.name;
oldID = +nodes.current.dataset.id;
@@ -9211,14 +9226,14 @@
} else {
Gallery.cb.stop();
}
- if (Conf['Scroll to Post'] && (post = (_ref = (post = g.posts[file.dataset.post])) != null ? _ref.nodes.root : void 0)) {
+ if (Conf['Scroll to Post'] && (post = (ref = (post = g.posts[file.dataset.post])) != null ? ref.nodes.root : void 0)) {
Header.scrollTo(post);
}
return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
},
error: function() {
- var _ref;
- if (((_ref = this.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
+ var ref;
+ if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
return new Notice('error', 'Corrupt or unplayable video', 30);
}
if (this.src.split('/')[2] !== 'i.4cdn.org') {
@@ -9433,14 +9448,14 @@
createSubEntries: function() {
var delayInput, delayLabel, item, subEntries;
subEntries = (function() {
- var _i, _len, _ref, _results;
- _ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Scroll to Post'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
- _results.push(Gallery.menu.createSubEntry(item));
+ var k, len1, ref, results;
+ ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Scroll to Post'];
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
+ results.push(Gallery.menu.createSubEntry(item));
}
- return _results;
+ return results;
})();
delayLabel = $.el('label', {
innerHTML: "Slide Delay: "
@@ -9494,8 +9509,8 @@
}
},
decodeError: function(file, post) {
- var message, _ref;
- if (((_ref = file.error) != null ? _ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
+ var message, ref;
+ if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
return false;
}
if (!(message = $('.warning', post.file.thumb.parentNode))) {
@@ -9538,16 +9553,16 @@
};
return $.ajax("//a.4cdn.org/" + post.board + "/thread/" + post.thread + ".json", {
onload: function() {
- var postObj, _i, _len, _ref;
+ var k, len1, postObj, ref;
if (this.status === 404) {
post.kill();
}
if (this.status !== 200) {
return redirect();
}
- _ref = this.response.posts;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- postObj = _ref[_i];
+ ref = this.response.posts;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ postObj = ref[k];
if (postObj.no === post.ID) {
break;
}
@@ -9601,8 +9616,8 @@
ImageExpand = {
init: function() {
- var _ref;
- if (!(this.enabled = Conf['Image Expansion'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var ref;
+ if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
this.EAI = $.el('a', {
@@ -9626,7 +9641,7 @@
});
},
node: function() {
- var _ref;
+ var ref;
if (!(this.file && (this.file.isImage || this.file.isVideo))) {
return;
}
@@ -9638,7 +9653,7 @@
} else if (this.file.isExpanded && this.file.isVideo) {
Volume.setup(this.file.fullImage);
ImageExpand.setupVideoCB(this);
- return ImageExpand.setupVideo(this, !((_ref = this.origin.file.fullImage) != null ? _ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
+ return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
}
} else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) {
return ImageExpand.expand(this);
@@ -9646,7 +9661,7 @@
},
cb: {
toggle: function(e) {
- var file, post, _ref;
+ var file, post, ref;
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
@@ -9656,7 +9671,7 @@
return;
}
e.preventDefault();
- if ((_ref = file.fullImage) != null ? _ref.paused : void 0) {
+ if ((ref = file.fullImage) != null ? ref.paused : void 0) {
return file.fullImage.play();
} else {
return ImageExpand.toggle(post);
@@ -9686,20 +9701,20 @@
func = ImageExpand.contract;
}
return g.posts.forEach(function(post) {
- var _i, _len, _ref;
- _ref = [post].concat(__slice.call(post.clones));
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ var k, len1, ref;
+ ref = [post].concat(slice.call(post.clones));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
toggle(post);
}
});
},
playVideos: function() {
return g.posts.forEach(function(post) {
- var file, video, visible, _i, _len, _ref;
- _ref = [post].concat(__slice.call(post.clones));
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post = _ref[_i];
+ var file, k, len1, ref, video, visible;
+ ref = [post].concat(slice.call(post.clones));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post = ref[k];
file = post.file;
if (!(file && file.isVideo && file.isExpanded)) {
continue;
@@ -9741,7 +9756,7 @@
}
},
contract: function(post) {
- var bottom, cb, el, eventName, file, oldHeight, scrollY, top, x, _i, _len, _ref, _ref1;
+ var bottom, cb, el, eventName, file, k, len1, oldHeight, ref, ref1, scrollY, top, x;
file = post.file;
if (el = file.fullImage) {
top = Header.getTopOf(el);
@@ -9756,9 +9771,9 @@
}
file.thumb.parentNode.href = file.URL;
file.thumb.parentNode.target = '_blank';
- _ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- x = _ref[_i];
+ ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ x = ref[k];
delete file[x];
}
if (!el) {
@@ -9778,9 +9793,9 @@
ImageCommon.pushCache(el);
if (file.isVideo) {
ImageCommon.pause(el);
- _ref1 = ImageExpand.videoCB;
- for (eventName in _ref1) {
- cb = _ref1[eventName];
+ ref1 = ImageExpand.videoCB;
+ for (eventName in ref1) {
+ cb = ref1[eventName];
$.off(el, eventName, cb);
}
}
@@ -9800,7 +9815,7 @@
});
},
expand: function(post, src) {
- var el, file, isVideo, thumb, _ref;
+ var el, file, isVideo, ref, thumb;
file = post.file;
thumb = file.thumb, isVideo = file.isVideo;
if (post.isHidden || file.isExpanding || file.isExpanded) {
@@ -9810,7 +9825,7 @@
file.isExpanding = true;
if (file.fullImage) {
el = file.fullImage;
- } else if (((_ref = ImageCommon.cache) != null ? _ref.dataset.fullID : void 0) === post.fullID) {
+ } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
el = file.fullImage = ImageCommon.popCache();
$.on(el, 'error', ImageExpand.error);
if (Conf['Restart when Opened'] && el.id !== 'ihover') {
@@ -9923,10 +9938,10 @@
};
})(),
setupVideoCB: function(post) {
- var cb, eventName, _ref;
- _ref = ImageExpand.videoCB;
- for (eventName in _ref) {
- cb = _ref[eventName];
+ var cb, eventName, ref;
+ ref = ImageExpand.videoCB;
+ for (eventName in ref) {
+ cb = ref[eventName];
$.on(post.file.fullImage, eventName, cb);
}
if (post.file.videoControls) {
@@ -9960,7 +9975,7 @@
},
menu: {
init: function() {
- var conf, createSubEntry, el, name, subEntries, _ref;
+ var conf, createSubEntry, el, name, ref, subEntries;
if (!ImageExpand.enabled) {
return;
}
@@ -9970,9 +9985,9 @@
});
createSubEntry = ImageExpand.menu.createSubEntry;
subEntries = [];
- _ref = Config.imageExpansion;
- for (name in _ref) {
- conf = _ref[name];
+ ref = Config.imageExpansion;
+ for (name in ref) {
+ conf = ref[name];
subEntries.push(createSubEntry(name, conf[1]));
}
return Header.menu.addEntry({
@@ -10000,8 +10015,8 @@
ImageHover = {
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
if (Conf['Image Hover']) {
@@ -10033,7 +10048,7 @@
},
mouseover: function(post) {
return function(e) {
- var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, right, scale, width, x, _ref, _ref1, _ref2;
+ var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, ref, ref1, ref2, right, scale, width, x;
if (!doc.contains(this)) {
return;
}
@@ -10043,7 +10058,7 @@
return;
}
error = ImageHover.error(post);
- if (((_ref = ImageCommon.cache) != null ? _ref.dataset.fullID : void 0) === post.fullID) {
+ if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
el = ImageCommon.popCache();
$.on(el, 'error', error);
} else {
@@ -10066,23 +10081,23 @@
el.play();
}
}
- _ref1 = (function() {
- var _i, _len, _ref1, _results;
- _ref1 = file.dimensions.split('x');
- _results = [];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- x = _ref1[_i];
- _results.push(+x);
+ ref1 = (function() {
+ var k, len1, ref1, results;
+ ref1 = file.dimensions.split('x');
+ results = [];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ x = ref1[k];
+ results.push(+x);
}
- return _results;
- })(), width = _ref1[0], height = _ref1[1];
- _ref2 = this.getBoundingClientRect(), left = _ref2.left, right = _ref2.right;
+ return results;
+ })(), width = ref1[0], height = ref1[1];
+ ref2 = this.getBoundingClientRect(), left = ref2.left, right = ref2.right;
padding = 16;
maxWidth = Math.max(left, doc.clientWidth - right);
maxHeight = doc.clientHeight - padding;
scale = Math.min(1, maxWidth / width, maxHeight / height);
- el.style.maxWidth = "" + (scale * width) + "px";
- el.style.maxHeight = "" + (scale * height) + "px";
+ el.style.maxWidth = (scale * width) + "px";
+ el.style.maxHeight = (scale * height) + "px";
return UI.hover({
root: this,
el: el,
@@ -10123,8 +10138,8 @@
ImageLoader = {
init: function() {
- var prefetch, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var prefetch, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
@@ -10163,7 +10178,7 @@
return ImageLoader.prefetch(this);
},
replaceVideo: function(post) {
- var attr, file, thumb, video, _i, _len, _ref;
+ var attr, file, k, len1, ref, thumb, video;
file = post.file;
thumb = file.thumb;
video = $.el('video', {
@@ -10176,9 +10191,9 @@
});
video.setAttribute('muted', 'muted');
video.dataset.md5 = thumb.dataset.md5;
- _ref = ['height', 'width', 'maxHeight', 'maxWidth'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- attr = _ref[_i];
+ ref = ['height', 'width', 'maxHeight', 'maxWidth'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ attr = ref[k];
video.style[attr] = thumb.style[attr];
}
video.src = file.URL;
@@ -10187,7 +10202,7 @@
return file.videoThumb = true;
},
prefetch: function(post) {
- var URL, clone, el, file, isImage, isVideo, match, replace, thumb, type, _i, _len, _ref;
+ var URL, clone, el, file, isImage, isVideo, k, len1, match, ref, replace, thumb, type;
file = post.file;
if (!file) {
return;
@@ -10201,16 +10216,16 @@
if (!(replace || Conf['prefetch'])) {
return;
}
- if (![post].concat(__slice.call(post.clones)).some(function(clone) {
+ if (![post].concat(slice.call(post.clones)).some(function(clone) {
return doc.contains(clone.nodes.root);
})) {
return;
}
file.isPrefetched = true;
if (file.videoThumb) {
- _ref = post.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- clone = _ref[_i];
+ ref = post.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ clone = ref[k];
clone.file.thumb.preload = 'auto';
}
thumb.preload = 'auto';
@@ -10224,10 +10239,10 @@
el = $.el(isImage ? 'img' : 'video');
if (replace && isImage) {
$.on(el, 'load', function() {
- var _j, _len1, _ref1;
- _ref1 = post.clones;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- clone = _ref1[_j];
+ var len2, q, ref1;
+ ref1 = post.clones;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ clone = ref1[q];
clone.file.thumb.src = URL;
}
return thumb.src = URL;
@@ -10241,14 +10256,14 @@
}
},
playVideos: function() {
- var qpClone, _ref;
- qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
+ var qpClone, ref;
+ qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0;
return g.posts.forEach(function(post) {
- var thumb, _i, _len, _ref1, _ref2;
- _ref1 = [post].concat(__slice.call(post.clones));
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- post = _ref1[_i];
- if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) {
+ var k, len1, ref1, ref2, thumb;
+ ref1 = [post].concat(slice.call(post.clones));
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ post = ref1[k];
+ if (!((ref2 = post.file) != null ? ref2.videoThumb : void 0)) {
continue;
}
thumb = post.file.thumb;
@@ -10264,8 +10279,8 @@
Metadata = {
init: function() {
- var _ref;
- if (!(Conf['WEBM Metadata'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
+ var ref;
+ if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
return Post.callbacks.push({
@@ -10358,8 +10373,8 @@
RevealSpoilers = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
return;
}
return Post.callbacks.push({
@@ -10368,8 +10383,8 @@
});
},
node: function() {
- var thumb, _ref;
- if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) {
+ var ref, thumb;
+ if (this.isClone || !((ref = this.file) != null ? ref.isSpoiler : void 0)) {
return;
}
thumb = this.file.thumb;
@@ -10381,14 +10396,14 @@
Sauce = {
init: function() {
- var err, link, links, _i, _len, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Sauce'])) {
+ var err, k, len1, link, links, ref, ref1;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
return;
}
links = [];
- _ref1 = Conf['sauces'].split('\n');
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- link = _ref1[_i];
+ ref1 = Conf['sauces'].split('\n');
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ link = ref1[k];
try {
if (link[0] !== '#') {
links.push(link.trim());
@@ -10410,11 +10425,11 @@
});
},
createSauceLink: function(link, post) {
- var a, ext, i, key, m, part, parts, _i, _len, _ref, _ref1, _ref2, _ref3;
+ var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, ref3;
parts = {};
- _ref = link.split(/;(?=(?:text|boards|types):)/);
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- part = _ref[i];
+ ref = link.split(/;(?=(?:text|boards|types):)/);
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ part = ref[i];
if (i === 0) {
parts['url'] = part;
} else {
@@ -10422,7 +10437,7 @@
parts[m[1]] = m[2];
}
}
- parts['text'] || (parts['text'] = ((_ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? _ref1[1] : void 0) || '?');
+ parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
for (key in parts) {
parts[key] = parts[key].replace(/%(T?URL|MD5|board|name|%|semi)/g, function(parameter) {
var type;
@@ -10444,11 +10459,11 @@
return type;
});
}
- ext = ((_ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? _ref2[1] : void 0) || '';
- if (!(!parts['boards'] || (_ref3 = post.board.ID, __indexOf.call(parts['boards'].split(','), _ref3) >= 0))) {
+ ext = ((ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? ref2[1] : void 0) || '';
+ if (!(!parts['boards'] || (ref3 = post.board.ID, indexOf.call(parts['boards'].split(','), ref3) >= 0))) {
return null;
}
- if (!(!parts['types'] || __indexOf.call(parts['types'].split(','), ext) >= 0)) {
+ if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
return null;
}
a = Sauce.link.cloneNode(true);
@@ -10460,14 +10475,14 @@
return a;
},
node: function() {
- var link, node, nodes, _i, _len, _ref;
+ var k, len1, link, node, nodes, ref;
if (this.isClone || !this.file) {
return;
}
nodes = [];
- _ref = Sauce.links;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- link = _ref[_i];
+ ref = Sauce.links;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
if (node = Sauce.createSauceLink(link, this)) {
nodes.push($.tn('\u00A0'), node);
}
@@ -10478,19 +10493,19 @@
Volume = {
init: function() {
- var unmuteEntry, volumeEntry, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
+ var ref, ref1, unmuteEntry, volumeEntry;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
return;
}
$.sync('Allow Sound', function(x) {
- var _ref1;
+ var ref1;
Conf['Allow Sound'] = x;
- return (_ref1 = Volume.inputs) != null ? _ref1.unmute.checked = x : void 0;
+ return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0;
});
$.sync('Default Volume', function(x) {
- var _ref1;
+ var ref1;
Conf['Default Volume'] = x;
- return (_ref1 = Volume.inputs) != null ? _ref1.volume.value = x : void 0;
+ return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0;
});
if (Conf['Mouse Wheel Volume']) {
Post.callbacks.push({
@@ -10498,7 +10513,7 @@
cb: this.node
});
}
- if ((_ref1 = g.BOARD.ID) !== 'gif' && _ref1 !== 'wsg') {
+ if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg') {
return;
}
if (Conf['Mouse Wheel Volume']) {
@@ -10556,8 +10571,8 @@
}
},
node: function() {
- var _ref, _ref1;
- if (!(((_ref = this.board.ID) === 'gif' || _ref === 'wsg') && ((_ref1 = this.file) != null ? _ref1.isVideo : void 0))) {
+ var ref, ref1;
+ if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) {
return;
}
$.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover));
@@ -10593,14 +10608,14 @@
Embedding = {
init: function() {
- var type, _i, _len, _ref;
+ var k, len1, ref, type;
if (!(Conf['Embedding'] || Conf['Link Title'])) {
return;
}
this.types = {};
- _ref = this.ordered_types;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
+ ref = this.ordered_types;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
this.types[type.key] = type;
}
if (Conf['Floating Embeds']) {
@@ -10612,11 +10627,11 @@
}
if (Conf['Link Title']) {
return $.on(d, '4chanXInitFinished PostsInserted', function() {
- var key, service, _ref1, _ref2;
- _ref1 = Embedding.types;
- for (key in _ref1) {
- service = _ref1[key];
- if ((_ref2 = service.title) != null ? _ref2.batchSize : void 0) {
+ var key, ref1, ref2, service;
+ ref1 = Embedding.types;
+ for (key in ref1) {
+ service = ref1[key];
+ if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
Embedding.flushTitles(service.title);
}
}
@@ -10656,11 +10671,11 @@
}
},
services: function(link) {
- var href, match, type, _i, _len, _ref;
+ var href, k, len1, match, ref, type;
href = link.href;
- _ref = Embedding.ordered_types;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
+ ref = Embedding.ordered_types;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
if (!(match = type.regExp.exec(href))) {
continue;
}
@@ -10676,7 +10691,7 @@
}
},
embed: function(data) {
- var embed, href, key, link, name, options, post, uid, value, _ref;
+ var embed, href, key, link, name, options, post, ref, uid, value;
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
href = link.href;
$.addClass(link, key.toLowerCase());
@@ -10684,7 +10699,7 @@
embed = $.el('a', {
href: "http://boards.4chan.org/" + post.board + "/thread/" + post.thread + "#p" + post,
textContent: '(HTTP)',
- title: "" + key + " does not support HTTPS."
+ title: key + " does not support HTTPS."
});
$.after(link, [$.tn(' '), embed]);
return;
@@ -10694,14 +10709,14 @@
href: 'javascript:;',
textContent: '(embed)'
});
- _ref = {
+ ref = {
key: key,
uid: uid,
options: options,
href: href
};
- for (name in _ref) {
- value = _ref[name];
+ for (name in ref) {
+ value = ref[name];
embed.dataset[name] = value;
}
$.on(embed, 'click', Embedding.cb.toggle);
@@ -10767,32 +10782,32 @@
}
},
flushTitles: function(service) {
- var cb, data, queue, _i, _len;
+ var cb, data, k, len1, queue;
queue = service.queue;
if (!(queue != null ? queue.length : void 0)) {
return;
}
service.queue = [];
cb = function() {
- var data, _i, _len;
- for (_i = 0, _len = queue.length; _i < _len; _i++) {
- data = queue[_i];
+ var data, k, len1;
+ for (k = 0, len1 = queue.length; k < len1; k++) {
+ data = queue[k];
Embedding.cb.title(this, data);
}
};
if (!$.cache(service.api((function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = queue.length; _i < _len; _i++) {
- data = queue[_i];
- _results.push(data.uid);
+ var k, len1, results;
+ results = [];
+ for (k = 0, len1 = queue.length; k < len1; k++) {
+ data = queue[k];
+ results.push(data.uid);
}
- return _results;
+ return results;
})()), cb, {
responseType: 'json'
})) {
- for (_i = 0, _len = queue.length; _i < _len; _i++) {
- data = queue[_i];
+ for (k = 0, len1 = queue.length; k < len1; k++) {
+ data = queue[k];
$.extend(data.link, {
innerHTML: "[" + E(data.key) + "] Title Link Blocked (are you using NoScript?)"
});
@@ -10831,7 +10846,7 @@
return container;
},
title: function(req, data) {
- var key, link, link2, options, post, post2, service, status, text, uid, _base, _i, _j, _len, _len1, _ref, _ref1;
+ var base1, k, key, len1, len2, link, link2, options, post, post2, q, ref, ref1, service, status, text, uid;
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
status = req.status;
service = Embedding.types[key].title;
@@ -10845,22 +10860,22 @@
case 403:
return "Forbidden or Private";
default:
- return "" + status + "'d";
+ return status + "'d";
}
})());
link.dataset.original = link.textContent;
link.textContent = text;
- _ref = post.clones;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- post2 = _ref[_i];
- _ref1 = $$('a.linkify', post2.nodes.comment);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- link2 = _ref1[_j];
+ ref = post.clones;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ post2 = ref[k];
+ ref1 = $$('a.linkify', post2.nodes.comment);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ link2 = ref1[q];
if (!(link2.href === link.href)) {
continue;
}
- if ((_base = link2.dataset).original == null) {
- _base.original = link2.textContent;
+ if ((base1 = link2.dataset).original == null) {
+ base1.original = link2.textContent;
}
link2.textContent = text;
}
@@ -10896,9 +10911,9 @@
api: function(uid) {
return "https://api.github.com/gists/" + uid;
},
- text: function(_arg) {
+ text: function(arg) {
var file, files;
- files = _arg.files;
+ files = arg.files;
for (file in files) {
if (files.hasOwnProperty(file)) {
return file;
@@ -10955,7 +10970,7 @@
el = $.el('div');
$.queueTask(function() {
return $.cache("https://mediacru.sh/" + a.dataset.uid + ".json", function() {
- var embed, ext, file, files, i, status, type, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
+ var embed, ext, file, files, i, k, len1, len2, len3, q, ref, ref1, status, type, u;
if (!doc.contains(el)) {
return;
}
@@ -10964,11 +10979,11 @@
return el.textContent = "ERROR " + status;
}
files = this.response.files;
- _ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- type = _ref[_i];
- for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
- file = files[_j];
+ ref = ['video/mp4', 'video/webm', 'video/ogv', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', 'audio/mpeg', 'audio/ogg'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ type = ref[k];
+ for (q = 0, len2 = files.length; q < len2; q++) {
+ file = files[q];
if (file.type === type) {
embed = file;
break;
@@ -10988,9 +11003,9 @@
$.extend(el, {
innerHTML: ""
});
- _ref1 = ['mp4', 'webm'];
- for (i = _k = 0, _len2 = _ref1.length; _k < _len2; i = ++_k) {
- ext = _ref1[i];
+ ref1 = ['mp4', 'webm'];
+ for (i = u = 0, len3 = ref1.length; u < len3; i = ++u) {
+ ext = ref1[i];
el.firstChild.children[i].src = "https://mediacru.sh/" + a.dataset.uid + "." + ext;
}
break;
@@ -11067,7 +11082,7 @@
httpOnly: true,
style: "border: none; width: 640px; height: 360px;",
el: function(a) {
- var channel, id, idparam, obj, result, type, _;
+ var _, channel, id, idparam, obj, result, type;
if (result = /(\w+)\/([bc])\/(\d+)/i.exec(a.dataset.uid)) {
_ = result[0], channel = result[1], type = result[2], id = result[3];
idparam = {
@@ -11158,10 +11173,10 @@
return "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + ids + "&fields=items%28id%2Csnippet%28title%29%29&key=" + key;
},
text: function(data, uid) {
- var item, _i, _len, _ref;
- _ref = data.items;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- item = _ref[_i];
+ var item, k, len1, ref;
+ ref = data.items;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ item = ref[k];
if (item.id === uid) {
return item.snippet.title;
}
@@ -11174,19 +11189,19 @@
regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/((?:pf|kd|lv|mc|gd|gh|db|nn)\/[\w\-]+(,[\w\-]+)*|fc\/\w+\/\d+)/,
style: 'max-width: 80vw; max-height: 80vh;',
el: function(a) {
- var base, el, host, name, names, type, types, url, _, _i, _j, _len, _len1, _ref, _ref1;
+ var _, base, el, host, k, len1, len2, name, names, q, ref, ref1, type, types, url;
el = $.el('video', {
controls: true,
preload: 'auto',
loop: true
});
- _ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = _ref[0], host = _ref[1], names = _ref[2];
+ ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
types = host === 'gd' || host === 'fc' ? [''] : ['.webm', '.mp4'];
- _ref1 = names.split(',');
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- name = _ref1[_i];
- for (_j = 0, _len1 = types.length; _j < _len1; _j++) {
- type = types[_j];
+ ref1 = names.split(',');
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ name = ref1[k];
+ for (q = 0, len2 = types.length; q < len2; q++) {
+ type = types[q];
base = "" + name + type;
url = (function() {
switch (host) {
@@ -11253,8 +11268,8 @@
Linkify = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Linkify']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Linkify']) {
return;
}
if (Conf['Comment Expansion']) {
@@ -11271,7 +11286,7 @@
return Embedding.init();
},
node: function() {
- var link, links, _i, _len;
+ var k, len1, link, links;
if (this.isClone) {
return Embedding.events(this);
}
@@ -11279,8 +11294,8 @@
return;
}
links = Linkify.process(this.nodes.comment);
- for (_i = 0, _len = links.length; _i < _len; _i++) {
- link = links[_i];
+ for (k = 0, len1 = links.length; k < len1; k++) {
+ link = links[k];
Embedding.process(link, this);
}
},
@@ -11394,8 +11409,8 @@
ArchiveLink = {
init: function() {
- var div, entry, type, _i, _len, _ref, _ref1;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
+ var div, entry, k, len1, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
return;
}
div = $.el('div', {
@@ -11404,9 +11419,9 @@
entry = {
el: div,
order: 90,
- open: function(_arg) {
+ open: function(arg) {
var ID, board, thread;
- ID = _arg.ID, thread = _arg.thread, board = _arg.board;
+ ID = arg.ID, thread = arg.thread, board = arg.board;
return !!Redirect.to('thread', {
postID: ID,
threadID: thread.ID,
@@ -11415,9 +11430,9 @@
},
subEntries: []
};
- _ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Unique ID', 'uniqueID'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- type = _ref1[_i];
+ ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ type = ref1[k];
entry.subEntries.push(this.createSubEntry(type[0], type[1]));
}
return Menu.menu.addEntry(entry);
@@ -11428,9 +11443,9 @@
textContent: text,
target: '_blank'
});
- open = type === 'post' ? function(_arg) {
+ open = type === 'post' ? function(arg) {
var ID, board, thread;
- ID = _arg.ID, thread = _arg.thread, board = _arg.board;
+ ID = arg.ID, thread = arg.thread, board = arg.board;
el.href = Redirect.to('thread', {
postID: ID,
threadID: thread.ID,
@@ -11460,8 +11475,8 @@
DeleteLink = {
init: function() {
- var div, fileEl, fileEntry, postEl, postEntry, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
+ var div, fileEl, fileEntry, postEl, postEntry, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
return;
}
div = $.el('div', {
@@ -11486,9 +11501,9 @@
};
fileEntry = {
el: fileEl,
- open: function(_arg) {
+ open: function(arg) {
var file;
- file = _arg.file;
+ file = arg.file;
if (!file || file.isDead) {
return false;
}
@@ -11565,8 +11580,8 @@
},
cooldown: {
start: function(post, node) {
- var length, seconds, _ref;
- if (!((_ref = QR.db) != null ? _ref.get({
+ var length, ref, seconds;
+ if (!((ref = QR.db) != null ? ref.get({
boardID: post.board.ID,
threadID: post.thread.ID,
postID: post.ID
@@ -11598,8 +11613,8 @@
DownloadLink = {
init: function() {
- var a, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
return;
}
a = $.el('a', {
@@ -11610,9 +11625,9 @@
return Menu.menu.addEntry({
el: a,
order: 100,
- open: function(_arg) {
+ open: function(arg) {
var file;
- file = _arg.file;
+ file = arg.file;
if (!file) {
return false;
}
@@ -11626,8 +11641,8 @@
Menu = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) {
return;
}
this.button = $.el('a', {
@@ -11668,8 +11683,8 @@
ReportLink = {
init: function() {
- var a, _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
return;
}
a = $.el('a', {
@@ -11757,34 +11772,34 @@
var x;
MarkNewIPs.ipCount = this.ipCount;
MarkNewIPs.postIDs = (function() {
- var _i, _len, _ref, _results;
- _ref = this.posts.keys;
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- x = _ref[_i];
- _results.push(+x);
+ var k, len1, ref, results;
+ ref = this.posts.keys;
+ results = [];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ x = ref[k];
+ results.push(+x);
}
- return _results;
+ return results;
}).call(this);
return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
},
onUpdate: function(e) {
- var added, fullID, i, ipCount, newPosts, obj, postIDs, removed, x, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1;
- _ref = e.detail, ipCount = _ref.ipCount, newPosts = _ref.newPosts;
+ var added, fullID, i, ipCount, k, len1, len2, len3, len4, newPosts, obj, postIDs, q, ref, ref1, removed, u, w, x;
+ ref = e.detail, ipCount = ref.ipCount, newPosts = ref.newPosts;
postIDs = ThreadUpdater.postIDs;
if (ipCount == null) {
return;
}
if (newPosts.length) {
obj = {};
- _ref1 = MarkNewIPs.postIDs;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- x = _ref1[_i];
+ ref1 = MarkNewIPs.postIDs;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ x = ref1[k];
obj[x] = true;
}
added = 0;
- for (_j = 0, _len1 = postIDs.length; _j < _len1; _j++) {
- x = postIDs[_j];
+ for (q = 0, len2 = postIDs.length; q < len2; q++) {
+ x = postIDs[q];
if (!(x in obj)) {
added++;
}
@@ -11793,14 +11808,14 @@
switch (ipCount - MarkNewIPs.ipCount) {
case added:
i = MarkNewIPs.ipCount;
- for (_k = 0, _len2 = newPosts.length; _k < _len2; _k++) {
- fullID = newPosts[_k];
+ for (u = 0, len3 = newPosts.length; u < len3; u++) {
+ fullID = newPosts[u];
MarkNewIPs.markNew(g.posts[fullID], ++i);
}
break;
case -removed:
- for (_l = 0, _len3 = newPosts.length; _l < _len3; _l++) {
- fullID = newPosts[_l];
+ for (w = 0, len4 = newPosts.length; w < len4; w++) {
+ fullID = newPosts[w];
MarkNewIPs.markOld(g.posts[fullID]);
}
}
@@ -11908,11 +11923,11 @@
return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate);
},
onUpdate: function(e) {
- var fileCount, ipCount, newPosts, postCount, _ref, _ref1;
+ var fileCount, ipCount, newPosts, postCount, ref, ref1;
if (e.detail[404]) {
return;
}
- _ref = e.detail, postCount = _ref.postCount, fileCount = _ref.fileCount, ipCount = _ref.ipCount, newPosts = _ref.newPosts;
+ ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount, ipCount = ref.ipCount, newPosts = ref.newPosts;
ThreadStats.update(postCount, fileCount, ipCount);
if (!Conf["Page Count in Stats"]) {
return;
@@ -11920,7 +11935,7 @@
if (newPosts.length) {
ThreadStats.lastPost = g.posts[newPosts[newPosts.length - 1]].info.date;
}
- if (ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((_ref1 = ThreadStats.pageCountEl) != null ? _ref1.textContent : void 0) !== '1') {
+ if (ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((ref1 = ThreadStats.pageCountEl) != null ? ref1.textContent : void 0) !== '1') {
return ThreadStats.fetchPage();
}
},
@@ -11953,16 +11968,16 @@
});
},
onThreadsLoad: function() {
- var page, thread, _i, _j, _len, _len1, _ref, _ref1;
+ var k, len1, len2, page, q, ref, ref1, thread;
if (!(Conf["Page Count in Stats"] && this.status === 200)) {
return;
}
- _ref = this.response;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- page = _ref[_i];
- _ref1 = page.threads;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- thread = _ref1[_j];
+ ref = this.response;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ page = ref[k];
+ ref1 = page.threads;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ thread = ref1[q];
if (!(thread.no === ThreadStats.thread.ID)) {
continue;
}
@@ -11977,7 +11992,7 @@
ThreadUpdater = {
init: function() {
- var conf, el, input, name, sc, subEntries, updateLink, _ref;
+ var conf, el, input, name, ref, sc, subEntries, updateLink;
if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
return;
}
@@ -12017,9 +12032,9 @@
});
$.on(updateLink.firstElementChild, 'click', this.update);
subEntries = [];
- _ref = Config.updater.checkbox;
- for (name in _ref) {
- conf = _ref[name];
+ ref = Config.updater.checkbox;
+ for (name in ref) {
+ conf = ref[name];
el = UI.checkbox(name, name);
el.title = conf[1];
input = el.firstElementChild;
@@ -12154,15 +12169,15 @@
case 404:
$.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/catalog.json", {
onloadend: function() {
- var confirmed, page, thread, _i, _j, _len, _len1, _ref, _ref1;
+ var confirmed, k, len1, len2, page, q, ref, ref1, thread;
if (this.status === 200) {
confirmed = true;
- _ref = this.response;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- page = _ref[_i];
- _ref1 = page.threads;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- thread = _ref1[_j];
+ ref = this.response;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ page = ref[k];
+ ref1 = page.threads;
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ thread = ref1[q];
if (thread.no === ThreadUpdater.thread.ID) {
confirmed = false;
break;
@@ -12199,9 +12214,9 @@
});
},
error: function(req) {
- var klass, text, _ref;
+ var klass, ref, text;
ThreadUpdater.setInterval();
- _ref = req.status === 304 ? ['', ''] : ["" + req.statusText + " (" + req.status + ")", 'warning'], text = _ref[0], klass = _ref[1];
+ ref = req.status === 304 ? ['', ''] : [req.statusText + " (" + req.status + ")", 'warning'], text = ref[0], klass = ref[1];
return ThreadUpdater.set('status', text, klass);
},
setInterval: function() {
@@ -12257,7 +12272,7 @@
}
},
update: function() {
- var _ref;
+ var ref;
if (!navigator.onLine) {
return;
}
@@ -12267,8 +12282,8 @@
} else {
ThreadUpdater.set('timer', 'Update');
}
- if ((_ref = ThreadUpdater.req) != null) {
- _ref.abort();
+ if ((ref = ThreadUpdater.req) != null) {
+ ref.abort();
}
return ThreadUpdater.req = $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/thread/" + ThreadUpdater.thread + ".json", {
onloadend: ThreadUpdater.cb.load,
@@ -12290,7 +12305,7 @@
return new Notice('info', "The thread is " + change + ".", 30);
},
parse: function(postObjects) {
- var OP, count, files, index, ipCountEl, node, num, post, postObject, posts, root, scroll, _i, _j, _len, _len1;
+ var OP, count, files, index, ipCountEl, k, len1, len2, node, num, post, postObject, posts, q, root, scroll;
OP = postObjects[0];
Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler;
ThreadUpdater.thread.setStatus('Archived', !!+OP.archived);
@@ -12305,8 +12320,8 @@
index = [];
files = [];
count = 0;
- for (_i = 0, _len = postObjects.length; _i < _len; _i++) {
- postObject = postObjects[_i];
+ for (k = 0, len1 = postObjects.length; k < len1; k++) {
+ postObject = postObjects[k];
num = postObject.no;
index.push(num);
if (postObject.fsize) {
@@ -12323,11 +12338,11 @@
var ID;
ID = +post.ID;
if (!(post.info.date > Date.now() - 60 * $.SECOND)) {
- if (__indexOf.call(index, ID) < 0) {
+ if (indexOf.call(index, ID) < 0) {
post.kill();
} else if (post.isDead) {
post.resurrect();
- } else if (post.file && !(post.file.isDead || __indexOf.call(files, ID) >= 0)) {
+ } else if (post.file && !(post.file.isDead || indexOf.call(files, ID) >= 0)) {
post.kill(true);
}
}
@@ -12351,8 +12366,8 @@
ThreadUpdater.lastPost = posts[count - 1].ID;
Main.callbackNodes(Post, posts);
scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
- for (_j = 0, _len1 = posts.length; _j < _len1; _j++) {
- post = posts[_j];
+ for (q = 0, len2 = posts.length; q < len2; q++) {
+ post = posts[q];
root = post.nodes.root;
if (!QuoteThreading.insert(post)) {
$.add(ThreadUpdater.root, post.nodes.root);
@@ -12379,13 +12394,13 @@
404: false,
threadID: ThreadUpdater.thread.fullID,
newPosts: (function() {
- var _k, _len2, _results;
- _results = [];
- for (_k = 0, _len2 = posts.length; _k < _len2; _k++) {
- post = posts[_k];
- _results.push(post.fullID);
+ var len3, results, u;
+ results = [];
+ for (u = 0, len3 = posts.length; u < len3; u++) {
+ post = posts[u];
+ results.push(post.fullID);
}
- return _results;
+ return results;
})(),
postCount: OP.replies + 1,
fileCount: OP.images + (!!ThreadUpdater.thread.OP.file && !ThreadUpdater.thread.OP.file.isDead),
@@ -12438,9 +12453,9 @@
href: 'javascript:;'
}),
order: 6,
- open: function(_arg) {
+ open: function(arg) {
var thread;
- thread = _arg.thread;
+ thread = arg.thread;
if (Conf['Index Mode'] !== 'catalog') {
return false;
}
@@ -12467,8 +12482,8 @@
});
},
isWatched: function(thread) {
- var _ref;
- return (_ref = ThreadWatcher.db) != null ? _ref.get({
+ var ref;
+ return (ref = ThreadWatcher.db) != null ? ref.get({
boardID: thread.board.ID,
threadID: thread.ID
}) : void 0;
@@ -12516,9 +12531,9 @@
if (!Conf['Auto Watch']) {
return;
}
- return $.get('AutoWatch', 0, function(_arg) {
+ return $.get('AutoWatch', 0, function(arg) {
var AutoWatch, thread;
- AutoWatch = _arg.AutoWatch;
+ AutoWatch = arg.AutoWatch;
if (!(thread = g.BOARD.threads[AutoWatch])) {
return;
}
@@ -12532,26 +12547,26 @@
},
cb: {
openAll: function() {
- var a, _i, _len, _ref;
+ var a, k, len1, ref;
if ($.hasClass(this, 'disabled')) {
return;
}
- _ref = $$('a[title]', ThreadWatcher.list);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
+ ref = $$('a[title]', ThreadWatcher.list);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
$.open(a.href);
}
return $.event('CloseMenu');
},
pruneDeads: function() {
- var boardID, data, threadID, _i, _len, _ref, _ref1;
+ var boardID, data, k, len1, ref, ref1, threadID;
if ($.hasClass(this, 'disabled')) {
return;
}
ThreadWatcher.db.forceSync();
- _ref = ThreadWatcher.getAll();
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- _ref1 = _ref[_i], boardID = _ref1.boardID, threadID = _ref1.threadID, data = _ref1.data;
+ ref = ThreadWatcher.getAll();
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
if (!data.isDead) {
continue;
}
@@ -12572,13 +12587,13 @@
return delete Index.followedThreadID;
},
rm: function() {
- var boardID, threadID, _ref;
- _ref = this.parentNode.dataset.fullID.split('.'), boardID = _ref[0], threadID = _ref[1];
+ var boardID, ref, threadID;
+ ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1];
return ThreadWatcher.rm(boardID, +threadID);
},
post: function(e) {
- var boardID, postID, threadID, _ref;
- _ref = e.detail, boardID = _ref.boardID, threadID = _ref.threadID, postID = _ref.postID;
+ var boardID, postID, ref, threadID;
+ ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
if (postID === threadID) {
if (Conf['Auto Watch']) {
return $.set('AutoWatch', threadID);
@@ -12588,13 +12603,13 @@
}
},
onIndexRefresh: function() {
- var boardID, data, db, threadID, _ref;
+ var boardID, data, db, ref, threadID;
db = ThreadWatcher.db;
boardID = g.BOARD.ID;
db.forceSync();
- _ref = db.data.boards[boardID];
- for (threadID in _ref) {
- data = _ref[threadID];
+ ref = db.data.boards[boardID];
+ for (threadID in ref) {
+ data = ref[threadID];
if (!data.isDead && !(threadID in g.BOARD.threads)) {
if (Conf['Auto Prune']) {
ThreadWatcher.db["delete"]({
@@ -12646,17 +12661,17 @@
return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);
},
fetchAllStatus: function() {
- var thread, threads, _i, _len, _ref;
+ var k, len1, ref, thread, threads;
ThreadWatcher.db.forceSync();
ThreadWatcher.unreaddb.forceSync();
- if ((_ref = QR.db) != null) {
- _ref.forceSync();
+ if ((ref = QR.db) != null) {
+ ref.forceSync();
}
if (!(threads = ThreadWatcher.getAll()).length) {
return;
}
- for (_i = 0, _len = threads.length; _i < _len; _i++) {
- thread = threads[_i];
+ for (k = 0, len1 = threads.length; k < len1; k++) {
+ thread = threads[k];
ThreadWatcher.fetchStatus(thread);
}
},
@@ -12678,9 +12693,9 @@
}
});
},
- parseStatus: function(_arg) {
- var boardID, data, fetchCount, isDead, lastReadPost, match, postObj, quotingYou, regexp, status, threadID, unread, _i, _len, _ref, _ref1;
- boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data;
+ parseStatus: function(arg) {
+ var boardID, data, fetchCount, isDead, k, lastReadPost, len1, match, postObj, quotingYou, ref, ref1, regexp, status, threadID, unread;
+ boardID = arg.boardID, threadID = arg.threadID, data = arg.data;
fetchCount = ThreadWatcher.fetchCount;
fetchCount.fetched++;
if (fetchCount.fetched === fetchCount.fetching) {
@@ -12689,7 +12704,7 @@
status = '';
$.rmClass(ThreadWatcher.refreshButton, 'fa-spin');
} else {
- status = "" + (Math.round(fetchCount.fetched / fetchCount.fetching * 100)) + "%";
+ status = (Math.round(fetchCount.fetched / fetchCount.fetching * 100)) + "%";
}
ThreadWatcher.status.textContent = status;
if (this.status === 200 && this.response) {
@@ -12708,13 +12723,13 @@
defaultValue: 0
});
unread = quotingYou = 0;
- _ref = this.response.posts;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- postObj = _ref[_i];
+ ref = this.response.posts;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ postObj = ref[k];
if (!(postObj.no > lastReadPost)) {
continue;
}
- if ((_ref1 = QR.db) != null ? _ref1.get({
+ if ((ref1 = QR.db) != null ? ref1.get({
boardID: boardID,
threadID: threadID,
postID: postObj.no
@@ -12768,11 +12783,11 @@
}
},
getAll: function() {
- var all, boardID, data, threadID, threads, _ref;
+ var all, boardID, data, ref, threadID, threads;
all = [];
- _ref = ThreadWatcher.db.data.boards;
- for (boardID in _ref) {
- threads = _ref[boardID];
+ ref = ThreadWatcher.db.data.boards;
+ for (boardID in ref) {
+ threads = ref[boardID];
if (Conf['Current Board'] && boardID !== g.BOARD.ID) {
continue;
}
@@ -12812,9 +12827,9 @@
});
$.add(link, title);
div = $.el('div');
- fullID = "" + boardID + "." + threadID;
+ fullID = boardID + "." + threadID;
div.dataset.fullID = fullID;
- if (g.VIEW === 'thread' && fullID === ("" + g.BOARD + "." + g.THREADID)) {
+ if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) {
$.addClass(div, 'current');
}
if (data.isDead) {
@@ -12832,26 +12847,26 @@
return div;
},
refresh: function() {
- var boardID, data, list, nodes, refresher, threadID, _i, _j, _len, _len1, _ref, _ref1, _ref2;
+ var boardID, data, k, len1, len2, list, nodes, q, ref, ref1, ref2, refresher, threadID;
nodes = [];
- _ref = ThreadWatcher.getAll();
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- _ref1 = _ref[_i], boardID = _ref1.boardID, threadID = _ref1.threadID, data = _ref1.data;
+ ref = ThreadWatcher.getAll();
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
nodes.push(ThreadWatcher.makeLine(boardID, threadID, data));
}
list = ThreadWatcher.list;
$.rmAll(list);
$.add(list, nodes);
g.threads.forEach(function(thread) {
- var helper, post, toggler, _j, _len1, _ref2;
+ var helper, len2, post, q, ref2, toggler;
helper = ThreadWatcher.isWatched(thread) ? ['addClass', 'Unwatch'] : ['rmClass', 'Watch'];
if (thread.OP) {
- _ref2 = [thread.OP].concat(__slice.call(thread.OP.clones));
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- post = _ref2[_j];
+ ref2 = [thread.OP].concat(slice.call(thread.OP.clones));
+ for (q = 0, len2 = ref2.length; q < len2; q++) {
+ post = ref2[q];
toggler = $('.watch-thread-link', post.nodes.post);
$[helper[0]](toggler, 'watched');
- toggler.title = "" + helper[1] + " Thread";
+ toggler.title = helper[1] + " Thread";
}
}
if (thread.catalogView) {
@@ -12859,9 +12874,9 @@
}
});
ThreadWatcher.refreshIcon();
- _ref2 = ThreadWatcher.menu.refreshers;
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- refresher = _ref2[_j];
+ ref2 = ThreadWatcher.menu.refreshers;
+ for (q = 0, len2 = ref2.length; q < len2; q++) {
+ refresher = ref2[q];
refresher();
}
if (Index.nodes && Conf['Pin Watched Threads']) {
@@ -12870,16 +12885,16 @@
}
},
refreshIcon: function() {
- var className, _i, _len, _ref;
- _ref = ['replies-unread', 'replies-quoting-you'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- className = _ref[_i];
+ var className, k, len1, ref;
+ ref = ['replies-unread', 'replies-quoting-you'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ className = ref[k];
ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog));
}
},
update: function(boardID, threadID, newData) {
- var data, key, line, n, newLine, val, _ref;
- if (!(data = (_ref = ThreadWatcher.db) != null ? _ref.get({
+ var data, key, line, n, newLine, ref, val;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
boardID: boardID,
threadID: threadID
}) : void 0)) {
@@ -12925,8 +12940,8 @@
}
},
set404: function(boardID, threadID, cb) {
- var data, _ref;
- if (!(data = (_ref = ThreadWatcher.db) != null ? _ref.get({
+ var data, ref;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
boardID: boardID,
threadID: threadID
}) : void 0)) {
@@ -13042,18 +13057,18 @@
order: 60
});
$.on(entryEl, 'click', function() {
- return ThreadWatcher.toggle(g.threads["" + g.BOARD + "." + g.THREADID]);
+ return ThreadWatcher.toggle(g.threads[g.BOARD + "." + g.THREADID]);
});
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];
+ var addClass, ref, rmClass, text;
+ 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);
return entryEl.textContent = text;
});
},
addMenuEntries: function() {
- var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1;
+ var cb, conf, entries, entry, k, len1, name, ref, ref1, refresh, subEntries;
entries = [];
entries.push({
cb: ThreadWatcher.cb.openAll,
@@ -13078,9 +13093,9 @@
}
});
subEntries = [];
- _ref = Config.threadWatcher;
- for (name in _ref) {
- conf = _ref[name];
+ ref = Config.threadWatcher;
+ for (name in ref) {
+ conf = ref[name];
subEntries.push(this.createSubEntry(name, conf[1]));
}
entries.push({
@@ -13091,8 +13106,8 @@
subEntries: subEntries
}
});
- for (_i = 0, _len = entries.length; _i < _len; _i++) {
- _ref1 = entries[_i], entry = _ref1.entry, cb = _ref1.cb, refresh = _ref1.refresh;
+ for (k = 0, len1 = entries.length; k < len1; k++) {
+ ref1 = entries[k], entry = ref1.entry, cb = ref1.cb, refresh = ref1.refresh;
if (entry.el.nodeName === 'A') {
entry.el.href = 'javascript:;';
}
@@ -13148,7 +13163,7 @@
});
},
node: function() {
- var ID, _i, _len, _ref;
+ var ID, k, len1, ref;
Unread.thread = this;
Unread.title = d.title;
Unread.lastReadPost = Unread.db.get({
@@ -13157,9 +13172,9 @@
defaultValue: 0
});
Unread.readCount = 0;
- _ref = this.posts.keys;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- ID = _ref[_i];
+ ref = this.posts.keys;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ID = ref[k];
if (+ID <= Unread.lastReadPost) {
Unread.readCount++;
}
@@ -13203,7 +13218,7 @@
}
},
sync: function() {
- var ID, i, lastReadPost, postIDs, _i, _ref, _ref1;
+ var ID, i, k, lastReadPost, postIDs, ref, ref1;
if (Unread.lastReadPost == null) {
return;
}
@@ -13217,7 +13232,7 @@
}
Unread.lastReadPost = lastReadPost;
postIDs = Unread.thread.posts.keys;
- for (i = _i = _ref = Unread.readCount, _ref1 = postIDs.length; _i < _ref1; i = _i += 1) {
+ for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
ID = +postIDs[i];
if (!Unread.thread.posts[ID].isFetchedQuote) {
if (ID > Unread.lastReadPost) {
@@ -13233,12 +13248,12 @@
return Unread.update();
},
addPost: function() {
- var _ref;
+ var ref;
if (this.isFetchedQuote || this.isClone) {
return;
}
Unread.order.push(this);
- if (this.ID <= Unread.lastReadPost || this.isHidden || ((_ref = QR.db) != null ? _ref.get({
+ if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QR.db) != null ? ref.get({
boardID: this.board.ID,
threadID: this.thread.ID,
postID: this.ID
@@ -13250,11 +13265,11 @@
return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
},
addPostQuotingYou: function(post) {
- var quotelink, _i, _len, _ref, _ref1;
- _ref = post.nodes.quotelinks;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- quotelink = _ref[_i];
- if (!((_ref1 = QR.db) != null ? _ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
+ var k, len1, quotelink, ref, ref1;
+ ref = post.nodes.quotelinks;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ quotelink = ref[k];
+ if (!((ref1 = QR.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
continue;
}
Unread.postsQuotingYou.add(post.ID);
@@ -13267,7 +13282,7 @@
if (!Header.areNotificationsEnabled) {
return;
}
- notif = new Notification("" + post.info.nameBlock + " replied to you", {
+ notif = new Notification(post.info.nameBlock + " replied to you", {
body: post.info[Conf['Remove Spoilers'] || Conf['Reveal Spoilers'] ? 'comment' : 'commentSpoilered'],
icon: Favicon.logo
});
@@ -13301,14 +13316,14 @@
return Unread.update();
},
read: $.debounce(100, function(e) {
- var ID, count, data, height, root, _ref, _ref1;
+ var ID, count, data, height, ref, ref1, root;
if (d.hidden || !Unread.posts.size) {
return;
}
height = doc.clientHeight;
count = 0;
while (Unread.position) {
- _ref = Unread.position, ID = _ref.ID, data = _ref.data;
+ ref = Unread.position, ID = ref.ID, data = ref.data;
root = data.nodes.root;
if (!(!root.getBoundingClientRect().height || Header.getBottomOf(root) > -1)) {
break;
@@ -13316,7 +13331,7 @@
count++;
Unread.posts["delete"](ID);
Unread.postsQuotingYou["delete"](ID);
- if (Conf['Mark Quotes of You'] && ((_ref1 = QR.db) != null ? _ref1.get({
+ if (Conf['Mark Quotes of You'] && ((ref1 = QR.db) != null ? ref1.get({
boardID: data.board.ID,
threadID: data.thread.ID,
postID: ID
@@ -13340,9 +13355,9 @@
}
},
saveLastReadPost: $.debounce(2 * $.SECOND, function() {
- var ID, i, postIDs, _i, _ref, _ref1;
+ var ID, i, k, postIDs, ref, ref1;
postIDs = Unread.thread.posts.keys;
- for (i = _i = _ref = Unread.readCount, _ref1 = postIDs.length; _i < _ref1; i = _i += 1) {
+ for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
ID = +postIDs[i];
if (!Unread.thread.posts[ID].isFetchedQuote) {
if (Unread.posts.has(ID)) {
@@ -13402,20 +13417,20 @@
Redirect = {
init: function() {
- var archive, archives, boardID, boards, data, files, id, name, o, record, software, type, withCredentials, _i, _j, _len, _len1, _ref, _ref1;
+ var archive, archives, boardID, boards, data, files, id, k, len1, len2, name, o, q, record, ref, ref1, software, type, withCredentials;
o = {
thread: {},
post: {},
file: {}
};
archives = {};
- _ref = Redirect.archives;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- data = _ref[_i];
+ ref = Redirect.archives;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ data = ref[k];
name = data.name, boards = data.boards, files = data.files, software = data.software, withCredentials = data.withCredentials;
archives[name] = data;
- for (_j = 0, _len1 = boards.length; _j < _len1; _j++) {
- boardID = boards[_j];
+ for (q = 0, len2 = boards.length; q < len2; q++) {
+ boardID = boards[q];
if (!(!withCredentials)) {
continue;
}
@@ -13425,21 +13440,21 @@
if (!(boardID in o.post || software !== 'foolfuuka')) {
o.post[boardID] = data;
}
- if (!(boardID in o.file || __indexOf.call(files, boardID) < 0)) {
+ if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) {
o.file[boardID] = data;
}
}
}
- _ref1 = Conf['selectedArchives'];
- for (boardID in _ref1) {
- record = _ref1[boardID];
+ ref1 = Conf['selectedArchives'];
+ for (boardID in ref1) {
+ record = ref1[boardID];
for (type in record) {
id = record[type];
if (id === 'disabled') {
delete o[type][boardID];
} else if (archive = archives[id]) {
boards = type === 'file' ? archive.files : archive.boards;
- if (__indexOf.call(boards, boardID) >= 0) {
+ if (indexOf.call(boards, boardID) >= 0) {
o[type][boardID] = archive;
}
}
@@ -13462,12 +13477,12 @@
if (!archive[protocol.slice(0, -1)]) {
protocol = protocol === 'https:' ? 'http:' : 'https:';
}
- return "" + protocol + "//";
+ return protocol + "//";
},
- thread: function(archive, _arg) {
+ 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;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
+ path = threadID ? boardID + "/thread/" + threadID : boardID + "/post/" + postID;
if (archive.software === 'foolfuuka') {
path += '/';
}
@@ -13476,9 +13491,9 @@
}
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
},
- post: function(archive, _arg) {
+ post: function(archive, arg) {
var URL, boardID, postID, protocol;
- boardID = _arg.boardID, postID = _arg.postID;
+ boardID = arg.boardID, postID = arg.postID;
protocol = Redirect.protocol(archive);
URL = new String("" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID);
if (!Redirect.securityCheck(URL)) {
@@ -13487,22 +13502,22 @@
URL.archive = archive;
return URL;
},
- file: function(archive, _arg) {
+ file: function(archive, arg) {
var boardID, filename;
- boardID = _arg.boardID, filename = _arg.filename;
+ boardID = arg.boardID, filename = arg.filename;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
},
- board: function(archive, _arg) {
+ board: function(archive, arg) {
var boardID;
- boardID = _arg.boardID;
+ boardID = arg.boardID;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/";
},
- search: function(archive, _arg) {
+ search: function(archive, arg) {
var boardID, path, type, value;
- boardID = _arg.boardID, type = _arg.type, value = _arg.value;
- type = type === 'name' ? 'username' : type === 'uniqueID' ? 'uid' : type === 'MD5' ? 'image' : type;
+ boardID = arg.boardID, type = arg.type, value = arg.value;
+ type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type;
value = encodeURIComponent(value);
- path = archive.software === 'foolfuuka' ? "" + boardID + "/search/" + type + "/" + value : "" + boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value;
+ path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value : boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value;
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
},
securityCheck: function(URL) {
@@ -13526,12 +13541,12 @@
return $.one(d, '4chanXInitFinished', this.setup);
},
setup: function() {
- var btn, entry, hr, psa, _ref;
+ var btn, entry, hr, psa, ref;
if (!(psa = PSAHiding.psa = $.id('globalMessage'))) {
$.rmClass(doc, 'hide-announcement');
return;
}
- if ((hr = (_ref = $.id('globalToggle')) != null ? _ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
+ if ((hr = (ref = $.id('globalToggle')) != null ? ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
PSAHiding.hr = hr;
}
entry = {
@@ -13555,9 +13570,9 @@
innerHTML: "[Dismiss]"
});
$.on(btn, 'click', PSAHiding.toggle);
- $.get('hiddenPSA', 0, function(_arg) {
+ $.get('hiddenPSA', 0, function(arg) {
var hiddenPSA;
- hiddenPSA = _arg.hiddenPSA;
+ hiddenPSA = arg.hiddenPSA;
PSAHiding.sync(hiddenPSA);
$.add(psa, btn);
return $.rmClass(doc, 'hide-announcement');
@@ -13576,7 +13591,7 @@
return PSAHiding.sync(UTC);
},
sync: function(UTC) {
- var psa, _ref;
+ var psa, ref;
psa = PSAHiding.psa;
PSAHiding.hidden = PSAHiding.btn.hidden = (UTC != null) && UTC >= +psa.dataset.utc;
if (PSAHiding.hidden) {
@@ -13584,22 +13599,22 @@
} else {
$.after($.id('globalToggle'), psa);
}
- if ((_ref = PSAHiding.hr) != null) {
- _ref.hidden = PSAHiding.hidden;
+ if ((ref = PSAHiding.hr) != null) {
+ ref.hidden = PSAHiding.hidden;
}
}
};
AntiAutoplay = {
init: function() {
- var audio, _i, _len, _ref;
+ var audio, k, len1, ref;
if (!Conf['Disable Autoplaying Sounds']) {
return;
}
$.addClass(doc, 'anti-autoplay');
- _ref = $$('audio[autoplay]', doc);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- audio = _ref[_i];
+ ref = $$('audio[autoplay]', doc);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ audio = ref[k];
this.stop(audio);
}
window.addEventListener('loadstart', ((function(_this) {
@@ -13637,15 +13652,15 @@
return AntiAutoplay.process(this.nodes.root);
},
process: function(root) {
- var iframe, object, _i, _j, _len, _len1, _ref, _ref1;
- _ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- iframe = _ref[_i];
+ var iframe, k, len1, len2, object, q, ref, ref1;
+ ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ iframe = ref[k];
iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
}
- _ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- object = _ref1[_j];
+ ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ object = ref1[q];
object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
}
}
@@ -13707,8 +13722,8 @@
},
cb: {
toggle: function() {
- var banner, i, _ref;
- if (!((_ref = Banner.choices) != null ? _ref.length : void 0)) {
+ var banner, i, ref;
+ if (!((ref = Banner.choices) != null ? ref.length : void 0)) {
Banner.choices = Banner.banners.slice();
}
i = Math.floor(Banner.choices.length * Math.random());
@@ -13716,17 +13731,17 @@
return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner;
},
click: function(e) {
- var br, _base, _i, _len, _name, _ref;
+ var base1, br, k, len1, name1, ref;
if (!(e.ctrlKey || e.metaKey)) {
return;
}
- if ((_base = Banner.original)[_name = this.className] == null) {
- _base[_name] = this.cloneNode(true);
+ if ((base1 = Banner.original)[name1 = this.className] == null) {
+ base1[name1] = this.cloneNode(true);
}
this.contentEditable = true;
- _ref = $$('br', this);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- br = _ref[_i];
+ ref = $$('br', this);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ br = ref[k];
$.replace(br, $.tn('\n'));
}
return this.focus();
@@ -13738,10 +13753,10 @@
}
},
blur: function() {
- var br, _i, _len, _ref;
- _ref = $$('br', this);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- br = _ref[_i];
+ var br, k, len1, ref;
+ ref = $$('br', this);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ br = ref[k];
$.replace(br, $.tn('\n'));
}
if (this.textContent = this.textContent.replace(/\n*$/, '')) {
@@ -13756,7 +13771,7 @@
});
} else {
$.rmAll(this);
- $.add(this, __slice.call(Banner.original[this.className].cloneNode(true).childNodes));
+ $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes));
return Banner.db["delete"]({
boardID: g.BOARD.ID,
threadID: this.className
@@ -13766,17 +13781,17 @@
},
original: {},
custom: function(child) {
- var className, data, event, items, string, string2, _i, _len, _ref;
+ var className, data, event, items, k, len1, ref, string, string2;
className = child.className;
child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase());
child.spellcheck = false;
- _ref = ['click', 'keydown', 'blur'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- event = _ref[_i];
+ ref = ['click', 'keydown', 'blur'];
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ event = ref[k];
$.on(child, event, Banner.cb[event]);
}
- string = "" + g.BOARD + "." + className;
- string2 = "" + string + ".orig";
+ string = g.BOARD + "." + className;
+ string2 = string + ".orig";
items = {};
items[string] = '';
items[string2] = child.textContent;
@@ -13826,10 +13841,10 @@
}
})();
$.ready(function() {
- var catalogLink, link, _i, _len, _ref;
- _ref = $$(selector);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- link = _ref[_i];
+ var catalogLink, k, len1, link, ref;
+ ref = $$(selector);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ link = ref[k];
switch (link.pathname) {
case "/" + g.BOARD + "/":
if (Conf['JSON Navigation']) {
@@ -13872,10 +13887,10 @@
}
},
node: function() {
- var a, m, _i, _len, _ref;
- _ref = $$('a', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
+ var a, k, len1, m, ref;
+ ref = $$('a', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
}
@@ -13893,11 +13908,11 @@
return CatalogLinks.set(this.checked);
},
set: function(useCatalog) {
- var a, board, _i, _len, _ref, _ref1;
- _ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- a = _ref[_i];
- if (((_ref1 = a.hostname) !== 'boards.4chan.org' && _ref1 !== 'catalog.neet.tv' && _ref1 !== '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
+ var a, board, k, len1, ref, ref1;
+ ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ a = ref[k];
+ if (((ref1 = a.hostname) !== 'boards.4chan.org' && ref1 !== 'catalog.neet.tv' && ref1 !== '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
continue;
}
a.href = useCatalog ? CatalogLinks.catalog(board) : "/" + board + "/";
@@ -14016,7 +14031,7 @@
return post.nodes.comment = post.nodes.shortComment;
},
parse: function(req, a, post) {
- var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1;
+ var callback, clone, comment, href, k, len1, len2, len3, postObj, posts, q, quote, ref, ref1, spoilerRange, status, u;
status = req.status;
if (status !== 200 && status !== 304) {
a.textContent = "Error " + req.statusText + " (" + status + ")";
@@ -14026,8 +14041,8 @@
if (spoilerRange = posts[0].custom_spoiler) {
Build.spoilerRange[g.BOARD] = spoilerRange;
}
- for (_i = 0, _len = posts.length; _i < _len; _i++) {
- postObj = posts[_i];
+ for (k = 0, len1 = posts.length; k < len1; k++) {
+ postObj = posts[k];
if (postObj.no === post.ID) {
break;
}
@@ -14039,9 +14054,9 @@
comment = post.nodes.comment;
clone = comment.cloneNode(false);
clone.innerHTML = postObj.com;
- _ref = $$('.quotelink', clone);
- for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
- quote = _ref[_j];
+ ref = $$('.quotelink', clone);
+ for (q = 0, len2 = ref.length; q < len2; q++) {
+ quote = ref[q];
href = quote.getAttribute('href');
if (href[0] === '/') {
continue;
@@ -14049,7 +14064,7 @@
if (href[0] === '#') {
quote.href = "" + (a.pathname.split('/').splice(0, 4).join('/')) + href;
} else {
- quote.href = "" + (a.pathname.split('/').splice(0, 3).join('/')) + "/" + href;
+ quote.href = (a.pathname.split('/').splice(0, 3).join('/')) + "/" + href;
}
}
post.nodes.shortComment = comment;
@@ -14057,9 +14072,9 @@
post.nodes.comment = post.nodes.longComment = clone;
post.parseComment();
post.parseQuotes();
- _ref1 = ExpandComment.callbacks;
- for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
- callback = _ref1[_k];
+ ref1 = ExpandComment.callbacks;
+ for (u = 0, len3 = ref1.length; u < len3; u++) {
+ callback = ref1[u];
callback.call(post);
}
}
@@ -14087,20 +14102,20 @@
if (!(a = $.x('following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
return;
}
- a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(__slice.call(a.textContent.match(/\d+/g))));
+ a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
a.style.cursor = 'pointer';
return $.on(a, 'click', ExpandThread.cbToggle);
},
disconnect: function(refresh) {
- var status, threadID, _ref, _ref1;
+ var ref, ref1, status, threadID;
if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
return;
}
- _ref = ExpandThread.statuses;
- for (threadID in _ref) {
- status = _ref[threadID];
- if ((_ref1 = status.req) != null) {
- _ref1.abort();
+ ref = ExpandThread.statuses;
+ for (threadID in ref) {
+ status = ref[threadID];
+ if ((ref1 = status.req) != null) {
+ ref1.abort();
}
delete ExpandThread.statuses[threadID];
}
@@ -14115,7 +14130,7 @@
});
},
text: function(status, posts, files) {
- return ("" + status + " " + posts + " post" + (posts > 1 ? 's' : '')) + (+files ? " and " + files + " image repl" + (files > 1 ? 'ies' : 'y') : "") + (" " + (status === '-' ? 'shown' : 'omitted') + ".");
+ return (status + " " + posts + " post" + (posts > 1 ? 's' : '')) + (+files ? " and " + files + " image repl" + (files > 1 ? 'ies' : 'y') : "") + (" " + (status === '-' ? 'shown' : 'omitted') + ".");
},
cbToggle: function(e) {
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
@@ -14139,20 +14154,20 @@
expand: function(thread, a) {
var status;
ExpandThread.statuses[thread] = status = {};
- a.textContent = ExpandThread.text.apply(ExpandThread, ['...'].concat(__slice.call(a.textContent.match(/\d+/g))));
+ a.textContent = ExpandThread.text.apply(ExpandThread, ['...'].concat(slice.call(a.textContent.match(/\d+/g))));
return status.req = $.cache("//a.4cdn.org/" + thread.board + "/thread/" + thread + ".json", function() {
delete status.req;
return ExpandThread.parse(this, thread, a);
});
},
contract: function(thread, a, threadRoot) {
- var filesCount, inlined, num, postsCount, replies, reply, status, _i, _len;
+ var filesCount, inlined, k, len1, num, postsCount, replies, reply, status;
status = ExpandThread.statuses[thread];
delete ExpandThread.statuses[thread];
if (status.req) {
status.req.abort();
if (a) {
- a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(__slice.call(a.textContent.match(/\d+/g))));
+ a.textContent = ExpandThread.text.apply(ExpandThread, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
}
return;
}
@@ -14177,8 +14192,8 @@
}
postsCount = 0;
filesCount = 0;
- for (_i = 0, _len = replies.length; _i < _len; _i++) {
- reply = replies[_i];
+ for (k = 0, len1 = replies.length; k < len1; k++) {
+ reply = replies[k];
if (Conf['Quote Inlining']) {
while (inlined = $('.inlined', reply)) {
inlined.click();
@@ -14193,8 +14208,8 @@
return a.textContent = ExpandThread.text('+', postsCount, filesCount);
},
parse: function(req, thread, a) {
- var filesCount, post, postData, posts, postsCount, postsRoot, root, _i, _len, _ref, _ref1;
- if ((_ref = req.status) !== 200 && _ref !== 304) {
+ var filesCount, k, len1, post, postData, posts, postsCount, postsRoot, ref, ref1, root;
+ if ((ref = req.status) !== 200 && ref !== 304) {
a.textContent = "Error " + req.statusText + " (" + req.status + ")";
return;
}
@@ -14202,9 +14217,9 @@
posts = [];
postsRoot = [];
filesCount = 0;
- _ref1 = req.response.posts;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- postData = _ref1[_i];
+ ref1 = req.response.posts;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ postData = ref1[k];
if (postData.no === thread.ID) {
continue;
}
@@ -14233,8 +14248,8 @@
FileInfo = {
init: function() {
- var _ref;
- if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['File Info Formatting']) {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['File Info Formatting']) {
return;
}
return Post.callbacks.push({
@@ -14352,8 +14367,8 @@
Fourchan = {
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
if (g.BOARD.ID === 'g') {
@@ -14379,7 +14394,7 @@
});
},
code: function() {
- var apply, pre, _i, _len, _ref;
+ var apply, k, len1, pre, ref;
if (this.isClone) {
return;
}
@@ -14388,9 +14403,9 @@
return $.addClass(pre, 'prettyprinted');
};
$.on(window, 'prettyprint:cb', apply);
- _ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- pre = _ref[_i];
+ ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ pre = ref[k];
$.event('prettyprint', pre.innerHTML, window);
}
$.off(window, 'prettyprint:cb', apply);
@@ -14413,8 +14428,8 @@
IDColor = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Color User IDs'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) {
return;
}
this.ids = {
@@ -14456,8 +14471,8 @@
IDHighlight = {
init: function() {
- var _ref;
- if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
return;
}
return Post.callbacks.push({
@@ -14502,12 +14517,12 @@
$.sync(hotkey, Keybinds.sync);
}
init = function() {
- var node, _i, _len, _ref;
+ var k, len1, node, ref;
$.off(d, '4chanXInitFinished', init);
$.on(d, 'keydown', Keybinds.keydown);
- _ref = $$('[accesskey]');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- node = _ref[_i];
+ ref = $$('[accesskey]');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
node.removeAttribute('accesskey');
}
};
@@ -14517,17 +14532,17 @@
return Conf[hotkey] = key;
},
keydown: function(e) {
- var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
+ var form, k, key, len1, notification, notifications, op, ref, ref1, ref2, ref3, ref4, ref5, searchInput, target, thread, threadRoot;
if (!(key = Keybinds.keyCode(e))) {
return;
}
target = e.target;
- if ((_ref = target.nodeName) === 'INPUT' || _ref === 'TEXTAREA') {
+ if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') {
if (!/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key)) {
return;
}
}
- if (!(((_ref1 = g.VIEW) !== 'index' && _ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
+ if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
threadRoot = Nav.getThread();
if (op = $('.op', threadRoot)) {
thread = Get.postFromNode(op).thread;
@@ -14562,8 +14577,8 @@
if (Settings.dialog) {
Settings.close();
} else if ((notifications = $$('.notification')).length) {
- for (_i = 0, _len = notifications.length; _i < _len; _i++) {
- notification = notifications[_i];
+ for (k = 0, len1 = notifications.length; k < len1; k++) {
+ notification = notifications[k];
$('.close', notification).click();
}
} else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) {
@@ -14659,13 +14674,13 @@
Gallery.cb.toggle();
break;
case Conf['fappeTyme']:
- if (!(Conf['Fappe Tyme'] && ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
FappeTyme.toggle('fappe');
break;
case Conf['werkTyme']:
- if (!(Conf['Werk Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread') && g.BOARD.ID !== 'f')) {
return;
}
FappeTyme.toggle('werk');
@@ -14685,7 +14700,7 @@
return;
}
if (Conf['JSON Navigation']) {
- if ((_ref4 = Conf['Index Mode']) !== 'paged' && _ref4 !== 'infinite') {
+ if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
return;
}
$('.next button', Index.pagelist).click();
@@ -14700,7 +14715,7 @@
return;
}
if (Conf['JSON Navigation']) {
- if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
+ if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
return;
}
$('.prev button', Index.pagelist).click();
@@ -14919,7 +14934,7 @@
}
},
hl: function(delta, thread) {
- var axis, height, next, postEl, replies, reply, root, _i, _len;
+ var axis, height, k, len1, next, postEl, replies, reply, root;
postEl = $('.reply.highlight', thread);
if (!delta) {
if (postEl) {
@@ -14932,7 +14947,7 @@
if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
root = postEl.parentNode;
axis = delta === +1 ? 'following' : 'preceding';
- if (!(next = $.x("" + axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
+ if (!(next = $.x(axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
return;
}
Header.scrollToIfNeeded(next, delta === +1);
@@ -14946,8 +14961,8 @@
if (delta === -1) {
replies.reverse();
}
- for (_i = 0, _len = replies.length; _i < _len; _i++) {
- reply = replies[_i];
+ for (k = 0, len1 = replies.length; k < len1; k++) {
+ reply = replies[k];
if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) {
this.focus(reply);
return;
@@ -15011,10 +15026,10 @@
}
},
getThread: function() {
- var thread, threadRoot, _i, _len, _ref;
- _ref = $$('.thread');
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- threadRoot = _ref[_i];
+ var k, len1, ref, thread, threadRoot;
+ ref = $$('.thread');
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ threadRoot = ref[k];
thread = Get.threadFromRoot(threadRoot);
if (thread.isHidden && !thread.stub) {
continue;
@@ -15026,13 +15041,13 @@
return $('.board');
},
scroll: function(delta) {
- var axis, extra, next, thread, top, _ref;
- if ((_ref = d.activeElement) != null) {
- _ref.blur();
+ var axis, extra, next, ref, thread, top;
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
}
thread = Nav.getThread();
axis = delta === +1 ? 'following' : 'preceding';
- if (next = $.x("" + axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
+ if (next = $.x(axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
top = Header.getTopOf(thread);
if (delta === +1 && top < 5 || delta === -1 && top > -5) {
thread = next;
@@ -15040,7 +15055,7 @@
}
extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom;
if (extra > 0) {
- d.body.style.marginBottom = "" + extra + "px";
+ d.body.style.marginBottom = extra + "px";
}
Header.scrollTo(thread);
if (extra > 0 && !Nav.haveExtra) {
@@ -15052,7 +15067,7 @@
var extra;
extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;
if (extra > 0) {
- return d.body.style.marginBottom = "" + extra + "px";
+ return d.body.style.marginBottom = extra + "px";
} else {
d.body.style.marginBottom = null;
delete Nav.haveExtra;
@@ -15064,8 +15079,8 @@
RelativeDates = {
INTERVAL: $.MINUTE / 2,
init: function() {
- var _ref;
- if (((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
+ var ref;
+ if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') {
this.flush();
$.on(d, 'visibilitychange ThreadUpdate', this.flush);
}
@@ -15100,18 +15115,18 @@
if (rounded !== 1) {
unit += 's';
}
- return "" + rounded + " " + unit + " ago";
+ return rounded + " " + unit + " ago";
},
stale: [],
flush: function() {
- var data, now, _i, _len, _ref;
+ var data, k, len1, now, ref;
if (d.hidden) {
return;
}
now = new Date();
- _ref = RelativeDates.stale;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- data = _ref[_i];
+ ref = RelativeDates.stale;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ data = ref[k];
RelativeDates.update(data, now);
}
RelativeDates.stale = [];
@@ -15126,16 +15141,16 @@
return post.nodes.date.title = RelativeDates.relative(diff, now, date);
},
update: function(data, now) {
- var date, diff, isPost, relative, singlePost, _i, _len, _ref;
+ var date, diff, isPost, k, len1, ref, relative, singlePost;
isPost = data instanceof Post;
date = isPost ? data.info.date : new Date(+data.dataset.utc);
now || (now = new Date());
diff = now - date;
relative = RelativeDates.relative(diff, now, date);
if (isPost) {
- _ref = [data].concat(data.clones);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- singlePost = _ref[_i];
+ ref = [data].concat(data.clones);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ singlePost = ref[k];
singlePost.nodes.date.firstChild.textContent = relative;
}
} else {
@@ -15149,7 +15164,7 @@
return setTimeout(RelativeDates.markStale, delay, data);
},
markStale: function(data) {
- if (__indexOf.call(RelativeDates.stale, data) >= 0) {
+ if (indexOf.call(RelativeDates.stale, data) >= 0) {
return;
}
if (data instanceof Post && !g.posts[data.fullID]) {
@@ -15185,23 +15200,23 @@
return RemoveSpoilers.unspoiler(this.nodes.comment);
},
unspoiler: function(el) {
- var span, spoiler, spoilers, _i, _len;
+ var k, len1, span, spoiler, spoilers;
spoilers = $$('s', el);
- for (_i = 0, _len = spoilers.length; _i < _len; _i++) {
- spoiler = spoilers[_i];
+ for (k = 0, len1 = spoilers.length; k < len1; k++) {
+ spoiler = spoilers[k];
span = $.el('span', {
className: 'removed-spoiler'
});
$.replace(spoiler, span);
- $.add(span, __slice.call(spoiler.childNodes));
+ $.add(span, slice.call(spoiler.childNodes));
}
}
};
Time = {
init: function() {
- var _ref;
- if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Time Formatting'])) {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Time Formatting'])) {
return;
}
return Post.callbacks.push({
@@ -15330,7 +15345,7 @@
}
},
open: function(openSection) {
- var dialog, link, links, overlay, section, sectionToOpen, _i, _len, _ref;
+ var dialog, k, len1, link, links, overlay, ref, section, sectionToOpen;
if (Settings.overlay) {
return;
}
@@ -15351,9 +15366,9 @@
$.on($('.reset', dialog), 'click', Settings.reset);
$.on($('input', dialog), 'change', Settings.onImport);
links = [];
- _ref = Settings.sections;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- section = _ref[_i];
+ ref = Settings.sections;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ section = ref[k];
link = $.el('a', {
className: "tab-" + section.hyphenatedTitle,
textContent: section.title,
@@ -15376,12 +15391,12 @@
return $.event('OpenSettings', null, dialog);
},
close: function() {
- var _ref;
+ var ref;
if (!Settings.dialog) {
return;
}
- if ((_ref = d.activeElement) != null) {
- _ref.blur();
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
}
$.rm(Settings.overlay);
$.rm(Settings.dialog);
@@ -15390,9 +15405,9 @@
},
sections: [],
addSection: function(title, open) {
- var hyphenatedTitle, _ref;
+ var hyphenatedTitle, ref;
if (typeof title !== 'string') {
- _ref = title.detail, title = _ref.title, open = _ref.open;
+ ref = title.detail, title = ref.title, open = ref.open;
}
hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-');
return Settings.sections.push({
@@ -15415,12 +15430,12 @@
return $.event('OpenSettings', null, section);
},
main: function(section) {
- var arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, _ref;
+ var arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, ref;
items = {};
inputs = {};
- _ref = Config.main;
- for (key in _ref) {
- obj = _ref[key];
+ ref = Config.main;
+ for (key in ref) {
+ obj = ref[key];
fs = $.el('fieldset', {
innerHTML: ""
});
@@ -15467,18 +15482,18 @@
$.get({
hiddenThreads: {},
hiddenPosts: {}
- }, function(_arg) {
- var ID, board, hiddenNum, hiddenPosts, hiddenThreads, thread, _ref1, _ref2;
- hiddenThreads = _arg.hiddenThreads, hiddenPosts = _arg.hiddenPosts;
+ }, function(arg) {
+ var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref1, ref2, thread;
+ hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts;
hiddenNum = 0;
- _ref1 = hiddenThreads.boards;
- for (ID in _ref1) {
- board = _ref1[ID];
+ ref1 = hiddenThreads.boards;
+ for (ID in ref1) {
+ board = ref1[ID];
hiddenNum += Object.keys(board).length;
}
- _ref2 = hiddenPosts.boards;
- for (ID in _ref2) {
- board = _ref2[ID];
+ ref2 = hiddenPosts.boards;
+ for (ID in ref2) {
+ board = ref2[ID];
for (ID in board) {
thread = board[ID];
hiddenNum += Object.keys(thread).length;
@@ -15488,9 +15503,9 @@
});
$.on(button, 'click', function() {
this.textContent = 'Hidden: 0';
- return $.get('hiddenThreads', {}, function(_arg) {
+ return $.get('hiddenThreads', {}, function(arg) {
var boardID, hiddenThreads;
- hiddenThreads = _arg.hiddenThreads;
+ hiddenThreads = arg.hiddenThreads;
for (boardID in hiddenThreads.boards) {
localStorage.removeItem("4chan-hide-t-" + boardID);
}
@@ -15553,7 +15568,7 @@
return reader.readAsText(file);
},
loadSettings: function(data, cb) {
- var convertSettings, key, val, version, _ref;
+ var convertSettings, key, ref, val, version;
version = data.version.split('.');
if (version[0] === '2') {
convertSettings = function(data, map) {
@@ -15633,9 +15648,9 @@
return c;
}
});
- _ref = Config.hotkeys;
- for (key in _ref) {
- val = _ref[key];
+ ref = Config.hotkeys;
+ for (key in ref) {
+ val = ref[key];
if (key in data.Conf) {
data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) {
return "" + (s[0].toUpperCase()) + s.slice(1);
@@ -15714,20 +15729,20 @@
return $.on(ta, 'change', $.cb.value);
},
advanced: function(section) {
- var applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, name, o, row, rows, software, ta, table, warning, withCredentials, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _len6, _m, _n, _o, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
+ var aa, applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, w, warning, withCredentials, y, z;
$.extend(section, {
- innerHTML: ""
+ innerHTML: ""
});
- _ref = $$('.warning', section);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- warning = _ref[_i];
+ ref = $$('.warning', section);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ warning = ref[k];
warning.hidden = Conf[warning.dataset.feature];
}
items = {};
inputs = {};
- _ref1 = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss'];
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- name = _ref1[_j];
+ ref1 = ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'customCooldown'];
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ name = ref1[q];
input = $("[name='" + name + "']", section);
items[name] = Conf[name];
inputs[name] = input;
@@ -15752,7 +15767,7 @@
val = items[key];
input = inputs[key];
input.value = val;
- if (key === 'usercss') {
+ if (key === 'usercss' || key === 'customCooldown') {
continue;
}
Settings[key].call(input);
@@ -15769,11 +15784,11 @@
$.on(customCSS, 'change', Settings.togglecss);
$.on(applyCSS, 'click', Settings.usercss);
archBoards = {};
- _ref2 = Redirect.archives;
- for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
- _ref3 = _ref2[_k], name = _ref3.name, boards = _ref3.boards, files = _ref3.files, software = _ref3.software, withCredentials = _ref3.withCredentials;
- for (_l = 0, _len3 = boards.length; _l < _len3; _l++) {
- boardID = boards[_l];
+ ref2 = Redirect.archives;
+ for (u = 0, len3 = ref2.length; u < len3; u++) {
+ ref3 = ref2[u], name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials;
+ for (w = 0, len4 = boards.length; w < len4; w++) {
+ boardID = boards[w];
o = archBoards[boardID] || (archBoards[boardID] = {
thread: [[], []],
post: [[], []],
@@ -15784,16 +15799,16 @@
if (software === 'foolfuuka') {
o.post[i].push(name);
}
- if (__indexOf.call(files, boardID) >= 0) {
+ if (indexOf.call(files, boardID) >= 0) {
o.file[i].push(name);
}
}
}
for (boardID in archBoards) {
o = archBoards[boardID];
- _ref4 = ['thread', 'post', 'file'];
- for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) {
- item = _ref4[_m];
+ ref4 = ['thread', 'post', 'file'];
+ for (y = 0, len5 = ref4.length; y < len5; y++) {
+ item = ref4[y];
i = o[item][0].length ? 1 : 0;
o[item][i].push('disabled');
o[item] = o[item][0].concat(o[item][1]);
@@ -15801,9 +15816,9 @@
}
rows = [];
boardOptions = [];
- _ref5 = Object.keys(archBoards).sort();
- for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) {
- boardID = _ref5[_n];
+ ref5 = Object.keys(archBoards).sort();
+ for (z = 0, len6 = ref5.length; z < len6; z++) {
+ boardID = ref5[z];
row = $.el('tr', {
className: "board-" + boardID
});
@@ -15814,9 +15829,9 @@
selected: boardID === g.BOARD.ID
}));
o = archBoards[boardID];
- _ref6 = ['thread', 'post', 'file'];
- for (_o = 0, _len6 = _ref6.length; _o < _len6; _o++) {
- item = _ref6[_o];
+ ref6 = ['thread', 'post', 'file'];
+ for (aa = 0, len7 = ref6.length; aa < len7; aa++) {
+ item = ref6[aa];
$.add(row, Settings.addArchiveCell(boardID, o, item));
}
rows.push(row);
@@ -15832,9 +15847,9 @@
$('tbody > :not([hidden])', table).hidden = true;
return $("tbody > ." + this.value, table).hidden = false;
});
- $.get('selectedArchives', Conf['selectedArchives'], function(_arg) {
+ $.get('selectedArchives', Conf['selectedArchives'], function(arg) {
var data, option, selectedArchives, type;
- selectedArchives = _arg.selectedArchives;
+ selectedArchives = arg.selectedArchives;
for (boardID in selectedArchives) {
data = selectedArchives[boardID];
for (type in data) {
@@ -15879,10 +15894,10 @@
},
saveSelectedArchive: function() {
return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) {
- return function(_arg) {
- var selectedArchives, _name;
- selectedArchives = _arg.selectedArchives;
- (selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value;
+ return function(arg) {
+ var name1, selectedArchives;
+ selectedArchives = arg.selectedArchives;
+ (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = {}))[_this.dataset.type] = _this.value;
return $.set('selectedArchives', selectedArchives);
};
})(this));
@@ -15941,7 +15956,7 @@
return CustomCSS.update();
},
keybinds: function(section) {
- var arr, input, inputs, items, key, tbody, tr, _ref;
+ var arr, input, inputs, items, key, ref, tbody, tr;
$.extend(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.
"
});
@@ -15949,9 +15964,9 @@
tbody = $('tbody', section);
items = {};
inputs = {};
- _ref = Config.hotkeys;
- for (key in _ref) {
- arr = _ref[key];
+ ref = Config.hotkeys;
+ for (key in ref) {
+ arr = ref[key];
tr = $.el('tr', {
innerHTML: "" + E(arr[1]) + " | | "
});
@@ -15988,7 +16003,7 @@
Main = {
init: function() {
- var db, flatten, pathname, type, _i, _len, _ref, _ref1;
+ var db, flatten, k, len1, pathname, ref, ref1, type;
if (location.hostname === 'www.google.com') {
type = location.pathname === '/recaptcha/api/fallback' ? 'noscript' : 'v2';
return $.ready(function() {
@@ -15999,7 +16014,7 @@
g.posts = new SimpleDict();
pathname = location.pathname.split('/');
g.BOARD = new Board(pathname[1]);
- if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
+ if ((ref = g.BOARD.ID) === 'z' || ref === 'fk') {
return;
}
g.VIEW = (function() {
@@ -16032,9 +16047,9 @@
}
};
flatten(null, Config);
- _ref1 = DataBoard.keys;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- db = _ref1[_i];
+ ref1 = DataBoard.keys;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ db = ref1[k];
Conf[db] = {
boards: {}
};
@@ -16053,7 +16068,7 @@
});
},
initFeatures: function() {
- var err, feature, name, pathname, _i, _len, _ref, _ref1;
+ var err, feature, k, len1, name, pathname, ref, ref1;
switch (location.hostname) {
case 'a.4cdn.org':
return;
@@ -16063,8 +16078,8 @@
$.asap((function() {
return d.readyState !== 'loading';
}), function() {
- var URL, pathname, video, _ref;
- if (Conf['404 Redirect'] && ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found')) {
+ var URL, pathname, ref, video;
+ if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
Redirect.init();
pathname = location.pathname.split('/');
URL = Redirect.to('file', {
@@ -16093,9 +16108,9 @@
history.replaceState(null, '', pathname.slice(0, 4).join('/') + location.hash);
}
}
- _ref = Main.features;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- _ref1 = _ref[_i], name = _ref1[0], feature = _ref1[1];
+ ref = Main.features;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ ref1 = ref[k], name = ref1[0], feature = ref1[1];
try {
feature.init();
} catch (_error) {
@@ -16109,12 +16124,12 @@
return $.ready(Main.initReady);
},
initStyle: function() {
- var _ref;
+ var ref;
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
return;
}
- if ((_ref = $('link[href*=mobile]', d.head)) != null) {
- _ref.disabled = true;
+ if ((ref = $('link[href*=mobile]', d.head)) != null) {
+ ref.disabled = true;
}
$.addClass(doc, 'fourchan-x', 'seaweedchan');
$.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW);
@@ -16132,10 +16147,10 @@
mainStyleSheet = $('link[title=switch]', d.head);
styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
setStyle = function() {
- var styleSheet, _i, _len;
+ var k, len1, styleSheet;
$.rmClass(doc, style);
- for (_i = 0, _len = styleSheets.length; _i < _len; _i++) {
- styleSheet = styleSheets[_i];
+ for (k = 0, len1 = styleSheets.length; k < len1; k++) {
+ styleSheet = styleSheets[k];
if (styleSheet.href === mainStyleSheet.href) {
style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-');
break;
@@ -16153,8 +16168,8 @@
});
},
initReady: function() {
- var GMver, err, i, passLink, styleSelector, v, _i, _len, _ref, _ref1;
- if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
+ var GMver, err, i, k, len1, passLink, ref, ref1, styleSelector, v;
+ if ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') {
if (g.VIEW === 'thread') {
ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
var href;
@@ -16185,9 +16200,9 @@
} else {
$.event('4chanXInitFinished');
}
- $.get('previousversion', null, function(_arg) {
+ $.get('previousversion', null, function(arg) {
var el, previousversion;
- previousversion = _arg.previousversion;
+ previousversion = arg.previousversion;
if (previousversion === g.VERSION) {
return;
}
@@ -16203,9 +16218,9 @@
});
if (Conf['Show Support Message']) {
GMver = GM_info.version.split('.');
- _ref1 = "1.14".split('.');
- for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) {
- v = _ref1[i];
+ ref1 = "1.14".split('.');
+ for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) {
+ v = ref1[i];
if (v === GMver[i]) {
continue;
}
@@ -16221,18 +16236,18 @@
}
},
initThread: function() {
- var board, err, errors, m, postRoot, posts, scriptData, thread, threadRoot, threads, _i, _j, _len, _len1, _ref, _ref1;
+ var board, err, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads;
if (board = $('.board')) {
threads = [];
posts = [];
- _ref = $$('.board > .thread', board);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- threadRoot = _ref[_i];
+ ref = $$('.board > .thread', board);
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ threadRoot = ref[k];
thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
threads.push(thread);
- _ref1 = $$('.thread > .postContainer', threadRoot);
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- postRoot = _ref1[_j];
+ ref1 = $$('.thread > .postContainer', threadRoot);
+ for (q = 0, len2 = ref1.length; q < len2; q++) {
+ postRoot = ref1[q];
try {
posts.push(new Post(postRoot, thread, g.BOARD));
} catch (_error) {
@@ -16258,9 +16273,9 @@
}
Main.callbackNodes(Thread, threads);
return Main.callbackNodesDB(Post, posts, function() {
- var post, _k, _len2;
- for (_k = 0, _len2 = posts.length; _k < _len2; _k++) {
- post = posts[_k];
+ var len3, post, u;
+ for (u = 0, len3 = posts.length; u < len3; u++) {
+ post = posts[u];
QuoteThreading.insert(post);
}
return $.event('4chanXInitFinished');
@@ -16304,7 +16319,7 @@
return softTask();
},
handleErrors: function(errors) {
- var div, error, logs, _i, _len;
+ var div, error, k, len1, logs;
if (!(errors instanceof Array)) {
error = errors;
} else if (errors.length === 1) {
@@ -16318,14 +16333,14 @@
innerHTML: E(errors.length) + " errors occurred. [show]"
});
$.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;
+ var ref;
+ return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref;
});
logs = $.el('div', {
hidden: true
});
- for (_i = 0, _len = errors.length; _i < _len; _i++) {
- error = errors[_i];
+ for (k = 0, len1 = errors.length; k < len1; k++) {
+ error = errors[k];
$.add(logs, Main.parseError(error));
}
return new Notice('error', [div, logs], 30);
@@ -16337,14 +16352,14 @@
textContent: data.message
});
error = $.el('div', {
- textContent: "" + (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
+ textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
});
return [message, error];
},
isThisPageLegit: function() {
- var _ref;
+ 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');
+ 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');
}
return Main.thisPageIsLegit;
},
@@ -17230,6 +17245,47 @@
" bottom: auto;\n" +
" top: 1px;\n" +
"}\n" +
+"@media (min-width: 1300px) {\n" +
+" :root.fixed:not(.centered-links) #header-bar {\n" +
+" font-size: 12px;\n" +
+" white-space: nowrap;\n" +
+" display: flex;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #board-list {\n" +
+" flex: auto;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list {\n" +
+" display: flex;\n" +
+" line-height: 15px;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) .hide-board-list-container {\n" +
+" flex: none;\n" +
+" margin-right: 5px;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList {\n" +
+" flex: auto;\n" +
+" display: flex;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > a,\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {\n" +
+" flex: none;\n" +
+" padding: .17em;\n" +
+" margin: -.17em -.32em;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span {\n" +
+" pointer-events: none;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span.space {\n" +
+" flex: 0 .63 .63em;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {\n" +
+" flex: 0 .38 .38em;\n" +
+" }\n" +
+" :root.fixed:not(.centered-links) #shortcuts {\n" +
+" float: initial;\n" +
+" flex: none;\n" +
+" }\n" +
+"}\n" +
"/* 4chan X link brackets */\n" +
".brackets-wrap::before {\n" +
" content: \"[\";\n" +
@@ -17802,13 +17858,6 @@
" max-height: 80vh;\n" +
" max-width: 50vw;\n" +
"}\n" +
-".qphl {\n" +
-" outline: 2px solid rgba(216, 94, 49, .7);\n" +
-"}\n" +
-":root.highlight-own .yourPost > .reply,\n" +
-":root.highlight-you .quotesYou > .reply {\n" +
-" border-left: 2px solid rgba(221,0,0,.5);\n" +
-"}\n" +
"/* Quote Threading */\n" +
".threadContainer {\n" +
" margin-left: 20px;\n" +
@@ -17899,10 +17948,6 @@
" -webkit-align-self: stretch;\n" +
" align-self: stretch;\n" +
"}\n" +
-".catalog-thread.watched .werkTyme-filename,\n" +
-".filter-highlight .werkTyme-filename {\n" +
-" border: 2px solid rgba(255, 0, 0, .5);\n" +
-"}\n" +
"/* Index/Reply Navigation */\n" +
"#navlinks {\n" +
" font-size: 16px;\n" +
@@ -17912,16 +17957,37 @@
":root.catalog-mode #navlinks {\n" +
" display: none;\n" +
"}\n" +
-"/* Filter */\n" +
-".opContainer.filter-highlight {\n" +
-" box-shadow: inset 5px 0 rgba(255, 0, 0, .5);\n" +
+"/* Highlighting */\n" +
+".qphl {\n" +
+" outline: 2px solid rgba(216, 94, 49, .8);\n" +
"}\n" +
+":root.highlight-own .yourPost > .reply,\n" +
+":root.highlight-you .quotesYou > .reply,\n" +
".filter-highlight > .reply {\n" +
-" box-shadow: -5px 0 rgba(255, 0, 0, .5);\n" +
+" border-left: 3px solid rgba(221, 0, 0, .8);\n" +
+"}\n" +
+":root.highlight-own .yourPost > div.sideArrows,\n" +
+":root.highlight-you .quotesYou > div.sideArrows,\n" +
+".filter-highlight > div.sideArrows {\n" +
+" color: rgba(221, 0, 0, .8);\n" +
+"}\n" +
+":root.highlight-own .yourPost.opContainer,\n" +
+":root.highlight-you .quotesYou.opContainer,\n" +
+".filter-highlight.opContainer {\n" +
+" border-left: 3px solid rgba(221, 0, 0, .8);\n" +
+"}\n" +
+":root.highlight-own .yourPost.opContainer::after,\n" +
+":root.highlight-you .quotesYou.opContainer::after,\n" +
+".filter-highlight.opContainer::after {\n" +
+" content: \"\";\n" +
+" display: block;\n" +
+" clear: both;\n" +
"}\n" +
".catalog-thread.watched .catalog-thumb,\n" +
-".filter-highlight .catalog-thumb {\n" +
-" border: 2px solid rgba(255, 0, 0, .5);\n" +
+".filter-highlight .catalog-thumb,\n" +
+".catalog-thread.watched .werkTyme-filename,\n" +
+".filter-highlight .werkTyme-filename {\n" +
+" border: 2px solid rgba(221, 0, 0, .8);\n" +
"}\n" +
"/* Spoiler text */\n" +
":root.reveal-spoilers s,\n" +
@@ -17976,8 +18042,9 @@
" display: none !important;\n" +
"}\n" +
"#qr select,\n" +
-"#dump-button,\n" +
"#url-button,\n" +
+"#custom-cooldown-button,\n" +
+"#dump-button,\n" +
".remove,\n" +
".captcha-img {\n" +
" cursor: pointer;\n" +
@@ -18032,7 +18099,7 @@
" -webkit-flex-direction: row;\n" +
" flex-direction: row;\n" +
"}\n" +
-"#dump-button {\n" +
+"#url-button, #custom-cooldown-button, #dump-button {\n" +
" width: 10%;\n" +
" margin: 0;\n" +
" margin-right: 4px;\n" +
@@ -18040,13 +18107,8 @@
" padding: 1px 0px 2px;\n" +
" opacity: 0.6;\n" +
"}\n" +
-"#url-button {\n" +
-" width: 10%;\n" +
-" margin: 0;\n" +
-" margin-right: 4px;\n" +
-" font: 13px sans-serif;\n" +
-" padding: 1px 0px 2px;\n" +
-" opacity: 0.6;\n" +
+"#custom-cooldown-button.disabled {\n" +
+" opacity: 0.27;\n" +
"}\n" +
".persona .field {\n" +
" -webkit-flex: 1;\n" +
@@ -18191,6 +18253,9 @@
"#file-n-submit {\n" +
" height: 23px;\n" +
"}\n" +
+"#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {\n" +
+" display: none;\n" +
+"}\n" +
"#qr input[type=\"file\"] {\n" +
" visibility: hidden;\n" +
" position: absolute;\n" +
@@ -18758,9 +18823,6 @@
":root.yotsuba #board-list a, :root.yotsuba #shortcuts a {\n" +
" color: #800000;\n" +
"}\n" +
-":root.yotsuba.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(178,0,0,0.2);\n" +
-"}\n" +
":root.yotsuba.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -18837,9 +18899,6 @@
":root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a {\n" +
" color: #34345C;\n" +
"}\n" +
-":root.yotsuba-b.fixed #custom-board-list .current {\n" +
-" border-bottom: 1px solid rgba(30, 30, 255, 0.2);\n" +
-"}\n" +
":root.yotsuba-b.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -18916,9 +18975,6 @@
":root.futaba #header-bar a, :root.futaba #notifications a {\n" +
" color: #800000;\n" +
"}\n" +
-":root.futaba.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(178,0,0,0.2);\n" +
-"}\n" +
":root.futaba.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -18990,9 +19046,6 @@
":root.burichan #header-bar a, :root.burichan #header-bar #notifications a {\n" +
" color: #34345C;\n" +
"}\n" +
-":root.burichan.fixed #custom-board-list .current {\n" +
-" border-bottom: 1px solid rgba(30, 30, 255, 0.2);\n" +
-"}\n" +
":root.burichan.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,0,0,0.2);\n" +
"}\n" +
@@ -19064,9 +19117,6 @@
":root.tomorrow #header-bar a, :root.tomorrow #notifications a {\n" +
" color: #81A2BE;\n" +
"}\n" +
-":root.tomorrow.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(83,124,160,0.4);\n" +
-"}\n" +
":root.tomorrow.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(95,137,172,0.4);\n" +
"}\n" +
@@ -19092,6 +19142,31 @@
" border-color: #111;\n" +
" background-color: rgba(0, 0, 0, .14);\n" +
"}\n" +
+"/* Highlighting */\n" +
+":root.tomorrow .qphl {\n" +
+" outline: 2px solid rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow.highlight-own .yourPost > .reply,\n" +
+":root.tomorrow.highlight-you .quotesYou > .reply,\n" +
+":root.tomorrow .filter-highlight > .reply {\n" +
+" border-left: 3px solid rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow.highlight-own .yourPost > div.sideArrows,\n" +
+":root.tomorrow.highlight-you .quotesYou > div.sideArrows,\n" +
+":root.tomorrow .filter-highlight > div.sideArrows {\n" +
+" color: rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow.highlight-own .yourPost.opContainer,\n" +
+":root.tomorrow.highlight-you .quotesYou.opContainer,\n" +
+":root.tomorrow .opContainer.filter-highlight {\n" +
+" border-left: 3px solid rgba(129, 162, 190, .9);\n" +
+"}\n" +
+":root.tomorrow .catalog-thread.watched .catalog-thumb,\n" +
+":root.tomorrow .filter-highlight .catalog-thumb,\n" +
+":root.tomorrow .catalog-thread.watched .werkTyme-filename,\n" +
+":root.tomorrow .filter-highlight .werkTyme-filename {\n" +
+" border: 2px solid rgb(64, 192, 255);\n" +
+"}\n" +
"/* QR */\n" +
".tomorrow #dump-list::-webkit-scrollbar-thumb {\n" +
" background-color: #282A2E;\n" +
@@ -19129,6 +19204,10 @@
":root.tomorrow .focused.entry {\n" +
" background: rgba(0, 0, 0, .33);\n" +
"}\n" +
+"/* Unread */\n" +
+":root.tomorrow #unread-line {\n" +
+" border-color: rgb(197, 200, 198);\n" +
+"}\n" +
"/* Thread Watcher */\n" +
":root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.disabled.replies-quoting-you {\n" +
" color: #F00 !important;\n" +
@@ -19162,9 +19241,6 @@
":root.photon #header-bar a, :root.photon #notifications a {\n" +
" color: #FF6600;\n" +
"}\n" +
-":root.photon.fixed #custom-board-list a.current {\n" +
-" border-bottom: 1px solid rgba(0,74,153,0.2);\n" +
-"}\n" +
":root.photon.fixed #custom-board-list .current:hover {\n" +
" border-bottom-color: rgba(255,51,0,0.2);\n" +
"}\n" +
diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip
index 6d284cdcb..0f17cd2cf 100644
Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ
diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml
index 7b539540f..901779f30 100644
--- a/builds/updates-beta.xml
+++ b/builds/updates-beta.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/builds/updates.xml b/builds/updates.xml
index 113df6ff4..b665fe727 100644
--- a/builds/updates.xml
+++ b/builds/updates.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/package.json b/package.json
index e8aab7994..109e450e3 100755
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": {
"name": "4chan X",
- "version": "1.10.1.14",
+ "version": "1.10.2.0",
"repo": "https://github.com/ccd0/4chan-x/",
"page": "https://github.com/ccd0/4chan-x",
"downloads": "https://ccd0.github.io/4chan-x/builds/",