diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index e219c6900..7778d4783 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -344,7 +344,6 @@ Array.prototype.indexOf = function(object) { var i; - i = this.length; while (i--) { if (this[i] === object) { @@ -363,7 +362,6 @@ $.extend = function(object, properties) { var key, val; - for (key in properties) { val = properties[key]; if (!properties.hasOwnProperty(key)) { @@ -381,7 +379,6 @@ $.ready = function(fc) { var cb; - if (d.readyState !== 'loading') { $.queueTask(fc); return; @@ -395,7 +392,6 @@ $.formData = function(form) { var fd, key, val; - if (form instanceof HTMLFormElement) { return new FormData(form); } @@ -415,7 +411,6 @@ $.extend = function(object, properties) { var key, val; - for (key in properties) { val = properties[key]; object[key] = val; @@ -424,11 +419,9 @@ $.ajax = (function() { var lastModified; - lastModified = {}; return function(url, options, extra) { var form, r, sync, type, upCallbacks, whenModified; - if (extra == null) { extra = {}; } @@ -451,11 +444,9 @@ $.cache = (function() { var reqs; - reqs = {}; return function(url, cb, options) { var err, req, rm; - if (req = reqs[url]) { if (req.readyState === 4) { cb.call(req, req.evt); @@ -475,7 +466,6 @@ } $.on(req, 'load', function(e) { var _i, _len, _ref; - _ref = this.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { cb = _ref[_i]; @@ -511,7 +501,6 @@ $.addStyle = function(css, id) { var style; - style = $.el('style', { id: id, textContent: css @@ -558,7 +547,6 @@ } else { return function(el) { var _ref; - return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; }; } @@ -566,7 +554,6 @@ $.rmAll = function(root) { var node; - while (node = root.firstChild) { root.removeChild(node); } @@ -582,7 +569,6 @@ $.nodes = function(nodes) { var frag, node, _i, _len; - if (!(nodes instanceof Array)) { return nodes; } @@ -616,7 +602,6 @@ $.el = function(tag, properties) { var el; - el = d.createElement(tag); if (properties) { $.extend(el, properties); @@ -626,7 +611,6 @@ $.on = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -636,7 +620,6 @@ $.off = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -658,7 +641,6 @@ $.debounce = function(wait, fn) { var args, exec, lastCall, that, timeout; - lastCall = 0; timeout = null; that = null; @@ -680,11 +662,9 @@ $.queueTask = (function() { var execTask, taskChannel, taskQueue; - taskQueue = []; execTask = function() { var args, func, task; - task = taskQueue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -707,7 +687,6 @@ $.globalEval = function(code) { var script; - script = $.el('script', { textContent: code }); @@ -717,7 +696,6 @@ $.bytesToString = function(size) { var unit; - unit = 0; while (size >= 1024) { size /= 1024; @@ -733,7 +711,6 @@ $.item = function(key, val) { var item; - item = {}; item[key] = val; return item; @@ -744,7 +721,6 @@ $.sync = (function() { $.on(window, 'storage', function(e) { var cb; - if (cb = $.syncing[e.key]) { return cb(JSON.parse(e.newValue)); } @@ -756,7 +732,6 @@ $["delete"] = function(keys) { var key, _i, _len; - if (!(keys instanceof Array)) { keys = [keys]; } @@ -770,7 +745,6 @@ $.get = function(key, val, cb) { var items; - if (typeof cb === 'function') { items = $.item(key, val); } else { @@ -789,7 +763,6 @@ $.set = (function() { var set; - set = function(key, val) { key = g.NAMESPACE + key; val = JSON.stringify(val); @@ -800,7 +773,6 @@ }; return function(keys, val) { var key; - if (typeof keys === 'string') { set(keys, val); return; @@ -868,7 +840,6 @@ function Post(root, thread, board, that) { var capcode, date, email, flag, info, name, post, subject, tripcode, uniqueID; - this.thread = thread; this.board = board; if (that == null) { @@ -944,7 +915,6 @@ Post.prototype.parseComment = function() { var bq, i, node, nodes, text; - bq = this.nodes.comment.cloneNode(true); nodes = $$('.abbr, .capcodeReplies, .exif, b', bq); i = 0; @@ -962,7 +932,6 @@ Post.prototype.parseQuotes = function() { var quotelink, _i, _len, _ref; - this.quotes = []; _ref = $$('.quotelink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -973,7 +942,6 @@ Post.prototype.parseQuote = function(quotelink) { var fullID, match; - if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) { return; } @@ -989,7 +957,6 @@ Post.prototype.parseFile = function(that) { var alt, anchor, fileEl, fileInfo, size, thumb, unit; - if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) { return; } @@ -1020,7 +987,6 @@ Post.prototype.kill = function(file, now) { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - now || (now = new Date()); if (file) { if (this.file.isDead) { @@ -1069,7 +1035,6 @@ Post.prototype.resurrect = function() { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - delete this.isDead; delete this.timeOfDeath; $.rmClass(this.nodes.root, 'deleted-post'); @@ -1103,7 +1068,6 @@ Post.prototype.rmClone = function(index) { var clone, _i, _len, _ref; - this.clones.splice(index, 1); _ref = this.clones.slice(index); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1121,7 +1085,6 @@ function Clone(origin, context) { var file, info, inline, inlined, key, nodes, post, root, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - this.origin = origin; this.context = context; _ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']; @@ -1209,7 +1172,6 @@ function DataBoard(key, sync, dontClean) { var init, _this = this; - this.key = key; this.onSync = __bind(this.onSync, this); this.data = Conf[key]; @@ -1233,7 +1195,6 @@ DataBoard.prototype["delete"] = function(_arg) { var boardID, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; if (postID) { delete this.data.boards[boardID][threadID][postID]; @@ -1254,7 +1215,6 @@ DataBoard.prototype.deleteIfEmpty = function(_arg) { var boardID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID; if (threadID) { if (!Object.keys(this.data.boards[boardID][threadID]).length) { @@ -1270,7 +1230,6 @@ DataBoard.prototype.set = function(_arg) { var boardID, postID, threadID, val, _base, _base1, _base2; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val; if (postID !== void 0) { ((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val; @@ -1284,7 +1243,6 @@ DataBoard.prototype.get = function(_arg) { var ID, board, boardID, defaultValue, postID, thread, threadID, val, _i, _len; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, defaultValue = _arg.defaultValue; if (board = this.data.boards[boardID]) { if (!threadID) { @@ -1308,7 +1266,6 @@ DataBoard.prototype.clean = function() { var boardID, now, val, _ref; - _ref = this.data.boards; for (boardID in _ref) { val = _ref[boardID]; @@ -1328,10 +1285,8 @@ DataBoard.prototype.ajaxClean = function(boardID) { var _this = this; - return $.cache("//api.4chan.org/" + boardID + "/threads.json", function(e) { var board, page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (e.target.status === 404) { _this["delete"](boardID); } else if (e.target.status === 200) { @@ -1434,10 +1389,8 @@ }, toBlob: function() { var _base; - return (_base = HTMLCanvasElement.prototype).toBlob || (_base.toBlob = function(cb) { var data, i, l, ui8a, _i; - data = atob(this.toDataURL().slice(22)); l = data.length; ui8a = new Uint8Array(l); @@ -1475,7 +1428,6 @@ init: function() { var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, shortcutToggler, _this = this; - this.menu = new UI.Menu('header'); menuButton = $.el('span', { className: 'menu-button', @@ -1576,7 +1528,6 @@ }); $.ready(function() { var a, cs; - _this.footer = $.id('boardNavDesktopFoot'); if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { a.className = 'current'; @@ -1611,7 +1562,6 @@ }), setBoardList: function() { var a, boardList, btn, fourchannav, fullBoardList; - fourchannav = $.id('boardNavDesktop'); if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) { a.className = 'current'; @@ -1633,7 +1583,6 @@ }, generateBoardList: function(text) { var as, list, nodes; - list = $('#custom-board-list', Header.bar); $.rmAll(list); if (!text) { @@ -1642,7 +1591,6 @@ as = $$('#full-board-list a[title]', Header.bar); nodes = text.match(/[\w@]+((-(all|title|replace|full|index|catalog|url:"[^"]+[^"]"|text:"[^"]+")|\,"[^"]+[^"]"))*|[^\w@]+/g).map(function(t) { var a, board, m, _i, _len; - if (/^[^\w@]/.test(t)) { return $.tn(t); } @@ -1693,7 +1641,6 @@ }, toggleBoardList: function() { var bar, custom, full, showBoardList; - bar = Header.bar; custom = $('#custom-board-list', bar); full = $('#full-board-list', bar); @@ -1729,7 +1676,6 @@ }, toggleLinkJustify: function() { var centered; - $.event('CloseMenu'); centered = this.nodeName === 'INPUT' ? this.checked : void 0; Header.setLinkJustify(centered); @@ -1773,7 +1719,6 @@ }, toggleBarVisibility: function() { var hide, message; - hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); this.checked = hide; $.set('Header auto-hide', Conf['Header auto-hide'] = hide); @@ -1787,7 +1732,6 @@ }, toggleFooterVisibility: function() { var hide, message; - $.event('CloseMenu'); hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden; Header.setFooterVisibility(hide); @@ -1797,7 +1741,6 @@ }, setCustomNav: function(show) { var btn, cust, full, _ref; - Header.customNavToggler.checked = show; cust = $('#custom-board-list', Header.bar); full = $('#full-board-list', Header.bar); @@ -1810,14 +1753,12 @@ }, editCustomNav: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=boardnav]', settings).focus(); }, hashScroll: function() { var hash, post; - if (!((hash = this.location.hash.slice(1)) && (post = $.id(hash)))) { return; } @@ -1828,7 +1769,6 @@ }, scrollToPost: function(post) { var headRect, top; - top = post.getBoundingClientRect().top; if (Conf['Fixed Header'] && !Conf['Bottom Header']) { headRect = Header.bar.getBoundingClientRect(); @@ -1838,7 +1778,6 @@ }, addShortcut: function(el) { var shortcut; - shortcut = $.el('span', { className: 'shortcut brackets-wrap' }); @@ -1850,7 +1789,6 @@ }, createNotification: function(e) { var cb, content, lifetime, notif, type, _ref; - _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; notif = new Notice(type, content, lifetime); if (cb) { @@ -1860,7 +1798,6 @@ areNotificationsEnabled: false, enableDesktopNotifications: function() { var authorize, disable, el, notice, _ref; - if (!(window.Notification && Conf['Desktop Notifications'])) { return; } @@ -1896,7 +1833,6 @@ spoilerRange: {}, shortFilename: function(filename, isReply) { var threshold; - threshold = isReply ? 30 : 40; if (filename.length - 4 > threshold) { return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); @@ -1906,7 +1842,6 @@ }, postFromObject: function(data, boardID) { var o; - o = { postID: data.no, threadID: data.resto || data.no, @@ -1951,7 +1886,6 @@ */ var a, boardID, capcode, capcodeClass, capcodeReplies, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; - postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, capcodeReplies = o.capcodeReplies, file = o.file; isOP = postID === threadID; staticPath = '//static.4chan.org/image/'; @@ -2050,7 +1984,6 @@ }, capcodeReplies: function(_arg) { var array, boardID, bq, capcodeReplies, capcodeType, generateCapcodeReplies, html, root, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, bq = _arg.bq, root = _arg.root, capcodeReplies = _arg.capcodeReplies; if (!capcodeReplies) { return; @@ -2087,7 +2020,6 @@ Get = { threadExcerpt: function(thread) { var OP, excerpt, _ref; - OP = thread.OP; excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || Conf['Anonymize'] && 'Anonymous' || $('.nameBlock', OP.nodes.info).textContent.trim(); if (excerpt.length > 70) { @@ -2103,7 +2035,6 @@ }, postFromRoot: function(root) { var boardID, index, link, post, postID; - link = $('a[title="Highlight this post"]', root); boardID = link.pathname.split('/')[1]; postID = link.hash.slice(2); @@ -2123,7 +2054,6 @@ }, postDataFromLink: function(link) { var boardID, path, postID, threadID, _ref; - if (link.hostname === 'boards.4chan.org') { path = link.pathname.split('/'); boardID = path[1]; @@ -2141,7 +2071,6 @@ }, allQuotelinksLinkingTo: function(post) { var ID, quote, quotedPost, quotelinks, quoterPost, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - quotelinks = []; _ref = g.posts; for (ID in _ref) { @@ -2170,14 +2099,12 @@ } return quotelinks.filter(function(quotelink) { var boardID, postID, _ref4; - _ref4 = Get.postDataFromLink(quotelink), boardID = _ref4.boardID, postID = _ref4.postID; return boardID === post.board.ID && postID === post.ID; }); }, postClone: function(boardID, threadID, postID, root, context) { var post, url; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2200,7 +2127,6 @@ }, insert: function(post, root, context) { var clone, nodes; - if (!root.parentNode) { return; } @@ -2214,7 +2140,6 @@ }, fetchedPost: function(req, boardID, threadID, postID, root, context) { var board, post, posts, status, thread, url, _i, _len; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2268,7 +2193,6 @@ }, archivedPost: function(req, boardID, postID, root, context) { var board, bq, comment, data, o, post, thread, threadID, _ref; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2365,10 +2289,8 @@ UI = (function() { var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove; - dialog = function(id, position, html) { var child, el, move, _i, _len, _ref; - el = $.el('div', { className: 'dialog', innerHTML: html, @@ -2410,7 +2332,6 @@ Menu.prototype.makeMenu = function() { var menu; - menu = $.el('div', { className: 'dialog', id: 'menu', @@ -2425,7 +2346,6 @@ Menu.prototype.toggle = function(e, button, data) { var previousButton; - e.preventDefault(); e.stopPropagation(); if (currentMenu) { @@ -2443,7 +2363,6 @@ Menu.prototype.open = function(button, data) { var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2; - menu = this.makeMenu(); currentMenu = menu; lastToggledButton = button; @@ -2482,7 +2401,6 @@ Menu.prototype.insertEntry = function(entry, parent, data) { var subEntry, submenu, _i, _len, _ref; - if (typeof entry.open === 'function') { if (!entry.open(data)) { return; @@ -2516,7 +2434,6 @@ Menu.prototype.findNextEntry = function(entry, direction) { var entries; - entries = __slice.call(entry.parentNode.children); entries.sort(function(first, second) { return +(first.style.order || first.style.webkitOrder) - +(second.style.order || second.style.webkitOrder); @@ -2526,7 +2443,6 @@ Menu.prototype.keybinds = function(e) { var entry, next, nextPrev, subEntry, submenu; - entry = $('.focused', currentMenu); while (subEntry = $('.focused', entry)) { entry = subEntry; @@ -2572,7 +2488,6 @@ Menu.prototype.focus = function(entry) { var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2; - while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) { $.rmClass(focused, 'focused'); } @@ -2600,7 +2515,6 @@ Menu.prototype.addEntry = function(e) { var entry; - entry = e.detail; if (entry.type !== this.type) { return; @@ -2611,7 +2525,6 @@ Menu.prototype.parseEntry = function(entry) { var el, style, subEntries, subEntry, _i, _len; - el = entry.el, subEntries = entry.subEntries; $.addClass(el, 'entry'); $.on(el, 'focus mouseover', (function(e) { @@ -2635,7 +2548,6 @@ })(); dragstart = function(e) { var el, isTouching, o, rect, screenHeight, screenWidth, _ref; - if (e.type === 'mousedown' && e.button !== 0) { return; } @@ -2674,7 +2586,6 @@ }; touchmove = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2686,7 +2597,6 @@ }; drag = function(e) { var bottom, clientX, clientY, left, right, style, top; - clientX = e.clientX, clientY = e.clientY; left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; @@ -2702,7 +2612,6 @@ }; touchend = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2724,7 +2633,6 @@ }; hoverstart = function(_arg) { var asapTest, cb, el, endEvents, latestEvent, o, root; - root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb; o = { root: root, @@ -2759,7 +2667,6 @@ }; hover = function(e) { var clientX, clientY, height, left, right, style, top, _ref; - this.latestEvent = e; height = this.el.offsetHeight; clientX = e.clientX, clientY = e.clientY; @@ -2803,7 +2710,6 @@ }, node: function() { var email, name, tripcode, _ref; - if (this.info.capcode || this.isClone) { return; } @@ -2830,7 +2736,6 @@ filters: {}, init: function() { var boards, err, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4; - if (g.VIEW === 'catalog' || !Conf['Filter']) { return; } @@ -2867,7 +2772,6 @@ op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'yes'; stub = (function() { var _ref3; - switch ((_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0) { case 'yes': return true; @@ -2898,7 +2802,6 @@ }, createFilter: function(regexp, op, stub, hl, top) { var settings, test; - test = typeof regexp === 'string' ? function(value) { return regexp === value; } : function(value) { @@ -2922,7 +2825,6 @@ }, node: function() { var filter, firstThread, key, result, thisThread, value, _i, _len, _ref; - if (this.isClone) { return; } @@ -3034,7 +2936,6 @@ menu: { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) { return; } @@ -3060,7 +2961,6 @@ }, createSubEntry: function(text, type) { var el; - el = $.el('a', { href: 'javascript:;', textContent: text @@ -3071,7 +2971,6 @@ el: el, open: function(post) { var value; - value = Filter[type](post); return value !== false; } @@ -3079,7 +2978,6 @@ }, makeFilter: function() { var re, type, value; - type = this.dataset.type; value = Filter[type](Filter.menu.post); re = ['uniqueID', 'MD5'].contains(type) ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) { @@ -3094,7 +2992,6 @@ re = ['uniqueID', 'MD5'].contains(type) ? "/" + re + "/" : "/^" + re + "$/"; return $.get(type, Conf[type], function(item) { var save, section, select, ta, tl; - save = item[type]; save = save ? "" + save + "\n" + re : re; $.set(type, save); @@ -3128,7 +3025,6 @@ }, node: function() { var data; - if (!this.isReply || this.isClone) { return; } @@ -3152,7 +3048,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub, replies, thisPost; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } @@ -3223,7 +3118,6 @@ order: 20, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3255,7 +3149,6 @@ order: 15, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3272,7 +3165,6 @@ }, hide: function() { var makeStub, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3291,7 +3183,6 @@ }, show: function() { var data, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3315,7 +3206,6 @@ }, hideStub: function() { var post; - post = PostHiding.menu.post; post.nodes.root.hidden = true; $.event('CloseMenu'); @@ -3323,7 +3213,6 @@ }, makeButton: function(post, type) { var a; - a = $.el('a', { className: "" + type + "-reply-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3334,7 +3223,6 @@ }, saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) { var data; - data = { boardID: post.board.ID, threadID: post.thread.ID, @@ -3353,14 +3241,12 @@ }, toggle: function() { var post; - post = Get.postFromNode(this); PostHiding[(post.isHidden ? 'show' : 'hide')](post); return PostHiding.saveHiddenState(post, post.isHidden); }, hide: function(post, makeStub, hideRecursively) { var a, button, postInfo, quotelink, _i, _len, _ref; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3395,7 +3281,6 @@ }, show: function(post, showRecursively) { var quotelink, _i, _len, _ref; - if (showRecursively == null) { showRecursively = Conf['Recursive Hiding']; } @@ -3431,7 +3316,6 @@ }, node: function() { var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; - if (this.isClone) { return; } @@ -3449,7 +3333,6 @@ }, add: function() { var args, obj, post, recursive, _base, _name; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { recursives: [], @@ -3460,7 +3343,6 @@ }, rm: function(recursive, post) { var i, obj, rec, _i, _len, _ref; - if (!(obj = Recursive.recursives[post.fullID])) { return; } @@ -3475,7 +3357,6 @@ }, apply: function() { var ID, args, fullID, post, recursive, _ref; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; fullID = post.fullID; _ref = g.posts; @@ -3502,7 +3383,6 @@ }, node: function() { var data; - if (data = ThreadHiding.db.get({ boardID: this.board.ID, threadID: this.ID @@ -3516,7 +3396,6 @@ }, syncCatalog: function() { var hiddenThreads, hiddenThreadsOnCatalog, threadID; - hiddenThreads = ThreadHiding.db.get({ boardID: g.BOARD.ID, defaultValue: {} @@ -3543,7 +3422,6 @@ cleanCatalog: function(hiddenThreadsOnCatalog) { return $.cache("//api.4chan.org/" + g.BOARD + "/threads.json", function() { var page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (this.status !== 200) { return; } @@ -3569,7 +3447,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub; - if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) { return; } @@ -3591,7 +3468,6 @@ order: 20, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || thread.isHidden) { return false; @@ -3619,7 +3495,6 @@ order: 20, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || !thread.isHidden) { return false; @@ -3639,7 +3514,6 @@ order: 15, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || !thread.isHidden) { return false; @@ -3650,7 +3524,6 @@ }, hide: function() { var makeStub, thread; - makeStub = $('input', this.parentNode).checked; thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, makeStub); @@ -3659,7 +3532,6 @@ }, show: function() { var thread; - thread = ThreadHiding.menu.thread; ThreadHiding.show(thread); ThreadHiding.saveHiddenState(thread); @@ -3667,7 +3539,6 @@ }, hideStub: function() { var thread; - thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, false); $.event('CloseMenu'); @@ -3675,7 +3546,6 @@ }, makeButton: function(thread, type) { var a; - a = $.el('a', { className: "" + type + "-thread-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3687,7 +3557,6 @@ }, saveHiddenState: function(thread, makeStub) { var hiddenThreadsOnCatalog; - hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; if (thread.isHidden) { ThreadHiding.db.set({ @@ -3720,7 +3589,6 @@ }, hide: function(thread, makeStub) { var OP, a, numReplies, opInfo, span, threadRoot; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3744,7 +3612,6 @@ }, show: function(thread) { var threadRoot; - if (thread.stub) { $.rm(thread.stub); delete thread.stub; @@ -3757,7 +3624,6 @@ QuoteBacklink = { init: function() { var format; - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { return; } @@ -3775,7 +3641,6 @@ }, firstNode: function() { var a, clone, container, containers, frag, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - if (this.isClone || !this.quotes.length) { return; } @@ -3813,7 +3678,6 @@ }, secondNode: function() { var container; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { this.nodes.backlinkContainer = $('.container', this.nodes.info); return; @@ -3827,7 +3691,6 @@ }, getContainer: function(id) { var _base; - return (_base = this.containers)[id] || (_base[id] = $.el('span', { className: 'container' })); @@ -3850,7 +3713,6 @@ }, node: function() { var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -3880,7 +3742,6 @@ if (Conf['Quote Hash Navigation']) { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3893,7 +3754,6 @@ } else { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3920,7 +3780,6 @@ }, toggle: function(e) { var boardID, context, postID, threadID, _ref; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { return; } @@ -3946,7 +3805,6 @@ }, add: function(quotelink, boardID, threadID, postID, context) { var inline, isBacklink, post, qroot, root; - isBacklink = $.hasClass(quotelink, 'backlink'); inline = $.el('div', { id: "i" + postID, @@ -3971,7 +3829,6 @@ }, rm: function(quotelink, boardID, threadID, postID, context) { var el, inlined, isBacklink, post, qroot, root, _ref; - isBacklink = $.hasClass(quotelink, 'backlink'); root = QuoteInline.findRoot(quotelink, isBacklink); root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); @@ -4013,7 +3870,6 @@ }, node: function() { var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -4056,7 +3912,6 @@ }, node: function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -4065,7 +3920,6 @@ }, mouseover: function(e) { var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; - if ($.hasClass(this, 'inlined')) { return; } @@ -4109,7 +3963,6 @@ }, mouseout: function() { var clone, post, root, _i, _len, _ref; - if (!(root = this.el.firstElementChild)) { return; } @@ -4139,7 +3992,6 @@ }, node: function() { var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; - if (this.isClone) { return; } @@ -4162,7 +4014,6 @@ QuoteThreading = { init: function() { var input; - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { return; } @@ -4185,7 +4036,6 @@ }, setup: function() { var ID, post, posts; - $.off(d, '4chanXInitFinished', QuoteThreading.setup); posts = g.posts; for (ID in posts) { @@ -4198,7 +4048,6 @@ }, node: function() { var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; - if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { return; } @@ -4228,7 +4077,6 @@ }, nodeinsert: function() { var bottom, height, qpost, qroot, threadContainer, top, _ref; - qpost = g.posts[this.threaded]; delete this.threaded; delete this.cb; @@ -4257,7 +4105,6 @@ }, toggle: function() { var container, containers, node, post, replies, reply, thread, _i, _j, _k, _len, _len1, _len2, _ref; - thread = $('.thread'); replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); QuoteThreading.enabled = this.checked; @@ -4274,7 +4121,6 @@ } else { replies.sort(function(a, b) { var aID, bID; - aID = Number(a.id.slice(2)); bID = Number(b.id.slice(2)); return aID - bID; @@ -4295,7 +4141,6 @@ }, kb: function() { var control; - control = $.id('threadingControl'); return control.click(); } @@ -4322,7 +4167,6 @@ }, node: function() { var quotelink, _i, _len, _ref; - if (this.isClone) { return; } @@ -4346,7 +4190,6 @@ cb: { seek: function(type) { var highlight, post, posts, result, str; - if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) { return; } @@ -4402,7 +4245,6 @@ }, node: function() { var deadlink, _i, _len, _ref; - _ref = $$('.deadlink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { deadlink = _ref[_i]; @@ -4417,7 +4259,6 @@ }, parseDeadlink: function(deadlink) { var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; - if ($.hasClass(deadlink.parentNode, 'prettyprint')) { Quotify.fixDeadlink(deadlink); return; @@ -4510,7 +4351,6 @@ }, node: function() { var data, el, end, endNode, i, index, items, length, link, links, node, result, saved, snapshot, space, test, word, _i, _len, _ref; - if (this.isClone) { if (Conf['Embedding']) { i = 0; @@ -4586,7 +4426,6 @@ }, makeRange: function(startNode, endNode, startOffset, endOffset) { var range; - range = document.createRange(); range.setStart(startNode, startOffset); range.setEnd(endNode, endOffset); @@ -4594,7 +4433,6 @@ }, makeLink: function(range) { var a, char, i, text; - text = range.toString(); i = 0; while (/[(\[{<>]/.test(text.charAt(i))) { @@ -4640,7 +4478,6 @@ }, services: function(link) { var href, key, match, type, _ref; - href = link.href; _ref = Linkify.types; for (key in _ref) { @@ -4653,7 +4490,6 @@ }, embed: function(data) { var embed, href, key, link, name, options, uid, value, _ref; - key = data[0], uid = data[1], options = data[2], link = data[3]; href = link.href; embed = $.el('a', { @@ -4682,7 +4518,6 @@ }, title: function(data) { var embed, err, key, link, options, service, title, titles, uid; - key = data[0], uid = data[1], options = data[2], link = data[3], embed = data[4]; if (!(service = Linkify.types[key].title)) { return; @@ -4719,21 +4554,18 @@ cb: { toggle: function() { var string, _ref; - _ref = $.hasClass(this, "embedded") ? ['unembed', '(embed)'] : ['embed', '(unembed)'], string = _ref[0], this.textContent = _ref[1]; $.replace(this.previousElementSibling, Linkify.cb[string](this)); return $.toggleClass(this, 'embedded'); }, embed: function(a) { var el, style, type; - el = (type = Linkify.types[a.dataset.key]).el(a); el.style.cssText = (style = type.style) ? style : "border: 0; width: 640px; height: 390px"; return el; }, unembed: function(a) { var el; - el = $.el('a', { rel: 'nofollow noreferrer', target: 'blank', @@ -4746,7 +4578,6 @@ }, title: function(response, data) { var embed, key, link, options, service, text, uid; - key = data[0], uid = data[1], options = data[2], link = data[3], embed = data[4]; service = Linkify.types[key].title; switch (response.status) { @@ -4786,7 +4617,6 @@ regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/, el: function(a) { var div; - return div = $.el('iframe', { src: "http://www.purplegene.com/script?url=https://gist.github.com/" + a.dataset.uid + ".js" }); @@ -4797,7 +4627,6 @@ }, text: function(_arg) { var file, files; - files = _arg.files; for (file in files) { if (files.hasOwnProperty(file)) { @@ -4845,7 +4674,6 @@ regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/, el: function(a) { var div; - return div = $.el('iframe', { src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid }); @@ -4856,7 +4684,6 @@ style: 'height: auto; width: 500px; display: inline-block;', el: function(a) { var div; - div = $.el('div', { className: "soundcloud", name: "soundcloud" @@ -4882,7 +4709,6 @@ style: "border: none; width: 640px; height: 360px;", el: function(a) { var channel, chapter, result, _; - if (result = /(\w+)\/(?:[a-z]\/)?(\d+)/i.exec(a.dataset.uid)) { _ = result[0], channel = result[1], chapter = result[2]; return $.el('object', { @@ -4954,7 +4780,6 @@ QR = { init: function() { var sc; - if (!Conf['Quick Reply']) { return; } @@ -5001,7 +4826,6 @@ }, initReady: function() { var link; - QR.postingIsEnabled = !!$.id('postForm'); if (!QR.postingIsEnabled) { return; @@ -5021,13 +4845,11 @@ $.before($.id('postForm'), link); $.on(d, 'QRGetSelectedPost', function(_arg) { var cb; - cb = _arg.detail; return cb(QR.selected); }); $.on(d, 'QRAddPreSubmitHook', function(_arg) { var cb; - cb = _arg.detail; return QR.preSubmitHooks.push(cb); }); @@ -5056,7 +4878,6 @@ }, open: function() { var err; - if (QR.nodes) { QR.nodes.el.hidden = false; QR.unhide(); @@ -5075,7 +4896,6 @@ }, close: function() { var post, _i, _len, _ref; - if (QR.req) { QR.abort(); return; @@ -5128,7 +4948,6 @@ }, error: function(err) { var el; - QR.open(); if (typeof err === 'string') { el = $.tn(err); @@ -5155,7 +4974,6 @@ }, notify: function(el) { var notice, notif; - notice = new Notice('warning', el); QR.notifications.push(notice); if (!Header.areNotificationsEnabled) { @@ -5172,7 +4990,6 @@ notifications: [], cleanNotifications: function() { var notification, _i, _len, _ref; - _ref = QR.notifications; for (_i = 0, _len = _ref.length; _i < _len; _i++) { notification = _ref[_i]; @@ -5182,7 +4999,6 @@ }, status: function() { var disabled, status, thread, value; - if (!QR.nodes) { return; } @@ -5204,7 +5020,6 @@ QR.persona.getPassword(); return $.get('QR.personas', Conf['QR.personas'], function(_arg) { var arr, item, personas, type, types, _i, _len, _ref; - personas = _arg['QR.personas']; types = { name: [], @@ -5224,7 +5039,6 @@ }, parseItem: function(item, types) { var boards, match, type, val, _ref, _ref1; - if (item[0] === '#') { return; } @@ -5253,7 +5067,6 @@ }, loadPersonas: function(type, arr) { var list, val, _i, _len; - list = $("#list-" + type, QR.nodes.el); for (_i = 0, _len = arr.length; _i < _len; _i++) { val = arr[_i]; @@ -5266,7 +5079,6 @@ }, getPassword: function() { var input, m; - if (!QR.persona.pwd) { QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : $.id('delPassword').value; } @@ -5275,7 +5087,6 @@ get: function(cb) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; return cb(persona); }); @@ -5283,7 +5094,6 @@ set: function(post) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; persona = { name: post.name, @@ -5297,7 +5107,6 @@ cooldown: { init: function() { var board; - if (!Conf['Cooldown']) { return; } @@ -5339,7 +5148,6 @@ }, sync: function(cooldowns) { var id; - for (id in cooldowns) { QR.cooldown.cooldowns[id] = cooldowns[id]; } @@ -5347,7 +5155,6 @@ }, set: function(data) { var cooldown, delay, hasFile, isReply, isSage, post, req, start, type, upSpd; - if (!Conf['Cooldown']) { return; } @@ -5387,7 +5194,6 @@ }, count: function() { var cooldown, cooldowns, elapsed, hasFile, isReply, isSage, now, post, seconds, start, type, types, upSpd, upSpdAccuracy, update, _ref; - if (!Object.keys(QR.cooldown.cooldowns).length) { $["delete"]("" + g.BOARD + ".cooldown"); delete QR.cooldown.isCounting; @@ -5441,7 +5247,6 @@ }, quote: function(e) { var caretPos, com, index, post, range, s, sel, text, thread, _ref; - if (e != null) { e.preventDefault(); } @@ -5479,7 +5284,6 @@ }, characterCount: function() { var count, counter; - counter = QR.nodes.charCount; count = QR.nodes.com.textLength; counter.textContent = count; @@ -5488,7 +5292,6 @@ }, drag: function(e) { var toggle; - toggle = e.type === 'dragstart' ? $.off : $.on; toggle(d, 'dragover', QR.dragOver); return toggle(d, 'drop', QR.dropFile); @@ -5508,7 +5311,6 @@ }, paste: function(e) { var blob, files, item, _i, _len, _ref; - files = []; _ref = e.clipboardData.items; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -5548,7 +5350,6 @@ }, fileInput: function(files) { var file, length, max, post, _i, _len; - if (this instanceof Element) { files = __slice.call(this.files); QR.nodes.fileInput.value = null; @@ -5598,7 +5399,6 @@ this.select = __bind(this.select, this); var el, elm, event, prev, _i, _j, _len, _len1, _ref, _ref1, _this = this; - el = $.el('a', { className: 'qr-preview', draggable: true, @@ -5658,7 +5458,6 @@ _Class.prototype.rm = function() { var index; - this["delete"](); index = QR.posts.indexOf(this); if (QR.posts.length === 1) { @@ -5678,7 +5477,6 @@ _Class.prototype.lock = function(lock) { var name, _i, _len, _ref; - if (lock == null) { lock = true; } @@ -5703,7 +5501,6 @@ _Class.prototype.select = function() { var rectEl, rectList; - if (QR.selected) { QR.selected.nodes.el.id = null; QR.selected.forceSave(); @@ -5720,7 +5517,6 @@ _Class.prototype.load = function() { var name, _i, _len, _ref; - _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { name = _ref[_i]; @@ -5732,7 +5528,6 @@ _Class.prototype.save = function(input) { var name, _ref; - if (input.type === 'checkbox') { this.spoiler = input.checked; return; @@ -5763,7 +5558,6 @@ _Class.prototype.forceSave = function() { var name, _i, _len, _ref; - if (this !== QR.selected) { return; } @@ -5793,11 +5587,9 @@ _Class.prototype.setThumbnail = function() { var fileURL, img, _this = this; - img = $.el('img'); img.onload = function() { var cv, height, s, width; - s = 90 * 2; if (_this.file.type === 'image/gif') { s *= 3; @@ -5848,7 +5640,6 @@ _Class.prototype.updateFilename = function() { var long; - long = "" + this.filename + " (" + this.filesize + ")\nCtrl+click to edit filename. Shift+click to clear."; this.nodes.el.title = long; if (this !== QR.selected) { @@ -5871,11 +5662,9 @@ _Class.prototype.pasteText = function(file) { var reader, _this = this; - reader = new FileReader(); reader.onload = function(e) { var text; - text = e.target.result; if (_this.com) { _this.com += "\n" + text; @@ -5913,7 +5702,6 @@ _Class.prototype.drop = function() { var el, index, newIndex, oldIndex, post; - $.rmClass(this, 'over'); if (!this.draggable) { return; @@ -5948,7 +5736,6 @@ ready: function() { var imgContainer, input, setLifetime, _this = this; - setLifetime = function(e) { return _this.lifetime = e.detail; }; @@ -5985,7 +5772,6 @@ }); $.get('captchas', [], function(_arg) { var captchas; - captchas = _arg.captchas; return _this.sync(captchas); }); @@ -6002,7 +5788,6 @@ }, getOne: function() { var captcha, challenge, response; - this.clear(); if (captcha = this.captchas.shift()) { challenge = captcha.challenge, response = captcha.response; @@ -6027,7 +5812,6 @@ }, save: function() { var response; - if (!(response = this.nodes.input.value.trim())) { return; } @@ -6042,7 +5826,6 @@ }, clear: function() { var captcha, i, now, _i, _len, _ref; - now = Date.now(); _ref = this.captchas; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { @@ -6060,7 +5843,6 @@ }, load: function() { var challenge; - if (!this.nodes.challenge.firstChild) { return; } @@ -6073,7 +5855,6 @@ }, count: function() { var count; - count = this.captchas.length; this.nodes.input.placeholder = (function() { switch (count) { @@ -6106,7 +5887,6 @@ }, dialog: function() { var check, dialog, elm, i, items, key, mimeTypes, name, nodes, thread, value, _ref; - QR.nodes = nodes = { el: dialog = UI.dialog('qr', 'top:0;right:0;', "
×
+
No selected file×+
") }; @@ -6229,7 +6009,6 @@ preSubmitHooks: [], submit: function(e) { var challenge, err, extra, filetag, hook, options, post, postData, response, textOnly, thread, threadID, _i, _len, _ref, _ref1; - if (e != null) { e.preventDefault(); } @@ -6343,7 +6122,6 @@ }, response: function() { var URL, ban, board, err, h1, isReply, m, post, postID, req, resDoc, threadID, _, _ref, _ref1; - req = QR.req; delete QR.req; post = QR.posts[0]; @@ -6442,7 +6220,6 @@ FappeTyme = { init: function() { var el, input; - if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { return; } @@ -6494,7 +6271,6 @@ }, node: function() { var thumb, _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6519,7 +6295,6 @@ }, toggleAll: function() { var ID, file, func, post, _i, _len, _ref, _ref1; - $.event('CloseMenu'); if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { ImageExpand.EAI.className = 'contract-all-shortcut icon icon-resize-small'; @@ -6553,7 +6328,6 @@ }, toggle: function(post) { var headRect, rect, root, thumb, x, y; - thumb = post.file.thumb; if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { ImageExpand.expand(post); @@ -6563,7 +6337,6 @@ root = post.nodes.root; rect = (Conf['Advance on contract'] ? (function() { var next; - next = root; while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) { if ($('.stub', next) || next.offsetHeight === 0) { @@ -6594,7 +6367,6 @@ }, expand: function(post, src) { var img, thumb; - thumb = post.file.thumb; if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { return; @@ -6622,7 +6394,6 @@ }, completeExpand: function(post) { var prev, thumb; - thumb = post.file.thumb; if (!$.hasClass(thumb, 'expanding')) { return; @@ -6636,7 +6407,6 @@ prev = post.nodes.root.getBoundingClientRect(); return $.queueTask(function() { var curr; - $.addClass(post.nodes.root, 'expanded-image'); $.rmClass(post.file.thumb, 'expanding'); if (!(prev.top + prev.height <= 0)) { @@ -6648,7 +6418,6 @@ }, error: function() { var URL, post, src, timeoutID; - post = Get.postFromNode(this); $.rm(this); delete post.file.fullImage; @@ -6674,7 +6443,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6698,7 +6466,6 @@ menu: { init: function() { var conf, createSubEntry, el, name, subEntries, _ref; - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { return; } @@ -6722,7 +6489,6 @@ }, createSubEntry: function(name, desc) { var input, label; - label = $.el('label', { innerHTML: " " + name, title: desc @@ -6756,7 +6522,6 @@ }, node: function() { var _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6764,7 +6529,6 @@ }, mouseover: function(e) { var el, post; - post = Get.postFromNode(this); el = $.el('img', { id: 'ihover', @@ -6786,7 +6550,6 @@ error: function() { var URL, post, src, timeoutID, _this = this; - if (!doc.contains(this)) { return; } @@ -6811,7 +6574,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6837,7 +6599,6 @@ ImageLoader = { init: function() { var prefetch; - if (g.VIEW === 'catalog') { return; } @@ -6864,7 +6625,6 @@ }, node: function() { var URL, img, string, style, thumb, type, _ref, _ref1; - if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6886,7 +6646,6 @@ }, toggle: function() { var enabled, id, post, _ref; - enabled = Conf['prefetch'] = this.checked; if (enabled) { _ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts; @@ -6910,7 +6669,6 @@ }, node: function() { var thumb, _ref; - if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { return; } @@ -6923,7 +6681,6 @@ Sauce = { init: function() { var err, link, links, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Sauce']) { return; } @@ -6953,7 +6710,6 @@ }, createSauceLink: function(link) { var m, text; - link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { switch (parameter) { case '%TURL': @@ -6974,7 +6730,6 @@ }, node: function() { var link, nodes, _i, _len, _ref; - if (this.isClone || !this.file) { return; } @@ -6991,7 +6746,6 @@ ArchiveLink = { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { return; } @@ -7004,7 +6758,6 @@ order: 90, open: function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; return !!Redirect.to('thread', { postID: ID, @@ -7023,14 +6776,12 @@ }, createSubEntry: function(text, type) { var el, open; - el = $.el('a', { textContent: text, target: '_blank' }); open = type === 'post' ? function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; el.href = Redirect.to('thread', { postID: ID, @@ -7040,7 +6791,6 @@ return true; } : function(post) { var value; - value = Filter[type](post); if (!value) { return false; @@ -7063,7 +6813,6 @@ DeleteLink = { init: function() { var div, fileEl, fileEntry, postEl, postEntry; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { return; } @@ -7091,7 +6840,6 @@ el: fileEl, open: function(_arg) { var file; - file = _arg.file; if (!file || file.isDead) { return false; @@ -7107,7 +6855,6 @@ order: 40, open: function(post) { var node; - if (post.isDead || post.board.ID === 'q') { return false; } @@ -7122,7 +6869,6 @@ }, "delete": function() { var fileOnly, form, link, post; - post = DeleteLink.post; if (DeleteLink.cooldown.counting === post) { return; @@ -7152,7 +6898,6 @@ }, load: function(link, post, fileOnly, resDoc) { var msg, s; - if (resDoc.title === '4chan - Banned') { s = 'Banned!'; } else if (msg = resDoc.getElementById('errmsg')) { @@ -7173,7 +6918,6 @@ cooldown: { start: function(post, node) { var length, seconds, _ref; - if (!((_ref = QR.db) != null ? _ref.get({ boardID: post.board.ID, threadID: post.thread.ID, @@ -7207,7 +6951,6 @@ DownloadLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { return; } @@ -7221,7 +6964,6 @@ order: 100, open: function(_arg) { var file; - file = _arg.file; if (!file) { return false; @@ -7254,7 +6996,6 @@ }, makeButton: (function() { var a; - a = $.el('a', { className: 'menu-button brackets-wrap', innerHTML: '', @@ -7262,7 +7003,6 @@ }); return function() { var button; - button = a.cloneNode(true); $.on(button, 'click', Menu.toggle); return button; @@ -7270,7 +7010,6 @@ })(), toggle: function(e) { var post; - post = Get.postFromNode(this); return Menu.menu.toggle(e, this, post); } @@ -7279,7 +7018,6 @@ ReportLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { return; } @@ -7301,7 +7039,6 @@ }, report: function() { var id, post, set, url; - post = ReportLink.post; url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; id = Date.now(); @@ -7314,7 +7051,6 @@ init: function() { return $.ready(function() { var href; - Favicon.el = $('link[rel="shortcut icon"]', d.head); Favicon.el.type = 'image/x-icon'; href = Favicon.el.href; @@ -7389,7 +7125,6 @@ init: function() { var sc, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } @@ -7418,7 +7153,6 @@ }, node: function() { var ID, fileCount, post, postCount, _ref; - postCount = 0; fileCount = 0; _ref = this.posts; @@ -7436,7 +7170,6 @@ }, onUpdate: function(e) { var fileCount, postCount, _ref; - if (e.detail[404]) { return; } @@ -7445,7 +7178,6 @@ }, update: function(postCount, fileCount) { var fileCountEl, postCountEl, thread; - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; postCountEl.textContent = postCount; fileCountEl.textContent = fileCount; @@ -7470,7 +7202,6 @@ }, onThreadsLoad: function() { var page, pages, thread, _i, _j, _len, _len1, _ref; - if (!(Conf["Page Count in Stats"] && this.status === 200)) { return; } @@ -7494,7 +7225,6 @@ init: function() { var checked, conf, el, input, name, sc, settings, subEntries, _ref, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { return; } @@ -7644,7 +7374,6 @@ }, interval: function() { var val; - val = +this.value; if (val < 1) { val = 1; @@ -7654,7 +7383,6 @@ }, load: function() { var klass, req, text, _ref; - req = ThreadUpdater.req; switch (req.status) { case 200: @@ -7687,7 +7415,6 @@ }, getInterval: function() { var i, j; - i = ThreadUpdater.interval; j = Math.min(ThreadUpdater.outdateCount, 10); if (!d.hidden) { @@ -7697,14 +7424,12 @@ }, intervalShortcut: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=Interval]', settings).focus(); }, set: function(name, text, klass) { var el, node; - el = ThreadUpdater[name]; if (node = el.firstChild) { node.data = text; @@ -7717,7 +7442,6 @@ }, timeout: function() { var n; - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); if (!(n = --ThreadUpdater.seconds)) { return ThreadUpdater.update(); @@ -7730,7 +7454,6 @@ }, update: function() { var url; - if (!ThreadUpdater.online) { return; } @@ -7753,7 +7476,6 @@ }, updateThreadStatus: function(title, OP) { var icon, message, root, titleLC; - titleLC = title.toLowerCase(); if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { return; @@ -7780,7 +7502,6 @@ }, parse: function(postObjects) { var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref; - OP = postObjects[0]; Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; ThreadUpdater.updateThreadStatus('Sticky', OP); @@ -7866,7 +7587,6 @@ } $.queueTask(function() { var length, threadID; - threadID = ThreadUpdater.thread.ID; length = $$('.thread > .postContainer', ThreadUpdater.root).length; return Fourchan.parseThread(threadID, length - count, length); @@ -7887,7 +7607,6 @@ ThreadWatcher = { init: function() { var now, sc; - if (!Conf['Thread Watcher']) { return; } @@ -7895,7 +7614,7 @@ id: 'watcher-link', textContent: 'Watcher', href: 'javascript:;', - className: 'disabled icon icon-bookmark' + className: 'disabled icon icon-eye-open' }); this.db = new DataBoard('watchedThreads', this.refresh, true); this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', "
Thread Watcher ×
"); @@ -7920,7 +7639,6 @@ } $.get('WatchedThreads', null, function(_arg) { var WatchedThreads, boardID, data, threadID, threads, _ref; - WatchedThreads = _arg.WatchedThreads; if (!WatchedThreads) { return; @@ -7946,7 +7664,6 @@ }, node: function() { var toggler; - toggler = $.el('img', { className: 'watch-thread-link' }); @@ -7968,7 +7685,6 @@ } return $.get('AutoWatch', 0, function(_arg) { var AutoWatch, thread; - AutoWatch = _arg.AutoWatch; if (!(thread = g.BOARD.threads[AutoWatch])) { return; @@ -7984,7 +7700,6 @@ cb: { openAll: function() { var a, _i, _len, _ref; - if ($.hasClass(this, 'disabled')) { return; } @@ -8003,7 +7718,6 @@ }, pruneDeads: function() { var boardID, data, threadID, _i, _len, _ref, _ref1; - if ($.hasClass(this, 'disabled')) { return; } @@ -8027,13 +7741,11 @@ }, rm: function() { var boardID, threadID, _ref; - _ref = this.parentNode.dataset.fullID.split('.'), boardID = _ref[0], threadID = _ref[1]; return ThreadWatcher.rm(boardID, +threadID); }, post: function(e) { var board, postID, threadID, _ref; - _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; if (postID === threadID) { if (Conf['Auto Watch']) { @@ -8045,7 +7757,6 @@ }, threadUpdate: function(e) { var thread; - thread = e.detail.thread; if (!(e.detail[404] && ThreadWatcher.db.get({ boardID: thread.board.ID, @@ -8062,7 +7773,6 @@ }, fetchAllStatus: function() { var thread, threads, _i, _len; - if (!(threads = ThreadWatcher.getAll()).length) { return; } @@ -8074,7 +7784,6 @@ }, fetchStatus: function(_arg) { var boardID, data, fetchCount, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data; if (data.isDead) { return; @@ -8084,7 +7793,6 @@ return $.ajax("//api.4chan.org/" + boardID + "/res/" + threadID + ".json", { onloadend: function() { var status; - fetchCount.fetched++; if (fetchCount.fetched === fetchCount.fetching) { fetchCount.fetched = 0; @@ -8115,7 +7823,6 @@ }, getAll: function() { var all, boardID, data, threadID, threads, _ref; - all = []; _ref = ThreadWatcher.db.data.boards; for (boardID in _ref) { @@ -8136,7 +7843,6 @@ }, makeLine: function(boardID, threadID, data) { var div, fullID, href, link, x; - x = $.el('a', { textContent: '×', href: 'javascript:;' @@ -8167,7 +7873,6 @@ }, refresh: function() { var boardID, data, list, nodes, refresher, thread, threadID, toggler, watched, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3; - nodes = []; _ref = ThreadWatcher.getAll(); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -8195,7 +7900,6 @@ }, toggle: function(thread) { var boardID, threadID; - boardID = thread.board.ID; threadID = thread.ID; if (ThreadWatcher.db.get({ @@ -8209,7 +7913,6 @@ }, add: function(thread) { var boardID, data, threadID; - data = {}; boardID = thread.board.ID; threadID = thread.ID; @@ -8240,7 +7943,6 @@ }, convert: function(oldFormat) { var boardID, data, newFormat, threadID, threads; - newFormat = {}; for (boardID in oldFormat) { threads = oldFormat[boardID]; @@ -8257,7 +7959,6 @@ refreshers: [], init: function() { var menu; - if (!Conf['Thread Watcher']) { return; } @@ -8270,7 +7971,6 @@ }, addHeaderMenuEntry: function() { var entryEl; - if (g.VIEW !== 'thread') { return; } @@ -8287,7 +7987,6 @@ }); return this.refreshers.push(function() { var addClass, rmClass, text, _ref; - _ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = _ref[0], rmClass = _ref[1], text = _ref[2]; $.addClass(entryEl, addClass); $.rmClass(entryEl, rmClass); @@ -8296,7 +7995,6 @@ }, addMenuEntries: function() { var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1, _results; - entries = []; entries.push({ cb: ThreadWatcher.cb.openAll, @@ -8367,7 +8065,6 @@ }, createSubEntry: function(name, desc) { var entry, input; - entry = { type: 'thread watcher', el: $.el('label', { @@ -8419,7 +8116,6 @@ }, ready: function() { var ID, post, posts, _ref; - $.off(d, '4chanXInitFinished', Unread.ready); posts = []; _ref = Unread.thread.posts; @@ -8436,7 +8132,6 @@ }, scroll: function() { var checkPosition, hash, onload, post, posts, root; - if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } @@ -8466,7 +8161,6 @@ } checkPosition = function(target) { var height, top, _ref; - _ref = target.getBoundingClientRect(), top = _ref.top, height = _ref.height; return top + height - doc.clientHeight > 0; }; @@ -8474,7 +8168,6 @@ }, sync: function() { var lastReadPost; - lastReadPost = Unread.db.get({ boardID: Unread.thread.board.ID, threadID: Unread.thread.ID, @@ -8491,7 +8184,6 @@ }, addPosts: function(posts) { var ID, data, post, _i, _len; - for (_i = 0, _len = posts.length; _i < _len; _i++) { post = posts[_i]; ID = post.ID; @@ -8519,7 +8211,6 @@ }, addPostQuotingYou: function(post) { var quotelink, _i, _len, _ref; - if (!QR.db) { return; } @@ -8536,7 +8227,6 @@ }, openNotification: function(post) { var name, notif; - if (!Header.areNotificationsEnabled) { return; } @@ -8562,7 +8252,6 @@ }, readSinglePost: function(post) { var i; - if ((i = Unread.posts.indexOf(post)) === -1) { return; } @@ -8578,7 +8267,6 @@ }, readArray: function(arr) { var i, post, _i, _len; - for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { post = arr[i]; if (post.ID > Unread.lastReadPost) { @@ -8589,7 +8277,6 @@ }, read: $.debounce(50, function(e) { var ID, bottom, height, i, post, posts; - if (d.hidden || !Unread.posts.length) { return; } @@ -8645,7 +8332,6 @@ }), setLine: function(force) { var post, root; - if (!(d.hidden || force === true)) { return; } @@ -8660,7 +8346,6 @@ }, update: function() { var count; - count = Unread.posts.length; if (Conf['Unread Count']) { d.title = "" + (Conf['Quoted Title'] && Unread.postsQuotingYou.length ? '(!) ' : '') + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); @@ -8681,7 +8366,6 @@ }, init: function() { var archive, boardID, boards, data, id, name, type, _i, _len, _ref, _ref1, _ref2; - _ref = Conf['selectedArchives']; for (boardID in _ref) { data = _ref[boardID]; @@ -8813,7 +8497,6 @@ }, to: function(dest, data) { var archive; - archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID]; if (!archive) { return ''; @@ -8822,7 +8505,6 @@ }, protocol: function(archive) { var protocol; - protocol = location.protocol; if (!archive[protocol.slice(0, -1)]) { protocol = protocol === 'https:' ? 'http:' : 'https:'; @@ -8831,7 +8513,6 @@ }, thread: function(archive, _arg) { var boardID, path, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; if (archive.software === 'foolfuuka') { @@ -8844,7 +8525,6 @@ }, post: function(archive, _arg) { var URL, boardID, postID, protocol; - boardID = _arg.boardID, postID = _arg.postID; protocol = Redirect.protocol(archive); if (['Foolz', 'NSFW Foolz'].contains(archive.name)) { @@ -8856,13 +8536,11 @@ }, file: function(archive, _arg) { var boardID, filename; - boardID = _arg.boardID, filename = _arg.filename; return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename; }, search: function(archive, _arg) { var boardID, path, type, value; - boardID = _arg.boardID, type = _arg.type, value = _arg.value; type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; value = encodeURIComponent(value); @@ -8881,7 +8559,6 @@ }, setup: function() { var btn, entry, psa; - $.off(d, '4chanXInitFinished', PSAHiding.setup); if (!(psa = $.id('globalMessage'))) { $.rmClass(doc, 'hide-announcement'); @@ -8910,7 +8587,6 @@ $.on(btn, 'click', PSAHiding.toggle); $.get('hiddenPSA', 0, function(_arg) { var hiddenPSA; - hiddenPSA = _arg.hiddenPSA; PSAHiding.sync(hiddenPSA); $.before(psa, btn); @@ -8920,7 +8596,6 @@ }, toggle: function(e) { var UTC; - if ($.hasClass(this, 'hide-announcement')) { UTC = +$.id('globalMessage').dataset.utc; $.set('hiddenPSA', UTC); @@ -8932,7 +8607,6 @@ }, sync: function(UTC) { var hr, psa; - psa = $.id('globalMessage'); psa.hidden = PSAHiding.btn.hidden = UTC && UTC >= +psa.dataset.utc ? true : false; if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') { @@ -8953,7 +8627,6 @@ }, ready: function() { var banner, child, children, i; - banner = $(".boardBanner"); children = banner.children; i = 0; @@ -8973,7 +8646,6 @@ cb: { toggle: (function() { var types; - types = { jpg: 227, png: 270, @@ -8981,7 +8653,6 @@ }; return function() { var num, type; - type = Object.keys(types)[Math.floor(3 * Math.random())]; num = Math.floor(types[type] * Math.random()); return this.src = "//static.4chan.org/image/title/" + num + "." + type; @@ -9001,7 +8672,6 @@ }, focus: function() { var items, string, string2; - this.textContent = this.innerHTML; string = "" + g.BOARD + "." + this.className; string2 = "" + string + ".orig"; @@ -9024,7 +8694,6 @@ }, custom: function(child) { var cachedTest, string; - cachedTest = child.innerHTML; string = "" + g.BOARD + "." + child.className; $.on(child, 'click keydown focus blur', function(e) { @@ -9032,7 +8701,6 @@ }); $.get(string, cachedTest, function(item) { var string2, title; - if (!(title = item[string])) { return; } @@ -9056,7 +8724,6 @@ CatalogLinks = { init: function() { var el, input; - if (!Conf['Catalog Links']) { return; } @@ -9080,14 +8747,12 @@ }, toggle: function() { var useCatalog; - $.event('CloseMenu'); $.set('Header catalog links', useCatalog = this.checked); return CatalogLinks.set(useCatalog); }, set: function(useCatalog) { var a, board, path, _i, _len, _ref; - path = useCatalog ? 'catalog' : ''; _ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -9122,7 +8787,6 @@ }, node: function() { var str, uid; - if (this.isClone || !(str = this.info.uniqueID)) { return; } @@ -9134,7 +8798,6 @@ }, compute: function(str) { var hash, rgb; - hash = IDColor.hash(str); rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; @@ -9146,7 +8809,6 @@ }, hash: function(str) { var i, msg; - msg = 0; i = 0; while (i < 8) { @@ -9192,7 +8854,6 @@ }, node: function() { var dicestats, roll, _ref; - if (this.isClone || !(dicestats = (_ref = this.info.email) != null ? _ref.match(/dice[+\s](\d+)d(\d+)/) : void 0)) { return; } @@ -9204,7 +8865,6 @@ Emoji = { init: function() { var css, icon, name, pos, _ref; - if (!Conf['Emoji']) { return; } @@ -9274,7 +8934,6 @@ }, node: function() { var a; - if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) { return $.on(a, 'click', ExpandComment.cb); } @@ -9286,7 +8945,6 @@ }, expand: function(post) { var a; - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { $.replace(post.nodes.shortComment, post.nodes.longComment); post.nodes.comment = post.nodes.longComment; @@ -9302,7 +8960,6 @@ }, contract: function(post) { var a; - if (!post.nodes.shortComment) { return; } @@ -9313,7 +8970,6 @@ }, parse: function(req, a, post) { var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - status = req.status; if (![200, 304].contains(status)) { a.textContent = "Error " + req.statusText + " (" + status + ")"; @@ -9376,7 +9032,6 @@ }, node: function() { var a, files, posts, span, _ref; - if (!(span = $.x('following-sibling::span[contains(@class,"summary")][1]', this.OP.nodes.root))) { return; } @@ -9397,7 +9052,6 @@ }, toggle: function(thread) { var a, files, filesCount, inlined, num, post, posts, postsCount, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4; - threadRoot = thread.OP.nodes.root.parentNode; a = $('.summary', threadRoot); switch (thread.isExpanded) { @@ -9475,7 +9129,6 @@ }, parse: function(req, thread, a) { var filesCount, link, post, posts, postsCount, postsObj, postsRoot, reply, root, spoilerRange, _i, _len; - if (a.textContent[0] === '+') { return; } @@ -9539,7 +9192,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%(.)/g, function(s, c) { if (c in FileInfo.formatters) { return "' + FileInfo.formatters." + c + ".call(post) + '"; @@ -9551,7 +9203,6 @@ }, convertUnit: function(size, unit) { var i; - if (unit === 'B') { return "" + (size.toFixed()) + " Bytes"; } @@ -9582,7 +9233,6 @@ }, n: function() { var fullname, shortname; - fullname = this.file.name; shortname = Build.shortFilename(this.file.name, this.isReply); if (fullname === shortname) { @@ -9626,7 +9276,6 @@ Fourchan = { init: function() { var board; - if (g.VIEW === 'catalog') { return; } @@ -9648,7 +9297,6 @@ }, code: function() { var pre, _i, _len, _ref; - if (this.isClone) { return; } @@ -9677,13 +9325,11 @@ Keybinds = { init: function() { var init; - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { return; } init = function() { var node, _i, _len, _ref; - $.off(d, '4chanXInitFinished', init); $.on(d, 'keydown', Keybinds.keydown); _ref = $$('[accesskey]'); @@ -9696,7 +9342,6 @@ }, keydown: function(e) { var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; - if (!(key = Keybinds.keyCode(e))) { return; } @@ -9874,7 +9519,6 @@ }, keyCode: function(e) { var kc, key; - key = (function() { switch (kc = e.keyCode) { case 8: @@ -9930,7 +9574,6 @@ }, tags: function(tag, ta) { var range, selEnd, selStart, value; - value = ta.value; selStart = ta.selectionStart; selEnd = ta.selectionEnd; @@ -9941,13 +9584,11 @@ }, sage: function() { var isSage; - isSage = /sage/i.test(QR.nodes.email.value); return QR.nodes.email.value = isSage ? "" : "sage"; }, img: function(thread, all) { var post; - if (all) { return ImageExpand.cb.toggleAll(); } else { @@ -9957,7 +9598,6 @@ }, open: function(thread, tab) { var url; - if (g.VIEW !== 'index') { return; } @@ -9970,7 +9610,6 @@ }, hl: function(delta, thread) { var axe, headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; - if (!delta) { if (postEl = $('.reply.highlight', thread)) { $.rmClass(postEl, 'highlight'); @@ -10030,7 +9669,6 @@ Nav = { init: function() { var append, next, prev, span; - switch (g.VIEW) { case 'index': if (!Conf['Index Navigation']) { @@ -10081,7 +9719,6 @@ }, getThread: function(full) { var headRect, i, rect, thread, threads, topMargin, _i, _len; - if (Conf['Bottom header'] || !Conf['Fixed Header']) { topMargin = 0; } else { @@ -10107,7 +9744,6 @@ }, scroll: function(delta) { var i, rect, thread, threads, top, topMargin, _ref, _ref1; - _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; top = rect.top - topMargin; if ((delta === -1 && top > -5) || (delta === +1 && top < 5)) { @@ -10132,7 +9768,6 @@ }, node: function() { var dateEl; - if (this.isClone) { return; } @@ -10142,7 +9777,6 @@ }, relative: function(diff, now, date) { var days, months, number, rounded, unit, years; - unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); rounded = Math.round(number); if (rounded !== 1) { @@ -10153,7 +9787,6 @@ stale: [], flush: function() { var now, update, _i, _len, _ref; - if (d.hidden) { return; } @@ -10169,16 +9802,13 @@ }, setUpdate: function(post) { var markStale, setOwnTimeout, update; - setOwnTimeout = function(diff) { var delay; - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; return setTimeout(markStale, delay); }; update = function(now) { var date, diff, relative, singlePost, _i, _len, _ref; - date = post.info.date; diff = now - date; relative = RelativeDates.relative(diff, now, date); @@ -10219,7 +9849,6 @@ }, node: function(post) { var spoiler, spoilers, _i, _len; - spoilers = $$('s', this.nodes.comment); for (_i = 0, _len = spoilers.length; _i < _len; _i++) { spoiler = spoilers[_i]; @@ -10239,7 +9868,6 @@ }, ready: function() { var field; - field = $.id('recaptcha_response_field'); $.on(field, 'keydown', function(e) { if (e.keyCode === 8 && !field.value) { @@ -10248,7 +9876,6 @@ }); return $.on($('form'), 'submit', function(e) { var response; - e.preventDefault(); response = field.value.trim(); if (!/\s/.test(response)) { @@ -10278,7 +9905,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%([A-Za-z])/g, function(s, c) { if (c in Time.formatters) { return "' + Time.formatters." + c + ".call(date) + '"; @@ -10363,7 +9989,6 @@ Settings = { init: function() { var link, settings; - link = $.el('a', { className: 'settings-link icon icon-wrench', textContent: 'Settings', @@ -10373,7 +9998,6 @@ Header.addShortcut(link); $.get('previousversion', null, function(item) { var changelog, el, previous; - if (previous = item['previousversion']) { if (previous === g.VERSION) { return; @@ -10408,7 +10032,6 @@ }, open: function(openSection) { var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref; - $.off(d, '4chanXInitFinished', Settings.open); if (Settings.dialog) { return; @@ -10461,7 +10084,6 @@ sections: [], addSection: function(title, open) { var hyphenatedTitle, _ref; - if (typeof title !== 'string') { _ref = title.detail, title = _ref.title, open = _ref.open; } @@ -10474,7 +10096,6 @@ }, openSection: function() { var section, selected; - if (selected = $('.tab-selected', Settings.dialog)) { $.rmClass(selected, 'tab-selected'); } @@ -10488,7 +10109,6 @@ }, main: function(section) { var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref; - items = {}; inputs = {}; _ref = Config.main; @@ -10513,7 +10133,6 @@ } $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].checked = val; @@ -10528,7 +10147,6 @@ boards: {} }, function(item) { var ID, board, thread, _ref1; - _ref1 = item.hiddenThreads.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -10543,7 +10161,6 @@ boards: {} }, function(item) { var ID, board, post, thread, _ref1; - _ref1 = item.hiddenPosts.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -10563,7 +10180,6 @@ boards: {} }, function(item) { var boardID; - for (boardID in item.hiddenThreads.boards) { localStorage.removeItem("4chan-hide-t-" + boardID); } @@ -10574,7 +10190,6 @@ }, "export": function(now, data) { var a, db, p, _i, _len, _ref; - if (typeof now !== 'number') { now = Date.now(); data = { @@ -10611,7 +10226,6 @@ }, onImport: function() { var file, output, reader; - if (!(file = this.files[0])) { return; } @@ -10623,7 +10237,6 @@ reader = new FileReader(); reader.onload = function(e) { var data, err; - try { data = JSON.parse(e.target.result); Settings.loadSettings(data); @@ -10640,7 +10253,6 @@ }, loadSettings: function(data) { var key, val, version, _ref; - version = data.version.split('.'); if (version[0] === '2') { data = Settings.convertSettings(data, { @@ -10728,7 +10340,6 @@ }, convertSettings: function(data, map) { var newKey, prevKey; - for (prevKey in map) { newKey = map[prevKey]; if (newKey) { @@ -10740,7 +10351,6 @@ }, filter: function(section) { var select; - section.innerHTML = "
"; select = $('select', section); $.on(select, 'change', Settings.selectFilter); @@ -10748,7 +10358,6 @@ }, selectFilter: function() { var div, name, ta; - div = this.nextElementSibling; if ((name = this.value) !== 'guide') { $.rmAll(div); @@ -10768,7 +10377,6 @@ }, sauce: function(section) { var ta; - section.innerHTML = "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
"; ta = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { @@ -10778,7 +10386,6 @@ }, advanced: function(section) { var archive, boardID, boardOptions, boardSelect, boards, data, event, input, inputs, item, items, name, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4; - section.innerHTML = "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Disabled selections indicate that only one archive is available for that board and redirection type.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
Board link: g
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:\"Install Gentoo\"
Index-only link: g-index
Catalog-only link: g-catalog
External link: external-text:\"Google\",\"http://www.google.com\"
Combinations are possible: g-index-text:\"Technology Index\"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Quick Reply Personas is disabled.

\n One item per line.
\n Items will be added in the relevant input's auto-completion list.
\n Password items will always be used, since there is no password input.
\n Lines starting with a # will be ignored.\n

Unread Favicon is disabled.
Emoji is disabled.
\n Sage Icon:
\n Position:
Thread Updater is disabled.
\n Interval:
"; items = {}; inputs = {}; @@ -10798,7 +10405,6 @@ $.on(ta, 'change', $.cb.value); $.get(items, function(items) { var key, val; - for (key in items) { val = items[key]; if (['emojiPos'].contains(key)) { @@ -10869,7 +10475,6 @@ }); $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var option, selectedArchives, type; - selectedArchives = _arg.selectedArchives; for (boardID in selectedArchives) { data = selectedArchives[boardID]; @@ -10884,7 +10489,6 @@ }, addArchiveCell: function(boardID, data, type) { var archive, i, length, options, select, td; - length = data[type].length; td = $.el('td', { className: 'archive-cell' @@ -10914,10 +10518,8 @@ }, saveSelectedArchive: function() { var _this = this; - return $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var selectedArchives, _name; - selectedArchives = _arg.selectedArchives; (selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value; return $.set('selectedArchives', selectedArchives); @@ -10928,7 +10530,6 @@ }, time: function() { var funk; - funk = Time.createFunc(this.value); return this.nextElementSibling.textContent = funk(Time, new Date()); }, @@ -10937,7 +10538,6 @@ }, fileInfo: function() { var data, funk; - data = { isReply: true, file: { @@ -10976,7 +10576,6 @@ }, keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; - section.innerHTML = "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
"; tbody = $('tbody', section); items = {}; @@ -10997,7 +10596,6 @@ } return $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].value = val; @@ -11006,7 +10604,6 @@ }, keybind: function(e) { var key; - if (e.keyCode === 9) { return; } @@ -11023,10 +10620,8 @@ Main = { init: function() { var db, flatten, _i, _len, _ref; - flatten = function(parent, obj) { var key, val; - if (obj instanceof Array) { Conf[parent] = obj[0]; } else if (typeof obj === 'object') { @@ -11059,7 +10654,6 @@ }, initFeatures: function() { var init, pathname, _ref; - pathname = location.pathname.split('/'); g.BOARD = new Board(pathname[1]); if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { @@ -11087,7 +10681,6 @@ case 'images.4chan.org': $.ready(function() { var URL; - if (Conf['404 Redirect'] && ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) { Redirect.init(); pathname = location.pathname.split('/'); @@ -11104,7 +10697,6 @@ } init = function(features) { var err, module, name; - for (name in features) { module = features[name]; try { @@ -11183,7 +10775,6 @@ }, initStyle: function() { var mainStyleSheet, setStyle, style, styleSheets, _ref; - $.off(d, '4chanMainInit', Main.initStyle); if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { return; @@ -11205,7 +10796,6 @@ styleSheets = $$('link[rel="alternate stylesheet"]', d.head); setStyle = function() { var styleSheet, _i, _len; - $.rmClass(doc, style); for (_i = 0, _len = styleSheets.length; _i < _len; _i++) { styleSheet = styleSheets[_i]; @@ -11227,7 +10817,6 @@ }, initReady: function() { var board, err, errors, href, passLink, postRoot, posts, styleSelector, thread, threadRoot, threads, _i, _j, _len, _len1, _ref, _ref1; - if (['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) { if (Conf['404 Redirect'] && g.VIEW === 'thread') { href = Redirect.to('thread', { @@ -11294,7 +10883,6 @@ }, callbackNodes: function(klass, nodes) { var callback, err, errors, i, len, node, _i, _len, _ref; - len = nodes.length; _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -11322,11 +10910,9 @@ }, callbackNodesDB: function(klass, nodes, cb) { var errors, func, i, len, node, queue, softTask; - queue = []; softTask = function() { var args, func, task; - task = queue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -11345,7 +10931,6 @@ errors = null; func = function(node, i) { var callback, err, _i, _len, _ref; - _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { callback = _ref[_i]; @@ -11379,7 +10964,6 @@ }, addCallback: function(e) { var Klass, obj; - obj = e.detail; if (typeof obj.callback.name !== 'string') { throw new Error("Invalid callback name: " + obj.callback.name); @@ -11399,7 +10983,6 @@ }, handleErrors: function(errors) { var div, error, logs, _i, _len; - if (!(errors instanceof Array)) { error = errors; } else if (errors.length === 1) { @@ -11414,7 +10997,6 @@ }); $.on(div.lastElementChild, 'click', function() { var _ref; - return _ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = _ref[0], logs.hidden = _ref[1], _ref; }); logs = $.el('div', { @@ -11428,7 +11010,6 @@ }, parseError: function(data) { var error, message; - Main.logError(data); message = $.el('div', { textContent: data.message @@ -11445,7 +11026,6 @@ }, isThisPageLegit: function() { var _ref; - if (!('thisPageIsLegit' in Main)) { Main.thisPageIsLegit = location.hostname === 'boards.4chan.org' && !$('link[href*="favicon-status.ico"]', d.head) && ((_ref = d.title) !== '4chan - Temporarily Offline' && _ref !== '4chan - Error' && _ref !== '504 Gateway Time-out'); } diff --git a/builds/crx/script.js b/builds/crx/script.js index c0e276695..f40284b28 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -323,7 +323,6 @@ Array.prototype.indexOf = function(object) { var i; - i = this.length; while (i--) { if (this[i] === object) { @@ -342,7 +341,6 @@ $.extend = function(object, properties) { var key, val; - for (key in properties) { val = properties[key]; if (!properties.hasOwnProperty(key)) { @@ -360,7 +358,6 @@ $.ready = function(fc) { var cb; - if (d.readyState !== 'loading') { $.queueTask(fc); return; @@ -374,7 +371,6 @@ $.formData = function(form) { var fd, key, val; - if (form instanceof HTMLFormElement) { return new FormData(form); } @@ -394,7 +390,6 @@ $.extend = function(object, properties) { var key, val; - for (key in properties) { val = properties[key]; object[key] = val; @@ -403,11 +398,9 @@ $.ajax = (function() { var lastModified; - lastModified = {}; return function(url, options, extra) { var form, r, sync, type, upCallbacks, whenModified; - if (extra == null) { extra = {}; } @@ -430,11 +423,9 @@ $.cache = (function() { var reqs; - reqs = {}; return function(url, cb, options) { var err, req, rm; - if (req = reqs[url]) { if (req.readyState === 4) { cb.call(req, req.evt); @@ -454,7 +445,6 @@ } $.on(req, 'load', function(e) { var _i, _len, _ref; - _ref = this.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { cb = _ref[_i]; @@ -490,7 +480,6 @@ $.addStyle = function(css, id) { var style; - style = $.el('style', { id: id, textContent: css @@ -537,7 +526,6 @@ } else { return function(el) { var _ref; - return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; }; } @@ -545,7 +533,6 @@ $.rmAll = function(root) { var node; - while (node = root.firstChild) { root.removeChild(node); } @@ -561,7 +548,6 @@ $.nodes = function(nodes) { var frag, node, _i, _len; - if (!(nodes instanceof Array)) { return nodes; } @@ -595,7 +581,6 @@ $.el = function(tag, properties) { var el; - el = d.createElement(tag); if (properties) { $.extend(el, properties); @@ -605,7 +590,6 @@ $.on = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -615,7 +599,6 @@ $.off = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -639,7 +622,6 @@ $.debounce = function(wait, fn) { var args, exec, lastCall, that, timeout; - lastCall = 0; timeout = null; that = null; @@ -661,11 +643,9 @@ $.queueTask = (function() { var execTask, taskChannel, taskQueue; - taskQueue = []; execTask = function() { var args, func, task; - task = taskQueue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -688,7 +668,6 @@ $.globalEval = function(code) { var script; - script = $.el('script', { textContent: code }); @@ -698,7 +677,6 @@ $.bytesToString = function(size) { var unit; - unit = 0; while (size >= 1024) { size /= 1024; @@ -714,7 +692,6 @@ $.item = function(key, val) { var item; - item = {}; item[key] = val; return item; @@ -725,7 +702,6 @@ $.sync = (function() { chrome.storage.onChanged.addListener(function(changes) { var cb, key; - for (key in changes) { if (cb = $.syncing[key]) { cb(changes[key].newValue); @@ -745,7 +721,6 @@ $.get = function(key, val, cb) { var count, done, items, localItems, syncItems; - if (typeof cb === 'function') { items = $.item(key, val); } else { @@ -765,7 +740,6 @@ count = 0; done = function(item) { var lastError; - lastError = chrome.runtime.lastError; if (lastError) { c.error(lastError, lastError.message || 'No message.'); @@ -787,12 +761,10 @@ $.set = (function() { var items, localItems, set; - items = {}; localItems = {}; set = $.debounce($.SECOND, function() { var err, key, _i, _len, _ref; - _ref = $.localKeys; for (_i = 0, _len = _ref.length; _i < _len; _i++) { key = _ref[_i]; @@ -877,7 +849,6 @@ function Post(root, thread, board, that) { var capcode, date, email, flag, info, name, post, subject, tripcode, uniqueID; - this.thread = thread; this.board = board; if (that == null) { @@ -953,7 +924,6 @@ Post.prototype.parseComment = function() { var bq, i, node, nodes, text; - bq = this.nodes.comment.cloneNode(true); nodes = $$('.abbr, .capcodeReplies, .exif, b', bq); i = 0; @@ -971,7 +941,6 @@ Post.prototype.parseQuotes = function() { var quotelink, _i, _len, _ref; - this.quotes = []; _ref = $$('.quotelink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -982,7 +951,6 @@ Post.prototype.parseQuote = function(quotelink) { var fullID, match; - if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) { return; } @@ -998,7 +966,6 @@ Post.prototype.parseFile = function(that) { var alt, anchor, fileEl, fileInfo, size, thumb, unit; - if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) { return; } @@ -1030,7 +997,6 @@ Post.prototype.kill = function(file, now) { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - now || (now = new Date()); if (file) { if (this.file.isDead) { @@ -1079,7 +1045,6 @@ Post.prototype.resurrect = function() { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - delete this.isDead; delete this.timeOfDeath; $.rmClass(this.nodes.root, 'deleted-post'); @@ -1113,7 +1078,6 @@ Post.prototype.rmClone = function(index) { var clone, _i, _len, _ref; - this.clones.splice(index, 1); _ref = this.clones.slice(index); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1131,7 +1095,6 @@ function Clone(origin, context) { var file, info, inline, inlined, key, nodes, post, root, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - this.origin = origin; this.context = context; _ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']; @@ -1219,7 +1182,6 @@ function DataBoard(key, sync, dontClean) { var init, _this = this; - this.key = key; this.onSync = __bind(this.onSync, this); this.data = Conf[key]; @@ -1243,7 +1205,6 @@ DataBoard.prototype["delete"] = function(_arg) { var boardID, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; if (postID) { delete this.data.boards[boardID][threadID][postID]; @@ -1264,7 +1225,6 @@ DataBoard.prototype.deleteIfEmpty = function(_arg) { var boardID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID; if (threadID) { if (!Object.keys(this.data.boards[boardID][threadID]).length) { @@ -1280,7 +1240,6 @@ DataBoard.prototype.set = function(_arg) { var boardID, postID, threadID, val, _base, _base1, _base2; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val; if (postID !== void 0) { ((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val; @@ -1294,7 +1253,6 @@ DataBoard.prototype.get = function(_arg) { var ID, board, boardID, defaultValue, postID, thread, threadID, val, _i, _len; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, defaultValue = _arg.defaultValue; if (board = this.data.boards[boardID]) { if (!threadID) { @@ -1318,7 +1276,6 @@ DataBoard.prototype.clean = function() { var boardID, now, val, _ref; - _ref = this.data.boards; for (boardID in _ref) { val = _ref[boardID]; @@ -1338,10 +1295,8 @@ DataBoard.prototype.ajaxClean = function(boardID) { var _this = this; - return $.cache("//api.4chan.org/" + boardID + "/threads.json", function(e) { var board, page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (e.target.status === 404) { _this["delete"](boardID); } else if (e.target.status === 200) { @@ -1448,10 +1403,8 @@ }, toBlob: function() { var _base; - return (_base = HTMLCanvasElement.prototype).toBlob || (_base.toBlob = function(cb) { var data, i, l, ui8a, _i; - data = atob(this.toDataURL().slice(22)); l = data.length; ui8a = new Uint8Array(l); @@ -1489,7 +1442,6 @@ init: function() { var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, shortcutToggler, _this = this; - this.menu = new UI.Menu('header'); menuButton = $.el('span', { className: 'menu-button', @@ -1590,7 +1542,6 @@ }); $.ready(function() { var a, cs; - _this.footer = $.id('boardNavDesktopFoot'); if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { a.className = 'current'; @@ -1625,7 +1576,6 @@ }), setBoardList: function() { var a, boardList, btn, fourchannav, fullBoardList; - fourchannav = $.id('boardNavDesktop'); if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) { a.className = 'current'; @@ -1647,7 +1597,6 @@ }, generateBoardList: function(text) { var as, list, nodes; - list = $('#custom-board-list', Header.bar); $.rmAll(list); if (!text) { @@ -1656,7 +1605,6 @@ as = $$('#full-board-list a[title]', Header.bar); nodes = text.match(/[\w@]+((-(all|title|replace|full|index|catalog|url:"[^"]+[^"]"|text:"[^"]+")|\,"[^"]+[^"]"))*|[^\w@]+/g).map(function(t) { var a, board, m, _i, _len; - if (/^[^\w@]/.test(t)) { return $.tn(t); } @@ -1707,7 +1655,6 @@ }, toggleBoardList: function() { var bar, custom, full, showBoardList; - bar = Header.bar; custom = $('#custom-board-list', bar); full = $('#full-board-list', bar); @@ -1743,7 +1690,6 @@ }, toggleLinkJustify: function() { var centered; - $.event('CloseMenu'); centered = this.nodeName === 'INPUT' ? this.checked : void 0; Header.setLinkJustify(centered); @@ -1787,7 +1733,6 @@ }, toggleBarVisibility: function() { var hide, message; - hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); this.checked = hide; $.set('Header auto-hide', Conf['Header auto-hide'] = hide); @@ -1801,7 +1746,6 @@ }, toggleFooterVisibility: function() { var hide, message; - $.event('CloseMenu'); hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden; Header.setFooterVisibility(hide); @@ -1811,7 +1755,6 @@ }, setCustomNav: function(show) { var btn, cust, full, _ref; - Header.customNavToggler.checked = show; cust = $('#custom-board-list', Header.bar); full = $('#full-board-list', Header.bar); @@ -1824,14 +1767,12 @@ }, editCustomNav: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=boardnav]', settings).focus(); }, hashScroll: function() { var hash, post; - if (!((hash = this.location.hash.slice(1)) && (post = $.id(hash)))) { return; } @@ -1842,7 +1783,6 @@ }, scrollToPost: function(post) { var headRect, top; - top = post.getBoundingClientRect().top; if (Conf['Fixed Header'] && !Conf['Bottom Header']) { headRect = Header.bar.getBoundingClientRect(); @@ -1852,7 +1792,6 @@ }, addShortcut: function(el) { var shortcut; - shortcut = $.el('span', { className: 'shortcut brackets-wrap' }); @@ -1864,7 +1803,6 @@ }, createNotification: function(e) { var cb, content, lifetime, notif, type, _ref; - _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; notif = new Notice(type, content, lifetime); if (cb) { @@ -1874,7 +1812,6 @@ areNotificationsEnabled: false, enableDesktopNotifications: function() { var authorize, disable, el, notice, _ref; - if (!(window.Notification && Conf['Desktop Notifications'])) { return; } @@ -1910,7 +1847,6 @@ spoilerRange: {}, shortFilename: function(filename, isReply) { var threshold; - threshold = isReply ? 30 : 40; if (filename.length - 4 > threshold) { return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); @@ -1920,7 +1856,6 @@ }, postFromObject: function(data, boardID) { var o; - o = { postID: data.no, threadID: data.resto || data.no, @@ -1965,7 +1900,6 @@ */ var a, boardID, capcode, capcodeClass, capcodeReplies, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; - postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, capcodeReplies = o.capcodeReplies, file = o.file; isOP = postID === threadID; staticPath = '//static.4chan.org/image/'; @@ -2064,7 +1998,6 @@ }, capcodeReplies: function(_arg) { var array, boardID, bq, capcodeReplies, capcodeType, generateCapcodeReplies, html, root, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, bq = _arg.bq, root = _arg.root, capcodeReplies = _arg.capcodeReplies; if (!capcodeReplies) { return; @@ -2101,7 +2034,6 @@ Get = { threadExcerpt: function(thread) { var OP, excerpt, _ref; - OP = thread.OP; excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || Conf['Anonymize'] && 'Anonymous' || $('.nameBlock', OP.nodes.info).textContent.trim(); if (excerpt.length > 70) { @@ -2117,7 +2049,6 @@ }, postFromRoot: function(root) { var boardID, index, link, post, postID; - link = $('a[title="Highlight this post"]', root); boardID = link.pathname.split('/')[1]; postID = link.hash.slice(2); @@ -2137,7 +2068,6 @@ }, postDataFromLink: function(link) { var boardID, path, postID, threadID, _ref; - if (link.hostname === 'boards.4chan.org') { path = link.pathname.split('/'); boardID = path[1]; @@ -2155,7 +2085,6 @@ }, allQuotelinksLinkingTo: function(post) { var ID, quote, quotedPost, quotelinks, quoterPost, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - quotelinks = []; _ref = g.posts; for (ID in _ref) { @@ -2184,14 +2113,12 @@ } return quotelinks.filter(function(quotelink) { var boardID, postID, _ref4; - _ref4 = Get.postDataFromLink(quotelink), boardID = _ref4.boardID, postID = _ref4.postID; return boardID === post.board.ID && postID === post.ID; }); }, postClone: function(boardID, threadID, postID, root, context) { var post, url; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2214,7 +2141,6 @@ }, insert: function(post, root, context) { var clone, nodes; - if (!root.parentNode) { return; } @@ -2228,7 +2154,6 @@ }, fetchedPost: function(req, boardID, threadID, postID, root, context) { var board, post, posts, status, thread, url, _i, _len; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2282,7 +2207,6 @@ }, archivedPost: function(req, boardID, postID, root, context) { var board, bq, comment, data, o, post, thread, threadID, _ref; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2379,10 +2303,8 @@ UI = (function() { var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove; - dialog = function(id, position, html) { var child, el, move, _i, _len, _ref; - el = $.el('div', { className: 'dialog', innerHTML: html, @@ -2424,7 +2346,6 @@ Menu.prototype.makeMenu = function() { var menu; - menu = $.el('div', { className: 'dialog', id: 'menu', @@ -2439,7 +2360,6 @@ Menu.prototype.toggle = function(e, button, data) { var previousButton; - e.preventDefault(); e.stopPropagation(); if (currentMenu) { @@ -2457,7 +2377,6 @@ Menu.prototype.open = function(button, data) { var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2; - menu = this.makeMenu(); currentMenu = menu; lastToggledButton = button; @@ -2496,7 +2415,6 @@ Menu.prototype.insertEntry = function(entry, parent, data) { var subEntry, submenu, _i, _len, _ref; - if (typeof entry.open === 'function') { if (!entry.open(data)) { return; @@ -2530,7 +2448,6 @@ Menu.prototype.findNextEntry = function(entry, direction) { var entries; - entries = __slice.call(entry.parentNode.children); entries.sort(function(first, second) { return +(first.style.order || first.style.webkitOrder) - +(second.style.order || second.style.webkitOrder); @@ -2540,7 +2457,6 @@ Menu.prototype.keybinds = function(e) { var entry, next, nextPrev, subEntry, submenu; - entry = $('.focused', currentMenu); while (subEntry = $('.focused', entry)) { entry = subEntry; @@ -2586,7 +2502,6 @@ Menu.prototype.focus = function(entry) { var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2; - while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) { $.rmClass(focused, 'focused'); } @@ -2614,7 +2529,6 @@ Menu.prototype.addEntry = function(e) { var entry; - entry = e.detail; if (entry.type !== this.type) { return; @@ -2625,7 +2539,6 @@ Menu.prototype.parseEntry = function(entry) { var el, style, subEntries, subEntry, _i, _len; - el = entry.el, subEntries = entry.subEntries; $.addClass(el, 'entry'); $.on(el, 'focus mouseover', (function(e) { @@ -2649,7 +2562,6 @@ })(); dragstart = function(e) { var el, isTouching, o, rect, screenHeight, screenWidth, _ref; - if (e.type === 'mousedown' && e.button !== 0) { return; } @@ -2688,7 +2600,6 @@ }; touchmove = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2700,7 +2611,6 @@ }; drag = function(e) { var bottom, clientX, clientY, left, right, style, top; - clientX = e.clientX, clientY = e.clientY; left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; @@ -2716,7 +2626,6 @@ }; touchend = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2738,7 +2647,6 @@ }; hoverstart = function(_arg) { var asapTest, cb, el, endEvents, latestEvent, o, root; - root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb; o = { root: root, @@ -2767,7 +2675,6 @@ }; hover = function(e) { var clientX, clientY, height, left, right, style, top, _ref; - this.latestEvent = e; height = this.el.offsetHeight; clientX = e.clientX, clientY = e.clientY; @@ -2810,7 +2717,6 @@ }, node: function() { var email, name, tripcode, _ref; - if (this.info.capcode || this.isClone) { return; } @@ -2837,7 +2743,6 @@ filters: {}, init: function() { var boards, err, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4; - if (g.VIEW === 'catalog' || !Conf['Filter']) { return; } @@ -2874,7 +2779,6 @@ op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'yes'; stub = (function() { var _ref3; - switch ((_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0) { case 'yes': return true; @@ -2905,7 +2809,6 @@ }, createFilter: function(regexp, op, stub, hl, top) { var settings, test; - test = typeof regexp === 'string' ? function(value) { return regexp === value; } : function(value) { @@ -2929,7 +2832,6 @@ }, node: function() { var filter, firstThread, key, result, thisThread, value, _i, _len, _ref; - if (this.isClone) { return; } @@ -3041,7 +2943,6 @@ menu: { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) { return; } @@ -3067,7 +2968,6 @@ }, createSubEntry: function(text, type) { var el; - el = $.el('a', { href: 'javascript:;', textContent: text @@ -3078,7 +2978,6 @@ el: el, open: function(post) { var value; - value = Filter[type](post); return value !== false; } @@ -3086,7 +2985,6 @@ }, makeFilter: function() { var re, type, value; - type = this.dataset.type; value = Filter[type](Filter.menu.post); re = ['uniqueID', 'MD5'].contains(type) ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) { @@ -3101,7 +2999,6 @@ re = ['uniqueID', 'MD5'].contains(type) ? "/" + re + "/" : "/^" + re + "$/"; return $.get(type, Conf[type], function(item) { var save, section, select, ta, tl; - save = item[type]; save = save ? "" + save + "\n" + re : re; $.set(type, save); @@ -3135,7 +3032,6 @@ }, node: function() { var data; - if (!this.isReply || this.isClone) { return; } @@ -3159,7 +3055,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub, replies, thisPost; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } @@ -3230,7 +3125,6 @@ order: 20, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3262,7 +3156,6 @@ order: 15, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3279,7 +3172,6 @@ }, hide: function() { var makeStub, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3298,7 +3190,6 @@ }, show: function() { var data, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3322,7 +3213,6 @@ }, hideStub: function() { var post; - post = PostHiding.menu.post; post.nodes.root.hidden = true; $.event('CloseMenu'); @@ -3330,7 +3220,6 @@ }, makeButton: function(post, type) { var a; - a = $.el('a', { className: "" + type + "-reply-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3341,7 +3230,6 @@ }, saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) { var data; - data = { boardID: post.board.ID, threadID: post.thread.ID, @@ -3360,14 +3248,12 @@ }, toggle: function() { var post; - post = Get.postFromNode(this); PostHiding[(post.isHidden ? 'show' : 'hide')](post); return PostHiding.saveHiddenState(post, post.isHidden); }, hide: function(post, makeStub, hideRecursively) { var a, button, postInfo, quotelink, _i, _len, _ref; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3402,7 +3288,6 @@ }, show: function(post, showRecursively) { var quotelink, _i, _len, _ref; - if (showRecursively == null) { showRecursively = Conf['Recursive Hiding']; } @@ -3438,7 +3323,6 @@ }, node: function() { var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; - if (this.isClone) { return; } @@ -3456,7 +3340,6 @@ }, add: function() { var args, obj, post, recursive, _base, _name; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { recursives: [], @@ -3467,7 +3350,6 @@ }, rm: function(recursive, post) { var i, obj, rec, _i, _len, _ref; - if (!(obj = Recursive.recursives[post.fullID])) { return; } @@ -3482,7 +3364,6 @@ }, apply: function() { var ID, args, fullID, post, recursive, _ref; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; fullID = post.fullID; _ref = g.posts; @@ -3509,7 +3390,6 @@ }, node: function() { var data; - if (data = ThreadHiding.db.get({ boardID: this.board.ID, threadID: this.ID @@ -3523,7 +3403,6 @@ }, syncCatalog: function() { var hiddenThreads, hiddenThreadsOnCatalog, threadID; - hiddenThreads = ThreadHiding.db.get({ boardID: g.BOARD.ID, defaultValue: {} @@ -3550,7 +3429,6 @@ cleanCatalog: function(hiddenThreadsOnCatalog) { return $.cache("//api.4chan.org/" + g.BOARD + "/threads.json", function() { var page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (this.status !== 200) { return; } @@ -3576,7 +3454,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub; - if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) { return; } @@ -3598,7 +3475,6 @@ order: 20, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || thread.isHidden) { return false; @@ -3626,7 +3502,6 @@ order: 20, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || !thread.isHidden) { return false; @@ -3646,7 +3521,6 @@ order: 15, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || !thread.isHidden) { return false; @@ -3657,7 +3531,6 @@ }, hide: function() { var makeStub, thread; - makeStub = $('input', this.parentNode).checked; thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, makeStub); @@ -3666,7 +3539,6 @@ }, show: function() { var thread; - thread = ThreadHiding.menu.thread; ThreadHiding.show(thread); ThreadHiding.saveHiddenState(thread); @@ -3674,7 +3546,6 @@ }, hideStub: function() { var thread; - thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, false); $.event('CloseMenu'); @@ -3682,7 +3553,6 @@ }, makeButton: function(thread, type) { var a; - a = $.el('a', { className: "" + type + "-thread-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3694,7 +3564,6 @@ }, saveHiddenState: function(thread, makeStub) { var hiddenThreadsOnCatalog; - hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; if (thread.isHidden) { ThreadHiding.db.set({ @@ -3727,7 +3596,6 @@ }, hide: function(thread, makeStub) { var OP, a, numReplies, opInfo, span, threadRoot; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3751,7 +3619,6 @@ }, show: function(thread) { var threadRoot; - if (thread.stub) { $.rm(thread.stub); delete thread.stub; @@ -3764,7 +3631,6 @@ QuoteBacklink = { init: function() { var format; - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { return; } @@ -3782,7 +3648,6 @@ }, firstNode: function() { var a, clone, container, containers, frag, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - if (this.isClone || !this.quotes.length) { return; } @@ -3820,7 +3685,6 @@ }, secondNode: function() { var container; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { this.nodes.backlinkContainer = $('.container', this.nodes.info); return; @@ -3834,7 +3698,6 @@ }, getContainer: function(id) { var _base; - return (_base = this.containers)[id] || (_base[id] = $.el('span', { className: 'container' })); @@ -3857,7 +3720,6 @@ }, node: function() { var board, boardID, quotelink, thread, threadID, _i, _len, _ref, _ref1, _ref2; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -3887,7 +3749,6 @@ if (Conf['Quote Hash Navigation']) { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3900,7 +3761,6 @@ } else { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3927,7 +3787,6 @@ }, toggle: function(e) { var boardID, context, postID, threadID, _ref; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { return; } @@ -3953,7 +3812,6 @@ }, add: function(quotelink, boardID, threadID, postID, context) { var inline, isBacklink, post, qroot, root; - isBacklink = $.hasClass(quotelink, 'backlink'); inline = $.el('div', { id: "i" + postID, @@ -3978,7 +3836,6 @@ }, rm: function(quotelink, boardID, threadID, postID, context) { var el, inlined, isBacklink, post, qroot, root, _ref; - isBacklink = $.hasClass(quotelink, 'backlink'); root = QuoteInline.findRoot(quotelink, isBacklink); root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); @@ -4020,7 +3877,6 @@ }, node: function() { var boardID, fullID, i, postID, quotelink, quotelinks, quotes, _ref; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -4063,7 +3919,6 @@ }, node: function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -4072,7 +3927,6 @@ }, mouseover: function(e) { var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; - if ($.hasClass(this, 'inlined')) { return; } @@ -4116,7 +3970,6 @@ }, mouseout: function() { var clone, post, root, _i, _len, _ref; - if (!(root = this.el.firstElementChild)) { return; } @@ -4146,7 +3999,6 @@ }, node: function() { var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; - if (this.isClone) { return; } @@ -4169,7 +4021,6 @@ QuoteThreading = { init: function() { var input; - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { return; } @@ -4192,7 +4043,6 @@ }, setup: function() { var ID, post, posts; - $.off(d, '4chanXInitFinished', QuoteThreading.setup); posts = g.posts; for (ID in posts) { @@ -4205,7 +4055,6 @@ }, node: function() { var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; - if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { return; } @@ -4235,7 +4084,6 @@ }, nodeinsert: function() { var bottom, height, qpost, qroot, threadContainer, top, _ref; - qpost = g.posts[this.threaded]; delete this.threaded; delete this.cb; @@ -4264,7 +4112,6 @@ }, toggle: function() { var container, containers, node, post, replies, reply, thread, _i, _j, _k, _len, _len1, _len2, _ref; - thread = $('.thread'); replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); QuoteThreading.enabled = this.checked; @@ -4281,7 +4128,6 @@ } else { replies.sort(function(a, b) { var aID, bID; - aID = Number(a.id.slice(2)); bID = Number(b.id.slice(2)); return aID - bID; @@ -4302,7 +4148,6 @@ }, kb: function() { var control; - control = $.id('threadingControl'); return control.click(); } @@ -4329,7 +4174,6 @@ }, node: function() { var quotelink, _i, _len, _ref; - if (this.isClone) { return; } @@ -4353,7 +4197,6 @@ cb: { seek: function(type) { var highlight, post, posts, result, str; - if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) { return; } @@ -4409,7 +4252,6 @@ }, node: function() { var deadlink, _i, _len, _ref; - _ref = $$('.deadlink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { deadlink = _ref[_i]; @@ -4424,7 +4266,6 @@ }, parseDeadlink: function(deadlink) { var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; - if ($.hasClass(deadlink.parentNode, 'prettyprint')) { Quotify.fixDeadlink(deadlink); return; @@ -4517,7 +4358,6 @@ }, node: function() { var data, el, end, endNode, i, index, items, length, link, links, node, result, saved, snapshot, space, test, word, _i, _len, _ref; - if (this.isClone) { if (Conf['Embedding']) { i = 0; @@ -4593,7 +4433,6 @@ }, makeRange: function(startNode, endNode, startOffset, endOffset) { var range; - range = document.createRange(); range.setStart(startNode, startOffset); range.setEnd(endNode, endOffset); @@ -4601,7 +4440,6 @@ }, makeLink: function(range) { var a, char, i, text; - text = range.toString(); i = 0; while (/[(\[{<>]/.test(text.charAt(i))) { @@ -4647,7 +4485,6 @@ }, services: function(link) { var href, key, match, type, _ref; - href = link.href; _ref = Linkify.types; for (key in _ref) { @@ -4660,7 +4497,6 @@ }, embed: function(data) { var embed, href, key, link, name, options, uid, value, _ref; - key = data[0], uid = data[1], options = data[2], link = data[3]; href = link.href; embed = $.el('a', { @@ -4689,7 +4525,6 @@ }, title: function(data) { var embed, err, key, link, options, service, title, titles, uid; - key = data[0], uid = data[1], options = data[2], link = data[3], embed = data[4]; if (!(service = Linkify.types[key].title)) { return; @@ -4726,21 +4561,18 @@ cb: { toggle: function() { var string, _ref; - _ref = $.hasClass(this, "embedded") ? ['unembed', '(embed)'] : ['embed', '(unembed)'], string = _ref[0], this.textContent = _ref[1]; $.replace(this.previousElementSibling, Linkify.cb[string](this)); return $.toggleClass(this, 'embedded'); }, embed: function(a) { var el, style, type; - el = (type = Linkify.types[a.dataset.key]).el(a); el.style.cssText = (style = type.style) ? style : "border: 0; width: 640px; height: 390px"; return el; }, unembed: function(a) { var el; - el = $.el('a', { rel: 'nofollow noreferrer', target: 'blank', @@ -4753,7 +4585,6 @@ }, title: function(response, data) { var embed, key, link, options, service, text, uid; - key = data[0], uid = data[1], options = data[2], link = data[3], embed = data[4]; service = Linkify.types[key].title; switch (response.status) { @@ -4793,7 +4624,6 @@ regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/, el: function(a) { var div; - return div = $.el('iframe', { src: "http://www.purplegene.com/script?url=https://gist.github.com/" + a.dataset.uid + ".js" }); @@ -4804,7 +4634,6 @@ }, text: function(_arg) { var file, files; - files = _arg.files; for (file in files) { if (files.hasOwnProperty(file)) { @@ -4852,7 +4681,6 @@ regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/, el: function(a) { var div; - return div = $.el('iframe', { src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid }); @@ -4863,7 +4691,6 @@ style: 'height: auto; width: 500px; display: inline-block;', el: function(a) { var div; - div = $.el('div', { className: "soundcloud", name: "soundcloud" @@ -4889,7 +4716,6 @@ style: "border: none; width: 640px; height: 360px;", el: function(a) { var channel, chapter, result, _; - if (result = /(\w+)\/(?:[a-z]\/)?(\d+)/i.exec(a.dataset.uid)) { _ = result[0], channel = result[1], chapter = result[2]; return $.el('object', { @@ -4961,7 +4787,6 @@ QR = { init: function() { var sc; - if (!Conf['Quick Reply']) { return; } @@ -5008,7 +4833,6 @@ }, initReady: function() { var link; - QR.postingIsEnabled = !!$.id('postForm'); if (!QR.postingIsEnabled) { return; @@ -5028,13 +4852,11 @@ $.before($.id('postForm'), link); $.on(d, 'QRGetSelectedPost', function(_arg) { var cb; - cb = _arg.detail; return cb(QR.selected); }); $.on(d, 'QRAddPreSubmitHook', function(_arg) { var cb; - cb = _arg.detail; return QR.preSubmitHooks.push(cb); }); @@ -5064,7 +4886,6 @@ }, open: function() { var err; - if (QR.nodes) { QR.nodes.el.hidden = false; QR.unhide(); @@ -5083,7 +4904,6 @@ }, close: function() { var post, _i, _len, _ref; - if (QR.req) { QR.abort(); return; @@ -5131,7 +4951,6 @@ }, error: function(err) { var el; - QR.open(); if (typeof err === 'string') { el = $.tn(err); @@ -5158,7 +4977,6 @@ }, notify: function(el) { var notice, notif; - notice = new Notice('warning', el); QR.notifications.push(notice); if (!Header.areNotificationsEnabled) { @@ -5182,7 +5000,6 @@ notifications: [], cleanNotifications: function() { var notification, _i, _len, _ref; - _ref = QR.notifications; for (_i = 0, _len = _ref.length; _i < _len; _i++) { notification = _ref[_i]; @@ -5192,7 +5009,6 @@ }, status: function() { var disabled, status, thread, value; - if (!QR.nodes) { return; } @@ -5214,7 +5030,6 @@ QR.persona.getPassword(); return $.get('QR.personas', Conf['QR.personas'], function(_arg) { var arr, item, personas, type, types, _i, _len, _ref; - personas = _arg['QR.personas']; types = { name: [], @@ -5234,7 +5049,6 @@ }, parseItem: function(item, types) { var boards, match, type, val, _ref, _ref1; - if (item[0] === '#') { return; } @@ -5263,7 +5077,6 @@ }, loadPersonas: function(type, arr) { var list, val, _i, _len; - list = $("#list-" + type, QR.nodes.el); for (_i = 0, _len = arr.length; _i < _len; _i++) { val = arr[_i]; @@ -5276,7 +5089,6 @@ }, getPassword: function() { var input, m; - if (!QR.persona.pwd) { QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : $.id('delPassword').value; } @@ -5285,7 +5097,6 @@ get: function(cb) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; return cb(persona); }); @@ -5293,7 +5104,6 @@ set: function(post) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; persona = { name: post.name, @@ -5307,7 +5117,6 @@ cooldown: { init: function() { var board; - if (!Conf['Cooldown']) { return; } @@ -5349,7 +5158,6 @@ }, sync: function(cooldowns) { var id; - for (id in cooldowns) { QR.cooldown.cooldowns[id] = cooldowns[id]; } @@ -5357,7 +5165,6 @@ }, set: function(data) { var cooldown, delay, hasFile, isReply, isSage, post, req, start, type, upSpd; - if (!Conf['Cooldown']) { return; } @@ -5397,7 +5204,6 @@ }, count: function() { var cooldown, cooldowns, elapsed, hasFile, isReply, isSage, now, post, seconds, start, type, types, upSpd, upSpdAccuracy, update, _ref; - if (!Object.keys(QR.cooldown.cooldowns).length) { $["delete"]("" + g.BOARD + ".cooldown"); delete QR.cooldown.isCounting; @@ -5451,7 +5257,6 @@ }, quote: function(e) { var caretPos, com, index, post, range, s, sel, text, thread, _ref; - if (e != null) { e.preventDefault(); } @@ -5489,7 +5294,6 @@ }, characterCount: function() { var count, counter; - counter = QR.nodes.charCount; count = QR.nodes.com.textLength; counter.textContent = count; @@ -5498,7 +5302,6 @@ }, drag: function(e) { var toggle; - toggle = e.type === 'dragstart' ? $.off : $.on; toggle(d, 'dragover', QR.dragOver); return toggle(d, 'drop', QR.dropFile); @@ -5518,7 +5321,6 @@ }, paste: function(e) { var blob, files, item, _i, _len, _ref; - files = []; _ref = e.clipboardData.items; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -5558,7 +5360,6 @@ }, fileInput: function(files) { var file, length, max, post, _i, _len; - if (this instanceof Element) { files = __slice.call(this.files); QR.nodes.fileInput.value = null; @@ -5608,7 +5409,6 @@ this.select = __bind(this.select, this); var el, event, prev, _i, _len, _ref, _this = this; - el = $.el('a', { className: 'qr-preview', draggable: true, @@ -5662,7 +5462,6 @@ _Class.prototype.rm = function() { var index; - this["delete"](); index = QR.posts.indexOf(this); if (QR.posts.length === 1) { @@ -5682,7 +5481,6 @@ _Class.prototype.lock = function(lock) { var name, _i, _len, _ref; - if (lock == null) { lock = true; } @@ -5707,7 +5505,6 @@ _Class.prototype.select = function() { var rectEl, rectList; - if (QR.selected) { QR.selected.nodes.el.id = null; QR.selected.forceSave(); @@ -5724,7 +5521,6 @@ _Class.prototype.load = function() { var name, _i, _len, _ref; - _ref = ['thread', 'name', 'email', 'sub', 'com', 'filename']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { name = _ref[_i]; @@ -5736,7 +5532,6 @@ _Class.prototype.save = function(input) { var name, _ref; - if (input.type === 'checkbox') { this.spoiler = input.checked; return; @@ -5767,7 +5562,6 @@ _Class.prototype.forceSave = function() { var name, _i, _len, _ref; - if (this !== QR.selected) { return; } @@ -5797,11 +5591,9 @@ _Class.prototype.setThumbnail = function() { var fileURL, img, _this = this; - img = $.el('img'); img.onload = function() { var cv, height, s, width; - s = 90 * 2; if (_this.file.type === 'image/gif') { s *= 3; @@ -5852,7 +5644,6 @@ _Class.prototype.updateFilename = function() { var long; - long = "" + this.filename + " (" + this.filesize + ")\nCtrl+click to edit filename. Shift+click to clear."; this.nodes.el.title = long; if (this !== QR.selected) { @@ -5875,11 +5666,9 @@ _Class.prototype.pasteText = function(file) { var reader, _this = this; - reader = new FileReader(); reader.onload = function(e) { var text; - text = e.target.result; if (_this.com) { _this.com += "\n" + text; @@ -5917,7 +5706,6 @@ _Class.prototype.drop = function() { var el, index, newIndex, oldIndex, post; - $.rmClass(this, 'over'); if (!this.draggable) { return; @@ -5952,7 +5740,6 @@ ready: function() { var imgContainer, input, setLifetime, _this = this; - setLifetime = function(e) { return _this.lifetime = e.detail; }; @@ -5989,7 +5776,6 @@ }); $.get('captchas', [], function(_arg) { var captchas; - captchas = _arg.captchas; return _this.sync(captchas); }); @@ -6004,7 +5790,6 @@ }, getOne: function() { var captcha, challenge, response; - this.clear(); if (captcha = this.captchas.shift()) { challenge = captcha.challenge, response = captcha.response; @@ -6029,7 +5814,6 @@ }, save: function() { var response; - if (!(response = this.nodes.input.value.trim())) { return; } @@ -6044,7 +5828,6 @@ }, clear: function() { var captcha, i, now, _i, _len, _ref; - now = Date.now(); _ref = this.captchas; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { @@ -6062,7 +5845,6 @@ }, load: function() { var challenge; - if (!this.nodes.challenge.firstChild) { return; } @@ -6075,7 +5857,6 @@ }, count: function() { var count; - count = this.captchas.length; this.nodes.input.placeholder = (function() { switch (count) { @@ -6108,7 +5889,6 @@ }, dialog: function() { var check, dialog, i, items, key, mimeTypes, name, nodes, thread, value, _ref; - QR.nodes = nodes = { el: dialog = UI.dialog('qr', 'top:0;right:0;', "
×
+
No selected file×+
") }; @@ -6214,7 +5994,6 @@ preSubmitHooks: [], submit: function(e) { var challenge, err, extra, filetag, hook, options, post, postData, response, textOnly, thread, threadID, _i, _len, _ref, _ref1; - if (e != null) { e.preventDefault(); } @@ -6328,7 +6107,6 @@ }, response: function() { var URL, ban, board, err, h1, isReply, m, post, postID, req, resDoc, threadID, _, _ref, _ref1; - req = QR.req; delete QR.req; post = QR.posts[0]; @@ -6427,7 +6205,6 @@ FappeTyme = { init: function() { var el, input; - if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { return; } @@ -6479,7 +6256,6 @@ }, node: function() { var thumb, _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6504,7 +6280,6 @@ }, toggleAll: function() { var ID, file, func, post, _i, _len, _ref, _ref1; - $.event('CloseMenu'); if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { ImageExpand.EAI.className = 'contract-all-shortcut icon icon-resize-small'; @@ -6538,7 +6313,6 @@ }, toggle: function(post) { var headRect, rect, root, thumb, x, y; - thumb = post.file.thumb; if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { ImageExpand.expand(post); @@ -6548,7 +6322,6 @@ root = post.nodes.root; rect = (Conf['Advance on contract'] ? (function() { var next; - next = root; while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) { if ($('.stub', next) || next.offsetHeight === 0) { @@ -6579,7 +6352,6 @@ }, expand: function(post, src) { var img, thumb; - thumb = post.file.thumb; if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { return; @@ -6607,7 +6379,6 @@ }, completeExpand: function(post) { var prev, thumb; - thumb = post.file.thumb; if (!$.hasClass(thumb, 'expanding')) { return; @@ -6621,7 +6392,6 @@ prev = post.nodes.root.getBoundingClientRect(); return $.queueTask(function() { var curr; - $.addClass(post.nodes.root, 'expanded-image'); $.rmClass(post.file.thumb, 'expanding'); if (!(prev.top + prev.height <= 0)) { @@ -6633,7 +6403,6 @@ }, error: function() { var URL, post, src, timeoutID; - post = Get.postFromNode(this); $.rm(this); delete post.file.fullImage; @@ -6659,7 +6428,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6683,7 +6451,6 @@ menu: { init: function() { var conf, createSubEntry, el, name, subEntries, _ref; - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { return; } @@ -6707,7 +6474,6 @@ }, createSubEntry: function(name, desc) { var input, label; - label = $.el('label', { innerHTML: " " + name, title: desc @@ -6741,7 +6507,6 @@ }, node: function() { var _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6749,7 +6514,6 @@ }, mouseover: function(e) { var el, post; - post = Get.postFromNode(this); el = $.el('img', { id: 'ihover', @@ -6771,7 +6535,6 @@ error: function() { var URL, post, src, timeoutID, _this = this; - if (!doc.contains(this)) { return; } @@ -6796,7 +6559,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6822,7 +6584,6 @@ ImageLoader = { init: function() { var prefetch; - if (g.VIEW === 'catalog') { return; } @@ -6849,7 +6610,6 @@ }, node: function() { var URL, img, string, style, thumb, type, _ref, _ref1; - if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6871,7 +6631,6 @@ }, toggle: function() { var enabled, id, post, _ref; - enabled = Conf['prefetch'] = this.checked; if (enabled) { _ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts; @@ -6895,7 +6654,6 @@ }, node: function() { var thumb, _ref; - if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { return; } @@ -6908,7 +6666,6 @@ Sauce = { init: function() { var err, link, links, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Sauce']) { return; } @@ -6938,7 +6695,6 @@ }, createSauceLink: function(link) { var m, text; - link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { switch (parameter) { case '%TURL': @@ -6959,7 +6715,6 @@ }, node: function() { var link, nodes, _i, _len, _ref; - if (this.isClone || !this.file) { return; } @@ -6976,7 +6731,6 @@ ArchiveLink = { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { return; } @@ -6989,7 +6743,6 @@ order: 90, open: function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; return !!Redirect.to('thread', { postID: ID, @@ -7008,14 +6761,12 @@ }, createSubEntry: function(text, type) { var el, open; - el = $.el('a', { textContent: text, target: '_blank' }); open = type === 'post' ? function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; el.href = Redirect.to('thread', { postID: ID, @@ -7025,7 +6776,6 @@ return true; } : function(post) { var value; - value = Filter[type](post); if (!value) { return false; @@ -7048,7 +6798,6 @@ DeleteLink = { init: function() { var div, fileEl, fileEntry, postEl, postEntry; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { return; } @@ -7076,7 +6825,6 @@ el: fileEl, open: function(_arg) { var file; - file = _arg.file; if (!file || file.isDead) { return false; @@ -7092,7 +6840,6 @@ order: 40, open: function(post) { var node; - if (post.isDead || post.board.ID === 'q') { return false; } @@ -7107,7 +6854,6 @@ }, "delete": function() { var fileOnly, form, link, post; - post = DeleteLink.post; if (DeleteLink.cooldown.counting === post) { return; @@ -7137,7 +6883,6 @@ }, load: function(link, post, fileOnly, resDoc) { var msg, s; - if (resDoc.title === '4chan - Banned') { s = 'Banned!'; } else if (msg = resDoc.getElementById('errmsg')) { @@ -7158,7 +6903,6 @@ cooldown: { start: function(post, node) { var length, seconds, _ref; - if (!((_ref = QR.db) != null ? _ref.get({ boardID: post.board.ID, threadID: post.thread.ID, @@ -7192,7 +6936,6 @@ DownloadLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { return; } @@ -7206,7 +6949,6 @@ order: 100, open: function(_arg) { var file; - file = _arg.file; if (!file) { return false; @@ -7239,7 +6981,6 @@ }, makeButton: (function() { var a; - a = $.el('a', { className: 'menu-button brackets-wrap', innerHTML: '', @@ -7247,7 +6988,6 @@ }); return function() { var button; - button = a.cloneNode(true); $.on(button, 'click', Menu.toggle); return button; @@ -7255,7 +6995,6 @@ })(), toggle: function(e) { var post; - post = Get.postFromNode(this); return Menu.menu.toggle(e, this, post); } @@ -7264,7 +7003,6 @@ ReportLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { return; } @@ -7286,7 +7024,6 @@ }, report: function() { var id, post, set, url; - post = ReportLink.post; url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; id = Date.now(); @@ -7299,7 +7036,6 @@ init: function() { return $.ready(function() { var href; - Favicon.el = $('link[rel="shortcut icon"]', d.head); Favicon.el.type = 'image/x-icon'; href = Favicon.el.href; @@ -7374,7 +7110,6 @@ init: function() { var sc, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } @@ -7403,7 +7138,6 @@ }, node: function() { var ID, fileCount, post, postCount, _ref; - postCount = 0; fileCount = 0; _ref = this.posts; @@ -7421,7 +7155,6 @@ }, onUpdate: function(e) { var fileCount, postCount, _ref; - if (e.detail[404]) { return; } @@ -7430,7 +7163,6 @@ }, update: function(postCount, fileCount) { var fileCountEl, postCountEl, thread; - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; postCountEl.textContent = postCount; fileCountEl.textContent = fileCount; @@ -7455,7 +7187,6 @@ }, onThreadsLoad: function() { var page, pages, thread, _i, _j, _len, _len1, _ref; - if (!(Conf["Page Count in Stats"] && this.status === 200)) { return; } @@ -7479,7 +7210,6 @@ init: function() { var checked, conf, el, input, name, sc, settings, subEntries, _ref, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { return; } @@ -7629,7 +7359,6 @@ }, interval: function() { var val; - val = +this.value; if (val < 1) { val = 1; @@ -7639,7 +7368,6 @@ }, load: function() { var klass, req, text, _ref; - req = ThreadUpdater.req; switch (req.status) { case 200: @@ -7672,7 +7400,6 @@ }, getInterval: function() { var i, j; - i = ThreadUpdater.interval; j = Math.min(ThreadUpdater.outdateCount, 10); if (!d.hidden) { @@ -7682,14 +7409,12 @@ }, intervalShortcut: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=Interval]', settings).focus(); }, set: function(name, text, klass) { var el, node; - el = ThreadUpdater[name]; if (node = el.firstChild) { node.data = text; @@ -7702,7 +7427,6 @@ }, timeout: function() { var n; - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); if (!(n = --ThreadUpdater.seconds)) { return ThreadUpdater.update(); @@ -7715,7 +7439,6 @@ }, update: function() { var url; - if (!ThreadUpdater.online) { return; } @@ -7738,7 +7461,6 @@ }, updateThreadStatus: function(title, OP) { var icon, message, root, titleLC; - titleLC = title.toLowerCase(); if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { return; @@ -7765,7 +7487,6 @@ }, parse: function(postObjects) { var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref; - OP = postObjects[0]; Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; ThreadUpdater.updateThreadStatus('Sticky', OP); @@ -7851,7 +7572,6 @@ } $.queueTask(function() { var length, threadID; - threadID = ThreadUpdater.thread.ID; length = $$('.thread > .postContainer', ThreadUpdater.root).length; return Fourchan.parseThread(threadID, length - count, length); @@ -7872,7 +7592,6 @@ ThreadWatcher = { init: function() { var now, sc; - if (!Conf['Thread Watcher']) { return; } @@ -7880,7 +7599,7 @@ id: 'watcher-link', textContent: 'Watcher', href: 'javascript:;', - className: 'disabled icon icon-bookmark' + className: 'disabled icon icon-eye-open' }); this.db = new DataBoard('watchedThreads', this.refresh, true); this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', "
Thread Watcher ×
"); @@ -7905,7 +7624,6 @@ } $.get('WatchedThreads', null, function(_arg) { var WatchedThreads, boardID, data, threadID, threads, _ref; - WatchedThreads = _arg.WatchedThreads; if (!WatchedThreads) { return; @@ -7931,7 +7649,6 @@ }, node: function() { var toggler; - toggler = $.el('img', { className: 'watch-thread-link' }); @@ -7953,7 +7670,6 @@ } return $.get('AutoWatch', 0, function(_arg) { var AutoWatch, thread; - AutoWatch = _arg.AutoWatch; if (!(thread = g.BOARD.threads[AutoWatch])) { return; @@ -7969,7 +7685,6 @@ cb: { openAll: function() { var a, _i, _len, _ref; - if ($.hasClass(this, 'disabled')) { return; } @@ -7988,7 +7703,6 @@ }, pruneDeads: function() { var boardID, data, threadID, _i, _len, _ref, _ref1; - if ($.hasClass(this, 'disabled')) { return; } @@ -8012,13 +7726,11 @@ }, rm: function() { var boardID, threadID, _ref; - _ref = this.parentNode.dataset.fullID.split('.'), boardID = _ref[0], threadID = _ref[1]; return ThreadWatcher.rm(boardID, +threadID); }, post: function(e) { var board, postID, threadID, _ref; - _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; if (postID === threadID) { if (Conf['Auto Watch']) { @@ -8030,7 +7742,6 @@ }, threadUpdate: function(e) { var thread; - thread = e.detail.thread; if (!(e.detail[404] && ThreadWatcher.db.get({ boardID: thread.board.ID, @@ -8047,7 +7758,6 @@ }, fetchAllStatus: function() { var thread, threads, _i, _len; - if (!(threads = ThreadWatcher.getAll()).length) { return; } @@ -8059,7 +7769,6 @@ }, fetchStatus: function(_arg) { var boardID, data, fetchCount, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, data = _arg.data; if (data.isDead) { return; @@ -8069,7 +7778,6 @@ return $.ajax("//api.4chan.org/" + boardID + "/res/" + threadID + ".json", { onloadend: function() { var status; - fetchCount.fetched++; if (fetchCount.fetched === fetchCount.fetching) { fetchCount.fetched = 0; @@ -8100,7 +7808,6 @@ }, getAll: function() { var all, boardID, data, threadID, threads, _ref; - all = []; _ref = ThreadWatcher.db.data.boards; for (boardID in _ref) { @@ -8121,7 +7828,6 @@ }, makeLine: function(boardID, threadID, data) { var div, fullID, href, link, x; - x = $.el('a', { textContent: '×', href: 'javascript:;' @@ -8152,7 +7858,6 @@ }, refresh: function() { var boardID, data, list, nodes, refresher, thread, threadID, toggler, watched, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3; - nodes = []; _ref = ThreadWatcher.getAll(); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -8180,7 +7885,6 @@ }, toggle: function(thread) { var boardID, threadID; - boardID = thread.board.ID; threadID = thread.ID; if (ThreadWatcher.db.get({ @@ -8194,7 +7898,6 @@ }, add: function(thread) { var boardID, data, threadID; - data = {}; boardID = thread.board.ID; threadID = thread.ID; @@ -8225,7 +7928,6 @@ }, convert: function(oldFormat) { var boardID, data, newFormat, threadID, threads; - newFormat = {}; for (boardID in oldFormat) { threads = oldFormat[boardID]; @@ -8242,7 +7944,6 @@ refreshers: [], init: function() { var menu; - if (!Conf['Thread Watcher']) { return; } @@ -8255,7 +7956,6 @@ }, addHeaderMenuEntry: function() { var entryEl; - if (g.VIEW !== 'thread') { return; } @@ -8272,7 +7972,6 @@ }); return this.refreshers.push(function() { var addClass, rmClass, text, _ref; - _ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = _ref[0], rmClass = _ref[1], text = _ref[2]; $.addClass(entryEl, addClass); $.rmClass(entryEl, rmClass); @@ -8281,7 +7980,6 @@ }, addMenuEntries: function() { var cb, conf, entries, entry, name, refresh, subEntries, _i, _len, _ref, _ref1, _results; - entries = []; entries.push({ cb: ThreadWatcher.cb.openAll, @@ -8352,7 +8050,6 @@ }, createSubEntry: function(name, desc) { var entry, input; - entry = { type: 'thread watcher', el: $.el('label', { @@ -8404,7 +8101,6 @@ }, ready: function() { var ID, post, posts, _ref; - $.off(d, '4chanXInitFinished', Unread.ready); posts = []; _ref = Unread.thread.posts; @@ -8421,7 +8117,6 @@ }, scroll: function() { var checkPosition, hash, onload, post, posts, root; - if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } @@ -8451,7 +8146,6 @@ } checkPosition = function(target) { var height, top, _ref; - _ref = target.getBoundingClientRect(), top = _ref.top, height = _ref.height; return top + height - doc.clientHeight > 0; }; @@ -8459,7 +8153,6 @@ }, sync: function() { var lastReadPost; - lastReadPost = Unread.db.get({ boardID: Unread.thread.board.ID, threadID: Unread.thread.ID, @@ -8476,7 +8169,6 @@ }, addPosts: function(posts) { var ID, data, post, _i, _len; - for (_i = 0, _len = posts.length; _i < _len; _i++) { post = posts[_i]; ID = post.ID; @@ -8504,7 +8196,6 @@ }, addPostQuotingYou: function(post) { var quotelink, _i, _len, _ref; - if (!QR.db) { return; } @@ -8521,7 +8212,6 @@ }, openNotification: function(post) { var name, notif; - if (!Header.areNotificationsEnabled) { return; } @@ -8547,7 +8237,6 @@ }, readSinglePost: function(post) { var i; - if ((i = Unread.posts.indexOf(post)) === -1) { return; } @@ -8563,7 +8252,6 @@ }, readArray: function(arr) { var i, post, _i, _len; - for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { post = arr[i]; if (post.ID > Unread.lastReadPost) { @@ -8574,7 +8262,6 @@ }, read: $.debounce(50, function(e) { var ID, bottom, height, i, post, posts; - if (d.hidden || !Unread.posts.length) { return; } @@ -8630,7 +8317,6 @@ }), setLine: function(force) { var post, root; - if (!(d.hidden || force === true)) { return; } @@ -8645,7 +8331,6 @@ }, update: function(dontrepeat) { var count; - count = Unread.posts.length; if (Conf['Unread Count']) { d.title = "" + (Conf['Quoted Title'] && Unread.postsQuotingYou.length ? '(!) ' : '') + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); @@ -8671,7 +8356,6 @@ }, init: function() { var archive, boardID, boards, data, id, name, type, _i, _len, _ref, _ref1, _ref2; - _ref = Conf['selectedArchives']; for (boardID in _ref) { data = _ref[boardID]; @@ -8803,7 +8487,6 @@ }, to: function(dest, data) { var archive; - archive = (dest === 'search' ? Redirect.data.thread : Redirect.data[dest])[data.boardID]; if (!archive) { return ''; @@ -8812,7 +8495,6 @@ }, protocol: function(archive) { var protocol; - protocol = location.protocol; if (!archive[protocol.slice(0, -1)]) { protocol = protocol === 'https:' ? 'http:' : 'https:'; @@ -8821,7 +8503,6 @@ }, thread: function(archive, _arg) { var boardID, path, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; if (archive.software === 'foolfuuka') { @@ -8834,7 +8515,6 @@ }, post: function(archive, _arg) { var URL, boardID, postID, protocol; - boardID = _arg.boardID, postID = _arg.postID; protocol = Redirect.protocol(archive); if (['Foolz', 'NSFW Foolz'].contains(archive.name)) { @@ -8846,13 +8526,11 @@ }, file: function(archive, _arg) { var boardID, filename; - boardID = _arg.boardID, filename = _arg.filename; return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename; }, search: function(archive, _arg) { var boardID, path, type, value; - boardID = _arg.boardID, type = _arg.type, value = _arg.value; type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; value = encodeURIComponent(value); @@ -8871,7 +8549,6 @@ }, setup: function() { var btn, entry, psa; - $.off(d, '4chanXInitFinished', PSAHiding.setup); if (!(psa = $.id('globalMessage'))) { $.rmClass(doc, 'hide-announcement'); @@ -8900,7 +8577,6 @@ $.on(btn, 'click', PSAHiding.toggle); $.get('hiddenPSA', 0, function(_arg) { var hiddenPSA; - hiddenPSA = _arg.hiddenPSA; PSAHiding.sync(hiddenPSA); $.before(psa, btn); @@ -8910,7 +8586,6 @@ }, toggle: function(e) { var UTC; - if ($.hasClass(this, 'hide-announcement')) { UTC = +$.id('globalMessage').dataset.utc; $.set('hiddenPSA', UTC); @@ -8922,7 +8597,6 @@ }, sync: function(UTC) { var hr, psa; - psa = $.id('globalMessage'); psa.hidden = PSAHiding.btn.hidden = UTC && UTC >= +psa.dataset.utc ? true : false; if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') { @@ -8943,7 +8617,6 @@ }, ready: function() { var banner, child, children, i; - banner = $(".boardBanner"); children = banner.children; i = 0; @@ -8963,7 +8636,6 @@ cb: { toggle: (function() { var types; - types = { jpg: 227, png: 270, @@ -8971,7 +8643,6 @@ }; return function() { var num, type; - type = Object.keys(types)[Math.floor(3 * Math.random())]; num = Math.floor(types[type] * Math.random()); return this.src = "//static.4chan.org/image/title/" + num + "." + type; @@ -8991,7 +8662,6 @@ }, focus: function() { var items, string, string2; - this.textContent = this.innerHTML; string = "" + g.BOARD + "." + this.className; string2 = "" + string + ".orig"; @@ -9014,7 +8684,6 @@ }, custom: function(child) { var cachedTest, string; - cachedTest = child.innerHTML; string = "" + g.BOARD + "." + child.className; $.on(child, 'click keydown focus blur', function(e) { @@ -9022,7 +8691,6 @@ }); $.get(string, cachedTest, function(item) { var string2, title; - if (!(title = item[string])) { return; } @@ -9046,7 +8714,6 @@ CatalogLinks = { init: function() { var el, input; - if (!Conf['Catalog Links']) { return; } @@ -9070,14 +8737,12 @@ }, toggle: function() { var useCatalog; - $.event('CloseMenu'); $.set('Header catalog links', useCatalog = this.checked); return CatalogLinks.set(useCatalog); }, set: function(useCatalog) { var a, board, path, _i, _len, _ref; - path = useCatalog ? 'catalog' : ''; _ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -9112,7 +8777,6 @@ }, node: function() { var str, uid; - if (this.isClone || !(str = this.info.uniqueID)) { return; } @@ -9124,7 +8788,6 @@ }, compute: function(str) { var hash, rgb; - hash = IDColor.hash(str); rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; @@ -9136,7 +8799,6 @@ }, hash: function(str) { var i, msg; - msg = 0; i = 0; while (i < 8) { @@ -9182,7 +8844,6 @@ }, node: function() { var dicestats, roll, _ref; - if (this.isClone || !(dicestats = (_ref = this.info.email) != null ? _ref.match(/dice[+\s](\d+)d(\d+)/) : void 0)) { return; } @@ -9194,7 +8855,6 @@ Emoji = { init: function() { var css, icon, name, pos, _ref; - if (!Conf['Emoji']) { return; } @@ -9264,7 +8924,6 @@ }, node: function() { var a; - if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) { return $.on(a, 'click', ExpandComment.cb); } @@ -9276,7 +8935,6 @@ }, expand: function(post) { var a; - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { $.replace(post.nodes.shortComment, post.nodes.longComment); post.nodes.comment = post.nodes.longComment; @@ -9292,7 +8950,6 @@ }, contract: function(post) { var a; - if (!post.nodes.shortComment) { return; } @@ -9303,7 +8960,6 @@ }, parse: function(req, a, post) { var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - status = req.status; if (![200, 304].contains(status)) { a.textContent = "Error " + req.statusText + " (" + status + ")"; @@ -9366,7 +9022,6 @@ }, node: function() { var a, files, posts, span, _ref; - if (!(span = $.x('following-sibling::span[contains(@class,"summary")][1]', this.OP.nodes.root))) { return; } @@ -9387,7 +9042,6 @@ }, toggle: function(thread) { var a, files, filesCount, inlined, num, post, posts, postsCount, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4; - threadRoot = thread.OP.nodes.root.parentNode; a = $('.summary', threadRoot); switch (thread.isExpanded) { @@ -9465,7 +9119,6 @@ }, parse: function(req, thread, a) { var filesCount, link, post, posts, postsCount, postsObj, postsRoot, reply, root, spoilerRange, _i, _len; - if (a.textContent[0] === '+') { return; } @@ -9529,7 +9182,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%(.)/g, function(s, c) { if (c in FileInfo.formatters) { return "' + FileInfo.formatters." + c + ".call(post) + '"; @@ -9541,7 +9193,6 @@ }, convertUnit: function(size, unit) { var i; - if (unit === 'B') { return "" + (size.toFixed()) + " Bytes"; } @@ -9572,7 +9223,6 @@ }, n: function() { var fullname, shortname; - fullname = this.file.name; shortname = Build.shortFilename(this.file.name, this.isReply); if (fullname === shortname) { @@ -9616,7 +9266,6 @@ Fourchan = { init: function() { var board; - if (g.VIEW === 'catalog') { return; } @@ -9638,7 +9287,6 @@ }, code: function() { var pre, _i, _len, _ref; - if (this.isClone) { return; } @@ -9667,13 +9315,11 @@ Keybinds = { init: function() { var init; - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { return; } init = function() { var node, _i, _len, _ref; - $.off(d, '4chanXInitFinished', init); $.on(d, 'keydown', Keybinds.keydown); _ref = $$('[accesskey]'); @@ -9686,7 +9332,6 @@ }, keydown: function(e) { var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; - if (!(key = Keybinds.keyCode(e))) { return; } @@ -9864,7 +9509,6 @@ }, keyCode: function(e) { var kc, key; - key = (function() { switch (kc = e.keyCode) { case 8: @@ -9920,7 +9564,6 @@ }, tags: function(tag, ta) { var range, selEnd, selStart, value; - value = ta.value; selStart = ta.selectionStart; selEnd = ta.selectionEnd; @@ -9931,13 +9574,11 @@ }, sage: function() { var isSage; - isSage = /sage/i.test(QR.nodes.email.value); return QR.nodes.email.value = isSage ? "" : "sage"; }, img: function(thread, all) { var post; - if (all) { return ImageExpand.cb.toggleAll(); } else { @@ -9947,7 +9588,6 @@ }, open: function(thread, tab) { var url; - if (g.VIEW !== 'index') { return; } @@ -9960,7 +9600,6 @@ }, hl: function(delta, thread) { var axe, headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; - if (!delta) { if (postEl = $('.reply.highlight', thread)) { $.rmClass(postEl, 'highlight'); @@ -10020,7 +9659,6 @@ Nav = { init: function() { var append, next, prev, span; - switch (g.VIEW) { case 'index': if (!Conf['Index Navigation']) { @@ -10071,7 +9709,6 @@ }, getThread: function(full) { var headRect, i, rect, thread, threads, topMargin, _i, _len; - if (Conf['Bottom header'] || !Conf['Fixed Header']) { topMargin = 0; } else { @@ -10097,7 +9734,6 @@ }, scroll: function(delta) { var i, rect, thread, threads, top, topMargin, _ref, _ref1; - _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; top = rect.top - topMargin; if ((delta === -1 && top > -5) || (delta === +1 && top < 5)) { @@ -10122,7 +9758,6 @@ }, node: function() { var dateEl; - if (this.isClone) { return; } @@ -10132,7 +9767,6 @@ }, relative: function(diff, now, date) { var days, months, number, rounded, unit, years; - unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); rounded = Math.round(number); if (rounded !== 1) { @@ -10143,7 +9777,6 @@ stale: [], flush: function() { var now, update, _i, _len, _ref; - if (d.hidden) { return; } @@ -10159,16 +9792,13 @@ }, setUpdate: function(post) { var markStale, setOwnTimeout, update; - setOwnTimeout = function(diff) { var delay; - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; return setTimeout(markStale, delay); }; update = function(now) { var date, diff, relative, singlePost, _i, _len, _ref; - date = post.info.date; diff = now - date; relative = RelativeDates.relative(diff, now, date); @@ -10209,7 +9839,6 @@ }, node: function(post) { var spoiler, spoilers, _i, _len; - spoilers = $$('s', this.nodes.comment); for (_i = 0, _len = spoilers.length; _i < _len; _i++) { spoiler = spoilers[_i]; @@ -10229,7 +9858,6 @@ }, ready: function() { var field; - field = $.id('recaptcha_response_field'); $.on(field, 'keydown', function(e) { if (e.keyCode === 8 && !field.value) { @@ -10238,7 +9866,6 @@ }); return $.on($('form'), 'submit', function(e) { var response; - e.preventDefault(); response = field.value.trim(); if (!/\s/.test(response)) { @@ -10268,7 +9895,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%([A-Za-z])/g, function(s, c) { if (c in Time.formatters) { return "' + Time.formatters." + c + ".call(date) + '"; @@ -10353,7 +9979,6 @@ Settings = { init: function() { var link, settings; - link = $.el('a', { className: 'settings-link icon icon-wrench', textContent: 'Settings', @@ -10363,7 +9988,6 @@ Header.addShortcut(link); $.get('previousversion', null, function(item) { var changelog, el, previous; - if (previous = item['previousversion']) { if (previous === g.VERSION) { return; @@ -10398,7 +10022,6 @@ }, open: function(openSection) { var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref; - $.off(d, '4chanXInitFinished', Settings.open); if (Settings.dialog) { return; @@ -10451,7 +10074,6 @@ sections: [], addSection: function(title, open) { var hyphenatedTitle, _ref; - if (typeof title !== 'string') { _ref = title.detail, title = _ref.title, open = _ref.open; } @@ -10464,7 +10086,6 @@ }, openSection: function() { var section, selected; - if (selected = $('.tab-selected', Settings.dialog)) { $.rmClass(selected, 'tab-selected'); } @@ -10478,7 +10099,6 @@ }, main: function(section) { var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref; - items = {}; inputs = {}; _ref = Config.main; @@ -10503,7 +10123,6 @@ } $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].checked = val; @@ -10518,7 +10137,6 @@ boards: {} }, function(item) { var ID, board, thread, _ref1; - _ref1 = item.hiddenThreads.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -10533,7 +10151,6 @@ boards: {} }, function(item) { var ID, board, post, thread, _ref1; - _ref1 = item.hiddenPosts.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -10553,7 +10170,6 @@ boards: {} }, function(item) { var boardID; - for (boardID in item.hiddenThreads.boards) { localStorage.removeItem("4chan-hide-t-" + boardID); } @@ -10564,7 +10180,6 @@ }, "export": function(now, data) { var a, db, _i, _len, _ref; - if (typeof now !== 'number') { now = Date.now(); data = { @@ -10599,7 +10214,6 @@ }, onImport: function() { var file, output, reader; - if (!(file = this.files[0])) { return; } @@ -10611,7 +10225,6 @@ reader = new FileReader(); reader.onload = function(e) { var data, err; - try { data = JSON.parse(e.target.result); Settings.loadSettings(data); @@ -10628,7 +10241,6 @@ }, loadSettings: function(data) { var key, val, version, _ref; - version = data.version.split('.'); if (version[0] === '2') { data = Settings.convertSettings(data, { @@ -10716,7 +10328,6 @@ }, convertSettings: function(data, map) { var newKey, prevKey; - for (prevKey in map) { newKey = map[prevKey]; if (newKey) { @@ -10728,7 +10339,6 @@ }, filter: function(section) { var select; - section.innerHTML = "
"; select = $('select', section); $.on(select, 'change', Settings.selectFilter); @@ -10736,7 +10346,6 @@ }, selectFilter: function() { var div, name, ta; - div = this.nextElementSibling; if ((name = this.value) !== 'guide') { $.rmAll(div); @@ -10756,7 +10365,6 @@ }, sauce: function(section) { var ta; - section.innerHTML = "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
"; ta = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { @@ -10766,7 +10374,6 @@ }, advanced: function(section) { var archive, boardID, boardOptions, boardSelect, boards, data, event, input, inputs, item, items, name, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4; - section.innerHTML = "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Disabled selections indicate that only one archive is available for that board and redirection type.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
Board link: g
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:\"Install Gentoo\"
Index-only link: g-index
Catalog-only link: g-catalog
External link: external-text:\"Google\",\"http://www.google.com\"
Combinations are possible: g-index-text:\"Technology Index\"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Quick Reply Personas is disabled.

\n One item per line.
\n Items will be added in the relevant input's auto-completion list.
\n Password items will always be used, since there is no password input.
\n Lines starting with a # will be ignored.\n

Unread Favicon is disabled.
Emoji is disabled.
\n Sage Icon:
\n Position:
Thread Updater is disabled.
\n Interval:
"; items = {}; inputs = {}; @@ -10786,7 +10393,6 @@ $.on(ta, 'change', $.cb.value); $.get(items, function(items) { var key, val; - for (key in items) { val = items[key]; if (['emojiPos'].contains(key)) { @@ -10857,7 +10463,6 @@ }); $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var option, selectedArchives, type; - selectedArchives = _arg.selectedArchives; for (boardID in selectedArchives) { data = selectedArchives[boardID]; @@ -10872,7 +10477,6 @@ }, addArchiveCell: function(boardID, data, type) { var archive, i, length, options, select, td; - length = data[type].length; td = $.el('td', { className: 'archive-cell' @@ -10902,10 +10506,8 @@ }, saveSelectedArchive: function() { var _this = this; - return $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var selectedArchives, _name; - selectedArchives = _arg.selectedArchives; (selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value; return $.set('selectedArchives', selectedArchives); @@ -10916,7 +10518,6 @@ }, time: function() { var funk; - funk = Time.createFunc(this.value); return this.nextElementSibling.textContent = funk(Time, new Date()); }, @@ -10925,7 +10526,6 @@ }, fileInfo: function() { var data, funk; - data = { isReply: true, file: { @@ -10964,7 +10564,6 @@ }, keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; - section.innerHTML = "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
"; tbody = $('tbody', section); items = {}; @@ -10985,7 +10584,6 @@ } return $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].value = val; @@ -10994,7 +10592,6 @@ }, keybind: function(e) { var key; - if (e.keyCode === 9) { return; } @@ -11011,10 +10608,8 @@ Main = { init: function() { var db, flatten, _i, _len, _ref; - flatten = function(parent, obj) { var key, val; - if (obj instanceof Array) { Conf[parent] = obj[0]; } else if (typeof obj === 'object') { @@ -11056,7 +10651,6 @@ }, initFeatures: function() { var init, pathname, _ref; - pathname = location.pathname.split('/'); g.BOARD = new Board(pathname[1]); if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { @@ -11084,7 +10678,6 @@ case 'images.4chan.org': $.ready(function() { var URL; - if (Conf['404 Redirect'] && ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) { Redirect.init(); pathname = location.pathname.split('/'); @@ -11101,7 +10694,6 @@ } init = function(features) { var err, module, name; - for (name in features) { module = features[name]; try { @@ -11180,7 +10772,6 @@ }, initStyle: function() { var mainStyleSheet, setStyle, style, styleSheets, _ref; - $.off(d, '4chanMainInit', Main.initStyle); if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { return; @@ -11202,7 +10793,6 @@ styleSheets = $$('link[rel="alternate stylesheet"]', d.head); setStyle = function() { var styleSheet, _i, _len; - $.rmClass(doc, style); for (_i = 0, _len = styleSheets.length; _i < _len; _i++) { styleSheet = styleSheets[_i]; @@ -11224,7 +10814,6 @@ }, initReady: function() { var board, err, errors, href, passLink, postRoot, posts, styleSelector, thread, threadRoot, threads, _i, _j, _len, _len1, _ref, _ref1; - if (['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) { if (Conf['404 Redirect'] && g.VIEW === 'thread') { href = Redirect.to('thread', { @@ -11291,7 +10880,6 @@ }, callbackNodes: function(klass, nodes) { var callback, err, errors, i, len, node, _i, _len, _ref; - len = nodes.length; _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -11319,11 +10907,9 @@ }, callbackNodesDB: function(klass, nodes, cb) { var errors, func, i, len, node, queue, softTask; - queue = []; softTask = function() { var args, func, task; - task = queue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -11342,7 +10928,6 @@ errors = null; func = function(node, i) { var callback, err, _i, _len, _ref; - _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { callback = _ref[_i]; @@ -11376,7 +10961,6 @@ }, addCallback: function(e) { var Klass, obj; - obj = e.detail; if (typeof obj.callback.name !== 'string') { throw new Error("Invalid callback name: " + obj.callback.name); @@ -11396,7 +10980,6 @@ }, handleErrors: function(errors) { var div, error, logs, _i, _len; - if (!(errors instanceof Array)) { error = errors; } else if (errors.length === 1) { @@ -11411,7 +10994,6 @@ }); $.on(div.lastElementChild, 'click', function() { var _ref; - return _ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = _ref[0], logs.hidden = _ref[1], _ref; }); logs = $.el('div', { @@ -11425,7 +11007,6 @@ }, parseError: function(data) { var error, message; - Main.logError(data); message = $.el('div', { textContent: data.message @@ -11442,7 +11023,6 @@ }, isThisPageLegit: function() { var _ref; - if (!('thisPageIsLegit' in Main)) { Main.thisPageIsLegit = location.hostname === 'boards.4chan.org' && !$('link[href*="favicon-status.ico"]', d.head) && ((_ref = d.title) !== '4chan - Temporarily Offline' && _ref !== '4chan - Error' && _ref !== '504 Gateway Time-out'); } diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index bb948ff4c..f1f7f2d55 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -6,7 +6,7 @@ ThreadWatcher = id: 'watcher-link' textContent: 'Watcher' href: 'javascript:;' - className: 'disabled icon icon-bookmark' + className: 'disabled icon icon-eye-open' @db = new DataBoard 'watchedThreads', @refresh, true @dialog = UI.dialog 'thread-watcher', 'top: 50px; left: 0px;', """