Tag:
%gLiteral %: %%
Quick Reply Personas One item per line. Items will be added in the relevant input's auto-completion list. Password items will always be used, since there is no password input. Lines starting with a # will be ignored.
You can use these settings with each item, separate them with semicolons:Possible items are: name, options (or equivalently email), subject and password. Wrap values of items with quotes, like this: options:"sage". Force values as defaults with the always keyword, for example: options:"sage";always. Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always. Unread Favicon is disabled. ferongr xat- 4chanJS Mayhem Original Metro Thread Updater is disabled. Interval: seconds
Custom Cooldown Time Seconds:
Custom CSSApply CSS "
+ });
+ ref = $$('.warning', section);
+ for (j = 0, len = ref.length; j < len; j++) {
+ warning = ref[j];
+ warning.hidden = Conf[warning.dataset.feature];
+ }
+ items = {};
+ inputs = {};
+ ref1 = ['captchaLanguage', 'boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'customCooldown'];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ name = ref1[k];
+ input = $("[name='" + name + "']", section);
+ items[name] = Conf[name];
+ inputs[name] = input;
+ if (name === 'usercss') {
+ $.on(input, 'change', $.cb.value);
+ } else if (name === 'favicon') {
+ $.on(input, 'change', $.cb.value);
+ $.on(input, 'change', Settings[name]);
+ } else {
+ $.on(input, 'input', $.cb.value);
+ if (name in Settings) {
+ $.on(input, 'input', Settings[name]);
+ }
+ }
+ }
+ ta = $('.personafield', section);
+ $.get('QR.personas', Conf['QR.personas'], function(item) {
+ return ta.value = item['QR.personas'];
+ });
+ $.on(ta, 'change', $.cb.value);
+ $.get(items, function(items) {
+ var key, val;
+ for (key in items) {
+ val = items[key];
+ input = inputs[key];
+ input.value = val;
+ if (key in Settings && key !== 'usercss') {
+ Settings[key].call(input);
+ }
+ }
+ });
+ interval = $('input[name="Interval"]', section);
+ customCSS = $('input[name="Custom CSS"]', section);
+ applyCSS = $('#apply-css', section);
+ interval.value = Conf['Interval'];
+ customCSS.checked = Conf['Custom CSS'];
+ inputs['usercss'].disabled = !Conf['Custom CSS'];
+ applyCSS.disabled = !Conf['Custom CSS'];
+ $.on(interval, 'change', ThreadUpdater.cb.interval);
+ $.on(customCSS, 'change', Settings.togglecss);
+ $.on(applyCSS, 'click', Settings.usercss);
+ archBoards = {};
+ ref2 = Redirect.archives;
+ for (l = 0, len2 = ref2.length; l < len2; l++) {
+ ref3 = ref2[l], uid = ref3.uid, name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials;
+ for (m = 0, len3 = boards.length; m < len3; m++) {
+ boardID = boards[m];
+ o = archBoards[boardID] || (archBoards[boardID] = {
+ thread: [[], []],
+ post: [[], []],
+ file: [[], []]
+ });
+ i = +(!!withCredentials);
+ archive = [uid != null ? uid : name, name];
+ o.thread[i].push(archive);
+ if (software === 'foolfuuka') {
+ o.post[i].push(archive);
+ }
+ if (indexOf.call(files, boardID) >= 0) {
+ o.file[i].push(archive);
+ }
+ }
+ }
+ for (boardID in archBoards) {
+ o = archBoards[boardID];
+ ref4 = ['thread', 'post', 'file'];
+ for (n = 0, len4 = ref4.length; n < len4; n++) {
+ item = ref4[n];
+ i = o[item][0].length ? 1 : 0;
+ o[item][i].push([null, 'disabled']);
+ o[item] = o[item][0].concat(o[item][1]);
+ }
+ }
+ rows = [];
+ boardOptions = [];
+ ref5 = Object.keys(archBoards).sort();
+ for (q = 0, len5 = ref5.length; q < len5; q++) {
+ boardID = ref5[q];
+ row = $.el('tr', {
+ className: "board-" + boardID
+ });
+ row.hidden = boardID !== g.BOARD.ID;
+ boardOptions.push($.el('option', {
+ textContent: "/" + boardID + "/",
+ value: "board-" + boardID,
+ selected: boardID === g.BOARD.ID
+ }));
+ o = archBoards[boardID];
+ ref6 = ['thread', 'post', 'file'];
+ for (r = 0, len6 = ref6.length; r < len6; r++) {
+ item = ref6[r];
+ $.add(row, Settings.addArchiveCell(boardID, o, item));
+ }
+ rows.push(row);
+ }
+ if (!(g.BOARD.ID in archBoards)) {
+ rows[0].hidden = false;
+ }
+ $.add($('tbody', section), rows);
+ boardSelect = $('#archive-board-select', section);
+ $.add(boardSelect, boardOptions);
+ table = $('#archive-table', section);
+ $.on(boardSelect, 'change', function() {
+ $('tbody > :not([hidden])', table).hidden = true;
+ return $("tbody > ." + this.value, table).hidden = false;
+ });
+ $.get('selectedArchives', Conf['selectedArchives'], function(arg) {
+ var data, id, select, selectedArchives, type;
+ selectedArchives = arg.selectedArchives;
+ for (boardID in selectedArchives) {
+ data = selectedArchives[boardID];
+ for (type in data) {
+ id = data[type];
+ if (select = $("select[data-boardid='" + boardID + "'][data-type='" + type + "']", section)) {
+ select.value = JSON.stringify(id);
+ }
+ }
+ }
+ });
+ },
+ addArchiveCell: function(boardID, data, type) {
+ var archive, i, length, options, select, td;
+ length = data[type].length;
+ td = $.el('td', {
+ className: 'archive-cell'
+ });
+ if (!length) {
+ td.textContent = '--';
+ return td;
+ }
+ options = [];
+ i = 0;
+ while (i < length) {
+ archive = data[type][i++];
+ options.push($.el('option', {
+ value: JSON.stringify(archive[0]),
+ textContent: archive[1]
+ }));
+ }
+ $.extend(td, {
+ innerHTML: "
"
+ });
+ select = td.firstElementChild;
+ if (!(select.disabled = length === 1)) {
+ select.setAttribute('data-boardid', boardID);
+ select.setAttribute('data-type', type);
+ $.on(select, 'change', Settings.saveSelectedArchive);
+ }
+ $.add(select, options);
+ return td;
+ },
+ saveSelectedArchive: function() {
+ return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) {
+ return function(arg) {
+ var name1, selectedArchives;
+ selectedArchives = arg.selectedArchives;
+ (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = {}))[_this.dataset.type] = JSON.parse(_this.value);
+ return $.set('selectedArchives', selectedArchives);
+ };
+ })(this));
+ },
+ boardnav: function() {
+ return Header.generateBoardList(this.value);
+ },
+ time: function() {
+ return this.nextElementSibling.textContent = Time.format(this.value, new Date());
+ },
+ backlink: function() {
+ return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) {
+ return {
+ '%id': '123456789',
+ '%%': '%'
+ }[x];
+ });
+ },
+ fileInfo: function() {
+ var data;
+ data = {
+ isReply: true,
+ file: {
+ url: '//i.4cdn.org/g/1334437723720.jpg',
+ name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg',
+ size: '276 KB',
+ sizeInBytes: 276 * 1024,
+ dimensions: '1280x720',
+ isImage: true,
+ isVideo: false,
+ isSpoiler: true,
+ tag: 'Loop'
+ }
+ };
+ return FileInfo.format(this.value, data, this.nextElementSibling);
+ },
+ favicon: function() {
+ var img;
+ Favicon["switch"]();
+ if (g.VIEW === 'thread' && Conf['Unread Favicon']) {
+ Unread.update();
+ }
+ img = this.nextElementSibling.children;
+ img[0].src = Favicon["default"];
+ img[1].src = Favicon.unreadSFW;
+ img[2].src = Favicon.unreadNSFW;
+ return img[3].src = Favicon.unreadDead;
+ },
+ togglecss: function() {
+ if ($('textarea[name=usercss]', $.x('ancestor::fieldset[1]', this)).disabled = $.id('apply-css').disabled = !this.checked) {
+ CustomCSS.rmStyle();
+ } else {
+ CustomCSS.addStyle();
+ }
+ return $.cb.checked.call(this);
+ },
+ usercss: function() {
+ return CustomCSS.update();
+ },
+ keybinds: function(section) {
+ var arr, input, inputs, items, key, ref, tbody, tr;
+ $.extend(section, {
+ innerHTML: "
Keybinds are disabled.
Allowed keys: a-z , 0-9 , Ctrl , Shift , Alt , Meta , Enter , Esc , Up , Down , Right , Left .
Press Backspace to disable a keybind.
"
+ });
+ $('.warning', section).hidden = Conf['Keybinds'];
+ tbody = $('tbody', section);
+ items = {};
+ inputs = {};
+ ref = Config.hotkeys;
+ for (key in ref) {
+ arr = ref[key];
+ tr = $.el('tr', {
+ innerHTML: "
" + E(arr[1]) + " "
+ });
+ input = $('input', tr);
+ input.name = key;
+ input.spellcheck = false;
+ items[key] = Conf[key];
+ inputs[key] = input;
+ $.on(input, 'keydown', Settings.keybind);
+ $.add(tbody, tr);
+ }
+ return $.get(items, function(items) {
+ var val;
+ for (key in items) {
+ val = items[key];
+ inputs[key].value = val;
+ }
+ });
+ },
+ keybind: function(e) {
+ var key;
+ if (e.keyCode === 9) {
+ return;
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ if ((key = Keybinds.keyCode(e)) == null) {
+ return;
+ }
+ this.value = key;
+ return $.cb.value.call(this);
+ }
+ };
+
+ return Settings;
+
+}).call(this);
+
+UI = (function() {
+ var Menu, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ slice = [].slice;
+
+ dialog = function(id, position, properties) {
+ var child, el, i, len, move, ref;
+ el = $.el('div', {
+ className: 'dialog',
+ id: id
+ });
+ $.extend(el, properties);
+ el.style.cssText = position;
+ $.get(id + ".position", position, function(item) {
+ return el.style.cssText = item[id + ".position"];
+ });
+ move = $('.move', el);
+ $.on(move, 'touchstart mousedown', dragstart);
+ ref = move.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if (!child.tagName) {
+ continue;
+ }
+ $.on(child, 'touchstart mousedown', function(e) {
+ return e.stopPropagation();
+ });
+ }
+ return el;
+ };
+
+ Menu = (function() {
+ var currentMenu, lastToggledButton;
+
+ currentMenu = null;
+
+ lastToggledButton = null;
+
+ function Menu(type) {
+ this.type = type;
+ this.addEntry = bind(this.addEntry, this);
+ this.onFocus = bind(this.onFocus, this);
+ this.keybinds = bind(this.keybinds, this);
+ this.close = bind(this.close, this);
+ this.setPosition = bind(this.setPosition, this);
+ $.on(d, 'AddMenuEntry', (function(_this) {
+ return function(arg) {
+ var detail;
+ detail = arg.detail;
+ if (detail.type !== _this.type) {
+ return;
+ }
+ delete detail.open;
+ return _this.addEntry(detail);
+ };
+ })(this));
+ this.entries = [];
+ }
+
+ Menu.prototype.makeMenu = function() {
+ var menu;
+ menu = $.el('div', {
+ className: 'dialog',
+ id: 'menu',
+ tabIndex: 0
+ });
+ $.on(menu, 'click', function(e) {
+ return e.stopPropagation();
+ });
+ $.on(menu, 'keydown', this.keybinds);
+ return menu;
+ };
+
+ Menu.prototype.toggle = function(e, button, data) {
+ var previousButton;
+ e.preventDefault();
+ e.stopPropagation();
+ if (currentMenu) {
+ previousButton = lastToggledButton;
+ currentMenu.close();
+ if (previousButton === button) {
+ return;
+ }
+ }
+ if (!this.entries.length) {
+ return;
+ }
+ return this.open(button, data);
+ };
+
+ Menu.prototype.open = function(button, data) {
+ var entry, i, len, menu, ref;
+ menu = this.menu = this.makeMenu();
+ currentMenu = this;
+ lastToggledButton = button;
+ this.entries.sort(function(first, second) {
+ return first.order - second.order;
+ });
+ ref = this.entries;
+ for (i = 0, len = ref.length; i < len; i++) {
+ entry = ref[i];
+ this.insertEntry(entry, menu, data);
+ }
+ $.addClass(lastToggledButton, 'active');
+ $.on(d, 'click CloseMenu', this.close);
+ $.on(d, 'scroll', this.setPosition);
+ $.on(window, 'resize', this.setPosition);
+ $.add(button, menu);
+ this.setPosition();
+ entry = $('.entry', menu);
+ this.focus(entry);
+ return menu.focus();
+ };
+
+ Menu.prototype.setPosition = function() {
+ var bLeft, bRect, bTop, bottom, cHeight, cWidth, left, mRect, ref, ref1, right, top;
+ mRect = this.menu.getBoundingClientRect();
+ bRect = lastToggledButton.getBoundingClientRect();
+ bTop = window.scrollY + bRect.top;
+ bLeft = window.scrollX + bRect.left;
+ cHeight = doc.clientHeight;
+ cWidth = doc.clientWidth;
+ ref = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom + "px", ''] : ['', (cHeight - bRect.top) + "px"], top = ref[0], bottom = ref[1];
+ ref1 = bRect.left + mRect.width < cWidth ? [bRect.left + "px", ''] : ['', (cWidth - bRect.right) + "px"], left = ref1[0], right = ref1[1];
+ $.extend(this.menu.style, {
+ top: top,
+ right: right,
+ bottom: bottom,
+ left: left
+ });
+ return this.menu.classList.toggle('left', right);
+ };
+
+ Menu.prototype.insertEntry = function(entry, parent, data) {
+ var err, i, len, ref, subEntry, submenu;
+ if (typeof entry.open === 'function') {
+ try {
+ if (!entry.open(data)) {
+ return;
+ }
+ } catch (_error) {
+ err = _error;
+ Main.handleErrors({
+ message: "Error in building the " + this.type + " menu.",
+ error: err
+ });
+ return;
+ }
+ }
+ $.add(parent, entry.el);
+ if (!entry.subEntries) {
+ return;
+ }
+ if (submenu = $('.submenu', entry.el)) {
+ $.rm(submenu);
+ }
+ submenu = $.el('div', {
+ className: 'dialog submenu'
+ });
+ ref = entry.subEntries;
+ for (i = 0, len = ref.length; i < len; i++) {
+ subEntry = ref[i];
+ this.insertEntry(subEntry, submenu, data);
+ }
+ $.add(entry.el, submenu);
+ };
+
+ Menu.prototype.close = function() {
+ $.rm(this.menu);
+ delete this.menu;
+ $.rmClass(lastToggledButton, 'active');
+ currentMenu = null;
+ lastToggledButton = null;
+ $.off(d, 'click scroll CloseMenu', this.close);
+ $.off(d, 'scroll', this.setPosition);
+ return $.off(window, 'resize', this.setPosition);
+ };
+
+ Menu.prototype.findNextEntry = function(entry, direction) {
+ var entries;
+ entries = slice.call(entry.parentNode.children);
+ entries.sort(function(first, second) {
+ return first.style.order - second.style.order;
+ });
+ return entries[entries.indexOf(entry) + direction];
+ };
+
+ Menu.prototype.keybinds = function(e) {
+ var entry, next, nextPrev, subEntry, submenu;
+ entry = $('.focused', this.menu);
+ while (subEntry = $('.focused', entry)) {
+ entry = subEntry;
+ }
+ switch (e.keyCode) {
+ case 27:
+ lastToggledButton.focus();
+ this.close();
+ break;
+ case 13:
+ case 32:
+ entry.click();
+ break;
+ case 38:
+ if (next = this.findNextEntry(entry, -1)) {
+ this.focus(next);
+ }
+ break;
+ case 40:
+ if (next = this.findNextEntry(entry, +1)) {
+ this.focus(next);
+ }
+ break;
+ case 39:
+ if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) {
+ while (nextPrev = this.findNextEntry(next, -1)) {
+ next = nextPrev;
+ }
+ this.focus(next);
+ }
+ break;
+ case 37:
+ if (next = $.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) {
+ this.focus(next);
+ }
+ break;
+ default:
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ };
+
+ Menu.prototype.onFocus = function(e) {
+ e.stopPropagation();
+ return this.focus(e.target);
+ };
+
+ Menu.prototype.focus = function(entry) {
+ var bottom, cHeight, cWidth, eRect, focused, i, left, len, ref, ref1, ref2, right, sRect, style, submenu, top;
+ while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
+ $.rmClass(focused, 'focused');
+ }
+ ref = $$('.focused', entry);
+ for (i = 0, len = ref.length; i < len; i++) {
+ focused = ref[i];
+ $.rmClass(focused, 'focused');
+ }
+ $.addClass(entry, 'focused');
+ if (!(submenu = $('.submenu', entry))) {
+ return;
+ }
+ sRect = submenu.getBoundingClientRect();
+ eRect = entry.getBoundingClientRect();
+ cHeight = doc.clientHeight;
+ cWidth = doc.clientWidth;
+ ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1];
+ ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1];
+ style = submenu.style;
+ style.top = top;
+ style.bottom = bottom;
+ style.left = left;
+ return style.right = right;
+ };
+
+ Menu.prototype.addEntry = function(entry) {
+ this.parseEntry(entry);
+ return this.entries.push(entry);
+ };
+
+ Menu.prototype.parseEntry = function(entry) {
+ var el, i, len, subEntries, subEntry;
+ el = entry.el, subEntries = entry.subEntries;
+ $.addClass(el, 'entry');
+ $.on(el, 'focus mouseover', this.onFocus);
+ el.style.order = entry.order || 100;
+ if (!subEntries) {
+ return;
+ }
+ $.addClass(el, 'has-submenu');
+ for (i = 0, len = subEntries.length; i < len; i++) {
+ subEntry = subEntries[i];
+ this.parseEntry(subEntry);
+ }
+ };
+
+ return Menu;
+
+ })();
+
+ dragstart = function(e) {
+ var el, isTouching, o, rect, ref, screenHeight, screenWidth;
+ if (e.type === 'mousedown' && e.button !== 0) {
+ return;
+ }
+ e.preventDefault();
+ if (isTouching = e.type === 'touchstart') {
+ e = e.changedTouches[e.changedTouches.length - 1];
+ }
+ el = $.x('ancestor::div[contains(@class,"dialog")][1]', this);
+ rect = el.getBoundingClientRect();
+ screenHeight = doc.clientHeight;
+ screenWidth = doc.clientWidth;
+ o = {
+ id: el.id,
+ style: el.style,
+ dx: e.clientX - rect.left,
+ dy: e.clientY - rect.top,
+ height: screenHeight - rect.height,
+ width: screenWidth - rect.width,
+ screenHeight: screenHeight,
+ screenWidth: screenWidth,
+ isTouching: isTouching
+ };
+ ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1];
+ if (isTouching) {
+ o.identifier = e.identifier;
+ o.move = touchmove.bind(o);
+ o.up = touchend.bind(o);
+ $.on(d, 'touchmove', o.move);
+ return $.on(d, 'touchend touchcancel', o.up);
+ } else {
+ o.move = drag.bind(o);
+ o.up = dragend.bind(o);
+ $.on(d, 'mousemove', o.move);
+ return $.on(d, 'mouseup', o.up);
+ }
+ };
+
+ touchmove = function(e) {
+ var i, len, ref, touch;
+ ref = e.changedTouches;
+ for (i = 0, len = ref.length; i < len; i++) {
+ touch = ref[i];
+ if (touch.identifier === this.identifier) {
+ drag.call(this, touch);
+ return;
+ }
+ }
+ };
+
+ 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 + '%';
+ top = clientY - this.dy;
+ top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%';
+ right = left === null ? 0 : null;
+ bottom = top === null ? this.bottomBorder + 'px' : null;
+ style = this.style;
+ style.left = left;
+ style.right = right;
+ style.top = top;
+ return style.bottom = bottom;
+ };
+
+ touchend = function(e) {
+ var i, len, ref, touch;
+ ref = e.changedTouches;
+ for (i = 0, len = ref.length; i < len; i++) {
+ touch = ref[i];
+ if (touch.identifier === this.identifier) {
+ dragend.call(this);
+ return;
+ }
+ }
+ };
+
+ dragend = function() {
+ if (this.isTouching) {
+ $.off(d, 'touchmove', this.move);
+ $.off(d, 'touchend touchcancel', this.up);
+ } else {
+ $.off(d, 'mousemove', this.move);
+ $.off(d, 'mouseup', this.up);
+ }
+ return $.set(this.id + ".position", this.style.cssText);
+ };
+
+ hoverstart = function(arg) {
+ var cb, el, endEvents, height, latestEvent, noRemove, o, ref, root;
+ root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, height = arg.height, cb = arg.cb, noRemove = arg.noRemove;
+ o = {
+ root: root,
+ el: el,
+ style: el.style,
+ isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO',
+ cb: cb,
+ endEvents: endEvents,
+ latestEvent: latestEvent,
+ clientHeight: doc.clientHeight,
+ clientWidth: doc.clientWidth,
+ height: height,
+ noRemove: noRemove
+ };
+ o.hover = hover.bind(o);
+ o.hoverend = hoverend.bind(o);
+ o.hover(o.latestEvent);
+ new MutationObserver(function() {
+ if (el.parentNode) {
+ return o.hover(o.latestEvent);
+ }
+ }).observe(el, {
+ childList: true
+ });
+ $.on(root, endEvents, o.hoverend);
+ if ($.x('ancestor::div[contains(@class,"inline")][1]', root)) {
+ $.on(d, 'keydown', o.hoverend);
+ }
+ $.on(root, 'mousemove', o.hover);
+ o.workaround = function(e) {
+ if (!root.contains(e.target)) {
+ return o.hoverend(e);
+ }
+ };
+ return $.on(doc, 'mousemove', o.workaround);
+ };
+
+ hoverstart.padding = 25;
+
+ hover = function(e) {
+ var clientX, clientY, height, left, ref, right, style, threshold, top;
+ this.latestEvent = e;
+ height = (this.height || this.el.offsetHeight) + hoverstart.padding;
+ clientX = e.clientX, clientY = e.clientY;
+ top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120));
+ threshold = this.clientWidth / 2;
+ if (!this.isImage) {
+ threshold = Math.max(threshold, this.clientWidth - 400);
+ }
+ ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
+ style = this.style;
+ style.top = top + 'px';
+ style.left = left;
+ return style.right = right;
+ };
+
+ hoverend = function(e) {
+ if (e.type === 'keydown' && e.keyCode !== 13 || e.target.nodeName === "TEXTAREA") {
+ return;
+ }
+ if (!this.noRemove) {
+ $.rm(this.el);
+ }
+ $.off(this.root, this.endEvents, this.hoverend);
+ $.off(d, 'keydown', this.hoverend);
+ $.off(this.root, 'mousemove', this.hover);
+ $.off(doc, 'mousemove', this.workaround);
+ if (this.cb) {
+ return this.cb.call(this);
+ }
+ };
+
+ checkbox = function(name, text, checked) {
+ var input, label;
+ if (checked == null) {
+ checked = Conf[name];
+ }
+ label = $.el('label');
+ input = $.el('input', {
+ type: 'checkbox',
+ name: name,
+ checked: checked
+ });
+ $.add(label, [input, $.tn(" " + text)]);
+ return label;
+ };
+
+ return {
+ dialog: dialog,
+ Menu: Menu,
+ hover: hoverstart,
+ checkbox: checkbox
+ };
+
+}).call(this);
+
+FappeTyme = (function() {
+ var FappeTyme;
+
+ FappeTyme = {
+ init: function() {
+ var el, i, lc, len, ref, ref1, type;
+ if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread'))) {
+ return;
+ }
+ this.nodes = {};
+ this.enabled = {
+ fappe: false,
+ werk: Conf['werk']
+ };
+ ref1 = ["Fappe", "Werk"];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ type = ref1[i];
+ if (!Conf[type + " Tyme"]) {
+ continue;
+ }
+ lc = type.toLowerCase();
+ el = UI.checkbox(lc, type + " Tyme", false);
+ el.title = type + " Tyme";
+ this.nodes[lc] = el.firstElementChild;
+ if (Conf[lc]) {
+ this.set(lc, true);
+ }
+ $.on(this.nodes[lc], 'change', this.toggle.bind(this, lc));
+ Header.menu.addEntry({
+ el: el,
+ order: 97
+ });
+ }
+ if (Conf['Werk Tyme']) {
+ $.sync('werk', this.set.bind(this, 'werk'));
+ }
+ Callbacks.Post.push({
+ name: 'Fappe Tyme',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Werk Tyme',
+ cb: this.catalogNode
+ });
+ },
+ node: function() {
+ return this.nodes.root.classList.toggle('noFile', !this.file);
+ },
+ catalogNode: function() {
+ var file, filename;
+ file = this.thread.OP.file;
+ if (!file) {
+ return;
+ }
+ filename = $.el('div', {
+ textContent: file.name,
+ className: 'werkTyme-filename'
+ });
+ return $.add(this.nodes.thumb.parentNode, filename);
+ },
+ set: function(type, enabled) {
+ this.enabled[type] = this.nodes[type].checked = enabled;
+ return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme");
+ },
+ toggle: function(type) {
+ this.set(type, !this.enabled[type]);
+ if (type === 'werk') {
+ return $.cb.checked.call(this.nodes[type]);
+ }
+ }
+ };
+
+ return FappeTyme;
+
+}).call(this);
+
+Gallery = (function() {
+ var Gallery;
+
+ Gallery = {
+ init: function() {
+ var el, ref;
+ if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ this.delay = Conf['Slide Delay'];
+ el = $.el('a', {
+ href: 'javascript:;',
+ id: 'appchan-gal',
+ title: 'Gallery',
+ className: 'fa fa-picture-o',
+ textContent: 'Gallery'
+ });
+ $.on(el, 'click', this.cb.toggle);
+ Header.addShortcut(el);
+ return Callbacks.Post.push({
+ name: 'Gallery',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var ref;
+ if (!((ref = this.file) != null ? ref.thumb : void 0)) {
+ return;
+ }
+ if (Gallery.nodes) {
+ Gallery.generateThumb(this);
+ Gallery.nodes.total.textContent = Gallery.images.length;
+ }
+ if (!Conf['Image Expansion']) {
+ return $.on(this.file.thumb.parentNode, 'click', Gallery.cb.image);
+ }
+ },
+ build: function(image) {
+ var candidate, cb, dialog, entry, file, i, j, key, len, len1, menuButton, nodes, post, ref, ref1, ref2, ref3, thumb, value;
+ cb = Gallery.cb;
+ if (Conf['Fullscreen Gallery']) {
+ $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
+ return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
+ });
+ if (typeof doc.mozRequestFullScreen === "function") {
+ doc.mozRequestFullScreen();
+ }
+ if (typeof doc.webkitRequestFullScreen === "function") {
+ doc.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
+ }
+ }
+ Gallery.images = [];
+ nodes = Gallery.nodes = {};
+ Gallery.fullIDs = {};
+ Gallery.slideshow = false;
+ nodes.el = dialog = $.el('div', {
+ id: 'a-gallery'
+ });
+ $.extend(dialog, {
+ innerHTML: "
"
+ });
+ ref = {
+ buttons: '.gal-buttons',
+ frame: '.gal-image',
+ name: '.gal-name',
+ count: '.count',
+ total: '.total',
+ thumbs: '.gal-thumbnails',
+ next: '.gal-image a',
+ current: '.gal-image img'
+ };
+ for (key in ref) {
+ value = ref[key];
+ nodes[key] = $(value, dialog);
+ }
+ menuButton = $('.menu-button', dialog);
+ nodes.menu = new UI.Menu('gallery');
+ $.on(nodes.frame, 'click', cb.blank);
+ if (Conf['Mouse Wheel Volume']) {
+ $.on(nodes.frame, 'wheel', Volume.wheel);
+ }
+ $.on(nodes.next, 'click', cb.click);
+ $.on(nodes.name, 'click', ImageCommon.download);
+ $.on($('.gal-prev', dialog), 'click', cb.prev);
+ $.on($('.gal-next', dialog), 'click', cb.next);
+ $.on($('.gal-start', dialog), 'click', cb.start);
+ $.on($('.gal-stop', dialog), 'click', cb.stop);
+ $.on($('.gal-close', dialog), 'click', cb.close);
+ $.on(menuButton, 'click', function(e) {
+ return nodes.menu.toggle(e, this, g);
+ });
+ ref1 = Gallery.menu.createSubEntries();
+ for (i = 0, len = ref1.length; i < len; i++) {
+ entry = ref1[i];
+ entry.order = 0;
+ nodes.menu.addEntry(entry);
+ }
+ $.on(d, 'keydown', cb.keybinds);
+ if (Conf['Keybinds']) {
+ $.off(d, 'keydown', Keybinds.keydown);
+ }
+ $.on(window, 'resize', Gallery.cb.setHeight);
+ ref2 = $$('.post .file');
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ file = ref2[j];
+ post = Get.postFromNode(file);
+ if (!((ref3 = post.file) != null ? ref3.thumb : void 0)) {
+ continue;
+ }
+ Gallery.generateThumb(post);
+ if (!image && Gallery.fullIDs[post.fullID]) {
+ candidate = post.file.thumb.parentNode;
+ if (Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0) {
+ image = candidate;
+ }
+ }
+ }
+ $.addClass(doc, 'gallery-open');
+ $.add(d.body, dialog);
+ nodes.thumbs.scrollTop = 0;
+ nodes.current.parentElement.scrollTop = 0;
+ if (image) {
+ thumb = $("[href='" + image.href + "']", nodes.thumbs);
+ }
+ thumb || (thumb = Gallery.images[Gallery.images.length - 1]);
+ if (thumb) {
+ Gallery.open(thumb);
+ }
+ doc.style.overflow = 'hidden';
+ return nodes.total.textContent = Gallery.images.length;
+ },
+ generateThumb: function(post) {
+ var thumb, thumbImg;
+ if (post.isClone || post.isHidden) {
+ return;
+ }
+ if (!(post.file && post.file.thumb && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
+ return;
+ }
+ if (Gallery.fullIDs[post.fullID]) {
+ return;
+ }
+ Gallery.fullIDs[post.fullID] = true;
+ thumb = $.el('a', {
+ className: 'gal-thumb',
+ href: post.file.url,
+ target: '_blank',
+ title: post.file.name
+ });
+ thumb.dataset.id = Gallery.images.length;
+ thumb.dataset.post = post.fullID;
+ thumbImg = post.file.thumb.cloneNode(false);
+ thumbImg.style.cssText = '';
+ $.add(thumb, thumbImg);
+ $.on(thumb, 'click', Gallery.cb.open);
+ Gallery.images.push(thumb);
+ return $.add(Gallery.nodes.thumbs, thumb);
+ },
+ load: function(thumb, errorCB) {
+ var elType, ext, file;
+ ext = thumb.href.match(/\w*$/);
+ elType = {
+ 'webm': 'video',
+ 'pdf': 'iframe'
+ }[ext] || 'img';
+ file = $.el(elType, {
+ title: thumb.title
+ });
+ $.extend(file.dataset, thumb.dataset);
+ $.on(file, 'error', errorCB);
+ file.src = thumb.href;
+ return file;
+ },
+ open: function(thumb) {
+ var el, file, newID, nodes, oldID, post, ref;
+ nodes = Gallery.nodes;
+ oldID = +nodes.current.dataset.id;
+ newID = +thumb.dataset.id;
+ if (el = Gallery.images[oldID]) {
+ $.rmClass(el, 'gal-highlight');
+ }
+ $.addClass(thumb, 'gal-highlight');
+ nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
+ if (((ref = Gallery.cache) != null ? ref.dataset.id : void 0) === '' + newID) {
+ file = Gallery.cache;
+ $.off(file, 'error', Gallery.cacheError);
+ $.on(file, 'error', Gallery.error);
+ } else {
+ file = Gallery.load(thumb, Gallery.error);
+ }
+ $.off(nodes.current, 'error', Gallery.error);
+ ImageCommon.pause(nodes.current);
+ $.replace(nodes.current, file);
+ nodes.current = file;
+ if (file.nodeName === 'VIDEO') {
+ file.loop = true;
+ Volume.setup(file);
+ if (Conf['Autoplay']) {
+ file.play();
+ }
+ if (Conf['Show Controls']) {
+ ImageCommon.addControls(file);
+ }
+ }
+ doc.classList.toggle('gal-pdf', file.nodeName === 'IFRAME');
+ Gallery.cb.setHeight();
+ nodes.count.textContent = +thumb.dataset.id + 1;
+ nodes.name.download = nodes.name.textContent = thumb.title;
+ nodes.name.href = thumb.href;
+ nodes.frame.scrollTop = 0;
+ nodes.next.focus();
+ if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) {
+ Gallery.setupTimer();
+ } else {
+ Gallery.cb.stop();
+ }
+ if (Conf['Scroll to Post'] && (post = g.posts[file.dataset.post])) {
+ Header.scrollTo(post.nodes.root);
+ }
+ if (isNaN(oldID) || newID === (oldID + 1) % Gallery.images.length) {
+ return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError);
+ }
+ },
+ error: function() {
+ var ref;
+ if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
+ return new Notice('error', 'Corrupt or unplayable video', 30);
+ }
+ if (this.src.split('/')[2] !== 'i.4cdn.org') {
+ return;
+ }
+ return ImageCommon.error(this, g.posts[this.dataset.post], null, (function(_this) {
+ return function(url) {
+ if (!url) {
+ return;
+ }
+ Gallery.images[_this.dataset.id].href = url;
+ if (Gallery.nodes.current === _this) {
+ return _this.src = url;
+ }
+ };
+ })(this));
+ },
+ cacheError: function() {
+ return delete Gallery.cache;
+ },
+ cleanupTimer: function() {
+ var current;
+ clearTimeout(Gallery.timeoutID);
+ current = Gallery.nodes.current;
+ $.off(current, 'canplaythrough load', Gallery.startTimer);
+ return $.off(current, 'ended', Gallery.cb.next);
+ },
+ startTimer: function() {
+ return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * $.SECOND);
+ },
+ setupTimer: function() {
+ var current, isVideo;
+ Gallery.cleanupTimer();
+ current = Gallery.nodes.current;
+ isVideo = current.nodeName === 'VIDEO';
+ if (isVideo) {
+ current.play();
+ }
+ if ((isVideo ? current.readyState >= 4 : current.complete) || current.nodeName === 'IFRAME') {
+ return Gallery.startTimer();
+ } else {
+ return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer);
+ }
+ },
+ checkTimer: function() {
+ var current;
+ current = Gallery.nodes.current;
+ if (current.nodeName === 'VIDEO' && !current.paused) {
+ $.on(current, 'ended', Gallery.cb.next);
+ return current.loop = false;
+ } else {
+ return Gallery.cb.next();
+ }
+ },
+ cb: {
+ keybinds: function(e) {
+ var cb, key;
+ if (!(key = Keybinds.keyCode(e))) {
+ return;
+ }
+ cb = (function() {
+ switch (key) {
+ case Conf['Close']:
+ case Conf['Open Gallery']:
+ return Gallery.cb.close;
+ case 'Right':
+ return Gallery.cb.next;
+ case 'Enter':
+ return Gallery.cb.advance;
+ case 'Left':
+ case '':
+ return Gallery.cb.prev;
+ case Conf['Pause']:
+ return Gallery.cb.pause;
+ case Conf['Slideshow']:
+ return Gallery.cb.toggleSlideshow;
+ }
+ })();
+ if (!cb) {
+ return;
+ }
+ e.stopPropagation();
+ e.preventDefault();
+ return cb();
+ },
+ open: function(e) {
+ if (e) {
+ e.preventDefault();
+ }
+ if (this) {
+ return Gallery.open(this);
+ }
+ },
+ image: function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ return Gallery.build(this);
+ },
+ prev: function() {
+ return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]);
+ },
+ next: function() {
+ return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]);
+ },
+ click: function(e) {
+ if (ImageCommon.onControls(e)) {
+ return;
+ }
+ e.preventDefault();
+ return Gallery.cb.advance();
+ },
+ advance: function() {
+ if (!Conf['Autoplay'] && Gallery.nodes.current.paused) {
+ return Gallery.nodes.current.play();
+ } else {
+ return Gallery.cb.next();
+ }
+ },
+ toggle: function() {
+ return (Gallery.nodes ? Gallery.cb.close : Gallery.build)();
+ },
+ blank: function(e) {
+ if (e.target === this) {
+ return Gallery.cb.close();
+ }
+ },
+ toggleSlideshow: function() {
+ return Gallery.cb[Gallery.slideshow ? 'stop' : 'start']();
+ },
+ pause: function() {
+ var current;
+ Gallery.cb.stop();
+ current = Gallery.nodes.current;
+ if (current.nodeName === 'VIDEO') {
+ return current[current.paused ? 'play' : 'pause']();
+ }
+ },
+ start: function() {
+ $.addClass(Gallery.nodes.buttons, 'gal-playing');
+ Gallery.slideshow = true;
+ return Gallery.setupTimer();
+ },
+ stop: function() {
+ var current;
+ if (!Gallery.slideshow) {
+ return;
+ }
+ Gallery.cleanupTimer();
+ current = Gallery.nodes.current;
+ if (current.nodeName === 'VIDEO') {
+ current.loop = true;
+ }
+ $.rmClass(Gallery.nodes.buttons, 'gal-playing');
+ return Gallery.slideshow = false;
+ },
+ close: function() {
+ $.off(Gallery.nodes.current, 'error', Gallery.error);
+ ImageCommon.pause(Gallery.nodes.current);
+ $.rm(Gallery.nodes.el);
+ $.rmClass(doc, 'gallery-open');
+ if (Conf['Fullscreen Gallery']) {
+ $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close);
+ if (typeof d.mozCancelFullScreen === "function") {
+ d.mozCancelFullScreen();
+ }
+ if (typeof d.webkitExitFullscreen === "function") {
+ d.webkitExitFullscreen();
+ }
+ }
+ delete Gallery.nodes;
+ delete Gallery.fullIDs;
+ doc.style.overflow = '';
+ $.off(d, 'keydown', Gallery.cb.keybinds);
+ if (Conf['Keybinds']) {
+ $.on(d, 'keydown', Keybinds.keydown);
+ }
+ $.off(window, 'resize', Gallery.cb.setHeight);
+ return clearTimeout(Gallery.timeoutID);
+ },
+ setFitness: function() {
+ return (this.checked ? $.addClass : $.rmClass)(doc, "gal-" + (this.name.toLowerCase().replace(/\s+/g, '-')));
+ },
+ setHeight: $.debounce(100, function() {
+ var current, dim, frame, height, minHeight, ref, ref1, ref2, style, width;
+ ref = Gallery.nodes, current = ref.current, frame = ref.frame;
+ style = current.style;
+ if (Conf['Stretch to Fit'] && (dim = (ref1 = g.posts[current.dataset.post]) != null ? ref1.file.dimensions : void 0)) {
+ ref2 = dim.split('x'), width = ref2[0], height = ref2[1];
+ minHeight = Math.min(doc.clientHeight - 25, height / width * frame.clientWidth);
+ style.minHeight = minHeight + 'px';
+ return style.minWidth = (width / height * minHeight) + 'px';
+ } else {
+ return style.minHeight = style.minWidth = null;
+ }
+ }),
+ setDelay: function() {
+ return Gallery.delay = +this.value;
+ }
+ },
+ menu: {
+ init: function() {
+ var el;
+ if (!Gallery.enabled) {
+ return;
+ }
+ el = $.el('span', {
+ textContent: 'Gallery',
+ className: 'gallery-link'
+ });
+ return Header.menu.addEntry({
+ el: el,
+ order: 105,
+ subEntries: Gallery.menu.createSubEntries()
+ });
+ },
+ createSubEntry: function(name) {
+ var input, label;
+ label = UI.checkbox(name, name);
+ input = label.firstElementChild;
+ if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height') {
+ $.on(input, 'change', Gallery.cb.setFitness);
+ }
+ $.event('change', null, input);
+ $.on(input, 'change', $.cb.checked);
+ if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height' || name === 'Stretch to Fit') {
+ $.on(input, 'change', Gallery.cb.setHeight);
+ }
+ return {
+ el: label
+ };
+ },
+ createSubEntries: function() {
+ var delayInput, delayLabel, item, subEntries;
+ subEntries = (function() {
+ var i, len, ref, results;
+ ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'];
+ results = [];
+ for (i = 0, len = ref.length; i < len; i++) {
+ item = ref[i];
+ results.push(Gallery.menu.createSubEntry(item));
+ }
+ return results;
+ })();
+ delayLabel = $.el('label', {
+ innerHTML: "Slide Delay:
"
+ });
+ delayInput = delayLabel.firstElementChild;
+ delayInput.value = Gallery.delay;
+ $.on(delayInput, 'change', Gallery.cb.setDelay);
+ $.on(delayInput, 'change', $.cb.value);
+ subEntries.push({
+ el: delayLabel
+ });
+ return subEntries;
+ }
+ }
+ };
+
+ return Gallery;
+
+}).call(this);
+
+ImageCommon = (function() {
+ var ImageCommon;
+
+ ImageCommon = {
+ pause: function(video) {
+ if (video.nodeName !== 'VIDEO') {
+ return;
+ }
+ video.pause();
+ $.off(video, 'volumechange', Volume.change);
+ return video.muted = true;
+ },
+ rewind: function(el) {
+ if (el.nodeName === 'VIDEO') {
+ if (el.readyState >= el.HAVE_METADATA) {
+ return el.currentTime = 0;
+ }
+ } else if (/\.gif$/.test(el.src)) {
+ return $.queueTask(function() {
+ return el.src = el.src;
+ });
+ }
+ },
+ pushCache: function(el) {
+ ImageCommon.cache = el;
+ return $.on(el, 'error', ImageCommon.cacheError);
+ },
+ popCache: function() {
+ var el;
+ el = ImageCommon.cache;
+ $.off(el, 'error', ImageCommon.cacheError);
+ delete ImageCommon.cache;
+ return el;
+ },
+ cacheError: function() {
+ if (ImageCommon.cache === this) {
+ return delete ImageCommon.cache;
+ }
+ },
+ decodeError: function(file, post) {
+ var message, ref;
+ if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
+ return false;
+ }
+ if (!(message = $('.warning', post.file.thumb.parentNode))) {
+ message = $.el('div', {
+ className: 'warning'
+ });
+ $.after(post.file.thumb, message);
+ }
+ message.textContent = 'Error: Corrupt or unplayable video';
+ return true;
+ },
+ error: function(file, post, delay, cb) {
+ var URL, redirect, src, timeoutID;
+ src = post.file.url.split('/');
+ URL = Redirect.to('file', {
+ boardID: post.board.ID,
+ filename: src[src.length - 1]
+ });
+ if (!(Conf['404 Redirect'] && URL && Redirect.securityCheck(URL))) {
+ URL = null;
+ }
+ if ((post.isDead || post.file.isDead) && file.src.split('/')[2] === 'i.4cdn.org') {
+ return cb(URL);
+ }
+ if (delay != null) {
+ timeoutID = setTimeout((function() {
+ return cb(URL);
+ }), delay);
+ }
+ if (post.isDead || post.file.isDead) {
+ return;
+ }
+ redirect = function() {
+ if (file.src.split('/')[2] === 'i.4cdn.org') {
+ if (delay != null) {
+ clearTimeout(timeoutID);
+ }
+ return cb(URL);
+ }
+ };
+ return $.ajax("//a.4cdn.org/" + post.board + "/thread/" + post.thread + ".json", {
+ onload: function() {
+ var i, len, postObj, ref;
+ if (this.status === 404) {
+ post.kill(!post.isClone);
+ }
+ if (this.status !== 200) {
+ return redirect();
+ }
+ ref = this.response.posts;
+ for (i = 0, len = ref.length; i < len; i++) {
+ postObj = ref[i];
+ if (postObj.no === post.ID) {
+ break;
+ }
+ }
+ if (postObj.no !== post.ID) {
+ post.kill();
+ return redirect();
+ } else if (postObj.filedeleted) {
+ post.kill(true);
+ return redirect();
+ } else {
+ return URL = post.file.url;
+ }
+ }
+ });
+ },
+ addControls: function(video) {
+ var handler;
+ handler = function() {
+ var t;
+ $.off(video, 'mouseover', handler);
+ t = new Date().getTime();
+ return $.asap((function() {
+ return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000;
+ }), function() {
+ return video.controls = true;
+ });
+ };
+ return $.on(video, 'mouseover', handler);
+ },
+ onControls: function(e) {
+ return (Conf['Show Controls'] && Conf['Click Passthrough'] && e.target.nodeName === 'VIDEO') || (e.target.controls && e.target.getBoundingClientRect().bottom - e.clientY < 35);
+ },
+ download: function(e) {
+ if (this.protocol === 'blob:') {
+ return true;
+ }
+ e.preventDefault();
+ return CrossOrigin.file(this.href, (function(_this) {
+ return function(blob) {
+ if (blob) {
+ _this.href = URL.createObjectURL(blob);
+ return _this.click();
+ } else {
+ return new Notice('error', "Could not download " + _this.href, 30);
+ }
+ };
+ })(this));
+ }
+ };
+
+ return ImageCommon;
+
+}).call(this);
+
+ImageExpand = (function() {
+ var ImageExpand,
+ slice = [].slice;
+
+ ImageExpand = {
+ init: function() {
+ var ref;
+ if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ this.EAI = $.el('a', {
+ className: 'expand-all-shortcut fa fa-expand',
+ textContent: 'EAI',
+ title: 'Expand All Images',
+ href: 'javascript:;'
+ });
+ $.on(this.EAI, 'click', this.cb.toggleAll);
+ Header.addShortcut(this.EAI, 3);
+ $.on(d, 'scroll visibilitychange', this.cb.playVideos);
+ this.videoControls = $.el('span', {
+ className: 'video-controls'
+ });
+ $.extend(this.videoControls, {
+ innerHTML: "Â
contract "
+ });
+ return Callbacks.Post.push({
+ name: 'Image Expansion',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var ref;
+ if (!(this.file && (this.file.isImage || this.file.isVideo))) {
+ return;
+ }
+ $.on(this.file.thumb.parentNode, 'click', ImageExpand.cb.toggle);
+ if (this.isClone) {
+ if (this.file.isExpanding) {
+ ImageExpand.contract(this);
+ return ImageExpand.expand(this);
+ } else if (this.file.isExpanded && this.file.isVideo) {
+ Volume.setup(this.file.fullImage);
+ ImageExpand.setupVideoCB(this);
+ return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
+ }
+ } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) {
+ return ImageExpand.expand(this);
+ }
+ },
+ cb: {
+ toggle: function(e) {
+ var file, post, ref;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ post = Get.postFromNode(this);
+ file = post.file;
+ if (file.isExpanded && ImageCommon.onControls(e)) {
+ return;
+ }
+ e.preventDefault();
+ if (!Conf['Autoplay'] && ((ref = file.fullImage) != null ? ref.paused : void 0)) {
+ return file.fullImage.play();
+ } else {
+ return ImageExpand.toggle(post);
+ }
+ },
+ toggleAll: function() {
+ var func, toggle;
+ $.event('CloseMenu');
+ toggle = function(post) {
+ var file;
+ file = post.file;
+ if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
+ return;
+ }
+ if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || !Conf['Expand videos'] && file.isVideo || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
+ return;
+ }
+ return $.queueTask(func, post);
+ };
+ if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) {
+ ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress';
+ ImageExpand.EAI.title = 'Contract All Images';
+ func = ImageExpand.expand;
+ } else {
+ ImageExpand.EAI.className = 'expand-all-shortcut fa fa-expand';
+ ImageExpand.EAI.title = 'Expand All Images';
+ func = ImageExpand.contract;
+ }
+ return g.posts.forEach(function(post) {
+ var i, len, ref;
+ ref = [post].concat(slice.call(post.clones));
+ for (i = 0, len = ref.length; i < len; i++) {
+ post = ref[i];
+ toggle(post);
+ }
+ });
+ },
+ playVideos: function() {
+ return g.posts.forEach(function(post) {
+ var file, i, len, ref, video, visible;
+ ref = [post].concat(slice.call(post.clones));
+ for (i = 0, len = ref.length; i < len; i++) {
+ post = ref[i];
+ file = post.file;
+ if (!(file && file.isVideo && file.isExpanded)) {
+ continue;
+ }
+ video = file.fullImage;
+ visible = ($.hasAudio(video) && !video.muted) || Header.isNodeVisible(video);
+ if (visible && file.wasPlaying) {
+ delete file.wasPlaying;
+ video.play();
+ } else if (!visible && !video.paused) {
+ file.wasPlaying = true;
+ video.pause();
+ }
+ }
+ });
+ },
+ setFitness: function() {
+ return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\s+/g, '-'));
+ }
+ },
+ toggle: function(post) {
+ var next;
+ if (!(post.file.isExpanding || post.file.isExpanded)) {
+ post.file.scrollIntoView = Conf['Scroll into view'];
+ ImageExpand.expand(post);
+ return;
+ }
+ ImageExpand.contract(post);
+ if (Conf['Advance on contract']) {
+ next = post.nodes.root;
+ while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
+ if (!($('.stub', next) || next.offsetHeight === 0)) {
+ break;
+ }
+ }
+ if (next) {
+ return Header.scrollTo(next);
+ }
+ }
+ },
+ contract: function(post) {
+ var bottom, cb, el, eventName, file, i, len, oldHeight, ref, ref1, scrollY, top, x;
+ file = post.file;
+ if (el = file.fullImage) {
+ top = Header.getTopOf(el);
+ bottom = top + el.getBoundingClientRect().height;
+ oldHeight = d.body.clientHeight;
+ scrollY = window.scrollY;
+ }
+ $.rmClass(post.nodes.root, 'expanded-image');
+ $.rmClass(file.thumb, 'expanding');
+ $.rm(file.videoControls);
+ file.thumb.parentNode.href = file.url;
+ file.thumb.parentNode.target = '_blank';
+ ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ x = ref[i];
+ delete file[x];
+ }
+ if (!el) {
+ return;
+ }
+ if (doc.contains(el)) {
+ if (bottom <= 0) {
+ window.scroll(0, scrollY + d.body.clientHeight - oldHeight);
+ } else {
+ Header.scrollToIfNeeded(post.nodes.root);
+ }
+ if (window.scrollX > 0) {
+ window.scroll(0, window.scrollY);
+ }
+ }
+ $.off(el, 'error', ImageExpand.error);
+ ImageCommon.pushCache(el);
+ if (file.isVideo) {
+ ImageCommon.pause(el);
+ ref1 = ImageExpand.videoCB;
+ for (eventName in ref1) {
+ cb = ref1[eventName];
+ $.off(el, eventName, cb);
+ }
+ }
+ if (Conf['Restart when Opened']) {
+ ImageCommon.rewind(file.thumb);
+ }
+ delete file.fullImage;
+ return $.queueTask(function() {
+ if (file.isExpanding || file.isExpanded) {
+ return;
+ }
+ $.rmClass(el, 'full-image');
+ if (el.id) {
+ return;
+ }
+ return $.rm(el);
+ });
+ },
+ expand: function(post, src) {
+ var el, file, isVideo, ref, thumb;
+ file = post.file;
+ thumb = file.thumb, isVideo = file.isVideo;
+ if (post.isHidden || file.isExpanding || file.isExpanded) {
+ return;
+ }
+ $.addClass(thumb, 'expanding');
+ file.isExpanding = true;
+ if (file.fullImage) {
+ el = file.fullImage;
+ } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
+ el = file.fullImage = ImageCommon.popCache();
+ $.on(el, 'error', ImageExpand.error);
+ if (Conf['Restart when Opened'] && el.id !== 'ihover') {
+ ImageCommon.rewind(el);
+ }
+ el.removeAttribute('id');
+ } else {
+ el = file.fullImage = $.el((isVideo ? 'video' : 'img'));
+ el.dataset.fullID = post.fullID;
+ $.on(el, 'error', ImageExpand.error);
+ el.src = src || file.url;
+ }
+ el.className = 'full-image';
+ $.after(thumb, el);
+ if (isVideo) {
+ if (Conf['Show Controls'] && Conf['Click Passthrough'] && !file.videoControls) {
+ file.videoControls = ImageExpand.videoControls.cloneNode(true);
+ $.add(file.text, file.videoControls);
+ }
+ thumb.parentNode.removeAttribute('href');
+ thumb.parentNode.removeAttribute('target');
+ el.loop = true;
+ Volume.setup(el);
+ ImageExpand.setupVideoCB(post);
+ }
+ if (!isVideo) {
+ return $.asap((function() {
+ return el.naturalHeight;
+ }), function() {
+ return ImageExpand.completeExpand(post);
+ });
+ } else if (el.readyState >= el.HAVE_METADATA) {
+ return ImageExpand.completeExpand(post);
+ } else {
+ return $.on(el, 'loadedmetadata', function() {
+ return ImageExpand.completeExpand(post);
+ });
+ }
+ },
+ completeExpand: function(post) {
+ var bottom, file, imageBottom, oldHeight, scrollY;
+ file = post.file;
+ if (!file.isExpanding) {
+ return;
+ }
+ bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height;
+ oldHeight = d.body.clientHeight;
+ scrollY = window.scrollY;
+ $.addClass(post.nodes.root, 'expanded-image');
+ $.rmClass(file.thumb, 'expanding');
+ file.isExpanded = true;
+ delete file.isExpanding;
+ if (doc.contains(post.nodes.root) && bottom <= 0) {
+ window.scroll(window.scrollX, scrollY + d.body.clientHeight - oldHeight);
+ }
+ if (file.scrollIntoView) {
+ delete file.scrollIntoView;
+ imageBottom = Math.min(doc.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header.getBottomOf(file.fullImage));
+ if (imageBottom < 0) {
+ window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage)));
+ }
+ }
+ if (file.isVideo) {
+ return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']);
+ }
+ },
+ setupVideo: function(post, playing, controls) {
+ var fullImage;
+ fullImage = post.file.fullImage;
+ if (!playing) {
+ fullImage.controls = controls;
+ return;
+ }
+ fullImage.controls = false;
+ $.asap((function() {
+ return doc.contains(fullImage);
+ }), function() {
+ if (!d.hidden && Header.isNodeVisible(fullImage)) {
+ return fullImage.play();
+ } else {
+ return post.file.wasPlaying = true;
+ }
+ });
+ if (controls) {
+ return ImageCommon.addControls(fullImage);
+ }
+ },
+ videoCB: (function() {
+ var mousedown;
+ mousedown = false;
+ return {
+ mouseover: function() {
+ return mousedown = false;
+ },
+ mousedown: function(e) {
+ if (e.button === 0) {
+ return mousedown = true;
+ }
+ },
+ mouseup: function(e) {
+ if (e.button === 0) {
+ return mousedown = false;
+ }
+ },
+ mouseout: function(e) {
+ if (mousedown && e.clientX <= this.getBoundingClientRect().left) {
+ return ImageExpand.toggle(Get.postFromNode(this));
+ }
+ }
+ };
+ })(),
+ setupVideoCB: function(post) {
+ var cb, eventName, ref;
+ ref = ImageExpand.videoCB;
+ for (eventName in ref) {
+ cb = ref[eventName];
+ $.on(post.file.fullImage, eventName, cb);
+ }
+ if (post.file.videoControls) {
+ return $.on(post.file.videoControls.firstElementChild, 'click', function() {
+ return ImageExpand.toggle(post);
+ });
+ }
+ },
+ error: function() {
+ var post;
+ post = Get.postFromNode(this);
+ $.rm(this);
+ delete post.file.fullImage;
+ if (!(post.file.isExpanding || post.file.isExpanded)) {
+ return;
+ }
+ if (ImageCommon.decodeError(this, post)) {
+ return ImageExpand.contract(post);
+ }
+ if (this.src.split('/')[2] !== 'i.4cdn.org') {
+ return ImageExpand.contract(post);
+ }
+ return ImageCommon.error(this, post, 10 * $.SECOND, function(URL) {
+ if (post.file.isExpanding || post.file.isExpanded) {
+ ImageExpand.contract(post);
+ if (URL) {
+ return ImageExpand.expand(post, URL);
+ }
+ }
+ });
+ },
+ menu: {
+ init: function() {
+ var conf, createSubEntry, el, name, ref, subEntries;
+ if (!ImageExpand.enabled) {
+ return;
+ }
+ el = $.el('span', {
+ textContent: 'Image Expansion',
+ className: 'image-expansion-link'
+ });
+ createSubEntry = ImageExpand.menu.createSubEntry;
+ subEntries = [];
+ ref = Config.imageExpansion;
+ for (name in ref) {
+ conf = ref[name];
+ subEntries.push(createSubEntry(name, conf[1]));
+ }
+ return Header.menu.addEntry({
+ el: el,
+ order: 105,
+ subEntries: subEntries
+ });
+ },
+ createSubEntry: function(name, desc) {
+ var input, label;
+ label = UI.checkbox(name, name);
+ label.title = desc;
+ input = label.firstElementChild;
+ if (name === 'Fit width' || name === 'Fit height') {
+ $.on(input, 'change', ImageExpand.cb.setFitness);
+ }
+ $.event('change', null, input);
+ $.on(input, 'change', $.cb.checked);
+ return {
+ el: label
+ };
+ }
+ }
+ };
+
+ return ImageExpand;
+
+}).call(this);
+
+ImageHover = (function() {
+ var ImageHover;
+
+ ImageHover = {
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ if (Conf['Image Hover']) {
+ Callbacks.Post.push({
+ name: 'Image Hover',
+ cb: this.node
+ });
+ }
+ if (Conf['Image Hover in Catalog']) {
+ return Callbacks.CatalogThread.push({
+ name: 'Image Hover',
+ cb: this.catalogNode
+ });
+ }
+ },
+ node: function() {
+ if (!(this.file && (this.file.isImage || this.file.isVideo))) {
+ return;
+ }
+ return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover(this));
+ },
+ catalogNode: function() {
+ var file;
+ file = this.thread.OP.file;
+ if (!(file && (file.isImage || file.isVideo))) {
+ return;
+ }
+ return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover(this.thread.OP));
+ },
+ mouseover: function(post) {
+ return function(e) {
+ var el, error, file, height, isVideo, left, maxHeight, maxWidth, ref, ref1, ref2, right, scale, width, x;
+ if (!doc.contains(this)) {
+ return;
+ }
+ file = post.file;
+ isVideo = file.isVideo;
+ if (file.isExpanding || file.isExpanded) {
+ return;
+ }
+ error = ImageHover.error(post);
+ if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
+ el = ImageCommon.popCache();
+ $.on(el, 'error', error);
+ } else {
+ el = $.el((isVideo ? 'video' : 'img'));
+ el.dataset.fullID = post.fullID;
+ $.on(el, 'error', error);
+ el.src = file.url;
+ }
+ if (Conf['Restart when Opened']) {
+ ImageCommon.rewind(el);
+ ImageCommon.rewind(this);
+ }
+ el.id = 'ihover';
+ $.add(Header.hover, el);
+ if (isVideo) {
+ el.loop = true;
+ el.controls = false;
+ Volume.setup(el);
+ if (Conf['Autoplay']) {
+ el.play();
+ }
+ }
+ ref1 = (function() {
+ var i, len, ref1, results;
+ ref1 = file.dimensions.split('x');
+ results = [];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ x = ref1[i];
+ results.push(+x);
+ }
+ return results;
+ })(), width = ref1[0], height = ref1[1];
+ ref2 = this.getBoundingClientRect(), left = ref2.left, right = ref2.right;
+ maxWidth = Math.max(left, doc.clientWidth - right);
+ maxHeight = doc.clientHeight - UI.hover.padding;
+ scale = Math.min(1, maxWidth / width, maxHeight / height);
+ el.style.maxWidth = (scale * width) + "px";
+ el.style.maxHeight = (scale * height) + "px";
+ return UI.hover({
+ root: this,
+ el: el,
+ latestEvent: e,
+ endEvents: 'mouseout click',
+ height: scale * height,
+ noRemove: true,
+ cb: function() {
+ $.off(el, 'error', error);
+ ImageCommon.pushCache(el);
+ ImageCommon.pause(el);
+ $.rm(el);
+ return el.removeAttribute('style');
+ }
+ });
+ };
+ },
+ error: function(post) {
+ return function() {
+ if (ImageCommon.decodeError(this, post)) {
+ return;
+ }
+ return ImageCommon.error(this, post, 3 * $.SECOND, (function(_this) {
+ return function(URL) {
+ if (URL) {
+ return _this.src = URL + (_this.src === URL ? '?' + Date.now() : '');
+ } else {
+ return $.rm(_this);
+ }
+ };
+ })(this));
+ };
+ }
+ };
+
+ return ImageHover;
+
+}).call(this);
+
+ImageLoader = (function() {
+ var ImageLoader,
+ slice = [].slice;
+
+ ImageLoader = {
+ init: function() {
+ var prefetch, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Image Replace',
+ cb: this.node
+ });
+ $.on(d, 'PostsInserted', function() {
+ return g.posts.forEach(ImageLoader.prefetch);
+ });
+ if (Conf['Replace WEBM']) {
+ $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
+ }
+ if (!Conf['Image Prefetching']) {
+ return;
+ }
+ prefetch = $.el('label', {
+ innerHTML: "
Prefetch Images"
+ });
+ this.el = prefetch.firstElementChild;
+ $.on(this.el, 'change', this.toggle);
+ return Header.menu.addEntry({
+ el: prefetch,
+ order: 98
+ });
+ },
+ node: function() {
+ if (this.isClone || !this.file) {
+ return;
+ }
+ if (Conf['Replace WEBM'] && this.file.isVideo) {
+ ImageLoader.replaceVideo(this);
+ }
+ return ImageLoader.prefetch(this);
+ },
+ replaceVideo: function(post) {
+ var attr, file, i, len, ref, thumb, video;
+ file = post.file;
+ thumb = file.thumb;
+ video = $.el('video', {
+ preload: 'none',
+ loop: true,
+ muted: true,
+ poster: thumb.src || thumb.dataset.src,
+ textContent: thumb.alt,
+ className: thumb.className
+ });
+ video.setAttribute('muted', 'muted');
+ video.dataset.md5 = thumb.dataset.md5;
+ ref = ['height', 'width', 'maxHeight', 'maxWidth'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ attr = ref[i];
+ video.style[attr] = thumb.style[attr];
+ }
+ video.src = file.url;
+ $.replace(thumb, video);
+ file.thumb = video;
+ return file.videoThumb = true;
+ },
+ prefetch: function(post) {
+ var clone, el, file, i, isImage, isVideo, len, match, ref, replace, thumb, type, url;
+ file = post.file;
+ if (!file) {
+ return;
+ }
+ isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, url = file.url;
+ if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) {
+ return;
+ }
+ type = (match = url.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
+ replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src);
+ if (!(replace || Conf['prefetch'])) {
+ return;
+ }
+ if (![post].concat(slice.call(post.clones)).some(function(clone) {
+ return doc.contains(clone.nodes.root);
+ })) {
+ return;
+ }
+ file.isPrefetched = true;
+ if (file.videoThumb) {
+ ref = post.clones;
+ for (i = 0, len = ref.length; i < len; i++) {
+ clone = ref[i];
+ clone.file.thumb.preload = 'auto';
+ }
+ thumb.preload = 'auto';
+ if ($.engine === 'gecko') {
+ $.on(thumb, 'loadeddata', function() {
+ return this.removeAttribute('poster');
+ });
+ }
+ return;
+ }
+ el = $.el(isImage ? 'img' : 'video');
+ if (replace && isImage) {
+ $.on(el, 'load', function() {
+ var j, len1, ref1;
+ ref1 = post.clones;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ clone = ref1[j];
+ clone.file.thumb.src = url;
+ }
+ thumb.src = url;
+ return thumb.removeAttribute('data-src');
+ });
+ }
+ return el.src = url;
+ },
+ toggle: function() {
+ if (Conf['prefetch'] = this.checked) {
+ g.posts.forEach(ImageLoader.prefetch);
+ }
+ },
+ playVideos: function() {
+ var qpClone, ref;
+ qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0;
+ return g.posts.forEach(function(post) {
+ var i, len, ref1, ref2, thumb;
+ ref1 = [post].concat(slice.call(post.clones));
+ for (i = 0, len = ref1.length; i < len; i++) {
+ post = ref1[i];
+ if (!((ref2 = post.file) != null ? ref2.videoThumb : void 0)) {
+ continue;
+ }
+ thumb = post.file.thumb;
+ if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) {
+ thumb.play();
+ } else {
+ thumb.pause();
+ }
+ }
+ });
+ }
+ };
+
+ return ImageLoader;
+
+}).call(this);
+
+Metadata = (function() {
+ var Metadata;
+
+ Metadata = {
+ init: function() {
+ var ref;
+ if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'WEBM Metadata',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var el;
+ if (!(this.file && /webm$/i.test(this.file.url))) {
+ return;
+ }
+ if (this.isClone) {
+ el = $('.webm-title', this.file.text);
+ } else {
+ el = $.el('span', {
+ className: 'webm-title'
+ });
+ $.extend(el, {
+ innerHTML: "
"
+ });
+ $.add(this.file.text, [$.tn('\u00A0'), el]);
+ }
+ if (el.children.length === 1) {
+ return $.one(el.lastElementChild, 'mouseover focus', Metadata.load);
+ }
+ },
+ load: function() {
+ $.rmClass(this.parentNode, 'error');
+ $.addClass(this.parentNode, 'loading');
+ return CrossOrigin.binary(Get.postFromNode(this).file.url, (function(_this) {
+ return function(data) {
+ var output, title;
+ $.rmClass(_this.parentNode, 'loading');
+ if (data != null) {
+ title = Metadata.parse(data);
+ output = $.el('span', {
+ textContent: title || ''
+ });
+ if (title == null) {
+ $.addClass(_this.parentNode, 'not-found');
+ }
+ $.before(_this, output);
+ _this.parentNode.tabIndex = 0;
+ if (d.activeElement === _this) {
+ _this.parentNode.focus();
+ }
+ return _this.tabIndex = -1;
+ } else {
+ $.addClass(_this.parentNode, 'error');
+ return $.one(_this, 'click', Metadata.load);
+ }
+ };
+ })(this), {
+ Range: 'bytes=0-9999'
+ });
+ },
+ parse: function(data) {
+ var element, i, readInt, size, title;
+ readInt = function() {
+ var len, n;
+ n = data[i++];
+ len = 0;
+ while (n < (0x80 >> len)) {
+ len++;
+ }
+ n ^= 0x80 >> len;
+ while (len-- && i < data.length) {
+ n = (n << 8) ^ data[i++];
+ }
+ return n;
+ };
+ i = 0;
+ while (i < data.length) {
+ element = readInt();
+ size = readInt();
+ if (element === 0x3BA9) {
+ title = '';
+ while (size-- && i < data.length) {
+ title += String.fromCharCode(data[i++]);
+ }
+ return decodeURIComponent(escape(title));
+ } else if (element !== 0x8538067 && element !== 0x549A966) {
+ i += size;
+ }
+ }
+ return null;
+ }
+ };
+
+ return Metadata;
+
+}).call(this);
+
+RevealSpoilers = (function() {
+ var RevealSpoilers;
+
+ RevealSpoilers = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Reveal Spoiler Thumbnails',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var thumb;
+ if (!(!this.isClone && this.file && this.file.thumb && this.file.isSpoiler)) {
+ return;
+ }
+ thumb = this.file.thumb;
+ thumb.removeAttribute('style');
+ thumb.style.maxHeight = thumb.style.maxWidth = this.isReply ? '125px' : '250px';
+ if (thumb.src) {
+ return thumb.src = this.file.thumbURL;
+ } else {
+ return thumb.dataset.src = this.file.thumbURL;
+ }
+ }
+ };
+
+ return RevealSpoilers;
+
+}).call(this);
+
+Sauce = (function() {
+ var Sauce,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Sauce = {
+ init: function() {
+ var err, j, len, link, links, ref, ref1;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
+ return;
+ }
+ links = [];
+ ref1 = Conf['sauces'].split('\n');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ link = ref1[j];
+ try {
+ if (link[0] !== '#') {
+ links.push(link.trim());
+ }
+ } catch (_error) {
+ err = _error;
+ }
+ }
+ if (!links.length) {
+ return;
+ }
+ this.links = links;
+ this.link = $.el('a', {
+ target: '_blank',
+ className: 'sauce'
+ });
+ return Callbacks.Post.push({
+ name: 'Sauce',
+ cb: this.node
+ });
+ },
+ sandbox: function(url) {
+ return E.url({
+ innerHTML: "
[sb] " + E(url) + " "
+ });
+ },
+ rmOrigin: function(e) {
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ $.open(this.href);
+ return e.preventDefault();
+ },
+ createSauceLink: function(link, post) {
+ var a, ext, i, j, key, len, m, part, parts, ref, ref1, ref2, skip, url;
+ if (!(link = link.trim())) {
+ return null;
+ }
+ parts = {};
+ ref = link.split(/;(?=(?:text|boards|types|sandbox):?)/);
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ part = ref[i];
+ if (i === 0) {
+ parts['url'] = part;
+ } else {
+ m = part.match(/^(\w*):?(.*)$/);
+ parts[m[1]] = m[2];
+ }
+ }
+ parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
+ ext = post.file.url.match(/[^.]*$/)[0];
+ skip = false;
+ for (key in parts) {
+ parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi)/g, function(_, parameter) {
+ var type;
+ type = Sauce.formatters[parameter](post, ext);
+ if (type == null) {
+ skip = true;
+ return '';
+ }
+ if (key === 'url' && (parameter !== '%' && parameter !== 'semi')) {
+ if (/^javascript:/i.test(parts['url'])) {
+ type = JSON.stringify(type);
+ }
+ type = encodeURIComponent(type);
+ }
+ return type;
+ });
+ }
+ if (skip) {
+ return null;
+ }
+ if (!(!parts['boards'] || (ref2 = post.board.ID, indexOf.call(parts['boards'].split(','), ref2) >= 0))) {
+ return null;
+ }
+ if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
+ return null;
+ }
+ url = parts['url'];
+ if (parts['sandbox'] != null) {
+ url = Sauce.sandbox(url);
+ }
+ a = Sauce.link.cloneNode(true);
+ a.href = url;
+ a.textContent = parts['text'];
+ if (/^javascript:/i.test(parts['url'])) {
+ a.removeAttribute('target');
+ }
+ if (parts['sandbox'] != null) {
+ $.on(a, 'click', Sauce.rmOrigin);
+ }
+ return a;
+ },
+ node: function() {
+ var j, len, link, node, nodes, ref;
+ if (this.isClone || !this.file) {
+ return;
+ }
+ nodes = [];
+ ref = Sauce.links;
+ for (j = 0, len = ref.length; j < len; j++) {
+ link = ref[j];
+ if (node = Sauce.createSauceLink(link, this)) {
+ nodes.push($.tn('\u00A0'), node);
+ }
+ }
+ return $.add(this.file.text, nodes);
+ },
+ formatters: {
+ TURL: function(post) {
+ return post.file.thumbURL;
+ },
+ URL: function(post) {
+ return post.file.url;
+ },
+ IMG: function(post, ext) {
+ if (ext === 'gif' || ext === 'jpg' || ext === 'png') {
+ return post.file.url;
+ } else {
+ return post.file.thumbURL;
+ }
+ },
+ MD5: function(post) {
+ return post.file.MD5;
+ },
+ sMD5: function(post) {
+ var ref;
+ return (ref = post.file.MD5) != null ? ref.replace(/[+\/=]/g, function(c) {
+ return {
+ '+': '-',
+ '/': '_',
+ '=': ''
+ }[c];
+ }) : void 0;
+ },
+ hMD5: function(post) {
+ var c;
+ if (post.file.MD5) {
+ return ((function() {
+ var j, len, ref, results;
+ ref = atob(post.file.MD5);
+ results = [];
+ for (j = 0, len = ref.length; j < len; j++) {
+ c = ref[j];
+ results.push(("0" + (c.charCodeAt(0).toString(16))).slice(-2));
+ }
+ return results;
+ })()).join('');
+ }
+ },
+ board: function(post) {
+ return post.board.ID;
+ },
+ name: function(post) {
+ return post.file.name;
+ },
+ '%': function() {
+ return '%';
+ },
+ semi: function() {
+ return ';';
+ }
+ }
+ };
+
+ return Sauce;
+
+}).call(this);
+
+Volume = (function() {
+ var Volume;
+
+ Volume = {
+ init: function() {
+ var ref, ref1, unmuteEntry, volumeEntry;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
+ return;
+ }
+ $.sync('Allow Sound', function(x) {
+ var ref1;
+ Conf['Allow Sound'] = x;
+ return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0;
+ });
+ $.sync('Default Volume', function(x) {
+ var ref1;
+ Conf['Default Volume'] = x;
+ return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0;
+ });
+ if (Conf['Mouse Wheel Volume']) {
+ Callbacks.Post.push({
+ name: 'Mouse Wheel Volume',
+ cb: this.node
+ });
+ }
+ if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg') {
+ return;
+ }
+ if (Conf['Mouse Wheel Volume']) {
+ Callbacks.CatalogThread.push({
+ name: 'Mouse Wheel Volume',
+ cb: this.catalogNode
+ });
+ }
+ unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound');
+ unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1];
+ volumeEntry = $.el('label', {
+ title: 'Default volume for videos.'
+ });
+ $.extend(volumeEntry, {
+ innerHTML: "
Volume"
+ });
+ this.inputs = {
+ unmute: unmuteEntry.firstElementChild,
+ volume: volumeEntry.firstElementChild
+ };
+ $.on(this.inputs.unmute, 'change', $.cb.checked);
+ $.on(this.inputs.volume, 'change', $.cb.value);
+ Header.menu.addEntry({
+ el: unmuteEntry,
+ order: 200
+ });
+ return Header.menu.addEntry({
+ el: volumeEntry,
+ order: 201
+ });
+ },
+ setup: function(video) {
+ video.muted = !Conf['Allow Sound'];
+ video.volume = Conf['Default Volume'];
+ return $.on(video, 'volumechange', Volume.change);
+ },
+ change: function() {
+ var items, key, muted, val, volume;
+ muted = this.muted, volume = this.volume;
+ items = {
+ 'Allow Sound': !muted,
+ 'Default Volume': volume
+ };
+ for (key in items) {
+ val = items[key];
+ if (Conf[key] === val) {
+ delete items[key];
+ }
+ }
+ $.set(items);
+ $.extend(Conf, items);
+ if (Volume.inputs) {
+ Volume.inputs.unmute.checked = !muted;
+ return Volume.inputs.volume.value = volume;
+ }
+ },
+ node: function() {
+ var ref, ref1;
+ if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) {
+ return;
+ }
+ $.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover));
+ return $.on($('a', this.file.text), 'wheel', Volume.wheel.bind(this.file.thumb.parentNode));
+ },
+ catalogNode: function() {
+ var file;
+ file = this.thread.OP.file;
+ if (!(file != null ? file.isVideo : void 0)) {
+ return;
+ }
+ return $.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header.hover));
+ },
+ wheel: function(e) {
+ var el, volume;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
+ return;
+ }
+ if (!(el = $('video:not([data-md5])', this))) {
+ return;
+ }
+ if (el.muted || !$.hasAudio(el)) {
+ return;
+ }
+ volume = el.volume + 0.1;
+ if (e.deltaY < 0) {
+ volume *= 1.1;
+ }
+ if (e.deltaY > 0) {
+ volume /= 1.1;
+ }
+ el.volume = $.minmax(volume - 0.1, 0, 1);
+ return e.preventDefault();
+ }
+ };
+
+ return Volume;
+
+}).call(this);
+
+Embedding = (function() {
+ var Embedding;
+
+ Embedding = {
+ init: function() {
+ var j, len, ref, type;
+ if (!(Conf['Embedding'] || Conf['Link Title'])) {
+ return;
+ }
+ this.types = {};
+ ref = this.ordered_types;
+ for (j = 0, len = ref.length; j < len; j++) {
+ type = ref[j];
+ this.types[type.key] = type;
+ }
+ if (Conf['Floating Embeds']) {
+ this.dialog = UI.dialog('embedding', 'top: 50px; right: 0px;', {
+ innerHTML: "
"
+ });
+ this.media = $('#media-embed', this.dialog);
+ $.one(d, '4chanXInitFinished', this.ready);
+ }
+ if (Conf['Link Title']) {
+ return $.on(d, '4chanXInitFinished PostsInserted', function() {
+ var key, ref1, ref2, service;
+ ref1 = Embedding.types;
+ for (key in ref1) {
+ service = ref1[key];
+ if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
+ Embedding.flushTitles(service.title);
+ }
+ }
+ });
+ }
+ },
+ events: function(post) {
+ var el, i, items;
+ if (!Conf['Embedding']) {
+ return;
+ }
+ i = 0;
+ items = $$('.embedder', post.nodes.comment);
+ while (el = items[i++]) {
+ $.on(el, 'click', Embedding.cb.toggle);
+ if ($.hasClass(el, 'embedded')) {
+ Embedding.cb.toggle.call(el);
+ }
+ }
+ },
+ process: function(link, post) {
+ var data;
+ if (!(Conf['Embedding'] || Conf['Link Title'])) {
+ return;
+ }
+ if ($.x('ancestor::pre', link)) {
+ return;
+ }
+ if (data = Embedding.services(link)) {
+ data.post = post;
+ if (Conf['Embedding']) {
+ Embedding.embed(data);
+ }
+ if (Conf['Link Title']) {
+ return Embedding.title(data);
+ }
+ }
+ },
+ services: function(link) {
+ var href, j, len, match, ref, type;
+ href = link.href;
+ ref = Embedding.ordered_types;
+ for (j = 0, len = ref.length; j < len; j++) {
+ type = ref[j];
+ if (!(match = type.regExp.exec(href))) {
+ continue;
+ }
+ if (type.dummy) {
+ return;
+ }
+ return {
+ key: type.key,
+ uid: match[1],
+ options: match[2],
+ link: link
+ };
+ }
+ },
+ embed: function(data) {
+ var embed, href, key, link, name, options, post, ref, uid, value;
+ key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
+ href = link.href;
+ if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
+ return;
+ }
+ $.addClass(link, key.toLowerCase());
+ embed = $.el('a', {
+ className: 'embedder',
+ href: 'javascript:;',
+ textContent: '(embed)'
+ });
+ ref = {
+ key: key,
+ uid: uid,
+ options: options,
+ href: href
+ };
+ for (name in ref) {
+ value = ref[name];
+ embed.dataset[name] = value;
+ }
+ $.on(embed, 'click', Embedding.cb.toggle);
+ $.after(link, [$.tn(' '), embed]);
+ if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote && key !== 'TwitchTV') {
+ return $.asap((function() {
+ return doc.contains(embed);
+ }), function() {
+ return Embedding.cb.toggle.call(embed);
+ });
+ }
+ },
+ ready: function() {
+ $.addClass(Embedding.dialog, 'empty');
+ $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat);
+ $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed);
+ $.on($('.jump', Embedding.dialog), 'click', function() {
+ if (doc.contains(Embedding.lastEmbed)) {
+ return Header.scrollTo(Embedding.lastEmbed);
+ }
+ });
+ return $.add(d.body, Embedding.dialog);
+ },
+ closeFloat: function() {
+ delete Embedding.lastEmbed;
+ $.addClass(Embedding.dialog, 'empty');
+ return $.replace(Embedding.media.firstChild, $.el('div'));
+ },
+ dragEmbed: function() {
+ var style;
+ style = Embedding.media.style;
+ if (Embedding.dragEmbed.mouseup) {
+ $.off(d, 'mouseup', Embedding.dragEmbed);
+ Embedding.dragEmbed.mouseup = false;
+ style.visibility = '';
+ return;
+ }
+ $.on(d, 'mouseup', Embedding.dragEmbed);
+ Embedding.dragEmbed.mouseup = true;
+ return style.visibility = 'hidden';
+ },
+ title: function(data) {
+ var key, link, options, post, service, uid;
+ key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
+ if (!(service = Embedding.types[key].title)) {
+ return;
+ }
+ $.addClass(link, key.toLowerCase());
+ if (service.batchSize) {
+ (service.queue || (service.queue = [])).push(data);
+ if (service.queue.length >= service.batchSize) {
+ return Embedding.flushTitles(service);
+ }
+ } else {
+ if (!$.cache(service.api(uid), (function() {
+ return Embedding.cb.title(this, data);
+ }), {
+ responseType: 'json'
+ })) {
+ return $.extend(link, {
+ innerHTML: "[" + E(key) + "]
Title Link Blocked (are you using NoScript?)"
+ });
+ }
+ }
+ },
+ flushTitles: function(service) {
+ var cb, data, j, len, queue;
+ queue = service.queue;
+ if (!(queue != null ? queue.length : void 0)) {
+ return;
+ }
+ service.queue = [];
+ cb = function() {
+ var data, j, len;
+ for (j = 0, len = queue.length; j < len; j++) {
+ data = queue[j];
+ Embedding.cb.title(this, data);
+ }
+ };
+ if (!$.cache(service.api((function() {
+ var j, len, results;
+ results = [];
+ for (j = 0, len = queue.length; j < len; j++) {
+ data = queue[j];
+ results.push(data.uid);
+ }
+ return results;
+ })()), cb, {
+ responseType: 'json'
+ })) {
+ for (j = 0, len = queue.length; j < len; j++) {
+ data = queue[j];
+ $.extend(data.link, {
+ innerHTML: "[" + E(data.key) + "]
Title Link Blocked (are you using NoScript?)"
+ });
+ }
+ }
+ },
+ cb: {
+ toggle: function(e) {
+ var div;
+ if (e != null) {
+ e.preventDefault();
+ }
+ if (Conf['Floating Embeds']) {
+ if (!(div = Embedding.media.firstChild)) {
+ return;
+ }
+ $.replace(div, Embedding.cb.embed(this));
+ Embedding.lastEmbed = Get.postFromNode(this).nodes.root;
+ $.rmClass(Embedding.dialog, 'empty');
+ return;
+ }
+ if ($.hasClass(this, "embedded")) {
+ $.rm(this.nextElementSibling);
+ this.textContent = '(embed)';
+ } else {
+ $.after(this, Embedding.cb.embed(this));
+ this.textContent = '(unembed)';
+ }
+ return $.toggleClass(this, 'embedded');
+ },
+ embed: function(a) {
+ var container, el, type;
+ container = $.el('div');
+ $.add(container, el = (type = Embedding.types[a.dataset.key]).el(a));
+ el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
+ return container;
+ },
+ title: function(req, data) {
+ var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
+ key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
+ status = req.status;
+ service = Embedding.types[key].title;
+ text = "[" + key + "] " + ((function() {
+ switch (status) {
+ case 200:
+ case 304:
+ return service.text(req.response, uid);
+ case 404:
+ return "Not Found";
+ case 403:
+ return "Forbidden or Private";
+ default:
+ return status + "'d";
+ }
+ })());
+ link.dataset.original = link.textContent;
+ link.textContent = text;
+ ref = post.clones;
+ for (j = 0, len = ref.length; j < len; j++) {
+ post2 = ref[j];
+ ref1 = $$('a.linkify', post2.nodes.comment);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ link2 = ref1[k];
+ if (!(link2.href === link.href)) {
+ continue;
+ }
+ if ((base1 = link2.dataset).original == null) {
+ base1.original = link2.textContent;
+ }
+ link2.textContent = text;
+ }
+ }
+ }
+ },
+ ordered_types: [
+ {
+ key: 'audio',
+ regExp: /\.(?:mp3|ogg|wav)(?:\?|$)/i,
+ style: '',
+ el: function(a) {
+ return $.el('audio', {
+ controls: true,
+ preload: 'auto',
+ src: a.dataset.href
+ });
+ }
+ }, {
+ key: 'Dailymotion',
+ regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/,
+ el: function(a) {
+ var el, options, start;
+ options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? "?" + start[1] : '';
+ el = $.el('iframe', {
+ src: "//www.dailymotion.com/embed/video/" + a.dataset.uid + options
+ });
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ api: function(uid) {
+ return "https://api.dailymotion.com/video/" + uid;
+ },
+ text: function(_) {
+ return _.title;
+ }
+ }
+ }, {
+ key: 'Gist',
+ regExp: /^\w+:\/\/gist\.github\.com\/(?:[\w\-]+\/)?(\w+)/,
+ el: function(a) {
+ var content, el;
+ el = $.el('iframe');
+ el.setAttribute('sandbox', 'allow-scripts');
+ content = {
+ innerHTML: "
" + E(a.dataset.uid) + " "
+ };
+ el.src = E.url(content);
+ return el;
+ },
+ title: {
+ api: function(uid) {
+ return "https://api.github.com/gists/" + uid;
+ },
+ text: function(arg) {
+ var file, files;
+ files = arg.files;
+ for (file in files) {
+ if (files.hasOwnProperty(file)) {
+ return file;
+ }
+ }
+ }
+ }
+ }, {
+ key: 'image',
+ regExp: /\.(?:gif|png|jpg|jpeg|bmp)(?:\?|$)/i,
+ style: '',
+ el: function(a) {
+ return $.el('div', {
+ innerHTML: "
"
+ });
+ }
+ }, {
+ key: 'InstallGentoo',
+ regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'Twitter',
+ regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'LiveLeak',
+ regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*i=(\w+)/,
+ httpOnly: true,
+ el: function(a) {
+ var el;
+ el = $.el('iframe', {
+ src: "http://www.liveleak.com/ll_embed?i=" + a.dataset.uid
+ });
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }, {
+ key: 'Pastebin',
+ regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
+ httpOnly: true,
+ el: function(a) {
+ var div;
+ return div = $.el('iframe', {
+ src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'Gfycat',
+ regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
+ el: function(a) {
+ var div;
+ return div = $.el('iframe', {
+ src: "//gfycat.com/iframe/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'SoundCloud',
+ regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/,
+ style: 'border: 0; width: 500px; height: 400px;',
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(a.dataset.uid))
+ });
+ },
+ title: {
+ api: function(uid) {
+ return "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(uid));
+ },
+ text: function(_) {
+ return _.title;
+ }
+ }
+ }, {
+ key: 'StrawPoll',
+ regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
+ style: 'border: 0; width: 600px; height: 406px;',
+ el: function(a) {
+ return $.el('iframe', {
+ src: "//strawpoll.me/embed_1/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'TwitchTV',
+ regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/(\w[^#\&\?]*)/,
+ style: "border: none; width: 620px; height: 378px;",
+ el: function(a) {
+ var _, channel, flashvars, id, idprefix, j, len, obj, part, ref, result, seconds, start, type;
+ if (result = /(\w+)\/([bcv])\/(\d+)/i.exec(a.dataset.uid)) {
+ _ = result[0], channel = result[1], type = result[2], id = result[3];
+ idprefix = type === 'b' ? 'a' : type;
+ flashvars = "channel=" + channel + "&start_volume=25&auto_play=false&videoId=" + idprefix + id;
+ if (start = a.dataset.href.match(/\bt=(\w+)/)) {
+ seconds = 0;
+ ref = start[1].match(/\d+[hms]/g);
+ for (j = 0, len = ref.length; j < len; j++) {
+ part = ref[j];
+ seconds += +part.slice(0, -1) * {
+ 'h': 3600,
+ 'm': 60,
+ 's': 1
+ }[part.slice(-1)];
+ }
+ flashvars += "&initial_time=" + seconds;
+ }
+ } else {
+ channel = (/(\w+)/.exec(a.dataset.uid))[0];
+ flashvars = "channel=" + channel + "&start_volume=25&auto_play=false";
+ }
+ obj = $.el('object', {
+ data: '//www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf'
+ });
+ $.extend(obj, {
+ innerHTML: "
"
+ });
+ obj.children[1].value = flashvars;
+ return obj;
+ }
+ }, {
+ key: 'Vocaroo',
+ regExp: /^\w+:\/\/(?:www\.)?vocaroo\.com\/i\/(\w+)/,
+ style: '',
+ el: function(a) {
+ var el, type;
+ el = $.el('audio', {
+ controls: true,
+ preload: 'auto'
+ });
+ type = el.canPlayType('audio/webm') ? 'webm' : 'mp3';
+ el.src = "http://vocaroo.com/media_command.php?media=" + a.dataset.uid + "&command=download_" + type;
+ return el;
+ }
+ }, {
+ key: 'Vimeo',
+ regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "//player.vimeo.com/video/" + a.dataset.uid + "?wmode=opaque"
+ });
+ },
+ title: {
+ api: function(uid) {
+ return "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" + uid;
+ },
+ text: function(_) {
+ return _.title;
+ }
+ }
+ }, {
+ key: 'Vine',
+ regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/,
+ style: 'border: none; width: 500px; height: 500px;',
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://vine.co/v/" + a.dataset.uid + "/card"
+ });
+ }
+ }, {
+ key: 'YouTube',
+ regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/))([\w\-]{11})(.*)/,
+ el: function(a) {
+ var el, start;
+ start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/);
+ if (start) {
+ start = start[1];
+ }
+ if (start && !/^\d+$/.test(start)) {
+ start += ' 0h0m0s';
+ start = 3600 * start.match(/(\d+)h/)[1] + 60 * start.match(/(\d+)m/)[1] + 1 * start.match(/(\d+)s/)[1];
+ }
+ el = $.el('iframe', {
+ src: "//www.youtube.com/embed/" + a.dataset.uid + "?wmode=opaque" + (start ? '&start=' + start : '')
+ });
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ batchSize: 50,
+ api: function(uids) {
+ var ids, key;
+ ids = encodeURIComponent(uids.join(','));
+ key = 'AIzaSyB5_zaen_-46Uhz1xGR-lz1YoUMHqCD6CE';
+ return "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + ids + "&fields=items%28id%2Csnippet%28title%29%29&key=" + key;
+ },
+ text: function(data, uid) {
+ var item, j, len, ref;
+ ref = data.items;
+ for (j = 0, len = ref.length; j < len; j++) {
+ item = ref[j];
+ if (item.id === uid) {
+ return item.snippet.title;
+ }
+ }
+ return 'Not Found';
+ }
+ }
+ }, {
+ key: 'Loopvid',
+ regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|pc|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el: function(a) {
+ var _, base, el, host, j, k, len, len1, name, names, ref, ref1, type, types, url;
+ el = $.el('video', {
+ controls: true,
+ preload: 'auto',
+ loop: true
+ });
+ ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
+ types = (function() {
+ switch (host) {
+ case 'gd':
+ case 'wu':
+ case 'fc':
+ return [''];
+ case 'gc':
+ return ['giant', 'fat', 'zippy'];
+ default:
+ return ['.webm', '.mp4'];
+ }
+ })();
+ ref1 = names.split(',');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ name = ref1[j];
+ for (k = 0, len1 = types.length; k < len1; k++) {
+ type = types[k];
+ base = "" + name + type;
+ url = (function() {
+ switch (host) {
+ case 'pf':
+ return "https://web.archive.org/web/2/http://a.pomf.se/" + base;
+ case 'kd':
+ return "http://kastden.org/loopvid/" + base;
+ case 'lv':
+ return "http://kastden.org/_loopvid_media/lv/" + base;
+ case 'gd':
+ return "https://docs.google.com/uc?export=download&id=" + base;
+ case 'gh':
+ return "https://googledrive.com/host/" + base;
+ case 'db':
+ return "https://dl.dropboxusercontent.com/u/" + base;
+ case 'dx':
+ return "https://dl.dropboxusercontent.com/" + base;
+ case 'nn':
+ return "http://naenara.eu/loopvids/" + base;
+ case 'cp':
+ return "https://copy.com/" + base;
+ case 'wu':
+ return "http://webmup.com/" + base + "/vid.webm";
+ case 'ig':
+ return "https://i.imgur.com/" + base;
+ case 'ky':
+ return "https://kiyo.me/" + base;
+ case 'mf':
+ return "https://d.maxfile.ro/" + base;
+ case 'pc':
+ return "http://a.pomf.cat/" + base;
+ case 'fc':
+ return "//i.4cdn.org/" + base + ".webm";
+ case 'gc':
+ return "https://" + type + ".gfycat.com/" + name + ".webm";
+ }
+ })();
+ $.add(el, $.el('source', {
+ src: url
+ }));
+ }
+ }
+ return el;
+ }
+ }, {
+ key: 'Clyp',
+ regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w+)/,
+ style: '',
+ el: function(a) {
+ var el, type;
+ el = $.el('audio', {
+ controls: true,
+ preload: 'auto'
+ });
+ type = el.canPlayType('audio/ogg') ? 'ogg' : 'mp3';
+ el.src = "https://clyp.it/" + a.dataset.uid + "." + type;
+ return el;
+ }
+ }, {
+ key: 'Loopvid-dummy',
+ regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\//,
+ dummy: true
+ }, {
+ key: 'MediaFire-dummy',
+ regExp: /^\w+:\/\/(?:www\.)?mediafire.com\//,
+ dummy: true
+ }, {
+ key: 'video',
+ regExp: /\.(?:ogv|webm|mp4)(?:\?|$)/i,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el: function(a) {
+ return $.el('video', {
+ controls: true,
+ preload: 'auto',
+ src: a.dataset.href,
+ loop: /^https?:\/\/i\.4cdn\.org\//.test(a.dataset.href)
+ });
+ }
+ }
+ ]
+ };
+
+ return Embedding;
+
+}).call(this);
+
+Linkify = (function() {
+ var Linkify;
+
+ Linkify = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Linkify']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ Callbacks.Post.push({
+ name: 'Linkify',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Linkify',
+ cb: this.catalogNode
+ });
+ return Embedding.init();
+ },
+ node: function() {
+ var j, k, len, len1, link, links, ref;
+ if (this.isClone) {
+ return Embedding.events(this);
+ }
+ if (!Linkify.regString.test(this.info.comment)) {
+ return;
+ }
+ ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"]', this.nodes.comment);
+ for (j = 0, len = ref.length; j < len; j++) {
+ link = ref[j];
+ $.addClass(link, 'linkify');
+ Embedding.process(link, this);
+ }
+ links = Linkify.process(this.nodes.comment);
+ for (k = 0, len1 = links.length; k < len1; k++) {
+ link = links[k];
+ Embedding.process(link, this);
+ }
+ },
+ catalogNode: function() {
+ if (!Linkify.regString.test(this.thread.OP.info.comment)) {
+ return;
+ }
+ return Linkify.process(this.nodes.comment);
+ },
+ process: function(node) {
+ var data, end, endNode, i, index, length, links, part1, part2, ref, ref1, result, saved, snapshot, space, test, word;
+ test = /[^\s"]+/g;
+ space = /[\s"]/;
+ snapshot = $.X('.//br|.//text()', node);
+ i = 0;
+ links = [];
+ while (node = snapshot.snapshotItem(i++)) {
+ data = node.data;
+ if (!data || node.parentElement.nodeName === "A") {
+ continue;
+ }
+ while (result = test.exec(data)) {
+ index = result.index;
+ endNode = node;
+ word = result[0];
+ if ((length = index + word.length) === data.length) {
+ test.lastIndex = 0;
+ while ((saved = snapshot.snapshotItem(i++))) {
+ if (saved.nodeName === 'BR') {
+ if ((part1 = word.match(/(https?:\/\/)?([a-z\d-]+\.)*[a-z\d-]+$/i)) && (part2 = (ref = snapshot.snapshotItem(i)) != null ? (ref1 = ref.data) != null ? ref1.match(/^(\.[a-z\d-]+)*\//i) : void 0 : void 0) && (part1[0] + part2[0]).search(Linkify.regString) === 0) {
+ continue;
+ } else {
+ break;
+ }
+ }
+ endNode = saved;
+ data = saved.data;
+ if (end = space.exec(data)) {
+ word += data.slice(0, end.index);
+ test.lastIndex = length = end.index;
+ i--;
+ break;
+ } else {
+ length = data.length;
+ word += data;
+ }
+ }
+ }
+ if (Linkify.regString.test(word)) {
+ links.push(Linkify.makeRange(node, endNode, index, length));
+ }
+ if (!(test.lastIndex && node === endNode)) {
+ break;
+ }
+ }
+ }
+ i = links.length;
+ while (i--) {
+ links[i] = Linkify.makeLink(links[i]);
+ }
+ return links;
+ },
+ regString: /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/?])|([-a-z\d]+[.])+(aero|asia|biz|cat|com|coop|dance|info|int|jobs|mobi|moe|museum|name|net|org|post|pro|tel|travel|xxx|xyz|edu|gov|mil|[a-z]{2})([:\/]|(?![^\s"]))|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i,
+ makeRange: function(startNode, endNode, startOffset, endOffset) {
+ var range;
+ range = document.createRange();
+ range.setStart(startNode, startOffset);
+ range.setEnd(endNode, endOffset);
+ return range;
+ },
+ makeLink: function(range) {
+ var a, encodedDomain, i, t, text;
+ text = range.toString();
+ i = text.search(Linkify.regString);
+ if (i > 0) {
+ text = text.slice(i);
+ while (range.startOffset + i >= range.startContainer.data.length) {
+ i--;
+ }
+ if (i) {
+ range.setStart(range.startContainer, range.startOffset + i);
+ }
+ }
+ i = 0;
+ while (/[)\]}>.,]/.test(t = text.charAt(text.length - (1 + i)))) {
+ if (!(/[.,]/.test(t) || (text.match(/[()\[\]{}<>]/g)).length % 2)) {
+ break;
+ }
+ i++;
+ }
+ if (i) {
+ text = text.slice(0, -i);
+ while (range.endOffset - i < 0) {
+ i--;
+ }
+ if (i) {
+ range.setEnd(range.endContainer, range.endOffset - i);
+ }
+ }
+ if (!/((mailto|magnet):|.+:\/\/)/.test(text)) {
+ text = (/@/.test(text) ? 'mailto:' : 'http://') + text;
+ }
+ if (encodedDomain = text.match(/^(https?:\/\/[^\/]*%[0-9a-f]{2})(.*)$/i)) {
+ text = encodedDomain[1].replace(/%([0-9a-f]{2})/ig, function(x, y) {
+ if (y === '25') {
+ return x;
+ } else {
+ return String.fromCharCode(parseInt(y, 16));
+ }
+ }) + encodedDomain[2];
+ }
+ a = $.el('a', {
+ className: 'linkify',
+ rel: 'nofollow noreferrer',
+ target: '_blank',
+ href: text
+ });
+ $.add(a, range.extractContents());
+ range.insertNode(a);
+ return a;
+ }
+ };
+
+ return Linkify;
+
+}).call(this);
+
+ArchiveLink = (function() {
+ var ArchiveLink;
+
+ ArchiveLink = {
+ init: function() {
+ var div, entry, i, len, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
+ return;
+ }
+ div = $.el('div', {
+ textContent: 'Archive'
+ });
+ entry = {
+ el: div,
+ order: 90,
+ open: function(arg) {
+ var ID, board, thread;
+ ID = arg.ID, thread = arg.thread, board = arg.board;
+ return !!Redirect.to('thread', {
+ postID: ID,
+ threadID: thread.ID,
+ boardID: board.ID
+ });
+ },
+ subEntries: []
+ };
+ ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ type = ref1[i];
+ entry.subEntries.push(this.createSubEntry(type[0], type[1]));
+ }
+ return Menu.menu.addEntry(entry);
+ },
+ 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,
+ threadID: thread.ID,
+ boardID: board.ID
+ });
+ return true;
+ } : function(post) {
+ var value;
+ value = Filter[type](post);
+ if (!value) {
+ return false;
+ }
+ el.href = Redirect.to('search', {
+ boardID: post.board.ID,
+ type: type,
+ value: value,
+ isSearch: true
+ });
+ return true;
+ };
+ return {
+ el: el,
+ open: open
+ };
+ }
+ };
+
+ return ArchiveLink;
+
+}).call(this);
+
+DeleteLink = (function() {
+ var DeleteLink;
+
+ DeleteLink = {
+ auto: [{}, {}],
+ init: function() {
+ var div, fileEl, fileEntry, postEl, postEntry, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
+ return;
+ }
+ div = $.el('div', {
+ className: 'delete-link',
+ textContent: 'Delete'
+ });
+ postEl = $.el('a', {
+ className: 'delete-post',
+ href: 'javascript:;'
+ });
+ fileEl = $.el('a', {
+ className: 'delete-file',
+ href: 'javascript:;'
+ });
+ this.nodes = {
+ menu: div.firstChild,
+ links: [postEl, fileEl]
+ };
+ postEntry = {
+ el: postEl,
+ open: function() {
+ postEl.textContent = DeleteLink.linkText(false);
+ $.on(postEl, 'click', DeleteLink.toggle);
+ return true;
+ }
+ };
+ fileEntry = {
+ el: fileEl,
+ open: function(arg) {
+ var file;
+ file = arg.file;
+ if (!file || file.isDead) {
+ return false;
+ }
+ fileEl.textContent = DeleteLink.linkText(true);
+ $.on(fileEl, 'click', DeleteLink.toggle);
+ return true;
+ }
+ };
+ return Menu.menu.addEntry({
+ el: div,
+ order: 40,
+ open: function(post) {
+ if (post.isDead) {
+ return false;
+ }
+ DeleteLink.post = post;
+ DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
+ DeleteLink.cooldown.start(post);
+ return true;
+ },
+ subEntries: [postEntry, fileEntry]
+ });
+ },
+ menuText: function() {
+ var seconds;
+ if (seconds = DeleteLink.cooldown.seconds[DeleteLink.post.fullID]) {
+ return "Delete (" + seconds + ")";
+ } else {
+ return 'Delete';
+ }
+ },
+ linkText: function(fileOnly) {
+ var text;
+ text = fileOnly ? 'File' : 'Post';
+ if (DeleteLink.auto[+fileOnly][DeleteLink.post.fullID]) {
+ text = "Deleting " + (text.toLowerCase()) + "...";
+ }
+ return text;
+ },
+ toggle: function() {
+ var auto, fileOnly, post;
+ post = DeleteLink.post;
+ fileOnly = $.hasClass(this, 'delete-file');
+ auto = DeleteLink.auto[+fileOnly];
+ if (auto[post.fullID]) {
+ delete auto[post.fullID];
+ } else {
+ auto[post.fullID] = true;
+ }
+ this.textContent = DeleteLink.linkText(fileOnly);
+ if (!DeleteLink.cooldown.seconds[post.fullID]) {
+ return DeleteLink["delete"](post, fileOnly);
+ }
+ },
+ "delete": function(post, fileOnly) {
+ var form, link;
+ link = DeleteLink.nodes.links[+fileOnly];
+ delete DeleteLink.auto[+fileOnly][post.fullID];
+ if (post.fullID === DeleteLink.post.fullID) {
+ $.off(link, 'click', DeleteLink.toggle);
+ }
+ form = {
+ mode: 'usrdel',
+ onlyimgdel: fileOnly,
+ pwd: QR.persona.getPassword()
+ };
+ form[post.ID] = 'delete';
+ return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), {
+ responseType: 'document',
+ withCredentials: true,
+ onload: function() {
+ return DeleteLink.load(link, post, fileOnly, this.response);
+ },
+ onerror: function() {
+ return DeleteLink.error(link, post);
+ }
+ }, {
+ form: $.formData(form)
+ });
+ },
+ load: function(link, post, fileOnly, resDoc) {
+ var el, msg;
+ link.textContent = DeleteLink.linkText(fileOnly);
+ if (resDoc.title === '4chan - Banned') {
+ el = $.el('span', {
+ innerHTML: "You can't delete posts because you are
banned ."
+ });
+ return new Notice('warning', el, 20);
+ } else if (msg = resDoc.getElementById('errmsg')) {
+ new Notice('warning', msg.textContent, 20);
+ if (post.fullID === DeleteLink.post.fullID) {
+ $.on(link, 'click', DeleteLink.toggle);
+ }
+ if (QR.cooldown.data && Conf['Cooldown'] && /\bwait\b/i.test(msg.textContent)) {
+ DeleteLink.cooldown.start(post, 5);
+ DeleteLink.auto[+fileOnly][post.fullID] = true;
+ return DeleteLink.nodes.links[+fileOnly].textContent = DeleteLink.linkText(fileOnly);
+ }
+ } else {
+ if (!fileOnly) {
+ QR.cooldown["delete"](post);
+ }
+ if (resDoc.title === 'Updating index...') {
+ (post.origin || post).kill(fileOnly);
+ }
+ if (post.fullID === DeleteLink.post.fullID) {
+ return link.textContent = 'Deleted';
+ }
+ }
+ },
+ error: function(link, post) {
+ new Notice('warning', 'Connection error, please retry.', 20);
+ if (post.fullID === DeleteLink.post.fullID) {
+ return $.on(link, 'click', DeleteLink.toggle);
+ }
+ },
+ cooldown: {
+ seconds: {},
+ start: function(post, seconds) {
+ if (DeleteLink.cooldown.seconds[post.fullID] != null) {
+ return;
+ }
+ if (seconds == null) {
+ seconds = QR.cooldown.secondsDeletion(post);
+ }
+ if (seconds > 0) {
+ DeleteLink.cooldown.seconds[post.fullID] = seconds;
+ return DeleteLink.cooldown.count(post);
+ }
+ },
+ count: function(post) {
+ var fileOnly, i, len, ref;
+ if (post.fullID === DeleteLink.post.fullID) {
+ DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
+ }
+ if (DeleteLink.cooldown.seconds[post.fullID] > 0 && Conf['Cooldown']) {
+ DeleteLink.cooldown.seconds[post.fullID]--;
+ setTimeout(DeleteLink.cooldown.count, 1000, post);
+ } else {
+ delete DeleteLink.cooldown.seconds[post.fullID];
+ ref = [false, true];
+ for (i = 0, len = ref.length; i < len; i++) {
+ fileOnly = ref[i];
+ if (DeleteLink.auto[+fileOnly][post.fullID]) {
+ DeleteLink["delete"](post, fileOnly);
+ }
+ }
+ }
+ }
+ }
+ };
+
+ return DeleteLink;
+
+}).call(this);
+
+DownloadLink = (function() {
+ var DownloadLink;
+
+ DownloadLink = {
+ init: function() {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
+ return;
+ }
+ a = $.el('a', {
+ className: 'download-link',
+ textContent: 'Download file'
+ });
+ $.on(a, 'click', ImageCommon.download);
+ return Menu.menu.addEntry({
+ el: a,
+ order: 100,
+ open: function(arg) {
+ var file;
+ file = arg.file;
+ if (!file) {
+ return false;
+ }
+ a.href = file.url;
+ a.download = file.name;
+ return true;
+ }
+ });
+ }
+ };
+
+ return DownloadLink;
+
+}).call(this);
+
+Menu = (function() {
+ var Menu;
+
+ Menu = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) {
+ return;
+ }
+ this.button = $.el('a', {
+ className: 'menu-button',
+ href: 'javascript:;'
+ });
+ $.extend(this.button, {
+ innerHTML: "
"
+ });
+ this.menu = new UI.Menu('post');
+ Callbacks.Post.push({
+ name: 'Menu',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Menu',
+ cb: this.catalogNode
+ });
+ },
+ node: function() {
+ if (this.isClone) {
+ Menu.makeButton(this, $('.menu-button', this.nodes.info));
+ return;
+ }
+ return $.add(this.nodes.info, Menu.makeButton(this));
+ },
+ catalogNode: function() {
+ return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP));
+ },
+ makeButton: function(post, button) {
+ button || (button = Menu.button.cloneNode(true));
+ $.on(button, 'click', function(e) {
+ return Menu.menu.toggle(e, this, post);
+ });
+ return button;
+ }
+ };
+
+ return Menu;
+
+}).call(this);
+
+ReportLink = (function() {
+ var ReportLink;
+
+ ReportLink = {
+ init: function() {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
+ return;
+ }
+ a = $.el('a', {
+ className: 'report-link',
+ href: 'javascript:;'
+ });
+ $.on(a, 'click', ReportLink.report);
+ return Menu.menu.addEntry({
+ el: a,
+ order: 10,
+ open: function(post) {
+ if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) {
+ a.textContent = 'Report';
+ ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
+ if ((Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled) || d.cookie.indexOf('pass_enabled=1') >= 0) {
+ ReportLink.url += '&altc=1';
+ ReportLink.dims = 'width=350,height=275';
+ } else {
+ ReportLink.dims = 'width=400,height=550';
+ }
+ } else if (Conf['Archive Report']) {
+ a.textContent = 'Report to archive';
+ ReportLink.url = Redirect.to('report', {
+ boardID: post.board.ID,
+ postID: post.ID
+ });
+ ReportLink.dims = 'width=700,height=475';
+ } else {
+ ReportLink.url = '';
+ }
+ return !!ReportLink.url;
+ }
+ });
+ },
+ report: function() {
+ var dims, id, set, url;
+ url = ReportLink.url, dims = ReportLink.dims;
+ id = Date.now();
+ set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1," + dims;
+ return window.open(url, id, set);
+ }
+ };
+
+ return ReportLink;
+
+}).call(this);
+
+AntiAutoplay = (function() {
+ var AntiAutoplay;
+
+ AntiAutoplay = {
+ init: function() {
+ var audio, i, len, ref;
+ if (!Conf['Disable Autoplaying Sounds']) {
+ return;
+ }
+ $.addClass(doc, 'anti-autoplay');
+ ref = $$('audio[autoplay]', doc);
+ for (i = 0, len = ref.length; i < len; i++) {
+ audio = ref[i];
+ this.stop(audio);
+ }
+ window.addEventListener('loadstart', ((function(_this) {
+ return function(e) {
+ return _this.stop(e.target);
+ };
+ })(this)), true);
+ Callbacks.Post.push({
+ name: 'Disable Autoplaying Sounds',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Disable Autoplaying Sounds',
+ cb: this.node
+ });
+ return $.ready((function(_this) {
+ return function() {
+ return _this.process(d.body);
+ };
+ })(this));
+ },
+ stop: function(audio) {
+ if (!audio.autoplay) {
+ return;
+ }
+ audio.pause();
+ audio.autoplay = false;
+ if (audio.controls) {
+ return;
+ }
+ audio.controls = true;
+ return $.addClass(audio, 'controls-added');
+ },
+ node: function() {
+ return AntiAutoplay.process(this.nodes.root);
+ },
+ process: function(root) {
+ var i, iframe, j, len, len1, object, ref, ref1;
+ ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
+ for (i = 0, len = ref.length; i < len; i++) {
+ iframe = ref[i];
+ iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
+ $.addClass(iframe, 'autoplay-removed');
+ }
+ ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ object = ref1[j];
+ object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
+ $.addClass(object, 'autoplay-removed');
+ }
+ }
+ };
+
+ return AntiAutoplay;
+
+}).call(this);
+
+Banner = (function() {
+ var Banner,
+ slice = [].slice;
+
+ Banner = {
+ banners: ["0.jpg","1.jpg","2.jpg","4.jpg","6.jpg","7.jpg","8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg","14.jpg","16.jpg","17.jpg","18.jpg","19.jpg","20.jpg","21.jpg","22.jpg","24.jpg","25.jpg","26.jpg","28.jpg","29.jpg","33.jpg","38.jpg","39.jpg","43.jpg","44.jpg","45.jpg","46.jpg","47.jpg","52.jpg","54.jpg","57.jpg","59.jpg","60.jpg","61.jpg","64.jpg","66.jpg","67.jpg","69.jpg","71.jpg","72.jpg","76.jpg","77.jpg","81.jpg","82.jpg","83.jpg","84.jpg","88.jpg","90.jpg","91.jpg","96.jpg","98.jpg","99.jpg","100.jpg","104.jpg","106.jpg","116.jpg","119.jpg","137.jpg","140.jpg","148.jpg","149.jpg","150.jpg","154.jpg","156.jpg","157.jpg","158.jpg","159.jpg","161.jpg","162.jpg","164.jpg","165.jpg","166.jpg","167.jpg","168.jpg","169.jpg","170.jpg","171.jpg","172.jpg","173.jpg","174.jpg","175.jpg","176.jpg","178.jpg","179.jpg","180.jpg","181.jpg","182.jpg","183.jpg","186.jpg","189.jpg","190.jpg","192.jpg","193.jpg","194.jpg","197.jpg","198.jpg","200.jpg","201.jpg","202.jpg","203.jpg","205.jpg","206.jpg","207.jpg","208.jpg","210.jpg","213.jpg","214.jpg","215.jpg","216.jpg","218.jpg","219.jpg","220.jpg","221.jpg","222.jpg","223.jpg","224.jpg","227.jpg","0.png","1.png","2.png","3.png","5.png","6.png","9.png","10.png","11.png","12.png","14.png","16.png","19.png","20.png","21.png","22.png","23.png","24.png","26.png","27.png","28.png","29.png","30.png","31.png","32.png","33.png","34.png","37.png","39.png","40.png","41.png","42.png","43.png","44.png","45.png","48.png","49.png","50.png","51.png","52.png","53.png","57.png","58.png","59.png","64.png","66.png","67.png","68.png","69.png","70.png","71.png","72.png","76.png","78.png","79.png","81.png","82.png","85.png","86.png","87.png","89.png","95.png","98.png","100.png","101.png","102.png","105.png","106.png","107.png","109.png","110.png","111.png","112.png","113.png","114.png","115.png","116.png","118.png","119.png","120.png","121.png","122.png","123.png","126.png","128.png","130.png","134.png","136.png","138.png","139.png","140.png","142.png","145.png","146.png","149.png","150.png","151.png","152.png","153.png","154.png","155.png","156.png","157.png","158.png","159.png","160.png","163.png","164.png","165.png","166.png","167.png","168.png","169.png","170.png","171.png","172.png","173.png","174.png","178.png","179.png","180.png","181.png","182.png","184.png","186.png","188.png","190.png","192.png","193.png","194.png","195.png","196.png","197.png","198.png","200.png","202.png","203.png","205.png","206.png","207.png","209.png","212.png","213.png","214.png","216.png","217.png","218.png","219.png","220.png","221.png","222.png","223.png","224.png","225.png","226.png","229.png","231.png","232.png","233.png","234.png","235.png","237.png","238.png","239.png","240.png","241.png","242.png","244.png","245.png","246.png","247.png","248.png","249.png","250.png","253.png","254.png","255.png","256.png","257.png","258.png","259.png","260.png","262.png","268.png","0.gif","1.gif","2.gif","3.gif","4.gif","5.gif","6.gif","7.gif","8.gif","9.gif","10.gif","12.gif","13.gif","14.gif","15.gif","16.gif","18.gif","19.gif","20.gif","21.gif","22.gif","23.gif","24.gif","28.gif","29.gif","30.gif","33.gif","34.gif","35.gif","36.gif","37.gif","39.gif","40.gif","42.gif","44.gif","45.gif","46.gif","48.gif","50.gif","52.gif","54.gif","55.gif","57.gif","58.gif","59.gif","60.gif","61.gif","63.gif","64.gif","66.gif","67.gif","68.gif","69.gif","70.gif","72.gif","73.gif","75.gif","76.gif","77.gif","78.gif","80.gif","81.gif","82.gif","83.gif","86.gif","87.gif","88.gif","92.gif","93.gif","94.gif","95.gif","96.gif","97.gif","98.gif","99.gif","100.gif","101.gif","102.gif","103.gif","104.gif","105.gif","106.gif","108.gif","109.gif","110.gif","111.gif","112.gif","113.gif","115.gif","116.gif","117.gif","118.gif","119.gif","120.gif","122.gif","123.gif","124.gif","127.gif","129.gif","130.gif","131.gif","134.gif","135.gif","136.gif","138.gif","139.gif","141.gif","144.gif","146.gif","148.gif","149.gif","153.gif","154.gif","155.gif","157.gif","158.gif","159.gif","160.gif","161.gif","162.gif","164.gif","166.gif","167.gif","168.gif","169.gif","170.gif","171.gif","172.gif","173.gif","174.gif","175.gif","176.gif","177.gif","178.gif","181.gif","182.gif","183.gif","185.gif","186.gif","187.gif","188.gif","189.gif","190.gif","191.gif","192.gif","193.gif","195.gif","196.gif","197.gif","200.gif","201.gif","202.gif","203.gif","204.gif","205.gif","206.gif","207.gif","208.gif","209.gif","210.gif","211.gif","212.gif","213.gif","214.gif","215.gif","216.gif","217.gif","219.gif","220.gif","221.gif","222.gif","224.gif","225.gif","226.gif","227.gif","228.gif","230.gif","232.gif","233.gif","234.gif","235.gif","238.gif","240.gif","241.gif","243.gif","244.gif","245.gif","246.gif","247.gif","249.gif","250.gif","251.gif","253.gif"],
+ init: function() {
+ if (Conf['Custom Board Titles']) {
+ this.db = new DataBoard('customTitles', null, true);
+ }
+ $.asap((function() {
+ return d.body;
+ }), function() {
+ return $.asap((function() {
+ return $('hr');
+ }), Banner.ready);
+ });
+ if (g.BOARD.ID !== 'f') {
+ return Main.ready(function() {
+ return $.queueTask(Banner.load);
+ });
+ }
+ },
+ ready: function() {
+ var banner, children;
+ banner = $(".boardBanner");
+ children = banner.children;
+ if (g.BOARD.ID !== 'f' && g.VIEW === 'thread' && Conf['Remove Thread Excerpt']) {
+ Banner.setTitle(children[1].textContent);
+ }
+ children[0].title = "Click to change";
+ $.on(children[0], 'click', Banner.cb.toggle);
+ if (Conf['Custom Board Titles']) {
+ Banner.custom(children[1]);
+ if (children[2]) {
+ return Banner.custom(children[2]);
+ }
+ }
+ },
+ load: function() {
+ var bannerCnt, img;
+ bannerCnt = $.id('bannerCnt');
+ if (!bannerCnt.firstChild) {
+ img = $.el('img', {
+ alt: '4chan',
+ src: '//s.4cdn.org/image/title/' + bannerCnt.dataset.src
+ });
+ return $.add(bannerCnt, img);
+ }
+ },
+ setTitle: function(title) {
+ if (Unread.title != null) {
+ Unread.title = title;
+ return Unread.update();
+ } else {
+ return d.title = title;
+ }
+ },
+ cb: {
+ toggle: function() {
+ var banner, i, ref;
+ if (!((ref = Banner.choices) != null ? ref.length : void 0)) {
+ Banner.choices = Banner.banners.slice();
+ }
+ i = Math.floor(Banner.choices.length * Math.random());
+ banner = Banner.choices.splice(i, 1);
+ return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner;
+ },
+ click: function(e) {
+ var base, br, j, len, name, ref;
+ if (!(e.ctrlKey || e.metaKey)) {
+ return;
+ }
+ if ((base = Banner.original)[name = this.className] == null) {
+ base[name] = this.cloneNode(true);
+ }
+ this.contentEditable = true;
+ ref = $$('br', this);
+ for (j = 0, len = ref.length; j < len; j++) {
+ br = ref[j];
+ $.replace(br, $.tn('\n'));
+ }
+ return this.focus();
+ },
+ keydown: function(e) {
+ e.stopPropagation();
+ if (!e.shiftKey && e.keyCode === 13) {
+ return this.blur();
+ }
+ },
+ blur: function() {
+ var br, j, len, ref;
+ ref = $$('br', this);
+ for (j = 0, len = ref.length; j < len; j++) {
+ br = ref[j];
+ $.replace(br, $.tn('\n'));
+ }
+ if (this.textContent = this.textContent.replace(/\n*$/, '')) {
+ this.contentEditable = false;
+ return Banner.db.set({
+ boardID: g.BOARD.ID,
+ threadID: this.className,
+ val: {
+ title: this.textContent,
+ orig: Banner.original[this.className].textContent
+ }
+ });
+ } else {
+ $.rmAll(this);
+ $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes));
+ return Banner.db["delete"]({
+ boardID: g.BOARD.ID,
+ threadID: this.className
+ });
+ }
+ }
+ },
+ original: {},
+ custom: function(child) {
+ var className, data, event, items, j, len, ref, string, string2;
+ className = child.className;
+ child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase());
+ child.spellcheck = false;
+ ref = ['click', 'keydown', 'blur'];
+ for (j = 0, len = ref.length; j < len; j++) {
+ event = ref[j];
+ $.on(child, event, Banner.cb[event]);
+ }
+ string = g.BOARD + "." + className;
+ string2 = string + ".orig";
+ items = {};
+ items[string] = '';
+ items[string2] = child.textContent;
+ $.get(items, function(items) {
+ if (items[string]) {
+ Banner.db.set({
+ boardID: g.BOARD.ID,
+ threadID: className,
+ val: {
+ title: items[string],
+ orig: items[string2]
+ }
+ });
+ }
+ return $["delete"]([string, string2]);
+ });
+ if (data = Banner.db.get({
+ boardID: g.BOARD.ID,
+ threadID: className
+ })) {
+ if (Conf['Persistent Custom Board Titles'] || data.orig === child.textContent) {
+ Banner.original[className] = child.cloneNode(true);
+ return child.textContent = data.title;
+ } else {
+ return Banner.db["delete"]({
+ boardID: g.BOARD.ID,
+ threadID: className
+ });
+ }
+ }
+ }
+ };
+
+ return Banner;
+
+}).call(this);
+
+CatalogLinks = (function() {
+ var CatalogLinks;
+
+ CatalogLinks = {
+ init: function() {
+ var el, input, selector;
+ if ((Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) {
+ selector = (function() {
+ switch (g.VIEW) {
+ case 'thread':
+ case 'archive':
+ return '.navLinks.desktop > a';
+ case 'catalog':
+ return '.navLinks > :first-child > a';
+ case 'index':
+ return '#ctrl-top > a, .cataloglink > a';
+ }
+ })();
+ $.ready(function() {
+ var catalogLink, i, len, link, ref;
+ ref = $$(selector);
+ for (i = 0, len = ref.length; i < len; i++) {
+ link = ref[i];
+ switch (link.pathname.replace(/\/+/g, '/')) {
+ case "/" + g.BOARD + "/":
+ if (Conf['JSON Index']) {
+ link.textContent = 'Index';
+ }
+ link.href = CatalogLinks.index();
+ break;
+ case "/" + g.BOARD + "/catalog":
+ link.href = CatalogLinks.catalog();
+ }
+ if (g.VIEW === 'catalog' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
+ catalogLink = link.parentNode.cloneNode(true);
+ catalogLink.firstElementChild.textContent = '4chan X Catalog';
+ catalogLink.firstElementChild.href = CatalogLinks.catalog();
+ $.after(link.parentNode, [$.tn(' '), catalogLink]);
+ }
+ }
+ });
+ }
+ if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
+ Callbacks.Post.push({
+ name: 'Catalog Link Rewrite',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Catalog Link Rewrite',
+ cb: this.node
+ });
+ }
+ if (Conf['Catalog Links']) {
+ CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links');
+ el.id = 'toggleCatalog';
+ input = $('input', el);
+ $.on(input, 'change', this.toggle);
+ $.sync('Header catalog links', CatalogLinks.set);
+ return Header.menu.addEntry({
+ el: el,
+ order: 95
+ });
+ }
+ },
+ node: function() {
+ var a, i, len, m, ref;
+ ref = $$('a', this.nodes.comment);
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
+ a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
+ }
+ }
+ },
+ initBoardList: function() {
+ if (!CatalogLinks.el) {
+ return;
+ }
+ return CatalogLinks.set(Conf['Header catalog links']);
+ },
+ toggle: function() {
+ $.event('CloseMenu');
+ $.set('Header catalog links', this.checked);
+ return CatalogLinks.set(this.checked);
+ },
+ set: function(useCatalog) {
+ var a, board, i, len, ref, ref1;
+ ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ if (((ref1 = a.hostname) !== 'boards.4chan.org' && ref1 !== 'catalog.neet.tv') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
+ continue;
+ }
+ a.href = useCatalog ? CatalogLinks.catalog(board) : "/" + board + "/";
+ if (a.dataset.indexOptions && a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
+ a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions;
+ }
+ }
+ CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
+ return $('input', CatalogLinks.el).checked = useCatalog;
+ },
+ catalog: function(board) {
+ if (board == null) {
+ board = g.BOARD.ID;
+ }
+ if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) {
+ return "http://catalog.neet.tv/" + board + "/";
+ } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
+ if (g.BOARD.ID === board && g.VIEW === 'index') {
+ return '#catalog';
+ } else {
+ return "/" + board + "/#catalog";
+ }
+ } else {
+ return "/" + board + "/catalog";
+ }
+ },
+ index: function(board) {
+ if (board == null) {
+ board = g.BOARD.ID;
+ }
+ if (Conf['JSON Index'] && board !== 'f') {
+ if (g.BOARD.ID === board && g.VIEW === 'index') {
+ return '#index';
+ } else {
+ return "/" + board + "/#index";
+ }
+ } else {
+ return "/" + board + "/";
+ }
+ }
+ };
+
+ return CatalogLinks;
+
+}).call(this);
+
+CustomCSS = (function() {
+ var CustomCSS;
+
+ CustomCSS = {
+ init: function() {
+ if (!Conf['Custom CSS']) {
+ return;
+ }
+ return this.addStyle();
+ },
+ addStyle: function() {
+ return this.style = $.addStyle(Conf['usercss'], 'custom-css', '#fourchanx-css');
+ },
+ rmStyle: function() {
+ if (this.style) {
+ $.rm(this.style);
+ return delete this.style;
+ }
+ },
+ update: function() {
+ if (!this.style) {
+ return this.addStyle();
+ }
+ return this.style.textContent = Conf['usercss'];
+ }
+ };
+
+ return CustomCSS;
+
+}).call(this);
+
+ExpandComment = (function() {
+ var ExpandComment;
+
+ ExpandComment = {
+ init: function() {
+ if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) {
+ return;
+ }
+ if (g.BOARD.ID === 'g') {
+ this.callbacks.push(Fourchan.code);
+ }
+ if (g.BOARD.ID === 'sci') {
+ this.callbacks.push(Fourchan.math);
+ }
+ return Callbacks.Post.push({
+ name: 'Comment Expansion',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var a;
+ if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
+ return $.on(a, 'click', ExpandComment.cb);
+ }
+ },
+ callbacks: [],
+ cb: function(e) {
+ e.preventDefault();
+ return ExpandComment.expand(Get.postFromNode(this));
+ },
+ 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;
+ return;
+ }
+ if (!(a = $('.abbr > a', post.nodes.comment))) {
+ return;
+ }
+ a.textContent = "Post No." + post + " Loading...";
+ return $.cache("//a.4cdn.org" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + ".json", function() {
+ return ExpandComment.parse(this, a, post);
+ });
+ },
+ contract: function(post) {
+ var a;
+ if (!post.nodes.shortComment) {
+ return;
+ }
+ a = $('.abbr > a', post.nodes.shortComment);
+ a.textContent = 'here';
+ $.replace(post.nodes.longComment, post.nodes.shortComment);
+ return post.nodes.comment = post.nodes.shortComment;
+ },
+ parse: function(req, a, post) {
+ var callback, clone, comment, href, i, j, k, len, len1, len2, postObj, posts, quote, ref, ref1, spoilerRange, status;
+ status = req.status;
+ if (status !== 200 && status !== 304) {
+ a.textContent = "Error " + req.statusText + " (" + status + ")";
+ return;
+ }
+ posts = req.response.posts;
+ if (spoilerRange = posts[0].custom_spoiler) {
+ Build.spoilerRange[g.BOARD] = spoilerRange;
+ }
+ for (i = 0, len = posts.length; i < len; i++) {
+ postObj = posts[i];
+ if (postObj.no === post.ID) {
+ break;
+ }
+ }
+ if (postObj.no !== post.ID) {
+ a.textContent = "Post No." + post + " not found.";
+ return;
+ }
+ comment = post.nodes.comment;
+ clone = comment.cloneNode(false);
+ clone.innerHTML = postObj.com;
+ ref = $$('.quotelink', clone);
+ for (j = 0, len1 = ref.length; j < len1; j++) {
+ quote = ref[j];
+ href = quote.getAttribute('href');
+ if (href[0] === '/') {
+ continue;
+ }
+ if (href[0] === '#') {
+ quote.href = "" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + href;
+ } else {
+ quote.href = (a.pathname.split(/\/+/).splice(0, 3).join('/')) + "/" + href;
+ }
+ }
+ post.nodes.shortComment = comment;
+ $.replace(comment, clone);
+ post.nodes.comment = post.nodes.longComment = clone;
+ post.parseComment();
+ post.parseQuotes();
+ ref1 = ExpandComment.callbacks;
+ for (k = 0, len2 = ref1.length; k < len2; k++) {
+ callback = ref1[k];
+ callback.call(post);
+ }
+ }
+ };
+
+ return ExpandComment;
+
+}).call(this);
+
+ExpandThread = (function() {
+ var ExpandThread,
+ slice = [].slice;
+
+ ExpandThread = {
+ statuses: {},
+ init: function() {
+ if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
+ return;
+ }
+ if (Conf['JSON Index']) {
+ return $.on(d, 'IndexRefresh', this.onIndexRefresh);
+ } else {
+ return Callbacks.Thread.push({
+ name: 'Expand Thread',
+ cb: function() {
+ return ExpandThread.setButton(this);
+ }
+ });
+ }
+ },
+ setButton: function(thread) {
+ var a;
+ if (!(a = $.x('following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
+ return;
+ }
+ a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
+ a.style.cursor = 'pointer';
+ return $.on(a, 'click', ExpandThread.cbToggle);
+ },
+ disconnect: function(refresh) {
+ var ref, ref1, status, threadID;
+ if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
+ return;
+ }
+ ref = ExpandThread.statuses;
+ for (threadID in ref) {
+ status = ref[threadID];
+ if ((ref1 = status.req) != null) {
+ ref1.abort();
+ }
+ delete ExpandThread.statuses[threadID];
+ }
+ if (!refresh) {
+ return $.off(d, 'IndexRefresh', this.onIndexRefresh);
+ }
+ },
+ onIndexRefresh: function() {
+ ExpandThread.disconnect(true);
+ return g.BOARD.threads.forEach(function(thread) {
+ return ExpandThread.setButton(thread);
+ });
+ },
+ cbToggle: function(e) {
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ e.preventDefault();
+ return ExpandThread.toggle(Get.threadFromNode(this));
+ },
+ toggle: function(thread) {
+ var a, threadRoot;
+ threadRoot = thread.OP.nodes.root.parentNode;
+ if (!(a = $('.summary', threadRoot))) {
+ return;
+ }
+ if (thread.ID in ExpandThread.statuses) {
+ return ExpandThread.contract(thread, a, threadRoot);
+ } else {
+ return ExpandThread.expand(thread, a);
+ }
+ },
+ expand: function(thread, a) {
+ var status;
+ ExpandThread.statuses[thread] = status = {};
+ a.textContent = Build.summaryText.apply(Build, ['...'].concat(slice.call(a.textContent.match(/\d+/g))));
+ return status.req = $.cache("//a.4cdn.org/" + thread.board + "/thread/" + thread + ".json", function() {
+ delete status.req;
+ return ExpandThread.parse(this, thread, a);
+ });
+ },
+ contract: function(thread, a, threadRoot) {
+ var filesCount, i, inlined, len, num, postsCount, replies, reply, status;
+ status = ExpandThread.statuses[thread];
+ delete ExpandThread.statuses[thread];
+ if (status.req) {
+ status.req.abort();
+ if (a) {
+ a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
+ }
+ return;
+ }
+ replies = $$('.thread > .replyContainer', threadRoot);
+ if (!Conf['JSON Index'] || Conf['Show Replies']) {
+ num = (function() {
+ if (thread.isSticky) {
+ return 1;
+ } else {
+ switch (g.BOARD.ID) {
+ case 'b':
+ case 'vg':
+ return 3;
+ case 't':
+ return 1;
+ default:
+ return 5;
+ }
+ }
+ })();
+ replies = replies.slice(0, -num);
+ }
+ postsCount = 0;
+ filesCount = 0;
+ for (i = 0, len = replies.length; i < len; i++) {
+ reply = replies[i];
+ if (Conf['Quote Inlining']) {
+ while (inlined = $('.inlined', reply)) {
+ inlined.click();
+ }
+ }
+ postsCount++;
+ if ('file' in Get.postFromRoot(reply)) {
+ filesCount++;
+ }
+ $.rm(reply);
+ }
+ return a.textContent = Build.summaryText('+', postsCount, filesCount);
+ },
+ parse: function(req, thread, a) {
+ var filesCount, i, len, post, postData, posts, postsCount, postsRoot, ref, ref1, root;
+ if ((ref = req.status) !== 200 && ref !== 304) {
+ a.textContent = "Error " + req.statusText + " (" + req.status + ")";
+ return;
+ }
+ Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler;
+ posts = [];
+ postsRoot = [];
+ filesCount = 0;
+ ref1 = req.response.posts;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ postData = ref1[i];
+ if (postData.no === thread.ID) {
+ continue;
+ }
+ if ((post = thread.posts[postData.no]) && !post.isFetchedQuote) {
+ if ('file' in post) {
+ filesCount++;
+ }
+ postsRoot.push(post.nodes.root);
+ continue;
+ }
+ root = Build.postFromObject(postData, thread.board.ID);
+ post = new Post(root, thread, thread.board);
+ if ('file' in post) {
+ filesCount++;
+ }
+ posts.push(post);
+ postsRoot.push(root);
+ }
+ Main.callbackNodes('Post', posts);
+ $.after(a, postsRoot);
+ $.event('PostsInserted');
+ postsCount = postsRoot.length;
+ return a.textContent = Build.summaryText('-', postsCount, filesCount);
+ }
+ };
+
+ return ExpandThread;
+
+}).call(this);
+
+FileInfo = (function() {
+ var FileInfo;
+
+ FileInfo = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['File Info Formatting']) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'File Info Formatting',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var info, oldInfo;
+ if (!this.file || this.isClone) {
+ return;
+ }
+ oldInfo = $.el('span', {
+ className: 'fileText-original'
+ });
+ $.prepend(this.file.link.parentNode, oldInfo);
+ $.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]);
+ info = $.el('span', {
+ className: 'file-info'
+ });
+ FileInfo.format(Conf['fileInfo'], this, info);
+ return $.prepend(this.file.text, info);
+ },
+ format: function(formatString, post, outputNode) {
+ var output;
+ output = [];
+ formatString.replace(/%(.)|[^%]+/g, function(s, c) {
+ output.push(c in FileInfo.formatters ? FileInfo.formatters[c].call(post) : {
+ innerHTML: E(s)
+ });
+ return '';
+ });
+ return $.extend(outputNode, {
+ innerHTML: E.cat(output)
+ });
+ },
+ formatters: {
+ t: function() {
+ return {
+ innerHTML: E(this.file.url.match(/[^/]*$/)[0])
+ };
+ },
+ T: function() {
+ return {
+ innerHTML: "
" + (FileInfo.formatters.t.call(this)).innerHTML + " "
+ };
+ },
+ l: function() {
+ return {
+ innerHTML: "
" + (FileInfo.formatters.n.call(this)).innerHTML + " "
+ };
+ },
+ L: function() {
+ return {
+ innerHTML: "
" + (FileInfo.formatters.N.call(this)).innerHTML + " "
+ };
+ },
+ n: function() {
+ var fullname, shortname;
+ fullname = this.file.name;
+ shortname = Build.shortFilename(this.file.name, this.isReply);
+ if (fullname === shortname) {
+ return {
+ innerHTML: E(fullname)
+ };
+ } else {
+ return {
+ innerHTML: "
" + E(shortname) + " " + E(fullname) + " "
+ };
+ }
+ },
+ N: function() {
+ return {
+ innerHTML: E(this.file.name)
+ };
+ },
+ p: function() {
+ return {
+ innerHTML: ((this.file.isSpoiler) ? "Spoiler, " : "")
+ };
+ },
+ s: function() {
+ return {
+ innerHTML: E(this.file.size)
+ };
+ },
+ B: function() {
+ return {
+ innerHTML: E(Math.round(this.file.sizeInBytes)) + " Bytes"
+ };
+ },
+ K: function() {
+ return {
+ innerHTML: E(Math.round(this.file.sizeInBytes/1024)) + " KB"
+ };
+ },
+ M: function() {
+ return {
+ innerHTML: E(Math.round(this.file.sizeInBytes/1048576*100)/100) + " MB"
+ };
+ },
+ r: function() {
+ return {
+ innerHTML: E(this.file.dimensions || "PDF")
+ };
+ },
+ g: function() {
+ return {
+ innerHTML: ((this.file.tag) ? ", " + E(this.file.tag) : "")
+ };
+ },
+ '%': function() {
+ return {
+ innerHTML: "%"
+ };
+ }
+ }
+ };
+
+ return FileInfo;
+
+}).call(this);
+
+Flash = (function() {
+ var Flash;
+
+ Flash = {
+ init: function() {
+ if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) {
+ return $.ready(Flash.initReady);
+ }
+ },
+ initReady: function() {
+ if ($.hasStorage) {
+ return $.global(function() {
+ if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) {
+ return window.SWFEmbed.init();
+ }
+ });
+ } else {
+ if (g.VIEW === 'thread') {
+ $.global(function() {
+ return window.Main.tid = location.pathname.split(/\/+/)[3];
+ });
+ }
+ return $.global(function() {
+ return window.SWFEmbed.init();
+ });
+ }
+ }
+ };
+
+ return Flash;
+
+}).call(this);
+
+Fourchan = (function() {
+ var Fourchan;
+
+ Fourchan = {
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ if (g.BOARD.ID === 'g') {
+ $.on(window, 'prettyprint:cb', function(e) {
+ var post, pre;
+ if (!(post = g.posts[e.detail.ID])) {
+ return;
+ }
+ if (!(pre = $$('.prettyprint', post.nodes.comment)[e.detail.i])) {
+ return;
+ }
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ pre.innerHTML = e.detail.html;
+ return $.addClass(pre, 'prettyprinted');
+ }
+ });
+ $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: {\n ID: e.detail.ID,\n i: e.detail.i,\n html: prettyPrintOne(e.detail.html)\n }\n }));\n}, false);');
+ Callbacks.Post.push({
+ name: 'Parse /g/ code',
+ cb: this.code
+ });
+ }
+ if (g.BOARD.ID === 'sci') {
+ $.global(function() {
+ return window.addEventListener('mathjax', function(e) {
+ if (window.MathJax) {
+ return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
+ } else {
+ if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) {
+ window.loadMathJax();
+ window.loadMathJax = function() {};
+ }
+ if (!e.target.classList.contains('postMessage')) {
+ return document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener('load', function() {
+ return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
+ }, false);
+ }
+ }
+ }, false);
+ });
+ Callbacks.Post.push({
+ name: 'Parse /sci/ math',
+ cb: this.math
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Parse /sci/ math',
+ cb: this.math
+ });
+ }
+ return Main.ready(function() {
+ return $.global(function() {
+ var j, len, node, ref1;
+ window.clickable_ids = false;
+ ref1 = document.querySelectorAll('.posteruid, .capcode');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ node = ref1[j];
+ node.removeEventListener('click', window.idClick, false);
+ }
+ });
+ });
+ },
+ code: function() {
+ if (this.isClone) {
+ return;
+ }
+ return $.ready((function(_this) {
+ return function() {
+ var i, j, len, pre, ref;
+ ref = $$('.prettyprint', _this.nodes.comment);
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ pre = ref[i];
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ $.event('prettyprint', {
+ ID: _this.fullID,
+ i: i,
+ html: pre.innerHTML
+ }, window);
+ }
+ }
+ };
+ })(this));
+ },
+ math: function() {
+ var cb, j, len, wbr, wbrs;
+ if (!/\[(math|eqn)\]/.test(this.nodes.comment.textContent)) {
+ return;
+ }
+ if ((wbrs = $$('wbr', this.nodes.comment)).length) {
+ for (j = 0, len = wbrs.length; j < len; j++) {
+ wbr = wbrs[j];
+ $.rm(wbr);
+ }
+ this.nodes.comment.normalize();
+ }
+ cb = (function(_this) {
+ return function() {
+ if (!doc.contains(_this.nodes.comment)) {
+ return;
+ }
+ $.off(d, 'PostsInserted', cb);
+ return $.event('mathjax', null, _this.nodes.comment);
+ };
+ })(this);
+ $.on(d, 'PostsInserted', cb);
+ return cb();
+ }
+ };
+
+ return Fourchan;
+
+}).call(this);
+
+IDColor = (function() {
+ var IDColor;
+
+ IDColor = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) {
+ return;
+ }
+ this.ids = {
+ Heaven: [0, 0, 0, '#fff']
+ };
+ return Callbacks.Post.push({
+ name: 'Color User IDs',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var rgb, span, style, uid;
+ if (this.isClone || !((uid = this.info.uniqueID) && (span = $('span.hand', this.nodes.uniqueID)))) {
+ return;
+ }
+ rgb = IDColor.ids[uid] || IDColor.compute(uid);
+ style = span.style;
+ style.color = rgb[3];
+ style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
+ return $.addClass(span, 'painted');
+ },
+ compute: function(uid) {
+ var hash, rgb;
+ hash = IDColor.hash(uid);
+ rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
+ rgb.push((rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff');
+ return this.ids[uid] = rgb;
+ },
+ hash: function(uid) {
+ var i, msg;
+ msg = 0;
+ i = 0;
+ while (i < 8) {
+ msg = (msg << 5) - msg + uid.charCodeAt(i++);
+ }
+ return msg;
+ }
+ };
+
+ return IDColor;
+
+}).call(this);
+
+IDHighlight = (function() {
+ var IDHighlight;
+
+ IDHighlight = {
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Highlight by User ID',
+ cb: this.node
+ });
+ },
+ uniqueID: null,
+ node: function() {
+ if (this.nodes.uniqueID) {
+ $.on(this.nodes.uniqueID, 'click', IDHighlight.click(this));
+ }
+ if (this.nodes.capcode) {
+ $.on(this.nodes.capcode, 'click', IDHighlight.click(this));
+ }
+ if (!this.isClone) {
+ return IDHighlight.set(this);
+ }
+ },
+ set: function(post) {
+ var match;
+ match = (post.info.uniqueID || post.info.capcode) === IDHighlight.uniqueID;
+ return $[match ? 'addClass' : 'rmClass'](post.nodes.post, 'highlight');
+ },
+ click: function(post) {
+ return function() {
+ var uniqueID;
+ uniqueID = post.info.uniqueID || post.info.capcode;
+ IDHighlight.uniqueID = IDHighlight.uniqueID === uniqueID ? null : uniqueID;
+ return g.posts.forEach(IDHighlight.set);
+ };
+ }
+ };
+
+ return IDHighlight;
+
+}).call(this);
+
+Keybinds = (function() {
+ var Keybinds;
+
+ Keybinds = {
+ init: function() {
+ var hotkey, init;
+ if (!Conf['Keybinds']) {
+ return;
+ }
+ for (hotkey in Config.hotkeys) {
+ $.sync(hotkey, Keybinds.sync);
+ }
+ init = function() {
+ var i, len, node, ref;
+ $.off(d, '4chanXInitFinished', init);
+ $.on(d, 'keydown', Keybinds.keydown);
+ ref = $$('[accesskey]');
+ for (i = 0, len = ref.length; i < len; i++) {
+ node = ref[i];
+ node.removeAttribute('accesskey');
+ }
+ };
+ return $.on(d, '4chanXInitFinished', init);
+ },
+ sync: function(key, hotkey) {
+ return Conf[hotkey] = key;
+ },
+ keydown: function(e) {
+ var form, i, key, len, notification, notifications, op, ref, ref1, ref2, ref3, ref4, ref5, searchInput, target, thread, threadRoot;
+ if (!(key = Keybinds.keyCode(e))) {
+ return;
+ }
+ target = e.target;
+ if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') {
+ if (!(/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) && !/^Alt\+(\d|Up|Down|Left|Right)$/.test(key))) {
+ return;
+ }
+ }
+ if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Index'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
+ threadRoot = Nav.getThread();
+ if (op = $('.op', threadRoot)) {
+ thread = Get.postFromNode(op).thread;
+ }
+ }
+ switch (key) {
+ case Conf['Toggle board list']:
+ if (!Conf['Custom Board Navigation']) {
+ return;
+ }
+ Header.toggleBoardList();
+ break;
+ case Conf['Toggle header']:
+ Header.toggleBarVisibility();
+ break;
+ case Conf['Open empty QR']:
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ Keybinds.qr();
+ break;
+ case Conf['Open QR']:
+ if (!(QR.postingIsEnabled && threadRoot)) {
+ return;
+ }
+ Keybinds.qr(threadRoot);
+ break;
+ case Conf['Open settings']:
+ Settings.open();
+ break;
+ case Conf['Close']:
+ if (Settings.dialog) {
+ Settings.close();
+ } else if ((notifications = $$('.notification')).length) {
+ for (i = 0, len = notifications.length; i < len; i++) {
+ notification = notifications[i];
+ $('.close', notification).click();
+ }
+ } else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) {
+ if (Conf['Persistent QR']) {
+ QR.hide();
+ } else {
+ QR.close();
+ }
+ } else if (Embedding.lastEmbed) {
+ Embedding.closeFloat();
+ } else {
+ return;
+ }
+ break;
+ case Conf['Spoiler tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('spoiler', target);
+ break;
+ case Conf['Code tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('code', target);
+ break;
+ case Conf['Eqn tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('eqn', target);
+ break;
+ case Conf['Math tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('math', target);
+ break;
+ case Conf['SJIS tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('sjis', target);
+ break;
+ case Conf['Toggle sage']:
+ if (!(QR.nodes && !QR.nodes.el.hidden)) {
+ return;
+ }
+ Keybinds.sage();
+ break;
+ case Conf['Submit QR']:
+ if (!(QR.nodes && !QR.nodes.el.hidden)) {
+ return;
+ }
+ if (!QR.status()) {
+ QR.submit();
+ }
+ break;
+ case Conf['Update']:
+ switch (g.VIEW) {
+ case 'thread':
+ if (!Conf['Thread Updater']) {
+ return;
+ }
+ ThreadUpdater.update();
+ break;
+ case 'index':
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ Index.update();
+ break;
+ default:
+ return;
+ }
+ break;
+ case Conf['Watch']:
+ if (!(ThreadWatcher.enabled && thread)) {
+ return;
+ }
+ ThreadWatcher.toggle(thread);
+ break;
+ case Conf['Update thread watcher']:
+ if (!ThreadWatcher.enabled) {
+ return;
+ }
+ ThreadWatcher.buttonFetchAll();
+ break;
+ case Conf['Expand image']:
+ if (!(ImageExpand.enabled && threadRoot)) {
+ return;
+ }
+ Keybinds.img(threadRoot);
+ break;
+ case Conf['Expand images']:
+ if (!(ImageExpand.enabled && threadRoot)) {
+ return;
+ }
+ Keybinds.img(threadRoot, true);
+ break;
+ case Conf['Open Gallery']:
+ if (!Gallery.enabled) {
+ return;
+ }
+ Gallery.cb.toggle();
+ break;
+ case Conf['fappeTyme']:
+ if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread'))) {
+ return;
+ }
+ FappeTyme.toggle('fappe');
+ break;
+ case Conf['werkTyme']:
+ if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread'))) {
+ return;
+ }
+ FappeTyme.toggle('werk');
+ break;
+ case Conf['Front page']:
+ if (Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
+ Index.userPageNav(1);
+ } else {
+ window.location = "/" + g.BOARD + "/";
+ }
+ break;
+ case Conf['Open front page']:
+ $.open("/" + g.BOARD + "/");
+ break;
+ case Conf['Next page']:
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ if (Conf['JSON Index']) {
+ if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
+ return;
+ }
+ $('.next button', Index.pagelist).click();
+ } else {
+ if (form = $('.next form')) {
+ window.location = form.action;
+ }
+ }
+ break;
+ case Conf['Previous page']:
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ if (Conf['JSON Index']) {
+ if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
+ return;
+ }
+ $('.prev button', Index.pagelist).click();
+ } else {
+ if (form = $('.prev form')) {
+ window.location = form.action;
+ }
+ }
+ break;
+ case Conf['Search form']:
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ searchInput = Conf['JSON Index'] ? Index.searchInput : $.id('search-box');
+ Header.scrollToIfNeeded(searchInput);
+ searchInput.focus();
+ break;
+ case Conf['Paged mode']:
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
+ break;
+ case Conf['Infinite scrolling mode']:
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
+ break;
+ case Conf['All pages mode']:
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
+ break;
+ case Conf['Open catalog']:
+ if (g.BOARD.ID === 'f') {
+ return;
+ }
+ window.location = CatalogLinks.catalog();
+ break;
+ case Conf['Cycle sort type']:
+ if (!(Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ Index.cycleSortType();
+ break;
+ case Conf['Next thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Nav.scroll(+1);
+ break;
+ case Conf['Previous thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Nav.scroll(-1);
+ break;
+ case Conf['Expand thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ ExpandThread.toggle(thread);
+ break;
+ case Conf['Open thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Keybinds.open(thread);
+ break;
+ case Conf['Open thread tab']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Keybinds.open(thread, true);
+ break;
+ case Conf['Next reply']:
+ if (!threadRoot) {
+ return;
+ }
+ Keybinds.hl(+1, threadRoot);
+ break;
+ case Conf['Previous reply']:
+ if (!threadRoot) {
+ return;
+ }
+ Keybinds.hl(-1, threadRoot);
+ break;
+ case Conf['Deselect reply']:
+ if (!threadRoot) {
+ return;
+ }
+ Keybinds.hl(0, threadRoot);
+ break;
+ case Conf['Hide']:
+ if (!thread) {
+ return;
+ }
+ if (ThreadHiding.db) {
+ ThreadHiding.toggle(thread);
+ }
+ break;
+ case Conf['Previous Post Quoting You']:
+ if (!(threadRoot && QuoteYou.db)) {
+ return;
+ }
+ QuoteYou.cb.seek('preceding');
+ break;
+ case Conf['Next Post Quoting You']:
+ if (!(threadRoot && QuoteYou.db)) {
+ return;
+ }
+ QuoteYou.cb.seek('following');
+ break;
+ default:
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ },
+ keyCode: function(e) {
+ var kc, key;
+ key = (function() {
+ switch (kc = e.keyCode) {
+ case 8:
+ return '';
+ case 13:
+ return 'Enter';
+ case 27:
+ return 'Esc';
+ case 32:
+ return 'Space';
+ case 37:
+ return 'Left';
+ case 38:
+ return 'Up';
+ case 39:
+ return 'Right';
+ case 40:
+ return 'Down';
+ case 188:
+ return 'Comma';
+ case 190:
+ return 'Period';
+ case 191:
+ return 'Slash';
+ case 59:
+ case 186:
+ return 'Semicolon';
+ default:
+ if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) {
+ return String.fromCharCode(kc).toLowerCase();
+ } else if ((96 <= kc && kc <= 105)) {
+ return String.fromCharCode(kc - 48).toLowerCase();
+ } else {
+ return null;
+ }
+ }
+ })();
+ if (key) {
+ if (e.altKey) {
+ key = 'Alt+' + key;
+ }
+ if (e.ctrlKey) {
+ key = 'Ctrl+' + key;
+ }
+ if (e.metaKey) {
+ key = 'Meta+' + key;
+ }
+ if (e.shiftKey) {
+ key = 'Shift+' + key;
+ }
+ }
+ return key;
+ },
+ qr: function(thread) {
+ QR.open();
+ if (thread != null) {
+ QR.quote.call($('input', $('.post.highlight', thread) || thread));
+ }
+ return QR.nodes.com.focus();
+ },
+ tags: function(tag, ta) {
+ var range, selEnd, selStart, supported, value;
+ supported = (function() {
+ switch (tag) {
+ case 'spoiler':
+ return !!$('.postForm input[name=spoiler]');
+ case 'code':
+ return g.BOARD.ID === 'g';
+ case 'math':
+ case 'eqn':
+ return g.BOARD.ID === 'sci';
+ case 'sjis':
+ return g.BOARD.ID === 'jp';
+ }
+ })();
+ if (!supported) {
+ new Notice('warning', "[" + tag + "] tags are not supported on /" + g.BOARD + "/.", 20);
+ }
+ value = ta.value;
+ selStart = ta.selectionStart;
+ selEnd = ta.selectionEnd;
+ ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd);
+ range = ("[" + tag + "]").length + selEnd;
+ ta.setSelectionRange(range, range);
+ return $.event('input', null, ta);
+ },
+ 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 {
+ post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread));
+ return ImageExpand.toggle(post);
+ }
+ },
+ open: function(thread, tab) {
+ var url;
+ if (g.VIEW !== 'index') {
+ return;
+ }
+ url = "/" + thread.board + "/thread/" + thread;
+ if (tab) {
+ return $.open(url);
+ } else {
+ return location.href = url;
+ }
+ },
+ hl: function(delta, thread) {
+ var axis, height, i, len, next, postEl, replies, reply, root;
+ postEl = $('.reply.highlight', thread);
+ if (!delta) {
+ if (postEl) {
+ $.rmClass(postEl, 'highlight');
+ }
+ return;
+ }
+ if (postEl) {
+ height = postEl.getBoundingClientRect().height;
+ if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
+ root = postEl.parentNode;
+ axis = delta === +1 ? 'following' : 'preceding';
+ if (!(next = $.x(axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
+ return;
+ }
+ Header.scrollToIfNeeded(next, delta === +1);
+ this.focus(next);
+ $.rmClass(postEl, 'highlight');
+ return;
+ }
+ $.rmClass(postEl, 'highlight');
+ }
+ replies = $$('.reply', thread);
+ if (delta === -1) {
+ replies.reverse();
+ }
+ for (i = 0, len = replies.length; i < len; i++) {
+ reply = replies[i];
+ if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) {
+ this.focus(reply);
+ return;
+ }
+ }
+ },
+ focus: function(post) {
+ return $.addClass(post, 'highlight');
+ }
+ };
+
+ return Keybinds;
+
+}).call(this);
+
+Nav = (function() {
+ var Nav;
+
+ Nav = {
+ init: function() {
+ var append, next, prev, span;
+ switch (g.VIEW) {
+ case 'index':
+ if (!Conf['Index Navigation']) {
+ return;
+ }
+ break;
+ case 'thread':
+ if (!Conf['Reply Navigation']) {
+ return;
+ }
+ break;
+ default:
+ return;
+ }
+ span = $.el('span', {
+ id: 'navlinks'
+ });
+ prev = $.el('a', {
+ textContent: 'â–²',
+ href: 'javascript:;'
+ });
+ next = $.el('a', {
+ textContent: 'â–¼',
+ href: 'javascript:;'
+ });
+ $.on(prev, 'click', this.prev);
+ $.on(next, 'click', this.next);
+ $.add(span, [prev, $.tn(' '), next]);
+ append = function() {
+ $.off(d, '4chanXInitFinished', append);
+ return $.add(d.body, span);
+ };
+ return $.on(d, '4chanXInitFinished', append);
+ },
+ prev: function() {
+ if (g.VIEW === 'thread') {
+ return window.scrollTo(0, 0);
+ } else {
+ return Nav.scroll(-1);
+ }
+ },
+ next: function() {
+ if (g.VIEW === 'thread') {
+ return window.scrollTo(0, d.body.scrollHeight);
+ } else {
+ return Nav.scroll(+1);
+ }
+ },
+ getThread: function() {
+ var i, len, ref, thread, threadRoot;
+ ref = $$('.thread');
+ for (i = 0, len = ref.length; i < len; i++) {
+ threadRoot = ref[i];
+ thread = Get.threadFromRoot(threadRoot);
+ if (thread.isHidden && !thread.stub) {
+ continue;
+ }
+ if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) {
+ return threadRoot;
+ }
+ }
+ return $('.board');
+ },
+ scroll: function(delta) {
+ var axis, extra, next, ref, thread, top;
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
+ }
+ thread = Nav.getThread();
+ axis = delta === +1 ? 'following' : 'preceding';
+ if (next = $.x(axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
+ top = Header.getTopOf(thread);
+ if (delta === +1 && top < 5 || delta === -1 && top > -5) {
+ thread = next;
+ }
+ }
+ extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom;
+ if (extra > 0) {
+ d.body.style.marginBottom = extra + "px";
+ }
+ Header.scrollTo(thread);
+ if (extra > 0 && !Nav.haveExtra) {
+ Nav.haveExtra = true;
+ return $.on(d, 'scroll', Nav.removeExtra);
+ }
+ },
+ removeExtra: function() {
+ var extra;
+ extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;
+ if (extra > 0) {
+ return d.body.style.marginBottom = extra + "px";
+ } else {
+ d.body.style.marginBottom = null;
+ delete Nav.haveExtra;
+ return $.off(d, 'scroll', Nav.removeExtra);
+ }
+ }
+ };
+
+ return Nav;
+
+}).call(this);
+
+NormalizeURL = (function() {
+ var NormalizeURL;
+
+ NormalizeURL = {
+ init: function() {
+ var pathname;
+ if (!Conf['Normalize URL']) {
+ return;
+ }
+ pathname = location.pathname.split(/\/+/);
+ switch (g.VIEW) {
+ case 'thread':
+ pathname[2] = 'thread';
+ pathname = pathname.slice(0, 4);
+ break;
+ case 'index':
+ pathname = pathname.slice(0, 3);
+ }
+ pathname = pathname.join('/');
+ if (location.pathname !== pathname) {
+ return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
+ }
+ }
+ };
+
+ return NormalizeURL;
+
+}).call(this);
+
+PSAHiding = (function() {
+ var PSAHiding;
+
+ PSAHiding = {
+ init: function() {
+ if (!Conf['Announcement Hiding']) {
+ return;
+ }
+ $.addClass(doc, 'hide-announcement');
+ return $.one(d, '4chanXInitFinished', this.setup);
+ },
+ setup: function() {
+ var btn, entry, hr, psa, ref;
+ if (!(psa = PSAHiding.psa = $.id('globalMessage'))) {
+ $.rmClass(doc, 'hide-announcement');
+ return;
+ }
+ if ((hr = (ref = $.id('globalToggle')) != null ? ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
+ PSAHiding.hr = hr;
+ }
+ entry = {
+ el: $.el('a', {
+ textContent: 'Show announcement',
+ className: 'show-announcement',
+ href: 'javascript:;'
+ }),
+ order: 50,
+ open: function() {
+ return PSAHiding.hidden;
+ }
+ };
+ Header.menu.addEntry(entry);
+ $.on(entry.el, 'click', PSAHiding.toggle);
+ PSAHiding.btn = btn = $.el('span', {
+ title: 'Mark announcement as read and hide.',
+ className: 'hide-announcement'
+ });
+ $.extend(btn, {
+ innerHTML: "[
Dismiss ]"
+ });
+ $.on(btn, 'click', PSAHiding.toggle);
+ $.get('hiddenPSA', 0, function(arg) {
+ var hiddenPSA;
+ hiddenPSA = arg.hiddenPSA;
+ PSAHiding.sync(hiddenPSA);
+ $.add(psa, btn);
+ return $.rmClass(doc, 'hide-announcement');
+ });
+ return $.sync('hiddenPSA', PSAHiding.sync);
+ },
+ toggle: function() {
+ var UTC;
+ if ($.hasClass(this, 'hide-announcement')) {
+ UTC = +$.id('globalMessage').dataset.utc;
+ $.set('hiddenPSA', UTC);
+ } else {
+ $.event('CloseMenu');
+ $["delete"]('hiddenPSA');
+ }
+ return PSAHiding.sync(UTC);
+ },
+ sync: function(UTC) {
+ var psa, ref;
+ psa = PSAHiding.psa;
+ PSAHiding.hidden = PSAHiding.btn.hidden = (UTC != null) && UTC >= +psa.dataset.utc;
+ if (PSAHiding.hidden) {
+ $.rm(psa);
+ } else {
+ $.after($.id('globalToggle'), psa);
+ }
+ if ((ref = PSAHiding.hr) != null) {
+ ref.hidden = PSAHiding.hidden;
+ }
+ }
+ };
+
+ return PSAHiding;
+
+}).call(this);
+
+RelativeDates = (function() {
+ var RelativeDates,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ RelativeDates = {
+ INTERVAL: $.MINUTE / 2,
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Index'] && g.BOARD.ID !== 'f') {
+ this.flush();
+ $.on(d, 'visibilitychange ThreadUpdate', this.flush);
+ }
+ if (Conf['Relative Post Dates']) {
+ return Callbacks.Post.push({
+ name: 'Relative Post Dates',
+ cb: this.node
+ });
+ }
+ },
+ node: function() {
+ var dateEl;
+ dateEl = this.nodes.date;
+ if (Conf['Relative Date Title']) {
+ $.on(dateEl, 'mouseover', (function(_this) {
+ return function() {
+ return RelativeDates.hover(_this);
+ };
+ })(this));
+ return;
+ }
+ if (this.isClone) {
+ return;
+ }
+ dateEl.title = dateEl.textContent;
+ return RelativeDates.update(this);
+ },
+ 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 * years) > 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) {
+ unit += 's';
+ }
+ return rounded + " " + unit + " ago";
+ },
+ stale: [],
+ flush: function() {
+ var data, i, len, now, ref;
+ if (d.hidden) {
+ return;
+ }
+ now = new Date();
+ ref = RelativeDates.stale;
+ for (i = 0, len = ref.length; i < len; i++) {
+ data = ref[i];
+ RelativeDates.update(data, now);
+ }
+ RelativeDates.stale = [];
+ clearTimeout(RelativeDates.timeout);
+ return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL);
+ },
+ hover: function(post) {
+ var date, diff, now;
+ date = post.info.date;
+ now = new Date();
+ diff = now - date;
+ return post.nodes.date.title = RelativeDates.relative(diff, now, date);
+ },
+ update: function(data, now) {
+ var date, diff, i, isPost, len, ref, relative, singlePost;
+ isPost = data instanceof Post;
+ date = isPost ? data.info.date : new Date(+data.dataset.utc);
+ now || (now = new Date());
+ diff = now - date;
+ relative = RelativeDates.relative(diff, now, date);
+ if (isPost) {
+ ref = [data].concat(data.clones);
+ for (i = 0, len = ref.length; i < len; i++) {
+ singlePost = ref[i];
+ singlePost.nodes.date.firstChild.textContent = relative;
+ }
+ } else {
+ data.firstChild.textContent = relative;
+ }
+ return RelativeDates.setOwnTimeout(diff, data);
+ },
+ setOwnTimeout: function(diff, data) {
+ var delay;
+ delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY;
+ return setTimeout(RelativeDates.markStale, delay, data);
+ },
+ markStale: function(data) {
+ if (indexOf.call(RelativeDates.stale, data) >= 0) {
+ return;
+ }
+ if (data instanceof Post && !g.posts[data.fullID]) {
+ return;
+ }
+ return RelativeDates.stale.push(data);
+ }
+ };
+
+ return RelativeDates;
+
+}).call(this);
+
+RemoveSpoilers = (function() {
+ var RemoveSpoilers,
+ slice = [].slice;
+
+ RemoveSpoilers = {
+ init: function() {
+ if (Conf['Reveal Spoilers']) {
+ $.addClass(doc, 'reveal-spoilers');
+ }
+ if (!Conf['Remove Spoilers']) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Reveal Spoilers',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Reveal Spoilers',
+ cb: this.node
+ });
+ if (g.VIEW === 'archive') {
+ return $.ready(function() {
+ return RemoveSpoilers.unspoiler($.id('arc-list'));
+ });
+ }
+ },
+ node: function() {
+ return RemoveSpoilers.unspoiler(this.nodes.comment);
+ },
+ unspoiler: function(el) {
+ var i, len, span, spoiler, spoilers;
+ spoilers = $$('s', el);
+ for (i = 0, len = spoilers.length; i < len; i++) {
+ spoiler = spoilers[i];
+ span = $.el('span', {
+ className: 'removed-spoiler'
+ });
+ $.replace(spoiler, span);
+ $.add(span, slice.call(spoiler.childNodes));
+ }
+ }
+ };
+
+ return RemoveSpoilers;
+
+}).call(this);
+
+Report = (function() {
+ var Report;
+
+ Report = {
+ init: function() {
+ var match;
+ if (!(match = location.search.match(/\bno=(\d+)/))) {
+ return;
+ }
+ Captcha.replace.init();
+ this.postID = +match[1];
+ return $.ready(this.ready);
+ },
+ ready: function() {
+ var passAd, prev, ref;
+ $.addStyle(CSS.report);
+ if (Conf['Archive Report']) {
+ Report.archive();
+ }
+ if ((passAd = $('a[href="https://www.4chan.org/pass"]'))) {
+ $.extend(passAd, {
+ textContent: 'Complain',
+ href: 'https://www.4chan-x.net/captchas.html',
+ tabIndex: -1
+ });
+ passAd.parentNode.normalize();
+ if (((ref = (prev = passAd.previousSibling)) != null ? ref.nodeType : void 0) === Node.TEXT_NODE) {
+ prev.nodeValue = prev.nodeValue.replace(/4chan Pass[^\.]*\./i, 'reCAPTCHA malfunctioning?');
+ }
+ $.after(passAd, [
+ $.tn('] ['), $.el('a', {
+ href: 'mailto:4chanpass@4chan.org?subject=4chan%20Pass%20-%20Purchase%20Support',
+ textContent: 'Email 4chan',
+ target: '_blank',
+ tabIndex: -1
+ })
+ ]);
+ }
+ if (!Conf['Use Recaptcha v1 in Reports'] && !Conf['Force Noscript Captcha'] && Main.jsEnabled) {
+ return new MutationObserver(function() {
+ Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
+ return Report.fit('body');
+ }).observe(d.body, {
+ childList: true,
+ attributes: true,
+ subtree: true
+ });
+ } else {
+ return Report.fit('body');
+ }
+ },
+ fit: function(selector) {
+ var dy, el;
+ if (!((el = $(selector, doc)) && getComputedStyle(el).visibility !== 'hidden')) {
+ return;
+ }
+ dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8;
+ if (dy > 0) {
+ return window.resizeBy(0, dy);
+ }
+ },
+ archive: function() {
+ var link, message, types, url;
+ Redirect.init();
+ if (!(url = Redirect.to('report', {
+ boardID: g.BOARD.ID,
+ postID: Report.postID
+ }))) {
+ return;
+ }
+ if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) {
+ if (location.hash === '#redirect') {
+ $.globalEval('self.close = function(){};');
+ window.resizeTo(700, 475);
+ location.replace(url);
+ }
+ return;
+ }
+ link = $.el('a', {
+ href: url,
+ textContent: 'Report to archive'
+ });
+ $.on(link, 'click', function(e) {
+ if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) {
+ return window.resizeTo(700, 475);
+ }
+ });
+ $.add(d.body, [$.tn(' ['), link, $.tn(']')]);
+ if (types = $.id('reportTypes')) {
+ return $.on(types, 'change', function(e) {
+ return $('form').action = e.target.value === 'illegal' ? '#redirect' : '';
+ });
+ }
+ }
+ };
+
+ return Report;
+
+}).call(this);
+
+ThreadLinks = (function() {
+ var ThreadLinks;
+
+ ThreadLinks = {
+ init: function() {
+ if (!(g.VIEW === 'index' && Conf['Open Threads in New Tab'])) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Thread Links',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Thread Links',
+ cb: this.catalogNode
+ });
+ },
+ node: function() {
+ if (this.isReply || this.isClone) {
+ return;
+ }
+ return ThreadLinks.process($('.replylink', this.nodes.info));
+ },
+ catalogNode: function() {
+ return ThreadLinks.process(this.nodes.thumb.parentNode);
+ },
+ process: function(link) {
+ return link.target = '_blank';
+ }
+ };
+
+ return ThreadLinks;
+
+}).call(this);
+
+Time = (function() {
+ var Time;
+
+ Time = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Time Formatting'])) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Time Formatting',
+ cb: this.node
+ });
+ },
+ node: function() {
+ if (this.isClone) {
+ return;
+ }
+ return this.nodes.date.textContent = Time.format(Conf['time'], this.info.date);
+ },
+ format: function(formatString, date) {
+ return formatString.replace(/%(.)/g, function(s, c) {
+ if (c in Time.formatters) {
+ return Time.formatters[c].call(date);
+ } else {
+ return s;
+ }
+ });
+ },
+ day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+ month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ zeroPad: function(n) {
+ if (n < 10) {
+ return "0" + n;
+ } else {
+ return n;
+ }
+ },
+ formatters: {
+ a: function() {
+ return Time.day[this.getDay()].slice(0, 3);
+ },
+ A: function() {
+ return Time.day[this.getDay()];
+ },
+ b: function() {
+ return Time.month[this.getMonth()].slice(0, 3);
+ },
+ B: function() {
+ return Time.month[this.getMonth()];
+ },
+ d: function() {
+ return Time.zeroPad(this.getDate());
+ },
+ e: function() {
+ return this.getDate();
+ },
+ H: function() {
+ return Time.zeroPad(this.getHours());
+ },
+ I: function() {
+ return Time.zeroPad(this.getHours() % 12 || 12);
+ },
+ k: function() {
+ return this.getHours();
+ },
+ l: function() {
+ return this.getHours() % 12 || 12;
+ },
+ m: function() {
+ return Time.zeroPad(this.getMonth() + 1);
+ },
+ M: function() {
+ return Time.zeroPad(this.getMinutes());
+ },
+ p: function() {
+ if (this.getHours() < 12) {
+ return 'AM';
+ } else {
+ return 'PM';
+ }
+ },
+ P: function() {
+ if (this.getHours() < 12) {
+ return 'am';
+ } else {
+ return 'pm';
+ }
+ },
+ S: function() {
+ return Time.zeroPad(this.getSeconds());
+ },
+ y: function() {
+ return this.getFullYear().toString().slice(2);
+ },
+ Y: function() {
+ return this.getFullYear();
+ },
+ '%': function() {
+ return '%';
+ }
+ }
+ };
+
+ return Time;
+
+}).call(this);
+
+Favicon = (function() {
+ var Favicon;
+
+ Favicon = {
+ init: function() {
+ return $.asap((function() {
+ return d.head && (Favicon.el = $('link[rel="shortcut icon"]', d.head));
+ }), Favicon.initAsap);
+ },
+ initAsap: function() {
+ var href;
+ Favicon.el.type = 'image/x-icon';
+ href = Favicon.el.href;
+ Favicon.SFW = /ws\.ico$/.test(href);
+ Favicon["default"] = href;
+ return Favicon["switch"]();
+ },
+ "switch": function() {
+ var f, i, items, t;
+ items = {
+ ferongr: ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxUlEQVR42q1TOwrCQBB9s0FRtJI0WoqFtSLYegoP4gVSeJsUHsHSI3iFeIqRXXgwrhlXwYHHhLwPTB7B36abBCV+0pA4DUBQUNZYQptGtW3jtoKyxgoe0yrBCoyZfL/5ioQ3URZOXW9I341l3oo+NXEZiW4CEuIzvPECopED4OaZ3RNmeAm4u+a8Jr5f17VyVoL8fr8qcltzwlyyj2iqcgPOQ9ExkHAITgD75bYBe0A5S4H/P9htuWMF3QXoQpwaKeT+lnsC6JE5I6aq6fEAAAAASUVORK5CYII=', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///8AcH4AtswA2PJ55fKi6fIA1/FtpPADAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0A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BZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAADCgANKAASOAATOwAZTAAwkQBAwQBV/wH////+Fmy4AAAAA3RSTlMAPse+s4iwAAAAM0lEQVQIW2NggAGuVasWgDBpDDAQUoSaob0Jao73lgVojOitUEazBZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC']
+ }[Conf['favicon']];
+ f = Favicon;
+ t = 'data:image/png;base64,';
+ i = 0;
+ while (items[i]) {
+ items[i] = t + items[i++];
+ }
+ f.unreadDead = items[0], f.unreadDeadY = items[1], f.unreadSFW = items[2], f.unreadSFWY = items[3], f.unreadNSFW = items[4], f.unreadNSFWY = items[5];
+ return f.update();
+ },
+ update: function() {
+ if (this.SFW) {
+ this.unread = this.unreadSFW;
+ return this.unreadY = this.unreadSFWY;
+ } else {
+ this.unread = this.unreadNSFW;
+ return this.unreadY = this.unreadNSFWY;
+ }
+ },
+ dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
+ logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAgMAAAC+UIlYAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAGlJREFUWMPtlkEKADEIA/tJP9lXLttQto2yHxgDHozTi0ToGK2WKZZ+HAQQMZc+xBwI4EZ+wAC2IfPuSIDOZJrSZQEAX9eVJhhwIuUYAnQe8rhAEMAZlTI2MID9f5Clyh0JeE1V1ZEAvB4qDfwuJTSGRAAAAABJRU5ErkJggg=='
+ };
+
+ return Favicon;
+
+}).call(this);
+
+MarkNewIPs = (function() {
+ var MarkNewIPs;
+
+ MarkNewIPs = {
+ init: function() {
+ if (g.VIEW !== 'thread' || !Conf['Mark New IPs']) {
+ return;
+ }
+ return Callbacks.Thread.push({
+ name: 'Mark New IPs',
+ cb: this.node
+ });
+ },
+ node: function() {
+ MarkNewIPs.ipCount = this.ipCount;
+ MarkNewIPs.postCount = this.posts.keys.length;
+ return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
+ },
+ onUpdate: function(e) {
+ var deletedPosts, fullID, i, ipCount, j, k, len, len1, newPosts, postCount, ref;
+ ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
+ if (ipCount == null) {
+ return;
+ }
+ switch (ipCount - MarkNewIPs.ipCount) {
+ case postCount - MarkNewIPs.postCount + deletedPosts.length:
+ i = MarkNewIPs.ipCount;
+ for (j = 0, len = newPosts.length; j < len; j++) {
+ fullID = newPosts[j];
+ MarkNewIPs.markNew(g.posts[fullID], ++i);
+ }
+ break;
+ case -deletedPosts.length:
+ for (k = 0, len1 = newPosts.length; k < len1; k++) {
+ fullID = newPosts[k];
+ MarkNewIPs.markOld(g.posts[fullID]);
+ }
+ }
+ MarkNewIPs.ipCount = ipCount;
+ return MarkNewIPs.postCount = postCount;
+ },
+ markNew: function(post, ipCount) {
+ var counter, suffix;
+ suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
+ counter = $.el('span', {
+ className: 'ip-counter',
+ textContent: "(" + ipCount + ")"
+ });
+ post.nodes.nameBlock.title = "This is the " + ipCount + suffix + " IP in the thread.";
+ $.add(post.nodes.nameBlock, [$.tn(' '), counter]);
+ return $.addClass(post.nodes.root, 'new-ip');
+ },
+ markOld: function(post) {
+ post.nodes.nameBlock.title = 'Not the first post from this IP.';
+ return $.addClass(post.nodes.root, 'old-ip');
+ }
+ };
+
+ return MarkNewIPs;
+
+}).call(this);
+
+ReplyPruning = (function() {
+ var ReplyPruning;
+
+ ReplyPruning = {
+ init: function() {
+ var el, label;
+ if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) {
+ return;
+ }
+ this.active = !(Conf['Quote Threading'] && Conf['Thread Quotes']);
+ this.container = $.frag();
+ this.summary = $.el('span', {
+ hidden: true,
+ className: 'summary'
+ });
+ this.summary.style.cursor = 'pointer';
+ $.on(this.summary, 'click', (function(_this) {
+ return function() {
+ _this.inputs.enabled.checked = !_this.inputs.enabled.checked;
+ return $.event('change', null, _this.inputs.enabled);
+ };
+ })(this));
+ label = UI.checkbox('Prune Replies', 'Show Last', this.active);
+ el = $.el('span', {
+ title: 'Maximum number of replies to show.'
+ }, {
+ innerHTML: "
"
+ });
+ $.prepend(el, label);
+ this.inputs = {
+ enabled: label.firstElementChild,
+ replies: el.lastElementChild
+ };
+ $.on(this.inputs.enabled, 'change', this.setEnabled);
+ $.on(this.inputs.replies, 'change', $.cb.value);
+ Header.menu.addEntry({
+ el: el,
+ order: 190
+ });
+ return Callbacks.Thread.push({
+ name: 'Reply Pruning',
+ cb: this.node
+ });
+ },
+ position: 0,
+ hidden: 0,
+ hiddenFiles: 0,
+ total: 0,
+ totalFiles: 0,
+ setEnabled: function() {
+ var other;
+ other = QuoteThreading.input;
+ if (this.checked && (other != null ? other.checked : void 0)) {
+ other.checked = false;
+ $.event('change', null, other);
+ }
+ return ReplyPruning.active = this.checked;
+ },
+ showIfHidden: function(id) {
+ var ref;
+ if ((ref = ReplyPruning.container) != null ? ref.getElementById(id) : void 0) {
+ ReplyPruning.inputs.enabled.checked = false;
+ return $.event('change', null, ReplyPruning.inputs.enabled);
+ }
+ },
+ node: function() {
+ var ref;
+ ReplyPruning.thread = this;
+ this.posts.forEach(function(post) {
+ if (post.isReply) {
+ ReplyPruning.total++;
+ if (post.file) {
+ return ReplyPruning.totalFiles++;
+ }
+ }
+ });
+ if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (0 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) {
+ ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false;
+ }
+ $.after(this.OP.nodes.root, ReplyPruning.summary);
+ $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update);
+ $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update);
+ $.on(d, 'ThreadUpdate', ReplyPruning.updateCount);
+ $.on(d, 'ThreadUpdate', ReplyPruning.update);
+ return ReplyPruning.update();
+ },
+ updateCount: function(e) {
+ var fullID, i, len, ref;
+ if (e.detail[404]) {
+ return;
+ }
+ ref = e.detail.newPosts;
+ for (i = 0, len = ref.length; i < len; i++) {
+ fullID = ref[i];
+ ReplyPruning.total++;
+ if (g.posts[fullID].file) {
+ ReplyPruning.totalFiles++;
+ }
+ }
+ },
+ update: function() {
+ var boardTop, frag, hidden2, oldPos, post, posts;
+ hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0;
+ oldPos = d.body.clientHeight - window.scrollY;
+ posts = ReplyPruning.thread.posts;
+ if (ReplyPruning.hidden < hidden2) {
+ while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) {
+ post = posts[posts.keys[ReplyPruning.position++]];
+ if (post.isReply && !post.isFetchedQuote) {
+ $.add(ReplyPruning.container, post.nodes.root);
+ ReplyPruning.hidden++;
+ if (post.file) {
+ ReplyPruning.hiddenFiles++;
+ }
+ }
+ }
+ } else if (ReplyPruning.hidden > hidden2) {
+ frag = $.frag();
+ while (ReplyPruning.hidden > hidden2 && ReplyPruning.position > 0) {
+ post = posts[posts.keys[--ReplyPruning.position]];
+ if (post.isReply && !post.isFetchedQuote) {
+ $.prepend(frag, post.nodes.root);
+ ReplyPruning.hidden--;
+ if (post.file) {
+ ReplyPruning.hiddenFiles--;
+ }
+ }
+ }
+ $.after(ReplyPruning.summary, frag);
+ $.event('PostsInserted');
+ }
+ ReplyPruning.summary.textContent = ReplyPruning.active ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles);
+ ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"];
+ if ((boardTop = Header.getTopOf($('.board'))) < 0) {
+ return window.scroll(window.scrollX, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop));
+ }
+ }
+ };
+
+ return ReplyPruning;
+
+}).call(this);
+
+ThreadExcerpt = (function() {
+ var ThreadExcerpt;
+
+ ThreadExcerpt = {
+ init: function() {
+ if (g.BOARD.ID !== 'f' || g.VIEW !== 'thread' || !Conf['Thread Excerpt']) {
+ return;
+ }
+ return Callbacks.Thread.push({
+ name: 'Thread Excerpt',
+ cb: this.node
+ });
+ },
+ node: function() {
+ return d.title = Get.threadExcerpt(this);
+ }
+ };
+
+ return ThreadExcerpt;
+
+}).call(this);
+
+ThreadStats = (function() {
+ var ThreadStats;
+
+ ThreadStats = {
+ init: function() {
+ var sc, statsHTML, statsTitle;
+ if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
+ return;
+ }
+ statsHTML = {
+ innerHTML: "
? /
? " + ((Conf["IP Count in Stats"]) ? " /
? " : "") + ((Conf["Page Count in Stats"]) ? " /
? " : "")
+ };
+ statsTitle = 'Posts / Files';
+ if (Conf['IP Count in Stats']) {
+ statsTitle += ' / IPs';
+ }
+ if (Conf['Page Count in Stats']) {
+ statsTitle += (g.BOARD.ID === 'f' ? ' / Purge Position' : ' / Page');
+ }
+ if (Conf['Updater and Stats in Header']) {
+ this.dialog = sc = $.el('span', {
+ id: 'thread-stats',
+ title: statsTitle
+ });
+ $.extend(sc, statsHTML);
+ $.ready(function() {
+ return Header.addShortcut(sc);
+ });
+ } else {
+ this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', {
+ innerHTML: "
" + (statsHTML).innerHTML + "
"
+ });
+ $.addClass(doc, 'float');
+ $.ready(function() {
+ return $.add(d.body, sc);
+ });
+ }
+ this.postCountEl = $('#post-count', sc);
+ this.fileCountEl = $('#file-count', sc);
+ this.ipCountEl = $('#ip-count', sc);
+ this.pageCountEl = $('#page-count', sc);
+ if (this.pageCountEl) {
+ $.on(this.pageCountEl, 'click', ThreadStats.fetchPage);
+ }
+ return Callbacks.Thread.push({
+ name: 'Thread Stats',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var fileCount, postCount;
+ postCount = 0;
+ fileCount = 0;
+ this.posts.forEach(function(post) {
+ postCount++;
+ if (post.file) {
+ fileCount++;
+ }
+ if (ThreadStats.pageCountEl) {
+ return ThreadStats.lastPost = post.info.date;
+ }
+ });
+ ThreadStats.thread = this;
+ ThreadStats.fetchPage();
+ ThreadStats.update(postCount, fileCount, this.ipCount);
+ return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate);
+ },
+ onUpdate: function(e) {
+ var fileCount, ipCount, newPosts, postCount, ref, ref1;
+ if (e.detail[404]) {
+ return;
+ }
+ ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount, ipCount = ref.ipCount, newPosts = ref.newPosts;
+ ThreadStats.update(postCount, fileCount, ipCount);
+ if (!ThreadStats.pageCountEl) {
+ return;
+ }
+ if (newPosts.length) {
+ ThreadStats.lastPost = g.posts[newPosts[newPosts.length - 1]].info.date;
+ }
+ if (g.BOARD.ID !== 'f' && ((ref1 = ThreadStats.pageCountEl) != null ? ref1.textContent : void 0) !== '1') {
+ return ThreadStats.fetchPage();
+ }
+ },
+ update: function(postCount, fileCount, ipCount) {
+ var fileCountEl, ipCountEl, postCountEl, thread;
+ thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl, ipCountEl = ThreadStats.ipCountEl;
+ postCountEl.textContent = postCount;
+ fileCountEl.textContent = fileCount;
+ if ((ipCount != null) && ipCountEl) {
+ ipCountEl.textContent = ipCount;
+ }
+ (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning');
+ return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning');
+ },
+ fetchPage: function() {
+ if (!ThreadStats.pageCountEl) {
+ return;
+ }
+ clearTimeout(ThreadStats.timeout);
+ if (ThreadStats.thread.isDead) {
+ ThreadStats.pageCountEl.textContent = 'Dead';
+ $.addClass(ThreadStats.pageCountEl, 'warning');
+ return;
+ }
+ ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 2 * $.MINUTE);
+ return $.ajax("//a.4cdn.org/" + ThreadStats.thread.board + "/threads.json", {
+ onload: ThreadStats.onThreadsLoad
+ }, {
+ whenModified: 'ThreadStats'
+ });
+ },
+ onThreadsLoad: function() {
+ var i, j, k, len, len1, len2, page, purgePos, ref, ref1, ref2, thread;
+ if (this.status === 200) {
+ ref = this.response;
+ for (i = 0, len = ref.length; i < len; i++) {
+ page = ref[i];
+ if (g.BOARD.ID === 'f') {
+ purgePos = 1;
+ ref1 = page.threads;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ thread = ref1[j];
+ if (thread.no < ThreadStats.thread.ID) {
+ purgePos++;
+ }
+ }
+ ThreadStats.pageCountEl.textContent = purgePos;
+ } else {
+ ref2 = page.threads;
+ for (k = 0, len2 = ref2.length; k < len2; k++) {
+ thread = ref2[k];
+ if (!(thread.no === ThreadStats.thread.ID)) {
+ continue;
+ }
+ ThreadStats.pageCountEl.textContent = page.page;
+ (page.page === this.response.length ? $.addClass : $.rmClass)(ThreadStats.pageCountEl, 'warning');
+ ThreadStats.lastPageUpdate = new Date(thread.last_modified * $.SECOND);
+ ThreadStats.retry();
+ return;
+ }
+ }
+ }
+ } else if (this.status === 304) {
+ return ThreadStats.retry();
+ }
+ },
+ retry: function() {
+ var ref;
+ if (g.BOARD.ID !== 'f' && ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((ref = ThreadStats.pageCountEl) != null ? ref.textContent : void 0) !== '1') {
+ clearTimeout(ThreadStats.timeout);
+ return ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 5 * $.SECOND);
+ }
+ }
+ };
+
+ return ThreadStats;
+
+}).call(this);
+
+ThreadUpdater = (function() {
+ var ThreadUpdater,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ ThreadUpdater = {
+ init: function() {
+ var conf, el, input, name, ref, sc, subEntries, updateLink;
+ if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
+ return;
+ }
+ this.audio = $.el('audio', {
+ src: ThreadUpdater.beep
+ });
+ if (Conf['Updater and Stats in Header']) {
+ this.dialog = sc = $.el('span', {
+ id: 'updater'
+ });
+ $.extend(sc, {
+ innerHTML: "
"
+ });
+ $.ready(function() {
+ return Header.addShortcut(sc);
+ });
+ } else {
+ this.dialog = sc = UI.dialog('updater', 'bottom: 0px; left: 0px;', {
+ innerHTML: "
"
+ });
+ $.addClass(doc, 'float');
+ $.ready(function() {
+ return $.add(d.body, sc);
+ });
+ }
+ this.checkPostCount = 0;
+ this.timer = $('#update-timer', sc);
+ this.status = $('#update-status', sc);
+ $.on(this.timer, 'click', this.update);
+ $.on(this.status, 'click', this.update);
+ updateLink = $.el('span', {
+ className: 'brackets-wrap updatelink'
+ });
+ $.extend(updateLink, {
+ innerHTML: "
Update "
+ });
+ Main.ready(function() {
+ var navLinksBot;
+ if ((navLinksBot = $('.navLinksBot'))) {
+ return $.add(navLinksBot, [$.tn(' '), updateLink]);
+ }
+ });
+ $.on(updateLink.firstElementChild, 'click', this.update);
+ subEntries = [];
+ ref = Config.updater.checkbox;
+ for (name in ref) {
+ conf = ref[name];
+ el = UI.checkbox(name, name);
+ el.title = conf[1];
+ input = el.firstElementChild;
+ $.on(input, 'change', $.cb.checked);
+ if (input.name === 'Scroll BG') {
+ $.on(input, 'change', this.cb.scrollBG);
+ this.cb.scrollBG();
+ } else if (input.name === 'Auto Update') {
+ $.on(input, 'change', this.setInterval);
+ }
+ subEntries.push({
+ el: el
+ });
+ }
+ this.settings = $.el('span', {
+ innerHTML: "
Interval "
+ });
+ $.on(this.settings, 'click', this.intervalShortcut);
+ subEntries.push({
+ el: this.settings
+ });
+ Header.menu.addEntry(this.entry = {
+ el: $.el('span', {
+ textContent: 'Updater'
+ }),
+ order: 110,
+ subEntries: subEntries
+ });
+ return Callbacks.Thread.push({
+ name: 'Thread Updater',
+ cb: this.node
+ });
+ },
+ node: function() {
+ ThreadUpdater.thread = this;
+ ThreadUpdater.root = this.OP.nodes.root.parentNode;
+ ThreadUpdater.outdateCount = 0;
+ ThreadUpdater.postIDs = [];
+ ThreadUpdater.fileIDs = [];
+ this.posts.forEach(function(post) {
+ ThreadUpdater.postIDs.push(post.ID);
+ if (post.file) {
+ return ThreadUpdater.fileIDs.push(post.ID);
+ }
+ });
+ ThreadUpdater.cb.interval.call($.el('input', {
+ value: Conf['Interval']
+ }));
+ $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);
+ $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
+ return ThreadUpdater.setInterval();
+ },
+
+ /*
+ http://freesound.org/people/pierrecartoons1979/sounds/90112/
+ cc-by-nc-3.0
+ */
+ beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA',
+ playBeep: function() {
+ var audio;
+ audio = ThreadUpdater.audio;
+ if (audio.paused) {
+ return audio.play();
+ } else {
+ return $.one(audio, 'ended', ThreadUpdater.playBeep);
+ }
+ },
+ cb: {
+ checkpost: function(e) {
+ if (e.detail.threadID !== ThreadUpdater.thread.ID) {
+ return;
+ }
+ ThreadUpdater.postID = e.detail.postID;
+ ThreadUpdater.checkPostCount = 0;
+ ThreadUpdater.outdateCount = 0;
+ return ThreadUpdater.setInterval();
+ },
+ visibility: function() {
+ if (d.hidden) {
+ return;
+ }
+ ThreadUpdater.outdateCount = 0;
+ if (ThreadUpdater.seconds > ThreadUpdater.interval) {
+ return ThreadUpdater.setInterval();
+ }
+ },
+ scrollBG: function() {
+ return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() {
+ return true;
+ } : function() {
+ return !d.hidden;
+ };
+ },
+ interval: function(e) {
+ var val;
+ val = parseInt(this.value, 10);
+ if (val < 1) {
+ val = 1;
+ }
+ ThreadUpdater.interval = this.value = val;
+ if (e) {
+ return $.cb.value.call(this);
+ }
+ },
+ load: function() {
+ var req;
+ req = ThreadUpdater.req;
+ switch (req.status) {
+ case 200:
+ ThreadUpdater.parse(req);
+ if (ThreadUpdater.thread.isArchived) {
+ return ThreadUpdater.kill();
+ } else {
+ return ThreadUpdater.setInterval();
+ }
+ break;
+ case 404:
+ return $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/catalog.json", {
+ onloadend: function() {
+ var confirmed, i, k, len, len1, page, ref, ref1, thread;
+ if (this.status === 200) {
+ confirmed = true;
+ ref = this.response;
+ for (i = 0, len = ref.length; i < len; i++) {
+ page = ref[i];
+ ref1 = page.threads;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ thread = ref1[k];
+ if (thread.no === ThreadUpdater.thread.ID) {
+ confirmed = false;
+ break;
+ }
+ }
+ }
+ } else {
+ confirmed = false;
+ }
+ if (confirmed) {
+ return ThreadUpdater.kill();
+ } else {
+ return ThreadUpdater.error(req);
+ }
+ }
+ });
+ default:
+ return ThreadUpdater.error(req);
+ }
+ }
+ },
+ kill: function() {
+ ThreadUpdater.thread.kill();
+ ThreadUpdater.setInterval();
+ return $.event('ThreadUpdate', {
+ 404: true,
+ threadID: ThreadUpdater.thread.fullID
+ });
+ },
+ error: function(req) {
+ if (req.status === 304) {
+ ThreadUpdater.set('status', '');
+ }
+ ThreadUpdater.setInterval();
+ if (!req.status) {
+ return ThreadUpdater.set('status', 'Connection Failed', 'warning');
+ } else if (req.status !== 304) {
+ return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning');
+ }
+ },
+ setInterval: function() {
+ var cur, interval, j, limit;
+ clearTimeout(ThreadUpdater.timeoutID);
+ if (ThreadUpdater.thread.isDead) {
+ ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning');
+ ThreadUpdater.set('timer', '');
+ return;
+ }
+ if (ThreadUpdater.postID && ThreadUpdater.checkPostCount < 5) {
+ ThreadUpdater.set('timer', '...', 'loading');
+ ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND);
+ return;
+ }
+ if (!Conf['Auto Update']) {
+ ThreadUpdater.set('timer', 'Update');
+ return;
+ }
+ interval = ThreadUpdater.interval;
+ if (Conf['Optional Increase']) {
+ limit = d.hidden ? 10 : 5;
+ j = Math.min(ThreadUpdater.outdateCount, limit);
+ cur = (Math.floor(interval * 0.1) || 1) * j * j;
+ ThreadUpdater.seconds = $.minmax(cur, interval, 300);
+ } else {
+ ThreadUpdater.seconds = interval;
+ }
+ return ThreadUpdater.timeout();
+ },
+ 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;
+ } else {
+ el.textContent = text;
+ }
+ return el.className = klass != null ? klass : (text === '' ? 'empty' : '');
+ },
+ timeout: function() {
+ if (ThreadUpdater.seconds) {
+ ThreadUpdater.set('timer', ThreadUpdater.seconds);
+ ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
+ } else {
+ ThreadUpdater.outdateCount++;
+ ThreadUpdater.update();
+ }
+ return ThreadUpdater.seconds--;
+ },
+ update: function() {
+ var ref;
+ clearTimeout(ThreadUpdater.timeoutID);
+ ThreadUpdater.set('timer', '...', 'loading');
+ if ((ref = ThreadUpdater.req) != null) {
+ ref.abort();
+ }
+ return ThreadUpdater.req = $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/thread/" + ThreadUpdater.thread + ".json", {
+ onloadend: ThreadUpdater.cb.load,
+ timeout: $.MINUTE
+ }, {
+ whenModified: 'ThreadUpdater'
+ });
+ },
+ updateThreadStatus: function(type, status) {
+ var change, hasChanged;
+ if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) {
+ return;
+ }
+ ThreadUpdater.thread.setStatus(type, status);
+ if (type === 'Closed' && ThreadUpdater.thread.isArchived) {
+ return;
+ }
+ change = type === 'Sticky' ? status ? 'now a sticky' : 'not a sticky anymore' : status ? 'now closed' : 'not closed anymore';
+ return new Notice('info', "The thread is " + change + ".", 30);
+ },
+ parse: function(req) {
+ var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, i, index, ipCountEl, k, l, lastPost, len, len1, len2, len3, m, newPosts, node, post, postObject, postObjects, posts, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, scroll, thread, unreadCount, unreadQYCount;
+ postObjects = req.response.posts;
+ OP = postObjects[0];
+ thread = ThreadUpdater.thread;
+ board = thread.board;
+ ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1];
+ if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts[lastPost].info.date < 30 * $.SECOND) {
+ return;
+ }
+ Build.spoilerRange[board] = OP.custom_spoiler;
+ thread.setStatus('Archived', !!OP.archived);
+ ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
+ ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
+ thread.postLimit = !!OP.bumplimit;
+ thread.fileLimit = !!OP.imagelimit;
+ if (OP.unique_ips != null) {
+ thread.ipCount = OP.unique_ips;
+ }
+ posts = [];
+ index = [];
+ files = [];
+ newPosts = [];
+ for (i = 0, len = postObjects.length; i < len; i++) {
+ postObject = postObjects[i];
+ ID = postObject.no;
+ index.push(ID);
+ if (postObject.fsize) {
+ files.push(ID);
+ }
+ if (ID <= lastPost) {
+ continue;
+ }
+ if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
+ post.resurrect();
+ continue;
+ }
+ newPosts.push(board + "." + ID);
+ node = Build.postFromObject(postObject, board.ID);
+ posts.push(new Post(node, thread, board));
+ if (ThreadUpdater.postID === ID) {
+ delete ThreadUpdater.postID;
+ }
+ }
+ deletedPosts = [];
+ ref1 = ThreadUpdater.postIDs;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ ID = ref1[k];
+ if (!(indexOf.call(index, ID) < 0)) {
+ continue;
+ }
+ thread.posts[ID].kill();
+ deletedPosts.push(board + "." + ID);
+ }
+ ThreadUpdater.postIDs = index;
+ deletedFiles = [];
+ ref2 = ThreadUpdater.fileIDs;
+ for (l = 0, len2 = ref2.length; l < len2; l++) {
+ ID = ref2[l];
+ if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) {
+ continue;
+ }
+ thread.posts[ID].kill(true);
+ deletedFiles.push(board + "." + ID);
+ }
+ ThreadUpdater.fileIDs = files;
+ if (!posts.length) {
+ ThreadUpdater.set('status', '');
+ } else {
+ ThreadUpdater.set('status', "+" + posts.length, 'new');
+ ThreadUpdater.outdateCount = 0;
+ unreadCount = (ref4 = Unread.posts) != null ? ref4.size : void 0;
+ unreadQYCount = (ref5 = Unread.postsQuotingYou) != null ? ref5.size : void 0;
+ Main.callbackNodes('Post', posts);
+ if (d.hidden || !d.hasFocus()) {
+ if (Conf['Beep Quoting You'] && ((ref6 = Unread.postsQuotingYou) != null ? ref6.size : void 0) > unreadQYCount) {
+ ThreadUpdater.playBeep();
+ if (Conf['Beep']) {
+ ThreadUpdater.playBeep();
+ }
+ } else if (Conf['Beep'] && ((ref7 = Unread.posts) != null ? ref7.size : void 0) > 0 && unreadCount === 0) {
+ ThreadUpdater.playBeep();
+ }
+ }
+ scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
+ firstPost = null;
+ for (m = 0, len3 = posts.length; m < len3; m++) {
+ post = posts[m];
+ if (!QuoteThreading.insert(post)) {
+ firstPost || (firstPost = post.nodes.root);
+ $.add(ThreadUpdater.root, post.nodes.root);
+ }
+ }
+ $.event('PostsInserted');
+ if (scroll) {
+ if (Conf['Bottom Scroll']) {
+ window.scrollTo(0, d.body.clientHeight);
+ } else {
+ if (firstPost) {
+ Header.scrollTo(firstPost);
+ }
+ }
+ }
+ }
+ if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) {
+ ipCountEl.textContent = OP.unique_ips;
+ ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are');
+ ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters');
+ }
+ return $.event('ThreadUpdate', {
+ 404: false,
+ threadID: thread.fullID,
+ newPosts: newPosts,
+ deletedPosts: deletedPosts,
+ deletedFiles: deletedFiles,
+ postCount: OP.replies + 1,
+ fileCount: OP.images + !!OP.fsize,
+ ipCount: OP.unique_ips
+ });
+ }
+ };
+
+ return ThreadUpdater;
+
+}).call(this);
+
+ThreadWatcher = (function() {
+ var ThreadWatcher,
+ slice = [].slice;
+
+ ThreadWatcher = {
+ init: function() {
+ var sc;
+ if (!(this.enabled = Conf['Thread Watcher'])) {
+ return;
+ }
+ this.shortcut = sc = $.el('a', {
+ id: 'watcher-link',
+ textContent: 'Watcher',
+ title: 'Thread Watcher',
+ href: 'javascript:;',
+ className: 'disabled fa fa-eye'
+ });
+ this.db = new DataBoard('watchedThreads', this.refresh, true);
+ this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', {
+ innerHTML: "
"
+ });
+ this.status = $('#watcher-status', this.dialog);
+ this.list = this.dialog.lastElementChild;
+ this.refreshButton = $('.refresh', this.dialog);
+ this.closeButton = $('.move > .close', this.dialog);
+ this.unreaddb = Unread.db || new DataBoard('lastReadPosts');
+ this.unreadEnabled = Conf['Remember Last Read Post'];
+ $.on(d, 'QRPostSuccessful', this.cb.post);
+ $.on(sc, 'click', this.toggleWatcher);
+ $.on(this.refreshButton, 'click', this.buttonFetchAll);
+ $.on(this.closeButton, 'click', this.toggleWatcher);
+ $.on(d, '4chanXInitFinished', this.ready);
+ switch (g.VIEW) {
+ case 'index':
+ $.on(d, 'IndexRefresh', this.cb.onIndexRefresh);
+ break;
+ case 'thread':
+ $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh);
+ }
+ if (Conf['Fixed Thread Watcher']) {
+ $.addClass(doc, 'fixed-watcher');
+ }
+ if (Conf['Toggleable Thread Watcher']) {
+ this.dialog.hidden = true;
+ Header.addShortcut(sc);
+ $.addClass(doc, 'toggleable-watcher');
+ }
+ ThreadWatcher.fetchAuto();
+ if (g.VIEW === 'index' && Conf['JSON Index'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
+ Menu.menu.addEntry({
+ el: $.el('a', {
+ href: 'javascript:;',
+ className: 'has-shortcut-text'
+ }, {
+ innerHTML: "
Alt+click "
+ }),
+ order: 6,
+ open: function(arg) {
+ var thread;
+ thread = arg.thread;
+ if (Conf['Index Mode'] !== 'catalog') {
+ return false;
+ }
+ this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? 'Unwatch' : 'Watch';
+ if (this.cb) {
+ $.off(this.el, 'click', this.cb);
+ }
+ this.cb = function() {
+ $.event('CloseMenu');
+ return ThreadWatcher.toggle(thread);
+ };
+ $.on(this.el, 'click', this.cb);
+ return true;
+ }
+ });
+ }
+ Callbacks.Post.push({
+ name: 'Thread Watcher',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Thread Watcher',
+ cb: this.catalogNode
+ });
+ },
+ isWatched: function(thread) {
+ var ref;
+ return (ref = ThreadWatcher.db) != null ? ref.get({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ }) : void 0;
+ },
+ node: function() {
+ var toggler;
+ if (this.isReply) {
+ return;
+ }
+ if (this.isClone) {
+ toggler = $('.watch-thread-link', this.nodes.post);
+ } else {
+ toggler = $.el('a', {
+ href: 'javascript:;',
+ className: 'watch-thread-link'
+ });
+ $.before($('input', this.nodes.post), toggler);
+ }
+ return $.on(toggler, 'click', ThreadWatcher.cb.toggle);
+ },
+ catalogNode: function() {
+ if (ThreadWatcher.isWatched(this.thread)) {
+ $.addClass(this.nodes.root, 'watched');
+ }
+ $.on(this.nodes.thumb.parentNode, 'click', (function(_this) {
+ return function(e) {
+ if (!(e.button === 0 && e.altKey)) {
+ return;
+ }
+ ThreadWatcher.toggle(_this.thread);
+ return e.preventDefault();
+ };
+ })(this));
+ return $.on(this.nodes.thumb.parentNode, 'mousedown', function(e) {
+ if (e.button === 0 && e.altKey) {
+ return e.preventDefault();
+ }
+ });
+ },
+ ready: function() {
+ $.off(d, '4chanXInitFinished', ThreadWatcher.ready);
+ if (!Main.isThisPageLegit()) {
+ return;
+ }
+ ThreadWatcher.refresh();
+ $.add(d.body, ThreadWatcher.dialog);
+ if (!Conf['Auto Watch']) {
+ return;
+ }
+ return $.get('AutoWatch', 0, function(arg) {
+ var AutoWatch, thread;
+ AutoWatch = arg.AutoWatch;
+ if (!(thread = g.BOARD.threads[AutoWatch])) {
+ return;
+ }
+ ThreadWatcher.add(thread);
+ return $["delete"]('AutoWatch');
+ });
+ },
+ toggleWatcher: function() {
+ $.toggleClass(ThreadWatcher.shortcut, 'disabled');
+ return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden;
+ },
+ cb: {
+ openAll: function() {
+ var a, i, len, ref;
+ if ($.hasClass(this, 'disabled')) {
+ return;
+ }
+ ref = $$('a[title]', ThreadWatcher.list);
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ $.open(a.href);
+ }
+ return $.event('CloseMenu');
+ },
+ pruneDeads: function() {
+ var boardID, data, i, len, ref, ref1, threadID;
+ if ($.hasClass(this, 'disabled')) {
+ return;
+ }
+ ThreadWatcher.db.forceSync();
+ ref = ThreadWatcher.getAll();
+ for (i = 0, len = ref.length; i < len; i++) {
+ ref1 = ref[i], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
+ if (!data.isDead) {
+ continue;
+ }
+ delete ThreadWatcher.db.data.boards[boardID][threadID];
+ ThreadWatcher.db.deleteIfEmpty({
+ boardID: boardID
+ });
+ }
+ ThreadWatcher.db.save();
+ ThreadWatcher.refresh();
+ return $.event('CloseMenu');
+ },
+ toggle: function() {
+ var thread;
+ thread = Get.postFromNode(this).thread;
+ Index.followedThreadID = thread.ID;
+ ThreadWatcher.toggle(thread);
+ return delete Index.followedThreadID;
+ },
+ rm: function() {
+ var boardID, ref, threadID;
+ ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1];
+ return ThreadWatcher.rm(boardID, +threadID);
+ },
+ post: function(e) {
+ var boardID, postID, ref, threadID;
+ ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ if (postID === threadID) {
+ if (Conf['Auto Watch']) {
+ return $.set('AutoWatch', threadID);
+ }
+ } else if (Conf['Auto Watch Reply']) {
+ return ThreadWatcher.add(g.threads[boardID + '.' + threadID]);
+ }
+ },
+ onIndexRefresh: function() {
+ var boardID, data, db, ref, threadID;
+ db = ThreadWatcher.db;
+ boardID = g.BOARD.ID;
+ db.forceSync();
+ ref = db.data.boards[boardID];
+ for (threadID in ref) {
+ data = ref[threadID];
+ if (!(data != null ? data.isDead : void 0) && !(threadID in g.BOARD.threads)) {
+ if (Conf['Auto Prune'] || !(data && typeof data === 'object')) {
+ db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ } else {
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
+ ThreadWatcher.fetchStatus({
+ boardID: boardID,
+ threadID: threadID,
+ data: data
+ });
+ }
+ data.isDead = true;
+ db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ }
+ }
+ }
+ return ThreadWatcher.refresh();
+ },
+ onThreadRefresh: function(e) {
+ var thread;
+ thread = g.threads[e.detail.threadID];
+ if (!(e.detail[404] && ThreadWatcher.db.get({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ }))) {
+ return;
+ }
+ return ThreadWatcher.add(thread);
+ }
+ },
+ requests: [],
+ fetched: 0,
+ clearRequests: function() {
+ ThreadWatcher.requests = [];
+ ThreadWatcher.fetched = 0;
+ ThreadWatcher.status.textContent = '';
+ return $.rmClass(ThreadWatcher.refreshButton, 'fa-spin');
+ },
+ abort: function() {
+ var i, len, ref, req;
+ ref = ThreadWatcher.requests;
+ for (i = 0, len = ref.length; i < len; i++) {
+ req = ref[i];
+ if (req.readyState !== 4) {
+ req.abort();
+ }
+ }
+ return ThreadWatcher.clearRequests();
+ },
+ fetchAuto: function() {
+ var db, interval, now;
+ clearTimeout(ThreadWatcher.timeout);
+ if (!Conf['Auto Update Thread Watcher']) {
+ return;
+ }
+ db = ThreadWatcher.db;
+ interval = ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] ? 5 * $.MINUTE : 2 * $.HOUR;
+ now = Date.now();
+ if (now >= (db.data.lastChecked || 0) + interval) {
+ db.data.lastChecked = now;
+ ThreadWatcher.fetchAllStatus();
+ db.save();
+ }
+ return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);
+ },
+ buttonFetchAll: function() {
+ if (ThreadWatcher.requests.length) {
+ return ThreadWatcher.abort();
+ } else {
+ return ThreadWatcher.fetchAllStatus();
+ }
+ },
+ fetchAllStatus: function() {
+ var i, len, ref, thread, threads;
+ ThreadWatcher.db.forceSync();
+ ThreadWatcher.unreaddb.forceSync();
+ if ((ref = QuoteYou.db) != null) {
+ ref.forceSync();
+ }
+ if (!(threads = ThreadWatcher.getAll()).length) {
+ return;
+ }
+ for (i = 0, len = threads.length; i < len; i++) {
+ thread = threads[i];
+ ThreadWatcher.fetchStatus(thread);
+ }
+ },
+ fetchStatus: function(thread, force) {
+ var boardID, data, req, threadID;
+ boardID = thread.boardID, threadID = thread.threadID, data = thread.data;
+ if (data.isDead && !force) {
+ return;
+ }
+ if (ThreadWatcher.requests.length === 0) {
+ ThreadWatcher.status.textContent = '...';
+ $.addClass(ThreadWatcher.refreshButton, 'fa-spin');
+ }
+ req = $.ajax("//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json", {
+ onloadend: function() {
+ return ThreadWatcher.parseStatus.call(this, thread);
+ },
+ timeout: $.MINUTE
+ }, {
+ whenModified: force ? false : 'ThreadWatcher'
+ });
+ return ThreadWatcher.requests.push(req);
+ },
+ parseStatus: function(arg) {
+ var boardID, data, i, isDead, lastReadPost, len, match, postObj, quotesYou, quotingYou, ref, ref1, regexp, threadID, unread;
+ boardID = arg.boardID, threadID = arg.threadID, data = arg.data;
+ ThreadWatcher.fetched++;
+ if (ThreadWatcher.fetched === ThreadWatcher.requests.length) {
+ ThreadWatcher.clearRequests();
+ } else {
+ ThreadWatcher.status.textContent = (Math.round(ThreadWatcher.fetched / ThreadWatcher.requests.length * 100)) + "%";
+ }
+ if (this.status === 200 && this.response) {
+ isDead = !!this.response.posts[0].archived;
+ if (isDead && Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ ThreadWatcher.refresh();
+ return;
+ }
+ lastReadPost = ThreadWatcher.unreaddb.get({
+ boardID: boardID,
+ threadID: threadID,
+ defaultValue: 0
+ });
+ unread = quotingYou = 0;
+ ref = this.response.posts;
+ for (i = 0, len = ref.length; i < len; i++) {
+ postObj = ref[i];
+ if (!(postObj.no > lastReadPost)) {
+ continue;
+ }
+ if ((ref1 = QuoteYou.db) != null ? ref1.get({
+ boardID: boardID,
+ threadID: threadID,
+ postID: postObj.no
+ }) : void 0) {
+ continue;
+ }
+ unread++;
+ if (!(QuoteYou.db && postObj.com)) {
+ continue;
+ }
+ quotesYou = false;
+ regexp = /
]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g;
+ while (match = regexp.exec(postObj.com)) {
+ if (QuoteYou.db.get({
+ boardID: match[1] || boardID,
+ threadID: match[2] || threadID,
+ postID: match[3] || match[2] || threadID
+ })) {
+ quotesYou = true;
+ break;
+ }
+ }
+ if (quotesYou && !Filter.isHidden(Build.parseJSON(postObj, boardID))) {
+ quotingYou++;
+ }
+ }
+ if (isDead !== data.isDead || unread !== data.unread || quotingYou !== data.quotingYou) {
+ data.isDead = isDead;
+ data.unread = unread;
+ data.quotingYou = quotingYou;
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ return ThreadWatcher.refresh();
+ }
+ } else if (this.status === 404) {
+ if (Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ } else {
+ data.isDead = true;
+ delete data.unread;
+ delete data.quotingYou;
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ }
+ return ThreadWatcher.refresh();
+ }
+ },
+ getAll: function() {
+ var all, boardID, data, ref, threadID, threads;
+ all = [];
+ ref = ThreadWatcher.db.data.boards;
+ for (boardID in ref) {
+ threads = ref[boardID];
+ if (Conf['Current Board'] && boardID !== g.BOARD.ID) {
+ continue;
+ }
+ for (threadID in threads) {
+ data = threads[threadID];
+ if (data && typeof data === 'object') {
+ all.push({
+ boardID: boardID,
+ threadID: threadID,
+ data: data
+ });
+ }
+ }
+ }
+ return all;
+ },
+ makeLine: function(boardID, threadID, data) {
+ var count, div, fullID, link, title, x;
+ x = $.el('a', {
+ className: 'fa fa-times',
+ href: 'javascript:;'
+ });
+ $.on(x, 'click', ThreadWatcher.cb.rm);
+ link = $.el('a', {
+ href: "/" + boardID + "/thread/" + threadID,
+ title: data.excerpt,
+ className: 'watcher-link'
+ });
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) {
+ count = $.el('span', {
+ textContent: "(" + data.unread + ")",
+ className: 'watcher-unread'
+ });
+ $.add(link, count);
+ }
+ title = $.el('span', {
+ textContent: data.excerpt,
+ className: 'watcher-title'
+ });
+ $.add(link, title);
+ div = $.el('div');
+ fullID = boardID + "." + threadID;
+ div.dataset.fullID = fullID;
+ if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) {
+ $.addClass(div, 'current');
+ }
+ if (data.isDead) {
+ $.addClass(div, 'dead-thread');
+ }
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
+ if (data.unread === 0) {
+ $.addClass(div, 'replies-read');
+ }
+ if (data.unread) {
+ $.addClass(div, 'replies-unread');
+ }
+ if (data.quotingYou) {
+ $.addClass(div, 'replies-quoting-you');
+ }
+ }
+ $.add(div, [x, $.tn(' '), link]);
+ return div;
+ },
+ refresh: function() {
+ var boardID, data, i, j, len, len1, list, nodes, ref, ref1, ref2, refresher, threadID;
+ nodes = [];
+ ref = ThreadWatcher.getAll();
+ for (i = 0, len = ref.length; i < len; i++) {
+ ref1 = ref[i], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
+ nodes.push(ThreadWatcher.makeLine(boardID, threadID, data));
+ }
+ list = ThreadWatcher.list;
+ $.rmAll(list);
+ $.add(list, nodes);
+ g.threads.forEach(function(thread) {
+ var helper, j, len1, post, ref2, toggler;
+ helper = ThreadWatcher.isWatched(thread) ? ['addClass', 'Unwatch'] : ['rmClass', 'Watch'];
+ if (thread.OP) {
+ ref2 = [thread.OP].concat(slice.call(thread.OP.clones));
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ post = ref2[j];
+ toggler = $('.watch-thread-link', post.nodes.post);
+ $[helper[0]](toggler, 'watched');
+ toggler.title = helper[1] + " Thread";
+ }
+ }
+ if (thread.catalogView) {
+ return $[helper[0]](thread.catalogView.nodes.root, 'watched');
+ }
+ });
+ ThreadWatcher.refreshIcon();
+ ref2 = ThreadWatcher.menu.refreshers;
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ refresher = ref2[j];
+ refresher();
+ }
+ if (Index.nodes && Conf['Pin Watched Threads']) {
+ Index.sort();
+ return Index.buildIndex();
+ }
+ },
+ refreshIcon: function() {
+ var className, i, len, ref;
+ ref = ['replies-unread', 'replies-quoting-you'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ className = ref[i];
+ ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog));
+ }
+ },
+ update: function(boardID, threadID, newData) {
+ var data, key, line, n, newLine, ref, val;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
+ boardID: boardID,
+ threadID: threadID
+ }) : void 0)) {
+ return;
+ }
+ if (newData.isDead && Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ ThreadWatcher.refresh();
+ return;
+ }
+ n = 0;
+ for (key in newData) {
+ val = newData[key];
+ if (data[key] !== val) {
+ n++;
+ }
+ }
+ if (!n) {
+ return;
+ }
+ ThreadWatcher.db.forceSync();
+ if (!(data = ThreadWatcher.db.get({
+ boardID: boardID,
+ threadID: threadID
+ }))) {
+ return;
+ }
+ $.extend(data, newData);
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ if (line = $("#watched-threads > [data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog)) {
+ newLine = ThreadWatcher.makeLine(boardID, threadID, data);
+ $.replace(line, newLine);
+ return ThreadWatcher.refreshIcon();
+ } else {
+ return ThreadWatcher.refresh();
+ }
+ },
+ set404: function(boardID, threadID, cb) {
+ var data, ref;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
+ boardID: boardID,
+ threadID: threadID
+ }) : void 0)) {
+ return cb();
+ }
+ if (Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ return cb();
+ }
+ if (data.isDead && !((data.unread != null) || (data.quotingYou != null))) {
+ return cb();
+ }
+ data.isDead = true;
+ delete data.unread;
+ delete data.quotingYou;
+ return ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ }, cb);
+ },
+ toggle: function(thread) {
+ var boardID, threadID;
+ boardID = thread.board.ID;
+ threadID = thread.ID;
+ if (ThreadWatcher.db.get({
+ boardID: boardID,
+ threadID: threadID
+ })) {
+ return ThreadWatcher.rm(boardID, threadID);
+ } else {
+ return ThreadWatcher.add(thread);
+ }
+ },
+ add: function(thread) {
+ var boardID, data, threadID;
+ data = {};
+ boardID = thread.board.ID;
+ threadID = thread.ID;
+ if (thread.isDead) {
+ if (Conf['Auto Prune'] && ThreadWatcher.db.get({
+ boardID: boardID,
+ threadID: threadID
+ })) {
+ ThreadWatcher.rm(boardID, threadID);
+ return;
+ }
+ data.isDead = true;
+ }
+ data.excerpt = Get.threadExcerpt(thread);
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ ThreadWatcher.refresh();
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
+ return ThreadWatcher.fetchStatus({
+ boardID: boardID,
+ threadID: threadID,
+ data: data
+ }, true);
+ }
+ },
+ rm: function(boardID, threadID) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ return ThreadWatcher.refresh();
+ },
+ menu: {
+ refreshers: [],
+ init: function() {
+ var menu;
+ if (!Conf['Thread Watcher']) {
+ return;
+ }
+ menu = this.menu = new UI.Menu('thread watcher');
+ $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) {
+ return menu.toggle(e, this, ThreadWatcher);
+ });
+ this.addHeaderMenuEntry();
+ return this.addMenuEntries();
+ },
+ addHeaderMenuEntry: function() {
+ var entryEl;
+ if (g.VIEW !== 'thread') {
+ return;
+ }
+ entryEl = $.el('a', {
+ href: 'javascript:;'
+ });
+ Header.menu.addEntry({
+ el: entryEl,
+ order: 60
+ });
+ $.on(entryEl, 'click', function() {
+ return ThreadWatcher.toggle(g.threads[g.BOARD + "." + g.THREADID]);
+ });
+ return this.refreshers.push(function() {
+ var addClass, ref, rmClass, text;
+ ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = ref[0], rmClass = ref[1], text = ref[2];
+ $.addClass(entryEl, addClass);
+ $.rmClass(entryEl, rmClass);
+ return entryEl.textContent = text;
+ });
+ },
+ addMenuEntries: function() {
+ var cb, conf, entries, entry, i, len, name, ref, ref1, refresh, subEntries;
+ entries = [];
+ entries.push({
+ cb: ThreadWatcher.cb.openAll,
+ entry: {
+ el: $.el('a', {
+ textContent: 'Open all threads'
+ })
+ },
+ refresh: function() {
+ return (ThreadWatcher.list.firstElementChild ? $.rmClass : $.addClass)(this.el, 'disabled');
+ }
+ });
+ entries.push({
+ cb: ThreadWatcher.cb.pruneDeads,
+ entry: {
+ el: $.el('a', {
+ textContent: 'Prune dead threads'
+ })
+ },
+ refresh: function() {
+ return ($('.dead-thread', ThreadWatcher.list) ? $.rmClass : $.addClass)(this.el, 'disabled');
+ }
+ });
+ subEntries = [];
+ ref = Config.threadWatcher;
+ for (name in ref) {
+ conf = ref[name];
+ subEntries.push(this.createSubEntry(name, conf[1]));
+ }
+ entries.push({
+ entry: {
+ el: $.el('span', {
+ textContent: 'Settings'
+ }),
+ subEntries: subEntries
+ }
+ });
+ for (i = 0, len = entries.length; i < len; i++) {
+ ref1 = entries[i], entry = ref1.entry, cb = ref1.cb, refresh = ref1.refresh;
+ if (entry.el.nodeName === 'A') {
+ entry.el.href = 'javascript:;';
+ }
+ if (cb) {
+ $.on(entry.el, 'click', cb);
+ }
+ if (refresh) {
+ this.refreshers.push(refresh.bind(entry));
+ }
+ this.menu.addEntry(entry);
+ }
+ },
+ createSubEntry: function(name, desc) {
+ var entry, input;
+ entry = {
+ type: 'thread watcher',
+ el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
+ };
+ entry.el.title = desc;
+ input = entry.el.firstElementChild;
+ if (name === 'Show Unread Count' && !ThreadWatcher.unreadEnabled) {
+ input.disabled = true;
+ $.addClass(entry.el, 'disabled');
+ entry.el.title += '\n[Remember Last Read Post is disabled.]';
+ }
+ $.on(input, 'change', $.cb.checked);
+ if (name === 'Current Board' || name === 'Show Unread Count') {
+ $.on(input, 'change', ThreadWatcher.refresh);
+ }
+ if (name === 'Show Unread Count' || name === 'Auto Update Thread Watcher') {
+ $.on(input, 'change', ThreadWatcher.fetchAuto);
+ }
+ return entry;
+ }
+ }
+ };
+
+ return ThreadWatcher;
+
+}).call(this);
+
+Unread = (function() {
+ var Unread;
+
+ Unread = {
+ init: function() {
+ if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Remember Last Read Post'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) {
+ return;
+ }
+ if (Conf['Remember Last Read Post']) {
+ $.sync('Remember Last Read Post', function(enabled) {
+ return Conf['Remember Last Read Post'] = enabled;
+ });
+ this.db = new DataBoard('lastReadPosts', this.sync);
+ }
+ this.hr = $.el('hr', {
+ id: 'unread-line'
+ });
+ this.posts = new Set();
+ this.postsQuotingYou = new Set();
+ this.order = new RandomAccessList();
+ this.position = null;
+ Callbacks.Thread.push({
+ name: 'Unread',
+ cb: this.node
+ });
+ return Callbacks.Post.push({
+ name: 'Unread',
+ cb: this.addPost
+ });
+ },
+ node: function() {
+ var ID, j, len, ref, ref1;
+ Unread.thread = this;
+ Unread.title = d.title;
+ Unread.lastReadPost = ((ref = Unread.db) != null ? ref.get({
+ boardID: this.board.ID,
+ threadID: this.ID
+ }) : void 0) || 0;
+ Unread.readCount = 0;
+ ref1 = this.posts.keys;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ ID = ref1[j];
+ if (+ID <= Unread.lastReadPost) {
+ Unread.readCount++;
+ }
+ }
+ $.one(d, '4chanXInitFinished', Unread.ready);
+ return $.on(d, 'ThreadUpdate', Unread.onUpdate);
+ },
+ ready: function() {
+ if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) {
+ Unread.scroll();
+ }
+ Unread.setLine(true);
+ Unread.read();
+ Unread.update();
+ $.on(d, 'scroll visibilitychange', Unread.read);
+ if (Conf['Unread Line']) {
+ return $.on(d, 'visibilitychange', Unread.setLine);
+ }
+ },
+ positionPrev: function() {
+ if (Unread.position) {
+ return Unread.position.prev;
+ } else {
+ return Unread.order.last;
+ }
+ },
+ scroll: function() {
+ var hash, position, ref, root;
+ if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
+ return;
+ }
+ ReplyPruning.showIfHidden((ref = Unread.position) != null ? ref.data.nodes.root.id : void 0);
+ position = Unread.positionPrev();
+ while (position) {
+ root = position.data.nodes.root;
+ if (!root.getBoundingClientRect().height) {
+ position = position.prev;
+ } else {
+ Header.scrollToIfNeeded(root, true);
+ break;
+ }
+ }
+ },
+ sync: function() {
+ var ID, i, j, lastReadPost, postIDs, ref, ref1;
+ if (Unread.lastReadPost == null) {
+ return;
+ }
+ lastReadPost = Unread.db.get({
+ boardID: Unread.thread.board.ID,
+ threadID: Unread.thread.ID,
+ defaultValue: 0
+ });
+ if (!(Unread.lastReadPost < lastReadPost)) {
+ return;
+ }
+ Unread.lastReadPost = lastReadPost;
+ postIDs = Unread.thread.posts.keys;
+ for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) {
+ ID = +postIDs[i];
+ if (!Unread.thread.posts[ID].isFetchedQuote) {
+ if (ID > Unread.lastReadPost) {
+ break;
+ }
+ Unread.posts["delete"](ID);
+ Unread.postsQuotingYou["delete"](ID);
+ }
+ Unread.readCount++;
+ }
+ Unread.updatePosition();
+ Unread.setLine();
+ return Unread.update();
+ },
+ addPost: function() {
+ var ref;
+ if (this.isFetchedQuote || this.isClone) {
+ return;
+ }
+ Unread.order.push(this);
+ if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QuoteYou.db) != null ? ref.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ }) : void 0)) {
+ return;
+ }
+ Unread.posts.add(this.ID);
+ Unread.addPostQuotingYou(this);
+ return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
+ },
+ addPostQuotingYou: function(post) {
+ var j, len, quotelink, ref, ref1;
+ ref = post.nodes.quotelinks;
+ for (j = 0, len = ref.length; j < len; j++) {
+ quotelink = ref[j];
+ if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
+ continue;
+ }
+ Unread.postsQuotingYou.add(post.ID);
+ Unread.openNotification(post);
+ return;
+ }
+ },
+ openNotification: function(post) {
+ var notif;
+ if (!Header.areNotificationsEnabled) {
+ return;
+ }
+ try {
+ notif = new Notification(post.info.nameBlock + " replied to you", {
+ body: post.info.commentDisplay,
+ icon: Favicon.logo
+ });
+ notif.onclick = function() {
+ Header.scrollToIfNeeded(post.nodes.root, true);
+ return $.global(function() {
+ return window.focus();
+ });
+ };
+ return notif.onshow = function() {
+ return setTimeout(function() {
+ return notif.close();
+ }, 7 * $.SECOND);
+ };
+ } catch (_error) {}
+ },
+ onUpdate: function(e) {
+ if (!e.detail[404]) {
+ Unread.setLine();
+ Unread.read();
+ }
+ return Unread.update();
+ },
+ readSinglePost: function(post) {
+ var ID;
+ ID = post.ID;
+ if (!Unread.posts.has(ID)) {
+ return;
+ }
+ Unread.posts["delete"](ID);
+ Unread.postsQuotingYou["delete"](ID);
+ Unread.updatePosition();
+ Unread.saveLastReadPost();
+ return Unread.update();
+ },
+ read: $.debounce(100, function(e) {
+ var ID, count, data, ref, ref1, root;
+ if (!Unread.posts.size && Unread.readCount !== Unread.thread.posts.keys.length) {
+ Unread.saveLastReadPost();
+ }
+ if (d.hidden || !Unread.posts.size) {
+ return;
+ }
+ count = 0;
+ while (Unread.position) {
+ ref = Unread.position, ID = ref.ID, data = ref.data;
+ root = data.nodes.root;
+ if (!(!root.getBoundingClientRect().height || Header.getBottomOf(root) > -1)) {
+ break;
+ }
+ count++;
+ Unread.posts["delete"](ID);
+ Unread.postsQuotingYou["delete"](ID);
+ if ((ref1 = QuoteYou.db) != null ? ref1.get({
+ boardID: data.board.ID,
+ threadID: data.thread.ID,
+ postID: ID
+ }) : void 0) {
+ QuoteYou.lastRead = root;
+ }
+ Unread.position = Unread.position.next;
+ }
+ if (!count) {
+ return;
+ }
+ Unread.updatePosition();
+ Unread.saveLastReadPost();
+ if (e) {
+ return Unread.update();
+ }
+ }),
+ updatePosition: function() {
+ while (Unread.position && !Unread.posts.has(Unread.position.ID)) {
+ Unread.position = Unread.position.next;
+ }
+ },
+ saveLastReadPost: $.debounce(2 * $.SECOND, function() {
+ var ID, i, j, postIDs, ref, ref1;
+ $.forceSync('Remember Last Read Post');
+ if (!(Conf['Remember Last Read Post'] && Unread.db)) {
+ return;
+ }
+ postIDs = Unread.thread.posts.keys;
+ for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) {
+ ID = +postIDs[i];
+ if (!Unread.thread.posts[ID].isFetchedQuote) {
+ if (Unread.posts.has(ID)) {
+ break;
+ }
+ Unread.lastReadPost = ID;
+ }
+ Unread.readCount++;
+ }
+ if (Unread.thread.isDead && !Unread.thread.isArchived) {
+ return;
+ }
+ Unread.db.forceSync();
+ return Unread.db.set({
+ boardID: Unread.thread.board.ID,
+ threadID: Unread.thread.ID,
+ val: Unread.lastReadPost
+ });
+ }),
+ setLine: function(force) {
+ if (!Conf['Unread Line']) {
+ return;
+ }
+ if (Unread.hr.hidden || d.hidden || (force === true)) {
+ if ((Unread.linePosition = Unread.positionPrev())) {
+ $.after(Unread.linePosition.data.nodes.root, Unread.hr);
+ } else {
+ $.rm(Unread.hr);
+ }
+ }
+ return Unread.hr.hidden = Unread.linePosition === Unread.order.last;
+ },
+ update: function() {
+ var count, countQuotingYou, isDead, titleCount, titleDead, titleQuotingYou;
+ count = Unread.posts.size;
+ countQuotingYou = Unread.postsQuotingYou.size;
+ if (Conf['Unread Count']) {
+ titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : '';
+ titleCount = count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '';
+ titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title;
+ d.title = "" + titleQuotingYou + titleCount + titleDead;
+ }
+ $.forceSync('Remember Last Read Post');
+ if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) {
+ ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, {
+ isDead: Unread.thread.isDead,
+ unread: count,
+ quotingYou: countQuotingYou
+ });
+ }
+ if (Conf['Unread Favicon']) {
+ isDead = Unread.thread.isDead;
+ Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default'];
+ return $.add(d.head, Favicon.el);
+ }
+ }
+ };
+
+ return Unread;
+
+}).call(this);
+
+Captcha = {};
+
+(function() {
+ Captcha.fixes = {
+ imageKeys: '789456123uiojklm'.split('').concat(['Comma', 'Period']),
+ imageKeys16: '7890uiopjkl'.split('').concat(['Semicolon', 'm', 'Comma', 'Period', 'Slash']),
+ css: '.rc-imageselect-target > div:focus, .rc-image-tile-target:focus {\n outline: 2px solid #4a90e2;\n}\n.rc-imageselect-target td:focus {\n box-shadow: inset 0 0 0 2px #4a90e2;\n outline: none;\n}\n.rc-button-default:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}',
+ cssNoscript: '.fbc-payload-imageselect {\n position: relative;\n}\n.fbc-payload-imageselect > label {\n position: absolute;\n display: block;\n height: 93.3px;\n width: 93.3px;\n}\nlabel[data-row="0"] {top: 0px;}\nlabel[data-row="1"] {top: 93.3px;}\nlabel[data-row="2"] {top: 186.6px;}\nlabel[data-col="0"] {left: 0px;}\nlabel[data-col="1"] {left: 93.3px;}\nlabel[data-col="2"] {left: 186.6px;}\n.fbc-payload-imageselect > input:focus + label {\n outline: 2px solid #4a90e2;\n}\n.fbc-button-verify input:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}\nbody.focus .fbc {\n box-shadow: inset 0 0 0 2px #4a90e2;\n}',
+ init: function() {
+ switch (location.pathname.split('/')[3]) {
+ case 'anchor':
+ return this.initMain();
+ case 'frame':
+ return this.initPopup();
+ case 'fallback':
+ return this.initNoscript();
+ }
+ },
+ initMain: function() {
+ var a, j, len, ref;
+ $.onExists(d.body, '#recaptcha-anchor', function(checkbox) {
+ var focus;
+ focus = function() {
+ var ref;
+ if (d.hasFocus() && ((ref = d.activeElement) === d.documentElement || ref === d.body)) {
+ return checkbox.focus();
+ }
+ };
+ focus();
+ return $.on(window, 'focus', function() {
+ return $.queueTask(focus);
+ });
+ });
+ ref = $$('.rc-anchor-pt a');
+ for (j = 0, len = ref.length; j < len; j++) {
+ a = ref[j];
+ a.tabIndex = -1;
+ }
+ },
+ initPopup: function() {
+ $.addStyle(this.css);
+ this.fixImages();
+ new MutationObserver((function(_this) {
+ return function() {
+ return _this.fixImages();
+ };
+ })(this)).observe(d.body, {
+ childList: true,
+ subtree: true
+ });
+ return $.on(d, 'keydown', this.keybinds.bind(this));
+ },
+ initNoscript: function() {
+ var data, ref, token;
+ this.noscript = true;
+ data = (token = (ref = $('.fbc-verification-token > textarea')) != null ? ref.value : void 0) ? {
+ token: token
+ } : {
+ working: true
+ };
+ new Connection(window.parent, '*').send(data);
+ d.body.classList.toggle('focus', d.hasFocus());
+ $.on(window, 'focus blur', function() {
+ return d.body.classList.toggle('focus', d.hasFocus());
+ });
+ this.images = $$('.fbc-payload-imageselect > input');
+ this.width = 3;
+ if (this.images.length !== 9) {
+ return;
+ }
+ $.addStyle(this.cssNoscript);
+ this.addLabels();
+ $.on(d, 'keydown', this.keybinds.bind(this));
+ return $.on($('.fbc-imageselect-challenge > form'), 'submit', this.checkForm.bind(this));
+ },
+ fixImages: function() {
+ var img, j, len, ref;
+ this.images = $$('.rc-image-tile-target');
+ if (!this.images.length) {
+ this.images = $$('.rc-imageselect-target > div, .rc-imageselect-target td');
+ }
+ this.width = $$('.rc-imageselect-target tr:first-of-type td').length || Math.round(Math.sqrt(this.images.length));
+ ref = this.images;
+ for (j = 0, len = ref.length; j < len; j++) {
+ img = ref[j];
+ img.tabIndex = 0;
+ }
+ if (this.images.length === 9) {
+ this.addTooltips(this.images);
+ } else {
+ this.addTooltips16(this.images);
+ }
+ return this.complaintLinks();
+ },
+ complaintLinks: function() {
+ var errmsg, j, len, link, ref;
+ ref = $$('.rc-imageselect-incorrect-response, .rc-imageselect-error-select-one, .rc-imageselect-error-select-more, .rc-imageselect-error-dynamic-more');
+ for (j = 0, len = ref.length; j < len; j++) {
+ errmsg = ref[j];
+ if (!$('a', errmsg)) {
+ link = $.el('a', {
+ href: 'https://www.4chan-x.net/captchas.html',
+ target: '_blank',
+ textContent: '[complain]'
+ });
+ $.add(errmsg, [$.tn(' '), link]);
+ }
+ }
+ },
+ addLabels: function() {
+ var checkbox, i, imageSelect, label, labels;
+ imageSelect = $('.fbc-payload-imageselect');
+ labels = (function() {
+ var j, len, ref, results;
+ ref = this.images;
+ results = [];
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ checkbox = ref[i];
+ checkbox.id = "checkbox-" + i;
+ label = $.el('label', {
+ htmlFor: checkbox.id
+ });
+ label.dataset.row = Math.floor(i / 3);
+ label.dataset.col = i % 3;
+ $.after(checkbox, label);
+ results.push(label);
+ }
+ return results;
+ }).call(this);
+ return this.addTooltips(labels);
+ },
+ addTooltips: function(nodes) {
+ var i, j, len, node;
+ for (i = j = 0, len = nodes.length; j < len; i = ++j) {
+ node = nodes[i];
+ node.title = this.imageKeys[i] + " or " + (this.imageKeys[i + 9][0].toUpperCase()) + this.imageKeys[i + 9].slice(1);
+ }
+ },
+ addTooltips16: function(nodes) {
+ var i, j, key, len, node, ref;
+ ref = this.imageKeys16;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ key = ref[i];
+ if (i % 4 < this.width && (node = nodes[nodes.length - (4 - Math.floor(i / 4)) * this.width + (i % 4)])) {
+ node.title = "" + (key[0].toUpperCase()) + key.slice(1);
+ }
+ }
+ },
+ checkForm: function(e) {
+ var checkbox, j, len, n, ref;
+ n = 0;
+ ref = this.images;
+ for (j = 0, len = ref.length; j < len; j++) {
+ checkbox = ref[j];
+ if (checkbox.checked) {
+ n++;
+ }
+ }
+ if (n === 0) {
+ return e.preventDefault();
+ }
+ },
+ keybinds: function(e) {
+ var dx, i, img, key, last, n, reload, verify, w, x;
+ if (!(this.images && doc.contains(this.images[0]))) {
+ return;
+ }
+ n = this.images.length;
+ w = this.width;
+ last = n + w - 1;
+ reload = $('#recaptcha-reload-button, .fbc-button-reload');
+ verify = $('#recaptcha-verify-button, .fbc-button-verify > input');
+ x = this.images.indexOf(d.activeElement);
+ if (x < 0) {
+ x = d.activeElement === verify ? last : n;
+ }
+ key = Keybinds.keyCode(e);
+ if (!this.noscript && key === 'Space' && x < n) {
+ this.images[x].click();
+ } else if (n === 9 && (i = this.imageKeys.indexOf(key)) >= 0) {
+ this.images[i % 9].click();
+ verify.focus();
+ } else if (n !== 9 && (i = this.imageKeys16.indexOf(key)) >= 0 && i % 4 < w && (img = this.images[n - (4 - Math.floor(i / 4)) * w + (i % 4)])) {
+ img.click();
+ verify.focus();
+ } else if (dx = {
+ 'Up': n,
+ 'Down': w,
+ 'Left': last,
+ 'Right': 1
+ }[key]) {
+ x = (x + dx) % (n + w);
+ if ((n < x && x < last)) {
+ x = dx === last ? n : last;
+ }
+ (this.images[x] || (x === n ? reload : void 0) || (x === last ? verify : void 0)).focus();
+ } else {
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ }
+ };
+
+}).call(this);
+
+(function() {
+ Captcha.replace = {
+ init: function() {
+ if (!(d.cookie.indexOf('pass_enabled=1') < 0)) {
+ return;
+ }
+ if (location.hostname === 'sys.4chan.org' && /[?&]altc\b/.test(location.search) && Main.jsEnabled) {
+ $.onExists(doc, 'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', function() {
+ $.global(function() {
+ return window.el.onload = null;
+ });
+ return Captcha.v1.create();
+ });
+ return;
+ }
+ if (((Conf['Use Recaptcha v1'] && location.hostname === 'boards.4chan.org') || (Conf['Use Recaptcha v1 in Reports'] && location.hostname === 'sys.4chan.org')) && Main.jsEnabled) {
+ $.ready(Captcha.replace.v1);
+ return;
+ }
+ if (Conf['Force Noscript Captcha'] && Main.jsEnabled) {
+ $.ready(Captcha.replace.noscript);
+ return;
+ }
+ if (Conf['captchaLanguage'].trim() || Conf['Captcha Fixes']) {
+ if (location.hostname === 'boards.4chan.org') {
+ return $.onExists(doc, '#captchaFormPart', function(node) {
+ return $.onExists(node, 'iframe', Captcha.replace.iframe);
+ });
+ } else {
+ return $.onExists(doc, 'iframe', Captcha.replace.iframe);
+ }
+ }
+ },
+ noscript: function() {
+ var insert, noscript, original, span, toggle;
+ if (!((original = $('#g-recaptcha, #captchaContainerAlt')) && (noscript = $('noscript')))) {
+ return;
+ }
+ span = $.el('span', {
+ id: 'captcha-forced-noscript'
+ });
+ $.replace(noscript, span);
+ $.rm(original);
+ insert = function() {
+ span.innerHTML = noscript.textContent;
+ return Captcha.replace.iframe($('iframe', span));
+ };
+ if ((toggle = $('#togglePostFormLink a, #form-link'))) {
+ return $.on(toggle, 'click', insert);
+ } else {
+ return insert();
+ }
+ },
+ v1: function() {
+ var form, link;
+ if (!$.id('g-recaptcha')) {
+ return;
+ }
+ Captcha.v1.replace();
+ if ((link = $.id('form-link'))) {
+ return $.on(link, 'click', function() {
+ return Captcha.v1.create();
+ });
+ } else if (location.hostname === 'boards.4chan.org') {
+ form = $.id('postForm');
+ return form.addEventListener('focus', (function() {
+ return Captcha.v1.create();
+ }), true);
+ } else {
+ return Captcha.v1.create();
+ }
+ },
+ iframe: function(iframe) {
+ var lang, src;
+ if ((lang = Conf['captchaLanguage'].trim())) {
+ src = /[?&]hl=/.test(iframe.src) ? iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) : iframe.src + ("&hl=" + (encodeURIComponent(lang)));
+ if (iframe.src !== src) {
+ iframe.src = src;
+ }
+ }
+ return Captcha.replace.autocopy(iframe);
+ },
+ autocopy: function(iframe) {
+ if (!(Conf['Captcha Fixes'] && /^https:\/\/www\.google\.com\/recaptcha\/api\/fallback\?/.test(iframe.src))) {
+ return;
+ }
+ return new Connection(iframe, 'https://www.google.com', {
+ working: function() {
+ var ref, ref1;
+ if ((ref = $.id('qr')) != null ? ref.contains(iframe) : void 0) {
+ return (ref1 = $('#qr .captcha-container textarea')) != null ? ref1.parentNode.hidden = true : void 0;
+ }
+ },
+ token: function(token) {
+ var node, textarea;
+ node = iframe;
+ while ((node = node.parentNode)) {
+ if ((textarea = $('textarea', node))) {
+ break;
+ }
+ }
+ textarea.value = token;
+ return $.event('input', null, textarea);
+ }
+ });
+ }
+ };
+
+}).call(this);
+
+(function() {
+ Captcha.v1 = {
+ blank: "data:image/svg+xml, ",
+ init: function() {
+ var imgContainer, input;
+ if (d.cookie.indexOf('pass_enabled=1') >= 0) {
+ return;
+ }
+ if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt'))) {
+ return;
+ }
+ imgContainer = $.el('div', {
+ className: 'captcha-img',
+ title: 'Reload reCAPTCHA'
+ });
+ $.extend(imgContainer, {
+ innerHTML: " "
+ });
+ input = $.el('input', {
+ className: 'captcha-input field',
+ title: 'Verification',
+ autocomplete: 'off',
+ spellcheck: false
+ });
+ this.nodes = {
+ img: imgContainer.firstChild,
+ input: input
+ };
+ $.on(input, 'blur', QR.focusout);
+ $.on(input, 'focus', QR.focusin);
+ $.on(input, 'keydown', QR.captcha.keydown.bind(QR.captcha));
+ $.on(this.nodes.img.parentNode, 'click', QR.captcha.reload.bind(QR.captcha));
+ $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v1');
+ $.after(QR.nodes.com.parentNode, [imgContainer, input]);
+ this.captchas = [];
+ $.get('captchas', [], function(arg) {
+ var captchas;
+ captchas = arg.captchas;
+ QR.captcha.sync(captchas);
+ return QR.captcha.clear();
+ });
+ $.sync('captchas', this.sync);
+ this.replace();
+ this.beforeSetup();
+ if (Conf['Auto-load captcha']) {
+ this.setup();
+ }
+ new MutationObserver(this.afterSetup).observe($.id('captchaContainerAlt'), {
+ childList: true
+ });
+ return this.afterSetup();
+ },
+ replace: function() {
+ var container, old;
+ if (this.script) {
+ return;
+ }
+ if (!(this.script = $('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', d.head))) {
+ this.script = $.el('script', {
+ src: '//www.google.com/recaptcha/api/js/recaptcha_ajax.js'
+ });
+ $.add(d.head, this.script);
+ }
+ if (old = $.id('g-recaptcha')) {
+ container = $.el('div', {
+ id: 'captchaContainerAlt'
+ });
+ return $.replace(old, container);
+ }
+ },
+ create: function() {
+ var cont, lang;
+ cont = $.id('captchaContainerAlt');
+ if (this.occupied) {
+ return;
+ }
+ this.occupied = true;
+ if ((lang = Conf['captchaLanguage'].trim())) {
+ cont.dataset.lang = lang;
+ }
+ $.onExists(cont, '#recaptcha_image', function(image) {
+ return $.on(image, 'click', function() {
+ if ($.id('recaptcha_challenge_image')) {
+ return $.global(function() {
+ return window.Recaptcha.reload();
+ });
+ }
+ });
+ });
+ $.onExists(cont, '#recaptcha_response_field', function(field) {
+ $.on(field, 'keydown', function(e) {
+ if (e.keyCode === 8 && !field.value) {
+ return $.global(function() {
+ return window.Recaptcha.reload();
+ });
+ }
+ });
+ if (location.hostname === 'sys.4chan.org') {
+ return field.focus();
+ }
+ });
+ return $.global(function() {
+ var container, options, script;
+ container = document.getElementById('captchaContainerAlt');
+ options = {
+ theme: 'clean',
+ tabindex: {
+ "boards.4chan.org": 5
+ }[location.hostname],
+ lang: container.dataset.lang
+ };
+ if (window.Recaptcha) {
+ return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
+ } else {
+ script = document.head.querySelector('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]');
+ return script.addEventListener('load', function() {
+ return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
+ }, false);
+ }
+ });
+ },
+ cb: {
+ focus: function() {
+ return QR.captcha.setup(false, true);
+ }
+ },
+ beforeSetup: function() {
+ var img, input, ref;
+ ref = this.nodes, img = ref.img, input = ref.input;
+ img.parentNode.hidden = true;
+ img.src = this.blank;
+ input.value = '';
+ input.placeholder = 'Focus to load reCAPTCHA';
+ this.count();
+ return $.on(input, 'focus click', this.cb.focus);
+ },
+ needed: function() {
+ var captchaCount, postsCount;
+ captchaCount = this.captchas.length;
+ if (QR.req) {
+ captchaCount++;
+ }
+ postsCount = QR.posts.length;
+ if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
+ postsCount = 0;
+ }
+ return captchaCount < postsCount;
+ },
+ onNewPost: function() {},
+ onPostChange: function() {},
+ setup: function(focus, force) {
+ if (!(this.isEnabled && (force || this.needed()))) {
+ return;
+ }
+ this.create();
+ if (focus) {
+ $.addClass(QR.nodes.el, 'focus');
+ return this.nodes.input.focus();
+ }
+ },
+ afterSetup: function() {
+ var challenge, img, input, ref, setLifetime;
+ if (!(challenge = $.id('recaptcha_challenge_field_holder'))) {
+ return;
+ }
+ if (challenge === QR.captcha.nodes.challenge) {
+ return;
+ }
+ setLifetime = function(e) {
+ return QR.captcha.lifetime = e.detail;
+ };
+ $.on(window, 'captcha:timeout', setLifetime);
+ $.global(function() {
+ return window.dispatchEvent(new CustomEvent('captcha:timeout', {
+ detail: window.RecaptchaState.timeout
+ }));
+ });
+ $.off(window, 'captcha:timeout', setLifetime);
+ ref = QR.captcha.nodes, img = ref.img, input = ref.input;
+ img.parentNode.hidden = false;
+ input.placeholder = 'Verification';
+ QR.captcha.count();
+ $.off(input, 'focus click', QR.captcha.cb.focus);
+ QR.captcha.nodes.challenge = challenge;
+ new MutationObserver(QR.captcha.load.bind(QR.captcha)).observe(challenge, {
+ childList: true,
+ subtree: true,
+ attributes: true
+ });
+ QR.captcha.load();
+ if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
+ QR.nodes.el.style.top = null;
+ return QR.nodes.el.style.bottom = '0px';
+ }
+ },
+ destroy: function() {
+ if (!this.script) {
+ return;
+ }
+ $.global(function() {
+ return window.Recaptcha.destroy();
+ });
+ delete this.occupied;
+ if (this.nodes) {
+ return this.beforeSetup();
+ }
+ },
+ sync: function(captchas) {
+ if (captchas == null) {
+ captchas = [];
+ }
+ QR.captcha.captchas = captchas;
+ return QR.captcha.count();
+ },
+ getOne: function() {
+ var captcha, challenge, response, timeout;
+ this.clear();
+ if (captcha = this.captchas.shift()) {
+ this.count();
+ $.set('captchas', this.captchas);
+ return captcha;
+ } else {
+ challenge = this.nodes.img.alt;
+ timeout = this.timeout;
+ if (/\S/.test(response = this.nodes.input.value)) {
+ this.destroy();
+ return {
+ challenge: challenge,
+ response: response,
+ timeout: timeout
+ };
+ } else {
+ return null;
+ }
+ }
+ },
+ save: function() {
+ var response;
+ if (!/\S/.test(response = this.nodes.input.value)) {
+ return;
+ }
+ this.nodes.input.value = '';
+ this.captchas.push({
+ challenge: this.nodes.img.alt,
+ response: response,
+ timeout: this.timeout
+ });
+ this.captchas.sort(function(a, b) {
+ return a.timeout - b.timeout;
+ });
+ this.count();
+ this.destroy();
+ this.setup(false, true);
+ return $.set('captchas', this.captchas);
+ },
+ clear: function() {
+ var captcha, i, j, len, now, ref;
+ if (!this.captchas.length) {
+ return;
+ }
+ $.forceSync('captchas');
+ now = Date.now();
+ ref = this.captchas;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ captcha = ref[i];
+ if (captcha.timeout > now) {
+ break;
+ }
+ }
+ if (!i) {
+ return;
+ }
+ this.captchas = this.captchas.slice(i);
+ this.count();
+ return $.set('captchas', this.captchas);
+ },
+ load: function() {
+ var challenge, challenge_image;
+ if ($('#captchaContainerAlt[class~="recaptcha_is_showing_audio"]')) {
+ this.nodes.img.src = this.blank;
+ return;
+ }
+ if (!this.nodes.challenge.firstChild) {
+ return;
+ }
+ if (!(challenge_image = $.id('recaptcha_challenge_image'))) {
+ return;
+ }
+ this.timeout = Date.now() + this.lifetime * $.SECOND - $.MINUTE;
+ challenge = this.nodes.challenge.firstChild.value;
+ this.nodes.img.alt = challenge;
+ this.nodes.img.src = challenge_image.src;
+ this.nodes.input.value = '';
+ return this.clear();
+ },
+ count: function() {
+ var count, placeholder;
+ count = this.captchas ? this.captchas.length : 0;
+ placeholder = this.nodes.input.placeholder.replace(/\ \(.*\)$/, '');
+ placeholder += (function() {
+ switch (count) {
+ case 0:
+ if (placeholder === 'Verification') {
+ return ' (Shift + Enter to cache)';
+ } else {
+ return '';
+ }
+ break;
+ case 1:
+ return ' (1 cached captcha)';
+ default:
+ return " (" + count + " cached captchas)";
+ }
+ })();
+ this.nodes.input.placeholder = placeholder;
+ this.nodes.input.alt = count;
+ clearTimeout(this.timer);
+ if (count) {
+ return this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
+ }
+ },
+ reload: function(focus) {
+ $.global(function() {
+ if (window.Recaptcha.type === 'image') {
+ window.Recaptcha.reload();
+ } else {
+ window.Recaptcha.switch_type('image');
+ }
+ return window.Recaptcha.should_focus = false;
+ });
+ if (focus) {
+ return this.nodes.input.focus();
+ }
+ },
+ keydown: function(e) {
+ if (e.keyCode === 8 && !this.nodes.input.value) {
+ this.reload();
+ } else if (e.keyCode === 13 && e.shiftKey) {
+ this.save();
+ } else {
+ return;
+ }
+ return e.preventDefault();
+ }
+ };
+
+}).call(this);
+
+(function() {
+ Captcha.v2 = {
+ lifetime: 2 * $.MINUTE,
+ init: function() {
+ var counter, root;
+ if (d.cookie.indexOf('pass_enabled=1') >= 0) {
+ return;
+ }
+ if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt, #captcha-forced-noscript'))) {
+ return;
+ }
+ if ((this.noscript = Conf['Force Noscript Captcha'] || !Main.jsEnabled)) {
+ $.addClass(QR.nodes.el, 'noscript-captcha');
+ }
+ this.captchas = [];
+ $.get('captchas', [], function(arg) {
+ var captchas;
+ captchas = arg.captchas;
+ return QR.captcha.sync(captchas);
+ });
+ $.sync('captchas', this.sync.bind(this));
+ root = $.el('div', {
+ className: 'captcha-root'
+ });
+ $.extend(root, {
+ innerHTML: ""
+ });
+ counter = $('.captcha-counter > a', root);
+ this.nodes = {
+ root: root,
+ counter: counter
+ };
+ this.count();
+ $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2');
+ $.after(QR.nodes.com.parentNode, root);
+ $.on(counter, 'click', this.toggle.bind(this));
+ $.on(counter, 'keydown', (function(_this) {
+ return function(e) {
+ if (Keybinds.keyCode(e) !== 'Space') {
+ return;
+ }
+ _this.toggle();
+ e.preventDefault();
+ return e.stopPropagation();
+ };
+ })(this));
+ return $.on(window, 'captcha:success', (function(_this) {
+ return function() {
+ return $.queueTask(function() {
+ return _this.save(false);
+ });
+ };
+ })(this));
+ },
+ timeouts: {},
+ postsCount: 0,
+ noscriptURL: function() {
+ var lang, url;
+ url = 'https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc';
+ if ((lang = Conf['captchaLanguage'].trim())) {
+ url += "&hl=" + (encodeURIComponent(lang));
+ }
+ return url;
+ },
+ needed: function() {
+ var captchaCount;
+ captchaCount = this.captchas.length;
+ if (QR.req) {
+ captchaCount++;
+ }
+ this.postsCount = QR.posts.length;
+ if (this.postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
+ this.postsCount = 0;
+ }
+ return captchaCount < this.postsCount;
+ },
+ onNewPost: function() {
+ return this.setup();
+ },
+ onPostChange: function() {
+ if (this.postsCount === 0) {
+ this.setup();
+ }
+ if (QR.posts.length === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
+ return this.postsCount = 0;
+ }
+ },
+ toggle: function() {
+ if (this.nodes.container && !this.timeouts.destroy) {
+ return this.destroy();
+ } else {
+ return this.setup(true, true);
+ }
+ },
+ setup: function(focus, force) {
+ if (!(this.isEnabled && (this.needed() || force))) {
+ return;
+ }
+ if (focus) {
+ $.addClass(QR.nodes.el, 'focus');
+ this.nodes.counter.focus();
+ }
+ if (this.timeouts.destroy) {
+ clearTimeout(this.timeouts.destroy);
+ delete this.timeouts.destroy;
+ return this.reload();
+ }
+ if (this.nodes.container) {
+ $.queueTask((function(_this) {
+ return function() {
+ var iframe;
+ if (_this.nodes.container && d.activeElement === _this.nodes.counter && (iframe = $('iframe', _this.nodes.container))) {
+ iframe.focus();
+ return QR.focus();
+ }
+ };
+ })(this));
+ return;
+ }
+ this.nodes.container = $.el('div', {
+ className: 'captcha-container'
+ });
+ $.prepend(this.nodes.root, this.nodes.container);
+ new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, {
+ childList: true,
+ subtree: true
+ });
+ if (this.noscript) {
+ return this.setupNoscript();
+ } else {
+ return this.setupJS();
+ }
+ },
+ setupNoscript: function() {
+ var div, iframe, textarea;
+ iframe = $.el('iframe', {
+ id: 'qr-captcha-iframe',
+ src: this.noscriptURL()
+ });
+ div = $.el('div');
+ textarea = $.el('textarea');
+ $.add(div, textarea);
+ return $.add(this.nodes.container, [iframe, div]);
+ },
+ setupJS: function() {
+ return $.global(function() {
+ var cbNative, render;
+ render = function() {
+ var classList, container;
+ classList = document.documentElement.classList;
+ container = document.querySelector('#qr .captcha-container');
+ return container.dataset.widgetID = window.grecaptcha.render(container, {
+ sitekey: '6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc',
+ theme: classList.contains('tomorrow') || classList.contains('dark-captcha') ? 'dark' : 'light',
+ callback: function(response) {
+ return window.dispatchEvent(new CustomEvent('captcha:success', {
+ detail: response
+ }));
+ }
+ });
+ };
+ if (window.grecaptcha) {
+ return render();
+ } else {
+ cbNative = window.onRecaptchaLoaded;
+ return window.onRecaptchaLoaded = function() {
+ render();
+ return cbNative();
+ };
+ }
+ });
+ },
+ afterSetup: function(mutations) {
+ var iframe, j, k, len, len1, mutation, node, ref, textarea;
+ for (j = 0, len = mutations.length; j < len; j++) {
+ mutation = mutations[j];
+ ref = mutation.addedNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
+ if ((iframe = $.x('./descendant-or-self::iframe', node))) {
+ this.setupIFrame(iframe);
+ }
+ if ((textarea = $.x('./descendant-or-self::textarea', node))) {
+ this.setupTextArea(textarea);
+ }
+ }
+ }
+ },
+ setupIFrame: function(iframe) {
+ if (!doc.contains(iframe)) {
+ return;
+ }
+ Captcha.replace.iframe(iframe);
+ $.addClass(QR.nodes.el, 'captcha-open');
+ this.fixQRPosition();
+ $.on(iframe, 'load', this.fixQRPosition);
+ if (d.activeElement === this.nodes.counter) {
+ iframe.focus();
+ }
+ return $.global(function() {
+ var f;
+ f = document.querySelector('#qr iframe');
+ return f.focus = f.blur = function() {};
+ });
+ },
+ fixQRPosition: function() {
+ if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
+ QR.nodes.el.style.top = null;
+ return QR.nodes.el.style.bottom = '0px';
+ }
+ },
+ setupTextArea: function(textarea) {
+ return $.one(textarea, 'input', (function(_this) {
+ return function() {
+ return _this.save(true);
+ };
+ })(this));
+ },
+ destroy: function() {
+ var garbage, i, ins, node, ref;
+ if (!this.isEnabled) {
+ return;
+ }
+ delete this.timeouts.destroy;
+ $.rmClass(QR.nodes.el, 'captcha-open');
+ if (this.nodes.container) {
+ $.rm(this.nodes.container);
+ }
+ delete this.nodes.container;
+ garbage = $.X('//iframe[starts-with(@src, "https://www.google.com/recaptcha/api2/frame")]/ancestor-or-self::*[parent::body]');
+ i = 0;
+ while (node = garbage.snapshotItem(i++)) {
+ if (((ref = (ins = node.nextSibling)) != null ? ref.nodeName : void 0) === 'INS') {
+ $.rm(ins);
+ }
+ $.rm(node);
+ }
+ },
+ sync: function(captchas) {
+ if (captchas == null) {
+ captchas = [];
+ }
+ this.captchas = captchas;
+ this.clear();
+ return this.count();
+ },
+ getOne: function() {
+ var captcha;
+ this.clear();
+ if ((captcha = this.captchas.shift())) {
+ $.set('captchas', this.captchas);
+ this.count();
+ return captcha;
+ } else {
+ return null;
+ }
+ },
+ save: function(pasted, token) {
+ var base, focus, ref;
+ $.forceSync('captchas');
+ this.captchas.push({
+ response: token || $('textarea', this.nodes.container).value,
+ timeout: Date.now() + this.lifetime
+ });
+ this.captchas.sort(function(a, b) {
+ return a.timeout - b.timeout;
+ });
+ $.set('captchas', this.captchas);
+ this.count();
+ focus = ((ref = d.activeElement) != null ? ref.nodeName : void 0) === 'IFRAME' && /https?:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src);
+ if (this.needed()) {
+ if (focus) {
+ if (QR.cooldown.auto || Conf['Post on Captcha Completion']) {
+ this.nodes.counter.focus();
+ } else {
+ QR.nodes.status.focus();
+ }
+ }
+ this.reload();
+ } else {
+ if (pasted) {
+ this.destroy();
+ } else {
+ if ((base = this.timeouts).destroy == null) {
+ base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
+ }
+ }
+ if (focus) {
+ QR.nodes.status.focus();
+ }
+ }
+ if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) {
+ return QR.submit();
+ }
+ },
+ clear: function() {
+ var captcha, i, j, len, now, ref;
+ if (!this.captchas.length) {
+ return;
+ }
+ $.forceSync('captchas');
+ now = Date.now();
+ ref = this.captchas;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ captcha = ref[i];
+ if (captcha.timeout > now) {
+ break;
+ }
+ }
+ if (!i) {
+ return;
+ }
+ this.captchas = this.captchas.slice(i);
+ this.count();
+ $.set('captchas', this.captchas);
+ return this.setup(d.activeElement === QR.nodes.status);
+ },
+ count: function() {
+ this.nodes.counter.textContent = "Captchas: " + this.captchas.length;
+ clearTimeout(this.timeouts.clear);
+ if (this.captchas.length) {
+ return this.timeouts.clear = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
+ }
+ },
+ reload: function() {
+ if ($('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) {
+ this.destroy();
+ return this.setup(false, true);
+ } else {
+ return $.global(function() {
+ var container;
+ container = document.querySelector('#qr .captcha-container');
+ return window.grecaptcha.reset(container.dataset.widgetID);
+ });
+ }
+ }
+ };
+
+}).call(this);
+
+PassLink = (function() {
+ var PassLink;
+
+ PassLink = {
+ init: function() {
+ if (!Conf['Pass Link']) {
+ return;
+ }
+ return Main.ready(this.ready);
+ },
+ ready: function() {
+ var passLink, styleSelector;
+ if (!(styleSelector = $.id('styleSelector'))) {
+ return;
+ }
+ passLink = $.el('span', {
+ className: 'brackets-wrap pass-link-container'
+ });
+ $.extend(passLink, {
+ innerHTML: " 4chan Pass "
+ });
+ $.on(passLink.firstElementChild, 'click', function() {
+ return window.open('//sys.4chan.org/auth', Date.now(), 'width=500,height=280,toolbar=0');
+ });
+ return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]);
+ }
+ };
+
+ return PassLink;
+
+}).call(this);
+
+PostSuccessful = (function() {
+ var PostSuccessful;
+
+ PostSuccessful = {
+ init: function() {
+ if (!Conf['Remember Your Posts']) {
+ return;
+ }
+ return $.ready(this.ready);
+ },
+ ready: function() {
+ var _, db, postID, ref, threadID;
+ if (d.title !== 'Post successful!') {
+ return;
+ }
+ ref = $('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref[0], threadID = ref[1], postID = ref[2];
+ postID = +postID;
+ threadID = +threadID || postID;
+ db = new DataBoard('yourPosts');
+ return db.set({
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ postID: postID,
+ val: true
+ });
+ }
+ };
+
+ return PostSuccessful;
+
+}).call(this);
+
+QR = (function() {
+ var QR,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ slice = [].slice;
+
+ QR = {
+ mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'],
+ validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i,
+ typeFromExtension: {
+ 'jpg': 'image/jpeg',
+ 'jpeg': 'image/jpeg',
+ 'png': 'image/png',
+ 'gif': 'image/gif',
+ 'pdf': 'application/pdf',
+ 'swf': 'application/vnd.adobe.flash.movie',
+ 'webm': 'video/webm'
+ },
+ extensionFromType: {
+ 'image/jpeg': 'jpg',
+ 'image/png': 'png',
+ 'image/gif': 'gif',
+ 'application/pdf': 'pdf',
+ 'application/vnd.adobe.flash.movie': 'swf',
+ 'application/x-shockwave-flash': 'swf',
+ 'video/webm': 'webm'
+ },
+ init: function() {
+ var sc, version;
+ if (!Conf['Quick Reply']) {
+ return;
+ }
+ this.posts = [];
+ if (g.VIEW === 'archive') {
+ return;
+ }
+ version = Conf['Use Recaptcha v1'] && Main.jsEnabled ? 'v1' : 'v2';
+ this.captcha = Captcha[version];
+ $.on(d, '4chanXInitFinished', this.initReady);
+ Callbacks.Post.push({
+ name: 'Quick Reply',
+ cb: this.node
+ });
+ if (Conf['QR Shortcut']) {
+ this.shortcut = sc = $.el('a', {
+ className: 'qr-shortcut fa fa-comment-o disabled',
+ textContent: 'QR',
+ title: 'Quick Reply',
+ href: 'javascript:;'
+ });
+ $.on(sc, 'click', function() {
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) {
+ QR.open();
+ return QR.nodes.com.focus();
+ } else {
+ return QR.close();
+ }
+ });
+ return Header.addShortcut(sc);
+ }
+ },
+ initReady: function() {
+ var link, linkBot, navLinksBot, origToggle;
+ $.off(d, '4chanXInitFinished', this.initReady);
+ QR.postingIsEnabled = !!$.id('postForm');
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ link = $.el('h1', {
+ className: "qr-link-container"
+ });
+ $.extend(link, {
+ innerHTML: "
" + ((g.VIEW === "thread") ? "Reply to Thread" : "Start a Thread") + " "
+ });
+ QR.link = link.firstElementChild;
+ $.on(link.firstChild, 'click', function() {
+ QR.open();
+ return QR.nodes.com.focus();
+ });
+ if (Conf['Bottom QR Link'] && g.VIEW === 'thread') {
+ linkBot = $.el('div', {
+ className: "brackets-wrap qr-link-container-bottom"
+ });
+ $.extend(linkBot, {
+ innerHTML: "
Reply to Thread "
+ });
+ $.on(linkBot.firstElementChild, 'click', function() {
+ QR.open();
+ return QR.nodes.com.focus();
+ });
+ if ((navLinksBot = $('.navLinksBot'))) {
+ $.prepend(navLinksBot, linkBot);
+ }
+ }
+ origToggle = $.id('togglePostFormLink');
+ $.before(origToggle, link);
+ origToggle.firstElementChild.textContent = 'Original Form';
+ $.on(d, 'QRGetFile', QR.getFile);
+ $.on(d, 'QRSetFile', QR.setFile);
+ $.on(d, 'paste', QR.paste);
+ $.on(d, 'dragover', QR.dragOver);
+ $.on(d, 'drop', QR.dropFile);
+ $.on(d, 'dragstart dragend', QR.drag);
+ $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
+ $.on(d, 'ThreadUpdate', QR.statusCheck);
+ if (!Conf['Persistent QR']) {
+ return;
+ }
+ QR.open();
+ if (Conf['Auto Hide QR']) {
+ return QR.hide();
+ }
+ },
+ statusCheck: function() {
+ var thread;
+ if (!QR.nodes) {
+ return;
+ }
+ thread = QR.posts[0].thread;
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
+ return QR.abort();
+ } else {
+ return QR.status();
+ }
+ },
+ node: function() {
+ $.on(this.nodes.quote, 'click', QR.quote);
+ if (this.isFetchedQuote) {
+ return QR.generatePostableThreadsList();
+ }
+ },
+ open: function() {
+ var err;
+ if (QR.nodes) {
+ if (QR.nodes.el.hidden) {
+ QR.captcha.setup();
+ }
+ QR.nodes.el.hidden = false;
+ QR.unhide();
+ } else {
+ try {
+ QR.dialog();
+ } catch (_error) {
+ err = _error;
+ delete QR.nodes;
+ Main.handleErrors({
+ message: 'Quick Reply dialog creation crashed.',
+ error: err
+ });
+ return;
+ }
+ }
+ if (Conf['QR Shortcut']) {
+ return $.rmClass(QR.shortcut, 'disabled');
+ }
+ },
+ close: function() {
+ var j, len, post, ref;
+ if (QR.req) {
+ QR.abort();
+ return;
+ }
+ QR.nodes.el.hidden = true;
+ QR.cleanNotifications();
+ d.activeElement.blur();
+ $.rmClass(QR.nodes.el, 'dump');
+ if (Conf['QR Shortcut']) {
+ $.addClass(QR.shortcut, 'disabled');
+ }
+ new QR.post(true);
+ ref = QR.posts.splice(0, QR.posts.length - 1);
+ for (j = 0, len = ref.length; j < len; j++) {
+ post = ref[j];
+ post["delete"]();
+ }
+ QR.cooldown.auto = false;
+ QR.status();
+ return QR.captcha.destroy();
+ },
+ focus: function() {
+ return $.queueTask(function() {
+ if (!QR.inBubble()) {
+ QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement);
+ return QR.nodes.el.classList.toggle('focus', QR.hasFocus);
+ }
+ });
+ },
+ inBubble: function() {
+ var bubbles, ref;
+ bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
+ return (ref = d.activeElement, indexOf.call(bubbles, ref) >= 0) || bubbles.some(function(el) {
+ return getComputedStyle(el).visibility !== 'hidden' && el.getBoundingClientRect().bottom > 0;
+ });
+ },
+ hide: function() {
+ d.activeElement.blur();
+ $.addClass(QR.nodes.el, 'autohide');
+ return QR.nodes.autohide.checked = true;
+ },
+ unhide: function() {
+ $.rmClass(QR.nodes.el, 'autohide');
+ return QR.nodes.autohide.checked = false;
+ },
+ toggleHide: function() {
+ if (this.checked) {
+ return QR.hide();
+ } else {
+ return QR.unhide();
+ }
+ },
+ toggleSJIS: function(e) {
+ e.preventDefault();
+ Conf['sjisPreview'] = !Conf['sjisPreview'];
+ $.set('sjisPreview', Conf['sjisPreview']);
+ return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']);
+ },
+ texPreviewShow: function() {
+ if ($.hasClass(QR.nodes.el, 'tex-preview')) {
+ return QR.texPreviewHide();
+ }
+ $.addClass(QR.nodes.el, 'tex-preview');
+ QR.nodes.texPreview.textContent = QR.nodes.com.value;
+ return $.event('mathjax', null, QR.nodes.texPreview);
+ },
+ texPreviewHide: function() {
+ return $.rmClass(QR.nodes.el, 'tex-preview');
+ },
+ setCustomCooldown: function(enabled) {
+ Conf['customCooldownEnabled'] = enabled;
+ QR.cooldown.customCooldown = enabled;
+ return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);
+ },
+ toggleCustomCooldown: function() {
+ var enabled;
+ enabled = $.hasClass(this, 'disabled');
+ QR.setCustomCooldown(enabled);
+ return $.set('customCooldownEnabled', enabled);
+ },
+ error: function(err, focusOverride) {
+ var el, notice, notif;
+ QR.open();
+ if (typeof err === 'string') {
+ el = $.tn(err);
+ } else {
+ el = err;
+ el.removeAttribute('style');
+ }
+ notice = new Notice('warning', el);
+ QR.notifications.push(notice);
+ if (!Header.areNotificationsEnabled) {
+ if (d.hidden && !QR.cooldown.auto) {
+ return alert(el.textContent);
+ }
+ } else if (d.hidden || !(focusOverride || d.hasFocus())) {
+ try {
+ notif = new Notification(el.textContent, {
+ body: el.textContent,
+ icon: Favicon.logo
+ });
+ notif.onclick = function() {
+ return $.global(function() {
+ return window.focus();
+ });
+ };
+ if ($.engine !== 'gecko') {
+ notif.onclose = function() {
+ return notice.close();
+ };
+ return notif.onshow = function() {
+ return setTimeout(function() {
+ notif.onclose = null;
+ return notif.close();
+ }, 7 * $.SECOND);
+ };
+ }
+ } catch (_error) {}
+ }
+ },
+ notifications: [],
+ cleanNotifications: function() {
+ var j, len, notification, ref;
+ ref = QR.notifications;
+ for (j = 0, len = ref.length; j < len; j++) {
+ notification = ref[j];
+ notification.close();
+ }
+ return QR.notifications = [];
+ },
+ status: function() {
+ var disabled, status, thread, value;
+ if (!QR.nodes) {
+ return;
+ }
+ thread = QR.posts[0].thread;
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
+ value = 'Dead';
+ disabled = true;
+ QR.cooldown.auto = false;
+ }
+ value = QR.req ? QR.req.progress : QR.cooldown.seconds || value;
+ status = QR.nodes.status;
+ status.value = !value ? 'Submit' : QR.cooldown.auto ? "Auto " + value : value;
+ return status.disabled = disabled || false;
+ },
+ openPost: function() {
+ var index;
+ QR.open();
+ if (QR.selected.isLocked) {
+ index = QR.posts.indexOf(QR.selected);
+ (QR.posts[index + 1] || new QR.post()).select();
+ $.addClass(QR.nodes.el, 'dump');
+ return QR.cooldown.auto = true;
+ }
+ },
+ quote: function(e) {
+ var ancestor, caretPos, com, frag, insideCode, j, k, l, len, len1, len2, len3, len4, len5, n, node, o, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread;
+ if (e != null) {
+ e.preventDefault();
+ }
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ sel = d.getSelection();
+ post = Get.postFromNode(this);
+ text = post.board.ID === g.BOARD.ID ? ">>" + post + "\n" : ">>>/" + post.board + "/" + post + "\n";
+ if (sel.toString().trim() && post === Get.postFromNode(sel.anchorNode)) {
+ range = sel.getRangeAt(0);
+ frag = range.cloneContents();
+ ancestor = range.commonAncestorContainer;
+ if ($.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) {
+ $.prepend(frag, $.tn('[spoiler]'));
+ $.add(frag, $.tn('[/spoiler]'));
+ }
+ if (insideCode = $.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) {
+ $.prepend(frag, $.tn('[code]'));
+ $.add(frag, $.tn('[/code]'));
+ }
+ ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
+ for (j = 0, len = ref.length; j < len; j++) {
+ node = ref[j];
+ $.replace(node, $.tn('\n'));
+ }
+ ref1 = $$('br', frag);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ node = ref1[k];
+ if (node !== frag.lastChild) {
+ $.replace(node, $.tn('\n>'));
+ }
+ }
+ ref2 = $$('s, .removed-spoiler', frag);
+ for (l = 0, len2 = ref2.length; l < len2; l++) {
+ node = ref2[l];
+ $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')]));
+ }
+ ref3 = $$('.prettyprint', frag);
+ for (n = 0, len3 = ref3.length; n < len3; n++) {
+ node = ref3[n];
+ $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')]));
+ }
+ ref4 = $$('.linkify[data-original]', frag);
+ for (o = 0, len4 = ref4.length; o < len4; o++) {
+ node = ref4[o];
+ $.replace(node, $.tn(node.dataset.original));
+ }
+ ref5 = $$('.embedder', frag);
+ for (q = 0, len5 = ref5.length; q < len5; q++) {
+ node = ref5[q];
+ if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') {
+ $.rm(node.previousSibling);
+ }
+ $.rm(node);
+ }
+ text += ">" + (frag.textContent.trim()) + "\n";
+ }
+ QR.openPost();
+ ref7 = QR.nodes, com = ref7.com, thread = ref7.thread;
+ if (!com.value) {
+ thread.value = Get.threadFromNode(this);
+ }
+ caretPos = com.selectionStart;
+ com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
+ range = caretPos + text.length;
+ com.setSelectionRange(range, range);
+ com.focus();
+ QR.selected.save(com);
+ return QR.selected.save(thread);
+ },
+ characterCount: function() {
+ var count, counter;
+ counter = QR.nodes.charCount;
+ count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
+ counter.textContent = count;
+ counter.hidden = count < QR.max_comment / 2;
+ return (count > QR.max_comment ? $.addClass : $.rmClass)(counter, 'warning');
+ },
+ getFile: function() {
+ var ref;
+ return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0);
+ },
+ setFile: function(e) {
+ var file, name, ref, source;
+ ref = e.detail, file = ref.file, name = ref.name, source = ref.source;
+ if (name != null) {
+ file.name = name;
+ }
+ if (source != null) {
+ file.source = source;
+ }
+ QR.open();
+ return QR.handleFiles([file]);
+ },
+ drag: function(e) {
+ var toggle;
+ toggle = e.type === 'dragstart' ? $.off : $.on;
+ toggle(d, 'dragover', QR.dragOver);
+ return toggle(d, 'drop', QR.dropFile);
+ },
+ dragOver: function(e) {
+ e.preventDefault();
+ return e.dataTransfer.dropEffect = 'copy';
+ },
+ dropFile: function(e) {
+ if (!e.dataTransfer.files.length) {
+ return;
+ }
+ e.preventDefault();
+ QR.open();
+ return QR.handleFiles(e.dataTransfer.files);
+ },
+ paste: function(e) {
+ var blob, files, item, j, len, ref;
+ if (!e.clipboardData.items) {
+ return;
+ }
+ files = [];
+ ref = e.clipboardData.items;
+ for (j = 0, len = ref.length; j < len; j++) {
+ item = ref[j];
+ if (!(item.kind === 'file')) {
+ continue;
+ }
+ blob = item.getAsFile();
+ blob.name = 'file';
+ if (blob.type) {
+ blob.name += '.' + blob.type.split('/')[1];
+ }
+ files.push(blob);
+ }
+ if (!files.length) {
+ return;
+ }
+ QR.open();
+ QR.handleFiles(files);
+ return $.addClass(QR.nodes.el, 'dump');
+ },
+ pasteFF: function() {
+ var arr, blob, bstr, i, images, img, j, k, len, m, pasteArea, ref, src;
+ pasteArea = QR.nodes.pasteArea;
+ if (!pasteArea.childNodes.length) {
+ return;
+ }
+ images = $$('img', pasteArea);
+ $.rmAll(pasteArea);
+ for (j = 0, len = images.length; j < len; j++) {
+ img = images[j];
+ src = img.src;
+ if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) {
+ bstr = atob(m[3]);
+ arr = new Uint8Array(bstr.length);
+ for (i = k = 0, ref = bstr.length; 0 <= ref ? k < ref : k > ref; i = 0 <= ref ? ++k : --k) {
+ arr[i] = bstr.charCodeAt(i);
+ }
+ blob = new Blob([arr], {
+ type: m[1]
+ });
+ blob.name = "file." + m[2];
+ QR.handleFiles([blob]);
+ } else if (/^https?:\/\//.test(src)) {
+ QR.handleUrl(src);
+ }
+ }
+ },
+ handleUrl: function(urlDefault) {
+ var url;
+ url = prompt('Enter a URL:', urlDefault);
+ if (url === null) {
+ return;
+ }
+ QR.nodes.fileButton.focus();
+ return CrossOrigin.file(url, function(blob) {
+ if (blob && !/^text\//.test(blob.type)) {
+ return QR.handleFiles([blob]);
+ } else {
+ return QR.error("Can't load file.");
+ }
+ });
+ },
+ handleFiles: function(files) {
+ var file, j, len;
+ if (this !== QR) {
+ files = slice.call(this.files);
+ this.value = null;
+ }
+ if (!files.length) {
+ return;
+ }
+ QR.cleanNotifications();
+ for (j = 0, len = files.length; j < len; j++) {
+ file = files[j];
+ QR.handleFile(file, files.length);
+ }
+ if (files.length !== 1) {
+ $.addClass(QR.nodes.el, 'dump');
+ }
+ if (d.activeElement === QR.nodes.fileButton && $.hasClass(QR.nodes.fileSubmit, 'has-file')) {
+ return QR.nodes.filename.focus();
+ }
+ },
+ handleFile: function(file, nfiles) {
+ var isText, post;
+ isText = /^text\//.test(file.type);
+ if (nfiles === 1) {
+ post = QR.selected;
+ } else {
+ post = QR.posts[QR.posts.length - 1];
+ if ((isText ? post.com || post.pasting : post.file)) {
+ post = new QR.post();
+ }
+ }
+ return post[isText ? 'pasteText' : 'setFile'](file);
+ },
+ openFileInput: function() {
+ if (QR.nodes.fileButton.disabled) {
+ return;
+ }
+ QR.nodes.fileInput.click();
+ return QR.nodes.fileButton.focus();
+ },
+ generatePostableThreadsList: function() {
+ var j, len, list, options, ref, thread, val;
+ if (!QR.nodes) {
+ return;
+ }
+ list = QR.nodes.thread;
+ options = [list.firstElementChild];
+ ref = g.BOARD.threads.keys;
+ for (j = 0, len = ref.length; j < len; j++) {
+ thread = ref[j];
+ options.push($.el('option', {
+ value: thread,
+ textContent: "Thread " + thread
+ }));
+ }
+ val = list.value;
+ $.rmAll(list);
+ $.add(list, options);
+ list.value = val;
+ if (list.value === val) {
+ return;
+ }
+ list.value = g.VIEW === 'thread' ? g.THREADID : 'new';
+ return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
+ },
+ dialog: function() {
+ var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, scriptData, setNode;
+ QR.nodes = nodes = {
+ el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
+ innerHTML: "
"
+ })
+ };
+ setNode = function(name, query) {
+ return nodes[name] = $(query, dialog);
+ };
+ setNode('move', '.move');
+ setNode('autohide', '#autohide');
+ setNode('close', '.close');
+ setNode('thread', 'select');
+ setNode('form', 'form');
+ setNode('sjisToggle', '#sjis-toggle');
+ setNode('texButton', '#tex-preview-button');
+ setNode('name', '[data-name=name]');
+ setNode('email', '[data-name=email]');
+ setNode('sub', '[data-name=sub]');
+ setNode('com', '[data-name=com]');
+ setNode('charCount', '#char-count');
+ setNode('texPreview', '#tex-preview');
+ setNode('dumpList', '#dump-list');
+ setNode('addPost', '#add-post');
+ setNode('oekaki', '.oekaki');
+ setNode('drawButton', '#qr-draw-button');
+ setNode('fileSubmit', '#file-n-submit');
+ setNode('fileButton', '#qr-file-button');
+ setNode('noFile', '#qr-no-file');
+ setNode('filename', '#qr-filename');
+ setNode('spoiler', '#qr-file-spoiler');
+ setNode('oekakiButton', '#qr-oekaki-button');
+ setNode('fileRM', '#qr-filerm');
+ setNode('urlButton', '#url-button');
+ setNode('pasteArea', '#paste-area');
+ setNode('customCooldown', '#custom-cooldown-button');
+ setNode('dumpButton', '#dump-button');
+ setNode('status', '[type=submit]');
+ setNode('flashTag', '[name=filetag]');
+ setNode('fileInput', '[type=file]');
+ rules = $('ul.rules').textContent.trim();
+ match_min = rules.match(/.+smaller than (\d+)x(\d+).+/);
+ match_max = rules.match(/.+greater than (\d+)x(\d+).+/);
+ QR.min_width = +(match_min != null ? match_min[1] : void 0) || 1;
+ QR.min_height = +(match_min != null ? match_min[2] : void 0) || 1;
+ QR.max_width = +(match_max != null ? match_max[1] : void 0) || 10000;
+ QR.max_height = +(match_max != null ? match_max[2] : void 0) || 10000;
+ scriptData = Get.scriptData();
+ QR.max_size = (m = scriptData.match(/\bmaxFilesize *= *(\d+)\b/)) ? +m[1] : 4194304;
+ QR.max_size_video = (m = scriptData.match(/\bmaxWebmFilesize *= *(\d+)\b/)) ? +m[1] : QR.max_size;
+ QR.max_comment = (m = scriptData.match(/\bcomlen *= *(\d+)\b/)) ? +m[1] : 2000;
+ QR.max_width_video = QR.max_height_video = 2048;
+ QR.max_duration_video = (ref = g.BOARD.ID) === 'gif' || ref === 'wsg' ? 300 : 120;
+ if (Conf['Show New Thread Option in Threads']) {
+ $.addClass(QR.nodes.el, 'show-new-thread-option');
+ }
+ if (Conf['Show Name and Subject']) {
+ $.addClass(QR.nodes.name, 'force-show');
+ $.addClass(QR.nodes.sub, 'force-show');
+ QR.nodes.email.placeholder = 'E-mail';
+ }
+ QR.forcedAnon = !!$('form[name="post"] input[name="name"][type="hidden"]');
+ if (QR.forcedAnon) {
+ $.addClass(QR.nodes.el, 'forced-anon');
+ }
+ QR.spoiler = !!$('.postForm input[name=spoiler]');
+ if (QR.spoiler) {
+ $.addClass(QR.nodes.el, 'has-spoiler');
+ }
+ if (g.BOARD.ID === 'jp' && Conf['sjisPreview']) {
+ $.addClass(QR.nodes.el, 'sjis-preview');
+ }
+ if (parseInt(Conf['customCooldown'], 10) > 0) {
+ $.addClass(QR.nodes.fileSubmit, 'custom-cooldown');
+ $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) {
+ var customCooldownEnabled;
+ customCooldownEnabled = arg.customCooldownEnabled;
+ QR.setCustomCooldown(customCooldownEnabled);
+ return $.sync('customCooldownEnabled', QR.setCustomCooldown);
+ });
+ }
+ $.on(nodes.autohide, 'change', QR.toggleHide);
+ $.on(nodes.close, 'click', QR.close);
+ $.on(nodes.form, 'submit', QR.submit);
+ $.on(nodes.sjisToggle, 'click', QR.toggleSJIS);
+ $.on(nodes.texButton, 'mousedown', QR.texPreviewShow);
+ $.on(nodes.texButton, 'mouseup', QR.texPreviewHide);
+ $.on(nodes.addPost, 'click', function() {
+ return new QR.post(true);
+ });
+ $.on(nodes.drawButton, 'click', QR.oekaki.draw);
+ $.on(nodes.fileButton, 'click', QR.openFileInput);
+ $.on(nodes.noFile, 'click', QR.openFileInput);
+ $.on(nodes.filename, 'focus', function() {
+ return $.addClass(this.parentNode, 'focus');
+ });
+ $.on(nodes.filename, 'blur', function() {
+ return $.rmClass(this.parentNode, 'focus');
+ });
+ $.on(nodes.spoiler, 'change', function() {
+ return QR.selected.nodes.spoiler.click();
+ });
+ $.on(nodes.oekakiButton, 'click', QR.oekaki.button);
+ $.on(nodes.fileRM, 'click', function() {
+ return QR.selected.rmFile();
+ });
+ $.on(nodes.urlButton, 'click', function() {
+ return QR.handleUrl('');
+ });
+ $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);
+ $.on(nodes.dumpButton, 'click', function() {
+ return nodes.el.classList.toggle('dump');
+ });
+ $.on(nodes.fileInput, 'change', QR.handleFiles);
+ window.addEventListener('focus', QR.focus, true);
+ window.addEventListener('blur', QR.focus, true);
+ $.on(d, 'click', QR.focus);
+ if ($.engine === 'gecko') {
+ nodes.pasteArea.hidden = false;
+ new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {
+ childList: true
+ });
+ }
+ items = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
+ i = 0;
+ save = function() {
+ return QR.selected.save(this);
+ };
+ while (name = items[i++]) {
+ if (!(node = nodes[name])) {
+ continue;
+ }
+ event = node.nodeName === 'SELECT' ? 'change' : 'input';
+ $.on(nodes[name], event, save);
+ }
+ if ($.engine === 'gecko' && Conf['Remember QR Size']) {
+ $.get('QR Size', '', function(item) {
+ return nodes.com.style.cssText = item['QR Size'];
+ });
+ $.on(nodes.com, 'mouseup', function(e) {
+ if (e.button !== 0) {
+ return;
+ }
+ return $.set('QR Size', this.style.cssText);
+ });
+ }
+ QR.generatePostableThreadsList();
+ QR.persona.load();
+ new QR.post(true);
+ QR.status();
+ QR.cooldown.setup();
+ QR.captcha.init();
+ $.add(d.body, dialog);
+ QR.captcha.setup();
+ QR.oekaki.setup();
+ return $.event('QRDialogCreation', null, dialog);
+ },
+ submit: function(e) {
+ var captcha, cb, err, extra, filetag, formData, options, post, ref, textOnly, thread, threadID;
+ if (e != null) {
+ e.preventDefault();
+ }
+ if (QR.req) {
+ QR.abort();
+ return;
+ }
+ if (QR.cooldown.seconds) {
+ QR.cooldown.auto = !QR.cooldown.auto;
+ QR.status();
+ return;
+ }
+ post = QR.posts[0];
+ post.forceSave();
+ threadID = post.thread;
+ thread = g.BOARD.threads[threadID];
+ if (g.BOARD.ID === 'f' && threadID === 'new') {
+ filetag = QR.nodes.flashTag.value;
+ }
+ if (threadID === 'new') {
+ threadID = null;
+ if (g.BOARD.ID === 'vg' && !post.sub) {
+ err = 'New threads require a subject.';
+ } else if (!($.hasClass(d.body, 'text_only') || post.file || (textOnly = !!$('input[name=textonly]', $.id('postForm'))))) {
+ err = 'No file selected.';
+ }
+ } else if (g.BOARD.threads[threadID].isClosed) {
+ err = 'You can\'t reply to this thread anymore.';
+ } else if (!(post.com || post.file)) {
+ err = 'No comment or file.';
+ } else if (post.file && thread.fileLimit) {
+ err = 'Max limit of image replies has been reached.';
+ }
+ if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
+ err || (err = 'Original comment required.');
+ }
+ if (QR.captcha.isEnabled && !err) {
+ captcha = QR.captcha.getOne();
+ if (!captcha) {
+ err = 'No valid captcha.';
+ QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
+ }
+ }
+ QR.cleanNotifications();
+ if (err) {
+ QR.cooldown.auto = false;
+ QR.status();
+ QR.error(err);
+ return;
+ }
+ QR.cooldown.auto = QR.posts.length > 1;
+ if (Conf['Auto Hide QR'] && !QR.cooldown.auto) {
+ QR.hide();
+ }
+ if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) {
+ d.activeElement.blur();
+ }
+ post.lock();
+ formData = {
+ resto: threadID,
+ name: !QR.forcedAnon ? post.name : void 0,
+ email: post.email,
+ sub: !(QR.forcedAnon || threadID) ? post.sub : void 0,
+ com: post.com,
+ upfile: post.file,
+ filetag: filetag,
+ spoiler: post.spoiler,
+ textonly: textOnly,
+ mode: 'regist',
+ pwd: QR.persona.getPassword()
+ };
+ options = {
+ responseType: 'document',
+ withCredentials: true,
+ onload: QR.response,
+ onerror: function() {
+ delete QR.req;
+ post.unlock();
+ QR.cooldown.auto = false;
+ QR.status();
+ return QR.error($.el('span', {
+ innerHTML: "Connection error while posting. [
More info ]"
+ }));
+ }
+ };
+ extra = {
+ form: $.formData(formData),
+ upCallbacks: {
+ onload: function() {
+ QR.req.isUploadFinished = true;
+ QR.req.progress = '...';
+ return QR.status();
+ },
+ onprogress: function(e) {
+ QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%";
+ return QR.status();
+ }
+ }
+ };
+ cb = function(response) {
+ if (response != null) {
+ if (response.challenge != null) {
+ extra.form.append('recaptcha_challenge_field', response.challenge);
+ extra.form.append('recaptcha_response_field', response.response);
+ } else {
+ extra.form.append('g-recaptcha-response', response.response);
+ }
+ }
+ QR.req = $.ajax("https://sys.4chan.org/" + g.BOARD + "/post", options, extra);
+ return QR.req.progress = '...';
+ };
+ if (typeof captcha === 'function') {
+ QR.req = {
+ progress: '...',
+ abort: function() {
+ return cb = null;
+ }
+ };
+ captcha(function(response) {
+ if (response) {
+ return typeof cb === "function" ? cb(response) : void 0;
+ } else {
+ delete QR.req;
+ post.unlock();
+ QR.cooldown.auto = !!QR.captcha.captchas.length;
+ return QR.status();
+ }
+ });
+ } else {
+ cb(captcha);
+ }
+ return QR.status();
+ },
+ response: function() {
+ var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, req, resDoc, seconds, threadID;
+ req = QR.req;
+ delete QR.req;
+ post = QR.posts[0];
+ post.unlock();
+ resDoc = req.response;
+ if (ban = $('.banType', resDoc)) {
+ err = $.el('span', ban.textContent.toLowerCase() === 'banned' ? {
+ innerHTML: "You are banned on " + ($(".board", resDoc)).innerHTML + "! ;_;
Click
here to see the reason."
+ } : {
+ innerHTML: "You were issued a warning on " + ($(".board", resDoc)).innerHTML + " as " + ($(".nameBlock", resDoc)).innerHTML + ".
Reason: " + ($(".reason", resDoc)).innerHTML
+ });
+ } else if (err = resDoc.getElementById('errmsg')) {
+ if ((ref = $('a', err)) != null) {
+ ref.target = '_blank';
+ }
+ } else if (resDoc.title !== 'Post successful!') {
+ err = 'Connection error with sys.4chan.org.';
+ } else if (req.status !== 200) {
+ err = "Error " + req.statusText + " (" + req.status + ")";
+ }
+ if (err) {
+ if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
+ if (/mistyped/i.test(err.textContent)) {
+ err = $.el('span', {
+ innerHTML: "You mistyped the CAPTCHA, or the CAPTCHA malfunctioned [
complain here ]."
+ });
+ } else if (/expired/i.test(err.textContent)) {
+ err = 'This CAPTCHA is no longer valid because it has expired.';
+ }
+ QR.cooldown.auto = QR.captcha.isEnabled || err === 'Connection error with sys.4chan.org.';
+ QR.cooldown.addDelay(post, 2);
+ } else if (err.textContent && (m = err.textContent.match(/(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i)) && !/duplicate|hour/i.test(err.textContent)) {
+ QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent);
+ seconds = 60 * (+(m[1] || 0)) + (+m[2]);
+ if (/muted/i.test(err.textContent)) {
+ QR.cooldown.addMute(seconds);
+ } else {
+ QR.cooldown.addDelay(post, seconds);
+ }
+ } else {
+ QR.cooldown.auto = false;
+ }
+ QR.captcha.setup(QR.cooldown.auto && ((ref1 = d.activeElement) === QR.nodes.status || ref1 === d.body));
+ if (QR.captcha.isEnabled && !QR.captcha.captchas.length) {
+ QR.cooldown.auto = false;
+ }
+ QR.status();
+ QR.error(err);
+ return;
+ }
+ h1 = $('h1', resDoc);
+ QR.cleanNotifications();
+ if (Conf['Posting Success Notifications']) {
+ QR.notifications.push(new Notice('success', h1.textContent, 5));
+ }
+ ref2 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref2[0], threadID = ref2[1], postID = ref2[2];
+ postID = +postID;
+ threadID = +threadID || postID;
+ isReply = threadID !== postID;
+ $.event('QRPostSuccessful', {
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ postID: postID
+ });
+ $.event('QRPostSuccessful_', {
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ postID: postID
+ });
+ postsCount = QR.posts.length - 1;
+ QR.cooldown.auto = postsCount && isReply;
+ lastPostToThread = !((function() {
+ var j, len, p, ref3;
+ ref3 = QR.posts.slice(1);
+ for (j = 0, len = ref3.length; j < len; j++) {
+ p = ref3[j];
+ if (p.thread === post.thread) {
+ return true;
+ }
+ }
+ })());
+ if (!(Conf['Persistent QR'] || postsCount)) {
+ QR.close();
+ } else {
+ post.rm();
+ QR.captcha.setup(d.activeElement === QR.nodes.status);
+ }
+ QR.cooldown.add(threadID, postID);
+ URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && lastPostToThread && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
+ if (URL) {
+ open = Conf['Open Post in New Tab'] || postsCount ? function() {
+ return $.open(URL);
+ } : function() {
+ return window.location = URL;
+ };
+ if (threadID === postID) {
+ QR.waitForThread(URL, open);
+ } else {
+ open();
+ }
+ }
+ return QR.status();
+ },
+ waitForThread: function(url, cb) {
+ var attempts, check;
+ attempts = 0;
+ check = function() {
+ return $.ajax(url, {
+ onloadend: function() {
+ attempts++;
+ if (attempts >= 6 || this.status === 200) {
+ return cb();
+ } else {
+ return setTimeout(check, attempts * $.SECOND);
+ }
+ }
+ }, {
+ type: 'HEAD'
+ });
+ };
+ return check();
+ },
+ abort: function() {
+ if (QR.req && !QR.req.isUploadFinished) {
+ QR.req.abort();
+ delete QR.req;
+ QR.posts[0].unlock();
+ QR.cooldown.auto = false;
+ QR.notifications.push(new Notice('info', 'QR upload aborted.', 5));
+ }
+ return QR.status();
+ }
+ };
+
+ return QR;
+
+}).call(this);
+
+(function() {
+ QR.cooldown = {
+ seconds: 0,
+ delays: {
+ thread: 0,
+ reply: 0,
+ image: 0,
+ reply_intra: 0,
+ image_intra: 0,
+ deletion: 60,
+ thread_global: 300
+ },
+ init: function() {
+ if (!Conf['Quick Reply']) {
+ return;
+ }
+ this.data = Conf['cooldowns'];
+ return $.sync('cooldowns', this.sync);
+ },
+ setup: function() {
+ var delay, m, ref, type;
+ if (m = Get.scriptData().match(/\bcooldowns *= *({[^}]+})/)) {
+ $.extend(QR.cooldown.delays, JSON.parse(m[1]));
+ }
+ QR.cooldown.maxDelay = 0;
+ ref = QR.cooldown.delays;
+ for (type in ref) {
+ delay = ref[type];
+ if (type !== 'thread' && type !== 'thread_global') {
+ QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay);
+ }
+ }
+ QR.cooldown.isSetup = true;
+ return QR.cooldown.start();
+ },
+ start: function() {
+ var data;
+ data = QR.cooldown.data;
+ if (!(Conf['Cooldown'] && QR.cooldown.isSetup && !QR.cooldown.isCounting && Object.keys(data[g.BOARD.ID] || {}).length + Object.keys(data.global || {}).length > 0)) {
+ return;
+ }
+ QR.cooldown.isCounting = true;
+ return QR.cooldown.count();
+ },
+ sync: function(data) {
+ QR.cooldown.data = data || {};
+ return QR.cooldown.start();
+ },
+ add: function(threadID, postID) {
+ var boardID, start;
+ if (!Conf['Cooldown']) {
+ return;
+ }
+ start = Date.now();
+ boardID = g.BOARD.ID;
+ QR.cooldown.set(boardID, start, {
+ threadID: threadID,
+ postID: postID
+ });
+ if (threadID === postID) {
+ QR.cooldown.set('global', start, {
+ boardID: boardID,
+ threadID: threadID,
+ postID: postID
+ });
+ }
+ return QR.cooldown.start();
+ },
+ addDelay: function(post, delay) {
+ var cooldown;
+ if (!Conf['Cooldown']) {
+ return;
+ }
+ cooldown = QR.cooldown.categorize(post);
+ cooldown.delay = delay;
+ QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown);
+ return QR.cooldown.start();
+ },
+ addMute: function(delay) {
+ if (!Conf['Cooldown']) {
+ return;
+ }
+ QR.cooldown.set(g.BOARD.ID, Date.now(), {
+ type: 'mute',
+ delay: delay
+ });
+ return QR.cooldown.start();
+ },
+ "delete": function(post) {
+ var base, cooldown, cooldowns, id, name;
+ if (!QR.cooldown.data) {
+ return;
+ }
+ $.forceSync('cooldowns');
+ cooldowns = ((base = QR.cooldown.data)[name = post.board.ID] || (base[name] = {}));
+ for (id in cooldowns) {
+ cooldown = cooldowns[id];
+ if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
+ delete cooldowns[id];
+ }
+ }
+ return QR.cooldown.save([post.board.ID]);
+ },
+ secondsDeletion: function(post) {
+ var cooldown, cooldowns, seconds, start;
+ if (!(QR.cooldown.data && Conf['Cooldown'])) {
+ return 0;
+ }
+ cooldowns = QR.cooldown.data[post.board.ID] || {};
+ for (start in cooldowns) {
+ cooldown = cooldowns[start];
+ if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
+ seconds = QR.cooldown.delays.deletion - Math.floor((Date.now() - start) / $.SECOND);
+ return Math.max(seconds, 0);
+ }
+ }
+ return 0;
+ },
+ categorize: function(post) {
+ if (post.thread === 'new') {
+ return {
+ type: 'thread'
+ };
+ } else {
+ return {
+ type: !!post.file ? 'image' : 'reply',
+ threadID: +post.thread
+ };
+ }
+ },
+ set: function(scope, id, value) {
+ var base, cooldowns;
+ $.forceSync('cooldowns');
+ cooldowns = ((base = QR.cooldown.data)[scope] || (base[scope] = {}));
+ cooldowns[id] = value;
+ return $.set('cooldowns', QR.cooldown.data);
+ },
+ save: function(scopes) {
+ var data, i, len, scope;
+ data = QR.cooldown.data;
+ for (i = 0, len = scopes.length; i < len; i++) {
+ scope = scopes[i];
+ if (scope in data && !Object.keys(data[scope]).length) {
+ delete data[scope];
+ }
+ }
+ return $.set('cooldowns', data);
+ },
+ count: function() {
+ var base, cooldown, cooldowns, elapsed, i, len, maxDelay, nCooldowns, now, ref, ref1, save, scope, seconds, start, suffix, threadID, type, update;
+ $.forceSync('cooldowns');
+ save = [];
+ nCooldowns = 0;
+ now = Date.now();
+ ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID;
+ seconds = 0;
+ if (Conf['Cooldown']) {
+ ref1 = [g.BOARD.ID, 'global'];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ scope = ref1[i];
+ cooldowns = ((base = QR.cooldown.data)[scope] || (base[scope] = {}));
+ for (start in cooldowns) {
+ cooldown = cooldowns[start];
+ start = +start;
+ elapsed = Math.floor((now - start) / $.SECOND);
+ if (elapsed < 0) {
+ delete cooldowns[start];
+ save.push(scope);
+ continue;
+ }
+ if (cooldown.delay != null) {
+ if (cooldown.delay <= elapsed) {
+ delete cooldowns[start];
+ save.push(scope);
+ } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') {
+ seconds = Math.max(seconds, cooldown.delay - elapsed);
+ }
+ continue;
+ }
+ maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread'];
+ if (QR.cooldown.customCooldown) {
+ maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10));
+ }
+ if (maxDelay <= elapsed) {
+ delete cooldowns[start];
+ save.push(scope);
+ continue;
+ }
+ if ((type === 'thread') === (cooldown.threadID === cooldown.postID) && cooldown.boardID !== g.BOARD.ID) {
+ suffix = scope === 'global' ? '_global' : type !== 'thread' && threadID === cooldown.threadID ? '_intra' : '';
+ seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed);
+ }
+ if (QR.cooldown.customCooldown) {
+ seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed);
+ }
+ }
+ nCooldowns += Object.keys(cooldowns).length;
+ }
+ }
+ if (save.length) {
+ QR.cooldown.save(save);
+ }
+ if (nCooldowns) {
+ clearTimeout(QR.cooldown.timeout);
+ QR.cooldown.timeout = setTimeout(QR.cooldown.count, $.SECOND);
+ } else {
+ delete QR.cooldown.isCounting;
+ }
+ update = seconds !== QR.cooldown.seconds;
+ QR.cooldown.seconds = seconds;
+ if (update) {
+ QR.status();
+ }
+ if (seconds === 0 && QR.cooldown.auto && !QR.req) {
+ return QR.submit();
+ }
+ }
+ };
+
+}).call(this);
+
+(function() {
+ QR.oekaki = {
+ menu: {
+ init: function() {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Edit Link'] && Conf['Quick Reply'])) {
+ return;
+ }
+ a = $.el('a', {
+ className: 'edit-link',
+ href: 'javascript:;',
+ textContent: 'Edit image'
+ });
+ $.on(a, 'click', this.editFile);
+ return Menu.menu.addEntry({
+ el: a,
+ order: 95,
+ open: function(post) {
+ var file;
+ QR.oekaki.menu.post = post;
+ file = post.file;
+ return QR.postingIsEnabled && !!file && (file.isImage || file.isVideo);
+ }
+ });
+ },
+ editFile: function() {
+ var currentTime, isVideo, post, ref;
+ post = QR.oekaki.menu.post;
+ QR.quote.call(post.nodes.post);
+ isVideo = post.file.isVideo;
+ currentTime = ((ref = post.file.fullImage) != null ? ref.currentTime : void 0) || 0;
+ return CrossOrigin.file(post.file.url, function(blob) {
+ var video;
+ if (!blob) {
+ return QR.error("Can't load file.");
+ } else if (isVideo) {
+ video = $.el('video');
+ $.on(video, 'loadedmetadata', function() {
+ $.on(video, 'seeked', function() {
+ var canvas;
+ canvas = $.el('canvas', {
+ width: video.videoWidth,
+ height: video.videoHeight
+ });
+ canvas.getContext('2d').drawImage(video, 0, 0);
+ return canvas.toBlob(function(snapshot) {
+ snapshot.name = post.file.name.replace(/\.\w+$/, '') + '.png';
+ QR.handleFiles([snapshot]);
+ return QR.oekaki.edit();
+ });
+ });
+ return video.currentTime = currentTime;
+ });
+ return video.src = URL.createObjectURL(blob);
+ } else {
+ blob.name = post.file.name;
+ QR.handleFiles([blob]);
+ return QR.oekaki.edit();
+ }
+ });
+ }
+ },
+ setup: function() {
+ return $.global(function() {
+ var FCX;
+ FCX = window.FCX;
+ FCX.oekakiCB = function() {
+ return window.Tegaki.flatten().toBlob(function(file) {
+ var source;
+ source = "oekaki-" + (Date.now());
+ FCX.oekakiLatest = source;
+ return document.dispatchEvent(new CustomEvent('QRSetFile', {
+ bubbles: true,
+ detail: {
+ file: file,
+ name: FCX.oekakiName,
+ source: source
+ }
+ }));
+ });
+ };
+ if (window.Tegaki) {
+ return document.querySelector('#qr .oekaki').hidden = false;
+ }
+ });
+ },
+ load: function(cb) {
+ var n, onload, script, style;
+ if ($('script[src^="//s.4cdn.org/js/painter"]', d.head)) {
+ return cb();
+ } else {
+ style = $.el('link', {
+ rel: 'stylesheet',
+ href: "//s.4cdn.org/css/painter." + (Date.now()) + ".css"
+ });
+ script = $.el('script', {
+ src: "//s.4cdn.org/js/painter.min." + (Date.now()) + ".js"
+ });
+ n = 0;
+ onload = function() {
+ if (++n === 2) {
+ return cb();
+ }
+ };
+ $.on(style, 'load', onload);
+ $.on(script, 'load', onload);
+ return $.add(d.head, [style, script]);
+ }
+ },
+ draw: function() {
+ return $.global(function() {
+ var FCX, Tegaki;
+ Tegaki = window.Tegaki, FCX = window.FCX;
+ if (Tegaki.bg) {
+ Tegaki.destroy();
+ }
+ FCX.oekakiName = 'tegaki.png';
+ return Tegaki.open({
+ onDone: FCX.oekakiCB,
+ onCancel: function() {
+ return Tegaki.bgColor = '#ffffff';
+ },
+ width: +document.querySelector('#qr [name=oekaki-width]').value,
+ height: +document.querySelector('#qr [name=oekaki-height]').value,
+ bgColor: document.querySelector('#qr [name=oekaki-bg]').checked ? document.querySelector('#qr [name=oekaki-bgcolor]').value : 'transparent'
+ });
+ });
+ },
+ button: function() {
+ if (QR.selected.file) {
+ return QR.oekaki.edit();
+ } else {
+ return QR.oekaki.toggle();
+ }
+ },
+ edit: function() {
+ return QR.oekaki.load(function() {
+ return $.global(function() {
+ var FCX, Tegaki, cb, error, name, source;
+ Tegaki = window.Tegaki, FCX = window.FCX;
+ name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png';
+ source = document.getElementById('file-n-submit').dataset.source;
+ error = function(content) {
+ return document.dispatchEvent(new CustomEvent('CreateNotification', {
+ bubbles: true,
+ detail: {
+ type: 'warning',
+ content: content,
+ lifetime: 20
+ }
+ }));
+ };
+ cb = function(e) {
+ var file, isVideo;
+ document.removeEventListener('QRFile', cb, false);
+ if (!e.detail) {
+ return error('No file to edit.');
+ }
+ if (!/^(image|video)\//.test(e.detail.type)) {
+ return error('Not an image.');
+ }
+ isVideo = /^video\//.test(e.detail.type);
+ file = document.createElement(isVideo ? 'video' : 'img');
+ file.addEventListener('error', function() {
+ return error('Could not open file.', false);
+ });
+ file.addEventListener((isVideo ? 'loadeddata' : 'load'), function() {
+ if (Tegaki.bg) {
+ Tegaki.destroy();
+ }
+ FCX.oekakiName = name;
+ Tegaki.open({
+ onDone: FCX.oekakiCB,
+ onCancel: function() {
+ return Tegaki.bgColor = '#ffffff';
+ },
+ width: file.naturalWidth || file.videoWidth,
+ height: file.naturalHeight || file.videoHeight,
+ bgColor: 'transparent'
+ });
+ return Tegaki.activeCtx.drawImage(file, 0, 0);
+ }, false);
+ return file.src = URL.createObjectURL(e.detail);
+ };
+ if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) {
+ FCX.oekakiName = name;
+ return Tegaki.resume();
+ } else {
+ document.addEventListener('QRFile', cb, false);
+ return document.dispatchEvent(new CustomEvent('QRGetFile', {
+ bubbles: true
+ }));
+ }
+ });
+ });
+ },
+ toggle: function() {
+ return QR.oekaki.load(function() {
+ return QR.nodes.oekaki.hidden = !QR.nodes.oekaki.hidden;
+ });
+ }
+ };
+
+}).call(this);
+
+(function() {
+ var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ QR.persona = {
+ always: {},
+ types: {
+ name: [],
+ email: [],
+ sub: []
+ },
+ init: function() {
+ var i, item, len, ref;
+ if (!(Conf['Quick Reply'] || (Conf['Menu'] && Conf['Delete Link']))) {
+ return;
+ }
+ ref = Conf['QR.personas'].split('\n');
+ for (i = 0, len = ref.length; i < len; i++) {
+ item = ref[i];
+ QR.persona.parseItem(item.trim());
+ }
+ },
+ parseItem: function(item) {
+ var boards, match, ref, ref1, ref2, type, val;
+ if (item[0] === '#') {
+ return;
+ }
+ if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) {
+ return;
+ }
+ ref = match, match = ref[0], type = ref[1], val = ref[2];
+ item = item.replace(match, '');
+ boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global';
+ if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) {
+ return;
+ }
+ if (type === 'password') {
+ QR.persona.pwd = val;
+ return;
+ }
+ if (type === 'options') {
+ type = 'email';
+ }
+ if (type === 'subject') {
+ type = 'sub';
+ }
+ if (/always/i.test(item)) {
+ QR.persona.always[type] = val;
+ }
+ if (indexOf.call(QR.persona.types[type], val) < 0) {
+ return QR.persona.types[type].push(val);
+ }
+ },
+ load: function() {
+ var arr, i, len, list, ref, type, val;
+ ref = QR.persona.types;
+ for (type in ref) {
+ arr = ref[type];
+ list = $("#list-" + type, QR.nodes.el);
+ for (i = 0, len = arr.length; i < len; i++) {
+ val = arr[i];
+ if (val) {
+ $.add(list, $.el('option', {
+ textContent: val
+ }));
+ }
+ }
+ }
+ },
+ getPassword: function() {
+ var m;
+ if (QR.persona.pwd != null) {
+ return QR.persona.pwd;
+ } else if ((m = d.cookie.match(/4chan_pass=([^;]+)/))) {
+ return decodeURIComponent(m[1]);
+ } else {
+ return '';
+ }
+ },
+ get: function(cb) {
+ return $.get('QR.persona', {}, function(arg) {
+ var persona;
+ persona = arg['QR.persona'];
+ return cb(persona);
+ });
+ },
+ set: function(post) {
+ return $.get('QR.persona', {}, function(arg) {
+ var persona;
+ persona = arg['QR.persona'];
+ persona = {
+ name: post.name
+ };
+ return $.set('QR.persona', persona);
+ });
+ }
+ };
+
+}).call(this);
+
+(function() {
+ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ slice = [].slice;
+
+ QR.post = (function() {
+ function _Class(select) {
+ this.select = bind(this.select, this);
+ var el, event, i, j, label, len, len1, prev, ref, ref1;
+ el = $.el('a', {
+ className: 'qr-preview',
+ draggable: true,
+ href: 'javascript:;'
+ });
+ $.extend(el, {
+ innerHTML: "
Spoiler"
+ });
+ this.nodes = {
+ el: el,
+ rm: el.firstChild,
+ spoiler: $('.qr-preview-spoiler input', el),
+ span: el.lastChild
+ };
+ $.on(el, 'click', this.select);
+ $.on(this.nodes.rm, 'click', (function(_this) {
+ return function(e) {
+ e.stopPropagation();
+ return _this.rm();
+ };
+ })(this));
+ $.on(this.nodes.spoiler, 'change', (function(_this) {
+ return function(e) {
+ _this.spoiler = e.target.checked;
+ if (_this === QR.selected) {
+ return QR.nodes.spoiler.checked = _this.spoiler;
+ }
+ };
+ })(this));
+ ref = $$('label', el);
+ for (i = 0, len = ref.length; i < len; i++) {
+ label = ref[i];
+ $.on(label, 'click', function(e) {
+ return e.stopPropagation();
+ });
+ }
+ $.add(QR.nodes.dumpList, el);
+ ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ event = ref1[j];
+ $.on(el, event.toLowerCase(), this[event]);
+ }
+ this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
+ prev = QR.posts[QR.posts.length - 1];
+ QR.posts.push(this);
+ this.nodes.spoiler.checked = this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false;
+ QR.persona.get((function(_this) {
+ return function(persona) {
+ _this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name;
+ _this.email = 'email' in QR.persona.always ? QR.persona.always.email : '';
+ _this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : '';
+ if (QR.selected === _this) {
+ return _this.load();
+ }
+ };
+ })(this));
+ if (select) {
+ this.select();
+ }
+ this.unlock();
+ $.queueTask(function() {
+ return QR.captcha.onNewPost();
+ });
+ }
+
+ _Class.prototype.rm = function() {
+ var index;
+ this["delete"]();
+ index = QR.posts.indexOf(this);
+ if (QR.posts.length === 1) {
+ new QR.post(true);
+ $.rmClass(QR.nodes.el, 'dump');
+ } else if (this === QR.selected) {
+ (QR.posts[index - 1] || QR.posts[index + 1]).select();
+ }
+ QR.posts.splice(index, 1);
+ return QR.status();
+ };
+
+ _Class.prototype["delete"] = function() {
+ $.rm(this.nodes.el);
+ URL.revokeObjectURL(this.URL);
+ return this.dismissErrors();
+ };
+
+ _Class.prototype.lock = function(lock) {
+ var i, len, name, node, ref;
+ if (lock == null) {
+ lock = true;
+ }
+ this.isLocked = lock;
+ if (this !== QR.selected) {
+ return;
+ }
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ if (node = QR.nodes[name]) {
+ node.disabled = lock;
+ }
+ }
+ this.nodes.rm.style.visibility = lock ? 'hidden' : '';
+ this.nodes.spoiler.disabled = lock;
+ return this.nodes.el.draggable = !lock;
+ };
+
+ _Class.prototype.unlock = function() {
+ return this.lock(false);
+ };
+
+ _Class.prototype.select = function() {
+ var rectEl, rectList;
+ if (QR.selected) {
+ QR.selected.nodes.el.removeAttribute('id');
+ QR.selected.forceSave();
+ }
+ QR.selected = this;
+ this.lock(this.isLocked);
+ this.nodes.el.id = 'selected';
+ rectEl = this.nodes.el.getBoundingClientRect();
+ rectList = this.nodes.el.parentNode.getBoundingClientRect();
+ this.nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2;
+ return this.load();
+ };
+
+ _Class.prototype.load = function() {
+ var i, len, name, node, ref;
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ if (!(node = QR.nodes[name])) {
+ continue;
+ }
+ node.value = this[name] || node.dataset["default"] || '';
+ }
+ (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
+ this.showFileData();
+ return QR.characterCount();
+ };
+
+ _Class.prototype.save = function(input) {
+ var name, ref;
+ if (input.type === 'checkbox') {
+ this.spoiler = input.checked;
+ return;
+ }
+ name = input.dataset.name;
+ this[name] = input.value || input.dataset["default"] || null;
+ switch (name) {
+ case 'thread':
+ (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
+ return QR.status();
+ case 'com':
+ this.updateComment();
+ if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
+ return QR.cooldown.auto = false;
+ }
+ break;
+ case 'filename':
+ if (!this.file) {
+ return;
+ }
+ this.saveFilename();
+ return this.updateFilename();
+ case 'name':
+ return QR.persona.set(this);
+ }
+ };
+
+ _Class.prototype.forceSave = function() {
+ var i, len, name, node, ref;
+ if (this !== QR.selected) {
+ return;
+ }
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ if (!(node = QR.nodes[name])) {
+ continue;
+ }
+ this.save(node);
+ }
+ };
+
+ _Class.prototype.setComment = function(com) {
+ this.com = com || null;
+ if (this === QR.selected) {
+ QR.nodes.com.value = this.com;
+ }
+ return this.updateComment();
+ };
+
+ _Class.prototype.updateComment = function() {
+ if (this === QR.selected) {
+ QR.characterCount();
+ }
+ this.nodes.span.textContent = this.com;
+ return $.queueTask(function() {
+ return QR.captcha.onPostChange();
+ });
+ };
+
+ _Class.rmErrored = function(e) {
+ var error, errors, i, j, len, post, ref;
+ e.stopPropagation();
+ ref = QR.posts;
+ for (i = ref.length - 1; i >= 0; i += -1) {
+ post = ref[i];
+ if (errors = post.errors) {
+ for (j = 0, len = errors.length; j < len; j++) {
+ error = errors[j];
+ if (!(doc.contains(error))) {
+ continue;
+ }
+ post.rm();
+ break;
+ }
+ }
+ }
+ };
+
+ _Class.prototype.error = function(className, message) {
+ var div, ref, rm, rmAll;
+ div = $.el('div', {
+ className: className
+ });
+ $.extend(div, {
+ innerHTML: E(message) + "
[
delete ] [
delete all ]"
+ });
+ (this.errors || (this.errors = [])).push(div);
+ ref = $$('a', div), rm = ref[0], rmAll = ref[1];
+ $.on(div, 'click', (function(_this) {
+ return function() {
+ if (indexOf.call(QR.posts, _this) >= 0) {
+ return _this.select();
+ }
+ };
+ })(this));
+ $.on(rm, 'click', (function(_this) {
+ return function(e) {
+ e.stopPropagation();
+ if (indexOf.call(QR.posts, _this) >= 0) {
+ return _this.rm();
+ }
+ };
+ })(this));
+ $.on(rmAll, 'click', QR.post.rmErrored);
+ return QR.error(div, true);
+ };
+
+ _Class.prototype.fileError = function(message) {
+ return this.error('file-error', this.filename + ": " + message);
+ };
+
+ _Class.prototype.dismissErrors = function(test) {
+ var error, i, len, ref;
+ if (test == null) {
+ test = function() {
+ return true;
+ };
+ }
+ if (this.errors) {
+ ref = this.errors;
+ for (i = 0, len = ref.length; i < len; i++) {
+ error = ref[i];
+ if (doc.contains(error) && test(error)) {
+ error.parentNode.previousElementSibling.click();
+ }
+ }
+ }
+ };
+
+ _Class.prototype.setFile = function(file1) {
+ var ext, ref;
+ this.file = file1;
+ if (Conf['Randomize Filename'] && g.BOARD.ID !== 'f') {
+ this.filename = "" + (Date.now() - Math.floor(Math.random() * 365 * $.DAY));
+ if (ext = this.file.name.match(QR.validExtension)) {
+ this.filename += ext[0];
+ }
+ } else {
+ this.filename = this.file.name;
+ }
+ this.filesize = $.bytesToString(this.file.size);
+ this.checkSize();
+ $.addClass(this.nodes.el, 'has-file');
+ $.queueTask(function() {
+ return QR.captcha.onPostChange();
+ });
+ URL.revokeObjectURL(this.URL);
+ this.saveFilename();
+ if (this === QR.selected) {
+ this.showFileData();
+ } else {
+ this.updateFilename();
+ }
+ this.nodes.el.style.backgroundImage = null;
+ if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) {
+ return this.fileError('Unsupported file type.');
+ } else if (/^(image|video)\//.test(this.file.type)) {
+ return this.readFile();
+ }
+ };
+
+ _Class.prototype.checkSize = function() {
+ var max;
+ max = QR.max_size;
+ if (/^video\//.test(this.file.type)) {
+ max = Math.min(max, QR.max_size_video);
+ }
+ if (this.file.size > max) {
+ return this.fileError("File too large (file: " + this.filesize + ", max: " + ($.bytesToString(max)) + ").");
+ }
+ };
+
+ _Class.prototype.readFile = function() {
+ var el, event, isVideo, onerror, onload;
+ isVideo = /^video\//.test(this.file.type);
+ el = $.el(isVideo ? 'video' : 'img');
+ if (isVideo && !el.canPlayType(this.file.type)) {
+ return;
+ }
+ event = isVideo ? 'loadeddata' : 'load';
+ onload = (function(_this) {
+ return function() {
+ $.off(el, event, onload);
+ $.off(el, 'error', onerror);
+ _this.checkDimensions(el);
+ return _this.setThumbnail(el);
+ };
+ })(this);
+ onerror = (function(_this) {
+ return function() {
+ $.off(el, event, onload);
+ $.off(el, 'error', onerror);
+ _this.fileError((isVideo ? 'Video' : 'Image') + " appears corrupt");
+ return URL.revokeObjectURL(el.src);
+ };
+ })(this);
+ $.on(el, event, onload);
+ $.on(el, 'error', onerror);
+ return el.src = URL.createObjectURL(this.file);
+ };
+
+ _Class.prototype.checkDimensions = function(el) {
+ var duration, height, max_height, max_width, ref, videoHeight, videoWidth, width;
+ if (el.tagName === 'IMG') {
+ height = el.height, width = el.width;
+ if (height > QR.max_height || width > QR.max_width) {
+ this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
+ }
+ if (height < QR.min_height || width < QR.min_width) {
+ return this.fileError("Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ }
+ } else {
+ videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration;
+ max_height = Math.min(QR.max_height, QR.max_height_video);
+ max_width = Math.min(QR.max_width, QR.max_width_video);
+ if (videoHeight > max_height || videoWidth > max_width) {
+ this.fileError("Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
+ }
+ if (videoHeight < QR.min_height || videoWidth < QR.min_width) {
+ this.fileError("Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ }
+ if (!isFinite(duration)) {
+ this.fileError('Video lacks duration metadata (try remuxing)');
+ } else if (duration > QR.max_duration_video) {
+ this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
+ }
+ if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg') && $.hasAudio(el)) {
+ return this.fileError('Audio not allowed');
+ }
+ }
+ };
+
+ _Class.prototype.setThumbnail = function(el) {
+ var cv, height, isVideo, s, width;
+ isVideo = el.tagName === 'VIDEO';
+ s = 90 * 2 * window.devicePixelRatio;
+ if (this.file.type === 'image/gif') {
+ s *= 3;
+ }
+ if (isVideo) {
+ height = el.videoHeight;
+ width = el.videoWidth;
+ } else {
+ height = el.height, width = el.width;
+ if (height < s || width < s) {
+ this.URL = el.src;
+ this.nodes.el.style.backgroundImage = "url(" + this.URL + ")";
+ return;
+ }
+ }
+ if (height <= width) {
+ width = s / height * width;
+ height = s;
+ } else {
+ height = s / width * height;
+ width = s;
+ }
+ cv = $.el('canvas');
+ cv.height = height;
+ cv.width = width;
+ cv.getContext('2d').drawImage(el, 0, 0, width, height);
+ URL.revokeObjectURL(el.src);
+ return cv.toBlob((function(_this) {
+ return function(blob) {
+ _this.URL = URL.createObjectURL(blob);
+ return _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")";
+ };
+ })(this));
+ };
+
+ _Class.prototype.rmFile = function() {
+ if (this.isLocked) {
+ return;
+ }
+ delete this.file;
+ delete this.filename;
+ delete this.filesize;
+ this.nodes.el.removeAttribute('title');
+ QR.nodes.filename.removeAttribute('title');
+ this.nodes.el.style.backgroundImage = null;
+ $.rmClass(this.nodes.el, 'has-file');
+ this.showFileData();
+ URL.revokeObjectURL(this.URL);
+ return this.dismissErrors(function(error) {
+ return $.hasClass(error, 'file-error');
+ });
+ };
+
+ _Class.prototype.saveFilename = function() {
+ this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-');
+ if (!QR.validExtension.test(this.filename)) {
+ return this.file.newName += "." + (QR.extensionFromType[this.file.type] || 'jpg');
+ }
+ };
+
+ _Class.prototype.updateFilename = function() {
+ var long;
+ long = this.filename + " (" + this.filesize + ")";
+ this.nodes.el.title = long;
+ if (this !== QR.selected) {
+ return;
+ }
+ return QR.nodes.filename.title = long;
+ };
+
+ _Class.prototype.showFileData = function() {
+ var ref;
+ if (this.file) {
+ this.updateFilename();
+ QR.nodes.filename.value = this.filename;
+ $.addClass(QR.nodes.oekaki, 'has-file');
+ $.addClass(QR.nodes.fileSubmit, 'has-file');
+ } else {
+ $.rmClass(QR.nodes.oekaki, 'has-file');
+ $.rmClass(QR.nodes.fileSubmit, 'has-file');
+ }
+ if (((ref = this.file) != null ? ref.source : void 0) != null) {
+ QR.nodes.fileSubmit.dataset.source = this.file.source;
+ } else {
+ QR.nodes.fileSubmit.removeAttribute('data-source');
+ }
+ return QR.nodes.spoiler.checked = this.spoiler;
+ };
+
+ _Class.prototype.pasteText = function(file) {
+ var reader;
+ this.pasting = true;
+ reader = new FileReader();
+ reader.onload = (function(_this) {
+ return function(e) {
+ var result;
+ result = e.target.result;
+ _this.setComment((_this.com ? _this.com + "\n" + result : result));
+ return delete _this.pasting;
+ };
+ })(this);
+ return reader.readAsText(file);
+ };
+
+ _Class.prototype.dragStart = function(e) {
+ var left, ref, top;
+ ref = this.getBoundingClientRect(), left = ref.left, top = ref.top;
+ e.dataTransfer.setDragImage(this, e.clientX - left, e.clientY - top);
+ return $.addClass(this, 'drag');
+ };
+
+ _Class.prototype.dragEnd = function() {
+ return $.rmClass(this, 'drag');
+ };
+
+ _Class.prototype.dragEnter = function() {
+ return $.addClass(this, 'over');
+ };
+
+ _Class.prototype.dragLeave = function() {
+ return $.rmClass(this, 'over');
+ };
+
+ _Class.prototype.dragOver = function(e) {
+ e.preventDefault();
+ return e.dataTransfer.dropEffect = 'move';
+ };
+
+ _Class.prototype.drop = function() {
+ var el, index, newIndex, oldIndex, post;
+ $.rmClass(this, 'over');
+ if (!this.draggable) {
+ return;
+ }
+ el = $('.drag', this.parentNode);
+ index = function(el) {
+ return slice.call(el.parentNode.children).indexOf(el);
+ };
+ oldIndex = index(el);
+ newIndex = index(this);
+ (oldIndex < newIndex ? $.after : $.before)(this, el);
+ post = QR.posts.splice(oldIndex, 1)[0];
+ QR.posts.splice(newIndex, 0, post);
+ return QR.status();
+ };
+
+ return _Class;
+
+ })();
+
+}).call(this);
+
+QuoteBacklink = (function() {
+ var QuoteBacklink;
+
+ QuoteBacklink = {
+ containers: {},
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Quote Backlinking Part 1',
+ cb: this.firstNode
+ });
+ return Callbacks.Post.push({
+ name: 'Quote Backlinking Part 2',
+ cb: this.secondNode
+ });
+ },
+ firstNode: function() {
+ var a, clone, container, containers, hash, i, j, k, len, len1, len2, link, markYours, nodes, post, quote, ref, ref1, ref2;
+ if (this.isClone || !this.quotes.length || this.isRebuilt) {
+ return;
+ }
+ markYours = Conf['Mark Quotes of You'] && ((ref = QuoteYou.db) != null ? ref.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ }) : void 0);
+ a = $.el('a', {
+ href: Build.postURL(this.board.ID, this.thread.ID, this.ID),
+ className: this.isHidden ? 'filtered backlink' : 'backlink',
+ textContent: Conf['backlink'].replace(/%(?:id|%)/g, (function(_this) {
+ return function(x) {
+ return {
+ '%id': _this.ID,
+ '%%': '%'
+ }[x];
+ };
+ })(this)) + (markYours ? '\u00A0(You)' : '')
+ });
+ ref1 = this.quotes;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ quote = ref1[i];
+ containers = [QuoteBacklink.getContainer(quote)];
+ if ((post = g.posts[quote]) && post.nodes.backlinkContainer) {
+ ref2 = post.clones;
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ clone = ref2[j];
+ containers.push(clone.nodes.backlinkContainer);
+ }
+ }
+ for (k = 0, len2 = containers.length; k < len2; k++) {
+ container = containers[k];
+ link = a.cloneNode(true);
+ nodes = container.firstChild ? [$.tn(' '), link] : [link];
+ if (Conf['Quote Previewing']) {
+ $.on(link, 'mouseover', QuotePreview.mouseover);
+ }
+ if (Conf['Quote Inlining']) {
+ $.on(link, 'click', QuoteInline.toggle);
+ if (Conf['Quote Hash Navigation']) {
+ hash = QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
+ nodes.push(hash);
+ }
+ }
+ $.add(container, nodes);
+ }
+ }
+ },
+ secondNode: function() {
+ var container;
+ if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
+ this.nodes.backlinkContainer = $('.container', this.nodes.info);
+ return;
+ }
+ if (!(this.isReply || Conf['OP Backlinks'])) {
+ return;
+ }
+ container = QuoteBacklink.getContainer(this.fullID);
+ this.nodes.backlinkContainer = container;
+ return $.add(this.nodes.info, container);
+ },
+ getContainer: function(id) {
+ var base;
+ return (base = this.containers)[id] || (base[id] = $.el('span', {
+ className: 'container'
+ }));
+ }
+ };
+
+ return QuoteBacklink;
+
+}).call(this);
+
+QuoteCT = (function() {
+ var QuoteCT;
+
+ QuoteCT = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ this.text = '\u00A0(Cross-thread)';
+ return Callbacks.Post.push({
+ name: 'Mark Cross-thread Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var board, boardID, i, len, quotelink, ref, ref1, ref2, thread, threadID;
+ if (this.isClone && this.thread === this.context.thread) {
+ return;
+ }
+ ref = this.context, board = ref.board, thread = ref.thread;
+ ref1 = this.nodes.quotelinks;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ quotelink = ref1[i];
+ ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID;
+ if (!threadID) {
+ continue;
+ }
+ if (this.isClone) {
+ quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, '');
+ }
+ if (boardID === board.ID && threadID !== thread.ID) {
+ $.add(quotelink, $.tn(QuoteCT.text));
+ }
+ }
+ }
+ };
+
+ return QuoteCT;
+
+}).call(this);
+
+QuoteInline = (function() {
+ var QuoteInline;
+
+ QuoteInline = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ return Callbacks.Post.push({
+ name: 'Quote Inlining',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, isClone, j, len, len1, link, process, ref, ref1;
+ process = QuoteInline.process;
+ isClone = this.isClone;
+ ref = this.nodes.quotelinks;
+ for (i = 0, len = ref.length; i < len; i++) {
+ link = ref[i];
+ process(link, isClone);
+ }
+ ref1 = this.nodes.backlinks;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ link = ref1[j];
+ process(link, isClone);
+ }
+ },
+ process: function(link, clone) {
+ if (Conf['Quote Hash Navigation']) {
+ if (!clone) {
+ $.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')));
+ }
+ }
+ return $.on(link, 'click', QuoteInline.toggle);
+ },
+ qiQuote: function(link, hidden) {
+ var name;
+ name = "hashlink";
+ if (hidden) {
+ name += " filtered";
+ }
+ return $.el('a', {
+ className: name,
+ textContent: '#',
+ href: link.href
+ });
+ },
+ toggle: function(e) {
+ var boardID, context, postID, quoter, ref, ref1, threadID;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ if (Conf['Inline Cross-thread Quotes Only'] && g.VIEW === 'thread' && ((ref1 = g.posts[boardID + "." + postID]) != null ? ref1.nodes.root.offsetParent : void 0)) {
+ return;
+ }
+ e.preventDefault();
+ quoter = Get.postFromNode(this);
+ context = quoter.context;
+ if ($.hasClass(this, 'inlined')) {
+ QuoteInline.rm(this, boardID, threadID, postID, context);
+ } else {
+ if ($.x("ancestor::div[@data-full-i-d='" + boardID + "." + postID + "']", this)) {
+ return;
+ }
+ QuoteInline.add(this, boardID, threadID, postID, context, quoter);
+ }
+ return this.classList.toggle('inlined');
+ },
+ findRoot: function(quotelink, isBacklink) {
+ if (isBacklink) {
+ return quotelink.parentNode.parentNode;
+ } else {
+ return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink);
+ }
+ },
+ add: function(quotelink, boardID, threadID, postID, context, quoter) {
+ var inline, isBacklink, post, qroot, root;
+ isBacklink = $.hasClass(quotelink, 'backlink');
+ inline = $.el('div', {
+ className: 'inline'
+ });
+ inline.dataset.fullID = boardID + "." + postID;
+ root = QuoteInline.findRoot(quotelink, isBacklink);
+ $.after(root, inline);
+ qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
+ $.addClass(qroot, 'hasInline');
+ new Fetcher(boardID, threadID, postID, inline, quoter);
+ if (!((post = g.posts[boardID + "." + postID]) && context.thread === post.thread)) {
+ return;
+ }
+ if (isBacklink && Conf['Forward Hiding']) {
+ $.addClass(post.nodes.root, 'forwarded');
+ post.forwarded++ || (post.forwarded = 1);
+ }
+ if (!Unread.posts) {
+ return;
+ }
+ return Unread.readSinglePost(post);
+ },
+ rm: function(quotelink, boardID, threadID, postID, context) {
+ var el, inlined, isBacklink, post, qroot, ref, root;
+ isBacklink = $.hasClass(quotelink, 'backlink');
+ root = QuoteInline.findRoot(quotelink, isBacklink);
+ root = $.x("following-sibling::div[@data-full-i-d='" + boardID + "." + postID + "'][1]", root);
+ qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
+ $.rm(root);
+ if (!$('.inline', qroot)) {
+ $.rmClass(qroot, 'hasInline');
+ }
+ if (!(el = root.firstElementChild)) {
+ return;
+ }
+ post = g.posts[boardID + "." + postID];
+ post.rmClone(el.dataset.clone);
+ if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads[boardID + "." + threadID] && !--post.forwarded) {
+ delete post.forwarded;
+ $.rmClass(post.nodes.root, 'forwarded');
+ }
+ while (inlined = $('.inlined', el)) {
+ ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ QuoteInline.rm(inlined, boardID, threadID, postID, context);
+ $.rmClass(inlined, 'inlined');
+ }
+ }
+ };
+
+ return QuoteInline;
+
+}).call(this);
+
+QuoteOP = (function() {
+ var QuoteOP,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ QuoteOP = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ this.text = '\u00A0(OP)';
+ return Callbacks.Post.push({
+ name: 'Mark OP Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1;
+ if (this.isClone && this.thread === this.context.thread) {
+ return;
+ }
+ if (!(quotes = this.quotes).length) {
+ return;
+ }
+ quotelinks = this.nodes.quotelinks;
+ if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) {
+ i = 0;
+ while (quotelink = quotelinks[i++]) {
+ quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, '');
+ }
+ }
+ fullID = this.context.thread.fullID;
+ if (indexOf.call(quotes, fullID) < 0) {
+ return;
+ }
+ i = 0;
+ while (quotelink = quotelinks[i++]) {
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((boardID + "." + postID) === fullID) {
+ $.add(quotelink, $.tn(QuoteOP.text));
+ }
+ }
+ }
+ };
+
+ return QuoteOP;
+
+}).call(this);
+
+QuotePreview = (function() {
+ var QuotePreview,
+ slice = [].slice;
+
+ QuotePreview = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Quote Previewing'])) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ return Callbacks.Post.push({
+ name: 'Quote Previewing',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, len, link, ref;
+ ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks));
+ for (i = 0, len = ref.length; i < len; i++) {
+ link = ref[i];
+ $.on(link, 'mouseover', QuotePreview.mouseover);
+ }
+ },
+ mouseover: function(e) {
+ var boardID, i, len, origin, post, postID, posts, qp, ref, threadID;
+ if ($.hasClass(this, 'inlined') || !d.contains(this)) {
+ return;
+ }
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ qp = $.el('div', {
+ id: 'qp',
+ className: 'dialog'
+ });
+ $.add(Header.hover, qp);
+ new Fetcher(boardID, threadID, postID, qp, Get.postFromNode(this));
+ UI.hover({
+ root: this,
+ el: qp,
+ latestEvent: e,
+ endEvents: 'mouseout click',
+ cb: QuotePreview.mouseout
+ });
+ if (Conf['Quote Highlighting'] && (origin = g.posts[boardID + "." + postID])) {
+ posts = [origin].concat(origin.clones);
+ posts.pop();
+ for (i = 0, len = posts.length; i < len; i++) {
+ post = posts[i];
+ $.addClass(post.nodes.post, 'qphl');
+ }
+ }
+ },
+ mouseout: function() {
+ var clone, i, len, post, ref, root;
+ if (!(root = this.el.firstElementChild)) {
+ return;
+ }
+ clone = Get.postFromRoot(root);
+ post = clone.origin;
+ post.rmClone(root.dataset.clone);
+ if (!Conf['Quote Highlighting']) {
+ return;
+ }
+ ref = [post].concat(post.clones);
+ for (i = 0, len = ref.length; i < len; i++) {
+ post = ref[i];
+ $.rmClass(post.nodes.post, 'qphl');
+ }
+ }
+ };
+
+ return QuotePreview;
+
+}).call(this);
+
+QuoteStrikeThrough = (function() {
+ var QuoteStrikeThrough;
+
+ QuoteStrikeThrough = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Strike-through Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var boardID, i, len, postID, quotelink, ref, ref1, ref2;
+ if (this.isClone) {
+ return;
+ }
+ ref = this.nodes.quotelinks;
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((ref2 = g.posts[boardID + "." + postID]) != null ? ref2.isHidden : void 0) {
+ $.addClass(quotelink, 'filtered');
+ }
+ }
+ }
+ };
+
+ return QuoteStrikeThrough;
+
+}).call(this);
+
+QuoteThreading =
+/*
+ <3 aeosynth
+ */
+
+(function() {
+ var QuoteThreading;
+
+ QuoteThreading = {
+ init: function() {
+ if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
+ return;
+ }
+ this.controls = $.el('label', {
+ innerHTML: "
Threading"
+ });
+ this.threadNewLink = $.el('span', {
+ className: 'brackets-wrap threadnewlink',
+ hidden: true
+ });
+ $.extend(this.threadNewLink, {
+ innerHTML: "
Thread New Posts "
+ });
+ this.input = $('input', this.controls);
+ this.input.checked = Conf['Thread Quotes'];
+ $.on(this.input, 'change', this.setEnabled);
+ $.on(this.input, 'change', this.rethread);
+ $.on(this.threadNewLink.firstElementChild, 'click', this.rethread);
+ $.on(d, '4chanXInitFinished', (function(_this) {
+ return function() {
+ return _this.ready = true;
+ };
+ })(this));
+ Header.menu.addEntry(this.entry = {
+ el: this.controls,
+ order: 99
+ });
+ Callbacks.Thread.push({
+ name: 'Quote Threading',
+ cb: this.setThread
+ });
+ return Callbacks.Post.push({
+ name: 'Quote Threading',
+ cb: this.node
+ });
+ },
+ parent: {},
+ children: {},
+ inserted: {},
+ setEnabled: function() {
+ var other, ref;
+ other = (ref = ReplyPruning.inputs) != null ? ref.enabled : void 0;
+ if (this.checked && (other != null ? other.checked : void 0)) {
+ other.checked = false;
+ $.event('change', null, other);
+ }
+ return $.cb.checked.call(this);
+ },
+ setThread: function() {
+ QuoteThreading.thread = this;
+ return $.asap((function() {
+ return !Conf['Thread Updater'] || $('.navLinksBot > .updatelink');
+ }), function() {
+ var navLinksBot;
+ if ((navLinksBot = $('.navLinksBot'))) {
+ return $.add(navLinksBot, [$.tn(' '), QuoteThreading.threadNewLink]);
+ }
+ });
+ },
+ node: function() {
+ var ancestor, j, lastParent, len, parent, parents, quote, ref;
+ if (this.isFetchedQuote || this.isClone || !this.isReply) {
+ return;
+ }
+ parents = new Set();
+ lastParent = null;
+ ref = this.quotes;
+ for (j = 0, len = ref.length; j < len; j++) {
+ quote = ref[j];
+ if (parent = g.posts[quote]) {
+ if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) {
+ parents.add(parent.ID);
+ if (!lastParent || parent.ID > lastParent.ID) {
+ lastParent = parent;
+ }
+ }
+ }
+ }
+ if (!lastParent) {
+ return;
+ }
+ ancestor = lastParent;
+ while (ancestor = QuoteThreading.parent[ancestor.fullID]) {
+ parents["delete"](ancestor.ID);
+ }
+ if (parents.size === 1) {
+ return QuoteThreading.parent[this.fullID] = lastParent;
+ }
+ },
+ descendants: function(post) {
+ var child, children, j, len, posts;
+ posts = [post];
+ if (children = QuoteThreading.children[post.fullID]) {
+ for (j = 0, len = children.length; j < len; j++) {
+ child = children[j];
+ posts = posts.concat(QuoteThreading.descendants(child));
+ }
+ }
+ return posts;
+ },
+ insert: function(post) {
+ var base, child, children, descendants, i, j, k, l, len, name, next, nodes, order, parent, prev, prev2, threadContainer, x;
+ if (!(Conf['Thread Quotes'] && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) {
+ return false;
+ }
+ descendants = QuoteThreading.descendants(post);
+ if (!Unread.posts.has(parent.ID)) {
+ if ((function() {
+ var j, len, x;
+ for (j = 0, len = descendants.length; j < len; j++) {
+ x = descendants[j];
+ if (Unread.posts.has(x.ID)) {
+ return true;
+ }
+ }
+ })()) {
+ QuoteThreading.threadNewLink.hidden = false;
+ return false;
+ }
+ }
+ order = Unread.order;
+ children = ((base = QuoteThreading.children)[name = parent.fullID] || (base[name] = []));
+ threadContainer = parent.nodes.threadContainer || $.el('div', {
+ className: 'threadContainer'
+ });
+ nodes = [post.nodes.root];
+ if (post.nodes.threadContainer) {
+ nodes.push(post.nodes.threadContainer);
+ }
+ i = children.length;
+ for (j = children.length - 1; j >= 0; j += -1) {
+ child = children[j];
+ if (child.ID >= post.ID) {
+ i--;
+ }
+ }
+ if (i !== children.length) {
+ next = children[i];
+ for (k = 0, len = descendants.length; k < len; k++) {
+ x = descendants[k];
+ order.before(order[next.ID], order[x.ID]);
+ }
+ children.splice(i, 0, post);
+ $.before(next.nodes.root, nodes);
+ } else {
+ prev = parent;
+ while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
+ prev = prev2[prev2.length - 1];
+ }
+ for (l = descendants.length - 1; l >= 0; l += -1) {
+ x = descendants[l];
+ order.after(order[prev.ID], order[x.ID]);
+ }
+ children.push(post);
+ $.add(threadContainer, nodes);
+ }
+ QuoteThreading.inserted[post.fullID] = true;
+ if (!parent.nodes.threadContainer) {
+ parent.nodes.threadContainer = threadContainer;
+ $.addClass(parent.nodes.root, 'threadOP');
+ $.after(parent.nodes.root, threadContainer);
+ }
+ return true;
+ },
+ rethread: function() {
+ var nodes, posts, thread;
+ if (!QuoteThreading.ready) {
+ return;
+ }
+ thread = QuoteThreading.thread;
+ posts = thread.posts;
+ QuoteThreading.threadNewLink.hidden = true;
+ if (Conf['Thread Quotes']) {
+ posts.forEach(QuoteThreading.insert);
+ } else {
+ nodes = [];
+ Unread.order = new RandomAccessList();
+ QuoteThreading.inserted = {};
+ posts.forEach(function(post) {
+ if (post.isFetchedQuote) {
+ return;
+ }
+ Unread.order.push(post);
+ if (post.isReply) {
+ nodes.push(post.nodes.root);
+ }
+ if (QuoteThreading.children[post.fullID]) {
+ delete QuoteThreading.children[post.fullID];
+ $.rmClass(post.nodes.root, 'threadOP');
+ $.rm(post.nodes.threadContainer);
+ return delete post.nodes.threadContainer;
+ }
+ });
+ $.add(thread.OP.nodes.root.parentNode, nodes);
+ }
+ Unread.position = Unread.order.first;
+ Unread.updatePosition();
+ Unread.setLine(true);
+ Unread.read();
+ return Unread.update();
+ }
+ };
+
+ return QuoteThreading;
+
+}).call(this);
+
+QuoteYou = (function() {
+ var QuoteYou;
+
+ QuoteYou = {
+ init: function() {
+ var ref;
+ if (!Conf['Remember Your Posts']) {
+ return;
+ }
+ this.db = new DataBoard('yourPosts');
+ $.sync('Remember Your Posts', function(enabled) {
+ return Conf['Remember Your Posts'] = enabled;
+ });
+ $.on(d, 'QRPostSuccessful', function(e) {
+ var boardID, postID, ref, threadID;
+ $.forceSync('Remember Your Posts');
+ if (Conf['Remember Your Posts']) {
+ ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ return QuoteYou.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ postID: postID,
+ val: true
+ });
+ }
+ });
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ if (Conf['Highlight Own Posts']) {
+ $.addClass(doc, 'highlight-own');
+ }
+ if (Conf['Highlight Posts Quoting You']) {
+ $.addClass(doc, 'highlight-you');
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ this.text = '\u00A0(You)';
+ return Callbacks.Post.push({
+ name: 'Mark Quotes of You',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, len, quotelink, ref;
+ if (this.isClone) {
+ return;
+ }
+ if (QuoteYou.db.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ })) {
+ $.addClass(this.nodes.root, 'yourPost');
+ }
+ if (!this.quotes.length) {
+ return;
+ }
+ ref = this.nodes.quotelinks;
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) {
+ continue;
+ }
+ if (Conf['Mark Quotes of You']) {
+ $.add(quotelink, $.tn(QuoteYou.text));
+ }
+ $.addClass(quotelink, 'you');
+ $.addClass(this.nodes.root, 'quotesYou');
+ }
+ },
+ cb: {
+ seek: function(type) {
+ var highlight, post, posts, result, str;
+ if (highlight = $('.highlight')) {
+ $.rmClass(highlight, 'highlight');
+ }
+ if (!(QuoteYou.lastRead && doc.contains(QuoteYou.lastRead) && $.hasClass(QuoteYou.lastRead, 'quotesYou'))) {
+ if (!(post = QuoteYou.lastRead = $('.quotesYou'))) {
+ new Notice('warning', 'No posts are currently quoting you, loser.', 20);
+ return;
+ }
+ if (QuoteYou.cb.scroll(post)) {
+ return;
+ }
+ } else {
+ post = QuoteYou.lastRead;
+ }
+ str = type + "::div[contains(@class,'quotesYou')]";
+ while ((post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0))) {
+ if (QuoteYou.cb.scroll(post)) {
+ return;
+ }
+ }
+ posts = $$('.quotesYou');
+ return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]);
+ },
+ scroll: function(root) {
+ var post;
+ post = $('.post', root);
+ if (!post.getBoundingClientRect().height) {
+ return false;
+ } else {
+ QuoteYou.lastRead = root;
+ window.location = "#" + post.id;
+ Header.scrollTo(post);
+ $.addClass(post, 'highlight');
+ return true;
+ }
+ }
+ }
+ };
+
+ return QuoteYou;
+
+}).call(this);
+
+Quotify = (function() {
+ var Quotify,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ slice = [].slice;
+
+ Quotify = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ return Callbacks.Post.push({
+ name: 'Resurrect Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var deadlink, i, len, ref;
+ if (this.isClone) {
+ return;
+ }
+ ref = $$('.deadlink', this.nodes.comment);
+ for (i = 0, len = ref.length; i < len; i++) {
+ deadlink = ref[i];
+ Quotify.parseDeadlink.call(this, deadlink);
+ }
+ },
+ parseDeadlink: function(deadlink) {
+ var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref;
+ if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
+ Quotify.fixDeadlink(deadlink);
+ return;
+ }
+ quote = deadlink.textContent;
+ if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) {
+ return;
+ }
+ if (postID[0] === '0') {
+ Quotify.fixDeadlink(deadlink);
+ return;
+ }
+ boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID;
+ quoteID = boardID + "." + postID;
+ if (post = g.posts[quoteID]) {
+ if (!post.isDead) {
+ a = $.el('a', {
+ href: Build.postURL(boardID, post.thread.ID, postID),
+ className: 'quotelink',
+ textContent: quote
+ });
+ } else {
+ a = $.el('a', {
+ href: Build.postURL(boardID, post.thread.ID, postID),
+ className: 'quotelink deadlink',
+ textContent: quote + "\u00A0(Dead)"
+ });
+ $.extend(a.dataset, {
+ boardID: boardID,
+ threadID: post.thread.ID,
+ postID: postID
+ });
+ }
+ } else {
+ redirect = Redirect.to('thread', {
+ boardID: boardID,
+ threadID: 0,
+ postID: postID
+ });
+ fetchable = Redirect.to('post', {
+ boardID: boardID,
+ postID: postID
+ });
+ if (redirect || fetchable) {
+ a = $.el('a', {
+ href: redirect || 'javascript:;',
+ className: 'deadlink',
+ textContent: quote + "\u00A0(Dead)"
+ });
+ if (fetchable) {
+ $.addClass(a, 'quotelink');
+ $.extend(a.dataset, {
+ boardID: boardID,
+ postID: postID
+ });
+ }
+ }
+ }
+ if (indexOf.call(this.quotes, quoteID) < 0) {
+ this.quotes.push(quoteID);
+ }
+ if (!a) {
+ deadlink.textContent = quote + "\u00A0(Dead)";
+ return;
+ }
+ $.replace(deadlink, a);
+ if ($.hasClass(a, 'quotelink')) {
+ return this.nodes.quotelinks.push(a);
+ }
+ },
+ fixDeadlink: function(deadlink) {
+ var el, green;
+ if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') {
+ green = $.el('span', {
+ className: 'quote'
+ });
+ $.before(deadlink, green);
+ $.add(green, deadlink);
+ }
+ return $.replace(deadlink, slice.call(deadlink.childNodes));
+ }
+ };
+
+ return Quotify;
+
+}).call(this);
+
+Main = (function() {
+ var Main;
+
+ Main = {
+ init: function() {
+ var db, flatten, items, j, key, len, ref;
+ if (d.body && !$('title', d.head)) {
+ return;
+ }
+ if (window['4chan X antidup']) {
+ return;
+ }
+ window['4chan X antidup'] = true;
+ if (location.hostname === 'www.google.com') {
+ $.get('Captcha Fixes', true, function(arg) {
+ var enabled;
+ enabled = arg['Captcha Fixes'];
+ if (enabled) {
+ return $.ready(function() {
+ return Captcha.fixes.init();
+ });
+ }
+ });
+ return;
+ }
+ $.global(function() {
+ var j, len, nuke, prop, ref;
+ nuke = function(obj, prop) {
+ try {
+ return Object.defineProperty(obj, prop, {
+ configurable: false,
+ get: function() {
+ throw new Error();
+ },
+ set: function() {
+ throw new Error();
+ }
+ });
+ } catch (_error) {}
+ };
+ ref = ['atOptions', 'adsterra_key', 'EpmadsConfig', 'epmads_key', 'EpomConfig', 'epom_key', 'exoDocumentProtocol'];
+ for (j = 0, len = ref.length; j < len; j++) {
+ prop = ref[j];
+ nuke(window, prop);
+ }
+ });
+ $.on(window, 'beforescriptexecute', function(e) {
+ var host, ref, ref1;
+ host = (ref = e.target.src.split('/')[2]) != null ? (ref1 = ref.match(/[^.]+\.[^.]+$/)) != null ? ref1[0] : void 0 : void 0;
+ if (host === 'bnhtml.com' || host === 'ecpmrocks.com' || host === 'advertisation.com' || host === 'exoclick.com') {
+ return e.preventDefault();
+ }
+ });
+ $.on(d, '4chanXInitFinished', function() {
+ if (Main.expectInitFinished) {
+ return delete Main.expectInitFinished;
+ } else {
+ new Notice('error', 'Error: Multiple copies of 4chan X are enabled.');
+ return $.addClass(doc, 'tainted');
+ }
+ });
+ flatten = function(parent, obj) {
+ var key, val;
+ if (obj instanceof Array) {
+ Conf[parent] = obj[0];
+ } else if (typeof obj === 'object') {
+ for (key in obj) {
+ val = obj[key];
+ flatten(key, val);
+ }
+ } else {
+ Conf[parent] = obj;
+ }
+ };
+ flatten(null, Config);
+ ref = DataBoard.keys;
+ for (j = 0, len = ref.length; j < len; j++) {
+ db = ref[j];
+ Conf[db] = {
+ boards: {}
+ };
+ }
+ Conf['selectedArchives'] = {};
+ Conf['cooldowns'] = {};
+ Conf['Index Sort'] = {};
+ Conf['Except Archives from Encryption'] = false;
+ Conf['JSON Navigation'] = true;
+ Conf['Oekaki Links'] = true;
+ items = {};
+ for (key in Conf) {
+ items[key] = void 0;
+ }
+ items['previousversion'] = void 0;
+ return $.get(items, function(items) {
+ return $.asap((function() {
+ var doc;
+ return doc = d.documentElement;
+ }), function() {
+ var ref1, val;
+ if ($.cantSet) {
+
+ } else if (items.previousversion == null) {
+ Main.ready(function() {
+ $.set('previousversion', g.VERSION);
+ return Settings.open();
+ });
+ } else if (items.previousversion !== g.VERSION) {
+ Main.upgrade(items);
+ }
+ for (key in Conf) {
+ val = Conf[key];
+ Conf[key] = (ref1 = items[key]) != null ? ref1 : val;
+ }
+ return Main.initFeatures();
+ });
+ });
+ },
+ upgrade: function(items) {
+ var changes, previousversion;
+ previousversion = items.previousversion;
+ changes = Settings.upgrade(items, previousversion);
+ items.previousversion = changes.previousversion = g.VERSION;
+ return $.set(changes, function() {
+ var el, ref;
+ if ((ref = items['Show Updated Notifications']) != null ? ref : true) {
+ el = $.el('span', {
+ innerHTML: "4chan X has been updated to
version " + E(g.VERSION) + " ."
+ });
+ return new Notice('info', el, 15);
+ }
+ });
+ },
+ initFeatures: function() {
+ var err, feature, hostname, j, len, match, name, pathname, ref, ref1, ref2, ref3, search;
+ hostname = location.hostname, search = location.search;
+ pathname = location.pathname.split(/\/+/);
+ if (hostname !== 'www.4chan.org') {
+ g.BOARD = new Board(pathname[1]);
+ }
+ if (hostname === 'boards.4chan.org' || hostname === 'sys.4chan.org' || hostname === 'www.4chan.org') {
+ $.global(function() {
+ document.documentElement.classList.add('js-enabled');
+ return window.FCX = {};
+ });
+ Main.jsEnabled = $.hasClass(doc, 'js-enabled');
+ }
+ switch (hostname) {
+ case 'www.4chan.org':
+ $.onExists(doc, 'body', function() {
+ return $.addStyle(CSS.www);
+ });
+ Captcha.replace.init();
+ return;
+ case 'sys.4chan.org':
+ if (pathname[2] === 'imgboard.php') {
+ if (/\bmode=report\b/.test(search)) {
+ Report.init();
+ } else if ((match = search.match(/\bres=(\d+)/))) {
+ $.ready(function() {
+ var ref;
+ if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') {
+ return Redirect.navigate('thread', {
+ boardID: g.BOARD.ID,
+ postID: +match[1]
+ });
+ }
+ });
+ }
+ } else if (pathname[2] === 'post') {
+ PostSuccessful.init();
+ }
+ return;
+ case 'i.4cdn.org':
+ if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) {
+ return;
+ }
+ $.asap((function() {
+ return d.readyState !== 'loading';
+ }), function() {
+ var ref, video;
+ if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
+ return Redirect.navigate('file', {
+ boardID: g.BOARD.ID,
+ filename: pathname[pathname.length - 1]
+ });
+ } else if (video = $('video')) {
+ if (Conf['Volume in New Tab']) {
+ Volume.setup(video);
+ }
+ if (Conf['Loop in New Tab']) {
+ video.loop = true;
+ video.controls = false;
+ video.play();
+ return ImageCommon.addControls(video);
+ }
+ }
+ });
+ return;
+ }
+ if ((ref = pathname[2]) === 'thread' || ref === 'res') {
+ g.VIEW = 'thread';
+ g.THREADID = +pathname[3];
+ } else if ((ref1 = pathname[2]) === 'catalog' || ref1 === 'archive') {
+ g.VIEW = pathname[2];
+ } else if (pathname[2].match(/^\d*$/)) {
+ g.VIEW = 'index';
+ } else {
+ return;
+ }
+ g.threads = new SimpleDict();
+ g.posts = new SimpleDict();
+ $.onExists(doc, 'body', Main.initStyle);
+ ref2 = Main.features;
+ for (j = 0, len = ref2.length; j < len; j++) {
+ ref3 = ref2[j], name = ref3[0], feature = ref3[1];
+ try {
+ feature.init();
+ } catch (_error) {
+ err = _error;
+ Main.handleErrors({
+ message: "\"" + name + "\" initialization crashed.",
+ error: err
+ });
+ }
+ }
+ return $.ready(Main.initReady);
+ },
+ initStyle: function() {
+ var keyboard, ref;
+ if (!Main.isThisPageLegit()) {
+ return;
+ }
+ if ((ref = $('link[href*=mobile]', d.head)) != null) {
+ ref.disabled = true;
+ }
+ $.addClass(doc, 'fourchan-x', 'seaweedchan');
+ $.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW);
+ if ($.engine) {
+ $.addClass(doc, $.engine);
+ }
+ $.onExists(doc, '.ad-cnt', function(ad) {
+ return $.onExists(ad, 'img', function() {
+ return $.addClass(doc, 'ads-loaded');
+ });
+ });
+ if (Conf['Autohiding Scrollbar']) {
+ $.addClass(doc, 'autohiding-scrollbar');
+ }
+ $.ready(function() {
+ if (d.body.clientHeight > doc.clientHeight && (window.innerWidth === doc.clientWidth) !== Conf['Autohiding Scrollbar']) {
+ Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar'];
+ $.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar']);
+ return $.toggleClass(doc, 'autohiding-scrollbar');
+ }
+ });
+ $.addStyle(CSS.boards, 'fourchanx-css');
+ Main.bgColorStyle = $.el('style', {
+ id: 'fourchanx-bgcolor-css'
+ });
+ keyboard = false;
+ $.on(d, 'mousedown', function() {
+ return keyboard = false;
+ });
+ $.on(d, 'keydown', function(e) {
+ if (e.keyCode === 9) {
+ return keyboard = true;
+ }
+ });
+ window.addEventListener('focus', (function() {
+ return doc.classList.toggle('keyboard-focus', keyboard);
+ }), true);
+ return Main.setClass();
+ },
+ setClass: function() {
+ var mainStyleSheet, setStyle, style, styleSheets;
+ if (g.VIEW === 'catalog') {
+ $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-'));
+ return;
+ }
+ style = 'yotsuba-b';
+ mainStyleSheet = $('link[title=switch]', d.head);
+ styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
+ setStyle = function() {
+ var bgColor, div, j, len, styleSheet;
+ $.rmClass(doc, style);
+ style = null;
+ for (j = 0, len = styleSheets.length; j < len; j++) {
+ styleSheet = styleSheets[j];
+ if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) {
+ style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-');
+ break;
+ }
+ }
+ if (style) {
+ $.addClass(doc, style);
+ return $.rm(Main.bgColorStyle);
+ } else {
+ div = $.el('div', {
+ className: 'reply'
+ });
+ div.style.cssText = 'position: absolute; visibility: hidden;';
+ $.add(d.body, div);
+ bgColor = window.getComputedStyle(div).backgroundColor;
+ $.rm(div);
+ Main.bgColorStyle.textContent = ".dialog, .suboption-list > div:last-of-type {\n background-color: " + bgColor + ";\n}";
+ return $.after($.id('fourchanx-css'), Main.bgColorStyle);
+ }
+ };
+ setStyle();
+ if (!mainStyleSheet) {
+ return;
+ }
+ return new MutationObserver(setStyle).observe(mainStyleSheet, {
+ attributes: true,
+ attributeFilter: ['href']
+ });
+ },
+ initReady: function() {
+ var msg, ref, ref1, ref2;
+ if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) {
+ ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
+ if (Conf['404 Redirect']) {
+ return Redirect.navigate('thread', {
+ boardID: g.BOARD.ID,
+ threadID: g.THREADID,
+ postID: +location.hash.match(/\d+/)
+ }, "/" + g.BOARD + "/");
+ }
+ });
+ return;
+ }
+ if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') {
+ return;
+ }
+ if (((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && !$('.board + *')) {
+ msg = $.el('div', {
+ innerHTML: "The page didn't load completely.
Some features may not work unless you
reload ."
+ });
+ $.on($('a', msg), 'click', function() {
+ return location.reload();
+ });
+ new Notice('warning', msg);
+ }
+ if (!(Conf['JSON Index'] && g.VIEW === 'index')) {
+ return Main.initThread();
+ } else {
+ Main.expectInitFinished = true;
+ return $.event('4chanXInitFinished');
+ }
+ },
+ initThread: function() {
+ var board, err, errors, j, k, len, len1, m, postRoot, posts, ref, ref1, scriptData, thread, threadRoot, threads;
+ if ((board = $('.board'))) {
+ threads = [];
+ posts = [];
+ ref = $$('.board > .thread', board);
+ for (j = 0, len = ref.length; j < len; j++) {
+ threadRoot = ref[j];
+ thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
+ threads.push(thread);
+ ref1 = $$('.thread > .postContainer', threadRoot);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ postRoot = ref1[k];
+ if ($('.postMessage', postRoot)) {
+ try {
+ posts.push(new Post(postRoot, thread, g.BOARD));
+ } catch (_error) {
+ err = _error;
+ if (!errors) {
+ errors = [];
+ }
+ errors.push({
+ message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.",
+ error: err
+ });
+ }
+ }
+ }
+ }
+ if (errors) {
+ Main.handleErrors(errors);
+ }
+ if (g.VIEW === 'thread') {
+ scriptData = Get.scriptData();
+ threads[0].postLimit = /\bbumplimit *= *1\b/.test(scriptData);
+ threads[0].fileLimit = /\bimagelimit *= *1\b/.test(scriptData);
+ threads[0].ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : void 0;
+ }
+ Main.callbackNodes('Thread', threads);
+ return Main.callbackNodesDB('Post', posts, function() {
+ var l, len2, post;
+ for (l = 0, len2 = posts.length; l < len2; l++) {
+ post = posts[l];
+ QuoteThreading.insert(post);
+ }
+ Main.expectInitFinished = true;
+ return $.event('4chanXInitFinished');
+ });
+ } else {
+ Main.expectInitFinished = true;
+ return $.event('4chanXInitFinished');
+ }
+ },
+ callbackNodes: function(klass, nodes) {
+ var cb, i, node;
+ i = 0;
+ cb = Callbacks[klass];
+ while (node = nodes[i++]) {
+ cb.execute(node);
+ }
+ },
+ callbackNodesDB: function(klass, nodes, cb) {
+ var cbs, fn, i, softTask;
+ i = 0;
+ cbs = Callbacks[klass];
+ fn = function() {
+ var node;
+ if (!(node = nodes[i])) {
+ return false;
+ }
+ cbs.execute(node);
+ return ++i % 25;
+ };
+ softTask = function() {
+ while (fn()) {
+ continue;
+ }
+ if (!nodes[i]) {
+ if (cb) {
+ cb();
+ }
+ return;
+ }
+ return setTimeout(softTask, 0);
+ };
+ return softTask();
+ },
+ handleErrors: function(errors) {
+ var div, error, j, len, logs;
+ if (!(errors instanceof Array)) {
+ error = errors;
+ } else if (errors.length === 1) {
+ error = errors[0];
+ }
+ if (error) {
+ new Notice('error', Main.parseError(error, Main.reportLink([error])), 15);
+ return;
+ }
+ div = $.el('div', {
+ innerHTML: E(errors.length) + " errors occurred." + (Main.reportLink(errors)).innerHTML + " [
show ]"
+ });
+ $.on(div.lastElementChild, 'click', function() {
+ var ref;
+ return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref;
+ });
+ logs = $.el('div', {
+ hidden: true
+ });
+ for (j = 0, len = errors.length; j < len; j++) {
+ error = errors[j];
+ $.add(logs, Main.parseError(error));
+ }
+ return new Notice('error', [div, logs], 30);
+ },
+ parseError: function(data, reportLink) {
+ var context, error, lines, message, ref, ref1;
+ c.error(data.message, data.error.stack);
+ message = $.el('div', {
+ innerHTML: E(data.message) + ((reportLink) ? (reportLink).innerHTML : "")
+ });
+ error = $.el('div', {
+ textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
+ });
+ lines = ((ref = data.error.stack) != null ? (ref1 = ref.match(/\d+(?=:\d+\)?$)/mg)) != null ? ref1.join().replace(/^/, ' at ') : void 0 : void 0) || '';
+ context = $.el('div', {
+ textContent: "(4chan X ccd0 v" + g.VERSION + " " + $.platform + " on " + $.engine + lines + ")"
+ });
+ return [message, error, context];
+ },
+ reportLink: function(errors) {
+ var data, details, ref, title, url;
+ data = errors[0];
+ title = data.message;
+ if (errors.length > 1) {
+ title += " (+" + (errors.length - 1) + " other errors)";
+ }
+ details = "[Please describe the steps needed to reproduce this error.]\n\nScript: 4chan X ccd0 v" + g.VERSION + " " + $.platform + "\nUser agent: " + navigator.userAgent + "\nURL: " + location.href + "\n\n" + data.error + "\n" + (((ref = data.error.stack) != null ? ref.replace(data.error.toString(), '').trim() : void 0) || '');
+ details = details.replace(/file:\/{3}.+\//g, '');
+ url = "https://gitreports.com/issue/ccd0/4chan-x?issue_title=" + (encodeURIComponent(title)) + "&details=" + (encodeURIComponent(details));
+ return {
+ innerHTML: "
[report ] "
+ };
+ },
+ 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');
+ }
+ return Main.thisPageIsLegit;
+ },
+ ready: function(cb) {
+ return $.ready(function() {
+ if (Main.isThisPageLegit()) {
+ return cb();
+ }
+ });
+ },
+ features: [['Polyfill', Polyfill], ['Normalize URL', NormalizeURL], ['Captcha Configuration', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply Personas', QR.persona], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Edit Link', QR.oekaki.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash], ['Reply Pruning', ReplyPruning]]
+ };
+
+ return Main;
+
+}).call(this);
+
+Main.init();
}).call(this);
diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx
index 41f0d6c28..2eebf6d96 100644
Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ
diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js
index be59133ab..ae3d5477b 100644
--- a/builds/4chan-X-noupdate.user.js
+++ b/builds/4chan-X-noupdate.user.js
@@ -1,7 +1,6 @@
-// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
-// @version 1.11.30.3
+// @version 1.11.31.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -107,7 +106,7 @@
/*
* Contains data from external sources:
*
-* audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/
+* src/Monitoring/ThreadUpdater/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/
* cc-by-nc-3.0
*
* Font Awesome by Dave Gandy (http://fontawesome.io)
@@ -119,12 +118,56 @@
'use strict';
(function() {
- var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, NormalizeURL, Notice, PSAHiding, PassLink, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReplyPruning, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g,
- slice = [].slice,
- indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty,
- bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, CSS, Callbacks, Captcha, CatalogLinks, CatalogThread, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, NormalizeURL, Notice, PSAHiding, PassLink, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReplyPruning, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume;
+
+var Conf, E, c, d, doc, g;
+
+Conf = {};
+c = console;
+d = document;
+doc = d.documentElement;
+
+g = {
+ VERSION: '1.11.31.0',
+ NAMESPACE: '4chan X.',
+ boards: {}
+};
+
+E = (function() {
+ var fn, r, regex, str;
+ str = {
+ '&': '&',
+ "'": ''',
+ '"': '"',
+ '<': '<',
+ '>': '>'
+ };
+ r = String.prototype.replace;
+ regex = /[&"'<>]/g;
+ fn = function(x) {
+ return str[x];
+ };
+ return function(text) {
+ return r.call(text, regex, fn);
+ };
+})();
+
+E.cat = function(templates) {
+ var html, i, len;
+ html = '';
+ for (i = 0, len = templates.length; i < len; i++) {
+ html += templates[i].innerHTML;
+ }
+ return html;
+};
+
+E.url = function(content) {
+ return "data:text/html;charset=utf-8," + encodeURIComponent(content.innerHTML);
+};
+
+Config = (function() {
+ var Config;
Config = {
main: {
@@ -368,7 +411,7 @@
":root.tomorrow div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n" +
-"}",
+"}\n",
hotkeys: {
'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'],
'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'],
@@ -434,18204 +477,23 @@
'Autohiding Scrollbar': false
};
- Conf = {};
+ return Config;
- c = console;
+}).call(this);
- d = document;
+CSS = {
- doc = d.documentElement;
-
- g = {
- VERSION: '1.11.30.3',
- NAMESPACE: '4chan X.',
- boards: {}
- };
-
- E = (function() {
- var fn, r, regex, str;
- str = {
- '&': '&',
- "'": ''',
- '"': '"',
- '<': '<',
- '>': '>'
- };
- r = String.prototype.replace;
- regex = /[&"'<>]/g;
- fn = function(x) {
- return str[x];
- };
- return function(text) {
- return r.call(text, regex, fn);
- };
- })();
-
- E.cat = function(templates) {
- var html, k, len1, x;
- html = '';
- for (k = 0, len1 = templates.length; k < len1; k++) {
- x = templates[k];
- html += x.innerHTML;
- }
- return html;
- };
-
- E.url = function(content) {
- return "data:text/html;charset=utf-8," + (encodeURIComponent(content.innerHTML));
- };
-
- $ = function(selector, root) {
- if (root == null) {
- root = d.body;
- }
- return root.querySelector(selector);
- };
-
- $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000)));
-
- $.id = function(id) {
- return d.getElementById(id);
- };
-
- $.ready = function(fc) {
- var cb;
- if (d.readyState !== 'loading') {
- $.queueTask(fc);
- return;
- }
- cb = function() {
- $.off(d, 'DOMContentLoaded', cb);
- return fc();
- };
- return $.on(d, 'DOMContentLoaded', cb);
- };
-
- $.formData = function(form) {
- var fd, key, val;
- if (form instanceof HTMLFormElement) {
- return new FormData(form);
- }
- fd = new FormData();
- for (key in form) {
- val = form[key];
- if (val) {
- if (typeof val === 'object' && 'newName' in val) {
- fd.append(key, val, val.newName);
- } else {
- fd.append(key, val);
- }
- }
- }
- return fd;
- };
-
- $.extend = function(object, properties) {
- var key, val;
- for (key in properties) {
- val = properties[key];
- object[key] = val;
- }
- };
-
- $.ajax = (function() {
- var blockedError, blockedURLs, lastModified;
- lastModified = {};
- blockedURLs = {};
- blockedError = function(url) {
- var message;
- if (blockedURLs[url]) {
- return;
- }
- blockedURLs[url] = true;
- message = $.el('div', {
- innerHTML: "4chan X was blocked from loading the following URL:
[
More info ]"
- });
- $('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
- return new Notice('warning', message, 30, function() {
- return delete blockedURLs[url];
- });
- };
- return function(url, options, extra) {
- var err, event, form, k, len1, r, ref, ref1, type, upCallbacks, whenModified;
- if (options == null) {
- options = {};
- }
- if (extra == null) {
- extra = {};
- }
- type = extra.type, whenModified = extra.whenModified, upCallbacks = extra.upCallbacks, form = extra.form;
- url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/');
- r = new XMLHttpRequest();
- type || (type = form && 'post' || 'get');
- try {
- r.open(type, url, true);
- } catch (_error) {
- err = _error;
- blockedError(url);
- ref = ['error', 'loadend'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- event = ref[k];
- r["on" + event] = options["on" + event];
- $.queueTask($.event, event, null, r);
- }
- return;
- }
- if (whenModified) {
- if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
- r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
- }
- $.on(r, 'load', function() {
- return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
- });
- }
- if (/\.json$/.test(url)) {
- if (options.responseType == null) {
- options.responseType = 'json';
- }
- }
- $.extend(r, options);
- if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
- Object.defineProperty(r, 'response', {
- configurable: true,
- enumerable: true,
- get: function() {
- return JSON.parse(r.responseText);
- }
- });
- }
- $.extend(r.upload, upCallbacks);
- r.send(form);
- return r;
- };
- })();
-
- (function() {
- var reqs;
- reqs = {};
- $.cache = function(url, cb, options) {
- var err, req, rm;
- if (req = reqs[url]) {
- if (req.readyState === 4) {
- $.queueTask(function() {
- return cb.call(req, req.evt, true);
- });
- } else {
- req.callbacks.push(cb);
- }
- return req;
- }
- rm = function() {
- return delete reqs[url];
- };
- try {
- if (!(req = $.ajax(url, options))) {
- return;
- }
- } catch (_error) {
- err = _error;
- return;
- }
- $.on(req, 'load', function(e) {
- var fn1, k, len1, ref;
- this.evt = e;
- ref = this.callbacks;
- fn1 = (function(_this) {
- return function(cb) {
- return $.queueTask(function() {
- return cb.call(_this, e, false);
- });
- };
- })(this);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- cb = ref[k];
- fn1(cb);
- }
- return delete this.callbacks;
- });
- $.on(req, 'abort error', rm);
- req.callbacks = [cb];
- return reqs[url] = req;
- };
- return $.cleanCache = function(testf) {
- var url;
- for (url in reqs) {
- if (testf(url)) {
- delete reqs[url];
- }
- }
- };
- })();
-
- $.cb = {
- checked: function() {
- $.set(this.name, this.checked);
- return Conf[this.name] = this.checked;
- },
- value: function() {
- $.set(this.name, this.value.trim());
- return Conf[this.name] = this.value;
- }
- };
-
- $.asap = function(test, cb) {
- if (test()) {
- return cb();
- } else {
- return setTimeout($.asap, 25, test, cb);
- }
- };
-
- $.onExists = function(root, selector, cb) {
- var el, observer;
- if (el = $(selector, root)) {
- return cb(el);
- }
- if ($.engine === 'edge' && d.readyState === 'loading') {
- $.asap((function() {
- return d.readyState !== 'loading' || $(selector, root);
- }), function() {
- return $.onExists(root, selector, cb);
- });
- return;
- }
- observer = new MutationObserver(function() {
- if (el = $(selector, root)) {
- observer.disconnect();
- return cb(el);
- }
- });
- return observer.observe(root, {
- childList: true,
- subtree: true
- });
- };
-
- $.addStyle = function(css, id, test) {
- var style;
- if (test == null) {
- test = 'head';
- }
- style = $.el('style', {
- textContent: css
- });
- if (id != null) {
- style.id = id;
- }
- $.onExists(doc, test, function() {
- return $.add(d.head, style);
- });
- return style;
- };
-
- $.x = function(path, root) {
- root || (root = d.body);
- return d.evaluate(path, root, null, 8, null).singleNodeValue;
- };
-
- $.X = function(path, root) {
- root || (root = d.body);
- return d.evaluate(path, root, null, 7, null);
- };
-
- $.addClass = function() {
- var className, classNames, el, k, len1;
- el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
- for (k = 0, len1 = classNames.length; k < len1; k++) {
- className = classNames[k];
- el.classList.add(className);
- }
- };
-
- $.rmClass = function() {
- var className, classNames, el, k, len1;
- el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
- for (k = 0, len1 = classNames.length; k < len1; k++) {
- className = classNames[k];
- el.classList.remove(className);
- }
- };
-
- $.toggleClass = function(el, className) {
- return el.classList.toggle(className);
- };
-
- $.hasClass = function(el, className) {
- return indexOf.call(el.classList, className) >= 0;
- };
-
- $.rm = function(el) {
- return el != null ? el.remove() : void 0;
- };
-
- $.rmAll = function(root) {
- return root.textContent = null;
- };
-
- $.tn = function(s) {
- return d.createTextNode(s);
- };
-
- $.frag = function() {
- return d.createDocumentFragment();
- };
-
- $.nodes = function(nodes) {
- var frag, k, len1, node;
- if (!(nodes instanceof Array)) {
- return nodes;
- }
- frag = $.frag();
- for (k = 0, len1 = nodes.length; k < len1; k++) {
- node = nodes[k];
- frag.appendChild(node);
- }
- return frag;
- };
-
- $.add = function(parent, el) {
- return parent.appendChild($.nodes(el));
- };
-
- $.prepend = function(parent, el) {
- return parent.insertBefore($.nodes(el), parent.firstChild);
- };
-
- $.after = function(root, el) {
- return root.parentNode.insertBefore($.nodes(el), root.nextSibling);
- };
-
- $.before = function(root, el) {
- return root.parentNode.insertBefore($.nodes(el), root);
- };
-
- $.replace = function(root, el) {
- return root.parentNode.replaceChild($.nodes(el), root);
- };
-
- $.el = function(tag, properties, properties2) {
- var el;
- el = d.createElement(tag);
- if (properties) {
- $.extend(el, properties);
- }
- if (properties2) {
- $.extend(el, properties2);
- }
- return el;
- };
-
- $.on = function(el, events, handler) {
- var event, k, len1, ref;
- ref = events.split(' ');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- event = ref[k];
- el.addEventListener(event, handler, false);
- }
- };
-
- $.off = function(el, events, handler) {
- var event, k, len1, ref;
- ref = events.split(' ');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- event = ref[k];
- el.removeEventListener(event, handler, false);
- }
- };
-
- $.one = function(el, events, handler) {
- var cb;
- cb = function(e) {
- $.off(el, events, cb);
- return handler.call(this, e);
- };
- return $.on(el, events, cb);
- };
-
- $.event = function(event, detail, root) {
- if (root == null) {
- root = d;
- }
- if ((detail != null) && typeof cloneInto === 'function') {
- detail = cloneInto(detail, d.defaultView);
- }
- return root.dispatchEvent(new CustomEvent(event, {
- bubbles: true,
- detail: detail
- }));
- };
-
- (function() {
- var clone, err, ref, unsafeConstructors;
- if (!(/PaleMoon\//.test(navigator.userAgent) && +(typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.version) != null ? ref.split('.')[0] : void 0 : void 0) >= 2 && typeof cloneInto === 'undefined')) {
- return;
- }
- try {
- return new CustomEvent('x', {
- detail: {}
- });
- } catch (_error) {
- err = _error;
- unsafeConstructors = {
- Object: unsafeWindow.Object,
- Array: unsafeWindow.Array
- };
- clone = function(obj) {
- var constructor, key, obj2, val;
- if ((obj != null) && typeof obj === 'object' && (constructor = unsafeConstructors[obj.constructor.name])) {
- obj2 = new constructor();
- for (key in obj) {
- val = obj[key];
- obj2[key] = clone(val);
- }
- return obj2;
- } else {
- return obj;
- }
- };
- return $.event = function(event, detail, root) {
- if (root == null) {
- root = d;
- }
- return root.dispatchEvent(new CustomEvent(event, {
- bubbles: true,
- detail: clone(detail)
- }));
- };
- }
- })();
-
- $.open = typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) {
- return window.open(url, '_blank');
- };
-
- $.debounce = function(wait, fn) {
- var args, exec, lastCall, that, timeout;
- lastCall = 0;
- timeout = null;
- that = null;
- args = null;
- exec = function() {
- lastCall = Date.now();
- return fn.apply(that, args);
- };
- return function() {
- args = arguments;
- that = this;
- if (lastCall < Date.now() - wait) {
- return exec();
- }
- clearTimeout(timeout);
- return timeout = setTimeout(exec, wait);
- };
- };
-
- $.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);
- return func.apply(func, args);
- };
- if (window.MessageChannel) {
- taskChannel = new MessageChannel();
- taskChannel.port1.onmessage = execTask;
- return function() {
- taskQueue.push(arguments);
- return taskChannel.port2.postMessage(null);
- };
- } else {
- return function() {
- taskQueue.push(arguments);
- return setTimeout(execTask, 0);
- };
- }
- })();
-
- $.globalEval = function(code) {
- var script;
- script = $.el('script', {
- textContent: code
- });
- $.add(d.head || doc, script);
- return $.rm(script);
- };
-
- $.global = function(fn) {
- if (doc) {
- return $.globalEval("(" + fn + ")();");
- } else {
- return fn();
- }
- };
-
- $.bytesToString = function(size) {
- var unit;
- unit = 0;
- while (size >= 1024) {
- size /= 1024;
- unit++;
- }
- size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size);
- return size + " " + ['B', 'KB', 'MB', 'GB'][unit];
- };
-
- $.minmax = function(value, min, max) {
- return (value < min ? min : value > max ? max : value);
- };
-
- $.hasAudio = function(video) {
- return video.mozHasAudio || !!video.webkitAudioDecodedByteCount;
- };
-
- $.engine = (function() {
- if (/Edge\//.test(navigator.userAgent)) {
- return 'edge';
- }
- if (/Chrome\//.test(navigator.userAgent)) {
- return 'blink';
- }
- if (/WebKit\//.test(navigator.userAgent)) {
- return 'webkit';
- }
- if (/Gecko\/|Goanna/.test(navigator.userAgent)) {
- return 'gecko';
- }
- })();
-
- try {
- localStorage.getItem('x');
- $.hasStorage = true;
- } catch (_error) {
- $.hasStorage = false;
- }
-
- $.item = function(key, val) {
- var item;
- item = {};
- item[key] = val;
- return item;
- };
-
- $.syncing = {};
-
- if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
- $.getValue = GM_getValue;
- $.listValues = function() {
- return GM_listValues();
- };
- } else if ($.hasStorage) {
- $.getValue = function(key) {
- return localStorage[key];
- };
- $.listValues = function() {
- var key, results;
- results = [];
- for (key in localStorage) {
- if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
- results.push(key);
- }
- }
- return results;
- };
- } else {
- $.getValue = function() {};
- $.listValues = function() {
- return [];
- };
- }
-
- if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
- $.setValue = GM_setValue;
- $.deleteValue = GM_deleteValue;
- } else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
- $.oldValue = {};
- $.setValue = function(key, val) {
- GM_setValue(key, val);
- if (key in $.syncing) {
- $.oldValue[key] = val;
- if ($.hasStorage) {
- return localStorage[key] = val;
- }
- }
- };
- $.deleteValue = function(key) {
- GM_deleteValue(key);
- if (key in $.syncing) {
- delete $.oldValue[key];
- if ($.hasStorage) {
- return localStorage.removeItem(key);
- }
- }
- };
- if (!$.hasStorage) {
- $.cantSync = true;
- }
- } else if ($.hasStorage) {
- $.oldValue = {};
- $.setValue = function(key, val) {
- if (key in $.syncing) {
- $.oldValue[key] = val;
- }
- return localStorage[key] = val;
- };
- $.deleteValue = function(key) {
- if (key in $.syncing) {
- delete $.oldValue[key];
- }
- return localStorage.removeItem(key);
- };
- } else {
- $.setValue = function() {};
- $.deleteValue = function() {};
- $.cantSync = $.cantSet = true;
- }
-
- if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
- $.sync = function(key, cb) {
- return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) {
- if (remote) {
- if (newValue !== void 0) {
- newValue = JSON.parse(newValue);
- }
- return cb(newValue, key);
- }
- });
- };
- $.forceSync = function() {};
- } else if ((typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) || $.hasStorage) {
- $.sync = function(key, cb) {
- key = g.NAMESPACE + key;
- $.syncing[key] = cb;
- return $.oldValue[key] = $.getValue(key);
- };
- (function() {
- var onChange;
- onChange = function(arg) {
- var cb, key, newValue;
- key = arg.key, newValue = arg.newValue;
- if (!(cb = $.syncing[key])) {
- return;
- }
- if (newValue != null) {
- if (newValue === $.oldValue[key]) {
- return;
- }
- $.oldValue[key] = newValue;
- return cb(JSON.parse(newValue), key.slice(g.NAMESPACE.length));
- } else {
- if ($.oldValue[key] == null) {
- return;
- }
- delete $.oldValue[key];
- return cb(void 0, key.slice(g.NAMESPACE.length));
- }
- };
- $.on(window, 'storage', onChange);
- return $.forceSync = function(key) {
- key = g.NAMESPACE + key;
- return onChange({
- key: key,
- newValue: $.getValue(key)
- });
- };
- })();
- } else {
- $.sync = function() {};
- $.forceSync = function() {};
- }
-
- $["delete"] = function(keys) {
- var k, key, len1;
- if (!(keys instanceof Array)) {
- keys = [keys];
- }
- for (k = 0, len1 = keys.length; k < len1; k++) {
- key = keys[k];
- $.deleteValue(g.NAMESPACE + key);
- }
- };
-
- $.get = function(key, val, cb) {
- var items;
- if (typeof cb === 'function') {
- items = $.item(key, val);
- } else {
- items = key;
- cb = val;
- }
- return $.queueTask(function() {
- for (key in items) {
- if (val = $.getValue(g.NAMESPACE + key)) {
- items[key] = JSON.parse(val);
- }
- }
- return cb(items);
- });
- };
-
- $.set = function(keys, val, cb) {
- var key, value;
- if (typeof keys === 'string') {
- $.setValue(g.NAMESPACE + keys, JSON.stringify(val));
- } else {
- for (key in keys) {
- value = keys[key];
- $.setValue(g.NAMESPACE + key, JSON.stringify(value));
- }
- cb = val;
- }
- return typeof cb === "function" ? cb() : void 0;
- };
-
- $.clear = function(cb) {
- var id;
- $["delete"](Object.keys(Conf));
- $["delete"](['previousversion', 'AutoWatch', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']);
- $["delete"]((function() {
- var k, len1, ref, results;
- ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
- results = [];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- id = ref[k];
- results.push(id + ".position");
- }
- return results;
- })());
- try {
- $["delete"]($.listValues().map(function(key) {
- return key.replace(g.NAMESPACE, '');
- }));
- } catch (_error) {}
- return typeof cb === "function" ? cb() : void 0;
- };
-
- $$ = function(selector, root) {
- if (root == null) {
- root = d.body;
- }
- return slice.call(root.querySelectorAll(selector));
- };
-
- Callbacks = (function() {
- function Callbacks(type1) {
- this.type = type1;
- this.keys = [];
- }
-
- Callbacks.prototype.push = function(arg) {
- var cb, name;
- name = arg.name, cb = arg.cb;
- if (!this[name]) {
- this.keys.push(name);
- }
- return this[name] = cb;
- };
-
- Callbacks.prototype.execute = function(node, keys) {
- var err, errors, k, len1, name, ref;
- if (keys == null) {
- keys = this.keys;
- }
- for (k = 0, len1 = keys.length; k < len1; k++) {
- name = keys[k];
- try {
- if ((ref = this[name]) != null) {
- ref.call(node);
- }
- } catch (_error) {
- err = _error;
- if (!errors) {
- errors = [];
- }
- errors.push({
- message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''),
- error: err
- });
- }
- }
- if (errors) {
- return Main.handleErrors(errors);
- }
- };
-
- return Callbacks;
-
- })();
-
- Board = (function() {
- Board.prototype.toString = function() {
- return this.ID;
- };
-
- function Board(ID1) {
- this.ID = ID1;
- this.threads = new SimpleDict();
- this.posts = new SimpleDict();
- g.boards[this] = this;
- }
-
- return Board;
-
- })();
-
- Thread = (function() {
- Thread.callbacks = new Callbacks('Thread');
-
- Thread.prototype.toString = function() {
- return this.ID;
- };
-
- function Thread(ID1, board1) {
- this.ID = ID1;
- this.board = board1;
- this.fullID = this.board + "." + this.ID;
- this.posts = new SimpleDict();
- this.isDead = false;
- this.isHidden = false;
- this.isOnTop = false;
- this.isSticky = false;
- this.isClosed = false;
- this.isArchived = false;
- this.postLimit = false;
- this.fileLimit = false;
- this.ipCount = void 0;
- this.OP = null;
- this.catalogView = null;
- this.board.threads.push(this.ID, this);
- g.threads.push(this.fullID, this);
- }
-
- Thread.prototype.setPage = function(pageNum) {
- var icon, info, quote, ref;
- ref = this.OP.nodes, info = ref.info, quote = ref.quote;
- if (!(icon = $('.page-num', info))) {
- icon = $.el('span', {
- className: 'page-num'
- });
- $.after(quote, [$.tn(' '), icon]);
- }
- icon.title = "This thread is on page " + pageNum + " in the original index.";
- icon.textContent = "[" + pageNum + "]";
- if (this.catalogView) {
- return this.catalogView.nodes.pageCount.textContent = pageNum;
- }
- };
-
- Thread.prototype.setCount = function(type, count, reachedLimit) {
- var el;
- if (!this.catalogView) {
- return;
- }
- el = this.catalogView.nodes[type + "Count"];
- el.textContent = count;
- return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning');
- };
-
- Thread.prototype.setStatus = function(type, status) {
- var name;
- name = "is" + type;
- if (this[name] === status) {
- return;
- }
- this[name] = status;
- if (!this.OP) {
- return;
- }
- this.setIcon('Sticky', this.isSticky);
- this.setIcon('Closed', this.isClosed && !this.isArchived);
- return this.setIcon('Archived', this.isArchived);
- };
-
- Thread.prototype.setIcon = function(type, status) {
- var icon, root, typeLC;
- typeLC = type.toLowerCase();
- icon = $("." + typeLC + "Icon", this.OP.nodes.info);
- if (!!icon === status) {
- return;
- }
- if (!status) {
- $.rm(icon.previousSibling);
- $.rm(icon);
- if (this.catalogView) {
- $.rm($("." + typeLC + "Icon", this.catalogView.nodes.icons));
- }
- return;
- }
- icon = $.el('img', {
- src: "" + Build.staticPath + typeLC + Build.gifIcon,
- alt: type,
- title: type,
- className: typeLC + "Icon retina"
- });
- root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote;
- $.after(root, [$.tn(' '), icon]);
- if (!this.catalogView) {
- return;
- }
- return (type === 'Sticky' && this.isClosed ? $.prepend : $.add)(this.catalogView.nodes.icons, icon.cloneNode());
- };
-
- Thread.prototype.kill = function() {
- return this.isDead = true;
- };
-
- Thread.prototype.collect = function() {
- this.posts.forEach(function(post) {
- return post.collect();
- });
- g.threads.rm(this.fullID);
- return this.board.threads.rm(this);
- };
-
- return Thread;
-
- })();
-
- CatalogThread = (function() {
- CatalogThread.callbacks = new Callbacks('Catalog Thread');
-
- CatalogThread.prototype.toString = function() {
- return this.ID;
- };
-
- function CatalogThread(root, thread1) {
- this.thread = thread1;
- this.ID = this.thread.ID;
- this.board = this.thread.board;
- this.nodes = {
- root: root,
- thumb: $('.catalog-thumb', root),
- icons: $('.catalog-icons', root),
- postCount: $('.post-count', root),
- fileCount: $('.file-count', root),
- pageCount: $('.page-count', root),
- comment: $('.comment', root)
- };
- this.thread.catalogView = this;
- }
-
- return CatalogThread;
-
- })();
-
- Post = (function() {
- Post.callbacks = new Callbacks('Post');
-
- Post.prototype.toString = function() {
- return this.ID;
- };
-
- function Post(root, thread1, board1) {
- var capcode, clone, date, email, flag, info, k, len1, name, post, ref, subject, tripcode, uniqueID;
- this.thread = thread1;
- this.board = board1;
- this.ID = +root.id.slice(2);
- this.fullID = this.board + "." + this.ID;
- this.context = this;
- root.dataset.fullID = this.fullID;
- post = $('.post', root);
- info = $('.postInfo', post);
- this.nodes = {
- root: root,
- post: post,
- info: info,
- nameBlock: $('.nameBlock', info),
- quote: $('.postNum > a:nth-of-type(2)', info),
- comment: $('.postMessage', post),
- links: [],
- quotelinks: []
- };
- if ($.engine === 'edge') {
- Object.defineProperty(this.nodes, 'backlinks', {
- configurable: true,
- enumerable: true,
- get: function() {
- return info.getElementsByClassName('backlink');
- }
- });
- } else {
- this.nodes.backlinks = info.getElementsByClassName('backlink');
- }
- if (!(this.isReply = $.hasClass(post, 'reply'))) {
- this.thread.OP = this;
- this.thread.isArchived = !!$('.archivedIcon', info);
- this.thread.isSticky = !!$('.stickyIcon', info);
- this.thread.isClosed = this.thread.isArchived || !!$('.closedIcon', info);
- if (this.thread.isArchived) {
- this.thread.kill();
- }
- }
- this.info = {};
- this.info.nameBlock = Conf['Anonymize'] ? 'Anonymous' : this.nodes.nameBlock.textContent.trim();
- if (subject = $('.subject', info)) {
- this.nodes.subject = subject;
- this.info.subject = subject.textContent || void 0;
- }
- if (name = $('.name', info)) {
- this.nodes.name = name;
- this.info.name = name.textContent;
- }
- if (email = $('.useremail', info)) {
- this.nodes.email = email;
- this.info.email = decodeURIComponent(email.href.slice(7));
- }
- if (tripcode = $('.postertrip', info)) {
- this.nodes.tripcode = tripcode;
- this.info.tripcode = tripcode.textContent;
- }
- if (uniqueID = $('.posteruid', info)) {
- this.nodes.uniqueID = uniqueID;
- this.info.uniqueID = uniqueID.firstElementChild.textContent;
- }
- if (capcode = $('.capcode.hand', info)) {
- this.nodes.capcode = capcode;
- this.info.capcode = capcode.textContent.replace('## ', '');
- }
- if (flag = $('.flag, .countryFlag', info)) {
- this.nodes.flag = flag;
- this.info.flag = flag.title;
- }
- if (date = $('.dateTime', info)) {
- this.nodes.date = date;
- this.info.date = new Date(date.dataset.utc * 1000);
- }
- this.parseComment();
- this.parseQuotes();
- this.parseFile();
- this.isDead = false;
- this.isHidden = false;
- this.clones = [];
- if (g.posts[this.fullID]) {
- this.isRebuilt = true;
- this.clones = g.posts[this.fullID].clones;
- ref = this.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.origin = this;
- }
- }
- this.board.posts.push(this.ID, this);
- this.thread.posts.push(this.ID, this);
- g.posts.push(this.fullID, this);
- }
-
- Post.prototype.parseComment = function() {
- var abbr, bq, commentDisplay, k, len1, len2, node, q, ref, spoilers;
- this.nodes.comment.normalize();
- bq = this.nodes.comment.cloneNode(true);
- ref = $$('.abbr + br, .exif, b, .fortune', bq);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- node = ref[k];
- $.rm(node);
- }
- if (abbr = $('.abbr', bq)) {
- $.rm(abbr);
- }
- this.info.comment = this.nodesToText(bq);
- if (abbr) {
- this.info.comment = this.info.comment.replace(/\n\n$/, '');
- }
- commentDisplay = this.info.comment;
- if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) {
- spoilers = $$('s', bq);
- if (spoilers.length) {
- for (q = 0, len2 = spoilers.length; q < len2; q++) {
- node = spoilers[q];
- $.replace(node, $.tn('[spoiler]'));
- }
- commentDisplay = this.nodesToText(bq);
- }
- }
- return this.info.commentDisplay = commentDisplay.trim().replace(/\s+$/gm, '');
- };
-
- Post.prototype.nodesToText = function(bq) {
- var i, node, nodes, text;
- text = "";
- nodes = $.X('.//br|.//text()', bq);
- i = 0;
- while (node = nodes.snapshotItem(i++)) {
- text += node.data || '\n';
- }
- return text;
- };
-
- Post.prototype.parseQuotes = function() {
- var k, len1, quotelink, ref;
- this.quotes = [];
- ref = $$(':not(pre) > .quotelink', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- this.parseQuote(quotelink);
- }
- };
-
- Post.prototype.parseQuote = function(quotelink) {
- var fullID, match;
- match = quotelink.href.match(/^https?:\/\/boards\.4chan\.org\/+([^\/]+)\/+(?:res|thread)\/+\d+(?:\/[^#]*)?#p(\d+)$/);
- if (!(match || (this.isClone && quotelink.dataset.postID))) {
- return;
- }
- this.nodes.quotelinks.push(quotelink);
- if (this.isClone) {
- return;
- }
- fullID = match[1] + "." + match[2];
- if (indexOf.call(this.quotes, fullID) < 0) {
- return this.quotes.push(fullID);
- }
- };
-
- Post.prototype.parseFile = function() {
- var fileEl, fileText, info, link, m, ref, ref1, ref2, size, thumb, unit;
- if (!(fileEl = $('.file', this.nodes.post))) {
- return;
- }
- if (!(link = $('.fileText > a, .fileText-original > a', fileEl))) {
- return;
- }
- if (!(info = (ref = link.nextSibling) != null ? ref.textContent.match(/\(([\d.]+ [KMG]?B).*\)/) : void 0)) {
- return;
- }
- fileText = fileEl.firstElementChild;
- this.file = {
- text: fileText,
- link: link,
- url: link.href,
- name: fileText.title || link.title || link.textContent,
- size: info[1],
- isImage: /(jpg|png|gif)$/i.test(link.href),
- isVideo: /webm$/i.test(link.href),
- dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0,
- tag: (ref2 = info[0].match(/,[^,]*, ([a-z]+)\)/i)) != null ? ref2[1] : void 0
- };
- size = +this.file.size.match(/[\d.]+/)[0];
- unit = ['B', 'KB', 'MB', 'GB'].indexOf(this.file.size.match(/\w+$/)[0]);
- while (unit-- > 0) {
- size *= 1024;
- }
- this.file.sizeInBytes = size;
- if ((thumb = $('.fileThumb > [data-md5]', fileEl))) {
- return $.extend(this.file, {
- thumb: thumb,
- thumbURL: (m = link.href.match(/\d+(?=\.\w+$)/)) ? location.protocol + "//i.4cdn.org/" + this.board + "/" + m[0] + "s.jpg" : void 0,
- MD5: thumb.dataset.md5,
- isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler')
- });
- }
- };
-
- Post.prototype.kill = function(file) {
- var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
- if (file) {
- if (this.file.isDead) {
- return;
- }
- this.file.isDead = true;
- $.addClass(this.nodes.root, 'deleted-file');
- } else {
- if (this.isDead) {
- return;
- }
- this.isDead = true;
- $.addClass(this.nodes.root, 'deleted-post');
- }
- if (!(strong = $('strong.warning', this.nodes.info))) {
- strong = $.el('strong', {
- className: 'warning',
- textContent: this.isReply ? '[Deleted]' : '[Dead]'
- });
- $.after($('input', this.nodes.info), strong);
- }
- strong.textContent = file ? '[File deleted]' : '[Deleted]';
- if (this.isClone) {
- return;
- }
- ref = this.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.kill(file);
- }
- if (file) {
- return;
- }
- ref1 = Get.allQuotelinksLinkingTo(this);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- quotelink = ref1[q];
- if (!(!$.hasClass(quotelink, 'deadlink'))) {
- continue;
- }
- quotelink.textContent = quotelink.textContent + '\u00A0(Dead)';
- $.addClass(quotelink, 'deadlink');
- }
- };
-
- Post.prototype.resurrect = function() {
- var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
- this.isDead = false;
- $.rmClass(this.nodes.root, 'deleted-post');
- strong = $('strong.warning', this.nodes.info);
- if (this.file && this.file.isDead) {
- strong.textContent = '[File deleted]';
- } else {
- $.rm(strong);
- }
- if (this.isClone) {
- return;
- }
- ref = this.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.resurrect();
- }
- ref1 = Get.allQuotelinksLinkingTo(this);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- quotelink = ref1[q];
- if (!($.hasClass(quotelink, 'deadlink'))) {
- continue;
- }
- quotelink.textContent = quotelink.textContent.replace('\u00A0(Dead)', '');
- $.rmClass(quotelink, 'deadlink');
- }
- };
-
- Post.prototype.collect = function() {
- g.posts.rm(this.fullID);
- this.thread.posts.rm(this);
- return this.board.posts.rm(this);
- };
-
- Post.prototype.addClone = function(context, contractThumb) {
- return new Clone(this, context, contractThumb);
- };
-
- Post.prototype.rmClone = function(index) {
- var clone, k, len1, ref;
- this.clones.splice(index, 1);
- ref = this.clones.slice(index);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.nodes.root.dataset.clone = index++;
- }
- };
-
- return Post;
-
- })();
-
- Clone = (function(superClass) {
- extend(Clone, superClass);
-
- Clone.prototype.isClone = true;
-
- function Clone(origin1, context1, contractThumb) {
- var file, info, inline, inlined, k, key, len1, len2, len3, len4, node, nodes, post, q, ref, ref1, ref2, ref3, ref4, ref5, root, u, v, val;
- this.origin = origin1;
- this.context = context1;
- ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- key = ref[k];
- this[key] = this.origin[key];
- }
- nodes = this.origin.nodes;
- root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true);
- Clone.prefix || (Clone.prefix = 0);
- ref1 = [root].concat(slice.call($$('[id]', root)));
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- node = ref1[q];
- node.id = Clone.prefix + node.id;
- }
- Clone.prefix++;
- post = $('.post', root);
- info = $('.postInfo', post);
- this.nodes = {
- root: root,
- post: post,
- info: info,
- nameBlock: $('.nameBlock', info),
- quote: $('.postNum > a:nth-of-type(2)', info),
- comment: $('.postMessage', post),
- quotelinks: []
- };
- if ($.engine === 'edge') {
- Object.defineProperty(this.nodes, 'backlinks', {
- configurable: true,
- enumerable: true,
- get: function() {
- return info.getElementsByClassName('backlink');
- }
- });
- } else {
- this.nodes.backlinks = info.getElementsByClassName('backlink');
- }
- ref2 = $$('.inline', post);
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- inline = ref2[u];
- $.rm(inline);
- }
- ref3 = $$('.inlined', post);
- for (v = 0, len4 = ref3.length; v < len4; v++) {
- inlined = ref3[v];
- $.rmClass(inlined, 'inlined');
- }
- root.hidden = false;
- $.rmClass(root, 'forwarded');
- $.rmClass(post, 'highlight');
- if (nodes.subject) {
- this.nodes.subject = $('.subject', info);
- }
- if (nodes.name) {
- this.nodes.name = $('.name', info);
- }
- if (nodes.email) {
- this.nodes.email = $('.useremail', info);
- }
- if (nodes.tripcode) {
- this.nodes.tripcode = $('.postertrip', info);
- }
- if (nodes.uniqueID) {
- this.nodes.uniqueID = $('.posteruid', info);
- }
- if (nodes.capcode) {
- this.nodes.capcode = $('.capcode.hand', info);
- }
- if (nodes.flag) {
- this.nodes.flag = $('.flag, .countryFlag', info);
- }
- if (nodes.date) {
- this.nodes.date = $('.dateTime', info);
- }
- this.parseQuotes();
- this.quotes = slice.call(this.origin.quotes);
- if (this.origin.file) {
- this.file = {};
- ref4 = this.origin.file;
- for (key in ref4) {
- val = ref4[key];
- this.file[key] = val;
- }
- file = $('.file', post);
- this.file.text = file.firstElementChild;
- this.file.link = $('.fileText > a, .fileText-original', file);
- this.file.thumb = $('.fileThumb > [data-md5]', file);
- this.file.fullImage = $('.full-image', file);
- this.file.videoControls = $('.video-controls', this.file.text);
- if (this.file.videoThumb) {
- this.file.thumb.muted = true;
- }
- if ((ref5 = this.file.thumb) != null ? ref5.dataset.src : void 0) {
- this.file.thumb.src = this.file.thumb.dataset.src;
- this.file.thumb.removeAttribute('data-src');
- }
- if (this.file.thumb && contractThumb) {
- ImageExpand.contract(this);
- }
- }
- if (this.origin.isDead) {
- this.isDead = true;
- }
- root.dataset.clone = this.origin.clones.push(this) - 1;
- }
-
- Clone.prototype.cloneWithoutVideo = function(node) {
- var child, clone, k, len1, ref;
- if (node.tagName === 'VIDEO' && !node.dataset.md5) {
- return [];
- } else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) {
- clone = node.cloneNode(false);
- ref = node.childNodes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- child = ref[k];
- $.add(clone, this.cloneWithoutVideo(child));
- }
- return clone;
- } else {
- return node.cloneNode(true);
- }
- };
-
- return Clone;
-
- })(Post);
-
- DataBoard = (function() {
- DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'customTitles'];
-
- function DataBoard(key1, sync, dontClean) {
- var init;
- this.key = key1;
- this.onSync = bind(this.onSync, this);
- this.data = Conf[this.key];
- $.sync(this.key, this.onSync);
- if (!dontClean) {
- this.clean();
- }
- if (!sync) {
- return;
- }
- init = (function(_this) {
- return function() {
- $.off(d, '4chanXInitFinished', init);
- return _this.sync = sync;
- };
- })(this);
- $.on(d, '4chanXInitFinished', init);
- }
-
- DataBoard.prototype.save = function(cb) {
- return $.set(this.key, this.data, cb);
- };
-
- DataBoard.prototype["delete"] = function(arg) {
- var boardID, postID, ref, threadID;
- boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
- $.forceSync(this.key);
- if (postID) {
- if (!((ref = this.data.boards[boardID]) != null ? ref[threadID] : void 0)) {
- return;
- }
- delete this.data.boards[boardID][threadID][postID];
- this.deleteIfEmpty({
- boardID: boardID,
- threadID: threadID
- });
- } else if (threadID) {
- if (!this.data.boards[boardID]) {
- return;
- }
- delete this.data.boards[boardID][threadID];
- this.deleteIfEmpty({
- boardID: boardID
- });
- } else {
- delete this.data.boards[boardID];
- }
- return this.save();
- };
-
- DataBoard.prototype.deleteIfEmpty = function(arg) {
- var boardID, threadID;
- boardID = arg.boardID, threadID = arg.threadID;
- $.forceSync(this.key);
- if (threadID) {
- if (!Object.keys(this.data.boards[boardID][threadID]).length) {
- delete this.data.boards[boardID][threadID];
- return this.deleteIfEmpty({
- boardID: boardID
- });
- }
- } else if (!Object.keys(this.data.boards[boardID]).length) {
- return delete this.data.boards[boardID];
- }
- };
-
- DataBoard.prototype.set = function(arg, cb) {
- var base1, base2, base3, boardID, postID, threadID, val;
- boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val;
- $.forceSync(this.key);
- if (postID !== void 0) {
- ((base1 = ((base2 = this.data.boards)[boardID] || (base2[boardID] = {})))[threadID] || (base1[threadID] = {}))[postID] = val;
- } else if (threadID !== void 0) {
- ((base3 = this.data.boards)[boardID] || (base3[boardID] = {}))[threadID] = val;
- } else {
- this.data.boards[boardID] = val;
- }
- return this.save(cb);
- };
-
- DataBoard.prototype.get = function(arg) {
- var ID, board, boardID, defaultValue, k, len1, postID, thread, threadID, val;
- boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue;
- if (board = this.data.boards[boardID]) {
- if (threadID == null) {
- if (postID != null) {
- for (thread = k = 0, len1 = board.length; k < len1; thread = ++k) {
- ID = board[thread];
- if (postID in thread) {
- val = thread[postID];
- break;
- }
- }
- } else {
- val = board;
- }
- } else if (thread = board[threadID]) {
- val = postID != null ? thread[postID] : thread;
- }
- }
- return val || defaultValue;
- };
-
- DataBoard.prototype.forceSync = function() {
- return $.forceSync(this.key);
- };
-
- DataBoard.prototype.clean = function() {
- var boardID, now, ref, val;
- $.forceSync(this.key);
- ref = this.data.boards;
- for (boardID in ref) {
- val = ref[boardID];
- this.deleteIfEmpty({
- boardID: boardID
- });
- }
- now = Date.now();
- if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) {
- this.data.lastChecked = now;
- for (boardID in this.data.boards) {
- this.ajaxClean(boardID);
- }
- }
- };
-
- DataBoard.prototype.ajaxClean = function(boardID) {
- return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) {
- return function(e1) {
- var ref;
- if ((ref = e1.target.status) !== 200 && ref !== 404) {
- return;
- }
- return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
- var ref1;
- if ((ref1 = e2.target.status) !== 200 && ref1 !== 404) {
- return;
- }
- return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
- });
- };
- })(this));
- };
-
- DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
- var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
- if (!(board = this.data.boards[boardID])) {
- return;
- }
- threads = {};
- if (response1) {
- for (k = 0, len1 = response1.length; k < len1; k++) {
- page = response1[k];
- ref = page.threads;
- for (q = 0, len2 = ref.length; q < len2; q++) {
- thread = ref[q];
- ID = thread.no;
- if (ID in board) {
- threads[ID] = board[ID];
- }
- }
- }
- }
- if (response2) {
- for (u = 0, len3 = response2.length; u < len3; u++) {
- ID = response2[u];
- if (ID in board) {
- threads[ID] = board[ID];
- }
- }
- }
- this.data.boards[boardID] = threads;
- this.deleteIfEmpty({
- boardID: boardID
- });
- return this.save();
- };
-
- DataBoard.prototype.onSync = function(data) {
- this.data = data || {
- boards: {}
- };
- return typeof this.sync === "function" ? this.sync() : void 0;
- };
-
- return DataBoard;
-
- })();
-
- Notice = (function() {
- function Notice(type, content, timeout1, onclose) {
- this.timeout = timeout1;
- this.onclose = onclose;
- this.close = bind(this.close, this);
- this.add = bind(this.add, this);
- this.el = $.el('div', {
- innerHTML: "
"
- });
- this.el.style.opacity = 0;
- this.setType(type);
- $.on(this.el.firstElementChild, 'click', this.close);
- if (typeof content === 'string') {
- content = $.tn(content);
- }
- $.add(this.el.lastElementChild, content);
- $.ready(this.add);
- }
-
- Notice.prototype.setType = function(type) {
- return this.el.className = "notification " + type;
- };
-
- Notice.prototype.add = function() {
- if (d.hidden) {
- $.on(d, 'visibilitychange', this.add);
- return;
- }
- $.off(d, 'visibilitychange', this.add);
- $.add(Header.noticesRoot, this.el);
- this.el.clientHeight;
- this.el.style.opacity = 1;
- if (this.timeout) {
- return setTimeout(this.close, this.timeout * $.SECOND);
- }
- };
-
- Notice.prototype.close = function() {
- $.off(d, 'visibilitychange', this.add);
- $.rm(this.el);
- return typeof this.onclose === "function" ? this.onclose() : void 0;
- };
-
- return Notice;
-
- })();
-
- RandomAccessList = (function() {
- function RandomAccessList(items) {
- var item, k, len1;
- this.length = 0;
- if (items) {
- for (k = 0, len1 = items.length; k < len1; k++) {
- item = items[k];
- this.push(item);
- }
- }
- }
-
- RandomAccessList.prototype.push = function(data) {
- var ID, item, last;
- ID = data.ID;
- ID || (ID = data.id);
- if (this[ID]) {
- return;
- }
- last = this.last;
- this[ID] = item = {
- prev: last,
- next: null,
- data: data,
- ID: ID
- };
- item.prev = last;
- this.last = last ? last.next = item : this.first = item;
- return this.length++;
- };
-
- RandomAccessList.prototype.before = function(root, item) {
- var prev;
- if (item.next === root || item === root) {
- return;
- }
- this.rmi(item);
- prev = root.prev;
- root.prev = item;
- item.next = root;
- item.prev = prev;
- if (prev) {
- return prev.next = item;
- } else {
- return this.first = item;
- }
- };
-
- RandomAccessList.prototype.after = function(root, item) {
- var next;
- if (item.prev === root || item === root) {
- return;
- }
- this.rmi(item);
- next = root.next;
- root.next = item;
- item.prev = root;
- item.next = next;
- if (next) {
- return next.prev = item;
- } else {
- return this.last = item;
- }
- };
-
- RandomAccessList.prototype.prepend = function(item) {
- var first;
- first = this.first;
- if (item === first || !this[item.ID]) {
- return;
- }
- this.rmi(item);
- item.next = first;
- if (first) {
- first.prev = item;
- } else {
- this.last = item;
- }
- this.first = item;
- return delete item.prev;
- };
-
- RandomAccessList.prototype.shift = function() {
- return this.rm(this.first.ID);
- };
-
- RandomAccessList.prototype.order = function() {
- var item, order;
- order = [item = this.first];
- while (item = item.next) {
- order.push(item);
- }
- return order;
- };
-
- RandomAccessList.prototype.rm = function(ID) {
- var item;
- item = this[ID];
- if (!item) {
- return;
- }
- delete this[ID];
- this.length--;
- this.rmi(item);
- delete item.next;
- return delete item.prev;
- };
-
- RandomAccessList.prototype.rmi = function(item) {
- var next, prev;
- prev = item.prev, next = item.next;
- if (prev) {
- prev.next = next;
- } else {
- this.first = next;
- }
- if (next) {
- return next.prev = prev;
- } else {
- return this.last = prev;
- }
- };
-
- return RandomAccessList;
-
- })();
-
- SimpleDict = (function() {
- function SimpleDict() {
- this.keys = [];
- }
-
- SimpleDict.prototype.push = function(key, data) {
- key = "" + key;
- if (!this[key]) {
- this.keys.push(key);
- }
- return this[key] = data;
- };
-
- SimpleDict.prototype.rm = function(key) {
- var i;
- key = "" + key;
- if ((i = this.keys.indexOf(key)) !== -1) {
- this.keys.splice(i, 1);
- return delete this[key];
- }
- };
-
- SimpleDict.prototype.forEach = function(fn) {
- var k, key, len1, ref;
- ref = slice.call(this.keys);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- key = ref[k];
- fn(this[key]);
- }
- };
-
- return SimpleDict;
-
- })();
-
- ShimSet = (function() {
- function ShimSet() {
- this.elements = {};
- this.size = 0;
- }
-
- ShimSet.prototype.has = function(value) {
- return value in this.elements;
- };
-
- ShimSet.prototype.add = function(value) {
- if (this.elements[value]) {
- return;
- }
- this.elements[value] = true;
- return this.size++;
- };
-
- ShimSet.prototype["delete"] = function(value) {
- if (!this.elements[value]) {
- return;
- }
- delete this.elements[value];
- return this.size--;
- };
-
- return ShimSet;
-
- })();
-
- if (!('Set' in window)) {
- window.Set = ShimSet;
- }
-
- Connection = (function() {
- function Connection(target1, origin1, cb1) {
- this.target = target1;
- this.origin = origin1;
- this.cb = cb1 != null ? cb1 : {};
- this.onMessage = bind(this.onMessage, this);
- this.send = bind(this.send, this);
- $.on(window, 'message', this.onMessage);
- }
-
- Connection.prototype.targetWindow = function() {
- if (this.target instanceof window.HTMLIFrameElement) {
- return this.target.contentWindow;
- } else {
- return this.target;
- }
- };
-
- Connection.prototype.send = function(data) {
- return this.targetWindow().postMessage("" + g.NAMESPACE + (JSON.stringify(data)), this.origin);
- };
-
- Connection.prototype.onMessage = function(e) {
- var base1, data, type, value;
- if (!(e.source === this.targetWindow() && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) {
- return;
- }
- data = JSON.parse(e.data.slice(g.NAMESPACE.length));
- for (type in data) {
- value = data[type];
- if (typeof (base1 = this.cb)[type] === "function") {
- base1[type](value);
- }
- }
- };
-
- return Connection;
-
- })();
-
- Fetcher = (function() {
- function Fetcher(boardID1, threadID1, postID1, root1, quoter1) {
- var post;
- this.boardID = boardID1;
- this.threadID = threadID1;
- this.postID = postID1;
- this.root = root1;
- this.quoter = quoter1;
- if (post = g.posts[this.boardID + "." + this.postID]) {
- this.insert(post);
- return;
- }
- this.root.textContent = "Loading post No." + this.postID + "...";
- if (this.threadID) {
- $.cache("//a.4cdn.org/" + this.boardID + "/thread/" + this.threadID + ".json", (function(_this) {
- return function(e, isCached) {
- return _this.fetchedPost(e.target, isCached);
- };
- })(this));
- } else {
- this.archivedPost();
- }
- }
-
- Fetcher.prototype.insert = function(post) {
- var boardID, clone, k, len1, nodes, postID, quote, ref, ref1;
- if (!this.root.parentNode) {
- return;
- }
- clone = post.addClone(this.quoter.context, $.hasClass(this.root, 'dialog'));
- Main.callbackNodes(Clone, [clone]);
- nodes = clone.nodes;
- $.rmAll(nodes.root);
- $.add(nodes.root, nodes.post);
- ref = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- ref1 = Get.postDataFromLink(quote), boardID = ref1.boardID, postID = ref1.postID;
- if (postID === this.quoter.ID && boardID === this.quoter.board.ID) {
- $.addClass(quote, 'forwardlink');
- }
- }
- $.rmAll(this.root);
- $.add(this.root, nodes.root);
- return $.event('PostsInserted');
- };
-
- Fetcher.prototype.fetchedPost = function(req, isCached) {
- var api, board, k, len1, post, posts, status, thread;
- if (post = g.posts[this.boardID + "." + this.postID]) {
- this.insert(post);
- return;
- }
- status = req.status;
- if (status !== 200 && status !== 304) {
- if (this.archivedPost()) {
- return;
- }
- $.addClass(this.root, 'warning');
- this.root.textContent = status === 404 ? "Thread No." + this.threadID + " 404'd." : "Error " + req.statusText + " (" + req.status + ").";
- return;
- }
- posts = req.response.posts;
- Build.spoilerRange[this.boardID] = posts[0].custom_spoiler;
- for (k = 0, len1 = posts.length; k < len1; k++) {
- post = posts[k];
- if (post.no === this.postID) {
- break;
- }
- }
- if (post.no !== this.postID) {
- if (isCached) {
- api = "//a.4cdn.org/" + this.boardID + "/thread/" + this.threadID + ".json";
- $.cleanCache(function(url) {
- return url === api;
- });
- $.cache(api, (function(_this) {
- return function(e) {
- return _this.fetchedPost(e.target, false);
- };
- })(this));
- return;
- }
- if (this.archivedPost()) {
- return;
- }
- $.addClass(this.root, 'warning');
- this.root.textContent = "Post No." + this.postID + " was not found.";
- return;
- }
- board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
- post = new Post(Build.postFromObject(post, this.boardID), thread, board);
- post.isFetchedQuote = true;
- Main.callbackNodes(Post, [post]);
- return this.insert(post);
- };
-
- Fetcher.prototype.archivedPost = function() {
- var archive, url;
- if (!Conf['Resurrect Quotes']) {
- return false;
- }
- if (!(url = Redirect.to('post', {
- boardID: this.boardID,
- postID: this.postID
- }))) {
- return false;
- }
- archive = Redirect.data.post[this.boardID];
- if (/^https:\/\//.test(url) || location.protocol === 'http:') {
- $.cache(url, (function(_this) {
- return function(e) {
- return _this.parseArchivedPost(e.target.response, url, archive);
- };
- })(this), {
- responseType: 'json',
- withCredentials: archive.withCredentials
- });
- return true;
- } else if (Conf['Exempt Archives from Encryption']) {
- CrossOrigin.json(url, (function(_this) {
- return function(response) {
- var key, media, ref;
- media = response.media;
- if (media) {
- for (key in media) {
- if (/_link$/.test(key)) {
- if (!((ref = media[key]) != null ? ref.match(/^http:\/\//) : void 0)) {
- delete media[key];
- }
- }
- }
- }
- return _this.parseArchivedPost(response, url, archive);
- };
- })(this));
- return true;
- }
- return false;
- };
-
- Fetcher.prototype.parseArchivedPost = function(data, url, archive) {
- var board, comment, greentext, i, j, key, o, post, ref, ref1, text, text2, thread, val;
- if (post = g.posts[this.boardID + "." + this.postID]) {
- this.insert(post);
- return;
- }
- if (data == null) {
- $.addClass(this.root, 'warning');
- this.root.textContent = "Error fetching Post No." + this.postID + " from " + archive.name + ".";
- return;
- }
- if (data.error) {
- $.addClass(this.root, 'warning');
- this.root.textContent = data.error;
- return;
- }
- comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned)\])/);
- comment = (function() {
- var k, len1, results;
- results = [];
- for (i = k = 0, len1 = comment.length; k < len1; i = ++k) {
- text = comment[i];
- if (i % 2 === 1) {
- results.push(this.archiveTags[text]);
- } else {
- greentext = text[0] === '>';
- text = text.replace(/(\[\/?[a-z]+):lit(\])/g, '$1$2');
- text = (function() {
- var len2, q, ref, results1;
- ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
- results1 = [];
- for (j = q = 0, len2 = ref.length; q < len2; j = ++q) {
- text2 = ref[j];
- results1.push({
- innerHTML: (j % 2 ? "
" + E(text2) + " " : E(text2))
- });
- }
- return results1;
- })();
- text = {
- innerHTML: (greentext ? "
" + E.cat(text) + " " : E.cat(text))
- };
- results.push(text);
- }
- }
- return results;
- }).call(this);
- comment = {
- innerHTML: E.cat(comment)
- };
- this.threadID = +data.thread_num;
- o = {
- postID: this.postID,
- threadID: this.threadID,
- boardID: this.boardID,
- isReply: this.postID !== this.threadID
- };
- o.info = {
- subject: data.title,
- email: data.email,
- name: data.name || '',
- tripcode: data.trip,
- capcode: (function() {
- switch (data.capcode) {
- case 'M':
- return 'Mod';
- case 'A':
- return 'Admin';
- case 'D':
- return 'Developer';
- }
- })(),
- uniqueID: data.poster_hash,
- flagCode: data.poster_country,
- flag: data.poster_country_name,
- dateUTC: data.timestamp,
- dateText: data.fourchan_date,
- commentHTML: comment
- };
- if (o.info.capcode) {
- delete o.info.uniqueID;
- }
- if ((ref = data.media) != null ? ref.media_filename : void 0) {
- ref1 = data.media;
- for (key in ref1) {
- val = ref1[key];
- if (/_link$/.test(key) && (val != null ? val[0] : void 0) === '/') {
- data.media[key] = url.split('/', 3).join('/') + val;
- }
- }
- o.file = {
- name: data.media.media_filename,
- url: data.media.media_link || data.media.remote_media_link || (location.protocol + "//i.4cdn.org/" + this.boardID + "/" + (encodeURIComponent(data.media[this.boardID === 'f' ? 'media_filename' : 'media_orig']))),
- height: data.media.media_h,
- width: data.media.media_w,
- MD5: data.media.media_hash,
- size: $.bytesToString(data.media.media_size),
- thumbURL: data.media.thumb_link || (location.protocol + "//i.4cdn.org/" + this.boardID + "/" + data.media.preview_orig),
- theight: data.media.preview_h,
- twidth: data.media.preview_w,
- isSpoiler: data.media.spoiler === '1'
- };
- if (!/\.pdf$/.test(o.file.url)) {
- o.file.dimensions = o.file.width + "x" + o.file.height;
- }
- if (this.boardID === 'f' && data.media.exif) {
- o.file.tag = JSON.parse(data.media.exif).Tag;
- }
- }
- board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
- post = new Post(Build.post(o), thread, board);
- post.kill();
- if (post.file) {
- post.file.thumbURL = o.file.thumbURL;
- }
- post.isFetchedQuote = true;
- Main.callbackNodes(Post, [post]);
- return this.insert(post);
- };
-
- Fetcher.prototype.archiveTags = {
- '\n': {
- innerHTML: "
"
- },
- '[b]': {
- innerHTML: "
"
- },
- '[/b]': {
- innerHTML: " "
- },
- '[spoiler]': {
- innerHTML: "
"
- },
- '[/spoiler]': {
- innerHTML: " "
- },
- '[code]': {
- innerHTML: "
"
- },
- '[/code]': {
- innerHTML: " "
- },
- '[moot]': {
- innerHTML: "
"
- },
- '[/moot]': {
- innerHTML: "
"
- },
- '[banned]': {
- innerHTML: "
"
- },
- '[/banned]': {
- innerHTML: " "
- }
- };
-
- return Fetcher;
-
- })();
-
- Polyfill = {
- init: function() {
- return this.toBlob();
- },
- toBlob: function() {
- if (HTMLCanvasElement.prototype.toBlob) {
- return;
- }
- HTMLCanvasElement.prototype.toBlob = function(cb, type, encoderOptions) {
- var data, i, k, l, ref, ui8a, url;
- if (type == null) {
- type = 'image/png';
- }
- url = this.toDataURL(type, encoderOptions);
- data = atob(url.slice(url.indexOf(',') + 1));
- l = data.length;
- ui8a = new Uint8Array(l);
- for (i = k = 0, ref = l; k < ref; i = k += 1) {
- ui8a[i] = data.charCodeAt(i);
- }
- return cb(new Blob([ui8a], {
- type: type
- }));
- };
- return $.globalEval("HTMLCanvasElement.prototype.toBlob = (" + HTMLCanvasElement.prototype.toBlob + ");");
- }
- };
-
- Header = {
- init: function() {
- var barFixedToggler, barPositionToggler, box, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler;
- this.menu = new UI.Menu('header');
- menuButton = $.el('span', {
- className: 'menu-button'
- });
- $.extend(menuButton, {
- innerHTML: "
"
- });
- box = UI.checkbox;
- barFixedToggler = box('Fixed Header', 'Fixed Header');
- headerToggler = box('Header auto-hide', 'Auto-hide header');
- scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll');
- barPositionToggler = box('Bottom Header', 'Bottom header');
- linkJustifyToggler = box('Centered links', 'Centered links');
- customNavToggler = box('Custom Board Navigation', 'Custom board navigation');
- footerToggler = box('Bottom Board List', 'Hide bottom board list');
- shortcutToggler = box('Shortcut Icons', 'Shortcut Icons');
- editCustomNav = $.el('a', {
- textContent: 'Edit custom board navigation',
- href: 'javascript:;'
- });
- this.barFixedToggler = barFixedToggler.firstElementChild;
- this.scrollHeaderToggler = scrollHeaderToggler.firstElementChild;
- this.barPositionToggler = barPositionToggler.firstElementChild;
- this.linkJustifyToggler = linkJustifyToggler.firstElementChild;
- this.headerToggler = headerToggler.firstElementChild;
- this.footerToggler = footerToggler.firstElementChild;
- this.shortcutToggler = shortcutToggler.firstElementChild;
- this.customNavToggler = customNavToggler.firstElementChild;
- $.on(menuButton, 'click', this.menuToggle);
- $.on(this.headerToggler, 'change', this.toggleBarVisibility);
- $.on(this.barFixedToggler, 'change', this.toggleBarFixed);
- $.on(this.barPositionToggler, 'change', this.toggleBarPosition);
- $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll);
- $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify);
- $.on(this.footerToggler, 'change', this.toggleFooterVisibility);
- $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons);
- $.on(this.customNavToggler, 'change', this.toggleCustomNav);
- $.on(editCustomNav, 'click', this.editCustomNav);
- this.setBarFixed(Conf['Fixed Header']);
- this.setHideBarOnScroll(Conf['Header auto-hide on scroll']);
- this.setBarVisibility(Conf['Header auto-hide']);
- this.setLinkJustify(Conf['Centered links']);
- this.setShortcutIcons(Conf['Shortcut Icons']);
- this.setFooterVisibility(Conf['Bottom Board List']);
- $.sync('Fixed Header', this.setBarFixed);
- $.sync('Header auto-hide on scroll', this.setHideBarOnScroll);
- $.sync('Bottom Header', this.setBarPosition);
- $.sync('Shortcut Icons', this.setShortcutIcons);
- $.sync('Header auto-hide', this.setBarVisibility);
- $.sync('Centered links', this.setLinkJustify);
- $.sync('Bottom Board List', this.setFooterVisibility);
- this.addShortcut(menuButton);
- this.menu.addEntry({
- el: $.el('span', {
- textContent: 'Header'
- }),
- order: 107,
- subEntries: [
- {
- el: barFixedToggler
- }, {
- el: headerToggler
- }, {
- el: scrollHeaderToggler
- }, {
- el: barPositionToggler
- }, {
- el: linkJustifyToggler
- }, {
- el: footerToggler
- }, {
- el: shortcutToggler
- }, {
- el: customNavToggler
- }, {
- el: editCustomNav
- }
- ]
- });
- $.on(window, 'load popstate', Header.hashScroll);
- $.on(d, 'CreateNotification', this.createNotification);
- $.asap((function() {
- return d.body;
- }), (function(_this) {
- return function() {
- if (!Main.isThisPageLegit()) {
- return;
- }
- $.asap((function() {
- return $.id('boardNavMobile') || d.readyState !== 'loading';
- }), function() {
- var a, footer;
- footer = $.id('boardNavDesktop').cloneNode(true);
- footer.id = 'boardNavDesktopFoot';
- $('#navtopright', footer).id = 'navbotright';
- $('#settingsWindowLink', footer).id = 'settingsWindowLinkBot';
- Header.bottomBoardList = $('.boardList', footer);
- if (a = $("a[href*='/" + g.BOARD + "/']", footer)) {
- a.className = 'current';
- }
- Main.ready(function() {
- var absbot, oldFooter;
- if ((oldFooter = $.id('boardNavDesktopFoot'))) {
- return $.replace($('.boardList', oldFooter), Header.bottomBoardList);
- } else if ((absbot = $.id('absbot'))) {
- $.before(absbot, footer);
- return $.globalEval('window.cloneTopNav = function() {};');
- }
- });
- return Header.setBoardList();
- });
- $.prepend(d.body, _this.bar);
- $.add(d.body, Header.hover);
- _this.setBarPosition(Conf['Bottom Header']);
- return _this;
- };
- })(this));
- Main.ready((function(_this) {
- return function() {
- var cs;
- if (g.VIEW === 'catalog' || !Conf['Disable Native Extension']) {
- cs = $.el('a', {
- href: 'javascript:;'
- });
- if (g.VIEW === 'catalog') {
- cs.title = cs.textContent = 'Catalog Settings';
- cs.className = 'fa fa-book';
- } else {
- cs.title = cs.textContent = '4chan Settings';
- cs.className = 'fa fa-leaf';
- }
- $.on(cs, 'click', function() {
- return $.id('settingsWindowLink').click();
- });
- return _this.addShortcut(cs);
- }
- };
- })(this));
- return this.enableDesktopNotifications();
- },
- bar: $.el('div', {
- id: 'header-bar'
- }),
- noticesRoot: $.el('div', {
- id: 'notifications'
- }),
- shortcuts: $.el('span', {
- id: 'shortcuts'
- }),
- hover: $.el('div', {
- id: 'hoverUI'
- }),
- toggle: $.el('div', {
- id: 'scroll-marker'
- }),
- setBoardList: function() {
- var a, boardList, btn, chr, k, len1, len2, node, nodes, q, ref, ref1, spacer, span;
- Header.boardList = boardList = $.el('span', {
- id: 'board-list'
- });
- $.extend(boardList, {
- innerHTML: "
- "
- });
- btn = $('.hide-board-list-button', boardList);
- $.on(btn, 'click', Header.toggleBoardList);
- nodes = [];
- spacer = function() {
- return $.el('span', {
- className: 'spacer'
- });
- };
- ref = $('#boardNavDesktop > .boardList').childNodes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- node = ref[k];
- switch (node.nodeName) {
- case '#text':
- ref1 = node.nodeValue;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- chr = ref1[q];
- span = $.el('span', {
- textContent: chr
- });
- if (chr === ' ') {
- span.className = 'space';
- }
- if (chr === ']') {
- nodes.push(spacer());
- }
- nodes.push(span);
- if (chr === '[') {
- nodes.push(spacer());
- }
- }
- break;
- case 'A':
- a = node.cloneNode(true);
- if (a.pathname.split('/')[1] === g.BOARD.ID) {
- a.className = 'current';
- }
- nodes.push(a);
- }
- }
- $.add($('.boardList', boardList), nodes);
- $.add(Header.bar, [Header.boardList, Header.shortcuts, Header.noticesRoot, Header.toggle]);
- Header.setCustomNav(Conf['Custom Board Navigation']);
- Header.generateBoardList(Conf['boardnav']);
- $.sync('Custom Board Navigation', Header.setCustomNav);
- return $.sync('boardnav', Header.generateBoardList);
- },
- generateBoardList: function(boardnav) {
- var as, list, nodes, re, t;
- list = $('#custom-board-list', Header.boardList);
- $.rmAll(list);
- if (!boardnav) {
- return;
- }
- boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' ');
- as = $$('#full-board-list a[title]', Header.boardList);
- re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
- nodes = (function() {
- var k, len1, ref, results;
- ref = boardnav.match(re);
- results = [];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- t = ref[k];
- results.push(Header.mapCustomNavigation(t, as));
- }
- return results;
- })();
- $.add(list, nodes);
- return $.ready(CatalogLinks.initBoardList);
- },
- mapCustomNavigation: function(t, as) {
- var a, boardID, href, indexOptions, m, text, url;
- if (/^[^\w@]/.test(t)) {
- return $.tn(t);
- }
- text = url = null;
- t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) {
- text = m1;
- url = m2;
- return '';
- });
- indexOptions = [];
- t = t.replace(/-(?:mode|sort):"([^"]+)"/g, function(m0, m1) {
- indexOptions.push(m1.toLowerCase().replace(/\ /g, '-'));
- return '';
- });
- indexOptions = indexOptions.join('/');
- if (/^toggle-all/.test(t)) {
- a = $.el('a', {
- className: 'show-board-list-button',
- textContent: text || '+',
- href: 'javascript:;'
- });
- $.on(a, 'click', Header.toggleBoardList);
- return a;
- }
- if (/^external/.test(t)) {
- a = $.el('a', {
- href: url || 'javascript:;',
- textContent: text || '+',
- className: 'external'
- });
- return a;
- }
- boardID = t.split('-')[0];
- if (boardID === 'current') {
- boardID = g.BOARD.ID;
- }
- a = (function() {
- var k, len1, ref;
- if (boardID === '@') {
- return $.el('a', {
- href: 'https://twitter.com/4chan',
- title: '4chan Twitter',
- textContent: '@'
- });
- }
- for (k = 0, len1 = as.length; k < len1; k++) {
- a = as[k];
- if (a.textContent === boardID) {
- return a.cloneNode(true);
- }
- }
- a = $.el('a', {
- href: "/" + boardID + "/",
- textContent: boardID
- });
- if ((ref = g.VIEW) === 'catalog' || ref === 'archive') {
- a.href += g.VIEW;
- }
- if (boardID === g.BOARD.ID) {
- a.className = 'current';
- }
- return a;
- })();
- a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID;
- if (m = t.match(/-(index|catalog)/)) {
- if (!(boardID === 'f' && m[1] === 'catalog')) {
- a.dataset.only = m[1];
- a.href = CatalogLinks[m[1]](boardID);
- if (m[1] === 'catalog') {
- $.addClass(a, 'catalog');
- }
- } else {
- return a.firstChild;
- }
- }
- if (Conf['JSON Index'] && indexOptions) {
- a.dataset.indexOptions = indexOptions;
- if (a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
- a.href += (a.hash ? '/' : '#') + indexOptions;
- }
- }
- if (/-archive/.test(t)) {
- if (href = Redirect.to('board', {
- boardID: boardID
- })) {
- a.href = href;
- } else {
- return a.firstChild;
- }
- }
- if (/-expired/.test(t)) {
- if (boardID !== 'b' && boardID !== 'f' && boardID !== 'trash') {
- a.href = "/" + boardID + "/archive";
- } else {
- return a.firstChild;
- }
- }
- if (boardID === '@') {
- $.addClass(a, 'navSmall');
- }
- return a;
- },
- toggleBoardList: function() {
- var bar, custom, full, showBoardList;
- bar = Header.bar;
- custom = $('#custom-board-list', bar);
- full = $('#full-board-list', bar);
- showBoardList = !full.hidden;
- custom.hidden = !showBoardList;
- return full.hidden = showBoardList;
- },
- setLinkJustify: function(centered) {
- Header.linkJustifyToggler.checked = centered;
- if (centered) {
- return $.addClass(doc, 'centered-links');
- } else {
- return $.rmClass(doc, 'centered-links');
- }
- },
- toggleLinkJustify: function() {
- var centered;
- $.event('CloseMenu');
- centered = this.nodeName === 'INPUT' ? this.checked : void 0;
- Header.setLinkJustify(centered);
- return $.set('Centered links', centered);
- },
- setBarFixed: function(fixed) {
- Header.barFixedToggler.checked = fixed;
- if (fixed) {
- $.addClass(doc, 'fixed');
- return $.addClass(Header.bar, 'dialog');
- } else {
- $.rmClass(doc, 'fixed');
- return $.rmClass(Header.bar, 'dialog');
- }
- },
- toggleBarFixed: function() {
- $.event('CloseMenu');
- Header.setBarFixed(this.checked);
- Conf['Fixed Header'] = this.checked;
- return $.set('Fixed Header', this.checked);
- },
- setShortcutIcons: function(show) {
- Header.shortcutToggler.checked = show;
- if (show) {
- return $.addClass(doc, 'shortcut-icons');
- } else {
- return $.rmClass(doc, 'shortcut-icons');
- }
- },
- toggleShortcutIcons: function() {
- $.event('CloseMenu');
- Header.setShortcutIcons(this.checked);
- Conf['Shortcut Icons'] = this.checked;
- return $.set('Shortcut Icons', this.checked);
- },
- setBarVisibility: function(hide) {
- Header.headerToggler.checked = hide;
- $.event('CloseMenu');
- (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide');
- return (hide ? $.addClass : $.rmClass)(doc, 'autohide');
- },
- toggleBarVisibility: function() {
- var hide, message;
- hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
- Conf['Header auto-hide'] = hide;
- $.set('Header auto-hide', hide);
- Header.setBarVisibility(hide);
- message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.');
- return new Notice('info', message, 2);
- },
- setHideBarOnScroll: function(hide) {
- Header.scrollHeaderToggler.checked = hide;
- if (hide) {
- $.on(window, 'scroll', Header.hideBarOnScroll);
- return;
- }
- $.off(window, 'scroll', Header.hideBarOnScroll);
- $.rmClass(Header.bar, 'scroll');
- if (!Conf['Header auto-hide']) {
- return $.rmClass(Header.bar, 'autohide');
- }
- },
- toggleHideBarOnScroll: function() {
- var hide;
- hide = this.checked;
- $.cb.checked.call(this);
- return Header.setHideBarOnScroll(hide);
- },
- hideBarOnScroll: function() {
- var offsetY;
- offsetY = window.pageYOffset;
- if (offsetY > (Header.previousOffset || 0)) {
- $.addClass(Header.bar, 'autohide', 'scroll');
- } else {
- $.rmClass(Header.bar, 'autohide', 'scroll');
- }
- return Header.previousOffset = offsetY;
- },
- setBarPosition: function(bottom) {
- var args;
- Header.barPositionToggler.checked = bottom;
- $.event('CloseMenu');
- args = bottom ? ['bottom-header', 'top-header', 'after'] : ['top-header', 'bottom-header', 'add'];
- $.addClass(doc, args[0]);
- $.rmClass(doc, args[1]);
- return $[args[2]](Header.bar, Header.noticesRoot);
- },
- toggleBarPosition: function() {
- $.cb.checked.call(this);
- return Header.setBarPosition(this.checked);
- },
- setFooterVisibility: function(hide) {
- Header.footerToggler.checked = hide;
- return doc.classList.toggle('hide-bottom-board-list', hide);
- },
- toggleFooterVisibility: function() {
- var hide, message;
- $.event('CloseMenu');
- hide = this.nodeName === 'INPUT' ? this.checked : $.hasClass(doc, 'hide-bottom-board-list');
- Header.setFooterVisibility(hide);
- $.set('Bottom Board List', hide);
- message = hide ? 'The bottom navigation will now be hidden.' : 'The bottom navigation will remain visible.';
- return new Notice('info', message, 2);
- },
- setCustomNav: function(show) {
- var btn, cust, full, ref;
- Header.customNavToggler.checked = show;
- cust = $('#custom-board-list', Header.bar);
- full = $('#full-board-list', Header.bar);
- btn = $('.hide-board-list-container', full);
- return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref;
- },
- toggleCustomNav: function() {
- $.cb.checked.call(this);
- return Header.setCustomNav(this.checked);
- },
- editCustomNav: function() {
- var settings;
- Settings.open('Advanced');
- settings = $.id('fourchanx-settings');
- return $('[name=boardnav]', settings).focus();
- },
- hashScroll: function(e) {
- var el, hash;
- if (e) {
- if (e.state) {
- return;
- }
- if (!history.state) {
- history.replaceState({}, '');
- }
- }
- if ((hash = location.hash.slice(1))) {
- ReplyPruning.showIfHidden(hash);
- if ((el = $.id(hash))) {
- return $.queueTask(function() {
- return Header.scrollTo(el);
- });
- }
- }
- },
- scrollTo: function(root, down, needed) {
- var height, x;
- if (!root.offsetParent) {
- return;
- }
- if (down) {
- x = Header.getBottomOf(root);
- if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && Conf['Bottom header']) {
- height = Header.bar.getBoundingClientRect().height;
- if (x <= 0) {
- if (!Header.isHidden()) {
- x += height;
- }
- } else {
- if (Header.isHidden()) {
- x -= height;
- }
- }
- }
- if (!(needed && x >= 0)) {
- return window.scrollBy(0, -x);
- }
- } else {
- x = Header.getTopOf(root);
- if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && !Conf['Bottom header']) {
- height = Header.bar.getBoundingClientRect().height;
- if (x >= 0) {
- if (!Header.isHidden()) {
- x += height;
- }
- } else {
- if (Header.isHidden()) {
- x -= height;
- }
- }
- }
- if (!(needed && x >= 0)) {
- return window.scrollBy(0, x);
- }
- }
- },
- scrollToIfNeeded: function(root, down) {
- return Header.scrollTo(root, down, true);
- },
- getTopOf: function(root) {
- var headRect, top;
- top = root.getBoundingClientRect().top;
- if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
- headRect = Header.toggle.getBoundingClientRect();
- top -= headRect.top + headRect.height;
- }
- return top;
- },
- getBottomOf: function(root) {
- var bottom, clientHeight, headRect;
- clientHeight = doc.clientHeight;
- bottom = clientHeight - root.getBoundingClientRect().bottom;
- if (Conf['Fixed Header'] && Conf['Bottom Header']) {
- headRect = Header.toggle.getBoundingClientRect();
- bottom -= clientHeight - headRect.bottom + headRect.height;
- }
- return bottom;
- },
- isNodeVisible: function(node) {
- var height;
- if (d.hidden || !doc.contains(node)) {
- return false;
- }
- height = node.getBoundingClientRect().height;
- return Header.getTopOf(node) + height >= 0 && Header.getBottomOf(node) + height >= 0;
- },
- isHidden: function() {
- var top;
- top = Header.bar.getBoundingClientRect().top;
- if (Conf['Bottom header']) {
- return top === doc.clientHeight;
- } else {
- return top < 0;
- }
- },
- addShortcut: function(el) {
- var shortcut;
- shortcut = $.el('span', {
- className: 'shortcut brackets-wrap'
- });
- $.add(shortcut, el);
- return $.prepend(Header.shortcuts, shortcut);
- },
- rmShortcut: function(el) {
- return $.rm(el.parentElement);
- },
- menuToggle: function(e) {
- return Header.menu.toggle(e, this, g);
- },
- createNotification: function(e) {
- var content, lifetime, notice, ref, type;
- ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime;
- return notice = new Notice(type, content, lifetime);
- },
- areNotificationsEnabled: false,
- enableDesktopNotifications: function() {
- var authorize, disable, el, notice, ref;
- if (!(window.Notification && Conf['Desktop Notifications'])) {
- return;
- }
- switch (Notification.permission) {
- case 'granted':
- Header.areNotificationsEnabled = true;
- return;
- case 'denied':
- return;
- }
- el = $.el('span', {
- innerHTML: "4chan X needs your permission to show desktop notifications. [
FAQ ]
Authorize or
Disable "
- });
- ref = $$('button', el), authorize = ref[0], disable = ref[1];
- $.on(authorize, 'click', function() {
- return Notification.requestPermission(function(status) {
- Header.areNotificationsEnabled = status === 'granted';
- if (status === 'default') {
- return;
- }
- return notice.close();
- });
- });
- $.on(disable, 'click', function() {
- $.set('Desktop Notifications', false);
- return notice.close();
- });
- return notice = new Notice('info', el);
- }
- };
-
- Index = {
- showHiddenThreads: false,
- changed: {},
- init: function() {
- var anchorEntry, input, k, label, len1, len2, name, pinEntry, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, refNavEntry, repliesEntry, select, sortEntry;
- if (g.BOARD.ID === 'f' || !Conf['JSON Index'] || g.VIEW !== 'index') {
- return;
- }
- CatalogThread.callbacks.push({
- name: 'Catalog Features',
- cb: this.catalogNode
- });
- this.search = ((ref = history.state) != null ? ref.searched : void 0) || '';
- if ((ref1 = history.state) != null ? ref1.mode : void 0) {
- Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0;
- }
- this.currentSort = (ref3 = history.state) != null ? ref3.sort : void 0;
- this.currentSort || (this.currentSort = typeof Conf['Index Sort'] === 'object' ? Conf['Index Sort'][g.BOARD.ID] || 'bump' : Conf['Index Sort']);
- this.currentPage = this.getCurrentPage();
- this.processHash();
- $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
- $.on(window, 'popstate', this.cb.popstate);
- $.on(d, 'scroll', Index.scroll);
- this.button = $.el('a', {
- className: 'index-refresh-shortcut fa fa-refresh',
- title: 'Refresh',
- href: 'javascript:;',
- textContent: 'Refresh Index'
- });
- $.on(this.button, 'click', function() {
- return Index.update();
- });
- Header.addShortcut(this.button, 1);
- repliesEntry = {
- el: UI.checkbox('Show Replies', 'Show replies')
- };
- sortEntry = {
- el: UI.checkbox('Per-Board Sort Type', 'Per-board sort type', typeof Conf['Index Sort'] === 'object')
- };
- pinEntry = {
- el: UI.checkbox('Pin Watched Threads', 'Pin watched threads')
- };
- anchorEntry = {
- el: UI.checkbox('Anchor Hidden Threads', 'Anchor hidden threads')
- };
- refNavEntry = {
- el: UI.checkbox('Refreshed Navigation', 'Refreshed navigation')
- };
- sortEntry.el.title = 'Set the sorting order of each board independently.';
- pinEntry.el.title = 'Move watched threads to the start of the index.';
- anchorEntry.el.title = 'Move hidden threads to the end of the index.';
- refNavEntry.el.title = 'Refresh index when navigating through pages.';
- ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
- for (k = 0, len1 = ref4.length; k < len1; k++) {
- label = ref4[k];
- input = label.el.firstChild;
- name = input.name;
- $.on(input, 'change', $.cb.checked);
- switch (name) {
- case 'Show Replies':
- $.on(input, 'change', this.cb.replies);
- break;
- case 'Pin Watched Threads':
- case 'Anchor Hidden Threads':
- $.on(input, 'change', this.cb.resort);
- }
- }
- $.on(sortEntry.el.firstChild, 'change', this.cb.perBoardSort);
- Header.menu.addEntry({
- el: $.el('span', {
- textContent: 'Index Navigation'
- }),
- order: 100,
- subEntries: [repliesEntry, sortEntry, pinEntry, anchorEntry, refNavEntry]
- });
- this.navLinks = $.el('div', {
- className: 'navLinks json-index'
- });
- $.extend(this.navLinks, {
- innerHTML: "
Index Catalog Archive Bottom ... × — [Show ] Index Mode Paged Infinite scrolling All threads Catalog Index Sort Bump order Last reply Last long reply Creation date Reply count File count Image Size Small Large "
- });
- $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog();
- if ((ref5 = g.BOARD.ID) === 'b' || ref5 === 'trash') {
- $('.archlistlink', this.navLinks).hidden = true;
- }
- $.on($('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront);
- this.searchInput = $('#index-search', this.navLinks);
- this.setupSearch();
- $.on(this.searchInput, 'input', this.onSearchInput);
- $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
- this.hideLabel = $('#hidden-label', this.navLinks);
- $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
- this.selectMode = $('#index-mode', this.navLinks);
- this.selectSort = $('#index-sort', this.navLinks);
- this.selectSize = $('#index-size', this.navLinks);
- $.on(this.selectMode, 'change', this.cb.mode);
- $.on(this.selectSort, 'change', this.cb.sort);
- $.on(this.selectSize, 'change', $.cb.value);
- $.on(this.selectSize, 'change', this.cb.size);
- ref6 = [this.selectMode, this.selectSize];
- for (q = 0, len2 = ref6.length; q < len2; q++) {
- select = ref6[q];
- select.value = Conf[select.name];
- }
- this.selectSort.value = Index.currentSort;
- this.root = $.el('div', {
- className: 'board json-index'
- });
- this.cb.size();
- this.pagelist = $.el('div', {
- className: 'pagelist json-index'
- });
- $.extend(this.pagelist, {
- innerHTML: "
"
- });
- $('.cataloglink a', this.pagelist).href = CatalogLinks.catalog();
- $.on(this.pagelist, 'click', this.cb.pageNav);
- this.update(true);
- $.onExists(doc, 'title + *', function() {
- return d.title = d.title.replace(/\ -\ Page\ \d+/, '');
- });
- $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() {
- var board, el, len3, len4, ref7, ref8, threadRoot, topNavPos, u, v;
- Index.hat = $('.board > .thread > img:first-child');
- if (Index.hat) {
- if (Index.nodes) {
- ref7 = Index.nodes;
- for (u = 0, len3 = ref7.length; u < len3; u++) {
- threadRoot = ref7[u];
- $.prepend(threadRoot, Index.hat.cloneNode(false));
- }
- }
- $.addClass(doc, 'hats-enabled');
- $.addStyle(".catalog-thread::after {background-image: url(" + Index.hat.src + ");}");
- }
- board = $('.board');
- $.replace(board, Index.root);
- $.event('PostsInserted');
- try {
- d.implementation.createDocument(null, null, null).appendChild(board);
- } catch (_error) {}
- ref8 = $$('.navLinks');
- for (v = 0, len4 = ref8.length; v < len4; v++) {
- el = ref8[v];
- $.rm(el);
- }
- $.rm($.id('ctrl-top'));
- topNavPos = $.id('delform').previousElementSibling;
- $.before(topNavPos, $.el('hr'));
- return $.before(topNavPos, Index.navLinks);
- });
- return Main.ready(function() {
- var pagelist;
- if ((pagelist = $('.pagelist'))) {
- $.replace(pagelist, Index.pagelist);
- }
- return $.rmClass(doc, 'index-loading');
- });
- },
- scroll: function() {
- var nodes, pageNum;
- if (Index.req || !Index.liveThreadData || Conf['Index Mode'] !== 'infinite' || (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight))) {
- return;
- }
- if (Index.pageNum == null) {
- Index.pageNum = Index.currentPage;
- }
- pageNum = ++Index.pageNum;
- if (pageNum > Index.pagesNum) {
- return Index.endNotice();
- }
- nodes = Index.buildSinglePage(pageNum);
- if (Conf['Show Replies']) {
- Index.buildReplies(nodes);
- }
- return Index.buildStructure(nodes);
- },
- endNotice: (function() {
- var notify, reset;
- notify = false;
- reset = function() {
- return notify = false;
- };
- return function() {
- if (notify) {
- return;
- }
- notify = true;
- new Notice('info', "Last page reached.", 2);
- return setTimeout(reset, 3 * $.SECOND);
- };
- })(),
- menu: {
- init: function() {
- if (g.VIEW !== 'index' || !Conf['JSON Index'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
- return;
- }
- return Menu.menu.addEntry({
- el: $.el('a', {
- href: 'javascript:;',
- className: 'has-shortcut-text'
- }, {
- innerHTML: "
Shift+click "
- }),
- order: 20,
- open: function(arg) {
- var thread;
- thread = arg.thread;
- if (Conf['Index Mode'] !== 'catalog') {
- return false;
- }
- this.el.firstElementChild.textContent = thread.isHidden ? 'Unhide' : 'Hide';
- if (this.cb) {
- $.off(this.el, 'click', this.cb);
- }
- this.cb = function() {
- $.event('CloseMenu');
- return Index.toggleHide(thread);
- };
- $.on(this.el, 'click', this.cb);
- return true;
- }
- });
- }
- },
- catalogNode: function() {
- return $.on(this.nodes.thumb.parentNode, 'click', Index.onClick);
- },
- onClick: function(e) {
- var thread;
- if (e.button !== 0) {
- return;
- }
- thread = g.threads[this.parentNode.dataset.fullID];
- if (e.shiftKey) {
- Index.toggleHide(thread);
- } else {
- return;
- }
- return e.preventDefault();
- },
- toggleHide: function(thread) {
- $.rm(thread.catalogView.nodes.root);
- if (Index.showHiddenThreads) {
- ThreadHiding.show(thread);
- if (!ThreadHiding.db.get({
- boardID: thread.board.ID,
- threadID: thread.ID
- })) {
- return;
- }
- } else {
- ThreadHiding.hide(thread);
- }
- return ThreadHiding.saveHiddenState(thread);
- },
- cycleSortType: function() {
- var i, k, len1, type, types;
- types = slice.call(Index.selectSort.options).filter(function(option) {
- return !option.disabled;
- });
- for (i = k = 0, len1 = types.length; k < len1; i = ++k) {
- type = types[i];
- if (type.selected) {
- break;
- }
- }
- types[(i + 1) % types.length].selected = true;
- return $.event('change', null, Index.selectSort);
- },
- cb: {
- toggleHiddenThreads: function() {
- $('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? 'Hide' : 'Show';
- Index.sort();
- return Index.buildIndex();
- },
- mode: function() {
- Index.pushState({
- mode: this.value
- });
- return Index.pageLoad(false);
- },
- sort: function() {
- Index.pushState({
- sort: this.value
- });
- return Index.pageLoad(false);
- },
- resort: function() {
- Index.sort();
- return Index.buildIndex();
- },
- perBoardSort: function() {
- Conf['Index Sort'] = this.checked ? {} : '';
- return Index.saveSort();
- },
- size: function(e) {
- if (Conf['Index Mode'] !== 'catalog') {
- $.rmClass(Index.root, 'catalog-small');
- $.rmClass(Index.root, 'catalog-large');
- } else if (Conf['Index Size'] === 'small') {
- $.addClass(Index.root, 'catalog-small');
- $.rmClass(Index.root, 'catalog-large');
- } else {
- $.addClass(Index.root, 'catalog-large');
- $.rmClass(Index.root, 'catalog-small');
- }
- if (e) {
- return Index.buildIndex();
- }
- },
- replies: function() {
- Index.buildThreads();
- Index.sort();
- return Index.buildIndex();
- },
- popstate: function(e) {
- var mode, nCommands, page, ref, searched, sort;
- if (e != null ? e.state : void 0) {
- ref = e.state, searched = ref.searched, mode = ref.mode, sort = ref.sort;
- page = Index.getCurrentPage();
- Index.setState({
- search: searched,
- mode: mode,
- sort: sort,
- page: page
- });
- return Index.pageLoad(false);
- } else {
- nCommands = Index.processHash();
- if (Conf['Refreshed Navigation'] && nCommands) {
- return Index.update();
- } else {
- return Index.pageLoad();
- }
- }
- },
- pageNav: function(e) {
- var a;
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- switch (e.target.nodeName) {
- case 'BUTTON':
- e.target.blur();
- a = e.target.parentNode;
- break;
- case 'A':
- a = e.target;
- break;
- default:
- return;
- }
- if (a.textContent === 'Catalog') {
- return;
- }
- e.preventDefault();
- return Index.userPageNav(+a.pathname.split(/\/+/)[2] || 1);
- },
- refreshFront: function() {
- Index.pushState({
- page: 1
- });
- return Index.update();
- }
- },
- scrollToIndex: function() {
- return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root));
- },
- getCurrentPage: function() {
- return +window.location.pathname.split(/\/+/)[2] || 1;
- },
- userPageNav: function(page) {
- Index.pushState({
- page: page
- });
- if (Conf['Refreshed Navigation']) {
- return Index.update();
- } else {
- return Index.pageLoad();
- }
- },
- hashCommands: {
- mode: {
- 'paged': 'paged',
- 'infinite-scrolling': 'infinite',
- 'infinite': 'infinite',
- 'all-threads': 'all pages',
- 'all-pages': 'all pages',
- 'catalog': 'catalog'
- },
- sort: {
- 'bump-order': 'bump',
- 'last-reply': 'lastreply',
- 'last-long-reply': 'lastlong',
- 'creation-date': 'birth',
- 'reply-count': 'replycount',
- 'file-count': 'filecount'
- }
- },
- processHash: function() {
- var command, commands, hash, k, leftover, len1, mode, ref, sort, state;
- hash = ((ref = location.href.match(/#.*/)) != null ? ref[0] : void 0) || '';
- state = {
- replace: true
- };
- commands = hash.slice(1).split('/');
- leftover = [];
- for (k = 0, len1 = commands.length; k < len1; k++) {
- command = commands[k];
- if ((mode = Index.hashCommands.mode[command])) {
- state.mode = mode;
- } else if (command === 'index') {
- state.mode = Conf['Previous Index Mode'];
- state.page = 1;
- } else if ((sort = Index.hashCommands.sort[command])) {
- state.sort = sort;
- } else if (/^s=/.test(command)) {
- state.search = decodeURIComponent(command.slice(2)).replace(/\+/g, ' ').trim();
- } else {
- leftover.push(command);
- }
- }
- hash = leftover.join('/');
- if (hash) {
- state.hash = "#" + hash;
- }
- Index.pushState(state);
- return commands.length - leftover.length;
- },
- pushState: function(state) {
- var hash, pageBeforeSearch, pathname, ref, replace, search;
- search = state.search, hash = state.hash, replace = state.replace;
- pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0;
- if ((search != null) && search !== Index.search) {
- state.page = search ? 1 : pageBeforeSearch || 1;
- if (!search) {
- pageBeforeSearch = void 0;
- } else if (!Index.search) {
- pageBeforeSearch = Index.currentPage;
- }
- }
- Index.setState(state);
- pathname = Index.currentPage === 1 ? "/" + g.BOARD + "/" : "/" + g.BOARD + "/" + Index.currentPage;
- hash || (hash = '');
- return history[replace ? 'replaceState' : 'pushState']({
- mode: Conf['Index Mode'],
- sort: Index.currentSort,
- searched: Index.search,
- oldpage: pageBeforeSearch
- }, '', location.protocol + "//" + location.host + pathname + hash);
- },
- setState: function(arg) {
- var hash, mode, page, ref, search, sort;
- search = arg.search, mode = arg.mode, sort = arg.sort, page = arg.page, hash = arg.hash;
- if ((search != null) && search !== Index.search) {
- Index.changed.search = true;
- Index.search = search;
- }
- if ((mode != null) && mode !== Conf['Index Mode']) {
- Index.changed.mode = true;
- Conf['Index Mode'] = mode;
- $.set('Index Mode', mode);
- if (!(mode === 'catalog' || Conf['Previous Index Mode'] === mode)) {
- Conf['Previous Index Mode'] = mode;
- $.set('Previous Index Mode', mode);
- }
- }
- if ((sort != null) && sort !== Index.currentSort) {
- Index.changed.sort = true;
- Index.currentSort = sort;
- Index.saveSort();
- }
- if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') {
- page = 1;
- }
- if ((page != null) && page !== Index.currentPage) {
- Index.changed.page = true;
- Index.currentPage = page;
- }
- if (hash != null) {
- return Index.changed.hash = true;
- }
- },
- saveSort: function() {
- if (typeof Conf['Index Sort'] === 'object') {
- Conf['Index Sort'][g.BOARD.ID] = Index.currentSort;
- } else {
- Conf['Index Sort'] = Index.currentSort;
- }
- return $.set('Index Sort', Conf['Index Sort']);
- },
- pageLoad: function(scroll) {
- var hash, mode, page, ref, search, sort, threads;
- if (scroll == null) {
- scroll = true;
- }
- if (!Index.liveThreadData) {
- return;
- }
- ref = Index.changed, threads = ref.threads, search = ref.search, mode = ref.mode, sort = ref.sort, page = ref.page, hash = ref.hash;
- if (threads || search || sort) {
- Index.sort();
- }
- if (threads || search) {
- Index.buildPagelist();
- }
- if (search) {
- Index.setupSearch();
- }
- if (mode) {
- Index.setupMode();
- }
- if (sort) {
- Index.setupSort();
- }
- if (threads || search || mode || page || sort) {
- Index.buildIndex();
- }
- if (threads || search || mode || page) {
- Index.setPage();
- }
- if (scroll && !hash) {
- Index.scrollToIndex();
- }
- if (hash) {
- Header.hashScroll();
- }
- return Index.changed = {};
- },
- setupMode: function() {
- var k, len1, mode, ref;
- ref = ['paged', 'infinite', 'all pages', 'catalog'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- mode = ref[k];
- $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode");
- }
- Index.selectMode.value = Conf['Index Mode'];
- Index.cb.size();
- Index.showHiddenThreads = false;
- return $('#hidden-toggle a', Index.navLinks).textContent = 'Show';
- },
- setupSort: function() {
- return Index.selectSort.value = Index.currentSort;
- },
- getPagesNum: function() {
- if (Index.search) {
- return Math.ceil(Index.sortedNodes.length / Index.threadsNumPerPage);
- } else {
- return Index.pagesNum;
- }
- },
- getMaxPageNum: function() {
- return Math.max(1, Index.getPagesNum());
- },
- buildPagelist: function() {
- var a, i, k, maxPageNum, nodes, pagesRoot, ref;
- pagesRoot = $('.pages', Index.pagelist);
- maxPageNum = Index.getMaxPageNum();
- if (pagesRoot.childElementCount !== maxPageNum) {
- nodes = [];
- for (i = k = 1, ref = maxPageNum; k <= ref; i = k += 1) {
- a = $.el('a', {
- textContent: i,
- href: i === 1 ? './' : i
- });
- nodes.push($.tn('['), a, $.tn('] '));
- }
- $.rmAll(pagesRoot);
- return $.add(pagesRoot, nodes);
- }
- },
- setPage: function() {
- var a, href, maxPageNum, next, pageNum, pagesRoot, prev, strong;
- pageNum = Index.currentPage;
- maxPageNum = Index.getMaxPageNum();
- pagesRoot = $('.pages', Index.pagelist);
- prev = pagesRoot.previousSibling.firstChild;
- next = pagesRoot.nextSibling.firstChild;
- href = Math.max(pageNum - 1, 1);
- prev.href = href === 1 ? './' : href;
- prev.firstChild.disabled = href === pageNum;
- href = Math.min(pageNum + 1, maxPageNum);
- next.href = href === 1 ? './' : href;
- next.firstChild.disabled = href === pageNum;
- if (strong = $('strong', pagesRoot)) {
- if (+strong.textContent === pageNum) {
- return;
- }
- $.replace(strong, strong.firstChild);
- } else {
- strong = $.el('strong');
- }
- a = pagesRoot.children[pageNum - 1];
- $.before(a, strong);
- return $.add(strong, a);
- },
- updateHideLabel: function() {
- var hiddenCount, ref, ref1, thread, threadID;
- hiddenCount = 0;
- ref = g.BOARD.threads;
- for (threadID in ref) {
- thread = ref[threadID];
- if (thread.isHidden) {
- if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) >= 0) {
- hiddenCount++;
- }
- }
- }
- if (!hiddenCount) {
- Index.hideLabel.hidden = true;
- if (Index.showHiddenThreads) {
- Index.cb.toggleHiddenThreads();
- }
- return;
- }
- Index.hideLabel.hidden = false;
- return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads";
- },
- update: function(firstTime) {
- var now, ref, ref1;
- if ((ref = Index.req) != null) {
- ref.abort();
- }
- if ((ref1 = Index.notice) != null) {
- ref1.close();
- }
- if (Conf['Index Refresh Notifications'] && d.readyState !== 'loading') {
- Index.notice = new Notice('info', 'Refreshing index...');
- } else {
- now = Date.now();
- $.ready(function() {
- return Index.nTimeout = setTimeout((function() {
- if (Index.req && !Index.notice) {
- return Index.notice = new Notice('info', 'Refreshing index...');
- }
- }), 3 * $.SECOND - (Date.now() - now));
- });
- }
- if (!firstTime && d.readyState !== 'loading' && !$('.board + *')) {
- location.reload();
- return;
- }
- Index.req = $.ajax("//a.4cdn.org/" + g.BOARD + "/catalog.json", {
- onabort: Index.load,
- onloadend: Index.load
- }, {
- whenModified: 'Index'
- });
- return $.addClass(Index.button, 'fa-spin');
- },
- load: function(e) {
- var err, nTimeout, notice, ref, req, timeEl;
- $.rmClass(Index.button, 'fa-spin');
- req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
- if (nTimeout) {
- clearTimeout(nTimeout);
- }
- delete Index.nTimeout;
- delete Index.req;
- delete Index.notice;
- if (e.type === 'abort') {
- req.onloadend = null;
- if (notice != null) {
- notice.close();
- }
- return;
- }
- if ((ref = req.status) !== 200 && ref !== 304) {
- err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
- if (notice) {
- notice.setType('warning');
- notice.el.lastElementChild.textContent = err;
- setTimeout(notice.close, $.SECOND);
- } else {
- new Notice('warning', err, 1);
- }
- return;
- }
- try {
- if (req.status === 200) {
- Index.parse(req.response);
- } else if (req.status === 304) {
- Index.pageLoad();
- }
- } catch (_error) {
- err = _error;
- c.error("Index failure: " + err.message, err.stack);
- if (notice) {
- notice.setType('error');
- notice.el.lastElementChild.textContent = 'Index refresh failed.';
- setTimeout(notice.close, $.SECOND);
- } else {
- new Notice('error', 'Index refresh failed.', 1);
- }
- return;
- }
- if (notice) {
- if (Conf['Index Refresh Notifications']) {
- notice.setType('success');
- notice.el.lastElementChild.textContent = 'Index refreshed!';
- setTimeout(notice.close, $.SECOND);
- } else {
- notice.close();
- }
- }
- timeEl = $('#index-last-refresh time', Index.navLinks);
- timeEl.dataset.utc = Date.parse(req.getResponseHeader('Last-Modified'));
- return RelativeDates.update(timeEl);
- },
- parse: function(pages) {
- $.cleanCache(function(url) {
- return /^\/\/a\.4cdn\.org\//.test(url);
- });
- Index.parseThreadList(pages);
- Index.buildThreads();
- Index.changed.threads = true;
- return Index.pageLoad();
- },
- parseThreadList: function(pages) {
- var ref;
- Index.pagesNum = pages.length;
- Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1;
- Index.liveThreadData = pages.reduce((function(arr, next) {
- return arr.concat(next.threads);
- }), []);
- Index.liveThreadIDs = Index.liveThreadData.map(function(data) {
- return data.no;
- });
- g.BOARD.threads.forEach(function(thread) {
- var ref1;
- if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) < 0) {
- return thread.collect();
- }
- });
- },
- buildThreads: function() {
- var err, errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads;
- if (!Index.liveThreadData) {
- return;
- }
- Index.nodes = [];
- threads = [];
- posts = [];
- ref = Index.liveThreadData;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- threadData = ref[i];
- try {
- threadRoot = Build.thread(g.BOARD, threadData);
- if (Index.hat) {
- $.prepend(threadRoot, Index.hat.cloneNode(false));
- }
- if (thread = g.BOARD.threads[threadData.no]) {
- thread.setCount('post', threadData.replies + 1, threadData.bumplimit);
- thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit);
- thread.setStatus('Sticky', !!threadData.sticky);
- thread.setStatus('Closed', !!threadData.closed);
- } else {
- thread = new Thread(threadData.no, g.BOARD);
- threads.push(thread);
- }
- Index.nodes.push(threadRoot);
- if (!(thread.OP && !thread.OP.isFetchedQuote)) {
- posts.push(new Post($('.opContainer', threadRoot), thread, g.BOARD));
- }
- thread.setPage(Math.floor(i / Index.threadsNumPerPage) + 1);
- } catch (_error) {
- err = _error;
- if (!errors) {
- errors = [];
- }
- errors.push({
- message: "Parsing of Thread No." + thread + " failed. Thread will be skipped.",
- error: err
- });
- }
- }
- if (errors) {
- Main.handleErrors(errors);
- }
- $.nodes(Index.nodes);
- Main.callbackNodes(Thread, threads);
- Main.callbackNodes(Post, posts);
- Index.updateHideLabel();
- return $.event('IndexRefresh');
- },
- buildReplies: function(threadRoots) {
- var data, err, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot;
- posts = [];
- for (k = 0, len1 = threadRoots.length; k < len1; k++) {
- threadRoot = threadRoots[k];
- thread = Get.threadFromRoot(threadRoot);
- i = Index.liveThreadIDs.indexOf(thread.ID);
- if (!(lastReplies = Index.liveThreadData[i].last_replies)) {
- continue;
- }
- nodes = [];
- for (q = 0, len2 = lastReplies.length; q < len2; q++) {
- data = lastReplies[q];
- if ((post = thread.posts[data.no]) && !post.isFetchedQuote) {
- nodes.push(post.nodes.root);
- continue;
- }
- nodes.push(node = Build.postFromObject(data, thread.board.ID));
- try {
- posts.push(new Post(node, thread, thread.board));
- } catch (_error) {
- err = _error;
- if (!errors) {
- errors = [];
- }
- errors.push({
- message: "Parsing of Post No." + data.no + " failed. Post will be skipped.",
- error: err
- });
- }
- }
- $.add(threadRoot, nodes);
- }
- if (errors) {
- Main.handleErrors(errors);
- }
- return Main.callbackNodes(Post, posts);
- },
- buildCatalogViews: function() {
- var catalogThreads, k, len1, thread, threads;
- threads = Index.sortedNodes.map(function(threadRoot) {
- return Get.threadFromRoot(threadRoot);
- }).filter(function(thread) {
- return !thread.isHidden !== Index.showHiddenThreads;
- });
- catalogThreads = [];
- for (k = 0, len1 = threads.length; k < len1; k++) {
- thread = threads[k];
- if (!thread.catalogView) {
- catalogThreads.push(new CatalogThread(Build.catalogThread(thread), thread));
- }
- }
- Main.callbackNodes(CatalogThread, catalogThreads);
- return threads.map(function(thread) {
- return thread.catalogView.nodes.root;
- });
- },
- sizeCatalogViews: function(nodes) {
- var height, k, len1, node, ratio, ref, size, thumb, width;
- size = Conf['Index Size'] === 'small' ? 150 : 250;
- for (k = 0, len1 = nodes.length; k < len1; k++) {
- node = nodes[k];
- thumb = $('.catalog-thumb', node);
- ref = thumb.dataset, width = ref.width, height = ref.height;
- if (!width) {
- continue;
- }
- ratio = size / Math.max(width, height);
- thumb.style.width = width * ratio + 'px';
- thumb.style.height = height * ratio + 'px';
- }
- },
- sort: function() {
- var k, lastlong, len1, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
- liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
- if (!liveThreadData) {
- return;
- }
- sortedThreadIDs = (function() {
- switch (Index.currentSort) {
- case 'lastreply':
- return slice.call(liveThreadData).sort(function(a, b) {
- var num;
- if ((num = a.last_replies)) {
- a = num[num.length - 1];
- }
- if ((num = b.last_replies)) {
- b = num[num.length - 1];
- }
- return b.no - a.no;
- }).map(function(post) {
- return post.no;
- });
- case 'lastlong':
- lastlong = function(thread) {
- var i, k, r, ref;
- ref = thread.last_replies || [];
- for (i = k = ref.length - 1; k >= 0; i = k += -1) {
- r = ref[i];
- if (r.com && Build.parseComment(r.com).replace(/[^a-z]/ig, '').length >= 100) {
- return r;
- }
- }
- return thread;
- };
- return slice.call(liveThreadData).sort(function(a, b) {
- return lastlong(b).no - lastlong(a).no;
- }).map(function(post) {
- return post.no;
- });
- case 'bump':
- return liveThreadIDs;
- case 'birth':
- return slice.call(liveThreadIDs).sort(function(a, b) {
- return b - a;
- });
- case 'replycount':
- return slice.call(liveThreadData).sort(function(a, b) {
- return b.replies - a.replies;
- }).map(function(post) {
- return post.no;
- });
- case 'filecount':
- return slice.call(liveThreadData).sort(function(a, b) {
- return b.images - a.images;
- }).map(function(post) {
- return post.no;
- });
- }
- })();
- Index.sortedNodes = sortedNodes = [];
- nodes = Index.nodes;
- for (k = 0, len1 = sortedThreadIDs.length; k < len1; k++) {
- threadID = sortedThreadIDs[k];
- sortedNodes.push(nodes[Index.liveThreadIDs.indexOf(threadID)]);
- }
- if (Index.search && (nodes = Index.querySearch(Index.search))) {
- Index.sortedNodes = nodes;
- }
- Index.sortOnTop(function(thread) {
- return thread.isSticky;
- });
- Index.sortOnTop(function(thread) {
- return thread.isOnTop || Conf['Pin Watched Threads'] && ThreadWatcher.isWatched(thread);
- });
- if (Conf['Anchor Hidden Threads']) {
- return Index.sortOnTop(function(thread) {
- return !thread.isHidden;
- });
- }
- },
- sortOnTop: function(match) {
- var bottomNodes, k, len1, ref, threadRoot, topNodes;
- topNodes = [];
- bottomNodes = [];
- ref = Index.sortedNodes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- threadRoot = ref[k];
- (match(Get.threadFromRoot(threadRoot)) ? topNodes : bottomNodes).push(threadRoot);
- }
- return Index.sortedNodes = topNodes.concat(bottomNodes);
- },
- buildIndex: function() {
- var i, nodes, page, post;
- if (!Index.liveThreadData) {
- return;
- }
- switch (Conf['Index Mode']) {
- case 'all pages':
- nodes = Index.sortedNodes;
- break;
- case 'catalog':
- nodes = Index.buildCatalogViews();
- Index.sizeCatalogViews(nodes);
- break;
- default:
- if (Index.followedThreadID != null) {
- i = 0;
- while (Index.followedThreadID !== Get.threadFromRoot(Index.sortedNodes[i]).ID) {
- i++;
- }
- page = Math.floor(i / Index.threadsNumPerPage) + 1;
- if (page !== Index.currentPage) {
- Index.currentPage = page;
- Index.pushState({
- page: page
- });
- Index.setPage();
- }
- }
- nodes = Index.buildSinglePage(Index.currentPage);
- }
- delete Index.pageNum;
- $.rmAll(Index.root);
- $.rmAll(Header.hover);
- if (Conf['Index Mode'] === 'catalog') {
- return $.add(Index.root, nodes);
- } else {
- if (Conf['Show Replies']) {
- Index.buildReplies(nodes);
- }
- Index.buildStructure(nodes);
- if ((Index.followedThreadID != null) && (post = g.posts[g.BOARD + "." + Index.followedThreadID])) {
- return Header.scrollTo(post.nodes.root);
- }
- }
- },
- buildSinglePage: function(pageNum) {
- var nodesPerPage, offset;
- nodesPerPage = Index.threadsNumPerPage;
- offset = nodesPerPage * (pageNum - 1);
- return Index.sortedNodes.slice(offset, offset + nodesPerPage);
- },
- buildStructure: function(nodes) {
- var k, len1, node, thumb;
- for (k = 0, len1 = nodes.length; k < len1; k++) {
- node = nodes[k];
- if (thumb = $('img[data-src]', node)) {
- thumb.src = thumb.dataset.src;
- thumb.removeAttribute('data-src');
- }
- $.add(Index.root, [node, $.el('hr')]);
- }
- if (doc.contains(Index.root)) {
- $.event('PostsInserted');
- }
- return ThreadHiding.onIndexBuild(nodes);
- },
- clearSearch: function() {
- Index.searchInput.value = '';
- Index.onSearchInput();
- return Index.searchInput.focus();
- },
- setupSearch: function() {
- Index.searchInput.value = Index.search;
- if (Index.search) {
- return Index.searchInput.dataset.searching = 1;
- } else {
- return Index.searchInput.removeAttribute('data-searching');
- }
- },
- onSearchInput: function() {
- var search;
- search = Index.searchInput.value.trim();
- if (search === Index.search) {
- return;
- }
- Index.pushState({
- search: search,
- replace: !!search === !!Index.search
- });
- return Index.pageLoad(false);
- },
- querySearch: function(query) {
- var keywords;
- if (!(keywords = query.toLowerCase().match(/\S+/g))) {
- return;
- }
- return Index.sortedNodes.filter(function(threadRoot) {
- return Index.searchMatch(Get.threadFromRoot(threadRoot), keywords);
- });
- },
- searchMatch: function(thread, keywords) {
- var file, info, k, key, keyword, len1, len2, q, ref, ref1, text;
- ref = thread.OP, info = ref.info, file = ref.file;
- text = [];
- ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- key = ref1[k];
- if (key in info) {
- text.push(info[key]);
- }
- }
- if (file) {
- text.push(file.name);
- }
- text = text.join(' ').toLowerCase();
- for (q = 0, len2 = keywords.length; q < len2; q++) {
- keyword = keywords[q];
- if (-1 === text.indexOf(keyword)) {
- return false;
- }
- }
- return true;
- }
- };
-
- Build = {
- staticPath: '//s.4cdn.org/image/',
- gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif',
- spoilerRange: {},
- unescape: function(text) {
- if (text == null) {
- return text;
- }
- return text.replace(/<[^>]*>/g, '').replace(/&(amp|#039|quot|lt|gt|#44);/g, function(c) {
- return {
- '&': '&',
- ''': "'",
- '"': '"',
- '<': '<',
- '>': '>',
- ',': ','
- }[c];
- });
- },
- shortFilename: function(filename) {
- var ext, threshold;
- threshold = 30;
- ext = filename.match(/\.?[^\.]*$/)[0];
- if (filename.length - ext.length > threshold) {
- return filename.slice(0, threshold - 5) + "(...)" + ext;
- } else {
- return filename;
- }
- },
- spoilerThumb: function(boardID) {
- var spoilerRange;
- if (spoilerRange = Build.spoilerRange[boardID]) {
- return Build.staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png";
- } else {
- return Build.staticPath + "spoiler.png";
- }
- },
- sameThread: function(boardID, threadID) {
- return g.VIEW === 'thread' && g.BOARD.ID === boardID && g.THREADID === +threadID;
- },
- postURL: function(boardID, threadID, postID) {
- if (Build.sameThread(boardID, threadID)) {
- return "#p" + postID;
- } else {
- return "/" + boardID + "/thread/" + threadID + "#p" + postID;
- }
- },
- parseJSON: function(data, boardID) {
- var o;
- o = {
- postID: data.no,
- threadID: data.resto || data.no,
- boardID: boardID,
- isReply: !!data.resto,
- isSticky: !!data.sticky,
- isClosed: !!data.closed,
- isArchived: !!data.archived,
- fileDeleted: !!data.filedeleted
- };
- o.info = {
- subject: Build.unescape(data.sub),
- email: Build.unescape(data.email),
- name: Build.unescape(data.name) || '',
- tripcode: data.trip,
- uniqueID: data.id,
- flagCode: data.country,
- flag: Build.unescape(data.country_name),
- dateUTC: data.time,
- dateText: data.now,
- commentHTML: {
- innerHTML: data.com || ''
- }
- };
- if (data.capcode) {
- o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, function(c) {
- return c.toUpperCase();
- });
- o.capcodeHighlight = /_highlight$/.test(data.capcode);
- delete o.info.uniqueID;
- }
- if (data.ext) {
- o.file = {
- name: (Build.unescape(data.filename)) + data.ext,
- url: boardID === 'f' ? location.protocol + "//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.filename)) + data.ext : location.protocol + "//i.4cdn.org/" + boardID + "/" + data.tim + data.ext,
- height: data.h,
- width: data.w,
- MD5: data.md5,
- size: $.bytesToString(data.fsize),
- thumbURL: location.protocol + "//i.4cdn.org/" + boardID + "/" + data.tim + "s.jpg",
- theight: data.tn_h,
- twidth: data.tn_w,
- isSpoiler: !!data.spoiler,
- tag: data.tag
- };
- if (!/\.pdf$/.test(o.file.url)) {
- o.file.dimensions = o.file.width + "x" + o.file.height;
- }
- }
- return o;
- },
- parseComment: function(html) {
- html = html.replace(/
/gi, '\n').replace(/\n\n
Rolled [^<]*<\/b>/i, '').replace(/]*>/g, '');
- return Build.unescape(html);
- },
- postFromObject: function(data, boardID, suppressThumb) {
- var o;
- o = Build.parseJSON(data, boardID);
- return Build.post(o, suppressThumb);
- },
- post: function(o, suppressThumb) {
- var boardID, capcode, capcodeDescription, capcodeLC, capcodeLong, capcodePlural, commentHTML, container, dateText, dateUTC, email, file, fileBlock, fileThumb, fileURL, flag, flagCode, gifIcon, href, k, len1, match, name, postClass, postID, postInfo, postLink, protocol, quote, quoteLink, ref, ref1, shortFilename, staticPath, subject, threadID, tripcode, uniqueID, wholePost;
- postID = o.postID, threadID = o.threadID, boardID = o.boardID, file = o.file;
- ref = o.info, subject = ref.subject, email = ref.email, name = ref.name, tripcode = ref.tripcode, capcode = ref.capcode, uniqueID = ref.uniqueID, flagCode = ref.flagCode, flag = ref.flag, dateUTC = ref.dateUTC, dateText = ref.dateText, commentHTML = ref.commentHTML;
- staticPath = Build.staticPath, gifIcon = Build.gifIcon;
-
- /* Post Info */
- if (capcode) {
- capcodeLC = capcode.toLowerCase();
- if (capcode === 'Founder') {
- capcodePlural = 'the Founder';
- capcodeDescription = "4chan's Founder";
- } else {
- capcodeLong = {
- 'Admin': 'Administrator',
- 'Mod': 'Moderator'
- }[capcode] || capcode;
- capcodePlural = capcodeLong + "s";
- capcodeDescription = "a 4chan " + capcodeLong;
- }
- }
- postLink = Build.postURL(boardID, threadID, postID);
- quoteLink = Build.sameThread(boardID, threadID) ? "javascript:quote('" + (+postID) + "');" : "/" + boardID + "/thread/" + threadID + "#q" + postID;
- postInfo = {
- innerHTML: ""
- };
-
- /* File Info */
- if (file) {
- protocol = /^https?:(?=\/\/i\.4cdn\.org\/)/;
- fileURL = file.url.replace(protocol, '');
- shortFilename = Build.shortFilename(file.name);
- fileThumb = file.isSpoiler ? Build.spoilerThumb(boardID) : file.thumbURL.replace(protocol, '');
- }
- fileBlock = {
- innerHTML: (file ? "" : (o.fileDeleted ? "" : ""))
- };
-
- /* Whole Post */
- postClass = o.isReply ? 'reply' : 'op';
- wholePost = {
- innerHTML: (o.isReply ? ">>
" : "") + "" + (o.isReply ? postInfo.innerHTML + fileBlock.innerHTML : fileBlock.innerHTML + postInfo.innerHTML) + "
" + commentHTML.innerHTML + " "
- };
- container = $.el('div', {
- className: "postContainer " + postClass + "Container",
- id: "pc" + postID
- });
- $.extend(container, wholePost);
- ref1 = $$('.quotelink', container);
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- quote = ref1[k];
- href = quote.getAttribute('href');
- if ((href[0] === '#') && !(Build.sameThread(boardID, threadID))) {
- quote.href = ("/" + boardID + "/thread/" + threadID) + href;
- } else if ((match = href.match(/^\/([^\/]+)\/thread\/(\d+)/)) && (Build.sameThread(match[1], match[2]))) {
- quote.href = href.match(/(#[^#]*)?$/)[0] || '#';
- } else if (/^\d+(#|$)/.test(href) && !(g.VIEW === 'thread' && g.BOARD.ID === boardID)) {
- quote.href = "/" + boardID + "/thread/" + href;
- }
- }
- return container;
- },
- summaryText: function(status, posts, files) {
- var text;
- text = '';
- if (status) {
- text += status + " ";
- }
- text += posts + " post" + (posts > 1 ? 's' : '');
- if (+files) {
- text += " and " + files + " image repl" + (files > 1 ? 'ies' : 'y');
- }
- return text += " " + (status === '-' ? 'shown' : 'omitted') + ".";
- },
- summary: function(boardID, threadID, posts, files) {
- return $.el('a', {
- className: 'summary',
- textContent: Build.summaryText('', posts, files),
- href: "/" + boardID + "/thread/" + threadID
- });
- },
- thread: function(board, data, full) {
- var OP, root;
- Build.spoilerRange[board] = data.custom_spoiler;
- if (OP = board.posts[data.no]) {
- if (OP.isFetchedQuote) {
- OP = null;
- }
- }
- if (OP && (root = OP.nodes.root.parentNode)) {
- $.rmAll(root);
- } else {
- root = $.el('div', {
- className: 'thread',
- id: "t" + data.no
- });
- }
- $.add(root, Build[full ? 'fullThread' : 'excerptThread'](board, data, OP));
- return root;
- },
- excerptThread: function(board, data, OP) {
- var files, nodes, posts, ref;
- nodes = [OP ? OP.nodes.root : Build.postFromObject(data, board.ID, true)];
- if (data.omitted_posts || !Conf['Show Replies'] && data.replies) {
- ref = Conf['Show Replies'] ? [
- data.omitted_posts, data.images - data.last_replies.filter(function(data) {
- return !!data.ext;
- }).length
- ] : [data.replies, data.images], posts = ref[0], files = ref[1];
- nodes.push(Build.summary(board.ID, data.no, posts, files));
- }
- return nodes;
- },
- fullThread: function(board, data) {
- return Build.postFromObject(data, board.ID);
- },
- catalogThread: function(thread) {
- var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, u, v;
- staticPath = Build.staticPath, gifIcon = Build.gifIcon;
- data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)];
- if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) {
- src = staticPath + "spoiler";
- if (spoilerRange = Build.spoilerRange[thread.board]) {
- src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random());
- }
- src += '.png';
- imgClass = 'spoiler-file';
- } else if (data.filedeleted) {
- src = staticPath + "filedeleted-res" + gifIcon;
- imgClass = 'deleted-file';
- } else if (thread.OP.file) {
- src = thread.OP.file.thumbURL;
- } else {
- src = staticPath + "nofile.png";
- imgClass = 'no-file';
- }
- postCount = data.replies + 1;
- fileCount = data.images + !!data.ext;
- pageCount = Math.floor(Index.liveThreadIDs.indexOf(thread.ID) / Index.threadsNumPerPage) + 1;
- comment = {
- innerHTML: data.com || ''
- };
- root = $.el('div', {
- className: 'catalog-thread'
- });
- $.extend(root, {
- innerHTML: "" + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "
" + (thread.OP.info.subject ? "" + E(thread.OP.info.subject) + "
" : "") + ""
- });
- root.dataset.fullID = thread.fullID;
- if (thread.OP.highlights) {
- $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights)));
- }
- ref = $$('.quotelink', root.lastElementChild);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- href = quote.getAttribute('href');
- if (href[0] === '#') {
- quote.href = ("/" + thread.board + "/thread/" + thread.ID) + href;
- }
- }
- ref1 = $$('.abbr, .exif', root.lastElementChild);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- exif = ref1[q];
- $.rm(exif);
- }
- ref2 = $$('.prettyprint', root.lastElementChild);
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- pp = ref2[u];
- cc = $.el('span', {
- className: 'catalog-code'
- });
- $.add(cc, slice.call(pp.childNodes));
- $.replace(pp, cc);
- }
- ref3 = $$('br', root.lastElementChild);
- for (v = 0, len4 = ref3.length; v < len4; v++) {
- br = ref3[v];
- if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') {
- $.rm(br);
- }
- }
- if (thread.isSticky) {
- $.add($('.catalog-icons', root), $.el('img', {
- src: staticPath + "sticky" + gifIcon,
- className: 'stickyIcon',
- title: 'Sticky'
- }));
- }
- if (thread.isClosed) {
- $.add($('.catalog-icons', root), $.el('img', {
- src: staticPath + "closed" + gifIcon,
- className: 'closedIcon',
- title: 'Closed'
- }));
- }
- if (data.bumplimit) {
- $.addClass($('.post-count', root), 'warning');
- }
- if (data.imagelimit) {
- $.addClass($('.file-count', root), 'warning');
- }
- return root;
- }
- };
-
- Get = {
- threadExcerpt: function(thread) {
- var OP, excerpt, ref;
- OP = thread.OP;
- excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.commentDisplay.replace(/\n+/g, ' // ') || OP.info.nameBlock);
- if (excerpt.length > 73) {
- return excerpt.slice(0, 70) + "...";
- }
- return excerpt;
- },
- threadFromRoot: function(root) {
- return g.threads[g.BOARD + "." + root.id.slice(1)];
- },
- threadFromNode: function(node) {
- return Get.threadFromRoot($.x('ancestor::div[@class="thread"]', node));
- },
- postFromRoot: function(root) {
- var index, post;
- if (root == null) {
- return null;
- }
- post = g.posts[root.dataset.fullID];
- index = root.dataset.clone;
- if (index) {
- return post.clones[index];
- } else {
- return post;
- }
- },
- postFromNode: function(root) {
- return Get.postFromRoot($.x('(ancestor::div[contains(@class,"postContainer")][1]|following::div[contains(@class,"postContainer")][1])', root));
- },
- postDataFromLink: function(link) {
- var boardID, path, postID, ref, threadID;
- if (link.hostname === 'boards.4chan.org') {
- path = link.pathname.split(/\/+/);
- boardID = path[1];
- threadID = path[3];
- postID = link.hash.slice(2);
- } else {
- ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- threadID || (threadID = 0);
- }
- return {
- boardID: boardID,
- threadID: +threadID,
- postID: +postID
- };
- },
- allQuotelinksLinkingTo: function(post) {
- var fullID, handleQuotes, k, len1, posts, qPost, quote, quotelinks, ref;
- quotelinks = [];
- posts = g.posts;
- fullID = post.fullID;
- handleQuotes = function(qPost, type) {
- var clone, k, len1, ref;
- quotelinks.push.apply(quotelinks, qPost.nodes[type]);
- ref = qPost.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- quotelinks.push.apply(quotelinks, clone.nodes[type]);
- }
- };
- posts.forEach(function(qPost) {
- if (indexOf.call(qPost.quotes, fullID) >= 0) {
- return handleQuotes(qPost, 'quotelinks');
- }
- });
- if (Conf['Quote Backlinks']) {
- ref = post.quotes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- if (qPost = posts[quote]) {
- handleQuotes(qPost, 'backlinks');
- }
- }
- }
- return quotelinks.filter(function(quotelink) {
- var boardID, postID, ref1;
- ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
- return boardID === post.board.ID && postID === post.ID;
- });
- },
- scriptData: function() {
- var k, len1, ref, script;
- ref = $$('script:not([src])', d.head);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- script = ref[k];
- if (/\bcooldowns *=/.test(script.textContent)) {
- return script.textContent;
- }
- }
- return '';
- }
- };
-
- UI = (function() {
- var Menu, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove;
- dialog = function(id, position, properties) {
- var child, el, k, len1, move, ref;
- el = $.el('div', {
- className: 'dialog',
- id: id
- });
- $.extend(el, properties);
- el.style.cssText = position;
- $.get(id + ".position", position, function(item) {
- return el.style.cssText = item[id + ".position"];
- });
- move = $('.move', el);
- $.on(move, 'touchstart mousedown', dragstart);
- ref = move.children;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- child = ref[k];
- if (!child.tagName) {
- continue;
- }
- $.on(child, 'touchstart mousedown', function(e) {
- return e.stopPropagation();
- });
- }
- return el;
- };
- Menu = (function() {
- var currentMenu, lastToggledButton;
-
- currentMenu = null;
-
- lastToggledButton = null;
-
- function Menu(type1) {
- this.type = type1;
- this.addEntry = bind(this.addEntry, this);
- this.onFocus = bind(this.onFocus, this);
- this.keybinds = bind(this.keybinds, this);
- this.close = bind(this.close, this);
- $.on(d, 'AddMenuEntry', (function(_this) {
- return function(arg) {
- var detail;
- detail = arg.detail;
- if (detail.type !== _this.type) {
- return;
- }
- delete detail.open;
- return _this.addEntry(detail);
- };
- })(this));
- this.entries = [];
- }
-
- Menu.prototype.makeMenu = function() {
- var menu;
- menu = $.el('div', {
- className: 'dialog',
- id: 'menu',
- tabIndex: 0
- });
- $.on(menu, 'click', function(e) {
- return e.stopPropagation();
- });
- $.on(menu, 'keydown', this.keybinds);
- return menu;
- };
-
- Menu.prototype.toggle = function(e, button, data) {
- var previousButton;
- e.preventDefault();
- e.stopPropagation();
- if (currentMenu) {
- previousButton = lastToggledButton;
- currentMenu.close();
- if (previousButton === button) {
- return;
- }
- }
- if (!this.entries.length) {
- return;
- }
- return this.open(button, data);
- };
-
- Menu.prototype.open = function(button, data) {
- var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, k, left, len1, mRect, menu, ref, ref1, ref2, right, style, top;
- menu = this.menu = this.makeMenu();
- currentMenu = this;
- lastToggledButton = button;
- this.entries.sort(function(first, second) {
- return first.order - second.order;
- });
- ref = this.entries;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- entry = ref[k];
- this.insertEntry(entry, menu, data);
- }
- $.addClass(lastToggledButton, 'active');
- $.on(d, 'click CloseMenu', this.close);
- if (this.type !== 'gallery') {
- $.on(d, 'scroll', this.close);
- }
- $.add(button, menu);
- mRect = menu.getBoundingClientRect();
- bRect = button.getBoundingClientRect();
- bTop = window.scrollY + bRect.top;
- bLeft = window.scrollX + bRect.left;
- cHeight = doc.clientHeight;
- cWidth = doc.clientWidth;
- ref1 = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom, null] : [null, cHeight - bRect.top], top = ref1[0], bottom = ref1[1];
- ref2 = bRect.left + mRect.width < cWidth ? [bRect.left, null] : [null, cWidth - bRect.right], left = ref2[0], right = ref2[1];
- style = menu.style;
- style.top = top + "px";
- style.right = right + "px";
- style.bottom = bottom + "px";
- style.left = left + "px";
- if (right) {
- $.addClass(menu, 'left');
- }
- entry = $('.entry', menu);
- this.focus(entry);
- return menu.focus();
- };
-
- Menu.prototype.insertEntry = function(entry, parent, data) {
- var err, k, len1, ref, subEntry, submenu;
- if (typeof entry.open === 'function') {
- try {
- if (!entry.open(data)) {
- return;
- }
- } catch (_error) {
- err = _error;
- Main.handleErrors({
- message: "Error in building the " + this.type + " menu.",
- error: err
- });
- return;
- }
- }
- $.add(parent, entry.el);
- if (!entry.subEntries) {
- return;
- }
- if (submenu = $('.submenu', entry.el)) {
- $.rm(submenu);
- }
- submenu = $.el('div', {
- className: 'dialog submenu'
- });
- ref = entry.subEntries;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- subEntry = ref[k];
- this.insertEntry(subEntry, submenu, data);
- }
- $.add(entry.el, submenu);
- };
-
- Menu.prototype.close = function() {
- $.rm(this.menu);
- delete this.menu;
- $.rmClass(lastToggledButton, 'active');
- currentMenu = null;
- lastToggledButton = null;
- return $.off(d, 'click scroll CloseMenu', this.close);
- };
-
- Menu.prototype.findNextEntry = function(entry, direction) {
- var entries;
- entries = slice.call(entry.parentNode.children);
- entries.sort(function(first, second) {
- return first.style.order - second.style.order;
- });
- return entries[entries.indexOf(entry) + direction];
- };
-
- Menu.prototype.keybinds = function(e) {
- var entry, next, nextPrev, subEntry, submenu;
- entry = $('.focused', this.menu);
- while (subEntry = $('.focused', entry)) {
- entry = subEntry;
- }
- switch (e.keyCode) {
- case 27:
- lastToggledButton.focus();
- this.close();
- break;
- case 13:
- case 32:
- entry.click();
- break;
- case 38:
- if (next = this.findNextEntry(entry, -1)) {
- this.focus(next);
- }
- break;
- case 40:
- if (next = this.findNextEntry(entry, +1)) {
- this.focus(next);
- }
- break;
- case 39:
- if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) {
- while (nextPrev = this.findNextEntry(next, -1)) {
- next = nextPrev;
- }
- this.focus(next);
- }
- break;
- case 37:
- if (next = $.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) {
- this.focus(next);
- }
- break;
- default:
- return;
- }
- e.preventDefault();
- return e.stopPropagation();
- };
-
- Menu.prototype.onFocus = function(e) {
- e.stopPropagation();
- return this.focus(e.target);
- };
-
- Menu.prototype.focus = function(entry) {
- var bottom, cHeight, cWidth, eRect, focused, k, left, len1, ref, ref1, ref2, right, sRect, style, submenu, top;
- while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
- $.rmClass(focused, 'focused');
- }
- ref = $$('.focused', entry);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- focused = ref[k];
- $.rmClass(focused, 'focused');
- }
- $.addClass(entry, 'focused');
- if (!(submenu = $('.submenu', entry))) {
- return;
- }
- sRect = submenu.getBoundingClientRect();
- eRect = entry.getBoundingClientRect();
- cHeight = doc.clientHeight;
- cWidth = doc.clientWidth;
- ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1];
- ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1];
- style = submenu.style;
- style.top = top;
- style.bottom = bottom;
- style.left = left;
- return style.right = right;
- };
-
- Menu.prototype.addEntry = function(entry) {
- this.parseEntry(entry);
- return this.entries.push(entry);
- };
-
- Menu.prototype.parseEntry = function(entry) {
- var el, k, len1, subEntries, subEntry;
- el = entry.el, subEntries = entry.subEntries;
- $.addClass(el, 'entry');
- $.on(el, 'focus mouseover', this.onFocus);
- el.style.order = entry.order || 100;
- if (!subEntries) {
- return;
- }
- $.addClass(el, 'has-submenu');
- for (k = 0, len1 = subEntries.length; k < len1; k++) {
- subEntry = subEntries[k];
- this.parseEntry(subEntry);
- }
- };
-
- return Menu;
-
- })();
- dragstart = function(e) {
- var el, isTouching, o, rect, ref, screenHeight, screenWidth;
- if (e.type === 'mousedown' && e.button !== 0) {
- return;
- }
- e.preventDefault();
- if (isTouching = e.type === 'touchstart') {
- e = e.changedTouches[e.changedTouches.length - 1];
- }
- el = $.x('ancestor::div[contains(@class,"dialog")][1]', this);
- rect = el.getBoundingClientRect();
- screenHeight = doc.clientHeight;
- screenWidth = doc.clientWidth;
- o = {
- id: el.id,
- style: el.style,
- dx: e.clientX - rect.left,
- dy: e.clientY - rect.top,
- height: screenHeight - rect.height,
- width: screenWidth - rect.width,
- screenHeight: screenHeight,
- screenWidth: screenWidth,
- isTouching: isTouching
- };
- ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1];
- if (isTouching) {
- o.identifier = e.identifier;
- o.move = touchmove.bind(o);
- o.up = touchend.bind(o);
- $.on(d, 'touchmove', o.move);
- return $.on(d, 'touchend touchcancel', o.up);
- } else {
- o.move = drag.bind(o);
- o.up = dragend.bind(o);
- $.on(d, 'mousemove', o.move);
- return $.on(d, 'mouseup', o.up);
- }
- };
- touchmove = function(e) {
- var k, len1, ref, touch;
- ref = e.changedTouches;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- touch = ref[k];
- if (touch.identifier === this.identifier) {
- drag.call(this, touch);
- return;
- }
- }
- };
- 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 + '%';
- top = clientY - this.dy;
- top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%';
- right = left === null ? 0 : null;
- bottom = top === null ? this.bottomBorder + 'px' : null;
- style = this.style;
- style.left = left;
- style.right = right;
- style.top = top;
- return style.bottom = bottom;
- };
- touchend = function(e) {
- var k, len1, ref, touch;
- ref = e.changedTouches;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- touch = ref[k];
- if (touch.identifier === this.identifier) {
- dragend.call(this);
- return;
- }
- }
- };
- dragend = function() {
- if (this.isTouching) {
- $.off(d, 'touchmove', this.move);
- $.off(d, 'touchend touchcancel', this.up);
- } else {
- $.off(d, 'mousemove', this.move);
- $.off(d, 'mouseup', this.up);
- }
- return $.set(this.id + ".position", this.style.cssText);
- };
- hoverstart = function(arg) {
- var cb, el, endEvents, height, latestEvent, noRemove, o, ref, root;
- root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, height = arg.height, cb = arg.cb, noRemove = arg.noRemove;
- o = {
- root: root,
- el: el,
- style: el.style,
- isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO',
- cb: cb,
- endEvents: endEvents,
- latestEvent: latestEvent,
- clientHeight: doc.clientHeight,
- clientWidth: doc.clientWidth,
- height: height,
- noRemove: noRemove
- };
- o.hover = hover.bind(o);
- o.hoverend = hoverend.bind(o);
- o.hover(o.latestEvent);
- new MutationObserver(function() {
- if (el.parentNode) {
- return o.hover(o.latestEvent);
- }
- }).observe(el, {
- childList: true
- });
- $.on(root, endEvents, o.hoverend);
- if ($.x('ancestor::div[contains(@class,"inline")][1]', root)) {
- $.on(d, 'keydown', o.hoverend);
- }
- $.on(root, 'mousemove', o.hover);
- o.workaround = function(e) {
- if (!root.contains(e.target)) {
- return o.hoverend(e);
- }
- };
- return $.on(doc, 'mousemove', o.workaround);
- };
- hoverstart.padding = 25;
- hover = function(e) {
- var clientX, clientY, height, left, ref, right, style, threshold, top;
- this.latestEvent = e;
- height = (this.height || this.el.offsetHeight) + hoverstart.padding;
- clientX = e.clientX, clientY = e.clientY;
- top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120));
- threshold = this.clientWidth / 2;
- if (!this.isImage) {
- threshold = Math.max(threshold, this.clientWidth - 400);
- }
- ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
- style = this.style;
- style.top = top + 'px';
- style.left = left;
- return style.right = right;
- };
- hoverend = function(e) {
- if (e.type === 'keydown' && e.keyCode !== 13 || e.target.nodeName === "TEXTAREA") {
- return;
- }
- if (!this.noRemove) {
- $.rm(this.el);
- }
- $.off(this.root, this.endEvents, this.hoverend);
- $.off(d, 'keydown', this.hoverend);
- $.off(this.root, 'mousemove', this.hover);
- $.off(doc, 'mousemove', this.workaround);
- if (this.cb) {
- return this.cb.call(this);
- }
- };
- checkbox = function(name, text, checked) {
- var input, label;
- if (checked == null) {
- checked = Conf[name];
- }
- label = $.el('label');
- input = $.el('input', {
- type: 'checkbox',
- name: name,
- checked: checked
- });
- $.add(label, [input, $.tn(" " + text)]);
- return label;
- };
- return {
- dialog: dialog,
- Menu: Menu,
- hover: hoverstart,
- checkbox: checkbox
- };
- })();
-
- CrossOrigin = (function() {
- return {
- binary: function(url, cb, headers) {
- var options, ref, workaround;
- if (headers == null) {
- headers = {};
- }
- url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/');
- workaround = $.engine === 'gecko' && (typeof GM_info !== "undefined" && GM_info !== null) && /^[0-2]\.|^3\.[01](?!\d)/.test(GM_info.version);
- workaround || (workaround = /PaleMoon\//.test(navigator.userAgent));
- workaround || (workaround = (typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.script) != null ? ref.includeJSB : void 0 : void 0) != null);
- options = {
- method: "GET",
- url: url,
- headers: headers,
- onload: function(xhr) {
- var contentDisposition, contentType, data, i, r, ref1, ref2;
- if (workaround) {
- r = xhr.responseText;
- data = new Uint8Array(r.length);
- i = 0;
- while (i < r.length) {
- data[i] = r.charCodeAt(i);
- i++;
- }
- } else {
- data = new Uint8Array(xhr.response);
- }
- if (typeof xhr.responseHeaders === 'object') {
- contentType = xhr.responseHeaders['Content-Type'];
- contentDisposition = xhr.responseHeaders['Content-Disposition'];
- } else {
- contentType = (ref1 = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0;
- contentDisposition = (ref2 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0;
- }
- return cb(data, contentType, contentDisposition);
- },
- onerror: function() {
- return cb(null);
- },
- onabort: function() {
- return cb(null);
- }
- };
- if (workaround) {
- options.overrideMimeType = options.mimeType = 'text/plain; charset=x-user-defined';
- } else {
- options.responseType = 'arraybuffer';
- }
- return GM_xmlhttpRequest(options);
- },
- file: function(url, cb) {
- return CrossOrigin.binary(url, function(data, contentType, contentDisposition) {
- var blob, match, mime, name, ref, ref1, ref2, ref3;
- if (data == null) {
- return cb(null);
- }
- name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0;
- mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream';
- match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0);
- if (match) {
- name = match.replace(/\\"/g, '"');
- }
- if ((typeof GM_info !== "undefined" && GM_info !== null ? (ref3 = GM_info.script) != null ? ref3.includeJSB : void 0 : void 0) != null) {
- mime = QR.typeFromExtension[name.match(/[^.]*$/)[0].toLowerCase()] || 'application/octet-stream';
- }
- blob = new Blob([data], {
- type: mime
- });
- blob.name = name;
- return cb(blob);
- });
- },
- json: (function() {
- var callbacks, responses;
- callbacks = {};
- responses = {};
- return function(url, cb) {
- if (responses[url]) {
- cb(responses[url]);
- return;
- }
- if (callbacks[url]) {
- callbacks[url].push(cb);
- return;
- }
- callbacks[url] = [cb];
- return GM_xmlhttpRequest({
- method: "GET",
- url: url + '',
- onload: function(xhr) {
- var k, len1, ref, response;
- response = JSON.parse(xhr.responseText);
- ref = callbacks[url];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- cb = ref[k];
- cb(response);
- }
- delete callbacks[url];
- return responses[url] = response;
- },
- onerror: function() {
- return delete callbacks[url];
- },
- onabort: function() {
- return delete callbacks[url];
- }
- });
- };
- })()
- };
- })();
-
- Anonymize = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Anonymize'])) {
- return;
- }
- if (g.VIEW === 'archive') {
- return this.archive();
- }
- return Post.callbacks.push({
- name: 'Anonymize',
- cb: this.node
- });
- },
- node: function() {
- var email, name, ref, tripcode;
- if (this.info.capcode || this.isClone) {
- return;
- }
- ref = this.nodes, name = ref.name, tripcode = ref.tripcode, email = ref.email;
- if (this.info.name !== 'Anonymous') {
- name.textContent = 'Anonymous';
- }
- if (tripcode) {
- $.rm(tripcode);
- delete this.nodes.tripcode;
- }
- if (this.info.email) {
- $.replace(email, name);
- return delete this.nodes.email;
- }
- },
- archive: function() {
- return $.ready(function() {
- var k, len1, len2, name, q, ref, ref1, trip;
- ref = $$('.name');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- name = ref[k];
- name.textContent = 'Anonymous';
- }
- ref1 = $$('.postertrip');
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- trip = ref1[q];
- $.rm(trip);
- }
- });
- }
- };
-
- Filter = {
- filters: {},
- init: function() {
- var boards, err, excludes, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, regexp, stub, top;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
- return;
- }
- if (!Conf['Filtered Backlinks']) {
- $.addClass(doc, 'hide-backlinks');
- }
- for (key in Config.filter) {
- this.filters[key] = [];
- ref1 = Conf[key].split('\n');
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- line = ref1[k];
- if (line[0] === '#') {
- continue;
- }
- if (!(regexp = line.match(/\/(.+)\/(\w*)/))) {
- continue;
- }
- filter = line.replace(regexp[0], '');
- boards = ((ref2 = filter.match(/boards:([^;]+)/)) != null ? ref2[1].toLowerCase() : void 0) || 'global';
- boards = boards === 'global' ? null : boards.split(',');
- if (boards === null) {
- excludes = ((ref3 = filter.match(/exclude:([^;]+)/)) != null ? ref3[1].toLowerCase().split(',') : void 0) || null;
- }
- if (key === 'uniqueID' || key === 'MD5') {
- regexp = regexp[1];
- } else {
- try {
- regexp = RegExp(regexp[1], regexp[2]);
- } catch (_error) {
- err = _error;
- new Notice('warning', [$.tn("Invalid " + key + " filter:"), $.el('br'), $.tn(line), $.el('br'), $.tn(err.message)], 60);
- continue;
- }
- }
- op = ((ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? ref4[1] : void 0) || 'yes';
- stub = (function() {
- var ref5;
- switch ((ref5 = filter.match(/stub:(yes|no)/)) != null ? ref5[1] : void 0) {
- case 'yes':
- return true;
- case 'no':
- return false;
- default:
- return Conf['Stubs'];
- }
- })();
- if (hl = /highlight/.test(filter)) {
- hl = ((ref5 = filter.match(/highlight:([\w-]+)/)) != null ? ref5[1] : void 0) || 'filter-highlight';
- top = ((ref6 = filter.match(/top:(yes|no)/)) != null ? ref6[1] : void 0) || 'yes';
- top = top === 'yes';
- }
- this.filters[key].push(this.createFilter(regexp, boards, excludes, op, stub, hl, top));
- }
- if (!this.filters[key].length) {
- delete this.filters[key];
- }
- }
- if (!Object.keys(this.filters).length) {
- return;
- }
- return Post.callbacks.push({
- name: 'Filter',
- cb: this.node
- });
- },
- createFilter: function(regexp, boards, excludes, op, stub, hl, top) {
- var settings, test;
- test = typeof regexp === 'string' ? function(value) {
- return regexp === value;
- } : function(value) {
- return regexp.test(value);
- };
- settings = {
- hide: !hl,
- stub: stub,
- "class": hl,
- top: top
- };
- return function(value, boardID, isReply) {
- if (boards && indexOf.call(boards, boardID) < 0) {
- return false;
- }
- if (excludes && indexOf.call(excludes, boardID) >= 0) {
- return false;
- }
- if (isReply && op === 'only' || !isReply && op === 'no') {
- return false;
- }
- if (!test(value)) {
- return false;
- }
- return settings;
- };
- },
- node: function() {
- var filter, k, key, len1, ref, ref1, result, value;
- if (this.isClone) {
- return;
- }
- for (key in Filter.filters) {
- if ((value = Filter[key](this)) != null) {
- ref = Filter.filters[key];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- filter = ref[k];
- if (!(result = filter(value, this.board.ID, this.isReply))) {
- continue;
- }
- if (result.hide && !this.isFetchedQuote) {
- if (this.isReply) {
- PostHiding.hide(this, result.stub);
- } else if (g.VIEW === 'index') {
- ThreadHiding.hide(this.thread, result.stub);
- } else {
- continue;
- }
- return;
- }
- $.addClass(this.nodes.root, result["class"]);
- if (!(this.highlights && (ref1 = result["class"], indexOf.call(this.highlights, ref1) >= 0))) {
- (this.highlights || (this.highlights = [])).push(result["class"]);
- }
- if (!this.isReply && result.top) {
- this.thread.isOnTop = true;
- }
- }
- }
- }
- },
- isHidden: function(post) {
- var filter, k, key, len1, ref, result, value;
- for (key in Filter.filters) {
- if ((value = Filter[key](post)) != null) {
- ref = Filter.filters[key];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- filter = ref[k];
- if (result = filter(value, post.boardID, post.isReply)) {
- if (result.hide) {
- return true;
- }
- }
- }
- }
- }
- return false;
- },
- postID: function(post) {
- var ref;
- return "" + ((ref = post.ID) != null ? ref : post.postID);
- },
- name: function(post) {
- return post.info.name;
- },
- uniqueID: function(post) {
- return post.info.uniqueID;
- },
- tripcode: function(post) {
- return post.info.tripcode;
- },
- capcode: function(post) {
- return post.info.capcode;
- },
- subject: function(post) {
- return post.info.subject;
- },
- comment: function(post) {
- var base1;
- return (base1 = post.info).comment != null ? base1.comment : base1.comment = Build.parseComment(post.info.commentHTML.innerHTML);
- },
- flag: function(post) {
- return post.info.flag;
- },
- filename: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.name : void 0;
- },
- dimensions: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.dimensions : void 0;
- },
- filesize: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.size : void 0;
- },
- MD5: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.MD5 : void 0;
- },
- menu: {
- init: function() {
- var div, entry, k, len1, ref, ref1, type;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
- return;
- }
- div = $.el('div', {
- textContent: 'Filter'
- });
- entry = {
- el: div,
- order: 50,
- open: function(post) {
- Filter.menu.post = post;
- return true;
- },
- subEntries: []
- };
- ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- type = ref1[k];
- entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1]));
- }
- return Menu.menu.addEntry(entry);
- },
- createSubEntry: function(text, type) {
- var el;
- el = $.el('a', {
- href: 'javascript:;',
- textContent: text
- });
- el.dataset.type = type;
- $.on(el, 'click', Filter.menu.makeFilter);
- return {
- el: el,
- open: function(post) {
- var value;
- value = Filter[type](post);
- return value != null;
- }
- };
- },
- makeFilter: function() {
- var re, type, value;
- type = this.dataset.type;
- value = Filter[type](Filter.menu.post);
- re = type === 'uniqueID' || type === 'MD5' ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
- if (c === '\n') {
- return '\\n';
- } else if (c === '\\') {
- return '\\\\';
- } else {
- return "\\" + c;
- }
- });
- re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
- return $.get(type, Conf[type], function(item) {
- var save, section, select, ta, tl;
- save = item[type];
- save = save ? save + "\n" + re : re;
- $.set(type, save);
- Settings.open('Filter');
- section = $('.section-container');
- select = $('select[name=filter]', section);
- select.value = type;
- Settings.selectFilter.call(select);
- ta = $('textarea', section);
- tl = ta.textLength;
- ta.setSelectionRange(tl, tl);
- return ta.focus();
- });
- }
- }
- };
-
- PostHiding = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
- return;
- }
- if (Conf['Reply Hiding Buttons']) {
- $.addClass(doc, "reply-hide");
- }
- this.db = new DataBoard('hiddenPosts');
- return Post.callbacks.push({
- name: 'Reply Hiding',
- cb: this.node
- });
- },
- node: function() {
- var data, sideArrows;
- if (!this.isReply || this.isClone || this.isFetchedQuote) {
- return;
- }
- if (data = PostHiding.db.get({
- boardID: this.board.ID,
- threadID: this.thread.ID,
- postID: this.ID
- })) {
- if (data.thisPost) {
- PostHiding.hide(this, data.makeStub, data.hideRecursively);
- } else {
- Recursive.apply(PostHiding.hide, this, data.makeStub, true);
- Recursive.add(PostHiding.hide, this, data.makeStub, true);
- }
- }
- if (!Conf['Reply Hiding Buttons']) {
- return;
- }
- sideArrows = $('.sideArrows', this.nodes.root);
- $.replace(sideArrows.firstChild, PostHiding.makeButton(this, 'hide'));
- return sideArrows.removeAttribute('class');
- },
- menu: {
- init: function() {
- var apply, div, hideStubLink, makeStub, ref, replies, thisPost;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
- return;
- }
- div = $.el('div', {
- className: 'hide-reply-link',
- textContent: 'Hide'
- });
- apply = $.el('a', {
- textContent: 'Apply',
- href: 'javascript:;'
- });
- $.on(apply, 'click', PostHiding.menu.hide);
- thisPost = UI.checkbox('thisPost', 'This post', true);
- replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']);
- makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']);
- Menu.menu.addEntry({
- el: div,
- order: 20,
- open: function(post) {
- if (!post.isReply || post.isClone || post.isHidden) {
- return false;
- }
- PostHiding.menu.post = post;
- return true;
- },
- subEntries: [
- {
- el: apply
- }, {
- el: thisPost
- }, {
- el: replies
- }, {
- el: makeStub
- }
- ]
- });
- div = $.el('div', {
- className: 'show-reply-link',
- textContent: 'Show'
- });
- apply = $.el('a', {
- textContent: 'Apply',
- href: 'javascript:;'
- });
- $.on(apply, 'click', PostHiding.menu.show);
- thisPost = UI.checkbox('thisPost', 'This post', false);
- replies = UI.checkbox('replies', 'Show replies', false);
- hideStubLink = $.el('a', {
- textContent: 'Hide stub',
- href: 'javascript:;'
- });
- $.on(hideStubLink, 'click', PostHiding.menu.hideStub);
- Menu.menu.addEntry({
- el: div,
- order: 20,
- open: function(post) {
- var data;
- if (!post.isReply || post.isClone || !post.isHidden) {
- return false;
- }
- if (!(data = PostHiding.db.get({
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- }))) {
- return false;
- }
- PostHiding.menu.post = post;
- thisPost.firstChild.checked = post.isHidden;
- replies.firstChild.checked = (data != null ? data.hideRecursively : void 0) != null ? data.hideRecursively : Conf['Recursive Hiding'];
- return true;
- },
- subEntries: [
- {
- el: apply
- }, {
- el: thisPost
- }, {
- el: replies
- }
- ]
- });
- return Menu.menu.addEntry({
- el: hideStubLink,
- order: 15,
- open: function(post) {
- var data;
- if (!post.isReply || post.isClone || !post.isHidden) {
- return false;
- }
- if (!(data = PostHiding.db.get({
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- }))) {
- return false;
- }
- return PostHiding.menu.post = post;
- }
- });
- },
- hide: function() {
- var makeStub, parent, post, replies, thisPost;
- parent = this.parentNode;
- thisPost = $('input[name=thisPost]', parent).checked;
- replies = $('input[name=replies]', parent).checked;
- makeStub = $('input[name=makeStub]', parent).checked;
- post = PostHiding.menu.post;
- if (thisPost) {
- PostHiding.hide(post, makeStub, replies);
- } else if (replies) {
- Recursive.apply(PostHiding.hide, post, makeStub, true);
- Recursive.add(PostHiding.hide, post, makeStub, true);
- } else {
- return;
- }
- PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies);
- return $.event('CloseMenu');
- },
- show: function() {
- var data, parent, post, replies, thisPost;
- parent = this.parentNode;
- thisPost = $('input[name=thisPost]', parent).checked;
- replies = $('input[name=replies]', parent).checked;
- post = PostHiding.menu.post;
- if (thisPost) {
- PostHiding.show(post, replies);
- } else if (replies) {
- Recursive.apply(PostHiding.show, post, true);
- Recursive.rm(PostHiding.hide, post, true);
- } else {
- return;
- }
- if (data = PostHiding.db.get({
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- })) {
- PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
- }
- return $.event('CloseMenu');
- },
- hideStub: function() {
- var data, post;
- post = PostHiding.menu.post;
- if (data = PostHiding.db.get({
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- })) {
- PostHiding.show(post, data.hideRecursively);
- PostHiding.hide(post, false, data.hideRecursively);
- PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively);
- }
- $.event('CloseMenu');
- }
- },
- makeButton: function(post, type) {
- var a, span;
- span = $.el('span', {
- className: "fa fa-" + (type === 'hide' ? 'minus' : 'plus') + "-square-o",
- textContent: ""
- });
- a = $.el('a', {
- className: type + "-reply-button",
- href: 'javascript:;'
- });
- $.add(a, span);
- $.on(a, 'click', PostHiding.toggle);
- return a;
- },
- saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
- var data;
- data = {
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- };
- if (isHiding) {
- data.val = {
- thisPost: thisPost !== false,
- makeStub: makeStub,
- hideRecursively: hideRecursively
- };
- return PostHiding.db.set(data);
- } else {
- return PostHiding.db["delete"](data);
- }
- },
- 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, k, len1, quotelink, ref;
- if (makeStub == null) {
- makeStub = Conf['Stubs'];
- }
- if (hideRecursively == null) {
- hideRecursively = Conf['Recursive Hiding'];
- }
- if (post.isHidden) {
- return;
- }
- post.isHidden = true;
- if (hideRecursively) {
- Recursive.apply(PostHiding.hide, post, makeStub, true);
- Recursive.add(PostHiding.hide, post, makeStub, true);
- }
- ref = Get.allQuotelinksLinkingTo(post);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- $.addClass(quotelink, 'filtered');
- }
- if (!makeStub) {
- post.nodes.root.hidden = true;
- return;
- }
- a = PostHiding.makeButton(post, 'show');
- $.add(a, $.tn(" " + post.info.nameBlock));
- post.nodes.stub = $.el('div', {
- className: 'stub'
- });
- $.add(post.nodes.stub, a);
- if (Conf['Menu']) {
- $.add(post.nodes.stub, Menu.makeButton(post));
- }
- return $.prepend(post.nodes.root, post.nodes.stub);
- },
- show: function(post, showRecursively) {
- var k, len1, quotelink, ref;
- if (showRecursively == null) {
- showRecursively = Conf['Recursive Hiding'];
- }
- if (post.nodes.stub) {
- $.rm(post.nodes.stub);
- delete post.nodes.stub;
- } else {
- post.nodes.root.hidden = false;
- }
- post.isHidden = false;
- if (showRecursively) {
- Recursive.apply(PostHiding.show, post, true);
- Recursive.rm(PostHiding.hide, post);
- }
- ref = Get.allQuotelinksLinkingTo(post);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- $.rmClass(quotelink, 'filtered');
- }
- }
- };
-
- Recursive = {
- recursives: {},
- init: function() {
- var ref;
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- return Post.callbacks.push({
- name: 'Recursive',
- cb: this.node
- });
- },
- node: function() {
- var i, k, len1, len2, obj, q, quote, recursive, ref, ref1;
- if (this.isClone || this.isFetchedQuote) {
- return;
- }
- ref = this.quotes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- if (obj = Recursive.recursives[quote]) {
- ref1 = obj.recursives;
- for (i = q = 0, len2 = ref1.length; q < len2; i = ++q) {
- recursive = ref1[i];
- recursive.apply(null, [this].concat(slice.call(obj.args[i])));
- }
- }
- }
- },
- add: function() {
- var args, base1, name1, obj, post, recursive;
- recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
- obj = (base1 = Recursive.recursives)[name1 = post.fullID] || (base1[name1] = {
- recursives: [],
- args: []
- });
- obj.recursives.push(recursive);
- return obj.args.push(args);
- },
- rm: function(recursive, post) {
- var i, k, len1, obj, rec, ref;
- if (!(obj = Recursive.recursives[post.fullID])) {
- return;
- }
- ref = obj.recursives;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- rec = ref[i];
- if (!(rec === recursive)) {
- continue;
- }
- obj.recursives.splice(i, 1);
- obj.args.splice(i, 1);
- }
- },
- apply: function() {
- var args, fullID, post, recursive;
- recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
- fullID = post.fullID;
- return g.posts.forEach(function(post) {
- if (indexOf.call(post.quotes, fullID) >= 0) {
- return recursive.apply(null, [post].concat(slice.call(args)));
- }
- });
- }
- };
-
- ThreadHiding = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) {
- return;
- }
- this.db = new DataBoard('hiddenThreads');
- if (g.VIEW === 'catalog') {
- return this.catalogWatch();
- }
- this.catalogSet(g.BOARD);
- return Post.callbacks.push({
- name: 'Thread Hiding',
- cb: this.node
- });
- },
- catalogSet: function(board) {
- var hiddenThreads, threadID;
- if (!$.hasStorage) {
- return;
- }
- hiddenThreads = ThreadHiding.db.get({
- boardID: board.ID,
- defaultValue: {}
- });
- for (threadID in hiddenThreads) {
- hiddenThreads[threadID] = true;
- }
- return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads));
- },
- catalogWatch: function() {
- if (!$.hasStorage) {
- return;
- }
- this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
- return Main.ready(function() {
- return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), {
- attributes: true,
- subtree: true,
- attributeFilter: ['style']
- });
- });
- },
- catalogSave: function() {
- var hiddenThreads2, threadID;
- hiddenThreads2 = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
- for (threadID in hiddenThreads2) {
- if (!(threadID in ThreadHiding.hiddenThreads)) {
- ThreadHiding.db.set({
- boardID: g.BOARD.ID,
- threadID: threadID,
- val: {
- makeStub: Conf['Stubs']
- }
- });
- }
- }
- for (threadID in ThreadHiding.hiddenThreads) {
- if (!(threadID in hiddenThreads2)) {
- ThreadHiding.db["delete"]({
- boardID: g.BOARD.ID,
- threadID: threadID
- });
- }
- }
- return ThreadHiding.hiddenThreads = hiddenThreads2;
- },
- node: function() {
- var data;
- if (this.isReply || this.isClone || this.isFetchedQuote) {
- return;
- }
- if (data = ThreadHiding.db.get({
- boardID: this.board.ID,
- threadID: this.ID
- })) {
- ThreadHiding.hide(this.thread, data.makeStub);
- }
- if (!Conf['Thread Hiding Buttons']) {
- return;
- }
- return $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide'));
- },
- onIndexBuild: function(nodes) {
- var k, len1, root, thread;
- for (k = 0, len1 = nodes.length; k < len1; k++) {
- root = nodes[k];
- thread = Get.threadFromRoot(root);
- if (thread.isHidden && thread.stub && !root.contains(thread.stub)) {
- ThreadHiding.makeStub(thread, root);
- }
- }
- },
- menu: {
- init: function() {
- var apply, div, hideStubLink, makeStub;
- if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
- return;
- }
- div = $.el('div', {
- className: 'hide-thread-link',
- textContent: 'Hide'
- });
- apply = $.el('a', {
- textContent: 'Apply',
- href: 'javascript:;'
- });
- $.on(apply, 'click', ThreadHiding.menu.hide);
- makeStub = UI.checkbox('Stubs', 'Make stub');
- Menu.menu.addEntry({
- el: div,
- order: 20,
- open: function(arg) {
- var isReply, thread;
- thread = arg.thread, isReply = arg.isReply;
- if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
- return false;
- }
- ThreadHiding.menu.thread = thread;
- return true;
- },
- subEntries: [
- {
- el: apply
- }, {
- el: makeStub
- }
- ]
- });
- div = $.el('a', {
- className: 'show-thread-link',
- textContent: 'Show',
- href: 'javascript:;'
- });
- $.on(div, 'click', ThreadHiding.menu.show);
- Menu.menu.addEntry({
- el: div,
- order: 20,
- open: function(arg) {
- var isReply, thread;
- thread = arg.thread, isReply = arg.isReply;
- if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
- return false;
- }
- ThreadHiding.menu.thread = thread;
- return true;
- }
- });
- hideStubLink = $.el('a', {
- textContent: 'Hide stub',
- href: 'javascript:;'
- });
- $.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);
- return Menu.menu.addEntry({
- el: hideStubLink,
- order: 15,
- open: function(arg) {
- var isReply, thread;
- thread = arg.thread, isReply = arg.isReply;
- if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
- return false;
- }
- return ThreadHiding.menu.thread = thread;
- }
- });
- },
- hide: function() {
- var makeStub, thread;
- makeStub = $('input', this.parentNode).checked;
- thread = ThreadHiding.menu.thread;
- ThreadHiding.hide(thread, makeStub);
- ThreadHiding.saveHiddenState(thread, makeStub);
- return $.event('CloseMenu');
- },
- show: function() {
- var thread;
- thread = ThreadHiding.menu.thread;
- ThreadHiding.show(thread);
- ThreadHiding.saveHiddenState(thread);
- return $.event('CloseMenu');
- },
- hideStub: function() {
- var thread;
- thread = ThreadHiding.menu.thread;
- ThreadHiding.show(thread);
- ThreadHiding.hide(thread, false);
- ThreadHiding.saveHiddenState(thread, false);
- $.event('CloseMenu');
- }
- },
- makeButton: function(thread, type) {
- var a;
- a = $.el('a', {
- className: type + "-thread-button",
- href: 'javascript:;'
- });
- $.extend(a, {
- innerHTML: " "
- });
- a.dataset.fullID = thread.fullID;
- $.on(a, 'click', ThreadHiding.toggle);
- return a;
- },
- makeStub: function(thread, root) {
- var a, numReplies, summary;
- numReplies = $$('.thread > .replyContainer', root).length;
- if (summary = $('.summary', root)) {
- numReplies += +summary.textContent.match(/\d+/);
- }
- a = ThreadHiding.makeButton(thread, 'show');
- $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")"));
- thread.stub = $.el('div', {
- className: 'stub'
- });
- if (Conf['Menu']) {
- $.add(thread.stub, [a, Menu.makeButton(thread.OP)]);
- } else {
- $.add(thread.stub, a);
- }
- return $.prepend(root, thread.stub);
- },
- saveHiddenState: function(thread, makeStub) {
- if (thread.isHidden) {
- ThreadHiding.db.set({
- boardID: thread.board.ID,
- threadID: thread.ID,
- val: {
- makeStub: makeStub
- }
- });
- } else {
- ThreadHiding.db["delete"]({
- boardID: thread.board.ID,
- threadID: thread.ID
- });
- }
- return ThreadHiding.catalogSet(thread.board);
- },
- toggle: function(thread) {
- if (!(thread instanceof Thread)) {
- thread = g.threads[this.dataset.fullID];
- }
- if (thread.isHidden) {
- ThreadHiding.show(thread);
- } else {
- ThreadHiding.hide(thread);
- }
- return ThreadHiding.saveHiddenState(thread);
- },
- hide: function(thread, makeStub) {
- var threadRoot;
- if (makeStub == null) {
- makeStub = Conf['Stubs'];
- }
- if (thread.isHidden) {
- return;
- }
- threadRoot = thread.OP.nodes.root.parentNode;
- thread.isHidden = true;
- if (Conf['JSON Index']) {
- Index.updateHideLabel();
- }
- if (!makeStub) {
- return threadRoot.hidden = true;
- }
- return ThreadHiding.makeStub(thread, threadRoot);
- },
- show: function(thread) {
- var threadRoot;
- if (thread.stub) {
- $.rm(thread.stub);
- delete thread.stub;
- }
- threadRoot = thread.OP.nodes.root.parentNode;
- threadRoot.hidden = thread.isHidden = false;
- if (Conf['JSON Index']) {
- return Index.updateHideLabel();
- }
- }
- };
-
- QuoteBacklink = {
- containers: {},
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) {
- return;
- }
- Post.callbacks.push({
- name: 'Quote Backlinking Part 1',
- cb: this.firstNode
- });
- return Post.callbacks.push({
- name: 'Quote Backlinking Part 2',
- cb: this.secondNode
- });
- },
- firstNode: function() {
- var a, clone, container, containers, hash, k, len1, len2, len3, link, markYours, nodes, post, q, quote, ref, ref1, ref2, u;
- if (this.isClone || !this.quotes.length || this.isRebuilt) {
- return;
- }
- markYours = Conf['Mark Quotes of You'] && ((ref = QuoteYou.db) != null ? ref.get({
- boardID: this.board.ID,
- threadID: this.thread.ID,
- postID: this.ID
- }) : void 0);
- a = $.el('a', {
- href: Build.postURL(this.board.ID, this.thread.ID, this.ID),
- className: this.isHidden ? 'filtered backlink' : 'backlink',
- textContent: Conf['backlink'].replace(/%(?:id|%)/g, (function(_this) {
- return function(x) {
- return {
- '%id': _this.ID,
- '%%': '%'
- }[x];
- };
- })(this)) + (markYours ? '\u00A0(You)' : '')
- });
- ref1 = this.quotes;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- quote = ref1[k];
- containers = [QuoteBacklink.getContainer(quote)];
- if ((post = g.posts[quote]) && post.nodes.backlinkContainer) {
- ref2 = post.clones;
- for (q = 0, len2 = ref2.length; q < len2; q++) {
- clone = ref2[q];
- containers.push(clone.nodes.backlinkContainer);
- }
- }
- for (u = 0, len3 = containers.length; u < len3; u++) {
- container = containers[u];
- link = a.cloneNode(true);
- nodes = container.firstChild ? [$.tn(' '), link] : [link];
- if (Conf['Quote Previewing']) {
- $.on(link, 'mouseover', QuotePreview.mouseover);
- }
- if (Conf['Quote Inlining']) {
- $.on(link, 'click', QuoteInline.toggle);
- if (Conf['Quote Hash Navigation']) {
- hash = QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
- nodes.push(hash);
- }
- }
- $.add(container, nodes);
- }
- }
- },
- secondNode: function() {
- var container;
- if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
- this.nodes.backlinkContainer = $('.container', this.nodes.info);
- return;
- }
- if (!(this.isReply || Conf['OP Backlinks'])) {
- return;
- }
- container = QuoteBacklink.getContainer(this.fullID);
- this.nodes.backlinkContainer = container;
- return $.add(this.nodes.info, container);
- },
- getContainer: function(id) {
- var base1;
- return (base1 = this.containers)[id] || (base1[id] = $.el('span', {
- className: 'container'
- }));
- }
- };
-
- QuoteCT = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- this.text = '\u00A0(Cross-thread)';
- return Post.callbacks.push({
- name: 'Mark Cross-thread Quotes',
- cb: this.node
- });
- },
- node: function() {
- var board, boardID, k, len1, quotelink, ref, ref1, ref2, thread, threadID;
- if (this.isClone && this.thread === this.context.thread) {
- return;
- }
- ref = this.context, board = ref.board, thread = ref.thread;
- ref1 = this.nodes.quotelinks;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- quotelink = ref1[k];
- ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID;
- if (!threadID) {
- continue;
- }
- if (this.isClone) {
- quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, '');
- }
- if (boardID === board.ID && threadID !== thread.ID) {
- $.add(quotelink, $.tn(QuoteCT.text));
- }
- }
- }
- };
-
- QuoteInline = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- return Post.callbacks.push({
- name: 'Quote Inlining',
- cb: this.node
- });
- },
- node: function() {
- var isClone, k, len1, len2, link, process, q, ref, ref1;
- process = QuoteInline.process;
- isClone = this.isClone;
- ref = this.nodes.quotelinks;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- process(link, isClone);
- }
- ref1 = this.nodes.backlinks;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- link = ref1[q];
- process(link, isClone);
- }
- },
- process: function(link, clone) {
- if (Conf['Quote Hash Navigation']) {
- if (!clone) {
- $.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')));
- }
- }
- return $.on(link, 'click', QuoteInline.toggle);
- },
- qiQuote: function(link, hidden) {
- var name;
- name = "hashlink";
- if (hidden) {
- name += " filtered";
- }
- return $.el('a', {
- className: name,
- textContent: '#',
- href: link.href
- });
- },
- toggle: function(e) {
- var boardID, context, postID, quoter, ref, ref1, threadID;
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- if (Conf['Inline Cross-thread Quotes Only'] && g.VIEW === 'thread' && ((ref1 = g.posts[boardID + "." + postID]) != null ? ref1.nodes.root.offsetParent : void 0)) {
- return;
- }
- e.preventDefault();
- quoter = Get.postFromNode(this);
- context = quoter.context;
- if ($.hasClass(this, 'inlined')) {
- QuoteInline.rm(this, boardID, threadID, postID, context);
- } else {
- if ($.x("ancestor::div[@data-full-i-d='" + boardID + "." + postID + "']", this)) {
- return;
- }
- QuoteInline.add(this, boardID, threadID, postID, context, quoter);
- }
- return this.classList.toggle('inlined');
- },
- findRoot: function(quotelink, isBacklink) {
- if (isBacklink) {
- return quotelink.parentNode.parentNode;
- } else {
- return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink);
- }
- },
- add: function(quotelink, boardID, threadID, postID, context, quoter) {
- var inline, isBacklink, post, qroot, root;
- isBacklink = $.hasClass(quotelink, 'backlink');
- inline = $.el('div', {
- className: 'inline'
- });
- inline.dataset.fullID = boardID + "." + postID;
- root = QuoteInline.findRoot(quotelink, isBacklink);
- $.after(root, inline);
- qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
- $.addClass(qroot, 'hasInline');
- new Fetcher(boardID, threadID, postID, inline, quoter);
- if (!((post = g.posts[boardID + "." + postID]) && context.thread === post.thread)) {
- return;
- }
- if (isBacklink && Conf['Forward Hiding']) {
- $.addClass(post.nodes.root, 'forwarded');
- post.forwarded++ || (post.forwarded = 1);
- }
- if (!Unread.posts) {
- return;
- }
- return Unread.readSinglePost(post);
- },
- rm: function(quotelink, boardID, threadID, postID, context) {
- var el, inlined, isBacklink, post, qroot, ref, root;
- isBacklink = $.hasClass(quotelink, 'backlink');
- root = QuoteInline.findRoot(quotelink, isBacklink);
- root = $.x("following-sibling::div[@data-full-i-d='" + boardID + "." + postID + "'][1]", root);
- qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
- $.rm(root);
- if (!$('.inline', qroot)) {
- $.rmClass(qroot, 'hasInline');
- }
- if (!(el = root.firstElementChild)) {
- return;
- }
- post = g.posts[boardID + "." + postID];
- post.rmClone(el.dataset.clone);
- if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads[boardID + "." + threadID] && !--post.forwarded) {
- delete post.forwarded;
- $.rmClass(post.nodes.root, 'forwarded');
- }
- while (inlined = $('.inlined', el)) {
- ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- QuoteInline.rm(inlined, boardID, threadID, postID, context);
- $.rmClass(inlined, 'inlined');
- }
- }
- };
-
- QuoteOP = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- this.text = '\u00A0(OP)';
- return Post.callbacks.push({
- name: 'Mark OP Quotes',
- cb: this.node
- });
- },
- node: function() {
- var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1;
- if (this.isClone && this.thread === this.context.thread) {
- return;
- }
- if (!(quotes = this.quotes).length) {
- return;
- }
- quotelinks = this.nodes.quotelinks;
- if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) {
- i = 0;
- while (quotelink = quotelinks[i++]) {
- quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, '');
- }
- }
- fullID = this.context.thread.fullID;
- if (indexOf.call(quotes, fullID) < 0) {
- return;
- }
- i = 0;
- while (quotelink = quotelinks[i++]) {
- ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
- if ((boardID + "." + postID) === fullID) {
- $.add(quotelink, $.tn(QuoteOP.text));
- }
- }
- }
- };
-
- QuotePreview = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Quote Previewing'])) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- return Post.callbacks.push({
- name: 'Quote Previewing',
- cb: this.node
- });
- },
- node: function() {
- var k, len1, link, ref;
- ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- $.on(link, 'mouseover', QuotePreview.mouseover);
- }
- },
- mouseover: function(e) {
- var boardID, k, len1, origin, post, postID, posts, qp, ref, threadID;
- if ($.hasClass(this, 'inlined') || !d.contains(this)) {
- return;
- }
- ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- qp = $.el('div', {
- id: 'qp',
- className: 'dialog'
- });
- $.add(Header.hover, qp);
- new Fetcher(boardID, threadID, postID, qp, Get.postFromNode(this));
- UI.hover({
- root: this,
- el: qp,
- latestEvent: e,
- endEvents: 'mouseout click',
- cb: QuotePreview.mouseout
- });
- if (Conf['Quote Highlighting'] && (origin = g.posts[boardID + "." + postID])) {
- posts = [origin].concat(origin.clones);
- posts.pop();
- for (k = 0, len1 = posts.length; k < len1; k++) {
- post = posts[k];
- $.addClass(post.nodes.post, 'qphl');
- }
- }
- },
- mouseout: function() {
- var clone, k, len1, post, ref, root;
- if (!(root = this.el.firstElementChild)) {
- return;
- }
- clone = Get.postFromRoot(root);
- post = clone.origin;
- post.rmClone(root.dataset.clone);
- if (!Conf['Quote Highlighting']) {
- return;
- }
- ref = [post].concat(post.clones);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post = ref[k];
- $.rmClass(post.nodes.post, 'qphl');
- }
- }
- };
-
- QuoteStrikeThrough = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
- return;
- }
- return Post.callbacks.push({
- name: 'Strike-through Quotes',
- cb: this.node
- });
- },
- node: function() {
- var boardID, k, len1, postID, quotelink, ref, ref1, ref2;
- if (this.isClone) {
- return;
- }
- ref = this.nodes.quotelinks;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
- if ((ref2 = g.posts[boardID + "." + postID]) != null ? ref2.isHidden : void 0) {
- $.addClass(quotelink, 'filtered');
- }
- }
- }
- };
-
-
- /*
- <3 aeosynth
- */
-
- QuoteThreading = {
- init: function() {
- if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
- return;
- }
- this.controls = $.el('label', {
- innerHTML: " Threading"
- });
- this.threadNewLink = $.el('span', {
- className: 'brackets-wrap threadnewlink',
- hidden: true
- });
- $.extend(this.threadNewLink, {
- innerHTML: "Thread New Posts "
- });
- this.input = $('input', this.controls);
- this.input.checked = Conf['Thread Quotes'];
- $.on(this.input, 'change', this.setEnabled);
- $.on(this.input, 'change', this.rethread);
- $.on(this.threadNewLink.firstElementChild, 'click', this.rethread);
- $.on(d, '4chanXInitFinished', (function(_this) {
- return function() {
- return _this.ready = true;
- };
- })(this));
- Header.menu.addEntry(this.entry = {
- el: this.controls,
- order: 99
- });
- Thread.callbacks.push({
- name: 'Quote Threading',
- cb: this.setThread
- });
- return Post.callbacks.push({
- name: 'Quote Threading',
- cb: this.node
- });
- },
- parent: {},
- children: {},
- inserted: {},
- setEnabled: function() {
- var other, ref;
- other = (ref = ReplyPruning.inputs) != null ? ref.enabled : void 0;
- if (this.checked && (other != null ? other.checked : void 0)) {
- other.checked = false;
- $.event('change', null, other);
- }
- return $.cb.checked.call(this);
- },
- setThread: function() {
- QuoteThreading.thread = this;
- return $.asap((function() {
- return !Conf['Thread Updater'] || $('.navLinksBot > .updatelink');
- }), function() {
- var navLinksBot;
- if ((navLinksBot = $('.navLinksBot'))) {
- return $.add(navLinksBot, [$.tn(' '), QuoteThreading.threadNewLink]);
- }
- });
- },
- node: function() {
- var ancestor, k, lastParent, len1, parent, parents, quote, ref;
- if (this.isFetchedQuote || this.isClone || !this.isReply) {
- return;
- }
- parents = new Set();
- lastParent = null;
- ref = this.quotes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- if (parent = g.posts[quote]) {
- if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) {
- parents.add(parent.ID);
- if (!lastParent || parent.ID > lastParent.ID) {
- lastParent = parent;
- }
- }
- }
- }
- if (!lastParent) {
- return;
- }
- ancestor = lastParent;
- while (ancestor = QuoteThreading.parent[ancestor.fullID]) {
- parents["delete"](ancestor.ID);
- }
- if (parents.size === 1) {
- return QuoteThreading.parent[this.fullID] = lastParent;
- }
- },
- descendants: function(post) {
- var child, children, k, len1, posts;
- posts = [post];
- if (children = QuoteThreading.children[post.fullID]) {
- for (k = 0, len1 = children.length; k < len1; k++) {
- child = children[k];
- posts = posts.concat(QuoteThreading.descendants(child));
- }
- }
- return posts;
- },
- insert: function(post) {
- var base1, child, children, descendants, i, k, len1, name1, next, nodes, order, parent, prev, prev2, q, threadContainer, u, x;
- if (!(Conf['Thread Quotes'] && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) {
- return false;
- }
- descendants = QuoteThreading.descendants(post);
- if (!Unread.posts.has(parent.ID)) {
- if ((function() {
- var k, len1, x;
- for (k = 0, len1 = descendants.length; k < len1; k++) {
- x = descendants[k];
- if (Unread.posts.has(x.ID)) {
- return true;
- }
- }
- })()) {
- QuoteThreading.threadNewLink.hidden = false;
- return false;
- }
- }
- order = Unread.order;
- children = ((base1 = QuoteThreading.children)[name1 = parent.fullID] || (base1[name1] = []));
- threadContainer = parent.nodes.threadContainer || $.el('div', {
- className: 'threadContainer'
- });
- nodes = [post.nodes.root];
- if (post.nodes.threadContainer) {
- nodes.push(post.nodes.threadContainer);
- }
- i = children.length;
- for (k = children.length - 1; k >= 0; k += -1) {
- child = children[k];
- if (child.ID >= post.ID) {
- i--;
- }
- }
- if (i !== children.length) {
- next = children[i];
- for (q = 0, len1 = descendants.length; q < len1; q++) {
- x = descendants[q];
- order.before(order[next.ID], order[x.ID]);
- }
- children.splice(i, 0, post);
- $.before(next.nodes.root, nodes);
- } else {
- prev = parent;
- while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
- prev = prev2[prev2.length - 1];
- }
- for (u = descendants.length - 1; u >= 0; u += -1) {
- x = descendants[u];
- order.after(order[prev.ID], order[x.ID]);
- }
- children.push(post);
- $.add(threadContainer, nodes);
- }
- QuoteThreading.inserted[post.fullID] = true;
- if (!parent.nodes.threadContainer) {
- parent.nodes.threadContainer = threadContainer;
- $.addClass(parent.nodes.root, 'threadOP');
- $.after(parent.nodes.root, threadContainer);
- }
- return true;
- },
- rethread: function() {
- var nodes, posts, thread;
- if (!QuoteThreading.ready) {
- return;
- }
- thread = QuoteThreading.thread;
- posts = thread.posts;
- QuoteThreading.threadNewLink.hidden = true;
- if (Conf['Thread Quotes']) {
- posts.forEach(QuoteThreading.insert);
- } else {
- nodes = [];
- Unread.order = new RandomAccessList();
- QuoteThreading.inserted = {};
- posts.forEach(function(post) {
- if (post.isFetchedQuote) {
- return;
- }
- Unread.order.push(post);
- if (post.isReply) {
- nodes.push(post.nodes.root);
- }
- if (QuoteThreading.children[post.fullID]) {
- delete QuoteThreading.children[post.fullID];
- $.rmClass(post.nodes.root, 'threadOP');
- $.rm(post.nodes.threadContainer);
- return delete post.nodes.threadContainer;
- }
- });
- $.add(thread.OP.nodes.root.parentNode, nodes);
- }
- Unread.position = Unread.order.first;
- Unread.updatePosition();
- Unread.setLine(true);
- Unread.read();
- return Unread.update();
- }
- };
-
- QuoteYou = {
- init: function() {
- var ref;
- if (!Conf['Remember Your Posts']) {
- return;
- }
- this.db = new DataBoard('yourPosts');
- $.sync('Remember Your Posts', function(enabled) {
- return Conf['Remember Your Posts'] = enabled;
- });
- $.on(d, 'QRPostSuccessful', function(e) {
- var boardID, postID, ref, threadID;
- $.forceSync('Remember Your Posts');
- if (Conf['Remember Your Posts']) {
- ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- return QuoteYou.db.set({
- boardID: boardID,
- threadID: threadID,
- postID: postID,
- val: true
- });
- }
- });
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- if (Conf['Highlight Own Posts']) {
- $.addClass(doc, 'highlight-own');
- }
- if (Conf['Highlight Posts Quoting You']) {
- $.addClass(doc, 'highlight-you');
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- this.text = '\u00A0(You)';
- return Post.callbacks.push({
- name: 'Mark Quotes of You',
- cb: this.node
- });
- },
- node: function() {
- var k, len1, quotelink, ref;
- if (this.isClone) {
- return;
- }
- if (QuoteYou.db.get({
- boardID: this.board.ID,
- threadID: this.thread.ID,
- postID: this.ID
- })) {
- $.addClass(this.nodes.root, 'yourPost');
- }
- if (!this.quotes.length) {
- return;
- }
- ref = this.nodes.quotelinks;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) {
- continue;
- }
- if (Conf['Mark Quotes of You']) {
- $.add(quotelink, $.tn(QuoteYou.text));
- }
- $.addClass(quotelink, 'you');
- $.addClass(this.nodes.root, 'quotesYou');
- }
- },
- cb: {
- seek: function(type) {
- var highlight, post, posts, result, str;
- if (highlight = $('.highlight')) {
- $.rmClass(highlight, 'highlight');
- }
- if (!(QuoteYou.lastRead && doc.contains(QuoteYou.lastRead) && $.hasClass(QuoteYou.lastRead, 'quotesYou'))) {
- if (!(post = QuoteYou.lastRead = $('.quotesYou'))) {
- new Notice('warning', 'No posts are currently quoting you, loser.', 20);
- return;
- }
- if (QuoteYou.cb.scroll(post)) {
- return;
- }
- } else {
- post = QuoteYou.lastRead;
- }
- str = type + "::div[contains(@class,'quotesYou')]";
- while ((post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0))) {
- if (QuoteYou.cb.scroll(post)) {
- return;
- }
- }
- posts = $$('.quotesYou');
- return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]);
- },
- scroll: function(root) {
- var post;
- post = $('.post', root);
- if (!post.getBoundingClientRect().height) {
- return false;
- } else {
- QuoteYou.lastRead = root;
- window.location = "#" + post.id;
- Header.scrollTo(post);
- $.addClass(post, 'highlight');
- return true;
- }
- }
- }
- };
-
- Quotify = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- return Post.callbacks.push({
- name: 'Resurrect Quotes',
- cb: this.node
- });
- },
- node: function() {
- var deadlink, k, len1, ref;
- if (this.isClone) {
- return;
- }
- ref = $$('.deadlink', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- deadlink = ref[k];
- Quotify.parseDeadlink.call(this, deadlink);
- }
- },
- parseDeadlink: function(deadlink) {
- var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref;
- if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
- Quotify.fixDeadlink(deadlink);
- return;
- }
- quote = deadlink.textContent;
- if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) {
- return;
- }
- if (postID[0] === '0') {
- Quotify.fixDeadlink(deadlink);
- return;
- }
- boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID;
- quoteID = boardID + "." + postID;
- if (post = g.posts[quoteID]) {
- if (!post.isDead) {
- a = $.el('a', {
- href: Build.postURL(boardID, post.thread.ID, postID),
- className: 'quotelink',
- textContent: quote
- });
- } else {
- a = $.el('a', {
- href: Build.postURL(boardID, post.thread.ID, postID),
- className: 'quotelink deadlink',
- textContent: quote + "\u00A0(Dead)"
- });
- $.extend(a.dataset, {
- boardID: boardID,
- threadID: post.thread.ID,
- postID: postID
- });
- }
- } else {
- redirect = Redirect.to('thread', {
- boardID: boardID,
- threadID: 0,
- postID: postID
- });
- fetchable = Redirect.to('post', {
- boardID: boardID,
- postID: postID
- });
- if (redirect || fetchable) {
- a = $.el('a', {
- href: redirect || 'javascript:;',
- className: 'deadlink',
- textContent: quote + "\u00A0(Dead)"
- });
- if (fetchable) {
- $.addClass(a, 'quotelink');
- $.extend(a.dataset, {
- boardID: boardID,
- postID: postID
- });
- }
- }
- }
- if (indexOf.call(this.quotes, quoteID) < 0) {
- this.quotes.push(quoteID);
- }
- if (!a) {
- deadlink.textContent = quote + "\u00A0(Dead)";
- return;
- }
- $.replace(deadlink, a);
- if ($.hasClass(a, 'quotelink')) {
- return this.nodes.quotelinks.push(a);
- }
- },
- fixDeadlink: function(deadlink) {
- var el, green;
- if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') {
- green = $.el('span', {
- className: 'quote'
- });
- $.before(deadlink, green);
- $.add(green, deadlink);
- }
- return $.replace(deadlink, slice.call(deadlink.childNodes));
- }
- };
-
- QR = {
- mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'],
- validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i,
- typeFromExtension: {
- 'jpg': 'image/jpeg',
- 'jpeg': 'image/jpeg',
- 'png': 'image/png',
- 'gif': 'image/gif',
- 'pdf': 'application/pdf',
- 'swf': 'application/vnd.adobe.flash.movie',
- 'webm': 'video/webm'
- },
- extensionFromType: {
- 'image/jpeg': 'jpg',
- 'image/png': 'png',
- 'image/gif': 'gif',
- 'application/pdf': 'pdf',
- 'application/vnd.adobe.flash.movie': 'swf',
- 'application/x-shockwave-flash': 'swf',
- 'video/webm': 'webm'
- },
- init: function() {
- var sc, version;
- if (!Conf['Quick Reply']) {
- return;
- }
- this.posts = [];
- if (g.VIEW === 'archive') {
- return;
- }
- version = Conf['Use Recaptcha v1'] && Main.jsEnabled ? 'v1' : 'v2';
- this.captcha = Captcha[version];
- $.on(d, '4chanXInitFinished', this.initReady);
- Post.callbacks.push({
- name: 'Quick Reply',
- cb: this.node
- });
- if (Conf['QR Shortcut']) {
- this.shortcut = sc = $.el('a', {
- className: 'qr-shortcut fa fa-comment-o disabled',
- textContent: 'QR',
- title: 'Quick Reply',
- href: 'javascript:;'
- });
- $.on(sc, 'click', function() {
- if (!QR.postingIsEnabled) {
- return;
- }
- if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) {
- QR.open();
- return QR.nodes.com.focus();
- } else {
- return QR.close();
- }
- });
- return Header.addShortcut(sc);
- }
- },
- initReady: function() {
- var link, linkBot, navLinksBot, origToggle;
- $.off(d, '4chanXInitFinished', this.initReady);
- QR.postingIsEnabled = !!$.id('postForm');
- if (!QR.postingIsEnabled) {
- return;
- }
- link = $.el('h1', {
- className: "qr-link-container"
- });
- $.extend(link, {
- innerHTML: "" + (g.VIEW === "thread" ? "Reply to Thread" : "Start a Thread") + " "
- });
- QR.link = link.firstElementChild;
- $.on(link.firstChild, 'click', function() {
- QR.open();
- return QR.nodes.com.focus();
- });
- if (Conf['Bottom QR Link'] && g.VIEW === 'thread') {
- linkBot = $.el('div', {
- className: "brackets-wrap qr-link-container-bottom"
- });
- $.extend(linkBot, {
- innerHTML: "Reply to Thread "
- });
- $.on(linkBot.firstElementChild, 'click', function() {
- QR.open();
- return QR.nodes.com.focus();
- });
- if ((navLinksBot = $('.navLinksBot'))) {
- $.prepend(navLinksBot, linkBot);
- }
- }
- origToggle = $.id('togglePostFormLink');
- $.before(origToggle, link);
- origToggle.firstElementChild.textContent = 'Original Form';
- $.on(d, 'QRGetFile', QR.getFile);
- $.on(d, 'QRSetFile', QR.setFile);
- $.on(d, 'paste', QR.paste);
- $.on(d, 'dragover', QR.dragOver);
- $.on(d, 'drop', QR.dropFile);
- $.on(d, 'dragstart dragend', QR.drag);
- $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
- $.on(d, 'ThreadUpdate', QR.statusCheck);
- if (!Conf['Persistent QR']) {
- return;
- }
- QR.open();
- if (Conf['Auto Hide QR']) {
- return QR.hide();
- }
- },
- statusCheck: function() {
- var thread;
- if (!QR.nodes) {
- return;
- }
- thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
- return QR.abort();
- } else {
- return QR.status();
- }
- },
- node: function() {
- $.on(this.nodes.quote, 'click', QR.quote);
- if (this.isFetchedQuote) {
- return QR.generatePostableThreadsList();
- }
- },
- open: function() {
- var err;
- if (QR.nodes) {
- if (QR.nodes.el.hidden) {
- QR.captcha.setup();
- }
- QR.nodes.el.hidden = false;
- QR.unhide();
- } else {
- try {
- QR.dialog();
- } catch (_error) {
- err = _error;
- delete QR.nodes;
- Main.handleErrors({
- message: 'Quick Reply dialog creation crashed.',
- error: err
- });
- return;
- }
- }
- if (Conf['QR Shortcut']) {
- return $.rmClass(QR.shortcut, 'disabled');
- }
- },
- close: function() {
- var k, len1, post, ref;
- if (QR.req) {
- QR.abort();
- return;
- }
- QR.nodes.el.hidden = true;
- QR.cleanNotifications();
- d.activeElement.blur();
- $.rmClass(QR.nodes.el, 'dump');
- if (Conf['QR Shortcut']) {
- $.addClass(QR.shortcut, 'disabled');
- }
- new QR.post(true);
- ref = QR.posts.splice(0, QR.posts.length - 1);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post = ref[k];
- post["delete"]();
- }
- QR.cooldown.auto = false;
- QR.status();
- return QR.captcha.destroy();
- },
- focus: function() {
- return $.queueTask(function() {
- if (!QR.inBubble()) {
- QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement);
- return QR.nodes.el.classList.toggle('focus', QR.hasFocus);
- }
- });
- },
- inBubble: function() {
- var bubbles, ref;
- bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
- return (ref = d.activeElement, indexOf.call(bubbles, ref) >= 0) || bubbles.some(function(el) {
- return getComputedStyle(el).visibility !== 'hidden' && el.getBoundingClientRect().bottom > 0;
- });
- },
- hide: function() {
- d.activeElement.blur();
- $.addClass(QR.nodes.el, 'autohide');
- return QR.nodes.autohide.checked = true;
- },
- unhide: function() {
- $.rmClass(QR.nodes.el, 'autohide');
- return QR.nodes.autohide.checked = false;
- },
- toggleHide: function() {
- if (this.checked) {
- return QR.hide();
- } else {
- return QR.unhide();
- }
- },
- toggleSJIS: function(e) {
- e.preventDefault();
- Conf['sjisPreview'] = !Conf['sjisPreview'];
- $.set('sjisPreview', Conf['sjisPreview']);
- return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']);
- },
- texPreviewShow: function() {
- if ($.hasClass(QR.nodes.el, 'tex-preview')) {
- return QR.texPreviewHide();
- }
- $.addClass(QR.nodes.el, 'tex-preview');
- QR.nodes.texPreview.textContent = QR.nodes.com.value;
- return $.event('mathjax', null, QR.nodes.texPreview);
- },
- texPreviewHide: function() {
- return $.rmClass(QR.nodes.el, 'tex-preview');
- },
- setCustomCooldown: function(enabled) {
- Conf['customCooldownEnabled'] = enabled;
- QR.cooldown.customCooldown = enabled;
- return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);
- },
- toggleCustomCooldown: function() {
- var enabled;
- enabled = $.hasClass(this, 'disabled');
- QR.setCustomCooldown(enabled);
- return $.set('customCooldownEnabled', enabled);
- },
- error: function(err, focusOverride) {
- var el, notice, notif;
- QR.open();
- if (typeof err === 'string') {
- el = $.tn(err);
- } else {
- el = err;
- el.removeAttribute('style');
- }
- notice = new Notice('warning', el);
- QR.notifications.push(notice);
- if (!Header.areNotificationsEnabled) {
- if (d.hidden && !QR.cooldown.auto) {
- return alert(el.textContent);
- }
- } else if (d.hidden || !(focusOverride || d.hasFocus())) {
- try {
- notif = new Notification(el.textContent, {
- body: el.textContent,
- icon: Favicon.logo
- });
- notif.onclick = function() {
- return $.global(function() {
- return window.focus();
- });
- };
- if ($.engine !== 'gecko') {
- notif.onclose = function() {
- return notice.close();
- };
- return notif.onshow = function() {
- return setTimeout(function() {
- notif.onclose = null;
- return notif.close();
- }, 7 * $.SECOND);
- };
- }
- } catch (_error) {}
- }
- },
- notifications: [],
- cleanNotifications: function() {
- var k, len1, notification, ref;
- ref = QR.notifications;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- notification = ref[k];
- notification.close();
- }
- return QR.notifications = [];
- },
- status: function() {
- var disabled, status, thread, value;
- if (!QR.nodes) {
- return;
- }
- thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
- value = 'Dead';
- disabled = true;
- QR.cooldown.auto = false;
- }
- value = QR.req ? QR.req.progress : QR.cooldown.seconds || value;
- status = QR.nodes.status;
- status.value = !value ? 'Submit' : QR.cooldown.auto ? "Auto " + value : value;
- return status.disabled = disabled || false;
- },
- openPost: function() {
- var index;
- QR.open();
- if (QR.selected.isLocked) {
- index = QR.posts.indexOf(QR.selected);
- (QR.posts[index + 1] || new QR.post()).select();
- $.addClass(QR.nodes.el, 'dump');
- return QR.cooldown.auto = true;
- }
- },
- quote: function(e) {
- var aa, ancestor, caretPos, com, frag, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, v, z;
- if (e != null) {
- e.preventDefault();
- }
- if (!QR.postingIsEnabled) {
- return;
- }
- sel = d.getSelection();
- post = Get.postFromNode(this);
- text = post.board.ID === g.BOARD.ID ? ">>" + post + "\n" : ">>>/" + post.board + "/" + post + "\n";
- if (sel.toString().trim() && post === Get.postFromNode(sel.anchorNode)) {
- range = sel.getRangeAt(0);
- frag = range.cloneContents();
- ancestor = range.commonAncestorContainer;
- if ($.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) {
- $.prepend(frag, $.tn('[spoiler]'));
- $.add(frag, $.tn('[/spoiler]'));
- }
- if (insideCode = $.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) {
- $.prepend(frag, $.tn('[code]'));
- $.add(frag, $.tn('[/code]'));
- }
- ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- node = ref[k];
- $.replace(node, $.tn('\n'));
- }
- ref1 = $$('br', frag);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- node = ref1[q];
- if (node !== frag.lastChild) {
- $.replace(node, $.tn('\n>'));
- }
- }
- ref2 = $$('s, .removed-spoiler', frag);
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- node = ref2[u];
- $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')]));
- }
- ref3 = $$('.prettyprint', frag);
- for (v = 0, len4 = ref3.length; v < len4; v++) {
- node = ref3[v];
- $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')]));
- }
- ref4 = $$('.linkify[data-original]', frag);
- for (z = 0, len5 = ref4.length; z < len5; z++) {
- node = ref4[z];
- $.replace(node, $.tn(node.dataset.original));
- }
- ref5 = $$('.embedder', frag);
- for (aa = 0, len6 = ref5.length; aa < len6; aa++) {
- node = ref5[aa];
- if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') {
- $.rm(node.previousSibling);
- }
- $.rm(node);
- }
- text += ">" + (frag.textContent.trim()) + "\n";
- }
- QR.openPost();
- ref7 = QR.nodes, com = ref7.com, thread = ref7.thread;
- if (!com.value) {
- thread.value = Get.threadFromNode(this);
- }
- caretPos = com.selectionStart;
- com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
- range = caretPos + text.length;
- com.setSelectionRange(range, range);
- com.focus();
- QR.selected.save(com);
- return QR.selected.save(thread);
- },
- characterCount: function() {
- var count, counter;
- counter = QR.nodes.charCount;
- count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
- counter.textContent = count;
- counter.hidden = count < QR.max_comment / 2;
- return (count > QR.max_comment ? $.addClass : $.rmClass)(counter, 'warning');
- },
- getFile: function() {
- var ref;
- return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0);
- },
- setFile: function(e) {
- var file, name, ref, source;
- ref = e.detail, file = ref.file, name = ref.name, source = ref.source;
- if (name != null) {
- file.name = name;
- }
- if (source != null) {
- file.source = source;
- }
- QR.open();
- return QR.handleFiles([file]);
- },
- drag: function(e) {
- var toggle;
- toggle = e.type === 'dragstart' ? $.off : $.on;
- toggle(d, 'dragover', QR.dragOver);
- return toggle(d, 'drop', QR.dropFile);
- },
- dragOver: function(e) {
- e.preventDefault();
- return e.dataTransfer.dropEffect = 'copy';
- },
- dropFile: function(e) {
- if (!e.dataTransfer.files.length) {
- return;
- }
- e.preventDefault();
- QR.open();
- return QR.handleFiles(e.dataTransfer.files);
- },
- paste: function(e) {
- var blob, files, item, k, len1, ref;
- if (!e.clipboardData.items) {
- return;
- }
- files = [];
- ref = e.clipboardData.items;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- item = ref[k];
- if (!(item.kind === 'file')) {
- continue;
- }
- blob = item.getAsFile();
- blob.name = 'file';
- if (blob.type) {
- blob.name += '.' + blob.type.split('/')[1];
- }
- files.push(blob);
- }
- if (!files.length) {
- return;
- }
- QR.open();
- QR.handleFiles(files);
- return $.addClass(QR.nodes.el, 'dump');
- },
- pasteFF: function() {
- var arr, blob, bstr, i, images, img, k, len1, m, pasteArea, q, ref, src;
- pasteArea = QR.nodes.pasteArea;
- if (!pasteArea.childNodes.length) {
- return;
- }
- images = $$('img', pasteArea);
- $.rmAll(pasteArea);
- for (k = 0, len1 = images.length; k < len1; k++) {
- img = images[k];
- src = img.src;
- if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) {
- bstr = atob(m[3]);
- arr = new Uint8Array(bstr.length);
- for (i = q = 0, ref = bstr.length; 0 <= ref ? q < ref : q > ref; i = 0 <= ref ? ++q : --q) {
- arr[i] = bstr.charCodeAt(i);
- }
- blob = new Blob([arr], {
- type: m[1]
- });
- blob.name = "file." + m[2];
- QR.handleFiles([blob]);
- } else if (/^https?:\/\//.test(src)) {
- QR.handleUrl(src);
- }
- }
- },
- handleUrl: function(urlDefault) {
- var url;
- url = prompt('Enter a URL:', urlDefault);
- if (url === null) {
- return;
- }
- QR.nodes.fileButton.focus();
- return CrossOrigin.file(url, function(blob) {
- if (blob && !/^text\//.test(blob.type)) {
- return QR.handleFiles([blob]);
- } else {
- return QR.error("Can't load file.");
- }
- });
- },
- handleFiles: function(files) {
- var file, k, len1;
- if (this !== QR) {
- files = slice.call(this.files);
- this.value = null;
- }
- if (!files.length) {
- return;
- }
- QR.cleanNotifications();
- for (k = 0, len1 = files.length; k < len1; k++) {
- file = files[k];
- QR.handleFile(file, files.length);
- }
- if (files.length !== 1) {
- $.addClass(QR.nodes.el, 'dump');
- }
- if (d.activeElement === QR.nodes.fileButton && $.hasClass(QR.nodes.fileSubmit, 'has-file')) {
- return QR.nodes.filename.focus();
- }
- },
- handleFile: function(file, nfiles) {
- var isText, post;
- isText = /^text\//.test(file.type);
- if (nfiles === 1) {
- post = QR.selected;
- } else {
- post = QR.posts[QR.posts.length - 1];
- if ((isText ? post.com || post.pasting : post.file)) {
- post = new QR.post();
- }
- }
- return post[isText ? 'pasteText' : 'setFile'](file);
- },
- openFileInput: function() {
- if (QR.nodes.fileButton.disabled) {
- return;
- }
- QR.nodes.fileInput.click();
- return QR.nodes.fileButton.focus();
- },
- generatePostableThreadsList: function() {
- var k, len1, list, options, ref, thread, val;
- if (!QR.nodes) {
- return;
- }
- list = QR.nodes.thread;
- options = [list.firstElementChild];
- ref = g.BOARD.threads.keys;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- thread = ref[k];
- options.push($.el('option', {
- value: thread,
- textContent: "Thread " + thread
- }));
- }
- val = list.value;
- $.rmAll(list);
- $.add(list, options);
- list.value = val;
- if (list.value === val) {
- return;
- }
- list.value = g.VIEW === 'thread' ? g.THREADID : 'new';
- return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
- },
- dialog: function() {
- var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, scriptData, setNode;
- QR.nodes = nodes = {
- el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
- innerHTML: "∀ TE X
Width: Height:
Hentai Porn Japanese Anime Game Loop Other "
- })
- };
- setNode = function(name, query) {
- return nodes[name] = $(query, dialog);
- };
- setNode('move', '.move');
- setNode('autohide', '#autohide');
- setNode('close', '.close');
- setNode('thread', 'select');
- setNode('form', 'form');
- setNode('sjisToggle', '#sjis-toggle');
- setNode('texButton', '#tex-preview-button');
- setNode('name', '[data-name=name]');
- setNode('email', '[data-name=email]');
- setNode('sub', '[data-name=sub]');
- setNode('com', '[data-name=com]');
- setNode('charCount', '#char-count');
- setNode('texPreview', '#tex-preview');
- setNode('dumpList', '#dump-list');
- setNode('addPost', '#add-post');
- setNode('oekaki', '.oekaki');
- setNode('drawButton', '#qr-draw-button');
- setNode('fileSubmit', '#file-n-submit');
- setNode('fileButton', '#qr-file-button');
- setNode('noFile', '#qr-no-file');
- setNode('filename', '#qr-filename');
- setNode('spoiler', '#qr-file-spoiler');
- setNode('oekakiButton', '#qr-oekaki-button');
- setNode('fileRM', '#qr-filerm');
- setNode('urlButton', '#url-button');
- setNode('pasteArea', '#paste-area');
- setNode('customCooldown', '#custom-cooldown-button');
- setNode('dumpButton', '#dump-button');
- setNode('status', '[type=submit]');
- setNode('flashTag', '[name=filetag]');
- setNode('fileInput', '[type=file]');
- rules = $('ul.rules').textContent.trim();
- match_min = rules.match(/.+smaller than (\d+)x(\d+).+/);
- match_max = rules.match(/.+greater than (\d+)x(\d+).+/);
- QR.min_width = +(match_min != null ? match_min[1] : void 0) || 1;
- QR.min_height = +(match_min != null ? match_min[2] : void 0) || 1;
- QR.max_width = +(match_max != null ? match_max[1] : void 0) || 10000;
- QR.max_height = +(match_max != null ? match_max[2] : void 0) || 10000;
- scriptData = Get.scriptData();
- QR.max_size = (m = scriptData.match(/\bmaxFilesize *= *(\d+)\b/)) ? +m[1] : 4194304;
- QR.max_size_video = (m = scriptData.match(/\bmaxWebmFilesize *= *(\d+)\b/)) ? +m[1] : QR.max_size;
- QR.max_comment = (m = scriptData.match(/\bcomlen *= *(\d+)\b/)) ? +m[1] : 2000;
- QR.max_width_video = QR.max_height_video = 2048;
- QR.max_duration_video = (ref = g.BOARD.ID) === 'gif' || ref === 'wsg' ? 300 : 120;
- if (Conf['Show New Thread Option in Threads']) {
- $.addClass(QR.nodes.el, 'show-new-thread-option');
- }
- if (Conf['Show Name and Subject']) {
- $.addClass(QR.nodes.name, 'force-show');
- $.addClass(QR.nodes.sub, 'force-show');
- QR.nodes.email.placeholder = 'E-mail';
- }
- QR.forcedAnon = !!$('form[name="post"] input[name="name"][type="hidden"]');
- if (QR.forcedAnon) {
- $.addClass(QR.nodes.el, 'forced-anon');
- }
- QR.spoiler = !!$('.postForm input[name=spoiler]');
- if (QR.spoiler) {
- $.addClass(QR.nodes.el, 'has-spoiler');
- }
- if (g.BOARD.ID === 'jp' && Conf['sjisPreview']) {
- $.addClass(QR.nodes.el, 'sjis-preview');
- }
- if (parseInt(Conf['customCooldown'], 10) > 0) {
- $.addClass(QR.nodes.fileSubmit, 'custom-cooldown');
- $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) {
- var customCooldownEnabled;
- customCooldownEnabled = arg.customCooldownEnabled;
- QR.setCustomCooldown(customCooldownEnabled);
- return $.sync('customCooldownEnabled', QR.setCustomCooldown);
- });
- }
- $.on(nodes.autohide, 'change', QR.toggleHide);
- $.on(nodes.close, 'click', QR.close);
- $.on(nodes.form, 'submit', QR.submit);
- $.on(nodes.sjisToggle, 'click', QR.toggleSJIS);
- $.on(nodes.texButton, 'mousedown', QR.texPreviewShow);
- $.on(nodes.texButton, 'mouseup', QR.texPreviewHide);
- $.on(nodes.addPost, 'click', function() {
- return new QR.post(true);
- });
- $.on(nodes.drawButton, 'click', QR.oekaki.draw);
- $.on(nodes.fileButton, 'click', QR.openFileInput);
- $.on(nodes.noFile, 'click', QR.openFileInput);
- $.on(nodes.filename, 'focus', function() {
- return $.addClass(this.parentNode, 'focus');
- });
- $.on(nodes.filename, 'blur', function() {
- return $.rmClass(this.parentNode, 'focus');
- });
- $.on(nodes.spoiler, 'change', function() {
- return QR.selected.nodes.spoiler.click();
- });
- $.on(nodes.oekakiButton, 'click', QR.oekaki.button);
- $.on(nodes.fileRM, 'click', function() {
- return QR.selected.rmFile();
- });
- $.on(nodes.urlButton, 'click', function() {
- return QR.handleUrl('');
- });
- $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);
- $.on(nodes.dumpButton, 'click', function() {
- return nodes.el.classList.toggle('dump');
- });
- $.on(nodes.fileInput, 'change', QR.handleFiles);
- window.addEventListener('focus', QR.focus, true);
- window.addEventListener('blur', QR.focus, true);
- $.on(d, 'click', QR.focus);
- if ($.engine === 'gecko') {
- nodes.pasteArea.hidden = false;
- new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {
- childList: true
- });
- }
- items = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
- i = 0;
- save = function() {
- return QR.selected.save(this);
- };
- while (name = items[i++]) {
- if (!(node = nodes[name])) {
- continue;
- }
- event = node.nodeName === 'SELECT' ? 'change' : 'input';
- $.on(nodes[name], event, save);
- }
- if ($.engine === 'gecko' && Conf['Remember QR Size']) {
- $.get('QR Size', '', function(item) {
- return nodes.com.style.cssText = item['QR Size'];
- });
- $.on(nodes.com, 'mouseup', function(e) {
- if (e.button !== 0) {
- return;
- }
- return $.set('QR Size', this.style.cssText);
- });
- }
- QR.generatePostableThreadsList();
- QR.persona.init();
- new QR.post(true);
- QR.status();
- QR.cooldown.setup();
- QR.captcha.init();
- $.add(d.body, dialog);
- QR.captcha.setup();
- QR.oekaki.setup();
- return $.event('QRDialogCreation', null, dialog);
- },
- submit: function(e) {
- var captcha, cb, err, extra, filetag, formData, options, post, ref, textOnly, thread, threadID;
- if (e != null) {
- e.preventDefault();
- }
- if (QR.req) {
- QR.abort();
- return;
- }
- if (QR.cooldown.seconds) {
- QR.cooldown.auto = !QR.cooldown.auto;
- QR.status();
- return;
- }
- post = QR.posts[0];
- post.forceSave();
- threadID = post.thread;
- thread = g.BOARD.threads[threadID];
- if (g.BOARD.ID === 'f' && threadID === 'new') {
- filetag = QR.nodes.flashTag.value;
- }
- if (threadID === 'new') {
- threadID = null;
- if (g.BOARD.ID === 'vg' && !post.sub) {
- err = 'New threads require a subject.';
- } else if (!($.hasClass(d.body, 'text_only') || post.file || (textOnly = !!$('input[name=textonly]', $.id('postForm'))))) {
- err = 'No file selected.';
- }
- } else if (g.BOARD.threads[threadID].isClosed) {
- err = 'You can\'t reply to this thread anymore.';
- } else if (!(post.com || post.file)) {
- err = 'No comment or file.';
- } else if (post.file && thread.fileLimit) {
- err = 'Max limit of image replies has been reached.';
- }
- if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
- err || (err = 'Original comment required.');
- }
- if (QR.captcha.isEnabled && !err) {
- captcha = QR.captcha.getOne();
- if (!captcha) {
- err = 'No valid captcha.';
- QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
- }
- }
- QR.cleanNotifications();
- if (err) {
- QR.cooldown.auto = false;
- QR.status();
- QR.error(err);
- return;
- }
- QR.cooldown.auto = QR.posts.length > 1;
- if (Conf['Auto Hide QR'] && !QR.cooldown.auto) {
- QR.hide();
- }
- if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) {
- d.activeElement.blur();
- }
- post.lock();
- formData = {
- resto: threadID,
- name: !QR.forcedAnon ? post.name : void 0,
- email: post.email,
- sub: !(QR.forcedAnon || threadID) ? post.sub : void 0,
- com: post.com,
- upfile: post.file,
- filetag: filetag,
- spoiler: post.spoiler,
- textonly: textOnly,
- mode: 'regist',
- pwd: QR.persona.pwd
- };
- options = {
- responseType: 'document',
- withCredentials: true,
- onload: QR.response,
- onerror: function() {
- delete QR.req;
- post.unlock();
- QR.cooldown.auto = false;
- QR.status();
- return QR.error($.el('span', {
- innerHTML: "4chan X encountered an error while posting. [Banned? ] [More info ]"
- }));
- }
- };
- extra = {
- form: $.formData(formData),
- upCallbacks: {
- onload: function() {
- QR.req.isUploadFinished = true;
- QR.req.progress = '...';
- return QR.status();
- },
- onprogress: function(e) {
- QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%";
- return QR.status();
- }
- }
- };
- cb = function(response) {
- if (response != null) {
- if (response.challenge != null) {
- extra.form.append('recaptcha_challenge_field', response.challenge);
- extra.form.append('recaptcha_response_field', response.response);
- } else {
- extra.form.append('g-recaptcha-response', response.response);
- }
- }
- QR.req = $.ajax("https://sys.4chan.org/" + g.BOARD + "/post", options, extra);
- return QR.req.progress = '...';
- };
- if (typeof captcha === 'function') {
- QR.req = {
- progress: '...',
- abort: function() {
- return cb = null;
- }
- };
- captcha(function(response) {
- if (response) {
- return typeof cb === "function" ? cb(response) : void 0;
- } else {
- delete QR.req;
- post.unlock();
- QR.cooldown.auto = !!QR.captcha.captchas.length;
- return QR.status();
- }
- });
- } else {
- cb(captcha);
- }
- return QR.status();
- },
- response: function() {
- var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, req, resDoc, seconds, threadID;
- req = QR.req;
- delete QR.req;
- post = QR.posts[0];
- post.unlock();
- resDoc = req.response;
- if (ban = $('.banType', resDoc)) {
- err = $.el('span', ban.textContent.toLowerCase() === 'banned' ? {
- innerHTML: "You are banned on " + $(".board", resDoc).innerHTML + "! ;_; Click here to see the reason."
- } : {
- innerHTML: "You were issued a warning on " + $(".board", resDoc).innerHTML + " as " + $(".nameBlock", resDoc).innerHTML + ". Reason: " + $(".reason", resDoc).innerHTML
- });
- } else if (err = resDoc.getElementById('errmsg')) {
- if ((ref = $('a', err)) != null) {
- ref.target = '_blank';
- }
- } else if (resDoc.title !== 'Post successful!') {
- err = 'Connection error with sys.4chan.org.';
- } else if (req.status !== 200) {
- err = "Error " + req.statusText + " (" + req.status + ")";
- }
- if (err) {
- if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
- if (/mistyped/i.test(err.textContent)) {
- err = $.el('span', {
- innerHTML: "You mistyped the CAPTCHA, or the CAPTCHA malfunctioned [complain here ]."
- });
- } else if (/expired/i.test(err.textContent)) {
- err = 'This CAPTCHA is no longer valid because it has expired.';
- }
- QR.cooldown.auto = QR.captcha.isEnabled || err === 'Connection error with sys.4chan.org.';
- QR.cooldown.addDelay(post, 2);
- } else if (err.textContent && (m = err.textContent.match(/(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i)) && !/duplicate|hour/i.test(err.textContent)) {
- QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent);
- seconds = 60 * (+(m[1] || 0)) + (+m[2]);
- if (/muted/i.test(err.textContent)) {
- QR.cooldown.addMute(seconds);
- } else {
- QR.cooldown.addDelay(post, seconds);
- }
- } else {
- QR.cooldown.auto = false;
- }
- QR.captcha.setup(QR.cooldown.auto && ((ref1 = d.activeElement) === QR.nodes.status || ref1 === d.body));
- if (QR.captcha.isEnabled && !QR.captcha.captchas.length) {
- QR.cooldown.auto = false;
- }
- QR.status();
- QR.error(err);
- return;
- }
- h1 = $('h1', resDoc);
- QR.cleanNotifications();
- if (Conf['Posting Success Notifications']) {
- QR.notifications.push(new Notice('success', h1.textContent, 5));
- }
- ref2 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref2[0], threadID = ref2[1], postID = ref2[2];
- postID = +postID;
- threadID = +threadID || postID;
- isReply = threadID !== postID;
- $.event('QRPostSuccessful', {
- boardID: g.BOARD.ID,
- threadID: threadID,
- postID: postID
- });
- $.event('QRPostSuccessful_', {
- boardID: g.BOARD.ID,
- threadID: threadID,
- postID: postID
- });
- postsCount = QR.posts.length - 1;
- QR.cooldown.auto = postsCount && isReply;
- lastPostToThread = !((function() {
- var k, len1, p, ref3;
- ref3 = QR.posts.slice(1);
- for (k = 0, len1 = ref3.length; k < len1; k++) {
- p = ref3[k];
- if (p.thread === post.thread) {
- return true;
- }
- }
- })());
- if (!(Conf['Persistent QR'] || postsCount)) {
- QR.close();
- } else {
- post.rm();
- QR.captcha.setup(d.activeElement === QR.nodes.status);
- }
- QR.cooldown.add(threadID, postID);
- URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && lastPostToThread && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
- if (URL) {
- open = Conf['Open Post in New Tab'] || postsCount ? function() {
- return $.open(URL);
- } : function() {
- return window.location = URL;
- };
- if (threadID === postID) {
- QR.waitForThread(URL, open);
- } else {
- open();
- }
- }
- return QR.status();
- },
- waitForThread: function(url, cb) {
- var attempts, check;
- attempts = 0;
- check = function() {
- return $.ajax(url, {
- onloadend: function() {
- attempts++;
- if (attempts >= 6 || this.status === 200) {
- return cb();
- } else {
- return setTimeout(check, attempts * $.SECOND);
- }
- }
- }, {
- type: 'HEAD'
- });
- };
- return check();
- },
- abort: function() {
- if (QR.req && !QR.req.isUploadFinished) {
- QR.req.abort();
- delete QR.req;
- QR.posts[0].unlock();
- QR.cooldown.auto = false;
- QR.notifications.push(new Notice('info', 'QR upload aborted.', 5));
- }
- return QR.status();
- }
- };
-
- Captcha = {};
-
- Captcha.fixes = {
- imageKeys: '789456123uiojklm'.split('').concat(['Comma', 'Period']),
- imageKeys16: '7890uiopjkl'.split('').concat(['Semicolon', 'm', 'Comma', 'Period', 'Slash']),
- css: '.rc-imageselect-target > div:focus, .rc-image-tile-target:focus {\n outline: 2px solid #4a90e2;\n}\n.rc-imageselect-target td:focus {\n box-shadow: inset 0 0 0 2px #4a90e2;\n outline: none;\n}\n.rc-button-default:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}',
- cssNoscript: '.fbc-payload-imageselect {\n position: relative;\n}\n.fbc-payload-imageselect > label {\n position: absolute;\n display: block;\n height: 93.3px;\n width: 93.3px;\n}\nlabel[data-row="0"] {top: 0px;}\nlabel[data-row="1"] {top: 93.3px;}\nlabel[data-row="2"] {top: 186.6px;}\nlabel[data-col="0"] {left: 0px;}\nlabel[data-col="1"] {left: 93.3px;}\nlabel[data-col="2"] {left: 186.6px;}\n.fbc-payload-imageselect > input:focus + label {\n outline: 2px solid #4a90e2;\n}\n.fbc-button-verify input:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}\nbody.focus .fbc {\n box-shadow: inset 0 0 0 2px #4a90e2;\n}',
- init: function() {
- switch (location.pathname.split('/')[3]) {
- case 'anchor':
- return this.initMain();
- case 'frame':
- return this.initPopup();
- case 'fallback':
- return this.initNoscript();
- }
- },
- initMain: function() {
- var a, k, len1, ref;
- $.onExists(d.body, '#recaptcha-anchor', function(checkbox) {
- var focus;
- focus = function() {
- var ref;
- if (d.hasFocus() && ((ref = d.activeElement) === d.documentElement || ref === d.body)) {
- return checkbox.focus();
- }
- };
- focus();
- return $.on(window, 'focus', function() {
- return $.queueTask(focus);
- });
- });
- ref = $$('.rc-anchor-pt a');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- a = ref[k];
- a.tabIndex = -1;
- }
- },
- initPopup: function() {
- $.addStyle(this.css);
- this.fixImages();
- new MutationObserver((function(_this) {
- return function() {
- return _this.fixImages();
- };
- })(this)).observe(d.body, {
- childList: true,
- subtree: true
- });
- return $.on(d, 'keydown', this.keybinds.bind(this));
- },
- initNoscript: function() {
- var data, ref, token;
- this.noscript = true;
- data = (token = (ref = $('.fbc-verification-token > textarea')) != null ? ref.value : void 0) ? {
- token: token
- } : {
- working: true
- };
- new Connection(window.parent, '*').send(data);
- d.body.classList.toggle('focus', d.hasFocus());
- $.on(window, 'focus blur', function() {
- return d.body.classList.toggle('focus', d.hasFocus());
- });
- this.images = $$('.fbc-payload-imageselect > input');
- this.width = 3;
- if (this.images.length !== 9) {
- return;
- }
- $.addStyle(this.cssNoscript);
- this.addLabels();
- $.on(d, 'keydown', this.keybinds.bind(this));
- return $.on($('.fbc-imageselect-challenge > form'), 'submit', this.checkForm.bind(this));
- },
- fixImages: function() {
- var img, k, len1, ref;
- this.images = $$('.rc-image-tile-target');
- if (!this.images.length) {
- this.images = $$('.rc-imageselect-target > div, .rc-imageselect-target td');
- }
- this.width = $$('.rc-imageselect-target tr:first-of-type td').length || Math.round(Math.sqrt(this.images.length));
- ref = this.images;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- img = ref[k];
- img.tabIndex = 0;
- }
- if (this.images.length === 9) {
- this.addTooltips(this.images);
- } else {
- this.addTooltips16(this.images);
- }
- return this.complaintLinks();
- },
- complaintLinks: function() {
- var errmsg, k, len1, link, ref;
- ref = $$('.rc-imageselect-incorrect-response, .rc-imageselect-error-select-one, .rc-imageselect-error-select-more, .rc-imageselect-error-dynamic-more');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- errmsg = ref[k];
- if (!$('a', errmsg)) {
- link = $.el('a', {
- href: 'https://www.4chan-x.net/captchas.html',
- target: '_blank',
- textContent: '[complain]'
- });
- $.add(errmsg, [$.tn(' '), link]);
- }
- }
- },
- addLabels: function() {
- var checkbox, i, imageSelect, label, labels;
- imageSelect = $('.fbc-payload-imageselect');
- labels = (function() {
- var k, len1, ref, results;
- ref = this.images;
- results = [];
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- checkbox = ref[i];
- checkbox.id = "checkbox-" + i;
- label = $.el('label', {
- htmlFor: checkbox.id
- });
- label.dataset.row = Math.floor(i / 3);
- label.dataset.col = i % 3;
- $.after(checkbox, label);
- results.push(label);
- }
- return results;
- }).call(this);
- return this.addTooltips(labels);
- },
- addTooltips: function(nodes) {
- var i, k, len1, node;
- for (i = k = 0, len1 = nodes.length; k < len1; i = ++k) {
- node = nodes[i];
- node.title = this.imageKeys[i] + " or " + (this.imageKeys[i + 9][0].toUpperCase()) + this.imageKeys[i + 9].slice(1);
- }
- },
- addTooltips16: function(nodes) {
- var i, k, key, len1, node, ref;
- ref = this.imageKeys16;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- key = ref[i];
- if (i % 4 < this.width && (node = nodes[nodes.length - (4 - Math.floor(i / 4)) * this.width + (i % 4)])) {
- node.title = "" + (key[0].toUpperCase()) + key.slice(1);
- }
- }
- },
- checkForm: function(e) {
- var checkbox, k, len1, n, ref;
- n = 0;
- ref = this.images;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- checkbox = ref[k];
- if (checkbox.checked) {
- n++;
- }
- }
- if (n === 0) {
- return e.preventDefault();
- }
- },
- keybinds: function(e) {
- var dx, i, img, key, last, n, reload, verify, w, x;
- if (!(this.images && doc.contains(this.images[0]))) {
- return;
- }
- n = this.images.length;
- w = this.width;
- last = n + w - 1;
- reload = $('#recaptcha-reload-button, .fbc-button-reload');
- verify = $('#recaptcha-verify-button, .fbc-button-verify > input');
- x = this.images.indexOf(d.activeElement);
- if (x < 0) {
- x = d.activeElement === verify ? last : n;
- }
- key = Keybinds.keyCode(e);
- if (!this.noscript && key === 'Space' && x < n) {
- this.images[x].click();
- } else if (n === 9 && (i = this.imageKeys.indexOf(key)) >= 0) {
- this.images[i % 9].click();
- verify.focus();
- } else if (n !== 9 && (i = this.imageKeys16.indexOf(key)) >= 0 && i % 4 < w && (img = this.images[n - (4 - Math.floor(i / 4)) * w + (i % 4)])) {
- img.click();
- verify.focus();
- } else if (dx = {
- 'Up': n,
- 'Down': w,
- 'Left': last,
- 'Right': 1
- }[key]) {
- x = (x + dx) % (n + w);
- if ((n < x && x < last)) {
- x = dx === last ? n : last;
- }
- (this.images[x] || (x === n ? reload : void 0) || (x === last ? verify : void 0)).focus();
- } else {
- return;
- }
- e.preventDefault();
- return e.stopPropagation();
- }
- };
-
- Captcha.replace = {
- init: function() {
- if (!(d.cookie.indexOf('pass_enabled=1') < 0)) {
- return;
- }
- if (location.hostname === 'sys.4chan.org' && /[?&]altc\b/.test(location.search) && Main.jsEnabled) {
- $.onExists(doc, 'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', function() {
- $.global(function() {
- return window.el.onload = null;
- });
- return Captcha.v1.create();
- });
- return;
- }
- if (((Conf['Use Recaptcha v1'] && location.hostname === 'boards.4chan.org') || (Conf['Use Recaptcha v1 in Reports'] && location.hostname === 'sys.4chan.org')) && Main.jsEnabled) {
- $.ready(Captcha.replace.v1);
- return;
- }
- if (Conf['Force Noscript Captcha'] && Main.jsEnabled) {
- $.ready(Captcha.replace.noscript);
- return;
- }
- if (Conf['captchaLanguage'].trim() || Conf['Captcha Fixes']) {
- if (location.hostname === 'boards.4chan.org') {
- return $.onExists(doc, '#captchaFormPart', function(node) {
- return $.onExists(node, 'iframe', Captcha.replace.iframe);
- });
- } else {
- return $.onExists(doc, 'iframe', Captcha.replace.iframe);
- }
- }
- },
- noscript: function() {
- var insert, noscript, original, span, toggle;
- if (!((original = $('#g-recaptcha, #captchaContainerAlt')) && (noscript = $('noscript')))) {
- return;
- }
- span = $.el('span', {
- id: 'captcha-forced-noscript'
- });
- $.replace(noscript, span);
- $.rm(original);
- insert = function() {
- span.innerHTML = noscript.textContent;
- return Captcha.replace.iframe($('iframe', span));
- };
- if ((toggle = $('#togglePostFormLink a, #form-link'))) {
- return $.on(toggle, 'click', insert);
- } else {
- return insert();
- }
- },
- v1: function() {
- var form, link;
- if (!$.id('g-recaptcha')) {
- return;
- }
- Captcha.v1.replace();
- if ((link = $.id('form-link'))) {
- return $.on(link, 'click', function() {
- return Captcha.v1.create();
- });
- } else if (location.hostname === 'boards.4chan.org') {
- form = $.id('postForm');
- return form.addEventListener('focus', (function() {
- return Captcha.v1.create();
- }), true);
- } else {
- return Captcha.v1.create();
- }
- },
- iframe: function(iframe) {
- var lang, src;
- if ((lang = Conf['captchaLanguage'].trim())) {
- src = /[?&]hl=/.test(iframe.src) ? iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) : iframe.src + ("&hl=" + (encodeURIComponent(lang)));
- if (iframe.src !== src) {
- iframe.src = src;
- }
- }
- return Captcha.replace.autocopy(iframe);
- },
- autocopy: function(iframe) {
- if (!(Conf['Captcha Fixes'] && /^https:\/\/www\.google\.com\/recaptcha\/api\/fallback\?/.test(iframe.src))) {
- return;
- }
- return new Connection(iframe, 'https://www.google.com', {
- working: function() {
- var ref, ref1;
- if ((ref = $.id('qr')) != null ? ref.contains(iframe) : void 0) {
- return (ref1 = $('#qr .captcha-container textarea')) != null ? ref1.parentNode.hidden = true : void 0;
- }
- },
- token: function(token) {
- var node, textarea;
- node = iframe;
- while ((node = node.parentNode)) {
- if ((textarea = $('textarea', node))) {
- break;
- }
- }
- textarea.value = token;
- return $.event('input', null, textarea);
- }
- });
- }
- };
-
- Captcha.v1 = {
- blank: "data:image/svg+xml, ",
- init: function() {
- var imgContainer, input;
- if (d.cookie.indexOf('pass_enabled=1') >= 0) {
- return;
- }
- if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt'))) {
- return;
- }
- imgContainer = $.el('div', {
- className: 'captcha-img',
- title: 'Reload reCAPTCHA'
- });
- $.extend(imgContainer, {
- innerHTML: " "
- });
- input = $.el('input', {
- className: 'captcha-input field',
- title: 'Verification',
- autocomplete: 'off',
- spellcheck: false
- });
- this.nodes = {
- img: imgContainer.firstChild,
- input: input
- };
- $.on(input, 'blur', QR.focusout);
- $.on(input, 'focus', QR.focusin);
- $.on(input, 'keydown', QR.captcha.keydown.bind(QR.captcha));
- $.on(this.nodes.img.parentNode, 'click', QR.captcha.reload.bind(QR.captcha));
- $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v1');
- $.after(QR.nodes.com.parentNode, [imgContainer, input]);
- this.captchas = [];
- $.get('captchas', [], function(arg) {
- var captchas;
- captchas = arg.captchas;
- QR.captcha.sync(captchas);
- return QR.captcha.clear();
- });
- $.sync('captchas', this.sync);
- this.replace();
- this.beforeSetup();
- if (Conf['Auto-load captcha']) {
- this.setup();
- }
- new MutationObserver(this.afterSetup).observe($.id('captchaContainerAlt'), {
- childList: true
- });
- return this.afterSetup();
- },
- replace: function() {
- var container, old;
- if (this.script) {
- return;
- }
- if (!(this.script = $('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', d.head))) {
- this.script = $.el('script', {
- src: '//www.google.com/recaptcha/api/js/recaptcha_ajax.js'
- });
- $.add(d.head, this.script);
- }
- if (old = $.id('g-recaptcha')) {
- container = $.el('div', {
- id: 'captchaContainerAlt'
- });
- return $.replace(old, container);
- }
- },
- create: function() {
- var cont, lang;
- cont = $.id('captchaContainerAlt');
- if (this.occupied) {
- return;
- }
- this.occupied = true;
- if ((lang = Conf['captchaLanguage'].trim())) {
- cont.dataset.lang = lang;
- }
- $.onExists(cont, '#recaptcha_image', function(image) {
- return $.on(image, 'click', function() {
- if ($.id('recaptcha_challenge_image')) {
- return $.global(function() {
- return window.Recaptcha.reload();
- });
- }
- });
- });
- $.onExists(cont, '#recaptcha_response_field', function(field) {
- $.on(field, 'keydown', function(e) {
- if (e.keyCode === 8 && !field.value) {
- return $.global(function() {
- return window.Recaptcha.reload();
- });
- }
- });
- if (location.hostname === 'sys.4chan.org') {
- return field.focus();
- }
- });
- return $.global(function() {
- var container, options, script;
- container = document.getElementById('captchaContainerAlt');
- options = {
- theme: 'clean',
- tabindex: {
- "boards.4chan.org": 5
- }[location.hostname],
- lang: container.dataset.lang
- };
- if (window.Recaptcha) {
- return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
- } else {
- script = document.head.querySelector('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]');
- return script.addEventListener('load', function() {
- return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
- }, false);
- }
- });
- },
- cb: {
- focus: function() {
- return QR.captcha.setup(false, true);
- }
- },
- beforeSetup: function() {
- var img, input, ref;
- ref = this.nodes, img = ref.img, input = ref.input;
- img.parentNode.hidden = true;
- img.src = this.blank;
- input.value = '';
- input.placeholder = 'Focus to load reCAPTCHA';
- this.count();
- return $.on(input, 'focus click', this.cb.focus);
- },
- needed: function() {
- var captchaCount, postsCount;
- captchaCount = this.captchas.length;
- if (QR.req) {
- captchaCount++;
- }
- postsCount = QR.posts.length;
- if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
- postsCount = 0;
- }
- return captchaCount < postsCount;
- },
- onNewPost: function() {},
- onPostChange: function() {},
- setup: function(focus, force) {
- if (!(this.isEnabled && (force || this.needed()))) {
- return;
- }
- this.create();
- if (focus) {
- $.addClass(QR.nodes.el, 'focus');
- return this.nodes.input.focus();
- }
- },
- afterSetup: function() {
- var challenge, img, input, ref, setLifetime;
- if (!(challenge = $.id('recaptcha_challenge_field_holder'))) {
- return;
- }
- if (challenge === QR.captcha.nodes.challenge) {
- return;
- }
- setLifetime = function(e) {
- return QR.captcha.lifetime = e.detail;
- };
- $.on(window, 'captcha:timeout', setLifetime);
- $.global(function() {
- return window.dispatchEvent(new CustomEvent('captcha:timeout', {
- detail: window.RecaptchaState.timeout
- }));
- });
- $.off(window, 'captcha:timeout', setLifetime);
- ref = QR.captcha.nodes, img = ref.img, input = ref.input;
- img.parentNode.hidden = false;
- input.placeholder = 'Verification';
- QR.captcha.count();
- $.off(input, 'focus click', QR.captcha.cb.focus);
- QR.captcha.nodes.challenge = challenge;
- new MutationObserver(QR.captcha.load.bind(QR.captcha)).observe(challenge, {
- childList: true,
- subtree: true,
- attributes: true
- });
- QR.captcha.load();
- if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
- QR.nodes.el.style.top = null;
- return QR.nodes.el.style.bottom = '0px';
- }
- },
- destroy: function() {
- if (!this.script) {
- return;
- }
- $.global(function() {
- return window.Recaptcha.destroy();
- });
- delete this.occupied;
- if (this.nodes) {
- return this.beforeSetup();
- }
- },
- sync: function(captchas) {
- if (captchas == null) {
- captchas = [];
- }
- QR.captcha.captchas = captchas;
- return QR.captcha.count();
- },
- getOne: function() {
- var captcha, challenge, response, timeout;
- this.clear();
- if (captcha = this.captchas.shift()) {
- this.count();
- $.set('captchas', this.captchas);
- return captcha;
- } else {
- challenge = this.nodes.img.alt;
- timeout = this.timeout;
- if (/\S/.test(response = this.nodes.input.value)) {
- this.destroy();
- return {
- challenge: challenge,
- response: response,
- timeout: timeout
- };
- } else {
- return null;
- }
- }
- },
- save: function() {
- var response;
- if (!/\S/.test(response = this.nodes.input.value)) {
- return;
- }
- this.nodes.input.value = '';
- this.captchas.push({
- challenge: this.nodes.img.alt,
- response: response,
- timeout: this.timeout
- });
- this.captchas.sort(function(a, b) {
- return a.timeout - b.timeout;
- });
- this.count();
- this.destroy();
- this.setup(false, true);
- return $.set('captchas', this.captchas);
- },
- clear: function() {
- var captcha, i, k, len1, now, ref;
- if (!this.captchas.length) {
- return;
- }
- $.forceSync('captchas');
- now = Date.now();
- ref = this.captchas;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- captcha = ref[i];
- if (captcha.timeout > now) {
- break;
- }
- }
- if (!i) {
- return;
- }
- this.captchas = this.captchas.slice(i);
- this.count();
- return $.set('captchas', this.captchas);
- },
- load: function() {
- var challenge, challenge_image;
- if ($('#captchaContainerAlt[class~="recaptcha_is_showing_audio"]')) {
- this.nodes.img.src = this.blank;
- return;
- }
- if (!this.nodes.challenge.firstChild) {
- return;
- }
- if (!(challenge_image = $.id('recaptcha_challenge_image'))) {
- return;
- }
- this.timeout = Date.now() + this.lifetime * $.SECOND - $.MINUTE;
- challenge = this.nodes.challenge.firstChild.value;
- this.nodes.img.alt = challenge;
- this.nodes.img.src = challenge_image.src;
- this.nodes.input.value = '';
- return this.clear();
- },
- count: function() {
- var count, placeholder;
- count = this.captchas ? this.captchas.length : 0;
- placeholder = this.nodes.input.placeholder.replace(/\ \(.*\)$/, '');
- placeholder += (function() {
- switch (count) {
- case 0:
- if (placeholder === 'Verification') {
- return ' (Shift + Enter to cache)';
- } else {
- return '';
- }
- break;
- case 1:
- return ' (1 cached captcha)';
- default:
- return " (" + count + " cached captchas)";
- }
- })();
- this.nodes.input.placeholder = placeholder;
- this.nodes.input.alt = count;
- clearTimeout(this.timer);
- if (count) {
- return this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
- }
- },
- reload: function(focus) {
- $.global(function() {
- if (window.Recaptcha.type === 'image') {
- window.Recaptcha.reload();
- } else {
- window.Recaptcha.switch_type('image');
- }
- return window.Recaptcha.should_focus = false;
- });
- if (focus) {
- return this.nodes.input.focus();
- }
- },
- keydown: function(e) {
- if (e.keyCode === 8 && !this.nodes.input.value) {
- this.reload();
- } else if (e.keyCode === 13 && e.shiftKey) {
- this.save();
- } else {
- return;
- }
- return e.preventDefault();
- }
- };
-
- Captcha.v2 = {
- lifetime: 2 * $.MINUTE,
- init: function() {
- var counter, root;
- if (d.cookie.indexOf('pass_enabled=1') >= 0) {
- return;
- }
- if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt, #captcha-forced-noscript'))) {
- return;
- }
- if ((this.noscript = Conf['Force Noscript Captcha'] || !Main.jsEnabled)) {
- $.addClass(QR.nodes.el, 'noscript-captcha');
- }
- this.captchas = [];
- $.get('captchas', [], function(arg) {
- var captchas;
- captchas = arg.captchas;
- return QR.captcha.sync(captchas);
- });
- $.sync('captchas', this.sync.bind(this));
- root = $.el('div', {
- className: 'captcha-root'
- });
- $.extend(root, {
- innerHTML: ""
- });
- counter = $('.captcha-counter > a', root);
- this.nodes = {
- root: root,
- counter: counter
- };
- this.count();
- $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2');
- $.after(QR.nodes.com.parentNode, root);
- $.on(counter, 'click', this.toggle.bind(this));
- $.on(counter, 'keydown', (function(_this) {
- return function(e) {
- if (Keybinds.keyCode(e) !== 'Space') {
- return;
- }
- _this.toggle();
- e.preventDefault();
- return e.stopPropagation();
- };
- })(this));
- return $.on(window, 'captcha:success', (function(_this) {
- return function() {
- return $.queueTask(function() {
- return _this.save(false);
- });
- };
- })(this));
- },
- timeouts: {},
- postsCount: 0,
- noscriptURL: function() {
- var lang, url;
- url = 'https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc';
- if ((lang = Conf['captchaLanguage'].trim())) {
- url += "&hl=" + (encodeURIComponent(lang));
- }
- return url;
- },
- needed: function() {
- var captchaCount;
- captchaCount = this.captchas.length;
- if (QR.req) {
- captchaCount++;
- }
- this.postsCount = QR.posts.length;
- if (this.postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
- this.postsCount = 0;
- }
- return captchaCount < this.postsCount;
- },
- onNewPost: function() {
- return this.setup();
- },
- onPostChange: function() {
- if (this.postsCount === 0) {
- this.setup();
- }
- if (QR.posts.length === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
- return this.postsCount = 0;
- }
- },
- toggle: function() {
- if (this.nodes.container && !this.timeouts.destroy) {
- return this.destroy();
- } else {
- return this.setup(true, true);
- }
- },
- setup: function(focus, force) {
- if (!(this.isEnabled && (this.needed() || force))) {
- return;
- }
- if (focus) {
- $.addClass(QR.nodes.el, 'focus');
- this.nodes.counter.focus();
- }
- if (this.timeouts.destroy) {
- clearTimeout(this.timeouts.destroy);
- delete this.timeouts.destroy;
- return this.reload();
- }
- if (this.nodes.container) {
- $.queueTask((function(_this) {
- return function() {
- var iframe;
- if (_this.nodes.container && d.activeElement === _this.nodes.counter && (iframe = $('iframe', _this.nodes.container))) {
- iframe.focus();
- return QR.focus();
- }
- };
- })(this));
- return;
- }
- this.nodes.container = $.el('div', {
- className: 'captcha-container'
- });
- $.prepend(this.nodes.root, this.nodes.container);
- new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, {
- childList: true,
- subtree: true
- });
- if (this.noscript) {
- return this.setupNoscript();
- } else {
- return this.setupJS();
- }
- },
- setupNoscript: function() {
- var div, iframe, textarea;
- iframe = $.el('iframe', {
- id: 'qr-captcha-iframe',
- src: this.noscriptURL()
- });
- div = $.el('div');
- textarea = $.el('textarea');
- $.add(div, textarea);
- return $.add(this.nodes.container, [iframe, div]);
- },
- setupJS: function() {
- return $.global(function() {
- var cbNative, render;
- render = function() {
- var classList, container;
- classList = document.documentElement.classList;
- container = document.querySelector('#qr .captcha-container');
- return container.dataset.widgetID = window.grecaptcha.render(container, {
- sitekey: '6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc',
- theme: classList.contains('tomorrow') || classList.contains('dark-captcha') ? 'dark' : 'light',
- callback: function(response) {
- return window.dispatchEvent(new CustomEvent('captcha:success', {
- detail: response
- }));
- }
- });
- };
- if (window.grecaptcha) {
- return render();
- } else {
- cbNative = window.onRecaptchaLoaded;
- return window.onRecaptchaLoaded = function() {
- render();
- return cbNative();
- };
- }
- });
- },
- afterSetup: function(mutations) {
- var iframe, k, len1, len2, mutation, node, q, ref, textarea;
- for (k = 0, len1 = mutations.length; k < len1; k++) {
- mutation = mutations[k];
- ref = mutation.addedNodes;
- for (q = 0, len2 = ref.length; q < len2; q++) {
- node = ref[q];
- if ((iframe = $.x('./descendant-or-self::iframe', node))) {
- this.setupIFrame(iframe);
- }
- if ((textarea = $.x('./descendant-or-self::textarea', node))) {
- this.setupTextArea(textarea);
- }
- }
- }
- },
- setupIFrame: function(iframe) {
- if (!doc.contains(iframe)) {
- return;
- }
- Captcha.replace.iframe(iframe);
- $.addClass(QR.nodes.el, 'captcha-open');
- this.fixQRPosition();
- $.on(iframe, 'load', this.fixQRPosition);
- if (d.activeElement === this.nodes.counter) {
- iframe.focus();
- }
- return $.global(function() {
- var f;
- f = document.querySelector('#qr iframe');
- return f.focus = f.blur = function() {};
- });
- },
- fixQRPosition: function() {
- if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
- QR.nodes.el.style.top = null;
- return QR.nodes.el.style.bottom = '0px';
- }
- },
- setupTextArea: function(textarea) {
- return $.one(textarea, 'input', (function(_this) {
- return function() {
- return _this.save(true);
- };
- })(this));
- },
- destroy: function() {
- var garbage, i, ins, node, ref;
- if (!this.isEnabled) {
- return;
- }
- delete this.timeouts.destroy;
- $.rmClass(QR.nodes.el, 'captcha-open');
- if (this.nodes.container) {
- $.rm(this.nodes.container);
- }
- delete this.nodes.container;
- garbage = $.X('//iframe[starts-with(@src, "https://www.google.com/recaptcha/api2/frame")]/ancestor-or-self::*[parent::body]');
- i = 0;
- while (node = garbage.snapshotItem(i++)) {
- if (((ref = (ins = node.nextSibling)) != null ? ref.nodeName : void 0) === 'INS') {
- $.rm(ins);
- }
- $.rm(node);
- }
- },
- sync: function(captchas) {
- if (captchas == null) {
- captchas = [];
- }
- this.captchas = captchas;
- this.clear();
- return this.count();
- },
- getOne: function() {
- var captcha;
- this.clear();
- if ((captcha = this.captchas.shift())) {
- $.set('captchas', this.captchas);
- this.count();
- return captcha;
- } else {
- return null;
- }
- },
- save: function(pasted, token) {
- var base1, focus, ref;
- $.forceSync('captchas');
- this.captchas.push({
- response: token || $('textarea', this.nodes.container).value,
- timeout: Date.now() + this.lifetime
- });
- this.captchas.sort(function(a, b) {
- return a.timeout - b.timeout;
- });
- $.set('captchas', this.captchas);
- this.count();
- focus = ((ref = d.activeElement) != null ? ref.nodeName : void 0) === 'IFRAME' && /https?:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src);
- if (this.needed()) {
- if (focus) {
- if (QR.cooldown.auto || Conf['Post on Captcha Completion']) {
- this.nodes.counter.focus();
- } else {
- QR.nodes.status.focus();
- }
- }
- this.reload();
- } else {
- if (pasted) {
- this.destroy();
- } else {
- if ((base1 = this.timeouts).destroy == null) {
- base1.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
- }
- }
- if (focus) {
- QR.nodes.status.focus();
- }
- }
- if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) {
- return QR.submit();
- }
- },
- clear: function() {
- var captcha, i, k, len1, now, ref;
- if (!this.captchas.length) {
- return;
- }
- $.forceSync('captchas');
- now = Date.now();
- ref = this.captchas;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- captcha = ref[i];
- if (captcha.timeout > now) {
- break;
- }
- }
- if (!i) {
- return;
- }
- this.captchas = this.captchas.slice(i);
- this.count();
- $.set('captchas', this.captchas);
- return this.setup(d.activeElement === QR.nodes.status);
- },
- count: function() {
- this.nodes.counter.textContent = "Captchas: " + this.captchas.length;
- clearTimeout(this.timeouts.clear);
- if (this.captchas.length) {
- return this.timeouts.clear = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
- }
- },
- reload: function() {
- if ($('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) {
- this.destroy();
- return this.setup(false, true);
- } else {
- return $.global(function() {
- var container;
- container = document.querySelector('#qr .captcha-container');
- return window.grecaptcha.reset(container.dataset.widgetID);
- });
- }
- }
- };
-
- PassLink = {
- init: function() {
- if (!Conf['Pass Link']) {
- return;
- }
- return Main.ready(this.ready);
- },
- ready: function() {
- var passLink, styleSelector;
- if (!(styleSelector = $.id('styleSelector'))) {
- return;
- }
- passLink = $.el('span', {
- className: 'brackets-wrap pass-link-container'
- });
- $.extend(passLink, {
- innerHTML: "4chan Pass "
- });
- $.on(passLink.firstElementChild, 'click', function() {
- return window.open('//sys.4chan.org/auth', Date.now(), 'width=500,height=280,toolbar=0');
- });
- return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]);
- }
- };
-
- PostSuccessful = {
- init: function() {
- if (!Conf['Remember Your Posts']) {
- return;
- }
- return $.ready(this.ready);
- },
- ready: function() {
- var _, db, postID, ref, threadID;
- if (d.title !== 'Post successful!') {
- return;
- }
- ref = $('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref[0], threadID = ref[1], postID = ref[2];
- postID = +postID;
- threadID = +threadID || postID;
- db = new DataBoard('yourPosts');
- return db.set({
- boardID: g.BOARD.ID,
- threadID: threadID,
- postID: postID,
- val: true
- });
- }
- };
-
- QR.cooldown = {
- seconds: 0,
- delays: {
- thread: 0,
- reply: 0,
- image: 0,
- reply_intra: 0,
- image_intra: 0,
- deletion: 60,
- thread_global: 300
- },
- init: function() {
- if (!Conf['Quick Reply']) {
- return;
- }
- this.data = Conf['cooldowns'];
- return $.sync('cooldowns', this.sync);
- },
- setup: function() {
- var delay, m, ref, type;
- if (m = Get.scriptData().match(/\bcooldowns *= *({[^}]+})/)) {
- $.extend(QR.cooldown.delays, JSON.parse(m[1]));
- }
- QR.cooldown.maxDelay = 0;
- ref = QR.cooldown.delays;
- for (type in ref) {
- delay = ref[type];
- if (type !== 'thread' && type !== 'thread_global') {
- QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay);
- }
- }
- QR.cooldown.isSetup = true;
- return QR.cooldown.start();
- },
- start: function() {
- var data;
- data = QR.cooldown.data;
- if (!(Conf['Cooldown'] && QR.cooldown.isSetup && !QR.cooldown.isCounting && Object.keys(data[g.BOARD.ID] || {}).length + Object.keys(data.global || {}).length > 0)) {
- return;
- }
- QR.cooldown.isCounting = true;
- return QR.cooldown.count();
- },
- sync: function(data) {
- QR.cooldown.data = data || {};
- return QR.cooldown.start();
- },
- add: function(threadID, postID) {
- var boardID, start;
- if (!Conf['Cooldown']) {
- return;
- }
- start = Date.now();
- boardID = g.BOARD.ID;
- QR.cooldown.set(boardID, start, {
- threadID: threadID,
- postID: postID
- });
- if (threadID === postID) {
- QR.cooldown.set('global', start, {
- boardID: boardID,
- threadID: threadID,
- postID: postID
- });
- }
- return QR.cooldown.start();
- },
- addDelay: function(post, delay) {
- var cooldown;
- if (!Conf['Cooldown']) {
- return;
- }
- cooldown = QR.cooldown.categorize(post);
- cooldown.delay = delay;
- QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown);
- return QR.cooldown.start();
- },
- addMute: function(delay) {
- if (!Conf['Cooldown']) {
- return;
- }
- QR.cooldown.set(g.BOARD.ID, Date.now(), {
- type: 'mute',
- delay: delay
- });
- return QR.cooldown.start();
- },
- "delete": function(post) {
- var base1, cooldown, cooldowns, id, name1;
- if (!QR.cooldown.data) {
- return;
- }
- $.forceSync('cooldowns');
- cooldowns = ((base1 = QR.cooldown.data)[name1 = post.board.ID] || (base1[name1] = {}));
- for (id in cooldowns) {
- cooldown = cooldowns[id];
- if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
- delete cooldowns[id];
- }
- }
- return QR.cooldown.save([post.board.ID]);
- },
- secondsDeletion: function(post) {
- var cooldown, cooldowns, seconds, start;
- if (!(QR.cooldown.data && Conf['Cooldown'])) {
- return 0;
- }
- cooldowns = QR.cooldown.data[post.board.ID] || {};
- for (start in cooldowns) {
- cooldown = cooldowns[start];
- if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
- seconds = QR.cooldown.delays.deletion - Math.floor((Date.now() - start) / $.SECOND);
- return Math.max(seconds, 0);
- }
- }
- return 0;
- },
- categorize: function(post) {
- if (post.thread === 'new') {
- return {
- type: 'thread'
- };
- } else {
- return {
- type: !!post.file ? 'image' : 'reply',
- threadID: +post.thread
- };
- }
- },
- set: function(scope, id, value) {
- var base1, cooldowns;
- $.forceSync('cooldowns');
- cooldowns = ((base1 = QR.cooldown.data)[scope] || (base1[scope] = {}));
- cooldowns[id] = value;
- return $.set('cooldowns', QR.cooldown.data);
- },
- save: function(scopes) {
- var data, k, len1, scope;
- data = QR.cooldown.data;
- for (k = 0, len1 = scopes.length; k < len1; k++) {
- scope = scopes[k];
- if (scope in data && !Object.keys(data[scope]).length) {
- delete data[scope];
- }
- }
- return $.set('cooldowns', data);
- },
- count: function() {
- var base1, cooldown, cooldowns, elapsed, k, len1, maxDelay, nCooldowns, now, ref, ref1, save, scope, seconds, start, suffix, threadID, type, update;
- $.forceSync('cooldowns');
- save = [];
- nCooldowns = 0;
- now = Date.now();
- ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID;
- seconds = 0;
- if (Conf['Cooldown']) {
- ref1 = [g.BOARD.ID, 'global'];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- scope = ref1[k];
- cooldowns = ((base1 = QR.cooldown.data)[scope] || (base1[scope] = {}));
- for (start in cooldowns) {
- cooldown = cooldowns[start];
- start = +start;
- elapsed = Math.floor((now - start) / $.SECOND);
- if (elapsed < 0) {
- delete cooldowns[start];
- save.push(scope);
- continue;
- }
- if (cooldown.delay != null) {
- if (cooldown.delay <= elapsed) {
- delete cooldowns[start];
- save.push(scope);
- } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') {
- seconds = Math.max(seconds, cooldown.delay - elapsed);
- }
- continue;
- }
- maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread'];
- if (QR.cooldown.customCooldown) {
- maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10));
- }
- if (maxDelay <= elapsed) {
- delete cooldowns[start];
- save.push(scope);
- continue;
- }
- if ((type === 'thread') === (cooldown.threadID === cooldown.postID) && cooldown.boardID !== g.BOARD.ID) {
- suffix = scope === 'global' ? '_global' : type !== 'thread' && threadID === cooldown.threadID ? '_intra' : '';
- seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed);
- }
- if (QR.cooldown.customCooldown) {
- seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed);
- }
- }
- nCooldowns += Object.keys(cooldowns).length;
- }
- }
- if (save.length) {
- QR.cooldown.save(save);
- }
- if (nCooldowns) {
- clearTimeout(QR.cooldown.timeout);
- QR.cooldown.timeout = setTimeout(QR.cooldown.count, $.SECOND);
- } else {
- delete QR.cooldown.isCounting;
- }
- update = seconds !== QR.cooldown.seconds;
- QR.cooldown.seconds = seconds;
- if (update) {
- QR.status();
- }
- if (seconds === 0 && QR.cooldown.auto && !QR.req) {
- return QR.submit();
- }
- }
- };
-
- QR.oekaki = {
- menu: {
- init: function() {
- var a, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Edit Link'] && Conf['Quick Reply'])) {
- return;
- }
- a = $.el('a', {
- className: 'edit-link',
- href: 'javascript:;',
- textContent: 'Edit image'
- });
- $.on(a, 'click', this.editFile);
- return Menu.menu.addEntry({
- el: a,
- order: 95,
- open: function(post) {
- var file;
- QR.oekaki.menu.post = post;
- file = post.file;
- return QR.postingIsEnabled && !!file && (file.isImage || file.isVideo);
- }
- });
- },
- editFile: function() {
- var currentTime, isVideo, post, ref;
- post = QR.oekaki.menu.post;
- QR.quote.call(post.nodes.post);
- isVideo = post.file.isVideo;
- currentTime = ((ref = post.file.fullImage) != null ? ref.currentTime : void 0) || 0;
- return CrossOrigin.file(post.file.url, function(blob) {
- var video;
- if (!blob) {
- return QR.error("Can't load file.");
- } else if (isVideo) {
- video = $.el('video');
- $.on(video, 'loadedmetadata', function() {
- $.on(video, 'seeked', function() {
- var canvas;
- canvas = $.el('canvas', {
- width: video.videoWidth,
- height: video.videoHeight
- });
- canvas.getContext('2d').drawImage(video, 0, 0);
- return canvas.toBlob(function(snapshot) {
- snapshot.name = post.file.name.replace(/\.\w+$/, '') + '.png';
- QR.handleFiles([snapshot]);
- return QR.oekaki.edit();
- });
- });
- return video.currentTime = currentTime;
- });
- return video.src = URL.createObjectURL(blob);
- } else {
- blob.name = post.file.name;
- QR.handleFiles([blob]);
- return QR.oekaki.edit();
- }
- });
- }
- },
- setup: function() {
- return $.global(function() {
- var FCX;
- FCX = window.FCX;
- FCX.oekakiCB = function() {
- return window.Tegaki.flatten().toBlob(function(file) {
- var source;
- source = "oekaki-" + (Date.now());
- FCX.oekakiLatest = source;
- return document.dispatchEvent(new CustomEvent('QRSetFile', {
- bubbles: true,
- detail: {
- file: file,
- name: FCX.oekakiName,
- source: source
- }
- }));
- });
- };
- if (window.Tegaki) {
- return document.querySelector('#qr .oekaki').hidden = false;
- }
- });
- },
- load: function(cb) {
- var n, onload, script, style;
- if ($('script[src^="//s.4cdn.org/js/painter"]', d.head)) {
- return cb();
- } else {
- style = $.el('link', {
- rel: 'stylesheet',
- href: "//s.4cdn.org/css/painter." + (Date.now()) + ".css"
- });
- script = $.el('script', {
- src: "//s.4cdn.org/js/painter.min." + (Date.now()) + ".js"
- });
- n = 0;
- onload = function() {
- if (++n === 2) {
- return cb();
- }
- };
- $.on(style, 'load', onload);
- $.on(script, 'load', onload);
- return $.add(d.head, [style, script]);
- }
- },
- draw: function() {
- return $.global(function() {
- var FCX, Tegaki;
- Tegaki = window.Tegaki, FCX = window.FCX;
- if (Tegaki.bg) {
- Tegaki.destroy();
- }
- FCX.oekakiName = 'tegaki.png';
- return Tegaki.open({
- onDone: FCX.oekakiCB,
- onCancel: function() {
- return Tegaki.bgColor = '#ffffff';
- },
- width: +document.querySelector('#qr [name=oekaki-width]').value,
- height: +document.querySelector('#qr [name=oekaki-height]').value,
- bgColor: document.querySelector('#qr [name=oekaki-bg]').checked ? document.querySelector('#qr [name=oekaki-bgcolor]').value : 'transparent'
- });
- });
- },
- button: function() {
- if (QR.selected.file) {
- return QR.oekaki.edit();
- } else {
- return QR.oekaki.toggle();
- }
- },
- edit: function() {
- return QR.oekaki.load(function() {
- return $.global(function() {
- var FCX, Tegaki, cb, error, name, source;
- Tegaki = window.Tegaki, FCX = window.FCX;
- name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png';
- source = document.getElementById('file-n-submit').dataset.source;
- error = function(content) {
- return document.dispatchEvent(new CustomEvent('CreateNotification', {
- bubbles: true,
- detail: {
- type: 'warning',
- content: content,
- lifetime: 20
- }
- }));
- };
- cb = function(e) {
- var file, isVideo;
- document.removeEventListener('QRFile', cb, false);
- if (!e.detail) {
- return error('No file to edit.');
- }
- if (!/^(image|video)\//.test(e.detail.type)) {
- return error('Not an image.');
- }
- isVideo = /^video\//.test(e.detail.type);
- file = document.createElement(isVideo ? 'video' : 'img');
- file.addEventListener('error', function() {
- return error('Could not open file.', false);
- });
- file.addEventListener((isVideo ? 'loadeddata' : 'load'), function() {
- if (Tegaki.bg) {
- Tegaki.destroy();
- }
- FCX.oekakiName = name;
- Tegaki.open({
- onDone: FCX.oekakiCB,
- onCancel: function() {
- return Tegaki.bgColor = '#ffffff';
- },
- width: file.naturalWidth || file.videoWidth,
- height: file.naturalHeight || file.videoHeight,
- bgColor: 'transparent'
- });
- return Tegaki.activeCtx.drawImage(file, 0, 0);
- }, false);
- return file.src = URL.createObjectURL(e.detail);
- };
- if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) {
- FCX.oekakiName = name;
- return Tegaki.resume();
- } else {
- document.addEventListener('QRFile', cb, false);
- return document.dispatchEvent(new CustomEvent('QRGetFile', {
- bubbles: true
- }));
- }
- });
- });
- },
- toggle: function() {
- return QR.oekaki.load(function() {
- return QR.nodes.oekaki.hidden = !QR.nodes.oekaki.hidden;
- });
- }
- };
-
- QR.persona = {
- pwd: '',
- always: {},
- init: function() {
- QR.persona.getPassword();
- return $.get('QR.personas', Conf['QR.personas'], function(arg) {
- var arr, item, k, len1, personas, ref, type, types;
- personas = arg['QR.personas'];
- types = {
- name: [],
- email: [],
- sub: []
- };
- ref = personas.split('\n');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- item = ref[k];
- QR.persona.parseItem(item.trim(), types);
- }
- for (type in types) {
- arr = types[type];
- QR.persona.loadPersonas(type, arr);
- }
- });
- },
- parseItem: function(item, types) {
- var boards, match, ref, ref1, ref2, type, val;
- if (item[0] === '#') {
- return;
- }
- if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) {
- return;
- }
- ref = match, match = ref[0], type = ref[1], val = ref[2];
- item = item.replace(match, '');
- boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global';
- if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) {
- return;
- }
- if (type === 'password') {
- QR.persona.pwd = val;
- return;
- }
- if (type === 'options') {
- type = 'email';
- }
- if (type === 'subject') {
- type = 'sub';
- }
- if (/always/i.test(item)) {
- QR.persona.always[type] = val;
- }
- if (indexOf.call(types[type], val) < 0) {
- return types[type].push(val);
- }
- },
- loadPersonas: function(type, arr) {
- var k, len1, list, val;
- list = $("#list-" + type, QR.nodes.el);
- for (k = 0, len1 = arr.length; k < len1; k++) {
- val = arr[k];
- if (val) {
- $.add(list, $.el('option', {
- textContent: val
- }));
- }
- }
- },
- getPassword: function() {
- var input, m, ref;
- if (!QR.persona.pwd) {
- QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : ((ref = $.id('delPassword')) != null ? ref.value : void 0) || '';
- }
- return QR.persona.pwd;
- },
- get: function(cb) {
- return $.get('QR.persona', {}, function(arg) {
- var persona;
- persona = arg['QR.persona'];
- return cb(persona);
- });
- },
- set: function(post) {
- return $.get('QR.persona', {}, function(arg) {
- var persona;
- persona = arg['QR.persona'];
- persona = {
- name: post.name
- };
- return $.set('QR.persona', persona);
- });
- }
- };
-
- QR.post = (function() {
- function _Class(select) {
- this.select = bind(this.select, this);
- var el, event, k, label, len1, len2, prev, q, ref, ref1;
- el = $.el('a', {
- className: 'qr-preview',
- draggable: true,
- href: 'javascript:;'
- });
- $.extend(el, {
- innerHTML: " Spoiler "
- });
- this.nodes = {
- el: el,
- rm: el.firstChild,
- spoiler: $('.qr-preview-spoiler input', el),
- span: el.lastChild
- };
- $.on(el, 'click', this.select);
- $.on(this.nodes.rm, 'click', (function(_this) {
- return function(e) {
- e.stopPropagation();
- return _this.rm();
- };
- })(this));
- $.on(this.nodes.spoiler, 'change', (function(_this) {
- return function(e) {
- _this.spoiler = e.target.checked;
- if (_this === QR.selected) {
- return QR.nodes.spoiler.checked = _this.spoiler;
- }
- };
- })(this));
- ref = $$('label', el);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- label = ref[k];
- $.on(label, 'click', function(e) {
- return e.stopPropagation();
- });
- }
- $.add(QR.nodes.dumpList, el);
- ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- event = ref1[q];
- $.on(el, event.toLowerCase(), this[event]);
- }
- this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
- prev = QR.posts[QR.posts.length - 1];
- QR.posts.push(this);
- this.nodes.spoiler.checked = this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false;
- QR.persona.get((function(_this) {
- return function(persona) {
- _this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name;
- _this.email = 'email' in QR.persona.always ? QR.persona.always.email : '';
- _this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : '';
- if (QR.selected === _this) {
- return _this.load();
- }
- };
- })(this));
- if (select) {
- this.select();
- }
- this.unlock();
- $.queueTask(function() {
- return QR.captcha.onNewPost();
- });
- }
-
- _Class.prototype.rm = function() {
- var index;
- this["delete"]();
- index = QR.posts.indexOf(this);
- if (QR.posts.length === 1) {
- new QR.post(true);
- $.rmClass(QR.nodes.el, 'dump');
- } else if (this === QR.selected) {
- (QR.posts[index - 1] || QR.posts[index + 1]).select();
- }
- QR.posts.splice(index, 1);
- return QR.status();
- };
-
- _Class.prototype["delete"] = function() {
- $.rm(this.nodes.el);
- URL.revokeObjectURL(this.URL);
- return this.dismissErrors();
- };
-
- _Class.prototype.lock = function(lock) {
- var k, len1, name, node, ref;
- if (lock == null) {
- lock = true;
- }
- this.isLocked = lock;
- if (this !== QR.selected) {
- return;
- }
- ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- name = ref[k];
- if (node = QR.nodes[name]) {
- node.disabled = lock;
- }
- }
- this.nodes.rm.style.visibility = lock ? 'hidden' : '';
- this.nodes.spoiler.disabled = lock;
- return this.nodes.el.draggable = !lock;
- };
-
- _Class.prototype.unlock = function() {
- return this.lock(false);
- };
-
- _Class.prototype.select = function() {
- var rectEl, rectList;
- if (QR.selected) {
- QR.selected.nodes.el.removeAttribute('id');
- QR.selected.forceSave();
- }
- QR.selected = this;
- this.lock(this.isLocked);
- this.nodes.el.id = 'selected';
- rectEl = this.nodes.el.getBoundingClientRect();
- rectList = this.nodes.el.parentNode.getBoundingClientRect();
- this.nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2;
- return this.load();
- };
-
- _Class.prototype.load = function() {
- var k, len1, name, node, ref;
- ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- name = ref[k];
- if (!(node = QR.nodes[name])) {
- continue;
- }
- node.value = this[name] || node.dataset["default"] || '';
- }
- (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
- this.showFileData();
- return QR.characterCount();
- };
-
- _Class.prototype.save = function(input) {
- var name, ref;
- if (input.type === 'checkbox') {
- this.spoiler = input.checked;
- return;
- }
- name = input.dataset.name;
- this[name] = input.value || input.dataset["default"] || null;
- switch (name) {
- case 'thread':
- (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
- return QR.status();
- case 'com':
- this.updateComment();
- if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
- return QR.cooldown.auto = false;
- }
- break;
- case 'filename':
- if (!this.file) {
- return;
- }
- this.saveFilename();
- return this.updateFilename();
- case 'name':
- return QR.persona.set(this);
- }
- };
-
- _Class.prototype.forceSave = function() {
- var k, len1, name, node, ref;
- if (this !== QR.selected) {
- return;
- }
- ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- name = ref[k];
- if (!(node = QR.nodes[name])) {
- continue;
- }
- this.save(node);
- }
- };
-
- _Class.prototype.setComment = function(com) {
- this.com = com || null;
- if (this === QR.selected) {
- QR.nodes.com.value = this.com;
- }
- return this.updateComment();
- };
-
- _Class.prototype.updateComment = function() {
- if (this === QR.selected) {
- QR.characterCount();
- }
- this.nodes.span.textContent = this.com;
- return $.queueTask(function() {
- return QR.captcha.onPostChange();
- });
- };
-
- _Class.rmErrored = function(e) {
- var error, errors, k, len1, post, q, ref;
- e.stopPropagation();
- ref = QR.posts;
- for (k = ref.length - 1; k >= 0; k += -1) {
- post = ref[k];
- if (errors = post.errors) {
- for (q = 0, len1 = errors.length; q < len1; q++) {
- error = errors[q];
- if (!(doc.contains(error))) {
- continue;
- }
- post.rm();
- break;
- }
- }
- }
- };
-
- _Class.prototype.error = function(className, message) {
- var div, ref, rm, rmAll;
- div = $.el('div', {
- className: className
- });
- $.extend(div, {
- innerHTML: E(message) + " [delete ] [delete all ]"
- });
- (this.errors || (this.errors = [])).push(div);
- ref = $$('a', div), rm = ref[0], rmAll = ref[1];
- $.on(div, 'click', (function(_this) {
- return function() {
- if (indexOf.call(QR.posts, _this) >= 0) {
- return _this.select();
- }
- };
- })(this));
- $.on(rm, 'click', (function(_this) {
- return function(e) {
- e.stopPropagation();
- if (indexOf.call(QR.posts, _this) >= 0) {
- return _this.rm();
- }
- };
- })(this));
- $.on(rmAll, 'click', QR.post.rmErrored);
- return QR.error(div, true);
- };
-
- _Class.prototype.fileError = function(message) {
- return this.error('file-error', this.filename + ": " + message);
- };
-
- _Class.prototype.dismissErrors = function(test) {
- var error, k, len1, ref;
- if (test == null) {
- test = function() {
- return true;
- };
- }
- if (this.errors) {
- ref = this.errors;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- error = ref[k];
- if (doc.contains(error) && test(error)) {
- error.parentNode.previousElementSibling.click();
- }
- }
- }
- };
-
- _Class.prototype.setFile = function(file1) {
- var ext, ref;
- this.file = file1;
- if (Conf['Randomize Filename'] && g.BOARD.ID !== 'f') {
- this.filename = "" + (Date.now() - Math.floor(Math.random() * 365 * $.DAY));
- if (ext = this.file.name.match(QR.validExtension)) {
- this.filename += ext[0];
- }
- } else {
- this.filename = this.file.name;
- }
- this.filesize = $.bytesToString(this.file.size);
- this.checkSize();
- $.addClass(this.nodes.el, 'has-file');
- $.queueTask(function() {
- return QR.captcha.onPostChange();
- });
- URL.revokeObjectURL(this.URL);
- this.saveFilename();
- if (this === QR.selected) {
- this.showFileData();
- } else {
- this.updateFilename();
- }
- this.nodes.el.style.backgroundImage = null;
- if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) {
- return this.fileError('Unsupported file type.');
- } else if (/^(image|video)\//.test(this.file.type)) {
- return this.readFile();
- }
- };
-
- _Class.prototype.checkSize = function() {
- var max;
- max = QR.max_size;
- if (/^video\//.test(this.file.type)) {
- max = Math.min(max, QR.max_size_video);
- }
- if (this.file.size > max) {
- return this.fileError("File too large (file: " + this.filesize + ", max: " + ($.bytesToString(max)) + ").");
- }
- };
-
- _Class.prototype.readFile = function() {
- var el, event, isVideo, onerror, onload;
- isVideo = /^video\//.test(this.file.type);
- el = $.el(isVideo ? 'video' : 'img');
- if (isVideo && !el.canPlayType(this.file.type)) {
- return;
- }
- event = isVideo ? 'loadeddata' : 'load';
- onload = (function(_this) {
- return function() {
- $.off(el, event, onload);
- $.off(el, 'error', onerror);
- _this.checkDimensions(el);
- return _this.setThumbnail(el);
- };
- })(this);
- onerror = (function(_this) {
- return function() {
- $.off(el, event, onload);
- $.off(el, 'error', onerror);
- _this.fileError((isVideo ? 'Video' : 'Image') + " appears corrupt");
- return URL.revokeObjectURL(el.src);
- };
- })(this);
- $.on(el, event, onload);
- $.on(el, 'error', onerror);
- return el.src = URL.createObjectURL(this.file);
- };
-
- _Class.prototype.checkDimensions = function(el) {
- var duration, height, max_height, max_width, ref, videoHeight, videoWidth, width;
- if (el.tagName === 'IMG') {
- height = el.height, width = el.width;
- if (height > QR.max_height || width > QR.max_width) {
- this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
- }
- if (height < QR.min_height || width < QR.min_width) {
- return this.fileError("Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
- }
- } else {
- videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration;
- max_height = Math.min(QR.max_height, QR.max_height_video);
- max_width = Math.min(QR.max_width, QR.max_width_video);
- if (videoHeight > max_height || videoWidth > max_width) {
- this.fileError("Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
- }
- if (videoHeight < QR.min_height || videoWidth < QR.min_width) {
- this.fileError("Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
- }
- if (!isFinite(duration)) {
- this.fileError('Video lacks duration metadata (try remuxing)');
- } else if (duration > QR.max_duration_video) {
- this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
- }
- if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg') && $.hasAudio(el)) {
- return this.fileError('Audio not allowed');
- }
- }
- };
-
- _Class.prototype.setThumbnail = function(el) {
- var cv, height, isVideo, s, width;
- isVideo = el.tagName === 'VIDEO';
- s = 90 * 2 * window.devicePixelRatio;
- if (this.file.type === 'image/gif') {
- s *= 3;
- }
- if (isVideo) {
- height = el.videoHeight;
- width = el.videoWidth;
- } else {
- height = el.height, width = el.width;
- if (height < s || width < s) {
- this.URL = el.src;
- this.nodes.el.style.backgroundImage = "url(" + this.URL + ")";
- return;
- }
- }
- if (height <= width) {
- width = s / height * width;
- height = s;
- } else {
- height = s / width * height;
- width = s;
- }
- cv = $.el('canvas');
- cv.height = height;
- cv.width = width;
- cv.getContext('2d').drawImage(el, 0, 0, width, height);
- URL.revokeObjectURL(el.src);
- return cv.toBlob((function(_this) {
- return function(blob) {
- _this.URL = URL.createObjectURL(blob);
- return _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")";
- };
- })(this));
- };
-
- _Class.prototype.rmFile = function() {
- if (this.isLocked) {
- return;
- }
- delete this.file;
- delete this.filename;
- delete this.filesize;
- this.nodes.el.removeAttribute('title');
- QR.nodes.filename.removeAttribute('title');
- this.nodes.el.style.backgroundImage = null;
- $.rmClass(this.nodes.el, 'has-file');
- this.showFileData();
- URL.revokeObjectURL(this.URL);
- return this.dismissErrors(function(error) {
- return $.hasClass(error, 'file-error');
- });
- };
-
- _Class.prototype.saveFilename = function() {
- this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-');
- if (!QR.validExtension.test(this.filename)) {
- return this.file.newName += "." + (QR.extensionFromType[this.file.type] || 'jpg');
- }
- };
-
- _Class.prototype.updateFilename = function() {
- var long;
- long = this.filename + " (" + this.filesize + ")";
- this.nodes.el.title = long;
- if (this !== QR.selected) {
- return;
- }
- return QR.nodes.filename.title = long;
- };
-
- _Class.prototype.showFileData = function() {
- var ref;
- if (this.file) {
- this.updateFilename();
- QR.nodes.filename.value = this.filename;
- $.addClass(QR.nodes.oekaki, 'has-file');
- $.addClass(QR.nodes.fileSubmit, 'has-file');
- } else {
- $.rmClass(QR.nodes.oekaki, 'has-file');
- $.rmClass(QR.nodes.fileSubmit, 'has-file');
- }
- if (((ref = this.file) != null ? ref.source : void 0) != null) {
- QR.nodes.fileSubmit.dataset.source = this.file.source;
- } else {
- QR.nodes.fileSubmit.removeAttribute('data-source');
- }
- return QR.nodes.spoiler.checked = this.spoiler;
- };
-
- _Class.prototype.pasteText = function(file) {
- var reader;
- this.pasting = true;
- reader = new FileReader();
- reader.onload = (function(_this) {
- return function(e) {
- var result;
- result = e.target.result;
- _this.setComment((_this.com ? _this.com + "\n" + result : result));
- return delete _this.pasting;
- };
- })(this);
- return reader.readAsText(file);
- };
-
- _Class.prototype.dragStart = function(e) {
- var left, ref, top;
- ref = this.getBoundingClientRect(), left = ref.left, top = ref.top;
- e.dataTransfer.setDragImage(this, e.clientX - left, e.clientY - top);
- return $.addClass(this, 'drag');
- };
-
- _Class.prototype.dragEnd = function() {
- return $.rmClass(this, 'drag');
- };
-
- _Class.prototype.dragEnter = function() {
- return $.addClass(this, 'over');
- };
-
- _Class.prototype.dragLeave = function() {
- return $.rmClass(this, 'over');
- };
-
- _Class.prototype.dragOver = function(e) {
- e.preventDefault();
- return e.dataTransfer.dropEffect = 'move';
- };
-
- _Class.prototype.drop = function() {
- var el, index, newIndex, oldIndex, post;
- $.rmClass(this, 'over');
- if (!this.draggable) {
- return;
- }
- el = $('.drag', this.parentNode);
- index = function(el) {
- return slice.call(el.parentNode.children).indexOf(el);
- };
- oldIndex = index(el);
- newIndex = index(this);
- (oldIndex < newIndex ? $.after : $.before)(this, el);
- post = QR.posts.splice(oldIndex, 1)[0];
- QR.posts.splice(newIndex, 0, post);
- return QR.status();
- };
-
- return _Class;
-
- })();
-
- FappeTyme = {
- init: function() {
- var el, k, lc, len1, ref, ref1, type;
- if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread'))) {
- return;
- }
- this.nodes = {};
- this.enabled = {
- fappe: false,
- werk: Conf['werk']
- };
- ref1 = ["Fappe", "Werk"];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- type = ref1[k];
- if (!Conf[type + " Tyme"]) {
- continue;
- }
- lc = type.toLowerCase();
- el = UI.checkbox(lc, type + " Tyme", false);
- el.title = type + " Tyme";
- this.nodes[lc] = el.firstElementChild;
- if (Conf[lc]) {
- this.set(lc, true);
- }
- $.on(this.nodes[lc], 'change', this.toggle.bind(this, lc));
- Header.menu.addEntry({
- el: el,
- order: 97
- });
- }
- if (Conf['Werk Tyme']) {
- $.sync('werk', this.set.bind(this, 'werk'));
- }
- Post.callbacks.push({
- name: 'Fappe Tyme',
- cb: this.node
- });
- return CatalogThread.callbacks.push({
- name: 'Werk Tyme',
- cb: this.catalogNode
- });
- },
- node: function() {
- return this.nodes.root.classList.toggle('noFile', !this.file);
- },
- catalogNode: function() {
- var file, filename;
- file = this.thread.OP.file;
- if (!file) {
- return;
- }
- filename = $.el('div', {
- textContent: file.name,
- className: 'werkTyme-filename'
- });
- return $.add(this.nodes.thumb.parentNode, filename);
- },
- set: function(type, enabled) {
- this.enabled[type] = this.nodes[type].checked = enabled;
- return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme");
- },
- toggle: function(type) {
- this.set(type, !this.enabled[type]);
- if (type === 'werk') {
- return $.cb.checked.call(this.nodes[type]);
- }
- }
- };
-
- Gallery = {
- init: function() {
- var el, ref;
- if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
- return;
- }
- this.delay = Conf['Slide Delay'];
- el = $.el('a', {
- href: 'javascript:;',
- id: 'appchan-gal',
- title: 'Gallery',
- className: 'fa fa-picture-o',
- textContent: 'Gallery'
- });
- $.on(el, 'click', this.cb.toggle);
- Header.addShortcut(el);
- return Post.callbacks.push({
- name: 'Gallery',
- cb: this.node
- });
- },
- node: function() {
- var ref;
- if (!((ref = this.file) != null ? ref.thumb : void 0)) {
- return;
- }
- if (Gallery.nodes) {
- Gallery.generateThumb(this);
- Gallery.nodes.total.textContent = Gallery.images.length;
- }
- if (!Conf['Image Expansion']) {
- return $.on(this.file.thumb.parentNode, 'click', Gallery.cb.image);
- }
- },
- build: function(image) {
- var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, ref3, thumb, value;
- cb = Gallery.cb;
- if (Conf['Fullscreen Gallery']) {
- $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
- return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
- });
- if (typeof doc.mozRequestFullScreen === "function") {
- doc.mozRequestFullScreen();
- }
- if (typeof doc.webkitRequestFullScreen === "function") {
- doc.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
- }
- }
- Gallery.images = [];
- nodes = Gallery.nodes = {};
- Gallery.fullIDs = {};
- Gallery.slideshow = false;
- nodes.el = dialog = $.el('div', {
- id: 'a-gallery'
- });
- $.extend(dialog, {
- innerHTML: "
"
- });
- ref = {
- buttons: '.gal-buttons',
- frame: '.gal-image',
- name: '.gal-name',
- count: '.count',
- total: '.total',
- thumbs: '.gal-thumbnails',
- next: '.gal-image a',
- current: '.gal-image img'
- };
- for (key in ref) {
- value = ref[key];
- nodes[key] = $(value, dialog);
- }
- menuButton = $('.menu-button', dialog);
- nodes.menu = new UI.Menu('gallery');
- $.on(nodes.frame, 'click', cb.blank);
- if (Conf['Mouse Wheel Volume']) {
- $.on(nodes.frame, 'wheel', Volume.wheel);
- }
- $.on(nodes.next, 'click', cb.click);
- $.on(nodes.name, 'click', ImageCommon.download);
- $.on($('.gal-prev', dialog), 'click', cb.prev);
- $.on($('.gal-next', dialog), 'click', cb.next);
- $.on($('.gal-start', dialog), 'click', cb.start);
- $.on($('.gal-stop', dialog), 'click', cb.stop);
- $.on($('.gal-close', dialog), 'click', cb.close);
- $.on(menuButton, 'click', function(e) {
- return nodes.menu.toggle(e, this, g);
- });
- ref1 = Gallery.menu.createSubEntries();
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- entry = ref1[k];
- entry.order = 0;
- nodes.menu.addEntry(entry);
- }
- $.on(d, 'keydown', cb.keybinds);
- if (Conf['Keybinds']) {
- $.off(d, 'keydown', Keybinds.keydown);
- }
- $.on(window, 'resize', Gallery.cb.setHeight);
- ref2 = $$('.post .file');
- for (q = 0, len2 = ref2.length; q < len2; q++) {
- file = ref2[q];
- post = Get.postFromNode(file);
- if (!((ref3 = post.file) != null ? ref3.thumb : void 0)) {
- continue;
- }
- Gallery.generateThumb(post);
- if (!image && Gallery.fullIDs[post.fullID]) {
- candidate = post.file.thumb.parentNode;
- if (Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0) {
- image = candidate;
- }
- }
- }
- $.addClass(doc, 'gallery-open');
- $.add(d.body, dialog);
- nodes.thumbs.scrollTop = 0;
- nodes.current.parentElement.scrollTop = 0;
- if (image) {
- thumb = $("[href='" + image.href + "']", nodes.thumbs);
- }
- thumb || (thumb = Gallery.images[Gallery.images.length - 1]);
- if (thumb) {
- Gallery.open(thumb);
- }
- doc.style.overflow = 'hidden';
- return nodes.total.textContent = Gallery.images.length;
- },
- generateThumb: function(post) {
- var thumb, thumbImg;
- if (post.isClone || post.isHidden) {
- return;
- }
- if (!(post.file && post.file.thumb && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
- return;
- }
- if (Gallery.fullIDs[post.fullID]) {
- return;
- }
- Gallery.fullIDs[post.fullID] = true;
- thumb = $.el('a', {
- className: 'gal-thumb',
- href: post.file.url,
- target: '_blank',
- title: post.file.name
- });
- thumb.dataset.id = Gallery.images.length;
- thumb.dataset.post = post.fullID;
- thumbImg = post.file.thumb.cloneNode(false);
- thumbImg.style.cssText = '';
- $.add(thumb, thumbImg);
- $.on(thumb, 'click', Gallery.cb.open);
- Gallery.images.push(thumb);
- return $.add(Gallery.nodes.thumbs, thumb);
- },
- load: function(thumb, errorCB) {
- var elType, ext, file;
- ext = thumb.href.match(/\w*$/);
- elType = {
- 'webm': 'video',
- 'pdf': 'iframe'
- }[ext] || 'img';
- file = $.el(elType, {
- title: thumb.title
- });
- $.extend(file.dataset, thumb.dataset);
- $.on(file, 'error', errorCB);
- file.src = thumb.href;
- return file;
- },
- open: function(thumb) {
- var el, file, newID, nodes, oldID, post, ref;
- nodes = Gallery.nodes;
- oldID = +nodes.current.dataset.id;
- newID = +thumb.dataset.id;
- if (el = Gallery.images[oldID]) {
- $.rmClass(el, 'gal-highlight');
- }
- $.addClass(thumb, 'gal-highlight');
- nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
- if (((ref = Gallery.cache) != null ? ref.dataset.id : void 0) === '' + newID) {
- file = Gallery.cache;
- $.off(file, 'error', Gallery.cacheError);
- $.on(file, 'error', Gallery.error);
- } else {
- file = Gallery.load(thumb, Gallery.error);
- }
- $.off(nodes.current, 'error', Gallery.error);
- ImageCommon.pause(nodes.current);
- $.replace(nodes.current, file);
- nodes.current = file;
- if (file.nodeName === 'VIDEO') {
- file.loop = true;
- Volume.setup(file);
- if (Conf['Autoplay']) {
- file.play();
- }
- if (Conf['Show Controls']) {
- ImageCommon.addControls(file);
- }
- }
- doc.classList.toggle('gal-pdf', file.nodeName === 'IFRAME');
- Gallery.cb.setHeight();
- nodes.count.textContent = +thumb.dataset.id + 1;
- nodes.name.download = nodes.name.textContent = thumb.title;
- nodes.name.href = thumb.href;
- nodes.frame.scrollTop = 0;
- nodes.next.focus();
- if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) {
- Gallery.setupTimer();
- } else {
- Gallery.cb.stop();
- }
- if (Conf['Scroll to Post'] && (post = g.posts[file.dataset.post])) {
- Header.scrollTo(post.nodes.root);
- }
- if (isNaN(oldID) || newID === (oldID + 1) % Gallery.images.length) {
- return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError);
- }
- },
- error: function() {
- var ref;
- if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
- return new Notice('error', 'Corrupt or unplayable video', 30);
- }
- if (this.src.split('/')[2] !== 'i.4cdn.org') {
- return;
- }
- return ImageCommon.error(this, g.posts[this.dataset.post], null, (function(_this) {
- return function(url) {
- if (!url) {
- return;
- }
- Gallery.images[_this.dataset.id].href = url;
- if (Gallery.nodes.current === _this) {
- return _this.src = url;
- }
- };
- })(this));
- },
- cacheError: function() {
- return delete Gallery.cache;
- },
- cleanupTimer: function() {
- var current;
- clearTimeout(Gallery.timeoutID);
- current = Gallery.nodes.current;
- $.off(current, 'canplaythrough load', Gallery.startTimer);
- return $.off(current, 'ended', Gallery.cb.next);
- },
- startTimer: function() {
- return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * $.SECOND);
- },
- setupTimer: function() {
- var current, isVideo;
- Gallery.cleanupTimer();
- current = Gallery.nodes.current;
- isVideo = current.nodeName === 'VIDEO';
- if (isVideo) {
- current.play();
- }
- if ((isVideo ? current.readyState >= 4 : current.complete) || current.nodeName === 'IFRAME') {
- return Gallery.startTimer();
- } else {
- return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer);
- }
- },
- checkTimer: function() {
- var current;
- current = Gallery.nodes.current;
- if (current.nodeName === 'VIDEO' && !current.paused) {
- $.on(current, 'ended', Gallery.cb.next);
- return current.loop = false;
- } else {
- return Gallery.cb.next();
- }
- },
- cb: {
- keybinds: function(e) {
- var cb, key;
- if (!(key = Keybinds.keyCode(e))) {
- return;
- }
- cb = (function() {
- switch (key) {
- case Conf['Close']:
- case Conf['Open Gallery']:
- return Gallery.cb.close;
- case 'Right':
- return Gallery.cb.next;
- case 'Enter':
- return Gallery.cb.advance;
- case 'Left':
- case '':
- return Gallery.cb.prev;
- case Conf['Pause']:
- return Gallery.cb.pause;
- case Conf['Slideshow']:
- return Gallery.cb.toggleSlideshow;
- }
- })();
- if (!cb) {
- return;
- }
- e.stopPropagation();
- e.preventDefault();
- return cb();
- },
- open: function(e) {
- if (e) {
- e.preventDefault();
- }
- if (this) {
- return Gallery.open(this);
- }
- },
- image: function(e) {
- e.preventDefault();
- e.stopPropagation();
- return Gallery.build(this);
- },
- prev: function() {
- return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]);
- },
- next: function() {
- return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]);
- },
- click: function(e) {
- if (ImageCommon.onControls(e)) {
- return;
- }
- e.preventDefault();
- return Gallery.cb.advance();
- },
- advance: function() {
- if (!Conf['Autoplay'] && Gallery.nodes.current.paused) {
- return Gallery.nodes.current.play();
- } else {
- return Gallery.cb.next();
- }
- },
- toggle: function() {
- return (Gallery.nodes ? Gallery.cb.close : Gallery.build)();
- },
- blank: function(e) {
- if (e.target === this) {
- return Gallery.cb.close();
- }
- },
- toggleSlideshow: function() {
- return Gallery.cb[Gallery.slideshow ? 'stop' : 'start']();
- },
- pause: function() {
- var current;
- Gallery.cb.stop();
- current = Gallery.nodes.current;
- if (current.nodeName === 'VIDEO') {
- return current[current.paused ? 'play' : 'pause']();
- }
- },
- start: function() {
- $.addClass(Gallery.nodes.buttons, 'gal-playing');
- Gallery.slideshow = true;
- return Gallery.setupTimer();
- },
- stop: function() {
- var current;
- if (!Gallery.slideshow) {
- return;
- }
- Gallery.cleanupTimer();
- current = Gallery.nodes.current;
- if (current.nodeName === 'VIDEO') {
- current.loop = true;
- }
- $.rmClass(Gallery.nodes.buttons, 'gal-playing');
- return Gallery.slideshow = false;
- },
- close: function() {
- $.off(Gallery.nodes.current, 'error', Gallery.error);
- ImageCommon.pause(Gallery.nodes.current);
- $.rm(Gallery.nodes.el);
- $.rmClass(doc, 'gallery-open');
- if (Conf['Fullscreen Gallery']) {
- $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close);
- if (typeof d.mozCancelFullScreen === "function") {
- d.mozCancelFullScreen();
- }
- if (typeof d.webkitExitFullscreen === "function") {
- d.webkitExitFullscreen();
- }
- }
- delete Gallery.nodes;
- delete Gallery.fullIDs;
- doc.style.overflow = '';
- $.off(d, 'keydown', Gallery.cb.keybinds);
- if (Conf['Keybinds']) {
- $.on(d, 'keydown', Keybinds.keydown);
- }
- $.off(window, 'resize', Gallery.cb.setHeight);
- return clearTimeout(Gallery.timeoutID);
- },
- setFitness: function() {
- return (this.checked ? $.addClass : $.rmClass)(doc, "gal-" + (this.name.toLowerCase().replace(/\s+/g, '-')));
- },
- setHeight: $.debounce(100, function() {
- var current, dim, frame, height, minHeight, ref, ref1, ref2, style, width;
- ref = Gallery.nodes, current = ref.current, frame = ref.frame;
- style = current.style;
- if (Conf['Stretch to Fit'] && (dim = (ref1 = g.posts[current.dataset.post]) != null ? ref1.file.dimensions : void 0)) {
- ref2 = dim.split('x'), width = ref2[0], height = ref2[1];
- minHeight = Math.min(doc.clientHeight - 25, height / width * frame.clientWidth);
- style.minHeight = minHeight + 'px';
- return style.minWidth = (width / height * minHeight) + 'px';
- } else {
- return style.minHeight = style.minWidth = null;
- }
- }),
- setDelay: function() {
- return Gallery.delay = +this.value;
- }
- },
- menu: {
- init: function() {
- var el;
- if (!Gallery.enabled) {
- return;
- }
- el = $.el('span', {
- textContent: 'Gallery',
- className: 'gallery-link'
- });
- return Header.menu.addEntry({
- el: el,
- order: 105,
- subEntries: Gallery.menu.createSubEntries()
- });
- },
- createSubEntry: function(name) {
- var input, label;
- label = UI.checkbox(name, name);
- input = label.firstElementChild;
- if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height') {
- $.on(input, 'change', Gallery.cb.setFitness);
- }
- $.event('change', null, input);
- $.on(input, 'change', $.cb.checked);
- if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height' || name === 'Stretch to Fit') {
- $.on(input, 'change', Gallery.cb.setHeight);
- }
- return {
- el: label
- };
- },
- createSubEntries: function() {
- var delayInput, delayLabel, item, subEntries;
- subEntries = (function() {
- var k, len1, ref, results;
- ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'];
- results = [];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- item = ref[k];
- results.push(Gallery.menu.createSubEntry(item));
- }
- return results;
- })();
- delayLabel = $.el('label', {
- innerHTML: "Slide Delay: "
- });
- delayInput = delayLabel.firstElementChild;
- delayInput.value = Gallery.delay;
- $.on(delayInput, 'change', Gallery.cb.setDelay);
- $.on(delayInput, 'change', $.cb.value);
- subEntries.push({
- el: delayLabel
- });
- return subEntries;
- }
- }
- };
-
- ImageCommon = {
- pause: function(video) {
- if (video.nodeName !== 'VIDEO') {
- return;
- }
- video.pause();
- $.off(video, 'volumechange', Volume.change);
- return video.muted = true;
- },
- rewind: function(el) {
- if (el.nodeName === 'VIDEO') {
- if (el.readyState >= el.HAVE_METADATA) {
- return el.currentTime = 0;
- }
- } else if (/\.gif$/.test(el.src)) {
- return $.queueTask(function() {
- return el.src = el.src;
- });
- }
- },
- pushCache: function(el) {
- ImageCommon.cache = el;
- return $.on(el, 'error', ImageCommon.cacheError);
- },
- popCache: function() {
- var el;
- el = ImageCommon.cache;
- $.off(el, 'error', ImageCommon.cacheError);
- delete ImageCommon.cache;
- return el;
- },
- cacheError: function() {
- if (ImageCommon.cache === this) {
- return delete ImageCommon.cache;
- }
- },
- decodeError: function(file, post) {
- var message, ref;
- if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
- return false;
- }
- if (!(message = $('.warning', post.file.thumb.parentNode))) {
- message = $.el('div', {
- className: 'warning'
- });
- $.after(post.file.thumb, message);
- }
- message.textContent = 'Error: Corrupt or unplayable video';
- return true;
- },
- error: function(file, post, delay, cb) {
- var URL, redirect, src, timeoutID;
- src = post.file.url.split('/');
- URL = Redirect.to('file', {
- boardID: post.board.ID,
- filename: src[src.length - 1]
- });
- if (!(Conf['404 Redirect'] && URL && Redirect.securityCheck(URL))) {
- URL = null;
- }
- if ((post.isDead || post.file.isDead) && file.src.split('/')[2] === 'i.4cdn.org') {
- return cb(URL);
- }
- if (delay != null) {
- timeoutID = setTimeout((function() {
- return cb(URL);
- }), delay);
- }
- if (post.isDead || post.file.isDead) {
- return;
- }
- redirect = function() {
- if (file.src.split('/')[2] === 'i.4cdn.org') {
- if (delay != null) {
- clearTimeout(timeoutID);
- }
- return cb(URL);
- }
- };
- return $.ajax("//a.4cdn.org/" + post.board + "/thread/" + post.thread + ".json", {
- onload: function() {
- var k, len1, postObj, ref;
- if (this.status === 404) {
- post.kill();
- }
- if (this.status !== 200) {
- return redirect();
- }
- ref = this.response.posts;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- postObj = ref[k];
- if (postObj.no === post.ID) {
- break;
- }
- }
- if (postObj.no !== post.ID) {
- post.kill();
- return redirect();
- } else if (postObj.filedeleted) {
- post.kill(true);
- return redirect();
- } else {
- return URL = post.file.url;
- }
- }
- });
- },
- addControls: function(video) {
- var handler;
- handler = function() {
- var t;
- $.off(video, 'mouseover', handler);
- t = new Date().getTime();
- return $.asap((function() {
- return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000;
- }), function() {
- return video.controls = true;
- });
- };
- return $.on(video, 'mouseover', handler);
- },
- onControls: function(e) {
- return (Conf['Show Controls'] && Conf['Click Passthrough'] && e.target.nodeName === 'VIDEO') || (e.target.controls && e.target.getBoundingClientRect().bottom - e.clientY < 35);
- },
- download: function(e) {
- if (this.protocol === 'blob:') {
- return true;
- }
- e.preventDefault();
- return CrossOrigin.file(this.href, (function(_this) {
- return function(blob) {
- if (blob) {
- _this.href = URL.createObjectURL(blob);
- return _this.click();
- } else {
- return new Notice('error', "Could not download " + _this.href, 30);
- }
- };
- })(this));
- }
- };
-
- ImageExpand = {
- init: function() {
- var ref;
- if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
- return;
- }
- this.EAI = $.el('a', {
- className: 'expand-all-shortcut fa fa-expand',
- textContent: 'EAI',
- title: 'Expand All Images',
- href: 'javascript:;'
- });
- $.on(this.EAI, 'click', this.cb.toggleAll);
- Header.addShortcut(this.EAI, 3);
- $.on(d, 'scroll visibilitychange', this.cb.playVideos);
- this.videoControls = $.el('span', {
- className: 'video-controls'
- });
- $.extend(this.videoControls, {
- innerHTML: "Â contract "
- });
- return Post.callbacks.push({
- name: 'Image Expansion',
- cb: this.node
- });
- },
- node: function() {
- var ref;
- if (!(this.file && (this.file.isImage || this.file.isVideo))) {
- return;
- }
- $.on(this.file.thumb.parentNode, 'click', ImageExpand.cb.toggle);
- if (this.isClone) {
- if (this.file.isExpanding) {
- ImageExpand.contract(this);
- return ImageExpand.expand(this);
- } else if (this.file.isExpanded && this.file.isVideo) {
- Volume.setup(this.file.fullImage);
- ImageExpand.setupVideoCB(this);
- return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
- }
- } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) {
- return ImageExpand.expand(this);
- }
- },
- cb: {
- toggle: function(e) {
- var file, post, ref;
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- post = Get.postFromNode(this);
- file = post.file;
- if (file.isExpanded && ImageCommon.onControls(e)) {
- return;
- }
- e.preventDefault();
- if (!Conf['Autoplay'] && ((ref = file.fullImage) != null ? ref.paused : void 0)) {
- return file.fullImage.play();
- } else {
- return ImageExpand.toggle(post);
- }
- },
- toggleAll: function() {
- var func, toggle;
- $.event('CloseMenu');
- toggle = function(post) {
- var file;
- file = post.file;
- if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
- return;
- }
- if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || !Conf['Expand videos'] && file.isVideo || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
- return;
- }
- return $.queueTask(func, post);
- };
- if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) {
- ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress';
- ImageExpand.EAI.title = 'Contract All Images';
- func = ImageExpand.expand;
- } else {
- ImageExpand.EAI.className = 'expand-all-shortcut fa fa-expand';
- ImageExpand.EAI.title = 'Expand All Images';
- func = ImageExpand.contract;
- }
- return g.posts.forEach(function(post) {
- var k, len1, ref;
- ref = [post].concat(slice.call(post.clones));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post = ref[k];
- toggle(post);
- }
- });
- },
- playVideos: function() {
- return g.posts.forEach(function(post) {
- var file, k, len1, ref, video, visible;
- ref = [post].concat(slice.call(post.clones));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post = ref[k];
- file = post.file;
- if (!(file && file.isVideo && file.isExpanded)) {
- continue;
- }
- video = file.fullImage;
- visible = ($.hasAudio(video) && !video.muted) || Header.isNodeVisible(video);
- if (visible && file.wasPlaying) {
- delete file.wasPlaying;
- video.play();
- } else if (!visible && !video.paused) {
- file.wasPlaying = true;
- video.pause();
- }
- }
- });
- },
- setFitness: function() {
- return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\s+/g, '-'));
- }
- },
- toggle: function(post) {
- var next;
- if (!(post.file.isExpanding || post.file.isExpanded)) {
- post.file.scrollIntoView = Conf['Scroll into view'];
- ImageExpand.expand(post);
- return;
- }
- ImageExpand.contract(post);
- if (Conf['Advance on contract']) {
- next = post.nodes.root;
- while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
- if (!($('.stub', next) || next.offsetHeight === 0)) {
- break;
- }
- }
- if (next) {
- return Header.scrollTo(next);
- }
- }
- },
- contract: function(post) {
- var bottom, cb, el, eventName, file, k, len1, oldHeight, ref, ref1, scrollY, top, x;
- file = post.file;
- if (el = file.fullImage) {
- top = Header.getTopOf(el);
- bottom = top + el.getBoundingClientRect().height;
- oldHeight = d.body.clientHeight;
- scrollY = window.scrollY;
- }
- $.rmClass(post.nodes.root, 'expanded-image');
- $.rmClass(file.thumb, 'expanding');
- $.rm(file.videoControls);
- file.thumb.parentNode.href = file.url;
- file.thumb.parentNode.target = '_blank';
- ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- x = ref[k];
- delete file[x];
- }
- if (!el) {
- return;
- }
- if (doc.contains(el)) {
- if (bottom <= 0) {
- window.scroll(0, scrollY + d.body.clientHeight - oldHeight);
- } else {
- Header.scrollToIfNeeded(post.nodes.root);
- }
- if (window.scrollX > 0) {
- window.scroll(0, window.scrollY);
- }
- }
- $.off(el, 'error', ImageExpand.error);
- ImageCommon.pushCache(el);
- if (file.isVideo) {
- ImageCommon.pause(el);
- ref1 = ImageExpand.videoCB;
- for (eventName in ref1) {
- cb = ref1[eventName];
- $.off(el, eventName, cb);
- }
- }
- if (Conf['Restart when Opened']) {
- ImageCommon.rewind(file.thumb);
- }
- delete file.fullImage;
- return $.queueTask(function() {
- if (file.isExpanding || file.isExpanded) {
- return;
- }
- $.rmClass(el, 'full-image');
- if (el.id) {
- return;
- }
- return $.rm(el);
- });
- },
- expand: function(post, src) {
- var el, file, isVideo, ref, thumb;
- file = post.file;
- thumb = file.thumb, isVideo = file.isVideo;
- if (post.isHidden || file.isExpanding || file.isExpanded) {
- return;
- }
- $.addClass(thumb, 'expanding');
- file.isExpanding = true;
- if (file.fullImage) {
- el = file.fullImage;
- } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
- el = file.fullImage = ImageCommon.popCache();
- $.on(el, 'error', ImageExpand.error);
- if (Conf['Restart when Opened'] && el.id !== 'ihover') {
- ImageCommon.rewind(el);
- }
- el.removeAttribute('id');
- } else {
- el = file.fullImage = $.el((isVideo ? 'video' : 'img'));
- el.dataset.fullID = post.fullID;
- $.on(el, 'error', ImageExpand.error);
- el.src = src || file.url;
- }
- el.className = 'full-image';
- $.after(thumb, el);
- if (isVideo) {
- if (Conf['Show Controls'] && Conf['Click Passthrough'] && !file.videoControls) {
- file.videoControls = ImageExpand.videoControls.cloneNode(true);
- $.add(file.text, file.videoControls);
- }
- thumb.parentNode.removeAttribute('href');
- thumb.parentNode.removeAttribute('target');
- el.loop = true;
- Volume.setup(el);
- ImageExpand.setupVideoCB(post);
- }
- if (!isVideo) {
- return $.asap((function() {
- return el.naturalHeight;
- }), function() {
- return ImageExpand.completeExpand(post);
- });
- } else if (el.readyState >= el.HAVE_METADATA) {
- return ImageExpand.completeExpand(post);
- } else {
- return $.on(el, 'loadedmetadata', function() {
- return ImageExpand.completeExpand(post);
- });
- }
- },
- completeExpand: function(post) {
- var bottom, file, imageBottom, oldHeight, scrollY;
- file = post.file;
- if (!file.isExpanding) {
- return;
- }
- bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height;
- oldHeight = d.body.clientHeight;
- scrollY = window.scrollY;
- $.addClass(post.nodes.root, 'expanded-image');
- $.rmClass(file.thumb, 'expanding');
- file.isExpanded = true;
- delete file.isExpanding;
- if (doc.contains(post.nodes.root) && bottom <= 0) {
- window.scroll(window.scrollX, scrollY + d.body.clientHeight - oldHeight);
- }
- if (file.scrollIntoView) {
- delete file.scrollIntoView;
- imageBottom = Math.min(doc.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header.getBottomOf(file.fullImage));
- if (imageBottom < 0) {
- window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage)));
- }
- }
- if (file.isVideo) {
- return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']);
- }
- },
- setupVideo: function(post, playing, controls) {
- var fullImage;
- fullImage = post.file.fullImage;
- if (!playing) {
- fullImage.controls = controls;
- return;
- }
- fullImage.controls = false;
- $.asap((function() {
- return doc.contains(fullImage);
- }), function() {
- if (!d.hidden && Header.isNodeVisible(fullImage)) {
- return fullImage.play();
- } else {
- return post.file.wasPlaying = true;
- }
- });
- if (controls) {
- return ImageCommon.addControls(fullImage);
- }
- },
- videoCB: (function() {
- var mousedown;
- mousedown = false;
- return {
- mouseover: function() {
- return mousedown = false;
- },
- mousedown: function(e) {
- if (e.button === 0) {
- return mousedown = true;
- }
- },
- mouseup: function(e) {
- if (e.button === 0) {
- return mousedown = false;
- }
- },
- mouseout: function(e) {
- if (mousedown && e.clientX <= this.getBoundingClientRect().left) {
- return ImageExpand.toggle(Get.postFromNode(this));
- }
- }
- };
- })(),
- setupVideoCB: function(post) {
- var cb, eventName, ref;
- ref = ImageExpand.videoCB;
- for (eventName in ref) {
- cb = ref[eventName];
- $.on(post.file.fullImage, eventName, cb);
- }
- if (post.file.videoControls) {
- return $.on(post.file.videoControls.firstElementChild, 'click', function() {
- return ImageExpand.toggle(post);
- });
- }
- },
- error: function() {
- var post;
- post = Get.postFromNode(this);
- $.rm(this);
- delete post.file.fullImage;
- if (!(post.file.isExpanding || post.file.isExpanded)) {
- return;
- }
- if (ImageCommon.decodeError(this, post)) {
- return ImageExpand.contract(post);
- }
- if (this.src.split('/')[2] !== 'i.4cdn.org') {
- return ImageExpand.contract(post);
- }
- return ImageCommon.error(this, post, 10 * $.SECOND, function(URL) {
- if (post.file.isExpanding || post.file.isExpanded) {
- ImageExpand.contract(post);
- if (URL) {
- return ImageExpand.expand(post, URL);
- }
- }
- });
- },
- menu: {
- init: function() {
- var conf, createSubEntry, el, name, ref, subEntries;
- if (!ImageExpand.enabled) {
- return;
- }
- el = $.el('span', {
- textContent: 'Image Expansion',
- className: 'image-expansion-link'
- });
- createSubEntry = ImageExpand.menu.createSubEntry;
- subEntries = [];
- ref = Config.imageExpansion;
- for (name in ref) {
- conf = ref[name];
- subEntries.push(createSubEntry(name, conf[1]));
- }
- return Header.menu.addEntry({
- el: el,
- order: 105,
- subEntries: subEntries
- });
- },
- createSubEntry: function(name, desc) {
- var input, label;
- label = UI.checkbox(name, name);
- label.title = desc;
- input = label.firstElementChild;
- if (name === 'Fit width' || name === 'Fit height') {
- $.on(input, 'change', ImageExpand.cb.setFitness);
- }
- $.event('change', null, input);
- $.on(input, 'change', $.cb.checked);
- return {
- el: label
- };
- }
- }
- };
-
- ImageHover = {
- init: function() {
- var ref;
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- if (Conf['Image Hover']) {
- Post.callbacks.push({
- name: 'Image Hover',
- cb: this.node
- });
- }
- if (Conf['Image Hover in Catalog']) {
- return CatalogThread.callbacks.push({
- name: 'Image Hover',
- cb: this.catalogNode
- });
- }
- },
- node: function() {
- if (!(this.file && (this.file.isImage || this.file.isVideo))) {
- return;
- }
- return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover(this));
- },
- catalogNode: function() {
- var file;
- file = this.thread.OP.file;
- if (!(file && (file.isImage || file.isVideo))) {
- return;
- }
- return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover(this.thread.OP));
- },
- mouseover: function(post) {
- return function(e) {
- var el, error, file, height, isVideo, left, maxHeight, maxWidth, ref, ref1, ref2, right, scale, width, x;
- if (!doc.contains(this)) {
- return;
- }
- file = post.file;
- isVideo = file.isVideo;
- if (file.isExpanding || file.isExpanded) {
- return;
- }
- error = ImageHover.error(post);
- if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
- el = ImageCommon.popCache();
- $.on(el, 'error', error);
- } else {
- el = $.el((isVideo ? 'video' : 'img'));
- el.dataset.fullID = post.fullID;
- $.on(el, 'error', error);
- el.src = file.url;
- }
- if (Conf['Restart when Opened']) {
- ImageCommon.rewind(el);
- ImageCommon.rewind(this);
- }
- el.id = 'ihover';
- $.add(Header.hover, el);
- if (isVideo) {
- el.loop = true;
- el.controls = false;
- Volume.setup(el);
- if (Conf['Autoplay']) {
- el.play();
- }
- }
- ref1 = (function() {
- var k, len1, ref1, results;
- ref1 = file.dimensions.split('x');
- results = [];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- x = ref1[k];
- results.push(+x);
- }
- return results;
- })(), width = ref1[0], height = ref1[1];
- ref2 = this.getBoundingClientRect(), left = ref2.left, right = ref2.right;
- maxWidth = Math.max(left, doc.clientWidth - right);
- maxHeight = doc.clientHeight - UI.hover.padding;
- scale = Math.min(1, maxWidth / width, maxHeight / height);
- el.style.maxWidth = (scale * width) + "px";
- el.style.maxHeight = (scale * height) + "px";
- return UI.hover({
- root: this,
- el: el,
- latestEvent: e,
- endEvents: 'mouseout click',
- height: scale * height,
- noRemove: true,
- cb: function() {
- $.off(el, 'error', error);
- ImageCommon.pushCache(el);
- ImageCommon.pause(el);
- $.rm(el);
- return el.removeAttribute('style');
- }
- });
- };
- },
- error: function(post) {
- return function() {
- if (ImageCommon.decodeError(this, post)) {
- return;
- }
- return ImageCommon.error(this, post, 3 * $.SECOND, (function(_this) {
- return function(URL) {
- if (URL) {
- return _this.src = URL + (_this.src === URL ? '?' + Date.now() : '');
- } else {
- return $.rm(_this);
- }
- };
- })(this));
- };
- }
- };
-
- ImageLoader = {
- init: function() {
- var prefetch, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
- return;
- }
- if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
- return;
- }
- Post.callbacks.push({
- name: 'Image Replace',
- cb: this.node
- });
- $.on(d, 'PostsInserted', function() {
- return g.posts.forEach(ImageLoader.prefetch);
- });
- if (Conf['Replace WEBM']) {
- $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
- }
- if (!Conf['Image Prefetching']) {
- return;
- }
- prefetch = $.el('label', {
- innerHTML: " Prefetch Images"
- });
- this.el = prefetch.firstElementChild;
- $.on(this.el, 'change', this.toggle);
- return Header.menu.addEntry({
- el: prefetch,
- order: 98
- });
- },
- node: function() {
- if (this.isClone || !this.file) {
- return;
- }
- if (Conf['Replace WEBM'] && this.file.isVideo) {
- ImageLoader.replaceVideo(this);
- }
- return ImageLoader.prefetch(this);
- },
- replaceVideo: function(post) {
- var attr, file, k, len1, ref, thumb, video;
- file = post.file;
- thumb = file.thumb;
- video = $.el('video', {
- preload: 'none',
- loop: true,
- muted: true,
- poster: thumb.src || thumb.dataset.src,
- textContent: thumb.alt,
- className: thumb.className
- });
- video.setAttribute('muted', 'muted');
- video.dataset.md5 = thumb.dataset.md5;
- ref = ['height', 'width', 'maxHeight', 'maxWidth'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- attr = ref[k];
- video.style[attr] = thumb.style[attr];
- }
- video.src = file.url;
- $.replace(thumb, video);
- file.thumb = video;
- return file.videoThumb = true;
- },
- prefetch: function(post) {
- var clone, el, file, isImage, isVideo, k, len1, match, ref, replace, thumb, type, url;
- file = post.file;
- if (!file) {
- return;
- }
- isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, url = file.url;
- if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) {
- return;
- }
- type = (match = url.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
- replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src);
- if (!(replace || Conf['prefetch'])) {
- return;
- }
- if (![post].concat(slice.call(post.clones)).some(function(clone) {
- return doc.contains(clone.nodes.root);
- })) {
- return;
- }
- file.isPrefetched = true;
- if (file.videoThumb) {
- ref = post.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.file.thumb.preload = 'auto';
- }
- thumb.preload = 'auto';
- if ($.engine === 'gecko') {
- $.on(thumb, 'loadeddata', function() {
- return this.removeAttribute('poster');
- });
- }
- return;
- }
- el = $.el(isImage ? 'img' : 'video');
- if (replace && isImage) {
- $.on(el, 'load', function() {
- var len2, q, ref1;
- ref1 = post.clones;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- clone = ref1[q];
- clone.file.thumb.src = url;
- }
- thumb.src = url;
- return thumb.removeAttribute('data-src');
- });
- }
- return el.src = url;
- },
- toggle: function() {
- if (Conf['prefetch'] = this.checked) {
- g.posts.forEach(ImageLoader.prefetch);
- }
- },
- playVideos: function() {
- var qpClone, ref;
- qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0;
- return g.posts.forEach(function(post) {
- var k, len1, ref1, ref2, thumb;
- ref1 = [post].concat(slice.call(post.clones));
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- post = ref1[k];
- if (!((ref2 = post.file) != null ? ref2.videoThumb : void 0)) {
- continue;
- }
- thumb = post.file.thumb;
- if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) {
- thumb.play();
- } else {
- thumb.pause();
- }
- }
- });
- }
- };
-
- Metadata = {
- init: function() {
- var ref;
- if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
- return;
- }
- return Post.callbacks.push({
- name: 'WEBM Metadata',
- cb: this.node
- });
- },
- node: function() {
- var el;
- if (!(this.file && /webm$/i.test(this.file.url))) {
- return;
- }
- if (this.isClone) {
- el = $('.webm-title', this.file.text);
- } else {
- el = $.el('span', {
- className: 'webm-title'
- });
- $.extend(el, {
- innerHTML: " "
- });
- $.add(this.file.text, [$.tn('\u00A0'), el]);
- }
- if (el.children.length === 1) {
- return $.one(el.lastElementChild, 'mouseover focus', Metadata.load);
- }
- },
- load: function() {
- $.rmClass(this.parentNode, 'error');
- $.addClass(this.parentNode, 'loading');
- return CrossOrigin.binary(Get.postFromNode(this).file.url, (function(_this) {
- return function(data) {
- var output, title;
- $.rmClass(_this.parentNode, 'loading');
- if (data != null) {
- title = Metadata.parse(data);
- output = $.el('span', {
- textContent: title || ''
- });
- if (title == null) {
- $.addClass(_this.parentNode, 'not-found');
- }
- $.before(_this, output);
- _this.parentNode.tabIndex = 0;
- if (d.activeElement === _this) {
- _this.parentNode.focus();
- }
- return _this.tabIndex = -1;
- } else {
- $.addClass(_this.parentNode, 'error');
- return $.one(_this, 'click', Metadata.load);
- }
- };
- })(this), {
- Range: 'bytes=0-9999'
- });
- },
- parse: function(data) {
- var element, i, readInt, size, title;
- readInt = function() {
- var len, n;
- n = data[i++];
- len = 0;
- while (n < (0x80 >> len)) {
- len++;
- }
- n ^= 0x80 >> len;
- while (len-- && i < data.length) {
- n = (n << 8) ^ data[i++];
- }
- return n;
- };
- i = 0;
- while (i < data.length) {
- element = readInt();
- size = readInt();
- if (element === 0x3BA9) {
- title = '';
- while (size-- && i < data.length) {
- title += String.fromCharCode(data[i++]);
- }
- return decodeURIComponent(escape(title));
- } else if (element !== 0x8538067 && element !== 0x549A966) {
- i += size;
- }
- }
- return null;
- }
- };
-
- RevealSpoilers = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
- return;
- }
- return Post.callbacks.push({
- name: 'Reveal Spoiler Thumbnails',
- cb: this.node
- });
- },
- node: function() {
- var thumb;
- if (!(!this.isClone && this.file && this.file.thumb && this.file.isSpoiler)) {
- return;
- }
- thumb = this.file.thumb;
- thumb.removeAttribute('style');
- thumb.style.maxHeight = thumb.style.maxWidth = this.isReply ? '125px' : '250px';
- if (thumb.src) {
- return thumb.src = this.file.thumbURL;
- } else {
- return thumb.dataset.src = this.file.thumbURL;
- }
- }
- };
-
- Sauce = {
- init: function() {
- var err, k, len1, link, links, ref, ref1;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
- return;
- }
- links = [];
- ref1 = Conf['sauces'].split('\n');
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- link = ref1[k];
- try {
- if (link[0] !== '#') {
- links.push(link.trim());
- }
- } catch (_error) {
- err = _error;
- }
- }
- if (!links.length) {
- return;
- }
- this.links = links;
- this.link = $.el('a', {
- target: '_blank',
- className: 'sauce'
- });
- return Post.callbacks.push({
- name: 'Sauce',
- cb: this.node
- });
- },
- sandbox: function(url) {
- return E.url({
- innerHTML: "[sb] " + E(url) + " "
- });
- },
- rmOrigin: function(e) {
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- $.open(this.href);
- return e.preventDefault();
- },
- createSauceLink: function(link, post) {
- var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip, url;
- if (!(link = link.trim())) {
- return null;
- }
- parts = {};
- ref = link.split(/;(?=(?:text|boards|types|sandbox):?)/);
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- part = ref[i];
- if (i === 0) {
- parts['url'] = part;
- } else {
- m = part.match(/^(\w*):?(.*)$/);
- parts[m[1]] = m[2];
- }
- }
- parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
- ext = post.file.url.match(/[^.]*$/)[0];
- skip = false;
- for (key in parts) {
- parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi)/g, function(_, parameter) {
- var type;
- type = Sauce.formatters[parameter](post, ext);
- if (type == null) {
- skip = true;
- return '';
- }
- if (key === 'url' && (parameter !== '%' && parameter !== 'semi')) {
- if (/^javascript:/i.test(parts['url'])) {
- type = JSON.stringify(type);
- }
- type = encodeURIComponent(type);
- }
- return type;
- });
- }
- if (skip) {
- return null;
- }
- if (!(!parts['boards'] || (ref2 = post.board.ID, indexOf.call(parts['boards'].split(','), ref2) >= 0))) {
- return null;
- }
- if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
- return null;
- }
- url = parts['url'];
- if (parts['sandbox'] != null) {
- url = Sauce.sandbox(url);
- }
- a = Sauce.link.cloneNode(true);
- a.href = url;
- a.textContent = parts['text'];
- if (/^javascript:/i.test(parts['url'])) {
- a.removeAttribute('target');
- }
- if (parts['sandbox'] != null) {
- $.on(a, 'click', Sauce.rmOrigin);
- }
- return a;
- },
- node: function() {
- var k, len1, link, node, nodes, ref;
- if (this.isClone || !this.file) {
- return;
- }
- nodes = [];
- ref = Sauce.links;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- if (node = Sauce.createSauceLink(link, this)) {
- nodes.push($.tn('\u00A0'), node);
- }
- }
- return $.add(this.file.text, nodes);
- },
- formatters: {
- TURL: function(post) {
- return post.file.thumbURL;
- },
- URL: function(post) {
- return post.file.url;
- },
- IMG: function(post, ext) {
- if (ext === 'gif' || ext === 'jpg' || ext === 'png') {
- return post.file.url;
- } else {
- return post.file.thumbURL;
- }
- },
- MD5: function(post) {
- return post.file.MD5;
- },
- sMD5: function(post) {
- var ref;
- return (ref = post.file.MD5) != null ? ref.replace(/[+\/=]/g, function(c) {
- return {
- '+': '-',
- '/': '_',
- '=': ''
- }[c];
- }) : void 0;
- },
- hMD5: function(post) {
- if (post.file.MD5) {
- return ((function() {
- var k, len1, ref, results;
- ref = atob(post.file.MD5);
- results = [];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- c = ref[k];
- results.push(("0" + (c.charCodeAt(0).toString(16))).slice(-2));
- }
- return results;
- })()).join('');
- }
- },
- board: function(post) {
- return post.board.ID;
- },
- name: function(post) {
- return post.file.name;
- },
- '%': function() {
- return '%';
- },
- semi: function() {
- return ';';
- }
- }
- };
-
- Volume = {
- init: function() {
- var ref, ref1, unmuteEntry, volumeEntry;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
- return;
- }
- $.sync('Allow Sound', function(x) {
- var ref1;
- Conf['Allow Sound'] = x;
- return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0;
- });
- $.sync('Default Volume', function(x) {
- var ref1;
- Conf['Default Volume'] = x;
- return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0;
- });
- if (Conf['Mouse Wheel Volume']) {
- Post.callbacks.push({
- name: 'Mouse Wheel Volume',
- cb: this.node
- });
- }
- if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg') {
- return;
- }
- if (Conf['Mouse Wheel Volume']) {
- CatalogThread.callbacks.push({
- name: 'Mouse Wheel Volume',
- cb: this.catalogNode
- });
- }
- unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound');
- unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1];
- volumeEntry = $.el('label', {
- title: 'Default volume for videos.'
- });
- $.extend(volumeEntry, {
- innerHTML: " Volume"
- });
- this.inputs = {
- unmute: unmuteEntry.firstElementChild,
- volume: volumeEntry.firstElementChild
- };
- $.on(this.inputs.unmute, 'change', $.cb.checked);
- $.on(this.inputs.volume, 'change', $.cb.value);
- Header.menu.addEntry({
- el: unmuteEntry,
- order: 200
- });
- return Header.menu.addEntry({
- el: volumeEntry,
- order: 201
- });
- },
- setup: function(video) {
- video.muted = !Conf['Allow Sound'];
- video.volume = Conf['Default Volume'];
- return $.on(video, 'volumechange', Volume.change);
- },
- change: function() {
- var items, key, muted, val, volume;
- muted = this.muted, volume = this.volume;
- items = {
- 'Allow Sound': !muted,
- 'Default Volume': volume
- };
- for (key in items) {
- val = items[key];
- if (Conf[key] === val) {
- delete items[key];
- }
- }
- $.set(items);
- $.extend(Conf, items);
- if (Volume.inputs) {
- Volume.inputs.unmute.checked = !muted;
- return Volume.inputs.volume.value = volume;
- }
- },
- node: function() {
- var ref, ref1;
- if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) {
- return;
- }
- $.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover));
- return $.on($('a', this.file.text), 'wheel', Volume.wheel.bind(this.file.thumb.parentNode));
- },
- catalogNode: function() {
- var file;
- file = this.thread.OP.file;
- if (!(file != null ? file.isVideo : void 0)) {
- return;
- }
- return $.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header.hover));
- },
- wheel: function(e) {
- var el, volume;
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
- return;
- }
- if (!(el = $('video:not([data-md5])', this))) {
- return;
- }
- if (el.muted || !$.hasAudio(el)) {
- return;
- }
- volume = el.volume + 0.1;
- if (e.deltaY < 0) {
- volume *= 1.1;
- }
- if (e.deltaY > 0) {
- volume /= 1.1;
- }
- el.volume = $.minmax(volume - 0.1, 0, 1);
- return e.preventDefault();
- }
- };
-
- Embedding = {
- init: function() {
- var k, len1, ref, type;
- if (!(Conf['Embedding'] || Conf['Link Title'])) {
- return;
- }
- this.types = {};
- ref = this.ordered_types;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- type = ref[k];
- this.types[type.key] = type;
- }
- if (Conf['Floating Embeds']) {
- this.dialog = UI.dialog('embedding', 'top: 50px; right: 0px;', {
- innerHTML: ""
- });
- this.media = $('#media-embed', this.dialog);
- $.one(d, '4chanXInitFinished', this.ready);
- }
- if (Conf['Link Title']) {
- return $.on(d, '4chanXInitFinished PostsInserted', function() {
- var key, ref1, ref2, service;
- ref1 = Embedding.types;
- for (key in ref1) {
- service = ref1[key];
- if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
- Embedding.flushTitles(service.title);
- }
- }
- });
- }
- },
- events: function(post) {
- var el, i, items;
- if (!Conf['Embedding']) {
- return;
- }
- i = 0;
- items = $$('.embedder', post.nodes.comment);
- while (el = items[i++]) {
- $.on(el, 'click', Embedding.cb.toggle);
- if ($.hasClass(el, 'embedded')) {
- Embedding.cb.toggle.call(el);
- }
- }
- },
- process: function(link, post) {
- var data;
- if (!(Conf['Embedding'] || Conf['Link Title'])) {
- return;
- }
- if ($.x('ancestor::pre', link)) {
- return;
- }
- if (data = Embedding.services(link)) {
- data.post = post;
- if (Conf['Embedding']) {
- Embedding.embed(data);
- }
- if (Conf['Link Title']) {
- return Embedding.title(data);
- }
- }
- },
- services: function(link) {
- var href, k, len1, match, ref, type;
- href = link.href;
- ref = Embedding.ordered_types;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- type = ref[k];
- if (!(match = type.regExp.exec(href))) {
- continue;
- }
- if (type.dummy) {
- return;
- }
- return {
- key: type.key,
- uid: match[1],
- options: match[2],
- link: link
- };
- }
- },
- embed: function(data) {
- var embed, href, key, link, name, options, post, ref, uid, value;
- key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
- href = link.href;
- if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
- return;
- }
- $.addClass(link, key.toLowerCase());
- embed = $.el('a', {
- className: 'embedder',
- href: 'javascript:;',
- textContent: '(embed)'
- });
- ref = {
- key: key,
- uid: uid,
- options: options,
- href: href
- };
- for (name in ref) {
- value = ref[name];
- embed.dataset[name] = value;
- }
- $.on(embed, 'click', Embedding.cb.toggle);
- $.after(link, [$.tn(' '), embed]);
- if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote && key !== 'TwitchTV') {
- return $.asap((function() {
- return doc.contains(embed);
- }), function() {
- return Embedding.cb.toggle.call(embed);
- });
- }
- },
- ready: function() {
- $.addClass(Embedding.dialog, 'empty');
- $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat);
- $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed);
- $.on($('.jump', Embedding.dialog), 'click', function() {
- if (doc.contains(Embedding.lastEmbed)) {
- return Header.scrollTo(Embedding.lastEmbed);
- }
- });
- return $.add(d.body, Embedding.dialog);
- },
- closeFloat: function() {
- delete Embedding.lastEmbed;
- $.addClass(Embedding.dialog, 'empty');
- return $.replace(Embedding.media.firstChild, $.el('div'));
- },
- dragEmbed: function() {
- var style;
- style = Embedding.media.style;
- if (Embedding.dragEmbed.mouseup) {
- $.off(d, 'mouseup', Embedding.dragEmbed);
- Embedding.dragEmbed.mouseup = false;
- style.visibility = '';
- return;
- }
- $.on(d, 'mouseup', Embedding.dragEmbed);
- Embedding.dragEmbed.mouseup = true;
- return style.visibility = 'hidden';
- },
- title: function(data) {
- var key, link, options, post, service, uid;
- key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
- if (!(service = Embedding.types[key].title)) {
- return;
- }
- $.addClass(link, key.toLowerCase());
- if (service.batchSize) {
- (service.queue || (service.queue = [])).push(data);
- if (service.queue.length >= service.batchSize) {
- return Embedding.flushTitles(service);
- }
- } else {
- if (!$.cache(service.api(uid), (function() {
- return Embedding.cb.title(this, data);
- }), {
- responseType: 'json'
- })) {
- return $.extend(link, {
- innerHTML: "[" + E(key) + "] Title Link Blocked (are you using NoScript?)"
- });
- }
- }
- },
- flushTitles: function(service) {
- var cb, data, k, len1, queue;
- queue = service.queue;
- if (!(queue != null ? queue.length : void 0)) {
- return;
- }
- service.queue = [];
- cb = function() {
- var data, k, len1;
- for (k = 0, len1 = queue.length; k < len1; k++) {
- data = queue[k];
- Embedding.cb.title(this, data);
- }
- };
- if (!$.cache(service.api((function() {
- var k, len1, results;
- results = [];
- for (k = 0, len1 = queue.length; k < len1; k++) {
- data = queue[k];
- results.push(data.uid);
- }
- return results;
- })()), cb, {
- responseType: 'json'
- })) {
- for (k = 0, len1 = queue.length; k < len1; k++) {
- data = queue[k];
- $.extend(data.link, {
- innerHTML: "[" + E(data.key) + "] Title Link Blocked (are you using NoScript?)"
- });
- }
- }
- },
- cb: {
- toggle: function(e) {
- var div;
- if (e != null) {
- e.preventDefault();
- }
- if (Conf['Floating Embeds']) {
- if (!(div = Embedding.media.firstChild)) {
- return;
- }
- $.replace(div, Embedding.cb.embed(this));
- Embedding.lastEmbed = Get.postFromNode(this).nodes.root;
- $.rmClass(Embedding.dialog, 'empty');
- return;
- }
- if ($.hasClass(this, "embedded")) {
- $.rm(this.nextElementSibling);
- this.textContent = '(embed)';
- } else {
- $.after(this, Embedding.cb.embed(this));
- this.textContent = '(unembed)';
- }
- return $.toggleClass(this, 'embedded');
- },
- embed: function(a) {
- var container, el, type;
- container = $.el('div');
- $.add(container, el = (type = Embedding.types[a.dataset.key]).el(a));
- el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
- return container;
- },
- title: function(req, data) {
- var base1, k, key, len1, len2, link, link2, options, post, post2, q, ref, ref1, service, status, text, uid;
- key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
- status = req.status;
- service = Embedding.types[key].title;
- text = "[" + key + "] " + ((function() {
- switch (status) {
- case 200:
- case 304:
- return service.text(req.response, uid);
- case 404:
- return "Not Found";
- case 403:
- return "Forbidden or Private";
- default:
- return status + "'d";
- }
- })());
- link.dataset.original = link.textContent;
- link.textContent = text;
- ref = post.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post2 = ref[k];
- ref1 = $$('a.linkify', post2.nodes.comment);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- link2 = ref1[q];
- if (!(link2.href === link.href)) {
- continue;
- }
- if ((base1 = link2.dataset).original == null) {
- base1.original = link2.textContent;
- }
- link2.textContent = text;
- }
- }
- }
- },
- ordered_types: [
- {
- key: 'audio',
- regExp: /\.(?:mp3|ogg|wav)(?:\?|$)/i,
- style: '',
- el: function(a) {
- return $.el('audio', {
- controls: true,
- preload: 'auto',
- src: a.dataset.href
- });
- }
- }, {
- key: 'Dailymotion',
- regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/,
- el: function(a) {
- var el, options, start;
- options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? "?" + start[1] : '';
- el = $.el('iframe', {
- src: "//www.dailymotion.com/embed/video/" + a.dataset.uid + options
- });
- el.setAttribute("allowfullscreen", "true");
- return el;
- },
- title: {
- api: function(uid) {
- return "https://api.dailymotion.com/video/" + uid;
- },
- text: function(_) {
- return _.title;
- }
- }
- }, {
- key: 'Gist',
- regExp: /^\w+:\/\/gist\.github\.com\/(?:[\w\-]+\/)?(\w+)/,
- el: function(a) {
- var content, el;
- el = $.el('iframe');
- el.setAttribute('sandbox', 'allow-scripts');
- content = {
- innerHTML: "" + E(a.dataset.uid) + " "
- };
- el.src = E.url(content);
- return el;
- },
- title: {
- api: function(uid) {
- return "https://api.github.com/gists/" + uid;
- },
- text: function(arg) {
- var file, files;
- files = arg.files;
- for (file in files) {
- if (files.hasOwnProperty(file)) {
- return file;
- }
- }
- }
- }
- }, {
- key: 'image',
- regExp: /\.(?:gif|png|jpg|jpeg|bmp)(?:\?|$)/i,
- style: '',
- el: function(a) {
- return $.el('div', {
- innerHTML: " "
- });
- }
- }, {
- key: 'InstallGentoo',
- regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,
- el: function(a) {
- return $.el('iframe', {
- src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid
- });
- }
- }, {
- key: 'Twitter',
- regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
- el: function(a) {
- return $.el('iframe', {
- src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
- });
- }
- }, {
- key: 'LiveLeak',
- regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*i=(\w+)/,
- httpOnly: true,
- el: function(a) {
- var el;
- el = $.el('iframe', {
- src: "http://www.liveleak.com/ll_embed?i=" + a.dataset.uid
- });
- el.setAttribute("allowfullscreen", "true");
- return el;
- }
- }, {
- key: 'Pastebin',
- regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
- httpOnly: true,
- el: function(a) {
- var div;
- return div = $.el('iframe', {
- src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid
- });
- }
- }, {
- key: 'Gfycat',
- regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
- el: function(a) {
- var div;
- return div = $.el('iframe', {
- src: "//gfycat.com/iframe/" + a.dataset.uid
- });
- }
- }, {
- key: 'SoundCloud',
- regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/,
- style: 'border: 0; width: 500px; height: 400px;',
- el: function(a) {
- return $.el('iframe', {
- src: "https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(a.dataset.uid))
- });
- },
- title: {
- api: function(uid) {
- return "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(uid));
- },
- text: function(_) {
- return _.title;
- }
- }
- }, {
- key: 'StrawPoll',
- regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
- style: 'border: 0; width: 600px; height: 406px;',
- el: function(a) {
- return $.el('iframe', {
- src: "//strawpoll.me/embed_1/" + a.dataset.uid
- });
- }
- }, {
- key: 'TwitchTV',
- regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/(\w[^#\&\?]*)/,
- style: "border: none; width: 620px; height: 378px;",
- el: function(a) {
- var _, channel, flashvars, id, idprefix, k, len1, obj, part, ref, result, seconds, start, type;
- if (result = /(\w+)\/([bcv])\/(\d+)/i.exec(a.dataset.uid)) {
- _ = result[0], channel = result[1], type = result[2], id = result[3];
- idprefix = type === 'b' ? 'a' : type;
- flashvars = "channel=" + channel + "&start_volume=25&auto_play=false&videoId=" + idprefix + id;
- if (start = a.dataset.href.match(/\bt=(\w+)/)) {
- seconds = 0;
- ref = start[1].match(/\d+[hms]/g);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- part = ref[k];
- seconds += +part.slice(0, -1) * {
- 'h': 3600,
- 'm': 60,
- 's': 1
- }[part.slice(-1)];
- }
- flashvars += "&initial_time=" + seconds;
- }
- } else {
- channel = (/(\w+)/.exec(a.dataset.uid))[0];
- flashvars = "channel=" + channel + "&start_volume=25&auto_play=false";
- }
- obj = $.el('object', {
- data: '//www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf'
- });
- $.extend(obj, {
- innerHTML: " "
- });
- obj.children[1].value = flashvars;
- return obj;
- }
- }, {
- key: 'Vocaroo',
- regExp: /^\w+:\/\/(?:www\.)?vocaroo\.com\/i\/(\w+)/,
- style: '',
- el: function(a) {
- var el, type;
- el = $.el('audio', {
- controls: true,
- preload: 'auto'
- });
- type = el.canPlayType('audio/webm') ? 'webm' : 'mp3';
- el.src = "http://vocaroo.com/media_command.php?media=" + a.dataset.uid + "&command=download_" + type;
- return el;
- }
- }, {
- key: 'Vimeo',
- regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/,
- el: function(a) {
- return $.el('iframe', {
- src: "//player.vimeo.com/video/" + a.dataset.uid + "?wmode=opaque"
- });
- },
- title: {
- api: function(uid) {
- return "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" + uid;
- },
- text: function(_) {
- return _.title;
- }
- }
- }, {
- key: 'Vine',
- regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/,
- style: 'border: none; width: 500px; height: 500px;',
- el: function(a) {
- return $.el('iframe', {
- src: "https://vine.co/v/" + a.dataset.uid + "/card"
- });
- }
- }, {
- key: 'YouTube',
- regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/))([\w\-]{11})(.*)/,
- el: function(a) {
- var el, start;
- start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/);
- if (start) {
- start = start[1];
- }
- if (start && !/^\d+$/.test(start)) {
- start += ' 0h0m0s';
- start = 3600 * start.match(/(\d+)h/)[1] + 60 * start.match(/(\d+)m/)[1] + 1 * start.match(/(\d+)s/)[1];
- }
- el = $.el('iframe', {
- src: "//www.youtube.com/embed/" + a.dataset.uid + "?wmode=opaque" + (start ? '&start=' + start : '')
- });
- el.setAttribute("allowfullscreen", "true");
- return el;
- },
- title: {
- batchSize: 50,
- api: function(uids) {
- var ids, key;
- ids = encodeURIComponent(uids.join(','));
- key = 'AIzaSyB5_zaen_-46Uhz1xGR-lz1YoUMHqCD6CE';
- return "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + ids + "&fields=items%28id%2Csnippet%28title%29%29&key=" + key;
- },
- text: function(data, uid) {
- var item, k, len1, ref;
- ref = data.items;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- item = ref[k];
- if (item.id === uid) {
- return item.snippet.title;
- }
- }
- return 'Not Found';
- }
- }
- }, {
- key: 'Loopvid',
- regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|pc|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
- style: 'max-width: 80vw; max-height: 80vh;',
- el: function(a) {
- var _, base, el, host, k, len1, len2, name, names, q, ref, ref1, type, types, url;
- el = $.el('video', {
- controls: true,
- preload: 'auto',
- loop: true
- });
- ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
- types = (function() {
- switch (host) {
- case 'gd':
- case 'wu':
- case 'fc':
- return [''];
- case 'gc':
- return ['giant', 'fat', 'zippy'];
- default:
- return ['.webm', '.mp4'];
- }
- })();
- ref1 = names.split(',');
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- name = ref1[k];
- for (q = 0, len2 = types.length; q < len2; q++) {
- type = types[q];
- base = "" + name + type;
- url = (function() {
- switch (host) {
- case 'pf':
- return "https://web.archive.org/web/2/http://a.pomf.se/" + base;
- case 'kd':
- return "http://kastden.org/loopvid/" + base;
- case 'lv':
- return "http://kastden.org/_loopvid_media/lv/" + base;
- case 'gd':
- return "https://docs.google.com/uc?export=download&id=" + base;
- case 'gh':
- return "https://googledrive.com/host/" + base;
- case 'db':
- return "https://dl.dropboxusercontent.com/u/" + base;
- case 'dx':
- return "https://dl.dropboxusercontent.com/" + base;
- case 'nn':
- return "http://naenara.eu/loopvids/" + base;
- case 'cp':
- return "https://copy.com/" + base;
- case 'wu':
- return "http://webmup.com/" + base + "/vid.webm";
- case 'ig':
- return "https://i.imgur.com/" + base;
- case 'ky':
- return "https://kiyo.me/" + base;
- case 'mf':
- return "https://d.maxfile.ro/" + base;
- case 'pc':
- return "http://a.pomf.cat/" + base;
- case 'fc':
- return "//i.4cdn.org/" + base + ".webm";
- case 'gc':
- return "https://" + type + ".gfycat.com/" + name + ".webm";
- }
- })();
- $.add(el, $.el('source', {
- src: url
- }));
- }
- }
- return el;
- }
- }, {
- key: 'Clyp',
- regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w+)/,
- style: '',
- el: function(a) {
- var el, type;
- el = $.el('audio', {
- controls: true,
- preload: 'auto'
- });
- type = el.canPlayType('audio/ogg') ? 'ogg' : 'mp3';
- el.src = "https://clyp.it/" + a.dataset.uid + "." + type;
- return el;
- }
- }, {
- key: 'Loopvid-dummy',
- regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\//,
- dummy: true
- }, {
- key: 'MediaFire-dummy',
- regExp: /^\w+:\/\/(?:www\.)?mediafire.com\//,
- dummy: true
- }, {
- key: 'video',
- regExp: /\.(?:ogv|webm|mp4)(?:\?|$)/i,
- style: 'max-width: 80vw; max-height: 80vh;',
- el: function(a) {
- return $.el('video', {
- controls: true,
- preload: 'auto',
- src: a.dataset.href,
- loop: /^https?:\/\/i\.4cdn\.org\//.test(a.dataset.href)
- });
- }
- }
- ]
- };
-
- Linkify = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Linkify']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- Post.callbacks.push({
- name: 'Linkify',
- cb: this.node
- });
- CatalogThread.callbacks.push({
- name: 'Linkify',
- cb: this.catalogNode
- });
- return Embedding.init();
- },
- node: function() {
- var k, len1, len2, link, links, q, ref;
- if (this.isClone) {
- return Embedding.events(this);
- }
- if (!Linkify.regString.test(this.info.comment)) {
- return;
- }
- ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"]', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- $.addClass(link, 'linkify');
- Embedding.process(link, this);
- }
- links = Linkify.process(this.nodes.comment);
- for (q = 0, len2 = links.length; q < len2; q++) {
- link = links[q];
- Embedding.process(link, this);
- }
- },
- catalogNode: function() {
- if (!Linkify.regString.test(this.thread.OP.info.comment)) {
- return;
- }
- return Linkify.process(this.nodes.comment);
- },
- process: function(node) {
- var data, end, endNode, i, index, length, links, part1, part2, ref, ref1, result, saved, snapshot, space, test, word;
- test = /[^\s"]+/g;
- space = /[\s"]/;
- snapshot = $.X('.//br|.//text()', node);
- i = 0;
- links = [];
- while (node = snapshot.snapshotItem(i++)) {
- data = node.data;
- if (!data || node.parentElement.nodeName === "A") {
- continue;
- }
- while (result = test.exec(data)) {
- index = result.index;
- endNode = node;
- word = result[0];
- if ((length = index + word.length) === data.length) {
- test.lastIndex = 0;
- while ((saved = snapshot.snapshotItem(i++))) {
- if (saved.nodeName === 'BR') {
- if ((part1 = word.match(/(https?:\/\/)?([a-z\d-]+\.)*[a-z\d-]+$/i)) && (part2 = (ref = snapshot.snapshotItem(i)) != null ? (ref1 = ref.data) != null ? ref1.match(/^(\.[a-z\d-]+)*\//i) : void 0 : void 0) && (part1[0] + part2[0]).search(Linkify.regString) === 0) {
- continue;
- } else {
- break;
- }
- }
- endNode = saved;
- data = saved.data;
- if (end = space.exec(data)) {
- word += data.slice(0, end.index);
- test.lastIndex = length = end.index;
- i--;
- break;
- } else {
- length = data.length;
- word += data;
- }
- }
- }
- if (Linkify.regString.test(word)) {
- links.push(Linkify.makeRange(node, endNode, index, length));
- }
- if (!(test.lastIndex && node === endNode)) {
- break;
- }
- }
- }
- i = links.length;
- while (i--) {
- links[i] = Linkify.makeLink(links[i]);
- }
- return links;
- },
- regString: /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/?])|([-a-z\d]+[.])+(aero|asia|biz|cat|com|coop|dance|info|int|jobs|mobi|moe|museum|name|net|org|post|pro|tel|travel|xxx|xyz|edu|gov|mil|[a-z]{2})([:\/]|(?![^\s"]))|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i,
- makeRange: function(startNode, endNode, startOffset, endOffset) {
- var range;
- range = document.createRange();
- range.setStart(startNode, startOffset);
- range.setEnd(endNode, endOffset);
- return range;
- },
- makeLink: function(range) {
- var a, encodedDomain, i, t, text;
- text = range.toString();
- i = text.search(Linkify.regString);
- if (i > 0) {
- text = text.slice(i);
- while (range.startOffset + i >= range.startContainer.data.length) {
- i--;
- }
- if (i) {
- range.setStart(range.startContainer, range.startOffset + i);
- }
- }
- i = 0;
- while (/[)\]}>.,]/.test(t = text.charAt(text.length - (1 + i)))) {
- if (!(/[.,]/.test(t) || (text.match(/[()\[\]{}<>]/g)).length % 2)) {
- break;
- }
- i++;
- }
- if (i) {
- text = text.slice(0, -i);
- while (range.endOffset - i < 0) {
- i--;
- }
- if (i) {
- range.setEnd(range.endContainer, range.endOffset - i);
- }
- }
- if (!/((mailto|magnet):|.+:\/\/)/.test(text)) {
- text = (/@/.test(text) ? 'mailto:' : 'http://') + text;
- }
- if (encodedDomain = text.match(/^(https?:\/\/[^\/]*%[0-9a-f]{2})(.*)$/i)) {
- text = encodedDomain[1].replace(/%([0-9a-f]{2})/ig, function(x, y) {
- if (y === '25') {
- return x;
- } else {
- return String.fromCharCode(parseInt(y, 16));
- }
- }) + encodedDomain[2];
- }
- a = $.el('a', {
- className: 'linkify',
- rel: 'nofollow noreferrer',
- target: '_blank',
- href: text
- });
- $.add(a, range.extractContents());
- range.insertNode(a);
- return a;
- }
- };
-
- ArchiveLink = {
- init: function() {
- var div, entry, k, len1, ref, ref1, type;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
- return;
- }
- div = $.el('div', {
- textContent: 'Archive'
- });
- entry = {
- el: div,
- order: 90,
- open: function(arg) {
- var ID, board, thread;
- ID = arg.ID, thread = arg.thread, board = arg.board;
- return !!Redirect.to('thread', {
- postID: ID,
- threadID: thread.ID,
- boardID: board.ID
- });
- },
- subEntries: []
- };
- ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- type = ref1[k];
- entry.subEntries.push(this.createSubEntry(type[0], type[1]));
- }
- return Menu.menu.addEntry(entry);
- },
- 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,
- threadID: thread.ID,
- boardID: board.ID
- });
- return true;
- } : function(post) {
- var value;
- value = Filter[type](post);
- if (!value) {
- return false;
- }
- el.href = Redirect.to('search', {
- boardID: post.board.ID,
- type: type,
- value: value,
- isSearch: true
- });
- return true;
- };
- return {
- el: el,
- open: open
- };
- }
- };
-
- DeleteLink = {
- auto: [{}, {}],
- init: function() {
- var div, fileEl, fileEntry, postEl, postEntry, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
- return;
- }
- div = $.el('div', {
- className: 'delete-link',
- textContent: 'Delete'
- });
- postEl = $.el('a', {
- className: 'delete-post',
- href: 'javascript:;'
- });
- fileEl = $.el('a', {
- className: 'delete-file',
- href: 'javascript:;'
- });
- this.nodes = {
- menu: div.firstChild,
- links: [postEl, fileEl]
- };
- postEntry = {
- el: postEl,
- open: function() {
- postEl.textContent = DeleteLink.linkText(false);
- $.on(postEl, 'click', DeleteLink.toggle);
- return true;
- }
- };
- fileEntry = {
- el: fileEl,
- open: function(arg) {
- var file;
- file = arg.file;
- if (!file || file.isDead) {
- return false;
- }
- fileEl.textContent = DeleteLink.linkText(true);
- $.on(fileEl, 'click', DeleteLink.toggle);
- return true;
- }
- };
- return Menu.menu.addEntry({
- el: div,
- order: 40,
- open: function(post) {
- if (post.isDead) {
- return false;
- }
- DeleteLink.post = post;
- DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
- DeleteLink.cooldown.start(post);
- return true;
- },
- subEntries: [postEntry, fileEntry]
- });
- },
- menuText: function() {
- var seconds;
- if (seconds = DeleteLink.cooldown.seconds[DeleteLink.post.fullID]) {
- return "Delete (" + seconds + ")";
- } else {
- return 'Delete';
- }
- },
- linkText: function(fileOnly) {
- var text;
- text = fileOnly ? 'File' : 'Post';
- if (DeleteLink.auto[+fileOnly][DeleteLink.post.fullID]) {
- text = "Deleting " + (text.toLowerCase()) + "...";
- }
- return text;
- },
- toggle: function() {
- var auto, fileOnly, post;
- post = DeleteLink.post;
- fileOnly = $.hasClass(this, 'delete-file');
- auto = DeleteLink.auto[+fileOnly];
- if (auto[post.fullID]) {
- delete auto[post.fullID];
- } else {
- auto[post.fullID] = true;
- }
- this.textContent = DeleteLink.linkText(fileOnly);
- if (!DeleteLink.cooldown.seconds[post.fullID]) {
- return DeleteLink["delete"](post, fileOnly);
- }
- },
- "delete": function(post, fileOnly) {
- var form, link;
- link = DeleteLink.nodes.links[+fileOnly];
- delete DeleteLink.auto[+fileOnly][post.fullID];
- if (post.fullID === DeleteLink.post.fullID) {
- $.off(link, 'click', DeleteLink.toggle);
- }
- form = {
- mode: 'usrdel',
- onlyimgdel: fileOnly,
- pwd: QR.persona.getPassword()
- };
- form[post.ID] = 'delete';
- return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), {
- responseType: 'document',
- withCredentials: true,
- onload: function() {
- return DeleteLink.load(link, post, fileOnly, this.response);
- },
- onerror: function() {
- return DeleteLink.error(link, post);
- }
- }, {
- form: $.formData(form)
- });
- },
- load: function(link, post, fileOnly, resDoc) {
- var el, msg;
- link.textContent = DeleteLink.linkText(fileOnly);
- if (resDoc.title === '4chan - Banned') {
- el = $.el('span', {
- innerHTML: "You can't delete posts because you are banned ."
- });
- return new Notice('warning', el, 20);
- } else if (msg = resDoc.getElementById('errmsg')) {
- new Notice('warning', msg.textContent, 20);
- if (post.fullID === DeleteLink.post.fullID) {
- $.on(link, 'click', DeleteLink.toggle);
- }
- if (QR.cooldown.data && Conf['Cooldown'] && /\bwait\b/i.test(msg.textContent)) {
- DeleteLink.cooldown.start(post, 5);
- DeleteLink.auto[+fileOnly][post.fullID] = true;
- return DeleteLink.nodes.links[+fileOnly].textContent = DeleteLink.linkText(fileOnly);
- }
- } else {
- if (!fileOnly) {
- QR.cooldown["delete"](post);
- }
- if (resDoc.title === 'Updating index...') {
- (post.origin || post).kill(fileOnly);
- }
- if (post.fullID === DeleteLink.post.fullID) {
- return link.textContent = 'Deleted';
- }
- }
- },
- error: function(link, post) {
- new Notice('warning', 'Connection error, please retry.', 20);
- if (post.fullID === DeleteLink.post.fullID) {
- return $.on(link, 'click', DeleteLink.toggle);
- }
- },
- cooldown: {
- seconds: {},
- start: function(post, seconds) {
- if (DeleteLink.cooldown.seconds[post.fullID] != null) {
- return;
- }
- if (seconds == null) {
- seconds = QR.cooldown.secondsDeletion(post);
- }
- if (seconds > 0) {
- DeleteLink.cooldown.seconds[post.fullID] = seconds;
- return DeleteLink.cooldown.count(post);
- }
- },
- count: function(post) {
- var fileOnly, k, len1, ref;
- if (post.fullID === DeleteLink.post.fullID) {
- DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
- }
- if (DeleteLink.cooldown.seconds[post.fullID] > 0 && Conf['Cooldown']) {
- DeleteLink.cooldown.seconds[post.fullID]--;
- setTimeout(DeleteLink.cooldown.count, 1000, post);
- } else {
- delete DeleteLink.cooldown.seconds[post.fullID];
- ref = [false, true];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- fileOnly = ref[k];
- if (DeleteLink.auto[+fileOnly][post.fullID]) {
- DeleteLink["delete"](post, fileOnly);
- }
- }
- }
- }
- }
- };
-
- DownloadLink = {
- init: function() {
- var a, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
- return;
- }
- a = $.el('a', {
- className: 'download-link',
- textContent: 'Download file'
- });
- $.on(a, 'click', ImageCommon.download);
- return Menu.menu.addEntry({
- el: a,
- order: 100,
- open: function(arg) {
- var file;
- file = arg.file;
- if (!file) {
- return false;
- }
- a.href = file.url;
- a.download = file.name;
- return true;
- }
- });
- }
- };
-
- Menu = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) {
- return;
- }
- this.button = $.el('a', {
- className: 'menu-button',
- href: 'javascript:;'
- });
- $.extend(this.button, {
- innerHTML: " "
- });
- this.menu = new UI.Menu('post');
- Post.callbacks.push({
- name: 'Menu',
- cb: this.node
- });
- return CatalogThread.callbacks.push({
- name: 'Menu',
- cb: this.catalogNode
- });
- },
- node: function() {
- if (this.isClone) {
- Menu.makeButton(this, $('.menu-button', this.nodes.info));
- return;
- }
- return $.add(this.nodes.info, Menu.makeButton(this));
- },
- catalogNode: function() {
- return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP));
- },
- makeButton: function(post, button) {
- button || (button = Menu.button.cloneNode(true));
- $.on(button, 'click', function(e) {
- return Menu.menu.toggle(e, this, post);
- });
- return button;
- }
- };
-
- ReportLink = {
- init: function() {
- var a, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
- return;
- }
- a = $.el('a', {
- className: 'report-link',
- href: 'javascript:;'
- });
- $.on(a, 'click', ReportLink.report);
- return Menu.menu.addEntry({
- el: a,
- order: 10,
- open: function(post) {
- if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) {
- a.textContent = 'Report';
- ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
- if ((Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled) || d.cookie.indexOf('pass_enabled=1') >= 0) {
- ReportLink.url += '&altc=1';
- ReportLink.dims = 'width=350,height=275';
- } else {
- ReportLink.dims = 'width=400,height=550';
- }
- } else if (Conf['Archive Report']) {
- a.textContent = 'Report to archive';
- ReportLink.url = Redirect.to('report', {
- boardID: post.board.ID,
- postID: post.ID
- });
- ReportLink.dims = 'width=700,height=475';
- } else {
- ReportLink.url = '';
- }
- return !!ReportLink.url;
- }
- });
- },
- report: function() {
- var dims, id, set, url;
- url = ReportLink.url, dims = ReportLink.dims;
- id = Date.now();
- set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1," + dims;
- return window.open(url, id, set);
- }
- };
-
- Favicon = {
- init: function() {
- return $.asap((function() {
- return d.head && (Favicon.el = $('link[rel="shortcut icon"]', d.head));
- }), Favicon.initAsap);
- },
- initAsap: function() {
- var href;
- Favicon.el.type = 'image/x-icon';
- href = Favicon.el.href;
- Favicon.SFW = /ws\.ico$/.test(href);
- Favicon["default"] = href;
- return Favicon["switch"]();
- },
- "switch": function() {
- var f, i, items, t;
- items = {
- ferongr: ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxUlEQVR42q1TOwrCQBB9s0FRtJI0WoqFtSLYegoP4gVSeJsUHsHSI3iFeIqRXXgwrhlXwYHHhLwPTB7B36abBCV+0pA4DUBQUNZYQptGtW3jtoKyxgoe0yrBCoyZfL/5ioQ3URZOXW9I341l3oo+NXEZiW4CEuIzvPECopED4OaZ3RNmeAm4u+a8Jr5f17VyVoL8fr8qcltzwlyyj2iqcgPOQ9ExkHAITgD75bYBe0A5S4H/P9htuWMF3QXoQpwaKeT+lnsC6JE5I6aq6fEAAAAASUVORK5CYII=', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///8AcH4AtswA2PJ55fKi6fIA1/FtpPADAAAAAXRSTlMA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AQUoSaob0Jao73lgVojOitUEazBZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAADCgANKAASOAATOwAZTAAwkQBAwQBV/wH////+Fmy4AAAAA3RSTlMAPse+s4iwAAAAM0lEQVQIW2NggAGuVasWgDBpDDAQUoSaob0Jao73lgVojOitUEazBZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC']
- }[Conf['favicon']];
- f = Favicon;
- t = 'data:image/png;base64,';
- i = 0;
- while (items[i]) {
- items[i] = t + items[i++];
- }
- f.unreadDead = items[0], f.unreadDeadY = items[1], f.unreadSFW = items[2], f.unreadSFWY = items[3], f.unreadNSFW = items[4], f.unreadNSFWY = items[5];
- return f.update();
- },
- update: function() {
- if (this.SFW) {
- this.unread = this.unreadSFW;
- return this.unreadY = this.unreadSFWY;
- } else {
- this.unread = this.unreadNSFW;
- return this.unreadY = this.unreadNSFWY;
- }
- },
- dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
- logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAgMAAAC+UIlYAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAGlJREFUWMPtlkEKADEIA/tJP9lXLttQto2yHxgDHozTi0ToGK2WKZZ+HAQQMZc+xBwI4EZ+wAC2IfPuSIDOZJrSZQEAX9eVJhhwIuUYAnQe8rhAEMAZlTI2MID9f5Clyh0JeE1V1ZEAvB4qDfwuJTSGRAAAAABJRU5ErkJggg=='
- };
-
- MarkNewIPs = {
- init: function() {
- if (g.VIEW !== 'thread' || !Conf['Mark New IPs']) {
- return;
- }
- return Thread.callbacks.push({
- name: 'Mark New IPs',
- cb: this.node
- });
- },
- node: function() {
- MarkNewIPs.ipCount = this.ipCount;
- MarkNewIPs.postCount = this.posts.keys.length;
- return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
- },
- onUpdate: function(e) {
- var deletedPosts, fullID, i, ipCount, k, len1, len2, newPosts, postCount, q, ref;
- ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
- if (ipCount == null) {
- return;
- }
- switch (ipCount - MarkNewIPs.ipCount) {
- case postCount - MarkNewIPs.postCount + deletedPosts.length:
- i = MarkNewIPs.ipCount;
- for (k = 0, len1 = newPosts.length; k < len1; k++) {
- fullID = newPosts[k];
- MarkNewIPs.markNew(g.posts[fullID], ++i);
- }
- break;
- case -deletedPosts.length:
- for (q = 0, len2 = newPosts.length; q < len2; q++) {
- fullID = newPosts[q];
- MarkNewIPs.markOld(g.posts[fullID]);
- }
- }
- MarkNewIPs.ipCount = ipCount;
- return MarkNewIPs.postCount = postCount;
- },
- markNew: function(post, ipCount) {
- var counter, suffix;
- suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
- counter = $.el('span', {
- className: 'ip-counter',
- textContent: "(" + ipCount + ")"
- });
- post.nodes.nameBlock.title = "This is the " + ipCount + suffix + " IP in the thread.";
- $.add(post.nodes.nameBlock, [$.tn(' '), counter]);
- return $.addClass(post.nodes.root, 'new-ip');
- },
- markOld: function(post) {
- post.nodes.nameBlock.title = 'Not the first post from this IP.';
- return $.addClass(post.nodes.root, 'old-ip');
- }
- };
-
- ReplyPruning = {
- init: function() {
- var el, label;
- if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) {
- return;
- }
- this.active = !(Conf['Quote Threading'] && Conf['Thread Quotes']);
- this.container = $.frag();
- this.summary = $.el('span', {
- hidden: true,
- className: 'summary'
- });
- this.summary.style.cursor = 'pointer';
- $.on(this.summary, 'click', (function(_this) {
- return function() {
- _this.inputs.enabled.checked = !_this.inputs.enabled.checked;
- return $.event('change', null, _this.inputs.enabled);
- };
- })(this));
- label = UI.checkbox('Prune Replies', 'Show Last', this.active);
- el = $.el('span', {
- title: 'Maximum number of replies to show.'
- }, {
- innerHTML: " "
- });
- $.prepend(el, label);
- this.inputs = {
- enabled: label.firstElementChild,
- replies: el.lastElementChild
- };
- $.on(this.inputs.enabled, 'change', this.setEnabled);
- $.on(this.inputs.replies, 'change', $.cb.value);
- Header.menu.addEntry({
- el: el,
- order: 190
- });
- return Thread.callbacks.push({
- name: 'Reply Pruning',
- cb: this.node
- });
- },
- position: 0,
- hidden: 0,
- hiddenFiles: 0,
- total: 0,
- totalFiles: 0,
- setEnabled: function() {
- var other;
- other = QuoteThreading.input;
- if (this.checked && (other != null ? other.checked : void 0)) {
- other.checked = false;
- $.event('change', null, other);
- }
- return ReplyPruning.active = this.checked;
- },
- showIfHidden: function(id) {
- var ref;
- if ((ref = ReplyPruning.container) != null ? ref.getElementById(id) : void 0) {
- ReplyPruning.inputs.enabled.checked = false;
- return $.event('change', null, ReplyPruning.inputs.enabled);
- }
- },
- node: function() {
- var ref;
- ReplyPruning.thread = this;
- this.posts.forEach(function(post) {
- if (post.isReply) {
- ReplyPruning.total++;
- if (post.file) {
- return ReplyPruning.totalFiles++;
- }
- }
- });
- if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (0 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) {
- ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false;
- }
- $.after(this.OP.nodes.root, ReplyPruning.summary);
- $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update);
- $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update);
- $.on(d, 'ThreadUpdate', ReplyPruning.updateCount);
- $.on(d, 'ThreadUpdate', ReplyPruning.update);
- return ReplyPruning.update();
- },
- updateCount: function(e) {
- var fullID, k, len1, ref;
- if (e.detail[404]) {
- return;
- }
- ref = e.detail.newPosts;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- fullID = ref[k];
- ReplyPruning.total++;
- if (g.posts[fullID].file) {
- ReplyPruning.totalFiles++;
- }
- }
- },
- update: function() {
- var frag, hidden2, post, posts;
- hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0;
- posts = ReplyPruning.thread.posts;
- if (ReplyPruning.hidden < hidden2) {
- while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) {
- post = posts[posts.keys[ReplyPruning.position++]];
- if (post.isReply && !post.isFetchedQuote) {
- $.add(ReplyPruning.container, post.nodes.root);
- ReplyPruning.hidden++;
- if (post.file) {
- ReplyPruning.hiddenFiles++;
- }
- }
- }
- } else if (ReplyPruning.hidden > hidden2) {
- frag = $.frag();
- while (ReplyPruning.hidden > hidden2 && ReplyPruning.position > 0) {
- post = posts[posts.keys[--ReplyPruning.position]];
- if (post.isReply && !post.isFetchedQuote) {
- $.prepend(frag, post.nodes.root);
- ReplyPruning.hidden--;
- if (post.file) {
- ReplyPruning.hiddenFiles--;
- }
- }
- }
- $.after(ReplyPruning.summary, frag);
- $.event('PostsInserted');
- }
- ReplyPruning.summary.textContent = ReplyPruning.active ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles);
- return ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"];
- }
- };
-
- ThreadExcerpt = {
- init: function() {
- if (g.BOARD.ID !== 'f' || g.VIEW !== 'thread' || !Conf['Thread Excerpt']) {
- return;
- }
- return Thread.callbacks.push({
- name: 'Thread Excerpt',
- cb: this.node
- });
- },
- node: function() {
- return d.title = Get.threadExcerpt(this);
- }
- };
-
- ThreadStats = {
- init: function() {
- var sc, statsHTML, statsTitle;
- if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
- return;
- }
- statsHTML = {
- innerHTML: "? / ? " + (Conf["IP Count in Stats"] ? " / ? " : "") + (Conf["Page Count in Stats"] ? " / ? " : "")
- };
- statsTitle = 'Posts / Files';
- if (Conf['IP Count in Stats']) {
- statsTitle += ' / IPs';
- }
- if (Conf['Page Count in Stats']) {
- statsTitle += (g.BOARD.ID === 'f' ? ' / Purge Position' : ' / Page');
- }
- if (Conf['Updater and Stats in Header']) {
- this.dialog = sc = $.el('span', {
- id: 'thread-stats',
- title: statsTitle
- });
- $.extend(sc, statsHTML);
- $.ready(function() {
- return Header.addShortcut(sc);
- });
- } else {
- this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', {
- innerHTML: "" + statsHTML.innerHTML + "
"
- });
- $.addClass(doc, 'float');
- $.ready(function() {
- return $.add(d.body, sc);
- });
- }
- this.postCountEl = $('#post-count', sc);
- this.fileCountEl = $('#file-count', sc);
- this.ipCountEl = $('#ip-count', sc);
- this.pageCountEl = $('#page-count', sc);
- if (this.pageCountEl) {
- $.on(this.pageCountEl, 'click', ThreadStats.fetchPage);
- }
- return Thread.callbacks.push({
- name: 'Thread Stats',
- cb: this.node
- });
- },
- node: function() {
- var fileCount, postCount;
- postCount = 0;
- fileCount = 0;
- this.posts.forEach(function(post) {
- postCount++;
- if (post.file) {
- fileCount++;
- }
- if (ThreadStats.pageCountEl) {
- return ThreadStats.lastPost = post.info.date;
- }
- });
- ThreadStats.thread = this;
- ThreadStats.fetchPage();
- ThreadStats.update(postCount, fileCount, this.ipCount);
- return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate);
- },
- onUpdate: function(e) {
- var fileCount, ipCount, newPosts, postCount, ref, ref1;
- if (e.detail[404]) {
- return;
- }
- ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount, ipCount = ref.ipCount, newPosts = ref.newPosts;
- ThreadStats.update(postCount, fileCount, ipCount);
- if (!ThreadStats.pageCountEl) {
- return;
- }
- if (newPosts.length) {
- ThreadStats.lastPost = g.posts[newPosts[newPosts.length - 1]].info.date;
- }
- if (g.BOARD.ID !== 'f' && ((ref1 = ThreadStats.pageCountEl) != null ? ref1.textContent : void 0) !== '1') {
- return ThreadStats.fetchPage();
- }
- },
- update: function(postCount, fileCount, ipCount) {
- var fileCountEl, ipCountEl, postCountEl, thread;
- thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl, ipCountEl = ThreadStats.ipCountEl;
- postCountEl.textContent = postCount;
- fileCountEl.textContent = fileCount;
- if ((ipCount != null) && ipCountEl) {
- ipCountEl.textContent = ipCount;
- }
- (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning');
- return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning');
- },
- fetchPage: function() {
- if (!ThreadStats.pageCountEl) {
- return;
- }
- clearTimeout(ThreadStats.timeout);
- if (ThreadStats.thread.isDead) {
- ThreadStats.pageCountEl.textContent = 'Dead';
- $.addClass(ThreadStats.pageCountEl, 'warning');
- return;
- }
- ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 2 * $.MINUTE);
- return $.ajax("//a.4cdn.org/" + ThreadStats.thread.board + "/threads.json", {
- onload: ThreadStats.onThreadsLoad
- }, {
- whenModified: 'ThreadStats'
- });
- },
- onThreadsLoad: function() {
- var k, len1, len2, len3, page, purgePos, q, ref, ref1, ref2, thread, u;
- if (this.status === 200) {
- ref = this.response;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- page = ref[k];
- if (g.BOARD.ID === 'f') {
- purgePos = 1;
- ref1 = page.threads;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- thread = ref1[q];
- if (thread.no < ThreadStats.thread.ID) {
- purgePos++;
- }
- }
- ThreadStats.pageCountEl.textContent = purgePos;
- } else {
- ref2 = page.threads;
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- thread = ref2[u];
- if (!(thread.no === ThreadStats.thread.ID)) {
- continue;
- }
- ThreadStats.pageCountEl.textContent = page.page;
- (page.page === this.response.length ? $.addClass : $.rmClass)(ThreadStats.pageCountEl, 'warning');
- ThreadStats.lastPageUpdate = new Date(thread.last_modified * $.SECOND);
- ThreadStats.retry();
- return;
- }
- }
- }
- } else if (this.status === 304) {
- return ThreadStats.retry();
- }
- },
- retry: function() {
- var ref;
- if (g.BOARD.ID !== 'f' && ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((ref = ThreadStats.pageCountEl) != null ? ref.textContent : void 0) !== '1') {
- clearTimeout(ThreadStats.timeout);
- return ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 5 * $.SECOND);
- }
- }
- };
-
- ThreadUpdater = {
- init: function() {
- var conf, el, input, name, ref, sc, subEntries, updateLink;
- if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
- return;
- }
- this.audio = $.el('audio', {
- src: ThreadUpdater.beep
- });
- if (Conf['Updater and Stats in Header']) {
- this.dialog = sc = $.el('span', {
- id: 'updater'
- });
- $.extend(sc, {
- innerHTML: " "
- });
- $.ready(function() {
- return Header.addShortcut(sc);
- });
- } else {
- this.dialog = sc = UI.dialog('updater', 'bottom: 0px; left: 0px;', {
- innerHTML: "
"
- });
- $.addClass(doc, 'float');
- $.ready(function() {
- return $.add(d.body, sc);
- });
- }
- this.checkPostCount = 0;
- this.timer = $('#update-timer', sc);
- this.status = $('#update-status', sc);
- $.on(this.timer, 'click', this.update);
- $.on(this.status, 'click', this.update);
- updateLink = $.el('span', {
- className: 'brackets-wrap updatelink'
- });
- $.extend(updateLink, {
- innerHTML: "Update "
- });
- Main.ready(function() {
- var navLinksBot;
- if ((navLinksBot = $('.navLinksBot'))) {
- return $.add(navLinksBot, [$.tn(' '), updateLink]);
- }
- });
- $.on(updateLink.firstElementChild, 'click', this.update);
- subEntries = [];
- ref = Config.updater.checkbox;
- for (name in ref) {
- conf = ref[name];
- el = UI.checkbox(name, name);
- el.title = conf[1];
- input = el.firstElementChild;
- $.on(input, 'change', $.cb.checked);
- if (input.name === 'Scroll BG') {
- $.on(input, 'change', this.cb.scrollBG);
- this.cb.scrollBG();
- } else if (input.name === 'Auto Update') {
- $.on(input, 'change', this.setInterval);
- }
- subEntries.push({
- el: el
- });
- }
- this.settings = $.el('span', {
- innerHTML: "Interval "
- });
- $.on(this.settings, 'click', this.intervalShortcut);
- subEntries.push({
- el: this.settings
- });
- Header.menu.addEntry(this.entry = {
- el: $.el('span', {
- textContent: 'Updater'
- }),
- order: 110,
- subEntries: subEntries
- });
- return Thread.callbacks.push({
- name: 'Thread Updater',
- cb: this.node
- });
- },
- node: function() {
- ThreadUpdater.thread = this;
- ThreadUpdater.root = this.OP.nodes.root.parentNode;
- ThreadUpdater.outdateCount = 0;
- ThreadUpdater.postIDs = [];
- ThreadUpdater.fileIDs = [];
- this.posts.forEach(function(post) {
- ThreadUpdater.postIDs.push(post.ID);
- if (post.file) {
- return ThreadUpdater.fileIDs.push(post.ID);
- }
- });
- ThreadUpdater.cb.interval.call($.el('input', {
- value: Conf['Interval']
- }));
- $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);
- $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
- return ThreadUpdater.setInterval();
- },
-
- /*
- http://freesound.org/people/pierrecartoons1979/sounds/90112/
- cc-by-nc-3.0
- */
- beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA',
- playBeep: function() {
- var audio;
- audio = ThreadUpdater.audio;
- if (audio.paused) {
- return audio.play();
- } else {
- return $.one(audio, 'ended', ThreadUpdater.playBeep);
- }
- },
- cb: {
- checkpost: function(e) {
- if (e.detail.threadID !== ThreadUpdater.thread.ID) {
- return;
- }
- ThreadUpdater.postID = e.detail.postID;
- ThreadUpdater.checkPostCount = 0;
- ThreadUpdater.outdateCount = 0;
- return ThreadUpdater.setInterval();
- },
- visibility: function() {
- if (d.hidden) {
- return;
- }
- ThreadUpdater.outdateCount = 0;
- if (ThreadUpdater.seconds > ThreadUpdater.interval) {
- return ThreadUpdater.setInterval();
- }
- },
- scrollBG: function() {
- return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() {
- return true;
- } : function() {
- return !d.hidden;
- };
- },
- interval: function(e) {
- var val;
- val = parseInt(this.value, 10);
- if (val < 1) {
- val = 1;
- }
- ThreadUpdater.interval = this.value = val;
- if (e) {
- return $.cb.value.call(this);
- }
- },
- load: function() {
- var req;
- req = ThreadUpdater.req;
- switch (req.status) {
- case 200:
- ThreadUpdater.parse(req);
- if (ThreadUpdater.thread.isArchived) {
- return ThreadUpdater.kill();
- } else {
- return ThreadUpdater.setInterval();
- }
- break;
- case 404:
- return $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/catalog.json", {
- onloadend: function() {
- var confirmed, k, len1, len2, page, q, ref, ref1, thread;
- if (this.status === 200) {
- confirmed = true;
- ref = this.response;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- page = ref[k];
- ref1 = page.threads;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- thread = ref1[q];
- if (thread.no === ThreadUpdater.thread.ID) {
- confirmed = false;
- break;
- }
- }
- }
- } else {
- confirmed = false;
- }
- if (confirmed) {
- return ThreadUpdater.kill();
- } else {
- return ThreadUpdater.error(req);
- }
- }
- });
- default:
- return ThreadUpdater.error(req);
- }
- }
- },
- kill: function() {
- ThreadUpdater.thread.kill();
- ThreadUpdater.setInterval();
- return $.event('ThreadUpdate', {
- 404: true,
- threadID: ThreadUpdater.thread.fullID
- });
- },
- error: function(req) {
- if (req.status === 304) {
- ThreadUpdater.set('status', '');
- }
- ThreadUpdater.setInterval();
- if (!req.status) {
- return ThreadUpdater.set('status', 'Connection Failed', 'warning');
- } else if (req.status !== 304) {
- return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning');
- }
- },
- setInterval: function() {
- var cur, interval, j, limit;
- clearTimeout(ThreadUpdater.timeoutID);
- if (ThreadUpdater.thread.isDead) {
- ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning');
- ThreadUpdater.set('timer', '');
- return;
- }
- if (ThreadUpdater.postID && ThreadUpdater.checkPostCount < 5) {
- ThreadUpdater.set('timer', '...', 'loading');
- ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND);
- return;
- }
- if (!Conf['Auto Update']) {
- ThreadUpdater.set('timer', 'Update');
- return;
- }
- interval = ThreadUpdater.interval;
- if (Conf['Optional Increase']) {
- limit = d.hidden ? 10 : 5;
- j = Math.min(ThreadUpdater.outdateCount, limit);
- cur = (Math.floor(interval * 0.1) || 1) * j * j;
- ThreadUpdater.seconds = $.minmax(cur, interval, 300);
- } else {
- ThreadUpdater.seconds = interval;
- }
- return ThreadUpdater.timeout();
- },
- 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;
- } else {
- el.textContent = text;
- }
- return el.className = klass != null ? klass : (text === '' ? 'empty' : '');
- },
- timeout: function() {
- if (ThreadUpdater.seconds) {
- ThreadUpdater.set('timer', ThreadUpdater.seconds);
- ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
- } else {
- ThreadUpdater.outdateCount++;
- ThreadUpdater.update();
- }
- return ThreadUpdater.seconds--;
- },
- update: function() {
- var ref;
- clearTimeout(ThreadUpdater.timeoutID);
- ThreadUpdater.set('timer', '...', 'loading');
- if ((ref = ThreadUpdater.req) != null) {
- ref.abort();
- }
- return ThreadUpdater.req = $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/thread/" + ThreadUpdater.thread + ".json", {
- onloadend: ThreadUpdater.cb.load,
- timeout: $.MINUTE
- }, {
- whenModified: 'ThreadUpdater'
- });
- },
- updateThreadStatus: function(type, status) {
- var change, hasChanged;
- if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) {
- return;
- }
- ThreadUpdater.thread.setStatus(type, status);
- if (type === 'Closed' && ThreadUpdater.thread.isArchived) {
- return;
- }
- change = type === 'Sticky' ? status ? 'now a sticky' : 'not a sticky anymore' : status ? 'now closed' : 'not closed anymore';
- return new Notice('info', "The thread is " + change + ".", 30);
- },
- parse: function(req) {
- var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, scroll, thread, u, unreadCount, unreadQYCount, v;
- postObjects = req.response.posts;
- OP = postObjects[0];
- thread = ThreadUpdater.thread;
- board = thread.board;
- ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1];
- if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts[lastPost].info.date < 30 * $.SECOND) {
- return;
- }
- Build.spoilerRange[board] = OP.custom_spoiler;
- thread.setStatus('Archived', !!OP.archived);
- ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
- ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
- thread.postLimit = !!OP.bumplimit;
- thread.fileLimit = !!OP.imagelimit;
- if (OP.unique_ips != null) {
- thread.ipCount = OP.unique_ips;
- }
- posts = [];
- index = [];
- files = [];
- newPosts = [];
- for (k = 0, len1 = postObjects.length; k < len1; k++) {
- postObject = postObjects[k];
- ID = postObject.no;
- index.push(ID);
- if (postObject.fsize) {
- files.push(ID);
- }
- if (ID <= lastPost) {
- continue;
- }
- if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
- post.resurrect();
- continue;
- }
- newPosts.push(board + "." + ID);
- node = Build.postFromObject(postObject, board.ID);
- posts.push(new Post(node, thread, board));
- if (ThreadUpdater.postID === ID) {
- delete ThreadUpdater.postID;
- }
- }
- deletedPosts = [];
- ref1 = ThreadUpdater.postIDs;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- ID = ref1[q];
- if (!(indexOf.call(index, ID) < 0)) {
- continue;
- }
- thread.posts[ID].kill();
- deletedPosts.push(board + "." + ID);
- }
- ThreadUpdater.postIDs = index;
- deletedFiles = [];
- ref2 = ThreadUpdater.fileIDs;
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- ID = ref2[u];
- if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) {
- continue;
- }
- thread.posts[ID].kill(true);
- deletedFiles.push(board + "." + ID);
- }
- ThreadUpdater.fileIDs = files;
- if (!posts.length) {
- ThreadUpdater.set('status', '');
- } else {
- ThreadUpdater.set('status', "+" + posts.length, 'new');
- ThreadUpdater.outdateCount = 0;
- unreadCount = (ref4 = Unread.posts) != null ? ref4.size : void 0;
- unreadQYCount = (ref5 = Unread.postsQuotingYou) != null ? ref5.size : void 0;
- Main.callbackNodes(Post, posts);
- if (d.hidden || !d.hasFocus()) {
- if (Conf['Beep Quoting You'] && ((ref6 = Unread.postsQuotingYou) != null ? ref6.size : void 0) > unreadQYCount) {
- ThreadUpdater.playBeep();
- if (Conf['Beep']) {
- ThreadUpdater.playBeep();
- }
- } else if (Conf['Beep'] && ((ref7 = Unread.posts) != null ? ref7.size : void 0) > 0 && unreadCount === 0) {
- ThreadUpdater.playBeep();
- }
- }
- scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
- firstPost = null;
- for (v = 0, len4 = posts.length; v < len4; v++) {
- post = posts[v];
- if (!QuoteThreading.insert(post)) {
- firstPost || (firstPost = post.nodes.root);
- $.add(ThreadUpdater.root, post.nodes.root);
- }
- }
- $.event('PostsInserted');
- if (scroll) {
- if (Conf['Bottom Scroll']) {
- window.scrollTo(0, d.body.clientHeight);
- } else {
- if (firstPost) {
- Header.scrollTo(firstPost);
- }
- }
- }
- }
- if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) {
- ipCountEl.textContent = OP.unique_ips;
- ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are');
- ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters');
- }
- return $.event('ThreadUpdate', {
- 404: false,
- threadID: thread.fullID,
- newPosts: newPosts,
- deletedPosts: deletedPosts,
- deletedFiles: deletedFiles,
- postCount: OP.replies + 1,
- fileCount: OP.images + !!OP.fsize,
- ipCount: OP.unique_ips
- });
- }
- };
-
- ThreadWatcher = {
- init: function() {
- var sc;
- if (!(this.enabled = Conf['Thread Watcher'])) {
- return;
- }
- this.shortcut = sc = $.el('a', {
- id: 'watcher-link',
- textContent: 'Watcher',
- title: 'Thread Watcher',
- href: 'javascript:;',
- className: 'disabled fa fa-eye'
- });
- this.db = new DataBoard('watchedThreads', this.refresh, true);
- this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', {
- innerHTML: "
"
- });
- this.status = $('#watcher-status', this.dialog);
- this.list = this.dialog.lastElementChild;
- this.refreshButton = $('.refresh', this.dialog);
- this.closeButton = $('.move > .close', this.dialog);
- this.unreaddb = Unread.db || new DataBoard('lastReadPosts');
- this.unreadEnabled = Conf['Remember Last Read Post'];
- $.on(d, 'QRPostSuccessful', this.cb.post);
- $.on(sc, 'click', this.toggleWatcher);
- $.on(this.refreshButton, 'click', this.buttonFetchAll);
- $.on(this.closeButton, 'click', this.toggleWatcher);
- $.on(d, '4chanXInitFinished', this.ready);
- switch (g.VIEW) {
- case 'index':
- $.on(d, 'IndexRefresh', this.cb.onIndexRefresh);
- break;
- case 'thread':
- $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh);
- }
- if (Conf['Fixed Thread Watcher']) {
- $.addClass(doc, 'fixed-watcher');
- }
- if (Conf['Toggleable Thread Watcher']) {
- this.dialog.hidden = true;
- Header.addShortcut(sc);
- $.addClass(doc, 'toggleable-watcher');
- }
- ThreadWatcher.fetchAuto();
- if (g.VIEW === 'index' && Conf['JSON Index'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
- Menu.menu.addEntry({
- el: $.el('a', {
- href: 'javascript:;',
- className: 'has-shortcut-text'
- }, {
- innerHTML: "Alt+click "
- }),
- order: 6,
- open: function(arg) {
- var thread;
- thread = arg.thread;
- if (Conf['Index Mode'] !== 'catalog') {
- return false;
- }
- this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? 'Unwatch' : 'Watch';
- if (this.cb) {
- $.off(this.el, 'click', this.cb);
- }
- this.cb = function() {
- $.event('CloseMenu');
- return ThreadWatcher.toggle(thread);
- };
- $.on(this.el, 'click', this.cb);
- return true;
- }
- });
- }
- Post.callbacks.push({
- name: 'Thread Watcher',
- cb: this.node
- });
- return CatalogThread.callbacks.push({
- name: 'Thread Watcher',
- cb: this.catalogNode
- });
- },
- isWatched: function(thread) {
- var ref;
- return (ref = ThreadWatcher.db) != null ? ref.get({
- boardID: thread.board.ID,
- threadID: thread.ID
- }) : void 0;
- },
- node: function() {
- var toggler;
- if (this.isReply) {
- return;
- }
- if (this.isClone) {
- toggler = $('.watch-thread-link', this.nodes.post);
- } else {
- toggler = $.el('a', {
- href: 'javascript:;',
- className: 'watch-thread-link'
- });
- $.before($('input', this.nodes.post), toggler);
- }
- return $.on(toggler, 'click', ThreadWatcher.cb.toggle);
- },
- catalogNode: function() {
- if (ThreadWatcher.isWatched(this.thread)) {
- $.addClass(this.nodes.root, 'watched');
- }
- $.on(this.nodes.thumb.parentNode, 'click', (function(_this) {
- return function(e) {
- if (!(e.button === 0 && e.altKey)) {
- return;
- }
- ThreadWatcher.toggle(_this.thread);
- return e.preventDefault();
- };
- })(this));
- return $.on(this.nodes.thumb.parentNode, 'mousedown', function(e) {
- if (e.button === 0 && e.altKey) {
- return e.preventDefault();
- }
- });
- },
- ready: function() {
- $.off(d, '4chanXInitFinished', ThreadWatcher.ready);
- if (!Main.isThisPageLegit()) {
- return;
- }
- ThreadWatcher.refresh();
- $.add(d.body, ThreadWatcher.dialog);
- if (!Conf['Auto Watch']) {
- return;
- }
- return $.get('AutoWatch', 0, function(arg) {
- var AutoWatch, thread;
- AutoWatch = arg.AutoWatch;
- if (!(thread = g.BOARD.threads[AutoWatch])) {
- return;
- }
- ThreadWatcher.add(thread);
- return $["delete"]('AutoWatch');
- });
- },
- toggleWatcher: function() {
- $.toggleClass(ThreadWatcher.shortcut, 'disabled');
- return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden;
- },
- cb: {
- openAll: function() {
- var a, k, len1, ref;
- if ($.hasClass(this, 'disabled')) {
- return;
- }
- ref = $$('a[title]', ThreadWatcher.list);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- a = ref[k];
- $.open(a.href);
- }
- return $.event('CloseMenu');
- },
- pruneDeads: function() {
- var boardID, data, k, len1, ref, ref1, threadID;
- if ($.hasClass(this, 'disabled')) {
- return;
- }
- ThreadWatcher.db.forceSync();
- ref = ThreadWatcher.getAll();
- for (k = 0, len1 = ref.length; k < len1; k++) {
- ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
- if (!data.isDead) {
- continue;
- }
- delete ThreadWatcher.db.data.boards[boardID][threadID];
- ThreadWatcher.db.deleteIfEmpty({
- boardID: boardID
- });
- }
- ThreadWatcher.db.save();
- ThreadWatcher.refresh();
- return $.event('CloseMenu');
- },
- toggle: function() {
- var thread;
- thread = Get.postFromNode(this).thread;
- Index.followedThreadID = thread.ID;
- ThreadWatcher.toggle(thread);
- return delete Index.followedThreadID;
- },
- rm: function() {
- var boardID, ref, threadID;
- ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1];
- return ThreadWatcher.rm(boardID, +threadID);
- },
- post: function(e) {
- var boardID, postID, ref, threadID;
- ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- if (postID === threadID) {
- if (Conf['Auto Watch']) {
- return $.set('AutoWatch', threadID);
- }
- } else if (Conf['Auto Watch Reply']) {
- return ThreadWatcher.add(g.threads[boardID + '.' + threadID]);
- }
- },
- onIndexRefresh: function() {
- var boardID, data, db, ref, threadID;
- db = ThreadWatcher.db;
- boardID = g.BOARD.ID;
- db.forceSync();
- ref = db.data.boards[boardID];
- for (threadID in ref) {
- data = ref[threadID];
- if (!(data != null ? data.isDead : void 0) && !(threadID in g.BOARD.threads)) {
- if (Conf['Auto Prune'] || !(data && typeof data === 'object')) {
- db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- } else {
- if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
- ThreadWatcher.fetchStatus({
- boardID: boardID,
- threadID: threadID,
- data: data
- });
- }
- data.isDead = true;
- db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- }
- }
- }
- return ThreadWatcher.refresh();
- },
- onThreadRefresh: function(e) {
- var thread;
- thread = g.threads[e.detail.threadID];
- if (!(e.detail[404] && ThreadWatcher.db.get({
- boardID: thread.board.ID,
- threadID: thread.ID
- }))) {
- return;
- }
- return ThreadWatcher.add(thread);
- }
- },
- requests: [],
- fetched: 0,
- clearRequests: function() {
- ThreadWatcher.requests = [];
- ThreadWatcher.fetched = 0;
- ThreadWatcher.status.textContent = '';
- return $.rmClass(ThreadWatcher.refreshButton, 'fa-spin');
- },
- abort: function() {
- var k, len1, ref, req;
- ref = ThreadWatcher.requests;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- req = ref[k];
- if (req.readyState !== 4) {
- req.abort();
- }
- }
- return ThreadWatcher.clearRequests();
- },
- fetchAuto: function() {
- var db, interval, now;
- clearTimeout(ThreadWatcher.timeout);
- if (!Conf['Auto Update Thread Watcher']) {
- return;
- }
- db = ThreadWatcher.db;
- interval = ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] ? 5 * $.MINUTE : 2 * $.HOUR;
- now = Date.now();
- if (now >= (db.data.lastChecked || 0) + interval) {
- db.data.lastChecked = now;
- ThreadWatcher.fetchAllStatus();
- db.save();
- }
- return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);
- },
- buttonFetchAll: function() {
- if (ThreadWatcher.requests.length) {
- return ThreadWatcher.abort();
- } else {
- return ThreadWatcher.fetchAllStatus();
- }
- },
- fetchAllStatus: function() {
- var k, len1, ref, thread, threads;
- ThreadWatcher.db.forceSync();
- ThreadWatcher.unreaddb.forceSync();
- if ((ref = QuoteYou.db) != null) {
- ref.forceSync();
- }
- if (!(threads = ThreadWatcher.getAll()).length) {
- return;
- }
- for (k = 0, len1 = threads.length; k < len1; k++) {
- thread = threads[k];
- ThreadWatcher.fetchStatus(thread);
- }
- },
- fetchStatus: function(thread, force) {
- var boardID, data, req, threadID;
- boardID = thread.boardID, threadID = thread.threadID, data = thread.data;
- if (data.isDead && !force) {
- return;
- }
- if (ThreadWatcher.requests.length === 0) {
- ThreadWatcher.status.textContent = '...';
- $.addClass(ThreadWatcher.refreshButton, 'fa-spin');
- }
- req = $.ajax("//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json", {
- onloadend: function() {
- return ThreadWatcher.parseStatus.call(this, thread);
- },
- timeout: $.MINUTE
- }, {
- whenModified: force ? false : 'ThreadWatcher'
- });
- return ThreadWatcher.requests.push(req);
- },
- parseStatus: function(arg) {
- var boardID, data, isDead, k, lastReadPost, len1, match, postObj, quotesYou, quotingYou, ref, ref1, regexp, threadID, unread;
- boardID = arg.boardID, threadID = arg.threadID, data = arg.data;
- ThreadWatcher.fetched++;
- if (ThreadWatcher.fetched === ThreadWatcher.requests.length) {
- ThreadWatcher.clearRequests();
- } else {
- ThreadWatcher.status.textContent = (Math.round(ThreadWatcher.fetched / ThreadWatcher.requests.length * 100)) + "%";
- }
- if (this.status === 200 && this.response) {
- isDead = !!this.response.posts[0].archived;
- if (isDead && Conf['Auto Prune']) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- ThreadWatcher.refresh();
- return;
- }
- lastReadPost = ThreadWatcher.unreaddb.get({
- boardID: boardID,
- threadID: threadID,
- defaultValue: 0
- });
- unread = quotingYou = 0;
- ref = this.response.posts;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- postObj = ref[k];
- if (!(postObj.no > lastReadPost)) {
- continue;
- }
- if ((ref1 = QuoteYou.db) != null ? ref1.get({
- boardID: boardID,
- threadID: threadID,
- postID: postObj.no
- }) : void 0) {
- continue;
- }
- unread++;
- if (!(QuoteYou.db && postObj.com)) {
- continue;
- }
- quotesYou = false;
- regexp = /]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g;
- while (match = regexp.exec(postObj.com)) {
- if (QuoteYou.db.get({
- boardID: match[1] || boardID,
- threadID: match[2] || threadID,
- postID: match[3] || match[2] || threadID
- })) {
- quotesYou = true;
- break;
- }
- }
- if (quotesYou && !Filter.isHidden(Build.parseJSON(postObj, boardID))) {
- quotingYou++;
- }
- }
- if (isDead !== data.isDead || unread !== data.unread || quotingYou !== data.quotingYou) {
- data.isDead = isDead;
- data.unread = unread;
- data.quotingYou = quotingYou;
- ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- return ThreadWatcher.refresh();
- }
- } else if (this.status === 404) {
- if (Conf['Auto Prune']) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- } else {
- data.isDead = true;
- delete data.unread;
- delete data.quotingYou;
- ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- }
- return ThreadWatcher.refresh();
- }
- },
- getAll: function() {
- var all, boardID, data, ref, threadID, threads;
- all = [];
- ref = ThreadWatcher.db.data.boards;
- for (boardID in ref) {
- threads = ref[boardID];
- if (Conf['Current Board'] && boardID !== g.BOARD.ID) {
- continue;
- }
- for (threadID in threads) {
- data = threads[threadID];
- if (data && typeof data === 'object') {
- all.push({
- boardID: boardID,
- threadID: threadID,
- data: data
- });
- }
- }
- }
- return all;
- },
- makeLine: function(boardID, threadID, data) {
- var count, div, fullID, link, title, x;
- x = $.el('a', {
- className: 'fa fa-times',
- href: 'javascript:;'
- });
- $.on(x, 'click', ThreadWatcher.cb.rm);
- link = $.el('a', {
- href: "/" + boardID + "/thread/" + threadID,
- title: data.excerpt,
- className: 'watcher-link'
- });
- if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) {
- count = $.el('span', {
- textContent: "(" + data.unread + ")",
- className: 'watcher-unread'
- });
- $.add(link, count);
- }
- title = $.el('span', {
- textContent: data.excerpt,
- className: 'watcher-title'
- });
- $.add(link, title);
- div = $.el('div');
- fullID = boardID + "." + threadID;
- div.dataset.fullID = fullID;
- if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) {
- $.addClass(div, 'current');
- }
- if (data.isDead) {
- $.addClass(div, 'dead-thread');
- }
- if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
- if (data.unread === 0) {
- $.addClass(div, 'replies-read');
- }
- if (data.unread) {
- $.addClass(div, 'replies-unread');
- }
- if (data.quotingYou) {
- $.addClass(div, 'replies-quoting-you');
- }
- }
- $.add(div, [x, $.tn(' '), link]);
- return div;
- },
- refresh: function() {
- var boardID, data, k, len1, len2, list, nodes, q, ref, ref1, ref2, refresher, threadID;
- nodes = [];
- ref = ThreadWatcher.getAll();
- for (k = 0, len1 = ref.length; k < len1; k++) {
- ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
- nodes.push(ThreadWatcher.makeLine(boardID, threadID, data));
- }
- list = ThreadWatcher.list;
- $.rmAll(list);
- $.add(list, nodes);
- g.threads.forEach(function(thread) {
- var helper, len2, post, q, ref2, toggler;
- helper = ThreadWatcher.isWatched(thread) ? ['addClass', 'Unwatch'] : ['rmClass', 'Watch'];
- if (thread.OP) {
- ref2 = [thread.OP].concat(slice.call(thread.OP.clones));
- for (q = 0, len2 = ref2.length; q < len2; q++) {
- post = ref2[q];
- toggler = $('.watch-thread-link', post.nodes.post);
- $[helper[0]](toggler, 'watched');
- toggler.title = helper[1] + " Thread";
- }
- }
- if (thread.catalogView) {
- return $[helper[0]](thread.catalogView.nodes.root, 'watched');
- }
- });
- ThreadWatcher.refreshIcon();
- ref2 = ThreadWatcher.menu.refreshers;
- for (q = 0, len2 = ref2.length; q < len2; q++) {
- refresher = ref2[q];
- refresher();
- }
- if (Index.nodes && Conf['Pin Watched Threads']) {
- Index.sort();
- return Index.buildIndex();
- }
- },
- refreshIcon: function() {
- var className, k, len1, ref;
- ref = ['replies-unread', 'replies-quoting-you'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- className = ref[k];
- ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog));
- }
- },
- update: function(boardID, threadID, newData) {
- var data, key, line, n, newLine, ref, val;
- if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
- boardID: boardID,
- threadID: threadID
- }) : void 0)) {
- return;
- }
- if (newData.isDead && Conf['Auto Prune']) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- ThreadWatcher.refresh();
- return;
- }
- n = 0;
- for (key in newData) {
- val = newData[key];
- if (data[key] !== val) {
- n++;
- }
- }
- if (!n) {
- return;
- }
- ThreadWatcher.db.forceSync();
- if (!(data = ThreadWatcher.db.get({
- boardID: boardID,
- threadID: threadID
- }))) {
- return;
- }
- $.extend(data, newData);
- ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- if (line = $("#watched-threads > [data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog)) {
- newLine = ThreadWatcher.makeLine(boardID, threadID, data);
- $.replace(line, newLine);
- return ThreadWatcher.refreshIcon();
- } else {
- return ThreadWatcher.refresh();
- }
- },
- set404: function(boardID, threadID, cb) {
- var data, ref;
- if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
- boardID: boardID,
- threadID: threadID
- }) : void 0)) {
- return cb();
- }
- if (Conf['Auto Prune']) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- return cb();
- }
- if (data.isDead && !((data.unread != null) || (data.quotingYou != null))) {
- return cb();
- }
- data.isDead = true;
- delete data.unread;
- delete data.quotingYou;
- return ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- }, cb);
- },
- toggle: function(thread) {
- var boardID, threadID;
- boardID = thread.board.ID;
- threadID = thread.ID;
- if (ThreadWatcher.db.get({
- boardID: boardID,
- threadID: threadID
- })) {
- return ThreadWatcher.rm(boardID, threadID);
- } else {
- return ThreadWatcher.add(thread);
- }
- },
- add: function(thread) {
- var boardID, data, threadID;
- data = {};
- boardID = thread.board.ID;
- threadID = thread.ID;
- if (thread.isDead) {
- if (Conf['Auto Prune'] && ThreadWatcher.db.get({
- boardID: boardID,
- threadID: threadID
- })) {
- ThreadWatcher.rm(boardID, threadID);
- return;
- }
- data.isDead = true;
- }
- data.excerpt = Get.threadExcerpt(thread);
- ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- ThreadWatcher.refresh();
- if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
- return ThreadWatcher.fetchStatus({
- boardID: boardID,
- threadID: threadID,
- data: data
- }, true);
- }
- },
- rm: function(boardID, threadID) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- return ThreadWatcher.refresh();
- },
- menu: {
- refreshers: [],
- init: function() {
- var menu;
- if (!Conf['Thread Watcher']) {
- return;
- }
- menu = this.menu = new UI.Menu('thread watcher');
- $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) {
- return menu.toggle(e, this, ThreadWatcher);
- });
- this.addHeaderMenuEntry();
- return this.addMenuEntries();
- },
- addHeaderMenuEntry: function() {
- var entryEl;
- if (g.VIEW !== 'thread') {
- return;
- }
- entryEl = $.el('a', {
- href: 'javascript:;'
- });
- Header.menu.addEntry({
- el: entryEl,
- order: 60
- });
- $.on(entryEl, 'click', function() {
- return ThreadWatcher.toggle(g.threads[g.BOARD + "." + g.THREADID]);
- });
- return this.refreshers.push(function() {
- var addClass, ref, rmClass, text;
- ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = ref[0], rmClass = ref[1], text = ref[2];
- $.addClass(entryEl, addClass);
- $.rmClass(entryEl, rmClass);
- return entryEl.textContent = text;
- });
- },
- addMenuEntries: function() {
- var cb, conf, entries, entry, k, len1, name, ref, ref1, refresh, subEntries;
- entries = [];
- entries.push({
- cb: ThreadWatcher.cb.openAll,
- entry: {
- el: $.el('a', {
- textContent: 'Open all threads'
- })
- },
- refresh: function() {
- return (ThreadWatcher.list.firstElementChild ? $.rmClass : $.addClass)(this.el, 'disabled');
- }
- });
- entries.push({
- cb: ThreadWatcher.cb.pruneDeads,
- entry: {
- el: $.el('a', {
- textContent: 'Prune dead threads'
- })
- },
- refresh: function() {
- return ($('.dead-thread', ThreadWatcher.list) ? $.rmClass : $.addClass)(this.el, 'disabled');
- }
- });
- subEntries = [];
- ref = Config.threadWatcher;
- for (name in ref) {
- conf = ref[name];
- subEntries.push(this.createSubEntry(name, conf[1]));
- }
- entries.push({
- entry: {
- el: $.el('span', {
- textContent: 'Settings'
- }),
- subEntries: subEntries
- }
- });
- for (k = 0, len1 = entries.length; k < len1; k++) {
- ref1 = entries[k], entry = ref1.entry, cb = ref1.cb, refresh = ref1.refresh;
- if (entry.el.nodeName === 'A') {
- entry.el.href = 'javascript:;';
- }
- if (cb) {
- $.on(entry.el, 'click', cb);
- }
- if (refresh) {
- this.refreshers.push(refresh.bind(entry));
- }
- this.menu.addEntry(entry);
- }
- },
- createSubEntry: function(name, desc) {
- var entry, input;
- entry = {
- type: 'thread watcher',
- el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
- };
- entry.el.title = desc;
- input = entry.el.firstElementChild;
- if (name === 'Show Unread Count' && !ThreadWatcher.unreadEnabled) {
- input.disabled = true;
- $.addClass(entry.el, 'disabled');
- entry.el.title += '\n[Remember Last Read Post is disabled.]';
- }
- $.on(input, 'change', $.cb.checked);
- if (name === 'Current Board' || name === 'Show Unread Count') {
- $.on(input, 'change', ThreadWatcher.refresh);
- }
- if (name === 'Show Unread Count' || name === 'Auto Update Thread Watcher') {
- $.on(input, 'change', ThreadWatcher.fetchAuto);
- }
- return entry;
- }
- }
- };
-
- Unread = {
- init: function() {
- if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Remember Last Read Post'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) {
- return;
- }
- if (Conf['Remember Last Read Post']) {
- $.sync('Remember Last Read Post', function(enabled) {
- return Conf['Remember Last Read Post'] = enabled;
- });
- this.db = new DataBoard('lastReadPosts', this.sync);
- }
- this.hr = $.el('hr', {
- id: 'unread-line'
- });
- this.posts = new Set();
- this.postsQuotingYou = new Set();
- this.order = new RandomAccessList();
- this.position = null;
- Thread.callbacks.push({
- name: 'Unread',
- cb: this.node
- });
- return Post.callbacks.push({
- name: 'Unread',
- cb: this.addPost
- });
- },
- node: function() {
- var ID, k, len1, ref, ref1;
- Unread.thread = this;
- Unread.title = d.title;
- Unread.lastReadPost = ((ref = Unread.db) != null ? ref.get({
- boardID: this.board.ID,
- threadID: this.ID
- }) : void 0) || 0;
- Unread.readCount = 0;
- ref1 = this.posts.keys;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- ID = ref1[k];
- if (+ID <= Unread.lastReadPost) {
- Unread.readCount++;
- }
- }
- $.one(d, '4chanXInitFinished', Unread.ready);
- return $.on(d, 'ThreadUpdate', Unread.onUpdate);
- },
- ready: function() {
- if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) {
- Unread.scroll();
- }
- Unread.setLine(true);
- Unread.read();
- Unread.update();
- $.on(d, 'scroll visibilitychange', Unread.read);
- if (Conf['Unread Line']) {
- return $.on(d, 'visibilitychange', Unread.setLine);
- }
- },
- positionPrev: function() {
- if (Unread.position) {
- return Unread.position.prev;
- } else {
- return Unread.order.last;
- }
- },
- scroll: function() {
- var hash, position, ref, root;
- if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
- return;
- }
- ReplyPruning.showIfHidden((ref = Unread.position) != null ? ref.data.nodes.root.id : void 0);
- position = Unread.positionPrev();
- while (position) {
- root = position.data.nodes.root;
- if (!root.getBoundingClientRect().height) {
- position = position.prev;
- } else {
- Header.scrollToIfNeeded(root, true);
- break;
- }
- }
- },
- sync: function() {
- var ID, i, k, lastReadPost, postIDs, ref, ref1;
- if (Unread.lastReadPost == null) {
- return;
- }
- lastReadPost = Unread.db.get({
- boardID: Unread.thread.board.ID,
- threadID: Unread.thread.ID,
- defaultValue: 0
- });
- if (!(Unread.lastReadPost < lastReadPost)) {
- return;
- }
- Unread.lastReadPost = lastReadPost;
- postIDs = Unread.thread.posts.keys;
- for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
- ID = +postIDs[i];
- if (!Unread.thread.posts[ID].isFetchedQuote) {
- if (ID > Unread.lastReadPost) {
- break;
- }
- Unread.posts["delete"](ID);
- Unread.postsQuotingYou["delete"](ID);
- }
- Unread.readCount++;
- }
- Unread.updatePosition();
- Unread.setLine();
- return Unread.update();
- },
- addPost: function() {
- var ref;
- if (this.isFetchedQuote || this.isClone) {
- return;
- }
- Unread.order.push(this);
- if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QuoteYou.db) != null ? ref.get({
- boardID: this.board.ID,
- threadID: this.thread.ID,
- postID: this.ID
- }) : void 0)) {
- return;
- }
- Unread.posts.add(this.ID);
- Unread.addPostQuotingYou(this);
- return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
- },
- addPostQuotingYou: function(post) {
- var k, len1, quotelink, ref, ref1;
- ref = post.nodes.quotelinks;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
- continue;
- }
- Unread.postsQuotingYou.add(post.ID);
- Unread.openNotification(post);
- return;
- }
- },
- openNotification: function(post) {
- var notif;
- if (!Header.areNotificationsEnabled) {
- return;
- }
- try {
- notif = new Notification(post.info.nameBlock + " replied to you", {
- body: post.info.commentDisplay,
- icon: Favicon.logo
- });
- notif.onclick = function() {
- Header.scrollToIfNeeded(post.nodes.root, true);
- return $.global(function() {
- return window.focus();
- });
- };
- return notif.onshow = function() {
- return setTimeout(function() {
- return notif.close();
- }, 7 * $.SECOND);
- };
- } catch (_error) {}
- },
- onUpdate: function(e) {
- if (!e.detail[404]) {
- Unread.setLine();
- Unread.read();
- }
- return Unread.update();
- },
- readSinglePost: function(post) {
- var ID;
- ID = post.ID;
- if (!Unread.posts.has(ID)) {
- return;
- }
- Unread.posts["delete"](ID);
- Unread.postsQuotingYou["delete"](ID);
- Unread.updatePosition();
- Unread.saveLastReadPost();
- return Unread.update();
- },
- read: $.debounce(100, function(e) {
- var ID, count, data, ref, ref1, root;
- if (!Unread.posts.size && Unread.readCount !== Unread.thread.posts.keys.length) {
- Unread.saveLastReadPost();
- }
- if (d.hidden || !Unread.posts.size) {
- return;
- }
- count = 0;
- while (Unread.position) {
- ref = Unread.position, ID = ref.ID, data = ref.data;
- root = data.nodes.root;
- if (!(!root.getBoundingClientRect().height || Header.getBottomOf(root) > -1)) {
- break;
- }
- count++;
- Unread.posts["delete"](ID);
- Unread.postsQuotingYou["delete"](ID);
- if ((ref1 = QuoteYou.db) != null ? ref1.get({
- boardID: data.board.ID,
- threadID: data.thread.ID,
- postID: ID
- }) : void 0) {
- QuoteYou.lastRead = root;
- }
- Unread.position = Unread.position.next;
- }
- if (!count) {
- return;
- }
- Unread.updatePosition();
- Unread.saveLastReadPost();
- if (e) {
- return Unread.update();
- }
- }),
- updatePosition: function() {
- while (Unread.position && !Unread.posts.has(Unread.position.ID)) {
- Unread.position = Unread.position.next;
- }
- },
- saveLastReadPost: $.debounce(2 * $.SECOND, function() {
- var ID, i, k, postIDs, ref, ref1;
- $.forceSync('Remember Last Read Post');
- if (!(Conf['Remember Last Read Post'] && Unread.db)) {
- return;
- }
- postIDs = Unread.thread.posts.keys;
- for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
- ID = +postIDs[i];
- if (!Unread.thread.posts[ID].isFetchedQuote) {
- if (Unread.posts.has(ID)) {
- break;
- }
- Unread.lastReadPost = ID;
- }
- Unread.readCount++;
- }
- if (Unread.thread.isDead && !Unread.thread.isArchived) {
- return;
- }
- Unread.db.forceSync();
- return Unread.db.set({
- boardID: Unread.thread.board.ID,
- threadID: Unread.thread.ID,
- val: Unread.lastReadPost
- });
- }),
- setLine: function(force) {
- if (!Conf['Unread Line']) {
- return;
- }
- if (Unread.hr.hidden || d.hidden || (force === true)) {
- if ((Unread.linePosition = Unread.positionPrev())) {
- $.after(Unread.linePosition.data.nodes.root, Unread.hr);
- } else {
- $.rm(Unread.hr);
- }
- }
- return Unread.hr.hidden = Unread.linePosition === Unread.order.last;
- },
- update: function() {
- var count, countQuotingYou, isDead, titleCount, titleDead, titleQuotingYou;
- count = Unread.posts.size;
- countQuotingYou = Unread.postsQuotingYou.size;
- if (Conf['Unread Count']) {
- titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : '';
- titleCount = count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '';
- titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title;
- d.title = "" + titleQuotingYou + titleCount + titleDead;
- }
- $.forceSync('Remember Last Read Post');
- if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) {
- ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, {
- isDead: Unread.thread.isDead,
- unread: count,
- quotingYou: countQuotingYou
- });
- }
- if (Conf['Unread Favicon']) {
- isDead = Unread.thread.isDead;
- Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default'];
- return $.add(d.head, Favicon.el);
- }
- }
- };
-
- Redirect = {
- init: function() {
- var archive, archives, boardID, boards, data, files, id, k, len1, len2, name, o, q, record, ref, ref1, software, type, uid, withCredentials;
- o = {
- thread: {},
- post: {},
- file: {},
- report: {}
- };
- archives = {};
- ref = Redirect.archives;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- data = ref[k];
- uid = data.uid, name = data.name, boards = data.boards, files = data.files, software = data.software, withCredentials = data.withCredentials;
- archives[JSON.stringify(uid != null ? uid : name)] = data;
- for (q = 0, len2 = boards.length; q < len2; q++) {
- boardID = boards[q];
- if (!withCredentials) {
- if (!(boardID in o.thread)) {
- o.thread[boardID] = data;
- }
- if (!(boardID in o.post || software !== 'foolfuuka')) {
- o.post[boardID] = data;
- }
- if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) {
- o.file[boardID] = data;
- }
- }
- if (name === 'fgts') {
- o.report[boardID] = data;
- }
- }
- }
- ref1 = Conf['selectedArchives'];
- for (boardID in ref1) {
- record = ref1[boardID];
- for (type in record) {
- id = record[type];
- if (id === null) {
- delete o[type][boardID];
- } else if (archive = archives[JSON.stringify(id)]) {
- boards = type === 'file' ? archive.files : archive.boards;
- if (indexOf.call(boards, boardID) >= 0) {
- o[type][boardID] = archive;
- }
- }
- }
- }
- return Redirect.data = o;
- },
- archives: [{"uid":3,"name":"4plebs","domain":"archive.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["adv","f","hr","o","pol","s4s","sp","tg","trv","tv","x"],"files":["adv","f","hr","o","pol","s4s","sp","tg","trv","tv","x"]},{"uid":4,"name":"Nyafuu Archive","domain":"archive.nyafuu.org","http":true,"https":true,"software":"foolfuuka","boards":["c","e","news","w","wg","wsr"],"files":["c","e","news","w","wg","wsr"]},{"uid":8,"name":"Rebecca Black Tech","domain":"rbt.asia","http":false,"https":true,"software":"fuuka","boards":["cgl","g","mu"],"files":["cgl","g","mu"]},{"uid":10,"name":"warosu","domain":"warosu.org","http":false,"https":true,"software":"fuuka","boards":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"],"files":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"]},{"uid":15,"name":"fgts","domain":"fgts.jp","http":true,"https":true,"software":"foolfuuka","boards":["asp","b","cm","gd","h","hc","hm","n","out","p","po","qa","r","s","soc","toy","vp","y"],"files":["asp","b","cm","gd","h","hc","hm","n","out","p","po","qa","r","s","soc","toy","vp","y"]},{"uid":23,"name":"Desustorage","domain":"desustorage.org","http":true,"https":true,"software":"foolfuuka","boards":["a","aco","an","c","co","d","fit","gif","his","int","k","m","mlp","qa","r9k","tg","trash","vr","wsg"],"files":["a","aco","an","c","co","d","fit","gif","his","int","k","m","mlp","qa","r9k","tg","trash","vr","wsg"]},{"uid":24,"name":"fireden.net","domain":"boards.fireden.net","http":false,"https":true,"software":"foolfuuka","boards":["a","cm","ic","sci","tg","v","vg","y"],"files":["a","cm","ic","sci","tg","v","vg","y"]},{"uid":25,"name":"arch.b4k.co","domain":"arch.b4k.co","http":true,"https":true,"software":"foolfuuka","boards":["g","jp","mlp","v"],"files":[]},{"uid":5,"name":"Love is Over","domain":"deploy.loveisover.me","http":true,"https":false,"software":"foolfuuka","boards":["c","d","e","i","lgbt","t","u"],"files":["c","d","e","i","lgbt","t","u"],"search":[]},{"uid":28,"name":"bstats","domain":"archive.b-stats.org","http":true,"https":true,"software":"foolfuuka","boards":["f","cm","hm","lgbt","news","trash","y"],"files":[]}],
- to: function(dest, data) {
- var archive;
- archive = (dest === 'search' || dest === 'board' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
- if (!archive) {
- return '';
- }
- return Redirect[dest](archive, data);
- },
- protocol: function(archive) {
- var protocol;
- protocol = location.protocol;
- if (!archive[protocol.slice(0, -1)]) {
- protocol = protocol === 'https:' ? 'http:' : 'https:';
- }
- return protocol + "//";
- },
- 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') {
- path += '/';
- }
- if (threadID && postID) {
- path += archive.software === 'foolfuuka' ? "#" + postID : "#p" + postID;
- }
- return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
- },
- post: function(archive, arg) {
- var boardID, postID, protocol, url;
- boardID = arg.boardID, postID = arg.postID;
- protocol = Redirect.protocol(archive);
- url = "" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID;
- if (!Redirect.securityCheck(url)) {
- return '';
- }
- return url;
- },
- file: function(archive, arg) {
- var boardID, filename;
- boardID = arg.boardID, filename = arg.filename;
- return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
- },
- board: function(archive, arg) {
- var boardID;
- boardID = arg.boardID;
- return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/";
- },
- 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;
- if (type === 'capcode') {
- value = {
- 'Developer': 'dev'
- }[value] || value.toLowerCase();
- } else if (type === 'image') {
- value = value.replace(/[+\/=]/g, function(c) {
- return {
- '+': '-',
- '/': '_',
- '=': ''
- }[c];
- });
- }
- value = encodeURIComponent(value);
- path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value + "/" : type === 'image' ? boardID + "/image/" + value : boardID + "/?task=search2&search_" + type + "=" + value;
- return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
- },
- report: function(archive, arg) {
- var boardID, postID;
- boardID = arg.boardID, postID = arg.postID;
- return "https://so.fgts.jp/report/?board=" + boardID + "&no=" + postID;
- },
- securityCheck: function(url) {
- return /^https:\/\//.test(url) || location.protocol === 'http:' || Conf['Exempt Archives from Encryption'];
- },
- navigate: function(dest, data, alternative) {
- var url;
- if (!Redirect.data) {
- Redirect.init();
- }
- url = Redirect.to(dest, data);
- if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) {
- return location.replace(url);
- } else if (alternative) {
- return location.replace(alternative);
- }
- }
- };
-
- PSAHiding = {
- init: function() {
- if (!Conf['Announcement Hiding']) {
- return;
- }
- $.addClass(doc, 'hide-announcement');
- return $.one(d, '4chanXInitFinished', this.setup);
- },
- setup: function() {
- var btn, entry, hr, psa, ref;
- if (!(psa = PSAHiding.psa = $.id('globalMessage'))) {
- $.rmClass(doc, 'hide-announcement');
- return;
- }
- if ((hr = (ref = $.id('globalToggle')) != null ? ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
- PSAHiding.hr = hr;
- }
- entry = {
- el: $.el('a', {
- textContent: 'Show announcement',
- className: 'show-announcement',
- href: 'javascript:;'
- }),
- order: 50,
- open: function() {
- return PSAHiding.hidden;
- }
- };
- Header.menu.addEntry(entry);
- $.on(entry.el, 'click', PSAHiding.toggle);
- PSAHiding.btn = btn = $.el('span', {
- title: 'Mark announcement as read and hide.',
- className: 'hide-announcement'
- });
- $.extend(btn, {
- innerHTML: "[ Dismiss ]"
- });
- $.on(btn, 'click', PSAHiding.toggle);
- $.get('hiddenPSA', 0, function(arg) {
- var hiddenPSA;
- hiddenPSA = arg.hiddenPSA;
- PSAHiding.sync(hiddenPSA);
- $.add(psa, btn);
- return $.rmClass(doc, 'hide-announcement');
- });
- return $.sync('hiddenPSA', PSAHiding.sync);
- },
- toggle: function() {
- var UTC;
- if ($.hasClass(this, 'hide-announcement')) {
- UTC = +$.id('globalMessage').dataset.utc;
- $.set('hiddenPSA', UTC);
- } else {
- $.event('CloseMenu');
- $["delete"]('hiddenPSA');
- }
- return PSAHiding.sync(UTC);
- },
- sync: function(UTC) {
- var psa, ref;
- psa = PSAHiding.psa;
- PSAHiding.hidden = PSAHiding.btn.hidden = (UTC != null) && UTC >= +psa.dataset.utc;
- if (PSAHiding.hidden) {
- $.rm(psa);
- } else {
- $.after($.id('globalToggle'), psa);
- }
- if ((ref = PSAHiding.hr) != null) {
- ref.hidden = PSAHiding.hidden;
- }
- }
- };
-
- AntiAutoplay = {
- init: function() {
- var audio, k, len1, ref;
- if (!Conf['Disable Autoplaying Sounds']) {
- return;
- }
- $.addClass(doc, 'anti-autoplay');
- ref = $$('audio[autoplay]', doc);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- audio = ref[k];
- this.stop(audio);
- }
- window.addEventListener('loadstart', ((function(_this) {
- return function(e) {
- return _this.stop(e.target);
- };
- })(this)), true);
- Post.callbacks.push({
- name: 'Disable Autoplaying Sounds',
- cb: this.node
- });
- CatalogThread.callbacks.push({
- name: 'Disable Autoplaying Sounds',
- cb: this.node
- });
- return $.ready((function(_this) {
- return function() {
- return _this.process(d.body);
- };
- })(this));
- },
- stop: function(audio) {
- if (!audio.autoplay) {
- return;
- }
- audio.pause();
- audio.autoplay = false;
- if (audio.controls) {
- return;
- }
- audio.controls = true;
- return $.addClass(audio, 'controls-added');
- },
- node: function() {
- return AntiAutoplay.process(this.nodes.root);
- },
- process: function(root) {
- var iframe, k, len1, len2, object, q, ref, ref1;
- ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- iframe = ref[k];
- iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
- $.addClass(iframe, 'autoplay-removed');
- }
- ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- object = ref1[q];
- object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
- $.addClass(object, 'autoplay-removed');
- }
- }
- };
-
- Banner = {
- banners: ["0.jpg","1.jpg","2.jpg","4.jpg","6.jpg","7.jpg","8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg","14.jpg","16.jpg","17.jpg","18.jpg","19.jpg","20.jpg","21.jpg","22.jpg","24.jpg","25.jpg","26.jpg","28.jpg","29.jpg","33.jpg","38.jpg","39.jpg","43.jpg","44.jpg","45.jpg","46.jpg","47.jpg","52.jpg","54.jpg","57.jpg","59.jpg","60.jpg","61.jpg","64.jpg","66.jpg","67.jpg","69.jpg","71.jpg","72.jpg","76.jpg","77.jpg","81.jpg","82.jpg","83.jpg","84.jpg","88.jpg","90.jpg","91.jpg","96.jpg","98.jpg","99.jpg","100.jpg","104.jpg","106.jpg","116.jpg","119.jpg","137.jpg","140.jpg","148.jpg","149.jpg","150.jpg","154.jpg","156.jpg","157.jpg","158.jpg","159.jpg","161.jpg","162.jpg","164.jpg","165.jpg","166.jpg","167.jpg","168.jpg","169.jpg","170.jpg","171.jpg","172.jpg","173.jpg","174.jpg","175.jpg","176.jpg","178.jpg","179.jpg","180.jpg","181.jpg","182.jpg","183.jpg","186.jpg","189.jpg","190.jpg","192.jpg","193.jpg","194.jpg","197.jpg","198.jpg","200.jpg","201.jpg","202.jpg","203.jpg","205.jpg","206.jpg","207.jpg","208.jpg","210.jpg","213.jpg","214.jpg","215.jpg","216.jpg","218.jpg","219.jpg","220.jpg","221.jpg","222.jpg","223.jpg","224.jpg","227.jpg","0.png","1.png","2.png","3.png","5.png","6.png","9.png","10.png","11.png","12.png","14.png","16.png","19.png","20.png","21.png","22.png","23.png","24.png","26.png","27.png","28.png","29.png","30.png","31.png","32.png","33.png","34.png","37.png","39.png","40.png","41.png","42.png","43.png","44.png","45.png","48.png","49.png","50.png","51.png","52.png","53.png","57.png","58.png","59.png","64.png","66.png","67.png","68.png","69.png","70.png","71.png","72.png","76.png","78.png","79.png","81.png","82.png","85.png","86.png","87.png","89.png","95.png","98.png","100.png","101.png","102.png","105.png","106.png","107.png","109.png","110.png","111.png","112.png","113.png","114.png","115.png","116.png","118.png","119.png","120.png","121.png","122.png","123.png","126.png","128.png","130.png","134.png","136.png","138.png","139.png","140.png","142.png","145.png","146.png","149.png","150.png","151.png","152.png","153.png","154.png","155.png","156.png","157.png","158.png","159.png","160.png","163.png","164.png","165.png","166.png","167.png","168.png","169.png","170.png","171.png","172.png","173.png","174.png","178.png","179.png","180.png","181.png","182.png","184.png","186.png","188.png","190.png","192.png","193.png","194.png","195.png","196.png","197.png","198.png","200.png","202.png","203.png","205.png","206.png","207.png","209.png","212.png","213.png","214.png","216.png","217.png","218.png","219.png","220.png","221.png","222.png","223.png","224.png","225.png","226.png","229.png","231.png","232.png","233.png","234.png","235.png","237.png","238.png","239.png","240.png","241.png","242.png","244.png","245.png","246.png","247.png","248.png","249.png","250.png","253.png","254.png","255.png","256.png","257.png","258.png","259.png","260.png","262.png","268.png","0.gif","1.gif","2.gif","3.gif","4.gif","5.gif","6.gif","7.gif","8.gif","9.gif","10.gif","12.gif","13.gif","14.gif","15.gif","16.gif","18.gif","19.gif","20.gif","21.gif","22.gif","23.gif","24.gif","28.gif","29.gif","30.gif","33.gif","34.gif","35.gif","36.gif","37.gif","39.gif","40.gif","42.gif","44.gif","45.gif","46.gif","48.gif","50.gif","52.gif","54.gif","55.gif","57.gif","58.gif","59.gif","60.gif","61.gif","63.gif","64.gif","66.gif","67.gif","68.gif","69.gif","70.gif","72.gif","73.gif","75.gif","76.gif","77.gif","78.gif","80.gif","81.gif","82.gif","83.gif","86.gif","87.gif","88.gif","92.gif","93.gif","94.gif","95.gif","96.gif","97.gif","98.gif","99.gif","100.gif","101.gif","102.gif","103.gif","104.gif","105.gif","106.gif","108.gif","109.gif","110.gif","111.gif","112.gif","113.gif","115.gif","116.gif","117.gif","118.gif","119.gif","120.gif","122.gif","123.gif","124.gif","127.gif","129.gif","130.gif","131.gif","134.gif","135.gif","136.gif","138.gif","139.gif","141.gif","144.gif","146.gif","148.gif","149.gif","153.gif","154.gif","155.gif","157.gif","158.gif","159.gif","160.gif","161.gif","162.gif","164.gif","166.gif","167.gif","168.gif","169.gif","170.gif","171.gif","172.gif","173.gif","174.gif","175.gif","176.gif","177.gif","178.gif","181.gif","182.gif","183.gif","185.gif","186.gif","187.gif","188.gif","189.gif","190.gif","191.gif","192.gif","193.gif","195.gif","196.gif","197.gif","200.gif","201.gif","202.gif","203.gif","204.gif","205.gif","206.gif","207.gif","208.gif","209.gif","210.gif","211.gif","212.gif","213.gif","214.gif","215.gif","216.gif","217.gif","219.gif","220.gif","221.gif","222.gif","224.gif","225.gif","226.gif","227.gif","228.gif","230.gif","232.gif","233.gif","234.gif","235.gif","238.gif","240.gif","241.gif","243.gif","244.gif","245.gif","246.gif","247.gif","249.gif","250.gif","251.gif","253.gif"],
- init: function() {
- if (Conf['Custom Board Titles']) {
- this.db = new DataBoard('customTitles', null, true);
- }
- $.asap((function() {
- return d.body;
- }), function() {
- return $.asap((function() {
- return $('hr');
- }), Banner.ready);
- });
- if (g.BOARD.ID !== 'f') {
- return Main.ready(function() {
- return $.queueTask(Banner.load);
- });
- }
- },
- ready: function() {
- var banner, children;
- banner = $(".boardBanner");
- children = banner.children;
- if (g.BOARD.ID !== 'f' && g.VIEW === 'thread' && Conf['Remove Thread Excerpt']) {
- Banner.setTitle(children[1].textContent);
- }
- children[0].title = "Click to change";
- $.on(children[0], 'click', Banner.cb.toggle);
- if (Conf['Custom Board Titles']) {
- Banner.custom(children[1]);
- if (children[2]) {
- return Banner.custom(children[2]);
- }
- }
- },
- load: function() {
- var bannerCnt, img;
- bannerCnt = $.id('bannerCnt');
- if (!bannerCnt.firstChild) {
- img = $.el('img', {
- alt: '4chan',
- src: '//s.4cdn.org/image/title/' + bannerCnt.dataset.src
- });
- return $.add(bannerCnt, img);
- }
- },
- setTitle: function(title) {
- if (Unread.title != null) {
- Unread.title = title;
- return Unread.update();
- } else {
- return d.title = title;
- }
- },
- cb: {
- toggle: function() {
- var banner, i, ref;
- if (!((ref = Banner.choices) != null ? ref.length : void 0)) {
- Banner.choices = Banner.banners.slice();
- }
- i = Math.floor(Banner.choices.length * Math.random());
- banner = Banner.choices.splice(i, 1);
- return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner;
- },
- click: function(e) {
- var base1, br, k, len1, name1, ref;
- if (!(e.ctrlKey || e.metaKey)) {
- return;
- }
- if ((base1 = Banner.original)[name1 = this.className] == null) {
- base1[name1] = this.cloneNode(true);
- }
- this.contentEditable = true;
- ref = $$('br', this);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- br = ref[k];
- $.replace(br, $.tn('\n'));
- }
- return this.focus();
- },
- keydown: function(e) {
- e.stopPropagation();
- if (!e.shiftKey && e.keyCode === 13) {
- return this.blur();
- }
- },
- blur: function() {
- var br, k, len1, ref;
- ref = $$('br', this);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- br = ref[k];
- $.replace(br, $.tn('\n'));
- }
- if (this.textContent = this.textContent.replace(/\n*$/, '')) {
- this.contentEditable = false;
- return Banner.db.set({
- boardID: g.BOARD.ID,
- threadID: this.className,
- val: {
- title: this.textContent,
- orig: Banner.original[this.className].textContent
- }
- });
- } else {
- $.rmAll(this);
- $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes));
- return Banner.db["delete"]({
- boardID: g.BOARD.ID,
- threadID: this.className
- });
- }
- }
- },
- original: {},
- custom: function(child) {
- var className, data, event, items, k, len1, ref, string, string2;
- className = child.className;
- child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase());
- child.spellcheck = false;
- ref = ['click', 'keydown', 'blur'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- event = ref[k];
- $.on(child, event, Banner.cb[event]);
- }
- string = g.BOARD + "." + className;
- string2 = string + ".orig";
- items = {};
- items[string] = '';
- items[string2] = child.textContent;
- $.get(items, function(items) {
- if (items[string]) {
- Banner.db.set({
- boardID: g.BOARD.ID,
- threadID: className,
- val: {
- title: items[string],
- orig: items[string2]
- }
- });
- }
- return $["delete"]([string, string2]);
- });
- if (data = Banner.db.get({
- boardID: g.BOARD.ID,
- threadID: className
- })) {
- if (Conf['Persistent Custom Board Titles'] || data.orig === child.textContent) {
- Banner.original[className] = child.cloneNode(true);
- return child.textContent = data.title;
- } else {
- return Banner.db["delete"]({
- boardID: g.BOARD.ID,
- threadID: className
- });
- }
- }
- }
- };
-
- CatalogLinks = {
- init: function() {
- var el, input, selector;
- if ((Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) {
- selector = (function() {
- switch (g.VIEW) {
- case 'thread':
- case 'archive':
- return '.navLinks.desktop > a';
- case 'catalog':
- return '.navLinks > :first-child > a';
- case 'index':
- return '#ctrl-top > a, .cataloglink > a';
- }
- })();
- $.ready(function() {
- var catalogLink, k, len1, link, ref;
- ref = $$(selector);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- switch (link.pathname.replace(/\/+/g, '/')) {
- case "/" + g.BOARD + "/":
- if (Conf['JSON Index']) {
- link.textContent = 'Index';
- }
- link.href = CatalogLinks.index();
- break;
- case "/" + g.BOARD + "/catalog":
- link.href = CatalogLinks.catalog();
- }
- if (g.VIEW === 'catalog' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
- catalogLink = link.parentNode.cloneNode(true);
- catalogLink.firstElementChild.textContent = '4chan X Catalog';
- catalogLink.firstElementChild.href = CatalogLinks.catalog();
- $.after(link.parentNode, [$.tn(' '), catalogLink]);
- }
- }
- });
- }
- if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
- Post.callbacks.push({
- name: 'Catalog Link Rewrite',
- cb: this.node
- });
- CatalogThread.callbacks.push({
- name: 'Catalog Link Rewrite',
- cb: this.node
- });
- }
- if (Conf['Catalog Links']) {
- CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links');
- el.id = 'toggleCatalog';
- input = $('input', el);
- $.on(input, 'change', this.toggle);
- $.sync('Header catalog links', CatalogLinks.set);
- return Header.menu.addEntry({
- el: el,
- order: 95
- });
- }
- },
- node: function() {
- var a, k, len1, m, ref;
- ref = $$('a', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- a = ref[k];
- if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
- a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
- }
- }
- },
- initBoardList: function() {
- if (!CatalogLinks.el) {
- return;
- }
- return CatalogLinks.set(Conf['Header catalog links']);
- },
- toggle: function() {
- $.event('CloseMenu');
- $.set('Header catalog links', this.checked);
- return CatalogLinks.set(this.checked);
- },
- set: function(useCatalog) {
- var a, board, k, len1, ref, ref1;
- ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- a = ref[k];
- if (((ref1 = a.hostname) !== 'boards.4chan.org' && ref1 !== 'catalog.neet.tv') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
- continue;
- }
- a.href = useCatalog ? CatalogLinks.catalog(board) : "/" + board + "/";
- if (a.dataset.indexOptions && a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
- a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions;
- }
- }
- CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
- return $('input', CatalogLinks.el).checked = useCatalog;
- },
- catalog: function(board) {
- if (board == null) {
- board = g.BOARD.ID;
- }
- if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) {
- return "http://catalog.neet.tv/" + board + "/";
- } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
- if (g.BOARD.ID === board && g.VIEW === 'index') {
- return '#catalog';
- } else {
- return "/" + board + "/#catalog";
- }
- } else {
- return "/" + board + "/catalog";
- }
- },
- index: function(board) {
- if (board == null) {
- board = g.BOARD.ID;
- }
- if (Conf['JSON Index'] && board !== 'f') {
- if (g.BOARD.ID === board && g.VIEW === 'index') {
- return '#index';
- } else {
- return "/" + board + "/#index";
- }
- } else {
- return "/" + board + "/";
- }
- }
- };
-
- CustomCSS = {
- init: function() {
- if (!Conf['Custom CSS']) {
- return;
- }
- return this.addStyle();
- },
- addStyle: function() {
- return this.style = $.addStyle(Conf['usercss'], 'custom-css', '#fourchanx-css');
- },
- rmStyle: function() {
- if (this.style) {
- $.rm(this.style);
- return delete this.style;
- }
- },
- update: function() {
- if (!this.style) {
- return this.addStyle();
- }
- return this.style.textContent = Conf['usercss'];
- }
- };
-
- ExpandComment = {
- init: function() {
- if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) {
- return;
- }
- if (g.BOARD.ID === 'g') {
- this.callbacks.push(Fourchan.code);
- }
- if (g.BOARD.ID === 'sci') {
- this.callbacks.push(Fourchan.math);
- }
- return Post.callbacks.push({
- name: 'Comment Expansion',
- cb: this.node
- });
- },
- node: function() {
- var a;
- if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
- return $.on(a, 'click', ExpandComment.cb);
- }
- },
- callbacks: [],
- cb: function(e) {
- e.preventDefault();
- return ExpandComment.expand(Get.postFromNode(this));
- },
- 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;
- return;
- }
- if (!(a = $('.abbr > a', post.nodes.comment))) {
- return;
- }
- a.textContent = "Post No." + post + " Loading...";
- return $.cache("//a.4cdn.org" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + ".json", function() {
- return ExpandComment.parse(this, a, post);
- });
- },
- contract: function(post) {
- var a;
- if (!post.nodes.shortComment) {
- return;
- }
- a = $('.abbr > a', post.nodes.shortComment);
- a.textContent = 'here';
- $.replace(post.nodes.longComment, post.nodes.shortComment);
- return post.nodes.comment = post.nodes.shortComment;
- },
- parse: function(req, a, post) {
- var callback, clone, comment, href, k, len1, len2, len3, postObj, posts, q, quote, ref, ref1, spoilerRange, status, u;
- status = req.status;
- if (status !== 200 && status !== 304) {
- a.textContent = "Error " + req.statusText + " (" + status + ")";
- return;
- }
- posts = req.response.posts;
- if (spoilerRange = posts[0].custom_spoiler) {
- Build.spoilerRange[g.BOARD] = spoilerRange;
- }
- for (k = 0, len1 = posts.length; k < len1; k++) {
- postObj = posts[k];
- if (postObj.no === post.ID) {
- break;
- }
- }
- if (postObj.no !== post.ID) {
- a.textContent = "Post No." + post + " not found.";
- return;
- }
- comment = post.nodes.comment;
- clone = comment.cloneNode(false);
- clone.innerHTML = postObj.com;
- ref = $$('.quotelink', clone);
- for (q = 0, len2 = ref.length; q < len2; q++) {
- quote = ref[q];
- href = quote.getAttribute('href');
- if (href[0] === '/') {
- continue;
- }
- if (href[0] === '#') {
- quote.href = "" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + href;
- } else {
- quote.href = (a.pathname.split(/\/+/).splice(0, 3).join('/')) + "/" + href;
- }
- }
- post.nodes.shortComment = comment;
- $.replace(comment, clone);
- post.nodes.comment = post.nodes.longComment = clone;
- post.parseComment();
- post.parseQuotes();
- ref1 = ExpandComment.callbacks;
- for (u = 0, len3 = ref1.length; u < len3; u++) {
- callback = ref1[u];
- callback.call(post);
- }
- }
- };
-
- ExpandThread = {
- statuses: {},
- init: function() {
- if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
- return;
- }
- if (Conf['JSON Index']) {
- return $.on(d, 'IndexRefresh', this.onIndexRefresh);
- } else {
- return Thread.callbacks.push({
- name: 'Expand Thread',
- cb: function() {
- return ExpandThread.setButton(this);
- }
- });
- }
- },
- setButton: function(thread) {
- var a;
- if (!(a = $.x('following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
- return;
- }
- a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
- a.style.cursor = 'pointer';
- return $.on(a, 'click', ExpandThread.cbToggle);
- },
- disconnect: function(refresh) {
- var ref, ref1, status, threadID;
- if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
- return;
- }
- ref = ExpandThread.statuses;
- for (threadID in ref) {
- status = ref[threadID];
- if ((ref1 = status.req) != null) {
- ref1.abort();
- }
- delete ExpandThread.statuses[threadID];
- }
- if (!refresh) {
- return $.off(d, 'IndexRefresh', this.onIndexRefresh);
- }
- },
- onIndexRefresh: function() {
- ExpandThread.disconnect(true);
- return g.BOARD.threads.forEach(function(thread) {
- return ExpandThread.setButton(thread);
- });
- },
- cbToggle: function(e) {
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- e.preventDefault();
- return ExpandThread.toggle(Get.threadFromNode(this));
- },
- toggle: function(thread) {
- var a, threadRoot;
- threadRoot = thread.OP.nodes.root.parentNode;
- if (!(a = $('.summary', threadRoot))) {
- return;
- }
- if (thread.ID in ExpandThread.statuses) {
- return ExpandThread.contract(thread, a, threadRoot);
- } else {
- return ExpandThread.expand(thread, a);
- }
- },
- expand: function(thread, a) {
- var status;
- ExpandThread.statuses[thread] = status = {};
- a.textContent = Build.summaryText.apply(Build, ['...'].concat(slice.call(a.textContent.match(/\d+/g))));
- return status.req = $.cache("//a.4cdn.org/" + thread.board + "/thread/" + thread + ".json", function() {
- delete status.req;
- return ExpandThread.parse(this, thread, a);
- });
- },
- contract: function(thread, a, threadRoot) {
- var filesCount, inlined, k, len1, num, postsCount, replies, reply, status;
- status = ExpandThread.statuses[thread];
- delete ExpandThread.statuses[thread];
- if (status.req) {
- status.req.abort();
- if (a) {
- a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
- }
- return;
- }
- replies = $$('.thread > .replyContainer', threadRoot);
- if (!Conf['JSON Index'] || Conf['Show Replies']) {
- num = (function() {
- if (thread.isSticky) {
- return 1;
- } else {
- switch (g.BOARD.ID) {
- case 'b':
- case 'vg':
- return 3;
- case 't':
- return 1;
- default:
- return 5;
- }
- }
- })();
- replies = replies.slice(0, -num);
- }
- postsCount = 0;
- filesCount = 0;
- for (k = 0, len1 = replies.length; k < len1; k++) {
- reply = replies[k];
- if (Conf['Quote Inlining']) {
- while (inlined = $('.inlined', reply)) {
- inlined.click();
- }
- }
- postsCount++;
- if ('file' in Get.postFromRoot(reply)) {
- filesCount++;
- }
- $.rm(reply);
- }
- return a.textContent = Build.summaryText('+', postsCount, filesCount);
- },
- parse: function(req, thread, a) {
- var filesCount, k, len1, post, postData, posts, postsCount, postsRoot, ref, ref1, root;
- if ((ref = req.status) !== 200 && ref !== 304) {
- a.textContent = "Error " + req.statusText + " (" + req.status + ")";
- return;
- }
- Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler;
- posts = [];
- postsRoot = [];
- filesCount = 0;
- ref1 = req.response.posts;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- postData = ref1[k];
- if (postData.no === thread.ID) {
- continue;
- }
- if ((post = thread.posts[postData.no]) && !post.isFetchedQuote) {
- if ('file' in post) {
- filesCount++;
- }
- postsRoot.push(post.nodes.root);
- continue;
- }
- root = Build.postFromObject(postData, thread.board.ID);
- post = new Post(root, thread, thread.board);
- if ('file' in post) {
- filesCount++;
- }
- posts.push(post);
- postsRoot.push(root);
- }
- Main.callbackNodes(Post, posts);
- $.after(a, postsRoot);
- $.event('PostsInserted');
- postsCount = postsRoot.length;
- return a.textContent = Build.summaryText('-', postsCount, filesCount);
- }
- };
-
- FileInfo = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['File Info Formatting']) {
- return;
- }
- return Post.callbacks.push({
- name: 'File Info Formatting',
- cb: this.node
- });
- },
- node: function() {
- var info, oldInfo;
- if (!this.file || this.isClone) {
- return;
- }
- oldInfo = $.el('span', {
- className: 'fileText-original'
- });
- $.prepend(this.file.link.parentNode, oldInfo);
- $.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]);
- info = $.el('span', {
- className: 'file-info'
- });
- FileInfo.format(Conf['fileInfo'], this, info);
- return $.prepend(this.file.text, info);
- },
- format: function(formatString, post, outputNode) {
- var output;
- output = [];
- formatString.replace(/%(.)|[^%]+/g, function(s, c) {
- output.push(c in FileInfo.formatters ? FileInfo.formatters[c].call(post) : {
- innerHTML: E(s)
- });
- return '';
- });
- return $.extend(outputNode, {
- innerHTML: E.cat(output)
- });
- },
- formatters: {
- t: function() {
- return {
- innerHTML: E(this.file.url.match(/[^/]*$/)[0])
- };
- },
- T: function() {
- return {
- innerHTML: "" + FileInfo.formatters.t.call(this).innerHTML + " "
- };
- },
- l: function() {
- return {
- innerHTML: "" + FileInfo.formatters.n.call(this).innerHTML + " "
- };
- },
- L: function() {
- return {
- innerHTML: "" + FileInfo.formatters.N.call(this).innerHTML + " "
- };
- },
- n: function() {
- var fullname, shortname;
- fullname = this.file.name;
- shortname = Build.shortFilename(this.file.name, this.isReply);
- if (fullname === shortname) {
- return {
- innerHTML: E(fullname)
- };
- } else {
- return {
- innerHTML: "" + E(shortname) + " " + E(fullname) + " "
- };
- }
- },
- N: function() {
- return {
- innerHTML: E(this.file.name)
- };
- },
- p: function() {
- return {
- innerHTML: (this.file.isSpoiler ? "Spoiler, " : "")
- };
- },
- s: function() {
- return {
- innerHTML: E(this.file.size)
- };
- },
- B: function() {
- return {
- innerHTML: E(Math.round(this.file.sizeInBytes)) + " Bytes"
- };
- },
- K: function() {
- return {
- innerHTML: E(Math.round(this.file.sizeInBytes/1024)) + " KB"
- };
- },
- M: function() {
- return {
- innerHTML: E(Math.round(this.file.sizeInBytes/1048576*100)/100) + " MB"
- };
- },
- r: function() {
- return {
- innerHTML: E(this.file.dimensions || "PDF")
- };
- },
- g: function() {
- return {
- innerHTML: (this.file.tag ? ", " + E(this.file.tag) : "")
- };
- },
- '%': function() {
- return {
- innerHTML: "%"
- };
- }
- }
- };
-
- Flash = {
- init: function() {
- if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) {
- return $.ready(Flash.initReady);
- }
- },
- initReady: function() {
- if ($.hasStorage) {
- return $.global(function() {
- if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) {
- return window.SWFEmbed.init();
- }
- });
- } else {
- if (g.VIEW === 'thread') {
- $.global(function() {
- return window.Main.tid = location.pathname.split(/\/+/)[3];
- });
- }
- return $.global(function() {
- return window.SWFEmbed.init();
- });
- }
- }
- };
-
- Fourchan = {
- init: function() {
- var ref;
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- if (g.BOARD.ID === 'g') {
- $.on(window, 'prettyprint:cb', function(e) {
- var post, pre;
- if (!(post = g.posts[e.detail.ID])) {
- return;
- }
- if (!(pre = $$('.prettyprint', post.nodes.comment)[e.detail.i])) {
- return;
- }
- if (!$.hasClass(pre, 'prettyprinted')) {
- pre.innerHTML = e.detail.html;
- return $.addClass(pre, 'prettyprinted');
- }
- });
- $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: {\n ID: e.detail.ID,\n i: e.detail.i,\n html: prettyPrintOne(e.detail.html)\n }\n }));\n}, false);');
- Post.callbacks.push({
- name: 'Parse /g/ code',
- cb: this.code
- });
- }
- if (g.BOARD.ID === 'sci') {
- $.global(function() {
- return window.addEventListener('mathjax', function(e) {
- if (window.MathJax) {
- return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
- } else {
- if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) {
- window.loadMathJax();
- window.loadMathJax = function() {};
- }
- if (!e.target.classList.contains('postMessage')) {
- return document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener('load', function() {
- return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
- }, false);
- }
- }
- }, false);
- });
- Post.callbacks.push({
- name: 'Parse /sci/ math',
- cb: this.math
- });
- CatalogThread.callbacks.push({
- name: 'Parse /sci/ math',
- cb: this.math
- });
- }
- return Main.ready(function() {
- return $.global(function() {
- var k, len1, node, ref1;
- window.clickable_ids = false;
- ref1 = document.querySelectorAll('.posteruid, .capcode');
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- node = ref1[k];
- node.removeEventListener('click', window.idClick, false);
- }
- });
- });
- },
- code: function() {
- if (this.isClone) {
- return;
- }
- return $.ready((function(_this) {
- return function() {
- var i, k, len1, pre, ref;
- ref = $$('.prettyprint', _this.nodes.comment);
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- pre = ref[i];
- if (!$.hasClass(pre, 'prettyprinted')) {
- $.event('prettyprint', {
- ID: _this.fullID,
- i: i,
- html: pre.innerHTML
- }, window);
- }
- }
- };
- })(this));
- },
- math: function() {
- var cb, k, len1, wbr, wbrs;
- if (!/\[(math|eqn)\]/.test(this.nodes.comment.textContent)) {
- return;
- }
- if ((wbrs = $$('wbr', this.nodes.comment)).length) {
- for (k = 0, len1 = wbrs.length; k < len1; k++) {
- wbr = wbrs[k];
- $.rm(wbr);
- }
- this.nodes.comment.normalize();
- }
- cb = (function(_this) {
- return function() {
- if (!doc.contains(_this.nodes.comment)) {
- return;
- }
- $.off(d, 'PostsInserted', cb);
- return $.event('mathjax', null, _this.nodes.comment);
- };
- })(this);
- $.on(d, 'PostsInserted', cb);
- return cb();
- }
- };
-
- IDColor = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) {
- return;
- }
- this.ids = {
- Heaven: [0, 0, 0, '#fff']
- };
- return Post.callbacks.push({
- name: 'Color User IDs',
- cb: this.node
- });
- },
- node: function() {
- var rgb, span, style, uid;
- if (this.isClone || !((uid = this.info.uniqueID) && (span = $('span.hand', this.nodes.uniqueID)))) {
- return;
- }
- rgb = IDColor.ids[uid] || IDColor.compute(uid);
- style = span.style;
- style.color = rgb[3];
- style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
- return $.addClass(span, 'painted');
- },
- compute: function(uid) {
- var hash, rgb;
- hash = IDColor.hash(uid);
- rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
- rgb.push((rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff');
- return this.ids[uid] = rgb;
- },
- hash: function(uid) {
- var i, msg;
- msg = 0;
- i = 0;
- while (i < 8) {
- msg = (msg << 5) - msg + uid.charCodeAt(i++);
- }
- return msg;
- }
- };
-
- IDHighlight = {
- init: function() {
- var ref;
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- return Post.callbacks.push({
- name: 'Highlight by User ID',
- cb: this.node
- });
- },
- uniqueID: null,
- node: function() {
- if (this.nodes.uniqueID) {
- $.on(this.nodes.uniqueID, 'click', IDHighlight.click(this));
- }
- if (this.nodes.capcode) {
- $.on(this.nodes.capcode, 'click', IDHighlight.click(this));
- }
- if (!this.isClone) {
- return IDHighlight.set(this);
- }
- },
- set: function(post) {
- var match;
- match = (post.info.uniqueID || post.info.capcode) === IDHighlight.uniqueID;
- return $[match ? 'addClass' : 'rmClass'](post.nodes.post, 'highlight');
- },
- click: function(post) {
- return function() {
- var uniqueID;
- uniqueID = post.info.uniqueID || post.info.capcode;
- IDHighlight.uniqueID = IDHighlight.uniqueID === uniqueID ? null : uniqueID;
- return g.posts.forEach(IDHighlight.set);
- };
- }
- };
-
- Keybinds = {
- init: function() {
- var hotkey, init;
- if (!Conf['Keybinds']) {
- return;
- }
- for (hotkey in Config.hotkeys) {
- $.sync(hotkey, Keybinds.sync);
- }
- init = function() {
- var k, len1, node, ref;
- $.off(d, '4chanXInitFinished', init);
- $.on(d, 'keydown', Keybinds.keydown);
- ref = $$('[accesskey]');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- node = ref[k];
- node.removeAttribute('accesskey');
- }
- };
- return $.on(d, '4chanXInitFinished', init);
- },
- sync: function(key, hotkey) {
- return Conf[hotkey] = key;
- },
- keydown: function(e) {
- var form, k, key, len1, notification, notifications, op, ref, ref1, ref2, ref3, ref4, ref5, searchInput, target, thread, threadRoot;
- if (!(key = Keybinds.keyCode(e))) {
- return;
- }
- target = e.target;
- if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') {
- if (!(/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) && !/^Alt\+(\d|Up|Down|Left|Right)$/.test(key))) {
- return;
- }
- }
- if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Index'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
- threadRoot = Nav.getThread();
- if (op = $('.op', threadRoot)) {
- thread = Get.postFromNode(op).thread;
- }
- }
- switch (key) {
- case Conf['Toggle board list']:
- if (!Conf['Custom Board Navigation']) {
- return;
- }
- Header.toggleBoardList();
- break;
- case Conf['Toggle header']:
- Header.toggleBarVisibility();
- break;
- case Conf['Open empty QR']:
- if (!QR.postingIsEnabled) {
- return;
- }
- Keybinds.qr();
- break;
- case Conf['Open QR']:
- if (!(QR.postingIsEnabled && threadRoot)) {
- return;
- }
- Keybinds.qr(threadRoot);
- break;
- case Conf['Open settings']:
- Settings.open();
- break;
- case Conf['Close']:
- if (Settings.dialog) {
- Settings.close();
- } else if ((notifications = $$('.notification')).length) {
- for (k = 0, len1 = notifications.length; k < len1; k++) {
- notification = notifications[k];
- $('.close', notification).click();
- }
- } else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) {
- if (Conf['Persistent QR']) {
- QR.hide();
- } else {
- QR.close();
- }
- } else if (Embedding.lastEmbed) {
- Embedding.closeFloat();
- } else {
- return;
- }
- break;
- case Conf['Spoiler tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('spoiler', target);
- break;
- case Conf['Code tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('code', target);
- break;
- case Conf['Eqn tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('eqn', target);
- break;
- case Conf['Math tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('math', target);
- break;
- case Conf['SJIS tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('sjis', target);
- break;
- case Conf['Toggle sage']:
- if (!(QR.nodes && !QR.nodes.el.hidden)) {
- return;
- }
- Keybinds.sage();
- break;
- case Conf['Submit QR']:
- if (!(QR.nodes && !QR.nodes.el.hidden)) {
- return;
- }
- if (!QR.status()) {
- QR.submit();
- }
- break;
- case Conf['Update']:
- switch (g.VIEW) {
- case 'thread':
- if (!Conf['Thread Updater']) {
- return;
- }
- ThreadUpdater.update();
- break;
- case 'index':
- if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
- return;
- }
- Index.update();
- break;
- default:
- return;
- }
- break;
- case Conf['Watch']:
- if (!(ThreadWatcher.enabled && thread)) {
- return;
- }
- ThreadWatcher.toggle(thread);
- break;
- case Conf['Update thread watcher']:
- if (!ThreadWatcher.enabled) {
- return;
- }
- ThreadWatcher.buttonFetchAll();
- break;
- case Conf['Expand image']:
- if (!(ImageExpand.enabled && threadRoot)) {
- return;
- }
- Keybinds.img(threadRoot);
- break;
- case Conf['Expand images']:
- if (!(ImageExpand.enabled && threadRoot)) {
- return;
- }
- Keybinds.img(threadRoot, true);
- break;
- case Conf['Open Gallery']:
- if (!Gallery.enabled) {
- return;
- }
- Gallery.cb.toggle();
- break;
- case Conf['fappeTyme']:
- if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread'))) {
- return;
- }
- FappeTyme.toggle('fappe');
- break;
- case Conf['werkTyme']:
- if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread'))) {
- return;
- }
- FappeTyme.toggle('werk');
- break;
- case Conf['Front page']:
- if (Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
- Index.userPageNav(1);
- } else {
- window.location = "/" + g.BOARD + "/";
- }
- break;
- case Conf['Open front page']:
- $.open("/" + g.BOARD + "/");
- break;
- case Conf['Next page']:
- if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
- return;
- }
- if (Conf['JSON Index']) {
- if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
- return;
- }
- $('.next button', Index.pagelist).click();
- } else {
- if (form = $('.next form')) {
- window.location = form.action;
- }
- }
- break;
- case Conf['Previous page']:
- if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
- return;
- }
- if (Conf['JSON Index']) {
- if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
- return;
- }
- $('.prev button', Index.pagelist).click();
- } else {
- if (form = $('.prev form')) {
- window.location = form.action;
- }
- }
- break;
- case Conf['Search form']:
- if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
- return;
- }
- searchInput = Conf['JSON Index'] ? Index.searchInput : $.id('search-box');
- Header.scrollToIfNeeded(searchInput);
- searchInput.focus();
- break;
- case Conf['Paged mode']:
- if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
- return;
- }
- window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
- break;
- case Conf['Infinite scrolling mode']:
- if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
- return;
- }
- window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
- break;
- case Conf['All pages mode']:
- if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
- return;
- }
- window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
- break;
- case Conf['Open catalog']:
- if (g.BOARD.ID === 'f') {
- return;
- }
- window.location = CatalogLinks.catalog();
- break;
- case Conf['Cycle sort type']:
- if (!(Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
- return;
- }
- Index.cycleSortType();
- break;
- case Conf['Next thread']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- Nav.scroll(+1);
- break;
- case Conf['Previous thread']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- Nav.scroll(-1);
- break;
- case Conf['Expand thread']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- ExpandThread.toggle(thread);
- break;
- case Conf['Open thread']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- Keybinds.open(thread);
- break;
- case Conf['Open thread tab']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- Keybinds.open(thread, true);
- break;
- case Conf['Next reply']:
- if (!threadRoot) {
- return;
- }
- Keybinds.hl(+1, threadRoot);
- break;
- case Conf['Previous reply']:
- if (!threadRoot) {
- return;
- }
- Keybinds.hl(-1, threadRoot);
- break;
- case Conf['Deselect reply']:
- if (!threadRoot) {
- return;
- }
- Keybinds.hl(0, threadRoot);
- break;
- case Conf['Hide']:
- if (!thread) {
- return;
- }
- if (ThreadHiding.db) {
- ThreadHiding.toggle(thread);
- }
- break;
- case Conf['Previous Post Quoting You']:
- if (!(threadRoot && QuoteYou.db)) {
- return;
- }
- QuoteYou.cb.seek('preceding');
- break;
- case Conf['Next Post Quoting You']:
- if (!(threadRoot && QuoteYou.db)) {
- return;
- }
- QuoteYou.cb.seek('following');
- break;
- default:
- return;
- }
- e.preventDefault();
- return e.stopPropagation();
- },
- keyCode: function(e) {
- var kc, key;
- key = (function() {
- switch (kc = e.keyCode) {
- case 8:
- return '';
- case 13:
- return 'Enter';
- case 27:
- return 'Esc';
- case 32:
- return 'Space';
- case 37:
- return 'Left';
- case 38:
- return 'Up';
- case 39:
- return 'Right';
- case 40:
- return 'Down';
- case 188:
- return 'Comma';
- case 190:
- return 'Period';
- case 191:
- return 'Slash';
- case 59:
- case 186:
- return 'Semicolon';
- default:
- if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) {
- return String.fromCharCode(kc).toLowerCase();
- } else if ((96 <= kc && kc <= 105)) {
- return String.fromCharCode(kc - 48).toLowerCase();
- } else {
- return null;
- }
- }
- })();
- if (key) {
- if (e.altKey) {
- key = 'Alt+' + key;
- }
- if (e.ctrlKey) {
- key = 'Ctrl+' + key;
- }
- if (e.metaKey) {
- key = 'Meta+' + key;
- }
- if (e.shiftKey) {
- key = 'Shift+' + key;
- }
- }
- return key;
- },
- qr: function(thread) {
- QR.open();
- if (thread != null) {
- QR.quote.call($('input', $('.post.highlight', thread) || thread));
- }
- return QR.nodes.com.focus();
- },
- tags: function(tag, ta) {
- var range, selEnd, selStart, supported, value;
- supported = (function() {
- switch (tag) {
- case 'spoiler':
- return !!$('.postForm input[name=spoiler]');
- case 'code':
- return g.BOARD.ID === 'g';
- case 'math':
- case 'eqn':
- return g.BOARD.ID === 'sci';
- case 'sjis':
- return g.BOARD.ID === 'jp';
- }
- })();
- if (!supported) {
- new Notice('warning', "[" + tag + "] tags are not supported on /" + g.BOARD + "/.", 20);
- }
- value = ta.value;
- selStart = ta.selectionStart;
- selEnd = ta.selectionEnd;
- ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd);
- range = ("[" + tag + "]").length + selEnd;
- ta.setSelectionRange(range, range);
- return $.event('input', null, ta);
- },
- 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 {
- post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread));
- return ImageExpand.toggle(post);
- }
- },
- open: function(thread, tab) {
- var url;
- if (g.VIEW !== 'index') {
- return;
- }
- url = "/" + thread.board + "/thread/" + thread;
- if (tab) {
- return $.open(url);
- } else {
- return location.href = url;
- }
- },
- hl: function(delta, thread) {
- var axis, height, k, len1, next, postEl, replies, reply, root;
- postEl = $('.reply.highlight', thread);
- if (!delta) {
- if (postEl) {
- $.rmClass(postEl, 'highlight');
- }
- return;
- }
- if (postEl) {
- height = postEl.getBoundingClientRect().height;
- if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
- root = postEl.parentNode;
- axis = delta === +1 ? 'following' : 'preceding';
- if (!(next = $.x(axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
- return;
- }
- Header.scrollToIfNeeded(next, delta === +1);
- this.focus(next);
- $.rmClass(postEl, 'highlight');
- return;
- }
- $.rmClass(postEl, 'highlight');
- }
- replies = $$('.reply', thread);
- if (delta === -1) {
- replies.reverse();
- }
- for (k = 0, len1 = replies.length; k < len1; k++) {
- reply = replies[k];
- if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) {
- this.focus(reply);
- return;
- }
- }
- },
- focus: function(post) {
- return $.addClass(post, 'highlight');
- }
- };
-
- Nav = {
- init: function() {
- var append, next, prev, span;
- switch (g.VIEW) {
- case 'index':
- if (!Conf['Index Navigation']) {
- return;
- }
- break;
- case 'thread':
- if (!Conf['Reply Navigation']) {
- return;
- }
- break;
- default:
- return;
- }
- span = $.el('span', {
- id: 'navlinks'
- });
- prev = $.el('a', {
- textContent: 'â–²',
- href: 'javascript:;'
- });
- next = $.el('a', {
- textContent: 'â–¼',
- href: 'javascript:;'
- });
- $.on(prev, 'click', this.prev);
- $.on(next, 'click', this.next);
- $.add(span, [prev, $.tn(' '), next]);
- append = function() {
- $.off(d, '4chanXInitFinished', append);
- return $.add(d.body, span);
- };
- return $.on(d, '4chanXInitFinished', append);
- },
- prev: function() {
- if (g.VIEW === 'thread') {
- return window.scrollTo(0, 0);
- } else {
- return Nav.scroll(-1);
- }
- },
- next: function() {
- if (g.VIEW === 'thread') {
- return window.scrollTo(0, d.body.scrollHeight);
- } else {
- return Nav.scroll(+1);
- }
- },
- getThread: function() {
- var k, len1, ref, thread, threadRoot;
- ref = $$('.thread');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- threadRoot = ref[k];
- thread = Get.threadFromRoot(threadRoot);
- if (thread.isHidden && !thread.stub) {
- continue;
- }
- if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) {
- return threadRoot;
- }
- }
- return $('.board');
- },
- scroll: function(delta) {
- var axis, extra, next, ref, thread, top;
- if ((ref = d.activeElement) != null) {
- ref.blur();
- }
- thread = Nav.getThread();
- axis = delta === +1 ? 'following' : 'preceding';
- if (next = $.x(axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
- top = Header.getTopOf(thread);
- if (delta === +1 && top < 5 || delta === -1 && top > -5) {
- thread = next;
- }
- }
- extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom;
- if (extra > 0) {
- d.body.style.marginBottom = extra + "px";
- }
- Header.scrollTo(thread);
- if (extra > 0 && !Nav.haveExtra) {
- Nav.haveExtra = true;
- return $.on(d, 'scroll', Nav.removeExtra);
- }
- },
- removeExtra: function() {
- var extra;
- extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;
- if (extra > 0) {
- return d.body.style.marginBottom = extra + "px";
- } else {
- d.body.style.marginBottom = null;
- delete Nav.haveExtra;
- return $.off(d, 'scroll', Nav.removeExtra);
- }
- }
- };
-
- NormalizeURL = {
- init: function() {
- var pathname;
- if (!Conf['Normalize URL']) {
- return;
- }
- pathname = location.pathname.split(/\/+/);
- switch (g.VIEW) {
- case 'thread':
- pathname[2] = 'thread';
- pathname = pathname.slice(0, 4);
- break;
- case 'index':
- pathname = pathname.slice(0, 3);
- }
- pathname = pathname.join('/');
- if (location.pathname !== pathname) {
- return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
- }
- }
- };
-
- RelativeDates = {
- INTERVAL: $.MINUTE / 2,
- init: function() {
- var ref;
- if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Index'] && g.BOARD.ID !== 'f') {
- this.flush();
- $.on(d, 'visibilitychange ThreadUpdate', this.flush);
- }
- if (Conf['Relative Post Dates']) {
- return Post.callbacks.push({
- name: 'Relative Post Dates',
- cb: this.node
- });
- }
- },
- node: function() {
- var dateEl;
- dateEl = this.nodes.date;
- if (Conf['Relative Date Title']) {
- $.on(dateEl, 'mouseover', (function(_this) {
- return function() {
- return RelativeDates.hover(_this);
- };
- })(this));
- return;
- }
- if (this.isClone) {
- return;
- }
- dateEl.title = dateEl.textContent;
- return RelativeDates.update(this);
- },
- 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 * years) > 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) {
- unit += 's';
- }
- return rounded + " " + unit + " ago";
- },
- stale: [],
- flush: function() {
- var data, k, len1, now, ref;
- if (d.hidden) {
- return;
- }
- now = new Date();
- ref = RelativeDates.stale;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- data = ref[k];
- RelativeDates.update(data, now);
- }
- RelativeDates.stale = [];
- clearTimeout(RelativeDates.timeout);
- return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL);
- },
- hover: function(post) {
- var date, diff, now;
- date = post.info.date;
- now = new Date();
- diff = now - date;
- return post.nodes.date.title = RelativeDates.relative(diff, now, date);
- },
- update: function(data, now) {
- var date, diff, isPost, k, len1, ref, relative, singlePost;
- isPost = data instanceof Post;
- date = isPost ? data.info.date : new Date(+data.dataset.utc);
- now || (now = new Date());
- diff = now - date;
- relative = RelativeDates.relative(diff, now, date);
- if (isPost) {
- ref = [data].concat(data.clones);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- singlePost = ref[k];
- singlePost.nodes.date.firstChild.textContent = relative;
- }
- } else {
- data.firstChild.textContent = relative;
- }
- return RelativeDates.setOwnTimeout(diff, data);
- },
- setOwnTimeout: function(diff, data) {
- var delay;
- delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY;
- return setTimeout(RelativeDates.markStale, delay, data);
- },
- markStale: function(data) {
- if (indexOf.call(RelativeDates.stale, data) >= 0) {
- return;
- }
- if (data instanceof Post && !g.posts[data.fullID]) {
- return;
- }
- return RelativeDates.stale.push(data);
- }
- };
-
- RemoveSpoilers = {
- init: function() {
- if (Conf['Reveal Spoilers']) {
- $.addClass(doc, 'reveal-spoilers');
- }
- if (!Conf['Remove Spoilers']) {
- return;
- }
- Post.callbacks.push({
- name: 'Reveal Spoilers',
- cb: this.node
- });
- CatalogThread.callbacks.push({
- name: 'Reveal Spoilers',
- cb: this.node
- });
- if (g.VIEW === 'archive') {
- return $.ready(function() {
- return RemoveSpoilers.unspoiler($.id('arc-list'));
- });
- }
- },
- node: function() {
- return RemoveSpoilers.unspoiler(this.nodes.comment);
- },
- unspoiler: function(el) {
- var k, len1, span, spoiler, spoilers;
- spoilers = $$('s', el);
- for (k = 0, len1 = spoilers.length; k < len1; k++) {
- spoiler = spoilers[k];
- span = $.el('span', {
- className: 'removed-spoiler'
- });
- $.replace(spoiler, span);
- $.add(span, slice.call(spoiler.childNodes));
- }
- }
- };
-
- Report = {
- css: "#g-recaptcha,\n" +
-":root:not(.js-enabled) #captchaContainerAlt {\n" +
-" height: auto;\n" +
-"}\n" +
-"#captchaContainerAlt td:nth-child(2) {\n" +
-" display: table-cell !important;\n" +
-"}",
- init: function() {
- var match;
- if (!(match = location.search.match(/\bno=(\d+)/))) {
- return;
- }
- Captcha.replace.init();
- this.postID = +match[1];
- return $.ready(this.ready);
- },
- ready: function() {
- var passAd, prev, ref;
- $.addStyle(Report.css);
- if (Conf['Archive Report']) {
- Report.archive();
- }
- if ((passAd = $('a[href="https://www.4chan.org/pass"]'))) {
- $.extend(passAd, {
- textContent: 'Complain',
- href: 'https://www.4chan-x.net/captchas.html',
- tabIndex: -1
- });
- passAd.parentNode.normalize();
- if (((ref = (prev = passAd.previousSibling)) != null ? ref.nodeType : void 0) === Node.TEXT_NODE) {
- prev.nodeValue = prev.nodeValue.replace(/4chan Pass[^\.]*\./i, 'reCAPTCHA malfunctioning?');
- }
- $.after(passAd, [
- $.tn('] ['), $.el('a', {
- href: 'mailto:4chanpass@4chan.org?subject=4chan%20Pass%20-%20Purchase%20Support',
- textContent: 'Email 4chan',
- target: '_blank',
- tabIndex: -1
- })
- ]);
- }
- if (!Conf['Use Recaptcha v1 in Reports'] && !Conf['Force Noscript Captcha'] && Main.jsEnabled) {
- return new MutationObserver(function() {
- Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
- return Report.fit('body');
- }).observe(d.body, {
- childList: true,
- attributes: true,
- subtree: true
- });
- } else {
- return Report.fit('body');
- }
- },
- fit: function(selector) {
- var dy, el;
- if (!((el = $(selector, doc)) && getComputedStyle(el).visibility !== 'hidden')) {
- return;
- }
- dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8;
- if (dy > 0) {
- return window.resizeBy(0, dy);
- }
- },
- archive: function() {
- var link, message, types, url;
- Redirect.init();
- if (!(url = Redirect.to('report', {
- boardID: g.BOARD.ID,
- postID: Report.postID
- }))) {
- return;
- }
- if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) {
- if (location.hash === '#redirect') {
- $.globalEval('self.close = function(){};');
- window.resizeTo(700, 475);
- location.replace(url);
- }
- return;
- }
- link = $.el('a', {
- href: url,
- textContent: 'Report to archive'
- });
- $.on(link, 'click', function(e) {
- if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) {
- return window.resizeTo(700, 475);
- }
- });
- $.add(d.body, [$.tn(' ['), link, $.tn(']')]);
- if (types = $.id('reportTypes')) {
- return $.on(types, 'change', function(e) {
- return $('form').action = e.target.value === 'illegal' ? '#redirect' : '';
- });
- }
- }
- };
-
- ThreadLinks = {
- init: function() {
- if (!(g.VIEW === 'index' && Conf['Open Threads in New Tab'])) {
- return;
- }
- Post.callbacks.push({
- name: 'Thread Links',
- cb: this.node
- });
- return CatalogThread.callbacks.push({
- name: 'Thread Links',
- cb: this.catalogNode
- });
- },
- node: function() {
- if (this.isReply || this.isClone) {
- return;
- }
- return ThreadLinks.process($('.replylink', this.nodes.info));
- },
- catalogNode: function() {
- return ThreadLinks.process(this.nodes.thumb.parentNode);
- },
- process: function(link) {
- return link.target = '_blank';
- }
- };
-
- Time = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Time Formatting'])) {
- return;
- }
- return Post.callbacks.push({
- name: 'Time Formatting',
- cb: this.node
- });
- },
- node: function() {
- if (this.isClone) {
- return;
- }
- return this.nodes.date.textContent = Time.format(Conf['time'], this.info.date);
- },
- format: function(formatString, date) {
- return formatString.replace(/%(.)/g, function(s, c) {
- if (c in Time.formatters) {
- return Time.formatters[c].call(date);
- } else {
- return s;
- }
- });
- },
- day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
- month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
- zeroPad: function(n) {
- if (n < 10) {
- return "0" + n;
- } else {
- return n;
- }
- },
- formatters: {
- a: function() {
- return Time.day[this.getDay()].slice(0, 3);
- },
- A: function() {
- return Time.day[this.getDay()];
- },
- b: function() {
- return Time.month[this.getMonth()].slice(0, 3);
- },
- B: function() {
- return Time.month[this.getMonth()];
- },
- d: function() {
- return Time.zeroPad(this.getDate());
- },
- e: function() {
- return this.getDate();
- },
- H: function() {
- return Time.zeroPad(this.getHours());
- },
- I: function() {
- return Time.zeroPad(this.getHours() % 12 || 12);
- },
- k: function() {
- return this.getHours();
- },
- l: function() {
- return this.getHours() % 12 || 12;
- },
- m: function() {
- return Time.zeroPad(this.getMonth() + 1);
- },
- M: function() {
- return Time.zeroPad(this.getMinutes());
- },
- p: function() {
- if (this.getHours() < 12) {
- return 'AM';
- } else {
- return 'PM';
- }
- },
- P: function() {
- if (this.getHours() < 12) {
- return 'am';
- } else {
- return 'pm';
- }
- },
- S: function() {
- return Time.zeroPad(this.getSeconds());
- },
- y: function() {
- return this.getFullYear().toString().slice(2);
- },
- Y: function() {
- return this.getFullYear();
- },
- '%': function() {
- return '%';
- }
- }
- };
-
- Settings = {
- init: function() {
- var add, link, settings;
- link = $.el('a', {
- className: 'settings-link fa fa-wrench',
- textContent: 'Settings',
- title: '4chan X Settings',
- href: 'javascript:;'
- });
- $.on(link, 'click', Settings.open);
- Header.addShortcut(link);
- add = this.addSection;
- add('Main', this.main);
- add('Filter', this.filter);
- add('Sauce', this.sauce);
- add('Advanced', this.advanced);
- add('Keybinds', this.keybinds);
- $.on(d, 'AddSettingsSection', Settings.addSection);
- $.on(d, 'OpenSettings', function(e) {
- return Settings.open(e.detail);
- });
- if (Conf['Disable Native Extension']) {
- if ($.hasStorage) {
- settings = JSON.parse(localStorage.getItem('4chan-settings')) || {};
- if (settings.disableAll) {
- return;
- }
- settings.disableAll = true;
- return localStorage.setItem('4chan-settings', JSON.stringify(settings));
- } else {
- return $.onExists(doc, 'body', function() {
- return $.global(function() {
- return window.Config.disableAll = true;
- });
- });
- }
- }
- },
- open: function(openSection) {
- var dialog, k, len1, link, links, overlay, ref, section, sectionToOpen;
- if (Settings.overlay) {
- return;
- }
- $.event('CloseMenu');
- Settings.dialog = dialog = $.el('div', {
- id: 'fourchanx-settings',
- className: 'dialog'
- });
- $.extend(dialog, {
- innerHTML: "
"
- });
- Settings.overlay = overlay = $.el('div', {
- id: 'overlay'
- });
- $.on($('.export', dialog), 'click', Settings["export"]);
- $.on($('.import', dialog), 'click', Settings["import"]);
- $.on($('.reset', dialog), 'click', Settings.reset);
- $.on($('input', dialog), 'change', Settings.onImport);
- links = [];
- ref = Settings.sections;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- section = ref[k];
- link = $.el('a', {
- className: "tab-" + section.hyphenatedTitle,
- textContent: section.title,
- href: 'javascript:;'
- });
- $.on(link, 'click', Settings.openSection.bind(section));
- links.push(link, $.tn(' | '));
- if (section.title === openSection) {
- sectionToOpen = link;
- }
- }
- links.pop();
- $.add($('.sections-list', dialog), links);
- if (openSection !== 'none') {
- (sectionToOpen ? sectionToOpen : links[0]).click();
- }
- $.on($('.close', dialog), 'click', Settings.close);
- $.on(overlay, 'click', Settings.close);
- $.add(d.body, [overlay, dialog]);
- return $.event('OpenSettings', null, dialog);
- },
- close: function() {
- var ref;
- if (!Settings.dialog) {
- return;
- }
- if ((ref = d.activeElement) != null) {
- ref.blur();
- }
- $.rm(Settings.overlay);
- $.rm(Settings.dialog);
- delete Settings.overlay;
- return delete Settings.dialog;
- },
- sections: [],
- addSection: function(title, open) {
- var hyphenatedTitle, ref;
- if (typeof title !== 'string') {
- ref = title.detail, title = ref.title, open = ref.open;
- }
- hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-');
- return Settings.sections.push({
- title: title,
- hyphenatedTitle: hyphenatedTitle,
- open: open
- });
- },
- openSection: function() {
- var section, selected;
- if (selected = $('.tab-selected', Settings.dialog)) {
- $.rmClass(selected, 'tab-selected');
- }
- $.addClass($(".tab-" + this.hyphenatedTitle, Settings.dialog), 'tab-selected');
- section = $('section', Settings.dialog);
- $.rmAll(section);
- section.className = "section-" + this.hyphenatedTitle;
- this.open(section, g);
- section.scrollTop = 0;
- return $.event('OpenSettings', null, section);
- },
- warnings: {
- localStorage: function(cb) {
- var why;
- if ($.cantSync) {
- why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs';
- return cb($.el('li', {
- textContent: "4chan X needs local storage to " + why + ".\nEnable it on boards.4chan.org in your browser's privacy settings (may be listed as part of \"local data\" or \"cookies\")."
- }));
- }
- },
- ads: function(cb) {
- return $.onExists(doc, '.ad-cnt', function(ad) {
- return $.onExists(ad, 'img', function() {
- return cb($.el('li', {
- innerHTML: "To protect yourself from malicious ads , you should block ads on 4chan."
- }));
- });
- });
- }
- },
- main: function(section) {
- var addWarning, arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, ref, ref1, warning, warnings;
- warnings = $.el('fieldset', {
- hidden: true
- }, {
- innerHTML: "Warnings "
- });
- addWarning = function(item) {
- $.add($('ul', warnings), item);
- return warnings.hidden = false;
- };
- ref = Settings.warnings;
- for (key in ref) {
- warning = ref[key];
- warning(addWarning);
- }
- $.add(section, warnings);
- items = {};
- inputs = {};
- ref1 = Config.main;
- for (key in ref1) {
- obj = ref1[key];
- fs = $.el('fieldset', {
- innerHTML: "" + E(key) + " "
- });
- containers = [fs];
- for (key in obj) {
- arr = obj[key];
- description = arr[1];
- div = $.el('div', {
- innerHTML: " " + E(key) + ": " + E(description) + " "
- });
- if ($.engine !== 'gecko' && key === 'Remember QR Size') {
- div.hidden = true;
- }
- input = $('input', div);
- $.on(input, 'change', function() {
- this.parentNode.parentNode.dataset.checked = this.checked;
- return $.cb.checked.call(this);
- });
- items[key] = Conf[key];
- inputs[key] = input;
- level = arr[2] || 0;
- if (containers.length <= level) {
- container = $.el('div', {
- className: 'suboption-list'
- });
- $.add(containers[containers.length - 1].lastElementChild, container);
- containers[level] = container;
- } else if (containers.length > level + 1) {
- containers.splice(level + 1, containers.length - (level + 1));
- }
- $.add(containers[level], div);
- }
- $.add(section, fs);
- }
- $.get(items, function(items) {
- var val;
- for (key in items) {
- val = items[key];
- inputs[key].checked = val;
- inputs[key].parentNode.parentNode.dataset.checked = val;
- }
- });
- div = $.el('div', {
- innerHTML: ": Clear manually-hidden threads and posts on all boards. Reload the page to apply."
- });
- button = $('button', div);
- $.get({
- hiddenThreads: {},
- hiddenPosts: {}
- }, function(arg) {
- var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref2, ref3, thread;
- hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts;
- hiddenNum = 0;
- ref2 = hiddenThreads.boards;
- for (ID in ref2) {
- board = ref2[ID];
- hiddenNum += Object.keys(board).length;
- }
- ref3 = hiddenPosts.boards;
- for (ID in ref3) {
- board = ref3[ID];
- for (ID in board) {
- thread = board[ID];
- hiddenNum += Object.keys(thread).length;
- }
- }
- return button.textContent = "Hidden: " + hiddenNum;
- });
- $.on(button, 'click', function() {
- this.textContent = 'Hidden: 0';
- return $.get('hiddenThreads', {}, function(arg) {
- var boardID, hiddenThreads;
- hiddenThreads = arg.hiddenThreads;
- if ($.hasStorage) {
- for (boardID in hiddenThreads.boards) {
- localStorage.removeItem("4chan-hide-t-" + boardID);
- }
- }
- return $["delete"](['hiddenThreads', 'hiddenPosts']);
- });
- });
- return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
- },
- "export": function() {
- return $.get(Conf, function(Conf) {
- return Settings.downloadExport({
- version: g.VERSION,
- date: Date.now(),
- Conf: Conf
- });
- });
- },
- downloadExport: function(data) {
- var a, p;
- a = $.el('a', {
- download: "4chan X v" + g.VERSION + "-" + data.date + ".json",
- href: "data:application/json;base64," + (btoa(unescape(encodeURIComponent(JSON.stringify(data, null, 2)))))
- });
- p = $('.imp-exp-result', Settings.dialog);
- $.rmAll(p);
- $.add(p, a);
- return a.click();
- },
- "import": function() {
- return $('input[type=file]', this.parentNode).click();
- },
- onImport: function() {
- var file, output, reader;
- if (!(file = this.files[0])) {
- return;
- }
- this.value = null;
- output = $('.imp-exp-result');
- if (!confirm('Your current settings will be entirely overwritten, are you sure?')) {
- output.textContent = 'Import aborted.';
- return;
- }
- reader = new FileReader();
- reader.onload = function(e) {
- var err;
- try {
- return Settings.loadSettings(JSON.parse(e.target.result), function(err) {
- if (err) {
- return output.textContent = 'Import failed due to an error.';
- } else if (confirm('Import successful. Reload now?')) {
- return window.location.reload();
- }
- });
- } catch (_error) {
- err = _error;
- output.textContent = 'Import failed due to an error.';
- return c.error(err.stack);
- }
- };
- return reader.readAsText(file);
- },
- convertFrom: {
- loadletter: function(data) {
- var base1, boardID, convertSettings, key, ref, ref1, threadData, threadID, threads, val;
- convertSettings = function(data, map) {
- var newKey, prevKey;
- for (prevKey in map) {
- newKey = map[prevKey];
- if (newKey) {
- data.Conf[newKey] = data.Conf[prevKey];
- }
- delete data.Conf[prevKey];
- }
- return data;
- };
- data = convertSettings(data, {
- 'Disable 4chan\'s extension': 'Disable Native Extension',
- 'Comment Auto-Expansion': '',
- 'Remove Slug': '',
- 'Check for Updates': '',
- 'Recursive Filtering': 'Recursive Hiding',
- 'Reply Hiding': 'Reply Hiding Buttons',
- 'Thread Hiding': 'Thread Hiding Buttons',
- 'Show Stubs': 'Stubs',
- 'Image Auto-Gif': 'Replace GIF',
- 'Reveal Spoilers': 'Reveal Spoiler Thumbnails',
- 'Expand From Current': 'Expand from here',
- 'Post in Title': 'Thread Excerpt',
- 'Current Page': 'Page Count in Stats',
- 'Current Page Position': '',
- 'Alternative captcha': 'Use Recaptcha v1',
- 'Auto Submit': 'Post on Captcha Completion',
- 'Open Reply in New Tab': 'Open Post in New Tab',
- 'Remember QR size': 'Remember QR Size',
- 'Remember Subject': '',
- 'Quote Inline': 'Quote Inlining',
- 'Quote Preview': 'Quote Previewing',
- 'Indicate OP quote': 'Mark OP Quotes',
- 'Indicate You quote': 'Mark Quotes of You',
- 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes',
- 'uniqueid': 'uniqueID',
- 'mod': 'capcode',
- 'email': '',
- 'country': 'flag',
- 'md5': 'MD5',
- 'openEmptyQR': 'Open empty QR',
- 'openQR': 'Open QR',
- 'openOptions': 'Open settings',
- 'close': 'Close',
- 'spoiler': 'Spoiler tags',
- 'sageru': 'Toggle sage',
- 'code': 'Code tags',
- 'submit': 'Submit QR',
- 'watch': 'Watch',
- 'update': 'Update',
- 'unreadCountTo0': '',
- 'expandAllImages': 'Expand images',
- 'expandImage': 'Expand image',
- 'zero': 'Front page',
- 'nextPage': 'Next page',
- 'previousPage': 'Previous page',
- 'nextThread': 'Next thread',
- 'previousThread': 'Previous thread',
- 'expandThread': 'Expand thread',
- 'openThreadTab': 'Open thread',
- 'openThread': 'Open thread tab',
- 'nextReply': 'Next reply',
- 'previousReply': 'Previous reply',
- 'hide': 'Hide',
- 'Scrolling': 'Auto Scroll',
- 'Verbose': ''
- });
- data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) {
- switch (c) {
- case '$1':
- return '%TURL';
- case '$2':
- return '%URL';
- case '$3':
- return '%MD5';
- case '$4':
- return '%board';
- default:
- return c;
- }
- });
- ref = Config.hotkeys;
- for (key in ref) {
- val = ref[key];
- if (key in data.Conf) {
- data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) {
- return "" + (s[0].toUpperCase()) + s.slice(1);
- }).replace(/(^|.+\+)[A-Z]$/g, function(s) {
- return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase());
- });
- }
- }
- if (data.WatchedThreads) {
- data.Conf['watchedThreads'] = {
- boards: {}
- };
- ref1 = data.WatchedThreads;
- for (boardID in ref1) {
- threads = ref1[boardID];
- for (threadID in threads) {
- threadData = threads[threadID];
- ((base1 = data.Conf['watchedThreads'].boards)[boardID] || (base1[boardID] = {}))[threadID] = {
- excerpt: threadData.textContent
- };
- }
- }
- }
- return data;
- }
- },
- upgrade: function(data, version) {
- var boardID, changes, compareString, k, key, len1, name, record, ref, ref1, ref2, ref3, ref4, ref5, rice, set, type, uids, value;
- changes = {};
- set = function(key, value) {
- return data[key] = changes[key] = value;
- };
- compareString = version.replace(/\d+/g, function(x) {
- return ('0000' + x).slice(-5);
- });
- if (compareString < '00001.00011.00008.00000') {
- if (data['Fixed Thread Watcher'] == null) {
- set('Fixed Thread Watcher', (ref = data['Toggleable Thread Watcher']) != null ? ref : true);
- }
- if (data['Exempt Archives from Encryption'] == null) {
- set('Exempt Archives from Encryption', (ref1 = data['Except Archives from Encryption']) != null ? ref1 : false);
- }
- }
- if (compareString < '00001.00011.00010.00001') {
- if (data['selectedArchives'] != null) {
- uids = {
- "Moe": 0,
- "4plebs Archive": 3,
- "Nyafuu Archive": 4,
- "Love is Over": 5,
- "Rebecca Black Tech": 8,
- "warosu": 10,
- "fgts": 15,
- "not4plebs": 22,
- "DesuStorage": 23,
- "fireden.net": 24,
- "disabled": null
- };
- ref2 = data['selectedArchives'];
- for (boardID in ref2) {
- record = ref2[boardID];
- for (type in record) {
- name = record[type];
- if (name in uids) {
- record[type] = uids[name];
- }
- }
- }
- set('selectedArchives', data['selectedArchives']);
- }
- }
- if (compareString < '00001.00011.00016.00000') {
- if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) {
- if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) {
- set('usercss', rice + '\n\n' + data['usercss']);
- }
- }
- }
- if (compareString < '00001.00011.00017.00000') {
- ref3 = ['Persistent QR', 'Color User IDs', 'Fappe Tyme', 'Werk Tyme', 'Highlight Posts Quoting You', 'Highlight Own Posts'];
- for (k = 0, len1 = ref3.length; k < len1; k++) {
- key = ref3[k];
- if (data[key] == null) {
- set(key, key === 'Persistent QR');
- }
- }
- }
- if (compareString < '00001.00011.00017.00006') {
- if (data['sauces'] != null) {
- set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/iqdb\.org\//mg, '$1//iqdb.org/'));
- }
- }
- if (compareString < '00001.00011.00019.00003' && !Settings.overlay) {
- $.queueTask(function() {
- return Settings.warnings.ads(function(item) {
- return new Notice('warning', slice.call(item.childNodes));
- });
- });
- }
- if (compareString < '00001.00011.00020.00003') {
- ref4 = {
- 'Inline Cross-thread Quotes Only': false,
- 'Pass Link': true
- };
- for (key in ref4) {
- value = ref4[key];
- if (data[key] == null) {
- set(key, value);
- }
- }
- }
- if (compareString < '00001.00011.00021.00003') {
- if (data['Remember Your Posts'] == null) {
- set('Remember Your Posts', (ref5 = data['Mark Quotes of You']) != null ? ref5 : true);
- }
- }
- if (compareString < '00001.00011.00022.00000') {
- if (data['sauces'] != null) {
- set('sauces', data['sauces'].replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/mg, '$1'));
- set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/mg, '$&&safe=off'));
- }
- }
- if (compareString < '00001.00011.00022.00002') {
- if ((data['Use Recaptcha v1 in Reports'] == null) && data['Use Recaptcha v1'] && !data['Use Recaptcha v2 in Reports']) {
- set('Use Recaptcha v1 in Reports', true);
- }
- }
- if (compareString < '00001.00011.00024.00000') {
- if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) {
- set('JSON Index', data['JSON Navigation']);
- }
- }
- if (compareString < '00001.00011.00026.00000') {
- if ((data['Oekaki Links'] != null) && (data['Edit Link'] == null)) {
- set('Edit Link', data['Oekaki Links']);
- }
- if (data['Inline Cross-thread Quotes Only'] == null) {
- set('Inline Cross-thread Quotes Only', true);
- }
- }
- if (compareString < '00001.00011.00030.00000') {
- if (data['Quote Threading'] && (data['Thread Quotes'] == null)) {
- set('Thread Quotes', true);
- }
- }
- return changes;
- },
- loadSettings: function(data, cb) {
- if (data.version.split('.')[0] === '2') {
- data = Settings.convertFrom.loadletter(data);
- } else if (data.version !== g.VERSION) {
- Settings.upgrade(data.Conf, data.version);
- }
- return $.clear(function(err) {
- if (err) {
- return cb(err);
- }
- return $.set(data.Conf, cb);
- });
- },
- reset: function() {
- if (confirm('Your current settings will be entirely wiped, are you sure?')) {
- return $.clear(function(err) {
- if (err) {
- return $('.imp-exp-result').textContent = 'Import failed due to an error.';
- } else if (confirm('Reset successful. Reload now?')) {
- return window.location.reload();
- }
- });
- }
- },
- filter: function(section) {
- var select;
- $.extend(section, {
- innerHTML: "Guide Post number Name Unique ID Tripcode Capcode Subject Comment Flag Filename Image dimensions Filesize Image MD5
"
- });
- select = $('select', section);
- $.on(select, 'change', Settings.selectFilter);
- return Settings.selectFilter.call(select);
- },
- selectFilter: function() {
- var div, name, ta;
- div = this.nextElementSibling;
- if ((name = this.value) !== 'guide') {
- $.rmAll(div);
- ta = $.el('textarea', {
- name: name,
- className: 'field',
- spellcheck: false
- });
- $.get(name, Conf[name], function(item) {
- return ta.value = item[name];
- });
- $.on(ta, 'change', $.cb.value);
- $.add(div, ta);
- return;
- }
- $.extend(div, {
- innerHTML: "Filter is disabled.
Use regular expressions , one per line. Lines starting with a # will be ignored. For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive. MD5 filtering uses exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:Per boards, separate them with commas. It is global if not specified. For example: boards:a,jp;. In case of a global rule, select boards to be excluded from the filter. For example: exclude:vg,v;. Filter OPs only along with their threads (\`only\`), replies only (\`no\`), or both (\`yes\`, this is default). For example: op:only;, op:no; or op:yes;. Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`). For example: stub:yes; or stub:no;. Highlight instead of hiding. You can specify a class name to use with a userstyle. For example: highlight; or highlight:wallpaper;. Highlighted OPs will have their threads put on top of the board index by default. For example: top:yes; or top:no;. Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there. The native catalog has its own separate filter list.
"
- });
- return $('.warning', div).hidden = Conf['Filter'];
- },
- sauce: function(section) {
- var ta;
- $.extend(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.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
You can open links with scripts and popups disabled by appending ;sandbox.
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.%MD5: MD5 hash in base64.%sMD5: MD5 hash in base64 using - and _.%hMD5: MD5 hash in hexadecimal.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;. "
- });
- $('.warning', section).hidden = Conf['Sauce'];
- ta = $('textarea', section);
- $.get('sauces', Conf['sauces'], function(item) {
- return ta.value = item['sauces'];
- });
- return $.on(ta, 'change', $.cb.value);
- },
- advanced: function(section) {
- var aa, ab, applyCSS, archBoards, archive, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, uid, v, warning, withCredentials, z;
- $.extend(section, {
- innerHTML: "Archiver 404 Redirect is disabled.
Thread redirection Post fetching File redirection
Captcha Language
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 Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
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
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
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"] will give you[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy] if you are on /g/.
Time Formatting is disabled. :
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled. :
File Info Formatting is disabled. :
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag:
%gLiteral %: %%
Quick Reply Personas One item per line. Items will be added in the relevant input's auto-completion list. Password items will always be used, since there is no password input. Lines starting with a # will be ignored.
You can use these settings with each item, separate them with semicolons:Possible items are: name, options (or equivalently email), subject and password. Wrap values of items with quotes, like this: options:"sage". Force values as defaults with the always keyword, for example: options:"sage";always. Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always. Unread Favicon is disabled. ferongr xat- 4chanJS Mayhem Original Metro Thread Updater is disabled. Interval: seconds
Custom Cooldown Time Seconds:
Custom CSSApply CSS "
- });
- ref = $$('.warning', section);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- warning = ref[k];
- warning.hidden = Conf[warning.dataset.feature];
- }
- items = {};
- inputs = {};
- ref1 = ['captchaLanguage', 'boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'customCooldown'];
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- name = ref1[q];
- input = $("[name='" + name + "']", section);
- items[name] = Conf[name];
- inputs[name] = input;
- if (name === 'usercss') {
- $.on(input, 'change', $.cb.value);
- } else if (name === 'favicon') {
- $.on(input, 'change', $.cb.value);
- $.on(input, 'change', Settings[name]);
- } else {
- $.on(input, 'input', $.cb.value);
- if (name in Settings) {
- $.on(input, 'input', Settings[name]);
- }
- }
- }
- ta = $('.personafield', section);
- $.get('QR.personas', Conf['QR.personas'], function(item) {
- return ta.value = item['QR.personas'];
- });
- $.on(ta, 'change', $.cb.value);
- $.get(items, function(items) {
- var key, val;
- for (key in items) {
- val = items[key];
- input = inputs[key];
- input.value = val;
- if (key in Settings && key !== 'usercss') {
- Settings[key].call(input);
- }
- }
- });
- interval = $('input[name="Interval"]', section);
- customCSS = $('input[name="Custom CSS"]', section);
- applyCSS = $('#apply-css', section);
- interval.value = Conf['Interval'];
- customCSS.checked = Conf['Custom CSS'];
- inputs['usercss'].disabled = !Conf['Custom CSS'];
- applyCSS.disabled = !Conf['Custom CSS'];
- $.on(interval, 'change', ThreadUpdater.cb.interval);
- $.on(customCSS, 'change', Settings.togglecss);
- $.on(applyCSS, 'click', Settings.usercss);
- archBoards = {};
- ref2 = Redirect.archives;
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- ref3 = ref2[u], uid = ref3.uid, name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials;
- for (v = 0, len4 = boards.length; v < len4; v++) {
- boardID = boards[v];
- o = archBoards[boardID] || (archBoards[boardID] = {
- thread: [[], []],
- post: [[], []],
- file: [[], []]
- });
- i = +(!!withCredentials);
- archive = [uid != null ? uid : name, name];
- o.thread[i].push(archive);
- if (software === 'foolfuuka') {
- o.post[i].push(archive);
- }
- if (indexOf.call(files, boardID) >= 0) {
- o.file[i].push(archive);
- }
- }
- }
- for (boardID in archBoards) {
- o = archBoards[boardID];
- ref4 = ['thread', 'post', 'file'];
- for (z = 0, len5 = ref4.length; z < len5; z++) {
- item = ref4[z];
- i = o[item][0].length ? 1 : 0;
- o[item][i].push([null, 'disabled']);
- o[item] = o[item][0].concat(o[item][1]);
- }
- }
- rows = [];
- boardOptions = [];
- ref5 = Object.keys(archBoards).sort();
- for (aa = 0, len6 = ref5.length; aa < len6; aa++) {
- boardID = ref5[aa];
- row = $.el('tr', {
- className: "board-" + boardID
- });
- row.hidden = boardID !== g.BOARD.ID;
- boardOptions.push($.el('option', {
- textContent: "/" + boardID + "/",
- value: "board-" + boardID,
- selected: boardID === g.BOARD.ID
- }));
- o = archBoards[boardID];
- ref6 = ['thread', 'post', 'file'];
- for (ab = 0, len7 = ref6.length; ab < len7; ab++) {
- item = ref6[ab];
- $.add(row, Settings.addArchiveCell(boardID, o, item));
- }
- rows.push(row);
- }
- if (!(g.BOARD.ID in archBoards)) {
- rows[0].hidden = false;
- }
- $.add($('tbody', section), rows);
- boardSelect = $('#archive-board-select', section);
- $.add(boardSelect, boardOptions);
- table = $('#archive-table', section);
- $.on(boardSelect, 'change', function() {
- $('tbody > :not([hidden])', table).hidden = true;
- return $("tbody > ." + this.value, table).hidden = false;
- });
- $.get('selectedArchives', Conf['selectedArchives'], function(arg) {
- var data, id, select, selectedArchives, type;
- selectedArchives = arg.selectedArchives;
- for (boardID in selectedArchives) {
- data = selectedArchives[boardID];
- for (type in data) {
- id = data[type];
- if (select = $("select[data-boardid='" + boardID + "'][data-type='" + type + "']", section)) {
- select.value = JSON.stringify(id);
- }
- }
- }
- });
- },
- addArchiveCell: function(boardID, data, type) {
- var archive, i, length, options, select, td;
- length = data[type].length;
- td = $.el('td', {
- className: 'archive-cell'
- });
- if (!length) {
- td.textContent = '--';
- return td;
- }
- options = [];
- i = 0;
- while (i < length) {
- archive = data[type][i++];
- options.push($.el('option', {
- value: JSON.stringify(archive[0]),
- textContent: archive[1]
- }));
- }
- $.extend(td, {
- innerHTML: "
"
- });
- select = td.firstElementChild;
- if (!(select.disabled = length === 1)) {
- select.setAttribute('data-boardid', boardID);
- select.setAttribute('data-type', type);
- $.on(select, 'change', Settings.saveSelectedArchive);
- }
- $.add(select, options);
- return td;
- },
- saveSelectedArchive: function() {
- return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) {
- return function(arg) {
- var name1, selectedArchives;
- selectedArchives = arg.selectedArchives;
- (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = {}))[_this.dataset.type] = JSON.parse(_this.value);
- return $.set('selectedArchives', selectedArchives);
- };
- })(this));
- },
- boardnav: function() {
- return Header.generateBoardList(this.value);
- },
- time: function() {
- return this.nextElementSibling.textContent = Time.format(this.value, new Date());
- },
- backlink: function() {
- return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) {
- return {
- '%id': '123456789',
- '%%': '%'
- }[x];
- });
- },
- fileInfo: function() {
- var data;
- data = {
- isReply: true,
- file: {
- url: '//i.4cdn.org/g/1334437723720.jpg',
- name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg',
- size: '276 KB',
- sizeInBytes: 276 * 1024,
- dimensions: '1280x720',
- isImage: true,
- isVideo: false,
- isSpoiler: true,
- tag: 'Loop'
- }
- };
- return FileInfo.format(this.value, data, this.nextElementSibling);
- },
- favicon: function() {
- var img;
- Favicon["switch"]();
- if (g.VIEW === 'thread' && Conf['Unread Favicon']) {
- Unread.update();
- }
- img = this.nextElementSibling.children;
- img[0].src = Favicon["default"];
- img[1].src = Favicon.unreadSFW;
- img[2].src = Favicon.unreadNSFW;
- return img[3].src = Favicon.unreadDead;
- },
- togglecss: function() {
- if ($('textarea[name=usercss]', $.x('ancestor::fieldset[1]', this)).disabled = $.id('apply-css').disabled = !this.checked) {
- CustomCSS.rmStyle();
- } else {
- CustomCSS.addStyle();
- }
- return $.cb.checked.call(this);
- },
- usercss: function() {
- return CustomCSS.update();
- },
- keybinds: function(section) {
- var arr, input, inputs, items, key, ref, tbody, tr;
- $.extend(section, {
- innerHTML: "
Keybinds are disabled.
Allowed keys: a-z , 0-9 , Ctrl , Shift , Alt , Meta , Enter , Esc , Up , Down , Right , Left .
Press Backspace to disable a keybind.
"
- });
- $('.warning', section).hidden = Conf['Keybinds'];
- tbody = $('tbody', section);
- items = {};
- inputs = {};
- ref = Config.hotkeys;
- for (key in ref) {
- arr = ref[key];
- tr = $.el('tr', {
- innerHTML: "
" + E(arr[1]) + " "
- });
- input = $('input', tr);
- input.name = key;
- input.spellcheck = false;
- items[key] = Conf[key];
- inputs[key] = input;
- $.on(input, 'keydown', Settings.keybind);
- $.add(tbody, tr);
- }
- return $.get(items, function(items) {
- var val;
- for (key in items) {
- val = items[key];
- inputs[key].value = val;
- }
- });
- },
- keybind: function(e) {
- var key;
- if (e.keyCode === 9) {
- return;
- }
- e.preventDefault();
- e.stopPropagation();
- if ((key = Keybinds.keyCode(e)) == null) {
- return;
- }
- this.value = key;
- return $.cb.value.call(this);
- }
- };
-
- Main = {
- init: function() {
- var db, flatten, items, k, key, len1, ref;
- if (d.body && !$('title', d.head)) {
- return;
- }
- if (window['4chan X antidup']) {
- return;
- }
- window['4chan X antidup'] = true;
- if (location.hostname === 'www.google.com') {
- $.get('Captcha Fixes', true, function(arg) {
- var enabled;
- enabled = arg['Captcha Fixes'];
- if (enabled) {
- return $.ready(function() {
- return Captcha.fixes.init();
- });
- }
- });
- return;
- }
- $.global(function() {
- var k, len1, nuke, prop, ref;
- nuke = function(obj, prop) {
- try {
- return Object.defineProperty(obj, prop, {
- configurable: false,
- get: function() {
- throw new Error();
- },
- set: function() {
- throw new Error();
- }
- });
- } catch (_error) {}
- };
- ref = ['atOptions', 'adsterra_key', 'EpmadsConfig', 'epmads_key', 'EpomConfig', 'epom_key', 'exoDocumentProtocol'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- prop = ref[k];
- nuke(window, prop);
- }
- });
- $.on(window, 'beforescriptexecute', function(e) {
- var host, ref, ref1;
- host = (ref = e.target.src.split('/')[2]) != null ? (ref1 = ref.match(/[^.]+\.[^.]+$/)) != null ? ref1[0] : void 0 : void 0;
- if (host === 'bnhtml.com' || host === 'ecpmrocks.com' || host === 'advertisation.com' || host === 'exoclick.com') {
- return e.preventDefault();
- }
- });
- $.on(d, '4chanXInitFinished', function() {
- if (Main.expectInitFinished) {
- return delete Main.expectInitFinished;
- } else {
- new Notice('error', 'Error: Multiple copies of 4chan X are enabled.');
- return $.addClass(doc, 'tainted');
- }
- });
- flatten = function(parent, obj) {
- var key, val;
- if (obj instanceof Array) {
- Conf[parent] = obj[0];
- } else if (typeof obj === 'object') {
- for (key in obj) {
- val = obj[key];
- flatten(key, val);
- }
- } else {
- Conf[parent] = obj;
- }
- };
- flatten(null, Config);
- ref = DataBoard.keys;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- db = ref[k];
- Conf[db] = {
- boards: {}
- };
- }
- Conf['selectedArchives'] = {};
- Conf['cooldowns'] = {};
- Conf['Index Sort'] = {};
- Conf['Except Archives from Encryption'] = false;
- Conf['JSON Navigation'] = true;
- Conf['Oekaki Links'] = true;
- items = {};
- for (key in Conf) {
- items[key] = void 0;
- }
- items['previousversion'] = void 0;
- return $.get(items, function(items) {
- return $.asap((function() {
- return doc = d.documentElement;
- }), function() {
- var ref1, val;
- if ($.cantSet) {
-
- } else if (items.previousversion == null) {
- Main.ready(function() {
- $.set('previousversion', g.VERSION);
- return Settings.open();
- });
- } else if (items.previousversion !== g.VERSION) {
- Main.upgrade(items);
- }
- for (key in Conf) {
- val = Conf[key];
- Conf[key] = (ref1 = items[key]) != null ? ref1 : val;
- }
- return Main.initFeatures();
- });
- });
- },
- upgrade: function(items) {
- var changes, previousversion;
- previousversion = items.previousversion;
- changes = Settings.upgrade(items, previousversion);
- items.previousversion = changes.previousversion = g.VERSION;
- return $.set(changes, function() {
- var el, ref;
- if ((ref = items['Show Updated Notifications']) != null ? ref : true) {
- el = $.el('span', {
- innerHTML: "4chan X has been updated to
version " + E(g.VERSION) + " ."
- });
- return new Notice('info', el, 15);
- }
- });
- },
- initFeatures: function() {
- var err, feature, hostname, k, len1, match, name, pathname, ref, ref1, ref2, ref3, search;
- hostname = location.hostname, search = location.search;
- pathname = location.pathname.split(/\/+/);
- if (hostname !== 'www.4chan.org') {
- g.BOARD = new Board(pathname[1]);
- }
- if (hostname === 'boards.4chan.org' || hostname === 'sys.4chan.org' || hostname === 'www.4chan.org') {
- $.global(function() {
- document.documentElement.classList.add('js-enabled');
- return window.FCX = {};
- });
- Main.jsEnabled = $.hasClass(doc, 'js-enabled');
- }
- switch (hostname) {
- case 'www.4chan.org':
- $.onExists(doc, 'body', function() {
- return $.addStyle(Main.cssWWW);
- });
- Captcha.replace.init();
- return;
- case 'sys.4chan.org':
- if (pathname[2] === 'imgboard.php') {
- if (/\bmode=report\b/.test(search)) {
- Report.init();
- } else if ((match = search.match(/\bres=(\d+)/))) {
- $.ready(function() {
- var ref;
- if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') {
- return Redirect.navigate('thread', {
- boardID: g.BOARD.ID,
- postID: +match[1]
- });
- }
- });
- }
- } else if (pathname[2] === 'post') {
- PostSuccessful.init();
- }
- return;
- case 'i.4cdn.org':
- if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) {
- return;
- }
- $.asap((function() {
- return d.readyState !== 'loading';
- }), function() {
- var ref, video;
- if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
- return Redirect.navigate('file', {
- boardID: g.BOARD.ID,
- filename: pathname[pathname.length - 1]
- });
- } else if (video = $('video')) {
- if (Conf['Volume in New Tab']) {
- Volume.setup(video);
- }
- if (Conf['Loop in New Tab']) {
- video.loop = true;
- video.controls = false;
- video.play();
- return ImageCommon.addControls(video);
- }
- }
- });
- return;
- }
- if ((ref = pathname[2]) === 'thread' || ref === 'res') {
- g.VIEW = 'thread';
- g.THREADID = +pathname[3];
- } else if ((ref1 = pathname[2]) === 'catalog' || ref1 === 'archive') {
- g.VIEW = pathname[2];
- } else if (pathname[2].match(/^\d*$/)) {
- g.VIEW = 'index';
- } else {
- return;
- }
- g.threads = new SimpleDict();
- g.posts = new SimpleDict();
- $.onExists(doc, 'body', Main.initStyle);
- ref2 = Main.features;
- for (k = 0, len1 = ref2.length; k < len1; k++) {
- ref3 = ref2[k], name = ref3[0], feature = ref3[1];
- try {
- feature.init();
- } catch (_error) {
- err = _error;
- Main.handleErrors({
- message: "\"" + name + "\" initialization crashed.",
- error: err
- });
- }
- }
- return $.ready(Main.initReady);
- },
- initStyle: function() {
- var keyboard, ref;
- if (!Main.isThisPageLegit()) {
- return;
- }
- if ((ref = $('link[href*=mobile]', d.head)) != null) {
- ref.disabled = true;
- }
- $.addClass(doc, 'fourchan-x', 'seaweedchan');
- $.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW);
- if ($.engine) {
- $.addClass(doc, $.engine);
- }
- $.onExists(doc, '.ad-cnt', function(ad) {
- return $.onExists(ad, 'img', function() {
- return $.addClass(doc, 'ads-loaded');
- });
- });
- if (Conf['Autohiding Scrollbar']) {
- $.addClass(doc, 'autohiding-scrollbar');
- }
- $.ready(function() {
- if (d.body.clientHeight > doc.clientHeight && (window.innerWidth === doc.clientWidth) !== Conf['Autohiding Scrollbar']) {
- Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar'];
- $.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar']);
- return $.toggleClass(doc, 'autohiding-scrollbar');
- }
- });
- $.addStyle(Main.css, 'fourchanx-css');
- Main.bgColorStyle = $.el('style', {
- id: 'fourchanx-bgcolor-css'
- });
- keyboard = false;
- $.on(d, 'mousedown', function() {
- return keyboard = false;
- });
- $.on(d, 'keydown', function(e) {
- if (e.keyCode === 9) {
- return keyboard = true;
- }
- });
- window.addEventListener('focus', (function() {
- return doc.classList.toggle('keyboard-focus', keyboard);
- }), true);
- return Main.setClass();
- },
- setClass: function() {
- var mainStyleSheet, setStyle, style, styleSheets;
- if (g.VIEW === 'catalog') {
- $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-'));
- return;
- }
- style = 'yotsuba-b';
- mainStyleSheet = $('link[title=switch]', d.head);
- styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
- setStyle = function() {
- var bgColor, div, k, len1, styleSheet;
- $.rmClass(doc, style);
- style = null;
- for (k = 0, len1 = styleSheets.length; k < len1; k++) {
- styleSheet = styleSheets[k];
- if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) {
- style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-');
- break;
- }
- }
- if (style) {
- $.addClass(doc, style);
- return $.rm(Main.bgColorStyle);
- } else {
- div = $.el('div', {
- className: 'reply'
- });
- div.style.cssText = 'position: absolute; visibility: hidden;';
- $.add(d.body, div);
- bgColor = window.getComputedStyle(div).backgroundColor;
- $.rm(div);
- Main.bgColorStyle.textContent = ".dialog, .suboption-list > div:last-of-type {\n background-color: " + bgColor + ";\n}";
- return $.after($.id('fourchanx-css'), Main.bgColorStyle);
- }
- };
- setStyle();
- if (!mainStyleSheet) {
- return;
- }
- return new MutationObserver(setStyle).observe(mainStyleSheet, {
- attributes: true,
- attributeFilter: ['href']
- });
- },
- initReady: function() {
- var msg, ref, ref1, ref2;
- if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) {
- ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
- if (Conf['404 Redirect']) {
- return Redirect.navigate('thread', {
- boardID: g.BOARD.ID,
- threadID: g.THREADID,
- postID: +location.hash.match(/\d+/)
- }, "/" + g.BOARD + "/");
- }
- });
- return;
- }
- if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') {
- return;
- }
- if (((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && !$('.board + *')) {
- msg = $.el('div', {
- innerHTML: "The page didn't load completely.
Some features may not work unless you
reload ."
- });
- $.on($('a', msg), 'click', function() {
- return location.reload();
- });
- new Notice('warning', msg);
- }
- if (!(Conf['JSON Index'] && g.VIEW === 'index')) {
- return Main.initThread();
- } else {
- Main.expectInitFinished = true;
- return $.event('4chanXInitFinished');
- }
- },
- initThread: function() {
- var board, err, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads;
- if ((board = $('.board'))) {
- threads = [];
- posts = [];
- ref = $$('.board > .thread', board);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- threadRoot = ref[k];
- thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
- threads.push(thread);
- ref1 = $$('.thread > .postContainer', threadRoot);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- postRoot = ref1[q];
- if ($('.postMessage', postRoot)) {
- try {
- posts.push(new Post(postRoot, thread, g.BOARD));
- } catch (_error) {
- err = _error;
- if (!errors) {
- errors = [];
- }
- errors.push({
- message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.",
- error: err
- });
- }
- }
- }
- }
- if (errors) {
- Main.handleErrors(errors);
- }
- if (g.VIEW === 'thread') {
- scriptData = Get.scriptData();
- threads[0].postLimit = /\bbumplimit *= *1\b/.test(scriptData);
- threads[0].fileLimit = /\bimagelimit *= *1\b/.test(scriptData);
- threads[0].ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : void 0;
- }
- Main.callbackNodes(Thread, threads);
- return Main.callbackNodesDB(Post, posts, function() {
- var len3, post, u;
- for (u = 0, len3 = posts.length; u < len3; u++) {
- post = posts[u];
- QuoteThreading.insert(post);
- }
- Main.expectInitFinished = true;
- return $.event('4chanXInitFinished');
- });
- } else {
- Main.expectInitFinished = true;
- return $.event('4chanXInitFinished');
- }
- },
- callbackNodes: function(klass, nodes) {
- var cb, i, node;
- i = 0;
- cb = klass.callbacks;
- while (node = nodes[i++]) {
- cb.execute(node);
- }
- },
- callbackNodesDB: function(klass, nodes, cb) {
- var cbs, fn, i, softTask;
- i = 0;
- cbs = klass.callbacks;
- fn = function() {
- var node;
- if (!(node = nodes[i])) {
- return false;
- }
- cbs.execute(node);
- return ++i % 25;
- };
- softTask = function() {
- while (fn()) {
- continue;
- }
- if (!nodes[i]) {
- if (cb) {
- cb();
- }
- return;
- }
- return setTimeout(softTask, 0);
- };
- return softTask();
- },
- handleErrors: function(errors) {
- var div, error, k, len1, logs;
- if (!(errors instanceof Array)) {
- error = errors;
- } else if (errors.length === 1) {
- error = errors[0];
- }
- if (error) {
- new Notice('error', Main.parseError(error, Main.reportLink([error])), 15);
- return;
- }
- div = $.el('div', {
- innerHTML: E(errors.length) + " errors occurred." + Main.reportLink(errors).innerHTML + " [
show ]"
- });
- $.on(div.lastElementChild, 'click', function() {
- var ref;
- return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref;
- });
- logs = $.el('div', {
- hidden: true
- });
- for (k = 0, len1 = errors.length; k < len1; k++) {
- error = errors[k];
- $.add(logs, Main.parseError(error));
- }
- return new Notice('error', [div, logs], 30);
- },
- parseError: function(data, reportLink) {
- var context, error, lines, message, ref, ref1;
- c.error(data.message, data.error.stack);
- message = $.el('div', {
- innerHTML: E(data.message) + (reportLink ? reportLink.innerHTML : "")
- });
- error = $.el('div', {
- textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
- });
- lines = ((ref = data.error.stack) != null ? (ref1 = ref.match(/\d+(?=:\d+\)?$)/mg)) != null ? ref1.join().replace(/^/, ' at ') : void 0 : void 0) || '';
- context = $.el('div', {
- textContent: "(4chan X ccd0 v" + g.VERSION + " userscript on " + $.engine + lines + ")"
- });
- return [message, error, context];
- },
- reportLink: function(errors) {
- var data, details, ref, title, url;
- data = errors[0];
- title = data.message;
- if (errors.length > 1) {
- title += " (+" + (errors.length - 1) + " other errors)";
- }
- details = "[Please describe the steps needed to reproduce this error.]\n\nScript: 4chan X ccd0 v" + g.VERSION + " userscript\nUser agent: " + navigator.userAgent + "\nURL: " + location.href + "\n\n" + data.error + "\n" + (((ref = data.error.stack) != null ? ref.replace(data.error.toString(), '').trim() : void 0) || '');
- details = details.replace(/file:\/{3}.+\//g, '');
- url = "https://gitreports.com/issue/ccd0/4chan-x?issue_title=" + (encodeURIComponent(title)) + "&details=" + (encodeURIComponent(details));
- return {
- innerHTML: "
[report ] "
- };
- },
- 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');
- }
- return Main.thisPageIsLegit;
- },
- ready: function(cb) {
- return $.ready(function() {
- if (Main.isThisPageLegit()) {
- return cb();
- }
- });
- },
- css: "/*!\n" +
-" * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome\n" +
+boards:
+"/*!\n" +
+" * Font Awesome 4.6.1 by @davegandy - http://fontawesome.io - @fontawesome\n" +
" * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n" +
" */\n" +
"@font-face {\n" +
" font-family: FontAwesome;\n" +
-" src: url('data:application/font-woff;base64,d09GRgABAAAAAUaEAA4AAAACKvgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABRAAAABwAAAAcagNvKUdERUYAAAFgAAAAHwAAACACtAAET1MvMgAAAYAAAAA/AAAAYIhZeh5jbWFwAAABwAAAAXcAAALyp8d/bWdhc3AAAAM4AAAACAAAAAj//wADZ2x5ZgAAA0AAASr8AAH7LBMsk3FoZWFkAAEuPAAAADEAAAA2DQzHVWhoZWEAAS5wAAAAHwAAACQPAwpbaG10eAABLpAAAAK8AAAKCpMpFypsb2NhAAExTAAABPUAAAUQaY3nVm1heHAAATZEAAAAHwAAACAC8AIcbmFtZQABNmQAAAGhAAADiDNGhcdwb3N0AAE4CAAADnIAABggxzdjQXdlYmYAAUZ8AAAABgAAAAaOKlZPAAAAAQAAAADMPaLPAAAAAMtQjbAAAAAA0nU+qXjaY2BkY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uF635gL7FmSV5isurNNmT9CzOz6aZLeloeeiqoqihAFeLGoWFooFiEUXys23LwqZ58bW9ID1NgJo1NAFqAtQEqAlQE6BmM9eqzyeINqwqihqKejrbWQtoWCgaKBZRALQwjwJfFwBaAGihjkKjAGIBiAUgFrK9nT2f1cBVgasCVwWuClwVuCpwVeCqWKmGlWpA1ICoAVHLtrc5m3DzQlYnIwCtZUtu1lltZTUmr2OOOlatY9U6Vq0nHwCtZ9BzsLDGwhrTaoA0QBogDZAGSAOksVULCAsICwgLCCvb6pbkG0BWQ/zdS74B1MCHBkANgBr40MAyDSzTsDC4AwvLNIBYBGIRCOiiDl3UoYs6dFGHLurQRR26qC8C0QSiCQREUW8C0aznetWERhGFWMkHICAKLaKQYgFFFUUNRR2FRmGhaKBYRNHMLxkJm2JCEhpzaUhCQxIaktCQhIYkNCShF7BIFYtUgYAYNMSgIQYNMWiIQUMMGmLQEIOGGDTEoCEGDTFohC9dA6IGRA0IaEDXgKgDUQeiDgSo16Beg3oN6jWo16Be14HQQIB3Dd41eNfgXYN3Dd41eNfgXYN3Dd41eNfgXYN3bQFhAQHStQWEBYSQ3qsKQgoghHSxgADpGqTrBhANIEC6BukapGuQrkG6BukapGuQrkG6BukapGuQrkG6BukapGuQrptAIBJoRAKNSKCF9F61YRKZVhfns1pwFqi3QL2VxYPqos5qC50NFIsoZD0LWrLAvwX+LfBvgX8L/Fvg3wL/Fvi3wL8F/i3wb4F/C/xb4N8C/xb4t8C/Bf6tavN/jalaPAAAAAFWT44pAAA=') format('woff');\n" +
+" src: url('data:application/font-woff;base64,d09GRgABAAAAAVv0AA4AAAACTYgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABRAAAABwAAAAcar+NgEdERUYAAAFgAAAAHwAAACAC0gAET1MvMgAAAYAAAAA+AAAAYIg2eiNjbWFwAAABwAAAAX4AAAMCnS901Gdhc3AAAANAAAAACAAAAAj//wADZ2x5ZgAAA0gAAT4PAAIWnEjw1XRoZWFkAAF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NtY3l+lmNtlnmmIaBGVYYCagioIaCGgBoCajTSrdpshGhLryJNVZpavFqzLANDmro0c9IIqDwrjTwtC6gsoHJNGiWNIMqCKAuinOxt3WxiBVcRXEVwFcFVBFcRXEVwFcFVxFNVPFUFURVEVRDVZHvrkwXXlxMbvSHQauJyvUqskVhZvCZr1MRrTbzWxGsteiDQWgLdII6VOFayrBKQEpASkBKQEpASkJKtGoIwBGEIwhCEkWx1Y/RMQEad492LngmoLg/qAqoLqC4P6uKmLm7qhrzckZ64qQtiThBzghBd1EQXNdFFTXRRE13URBc10UVtThANQTQEIaKoNQTRqKV7lYhGFgX3ogeCEFEoFgU3ZWkq0lSlqUmjpDGkqUszJ00js6A5bXJXJKFkLSWSUCIJJZJQIgklklAiCVUWJxVxUhGEiEGJGJSIQYkYlIhBiRiUiEGJGJSIQYkYlIhBiRiUpC9VFURVEFVBiAZUVRA1QdQEUROEUK+EeiXUK6FeCfVKqFc1QShBCO9KeFfCuxLelfCuhHclvCvhXQnvSnhXwrsS3pXwrgxBGIIQ0pUhCEMQTHqvwghuBMGkc08QQroS0lVdEHVBCOlKSFdCuhLSlZCuhHQlpCshXQnpSkhXQroS0pWQroR0JaQrIV01BCGZQEkmUJIJFJPeq9R1JNPK3GxiGWcI9YZQbyT5oDKnEmvIZF2aOWnYnyFaMoR/Q/g3hH9D+DeEf0P4N4R/Q/g3hH9D+DeEf0P4N4R/Q/g3hH9D+DeEf0P4NyrxtazMJzucLye2kthqYpOtzidbnTcSW0/sXGIn680ntpnYdYldn9gNsW0mfpuJ32bit5n4bSZ+m4nfZuK3mfhtJn6bid9m4reZ+G0mfpuJ3+aG/wKaCq5qAAABVwz+AQAA') format('woff');\n" +
" font-weight: 400;\n" +
" font-style: normal;\n" +
"}\n" +
-".fa::before {\n" +
-" font-family: FontAwesome;\n" +
-" font-weight: 400;\n" +
-" font-style: normal;\n" +
-" -webkit-font-smoothing: antialiased;\n" +
-" text-decoration: inherit;\n" +
-" speak: none;\n" +
-" display: inline-block;\n" +
-" font-size: 13px;\n" +
-" visibility: visible;\n" +
-"}\n" +
-":root:not(.shortcut-icons) #shortcuts .fa::before {\n" +
-" display: none;\n" +
-"}\n" +
-":root.shortcut-icons #shortcuts .fa::before {\n" +
-" font-size: 15px !important;\n" +
-" margin-top: -3px !important;\n" +
-" position: relative;\n" +
-" top: 1px;\n" +
-"}\n" +
-":root.shortcut-icons #shortcuts .fa, .menu-button .fa {\n" +
-" font-size: 0;\n" +
-" visibility: hidden;\n" +
-"}\n" +
-":root.shortcut-icons .shortcut.brackets-wrap::after,\n" +
-":root.shortcut-icons .shortcut.brackets-wrap::before {\n" +
-" display: none;\n" +
-"}\n" +
-":root.shortcut-icons #shortcuts a .fa,\n" +
-".menu-button .fa,\n" +
-".hide-reply-button .fa,\n" +
-".hide-thread-button .fa {\n" +
-" display: inline;\n" +
-"}\n" +
".fa-glass:before {content: \"\\f000\";}\n" +
".fa-music:before {content: \"\\f001\";}\n" +
".fa-search:before {content: \"\\f002\";}\n" +
@@ -19237,6 +1099,63 @@
".fa-bluetooth:before {content: \"\\f293\";}\n" +
".fa-bluetooth-b:before {content: \"\\f294\";}\n" +
".fa-percent:before {content: \"\\f295\";}\n" +
+".fa-gitlab:before {content: \"\\f296\";}\n" +
+".fa-wpbeginner:before {content: \"\\f297\";}\n" +
+".fa-wpforms:before {content: \"\\f298\";}\n" +
+".fa-envira:before {content: \"\\f299\";}\n" +
+".fa-universal-access:before {content: \"\\f29a\";}\n" +
+".fa-wheelchair-alt:before {content: \"\\f29b\";}\n" +
+".fa-question-circle-o:before {content: \"\\f29c\";}\n" +
+".fa-blind:before {content: \"\\f29d\";}\n" +
+".fa-audio-description:before {content: \"\\f29e\";}\n" +
+".fa-volume-control-phone:before {content: \"\\f2a0\";}\n" +
+".fa-braille:before {content: \"\\f2a1\";}\n" +
+".fa-assistive-listening-systems:before {content: \"\\f2a2\";}\n" +
+".fa-asl-interpreting:before, .fa-american-sign-language-interpreting:before {content: \"\\f2a3\";}\n" +
+".fa-deafness:before, .fa-hard-of-hearing:before, .fa-deaf:before {content: \"\\f2a4\";}\n" +
+".fa-glide:before {content: \"\\f2a5\";}\n" +
+".fa-glide-g:before {content: \"\\f2a6\";}\n" +
+".fa-signing:before, .fa-sign-language:before {content: \"\\f2a7\";}\n" +
+".fa-low-vision:before {content: \"\\f2a8\";}\n" +
+".fa-viadeo:before {content: \"\\f2a9\";}\n" +
+".fa-viadeo-square:before {content: \"\\f2aa\";}\n" +
+".fa-snapchat:before {content: \"\\f2ab\";}\n" +
+".fa-snapchat-ghost:before {content: \"\\f2ac\";}\n" +
+".fa-snapchat-square:before {content: \"\\f2ad\";}\n" +
+".fa::before {\n" +
+" font-family: FontAwesome;\n" +
+" font-weight: 400;\n" +
+" font-style: normal;\n" +
+" -webkit-font-smoothing: antialiased;\n" +
+" text-decoration: inherit;\n" +
+" speak: none;\n" +
+" display: inline-block;\n" +
+" font-size: 13px;\n" +
+" visibility: visible;\n" +
+"}\n" +
+":root:not(.shortcut-icons) #shortcuts .fa::before {\n" +
+" display: none;\n" +
+"}\n" +
+":root.shortcut-icons #shortcuts .fa::before {\n" +
+" font-size: 15px !important;\n" +
+" margin-top: -3px !important;\n" +
+" position: relative;\n" +
+" top: 1px;\n" +
+"}\n" +
+":root.shortcut-icons #shortcuts .fa, .menu-button .fa {\n" +
+" font-size: 0;\n" +
+" visibility: hidden;\n" +
+"}\n" +
+":root.shortcut-icons .shortcut.brackets-wrap::after,\n" +
+":root.shortcut-icons .shortcut.brackets-wrap::before {\n" +
+" display: none;\n" +
+"}\n" +
+":root.shortcut-icons #shortcuts a .fa,\n" +
+".menu-button .fa,\n" +
+".hide-reply-button .fa,\n" +
+".hide-thread-button .fa {\n" +
+" display: inline;\n" +
+"}\n" +
".fa-spin::before {\n" +
" -webkit-animation:spin 2s infinite linear;\n" +
" -moz-animation:spin 2s infinite linear;\n" +
@@ -20093,7 +2012,7 @@
":root.float #updater {\n" +
" padding: 0px 3px;\n" +
"}\n" +
-":root:not(.float) #updater {\n" +
+":root:not(.float).shortcut-icons #updater {\n" +
" display: inline-block;\n" +
" min-width: 12pt;\n" +
" text-align: right;\n" +
@@ -21046,75 +2965,6 @@
".boardSubtitle[contenteditable=\"true\"] {\n" +
" cursor: text !important;\n" +
"}\n" +
-"/* Link Title Favicons */\n" +
-".linkify.audio {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.clyp {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.dailymotion {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.gfycat {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8qLf86Pi9Kzj9K7k9LHp9sDp98Lq98Ps+Mr0++L5/O75/fD6/fH6/fL6/fP7/fT7/fb8/ff8/vj8/vn+/v7///91X4cfAAAAcklEQVR42o3M2xKBUACF4aVQckrIuRJK6H//x2sme4/MuPDfre9i6c/Cc3U5Dj87BuAxsXvGu6JvIIXEHRWwNHCHQNrCzkAFkbSBg4EM8i+Yw7PXBa3zRfuxVyf/Bis7nKwGKAcWxgC8prI5Sc315OlnDfzpDar2S9/oAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.gist {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABblBMVEXc3NykpKTW1tbb29ugoKCdnZ0AAAACAgIEDRcKCgoMDAwODg4QIzYRDAoTExMUDwwVAg0WICsaEw8aGhoiCBklGxUmERwwKCQ7LSU7Ozs8LSZFLyNINi1JNyxJNy1KSklMOi5VR1FXV1daQTRkZGRseYZwU0F4eHh7dnR8bWV/YE6IdGiKcGCKkJaNgYeNjY2RdGOScWCUcWCZmZmhoaGkpKSoqKirfmaurq6xsbG1tbW6urq+vr7AbmzBb23CwsLGxsbHx8fHyMjJycnJysrMzMzOiYbPi4fQ0NDRoYbT09PU1NTW1tbY2NjZqIzZ2dnb29vd3d3f39/i4uLktZrk5OTl5eXm5ubn5+fo6Ojq6urs7OzttKLu7u7wuqbw8PDx8fHz8/P4+Pj5+fn7uZj8vpz9ya79ybD/tZf/upr/wZ//w6H/xKH/xaL/xrH/yqj/y7T/zqv/z7D/07D/17n/2Lv/2Lz/3L//38n/4Mk3Q/ZuAAAABnRSTlMSFcbGzc5MNKFvAAAA1klEQVQoz2NgYPZHAswMDEwRSclwkBTBxOARn4gE4j0YXBOiJNUDg7y8Ar1UlOITXBkcY73Z2Li42dg42dn4wmIdGeyjQ7nZoEA4PNqewSZKlw0O9KJsGKwjBdl4ZeWkJGQUhNjEIq0ZrMI5+D0ri7Jz8itCRAXCrRgsQ3mUy+xicrPSbfO0REItGSyCVaVL3ONSU9LcCtQUgy0YzIJ85M1LizMzCsv9xF2CzBhMAwN99TV1DI0MtDWcAgNNGUycA5CAswkDi5kDwrMOZiwMjKzGSICVEQDhZj0UQV7PewAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.image {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAs5JREFUOE+lk/tvi1EYx98/xT8gW4REIpGFMEQWl2FiM9ZMZhm2xRAyOsmujFFmdFRHu0tWm87UypxStr69zPauN5e5rHVp3IYhbOvHy+wHEQlxkm+ek+d8nm9OznkeSfrfldmgJC7QyUlTymsJTfuTZ25z4HdWYwyLreYhtpgekGPw0+kKvo1Eo+IXRSIiEhkWZuc9tqnsJD9EqTUopCxjSGTpB0iueczSo1HyW8cpsExQ1DbxI2pt45j9cXpexul4FEd79RnZphAa/SD7WvuFtO6UItbU9LC+YQxNI2w0wwYT5LRAdhOU3oBTIXC9gXP3oUSGgz2vST3gYHejR0jptT1C332f8yrUEYHrz8CgxDnpm6DKCUfc0KnmXa/AEVPPwnDcD0cvetA2uYRk67Ive/lpjO7YBO1PPuF8Df3vwf4cbNE4tqdw7YVq8HYyHx6FvhE1hkMEg8HDUqvFkjT4aIjMqkqyqkswDSrcfBfH+Q561YLAZ/B+BLda6FXlU/cPv0AoEPhuoP1h4Av7Wbh9E/Py15NWWUjeSR3nZDfeN+N0DY9hG/7K1eGP3P0S5/EYRFUF/IOTBrUXHPm9fT6mr1xEwupkZqxbzLyiDJYUZ5NSnkdqdSHpxyrYdFpPgdmAsdfJwPMI/Yr65bf7tZLGGBQ7DNdJWFtIYvoOZmbuZE7OXpIKKli86zAr9p9gTVktWTVnKTI2U95uRWe3U2IJUDbVB5p6hVm5x5m9Vc/cnedZUNzC8lILaQesZBy6hEZ3maKzgvJWFzVWD9XtXvVGQbSWASFtMATVRlJIKbOTWtlJXaeXepuPM1f6MNp9GLt8mLvvYLmp0OhQ2Fwvk6m7xaqDTvY0eYWUVtcnllXfYlGpnfklVuraHHg8HjxuN+6fktUHlWWZPaZeUo/ILK0UKttBcbNbSB9GP0yLxWJJUxoZGUn80zD9C/vXQ/4NHY10h3M1zmQAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.installgentoo {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABcVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3dIYAAAAAAAAAAAAbGh4BBAcCBgoBBgoCBwsCCQ/QzucCCA7MyuXZ1eUBBQmTh8fo5/i9svIAAADh3vQAAAACCA0CCQ8CCQ4DDBQbGCUDChDr6vgAAAAAAAAREBIDCxK6tdfe2fTv7/cDCxIDDBQEDRUHDhgMJjXk4PZdXWdLUFoUNEYOKDgSMUMRLUBneI4eTGj08/QmW3onW3rTzvfOx/giU3IiVHMkWHdEaYJobHv3+PokWHpua6TNy9xZgZ+1quz8/foQKj0XPFInWn0nW38tZ4o6fqg8gq48grA9hrU/i7pAhrNAiLdBjLtEjr1FksNIjr5Il8pImMtKWnNqhL97odKFqti5q/q5rPq60+nCt/vLw/vPx/jV0vHY0/rc1/rg2/vh3fzn4fzu6/vx8vf19Pv19Pz49/v5+Pv8/Pv8/fr9/vv+/frziVtUAAAAT3RSTlMABQYHCAoNDhARGRobL0ZOV1xdXV5fYGBmZnB0eX2MjZSaoaGio6mqqqustLq7zubo6Ojo6evt7u/x8fLy9/f4+Pj5+vr6+vr6+/39/v7+XKgUSwAAAMhJREFUKM9jYGDg4OZmZgABKINT1dBAhBHIYFMxMBIDisjbhoZbCTExsCu5hoeY8DEwcOkEx8fY6MqpucTGB0izglVEplcU5/gmRYWBVQDNMK+s0hN3SvMyBpsBNJxXw0NfwTEjVQZqHQMHj5RfWW5mliSEC7TPzK6yJD/bXZQRzGdXcisqLy309okA2Q4Eis4peQWmstqBCdGW/CABraC45ERBBs3A6Fh/AbAKTwsHa34QZW8NVsGuLqwswQSjQICTmYMFQaEDAAF8JHLfKGswAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.liveleak {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAlNJREFUGBkFwU2LVmUYAODrPu8Z5x1xSpRBXQyFoLsBE+wfiO5atJOgnf9DUPwFgtGinUgEaQsRhHYuMtpEiEWuG5iNjuOcj+c8z911xXcXL/68c3Dw1fzhg0QgEQAAEYGUKXFie9vxlSs/xk/rdavjGEkmkWSih65z4osv9GfOiK6LzEyZ2uGh4dUrmzs72ddlUUhkoiMr4PT167589Mh6c1N0nSRlqrX67dat+PDyZXRT19m5edPnt28rGFHxMcJ6d9fprS1/37tneP3aemPD1uamUydPOru3p5DdGOH0tWsu3LhhxIQJM2qEpRT/Pn3q/du3AhARSmvGTH0lplKMrVkiYpVpQaJlighzhDkzhmEA0fcWoqAfyaFW4zTlgCABxlrNmY4ylUzLsiREprFWc0T2M+ZSjKWY0AEaltZUjJixZJIpuk5pTWlNP2BYFvOyKJkCAKU1tTXHrZlqVWolUxdhxsfVSj9FmJfFMM9GdICGGa01HyMstYpMIFPJVNDPmYZSTOPoOEKHzNRlKpmWWh1j6TpLa2SKTKVWU6Z+Qolwdm/P9QcPZKa2LH69e9eIMs+WCL/cv2/98CGZPrt61am+V9APq1X89eyZ/968obVYaiXT4dGREgG+vnPHeHgYMsH2+fP+efEihtVKv7SWw/6+9/v7KYLMhIywTJPamvOXLomukyRsrNf+ePzYkpl9dJ3SWgSCSCQCfz5/7pMLF2yfO6eLiAQcHRz4/cmT+HR7O+Ob3d0fNt69+7a2BiICQCJbA0EgE5lpvbXl1OXL3/8Pfax4+6SjSukAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.pastebin {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB1FBMVEUAAAAAAAAAAABWYWwAAABbY3BbYm5dZnFdZXJeZnMEBAQHCAhYYGpdZnFdZnBgaHIlJyomKCooKi09QkdESU5eZGtdYmhdYmleY2lrcXdqb3Rqb3Rqb3SSmJ+SlJeWmJutr7GtrrCWm6ChpKhbW1tmZmZvb290dHR3d3d4eHh5eXl6enp8fHx+gIJ/f3+CgoKDg4OEhISFhYWHh4eKioqKjI2Li4uMjIyOjo6Pj4+QkJCRkZGSkpKUlJSVl5mWlpaYmZqZm52ampqbm5ucnJydnZ2enp6fn5+hoaGioqKkpKSkpaalpaWmp6mmp6qnqauoqKioqquoqq2qqqqrrK2srKysra6srrCsrrGurq6vr6+wsLCxsbGysrKztLa0tLS1t7m2tra3t7e4uLi5ubm6urq7u7u8vLy9vb2+vr7AwMDAwsTBwcHExcfFxcXFxsnGxsbHx8fIyMjJycnMzMzNzc3Ozs7O0NLPz8/Q0NDR0dHR09XT09PV1dXV1dbV1tfV19rW1tbX19fX19jY2tzZ2dnZ2tva2tra3N3a3N7c3Nze3t7f39/f4OHg4ODi4uLl5+jm5ubs7Ozs7e3u7u7v7+/v8PDw8PDx8fHy8vLz8/P29vYSoLMZAAAAJHRSTlMABAUGCwsNHCAiLzMzMzZEYGJwgIuOnJycnqmqq9bc3+/w8fkZ0N/uAAAA/klEQVQoU2NgYGDl5YMDdgYGBmZZ3964CYFtIR3e9Q7K/AwMHI55KfaFmcHWMy3K3MwlGRg4wz0zdYpcorRbNbL0LaWAAp3ts2umV8wo6MupTauQBgqUG03VL7W3sfZSb1erAgm02M+yzYrVCXUy6zapAQlUx/dEdyX3J3ZHVUYVywAF8o2rDNN1Go2jzGLMokAC2QbuSc42mXmaOXop9iAtCXrJ5qXWjT59Abl2ESJAAX/tSIMMiyrrqQ3T6uS5gQK6kSqpqkUermGTexQFmYACflqR+hlWZSamzQpCLEDPsSmVVDT1TJw0JUhOAMRnYOARFRMTE5cQF+ZiBPIAII5B3EVG0b4AAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.soundcloud {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABsklEQVQ4y5WTy2pUQRCGv2rbzDjJeAlIBmOyipGIIJqFEBDElwh4yULGeRFXPoEIBl/AvQ/gC2RnxCAoxijiwks852S6+3dxzslcHJCpTXVX11/Xv0097gLPgVNMJxnQNfX4zsqleWbnpoMf/oa9d988MM9MC/rp+E0a+A0dsVobMNMCOO8B6McRoABJI+A6gJmN3D2A8jgEBCEkSEMBrcrsDAzDWWn3AjgKFaDMmgRqniGFgsaDp1jrLOngDf1XT1D+A1dFc4MKAkkiCVKjjVu7g9+4Rzx4i1u6hjXbuMWr0O5QPNvCu7IaCZwEKQukLGDrm5x8uI0tr6MkiGlkiv7yLfzN+6S5i6QsIMABkEfcxhbWWYMkVAOjxvYAjc3HNHrbKI9VBQBFwF25XQKSBjqIf1YBuAurEMrczgDygD6/x2LCpFLXLUyQ+PoldphhBhYfIX09XU1+Flaukz7uYqs3SHs7cG4BmTsmkBUF9mmXEwa28BNLPaQPLepuNcbGSWQquQC2/Kdcox1FUGkcB0ykck1nA2+wTzMs8stGnP4rbWGw74EuS/GFQWfK7/wF6P4F7fzIAYkdmdEAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.twitchtv {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAYUExURf///2RBpWRBpWRBpWRBpWRBpWRBpf///+zQyUYAAAAGdFJOUwFdZX0lTzs4r5oAAAABYktHRAcWYYjrAAAAB3RJTUUH4AINEi42iSXRNAAAAD1JREFUCNdjYEiDAAZGGIMtjQEEUBlMCWoEGci6mGEMsxQgIy0BiB3AjLS0FAYQIw0kwABipoI1AhkBQBIAFCIXxiHgq80AAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.twitter {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAEsUExURf///1Cf21Gg3FGi31Gh3VKj4FGh3lKj4VKk4lKl41Ol5FOn51Sp6VSo6FOn5lCf21Gg3FGh3VGi31Gi31Gh3lGg3FGg3FGg3FGg3FGh3lGg3FGi31Kk4lKj4FGh3lGi31Kk4lGh3lGg3FGh3lOm5FOm5VGi31Kj4VSo6FGi31Gh3VGg3FKj4FOn51Gi31So6FWr7VOl5FGi31On51Sq6lKk4lOo51Sp6VOm5FSq61Ws7VOn51Oo51Sq61Ol5FOm5FSq61Wr7VOo51On51Sr7FWs7VSp6lGg3FGh3VOm5FWr7VSp6lKj4VOm5FSo6FSr7FWs7VWs7VWr7VSq6lOo51Om5FOo51So6FOm5VOl5FSq61Ws7VSr7FSp6lSp6VWs7lWr7VKk4lSq6v///6E3MNsAAABVdFJOUwAAAAAAAAAAAAAAAAAAAB0Ii+3xnBVTJhfsMKb+qTEp9GwBF/7lLAbo0m4pLkUTdvk2Ev3+EZnOBo/3Z8ffCRzH/D0OqPxiLnvx3UI8m9n1++GwXQZNS29BAAAAAWJLR0QAiAUdSAAAAAd0SU1FB+ACDRIwBwy67tEAAADKSURBVBjTY2BAB4xogIGRH8IQEBQSFhEVE2eQkJQC8ZmkQ8PCI2Rk5RjkIxUUlRgZlVWioqNjYlXVGNQ14iI1tbR14qLj4+MTdJkZ9PQNosJCE0OjgPz4KEMWBiPjhPiEmKQokIJ4E1MmBmazhHg4MGdlYmCzsLSC8ROsmRkZmFht4Eps7ViADmOzd4DyHZ2YmYACTOzOLmATXd04mIBOd/eQ9owFCXh5c7KB/MLi4+vnHxAYFBzCwcYEEmBi5uLm4eHl42RmAnsSAMZBLgZiFUQ5AAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.video {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAxgDGAP8nNqN7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gMZBjQQLEEqGwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAA5SURBVDjLY2AYaMDIwMDwn1JD/lPCZhpwL+B1wf///ykzgBhDiAoDfIYQZQAjIyP5BuDTPJqQqAQAvW0ZAMk8+EEAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.vimeo {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAAIdZUKh6sLlLkLmr4LmsAMp88NrdYVW3MZj7Acstkrt9s1e5E7vN5EfI9JvdtKwuBijp5kpbl30eiDt8aG1uqRr7qTyNehxM+k4PCy3enB3OTg6Ovv9PXw+fz////L9U5WAAAAAXRSTlMAQObYZgAAAIFJREFUeNplz90OwiAMBWAQpAoyxclkP3je/y0H2AQXz0WT8100rRD6kNI9/cRroemQL3hXhoujZYj4OHoAmBvYGcBISwbWBvfXCrytnIDUQMkbsBpagMA7zhtQdyTFQAmIG7IkYniiZuh3XGsPqoOZkMOJOpAcLqUzNFGGu/57fwc1hgtp0mVSyQAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.vine {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAHCUExURQAAAAC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+j////54tRLAAAACUdFJOUwAAAEK+9/e+QQIDAwEqzskfUZmUNHz2mrT++V1w+f5tCanNFUDwfEjtjAyyvg027Hki27QMBJzaHE/1+FkNsN0iZvv6bxyAlB589lQeyud0KB8PQO+ZBUrc+eXgcRG/3CoATe316Wxw/P6BAgBt+fp4IAwh0d4zM9q7Fm76qi605EMSrvfX/PRtAivF9IAJNMLxhA2KYlJ9AAAAAWJLR0SVCGB6gwAAAAd0SU1FB+ACDRI2MOJd7FgAAADrSURBVBjTLY9VWwJgGEPfiYWBha2YYHcHditgd3d3odjdivvBfgK727nYsyPiCrw03j6+fv6AaAMCgyAI1lElJBQSFh6hBxDJqOiY2Lh4SEKiIQlITmFqWrqRJkhGJrOA7Bzm5uUXsBBSVMySUpSVs6KyqrqmFmKuY30D0NjU3NLa1t6h9jvZ1Q30WGi19fb1KzAwyKFhYGSUY+MTkwpMTXNmFpibX+Di0rICWFldW9/A5tb2zu7ePtTrg0MeHePklPYzuDRw7uDF5RWvbwC32O0d7x8en55f4DHF6xv5/vHp6f/k6/vH+evuf1LAObptvSvrAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.vocaroo {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAw9JREFUOE9jYMABuMwYmCyTJKUCGlSnFSy02TTzeOyCiQcDViX26qVz2TAyYtWmEMwuoZ3M7V40LcB79pHkc0svpvzY8jD//87nxf+3Pyn8v/ZO8v+VNyP/2mZJumI1QCWSI8232Hjumitlfw5+qPp/9l8TCt76JP//xkdx/wsXWCzjtWFkwTCkbWFe9plPk/+ga4Txz/xt/D/hkN//gMXif21a+NbyWjIwoRiy6GDT5rP/mlFsPfyp5n/NpOj/22+0gMUXXIz/H7hC/L/bFKFbPDZMrHAD5H35OPt2J9zacDv/f3V7xv9FhwrBGubsT/1//Pjx/1GJ/mD+/nfl/1v3Ovy3KRJNQbHdOlXCvOO03/+pm1P/v3v37n90hhtYw9HPtf8Xb2v937cmHswHeWPRxYj/LvkK3igGKARwicTO07118H3V/5kbi/4vPZMJtK3s/6YH2f+Pfq1B8VbjWrdnMu5s4nAD9CNFhKwz5DTUvLl419zKvAcLtG1P84BRl/b/5M/6/6f/NPzf/qzo84yj0Uus0xUU4Zor54bm9+4OfZG02OCuoAMTb9ZkC9ull1Nvrr2Z+XvRpaRfc65H/68F+jl9svEhzyLFWoccWVc+eyTHq/twydjlKRln7jX9bNMkMJnbhoFRL1xCqmKx6/yi2fYXa/c5/e846PV/5fW0/7OPx/yfcjzop34ulxdGGvDuU8mMXaX507lBuiN6ueadmQeT/p/93vf/1O+G//sP5fw/eL3o/5JLif8zVxs+Tlir9S26UyeFQQvJGBE7FvaFZ9LfN+1y+WjbItSb3GmXvXd15v8zroH/HxgE/D+aGPx/18vi/z07PeZNPRKxe/Kh0Ae8toxscCO4zBkYXArk9C1SxJUYjBkYPPIVtbbuTftz3cz//2O9wP/75iSAXdO72/dt2HL5F6YlfBW4MiJYXMiBiW3t7azHBx+V/t89N+H/8a+1//e9K/9attDp5LQjYX8SuvVL8RoAkmxa65299Erq1FnHo0qrl7t4BddriIs4MrM3rfWcFd+pGwVSAwBZ0bKP8yrZPAAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.youtube {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
"/* Embedding */\n" +
"#embedding {\n" +
" padding: 1px 4px 1px 4px;\n" +
@@ -21874,6 +3724,75 @@
"{\n" +
" background-image: url(\"data:image/svg+xml,
\");\n" +
"}\n" +
+"/* Link Title Favicons */\n" +
+".linkify.audio {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.clyp {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.dailymotion {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.gfycat {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8qLf86Pi9Kzj9K7k9LHp9sDp98Lq98Ps+Mr0++L5/O75/fD6/fH6/fL6/fP7/fT7/fb8/ff8/vj8/vn+/v7///91X4cfAAAAcklEQVR42o3M2xKBUACF4aVQckrIuRJK6H//x2sme4/MuPDfre9i6c/Cc3U5Dj87BuAxsXvGu6JvIIXEHRWwNHCHQNrCzkAFkbSBg4EM8i+Yw7PXBa3zRfuxVyf/Bis7nKwGKAcWxgC8prI5Sc315OlnDfzpDar2S9/oAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.gist {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABblBMVEXc3NykpKTW1tbb29ugoKCdnZ0AAAACAgIEDRcKCgoMDAwODg4QIzYRDAoTExMUDwwVAg0WICsaEw8aGhoiCBklGxUmERwwKCQ7LSU7Ozs8LSZFLyNINi1JNyxJNy1KSklMOi5VR1FXV1daQTRkZGRseYZwU0F4eHh7dnR8bWV/YE6IdGiKcGCKkJaNgYeNjY2RdGOScWCUcWCZmZmhoaGkpKSoqKirfmaurq6xsbG1tbW6urq+vr7AbmzBb23CwsLGxsbHx8fHyMjJycnJysrMzMzOiYbPi4fQ0NDRoYbT09PU1NTW1tbY2NjZqIzZ2dnb29vd3d3f39/i4uLktZrk5OTl5eXm5ubn5+fo6Ojq6urs7OzttKLu7u7wuqbw8PDx8fHz8/P4+Pj5+fn7uZj8vpz9ya79ybD/tZf/upr/wZ//w6H/xKH/xaL/xrH/yqj/y7T/zqv/z7D/07D/17n/2Lv/2Lz/3L//38n/4Mk3Q/ZuAAAABnRSTlMSFcbGzc5MNKFvAAAA1klEQVQoz2NgYPZHAswMDEwRSclwkBTBxOARn4gE4j0YXBOiJNUDg7y8Ar1UlOITXBkcY73Z2Li42dg42dn4wmIdGeyjQ7nZoEA4PNqewSZKlw0O9KJsGKwjBdl4ZeWkJGQUhNjEIq0ZrMI5+D0ri7Jz8itCRAXCrRgsQ3mUy+xicrPSbfO0REItGSyCVaVL3ONSU9LcCtQUgy0YzIJ85M1LizMzCsv9xF2CzBhMAwN99TV1DI0MtDWcAgNNGUycA5CAswkDi5kDwrMOZiwMjKzGSICVEQDhZj0UQV7PewAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.image {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAs5JREFUOE+lk/tvi1EYx98/xT8gW4REIpGFMEQWl2FiM9ZMZhm2xRAyOsmujFFmdFRHu0tWm87UypxStr69zPauN5e5rHVp3IYhbOvHy+wHEQlxkm+ek+d8nm9OznkeSfrfldmgJC7QyUlTymsJTfuTZ25z4HdWYwyLreYhtpgekGPw0+kKvo1Eo+IXRSIiEhkWZuc9tqnsJD9EqTUopCxjSGTpB0iueczSo1HyW8cpsExQ1DbxI2pt45j9cXpexul4FEd79RnZphAa/SD7WvuFtO6UItbU9LC+YQxNI2w0wwYT5LRAdhOU3oBTIXC9gXP3oUSGgz2vST3gYHejR0jptT1C332f8yrUEYHrz8CgxDnpm6DKCUfc0KnmXa/AEVPPwnDcD0cvetA2uYRk67Ive/lpjO7YBO1PPuF8Df3vwf4cbNE4tqdw7YVq8HYyHx6FvhE1hkMEg8HDUqvFkjT4aIjMqkqyqkswDSrcfBfH+Q561YLAZ/B+BLda6FXlU/cPv0AoEPhuoP1h4Av7Wbh9E/Py15NWWUjeSR3nZDfeN+N0DY9hG/7K1eGP3P0S5/EYRFUF/IOTBrUXHPm9fT6mr1xEwupkZqxbzLyiDJYUZ5NSnkdqdSHpxyrYdFpPgdmAsdfJwPMI/Yr65bf7tZLGGBQ7DNdJWFtIYvoOZmbuZE7OXpIKKli86zAr9p9gTVktWTVnKTI2U95uRWe3U2IJUDbVB5p6hVm5x5m9Vc/cnedZUNzC8lILaQesZBy6hEZ3maKzgvJWFzVWD9XtXvVGQbSWASFtMATVRlJIKbOTWtlJXaeXepuPM1f6MNp9GLt8mLvvYLmp0OhQ2Fwvk6m7xaqDTvY0eYWUVtcnllXfYlGpnfklVuraHHg8HjxuN+6fktUHlWWZPaZeUo/ILK0UKttBcbNbSB9GP0yLxWJJUxoZGUn80zD9C/vXQ/4NHY10h3M1zmQAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.installgentoo {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABcVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3dIYAAAAAAAAAAAAbGh4BBAcCBgoBBgoCBwsCCQ/QzucCCA7MyuXZ1eUBBQmTh8fo5/i9svIAAADh3vQAAAACCA0CCQ8CCQ4DDBQbGCUDChDr6vgAAAAAAAAREBIDCxK6tdfe2fTv7/cDCxIDDBQEDRUHDhgMJjXk4PZdXWdLUFoUNEYOKDgSMUMRLUBneI4eTGj08/QmW3onW3rTzvfOx/giU3IiVHMkWHdEaYJobHv3+PokWHpua6TNy9xZgZ+1quz8/foQKj0XPFInWn0nW38tZ4o6fqg8gq48grA9hrU/i7pAhrNAiLdBjLtEjr1FksNIjr5Il8pImMtKWnNqhL97odKFqti5q/q5rPq60+nCt/vLw/vPx/jV0vHY0/rc1/rg2/vh3fzn4fzu6/vx8vf19Pv19Pz49/v5+Pv8/Pv8/fr9/vv+/frziVtUAAAAT3RSTlMABQYHCAoNDhARGRobL0ZOV1xdXV5fYGBmZnB0eX2MjZSaoaGio6mqqqustLq7zubo6Ojo6evt7u/x8fLy9/f4+Pj5+vr6+vr6+/39/v7+XKgUSwAAAMhJREFUKM9jYGDg4OZmZgABKINT1dBAhBHIYFMxMBIDisjbhoZbCTExsCu5hoeY8DEwcOkEx8fY6MqpucTGB0izglVEplcU5/gmRYWBVQDNMK+s0hN3SvMyBpsBNJxXw0NfwTEjVQZqHQMHj5RfWW5mliSEC7TPzK6yJD/bXZQRzGdXcisqLy309okA2Q4Eis4peQWmstqBCdGW/CABraC45ERBBs3A6Fh/AbAKTwsHa34QZW8NVsGuLqwswQSjQICTmYMFQaEDAAF8JHLfKGswAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.liveleak {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAlNJREFUGBkFwU2LVmUYAODrPu8Z5x1xSpRBXQyFoLsBE+wfiO5atJOgnf9DUPwFgtGinUgEaQsRhHYuMtpEiEWuG5iNjuOcj+c8z911xXcXL/68c3Dw1fzhg0QgEQAAEYGUKXFie9vxlSs/xk/rdavjGEkmkWSih65z4osv9GfOiK6LzEyZ2uGh4dUrmzs72ddlUUhkoiMr4PT167589Mh6c1N0nSRlqrX67dat+PDyZXRT19m5edPnt28rGFHxMcJ6d9fprS1/37tneP3aemPD1uamUydPOru3p5DdGOH0tWsu3LhhxIQJM2qEpRT/Pn3q/du3AhARSmvGTH0lplKMrVkiYpVpQaJlighzhDkzhmEA0fcWoqAfyaFW4zTlgCABxlrNmY4ylUzLsiREprFWc0T2M+ZSjKWY0AEaltZUjJixZJIpuk5pTWlNP2BYFvOyKJkCAKU1tTXHrZlqVWolUxdhxsfVSj9FmJfFMM9GdICGGa01HyMstYpMIFPJVNDPmYZSTOPoOEKHzNRlKpmWWh1j6TpLa2SKTKVWU6Z+Qolwdm/P9QcPZKa2LH69e9eIMs+WCL/cv2/98CGZPrt61am+V9APq1X89eyZ/968obVYaiXT4dGREgG+vnPHeHgYMsH2+fP+efEihtVKv7SWw/6+9/v7KYLMhIywTJPamvOXLomukyRsrNf+ePzYkpl9dJ3SWgSCSCQCfz5/7pMLF2yfO6eLiAQcHRz4/cmT+HR7O+Ob3d0fNt69+7a2BiICQCJbA0EgE5lpvbXl1OXL3/8Pfax4+6SjSukAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.pastebin {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB1FBMVEUAAAAAAAAAAABWYWwAAABbY3BbYm5dZnFdZXJeZnMEBAQHCAhYYGpdZnFdZnBgaHIlJyomKCooKi09QkdESU5eZGtdYmhdYmleY2lrcXdqb3Rqb3Rqb3SSmJ+SlJeWmJutr7GtrrCWm6ChpKhbW1tmZmZvb290dHR3d3d4eHh5eXl6enp8fHx+gIJ/f3+CgoKDg4OEhISFhYWHh4eKioqKjI2Li4uMjIyOjo6Pj4+QkJCRkZGSkpKUlJSVl5mWlpaYmZqZm52ampqbm5ucnJydnZ2enp6fn5+hoaGioqKkpKSkpaalpaWmp6mmp6qnqauoqKioqquoqq2qqqqrrK2srKysra6srrCsrrGurq6vr6+wsLCxsbGysrKztLa0tLS1t7m2tra3t7e4uLi5ubm6urq7u7u8vLy9vb2+vr7AwMDAwsTBwcHExcfFxcXFxsnGxsbHx8fIyMjJycnMzMzNzc3Ozs7O0NLPz8/Q0NDR0dHR09XT09PV1dXV1dbV1tfV19rW1tbX19fX19jY2tzZ2dnZ2tva2tra3N3a3N7c3Nze3t7f39/f4OHg4ODi4uLl5+jm5ubs7Ozs7e3u7u7v7+/v8PDw8PDx8fHy8vLz8/P29vYSoLMZAAAAJHRSTlMABAUGCwsNHCAiLzMzMzZEYGJwgIuOnJycnqmqq9bc3+/w8fkZ0N/uAAAA/klEQVQoU2NgYGDl5YMDdgYGBmZZ3964CYFtIR3e9Q7K/AwMHI55KfaFmcHWMy3K3MwlGRg4wz0zdYpcorRbNbL0LaWAAp3ts2umV8wo6MupTauQBgqUG03VL7W3sfZSb1erAgm02M+yzYrVCXUy6zapAQlUx/dEdyX3J3ZHVUYVywAF8o2rDNN1Go2jzGLMokAC2QbuSc42mXmaOXop9iAtCXrJ5qXWjT59Abl2ESJAAX/tSIMMiyrrqQ3T6uS5gQK6kSqpqkUermGTexQFmYACflqR+hlWZSamzQpCLEDPsSmVVDT1TJw0JUhOAMRnYOARFRMTE5cQF+ZiBPIAII5B3EVG0b4AAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.soundcloud {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABsklEQVQ4y5WTy2pUQRCGv2rbzDjJeAlIBmOyipGIIJqFEBDElwh4yULGeRFXPoEIBl/AvQ/gC2RnxCAoxijiwks852S6+3dxzslcHJCpTXVX11/Xv0097gLPgVNMJxnQNfX4zsqleWbnpoMf/oa9d988MM9MC/rp+E0a+A0dsVobMNMCOO8B6McRoABJI+A6gJmN3D2A8jgEBCEkSEMBrcrsDAzDWWn3AjgKFaDMmgRqniGFgsaDp1jrLOngDf1XT1D+A1dFc4MKAkkiCVKjjVu7g9+4Rzx4i1u6hjXbuMWr0O5QPNvCu7IaCZwEKQukLGDrm5x8uI0tr6MkiGlkiv7yLfzN+6S5i6QsIMABkEfcxhbWWYMkVAOjxvYAjc3HNHrbKI9VBQBFwF25XQKSBjqIf1YBuAurEMrczgDygD6/x2LCpFLXLUyQ+PoldphhBhYfIX09XU1+Flaukz7uYqs3SHs7cG4BmTsmkBUF9mmXEwa28BNLPaQPLepuNcbGSWQquQC2/Kdcox1FUGkcB0ykck1nA2+wTzMs8stGnP4rbWGw74EuS/GFQWfK7/wF6P4F7fzIAYkdmdEAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.twitchtv {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAYUExURf///2RBpWRBpWRBpWRBpWRBpWRBpf///+zQyUYAAAAGdFJOUwFdZX0lTzs4r5oAAAABYktHRAcWYYjrAAAAB3RJTUUH4AINEi42iSXRNAAAAD1JREFUCNdjYEiDAAZGGIMtjQEEUBlMCWoEGci6mGEMsxQgIy0BiB3AjLS0FAYQIw0kwABipoI1AhkBQBIAFCIXxiHgq80AAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.twitter {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAEsUExURf///1Cf21Gg3FGi31Gh3VKj4FGh3lKj4VKk4lKl41Ol5FOn51Sp6VSo6FOn5lCf21Gg3FGh3VGi31Gi31Gh3lGg3FGg3FGg3FGg3FGh3lGg3FGi31Kk4lKj4FGh3lGi31Kk4lGh3lGg3FGh3lOm5FOm5VGi31Kj4VSo6FGi31Gh3VGg3FKj4FOn51Gi31So6FWr7VOl5FGi31On51Sq6lKk4lOo51Sp6VOm5FSq61Ws7VOn51Oo51Sq61Ol5FOm5FSq61Wr7VOo51On51Sr7FWs7VSp6lGg3FGh3VOm5FWr7VSp6lKj4VOm5FSo6FSr7FWs7VWs7VWr7VSq6lOo51Om5FOo51So6FOm5VOl5FSq61Ws7VSr7FSp6lSp6VWs7lWr7VKk4lSq6v///6E3MNsAAABVdFJOUwAAAAAAAAAAAAAAAAAAAB0Ii+3xnBVTJhfsMKb+qTEp9GwBF/7lLAbo0m4pLkUTdvk2Ev3+EZnOBo/3Z8ffCRzH/D0OqPxiLnvx3UI8m9n1++GwXQZNS29BAAAAAWJLR0QAiAUdSAAAAAd0SU1FB+ACDRIwBwy67tEAAADKSURBVBjTY2BAB4xogIGRH8IQEBQSFhEVE2eQkJQC8ZmkQ8PCI2Rk5RjkIxUUlRgZlVWioqNjYlXVGNQ14iI1tbR14qLj4+MTdJkZ9PQNosJCE0OjgPz4KEMWBiPjhPiEmKQokIJ4E1MmBmazhHg4MGdlYmCzsLSC8ROsmRkZmFht4Eps7ViADmOzd4DyHZ2YmYACTOzOLmATXd04mIBOd/eQ9owFCXh5c7KB/MLi4+vnHxAYFBzCwcYEEmBi5uLm4eHl42RmAnsSAMZBLgZiFUQ5AAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.video {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAxgDGAP8nNqN7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gMZBjQQLEEqGwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAA5SURBVDjLY2AYaMDIwMDwn1JD/lPCZhpwL+B1wf///ykzgBhDiAoDfIYQZQAjIyP5BuDTPJqQqAQAvW0ZAMk8+EEAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.vimeo {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAAIdZUKh6sLlLkLmr4LmsAMp88NrdYVW3MZj7Acstkrt9s1e5E7vN5EfI9JvdtKwuBijp5kpbl30eiDt8aG1uqRr7qTyNehxM+k4PCy3enB3OTg6Ovv9PXw+fz////L9U5WAAAAAXRSTlMAQObYZgAAAIFJREFUeNplz90OwiAMBWAQpAoyxclkP3je/y0H2AQXz0WT8100rRD6kNI9/cRroemQL3hXhoujZYj4OHoAmBvYGcBISwbWBvfXCrytnIDUQMkbsBpagMA7zhtQdyTFQAmIG7IkYniiZuh3XGsPqoOZkMOJOpAcLqUzNFGGu/57fwc1hgtp0mVSyQAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.vine {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAHCUExURQAAAAC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+j////54tRLAAAACUdFJOUwAAAEK+9/e+QQIDAwEqzskfUZmUNHz2mrT++V1w+f5tCanNFUDwfEjtjAyyvg027Hki27QMBJzaHE/1+FkNsN0iZvv6bxyAlB589lQeyud0KB8PQO+ZBUrc+eXgcRG/3CoATe316Wxw/P6BAgBt+fp4IAwh0d4zM9q7Fm76qi605EMSrvfX/PRtAivF9IAJNMLxhA2KYlJ9AAAAAWJLR0SVCGB6gwAAAAd0SU1FB+ACDRI2MOJd7FgAAADrSURBVBjTLY9VWwJgGEPfiYWBha2YYHcHditgd3d3odjdivvBfgK727nYsyPiCrw03j6+fv6AaAMCgyAI1lElJBQSFh6hBxDJqOiY2Lh4SEKiIQlITmFqWrqRJkhGJrOA7Bzm5uUXsBBSVMySUpSVs6KyqrqmFmKuY30D0NjU3NLa1t6h9jvZ1Q30WGi19fb1KzAwyKFhYGSUY+MTkwpMTXNmFpibX+Di0rICWFldW9/A5tb2zu7ePtTrg0MeHePklPYzuDRw7uDF5RWvbwC32O0d7x8en55f4DHF6xv5/vHp6f/k6/vH+evuf1LAObptvSvrAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.vocaroo {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAw9JREFUOE9jYMABuMwYmCyTJKUCGlSnFSy02TTzeOyCiQcDViX26qVz2TAyYtWmEMwuoZ3M7V40LcB79pHkc0svpvzY8jD//87nxf+3Pyn8v/ZO8v+VNyP/2mZJumI1QCWSI8232Hjumitlfw5+qPp/9l8TCt76JP//xkdx/wsXWCzjtWFkwTCkbWFe9plPk/+ga4Txz/xt/D/hkN//gMXif21a+NbyWjIwoRiy6GDT5rP/mlFsPfyp5n/NpOj/22+0gMUXXIz/H7hC/L/bFKFbPDZMrHAD5H35OPt2J9zacDv/f3V7xv9FhwrBGubsT/1//Pjx/1GJ/mD+/nfl/1v3Ovy3KRJNQbHdOlXCvOO03/+pm1P/v3v37n90hhtYw9HPtf8Xb2v937cmHswHeWPRxYj/LvkK3igGKARwicTO07118H3V/5kbi/4vPZMJtK3s/6YH2f+Pfq1B8VbjWrdnMu5s4nAD9CNFhKwz5DTUvLl419zKvAcLtG1P84BRl/b/5M/6/6f/NPzf/qzo84yj0Uus0xUU4Zor54bm9+4OfZG02OCuoAMTb9ZkC9ull1Nvrr2Z+XvRpaRfc65H/68F+jl9svEhzyLFWoccWVc+eyTHq/twydjlKRln7jX9bNMkMJnbhoFRL1xCqmKx6/yi2fYXa/c5/e846PV/5fW0/7OPx/yfcjzop34ulxdGGvDuU8mMXaX507lBuiN6ueadmQeT/p/93vf/1O+G//sP5fw/eL3o/5JLif8zVxs+Tlir9S26UyeFQQvJGBE7FvaFZ9LfN+1y+WjbItSb3GmXvXd15v8zroH/HxgE/D+aGPx/18vi/z07PeZNPRKxe/Kh0Ae8toxscCO4zBkYXArk9C1SxJUYjBkYPPIVtbbuTftz3cz//2O9wP/75iSAXdO72/dt2HL5F6YlfBW4MiJYXMiBiW3t7azHBx+V/t89N+H/8a+1//e9K/9attDp5LQjYX8SuvVL8RoAkmxa65299Erq1FnHo0qrl7t4BddriIs4MrM3rfWcFd+pGwVSAwBZ0bKP8yrZPAAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.youtube {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
"/* XXX Moved to end of stylesheet to avoid breaking whole stylesheet in Maxthon. */\n" +
"@supports (text-decoration-style: dashed) or (-moz-text-decoration-style: dashed) {\n" +
" .quotelink.forwardlink,\n" +
@@ -21883,13 +3802,18839 @@
" text-decoration-style: dashed;\n" +
" border-bottom: none;\n" +
" }\n" +
-"}",
- cssWWW: "#captcha-cnt {\n" +
+"}\n",
+
+report:
+"#g-recaptcha,\n" +
+":root:not(.js-enabled) #captchaContainerAlt {\n" +
" height: auto;\n" +
-"}",
- features: [['Polyfill', Polyfill], ['Normalize URL', NormalizeURL], ['Captcha Configuration', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Edit Link', QR.oekaki.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash], ['Reply Pruning', ReplyPruning]]
+"}\n" +
+"#captchaContainerAlt td:nth-child(2) {\n" +
+" display: table-cell !important;\n" +
+"}\n",
+
+www:
+"#captcha-cnt {\n" +
+" height: auto;\n" +
+"}\n"
+
+};
+
+$ = (function() {
+ var $,
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ $ = function(selector, root) {
+ if (root == null) {
+ root = d.body;
+ }
+ return root.querySelector(selector);
};
- Main.init();
+ $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000)));
+
+ $.id = function(id) {
+ return d.getElementById(id);
+ };
+
+ $.ready = function(fc) {
+ var cb;
+ if (d.readyState !== 'loading') {
+ $.queueTask(fc);
+ return;
+ }
+ cb = function() {
+ $.off(d, 'DOMContentLoaded', cb);
+ return fc();
+ };
+ return $.on(d, 'DOMContentLoaded', cb);
+ };
+
+ $.formData = function(form) {
+ var fd, key, val;
+ if (form instanceof HTMLFormElement) {
+ return new FormData(form);
+ }
+ fd = new FormData();
+ for (key in form) {
+ val = form[key];
+ if (val) {
+ if (typeof val === 'object' && 'newName' in val) {
+ fd.append(key, val, val.newName);
+ } else {
+ fd.append(key, val);
+ }
+ }
+ }
+ return fd;
+ };
+
+ $.extend = function(object, properties) {
+ var key, val;
+ for (key in properties) {
+ val = properties[key];
+ object[key] = val;
+ }
+ };
+
+ $.ajax = (function() {
+ var blockedError, blockedURLs, lastModified;
+ lastModified = {};
+ blockedURLs = {};
+ blockedError = function(url) {
+ var message;
+ if (blockedURLs[url]) {
+ return;
+ }
+ blockedURLs[url] = true;
+ message = $.el('div', {
+ innerHTML: "4chan X was blocked from loading the following URL:
[
More info ]"
+ });
+ $('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
+ return new Notice('warning', message, 30, function() {
+ return delete blockedURLs[url];
+ });
+ };
+ return function(url, options, extra) {
+ var err, event, form, i, len, r, ref, ref1, type, upCallbacks, whenModified;
+ if (options == null) {
+ options = {};
+ }
+ if (extra == null) {
+ extra = {};
+ }
+ type = extra.type, whenModified = extra.whenModified, upCallbacks = extra.upCallbacks, form = extra.form;
+ url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/');
+ r = new XMLHttpRequest();
+ type || (type = form && 'post' || 'get');
+ try {
+ r.open(type, url, true);
+ } catch (_error) {
+ err = _error;
+ blockedError(url);
+ ref = ['error', 'loadend'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ event = ref[i];
+ r["on" + event] = options["on" + event];
+ $.queueTask($.event, event, null, r);
+ }
+ return;
+ }
+ if (whenModified) {
+ if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
+ r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
+ }
+ $.on(r, 'load', function() {
+ return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
+ });
+ }
+ if (/\.json$/.test(url)) {
+ if (options.responseType == null) {
+ options.responseType = 'json';
+ }
+ }
+ $.extend(r, options);
+ if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
+ Object.defineProperty(r, 'response', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return JSON.parse(r.responseText);
+ }
+ });
+ }
+ $.extend(r.upload, upCallbacks);
+ r.send(form);
+ return r;
+ };
+ })();
+
+ (function() {
+ var reqs;
+ reqs = {};
+ $.cache = function(url, cb, options) {
+ var err, req, rm;
+ if (req = reqs[url]) {
+ if (req.readyState === 4) {
+ $.queueTask(function() {
+ return cb.call(req, req.evt, true);
+ });
+ } else {
+ req.callbacks.push(cb);
+ }
+ return req;
+ }
+ rm = function() {
+ return delete reqs[url];
+ };
+ try {
+ if (!(req = $.ajax(url, options))) {
+ return;
+ }
+ } catch (_error) {
+ err = _error;
+ return;
+ }
+ $.on(req, 'load', function(e) {
+ var fn1, i, len, ref;
+ this.evt = e;
+ ref = this.callbacks;
+ fn1 = (function(_this) {
+ return function(cb) {
+ return $.queueTask(function() {
+ return cb.call(_this, e, false);
+ });
+ };
+ })(this);
+ for (i = 0, len = ref.length; i < len; i++) {
+ cb = ref[i];
+ fn1(cb);
+ }
+ return delete this.callbacks;
+ });
+ $.on(req, 'abort error', rm);
+ req.callbacks = [cb];
+ return reqs[url] = req;
+ };
+ return $.cleanCache = function(testf) {
+ var url;
+ for (url in reqs) {
+ if (testf(url)) {
+ delete reqs[url];
+ }
+ }
+ };
+ })();
+
+ $.cb = {
+ checked: function() {
+ $.set(this.name, this.checked);
+ return Conf[this.name] = this.checked;
+ },
+ value: function() {
+ $.set(this.name, this.value.trim());
+ return Conf[this.name] = this.value;
+ }
+ };
+
+ $.asap = function(test, cb) {
+ if (test()) {
+ return cb();
+ } else {
+ return setTimeout($.asap, 25, test, cb);
+ }
+ };
+
+ $.onExists = function(root, selector, cb) {
+ var el, observer;
+ if (el = $(selector, root)) {
+ return cb(el);
+ }
+ if ($.engine === 'edge' && d.readyState === 'loading') {
+ $.asap((function() {
+ return d.readyState !== 'loading' || $(selector, root);
+ }), function() {
+ return $.onExists(root, selector, cb);
+ });
+ return;
+ }
+ observer = new MutationObserver(function() {
+ if (el = $(selector, root)) {
+ observer.disconnect();
+ return cb(el);
+ }
+ });
+ return observer.observe(root, {
+ childList: true,
+ subtree: true
+ });
+ };
+
+ $.addStyle = function(css, id, test) {
+ var style;
+ if (test == null) {
+ test = 'head';
+ }
+ style = $.el('style', {
+ textContent: css
+ });
+ if (id != null) {
+ style.id = id;
+ }
+ $.onExists(doc, test, function() {
+ return $.add(d.head, style);
+ });
+ return style;
+ };
+
+ $.x = function(path, root) {
+ root || (root = d.body);
+ return d.evaluate(path, root, null, 8, null).singleNodeValue;
+ };
+
+ $.X = function(path, root) {
+ root || (root = d.body);
+ return d.evaluate(path, root, null, 7, null);
+ };
+
+ $.addClass = function() {
+ var className, classNames, el, i, len;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (i = 0, len = classNames.length; i < len; i++) {
+ className = classNames[i];
+ el.classList.add(className);
+ }
+ };
+
+ $.rmClass = function() {
+ var className, classNames, el, i, len;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (i = 0, len = classNames.length; i < len; i++) {
+ className = classNames[i];
+ el.classList.remove(className);
+ }
+ };
+
+ $.toggleClass = function(el, className) {
+ return el.classList.toggle(className);
+ };
+
+ $.hasClass = function(el, className) {
+ return indexOf.call(el.classList, className) >= 0;
+ };
+
+ $.rm = function(el) {
+ return el != null ? el.remove() : void 0;
+ };
+
+ $.rmAll = function(root) {
+ return root.textContent = null;
+ };
+
+ $.tn = function(s) {
+ return d.createTextNode(s);
+ };
+
+ $.frag = function() {
+ return d.createDocumentFragment();
+ };
+
+ $.nodes = function(nodes) {
+ var frag, i, len, node;
+ if (!(nodes instanceof Array)) {
+ return nodes;
+ }
+ frag = $.frag();
+ for (i = 0, len = nodes.length; i < len; i++) {
+ node = nodes[i];
+ frag.appendChild(node);
+ }
+ return frag;
+ };
+
+ $.add = function(parent, el) {
+ return parent.appendChild($.nodes(el));
+ };
+
+ $.prepend = function(parent, el) {
+ return parent.insertBefore($.nodes(el), parent.firstChild);
+ };
+
+ $.after = function(root, el) {
+ return root.parentNode.insertBefore($.nodes(el), root.nextSibling);
+ };
+
+ $.before = function(root, el) {
+ return root.parentNode.insertBefore($.nodes(el), root);
+ };
+
+ $.replace = function(root, el) {
+ return root.parentNode.replaceChild($.nodes(el), root);
+ };
+
+ $.el = function(tag, properties, properties2) {
+ var el;
+ el = d.createElement(tag);
+ if (properties) {
+ $.extend(el, properties);
+ }
+ if (properties2) {
+ $.extend(el, properties2);
+ }
+ return el;
+ };
+
+ $.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];
+ el.addEventListener(event, handler, false);
+ }
+ };
+
+ $.off = function(el, events, handler) {
+ var event, i, len, ref;
+ ref = events.split(' ');
+ for (i = 0, len = ref.length; i < len; i++) {
+ event = ref[i];
+ el.removeEventListener(event, handler, false);
+ }
+ };
+
+ $.one = function(el, events, handler) {
+ var cb;
+ cb = function(e) {
+ $.off(el, events, cb);
+ return handler.call(this, e);
+ };
+ return $.on(el, events, cb);
+ };
+
+ $.event = function(event, detail, root) {
+ if (root == null) {
+ root = d;
+ }
+ if ((detail != null) && typeof cloneInto === 'function') {
+ detail = cloneInto(detail, d.defaultView);
+ }
+ return root.dispatchEvent(new CustomEvent(event, {
+ bubbles: true,
+ detail: detail
+ }));
+ };
+
+ (function() {
+ var clone, err, ref, unsafeConstructors;
+ if (!(/PaleMoon\//.test(navigator.userAgent) && +(typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.version) != null ? ref.split('.')[0] : void 0 : void 0) >= 2 && typeof cloneInto === 'undefined')) {
+ return;
+ }
+ try {
+ return new CustomEvent('x', {
+ detail: {}
+ });
+ } catch (_error) {
+ err = _error;
+ unsafeConstructors = {
+ Object: unsafeWindow.Object,
+ Array: unsafeWindow.Array
+ };
+ clone = function(obj) {
+ var constructor, key, obj2, val;
+ if ((obj != null) && typeof obj === 'object' && (constructor = unsafeConstructors[obj.constructor.name])) {
+ obj2 = new constructor();
+ for (key in obj) {
+ val = obj[key];
+ obj2[key] = clone(val);
+ }
+ return obj2;
+ } else {
+ return obj;
+ }
+ };
+ return $.event = function(event, detail, root) {
+ if (root == null) {
+ root = d;
+ }
+ return root.dispatchEvent(new CustomEvent(event, {
+ bubbles: true,
+ detail: clone(detail)
+ }));
+ };
+ }
+ })();
+
+ $.open = typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) {
+ return window.open(url, '_blank');
+ };
+
+ $.debounce = function(wait, fn) {
+ var args, exec, lastCall, that, timeout;
+ lastCall = 0;
+ timeout = null;
+ that = null;
+ args = null;
+ exec = function() {
+ lastCall = Date.now();
+ return fn.apply(that, args);
+ };
+ return function() {
+ args = arguments;
+ that = this;
+ if (lastCall < Date.now() - wait) {
+ return exec();
+ }
+ clearTimeout(timeout);
+ return timeout = setTimeout(exec, wait);
+ };
+ };
+
+ $.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);
+ return func.apply(func, args);
+ };
+ if (window.MessageChannel) {
+ taskChannel = new MessageChannel();
+ taskChannel.port1.onmessage = execTask;
+ return function() {
+ taskQueue.push(arguments);
+ return taskChannel.port2.postMessage(null);
+ };
+ } else {
+ return function() {
+ taskQueue.push(arguments);
+ return setTimeout(execTask, 0);
+ };
+ }
+ })();
+
+ $.globalEval = function(code) {
+ var script;
+ script = $.el('script', {
+ textContent: code
+ });
+ $.add(d.head || doc, script);
+ return $.rm(script);
+ };
+
+ $.global = function(fn) {
+ if (doc) {
+ return $.globalEval("(" + fn + ")();");
+ } else {
+ return fn();
+ }
+ };
+
+ $.bytesToString = function(size) {
+ var unit;
+ unit = 0;
+ while (size >= 1024) {
+ size /= 1024;
+ unit++;
+ }
+ size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size);
+ return size + " " + ['B', 'KB', 'MB', 'GB'][unit];
+ };
+
+ $.minmax = function(value, min, max) {
+ return (value < min ? min : value > max ? max : value);
+ };
+
+ $.hasAudio = function(video) {
+ return video.mozHasAudio || !!video.webkitAudioDecodedByteCount;
+ };
+
+ $.engine = (function() {
+ if (/Edge\//.test(navigator.userAgent)) {
+ return 'edge';
+ }
+ if (/Chrome\//.test(navigator.userAgent)) {
+ return 'blink';
+ }
+ if (/WebKit\//.test(navigator.userAgent)) {
+ return 'webkit';
+ }
+ if (/Gecko\/|Goanna/.test(navigator.userAgent)) {
+ return 'gecko';
+ }
+ })();
+
+ $.platform = 'userscript';
+
+ try {
+ localStorage.getItem('x');
+ $.hasStorage = true;
+ } catch (_error) {
+ $.hasStorage = false;
+ }
+
+ $.item = function(key, val) {
+ var item;
+ item = {};
+ item[key] = val;
+ return item;
+ };
+
+ $.syncing = {};
+
+ if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
+ $.getValue = GM_getValue;
+ $.listValues = function() {
+ return GM_listValues();
+ };
+ } else if ($.hasStorage) {
+ $.getValue = function(key) {
+ return localStorage[key];
+ };
+ $.listValues = function() {
+ var key, results;
+ results = [];
+ for (key in localStorage) {
+ if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
+ results.push(key);
+ }
+ }
+ return results;
+ };
+ } else {
+ $.getValue = function() {};
+ $.listValues = function() {
+ return [];
+ };
+ }
+
+ if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
+ $.setValue = GM_setValue;
+ $.deleteValue = GM_deleteValue;
+ } else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
+ $.oldValue = {};
+ $.setValue = function(key, val) {
+ GM_setValue(key, val);
+ if (key in $.syncing) {
+ $.oldValue[key] = val;
+ if ($.hasStorage) {
+ return localStorage[key] = val;
+ }
+ }
+ };
+ $.deleteValue = function(key) {
+ GM_deleteValue(key);
+ if (key in $.syncing) {
+ delete $.oldValue[key];
+ if ($.hasStorage) {
+ return localStorage.removeItem(key);
+ }
+ }
+ };
+ if (!$.hasStorage) {
+ $.cantSync = true;
+ }
+ } else if ($.hasStorage) {
+ $.oldValue = {};
+ $.setValue = function(key, val) {
+ if (key in $.syncing) {
+ $.oldValue[key] = val;
+ }
+ return localStorage[key] = val;
+ };
+ $.deleteValue = function(key) {
+ if (key in $.syncing) {
+ delete $.oldValue[key];
+ }
+ return localStorage.removeItem(key);
+ };
+ } else {
+ $.setValue = function() {};
+ $.deleteValue = function() {};
+ $.cantSync = $.cantSet = true;
+ }
+
+ if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
+ $.sync = function(key, cb) {
+ return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) {
+ if (remote) {
+ if (newValue !== void 0) {
+ newValue = JSON.parse(newValue);
+ }
+ return cb(newValue, key);
+ }
+ });
+ };
+ $.forceSync = function() {};
+ } else if ((typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) || $.hasStorage) {
+ $.sync = function(key, cb) {
+ key = g.NAMESPACE + key;
+ $.syncing[key] = cb;
+ return $.oldValue[key] = $.getValue(key);
+ };
+ (function() {
+ var onChange;
+ onChange = function(arg) {
+ var cb, key, newValue;
+ key = arg.key, newValue = arg.newValue;
+ if (!(cb = $.syncing[key])) {
+ return;
+ }
+ if (newValue != null) {
+ if (newValue === $.oldValue[key]) {
+ return;
+ }
+ $.oldValue[key] = newValue;
+ return cb(JSON.parse(newValue), key.slice(g.NAMESPACE.length));
+ } else {
+ if ($.oldValue[key] == null) {
+ return;
+ }
+ delete $.oldValue[key];
+ return cb(void 0, key.slice(g.NAMESPACE.length));
+ }
+ };
+ $.on(window, 'storage', onChange);
+ return $.forceSync = function(key) {
+ key = g.NAMESPACE + key;
+ return onChange({
+ key: key,
+ newValue: $.getValue(key)
+ });
+ };
+ })();
+ } else {
+ $.sync = function() {};
+ $.forceSync = function() {};
+ }
+
+ $["delete"] = function(keys) {
+ var i, key, len;
+ if (!(keys instanceof Array)) {
+ keys = [keys];
+ }
+ for (i = 0, len = keys.length; i < len; i++) {
+ key = keys[i];
+ $.deleteValue(g.NAMESPACE + key);
+ }
+ };
+
+ $.get = function(key, val, cb) {
+ var items;
+ if (typeof cb === 'function') {
+ items = $.item(key, val);
+ } else {
+ items = key;
+ cb = val;
+ }
+ return $.queueTask(function() {
+ for (key in items) {
+ if (val = $.getValue(g.NAMESPACE + key)) {
+ items[key] = JSON.parse(val);
+ }
+ }
+ return cb(items);
+ });
+ };
+
+ $.set = function(keys, val, cb) {
+ var key, value;
+ if (typeof keys === 'string') {
+ $.setValue(g.NAMESPACE + keys, JSON.stringify(val));
+ } else {
+ for (key in keys) {
+ value = keys[key];
+ $.setValue(g.NAMESPACE + key, JSON.stringify(value));
+ }
+ cb = val;
+ }
+ return typeof cb === "function" ? cb() : void 0;
+ };
+
+ $.clear = function(cb) {
+ var id;
+ $["delete"](Object.keys(Conf));
+ $["delete"](['previousversion', 'AutoWatch', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']);
+ $["delete"]((function() {
+ var i, len, ref, results;
+ ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
+ results = [];
+ for (i = 0, len = ref.length; i < len; i++) {
+ id = ref[i];
+ results.push(id + ".position");
+ }
+ return results;
+ })());
+ try {
+ $["delete"]($.listValues().map(function(key) {
+ return key.replace(g.NAMESPACE, '');
+ }));
+ } catch (_error) {}
+ return typeof cb === "function" ? cb() : void 0;
+ };
+
+ return $;
+
+}).call(this);
+
+$$ = (function() {
+ var slice = [].slice;
+
+ return function(selector, root) {
+ if (root == null) {
+ root = d.body;
+ }
+ return slice.call(root.querySelectorAll(selector));
+ };
+
+}).call(this);
+
+CrossOrigin = (function() {
+ var CrossOrigin;
+
+ CrossOrigin = {
+ binary: function(url, cb, headers) {
+ var options, ref, workaround;
+ if (headers == null) {
+ headers = {};
+ }
+ url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/');
+ workaround = $.engine === 'gecko' && (typeof GM_info !== "undefined" && GM_info !== null) && /^[0-2]\.|^3\.[01](?!\d)/.test(GM_info.version);
+ workaround || (workaround = /PaleMoon\//.test(navigator.userAgent));
+ workaround || (workaround = (typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.script) != null ? ref.includeJSB : void 0 : void 0) != null);
+ options = {
+ method: "GET",
+ url: url,
+ headers: headers,
+ onload: function(xhr) {
+ var contentDisposition, contentType, data, i, r, ref1, ref2;
+ if (workaround) {
+ r = xhr.responseText;
+ data = new Uint8Array(r.length);
+ i = 0;
+ while (i < r.length) {
+ data[i] = r.charCodeAt(i);
+ i++;
+ }
+ } else {
+ data = new Uint8Array(xhr.response);
+ }
+ if (typeof xhr.responseHeaders === 'object') {
+ contentType = xhr.responseHeaders['Content-Type'];
+ contentDisposition = xhr.responseHeaders['Content-Disposition'];
+ } else {
+ contentType = (ref1 = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0;
+ contentDisposition = (ref2 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0;
+ }
+ return cb(data, contentType, contentDisposition);
+ },
+ onerror: function() {
+ return cb(null);
+ },
+ onabort: function() {
+ return cb(null);
+ }
+ };
+ if (workaround) {
+ options.overrideMimeType = options.mimeType = 'text/plain; charset=x-user-defined';
+ } else {
+ options.responseType = 'arraybuffer';
+ }
+ return GM_xmlhttpRequest(options);
+ },
+ file: function(url, cb) {
+ return CrossOrigin.binary(url, function(data, contentType, contentDisposition) {
+ var blob, match, mime, name, ref, ref1, ref2, ref3;
+ if (data == null) {
+ return cb(null);
+ }
+ name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0;
+ mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream';
+ match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0);
+ if (match) {
+ name = match.replace(/\\"/g, '"');
+ }
+ if ((typeof GM_info !== "undefined" && GM_info !== null ? (ref3 = GM_info.script) != null ? ref3.includeJSB : void 0 : void 0) != null) {
+ mime = QR.typeFromExtension[name.match(/[^.]*$/)[0].toLowerCase()] || 'application/octet-stream';
+ }
+ blob = new Blob([data], {
+ type: mime
+ });
+ blob.name = name;
+ return cb(blob);
+ });
+ },
+ json: (function() {
+ var callbacks, responses;
+ callbacks = {};
+ responses = {};
+ return function(url, cb) {
+ if (responses[url]) {
+ cb(responses[url]);
+ return;
+ }
+ if (callbacks[url]) {
+ callbacks[url].push(cb);
+ return;
+ }
+ callbacks[url] = [cb];
+ return GM_xmlhttpRequest({
+ method: "GET",
+ url: url + '',
+ onload: function(xhr) {
+ var j, len, ref, response;
+ response = JSON.parse(xhr.responseText);
+ ref = callbacks[url];
+ for (j = 0, len = ref.length; j < len; j++) {
+ cb = ref[j];
+ cb(response);
+ }
+ delete callbacks[url];
+ return responses[url] = response;
+ },
+ onerror: function() {
+ return delete callbacks[url];
+ },
+ onabort: function() {
+ return delete callbacks[url];
+ }
+ });
+ };
+ })()
+ };
+
+ return CrossOrigin;
+
+}).call(this);
+
+Board = (function() {
+ var Board;
+
+ Board = (function() {
+ Board.prototype.toString = function() {
+ return this.ID;
+ };
+
+ function Board(ID) {
+ this.ID = ID;
+ this.threads = new SimpleDict();
+ this.posts = new SimpleDict();
+ g.boards[this] = this;
+ }
+
+ return Board;
+
+ })();
+
+ return Board;
+
+}).call(this);
+
+Callbacks = (function() {
+ var Callbacks;
+
+ Callbacks = (function() {
+ Callbacks.Post = new Callbacks('Post');
+
+ Callbacks.Thread = new Callbacks('Thread');
+
+ Callbacks.CatalogThread = new Callbacks('Catalog Thread');
+
+ function Callbacks(type) {
+ this.type = type;
+ this.keys = [];
+ }
+
+ Callbacks.prototype.push = function(arg) {
+ var cb, name;
+ name = arg.name, cb = arg.cb;
+ if (!this[name]) {
+ this.keys.push(name);
+ }
+ return this[name] = cb;
+ };
+
+ Callbacks.prototype.execute = function(node, keys) {
+ var err, errors, i, len, name, ref;
+ if (keys == null) {
+ keys = this.keys;
+ }
+ for (i = 0, len = keys.length; i < len; i++) {
+ name = keys[i];
+ try {
+ if ((ref = this[name]) != null) {
+ ref.call(node);
+ }
+ } catch (_error) {
+ err = _error;
+ if (!errors) {
+ errors = [];
+ }
+ errors.push({
+ message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''),
+ error: err
+ });
+ }
+ }
+ if (errors) {
+ return Main.handleErrors(errors);
+ }
+ };
+
+ return Callbacks;
+
+ })();
+
+ return Callbacks;
+
+}).call(this);
+
+CatalogThread = (function() {
+ var CatalogThread;
+
+ CatalogThread = (function() {
+ CatalogThread.prototype.toString = function() {
+ return this.ID;
+ };
+
+ function CatalogThread(root, thread) {
+ this.thread = thread;
+ this.ID = this.thread.ID;
+ this.board = this.thread.board;
+ this.nodes = {
+ root: root,
+ thumb: $('.catalog-thumb', root),
+ icons: $('.catalog-icons', root),
+ postCount: $('.post-count', root),
+ fileCount: $('.file-count', root),
+ pageCount: $('.page-count', root),
+ comment: $('.comment', root)
+ };
+ this.thread.catalogView = this;
+ }
+
+ return CatalogThread;
+
+ })();
+
+ return CatalogThread;
+
+}).call(this);
+
+Connection = (function() {
+ var Connection,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+ Connection = (function() {
+ function Connection(target, origin, cb) {
+ this.target = target;
+ this.origin = origin;
+ this.cb = cb != null ? cb : {};
+ this.onMessage = bind(this.onMessage, this);
+ this.send = bind(this.send, this);
+ $.on(window, 'message', this.onMessage);
+ }
+
+ Connection.prototype.targetWindow = function() {
+ if (this.target instanceof window.HTMLIFrameElement) {
+ return this.target.contentWindow;
+ } else {
+ return this.target;
+ }
+ };
+
+ Connection.prototype.send = function(data) {
+ return this.targetWindow().postMessage("" + g.NAMESPACE + (JSON.stringify(data)), this.origin);
+ };
+
+ Connection.prototype.onMessage = function(e) {
+ var base, data, type, value;
+ if (!(e.source === this.targetWindow() && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) {
+ return;
+ }
+ data = JSON.parse(e.data.slice(g.NAMESPACE.length));
+ for (type in data) {
+ value = data[type];
+ if (typeof (base = this.cb)[type] === "function") {
+ base[type](value);
+ }
+ }
+ };
+
+ return Connection;
+
+ })();
+
+ return Connection;
+
+}).call(this);
+
+DataBoard = (function() {
+ var DataBoard,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+ DataBoard = (function() {
+ DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'customTitles'];
+
+ function DataBoard(key, sync, dontClean) {
+ var init;
+ this.key = key;
+ this.onSync = bind(this.onSync, this);
+ this.data = Conf[this.key];
+ $.sync(this.key, this.onSync);
+ if (!dontClean) {
+ this.clean();
+ }
+ if (!sync) {
+ return;
+ }
+ init = (function(_this) {
+ return function() {
+ $.off(d, '4chanXInitFinished', init);
+ return _this.sync = sync;
+ };
+ })(this);
+ $.on(d, '4chanXInitFinished', init);
+ }
+
+ DataBoard.prototype.save = function(cb) {
+ return $.set(this.key, this.data, cb);
+ };
+
+ DataBoard.prototype["delete"] = function(arg) {
+ var boardID, postID, ref, threadID;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
+ $.forceSync(this.key);
+ if (postID) {
+ if (!((ref = this.data.boards[boardID]) != null ? ref[threadID] : void 0)) {
+ return;
+ }
+ delete this.data.boards[boardID][threadID][postID];
+ this.deleteIfEmpty({
+ boardID: boardID,
+ threadID: threadID
+ });
+ } else if (threadID) {
+ if (!this.data.boards[boardID]) {
+ return;
+ }
+ delete this.data.boards[boardID][threadID];
+ this.deleteIfEmpty({
+ boardID: boardID
+ });
+ } else {
+ delete this.data.boards[boardID];
+ }
+ return this.save();
+ };
+
+ DataBoard.prototype.deleteIfEmpty = function(arg) {
+ var boardID, threadID;
+ boardID = arg.boardID, threadID = arg.threadID;
+ $.forceSync(this.key);
+ if (threadID) {
+ if (!Object.keys(this.data.boards[boardID][threadID]).length) {
+ delete this.data.boards[boardID][threadID];
+ return this.deleteIfEmpty({
+ boardID: boardID
+ });
+ }
+ } else if (!Object.keys(this.data.boards[boardID]).length) {
+ return delete this.data.boards[boardID];
+ }
+ };
+
+ DataBoard.prototype.set = function(arg, cb) {
+ var base, base1, base2, boardID, postID, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val;
+ $.forceSync(this.key);
+ if (postID !== void 0) {
+ ((base = ((base1 = this.data.boards)[boardID] || (base1[boardID] = {})))[threadID] || (base[threadID] = {}))[postID] = val;
+ } else if (threadID !== void 0) {
+ ((base2 = this.data.boards)[boardID] || (base2[boardID] = {}))[threadID] = val;
+ } else {
+ this.data.boards[boardID] = val;
+ }
+ return this.save(cb);
+ };
+
+ DataBoard.prototype.get = function(arg) {
+ var ID, board, boardID, defaultValue, i, len, postID, thread, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue;
+ if (board = this.data.boards[boardID]) {
+ if (threadID == null) {
+ if (postID != null) {
+ for (thread = i = 0, len = board.length; i < len; thread = ++i) {
+ ID = board[thread];
+ if (postID in thread) {
+ val = thread[postID];
+ break;
+ }
+ }
+ } else {
+ val = board;
+ }
+ } else if (thread = board[threadID]) {
+ val = postID != null ? thread[postID] : thread;
+ }
+ }
+ return val || defaultValue;
+ };
+
+ DataBoard.prototype.forceSync = function() {
+ return $.forceSync(this.key);
+ };
+
+ DataBoard.prototype.clean = function() {
+ var boardID, now, ref, val;
+ $.forceSync(this.key);
+ ref = this.data.boards;
+ for (boardID in ref) {
+ val = ref[boardID];
+ this.deleteIfEmpty({
+ boardID: boardID
+ });
+ }
+ now = Date.now();
+ if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) {
+ this.data.lastChecked = now;
+ for (boardID in this.data.boards) {
+ this.ajaxClean(boardID);
+ }
+ }
+ };
+
+ DataBoard.prototype.ajaxClean = function(boardID) {
+ return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) {
+ return function(e1) {
+ var ref;
+ if ((ref = e1.target.status) !== 200 && ref !== 404) {
+ return;
+ }
+ return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
+ var ref1;
+ if ((ref1 = e2.target.status) !== 200 && ref1 !== 404) {
+ return;
+ }
+ return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
+ });
+ };
+ })(this));
+ };
+
+ DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
+ var ID, board, i, j, k, len, len1, len2, page, ref, thread, threads;
+ if (!(board = this.data.boards[boardID])) {
+ return;
+ }
+ threads = {};
+ if (response1) {
+ for (i = 0, len = response1.length; i < len; i++) {
+ page = response1[i];
+ ref = page.threads;
+ for (j = 0, len1 = ref.length; j < len1; j++) {
+ thread = ref[j];
+ ID = thread.no;
+ if (ID in board) {
+ threads[ID] = board[ID];
+ }
+ }
+ }
+ }
+ if (response2) {
+ for (k = 0, len2 = response2.length; k < len2; k++) {
+ ID = response2[k];
+ if (ID in board) {
+ threads[ID] = board[ID];
+ }
+ }
+ }
+ this.data.boards[boardID] = threads;
+ this.deleteIfEmpty({
+ boardID: boardID
+ });
+ return this.save();
+ };
+
+ DataBoard.prototype.onSync = function(data) {
+ this.data = data || {
+ boards: {}
+ };
+ return typeof this.sync === "function" ? this.sync() : void 0;
+ };
+
+ return DataBoard;
+
+ })();
+
+ return DataBoard;
+
+}).call(this);
+
+Fetcher = (function() {
+ var Fetcher,
+ slice = [].slice;
+
+ Fetcher = (function() {
+ function Fetcher(boardID1, threadID, postID1, root, quoter) {
+ var post;
+ this.boardID = boardID1;
+ this.threadID = threadID;
+ this.postID = postID1;
+ this.root = root;
+ this.quoter = quoter;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
+ this.insert(post);
+ return;
+ }
+ this.root.textContent = "Loading post No." + this.postID + "...";
+ if (this.threadID) {
+ $.cache("//a.4cdn.org/" + this.boardID + "/thread/" + this.threadID + ".json", (function(_this) {
+ return function(e, isCached) {
+ return _this.fetchedPost(e.target, isCached);
+ };
+ })(this));
+ } else {
+ this.archivedPost();
+ }
+ }
+
+ Fetcher.prototype.insert = function(post) {
+ var boardID, clone, k, len, nodes, postID, quote, ref, ref1;
+ if (!this.root.parentNode) {
+ return;
+ }
+ clone = post.addClone(this.quoter.context, $.hasClass(this.root, 'dialog'));
+ Main.callbackNodes('Post', [clone]);
+ nodes = clone.nodes;
+ $.rmAll(nodes.root);
+ $.add(nodes.root, nodes.post);
+ ref = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks));
+ for (k = 0, len = ref.length; k < len; k++) {
+ quote = ref[k];
+ ref1 = Get.postDataFromLink(quote), boardID = ref1.boardID, postID = ref1.postID;
+ if (postID === this.quoter.ID && boardID === this.quoter.board.ID) {
+ $.addClass(quote, 'forwardlink');
+ }
+ }
+ $.rmAll(this.root);
+ $.add(this.root, nodes.root);
+ return $.event('PostsInserted');
+ };
+
+ Fetcher.prototype.fetchedPost = function(req, isCached) {
+ var api, board, k, len, post, posts, status, thread;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
+ this.insert(post);
+ return;
+ }
+ status = req.status;
+ if (status !== 200 && status !== 304) {
+ if (this.archivedPost()) {
+ return;
+ }
+ $.addClass(this.root, 'warning');
+ this.root.textContent = status === 404 ? "Thread No." + this.threadID + " 404'd." : "Error " + req.statusText + " (" + req.status + ").";
+ return;
+ }
+ posts = req.response.posts;
+ Build.spoilerRange[this.boardID] = posts[0].custom_spoiler;
+ for (k = 0, len = posts.length; k < len; k++) {
+ post = posts[k];
+ if (post.no === this.postID) {
+ break;
+ }
+ }
+ if (post.no !== this.postID) {
+ if (isCached) {
+ api = "//a.4cdn.org/" + this.boardID + "/thread/" + this.threadID + ".json";
+ $.cleanCache(function(url) {
+ return url === api;
+ });
+ $.cache(api, (function(_this) {
+ return function(e) {
+ return _this.fetchedPost(e.target, false);
+ };
+ })(this));
+ return;
+ }
+ if (this.archivedPost()) {
+ return;
+ }
+ $.addClass(this.root, 'warning');
+ this.root.textContent = "Post No." + this.postID + " was not found.";
+ return;
+ }
+ board = g.boards[this.boardID] || new Board(this.boardID);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ post = new Post(Build.postFromObject(post, this.boardID), thread, board);
+ post.isFetchedQuote = true;
+ Main.callbackNodes('Post', [post]);
+ return this.insert(post);
+ };
+
+ Fetcher.prototype.archivedPost = function() {
+ var archive, url;
+ if (!Conf['Resurrect Quotes']) {
+ return false;
+ }
+ if (!(url = Redirect.to('post', {
+ boardID: this.boardID,
+ postID: this.postID
+ }))) {
+ return false;
+ }
+ archive = Redirect.data.post[this.boardID];
+ if (/^https:\/\//.test(url) || location.protocol === 'http:') {
+ $.cache(url, (function(_this) {
+ return function(e) {
+ return _this.parseArchivedPost(e.target.response, url, archive);
+ };
+ })(this), {
+ responseType: 'json',
+ withCredentials: archive.withCredentials
+ });
+ return true;
+ } else if (Conf['Exempt Archives from Encryption']) {
+ CrossOrigin.json(url, (function(_this) {
+ return function(response) {
+ var key, media, ref;
+ media = response.media;
+ if (media) {
+ for (key in media) {
+ if (/_link$/.test(key)) {
+ if (!((ref = media[key]) != null ? ref.match(/^http:\/\//) : void 0)) {
+ delete media[key];
+ }
+ }
+ }
+ }
+ return _this.parseArchivedPost(response, url, archive);
+ };
+ })(this));
+ return true;
+ }
+ return false;
+ };
+
+ Fetcher.prototype.parseArchivedPost = function(data, url, archive) {
+ var board, comment, greentext, i, j, key, o, post, ref, ref1, text, text2, thread, val;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
+ this.insert(post);
+ return;
+ }
+ if (data == null) {
+ $.addClass(this.root, 'warning');
+ this.root.textContent = "Error fetching Post No." + this.postID + " from " + archive.name + ".";
+ return;
+ }
+ if (data.error) {
+ $.addClass(this.root, 'warning');
+ this.root.textContent = data.error;
+ return;
+ }
+ comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned)\])/);
+ comment = (function() {
+ var k, len, results;
+ results = [];
+ for (i = k = 0, len = comment.length; k < len; i = ++k) {
+ text = comment[i];
+ if (i % 2 === 1) {
+ results.push(this.archiveTags[text]);
+ } else {
+ greentext = text[0] === '>';
+ text = text.replace(/(\[\/?[a-z]+):lit(\])/g, '$1$2');
+ text = (function() {
+ var l, len1, ref, results1;
+ ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
+ results1 = [];
+ for (j = l = 0, len1 = ref.length; l < len1; j = ++l) {
+ text2 = ref[j];
+ results1.push({
+ innerHTML: ((j % 2) ? "
" + E(text2) + " " : E(text2))
+ });
+ }
+ return results1;
+ })();
+ text = {
+ innerHTML: ((greentext) ? "
" + E.cat(text) + " " : E.cat(text))
+ };
+ results.push(text);
+ }
+ }
+ return results;
+ }).call(this);
+ comment = {
+ innerHTML: E.cat(comment)
+ };
+ this.threadID = +data.thread_num;
+ o = {
+ postID: this.postID,
+ threadID: this.threadID,
+ boardID: this.boardID,
+ isReply: this.postID !== this.threadID
+ };
+ o.info = {
+ subject: data.title,
+ email: data.email,
+ name: data.name || '',
+ tripcode: data.trip,
+ capcode: (function() {
+ switch (data.capcode) {
+ case 'M':
+ return 'Mod';
+ case 'A':
+ return 'Admin';
+ case 'D':
+ return 'Developer';
+ }
+ })(),
+ uniqueID: data.poster_hash,
+ flagCode: data.poster_country,
+ flag: data.poster_country_name,
+ dateUTC: data.timestamp,
+ dateText: data.fourchan_date,
+ commentHTML: comment
+ };
+ if (o.info.capcode) {
+ delete o.info.uniqueID;
+ }
+ if ((ref = data.media) != null ? ref.media_filename : void 0) {
+ ref1 = data.media;
+ for (key in ref1) {
+ val = ref1[key];
+ if (/_link$/.test(key) && (val != null ? val[0] : void 0) === '/') {
+ data.media[key] = url.split('/', 3).join('/') + val;
+ }
+ }
+ o.file = {
+ name: data.media.media_filename,
+ url: data.media.media_link || data.media.remote_media_link || (location.protocol + "//i.4cdn.org/" + this.boardID + "/" + (encodeURIComponent(data.media[this.boardID === 'f' ? 'media_filename' : 'media_orig']))),
+ height: data.media.media_h,
+ width: data.media.media_w,
+ MD5: data.media.media_hash,
+ size: $.bytesToString(data.media.media_size),
+ thumbURL: data.media.thumb_link || (location.protocol + "//i.4cdn.org/" + this.boardID + "/" + data.media.preview_orig),
+ theight: data.media.preview_h,
+ twidth: data.media.preview_w,
+ isSpoiler: data.media.spoiler === '1'
+ };
+ if (!/\.pdf$/.test(o.file.url)) {
+ o.file.dimensions = o.file.width + "x" + o.file.height;
+ }
+ if (this.boardID === 'f' && data.media.exif) {
+ o.file.tag = JSON.parse(data.media.exif).Tag;
+ }
+ }
+ board = g.boards[this.boardID] || new Board(this.boardID);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ post = new Post(Build.post(o), thread, board);
+ post.kill();
+ if (post.file) {
+ post.file.thumbURL = o.file.thumbURL;
+ }
+ post.isFetchedQuote = true;
+ Main.callbackNodes('Post', [post]);
+ return this.insert(post);
+ };
+
+ Fetcher.prototype.archiveTags = {
+ '\n': {
+ innerHTML: "
"
+ },
+ '[b]': {
+ innerHTML: "
"
+ },
+ '[/b]': {
+ innerHTML: " "
+ },
+ '[spoiler]': {
+ innerHTML: "
"
+ },
+ '[/spoiler]': {
+ innerHTML: " "
+ },
+ '[code]': {
+ innerHTML: "
"
+ },
+ '[/code]': {
+ innerHTML: " "
+ },
+ '[moot]': {
+ innerHTML: "
"
+ },
+ '[/moot]': {
+ innerHTML: "
"
+ },
+ '[banned]': {
+ innerHTML: "
"
+ },
+ '[/banned]': {
+ innerHTML: " "
+ }
+ };
+
+ return Fetcher;
+
+ })();
+
+ return Fetcher;
+
+}).call(this);
+
+Notice = (function() {
+ var Notice,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+ Notice = (function() {
+ function Notice(type, content, timeout, onclose) {
+ this.timeout = timeout;
+ this.onclose = onclose;
+ this.close = bind(this.close, this);
+ this.add = bind(this.add, this);
+ this.el = $.el('div', {
+ innerHTML: "
"
+ });
+ this.el.style.opacity = 0;
+ this.setType(type);
+ $.on(this.el.firstElementChild, 'click', this.close);
+ if (typeof content === 'string') {
+ content = $.tn(content);
+ }
+ $.add(this.el.lastElementChild, content);
+ $.ready(this.add);
+ }
+
+ Notice.prototype.setType = function(type) {
+ return this.el.className = "notification " + type;
+ };
+
+ Notice.prototype.add = function() {
+ if (this.closed) {
+ return;
+ }
+ if (d.hidden) {
+ $.on(d, 'visibilitychange', this.add);
+ return;
+ }
+ $.off(d, 'visibilitychange', this.add);
+ $.add(Header.noticesRoot, this.el);
+ this.el.clientHeight;
+ this.el.style.opacity = 1;
+ if (this.timeout) {
+ return setTimeout(this.close, this.timeout * $.SECOND);
+ }
+ };
+
+ Notice.prototype.close = function() {
+ this.closed = true;
+ $.off(d, 'visibilitychange', this.add);
+ $.rm(this.el);
+ return typeof this.onclose === "function" ? this.onclose() : void 0;
+ };
+
+ return Notice;
+
+ })();
+
+ return Notice;
+
+}).call(this);
+
+Post = (function() {
+ var Post,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Post = (function() {
+ Post.prototype.toString = function() {
+ return this.ID;
+ };
+
+ function Post(root, thread, board) {
+ var capcode, clone, date, email, flag, info, j, len, name, post, ref, subject, tripcode, uniqueID;
+ this.thread = thread;
+ this.board = board;
+ this.ID = +root.id.slice(2);
+ this.fullID = this.board + "." + this.ID;
+ this.context = this;
+ root.dataset.fullID = this.fullID;
+ post = $('.post', root);
+ info = $('.postInfo', post);
+ this.nodes = {
+ root: root,
+ post: post,
+ info: info,
+ nameBlock: $('.nameBlock', info),
+ quote: $('.postNum > a:nth-of-type(2)', info),
+ comment: $('.postMessage', post),
+ links: [],
+ quotelinks: []
+ };
+ if ($.engine === 'edge') {
+ Object.defineProperty(this.nodes, 'backlinks', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return info.getElementsByClassName('backlink');
+ }
+ });
+ } else {
+ this.nodes.backlinks = info.getElementsByClassName('backlink');
+ }
+ if (!(this.isReply = $.hasClass(post, 'reply'))) {
+ this.thread.OP = this;
+ this.thread.isArchived = !!$('.archivedIcon', info);
+ this.thread.isSticky = !!$('.stickyIcon', info);
+ this.thread.isClosed = this.thread.isArchived || !!$('.closedIcon', info);
+ if (this.thread.isArchived) {
+ this.thread.kill();
+ }
+ }
+ this.info = {};
+ this.info.nameBlock = Conf['Anonymize'] ? 'Anonymous' : this.nodes.nameBlock.textContent.trim();
+ if (subject = $('.subject', info)) {
+ this.nodes.subject = subject;
+ this.info.subject = subject.textContent || void 0;
+ }
+ if (name = $('.name', info)) {
+ this.nodes.name = name;
+ this.info.name = name.textContent;
+ }
+ if (email = $('.useremail', info)) {
+ this.nodes.email = email;
+ this.info.email = decodeURIComponent(email.href.slice(7));
+ }
+ if (tripcode = $('.postertrip', info)) {
+ this.nodes.tripcode = tripcode;
+ this.info.tripcode = tripcode.textContent;
+ }
+ if (uniqueID = $('.posteruid', info)) {
+ this.nodes.uniqueID = uniqueID;
+ this.info.uniqueID = uniqueID.firstElementChild.textContent;
+ }
+ if (capcode = $('.capcode.hand', info)) {
+ this.nodes.capcode = capcode;
+ this.info.capcode = capcode.textContent.replace('## ', '');
+ }
+ if (flag = $('.flag, .countryFlag', info)) {
+ this.nodes.flag = flag;
+ this.info.flag = flag.title;
+ }
+ if (date = $('.dateTime', info)) {
+ this.nodes.date = date;
+ this.info.date = new Date(date.dataset.utc * 1000);
+ }
+ this.parseComment();
+ this.parseQuotes();
+ this.parseFile();
+ this.isDead = false;
+ this.isHidden = false;
+ this.clones = [];
+ if (g.posts[this.fullID]) {
+ this.isRebuilt = true;
+ this.clones = g.posts[this.fullID].clones;
+ ref = this.clones;
+ for (j = 0, len = ref.length; j < len; j++) {
+ clone = ref[j];
+ clone.origin = this;
+ }
+ }
+ this.board.posts.push(this.ID, this);
+ this.thread.posts.push(this.ID, this);
+ g.posts.push(this.fullID, this);
+ }
+
+ Post.prototype.parseComment = function() {
+ var abbr, bq, commentDisplay, j, k, len, len1, node, ref, spoilers;
+ this.nodes.comment.normalize();
+ bq = this.nodes.comment.cloneNode(true);
+ ref = $$('.abbr + br, .exif, b, .fortune', bq);
+ for (j = 0, len = ref.length; j < len; j++) {
+ node = ref[j];
+ $.rm(node);
+ }
+ if (abbr = $('.abbr', bq)) {
+ $.rm(abbr);
+ }
+ this.info.comment = this.nodesToText(bq);
+ if (abbr) {
+ this.info.comment = this.info.comment.replace(/\n\n$/, '');
+ }
+ commentDisplay = this.info.comment;
+ if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) {
+ spoilers = $$('s', bq);
+ if (spoilers.length) {
+ for (k = 0, len1 = spoilers.length; k < len1; k++) {
+ node = spoilers[k];
+ $.replace(node, $.tn('[spoiler]'));
+ }
+ commentDisplay = this.nodesToText(bq);
+ }
+ }
+ return this.info.commentDisplay = commentDisplay.trim().replace(/\s+$/gm, '');
+ };
+
+ Post.prototype.nodesToText = function(bq) {
+ var i, node, nodes, text;
+ text = "";
+ nodes = $.X('.//br|.//text()', bq);
+ i = 0;
+ while (node = nodes.snapshotItem(i++)) {
+ text += node.data || '\n';
+ }
+ return text;
+ };
+
+ Post.prototype.parseQuotes = function() {
+ var j, len, quotelink, ref;
+ this.quotes = [];
+ ref = $$(':not(pre) > .quotelink', this.nodes.comment);
+ for (j = 0, len = ref.length; j < len; j++) {
+ quotelink = ref[j];
+ this.parseQuote(quotelink);
+ }
+ };
+
+ Post.prototype.parseQuote = function(quotelink) {
+ var fullID, match;
+ match = quotelink.href.match(/^https?:\/\/boards\.4chan\.org\/+([^\/]+)\/+(?:res|thread)\/+\d+(?:\/[^#]*)?#p(\d+)$/);
+ if (!(match || (this.isClone && quotelink.dataset.postID))) {
+ return;
+ }
+ this.nodes.quotelinks.push(quotelink);
+ if (this.isClone) {
+ return;
+ }
+ fullID = match[1] + "." + match[2];
+ if (indexOf.call(this.quotes, fullID) < 0) {
+ return this.quotes.push(fullID);
+ }
+ };
+
+ Post.prototype.parseFile = function() {
+ var fileEl, fileText, info, link, m, ref, ref1, ref2, size, thumb, unit;
+ if (!(fileEl = $('.file', this.nodes.post))) {
+ return;
+ }
+ if (!(link = $('.fileText > a, .fileText-original > a', fileEl))) {
+ return;
+ }
+ if (!(info = (ref = link.nextSibling) != null ? ref.textContent.match(/\(([\d.]+ [KMG]?B).*\)/) : void 0)) {
+ return;
+ }
+ fileText = fileEl.firstElementChild;
+ this.file = {
+ text: fileText,
+ link: link,
+ url: link.href,
+ name: fileText.title || link.title || link.textContent,
+ size: info[1],
+ isImage: /(jpg|png|gif)$/i.test(link.href),
+ isVideo: /webm$/i.test(link.href),
+ dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0,
+ tag: (ref2 = info[0].match(/,[^,]*, ([a-z]+)\)/i)) != null ? ref2[1] : void 0
+ };
+ size = +this.file.size.match(/[\d.]+/)[0];
+ unit = ['B', 'KB', 'MB', 'GB'].indexOf(this.file.size.match(/\w+$/)[0]);
+ while (unit-- > 0) {
+ size *= 1024;
+ }
+ this.file.sizeInBytes = size;
+ if ((thumb = $('.fileThumb > [data-md5]', fileEl))) {
+ return $.extend(this.file, {
+ thumb: thumb,
+ thumbURL: (m = link.href.match(/\d+(?=\.\w+$)/)) ? location.protocol + "//i.4cdn.org/" + this.board + "/" + m[0] + "s.jpg" : void 0,
+ MD5: thumb.dataset.md5,
+ isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler')
+ });
+ }
+ };
+
+ Post.prototype.kill = function(file) {
+ var clone, j, k, len, len1, quotelink, ref, ref1, strong;
+ if (file) {
+ if (this.isDead || this.file.isDead) {
+ return;
+ }
+ this.file.isDead = true;
+ $.addClass(this.nodes.root, 'deleted-file');
+ } else {
+ if (this.isDead) {
+ return;
+ }
+ this.isDead = true;
+ $.rmClass(this.nodes.root, 'deleted-file');
+ $.addClass(this.nodes.root, 'deleted-post');
+ }
+ if (!(strong = $('strong.warning', this.nodes.info))) {
+ strong = $.el('strong', {
+ className: 'warning'
+ });
+ $.after($('input', this.nodes.info), strong);
+ }
+ strong.textContent = file ? '[File deleted]' : '[Deleted]';
+ if (this.isClone) {
+ return;
+ }
+ ref = this.clones;
+ for (j = 0, len = ref.length; j < len; j++) {
+ clone = ref[j];
+ clone.kill(file);
+ }
+ if (file) {
+ return;
+ }
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ quotelink = ref1[k];
+ if (!(!$.hasClass(quotelink, 'deadlink'))) {
+ continue;
+ }
+ quotelink.textContent = quotelink.textContent + '\u00A0(Dead)';
+ $.addClass(quotelink, 'deadlink');
+ }
+ };
+
+ Post.prototype.resurrect = function() {
+ var clone, j, k, len, len1, quotelink, ref, ref1, strong;
+ this.isDead = false;
+ $.rmClass(this.nodes.root, 'deleted-post');
+ strong = $('strong.warning', this.nodes.info);
+ if (this.file && this.file.isDead) {
+ strong.textContent = '[File deleted]';
+ } else {
+ $.rm(strong);
+ }
+ if (this.isClone) {
+ return;
+ }
+ ref = this.clones;
+ for (j = 0, len = ref.length; j < len; j++) {
+ clone = ref[j];
+ clone.resurrect();
+ }
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ quotelink = ref1[k];
+ if (!($.hasClass(quotelink, 'deadlink'))) {
+ continue;
+ }
+ quotelink.textContent = quotelink.textContent.replace('\u00A0(Dead)', '');
+ $.rmClass(quotelink, 'deadlink');
+ }
+ };
+
+ Post.prototype.collect = function() {
+ g.posts.rm(this.fullID);
+ this.thread.posts.rm(this);
+ return this.board.posts.rm(this);
+ };
+
+ Post.prototype.addClone = function(context, contractThumb) {
+ return new Post.Clone(this, context, contractThumb);
+ };
+
+ Post.prototype.rmClone = function(index) {
+ var clone, j, len, ref;
+ this.clones.splice(index, 1);
+ ref = this.clones.slice(index);
+ for (j = 0, len = ref.length; j < len; j++) {
+ clone = ref[j];
+ clone.nodes.root.dataset.clone = index++;
+ }
+ };
+
+ return Post;
+
+ })();
+
+ return Post;
+
+}).call(this);
+
+(function() {
+ var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty,
+ slice = [].slice;
+
+ Post.Clone = (function(superClass) {
+ extend(_Class, superClass);
+
+ _Class.prototype.isClone = true;
+
+ function _Class(origin, context, contractThumb) {
+ var base, file, i, info, inline, inlined, j, k, key, l, len, len1, len2, len3, node, nodes, post, ref, ref1, ref2, ref3, ref4, ref5, root, val;
+ this.origin = origin;
+ this.context = context;
+ ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ key = ref[i];
+ this[key] = this.origin[key];
+ }
+ nodes = this.origin.nodes;
+ root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true);
+ (base = Post.Clone).prefix || (base.prefix = 0);
+ ref1 = [root].concat(slice.call($$('[id]', root)));
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ node = ref1[j];
+ node.id = Post.Clone.prefix + node.id;
+ }
+ Post.Clone.prefix++;
+ post = $('.post', root);
+ info = $('.postInfo', post);
+ this.nodes = {
+ root: root,
+ post: post,
+ info: info,
+ nameBlock: $('.nameBlock', info),
+ quote: $('.postNum > a:nth-of-type(2)', info),
+ comment: $('.postMessage', post),
+ quotelinks: []
+ };
+ if ($.engine === 'edge') {
+ Object.defineProperty(this.nodes, 'backlinks', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return info.getElementsByClassName('backlink');
+ }
+ });
+ } else {
+ this.nodes.backlinks = info.getElementsByClassName('backlink');
+ }
+ ref2 = $$('.inline', post);
+ for (k = 0, len2 = ref2.length; k < len2; k++) {
+ inline = ref2[k];
+ $.rm(inline);
+ }
+ ref3 = $$('.inlined', post);
+ for (l = 0, len3 = ref3.length; l < len3; l++) {
+ inlined = ref3[l];
+ $.rmClass(inlined, 'inlined');
+ }
+ root.hidden = false;
+ $.rmClass(root, 'forwarded');
+ $.rmClass(post, 'highlight');
+ if (nodes.subject) {
+ this.nodes.subject = $('.subject', info);
+ }
+ if (nodes.name) {
+ this.nodes.name = $('.name', info);
+ }
+ if (nodes.email) {
+ this.nodes.email = $('.useremail', info);
+ }
+ if (nodes.tripcode) {
+ this.nodes.tripcode = $('.postertrip', info);
+ }
+ if (nodes.uniqueID) {
+ this.nodes.uniqueID = $('.posteruid', info);
+ }
+ if (nodes.capcode) {
+ this.nodes.capcode = $('.capcode.hand', info);
+ }
+ if (nodes.flag) {
+ this.nodes.flag = $('.flag, .countryFlag', info);
+ }
+ if (nodes.date) {
+ this.nodes.date = $('.dateTime', info);
+ }
+ this.parseQuotes();
+ this.quotes = slice.call(this.origin.quotes);
+ if (this.origin.file) {
+ this.file = {};
+ ref4 = this.origin.file;
+ for (key in ref4) {
+ val = ref4[key];
+ this.file[key] = val;
+ }
+ file = $('.file', post);
+ this.file.text = file.firstElementChild;
+ this.file.link = $('.fileText > a, .fileText-original', file);
+ this.file.thumb = $('.fileThumb > [data-md5]', file);
+ this.file.fullImage = $('.full-image', file);
+ this.file.videoControls = $('.video-controls', this.file.text);
+ if (this.file.videoThumb) {
+ this.file.thumb.muted = true;
+ }
+ if ((ref5 = this.file.thumb) != null ? ref5.dataset.src : void 0) {
+ this.file.thumb.src = this.file.thumb.dataset.src;
+ this.file.thumb.removeAttribute('data-src');
+ }
+ if (this.file.thumb && contractThumb) {
+ ImageExpand.contract(this);
+ }
+ }
+ if (this.origin.isDead) {
+ this.isDead = true;
+ }
+ root.dataset.clone = this.origin.clones.push(this) - 1;
+ }
+
+ _Class.prototype.cloneWithoutVideo = function(node) {
+ var child, clone, i, len, ref;
+ if (node.tagName === 'VIDEO' && !node.dataset.md5) {
+ return [];
+ } else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) {
+ clone = node.cloneNode(false);
+ ref = node.childNodes;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ $.add(clone, this.cloneWithoutVideo(child));
+ }
+ return clone;
+ } else {
+ return node.cloneNode(true);
+ }
+ };
+
+ return _Class;
+
+ })(Post);
+
+}).call(this);
+
+RandomAccessList = (function() {
+ var RandomAccessList;
+
+ RandomAccessList = (function() {
+ function RandomAccessList(items) {
+ var i, item, len;
+ this.length = 0;
+ if (items) {
+ for (i = 0, len = items.length; i < len; i++) {
+ item = items[i];
+ this.push(item);
+ }
+ }
+ }
+
+ RandomAccessList.prototype.push = function(data) {
+ var ID, item, last;
+ ID = data.ID;
+ ID || (ID = data.id);
+ if (this[ID]) {
+ return;
+ }
+ last = this.last;
+ this[ID] = item = {
+ prev: last,
+ next: null,
+ data: data,
+ ID: ID
+ };
+ item.prev = last;
+ this.last = last ? last.next = item : this.first = item;
+ return this.length++;
+ };
+
+ RandomAccessList.prototype.before = function(root, item) {
+ var prev;
+ if (item.next === root || item === root) {
+ return;
+ }
+ this.rmi(item);
+ prev = root.prev;
+ root.prev = item;
+ item.next = root;
+ item.prev = prev;
+ if (prev) {
+ return prev.next = item;
+ } else {
+ return this.first = item;
+ }
+ };
+
+ RandomAccessList.prototype.after = function(root, item) {
+ var next;
+ if (item.prev === root || item === root) {
+ return;
+ }
+ this.rmi(item);
+ next = root.next;
+ root.next = item;
+ item.prev = root;
+ item.next = next;
+ if (next) {
+ return next.prev = item;
+ } else {
+ return this.last = item;
+ }
+ };
+
+ RandomAccessList.prototype.prepend = function(item) {
+ var first;
+ first = this.first;
+ if (item === first || !this[item.ID]) {
+ return;
+ }
+ this.rmi(item);
+ item.next = first;
+ if (first) {
+ first.prev = item;
+ } else {
+ this.last = item;
+ }
+ this.first = item;
+ return delete item.prev;
+ };
+
+ RandomAccessList.prototype.shift = function() {
+ return this.rm(this.first.ID);
+ };
+
+ RandomAccessList.prototype.order = function() {
+ var item, order;
+ order = [item = this.first];
+ while (item = item.next) {
+ order.push(item);
+ }
+ return order;
+ };
+
+ RandomAccessList.prototype.rm = function(ID) {
+ var item;
+ item = this[ID];
+ if (!item) {
+ return;
+ }
+ delete this[ID];
+ this.length--;
+ this.rmi(item);
+ delete item.next;
+ return delete item.prev;
+ };
+
+ RandomAccessList.prototype.rmi = function(item) {
+ var next, prev;
+ prev = item.prev, next = item.next;
+ if (prev) {
+ prev.next = next;
+ } else {
+ this.first = next;
+ }
+ if (next) {
+ return next.prev = prev;
+ } else {
+ return this.last = prev;
+ }
+ };
+
+ return RandomAccessList;
+
+ })();
+
+ return RandomAccessList;
+
+}).call(this);
+
+ShimSet = (function() {
+ var ShimSet;
+
+ ShimSet = (function() {
+ function ShimSet() {
+ this.elements = {};
+ this.size = 0;
+ }
+
+ ShimSet.prototype.has = function(value) {
+ return value in this.elements;
+ };
+
+ ShimSet.prototype.add = function(value) {
+ if (this.elements[value]) {
+ return;
+ }
+ this.elements[value] = true;
+ return this.size++;
+ };
+
+ ShimSet.prototype["delete"] = function(value) {
+ if (!this.elements[value]) {
+ return;
+ }
+ delete this.elements[value];
+ return this.size--;
+ };
+
+ return ShimSet;
+
+ })();
+
+ if (!('Set' in window)) {
+ window.Set = ShimSet;
+ }
+
+ return ShimSet;
+
+}).call(this);
+
+SimpleDict = (function() {
+ var SimpleDict,
+ slice = [].slice;
+
+ SimpleDict = (function() {
+ function SimpleDict() {
+ this.keys = [];
+ }
+
+ SimpleDict.prototype.push = function(key, data) {
+ key = "" + key;
+ if (!this[key]) {
+ this.keys.push(key);
+ }
+ return this[key] = data;
+ };
+
+ SimpleDict.prototype.rm = function(key) {
+ var i;
+ key = "" + key;
+ if ((i = this.keys.indexOf(key)) !== -1) {
+ this.keys.splice(i, 1);
+ return delete this[key];
+ }
+ };
+
+ SimpleDict.prototype.forEach = function(fn) {
+ var j, key, len, ref;
+ ref = slice.call(this.keys);
+ for (j = 0, len = ref.length; j < len; j++) {
+ key = ref[j];
+ fn(this[key]);
+ }
+ };
+
+ return SimpleDict;
+
+ })();
+
+ return SimpleDict;
+
+}).call(this);
+
+Thread = (function() {
+ var Thread;
+
+ Thread = (function() {
+ Thread.prototype.toString = function() {
+ return this.ID;
+ };
+
+ function Thread(ID, board) {
+ this.ID = ID;
+ this.board = board;
+ this.fullID = this.board + "." + this.ID;
+ this.posts = new SimpleDict();
+ this.isDead = false;
+ this.isHidden = false;
+ this.isOnTop = false;
+ this.isSticky = false;
+ this.isClosed = false;
+ this.isArchived = false;
+ this.postLimit = false;
+ this.fileLimit = false;
+ this.ipCount = void 0;
+ this.OP = null;
+ this.catalogView = null;
+ this.board.threads.push(this.ID, this);
+ g.threads.push(this.fullID, this);
+ }
+
+ Thread.prototype.setPage = function(pageNum) {
+ var icon, info, quote, ref;
+ ref = this.OP.nodes, info = ref.info, quote = ref.quote;
+ if (!(icon = $('.page-num', info))) {
+ icon = $.el('span', {
+ className: 'page-num'
+ });
+ $.after(quote, [$.tn(' '), icon]);
+ }
+ icon.title = "This thread is on page " + pageNum + " in the original index.";
+ icon.textContent = "[" + pageNum + "]";
+ if (this.catalogView) {
+ return this.catalogView.nodes.pageCount.textContent = pageNum;
+ }
+ };
+
+ Thread.prototype.setCount = function(type, count, reachedLimit) {
+ var el;
+ if (!this.catalogView) {
+ return;
+ }
+ el = this.catalogView.nodes[type + "Count"];
+ el.textContent = count;
+ return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning');
+ };
+
+ Thread.prototype.setStatus = function(type, status) {
+ var name;
+ name = "is" + type;
+ if (this[name] === status) {
+ return;
+ }
+ this[name] = status;
+ if (!this.OP) {
+ return;
+ }
+ this.setIcon('Sticky', this.isSticky);
+ this.setIcon('Closed', this.isClosed && !this.isArchived);
+ return this.setIcon('Archived', this.isArchived);
+ };
+
+ Thread.prototype.setIcon = function(type, status) {
+ var icon, root, typeLC;
+ typeLC = type.toLowerCase();
+ icon = $("." + typeLC + "Icon", this.OP.nodes.info);
+ if (!!icon === status) {
+ return;
+ }
+ if (!status) {
+ $.rm(icon.previousSibling);
+ $.rm(icon);
+ if (this.catalogView) {
+ $.rm($("." + typeLC + "Icon", this.catalogView.nodes.icons));
+ }
+ return;
+ }
+ icon = $.el('img', {
+ src: "" + Build.staticPath + typeLC + Build.gifIcon,
+ alt: type,
+ title: type,
+ className: typeLC + "Icon retina"
+ });
+ root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote;
+ $.after(root, [$.tn(' '), icon]);
+ if (!this.catalogView) {
+ return;
+ }
+ return (type === 'Sticky' && this.isClosed ? $.prepend : $.add)(this.catalogView.nodes.icons, icon.cloneNode());
+ };
+
+ Thread.prototype.kill = function() {
+ return this.isDead = true;
+ };
+
+ Thread.prototype.collect = function() {
+ this.posts.forEach(function(post) {
+ return post.collect();
+ });
+ g.threads.rm(this.fullID);
+ return this.board.threads.rm(this);
+ };
+
+ return Thread;
+
+ })();
+
+ return Thread;
+
+}).call(this);
+
+Redirect = (function() {
+ var Redirect,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Redirect = {
+ init: function() {
+ var archive, archives, boardID, boards, data, files, i, id, j, len, len1, name, o, record, ref, ref1, software, type, uid, withCredentials;
+ o = {
+ thread: {},
+ post: {},
+ file: {},
+ report: {}
+ };
+ archives = {};
+ ref = Redirect.archives;
+ for (i = 0, len = ref.length; i < len; i++) {
+ data = ref[i];
+ uid = data.uid, name = data.name, boards = data.boards, files = data.files, software = data.software, withCredentials = data.withCredentials;
+ archives[JSON.stringify(uid != null ? uid : name)] = data;
+ for (j = 0, len1 = boards.length; j < len1; j++) {
+ boardID = boards[j];
+ if (!withCredentials) {
+ if (!(boardID in o.thread)) {
+ o.thread[boardID] = data;
+ }
+ if (!(boardID in o.post || software !== 'foolfuuka')) {
+ o.post[boardID] = data;
+ }
+ if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) {
+ o.file[boardID] = data;
+ }
+ }
+ if (name === 'fgts') {
+ o.report[boardID] = data;
+ }
+ }
+ }
+ ref1 = Conf['selectedArchives'];
+ for (boardID in ref1) {
+ record = ref1[boardID];
+ for (type in record) {
+ id = record[type];
+ if (id === null) {
+ delete o[type][boardID];
+ } else if (archive = archives[JSON.stringify(id)]) {
+ boards = type === 'file' ? archive.files : archive.boards;
+ if (indexOf.call(boards, boardID) >= 0) {
+ o[type][boardID] = archive;
+ }
+ }
+ }
+ }
+ return Redirect.data = o;
+ },
+ archives: [
+ { "uid": 3, "name": "4plebs", "domain": "archive.4plebs.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "adv", "f", "hr", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ], "files": [ "adv", "f", "hr", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ] },
+ { "uid": 4, "name": "Nyafuu Archive", "domain": "archive.nyafuu.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "c", "e", "news", "w", "wg", "wsr" ], "files": [ "c", "e", "news", "w", "wg", "wsr" ] },
+ { "uid": 8, "name": "Rebecca Black Tech", "domain": "rbt.asia", "http": false, "https": true, "software": "fuuka", "boards": [ "cgl", "g", "mu" ], "files": [ "cgl", "g", "mu" ] },
+ { "uid": 10, "name": "warosu", "domain": "warosu.org", "http": false, "https": true, "software": "fuuka", "boards": [ "3", "biz", "cgl", "ck", "diy", "fa", "g", "ic", "jp", "lit", "sci", "tg", "vr" ], "files": [ "3", "biz", "cgl", "ck", "diy", "fa", "g", "ic", "jp", "lit", "sci", "tg", "vr" ] },
+ { "uid": 15, "name": "fgts", "domain": "fgts.jp", "http": true, "https": true, "software": "foolfuuka", "boards": [ "asp", "b", "cm", "gd", "h", "hc", "hm", "n", "out", "p", "po", "qa", "r", "s", "soc", "toy", "vp", "y" ], "files": [ "asp", "b", "cm", "gd", "h", "hc", "hm", "n", "out", "p", "po", "qa", "r", "s", "soc", "toy", "vp", "y" ] },
+ { "uid": 23, "name": "Desustorage", "domain": "desustorage.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "a", "aco", "an", "c", "co", "d", "fit", "gif", "his", "int", "k", "m", "mlp", "qa", "r9k", "tg", "trash", "vr", "wsg" ], "files": [ "a", "aco", "an", "c", "co", "d", "fit", "gif", "his", "int", "k", "m", "mlp", "qa", "r9k", "tg", "trash", "vr", "wsg" ] },
+ { "uid": 24, "name": "fireden.net", "domain": "boards.fireden.net", "http": false, "https": true, "software": "foolfuuka", "boards": [ "a", "cm", "ic", "sci", "tg", "v", "vg", "y" ], "files": [ "a", "cm", "ic", "sci", "tg", "v", "vg", "y" ] },
+ { "uid": 25, "name": "arch.b4k.co", "domain": "arch.b4k.co", "http": true, "https": true, "software": "foolfuuka", "boards": [ "g", "jp", "mlp", "v" ], "files": [] },
+ { "uid": 5, "name": "Love is Over", "domain": "deploy.loveisover.me", "http": true, "https": false, "software": "foolfuuka", "boards": [ "c", "d", "e", "i", "lgbt", "t", "u" ], "files": [ "c", "d", "e", "i", "lgbt", "t", "u" ], "search": [] },
+ { "uid": 28, "name": "bstats", "domain": "archive.b-stats.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "f", "cm", "hm", "lgbt", "news", "trash", "y" ], "files": [] }
+ ],
+ to: function(dest, data) {
+ var archive;
+ archive = (dest === 'search' || dest === 'board' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
+ if (!archive) {
+ return '';
+ }
+ return Redirect[dest](archive, data);
+ },
+ protocol: function(archive) {
+ var protocol;
+ protocol = location.protocol;
+ if (!archive[protocol.slice(0, -1)]) {
+ protocol = protocol === 'https:' ? 'http:' : 'https:';
+ }
+ return protocol + "//";
+ },
+ 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') {
+ path += '/';
+ }
+ if (threadID && postID) {
+ path += archive.software === 'foolfuuka' ? "#" + postID : "#p" + postID;
+ }
+ return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
+ },
+ post: function(archive, arg) {
+ var boardID, postID, protocol, url;
+ boardID = arg.boardID, postID = arg.postID;
+ protocol = Redirect.protocol(archive);
+ url = "" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID;
+ if (!Redirect.securityCheck(url)) {
+ return '';
+ }
+ return url;
+ },
+ file: function(archive, arg) {
+ var boardID, filename;
+ boardID = arg.boardID, filename = arg.filename;
+ return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
+ },
+ board: function(archive, arg) {
+ var boardID;
+ boardID = arg.boardID;
+ return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/";
+ },
+ 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;
+ if (type === 'capcode') {
+ value = {
+ 'Developer': 'dev'
+ }[value] || value.toLowerCase();
+ } else if (type === 'image') {
+ value = value.replace(/[+\/=]/g, function(c) {
+ return {
+ '+': '-',
+ '/': '_',
+ '=': ''
+ }[c];
+ });
+ }
+ value = encodeURIComponent(value);
+ path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value + "/" : type === 'image' ? boardID + "/image/" + value : boardID + "/?task=search2&search_" + type + "=" + value;
+ return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
+ },
+ report: function(archive, arg) {
+ var boardID, postID;
+ boardID = arg.boardID, postID = arg.postID;
+ return "https://so.fgts.jp/report/?board=" + boardID + "&no=" + postID;
+ },
+ securityCheck: function(url) {
+ return /^https:\/\//.test(url) || location.protocol === 'http:' || Conf['Exempt Archives from Encryption'];
+ },
+ navigate: function(dest, data, alternative) {
+ var url;
+ if (!Redirect.data) {
+ Redirect.init();
+ }
+ url = Redirect.to(dest, data);
+ if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) {
+ return location.replace(url);
+ } else if (alternative) {
+ return location.replace(alternative);
+ }
+ }
+ };
+
+ return Redirect;
+
+}).call(this);
+
+Anonymize = (function() {
+ var Anonymize;
+
+ Anonymize = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Anonymize'])) {
+ return;
+ }
+ if (g.VIEW === 'archive') {
+ return this.archive();
+ }
+ return Callbacks.Post.push({
+ name: 'Anonymize',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var email, name, ref, tripcode;
+ if (this.info.capcode || this.isClone) {
+ return;
+ }
+ ref = this.nodes, name = ref.name, tripcode = ref.tripcode, email = ref.email;
+ if (this.info.name !== 'Anonymous') {
+ name.textContent = 'Anonymous';
+ }
+ if (tripcode) {
+ $.rm(tripcode);
+ delete this.nodes.tripcode;
+ }
+ if (this.info.email) {
+ $.replace(email, name);
+ return delete this.nodes.email;
+ }
+ },
+ archive: function() {
+ return $.ready(function() {
+ var i, j, len, len1, name, ref, ref1, trip;
+ ref = $$('.name');
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ name.textContent = 'Anonymous';
+ }
+ ref1 = $$('.postertrip');
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ trip = ref1[j];
+ $.rm(trip);
+ }
+ });
+ }
+ };
+
+ return Anonymize;
+
+}).call(this);
+
+Filter = (function() {
+ var Filter,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Filter = {
+ filters: {},
+ init: function() {
+ var boards, err, excludes, filter, hl, i, key, len, line, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, regexp, stub, top;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
+ return;
+ }
+ if (!Conf['Filtered Backlinks']) {
+ $.addClass(doc, 'hide-backlinks');
+ }
+ for (key in Config.filter) {
+ this.filters[key] = [];
+ ref1 = Conf[key].split('\n');
+ for (i = 0, len = ref1.length; i < len; i++) {
+ line = ref1[i];
+ if (line[0] === '#') {
+ continue;
+ }
+ if (!(regexp = line.match(/\/(.+)\/(\w*)/))) {
+ continue;
+ }
+ filter = line.replace(regexp[0], '');
+ boards = ((ref2 = filter.match(/boards:([^;]+)/)) != null ? ref2[1].toLowerCase() : void 0) || 'global';
+ boards = boards === 'global' ? null : boards.split(',');
+ if (boards === null) {
+ excludes = ((ref3 = filter.match(/exclude:([^;]+)/)) != null ? ref3[1].toLowerCase().split(',') : void 0) || null;
+ }
+ if (key === 'uniqueID' || key === 'MD5') {
+ regexp = regexp[1];
+ } else {
+ try {
+ regexp = RegExp(regexp[1], regexp[2]);
+ } catch (_error) {
+ err = _error;
+ new Notice('warning', [$.tn("Invalid " + key + " filter:"), $.el('br'), $.tn(line), $.el('br'), $.tn(err.message)], 60);
+ continue;
+ }
+ }
+ op = ((ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? ref4[1] : void 0) || 'yes';
+ stub = (function() {
+ var ref5;
+ switch ((ref5 = filter.match(/stub:(yes|no)/)) != null ? ref5[1] : void 0) {
+ case 'yes':
+ return true;
+ case 'no':
+ return false;
+ default:
+ return Conf['Stubs'];
+ }
+ })();
+ if (hl = /highlight/.test(filter)) {
+ hl = ((ref5 = filter.match(/highlight:([\w-]+)/)) != null ? ref5[1] : void 0) || 'filter-highlight';
+ top = ((ref6 = filter.match(/top:(yes|no)/)) != null ? ref6[1] : void 0) || 'yes';
+ top = top === 'yes';
+ }
+ this.filters[key].push(this.createFilter(regexp, boards, excludes, op, stub, hl, top));
+ }
+ if (!this.filters[key].length) {
+ delete this.filters[key];
+ }
+ }
+ if (!Object.keys(this.filters).length) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Filter',
+ cb: this.node
+ });
+ },
+ createFilter: function(regexp, boards, excludes, op, stub, hl, top) {
+ var settings, test;
+ test = typeof regexp === 'string' ? function(value) {
+ return regexp === value;
+ } : function(value) {
+ return regexp.test(value);
+ };
+ settings = {
+ hide: !hl,
+ stub: stub,
+ "class": hl,
+ top: top
+ };
+ return function(value, boardID, isReply) {
+ if (boards && indexOf.call(boards, boardID) < 0) {
+ return false;
+ }
+ if (excludes && indexOf.call(excludes, boardID) >= 0) {
+ return false;
+ }
+ if (isReply && op === 'only' || !isReply && op === 'no') {
+ return false;
+ }
+ if (!test(value)) {
+ return false;
+ }
+ return settings;
+ };
+ },
+ node: function() {
+ var filter, i, key, len, ref, ref1, result, value;
+ if (this.isClone) {
+ return;
+ }
+ for (key in Filter.filters) {
+ if ((value = Filter[key](this)) != null) {
+ ref = Filter.filters[key];
+ for (i = 0, len = ref.length; i < len; i++) {
+ filter = ref[i];
+ if (!(result = filter(value, this.board.ID, this.isReply))) {
+ continue;
+ }
+ if (result.hide && !this.isFetchedQuote) {
+ if (this.isReply) {
+ PostHiding.hide(this, result.stub);
+ } else if (g.VIEW === 'index') {
+ ThreadHiding.hide(this.thread, result.stub);
+ } else {
+ continue;
+ }
+ return;
+ }
+ $.addClass(this.nodes.root, result["class"]);
+ if (!(this.highlights && (ref1 = result["class"], indexOf.call(this.highlights, ref1) >= 0))) {
+ (this.highlights || (this.highlights = [])).push(result["class"]);
+ }
+ if (!this.isReply && result.top) {
+ this.thread.isOnTop = true;
+ }
+ }
+ }
+ }
+ },
+ isHidden: function(post) {
+ var filter, i, key, len, ref, result, value;
+ for (key in Filter.filters) {
+ if ((value = Filter[key](post)) != null) {
+ ref = Filter.filters[key];
+ for (i = 0, len = ref.length; i < len; i++) {
+ filter = ref[i];
+ if (result = filter(value, post.boardID, post.isReply)) {
+ if (result.hide) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ },
+ postID: function(post) {
+ var ref;
+ return "" + ((ref = post.ID) != null ? ref : post.postID);
+ },
+ name: function(post) {
+ return post.info.name;
+ },
+ uniqueID: function(post) {
+ return post.info.uniqueID;
+ },
+ tripcode: function(post) {
+ return post.info.tripcode;
+ },
+ capcode: function(post) {
+ return post.info.capcode;
+ },
+ subject: function(post) {
+ return post.info.subject;
+ },
+ comment: function(post) {
+ var base;
+ return (base = post.info).comment != null ? base.comment : base.comment = Build.parseComment(post.info.commentHTML.innerHTML);
+ },
+ flag: function(post) {
+ return post.info.flag;
+ },
+ filename: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.name : void 0;
+ },
+ dimensions: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.dimensions : void 0;
+ },
+ filesize: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.size : void 0;
+ },
+ MD5: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.MD5 : void 0;
+ },
+ menu: {
+ init: function() {
+ var div, entry, i, len, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
+ return;
+ }
+ div = $.el('div', {
+ textContent: 'Filter'
+ });
+ entry = {
+ el: div,
+ order: 50,
+ open: function(post) {
+ Filter.menu.post = post;
+ return true;
+ },
+ subEntries: []
+ };
+ ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ type = ref1[i];
+ entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1]));
+ }
+ return Menu.menu.addEntry(entry);
+ },
+ createSubEntry: function(text, type) {
+ var el;
+ el = $.el('a', {
+ href: 'javascript:;',
+ textContent: text
+ });
+ el.dataset.type = type;
+ $.on(el, 'click', Filter.menu.makeFilter);
+ return {
+ el: el,
+ open: function(post) {
+ var value;
+ value = Filter[type](post);
+ return value != null;
+ }
+ };
+ },
+ makeFilter: function() {
+ var re, type, value;
+ type = this.dataset.type;
+ value = Filter[type](Filter.menu.post);
+ re = type === 'uniqueID' || type === 'MD5' ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
+ if (c === '\n') {
+ return '\\n';
+ } else if (c === '\\') {
+ return '\\\\';
+ } else {
+ return "\\" + c;
+ }
+ });
+ re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
+ return $.get(type, Conf[type], function(item) {
+ var save, section, select, ta, tl;
+ save = item[type];
+ save = save ? save + "\n" + re : re;
+ $.set(type, save);
+ Settings.open('Filter');
+ section = $('.section-container');
+ select = $('select[name=filter]', section);
+ select.value = type;
+ Settings.selectFilter.call(select);
+ ta = $('textarea', section);
+ tl = ta.textLength;
+ ta.setSelectionRange(tl, tl);
+ return ta.focus();
+ });
+ }
+ }
+ };
+
+ return Filter;
+
+}).call(this);
+
+PostHiding = (function() {
+ var PostHiding;
+
+ PostHiding = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
+ return;
+ }
+ if (Conf['Reply Hiding Buttons']) {
+ $.addClass(doc, "reply-hide");
+ }
+ this.db = new DataBoard('hiddenPosts');
+ return Callbacks.Post.push({
+ name: 'Reply Hiding',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var data, sideArrows;
+ if (!this.isReply || this.isClone || this.isFetchedQuote) {
+ return;
+ }
+ if (data = PostHiding.db.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ })) {
+ if (data.thisPost) {
+ PostHiding.hide(this, data.makeStub, data.hideRecursively);
+ } else {
+ Recursive.apply(PostHiding.hide, this, data.makeStub, true);
+ Recursive.add(PostHiding.hide, this, data.makeStub, true);
+ }
+ }
+ if (!Conf['Reply Hiding Buttons']) {
+ return;
+ }
+ sideArrows = $('.sideArrows', this.nodes.root);
+ $.replace(sideArrows.firstChild, PostHiding.makeButton(this, 'hide'));
+ return sideArrows.removeAttribute('class');
+ },
+ menu: {
+ init: function() {
+ var apply, div, hideStubLink, makeStub, ref, replies, thisPost;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
+ return;
+ }
+ div = $.el('div', {
+ className: 'hide-reply-link',
+ textContent: 'Hide'
+ });
+ apply = $.el('a', {
+ textContent: 'Apply',
+ href: 'javascript:;'
+ });
+ $.on(apply, 'click', PostHiding.menu.hide);
+ thisPost = UI.checkbox('thisPost', 'This post', true);
+ replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']);
+ makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']);
+ Menu.menu.addEntry({
+ el: div,
+ order: 20,
+ open: function(post) {
+ if (!post.isReply || post.isClone || post.isHidden) {
+ return false;
+ }
+ PostHiding.menu.post = post;
+ return true;
+ },
+ subEntries: [
+ {
+ el: apply
+ }, {
+ el: thisPost
+ }, {
+ el: replies
+ }, {
+ el: makeStub
+ }
+ ]
+ });
+ div = $.el('div', {
+ className: 'show-reply-link',
+ textContent: 'Show'
+ });
+ apply = $.el('a', {
+ textContent: 'Apply',
+ href: 'javascript:;'
+ });
+ $.on(apply, 'click', PostHiding.menu.show);
+ thisPost = UI.checkbox('thisPost', 'This post', false);
+ replies = UI.checkbox('replies', 'Show replies', false);
+ hideStubLink = $.el('a', {
+ textContent: 'Hide stub',
+ href: 'javascript:;'
+ });
+ $.on(hideStubLink, 'click', PostHiding.menu.hideStub);
+ Menu.menu.addEntry({
+ el: div,
+ order: 20,
+ open: function(post) {
+ var data;
+ if (!post.isReply || post.isClone || !post.isHidden) {
+ return false;
+ }
+ if (!(data = PostHiding.db.get({
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ }))) {
+ return false;
+ }
+ PostHiding.menu.post = post;
+ thisPost.firstChild.checked = post.isHidden;
+ replies.firstChild.checked = (data != null ? data.hideRecursively : void 0) != null ? data.hideRecursively : Conf['Recursive Hiding'];
+ return true;
+ },
+ subEntries: [
+ {
+ el: apply
+ }, {
+ el: thisPost
+ }, {
+ el: replies
+ }
+ ]
+ });
+ return Menu.menu.addEntry({
+ el: hideStubLink,
+ order: 15,
+ open: function(post) {
+ var data;
+ if (!post.isReply || post.isClone || !post.isHidden) {
+ return false;
+ }
+ if (!(data = PostHiding.db.get({
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ }))) {
+ return false;
+ }
+ return PostHiding.menu.post = post;
+ }
+ });
+ },
+ hide: function() {
+ var makeStub, parent, post, replies, thisPost;
+ parent = this.parentNode;
+ thisPost = $('input[name=thisPost]', parent).checked;
+ replies = $('input[name=replies]', parent).checked;
+ makeStub = $('input[name=makeStub]', parent).checked;
+ post = PostHiding.menu.post;
+ if (thisPost) {
+ PostHiding.hide(post, makeStub, replies);
+ } else if (replies) {
+ Recursive.apply(PostHiding.hide, post, makeStub, true);
+ Recursive.add(PostHiding.hide, post, makeStub, true);
+ } else {
+ return;
+ }
+ PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies);
+ return $.event('CloseMenu');
+ },
+ show: function() {
+ var data, parent, post, replies, thisPost;
+ parent = this.parentNode;
+ thisPost = $('input[name=thisPost]', parent).checked;
+ replies = $('input[name=replies]', parent).checked;
+ post = PostHiding.menu.post;
+ if (thisPost) {
+ PostHiding.show(post, replies);
+ } else if (replies) {
+ Recursive.apply(PostHiding.show, post, true);
+ Recursive.rm(PostHiding.hide, post, true);
+ } else {
+ return;
+ }
+ if (data = PostHiding.db.get({
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ })) {
+ PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
+ }
+ return $.event('CloseMenu');
+ },
+ hideStub: function() {
+ var data, post;
+ post = PostHiding.menu.post;
+ if (data = PostHiding.db.get({
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ })) {
+ PostHiding.show(post, data.hideRecursively);
+ PostHiding.hide(post, false, data.hideRecursively);
+ PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively);
+ }
+ $.event('CloseMenu');
+ }
+ },
+ makeButton: function(post, type) {
+ var a, span;
+ span = $.el('span', {
+ className: "fa fa-" + (type === 'hide' ? 'minus' : 'plus') + "-square-o",
+ textContent: ""
+ });
+ a = $.el('a', {
+ className: type + "-reply-button",
+ href: 'javascript:;'
+ });
+ $.add(a, span);
+ $.on(a, 'click', PostHiding.toggle);
+ return a;
+ },
+ saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
+ var data;
+ data = {
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ };
+ if (isHiding) {
+ data.val = {
+ thisPost: thisPost !== false,
+ makeStub: makeStub,
+ hideRecursively: hideRecursively
+ };
+ return PostHiding.db.set(data);
+ } else {
+ return PostHiding.db["delete"](data);
+ }
+ },
+ 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, i, len, quotelink, ref;
+ if (makeStub == null) {
+ makeStub = Conf['Stubs'];
+ }
+ if (hideRecursively == null) {
+ hideRecursively = Conf['Recursive Hiding'];
+ }
+ if (post.isHidden) {
+ return;
+ }
+ post.isHidden = true;
+ if (hideRecursively) {
+ Recursive.apply(PostHiding.hide, post, makeStub, true);
+ Recursive.add(PostHiding.hide, post, makeStub, true);
+ }
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ $.addClass(quotelink, 'filtered');
+ }
+ if (!makeStub) {
+ post.nodes.root.hidden = true;
+ return;
+ }
+ a = PostHiding.makeButton(post, 'show');
+ $.add(a, $.tn(" " + post.info.nameBlock));
+ post.nodes.stub = $.el('div', {
+ className: 'stub'
+ });
+ $.add(post.nodes.stub, a);
+ if (Conf['Menu']) {
+ $.add(post.nodes.stub, Menu.makeButton(post));
+ }
+ return $.prepend(post.nodes.root, post.nodes.stub);
+ },
+ show: function(post, showRecursively) {
+ var i, len, quotelink, ref;
+ if (showRecursively == null) {
+ showRecursively = Conf['Recursive Hiding'];
+ }
+ if (post.nodes.stub) {
+ $.rm(post.nodes.stub);
+ delete post.nodes.stub;
+ } else {
+ post.nodes.root.hidden = false;
+ }
+ post.isHidden = false;
+ if (showRecursively) {
+ Recursive.apply(PostHiding.show, post, true);
+ Recursive.rm(PostHiding.hide, post);
+ }
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ $.rmClass(quotelink, 'filtered');
+ }
+ }
+ };
+
+ return PostHiding;
+
+}).call(this);
+
+Recursive = (function() {
+ var Recursive,
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Recursive = {
+ recursives: {},
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Recursive',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, j, k, len, len1, obj, quote, recursive, ref, ref1;
+ if (this.isClone || this.isFetchedQuote) {
+ return;
+ }
+ ref = this.quotes;
+ for (j = 0, len = ref.length; j < len; j++) {
+ quote = ref[j];
+ if (obj = Recursive.recursives[quote]) {
+ ref1 = obj.recursives;
+ for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) {
+ recursive = ref1[i];
+ recursive.apply(null, [this].concat(slice.call(obj.args[i])));
+ }
+ }
+ }
+ },
+ add: function() {
+ var args, base, name, obj, post, recursive;
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
+ obj = (base = Recursive.recursives)[name = post.fullID] || (base[name] = {
+ recursives: [],
+ args: []
+ });
+ obj.recursives.push(recursive);
+ return obj.args.push(args);
+ },
+ rm: function(recursive, post) {
+ var i, j, len, obj, rec, ref;
+ if (!(obj = Recursive.recursives[post.fullID])) {
+ return;
+ }
+ ref = obj.recursives;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ rec = ref[i];
+ if (!(rec === recursive)) {
+ continue;
+ }
+ obj.recursives.splice(i, 1);
+ obj.args.splice(i, 1);
+ }
+ },
+ apply: function() {
+ var args, fullID, post, recursive;
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
+ fullID = post.fullID;
+ return g.posts.forEach(function(post) {
+ if (indexOf.call(post.quotes, fullID) >= 0) {
+ return recursive.apply(null, [post].concat(slice.call(args)));
+ }
+ });
+ }
+ };
+
+ return Recursive;
+
+}).call(this);
+
+ThreadHiding = (function() {
+ var ThreadHiding;
+
+ ThreadHiding = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) {
+ return;
+ }
+ this.db = new DataBoard('hiddenThreads');
+ if (g.VIEW === 'catalog') {
+ return this.catalogWatch();
+ }
+ this.catalogSet(g.BOARD);
+ return Callbacks.Post.push({
+ name: 'Thread Hiding',
+ cb: this.node
+ });
+ },
+ catalogSet: function(board) {
+ var hiddenThreads, threadID;
+ if (!$.hasStorage) {
+ return;
+ }
+ hiddenThreads = ThreadHiding.db.get({
+ boardID: board.ID,
+ defaultValue: {}
+ });
+ for (threadID in hiddenThreads) {
+ hiddenThreads[threadID] = true;
+ }
+ return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads));
+ },
+ catalogWatch: function() {
+ if (!$.hasStorage) {
+ return;
+ }
+ this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
+ return Main.ready(function() {
+ return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), {
+ attributes: true,
+ subtree: true,
+ attributeFilter: ['style']
+ });
+ });
+ },
+ catalogSave: function() {
+ var hiddenThreads2, threadID;
+ hiddenThreads2 = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
+ for (threadID in hiddenThreads2) {
+ if (!(threadID in ThreadHiding.hiddenThreads)) {
+ ThreadHiding.db.set({
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ val: {
+ makeStub: Conf['Stubs']
+ }
+ });
+ }
+ }
+ for (threadID in ThreadHiding.hiddenThreads) {
+ if (!(threadID in hiddenThreads2)) {
+ ThreadHiding.db["delete"]({
+ boardID: g.BOARD.ID,
+ threadID: threadID
+ });
+ }
+ }
+ return ThreadHiding.hiddenThreads = hiddenThreads2;
+ },
+ node: function() {
+ var data;
+ if (this.isReply || this.isClone || this.isFetchedQuote) {
+ return;
+ }
+ if (data = ThreadHiding.db.get({
+ boardID: this.board.ID,
+ threadID: this.ID
+ })) {
+ ThreadHiding.hide(this.thread, data.makeStub);
+ }
+ if (!Conf['Thread Hiding Buttons']) {
+ return;
+ }
+ return $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide'));
+ },
+ onIndexBuild: function(nodes) {
+ var i, len, root, thread;
+ for (i = 0, len = nodes.length; i < len; i++) {
+ root = nodes[i];
+ thread = Get.threadFromRoot(root);
+ if (thread.isHidden && thread.stub && !root.contains(thread.stub)) {
+ ThreadHiding.makeStub(thread, root);
+ }
+ }
+ },
+ menu: {
+ init: function() {
+ var apply, div, hideStubLink, makeStub;
+ if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
+ return;
+ }
+ div = $.el('div', {
+ className: 'hide-thread-link',
+ textContent: 'Hide'
+ });
+ apply = $.el('a', {
+ textContent: 'Apply',
+ href: 'javascript:;'
+ });
+ $.on(apply, 'click', ThreadHiding.menu.hide);
+ makeStub = UI.checkbox('Stubs', 'Make stub');
+ Menu.menu.addEntry({
+ el: div,
+ order: 20,
+ open: function(arg) {
+ var isReply, thread;
+ thread = arg.thread, isReply = arg.isReply;
+ if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
+ return false;
+ }
+ ThreadHiding.menu.thread = thread;
+ return true;
+ },
+ subEntries: [
+ {
+ el: apply
+ }, {
+ el: makeStub
+ }
+ ]
+ });
+ div = $.el('a', {
+ className: 'show-thread-link',
+ textContent: 'Show',
+ href: 'javascript:;'
+ });
+ $.on(div, 'click', ThreadHiding.menu.show);
+ Menu.menu.addEntry({
+ el: div,
+ order: 20,
+ open: function(arg) {
+ var isReply, thread;
+ thread = arg.thread, isReply = arg.isReply;
+ if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
+ return false;
+ }
+ ThreadHiding.menu.thread = thread;
+ return true;
+ }
+ });
+ hideStubLink = $.el('a', {
+ textContent: 'Hide stub',
+ href: 'javascript:;'
+ });
+ $.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);
+ return Menu.menu.addEntry({
+ el: hideStubLink,
+ order: 15,
+ open: function(arg) {
+ var isReply, thread;
+ thread = arg.thread, isReply = arg.isReply;
+ if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
+ return false;
+ }
+ return ThreadHiding.menu.thread = thread;
+ }
+ });
+ },
+ hide: function() {
+ var makeStub, thread;
+ makeStub = $('input', this.parentNode).checked;
+ thread = ThreadHiding.menu.thread;
+ ThreadHiding.hide(thread, makeStub);
+ ThreadHiding.saveHiddenState(thread, makeStub);
+ return $.event('CloseMenu');
+ },
+ show: function() {
+ var thread;
+ thread = ThreadHiding.menu.thread;
+ ThreadHiding.show(thread);
+ ThreadHiding.saveHiddenState(thread);
+ return $.event('CloseMenu');
+ },
+ hideStub: function() {
+ var thread;
+ thread = ThreadHiding.menu.thread;
+ ThreadHiding.show(thread);
+ ThreadHiding.hide(thread, false);
+ ThreadHiding.saveHiddenState(thread, false);
+ $.event('CloseMenu');
+ }
+ },
+ makeButton: function(thread, type) {
+ var a;
+ a = $.el('a', {
+ className: type + "-thread-button",
+ href: 'javascript:;'
+ });
+ $.extend(a, {
+ innerHTML: "
"
+ });
+ a.dataset.fullID = thread.fullID;
+ $.on(a, 'click', ThreadHiding.toggle);
+ return a;
+ },
+ makeStub: function(thread, root) {
+ var a, numReplies, summary;
+ numReplies = $$('.thread > .replyContainer', root).length;
+ if (summary = $('.summary', root)) {
+ numReplies += +summary.textContent.match(/\d+/);
+ }
+ a = ThreadHiding.makeButton(thread, 'show');
+ $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")"));
+ thread.stub = $.el('div', {
+ className: 'stub'
+ });
+ if (Conf['Menu']) {
+ $.add(thread.stub, [a, Menu.makeButton(thread.OP)]);
+ } else {
+ $.add(thread.stub, a);
+ }
+ return $.prepend(root, thread.stub);
+ },
+ saveHiddenState: function(thread, makeStub) {
+ if (thread.isHidden) {
+ ThreadHiding.db.set({
+ boardID: thread.board.ID,
+ threadID: thread.ID,
+ val: {
+ makeStub: makeStub
+ }
+ });
+ } else {
+ ThreadHiding.db["delete"]({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ });
+ }
+ return ThreadHiding.catalogSet(thread.board);
+ },
+ toggle: function(thread) {
+ if (!(thread instanceof Thread)) {
+ thread = g.threads[this.dataset.fullID];
+ }
+ if (thread.isHidden) {
+ ThreadHiding.show(thread);
+ } else {
+ ThreadHiding.hide(thread);
+ }
+ return ThreadHiding.saveHiddenState(thread);
+ },
+ hide: function(thread, makeStub) {
+ var threadRoot;
+ if (makeStub == null) {
+ makeStub = Conf['Stubs'];
+ }
+ if (thread.isHidden) {
+ return;
+ }
+ threadRoot = thread.OP.nodes.root.parentNode;
+ thread.isHidden = true;
+ if (Conf['JSON Index']) {
+ Index.updateHideLabel();
+ }
+ if (!makeStub) {
+ return threadRoot.hidden = true;
+ }
+ return ThreadHiding.makeStub(thread, threadRoot);
+ },
+ show: function(thread) {
+ var threadRoot;
+ if (thread.stub) {
+ $.rm(thread.stub);
+ delete thread.stub;
+ }
+ threadRoot = thread.OP.nodes.root.parentNode;
+ threadRoot.hidden = thread.isHidden = false;
+ if (Conf['JSON Index']) {
+ return Index.updateHideLabel();
+ }
+ }
+ };
+
+ return ThreadHiding;
+
+}).call(this);
+
+Build = (function() {
+ var Build,
+ slice = [].slice;
+
+ Build = {
+ staticPath: '//s.4cdn.org/image/',
+ gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif',
+ spoilerRange: {},
+ unescape: function(text) {
+ if (text == null) {
+ return text;
+ }
+ return text.replace(/<[^>]*>/g, '').replace(/&(amp|#039|quot|lt|gt|#44);/g, function(c) {
+ return {
+ '&': '&',
+ ''': "'",
+ '"': '"',
+ '<': '<',
+ '>': '>',
+ ',': ','
+ }[c];
+ });
+ },
+ shortFilename: function(filename) {
+ var ext, threshold;
+ threshold = 30;
+ ext = filename.match(/\.?[^\.]*$/)[0];
+ if (filename.length - ext.length > threshold) {
+ return filename.slice(0, threshold - 5) + "(...)" + ext;
+ } else {
+ return filename;
+ }
+ },
+ spoilerThumb: function(boardID) {
+ var spoilerRange;
+ if (spoilerRange = Build.spoilerRange[boardID]) {
+ return Build.staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png";
+ } else {
+ return Build.staticPath + "spoiler.png";
+ }
+ },
+ sameThread: function(boardID, threadID) {
+ return g.VIEW === 'thread' && g.BOARD.ID === boardID && g.THREADID === +threadID;
+ },
+ postURL: function(boardID, threadID, postID) {
+ if (Build.sameThread(boardID, threadID)) {
+ return "#p" + postID;
+ } else {
+ return "/" + boardID + "/thread/" + threadID + "#p" + postID;
+ }
+ },
+ parseJSON: function(data, boardID) {
+ var o;
+ o = {
+ postID: data.no,
+ threadID: data.resto || data.no,
+ boardID: boardID,
+ isReply: !!data.resto,
+ isSticky: !!data.sticky,
+ isClosed: !!data.closed,
+ isArchived: !!data.archived,
+ fileDeleted: !!data.filedeleted
+ };
+ o.info = {
+ subject: Build.unescape(data.sub),
+ email: Build.unescape(data.email),
+ name: Build.unescape(data.name) || '',
+ tripcode: data.trip,
+ uniqueID: data.id,
+ flagCode: data.country,
+ flag: Build.unescape(data.country_name),
+ dateUTC: data.time,
+ dateText: data.now,
+ commentHTML: {
+ innerHTML: data.com || ''
+ }
+ };
+ if (data.capcode) {
+ o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, function(c) {
+ return c.toUpperCase();
+ });
+ o.capcodeHighlight = /_highlight$/.test(data.capcode);
+ delete o.info.uniqueID;
+ }
+ if (data.ext) {
+ o.file = {
+ name: (Build.unescape(data.filename)) + data.ext,
+ url: boardID === 'f' ? location.protocol + "//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.filename)) + data.ext : location.protocol + "//i.4cdn.org/" + boardID + "/" + data.tim + data.ext,
+ height: data.h,
+ width: data.w,
+ MD5: data.md5,
+ size: $.bytesToString(data.fsize),
+ thumbURL: location.protocol + "//i.4cdn.org/" + boardID + "/" + data.tim + "s.jpg",
+ theight: data.tn_h,
+ twidth: data.tn_w,
+ isSpoiler: !!data.spoiler,
+ tag: data.tag
+ };
+ if (!/\.pdf$/.test(o.file.url)) {
+ o.file.dimensions = o.file.width + "x" + o.file.height;
+ }
+ }
+ return o;
+ },
+ parseComment: function(html) {
+ html = html.replace(/
/gi, '\n').replace(/\n\n
Rolled [^<]*<\/b>/i, '').replace(/]*>/g, '');
+ return Build.unescape(html);
+ },
+ postFromObject: function(data, boardID, suppressThumb) {
+ var o;
+ o = Build.parseJSON(data, boardID);
+ return Build.post(o, suppressThumb);
+ },
+ post: function(o, suppressThumb) {
+ var boardID, capcode, capcodeDescription, capcodeLC, capcodeLong, capcodePlural, commentHTML, container, dateText, dateUTC, email, file, fileBlock, fileThumb, fileURL, flag, flagCode, gifIcon, href, i, len, match, name, postClass, postID, postInfo, postLink, protocol, quote, quoteLink, ref, ref1, shortFilename, staticPath, subject, threadID, tripcode, uniqueID, wholePost;
+ postID = o.postID, threadID = o.threadID, boardID = o.boardID, file = o.file;
+ ref = o.info, subject = ref.subject, email = ref.email, name = ref.name, tripcode = ref.tripcode, capcode = ref.capcode, uniqueID = ref.uniqueID, flagCode = ref.flagCode, flag = ref.flag, dateUTC = ref.dateUTC, dateText = ref.dateText, commentHTML = ref.commentHTML;
+ staticPath = Build.staticPath, gifIcon = Build.gifIcon;
+
+ /* Post Info */
+ if (capcode) {
+ capcodeLC = capcode.toLowerCase();
+ if (capcode === 'Founder') {
+ capcodePlural = 'the Founder';
+ capcodeDescription = "4chan's Founder";
+ } else {
+ capcodeLong = {
+ 'Admin': 'Administrator',
+ 'Mod': 'Moderator'
+ }[capcode] || capcode;
+ capcodePlural = capcodeLong + "s";
+ capcodeDescription = "a 4chan " + capcodeLong;
+ }
+ }
+ postLink = Build.postURL(boardID, threadID, postID);
+ quoteLink = Build.sameThread(boardID, threadID) ? "javascript:quote('" + (+postID) + "');" : "/" + boardID + "/thread/" + threadID + "#q" + postID;
+ postInfo = {
+ innerHTML: ""
+ };
+
+ /* File Info */
+ if (file) {
+ protocol = /^https?:(?=\/\/i\.4cdn\.org\/)/;
+ fileURL = file.url.replace(protocol, '');
+ shortFilename = Build.shortFilename(file.name);
+ fileThumb = file.isSpoiler ? Build.spoilerThumb(boardID) : file.thumbURL.replace(protocol, '');
+ }
+ fileBlock = {
+ innerHTML: ((file) ? "" : ((o.fileDeleted) ? "" : ""))
+ };
+
+ /* Whole Post */
+ postClass = o.isReply ? 'reply' : 'op';
+ wholePost = {
+ innerHTML: ((o.isReply) ? ">>
" : "") + "" + ((o.isReply) ? (postInfo).innerHTML + (fileBlock).innerHTML : (fileBlock).innerHTML + (postInfo).innerHTML) + "
" + (commentHTML).innerHTML + " "
+ };
+ container = $.el('div', {
+ className: "postContainer " + postClass + "Container",
+ id: "pc" + postID
+ });
+ $.extend(container, wholePost);
+ ref1 = $$('.quotelink', container);
+ for (i = 0, len = ref1.length; i < len; i++) {
+ quote = ref1[i];
+ href = quote.getAttribute('href');
+ if ((href[0] === '#') && !(Build.sameThread(boardID, threadID))) {
+ quote.href = ("/" + boardID + "/thread/" + threadID) + href;
+ } else if ((match = href.match(/^\/([^\/]+)\/thread\/(\d+)/)) && (Build.sameThread(match[1], match[2]))) {
+ quote.href = href.match(/(#[^#]*)?$/)[0] || '#';
+ } else if (/^\d+(#|$)/.test(href) && !(g.VIEW === 'thread' && g.BOARD.ID === boardID)) {
+ quote.href = "/" + boardID + "/thread/" + href;
+ }
+ }
+ return container;
+ },
+ summaryText: function(status, posts, files) {
+ var text;
+ text = '';
+ if (status) {
+ text += status + " ";
+ }
+ text += posts + " post" + (posts > 1 ? 's' : '');
+ if (+files) {
+ text += " and " + files + " image repl" + (files > 1 ? 'ies' : 'y');
+ }
+ return text += " " + (status === '-' ? 'shown' : 'omitted') + ".";
+ },
+ summary: function(boardID, threadID, posts, files) {
+ return $.el('a', {
+ className: 'summary',
+ textContent: Build.summaryText('', posts, files),
+ href: "/" + boardID + "/thread/" + threadID
+ });
+ },
+ thread: function(board, data, full) {
+ var OP, root;
+ Build.spoilerRange[board] = data.custom_spoiler;
+ if (OP = board.posts[data.no]) {
+ if (OP.isFetchedQuote) {
+ OP = null;
+ }
+ }
+ if (OP && (root = OP.nodes.root.parentNode)) {
+ $.rmAll(root);
+ } else {
+ root = $.el('div', {
+ className: 'thread',
+ id: "t" + data.no
+ });
+ }
+ $.add(root, Build[full ? 'fullThread' : 'excerptThread'](board, data, OP));
+ return root;
+ },
+ excerptThread: function(board, data, OP) {
+ var files, nodes, posts, ref;
+ nodes = [OP ? OP.nodes.root : Build.postFromObject(data, board.ID, true)];
+ if (data.omitted_posts || !Conf['Show Replies'] && data.replies) {
+ ref = Conf['Show Replies'] ? [
+ data.omitted_posts, data.images - data.last_replies.filter(function(data) {
+ return !!data.ext;
+ }).length
+ ] : [data.replies, data.images], posts = ref[0], files = ref[1];
+ nodes.push(Build.summary(board.ID, data.no, posts, files));
+ }
+ return nodes;
+ },
+ fullThread: function(board, data) {
+ return Build.postFromObject(data, board.ID);
+ },
+ catalogThread: function(thread) {
+ var br, cc, comment, data, exif, fileCount, gifIcon, href, i, imgClass, j, k, l, len, len1, len2, len3, pageCount, postCount, pp, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath;
+ staticPath = Build.staticPath, gifIcon = Build.gifIcon;
+ data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)];
+ if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) {
+ src = staticPath + "spoiler";
+ if (spoilerRange = Build.spoilerRange[thread.board]) {
+ src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random());
+ }
+ src += '.png';
+ imgClass = 'spoiler-file';
+ } else if (data.filedeleted) {
+ src = staticPath + "filedeleted-res" + gifIcon;
+ imgClass = 'deleted-file';
+ } else if (thread.OP.file) {
+ src = thread.OP.file.thumbURL;
+ } else {
+ src = staticPath + "nofile.png";
+ imgClass = 'no-file';
+ }
+ postCount = data.replies + 1;
+ fileCount = data.images + !!data.ext;
+ pageCount = Math.floor(Index.liveThreadIDs.indexOf(thread.ID) / Index.threadsNumPerPage) + 1;
+ comment = {
+ innerHTML: data.com || ''
+ };
+ root = $.el('div', {
+ className: 'catalog-thread'
+ });
+ $.extend(root, {
+ innerHTML: "" + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "
" + ((thread.OP.info.subject) ? "" + E(thread.OP.info.subject) + "
" : "") + ""
+ });
+ root.dataset.fullID = thread.fullID;
+ if (thread.OP.highlights) {
+ $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights)));
+ }
+ ref = $$('.quotelink', root.lastElementChild);
+ for (i = 0, len = ref.length; i < len; i++) {
+ quote = ref[i];
+ href = quote.getAttribute('href');
+ if (href[0] === '#') {
+ quote.href = ("/" + thread.board + "/thread/" + thread.ID) + href;
+ }
+ }
+ ref1 = $$('.abbr, .exif', root.lastElementChild);
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ exif = ref1[j];
+ $.rm(exif);
+ }
+ ref2 = $$('.prettyprint', root.lastElementChild);
+ for (k = 0, len2 = ref2.length; k < len2; k++) {
+ pp = ref2[k];
+ cc = $.el('span', {
+ className: 'catalog-code'
+ });
+ $.add(cc, slice.call(pp.childNodes));
+ $.replace(pp, cc);
+ }
+ ref3 = $$('br', root.lastElementChild);
+ for (l = 0, len3 = ref3.length; l < len3; l++) {
+ br = ref3[l];
+ if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') {
+ $.rm(br);
+ }
+ }
+ if (thread.isSticky) {
+ $.add($('.catalog-icons', root), $.el('img', {
+ src: staticPath + "sticky" + gifIcon,
+ className: 'stickyIcon',
+ title: 'Sticky'
+ }));
+ }
+ if (thread.isClosed) {
+ $.add($('.catalog-icons', root), $.el('img', {
+ src: staticPath + "closed" + gifIcon,
+ className: 'closedIcon',
+ title: 'Closed'
+ }));
+ }
+ if (data.bumplimit) {
+ $.addClass($('.post-count', root), 'warning');
+ }
+ if (data.imagelimit) {
+ $.addClass($('.file-count', root), 'warning');
+ }
+ return root;
+ }
+ };
+
+ return Build;
+
+}).call(this);
+
+(function() {
+
+
+}).call(this);
+
+Get = (function() {
+ var Get,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Get = {
+ threadExcerpt: function(thread) {
+ var OP, excerpt, ref;
+ OP = thread.OP;
+ excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.commentDisplay.replace(/\n+/g, ' // ') || OP.info.nameBlock);
+ if (excerpt.length > 73) {
+ return excerpt.slice(0, 70) + "...";
+ }
+ return excerpt;
+ },
+ threadFromRoot: function(root) {
+ return g.threads[g.BOARD + "." + root.id.slice(1)];
+ },
+ threadFromNode: function(node) {
+ return Get.threadFromRoot($.x('ancestor::div[@class="thread"]', node));
+ },
+ postFromRoot: function(root) {
+ var index, post;
+ if (root == null) {
+ return null;
+ }
+ post = g.posts[root.dataset.fullID];
+ index = root.dataset.clone;
+ if (index) {
+ return post.clones[index];
+ } else {
+ return post;
+ }
+ },
+ postFromNode: function(root) {
+ return Get.postFromRoot($.x('(ancestor::div[contains(@class,"postContainer")][1]|following::div[contains(@class,"postContainer")][1])', root));
+ },
+ postDataFromLink: function(link) {
+ var boardID, path, postID, ref, threadID;
+ if (link.hostname === 'boards.4chan.org') {
+ path = link.pathname.split(/\/+/);
+ boardID = path[1];
+ threadID = path[3];
+ postID = link.hash.slice(2);
+ } else {
+ ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ threadID || (threadID = 0);
+ }
+ return {
+ boardID: boardID,
+ threadID: +threadID,
+ postID: +postID
+ };
+ },
+ allQuotelinksLinkingTo: function(post) {
+ var fullID, handleQuotes, i, len, posts, qPost, quote, quotelinks, ref;
+ quotelinks = [];
+ posts = g.posts;
+ fullID = post.fullID;
+ handleQuotes = function(qPost, type) {
+ var clone, i, len, ref;
+ quotelinks.push.apply(quotelinks, qPost.nodes[type]);
+ ref = qPost.clones;
+ for (i = 0, len = ref.length; i < len; i++) {
+ clone = ref[i];
+ quotelinks.push.apply(quotelinks, clone.nodes[type]);
+ }
+ };
+ posts.forEach(function(qPost) {
+ if (indexOf.call(qPost.quotes, fullID) >= 0) {
+ return handleQuotes(qPost, 'quotelinks');
+ }
+ });
+ if (Conf['Quote Backlinks']) {
+ ref = post.quotes;
+ for (i = 0, len = ref.length; i < len; i++) {
+ quote = ref[i];
+ if (qPost = posts[quote]) {
+ handleQuotes(qPost, 'backlinks');
+ }
+ }
+ }
+ return quotelinks.filter(function(quotelink) {
+ var boardID, postID, ref1;
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ return boardID === post.board.ID && postID === post.ID;
+ });
+ },
+ scriptData: function() {
+ var i, len, ref, script;
+ ref = $$('script:not([src])', d.head);
+ for (i = 0, len = ref.length; i < len; i++) {
+ script = ref[i];
+ if (/\bcooldowns *=/.test(script.textContent)) {
+ return script.textContent;
+ }
+ }
+ return '';
+ }
+ };
+
+ return Get;
+
+}).call(this);
+
+Header = (function() {
+ var Header;
+
+ Header = {
+ init: function() {
+ var barFixedToggler, barPositionToggler, box, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler;
+ this.menu = new UI.Menu('header');
+ menuButton = $.el('span', {
+ className: 'menu-button'
+ });
+ $.extend(menuButton, {
+ innerHTML: " "
+ });
+ box = UI.checkbox;
+ barFixedToggler = box('Fixed Header', 'Fixed Header');
+ headerToggler = box('Header auto-hide', 'Auto-hide header');
+ scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll');
+ barPositionToggler = box('Bottom Header', 'Bottom header');
+ linkJustifyToggler = box('Centered links', 'Centered links');
+ customNavToggler = box('Custom Board Navigation', 'Custom board navigation');
+ footerToggler = box('Bottom Board List', 'Hide bottom board list');
+ shortcutToggler = box('Shortcut Icons', 'Shortcut Icons');
+ editCustomNav = $.el('a', {
+ textContent: 'Edit custom board navigation',
+ href: 'javascript:;'
+ });
+ this.barFixedToggler = barFixedToggler.firstElementChild;
+ this.scrollHeaderToggler = scrollHeaderToggler.firstElementChild;
+ this.barPositionToggler = barPositionToggler.firstElementChild;
+ this.linkJustifyToggler = linkJustifyToggler.firstElementChild;
+ this.headerToggler = headerToggler.firstElementChild;
+ this.footerToggler = footerToggler.firstElementChild;
+ this.shortcutToggler = shortcutToggler.firstElementChild;
+ this.customNavToggler = customNavToggler.firstElementChild;
+ $.on(menuButton, 'click', this.menuToggle);
+ $.on(this.headerToggler, 'change', this.toggleBarVisibility);
+ $.on(this.barFixedToggler, 'change', this.toggleBarFixed);
+ $.on(this.barPositionToggler, 'change', this.toggleBarPosition);
+ $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll);
+ $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify);
+ $.on(this.footerToggler, 'change', this.toggleFooterVisibility);
+ $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons);
+ $.on(this.customNavToggler, 'change', this.toggleCustomNav);
+ $.on(editCustomNav, 'click', this.editCustomNav);
+ this.setBarFixed(Conf['Fixed Header']);
+ this.setHideBarOnScroll(Conf['Header auto-hide on scroll']);
+ this.setBarVisibility(Conf['Header auto-hide']);
+ this.setLinkJustify(Conf['Centered links']);
+ this.setShortcutIcons(Conf['Shortcut Icons']);
+ this.setFooterVisibility(Conf['Bottom Board List']);
+ $.sync('Fixed Header', this.setBarFixed);
+ $.sync('Header auto-hide on scroll', this.setHideBarOnScroll);
+ $.sync('Bottom Header', this.setBarPosition);
+ $.sync('Shortcut Icons', this.setShortcutIcons);
+ $.sync('Header auto-hide', this.setBarVisibility);
+ $.sync('Centered links', this.setLinkJustify);
+ $.sync('Bottom Board List', this.setFooterVisibility);
+ this.addShortcut(menuButton);
+ this.menu.addEntry({
+ el: $.el('span', {
+ textContent: 'Header'
+ }),
+ order: 107,
+ subEntries: [
+ {
+ el: barFixedToggler
+ }, {
+ el: headerToggler
+ }, {
+ el: scrollHeaderToggler
+ }, {
+ el: barPositionToggler
+ }, {
+ el: linkJustifyToggler
+ }, {
+ el: footerToggler
+ }, {
+ el: shortcutToggler
+ }, {
+ el: customNavToggler
+ }, {
+ el: editCustomNav
+ }
+ ]
+ });
+ $.on(window, 'load popstate', Header.hashScroll);
+ $.on(d, 'CreateNotification', this.createNotification);
+ $.asap((function() {
+ return d.body;
+ }), (function(_this) {
+ return function() {
+ if (!Main.isThisPageLegit()) {
+ return;
+ }
+ $.asap((function() {
+ return $.id('boardNavMobile') || d.readyState !== 'loading';
+ }), function() {
+ var a, footer;
+ footer = $.id('boardNavDesktop').cloneNode(true);
+ footer.id = 'boardNavDesktopFoot';
+ $('#navtopright', footer).id = 'navbotright';
+ $('#settingsWindowLink', footer).id = 'settingsWindowLinkBot';
+ Header.bottomBoardList = $('.boardList', footer);
+ if (a = $("a[href*='/" + g.BOARD + "/']", footer)) {
+ a.className = 'current';
+ }
+ Main.ready(function() {
+ var absbot, oldFooter;
+ if ((oldFooter = $.id('boardNavDesktopFoot'))) {
+ return $.replace($('.boardList', oldFooter), Header.bottomBoardList);
+ } else if ((absbot = $.id('absbot'))) {
+ $.before(absbot, footer);
+ return $.globalEval('window.cloneTopNav = function() {};');
+ }
+ });
+ return Header.setBoardList();
+ });
+ $.prepend(d.body, _this.bar);
+ $.add(d.body, Header.hover);
+ _this.setBarPosition(Conf['Bottom Header']);
+ return _this;
+ };
+ })(this));
+ Main.ready((function(_this) {
+ return function() {
+ var cs;
+ if (g.VIEW === 'catalog' || !Conf['Disable Native Extension']) {
+ cs = $.el('a', {
+ href: 'javascript:;'
+ });
+ if (g.VIEW === 'catalog') {
+ cs.title = cs.textContent = 'Catalog Settings';
+ cs.className = 'fa fa-book';
+ } else {
+ cs.title = cs.textContent = '4chan Settings';
+ cs.className = 'fa fa-leaf';
+ }
+ $.on(cs, 'click', function() {
+ return $.id('settingsWindowLink').click();
+ });
+ return _this.addShortcut(cs);
+ }
+ };
+ })(this));
+ return this.enableDesktopNotifications();
+ },
+ bar: $.el('div', {
+ id: 'header-bar'
+ }),
+ noticesRoot: $.el('div', {
+ id: 'notifications'
+ }),
+ shortcuts: $.el('span', {
+ id: 'shortcuts'
+ }),
+ hover: $.el('div', {
+ id: 'hoverUI'
+ }),
+ toggle: $.el('div', {
+ id: 'scroll-marker'
+ }),
+ setBoardList: function() {
+ var a, boardList, btn, chr, i, j, len, len1, node, nodes, ref, ref1, spacer, span;
+ Header.boardList = boardList = $.el('span', {
+ id: 'board-list'
+ });
+ $.extend(boardList, {
+ innerHTML: " - "
+ });
+ btn = $('.hide-board-list-button', boardList);
+ $.on(btn, 'click', Header.toggleBoardList);
+ nodes = [];
+ spacer = function() {
+ return $.el('span', {
+ className: 'spacer'
+ });
+ };
+ ref = $('#boardNavDesktop > .boardList').childNodes;
+ for (i = 0, len = ref.length; i < len; i++) {
+ node = ref[i];
+ switch (node.nodeName) {
+ case '#text':
+ ref1 = node.nodeValue;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ chr = ref1[j];
+ span = $.el('span', {
+ textContent: chr
+ });
+ if (chr === ' ') {
+ span.className = 'space';
+ }
+ if (chr === ']') {
+ nodes.push(spacer());
+ }
+ nodes.push(span);
+ if (chr === '[') {
+ nodes.push(spacer());
+ }
+ }
+ break;
+ case 'A':
+ a = node.cloneNode(true);
+ if (a.pathname.split('/')[1] === g.BOARD.ID) {
+ a.className = 'current';
+ }
+ nodes.push(a);
+ }
+ }
+ $.add($('.boardList', boardList), nodes);
+ $.add(Header.bar, [Header.boardList, Header.shortcuts, Header.noticesRoot, Header.toggle]);
+ Header.setCustomNav(Conf['Custom Board Navigation']);
+ Header.generateBoardList(Conf['boardnav']);
+ $.sync('Custom Board Navigation', Header.setCustomNav);
+ return $.sync('boardnav', Header.generateBoardList);
+ },
+ generateBoardList: function(boardnav) {
+ var as, list, nodes, re, t;
+ list = $('#custom-board-list', Header.boardList);
+ $.rmAll(list);
+ if (!boardnav) {
+ return;
+ }
+ boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' ');
+ as = $$('#full-board-list a[title]', Header.boardList);
+ re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
+ nodes = (function() {
+ var i, len, ref, results;
+ ref = boardnav.match(re);
+ results = [];
+ for (i = 0, len = ref.length; i < len; i++) {
+ t = ref[i];
+ results.push(Header.mapCustomNavigation(t, as));
+ }
+ return results;
+ })();
+ $.add(list, nodes);
+ return $.ready(CatalogLinks.initBoardList);
+ },
+ mapCustomNavigation: function(t, as) {
+ var a, boardID, href, indexOptions, m, text, url;
+ if (/^[^\w@]/.test(t)) {
+ return $.tn(t);
+ }
+ text = url = null;
+ t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) {
+ text = m1;
+ url = m2;
+ return '';
+ });
+ indexOptions = [];
+ t = t.replace(/-(?:mode|sort):"([^"]+)"/g, function(m0, m1) {
+ indexOptions.push(m1.toLowerCase().replace(/\ /g, '-'));
+ return '';
+ });
+ indexOptions = indexOptions.join('/');
+ if (/^toggle-all/.test(t)) {
+ a = $.el('a', {
+ className: 'show-board-list-button',
+ textContent: text || '+',
+ href: 'javascript:;'
+ });
+ $.on(a, 'click', Header.toggleBoardList);
+ return a;
+ }
+ if (/^external/.test(t)) {
+ a = $.el('a', {
+ href: url || 'javascript:;',
+ textContent: text || '+',
+ className: 'external'
+ });
+ return a;
+ }
+ boardID = t.split('-')[0];
+ if (boardID === 'current') {
+ boardID = g.BOARD.ID;
+ }
+ a = (function() {
+ var i, len, ref;
+ if (boardID === '@') {
+ return $.el('a', {
+ href: 'https://twitter.com/4chan',
+ title: '4chan Twitter',
+ textContent: '@'
+ });
+ }
+ for (i = 0, len = as.length; i < len; i++) {
+ a = as[i];
+ if (a.textContent === boardID) {
+ return a.cloneNode(true);
+ }
+ }
+ a = $.el('a', {
+ href: "/" + boardID + "/",
+ textContent: boardID
+ });
+ if ((ref = g.VIEW) === 'catalog' || ref === 'archive') {
+ a.href += g.VIEW;
+ }
+ if (boardID === g.BOARD.ID) {
+ a.className = 'current';
+ }
+ return a;
+ })();
+ a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID;
+ if (m = t.match(/-(index|catalog)/)) {
+ if (!(boardID === 'f' && m[1] === 'catalog')) {
+ a.dataset.only = m[1];
+ a.href = CatalogLinks[m[1]](boardID);
+ if (m[1] === 'catalog') {
+ $.addClass(a, 'catalog');
+ }
+ } else {
+ return a.firstChild;
+ }
+ }
+ if (Conf['JSON Index'] && indexOptions) {
+ a.dataset.indexOptions = indexOptions;
+ if (a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
+ a.href += (a.hash ? '/' : '#') + indexOptions;
+ }
+ }
+ if (/-archive/.test(t)) {
+ if (href = Redirect.to('board', {
+ boardID: boardID
+ })) {
+ a.href = href;
+ } else {
+ return a.firstChild;
+ }
+ }
+ if (/-expired/.test(t)) {
+ if (boardID !== 'b' && boardID !== 'f' && boardID !== 'trash') {
+ a.href = "/" + boardID + "/archive";
+ } else {
+ return a.firstChild;
+ }
+ }
+ if (boardID === '@') {
+ $.addClass(a, 'navSmall');
+ }
+ return a;
+ },
+ toggleBoardList: function() {
+ var bar, custom, full, showBoardList;
+ bar = Header.bar;
+ custom = $('#custom-board-list', bar);
+ full = $('#full-board-list', bar);
+ showBoardList = !full.hidden;
+ custom.hidden = !showBoardList;
+ return full.hidden = showBoardList;
+ },
+ setLinkJustify: function(centered) {
+ Header.linkJustifyToggler.checked = centered;
+ if (centered) {
+ return $.addClass(doc, 'centered-links');
+ } else {
+ return $.rmClass(doc, 'centered-links');
+ }
+ },
+ toggleLinkJustify: function() {
+ var centered;
+ $.event('CloseMenu');
+ centered = this.nodeName === 'INPUT' ? this.checked : void 0;
+ Header.setLinkJustify(centered);
+ return $.set('Centered links', centered);
+ },
+ setBarFixed: function(fixed) {
+ Header.barFixedToggler.checked = fixed;
+ if (fixed) {
+ $.addClass(doc, 'fixed');
+ return $.addClass(Header.bar, 'dialog');
+ } else {
+ $.rmClass(doc, 'fixed');
+ return $.rmClass(Header.bar, 'dialog');
+ }
+ },
+ toggleBarFixed: function() {
+ $.event('CloseMenu');
+ Header.setBarFixed(this.checked);
+ Conf['Fixed Header'] = this.checked;
+ return $.set('Fixed Header', this.checked);
+ },
+ setShortcutIcons: function(show) {
+ Header.shortcutToggler.checked = show;
+ if (show) {
+ return $.addClass(doc, 'shortcut-icons');
+ } else {
+ return $.rmClass(doc, 'shortcut-icons');
+ }
+ },
+ toggleShortcutIcons: function() {
+ $.event('CloseMenu');
+ Header.setShortcutIcons(this.checked);
+ Conf['Shortcut Icons'] = this.checked;
+ return $.set('Shortcut Icons', this.checked);
+ },
+ setBarVisibility: function(hide) {
+ Header.headerToggler.checked = hide;
+ $.event('CloseMenu');
+ (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide');
+ return (hide ? $.addClass : $.rmClass)(doc, 'autohide');
+ },
+ toggleBarVisibility: function() {
+ var hide, message;
+ hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
+ Conf['Header auto-hide'] = hide;
+ $.set('Header auto-hide', hide);
+ Header.setBarVisibility(hide);
+ message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.');
+ return new Notice('info', message, 2);
+ },
+ setHideBarOnScroll: function(hide) {
+ Header.scrollHeaderToggler.checked = hide;
+ if (hide) {
+ $.on(window, 'scroll', Header.hideBarOnScroll);
+ return;
+ }
+ $.off(window, 'scroll', Header.hideBarOnScroll);
+ $.rmClass(Header.bar, 'scroll');
+ if (!Conf['Header auto-hide']) {
+ return $.rmClass(Header.bar, 'autohide');
+ }
+ },
+ toggleHideBarOnScroll: function() {
+ var hide;
+ hide = this.checked;
+ $.cb.checked.call(this);
+ return Header.setHideBarOnScroll(hide);
+ },
+ hideBarOnScroll: function() {
+ var offsetY;
+ offsetY = window.pageYOffset;
+ if (offsetY > (Header.previousOffset || 0)) {
+ $.addClass(Header.bar, 'autohide', 'scroll');
+ } else {
+ $.rmClass(Header.bar, 'autohide', 'scroll');
+ }
+ return Header.previousOffset = offsetY;
+ },
+ setBarPosition: function(bottom) {
+ var args;
+ Header.barPositionToggler.checked = bottom;
+ $.event('CloseMenu');
+ args = bottom ? ['bottom-header', 'top-header', 'after'] : ['top-header', 'bottom-header', 'add'];
+ $.addClass(doc, args[0]);
+ $.rmClass(doc, args[1]);
+ return $[args[2]](Header.bar, Header.noticesRoot);
+ },
+ toggleBarPosition: function() {
+ $.cb.checked.call(this);
+ return Header.setBarPosition(this.checked);
+ },
+ setFooterVisibility: function(hide) {
+ Header.footerToggler.checked = hide;
+ return doc.classList.toggle('hide-bottom-board-list', hide);
+ },
+ toggleFooterVisibility: function() {
+ var hide, message;
+ $.event('CloseMenu');
+ hide = this.nodeName === 'INPUT' ? this.checked : $.hasClass(doc, 'hide-bottom-board-list');
+ Header.setFooterVisibility(hide);
+ $.set('Bottom Board List', hide);
+ message = hide ? 'The bottom navigation will now be hidden.' : 'The bottom navigation will remain visible.';
+ return new Notice('info', message, 2);
+ },
+ setCustomNav: function(show) {
+ var btn, cust, full, ref;
+ Header.customNavToggler.checked = show;
+ cust = $('#custom-board-list', Header.bar);
+ full = $('#full-board-list', Header.bar);
+ btn = $('.hide-board-list-container', full);
+ return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref;
+ },
+ toggleCustomNav: function() {
+ $.cb.checked.call(this);
+ return Header.setCustomNav(this.checked);
+ },
+ editCustomNav: function() {
+ var settings;
+ Settings.open('Advanced');
+ settings = $.id('fourchanx-settings');
+ return $('[name=boardnav]', settings).focus();
+ },
+ hashScroll: function(e) {
+ var el, hash;
+ if (e) {
+ if (e.state) {
+ return;
+ }
+ if (!history.state) {
+ history.replaceState({}, '');
+ }
+ }
+ if ((hash = location.hash.slice(1))) {
+ ReplyPruning.showIfHidden(hash);
+ if ((el = $.id(hash))) {
+ return $.queueTask(function() {
+ return Header.scrollTo(el);
+ });
+ }
+ }
+ },
+ scrollTo: function(root, down, needed) {
+ var height, x;
+ if (!root.offsetParent) {
+ return;
+ }
+ if (down) {
+ x = Header.getBottomOf(root);
+ if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && Conf['Bottom header']) {
+ height = Header.bar.getBoundingClientRect().height;
+ if (x <= 0) {
+ if (!Header.isHidden()) {
+ x += height;
+ }
+ } else {
+ if (Header.isHidden()) {
+ x -= height;
+ }
+ }
+ }
+ if (!(needed && x >= 0)) {
+ return window.scrollBy(0, -x);
+ }
+ } else {
+ x = Header.getTopOf(root);
+ if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && !Conf['Bottom header']) {
+ height = Header.bar.getBoundingClientRect().height;
+ if (x >= 0) {
+ if (!Header.isHidden()) {
+ x += height;
+ }
+ } else {
+ if (Header.isHidden()) {
+ x -= height;
+ }
+ }
+ }
+ if (!(needed && x >= 0)) {
+ return window.scrollBy(0, x);
+ }
+ }
+ },
+ scrollToIfNeeded: function(root, down) {
+ return Header.scrollTo(root, down, true);
+ },
+ getTopOf: function(root) {
+ var headRect, top;
+ top = root.getBoundingClientRect().top;
+ if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
+ headRect = Header.toggle.getBoundingClientRect();
+ top -= headRect.top + headRect.height;
+ }
+ return top;
+ },
+ getBottomOf: function(root) {
+ var bottom, clientHeight, headRect;
+ clientHeight = doc.clientHeight;
+ bottom = clientHeight - root.getBoundingClientRect().bottom;
+ if (Conf['Fixed Header'] && Conf['Bottom Header']) {
+ headRect = Header.toggle.getBoundingClientRect();
+ bottom -= clientHeight - headRect.bottom + headRect.height;
+ }
+ return bottom;
+ },
+ isNodeVisible: function(node) {
+ var height;
+ if (d.hidden || !doc.contains(node)) {
+ return false;
+ }
+ height = node.getBoundingClientRect().height;
+ return Header.getTopOf(node) + height >= 0 && Header.getBottomOf(node) + height >= 0;
+ },
+ isHidden: function() {
+ var top;
+ top = Header.bar.getBoundingClientRect().top;
+ if (Conf['Bottom header']) {
+ return top === doc.clientHeight;
+ } else {
+ return top < 0;
+ }
+ },
+ addShortcut: function(el) {
+ var shortcut;
+ shortcut = $.el('span', {
+ className: 'shortcut brackets-wrap'
+ });
+ $.add(shortcut, el);
+ return $.prepend(Header.shortcuts, shortcut);
+ },
+ rmShortcut: function(el) {
+ return $.rm(el.parentElement);
+ },
+ menuToggle: function(e) {
+ return Header.menu.toggle(e, this, g);
+ },
+ createNotification: function(e) {
+ var content, lifetime, notice, ref, type;
+ ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime;
+ return notice = new Notice(type, content, lifetime);
+ },
+ areNotificationsEnabled: false,
+ enableDesktopNotifications: function() {
+ var authorize, disable, el, notice, ref;
+ if (!(window.Notification && Conf['Desktop Notifications'])) {
+ return;
+ }
+ switch (Notification.permission) {
+ case 'granted':
+ Header.areNotificationsEnabled = true;
+ return;
+ case 'denied':
+ return;
+ }
+ el = $.el('span', {
+ innerHTML: "4chan X needs your permission to show desktop notifications. [FAQ ]Authorize or Disable "
+ });
+ ref = $$('button', el), authorize = ref[0], disable = ref[1];
+ $.on(authorize, 'click', function() {
+ return Notification.requestPermission(function(status) {
+ Header.areNotificationsEnabled = status === 'granted';
+ if (status === 'default') {
+ return;
+ }
+ return notice.close();
+ });
+ });
+ $.on(disable, 'click', function() {
+ $.set('Desktop Notifications', false);
+ return notice.close();
+ });
+ return notice = new Notice('info', el);
+ }
+ };
+
+ return Header;
+
+}).call(this);
+
+Index = (function() {
+ var Index,
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Index = {
+ showHiddenThreads: false,
+ changed: {},
+ init: function() {
+ var anchorEntry, input, j, k, label, len, len1, name, pinEntry, ref, ref1, ref2, ref3, ref4, ref5, ref6, refNavEntry, repliesEntry, select, sortEntry;
+ if (g.BOARD.ID === 'f' || !Conf['JSON Index'] || g.VIEW !== 'index') {
+ return;
+ }
+ Callbacks.CatalogThread.push({
+ name: 'Catalog Features',
+ cb: this.catalogNode
+ });
+ this.search = ((ref = history.state) != null ? ref.searched : void 0) || '';
+ if ((ref1 = history.state) != null ? ref1.mode : void 0) {
+ Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0;
+ }
+ this.currentSort = (ref3 = history.state) != null ? ref3.sort : void 0;
+ this.currentSort || (this.currentSort = typeof Conf['Index Sort'] === 'object' ? Conf['Index Sort'][g.BOARD.ID] || 'bump' : Conf['Index Sort']);
+ this.currentPage = this.getCurrentPage();
+ this.processHash();
+ $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
+ $.on(window, 'popstate', this.cb.popstate);
+ $.on(d, 'scroll', Index.scroll);
+ this.button = $.el('a', {
+ className: 'index-refresh-shortcut fa fa-refresh',
+ title: 'Refresh',
+ href: 'javascript:;',
+ textContent: 'Refresh Index'
+ });
+ $.on(this.button, 'click', function() {
+ return Index.update();
+ });
+ Header.addShortcut(this.button, 1);
+ repliesEntry = {
+ el: UI.checkbox('Show Replies', 'Show replies')
+ };
+ sortEntry = {
+ el: UI.checkbox('Per-Board Sort Type', 'Per-board sort type', typeof Conf['Index Sort'] === 'object')
+ };
+ pinEntry = {
+ el: UI.checkbox('Pin Watched Threads', 'Pin watched threads')
+ };
+ anchorEntry = {
+ el: UI.checkbox('Anchor Hidden Threads', 'Anchor hidden threads')
+ };
+ refNavEntry = {
+ el: UI.checkbox('Refreshed Navigation', 'Refreshed navigation')
+ };
+ sortEntry.el.title = 'Set the sorting order of each board independently.';
+ pinEntry.el.title = 'Move watched threads to the start of the index.';
+ anchorEntry.el.title = 'Move hidden threads to the end of the index.';
+ refNavEntry.el.title = 'Refresh index when navigating through pages.';
+ ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
+ for (j = 0, len = ref4.length; j < len; j++) {
+ label = ref4[j];
+ input = label.el.firstChild;
+ name = input.name;
+ $.on(input, 'change', $.cb.checked);
+ switch (name) {
+ case 'Show Replies':
+ $.on(input, 'change', this.cb.replies);
+ break;
+ case 'Pin Watched Threads':
+ case 'Anchor Hidden Threads':
+ $.on(input, 'change', this.cb.resort);
+ }
+ }
+ $.on(sortEntry.el.firstChild, 'change', this.cb.perBoardSort);
+ Header.menu.addEntry({
+ el: $.el('span', {
+ textContent: 'Index Navigation'
+ }),
+ order: 100,
+ subEntries: [repliesEntry, sortEntry, pinEntry, anchorEntry, refNavEntry]
+ });
+ this.navLinks = $.el('div', {
+ className: 'navLinks json-index'
+ });
+ $.extend(this.navLinks, {
+ innerHTML: "Index Catalog Archive Bottom ... × — [Show ] Index Mode Paged Infinite scrolling All threads Catalog Index Sort Bump order Last reply Last long reply Creation date Reply count File count Image Size Small Large "
+ });
+ $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog();
+ if ((ref5 = g.BOARD.ID) === 'b' || ref5 === 'trash') {
+ $('.archlistlink', this.navLinks).hidden = true;
+ }
+ $.on($('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront);
+ this.searchInput = $('#index-search', this.navLinks);
+ this.setupSearch();
+ $.on(this.searchInput, 'input', this.onSearchInput);
+ $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
+ this.hideLabel = $('#hidden-label', this.navLinks);
+ $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
+ this.selectMode = $('#index-mode', this.navLinks);
+ this.selectSort = $('#index-sort', this.navLinks);
+ this.selectSize = $('#index-size', this.navLinks);
+ $.on(this.selectMode, 'change', this.cb.mode);
+ $.on(this.selectSort, 'change', this.cb.sort);
+ $.on(this.selectSize, 'change', $.cb.value);
+ $.on(this.selectSize, 'change', this.cb.size);
+ ref6 = [this.selectMode, this.selectSize];
+ for (k = 0, len1 = ref6.length; k < len1; k++) {
+ select = ref6[k];
+ select.value = Conf[select.name];
+ }
+ this.selectSort.value = Index.currentSort;
+ this.root = $.el('div', {
+ className: 'board json-index'
+ });
+ this.cb.size();
+ this.pagelist = $.el('div', {
+ className: 'pagelist json-index'
+ });
+ $.extend(this.pagelist, {
+ innerHTML: "
"
+ });
+ $('.cataloglink a', this.pagelist).href = CatalogLinks.catalog();
+ $.on(this.pagelist, 'click', this.cb.pageNav);
+ this.update(true);
+ $.onExists(doc, 'title + *', function() {
+ return d.title = d.title.replace(/\ -\ Page\ \d+/, '');
+ });
+ $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() {
+ var board, el, l, len2, len3, m, ref7, ref8, threadRoot, topNavPos;
+ Index.hat = $('.board > .thread > img:first-child');
+ if (Index.hat) {
+ if (Index.nodes) {
+ ref7 = Index.nodes;
+ for (l = 0, len2 = ref7.length; l < len2; l++) {
+ threadRoot = ref7[l];
+ $.prepend(threadRoot, Index.hat.cloneNode(false));
+ }
+ }
+ $.addClass(doc, 'hats-enabled');
+ $.addStyle(".catalog-thread::after {background-image: url(" + Index.hat.src + ");}");
+ }
+ board = $('.board');
+ $.replace(board, Index.root);
+ $.event('PostsInserted');
+ try {
+ d.implementation.createDocument(null, null, null).appendChild(board);
+ } catch (_error) {}
+ ref8 = $$('.navLinks');
+ for (m = 0, len3 = ref8.length; m < len3; m++) {
+ el = ref8[m];
+ $.rm(el);
+ }
+ $.rm($.id('ctrl-top'));
+ topNavPos = $.id('delform').previousElementSibling;
+ $.before(topNavPos, $.el('hr'));
+ return $.before(topNavPos, Index.navLinks);
+ });
+ return Main.ready(function() {
+ var pagelist;
+ if ((pagelist = $('.pagelist'))) {
+ $.replace(pagelist, Index.pagelist);
+ }
+ return $.rmClass(doc, 'index-loading');
+ });
+ },
+ scroll: function() {
+ var nodes, pageNum;
+ if (Index.req || !Index.liveThreadData || Conf['Index Mode'] !== 'infinite' || (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight))) {
+ return;
+ }
+ if (Index.pageNum == null) {
+ Index.pageNum = Index.currentPage;
+ }
+ pageNum = ++Index.pageNum;
+ if (pageNum > Index.pagesNum) {
+ return Index.endNotice();
+ }
+ nodes = Index.buildSinglePage(pageNum);
+ if (Conf['Show Replies']) {
+ Index.buildReplies(nodes);
+ }
+ return Index.buildStructure(nodes);
+ },
+ endNotice: (function() {
+ var notify, reset;
+ notify = false;
+ reset = function() {
+ return notify = false;
+ };
+ return function() {
+ if (notify) {
+ return;
+ }
+ notify = true;
+ new Notice('info', "Last page reached.", 2);
+ return setTimeout(reset, 3 * $.SECOND);
+ };
+ })(),
+ menu: {
+ init: function() {
+ if (g.VIEW !== 'index' || !Conf['JSON Index'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
+ return;
+ }
+ return Menu.menu.addEntry({
+ el: $.el('a', {
+ href: 'javascript:;',
+ className: 'has-shortcut-text'
+ }, {
+ innerHTML: "Shift+click "
+ }),
+ order: 20,
+ open: function(arg) {
+ var thread;
+ thread = arg.thread;
+ if (Conf['Index Mode'] !== 'catalog') {
+ return false;
+ }
+ this.el.firstElementChild.textContent = thread.isHidden ? 'Unhide' : 'Hide';
+ if (this.cb) {
+ $.off(this.el, 'click', this.cb);
+ }
+ this.cb = function() {
+ $.event('CloseMenu');
+ return Index.toggleHide(thread);
+ };
+ $.on(this.el, 'click', this.cb);
+ return true;
+ }
+ });
+ }
+ },
+ catalogNode: function() {
+ return $.on(this.nodes.thumb.parentNode, 'click', Index.onClick);
+ },
+ onClick: function(e) {
+ var thread;
+ if (e.button !== 0) {
+ return;
+ }
+ thread = g.threads[this.parentNode.dataset.fullID];
+ if (e.shiftKey) {
+ Index.toggleHide(thread);
+ } else {
+ return;
+ }
+ return e.preventDefault();
+ },
+ toggleHide: function(thread) {
+ $.rm(thread.catalogView.nodes.root);
+ if (Index.showHiddenThreads) {
+ ThreadHiding.show(thread);
+ if (!ThreadHiding.db.get({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ })) {
+ return;
+ }
+ } else {
+ ThreadHiding.hide(thread);
+ }
+ return ThreadHiding.saveHiddenState(thread);
+ },
+ cycleSortType: function() {
+ var i, j, len, type, types;
+ types = slice.call(Index.selectSort.options).filter(function(option) {
+ return !option.disabled;
+ });
+ for (i = j = 0, len = types.length; j < len; i = ++j) {
+ type = types[i];
+ if (type.selected) {
+ break;
+ }
+ }
+ types[(i + 1) % types.length].selected = true;
+ return $.event('change', null, Index.selectSort);
+ },
+ cb: {
+ toggleHiddenThreads: function() {
+ $('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? 'Hide' : 'Show';
+ Index.sort();
+ return Index.buildIndex();
+ },
+ mode: function() {
+ Index.pushState({
+ mode: this.value
+ });
+ return Index.pageLoad(false);
+ },
+ sort: function() {
+ Index.pushState({
+ sort: this.value
+ });
+ return Index.pageLoad(false);
+ },
+ resort: function() {
+ Index.sort();
+ return Index.buildIndex();
+ },
+ perBoardSort: function() {
+ Conf['Index Sort'] = this.checked ? {} : '';
+ return Index.saveSort();
+ },
+ size: function(e) {
+ if (Conf['Index Mode'] !== 'catalog') {
+ $.rmClass(Index.root, 'catalog-small');
+ $.rmClass(Index.root, 'catalog-large');
+ } else if (Conf['Index Size'] === 'small') {
+ $.addClass(Index.root, 'catalog-small');
+ $.rmClass(Index.root, 'catalog-large');
+ } else {
+ $.addClass(Index.root, 'catalog-large');
+ $.rmClass(Index.root, 'catalog-small');
+ }
+ if (e) {
+ return Index.buildIndex();
+ }
+ },
+ replies: function() {
+ Index.buildThreads();
+ Index.sort();
+ return Index.buildIndex();
+ },
+ popstate: function(e) {
+ var mode, nCommands, page, ref, searched, sort;
+ if (e != null ? e.state : void 0) {
+ ref = e.state, searched = ref.searched, mode = ref.mode, sort = ref.sort;
+ page = Index.getCurrentPage();
+ Index.setState({
+ search: searched,
+ mode: mode,
+ sort: sort,
+ page: page
+ });
+ return Index.pageLoad(false);
+ } else {
+ nCommands = Index.processHash();
+ if (Conf['Refreshed Navigation'] && nCommands) {
+ return Index.update();
+ } else {
+ return Index.pageLoad();
+ }
+ }
+ },
+ pageNav: function(e) {
+ var a;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ switch (e.target.nodeName) {
+ case 'BUTTON':
+ e.target.blur();
+ a = e.target.parentNode;
+ break;
+ case 'A':
+ a = e.target;
+ break;
+ default:
+ return;
+ }
+ if (a.textContent === 'Catalog') {
+ return;
+ }
+ e.preventDefault();
+ return Index.userPageNav(+a.pathname.split(/\/+/)[2] || 1);
+ },
+ refreshFront: function() {
+ Index.pushState({
+ page: 1
+ });
+ return Index.update();
+ }
+ },
+ scrollToIndex: function() {
+ return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root));
+ },
+ getCurrentPage: function() {
+ return +window.location.pathname.split(/\/+/)[2] || 1;
+ },
+ userPageNav: function(page) {
+ Index.pushState({
+ page: page
+ });
+ if (Conf['Refreshed Navigation']) {
+ return Index.update();
+ } else {
+ return Index.pageLoad();
+ }
+ },
+ hashCommands: {
+ mode: {
+ 'paged': 'paged',
+ 'infinite-scrolling': 'infinite',
+ 'infinite': 'infinite',
+ 'all-threads': 'all pages',
+ 'all-pages': 'all pages',
+ 'catalog': 'catalog'
+ },
+ sort: {
+ 'bump-order': 'bump',
+ 'last-reply': 'lastreply',
+ 'last-long-reply': 'lastlong',
+ 'creation-date': 'birth',
+ 'reply-count': 'replycount',
+ 'file-count': 'filecount'
+ }
+ },
+ processHash: function() {
+ var command, commands, hash, j, leftover, len, mode, ref, sort, state;
+ hash = ((ref = location.href.match(/#.*/)) != null ? ref[0] : void 0) || '';
+ state = {
+ replace: true
+ };
+ commands = hash.slice(1).split('/');
+ leftover = [];
+ for (j = 0, len = commands.length; j < len; j++) {
+ command = commands[j];
+ if ((mode = Index.hashCommands.mode[command])) {
+ state.mode = mode;
+ } else if (command === 'index') {
+ state.mode = Conf['Previous Index Mode'];
+ state.page = 1;
+ } else if ((sort = Index.hashCommands.sort[command])) {
+ state.sort = sort;
+ } else if (/^s=/.test(command)) {
+ state.search = decodeURIComponent(command.slice(2)).replace(/\+/g, ' ').trim();
+ } else {
+ leftover.push(command);
+ }
+ }
+ hash = leftover.join('/');
+ if (hash) {
+ state.hash = "#" + hash;
+ }
+ Index.pushState(state);
+ return commands.length - leftover.length;
+ },
+ pushState: function(state) {
+ var hash, pageBeforeSearch, pathname, ref, replace, search;
+ search = state.search, hash = state.hash, replace = state.replace;
+ pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0;
+ if ((search != null) && search !== Index.search) {
+ state.page = search ? 1 : pageBeforeSearch || 1;
+ if (!search) {
+ pageBeforeSearch = void 0;
+ } else if (!Index.search) {
+ pageBeforeSearch = Index.currentPage;
+ }
+ }
+ Index.setState(state);
+ pathname = Index.currentPage === 1 ? "/" + g.BOARD + "/" : "/" + g.BOARD + "/" + Index.currentPage;
+ hash || (hash = '');
+ return history[replace ? 'replaceState' : 'pushState']({
+ mode: Conf['Index Mode'],
+ sort: Index.currentSort,
+ searched: Index.search,
+ oldpage: pageBeforeSearch
+ }, '', location.protocol + "//" + location.host + pathname + hash);
+ },
+ setState: function(arg) {
+ var hash, mode, page, ref, search, sort;
+ search = arg.search, mode = arg.mode, sort = arg.sort, page = arg.page, hash = arg.hash;
+ if ((search != null) && search !== Index.search) {
+ Index.changed.search = true;
+ Index.search = search;
+ }
+ if ((mode != null) && mode !== Conf['Index Mode']) {
+ Index.changed.mode = true;
+ Conf['Index Mode'] = mode;
+ $.set('Index Mode', mode);
+ if (!(mode === 'catalog' || Conf['Previous Index Mode'] === mode)) {
+ Conf['Previous Index Mode'] = mode;
+ $.set('Previous Index Mode', mode);
+ }
+ }
+ if ((sort != null) && sort !== Index.currentSort) {
+ Index.changed.sort = true;
+ Index.currentSort = sort;
+ Index.saveSort();
+ }
+ if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') {
+ page = 1;
+ }
+ if ((page != null) && page !== Index.currentPage) {
+ Index.changed.page = true;
+ Index.currentPage = page;
+ }
+ if (hash != null) {
+ return Index.changed.hash = true;
+ }
+ },
+ saveSort: function() {
+ if (typeof Conf['Index Sort'] === 'object') {
+ Conf['Index Sort'][g.BOARD.ID] = Index.currentSort;
+ } else {
+ Conf['Index Sort'] = Index.currentSort;
+ }
+ return $.set('Index Sort', Conf['Index Sort']);
+ },
+ pageLoad: function(scroll) {
+ var hash, mode, page, ref, search, sort, threads;
+ if (scroll == null) {
+ scroll = true;
+ }
+ if (!Index.liveThreadData) {
+ return;
+ }
+ ref = Index.changed, threads = ref.threads, search = ref.search, mode = ref.mode, sort = ref.sort, page = ref.page, hash = ref.hash;
+ if (threads || search || sort) {
+ Index.sort();
+ }
+ if (threads || search) {
+ Index.buildPagelist();
+ }
+ if (search) {
+ Index.setupSearch();
+ }
+ if (mode) {
+ Index.setupMode();
+ }
+ if (sort) {
+ Index.setupSort();
+ }
+ if (threads || search || mode || page || sort) {
+ Index.buildIndex();
+ }
+ if (threads || search || mode || page) {
+ Index.setPage();
+ }
+ if (scroll && !hash) {
+ Index.scrollToIndex();
+ }
+ if (hash) {
+ Header.hashScroll();
+ }
+ return Index.changed = {};
+ },
+ setupMode: function() {
+ var j, len, mode, ref;
+ ref = ['paged', 'infinite', 'all pages', 'catalog'];
+ for (j = 0, len = ref.length; j < len; j++) {
+ mode = ref[j];
+ $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode");
+ }
+ Index.selectMode.value = Conf['Index Mode'];
+ Index.cb.size();
+ Index.showHiddenThreads = false;
+ return $('#hidden-toggle a', Index.navLinks).textContent = 'Show';
+ },
+ setupSort: function() {
+ return Index.selectSort.value = Index.currentSort;
+ },
+ getPagesNum: function() {
+ if (Index.search) {
+ return Math.ceil(Index.sortedNodes.length / Index.threadsNumPerPage);
+ } else {
+ return Index.pagesNum;
+ }
+ },
+ getMaxPageNum: function() {
+ return Math.max(1, Index.getPagesNum());
+ },
+ buildPagelist: function() {
+ var a, i, j, maxPageNum, nodes, pagesRoot, ref;
+ pagesRoot = $('.pages', Index.pagelist);
+ maxPageNum = Index.getMaxPageNum();
+ if (pagesRoot.childElementCount !== maxPageNum) {
+ nodes = [];
+ for (i = j = 1, ref = maxPageNum; j <= ref; i = j += 1) {
+ a = $.el('a', {
+ textContent: i,
+ href: i === 1 ? './' : i
+ });
+ nodes.push($.tn('['), a, $.tn('] '));
+ }
+ $.rmAll(pagesRoot);
+ return $.add(pagesRoot, nodes);
+ }
+ },
+ setPage: function() {
+ var a, href, maxPageNum, next, pageNum, pagesRoot, prev, strong;
+ pageNum = Index.currentPage;
+ maxPageNum = Index.getMaxPageNum();
+ pagesRoot = $('.pages', Index.pagelist);
+ prev = pagesRoot.previousSibling.firstChild;
+ next = pagesRoot.nextSibling.firstChild;
+ href = Math.max(pageNum - 1, 1);
+ prev.href = href === 1 ? './' : href;
+ prev.firstChild.disabled = href === pageNum;
+ href = Math.min(pageNum + 1, maxPageNum);
+ next.href = href === 1 ? './' : href;
+ next.firstChild.disabled = href === pageNum;
+ if (strong = $('strong', pagesRoot)) {
+ if (+strong.textContent === pageNum) {
+ return;
+ }
+ $.replace(strong, strong.firstChild);
+ } else {
+ strong = $.el('strong');
+ }
+ a = pagesRoot.children[pageNum - 1];
+ $.before(a, strong);
+ return $.add(strong, a);
+ },
+ updateHideLabel: function() {
+ var hiddenCount, ref, ref1, thread, threadID;
+ hiddenCount = 0;
+ ref = g.BOARD.threads;
+ for (threadID in ref) {
+ thread = ref[threadID];
+ if (thread.isHidden) {
+ if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) >= 0) {
+ hiddenCount++;
+ }
+ }
+ }
+ if (!hiddenCount) {
+ Index.hideLabel.hidden = true;
+ if (Index.showHiddenThreads) {
+ Index.cb.toggleHiddenThreads();
+ }
+ return;
+ }
+ Index.hideLabel.hidden = false;
+ return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads";
+ },
+ update: function(firstTime) {
+ var now, ref, ref1;
+ if ((ref = Index.req) != null) {
+ ref.abort();
+ }
+ if ((ref1 = Index.notice) != null) {
+ ref1.close();
+ }
+ if (Conf['Index Refresh Notifications'] && d.readyState !== 'loading') {
+ Index.notice = new Notice('info', 'Refreshing index...');
+ } else {
+ now = Date.now();
+ $.ready(function() {
+ return Index.nTimeout = setTimeout((function() {
+ if (Index.req && !Index.notice) {
+ return Index.notice = new Notice('info', 'Refreshing index...');
+ }
+ }), 3 * $.SECOND - (Date.now() - now));
+ });
+ }
+ if (!firstTime && d.readyState !== 'loading' && !$('.board + *')) {
+ location.reload();
+ return;
+ }
+ Index.req = $.ajax("//a.4cdn.org/" + g.BOARD + "/catalog.json", {
+ onabort: Index.load,
+ onloadend: Index.load
+ }, {
+ whenModified: 'Index'
+ });
+ return $.addClass(Index.button, 'fa-spin');
+ },
+ load: function(e) {
+ var err, nTimeout, notice, ref, req, timeEl;
+ $.rmClass(Index.button, 'fa-spin');
+ req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
+ if (nTimeout) {
+ clearTimeout(nTimeout);
+ }
+ delete Index.nTimeout;
+ delete Index.req;
+ delete Index.notice;
+ if (e.type === 'abort') {
+ req.onloadend = null;
+ if (notice != null) {
+ notice.close();
+ }
+ return;
+ }
+ if ((ref = req.status) !== 200 && ref !== 304) {
+ err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
+ if (notice) {
+ notice.setType('warning');
+ notice.el.lastElementChild.textContent = err;
+ setTimeout(notice.close, $.SECOND);
+ } else {
+ new Notice('warning', err, 1);
+ }
+ return;
+ }
+ try {
+ if (req.status === 200) {
+ Index.parse(req.response);
+ } else if (req.status === 304) {
+ Index.pageLoad();
+ }
+ } catch (_error) {
+ err = _error;
+ c.error("Index failure: " + err.message, err.stack);
+ if (notice) {
+ notice.setType('error');
+ notice.el.lastElementChild.textContent = 'Index refresh failed.';
+ setTimeout(notice.close, $.SECOND);
+ } else {
+ new Notice('error', 'Index refresh failed.', 1);
+ }
+ return;
+ }
+ if (notice) {
+ if (Conf['Index Refresh Notifications']) {
+ notice.setType('success');
+ notice.el.lastElementChild.textContent = 'Index refreshed!';
+ setTimeout(notice.close, $.SECOND);
+ } else {
+ notice.close();
+ }
+ }
+ timeEl = $('#index-last-refresh time', Index.navLinks);
+ timeEl.dataset.utc = Date.parse(req.getResponseHeader('Last-Modified'));
+ return RelativeDates.update(timeEl);
+ },
+ parse: function(pages) {
+ $.cleanCache(function(url) {
+ return /^\/\/a\.4cdn\.org\//.test(url);
+ });
+ Index.parseThreadList(pages);
+ Index.buildThreads();
+ Index.changed.threads = true;
+ return Index.pageLoad();
+ },
+ parseThreadList: function(pages) {
+ var ref;
+ Index.pagesNum = pages.length;
+ Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1;
+ Index.liveThreadData = pages.reduce((function(arr, next) {
+ return arr.concat(next.threads);
+ }), []);
+ Index.liveThreadIDs = Index.liveThreadData.map(function(data) {
+ return data.no;
+ });
+ g.BOARD.threads.forEach(function(thread) {
+ var ref1;
+ if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) < 0) {
+ return thread.collect();
+ }
+ });
+ },
+ buildThreads: function() {
+ var err, errors, i, j, len, posts, ref, thread, threadData, threadRoot, threads;
+ if (!Index.liveThreadData) {
+ return;
+ }
+ Index.nodes = [];
+ threads = [];
+ posts = [];
+ ref = Index.liveThreadData;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ threadData = ref[i];
+ try {
+ threadRoot = Build.thread(g.BOARD, threadData);
+ if (Index.hat) {
+ $.prepend(threadRoot, Index.hat.cloneNode(false));
+ }
+ if (thread = g.BOARD.threads[threadData.no]) {
+ thread.setCount('post', threadData.replies + 1, threadData.bumplimit);
+ thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit);
+ thread.setStatus('Sticky', !!threadData.sticky);
+ thread.setStatus('Closed', !!threadData.closed);
+ } else {
+ thread = new Thread(threadData.no, g.BOARD);
+ threads.push(thread);
+ }
+ Index.nodes.push(threadRoot);
+ if (!(thread.OP && !thread.OP.isFetchedQuote)) {
+ posts.push(new Post($('.opContainer', threadRoot), thread, g.BOARD));
+ }
+ thread.setPage(Math.floor(i / Index.threadsNumPerPage) + 1);
+ } catch (_error) {
+ err = _error;
+ if (!errors) {
+ errors = [];
+ }
+ errors.push({
+ message: "Parsing of Thread No." + thread + " failed. Thread will be skipped.",
+ error: err
+ });
+ }
+ }
+ if (errors) {
+ Main.handleErrors(errors);
+ }
+ $.nodes(Index.nodes);
+ Main.callbackNodes('Thread', threads);
+ Main.callbackNodes('Post', posts);
+ Index.updateHideLabel();
+ return $.event('IndexRefresh');
+ },
+ buildReplies: function(threadRoots) {
+ var data, err, errors, i, j, k, lastReplies, len, len1, node, nodes, post, posts, thread, threadRoot;
+ posts = [];
+ for (j = 0, len = threadRoots.length; j < len; j++) {
+ threadRoot = threadRoots[j];
+ thread = Get.threadFromRoot(threadRoot);
+ i = Index.liveThreadIDs.indexOf(thread.ID);
+ if (!(lastReplies = Index.liveThreadData[i].last_replies)) {
+ continue;
+ }
+ nodes = [];
+ for (k = 0, len1 = lastReplies.length; k < len1; k++) {
+ data = lastReplies[k];
+ if ((post = thread.posts[data.no]) && !post.isFetchedQuote) {
+ nodes.push(post.nodes.root);
+ continue;
+ }
+ nodes.push(node = Build.postFromObject(data, thread.board.ID));
+ try {
+ posts.push(new Post(node, thread, thread.board));
+ } catch (_error) {
+ err = _error;
+ if (!errors) {
+ errors = [];
+ }
+ errors.push({
+ message: "Parsing of Post No." + data.no + " failed. Post will be skipped.",
+ error: err
+ });
+ }
+ }
+ $.add(threadRoot, nodes);
+ }
+ if (errors) {
+ Main.handleErrors(errors);
+ }
+ return Main.callbackNodes('Post', posts);
+ },
+ buildCatalogViews: function() {
+ var catalogThreads, j, len, thread, threads;
+ threads = Index.sortedNodes.map(function(threadRoot) {
+ return Get.threadFromRoot(threadRoot);
+ }).filter(function(thread) {
+ return !thread.isHidden !== Index.showHiddenThreads;
+ });
+ catalogThreads = [];
+ for (j = 0, len = threads.length; j < len; j++) {
+ thread = threads[j];
+ if (!thread.catalogView) {
+ catalogThreads.push(new CatalogThread(Build.catalogThread(thread), thread));
+ }
+ }
+ Main.callbackNodes('CatalogThread', catalogThreads);
+ return threads.map(function(thread) {
+ return thread.catalogView.nodes.root;
+ });
+ },
+ sizeCatalogViews: function(nodes) {
+ var height, j, len, node, ratio, ref, size, thumb, width;
+ size = Conf['Index Size'] === 'small' ? 150 : 250;
+ for (j = 0, len = nodes.length; j < len; j++) {
+ node = nodes[j];
+ thumb = $('.catalog-thumb', node);
+ ref = thumb.dataset, width = ref.width, height = ref.height;
+ if (!width) {
+ continue;
+ }
+ ratio = size / Math.max(width, height);
+ thumb.style.width = width * ratio + 'px';
+ thumb.style.height = height * ratio + 'px';
+ }
+ },
+ sort: function() {
+ var j, lastlong, len, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
+ liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
+ if (!liveThreadData) {
+ return;
+ }
+ sortedThreadIDs = (function() {
+ switch (Index.currentSort) {
+ case 'lastreply':
+ return slice.call(liveThreadData).sort(function(a, b) {
+ var num;
+ if ((num = a.last_replies)) {
+ a = num[num.length - 1];
+ }
+ if ((num = b.last_replies)) {
+ b = num[num.length - 1];
+ }
+ return b.no - a.no;
+ }).map(function(post) {
+ return post.no;
+ });
+ case 'lastlong':
+ lastlong = function(thread) {
+ var i, j, r, ref;
+ ref = thread.last_replies || [];
+ for (i = j = ref.length - 1; j >= 0; i = j += -1) {
+ r = ref[i];
+ if (r.com && Build.parseComment(r.com).replace(/[^a-z]/ig, '').length >= 100) {
+ return r;
+ }
+ }
+ return thread;
+ };
+ return slice.call(liveThreadData).sort(function(a, b) {
+ return lastlong(b).no - lastlong(a).no;
+ }).map(function(post) {
+ return post.no;
+ });
+ case 'bump':
+ return liveThreadIDs;
+ case 'birth':
+ return slice.call(liveThreadIDs).sort(function(a, b) {
+ return b - a;
+ });
+ case 'replycount':
+ return slice.call(liveThreadData).sort(function(a, b) {
+ return b.replies - a.replies;
+ }).map(function(post) {
+ return post.no;
+ });
+ case 'filecount':
+ return slice.call(liveThreadData).sort(function(a, b) {
+ return b.images - a.images;
+ }).map(function(post) {
+ return post.no;
+ });
+ }
+ })();
+ Index.sortedNodes = sortedNodes = [];
+ nodes = Index.nodes;
+ for (j = 0, len = sortedThreadIDs.length; j < len; j++) {
+ threadID = sortedThreadIDs[j];
+ sortedNodes.push(nodes[Index.liveThreadIDs.indexOf(threadID)]);
+ }
+ if (Index.search && (nodes = Index.querySearch(Index.search))) {
+ Index.sortedNodes = nodes;
+ }
+ Index.sortOnTop(function(thread) {
+ return thread.isSticky;
+ });
+ Index.sortOnTop(function(thread) {
+ return thread.isOnTop || Conf['Pin Watched Threads'] && ThreadWatcher.isWatched(thread);
+ });
+ if (Conf['Anchor Hidden Threads']) {
+ return Index.sortOnTop(function(thread) {
+ return !thread.isHidden;
+ });
+ }
+ },
+ sortOnTop: function(match) {
+ var bottomNodes, j, len, ref, threadRoot, topNodes;
+ topNodes = [];
+ bottomNodes = [];
+ ref = Index.sortedNodes;
+ for (j = 0, len = ref.length; j < len; j++) {
+ threadRoot = ref[j];
+ (match(Get.threadFromRoot(threadRoot)) ? topNodes : bottomNodes).push(threadRoot);
+ }
+ return Index.sortedNodes = topNodes.concat(bottomNodes);
+ },
+ buildIndex: function() {
+ var i, nodes, page, post;
+ if (!Index.liveThreadData) {
+ return;
+ }
+ switch (Conf['Index Mode']) {
+ case 'all pages':
+ nodes = Index.sortedNodes;
+ break;
+ case 'catalog':
+ nodes = Index.buildCatalogViews();
+ Index.sizeCatalogViews(nodes);
+ break;
+ default:
+ if (Index.followedThreadID != null) {
+ i = 0;
+ while (Index.followedThreadID !== Get.threadFromRoot(Index.sortedNodes[i]).ID) {
+ i++;
+ }
+ page = Math.floor(i / Index.threadsNumPerPage) + 1;
+ if (page !== Index.currentPage) {
+ Index.currentPage = page;
+ Index.pushState({
+ page: page
+ });
+ Index.setPage();
+ }
+ }
+ nodes = Index.buildSinglePage(Index.currentPage);
+ }
+ delete Index.pageNum;
+ $.rmAll(Index.root);
+ $.rmAll(Header.hover);
+ if (Conf['Index Mode'] === 'catalog') {
+ return $.add(Index.root, nodes);
+ } else {
+ if (Conf['Show Replies']) {
+ Index.buildReplies(nodes);
+ }
+ Index.buildStructure(nodes);
+ if ((Index.followedThreadID != null) && (post = g.posts[g.BOARD + "." + Index.followedThreadID])) {
+ return Header.scrollTo(post.nodes.root);
+ }
+ }
+ },
+ buildSinglePage: function(pageNum) {
+ var nodesPerPage, offset;
+ nodesPerPage = Index.threadsNumPerPage;
+ offset = nodesPerPage * (pageNum - 1);
+ return Index.sortedNodes.slice(offset, offset + nodesPerPage);
+ },
+ buildStructure: function(nodes) {
+ var j, len, node, thumb;
+ for (j = 0, len = nodes.length; j < len; j++) {
+ node = nodes[j];
+ if (thumb = $('img[data-src]', node)) {
+ thumb.src = thumb.dataset.src;
+ thumb.removeAttribute('data-src');
+ }
+ $.add(Index.root, [node, $.el('hr')]);
+ }
+ if (doc.contains(Index.root)) {
+ $.event('PostsInserted');
+ }
+ return ThreadHiding.onIndexBuild(nodes);
+ },
+ clearSearch: function() {
+ Index.searchInput.value = '';
+ Index.onSearchInput();
+ return Index.searchInput.focus();
+ },
+ setupSearch: function() {
+ Index.searchInput.value = Index.search;
+ if (Index.search) {
+ return Index.searchInput.dataset.searching = 1;
+ } else {
+ return Index.searchInput.removeAttribute('data-searching');
+ }
+ },
+ onSearchInput: function() {
+ var search;
+ search = Index.searchInput.value.trim();
+ if (search === Index.search) {
+ return;
+ }
+ Index.pushState({
+ search: search,
+ replace: !!search === !!Index.search
+ });
+ return Index.pageLoad(false);
+ },
+ querySearch: function(query) {
+ var keywords;
+ if (!(keywords = query.toLowerCase().match(/\S+/g))) {
+ return;
+ }
+ return Index.sortedNodes.filter(function(threadRoot) {
+ return Index.searchMatch(Get.threadFromRoot(threadRoot), keywords);
+ });
+ },
+ searchMatch: function(thread, keywords) {
+ var file, info, j, k, key, keyword, len, len1, ref, ref1, text;
+ ref = thread.OP, info = ref.info, file = ref.file;
+ text = [];
+ ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
+ for (j = 0, len = ref1.length; j < len; j++) {
+ key = ref1[j];
+ if (key in info) {
+ text.push(info[key]);
+ }
+ }
+ if (file) {
+ text.push(file.name);
+ }
+ text = text.join(' ').toLowerCase();
+ for (k = 0, len1 = keywords.length; k < len1; k++) {
+ keyword = keywords[k];
+ if (-1 === text.indexOf(keyword)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ };
+
+ return Index;
+
+}).call(this);
+
+Polyfill = (function() {
+ var Polyfill;
+
+ Polyfill = {
+ init: function() {
+ return this.toBlob();
+ },
+ toBlob: function() {
+ if (HTMLCanvasElement.prototype.toBlob) {
+ return;
+ }
+ HTMLCanvasElement.prototype.toBlob = function(cb, type, encoderOptions) {
+ var data, i, j, l, ref, ui8a, url;
+ if (type == null) {
+ type = 'image/png';
+ }
+ url = this.toDataURL(type, encoderOptions);
+ data = atob(url.slice(url.indexOf(',') + 1));
+ l = data.length;
+ ui8a = new Uint8Array(l);
+ for (i = j = 0, ref = l; j < ref; i = j += 1) {
+ ui8a[i] = data.charCodeAt(i);
+ }
+ return cb(new Blob([ui8a], {
+ type: type
+ }));
+ };
+ return $.globalEval("HTMLCanvasElement.prototype.toBlob = (" + HTMLCanvasElement.prototype.toBlob + ");");
+ }
+ };
+
+ return Polyfill;
+
+}).call(this);
+
+Settings = (function() {
+ var Settings,
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Settings = {
+ init: function() {
+ var add, link, settings;
+ link = $.el('a', {
+ className: 'settings-link fa fa-wrench',
+ textContent: 'Settings',
+ title: '4chan X Settings',
+ href: 'javascript:;'
+ });
+ $.on(link, 'click', Settings.open);
+ Header.addShortcut(link);
+ add = this.addSection;
+ add('Main', this.main);
+ add('Filter', this.filter);
+ add('Sauce', this.sauce);
+ add('Advanced', this.advanced);
+ add('Keybinds', this.keybinds);
+ $.on(d, 'AddSettingsSection', Settings.addSection);
+ $.on(d, 'OpenSettings', function(e) {
+ return Settings.open(e.detail);
+ });
+ if (Conf['Disable Native Extension']) {
+ if ($.hasStorage) {
+ settings = JSON.parse(localStorage.getItem('4chan-settings')) || {};
+ if (settings.disableAll) {
+ return;
+ }
+ settings.disableAll = true;
+ return localStorage.setItem('4chan-settings', JSON.stringify(settings));
+ } else {
+ return $.onExists(doc, 'body', function() {
+ return $.global(function() {
+ return window.Config.disableAll = true;
+ });
+ });
+ }
+ }
+ },
+ open: function(openSection) {
+ var dialog, j, len, link, links, overlay, ref, section, sectionToOpen;
+ if (Settings.overlay) {
+ return;
+ }
+ $.event('CloseMenu');
+ Settings.dialog = dialog = $.el('div', {
+ id: 'fourchanx-settings',
+ className: 'dialog'
+ });
+ $.extend(dialog, {
+ innerHTML: "
"
+ });
+ Settings.overlay = overlay = $.el('div', {
+ id: 'overlay'
+ });
+ $.on($('.export', dialog), 'click', Settings["export"]);
+ $.on($('.import', dialog), 'click', Settings["import"]);
+ $.on($('.reset', dialog), 'click', Settings.reset);
+ $.on($('input', dialog), 'change', Settings.onImport);
+ links = [];
+ ref = Settings.sections;
+ for (j = 0, len = ref.length; j < len; j++) {
+ section = ref[j];
+ link = $.el('a', {
+ className: "tab-" + section.hyphenatedTitle,
+ textContent: section.title,
+ href: 'javascript:;'
+ });
+ $.on(link, 'click', Settings.openSection.bind(section));
+ links.push(link, $.tn(' | '));
+ if (section.title === openSection) {
+ sectionToOpen = link;
+ }
+ }
+ links.pop();
+ $.add($('.sections-list', dialog), links);
+ if (openSection !== 'none') {
+ (sectionToOpen ? sectionToOpen : links[0]).click();
+ }
+ $.on($('.close', dialog), 'click', Settings.close);
+ $.on(overlay, 'click', Settings.close);
+ $.add(d.body, [overlay, dialog]);
+ return $.event('OpenSettings', null, dialog);
+ },
+ close: function() {
+ var ref;
+ if (!Settings.dialog) {
+ return;
+ }
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
+ }
+ $.rm(Settings.overlay);
+ $.rm(Settings.dialog);
+ delete Settings.overlay;
+ return delete Settings.dialog;
+ },
+ sections: [],
+ addSection: function(title, open) {
+ var hyphenatedTitle, ref;
+ if (typeof title !== 'string') {
+ ref = title.detail, title = ref.title, open = ref.open;
+ }
+ hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-');
+ return Settings.sections.push({
+ title: title,
+ hyphenatedTitle: hyphenatedTitle,
+ open: open
+ });
+ },
+ openSection: function() {
+ var section, selected;
+ if (selected = $('.tab-selected', Settings.dialog)) {
+ $.rmClass(selected, 'tab-selected');
+ }
+ $.addClass($(".tab-" + this.hyphenatedTitle, Settings.dialog), 'tab-selected');
+ section = $('section', Settings.dialog);
+ $.rmAll(section);
+ section.className = "section-" + this.hyphenatedTitle;
+ this.open(section, g);
+ section.scrollTop = 0;
+ return $.event('OpenSettings', null, section);
+ },
+ warnings: {
+ localStorage: function(cb) {
+ var why;
+ if ($.cantSync) {
+ why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs';
+ return cb($.el('li', {
+ textContent: "4chan X needs local storage to " + why + ".\nEnable it on boards.4chan.org in your browser's privacy settings (may be listed as part of \"local data\" or \"cookies\")."
+ }));
+ }
+ },
+ ads: function(cb) {
+ return $.onExists(doc, '.ad-cnt', function(ad) {
+ return $.onExists(ad, 'img', function() {
+ return cb($.el('li', {
+ innerHTML: "To protect yourself from malicious ads , you should block ads on 4chan."
+ }));
+ });
+ });
+ }
+ },
+ main: function(section) {
+ var addWarning, arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, ref, ref1, warning, warnings;
+ warnings = $.el('fieldset', {
+ hidden: true
+ }, {
+ innerHTML: "Warnings "
+ });
+ addWarning = function(item) {
+ $.add($('ul', warnings), item);
+ return warnings.hidden = false;
+ };
+ ref = Settings.warnings;
+ for (key in ref) {
+ warning = ref[key];
+ warning(addWarning);
+ }
+ $.add(section, warnings);
+ items = {};
+ inputs = {};
+ ref1 = Config.main;
+ for (key in ref1) {
+ obj = ref1[key];
+ fs = $.el('fieldset', {
+ innerHTML: "" + E(key) + " "
+ });
+ containers = [fs];
+ for (key in obj) {
+ arr = obj[key];
+ description = arr[1];
+ div = $.el('div', {
+ innerHTML: " " + E(key) + ": " + E(description) + " "
+ });
+ if ($.engine !== 'gecko' && key === 'Remember QR Size') {
+ div.hidden = true;
+ }
+ input = $('input', div);
+ $.on(input, 'change', function() {
+ this.parentNode.parentNode.dataset.checked = this.checked;
+ return $.cb.checked.call(this);
+ });
+ items[key] = Conf[key];
+ inputs[key] = input;
+ level = arr[2] || 0;
+ if (containers.length <= level) {
+ container = $.el('div', {
+ className: 'suboption-list'
+ });
+ $.add(containers[containers.length - 1].lastElementChild, container);
+ containers[level] = container;
+ } else if (containers.length > level + 1) {
+ containers.splice(level + 1, containers.length - (level + 1));
+ }
+ $.add(containers[level], div);
+ }
+ $.add(section, fs);
+ }
+ $.get(items, function(items) {
+ var val;
+ for (key in items) {
+ val = items[key];
+ inputs[key].checked = val;
+ inputs[key].parentNode.parentNode.dataset.checked = val;
+ }
+ });
+ div = $.el('div', {
+ innerHTML: ": Clear manually-hidden threads and posts on all boards. Reload the page to apply."
+ });
+ button = $('button', div);
+ $.get({
+ hiddenThreads: {},
+ hiddenPosts: {}
+ }, function(arg) {
+ var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref2, ref3, thread;
+ hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts;
+ hiddenNum = 0;
+ ref2 = hiddenThreads.boards;
+ for (ID in ref2) {
+ board = ref2[ID];
+ hiddenNum += Object.keys(board).length;
+ }
+ ref3 = hiddenPosts.boards;
+ for (ID in ref3) {
+ board = ref3[ID];
+ for (ID in board) {
+ thread = board[ID];
+ hiddenNum += Object.keys(thread).length;
+ }
+ }
+ return button.textContent = "Hidden: " + hiddenNum;
+ });
+ $.on(button, 'click', function() {
+ this.textContent = 'Hidden: 0';
+ return $.get('hiddenThreads', {}, function(arg) {
+ var boardID, hiddenThreads;
+ hiddenThreads = arg.hiddenThreads;
+ if ($.hasStorage) {
+ for (boardID in hiddenThreads.boards) {
+ localStorage.removeItem("4chan-hide-t-" + boardID);
+ }
+ }
+ return $["delete"](['hiddenThreads', 'hiddenPosts']);
+ });
+ });
+ return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
+ },
+ "export": function() {
+ return $.get(Conf, function(Conf) {
+ return Settings.downloadExport({
+ version: g.VERSION,
+ date: Date.now(),
+ Conf: Conf
+ });
+ });
+ },
+ downloadExport: function(data) {
+ var a, p;
+ a = $.el('a', {
+ download: "4chan X v" + g.VERSION + "-" + data.date + ".json",
+ href: "data:application/json;base64," + (btoa(unescape(encodeURIComponent(JSON.stringify(data, null, 2)))))
+ });
+ p = $('.imp-exp-result', Settings.dialog);
+ $.rmAll(p);
+ $.add(p, a);
+ return a.click();
+ },
+ "import": function() {
+ return $('input[type=file]', this.parentNode).click();
+ },
+ onImport: function() {
+ var file, output, reader;
+ if (!(file = this.files[0])) {
+ return;
+ }
+ this.value = null;
+ output = $('.imp-exp-result');
+ if (!confirm('Your current settings will be entirely overwritten, are you sure?')) {
+ output.textContent = 'Import aborted.';
+ return;
+ }
+ reader = new FileReader();
+ reader.onload = function(e) {
+ var err;
+ try {
+ return Settings.loadSettings(JSON.parse(e.target.result), function(err) {
+ if (err) {
+ return output.textContent = 'Import failed due to an error.';
+ } else if (confirm('Import successful. Reload now?')) {
+ return window.location.reload();
+ }
+ });
+ } catch (_error) {
+ err = _error;
+ output.textContent = 'Import failed due to an error.';
+ return c.error(err.stack);
+ }
+ };
+ return reader.readAsText(file);
+ },
+ convertFrom: {
+ loadletter: function(data) {
+ var base, boardID, convertSettings, key, ref, ref1, threadData, threadID, threads, val;
+ convertSettings = function(data, map) {
+ var newKey, prevKey;
+ for (prevKey in map) {
+ newKey = map[prevKey];
+ if (newKey) {
+ data.Conf[newKey] = data.Conf[prevKey];
+ }
+ delete data.Conf[prevKey];
+ }
+ return data;
+ };
+ data = convertSettings(data, {
+ 'Disable 4chan\'s extension': 'Disable Native Extension',
+ 'Comment Auto-Expansion': '',
+ 'Remove Slug': '',
+ 'Check for Updates': '',
+ 'Recursive Filtering': 'Recursive Hiding',
+ 'Reply Hiding': 'Reply Hiding Buttons',
+ 'Thread Hiding': 'Thread Hiding Buttons',
+ 'Show Stubs': 'Stubs',
+ 'Image Auto-Gif': 'Replace GIF',
+ 'Reveal Spoilers': 'Reveal Spoiler Thumbnails',
+ 'Expand From Current': 'Expand from here',
+ 'Post in Title': 'Thread Excerpt',
+ 'Current Page': 'Page Count in Stats',
+ 'Current Page Position': '',
+ 'Alternative captcha': 'Use Recaptcha v1',
+ 'Auto Submit': 'Post on Captcha Completion',
+ 'Open Reply in New Tab': 'Open Post in New Tab',
+ 'Remember QR size': 'Remember QR Size',
+ 'Remember Subject': '',
+ 'Quote Inline': 'Quote Inlining',
+ 'Quote Preview': 'Quote Previewing',
+ 'Indicate OP quote': 'Mark OP Quotes',
+ 'Indicate You quote': 'Mark Quotes of You',
+ 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes',
+ 'uniqueid': 'uniqueID',
+ 'mod': 'capcode',
+ 'email': '',
+ 'country': 'flag',
+ 'md5': 'MD5',
+ 'openEmptyQR': 'Open empty QR',
+ 'openQR': 'Open QR',
+ 'openOptions': 'Open settings',
+ 'close': 'Close',
+ 'spoiler': 'Spoiler tags',
+ 'sageru': 'Toggle sage',
+ 'code': 'Code tags',
+ 'submit': 'Submit QR',
+ 'watch': 'Watch',
+ 'update': 'Update',
+ 'unreadCountTo0': '',
+ 'expandAllImages': 'Expand images',
+ 'expandImage': 'Expand image',
+ 'zero': 'Front page',
+ 'nextPage': 'Next page',
+ 'previousPage': 'Previous page',
+ 'nextThread': 'Next thread',
+ 'previousThread': 'Previous thread',
+ 'expandThread': 'Expand thread',
+ 'openThreadTab': 'Open thread',
+ 'openThread': 'Open thread tab',
+ 'nextReply': 'Next reply',
+ 'previousReply': 'Previous reply',
+ 'hide': 'Hide',
+ 'Scrolling': 'Auto Scroll',
+ 'Verbose': ''
+ });
+ data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) {
+ switch (c) {
+ case '$1':
+ return '%TURL';
+ case '$2':
+ return '%URL';
+ case '$3':
+ return '%MD5';
+ case '$4':
+ return '%board';
+ default:
+ return c;
+ }
+ });
+ ref = Config.hotkeys;
+ for (key in ref) {
+ val = ref[key];
+ if (key in data.Conf) {
+ data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) {
+ return "" + (s[0].toUpperCase()) + s.slice(1);
+ }).replace(/(^|.+\+)[A-Z]$/g, function(s) {
+ return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase());
+ });
+ }
+ }
+ if (data.WatchedThreads) {
+ data.Conf['watchedThreads'] = {
+ boards: {}
+ };
+ ref1 = data.WatchedThreads;
+ for (boardID in ref1) {
+ threads = ref1[boardID];
+ for (threadID in threads) {
+ threadData = threads[threadID];
+ ((base = data.Conf['watchedThreads'].boards)[boardID] || (base[boardID] = {}))[threadID] = {
+ excerpt: threadData.textContent
+ };
+ }
+ }
+ }
+ return data;
+ }
+ },
+ upgrade: function(data, version) {
+ var boardID, changes, compareString, j, key, len, name, record, ref, ref1, ref2, ref3, ref4, ref5, rice, set, type, uids, value;
+ changes = {};
+ set = function(key, value) {
+ return data[key] = changes[key] = value;
+ };
+ compareString = version.replace(/\d+/g, function(x) {
+ return ('0000' + x).slice(-5);
+ });
+ if (compareString < '00001.00011.00008.00000') {
+ if (data['Fixed Thread Watcher'] == null) {
+ set('Fixed Thread Watcher', (ref = data['Toggleable Thread Watcher']) != null ? ref : true);
+ }
+ if (data['Exempt Archives from Encryption'] == null) {
+ set('Exempt Archives from Encryption', (ref1 = data['Except Archives from Encryption']) != null ? ref1 : false);
+ }
+ }
+ if (compareString < '00001.00011.00010.00001') {
+ if (data['selectedArchives'] != null) {
+ uids = {
+ "Moe": 0,
+ "4plebs Archive": 3,
+ "Nyafuu Archive": 4,
+ "Love is Over": 5,
+ "Rebecca Black Tech": 8,
+ "warosu": 10,
+ "fgts": 15,
+ "not4plebs": 22,
+ "DesuStorage": 23,
+ "fireden.net": 24,
+ "disabled": null
+ };
+ ref2 = data['selectedArchives'];
+ for (boardID in ref2) {
+ record = ref2[boardID];
+ for (type in record) {
+ name = record[type];
+ if (name in uids) {
+ record[type] = uids[name];
+ }
+ }
+ }
+ set('selectedArchives', data['selectedArchives']);
+ }
+ }
+ if (compareString < '00001.00011.00016.00000') {
+ if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) {
+ if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) {
+ set('usercss', rice + '\n\n' + data['usercss']);
+ }
+ }
+ }
+ if (compareString < '00001.00011.00017.00000') {
+ ref3 = ['Persistent QR', 'Color User IDs', 'Fappe Tyme', 'Werk Tyme', 'Highlight Posts Quoting You', 'Highlight Own Posts'];
+ for (j = 0, len = ref3.length; j < len; j++) {
+ key = ref3[j];
+ if (data[key] == null) {
+ set(key, key === 'Persistent QR');
+ }
+ }
+ }
+ if (compareString < '00001.00011.00017.00006') {
+ if (data['sauces'] != null) {
+ set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/iqdb\.org\//mg, '$1//iqdb.org/'));
+ }
+ }
+ if (compareString < '00001.00011.00019.00003' && !Settings.overlay) {
+ $.queueTask(function() {
+ return Settings.warnings.ads(function(item) {
+ return new Notice('warning', slice.call(item.childNodes));
+ });
+ });
+ }
+ if (compareString < '00001.00011.00020.00003') {
+ ref4 = {
+ 'Inline Cross-thread Quotes Only': false,
+ 'Pass Link': true
+ };
+ for (key in ref4) {
+ value = ref4[key];
+ if (data[key] == null) {
+ set(key, value);
+ }
+ }
+ }
+ if (compareString < '00001.00011.00021.00003') {
+ if (data['Remember Your Posts'] == null) {
+ set('Remember Your Posts', (ref5 = data['Mark Quotes of You']) != null ? ref5 : true);
+ }
+ }
+ if (compareString < '00001.00011.00022.00000') {
+ if (data['sauces'] != null) {
+ set('sauces', data['sauces'].replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/mg, '$1'));
+ set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/mg, '$&&safe=off'));
+ }
+ }
+ if (compareString < '00001.00011.00022.00002') {
+ if ((data['Use Recaptcha v1 in Reports'] == null) && data['Use Recaptcha v1'] && !data['Use Recaptcha v2 in Reports']) {
+ set('Use Recaptcha v1 in Reports', true);
+ }
+ }
+ if (compareString < '00001.00011.00024.00000') {
+ if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) {
+ set('JSON Index', data['JSON Navigation']);
+ }
+ }
+ if (compareString < '00001.00011.00026.00000') {
+ if ((data['Oekaki Links'] != null) && (data['Edit Link'] == null)) {
+ set('Edit Link', data['Oekaki Links']);
+ }
+ if (data['Inline Cross-thread Quotes Only'] == null) {
+ set('Inline Cross-thread Quotes Only', true);
+ }
+ }
+ if (compareString < '00001.00011.00030.00000') {
+ if (data['Quote Threading'] && (data['Thread Quotes'] == null)) {
+ set('Thread Quotes', true);
+ }
+ }
+ return changes;
+ },
+ loadSettings: function(data, cb) {
+ if (data.version.split('.')[0] === '2') {
+ data = Settings.convertFrom.loadletter(data);
+ } else if (data.version !== g.VERSION) {
+ Settings.upgrade(data.Conf, data.version);
+ }
+ return $.clear(function(err) {
+ if (err) {
+ return cb(err);
+ }
+ return $.set(data.Conf, cb);
+ });
+ },
+ reset: function() {
+ if (confirm('Your current settings will be entirely wiped, are you sure?')) {
+ return $.clear(function(err) {
+ if (err) {
+ return $('.imp-exp-result').textContent = 'Import failed due to an error.';
+ } else if (confirm('Reset successful. Reload now?')) {
+ return window.location.reload();
+ }
+ });
+ }
+ },
+ filter: function(section) {
+ var select;
+ $.extend(section, {
+ innerHTML: "Guide Post number Name Unique ID Tripcode Capcode Subject Comment Flag Filename Image dimensions Filesize Image MD5
"
+ });
+ select = $('select', section);
+ $.on(select, 'change', Settings.selectFilter);
+ return Settings.selectFilter.call(select);
+ },
+ selectFilter: function() {
+ var div, name, ta;
+ div = this.nextElementSibling;
+ if ((name = this.value) !== 'guide') {
+ $.rmAll(div);
+ ta = $.el('textarea', {
+ name: name,
+ className: 'field',
+ spellcheck: false
+ });
+ $.get(name, Conf[name], function(item) {
+ return ta.value = item[name];
+ });
+ $.on(ta, 'change', $.cb.value);
+ $.add(div, ta);
+ return;
+ }
+ $.extend(div, {
+ innerHTML: "Filter is disabled.
Use regular expressions , one per line. Lines starting with a # will be ignored. For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive. MD5 filtering uses exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:Per boards, separate them with commas. It is global if not specified. For example: boards:a,jp;. In case of a global rule, select boards to be excluded from the filter. For example: exclude:vg,v;. Filter OPs only along with their threads (\`only\`), replies only (\`no\`), or both (\`yes\`, this is default). For example: op:only;, op:no; or op:yes;. Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`). For example: stub:yes; or stub:no;. Highlight instead of hiding. You can specify a class name to use with a userstyle. For example: highlight; or highlight:wallpaper;. Highlighted OPs will have their threads put on top of the board index by default. For example: top:yes; or top:no;. Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there. The native catalog has its own separate filter list.
"
+ });
+ return $('.warning', div).hidden = Conf['Filter'];
+ },
+ sauce: function(section) {
+ var ta;
+ $.extend(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.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
You can open links with scripts and popups disabled by appending ;sandbox.
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.%MD5: MD5 hash in base64.%sMD5: MD5 hash in base64 using - and _.%hMD5: MD5 hash in hexadecimal.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;. "
+ });
+ $('.warning', section).hidden = Conf['Sauce'];
+ ta = $('textarea', section);
+ $.get('sauces', Conf['sauces'], function(item) {
+ return ta.value = item['sauces'];
+ });
+ return $.on(ta, 'change', $.cb.value);
+ },
+ advanced: function(section) {
+ var applyCSS, archBoards, archive, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, j, k, l, len, len1, len2, len3, len4, len5, len6, m, n, name, o, q, r, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, uid, warning, withCredentials;
+ $.extend(section, {
+ innerHTML: "Archiver 404 Redirect is disabled.
Thread redirection Post fetching File redirection
Captcha Language
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 Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
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
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
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"] will give you[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy] if you are on /g/.
Time Formatting is disabled. :
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled. :
File Info Formatting is disabled. :
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag:
%gLiteral %: %%
Quick Reply Personas One item per line. Items will be added in the relevant input's auto-completion list. Password items will always be used, since there is no password input. Lines starting with a # will be ignored.
You can use these settings with each item, separate them with semicolons:Possible items are: name, options (or equivalently email), subject and password. Wrap values of items with quotes, like this: options:"sage". Force values as defaults with the always keyword, for example: options:"sage";always. Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always. Unread Favicon is disabled. ferongr xat- 4chanJS Mayhem Original Metro Thread Updater is disabled. Interval: seconds
Custom Cooldown Time Seconds:
Custom CSSApply CSS "
+ });
+ ref = $$('.warning', section);
+ for (j = 0, len = ref.length; j < len; j++) {
+ warning = ref[j];
+ warning.hidden = Conf[warning.dataset.feature];
+ }
+ items = {};
+ inputs = {};
+ ref1 = ['captchaLanguage', 'boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'customCooldown'];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ name = ref1[k];
+ input = $("[name='" + name + "']", section);
+ items[name] = Conf[name];
+ inputs[name] = input;
+ if (name === 'usercss') {
+ $.on(input, 'change', $.cb.value);
+ } else if (name === 'favicon') {
+ $.on(input, 'change', $.cb.value);
+ $.on(input, 'change', Settings[name]);
+ } else {
+ $.on(input, 'input', $.cb.value);
+ if (name in Settings) {
+ $.on(input, 'input', Settings[name]);
+ }
+ }
+ }
+ ta = $('.personafield', section);
+ $.get('QR.personas', Conf['QR.personas'], function(item) {
+ return ta.value = item['QR.personas'];
+ });
+ $.on(ta, 'change', $.cb.value);
+ $.get(items, function(items) {
+ var key, val;
+ for (key in items) {
+ val = items[key];
+ input = inputs[key];
+ input.value = val;
+ if (key in Settings && key !== 'usercss') {
+ Settings[key].call(input);
+ }
+ }
+ });
+ interval = $('input[name="Interval"]', section);
+ customCSS = $('input[name="Custom CSS"]', section);
+ applyCSS = $('#apply-css', section);
+ interval.value = Conf['Interval'];
+ customCSS.checked = Conf['Custom CSS'];
+ inputs['usercss'].disabled = !Conf['Custom CSS'];
+ applyCSS.disabled = !Conf['Custom CSS'];
+ $.on(interval, 'change', ThreadUpdater.cb.interval);
+ $.on(customCSS, 'change', Settings.togglecss);
+ $.on(applyCSS, 'click', Settings.usercss);
+ archBoards = {};
+ ref2 = Redirect.archives;
+ for (l = 0, len2 = ref2.length; l < len2; l++) {
+ ref3 = ref2[l], uid = ref3.uid, name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials;
+ for (m = 0, len3 = boards.length; m < len3; m++) {
+ boardID = boards[m];
+ o = archBoards[boardID] || (archBoards[boardID] = {
+ thread: [[], []],
+ post: [[], []],
+ file: [[], []]
+ });
+ i = +(!!withCredentials);
+ archive = [uid != null ? uid : name, name];
+ o.thread[i].push(archive);
+ if (software === 'foolfuuka') {
+ o.post[i].push(archive);
+ }
+ if (indexOf.call(files, boardID) >= 0) {
+ o.file[i].push(archive);
+ }
+ }
+ }
+ for (boardID in archBoards) {
+ o = archBoards[boardID];
+ ref4 = ['thread', 'post', 'file'];
+ for (n = 0, len4 = ref4.length; n < len4; n++) {
+ item = ref4[n];
+ i = o[item][0].length ? 1 : 0;
+ o[item][i].push([null, 'disabled']);
+ o[item] = o[item][0].concat(o[item][1]);
+ }
+ }
+ rows = [];
+ boardOptions = [];
+ ref5 = Object.keys(archBoards).sort();
+ for (q = 0, len5 = ref5.length; q < len5; q++) {
+ boardID = ref5[q];
+ row = $.el('tr', {
+ className: "board-" + boardID
+ });
+ row.hidden = boardID !== g.BOARD.ID;
+ boardOptions.push($.el('option', {
+ textContent: "/" + boardID + "/",
+ value: "board-" + boardID,
+ selected: boardID === g.BOARD.ID
+ }));
+ o = archBoards[boardID];
+ ref6 = ['thread', 'post', 'file'];
+ for (r = 0, len6 = ref6.length; r < len6; r++) {
+ item = ref6[r];
+ $.add(row, Settings.addArchiveCell(boardID, o, item));
+ }
+ rows.push(row);
+ }
+ if (!(g.BOARD.ID in archBoards)) {
+ rows[0].hidden = false;
+ }
+ $.add($('tbody', section), rows);
+ boardSelect = $('#archive-board-select', section);
+ $.add(boardSelect, boardOptions);
+ table = $('#archive-table', section);
+ $.on(boardSelect, 'change', function() {
+ $('tbody > :not([hidden])', table).hidden = true;
+ return $("tbody > ." + this.value, table).hidden = false;
+ });
+ $.get('selectedArchives', Conf['selectedArchives'], function(arg) {
+ var data, id, select, selectedArchives, type;
+ selectedArchives = arg.selectedArchives;
+ for (boardID in selectedArchives) {
+ data = selectedArchives[boardID];
+ for (type in data) {
+ id = data[type];
+ if (select = $("select[data-boardid='" + boardID + "'][data-type='" + type + "']", section)) {
+ select.value = JSON.stringify(id);
+ }
+ }
+ }
+ });
+ },
+ addArchiveCell: function(boardID, data, type) {
+ var archive, i, length, options, select, td;
+ length = data[type].length;
+ td = $.el('td', {
+ className: 'archive-cell'
+ });
+ if (!length) {
+ td.textContent = '--';
+ return td;
+ }
+ options = [];
+ i = 0;
+ while (i < length) {
+ archive = data[type][i++];
+ options.push($.el('option', {
+ value: JSON.stringify(archive[0]),
+ textContent: archive[1]
+ }));
+ }
+ $.extend(td, {
+ innerHTML: "
"
+ });
+ select = td.firstElementChild;
+ if (!(select.disabled = length === 1)) {
+ select.setAttribute('data-boardid', boardID);
+ select.setAttribute('data-type', type);
+ $.on(select, 'change', Settings.saveSelectedArchive);
+ }
+ $.add(select, options);
+ return td;
+ },
+ saveSelectedArchive: function() {
+ return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) {
+ return function(arg) {
+ var name1, selectedArchives;
+ selectedArchives = arg.selectedArchives;
+ (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = {}))[_this.dataset.type] = JSON.parse(_this.value);
+ return $.set('selectedArchives', selectedArchives);
+ };
+ })(this));
+ },
+ boardnav: function() {
+ return Header.generateBoardList(this.value);
+ },
+ time: function() {
+ return this.nextElementSibling.textContent = Time.format(this.value, new Date());
+ },
+ backlink: function() {
+ return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) {
+ return {
+ '%id': '123456789',
+ '%%': '%'
+ }[x];
+ });
+ },
+ fileInfo: function() {
+ var data;
+ data = {
+ isReply: true,
+ file: {
+ url: '//i.4cdn.org/g/1334437723720.jpg',
+ name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg',
+ size: '276 KB',
+ sizeInBytes: 276 * 1024,
+ dimensions: '1280x720',
+ isImage: true,
+ isVideo: false,
+ isSpoiler: true,
+ tag: 'Loop'
+ }
+ };
+ return FileInfo.format(this.value, data, this.nextElementSibling);
+ },
+ favicon: function() {
+ var img;
+ Favicon["switch"]();
+ if (g.VIEW === 'thread' && Conf['Unread Favicon']) {
+ Unread.update();
+ }
+ img = this.nextElementSibling.children;
+ img[0].src = Favicon["default"];
+ img[1].src = Favicon.unreadSFW;
+ img[2].src = Favicon.unreadNSFW;
+ return img[3].src = Favicon.unreadDead;
+ },
+ togglecss: function() {
+ if ($('textarea[name=usercss]', $.x('ancestor::fieldset[1]', this)).disabled = $.id('apply-css').disabled = !this.checked) {
+ CustomCSS.rmStyle();
+ } else {
+ CustomCSS.addStyle();
+ }
+ return $.cb.checked.call(this);
+ },
+ usercss: function() {
+ return CustomCSS.update();
+ },
+ keybinds: function(section) {
+ var arr, input, inputs, items, key, ref, tbody, tr;
+ $.extend(section, {
+ innerHTML: "
Keybinds are disabled.
Allowed keys: a-z , 0-9 , Ctrl , Shift , Alt , Meta , Enter , Esc , Up , Down , Right , Left .
Press Backspace to disable a keybind.
"
+ });
+ $('.warning', section).hidden = Conf['Keybinds'];
+ tbody = $('tbody', section);
+ items = {};
+ inputs = {};
+ ref = Config.hotkeys;
+ for (key in ref) {
+ arr = ref[key];
+ tr = $.el('tr', {
+ innerHTML: "
" + E(arr[1]) + " "
+ });
+ input = $('input', tr);
+ input.name = key;
+ input.spellcheck = false;
+ items[key] = Conf[key];
+ inputs[key] = input;
+ $.on(input, 'keydown', Settings.keybind);
+ $.add(tbody, tr);
+ }
+ return $.get(items, function(items) {
+ var val;
+ for (key in items) {
+ val = items[key];
+ inputs[key].value = val;
+ }
+ });
+ },
+ keybind: function(e) {
+ var key;
+ if (e.keyCode === 9) {
+ return;
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ if ((key = Keybinds.keyCode(e)) == null) {
+ return;
+ }
+ this.value = key;
+ return $.cb.value.call(this);
+ }
+ };
+
+ return Settings;
+
+}).call(this);
+
+UI = (function() {
+ var Menu, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ slice = [].slice;
+
+ dialog = function(id, position, properties) {
+ var child, el, i, len, move, ref;
+ el = $.el('div', {
+ className: 'dialog',
+ id: id
+ });
+ $.extend(el, properties);
+ el.style.cssText = position;
+ $.get(id + ".position", position, function(item) {
+ return el.style.cssText = item[id + ".position"];
+ });
+ move = $('.move', el);
+ $.on(move, 'touchstart mousedown', dragstart);
+ ref = move.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if (!child.tagName) {
+ continue;
+ }
+ $.on(child, 'touchstart mousedown', function(e) {
+ return e.stopPropagation();
+ });
+ }
+ return el;
+ };
+
+ Menu = (function() {
+ var currentMenu, lastToggledButton;
+
+ currentMenu = null;
+
+ lastToggledButton = null;
+
+ function Menu(type) {
+ this.type = type;
+ this.addEntry = bind(this.addEntry, this);
+ this.onFocus = bind(this.onFocus, this);
+ this.keybinds = bind(this.keybinds, this);
+ this.close = bind(this.close, this);
+ this.setPosition = bind(this.setPosition, this);
+ $.on(d, 'AddMenuEntry', (function(_this) {
+ return function(arg) {
+ var detail;
+ detail = arg.detail;
+ if (detail.type !== _this.type) {
+ return;
+ }
+ delete detail.open;
+ return _this.addEntry(detail);
+ };
+ })(this));
+ this.entries = [];
+ }
+
+ Menu.prototype.makeMenu = function() {
+ var menu;
+ menu = $.el('div', {
+ className: 'dialog',
+ id: 'menu',
+ tabIndex: 0
+ });
+ $.on(menu, 'click', function(e) {
+ return e.stopPropagation();
+ });
+ $.on(menu, 'keydown', this.keybinds);
+ return menu;
+ };
+
+ Menu.prototype.toggle = function(e, button, data) {
+ var previousButton;
+ e.preventDefault();
+ e.stopPropagation();
+ if (currentMenu) {
+ previousButton = lastToggledButton;
+ currentMenu.close();
+ if (previousButton === button) {
+ return;
+ }
+ }
+ if (!this.entries.length) {
+ return;
+ }
+ return this.open(button, data);
+ };
+
+ Menu.prototype.open = function(button, data) {
+ var entry, i, len, menu, ref;
+ menu = this.menu = this.makeMenu();
+ currentMenu = this;
+ lastToggledButton = button;
+ this.entries.sort(function(first, second) {
+ return first.order - second.order;
+ });
+ ref = this.entries;
+ for (i = 0, len = ref.length; i < len; i++) {
+ entry = ref[i];
+ this.insertEntry(entry, menu, data);
+ }
+ $.addClass(lastToggledButton, 'active');
+ $.on(d, 'click CloseMenu', this.close);
+ $.on(d, 'scroll', this.setPosition);
+ $.on(window, 'resize', this.setPosition);
+ $.add(button, menu);
+ this.setPosition();
+ entry = $('.entry', menu);
+ this.focus(entry);
+ return menu.focus();
+ };
+
+ Menu.prototype.setPosition = function() {
+ var bLeft, bRect, bTop, bottom, cHeight, cWidth, left, mRect, ref, ref1, right, top;
+ mRect = this.menu.getBoundingClientRect();
+ bRect = lastToggledButton.getBoundingClientRect();
+ bTop = window.scrollY + bRect.top;
+ bLeft = window.scrollX + bRect.left;
+ cHeight = doc.clientHeight;
+ cWidth = doc.clientWidth;
+ ref = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom + "px", ''] : ['', (cHeight - bRect.top) + "px"], top = ref[0], bottom = ref[1];
+ ref1 = bRect.left + mRect.width < cWidth ? [bRect.left + "px", ''] : ['', (cWidth - bRect.right) + "px"], left = ref1[0], right = ref1[1];
+ $.extend(this.menu.style, {
+ top: top,
+ right: right,
+ bottom: bottom,
+ left: left
+ });
+ return this.menu.classList.toggle('left', right);
+ };
+
+ Menu.prototype.insertEntry = function(entry, parent, data) {
+ var err, i, len, ref, subEntry, submenu;
+ if (typeof entry.open === 'function') {
+ try {
+ if (!entry.open(data)) {
+ return;
+ }
+ } catch (_error) {
+ err = _error;
+ Main.handleErrors({
+ message: "Error in building the " + this.type + " menu.",
+ error: err
+ });
+ return;
+ }
+ }
+ $.add(parent, entry.el);
+ if (!entry.subEntries) {
+ return;
+ }
+ if (submenu = $('.submenu', entry.el)) {
+ $.rm(submenu);
+ }
+ submenu = $.el('div', {
+ className: 'dialog submenu'
+ });
+ ref = entry.subEntries;
+ for (i = 0, len = ref.length; i < len; i++) {
+ subEntry = ref[i];
+ this.insertEntry(subEntry, submenu, data);
+ }
+ $.add(entry.el, submenu);
+ };
+
+ Menu.prototype.close = function() {
+ $.rm(this.menu);
+ delete this.menu;
+ $.rmClass(lastToggledButton, 'active');
+ currentMenu = null;
+ lastToggledButton = null;
+ $.off(d, 'click scroll CloseMenu', this.close);
+ $.off(d, 'scroll', this.setPosition);
+ return $.off(window, 'resize', this.setPosition);
+ };
+
+ Menu.prototype.findNextEntry = function(entry, direction) {
+ var entries;
+ entries = slice.call(entry.parentNode.children);
+ entries.sort(function(first, second) {
+ return first.style.order - second.style.order;
+ });
+ return entries[entries.indexOf(entry) + direction];
+ };
+
+ Menu.prototype.keybinds = function(e) {
+ var entry, next, nextPrev, subEntry, submenu;
+ entry = $('.focused', this.menu);
+ while (subEntry = $('.focused', entry)) {
+ entry = subEntry;
+ }
+ switch (e.keyCode) {
+ case 27:
+ lastToggledButton.focus();
+ this.close();
+ break;
+ case 13:
+ case 32:
+ entry.click();
+ break;
+ case 38:
+ if (next = this.findNextEntry(entry, -1)) {
+ this.focus(next);
+ }
+ break;
+ case 40:
+ if (next = this.findNextEntry(entry, +1)) {
+ this.focus(next);
+ }
+ break;
+ case 39:
+ if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) {
+ while (nextPrev = this.findNextEntry(next, -1)) {
+ next = nextPrev;
+ }
+ this.focus(next);
+ }
+ break;
+ case 37:
+ if (next = $.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) {
+ this.focus(next);
+ }
+ break;
+ default:
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ };
+
+ Menu.prototype.onFocus = function(e) {
+ e.stopPropagation();
+ return this.focus(e.target);
+ };
+
+ Menu.prototype.focus = function(entry) {
+ var bottom, cHeight, cWidth, eRect, focused, i, left, len, ref, ref1, ref2, right, sRect, style, submenu, top;
+ while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
+ $.rmClass(focused, 'focused');
+ }
+ ref = $$('.focused', entry);
+ for (i = 0, len = ref.length; i < len; i++) {
+ focused = ref[i];
+ $.rmClass(focused, 'focused');
+ }
+ $.addClass(entry, 'focused');
+ if (!(submenu = $('.submenu', entry))) {
+ return;
+ }
+ sRect = submenu.getBoundingClientRect();
+ eRect = entry.getBoundingClientRect();
+ cHeight = doc.clientHeight;
+ cWidth = doc.clientWidth;
+ ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1];
+ ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1];
+ style = submenu.style;
+ style.top = top;
+ style.bottom = bottom;
+ style.left = left;
+ return style.right = right;
+ };
+
+ Menu.prototype.addEntry = function(entry) {
+ this.parseEntry(entry);
+ return this.entries.push(entry);
+ };
+
+ Menu.prototype.parseEntry = function(entry) {
+ var el, i, len, subEntries, subEntry;
+ el = entry.el, subEntries = entry.subEntries;
+ $.addClass(el, 'entry');
+ $.on(el, 'focus mouseover', this.onFocus);
+ el.style.order = entry.order || 100;
+ if (!subEntries) {
+ return;
+ }
+ $.addClass(el, 'has-submenu');
+ for (i = 0, len = subEntries.length; i < len; i++) {
+ subEntry = subEntries[i];
+ this.parseEntry(subEntry);
+ }
+ };
+
+ return Menu;
+
+ })();
+
+ dragstart = function(e) {
+ var el, isTouching, o, rect, ref, screenHeight, screenWidth;
+ if (e.type === 'mousedown' && e.button !== 0) {
+ return;
+ }
+ e.preventDefault();
+ if (isTouching = e.type === 'touchstart') {
+ e = e.changedTouches[e.changedTouches.length - 1];
+ }
+ el = $.x('ancestor::div[contains(@class,"dialog")][1]', this);
+ rect = el.getBoundingClientRect();
+ screenHeight = doc.clientHeight;
+ screenWidth = doc.clientWidth;
+ o = {
+ id: el.id,
+ style: el.style,
+ dx: e.clientX - rect.left,
+ dy: e.clientY - rect.top,
+ height: screenHeight - rect.height,
+ width: screenWidth - rect.width,
+ screenHeight: screenHeight,
+ screenWidth: screenWidth,
+ isTouching: isTouching
+ };
+ ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1];
+ if (isTouching) {
+ o.identifier = e.identifier;
+ o.move = touchmove.bind(o);
+ o.up = touchend.bind(o);
+ $.on(d, 'touchmove', o.move);
+ return $.on(d, 'touchend touchcancel', o.up);
+ } else {
+ o.move = drag.bind(o);
+ o.up = dragend.bind(o);
+ $.on(d, 'mousemove', o.move);
+ return $.on(d, 'mouseup', o.up);
+ }
+ };
+
+ touchmove = function(e) {
+ var i, len, ref, touch;
+ ref = e.changedTouches;
+ for (i = 0, len = ref.length; i < len; i++) {
+ touch = ref[i];
+ if (touch.identifier === this.identifier) {
+ drag.call(this, touch);
+ return;
+ }
+ }
+ };
+
+ 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 + '%';
+ top = clientY - this.dy;
+ top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%';
+ right = left === null ? 0 : null;
+ bottom = top === null ? this.bottomBorder + 'px' : null;
+ style = this.style;
+ style.left = left;
+ style.right = right;
+ style.top = top;
+ return style.bottom = bottom;
+ };
+
+ touchend = function(e) {
+ var i, len, ref, touch;
+ ref = e.changedTouches;
+ for (i = 0, len = ref.length; i < len; i++) {
+ touch = ref[i];
+ if (touch.identifier === this.identifier) {
+ dragend.call(this);
+ return;
+ }
+ }
+ };
+
+ dragend = function() {
+ if (this.isTouching) {
+ $.off(d, 'touchmove', this.move);
+ $.off(d, 'touchend touchcancel', this.up);
+ } else {
+ $.off(d, 'mousemove', this.move);
+ $.off(d, 'mouseup', this.up);
+ }
+ return $.set(this.id + ".position", this.style.cssText);
+ };
+
+ hoverstart = function(arg) {
+ var cb, el, endEvents, height, latestEvent, noRemove, o, ref, root;
+ root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, height = arg.height, cb = arg.cb, noRemove = arg.noRemove;
+ o = {
+ root: root,
+ el: el,
+ style: el.style,
+ isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO',
+ cb: cb,
+ endEvents: endEvents,
+ latestEvent: latestEvent,
+ clientHeight: doc.clientHeight,
+ clientWidth: doc.clientWidth,
+ height: height,
+ noRemove: noRemove
+ };
+ o.hover = hover.bind(o);
+ o.hoverend = hoverend.bind(o);
+ o.hover(o.latestEvent);
+ new MutationObserver(function() {
+ if (el.parentNode) {
+ return o.hover(o.latestEvent);
+ }
+ }).observe(el, {
+ childList: true
+ });
+ $.on(root, endEvents, o.hoverend);
+ if ($.x('ancestor::div[contains(@class,"inline")][1]', root)) {
+ $.on(d, 'keydown', o.hoverend);
+ }
+ $.on(root, 'mousemove', o.hover);
+ o.workaround = function(e) {
+ if (!root.contains(e.target)) {
+ return o.hoverend(e);
+ }
+ };
+ return $.on(doc, 'mousemove', o.workaround);
+ };
+
+ hoverstart.padding = 25;
+
+ hover = function(e) {
+ var clientX, clientY, height, left, ref, right, style, threshold, top;
+ this.latestEvent = e;
+ height = (this.height || this.el.offsetHeight) + hoverstart.padding;
+ clientX = e.clientX, clientY = e.clientY;
+ top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120));
+ threshold = this.clientWidth / 2;
+ if (!this.isImage) {
+ threshold = Math.max(threshold, this.clientWidth - 400);
+ }
+ ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
+ style = this.style;
+ style.top = top + 'px';
+ style.left = left;
+ return style.right = right;
+ };
+
+ hoverend = function(e) {
+ if (e.type === 'keydown' && e.keyCode !== 13 || e.target.nodeName === "TEXTAREA") {
+ return;
+ }
+ if (!this.noRemove) {
+ $.rm(this.el);
+ }
+ $.off(this.root, this.endEvents, this.hoverend);
+ $.off(d, 'keydown', this.hoverend);
+ $.off(this.root, 'mousemove', this.hover);
+ $.off(doc, 'mousemove', this.workaround);
+ if (this.cb) {
+ return this.cb.call(this);
+ }
+ };
+
+ checkbox = function(name, text, checked) {
+ var input, label;
+ if (checked == null) {
+ checked = Conf[name];
+ }
+ label = $.el('label');
+ input = $.el('input', {
+ type: 'checkbox',
+ name: name,
+ checked: checked
+ });
+ $.add(label, [input, $.tn(" " + text)]);
+ return label;
+ };
+
+ return {
+ dialog: dialog,
+ Menu: Menu,
+ hover: hoverstart,
+ checkbox: checkbox
+ };
+
+}).call(this);
+
+FappeTyme = (function() {
+ var FappeTyme;
+
+ FappeTyme = {
+ init: function() {
+ var el, i, lc, len, ref, ref1, type;
+ if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread'))) {
+ return;
+ }
+ this.nodes = {};
+ this.enabled = {
+ fappe: false,
+ werk: Conf['werk']
+ };
+ ref1 = ["Fappe", "Werk"];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ type = ref1[i];
+ if (!Conf[type + " Tyme"]) {
+ continue;
+ }
+ lc = type.toLowerCase();
+ el = UI.checkbox(lc, type + " Tyme", false);
+ el.title = type + " Tyme";
+ this.nodes[lc] = el.firstElementChild;
+ if (Conf[lc]) {
+ this.set(lc, true);
+ }
+ $.on(this.nodes[lc], 'change', this.toggle.bind(this, lc));
+ Header.menu.addEntry({
+ el: el,
+ order: 97
+ });
+ }
+ if (Conf['Werk Tyme']) {
+ $.sync('werk', this.set.bind(this, 'werk'));
+ }
+ Callbacks.Post.push({
+ name: 'Fappe Tyme',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Werk Tyme',
+ cb: this.catalogNode
+ });
+ },
+ node: function() {
+ return this.nodes.root.classList.toggle('noFile', !this.file);
+ },
+ catalogNode: function() {
+ var file, filename;
+ file = this.thread.OP.file;
+ if (!file) {
+ return;
+ }
+ filename = $.el('div', {
+ textContent: file.name,
+ className: 'werkTyme-filename'
+ });
+ return $.add(this.nodes.thumb.parentNode, filename);
+ },
+ set: function(type, enabled) {
+ this.enabled[type] = this.nodes[type].checked = enabled;
+ return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme");
+ },
+ toggle: function(type) {
+ this.set(type, !this.enabled[type]);
+ if (type === 'werk') {
+ return $.cb.checked.call(this.nodes[type]);
+ }
+ }
+ };
+
+ return FappeTyme;
+
+}).call(this);
+
+Gallery = (function() {
+ var Gallery;
+
+ Gallery = {
+ init: function() {
+ var el, ref;
+ if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ this.delay = Conf['Slide Delay'];
+ el = $.el('a', {
+ href: 'javascript:;',
+ id: 'appchan-gal',
+ title: 'Gallery',
+ className: 'fa fa-picture-o',
+ textContent: 'Gallery'
+ });
+ $.on(el, 'click', this.cb.toggle);
+ Header.addShortcut(el);
+ return Callbacks.Post.push({
+ name: 'Gallery',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var ref;
+ if (!((ref = this.file) != null ? ref.thumb : void 0)) {
+ return;
+ }
+ if (Gallery.nodes) {
+ Gallery.generateThumb(this);
+ Gallery.nodes.total.textContent = Gallery.images.length;
+ }
+ if (!Conf['Image Expansion']) {
+ return $.on(this.file.thumb.parentNode, 'click', Gallery.cb.image);
+ }
+ },
+ build: function(image) {
+ var candidate, cb, dialog, entry, file, i, j, key, len, len1, menuButton, nodes, post, ref, ref1, ref2, ref3, thumb, value;
+ cb = Gallery.cb;
+ if (Conf['Fullscreen Gallery']) {
+ $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
+ return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
+ });
+ if (typeof doc.mozRequestFullScreen === "function") {
+ doc.mozRequestFullScreen();
+ }
+ if (typeof doc.webkitRequestFullScreen === "function") {
+ doc.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
+ }
+ }
+ Gallery.images = [];
+ nodes = Gallery.nodes = {};
+ Gallery.fullIDs = {};
+ Gallery.slideshow = false;
+ nodes.el = dialog = $.el('div', {
+ id: 'a-gallery'
+ });
+ $.extend(dialog, {
+ innerHTML: "
"
+ });
+ ref = {
+ buttons: '.gal-buttons',
+ frame: '.gal-image',
+ name: '.gal-name',
+ count: '.count',
+ total: '.total',
+ thumbs: '.gal-thumbnails',
+ next: '.gal-image a',
+ current: '.gal-image img'
+ };
+ for (key in ref) {
+ value = ref[key];
+ nodes[key] = $(value, dialog);
+ }
+ menuButton = $('.menu-button', dialog);
+ nodes.menu = new UI.Menu('gallery');
+ $.on(nodes.frame, 'click', cb.blank);
+ if (Conf['Mouse Wheel Volume']) {
+ $.on(nodes.frame, 'wheel', Volume.wheel);
+ }
+ $.on(nodes.next, 'click', cb.click);
+ $.on(nodes.name, 'click', ImageCommon.download);
+ $.on($('.gal-prev', dialog), 'click', cb.prev);
+ $.on($('.gal-next', dialog), 'click', cb.next);
+ $.on($('.gal-start', dialog), 'click', cb.start);
+ $.on($('.gal-stop', dialog), 'click', cb.stop);
+ $.on($('.gal-close', dialog), 'click', cb.close);
+ $.on(menuButton, 'click', function(e) {
+ return nodes.menu.toggle(e, this, g);
+ });
+ ref1 = Gallery.menu.createSubEntries();
+ for (i = 0, len = ref1.length; i < len; i++) {
+ entry = ref1[i];
+ entry.order = 0;
+ nodes.menu.addEntry(entry);
+ }
+ $.on(d, 'keydown', cb.keybinds);
+ if (Conf['Keybinds']) {
+ $.off(d, 'keydown', Keybinds.keydown);
+ }
+ $.on(window, 'resize', Gallery.cb.setHeight);
+ ref2 = $$('.post .file');
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ file = ref2[j];
+ post = Get.postFromNode(file);
+ if (!((ref3 = post.file) != null ? ref3.thumb : void 0)) {
+ continue;
+ }
+ Gallery.generateThumb(post);
+ if (!image && Gallery.fullIDs[post.fullID]) {
+ candidate = post.file.thumb.parentNode;
+ if (Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0) {
+ image = candidate;
+ }
+ }
+ }
+ $.addClass(doc, 'gallery-open');
+ $.add(d.body, dialog);
+ nodes.thumbs.scrollTop = 0;
+ nodes.current.parentElement.scrollTop = 0;
+ if (image) {
+ thumb = $("[href='" + image.href + "']", nodes.thumbs);
+ }
+ thumb || (thumb = Gallery.images[Gallery.images.length - 1]);
+ if (thumb) {
+ Gallery.open(thumb);
+ }
+ doc.style.overflow = 'hidden';
+ return nodes.total.textContent = Gallery.images.length;
+ },
+ generateThumb: function(post) {
+ var thumb, thumbImg;
+ if (post.isClone || post.isHidden) {
+ return;
+ }
+ if (!(post.file && post.file.thumb && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
+ return;
+ }
+ if (Gallery.fullIDs[post.fullID]) {
+ return;
+ }
+ Gallery.fullIDs[post.fullID] = true;
+ thumb = $.el('a', {
+ className: 'gal-thumb',
+ href: post.file.url,
+ target: '_blank',
+ title: post.file.name
+ });
+ thumb.dataset.id = Gallery.images.length;
+ thumb.dataset.post = post.fullID;
+ thumbImg = post.file.thumb.cloneNode(false);
+ thumbImg.style.cssText = '';
+ $.add(thumb, thumbImg);
+ $.on(thumb, 'click', Gallery.cb.open);
+ Gallery.images.push(thumb);
+ return $.add(Gallery.nodes.thumbs, thumb);
+ },
+ load: function(thumb, errorCB) {
+ var elType, ext, file;
+ ext = thumb.href.match(/\w*$/);
+ elType = {
+ 'webm': 'video',
+ 'pdf': 'iframe'
+ }[ext] || 'img';
+ file = $.el(elType, {
+ title: thumb.title
+ });
+ $.extend(file.dataset, thumb.dataset);
+ $.on(file, 'error', errorCB);
+ file.src = thumb.href;
+ return file;
+ },
+ open: function(thumb) {
+ var el, file, newID, nodes, oldID, post, ref;
+ nodes = Gallery.nodes;
+ oldID = +nodes.current.dataset.id;
+ newID = +thumb.dataset.id;
+ if (el = Gallery.images[oldID]) {
+ $.rmClass(el, 'gal-highlight');
+ }
+ $.addClass(thumb, 'gal-highlight');
+ nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
+ if (((ref = Gallery.cache) != null ? ref.dataset.id : void 0) === '' + newID) {
+ file = Gallery.cache;
+ $.off(file, 'error', Gallery.cacheError);
+ $.on(file, 'error', Gallery.error);
+ } else {
+ file = Gallery.load(thumb, Gallery.error);
+ }
+ $.off(nodes.current, 'error', Gallery.error);
+ ImageCommon.pause(nodes.current);
+ $.replace(nodes.current, file);
+ nodes.current = file;
+ if (file.nodeName === 'VIDEO') {
+ file.loop = true;
+ Volume.setup(file);
+ if (Conf['Autoplay']) {
+ file.play();
+ }
+ if (Conf['Show Controls']) {
+ ImageCommon.addControls(file);
+ }
+ }
+ doc.classList.toggle('gal-pdf', file.nodeName === 'IFRAME');
+ Gallery.cb.setHeight();
+ nodes.count.textContent = +thumb.dataset.id + 1;
+ nodes.name.download = nodes.name.textContent = thumb.title;
+ nodes.name.href = thumb.href;
+ nodes.frame.scrollTop = 0;
+ nodes.next.focus();
+ if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) {
+ Gallery.setupTimer();
+ } else {
+ Gallery.cb.stop();
+ }
+ if (Conf['Scroll to Post'] && (post = g.posts[file.dataset.post])) {
+ Header.scrollTo(post.nodes.root);
+ }
+ if (isNaN(oldID) || newID === (oldID + 1) % Gallery.images.length) {
+ return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError);
+ }
+ },
+ error: function() {
+ var ref;
+ if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
+ return new Notice('error', 'Corrupt or unplayable video', 30);
+ }
+ if (this.src.split('/')[2] !== 'i.4cdn.org') {
+ return;
+ }
+ return ImageCommon.error(this, g.posts[this.dataset.post], null, (function(_this) {
+ return function(url) {
+ if (!url) {
+ return;
+ }
+ Gallery.images[_this.dataset.id].href = url;
+ if (Gallery.nodes.current === _this) {
+ return _this.src = url;
+ }
+ };
+ })(this));
+ },
+ cacheError: function() {
+ return delete Gallery.cache;
+ },
+ cleanupTimer: function() {
+ var current;
+ clearTimeout(Gallery.timeoutID);
+ current = Gallery.nodes.current;
+ $.off(current, 'canplaythrough load', Gallery.startTimer);
+ return $.off(current, 'ended', Gallery.cb.next);
+ },
+ startTimer: function() {
+ return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * $.SECOND);
+ },
+ setupTimer: function() {
+ var current, isVideo;
+ Gallery.cleanupTimer();
+ current = Gallery.nodes.current;
+ isVideo = current.nodeName === 'VIDEO';
+ if (isVideo) {
+ current.play();
+ }
+ if ((isVideo ? current.readyState >= 4 : current.complete) || current.nodeName === 'IFRAME') {
+ return Gallery.startTimer();
+ } else {
+ return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer);
+ }
+ },
+ checkTimer: function() {
+ var current;
+ current = Gallery.nodes.current;
+ if (current.nodeName === 'VIDEO' && !current.paused) {
+ $.on(current, 'ended', Gallery.cb.next);
+ return current.loop = false;
+ } else {
+ return Gallery.cb.next();
+ }
+ },
+ cb: {
+ keybinds: function(e) {
+ var cb, key;
+ if (!(key = Keybinds.keyCode(e))) {
+ return;
+ }
+ cb = (function() {
+ switch (key) {
+ case Conf['Close']:
+ case Conf['Open Gallery']:
+ return Gallery.cb.close;
+ case 'Right':
+ return Gallery.cb.next;
+ case 'Enter':
+ return Gallery.cb.advance;
+ case 'Left':
+ case '':
+ return Gallery.cb.prev;
+ case Conf['Pause']:
+ return Gallery.cb.pause;
+ case Conf['Slideshow']:
+ return Gallery.cb.toggleSlideshow;
+ }
+ })();
+ if (!cb) {
+ return;
+ }
+ e.stopPropagation();
+ e.preventDefault();
+ return cb();
+ },
+ open: function(e) {
+ if (e) {
+ e.preventDefault();
+ }
+ if (this) {
+ return Gallery.open(this);
+ }
+ },
+ image: function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ return Gallery.build(this);
+ },
+ prev: function() {
+ return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]);
+ },
+ next: function() {
+ return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]);
+ },
+ click: function(e) {
+ if (ImageCommon.onControls(e)) {
+ return;
+ }
+ e.preventDefault();
+ return Gallery.cb.advance();
+ },
+ advance: function() {
+ if (!Conf['Autoplay'] && Gallery.nodes.current.paused) {
+ return Gallery.nodes.current.play();
+ } else {
+ return Gallery.cb.next();
+ }
+ },
+ toggle: function() {
+ return (Gallery.nodes ? Gallery.cb.close : Gallery.build)();
+ },
+ blank: function(e) {
+ if (e.target === this) {
+ return Gallery.cb.close();
+ }
+ },
+ toggleSlideshow: function() {
+ return Gallery.cb[Gallery.slideshow ? 'stop' : 'start']();
+ },
+ pause: function() {
+ var current;
+ Gallery.cb.stop();
+ current = Gallery.nodes.current;
+ if (current.nodeName === 'VIDEO') {
+ return current[current.paused ? 'play' : 'pause']();
+ }
+ },
+ start: function() {
+ $.addClass(Gallery.nodes.buttons, 'gal-playing');
+ Gallery.slideshow = true;
+ return Gallery.setupTimer();
+ },
+ stop: function() {
+ var current;
+ if (!Gallery.slideshow) {
+ return;
+ }
+ Gallery.cleanupTimer();
+ current = Gallery.nodes.current;
+ if (current.nodeName === 'VIDEO') {
+ current.loop = true;
+ }
+ $.rmClass(Gallery.nodes.buttons, 'gal-playing');
+ return Gallery.slideshow = false;
+ },
+ close: function() {
+ $.off(Gallery.nodes.current, 'error', Gallery.error);
+ ImageCommon.pause(Gallery.nodes.current);
+ $.rm(Gallery.nodes.el);
+ $.rmClass(doc, 'gallery-open');
+ if (Conf['Fullscreen Gallery']) {
+ $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close);
+ if (typeof d.mozCancelFullScreen === "function") {
+ d.mozCancelFullScreen();
+ }
+ if (typeof d.webkitExitFullscreen === "function") {
+ d.webkitExitFullscreen();
+ }
+ }
+ delete Gallery.nodes;
+ delete Gallery.fullIDs;
+ doc.style.overflow = '';
+ $.off(d, 'keydown', Gallery.cb.keybinds);
+ if (Conf['Keybinds']) {
+ $.on(d, 'keydown', Keybinds.keydown);
+ }
+ $.off(window, 'resize', Gallery.cb.setHeight);
+ return clearTimeout(Gallery.timeoutID);
+ },
+ setFitness: function() {
+ return (this.checked ? $.addClass : $.rmClass)(doc, "gal-" + (this.name.toLowerCase().replace(/\s+/g, '-')));
+ },
+ setHeight: $.debounce(100, function() {
+ var current, dim, frame, height, minHeight, ref, ref1, ref2, style, width;
+ ref = Gallery.nodes, current = ref.current, frame = ref.frame;
+ style = current.style;
+ if (Conf['Stretch to Fit'] && (dim = (ref1 = g.posts[current.dataset.post]) != null ? ref1.file.dimensions : void 0)) {
+ ref2 = dim.split('x'), width = ref2[0], height = ref2[1];
+ minHeight = Math.min(doc.clientHeight - 25, height / width * frame.clientWidth);
+ style.minHeight = minHeight + 'px';
+ return style.minWidth = (width / height * minHeight) + 'px';
+ } else {
+ return style.minHeight = style.minWidth = null;
+ }
+ }),
+ setDelay: function() {
+ return Gallery.delay = +this.value;
+ }
+ },
+ menu: {
+ init: function() {
+ var el;
+ if (!Gallery.enabled) {
+ return;
+ }
+ el = $.el('span', {
+ textContent: 'Gallery',
+ className: 'gallery-link'
+ });
+ return Header.menu.addEntry({
+ el: el,
+ order: 105,
+ subEntries: Gallery.menu.createSubEntries()
+ });
+ },
+ createSubEntry: function(name) {
+ var input, label;
+ label = UI.checkbox(name, name);
+ input = label.firstElementChild;
+ if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height') {
+ $.on(input, 'change', Gallery.cb.setFitness);
+ }
+ $.event('change', null, input);
+ $.on(input, 'change', $.cb.checked);
+ if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height' || name === 'Stretch to Fit') {
+ $.on(input, 'change', Gallery.cb.setHeight);
+ }
+ return {
+ el: label
+ };
+ },
+ createSubEntries: function() {
+ var delayInput, delayLabel, item, subEntries;
+ subEntries = (function() {
+ var i, len, ref, results;
+ ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'];
+ results = [];
+ for (i = 0, len = ref.length; i < len; i++) {
+ item = ref[i];
+ results.push(Gallery.menu.createSubEntry(item));
+ }
+ return results;
+ })();
+ delayLabel = $.el('label', {
+ innerHTML: "Slide Delay:
"
+ });
+ delayInput = delayLabel.firstElementChild;
+ delayInput.value = Gallery.delay;
+ $.on(delayInput, 'change', Gallery.cb.setDelay);
+ $.on(delayInput, 'change', $.cb.value);
+ subEntries.push({
+ el: delayLabel
+ });
+ return subEntries;
+ }
+ }
+ };
+
+ return Gallery;
+
+}).call(this);
+
+ImageCommon = (function() {
+ var ImageCommon;
+
+ ImageCommon = {
+ pause: function(video) {
+ if (video.nodeName !== 'VIDEO') {
+ return;
+ }
+ video.pause();
+ $.off(video, 'volumechange', Volume.change);
+ return video.muted = true;
+ },
+ rewind: function(el) {
+ if (el.nodeName === 'VIDEO') {
+ if (el.readyState >= el.HAVE_METADATA) {
+ return el.currentTime = 0;
+ }
+ } else if (/\.gif$/.test(el.src)) {
+ return $.queueTask(function() {
+ return el.src = el.src;
+ });
+ }
+ },
+ pushCache: function(el) {
+ ImageCommon.cache = el;
+ return $.on(el, 'error', ImageCommon.cacheError);
+ },
+ popCache: function() {
+ var el;
+ el = ImageCommon.cache;
+ $.off(el, 'error', ImageCommon.cacheError);
+ delete ImageCommon.cache;
+ return el;
+ },
+ cacheError: function() {
+ if (ImageCommon.cache === this) {
+ return delete ImageCommon.cache;
+ }
+ },
+ decodeError: function(file, post) {
+ var message, ref;
+ if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
+ return false;
+ }
+ if (!(message = $('.warning', post.file.thumb.parentNode))) {
+ message = $.el('div', {
+ className: 'warning'
+ });
+ $.after(post.file.thumb, message);
+ }
+ message.textContent = 'Error: Corrupt or unplayable video';
+ return true;
+ },
+ error: function(file, post, delay, cb) {
+ var URL, redirect, src, timeoutID;
+ src = post.file.url.split('/');
+ URL = Redirect.to('file', {
+ boardID: post.board.ID,
+ filename: src[src.length - 1]
+ });
+ if (!(Conf['404 Redirect'] && URL && Redirect.securityCheck(URL))) {
+ URL = null;
+ }
+ if ((post.isDead || post.file.isDead) && file.src.split('/')[2] === 'i.4cdn.org') {
+ return cb(URL);
+ }
+ if (delay != null) {
+ timeoutID = setTimeout((function() {
+ return cb(URL);
+ }), delay);
+ }
+ if (post.isDead || post.file.isDead) {
+ return;
+ }
+ redirect = function() {
+ if (file.src.split('/')[2] === 'i.4cdn.org') {
+ if (delay != null) {
+ clearTimeout(timeoutID);
+ }
+ return cb(URL);
+ }
+ };
+ return $.ajax("//a.4cdn.org/" + post.board + "/thread/" + post.thread + ".json", {
+ onload: function() {
+ var i, len, postObj, ref;
+ if (this.status === 404) {
+ post.kill(!post.isClone);
+ }
+ if (this.status !== 200) {
+ return redirect();
+ }
+ ref = this.response.posts;
+ for (i = 0, len = ref.length; i < len; i++) {
+ postObj = ref[i];
+ if (postObj.no === post.ID) {
+ break;
+ }
+ }
+ if (postObj.no !== post.ID) {
+ post.kill();
+ return redirect();
+ } else if (postObj.filedeleted) {
+ post.kill(true);
+ return redirect();
+ } else {
+ return URL = post.file.url;
+ }
+ }
+ });
+ },
+ addControls: function(video) {
+ var handler;
+ handler = function() {
+ var t;
+ $.off(video, 'mouseover', handler);
+ t = new Date().getTime();
+ return $.asap((function() {
+ return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000;
+ }), function() {
+ return video.controls = true;
+ });
+ };
+ return $.on(video, 'mouseover', handler);
+ },
+ onControls: function(e) {
+ return (Conf['Show Controls'] && Conf['Click Passthrough'] && e.target.nodeName === 'VIDEO') || (e.target.controls && e.target.getBoundingClientRect().bottom - e.clientY < 35);
+ },
+ download: function(e) {
+ if (this.protocol === 'blob:') {
+ return true;
+ }
+ e.preventDefault();
+ return CrossOrigin.file(this.href, (function(_this) {
+ return function(blob) {
+ if (blob) {
+ _this.href = URL.createObjectURL(blob);
+ return _this.click();
+ } else {
+ return new Notice('error', "Could not download " + _this.href, 30);
+ }
+ };
+ })(this));
+ }
+ };
+
+ return ImageCommon;
+
+}).call(this);
+
+ImageExpand = (function() {
+ var ImageExpand,
+ slice = [].slice;
+
+ ImageExpand = {
+ init: function() {
+ var ref;
+ if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ this.EAI = $.el('a', {
+ className: 'expand-all-shortcut fa fa-expand',
+ textContent: 'EAI',
+ title: 'Expand All Images',
+ href: 'javascript:;'
+ });
+ $.on(this.EAI, 'click', this.cb.toggleAll);
+ Header.addShortcut(this.EAI, 3);
+ $.on(d, 'scroll visibilitychange', this.cb.playVideos);
+ this.videoControls = $.el('span', {
+ className: 'video-controls'
+ });
+ $.extend(this.videoControls, {
+ innerHTML: "Â
contract "
+ });
+ return Callbacks.Post.push({
+ name: 'Image Expansion',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var ref;
+ if (!(this.file && (this.file.isImage || this.file.isVideo))) {
+ return;
+ }
+ $.on(this.file.thumb.parentNode, 'click', ImageExpand.cb.toggle);
+ if (this.isClone) {
+ if (this.file.isExpanding) {
+ ImageExpand.contract(this);
+ return ImageExpand.expand(this);
+ } else if (this.file.isExpanded && this.file.isVideo) {
+ Volume.setup(this.file.fullImage);
+ ImageExpand.setupVideoCB(this);
+ return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
+ }
+ } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) {
+ return ImageExpand.expand(this);
+ }
+ },
+ cb: {
+ toggle: function(e) {
+ var file, post, ref;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ post = Get.postFromNode(this);
+ file = post.file;
+ if (file.isExpanded && ImageCommon.onControls(e)) {
+ return;
+ }
+ e.preventDefault();
+ if (!Conf['Autoplay'] && ((ref = file.fullImage) != null ? ref.paused : void 0)) {
+ return file.fullImage.play();
+ } else {
+ return ImageExpand.toggle(post);
+ }
+ },
+ toggleAll: function() {
+ var func, toggle;
+ $.event('CloseMenu');
+ toggle = function(post) {
+ var file;
+ file = post.file;
+ if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
+ return;
+ }
+ if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || !Conf['Expand videos'] && file.isVideo || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
+ return;
+ }
+ return $.queueTask(func, post);
+ };
+ if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) {
+ ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress';
+ ImageExpand.EAI.title = 'Contract All Images';
+ func = ImageExpand.expand;
+ } else {
+ ImageExpand.EAI.className = 'expand-all-shortcut fa fa-expand';
+ ImageExpand.EAI.title = 'Expand All Images';
+ func = ImageExpand.contract;
+ }
+ return g.posts.forEach(function(post) {
+ var i, len, ref;
+ ref = [post].concat(slice.call(post.clones));
+ for (i = 0, len = ref.length; i < len; i++) {
+ post = ref[i];
+ toggle(post);
+ }
+ });
+ },
+ playVideos: function() {
+ return g.posts.forEach(function(post) {
+ var file, i, len, ref, video, visible;
+ ref = [post].concat(slice.call(post.clones));
+ for (i = 0, len = ref.length; i < len; i++) {
+ post = ref[i];
+ file = post.file;
+ if (!(file && file.isVideo && file.isExpanded)) {
+ continue;
+ }
+ video = file.fullImage;
+ visible = ($.hasAudio(video) && !video.muted) || Header.isNodeVisible(video);
+ if (visible && file.wasPlaying) {
+ delete file.wasPlaying;
+ video.play();
+ } else if (!visible && !video.paused) {
+ file.wasPlaying = true;
+ video.pause();
+ }
+ }
+ });
+ },
+ setFitness: function() {
+ return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\s+/g, '-'));
+ }
+ },
+ toggle: function(post) {
+ var next;
+ if (!(post.file.isExpanding || post.file.isExpanded)) {
+ post.file.scrollIntoView = Conf['Scroll into view'];
+ ImageExpand.expand(post);
+ return;
+ }
+ ImageExpand.contract(post);
+ if (Conf['Advance on contract']) {
+ next = post.nodes.root;
+ while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
+ if (!($('.stub', next) || next.offsetHeight === 0)) {
+ break;
+ }
+ }
+ if (next) {
+ return Header.scrollTo(next);
+ }
+ }
+ },
+ contract: function(post) {
+ var bottom, cb, el, eventName, file, i, len, oldHeight, ref, ref1, scrollY, top, x;
+ file = post.file;
+ if (el = file.fullImage) {
+ top = Header.getTopOf(el);
+ bottom = top + el.getBoundingClientRect().height;
+ oldHeight = d.body.clientHeight;
+ scrollY = window.scrollY;
+ }
+ $.rmClass(post.nodes.root, 'expanded-image');
+ $.rmClass(file.thumb, 'expanding');
+ $.rm(file.videoControls);
+ file.thumb.parentNode.href = file.url;
+ file.thumb.parentNode.target = '_blank';
+ ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ x = ref[i];
+ delete file[x];
+ }
+ if (!el) {
+ return;
+ }
+ if (doc.contains(el)) {
+ if (bottom <= 0) {
+ window.scroll(0, scrollY + d.body.clientHeight - oldHeight);
+ } else {
+ Header.scrollToIfNeeded(post.nodes.root);
+ }
+ if (window.scrollX > 0) {
+ window.scroll(0, window.scrollY);
+ }
+ }
+ $.off(el, 'error', ImageExpand.error);
+ ImageCommon.pushCache(el);
+ if (file.isVideo) {
+ ImageCommon.pause(el);
+ ref1 = ImageExpand.videoCB;
+ for (eventName in ref1) {
+ cb = ref1[eventName];
+ $.off(el, eventName, cb);
+ }
+ }
+ if (Conf['Restart when Opened']) {
+ ImageCommon.rewind(file.thumb);
+ }
+ delete file.fullImage;
+ return $.queueTask(function() {
+ if (file.isExpanding || file.isExpanded) {
+ return;
+ }
+ $.rmClass(el, 'full-image');
+ if (el.id) {
+ return;
+ }
+ return $.rm(el);
+ });
+ },
+ expand: function(post, src) {
+ var el, file, isVideo, ref, thumb;
+ file = post.file;
+ thumb = file.thumb, isVideo = file.isVideo;
+ if (post.isHidden || file.isExpanding || file.isExpanded) {
+ return;
+ }
+ $.addClass(thumb, 'expanding');
+ file.isExpanding = true;
+ if (file.fullImage) {
+ el = file.fullImage;
+ } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
+ el = file.fullImage = ImageCommon.popCache();
+ $.on(el, 'error', ImageExpand.error);
+ if (Conf['Restart when Opened'] && el.id !== 'ihover') {
+ ImageCommon.rewind(el);
+ }
+ el.removeAttribute('id');
+ } else {
+ el = file.fullImage = $.el((isVideo ? 'video' : 'img'));
+ el.dataset.fullID = post.fullID;
+ $.on(el, 'error', ImageExpand.error);
+ el.src = src || file.url;
+ }
+ el.className = 'full-image';
+ $.after(thumb, el);
+ if (isVideo) {
+ if (Conf['Show Controls'] && Conf['Click Passthrough'] && !file.videoControls) {
+ file.videoControls = ImageExpand.videoControls.cloneNode(true);
+ $.add(file.text, file.videoControls);
+ }
+ thumb.parentNode.removeAttribute('href');
+ thumb.parentNode.removeAttribute('target');
+ el.loop = true;
+ Volume.setup(el);
+ ImageExpand.setupVideoCB(post);
+ }
+ if (!isVideo) {
+ return $.asap((function() {
+ return el.naturalHeight;
+ }), function() {
+ return ImageExpand.completeExpand(post);
+ });
+ } else if (el.readyState >= el.HAVE_METADATA) {
+ return ImageExpand.completeExpand(post);
+ } else {
+ return $.on(el, 'loadedmetadata', function() {
+ return ImageExpand.completeExpand(post);
+ });
+ }
+ },
+ completeExpand: function(post) {
+ var bottom, file, imageBottom, oldHeight, scrollY;
+ file = post.file;
+ if (!file.isExpanding) {
+ return;
+ }
+ bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height;
+ oldHeight = d.body.clientHeight;
+ scrollY = window.scrollY;
+ $.addClass(post.nodes.root, 'expanded-image');
+ $.rmClass(file.thumb, 'expanding');
+ file.isExpanded = true;
+ delete file.isExpanding;
+ if (doc.contains(post.nodes.root) && bottom <= 0) {
+ window.scroll(window.scrollX, scrollY + d.body.clientHeight - oldHeight);
+ }
+ if (file.scrollIntoView) {
+ delete file.scrollIntoView;
+ imageBottom = Math.min(doc.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header.getBottomOf(file.fullImage));
+ if (imageBottom < 0) {
+ window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage)));
+ }
+ }
+ if (file.isVideo) {
+ return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']);
+ }
+ },
+ setupVideo: function(post, playing, controls) {
+ var fullImage;
+ fullImage = post.file.fullImage;
+ if (!playing) {
+ fullImage.controls = controls;
+ return;
+ }
+ fullImage.controls = false;
+ $.asap((function() {
+ return doc.contains(fullImage);
+ }), function() {
+ if (!d.hidden && Header.isNodeVisible(fullImage)) {
+ return fullImage.play();
+ } else {
+ return post.file.wasPlaying = true;
+ }
+ });
+ if (controls) {
+ return ImageCommon.addControls(fullImage);
+ }
+ },
+ videoCB: (function() {
+ var mousedown;
+ mousedown = false;
+ return {
+ mouseover: function() {
+ return mousedown = false;
+ },
+ mousedown: function(e) {
+ if (e.button === 0) {
+ return mousedown = true;
+ }
+ },
+ mouseup: function(e) {
+ if (e.button === 0) {
+ return mousedown = false;
+ }
+ },
+ mouseout: function(e) {
+ if (mousedown && e.clientX <= this.getBoundingClientRect().left) {
+ return ImageExpand.toggle(Get.postFromNode(this));
+ }
+ }
+ };
+ })(),
+ setupVideoCB: function(post) {
+ var cb, eventName, ref;
+ ref = ImageExpand.videoCB;
+ for (eventName in ref) {
+ cb = ref[eventName];
+ $.on(post.file.fullImage, eventName, cb);
+ }
+ if (post.file.videoControls) {
+ return $.on(post.file.videoControls.firstElementChild, 'click', function() {
+ return ImageExpand.toggle(post);
+ });
+ }
+ },
+ error: function() {
+ var post;
+ post = Get.postFromNode(this);
+ $.rm(this);
+ delete post.file.fullImage;
+ if (!(post.file.isExpanding || post.file.isExpanded)) {
+ return;
+ }
+ if (ImageCommon.decodeError(this, post)) {
+ return ImageExpand.contract(post);
+ }
+ if (this.src.split('/')[2] !== 'i.4cdn.org') {
+ return ImageExpand.contract(post);
+ }
+ return ImageCommon.error(this, post, 10 * $.SECOND, function(URL) {
+ if (post.file.isExpanding || post.file.isExpanded) {
+ ImageExpand.contract(post);
+ if (URL) {
+ return ImageExpand.expand(post, URL);
+ }
+ }
+ });
+ },
+ menu: {
+ init: function() {
+ var conf, createSubEntry, el, name, ref, subEntries;
+ if (!ImageExpand.enabled) {
+ return;
+ }
+ el = $.el('span', {
+ textContent: 'Image Expansion',
+ className: 'image-expansion-link'
+ });
+ createSubEntry = ImageExpand.menu.createSubEntry;
+ subEntries = [];
+ ref = Config.imageExpansion;
+ for (name in ref) {
+ conf = ref[name];
+ subEntries.push(createSubEntry(name, conf[1]));
+ }
+ return Header.menu.addEntry({
+ el: el,
+ order: 105,
+ subEntries: subEntries
+ });
+ },
+ createSubEntry: function(name, desc) {
+ var input, label;
+ label = UI.checkbox(name, name);
+ label.title = desc;
+ input = label.firstElementChild;
+ if (name === 'Fit width' || name === 'Fit height') {
+ $.on(input, 'change', ImageExpand.cb.setFitness);
+ }
+ $.event('change', null, input);
+ $.on(input, 'change', $.cb.checked);
+ return {
+ el: label
+ };
+ }
+ }
+ };
+
+ return ImageExpand;
+
+}).call(this);
+
+ImageHover = (function() {
+ var ImageHover;
+
+ ImageHover = {
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ if (Conf['Image Hover']) {
+ Callbacks.Post.push({
+ name: 'Image Hover',
+ cb: this.node
+ });
+ }
+ if (Conf['Image Hover in Catalog']) {
+ return Callbacks.CatalogThread.push({
+ name: 'Image Hover',
+ cb: this.catalogNode
+ });
+ }
+ },
+ node: function() {
+ if (!(this.file && (this.file.isImage || this.file.isVideo))) {
+ return;
+ }
+ return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover(this));
+ },
+ catalogNode: function() {
+ var file;
+ file = this.thread.OP.file;
+ if (!(file && (file.isImage || file.isVideo))) {
+ return;
+ }
+ return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover(this.thread.OP));
+ },
+ mouseover: function(post) {
+ return function(e) {
+ var el, error, file, height, isVideo, left, maxHeight, maxWidth, ref, ref1, ref2, right, scale, width, x;
+ if (!doc.contains(this)) {
+ return;
+ }
+ file = post.file;
+ isVideo = file.isVideo;
+ if (file.isExpanding || file.isExpanded) {
+ return;
+ }
+ error = ImageHover.error(post);
+ if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
+ el = ImageCommon.popCache();
+ $.on(el, 'error', error);
+ } else {
+ el = $.el((isVideo ? 'video' : 'img'));
+ el.dataset.fullID = post.fullID;
+ $.on(el, 'error', error);
+ el.src = file.url;
+ }
+ if (Conf['Restart when Opened']) {
+ ImageCommon.rewind(el);
+ ImageCommon.rewind(this);
+ }
+ el.id = 'ihover';
+ $.add(Header.hover, el);
+ if (isVideo) {
+ el.loop = true;
+ el.controls = false;
+ Volume.setup(el);
+ if (Conf['Autoplay']) {
+ el.play();
+ }
+ }
+ ref1 = (function() {
+ var i, len, ref1, results;
+ ref1 = file.dimensions.split('x');
+ results = [];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ x = ref1[i];
+ results.push(+x);
+ }
+ return results;
+ })(), width = ref1[0], height = ref1[1];
+ ref2 = this.getBoundingClientRect(), left = ref2.left, right = ref2.right;
+ maxWidth = Math.max(left, doc.clientWidth - right);
+ maxHeight = doc.clientHeight - UI.hover.padding;
+ scale = Math.min(1, maxWidth / width, maxHeight / height);
+ el.style.maxWidth = (scale * width) + "px";
+ el.style.maxHeight = (scale * height) + "px";
+ return UI.hover({
+ root: this,
+ el: el,
+ latestEvent: e,
+ endEvents: 'mouseout click',
+ height: scale * height,
+ noRemove: true,
+ cb: function() {
+ $.off(el, 'error', error);
+ ImageCommon.pushCache(el);
+ ImageCommon.pause(el);
+ $.rm(el);
+ return el.removeAttribute('style');
+ }
+ });
+ };
+ },
+ error: function(post) {
+ return function() {
+ if (ImageCommon.decodeError(this, post)) {
+ return;
+ }
+ return ImageCommon.error(this, post, 3 * $.SECOND, (function(_this) {
+ return function(URL) {
+ if (URL) {
+ return _this.src = URL + (_this.src === URL ? '?' + Date.now() : '');
+ } else {
+ return $.rm(_this);
+ }
+ };
+ })(this));
+ };
+ }
+ };
+
+ return ImageHover;
+
+}).call(this);
+
+ImageLoader = (function() {
+ var ImageLoader,
+ slice = [].slice;
+
+ ImageLoader = {
+ init: function() {
+ var prefetch, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Image Replace',
+ cb: this.node
+ });
+ $.on(d, 'PostsInserted', function() {
+ return g.posts.forEach(ImageLoader.prefetch);
+ });
+ if (Conf['Replace WEBM']) {
+ $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
+ }
+ if (!Conf['Image Prefetching']) {
+ return;
+ }
+ prefetch = $.el('label', {
+ innerHTML: "
Prefetch Images"
+ });
+ this.el = prefetch.firstElementChild;
+ $.on(this.el, 'change', this.toggle);
+ return Header.menu.addEntry({
+ el: prefetch,
+ order: 98
+ });
+ },
+ node: function() {
+ if (this.isClone || !this.file) {
+ return;
+ }
+ if (Conf['Replace WEBM'] && this.file.isVideo) {
+ ImageLoader.replaceVideo(this);
+ }
+ return ImageLoader.prefetch(this);
+ },
+ replaceVideo: function(post) {
+ var attr, file, i, len, ref, thumb, video;
+ file = post.file;
+ thumb = file.thumb;
+ video = $.el('video', {
+ preload: 'none',
+ loop: true,
+ muted: true,
+ poster: thumb.src || thumb.dataset.src,
+ textContent: thumb.alt,
+ className: thumb.className
+ });
+ video.setAttribute('muted', 'muted');
+ video.dataset.md5 = thumb.dataset.md5;
+ ref = ['height', 'width', 'maxHeight', 'maxWidth'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ attr = ref[i];
+ video.style[attr] = thumb.style[attr];
+ }
+ video.src = file.url;
+ $.replace(thumb, video);
+ file.thumb = video;
+ return file.videoThumb = true;
+ },
+ prefetch: function(post) {
+ var clone, el, file, i, isImage, isVideo, len, match, ref, replace, thumb, type, url;
+ file = post.file;
+ if (!file) {
+ return;
+ }
+ isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, url = file.url;
+ if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) {
+ return;
+ }
+ type = (match = url.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
+ replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src);
+ if (!(replace || Conf['prefetch'])) {
+ return;
+ }
+ if (![post].concat(slice.call(post.clones)).some(function(clone) {
+ return doc.contains(clone.nodes.root);
+ })) {
+ return;
+ }
+ file.isPrefetched = true;
+ if (file.videoThumb) {
+ ref = post.clones;
+ for (i = 0, len = ref.length; i < len; i++) {
+ clone = ref[i];
+ clone.file.thumb.preload = 'auto';
+ }
+ thumb.preload = 'auto';
+ if ($.engine === 'gecko') {
+ $.on(thumb, 'loadeddata', function() {
+ return this.removeAttribute('poster');
+ });
+ }
+ return;
+ }
+ el = $.el(isImage ? 'img' : 'video');
+ if (replace && isImage) {
+ $.on(el, 'load', function() {
+ var j, len1, ref1;
+ ref1 = post.clones;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ clone = ref1[j];
+ clone.file.thumb.src = url;
+ }
+ thumb.src = url;
+ return thumb.removeAttribute('data-src');
+ });
+ }
+ return el.src = url;
+ },
+ toggle: function() {
+ if (Conf['prefetch'] = this.checked) {
+ g.posts.forEach(ImageLoader.prefetch);
+ }
+ },
+ playVideos: function() {
+ var qpClone, ref;
+ qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0;
+ return g.posts.forEach(function(post) {
+ var i, len, ref1, ref2, thumb;
+ ref1 = [post].concat(slice.call(post.clones));
+ for (i = 0, len = ref1.length; i < len; i++) {
+ post = ref1[i];
+ if (!((ref2 = post.file) != null ? ref2.videoThumb : void 0)) {
+ continue;
+ }
+ thumb = post.file.thumb;
+ if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) {
+ thumb.play();
+ } else {
+ thumb.pause();
+ }
+ }
+ });
+ }
+ };
+
+ return ImageLoader;
+
+}).call(this);
+
+Metadata = (function() {
+ var Metadata;
+
+ Metadata = {
+ init: function() {
+ var ref;
+ if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'WEBM Metadata',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var el;
+ if (!(this.file && /webm$/i.test(this.file.url))) {
+ return;
+ }
+ if (this.isClone) {
+ el = $('.webm-title', this.file.text);
+ } else {
+ el = $.el('span', {
+ className: 'webm-title'
+ });
+ $.extend(el, {
+ innerHTML: "
"
+ });
+ $.add(this.file.text, [$.tn('\u00A0'), el]);
+ }
+ if (el.children.length === 1) {
+ return $.one(el.lastElementChild, 'mouseover focus', Metadata.load);
+ }
+ },
+ load: function() {
+ $.rmClass(this.parentNode, 'error');
+ $.addClass(this.parentNode, 'loading');
+ return CrossOrigin.binary(Get.postFromNode(this).file.url, (function(_this) {
+ return function(data) {
+ var output, title;
+ $.rmClass(_this.parentNode, 'loading');
+ if (data != null) {
+ title = Metadata.parse(data);
+ output = $.el('span', {
+ textContent: title || ''
+ });
+ if (title == null) {
+ $.addClass(_this.parentNode, 'not-found');
+ }
+ $.before(_this, output);
+ _this.parentNode.tabIndex = 0;
+ if (d.activeElement === _this) {
+ _this.parentNode.focus();
+ }
+ return _this.tabIndex = -1;
+ } else {
+ $.addClass(_this.parentNode, 'error');
+ return $.one(_this, 'click', Metadata.load);
+ }
+ };
+ })(this), {
+ Range: 'bytes=0-9999'
+ });
+ },
+ parse: function(data) {
+ var element, i, readInt, size, title;
+ readInt = function() {
+ var len, n;
+ n = data[i++];
+ len = 0;
+ while (n < (0x80 >> len)) {
+ len++;
+ }
+ n ^= 0x80 >> len;
+ while (len-- && i < data.length) {
+ n = (n << 8) ^ data[i++];
+ }
+ return n;
+ };
+ i = 0;
+ while (i < data.length) {
+ element = readInt();
+ size = readInt();
+ if (element === 0x3BA9) {
+ title = '';
+ while (size-- && i < data.length) {
+ title += String.fromCharCode(data[i++]);
+ }
+ return decodeURIComponent(escape(title));
+ } else if (element !== 0x8538067 && element !== 0x549A966) {
+ i += size;
+ }
+ }
+ return null;
+ }
+ };
+
+ return Metadata;
+
+}).call(this);
+
+RevealSpoilers = (function() {
+ var RevealSpoilers;
+
+ RevealSpoilers = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Reveal Spoiler Thumbnails',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var thumb;
+ if (!(!this.isClone && this.file && this.file.thumb && this.file.isSpoiler)) {
+ return;
+ }
+ thumb = this.file.thumb;
+ thumb.removeAttribute('style');
+ thumb.style.maxHeight = thumb.style.maxWidth = this.isReply ? '125px' : '250px';
+ if (thumb.src) {
+ return thumb.src = this.file.thumbURL;
+ } else {
+ return thumb.dataset.src = this.file.thumbURL;
+ }
+ }
+ };
+
+ return RevealSpoilers;
+
+}).call(this);
+
+Sauce = (function() {
+ var Sauce,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Sauce = {
+ init: function() {
+ var err, j, len, link, links, ref, ref1;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
+ return;
+ }
+ links = [];
+ ref1 = Conf['sauces'].split('\n');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ link = ref1[j];
+ try {
+ if (link[0] !== '#') {
+ links.push(link.trim());
+ }
+ } catch (_error) {
+ err = _error;
+ }
+ }
+ if (!links.length) {
+ return;
+ }
+ this.links = links;
+ this.link = $.el('a', {
+ target: '_blank',
+ className: 'sauce'
+ });
+ return Callbacks.Post.push({
+ name: 'Sauce',
+ cb: this.node
+ });
+ },
+ sandbox: function(url) {
+ return E.url({
+ innerHTML: "
[sb] " + E(url) + " "
+ });
+ },
+ rmOrigin: function(e) {
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ $.open(this.href);
+ return e.preventDefault();
+ },
+ createSauceLink: function(link, post) {
+ var a, ext, i, j, key, len, m, part, parts, ref, ref1, ref2, skip, url;
+ if (!(link = link.trim())) {
+ return null;
+ }
+ parts = {};
+ ref = link.split(/;(?=(?:text|boards|types|sandbox):?)/);
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ part = ref[i];
+ if (i === 0) {
+ parts['url'] = part;
+ } else {
+ m = part.match(/^(\w*):?(.*)$/);
+ parts[m[1]] = m[2];
+ }
+ }
+ parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
+ ext = post.file.url.match(/[^.]*$/)[0];
+ skip = false;
+ for (key in parts) {
+ parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi)/g, function(_, parameter) {
+ var type;
+ type = Sauce.formatters[parameter](post, ext);
+ if (type == null) {
+ skip = true;
+ return '';
+ }
+ if (key === 'url' && (parameter !== '%' && parameter !== 'semi')) {
+ if (/^javascript:/i.test(parts['url'])) {
+ type = JSON.stringify(type);
+ }
+ type = encodeURIComponent(type);
+ }
+ return type;
+ });
+ }
+ if (skip) {
+ return null;
+ }
+ if (!(!parts['boards'] || (ref2 = post.board.ID, indexOf.call(parts['boards'].split(','), ref2) >= 0))) {
+ return null;
+ }
+ if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
+ return null;
+ }
+ url = parts['url'];
+ if (parts['sandbox'] != null) {
+ url = Sauce.sandbox(url);
+ }
+ a = Sauce.link.cloneNode(true);
+ a.href = url;
+ a.textContent = parts['text'];
+ if (/^javascript:/i.test(parts['url'])) {
+ a.removeAttribute('target');
+ }
+ if (parts['sandbox'] != null) {
+ $.on(a, 'click', Sauce.rmOrigin);
+ }
+ return a;
+ },
+ node: function() {
+ var j, len, link, node, nodes, ref;
+ if (this.isClone || !this.file) {
+ return;
+ }
+ nodes = [];
+ ref = Sauce.links;
+ for (j = 0, len = ref.length; j < len; j++) {
+ link = ref[j];
+ if (node = Sauce.createSauceLink(link, this)) {
+ nodes.push($.tn('\u00A0'), node);
+ }
+ }
+ return $.add(this.file.text, nodes);
+ },
+ formatters: {
+ TURL: function(post) {
+ return post.file.thumbURL;
+ },
+ URL: function(post) {
+ return post.file.url;
+ },
+ IMG: function(post, ext) {
+ if (ext === 'gif' || ext === 'jpg' || ext === 'png') {
+ return post.file.url;
+ } else {
+ return post.file.thumbURL;
+ }
+ },
+ MD5: function(post) {
+ return post.file.MD5;
+ },
+ sMD5: function(post) {
+ var ref;
+ return (ref = post.file.MD5) != null ? ref.replace(/[+\/=]/g, function(c) {
+ return {
+ '+': '-',
+ '/': '_',
+ '=': ''
+ }[c];
+ }) : void 0;
+ },
+ hMD5: function(post) {
+ var c;
+ if (post.file.MD5) {
+ return ((function() {
+ var j, len, ref, results;
+ ref = atob(post.file.MD5);
+ results = [];
+ for (j = 0, len = ref.length; j < len; j++) {
+ c = ref[j];
+ results.push(("0" + (c.charCodeAt(0).toString(16))).slice(-2));
+ }
+ return results;
+ })()).join('');
+ }
+ },
+ board: function(post) {
+ return post.board.ID;
+ },
+ name: function(post) {
+ return post.file.name;
+ },
+ '%': function() {
+ return '%';
+ },
+ semi: function() {
+ return ';';
+ }
+ }
+ };
+
+ return Sauce;
+
+}).call(this);
+
+Volume = (function() {
+ var Volume;
+
+ Volume = {
+ init: function() {
+ var ref, ref1, unmuteEntry, volumeEntry;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
+ return;
+ }
+ $.sync('Allow Sound', function(x) {
+ var ref1;
+ Conf['Allow Sound'] = x;
+ return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0;
+ });
+ $.sync('Default Volume', function(x) {
+ var ref1;
+ Conf['Default Volume'] = x;
+ return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0;
+ });
+ if (Conf['Mouse Wheel Volume']) {
+ Callbacks.Post.push({
+ name: 'Mouse Wheel Volume',
+ cb: this.node
+ });
+ }
+ if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg') {
+ return;
+ }
+ if (Conf['Mouse Wheel Volume']) {
+ Callbacks.CatalogThread.push({
+ name: 'Mouse Wheel Volume',
+ cb: this.catalogNode
+ });
+ }
+ unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound');
+ unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1];
+ volumeEntry = $.el('label', {
+ title: 'Default volume for videos.'
+ });
+ $.extend(volumeEntry, {
+ innerHTML: "
Volume"
+ });
+ this.inputs = {
+ unmute: unmuteEntry.firstElementChild,
+ volume: volumeEntry.firstElementChild
+ };
+ $.on(this.inputs.unmute, 'change', $.cb.checked);
+ $.on(this.inputs.volume, 'change', $.cb.value);
+ Header.menu.addEntry({
+ el: unmuteEntry,
+ order: 200
+ });
+ return Header.menu.addEntry({
+ el: volumeEntry,
+ order: 201
+ });
+ },
+ setup: function(video) {
+ video.muted = !Conf['Allow Sound'];
+ video.volume = Conf['Default Volume'];
+ return $.on(video, 'volumechange', Volume.change);
+ },
+ change: function() {
+ var items, key, muted, val, volume;
+ muted = this.muted, volume = this.volume;
+ items = {
+ 'Allow Sound': !muted,
+ 'Default Volume': volume
+ };
+ for (key in items) {
+ val = items[key];
+ if (Conf[key] === val) {
+ delete items[key];
+ }
+ }
+ $.set(items);
+ $.extend(Conf, items);
+ if (Volume.inputs) {
+ Volume.inputs.unmute.checked = !muted;
+ return Volume.inputs.volume.value = volume;
+ }
+ },
+ node: function() {
+ var ref, ref1;
+ if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) {
+ return;
+ }
+ $.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover));
+ return $.on($('a', this.file.text), 'wheel', Volume.wheel.bind(this.file.thumb.parentNode));
+ },
+ catalogNode: function() {
+ var file;
+ file = this.thread.OP.file;
+ if (!(file != null ? file.isVideo : void 0)) {
+ return;
+ }
+ return $.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header.hover));
+ },
+ wheel: function(e) {
+ var el, volume;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
+ return;
+ }
+ if (!(el = $('video:not([data-md5])', this))) {
+ return;
+ }
+ if (el.muted || !$.hasAudio(el)) {
+ return;
+ }
+ volume = el.volume + 0.1;
+ if (e.deltaY < 0) {
+ volume *= 1.1;
+ }
+ if (e.deltaY > 0) {
+ volume /= 1.1;
+ }
+ el.volume = $.minmax(volume - 0.1, 0, 1);
+ return e.preventDefault();
+ }
+ };
+
+ return Volume;
+
+}).call(this);
+
+Embedding = (function() {
+ var Embedding;
+
+ Embedding = {
+ init: function() {
+ var j, len, ref, type;
+ if (!(Conf['Embedding'] || Conf['Link Title'])) {
+ return;
+ }
+ this.types = {};
+ ref = this.ordered_types;
+ for (j = 0, len = ref.length; j < len; j++) {
+ type = ref[j];
+ this.types[type.key] = type;
+ }
+ if (Conf['Floating Embeds']) {
+ this.dialog = UI.dialog('embedding', 'top: 50px; right: 0px;', {
+ innerHTML: "
"
+ });
+ this.media = $('#media-embed', this.dialog);
+ $.one(d, '4chanXInitFinished', this.ready);
+ }
+ if (Conf['Link Title']) {
+ return $.on(d, '4chanXInitFinished PostsInserted', function() {
+ var key, ref1, ref2, service;
+ ref1 = Embedding.types;
+ for (key in ref1) {
+ service = ref1[key];
+ if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
+ Embedding.flushTitles(service.title);
+ }
+ }
+ });
+ }
+ },
+ events: function(post) {
+ var el, i, items;
+ if (!Conf['Embedding']) {
+ return;
+ }
+ i = 0;
+ items = $$('.embedder', post.nodes.comment);
+ while (el = items[i++]) {
+ $.on(el, 'click', Embedding.cb.toggle);
+ if ($.hasClass(el, 'embedded')) {
+ Embedding.cb.toggle.call(el);
+ }
+ }
+ },
+ process: function(link, post) {
+ var data;
+ if (!(Conf['Embedding'] || Conf['Link Title'])) {
+ return;
+ }
+ if ($.x('ancestor::pre', link)) {
+ return;
+ }
+ if (data = Embedding.services(link)) {
+ data.post = post;
+ if (Conf['Embedding']) {
+ Embedding.embed(data);
+ }
+ if (Conf['Link Title']) {
+ return Embedding.title(data);
+ }
+ }
+ },
+ services: function(link) {
+ var href, j, len, match, ref, type;
+ href = link.href;
+ ref = Embedding.ordered_types;
+ for (j = 0, len = ref.length; j < len; j++) {
+ type = ref[j];
+ if (!(match = type.regExp.exec(href))) {
+ continue;
+ }
+ if (type.dummy) {
+ return;
+ }
+ return {
+ key: type.key,
+ uid: match[1],
+ options: match[2],
+ link: link
+ };
+ }
+ },
+ embed: function(data) {
+ var embed, href, key, link, name, options, post, ref, uid, value;
+ key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
+ href = link.href;
+ if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
+ return;
+ }
+ $.addClass(link, key.toLowerCase());
+ embed = $.el('a', {
+ className: 'embedder',
+ href: 'javascript:;',
+ textContent: '(embed)'
+ });
+ ref = {
+ key: key,
+ uid: uid,
+ options: options,
+ href: href
+ };
+ for (name in ref) {
+ value = ref[name];
+ embed.dataset[name] = value;
+ }
+ $.on(embed, 'click', Embedding.cb.toggle);
+ $.after(link, [$.tn(' '), embed]);
+ if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote && key !== 'TwitchTV') {
+ return $.asap((function() {
+ return doc.contains(embed);
+ }), function() {
+ return Embedding.cb.toggle.call(embed);
+ });
+ }
+ },
+ ready: function() {
+ $.addClass(Embedding.dialog, 'empty');
+ $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat);
+ $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed);
+ $.on($('.jump', Embedding.dialog), 'click', function() {
+ if (doc.contains(Embedding.lastEmbed)) {
+ return Header.scrollTo(Embedding.lastEmbed);
+ }
+ });
+ return $.add(d.body, Embedding.dialog);
+ },
+ closeFloat: function() {
+ delete Embedding.lastEmbed;
+ $.addClass(Embedding.dialog, 'empty');
+ return $.replace(Embedding.media.firstChild, $.el('div'));
+ },
+ dragEmbed: function() {
+ var style;
+ style = Embedding.media.style;
+ if (Embedding.dragEmbed.mouseup) {
+ $.off(d, 'mouseup', Embedding.dragEmbed);
+ Embedding.dragEmbed.mouseup = false;
+ style.visibility = '';
+ return;
+ }
+ $.on(d, 'mouseup', Embedding.dragEmbed);
+ Embedding.dragEmbed.mouseup = true;
+ return style.visibility = 'hidden';
+ },
+ title: function(data) {
+ var key, link, options, post, service, uid;
+ key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
+ if (!(service = Embedding.types[key].title)) {
+ return;
+ }
+ $.addClass(link, key.toLowerCase());
+ if (service.batchSize) {
+ (service.queue || (service.queue = [])).push(data);
+ if (service.queue.length >= service.batchSize) {
+ return Embedding.flushTitles(service);
+ }
+ } else {
+ if (!$.cache(service.api(uid), (function() {
+ return Embedding.cb.title(this, data);
+ }), {
+ responseType: 'json'
+ })) {
+ return $.extend(link, {
+ innerHTML: "[" + E(key) + "]
Title Link Blocked (are you using NoScript?)"
+ });
+ }
+ }
+ },
+ flushTitles: function(service) {
+ var cb, data, j, len, queue;
+ queue = service.queue;
+ if (!(queue != null ? queue.length : void 0)) {
+ return;
+ }
+ service.queue = [];
+ cb = function() {
+ var data, j, len;
+ for (j = 0, len = queue.length; j < len; j++) {
+ data = queue[j];
+ Embedding.cb.title(this, data);
+ }
+ };
+ if (!$.cache(service.api((function() {
+ var j, len, results;
+ results = [];
+ for (j = 0, len = queue.length; j < len; j++) {
+ data = queue[j];
+ results.push(data.uid);
+ }
+ return results;
+ })()), cb, {
+ responseType: 'json'
+ })) {
+ for (j = 0, len = queue.length; j < len; j++) {
+ data = queue[j];
+ $.extend(data.link, {
+ innerHTML: "[" + E(data.key) + "]
Title Link Blocked (are you using NoScript?)"
+ });
+ }
+ }
+ },
+ cb: {
+ toggle: function(e) {
+ var div;
+ if (e != null) {
+ e.preventDefault();
+ }
+ if (Conf['Floating Embeds']) {
+ if (!(div = Embedding.media.firstChild)) {
+ return;
+ }
+ $.replace(div, Embedding.cb.embed(this));
+ Embedding.lastEmbed = Get.postFromNode(this).nodes.root;
+ $.rmClass(Embedding.dialog, 'empty');
+ return;
+ }
+ if ($.hasClass(this, "embedded")) {
+ $.rm(this.nextElementSibling);
+ this.textContent = '(embed)';
+ } else {
+ $.after(this, Embedding.cb.embed(this));
+ this.textContent = '(unembed)';
+ }
+ return $.toggleClass(this, 'embedded');
+ },
+ embed: function(a) {
+ var container, el, type;
+ container = $.el('div');
+ $.add(container, el = (type = Embedding.types[a.dataset.key]).el(a));
+ el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
+ return container;
+ },
+ title: function(req, data) {
+ var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
+ key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
+ status = req.status;
+ service = Embedding.types[key].title;
+ text = "[" + key + "] " + ((function() {
+ switch (status) {
+ case 200:
+ case 304:
+ return service.text(req.response, uid);
+ case 404:
+ return "Not Found";
+ case 403:
+ return "Forbidden or Private";
+ default:
+ return status + "'d";
+ }
+ })());
+ link.dataset.original = link.textContent;
+ link.textContent = text;
+ ref = post.clones;
+ for (j = 0, len = ref.length; j < len; j++) {
+ post2 = ref[j];
+ ref1 = $$('a.linkify', post2.nodes.comment);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ link2 = ref1[k];
+ if (!(link2.href === link.href)) {
+ continue;
+ }
+ if ((base1 = link2.dataset).original == null) {
+ base1.original = link2.textContent;
+ }
+ link2.textContent = text;
+ }
+ }
+ }
+ },
+ ordered_types: [
+ {
+ key: 'audio',
+ regExp: /\.(?:mp3|ogg|wav)(?:\?|$)/i,
+ style: '',
+ el: function(a) {
+ return $.el('audio', {
+ controls: true,
+ preload: 'auto',
+ src: a.dataset.href
+ });
+ }
+ }, {
+ key: 'Dailymotion',
+ regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/,
+ el: function(a) {
+ var el, options, start;
+ options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? "?" + start[1] : '';
+ el = $.el('iframe', {
+ src: "//www.dailymotion.com/embed/video/" + a.dataset.uid + options
+ });
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ api: function(uid) {
+ return "https://api.dailymotion.com/video/" + uid;
+ },
+ text: function(_) {
+ return _.title;
+ }
+ }
+ }, {
+ key: 'Gist',
+ regExp: /^\w+:\/\/gist\.github\.com\/(?:[\w\-]+\/)?(\w+)/,
+ el: function(a) {
+ var content, el;
+ el = $.el('iframe');
+ el.setAttribute('sandbox', 'allow-scripts');
+ content = {
+ innerHTML: "
" + E(a.dataset.uid) + " "
+ };
+ el.src = E.url(content);
+ return el;
+ },
+ title: {
+ api: function(uid) {
+ return "https://api.github.com/gists/" + uid;
+ },
+ text: function(arg) {
+ var file, files;
+ files = arg.files;
+ for (file in files) {
+ if (files.hasOwnProperty(file)) {
+ return file;
+ }
+ }
+ }
+ }
+ }, {
+ key: 'image',
+ regExp: /\.(?:gif|png|jpg|jpeg|bmp)(?:\?|$)/i,
+ style: '',
+ el: function(a) {
+ return $.el('div', {
+ innerHTML: "
"
+ });
+ }
+ }, {
+ key: 'InstallGentoo',
+ regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'Twitter',
+ regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'LiveLeak',
+ regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*i=(\w+)/,
+ httpOnly: true,
+ el: function(a) {
+ var el;
+ el = $.el('iframe', {
+ src: "http://www.liveleak.com/ll_embed?i=" + a.dataset.uid
+ });
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }, {
+ key: 'Pastebin',
+ regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
+ httpOnly: true,
+ el: function(a) {
+ var div;
+ return div = $.el('iframe', {
+ src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'Gfycat',
+ regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
+ el: function(a) {
+ var div;
+ return div = $.el('iframe', {
+ src: "//gfycat.com/iframe/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'SoundCloud',
+ regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/,
+ style: 'border: 0; width: 500px; height: 400px;',
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(a.dataset.uid))
+ });
+ },
+ title: {
+ api: function(uid) {
+ return "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(uid));
+ },
+ text: function(_) {
+ return _.title;
+ }
+ }
+ }, {
+ key: 'StrawPoll',
+ regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
+ style: 'border: 0; width: 600px; height: 406px;',
+ el: function(a) {
+ return $.el('iframe', {
+ src: "//strawpoll.me/embed_1/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'TwitchTV',
+ regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/(\w[^#\&\?]*)/,
+ style: "border: none; width: 620px; height: 378px;",
+ el: function(a) {
+ var _, channel, flashvars, id, idprefix, j, len, obj, part, ref, result, seconds, start, type;
+ if (result = /(\w+)\/([bcv])\/(\d+)/i.exec(a.dataset.uid)) {
+ _ = result[0], channel = result[1], type = result[2], id = result[3];
+ idprefix = type === 'b' ? 'a' : type;
+ flashvars = "channel=" + channel + "&start_volume=25&auto_play=false&videoId=" + idprefix + id;
+ if (start = a.dataset.href.match(/\bt=(\w+)/)) {
+ seconds = 0;
+ ref = start[1].match(/\d+[hms]/g);
+ for (j = 0, len = ref.length; j < len; j++) {
+ part = ref[j];
+ seconds += +part.slice(0, -1) * {
+ 'h': 3600,
+ 'm': 60,
+ 's': 1
+ }[part.slice(-1)];
+ }
+ flashvars += "&initial_time=" + seconds;
+ }
+ } else {
+ channel = (/(\w+)/.exec(a.dataset.uid))[0];
+ flashvars = "channel=" + channel + "&start_volume=25&auto_play=false";
+ }
+ obj = $.el('object', {
+ data: '//www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf'
+ });
+ $.extend(obj, {
+ innerHTML: "
"
+ });
+ obj.children[1].value = flashvars;
+ return obj;
+ }
+ }, {
+ key: 'Vocaroo',
+ regExp: /^\w+:\/\/(?:www\.)?vocaroo\.com\/i\/(\w+)/,
+ style: '',
+ el: function(a) {
+ var el, type;
+ el = $.el('audio', {
+ controls: true,
+ preload: 'auto'
+ });
+ type = el.canPlayType('audio/webm') ? 'webm' : 'mp3';
+ el.src = "http://vocaroo.com/media_command.php?media=" + a.dataset.uid + "&command=download_" + type;
+ return el;
+ }
+ }, {
+ key: 'Vimeo',
+ regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "//player.vimeo.com/video/" + a.dataset.uid + "?wmode=opaque"
+ });
+ },
+ title: {
+ api: function(uid) {
+ return "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" + uid;
+ },
+ text: function(_) {
+ return _.title;
+ }
+ }
+ }, {
+ key: 'Vine',
+ regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/,
+ style: 'border: none; width: 500px; height: 500px;',
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://vine.co/v/" + a.dataset.uid + "/card"
+ });
+ }
+ }, {
+ key: 'YouTube',
+ regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/))([\w\-]{11})(.*)/,
+ el: function(a) {
+ var el, start;
+ start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/);
+ if (start) {
+ start = start[1];
+ }
+ if (start && !/^\d+$/.test(start)) {
+ start += ' 0h0m0s';
+ start = 3600 * start.match(/(\d+)h/)[1] + 60 * start.match(/(\d+)m/)[1] + 1 * start.match(/(\d+)s/)[1];
+ }
+ el = $.el('iframe', {
+ src: "//www.youtube.com/embed/" + a.dataset.uid + "?wmode=opaque" + (start ? '&start=' + start : '')
+ });
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ batchSize: 50,
+ api: function(uids) {
+ var ids, key;
+ ids = encodeURIComponent(uids.join(','));
+ key = 'AIzaSyB5_zaen_-46Uhz1xGR-lz1YoUMHqCD6CE';
+ return "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + ids + "&fields=items%28id%2Csnippet%28title%29%29&key=" + key;
+ },
+ text: function(data, uid) {
+ var item, j, len, ref;
+ ref = data.items;
+ for (j = 0, len = ref.length; j < len; j++) {
+ item = ref[j];
+ if (item.id === uid) {
+ return item.snippet.title;
+ }
+ }
+ return 'Not Found';
+ }
+ }
+ }, {
+ key: 'Loopvid',
+ regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|pc|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el: function(a) {
+ var _, base, el, host, j, k, len, len1, name, names, ref, ref1, type, types, url;
+ el = $.el('video', {
+ controls: true,
+ preload: 'auto',
+ loop: true
+ });
+ ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
+ types = (function() {
+ switch (host) {
+ case 'gd':
+ case 'wu':
+ case 'fc':
+ return [''];
+ case 'gc':
+ return ['giant', 'fat', 'zippy'];
+ default:
+ return ['.webm', '.mp4'];
+ }
+ })();
+ ref1 = names.split(',');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ name = ref1[j];
+ for (k = 0, len1 = types.length; k < len1; k++) {
+ type = types[k];
+ base = "" + name + type;
+ url = (function() {
+ switch (host) {
+ case 'pf':
+ return "https://web.archive.org/web/2/http://a.pomf.se/" + base;
+ case 'kd':
+ return "http://kastden.org/loopvid/" + base;
+ case 'lv':
+ return "http://kastden.org/_loopvid_media/lv/" + base;
+ case 'gd':
+ return "https://docs.google.com/uc?export=download&id=" + base;
+ case 'gh':
+ return "https://googledrive.com/host/" + base;
+ case 'db':
+ return "https://dl.dropboxusercontent.com/u/" + base;
+ case 'dx':
+ return "https://dl.dropboxusercontent.com/" + base;
+ case 'nn':
+ return "http://naenara.eu/loopvids/" + base;
+ case 'cp':
+ return "https://copy.com/" + base;
+ case 'wu':
+ return "http://webmup.com/" + base + "/vid.webm";
+ case 'ig':
+ return "https://i.imgur.com/" + base;
+ case 'ky':
+ return "https://kiyo.me/" + base;
+ case 'mf':
+ return "https://d.maxfile.ro/" + base;
+ case 'pc':
+ return "http://a.pomf.cat/" + base;
+ case 'fc':
+ return "//i.4cdn.org/" + base + ".webm";
+ case 'gc':
+ return "https://" + type + ".gfycat.com/" + name + ".webm";
+ }
+ })();
+ $.add(el, $.el('source', {
+ src: url
+ }));
+ }
+ }
+ return el;
+ }
+ }, {
+ key: 'Clyp',
+ regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w+)/,
+ style: '',
+ el: function(a) {
+ var el, type;
+ el = $.el('audio', {
+ controls: true,
+ preload: 'auto'
+ });
+ type = el.canPlayType('audio/ogg') ? 'ogg' : 'mp3';
+ el.src = "https://clyp.it/" + a.dataset.uid + "." + type;
+ return el;
+ }
+ }, {
+ key: 'Loopvid-dummy',
+ regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\//,
+ dummy: true
+ }, {
+ key: 'MediaFire-dummy',
+ regExp: /^\w+:\/\/(?:www\.)?mediafire.com\//,
+ dummy: true
+ }, {
+ key: 'video',
+ regExp: /\.(?:ogv|webm|mp4)(?:\?|$)/i,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el: function(a) {
+ return $.el('video', {
+ controls: true,
+ preload: 'auto',
+ src: a.dataset.href,
+ loop: /^https?:\/\/i\.4cdn\.org\//.test(a.dataset.href)
+ });
+ }
+ }
+ ]
+ };
+
+ return Embedding;
+
+}).call(this);
+
+Linkify = (function() {
+ var Linkify;
+
+ Linkify = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Linkify']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ Callbacks.Post.push({
+ name: 'Linkify',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Linkify',
+ cb: this.catalogNode
+ });
+ return Embedding.init();
+ },
+ node: function() {
+ var j, k, len, len1, link, links, ref;
+ if (this.isClone) {
+ return Embedding.events(this);
+ }
+ if (!Linkify.regString.test(this.info.comment)) {
+ return;
+ }
+ ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"]', this.nodes.comment);
+ for (j = 0, len = ref.length; j < len; j++) {
+ link = ref[j];
+ $.addClass(link, 'linkify');
+ Embedding.process(link, this);
+ }
+ links = Linkify.process(this.nodes.comment);
+ for (k = 0, len1 = links.length; k < len1; k++) {
+ link = links[k];
+ Embedding.process(link, this);
+ }
+ },
+ catalogNode: function() {
+ if (!Linkify.regString.test(this.thread.OP.info.comment)) {
+ return;
+ }
+ return Linkify.process(this.nodes.comment);
+ },
+ process: function(node) {
+ var data, end, endNode, i, index, length, links, part1, part2, ref, ref1, result, saved, snapshot, space, test, word;
+ test = /[^\s"]+/g;
+ space = /[\s"]/;
+ snapshot = $.X('.//br|.//text()', node);
+ i = 0;
+ links = [];
+ while (node = snapshot.snapshotItem(i++)) {
+ data = node.data;
+ if (!data || node.parentElement.nodeName === "A") {
+ continue;
+ }
+ while (result = test.exec(data)) {
+ index = result.index;
+ endNode = node;
+ word = result[0];
+ if ((length = index + word.length) === data.length) {
+ test.lastIndex = 0;
+ while ((saved = snapshot.snapshotItem(i++))) {
+ if (saved.nodeName === 'BR') {
+ if ((part1 = word.match(/(https?:\/\/)?([a-z\d-]+\.)*[a-z\d-]+$/i)) && (part2 = (ref = snapshot.snapshotItem(i)) != null ? (ref1 = ref.data) != null ? ref1.match(/^(\.[a-z\d-]+)*\//i) : void 0 : void 0) && (part1[0] + part2[0]).search(Linkify.regString) === 0) {
+ continue;
+ } else {
+ break;
+ }
+ }
+ endNode = saved;
+ data = saved.data;
+ if (end = space.exec(data)) {
+ word += data.slice(0, end.index);
+ test.lastIndex = length = end.index;
+ i--;
+ break;
+ } else {
+ length = data.length;
+ word += data;
+ }
+ }
+ }
+ if (Linkify.regString.test(word)) {
+ links.push(Linkify.makeRange(node, endNode, index, length));
+ }
+ if (!(test.lastIndex && node === endNode)) {
+ break;
+ }
+ }
+ }
+ i = links.length;
+ while (i--) {
+ links[i] = Linkify.makeLink(links[i]);
+ }
+ return links;
+ },
+ regString: /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/?])|([-a-z\d]+[.])+(aero|asia|biz|cat|com|coop|dance|info|int|jobs|mobi|moe|museum|name|net|org|post|pro|tel|travel|xxx|xyz|edu|gov|mil|[a-z]{2})([:\/]|(?![^\s"]))|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i,
+ makeRange: function(startNode, endNode, startOffset, endOffset) {
+ var range;
+ range = document.createRange();
+ range.setStart(startNode, startOffset);
+ range.setEnd(endNode, endOffset);
+ return range;
+ },
+ makeLink: function(range) {
+ var a, encodedDomain, i, t, text;
+ text = range.toString();
+ i = text.search(Linkify.regString);
+ if (i > 0) {
+ text = text.slice(i);
+ while (range.startOffset + i >= range.startContainer.data.length) {
+ i--;
+ }
+ if (i) {
+ range.setStart(range.startContainer, range.startOffset + i);
+ }
+ }
+ i = 0;
+ while (/[)\]}>.,]/.test(t = text.charAt(text.length - (1 + i)))) {
+ if (!(/[.,]/.test(t) || (text.match(/[()\[\]{}<>]/g)).length % 2)) {
+ break;
+ }
+ i++;
+ }
+ if (i) {
+ text = text.slice(0, -i);
+ while (range.endOffset - i < 0) {
+ i--;
+ }
+ if (i) {
+ range.setEnd(range.endContainer, range.endOffset - i);
+ }
+ }
+ if (!/((mailto|magnet):|.+:\/\/)/.test(text)) {
+ text = (/@/.test(text) ? 'mailto:' : 'http://') + text;
+ }
+ if (encodedDomain = text.match(/^(https?:\/\/[^\/]*%[0-9a-f]{2})(.*)$/i)) {
+ text = encodedDomain[1].replace(/%([0-9a-f]{2})/ig, function(x, y) {
+ if (y === '25') {
+ return x;
+ } else {
+ return String.fromCharCode(parseInt(y, 16));
+ }
+ }) + encodedDomain[2];
+ }
+ a = $.el('a', {
+ className: 'linkify',
+ rel: 'nofollow noreferrer',
+ target: '_blank',
+ href: text
+ });
+ $.add(a, range.extractContents());
+ range.insertNode(a);
+ return a;
+ }
+ };
+
+ return Linkify;
+
+}).call(this);
+
+ArchiveLink = (function() {
+ var ArchiveLink;
+
+ ArchiveLink = {
+ init: function() {
+ var div, entry, i, len, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
+ return;
+ }
+ div = $.el('div', {
+ textContent: 'Archive'
+ });
+ entry = {
+ el: div,
+ order: 90,
+ open: function(arg) {
+ var ID, board, thread;
+ ID = arg.ID, thread = arg.thread, board = arg.board;
+ return !!Redirect.to('thread', {
+ postID: ID,
+ threadID: thread.ID,
+ boardID: board.ID
+ });
+ },
+ subEntries: []
+ };
+ ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ type = ref1[i];
+ entry.subEntries.push(this.createSubEntry(type[0], type[1]));
+ }
+ return Menu.menu.addEntry(entry);
+ },
+ 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,
+ threadID: thread.ID,
+ boardID: board.ID
+ });
+ return true;
+ } : function(post) {
+ var value;
+ value = Filter[type](post);
+ if (!value) {
+ return false;
+ }
+ el.href = Redirect.to('search', {
+ boardID: post.board.ID,
+ type: type,
+ value: value,
+ isSearch: true
+ });
+ return true;
+ };
+ return {
+ el: el,
+ open: open
+ };
+ }
+ };
+
+ return ArchiveLink;
+
+}).call(this);
+
+DeleteLink = (function() {
+ var DeleteLink;
+
+ DeleteLink = {
+ auto: [{}, {}],
+ init: function() {
+ var div, fileEl, fileEntry, postEl, postEntry, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
+ return;
+ }
+ div = $.el('div', {
+ className: 'delete-link',
+ textContent: 'Delete'
+ });
+ postEl = $.el('a', {
+ className: 'delete-post',
+ href: 'javascript:;'
+ });
+ fileEl = $.el('a', {
+ className: 'delete-file',
+ href: 'javascript:;'
+ });
+ this.nodes = {
+ menu: div.firstChild,
+ links: [postEl, fileEl]
+ };
+ postEntry = {
+ el: postEl,
+ open: function() {
+ postEl.textContent = DeleteLink.linkText(false);
+ $.on(postEl, 'click', DeleteLink.toggle);
+ return true;
+ }
+ };
+ fileEntry = {
+ el: fileEl,
+ open: function(arg) {
+ var file;
+ file = arg.file;
+ if (!file || file.isDead) {
+ return false;
+ }
+ fileEl.textContent = DeleteLink.linkText(true);
+ $.on(fileEl, 'click', DeleteLink.toggle);
+ return true;
+ }
+ };
+ return Menu.menu.addEntry({
+ el: div,
+ order: 40,
+ open: function(post) {
+ if (post.isDead) {
+ return false;
+ }
+ DeleteLink.post = post;
+ DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
+ DeleteLink.cooldown.start(post);
+ return true;
+ },
+ subEntries: [postEntry, fileEntry]
+ });
+ },
+ menuText: function() {
+ var seconds;
+ if (seconds = DeleteLink.cooldown.seconds[DeleteLink.post.fullID]) {
+ return "Delete (" + seconds + ")";
+ } else {
+ return 'Delete';
+ }
+ },
+ linkText: function(fileOnly) {
+ var text;
+ text = fileOnly ? 'File' : 'Post';
+ if (DeleteLink.auto[+fileOnly][DeleteLink.post.fullID]) {
+ text = "Deleting " + (text.toLowerCase()) + "...";
+ }
+ return text;
+ },
+ toggle: function() {
+ var auto, fileOnly, post;
+ post = DeleteLink.post;
+ fileOnly = $.hasClass(this, 'delete-file');
+ auto = DeleteLink.auto[+fileOnly];
+ if (auto[post.fullID]) {
+ delete auto[post.fullID];
+ } else {
+ auto[post.fullID] = true;
+ }
+ this.textContent = DeleteLink.linkText(fileOnly);
+ if (!DeleteLink.cooldown.seconds[post.fullID]) {
+ return DeleteLink["delete"](post, fileOnly);
+ }
+ },
+ "delete": function(post, fileOnly) {
+ var form, link;
+ link = DeleteLink.nodes.links[+fileOnly];
+ delete DeleteLink.auto[+fileOnly][post.fullID];
+ if (post.fullID === DeleteLink.post.fullID) {
+ $.off(link, 'click', DeleteLink.toggle);
+ }
+ form = {
+ mode: 'usrdel',
+ onlyimgdel: fileOnly,
+ pwd: QR.persona.getPassword()
+ };
+ form[post.ID] = 'delete';
+ return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), {
+ responseType: 'document',
+ withCredentials: true,
+ onload: function() {
+ return DeleteLink.load(link, post, fileOnly, this.response);
+ },
+ onerror: function() {
+ return DeleteLink.error(link, post);
+ }
+ }, {
+ form: $.formData(form)
+ });
+ },
+ load: function(link, post, fileOnly, resDoc) {
+ var el, msg;
+ link.textContent = DeleteLink.linkText(fileOnly);
+ if (resDoc.title === '4chan - Banned') {
+ el = $.el('span', {
+ innerHTML: "You can't delete posts because you are
banned ."
+ });
+ return new Notice('warning', el, 20);
+ } else if (msg = resDoc.getElementById('errmsg')) {
+ new Notice('warning', msg.textContent, 20);
+ if (post.fullID === DeleteLink.post.fullID) {
+ $.on(link, 'click', DeleteLink.toggle);
+ }
+ if (QR.cooldown.data && Conf['Cooldown'] && /\bwait\b/i.test(msg.textContent)) {
+ DeleteLink.cooldown.start(post, 5);
+ DeleteLink.auto[+fileOnly][post.fullID] = true;
+ return DeleteLink.nodes.links[+fileOnly].textContent = DeleteLink.linkText(fileOnly);
+ }
+ } else {
+ if (!fileOnly) {
+ QR.cooldown["delete"](post);
+ }
+ if (resDoc.title === 'Updating index...') {
+ (post.origin || post).kill(fileOnly);
+ }
+ if (post.fullID === DeleteLink.post.fullID) {
+ return link.textContent = 'Deleted';
+ }
+ }
+ },
+ error: function(link, post) {
+ new Notice('warning', 'Connection error, please retry.', 20);
+ if (post.fullID === DeleteLink.post.fullID) {
+ return $.on(link, 'click', DeleteLink.toggle);
+ }
+ },
+ cooldown: {
+ seconds: {},
+ start: function(post, seconds) {
+ if (DeleteLink.cooldown.seconds[post.fullID] != null) {
+ return;
+ }
+ if (seconds == null) {
+ seconds = QR.cooldown.secondsDeletion(post);
+ }
+ if (seconds > 0) {
+ DeleteLink.cooldown.seconds[post.fullID] = seconds;
+ return DeleteLink.cooldown.count(post);
+ }
+ },
+ count: function(post) {
+ var fileOnly, i, len, ref;
+ if (post.fullID === DeleteLink.post.fullID) {
+ DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
+ }
+ if (DeleteLink.cooldown.seconds[post.fullID] > 0 && Conf['Cooldown']) {
+ DeleteLink.cooldown.seconds[post.fullID]--;
+ setTimeout(DeleteLink.cooldown.count, 1000, post);
+ } else {
+ delete DeleteLink.cooldown.seconds[post.fullID];
+ ref = [false, true];
+ for (i = 0, len = ref.length; i < len; i++) {
+ fileOnly = ref[i];
+ if (DeleteLink.auto[+fileOnly][post.fullID]) {
+ DeleteLink["delete"](post, fileOnly);
+ }
+ }
+ }
+ }
+ }
+ };
+
+ return DeleteLink;
+
+}).call(this);
+
+DownloadLink = (function() {
+ var DownloadLink;
+
+ DownloadLink = {
+ init: function() {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
+ return;
+ }
+ a = $.el('a', {
+ className: 'download-link',
+ textContent: 'Download file'
+ });
+ $.on(a, 'click', ImageCommon.download);
+ return Menu.menu.addEntry({
+ el: a,
+ order: 100,
+ open: function(arg) {
+ var file;
+ file = arg.file;
+ if (!file) {
+ return false;
+ }
+ a.href = file.url;
+ a.download = file.name;
+ return true;
+ }
+ });
+ }
+ };
+
+ return DownloadLink;
+
+}).call(this);
+
+Menu = (function() {
+ var Menu;
+
+ Menu = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) {
+ return;
+ }
+ this.button = $.el('a', {
+ className: 'menu-button',
+ href: 'javascript:;'
+ });
+ $.extend(this.button, {
+ innerHTML: "
"
+ });
+ this.menu = new UI.Menu('post');
+ Callbacks.Post.push({
+ name: 'Menu',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Menu',
+ cb: this.catalogNode
+ });
+ },
+ node: function() {
+ if (this.isClone) {
+ Menu.makeButton(this, $('.menu-button', this.nodes.info));
+ return;
+ }
+ return $.add(this.nodes.info, Menu.makeButton(this));
+ },
+ catalogNode: function() {
+ return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP));
+ },
+ makeButton: function(post, button) {
+ button || (button = Menu.button.cloneNode(true));
+ $.on(button, 'click', function(e) {
+ return Menu.menu.toggle(e, this, post);
+ });
+ return button;
+ }
+ };
+
+ return Menu;
+
+}).call(this);
+
+ReportLink = (function() {
+ var ReportLink;
+
+ ReportLink = {
+ init: function() {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
+ return;
+ }
+ a = $.el('a', {
+ className: 'report-link',
+ href: 'javascript:;'
+ });
+ $.on(a, 'click', ReportLink.report);
+ return Menu.menu.addEntry({
+ el: a,
+ order: 10,
+ open: function(post) {
+ if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) {
+ a.textContent = 'Report';
+ ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
+ if ((Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled) || d.cookie.indexOf('pass_enabled=1') >= 0) {
+ ReportLink.url += '&altc=1';
+ ReportLink.dims = 'width=350,height=275';
+ } else {
+ ReportLink.dims = 'width=400,height=550';
+ }
+ } else if (Conf['Archive Report']) {
+ a.textContent = 'Report to archive';
+ ReportLink.url = Redirect.to('report', {
+ boardID: post.board.ID,
+ postID: post.ID
+ });
+ ReportLink.dims = 'width=700,height=475';
+ } else {
+ ReportLink.url = '';
+ }
+ return !!ReportLink.url;
+ }
+ });
+ },
+ report: function() {
+ var dims, id, set, url;
+ url = ReportLink.url, dims = ReportLink.dims;
+ id = Date.now();
+ set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1," + dims;
+ return window.open(url, id, set);
+ }
+ };
+
+ return ReportLink;
+
+}).call(this);
+
+AntiAutoplay = (function() {
+ var AntiAutoplay;
+
+ AntiAutoplay = {
+ init: function() {
+ var audio, i, len, ref;
+ if (!Conf['Disable Autoplaying Sounds']) {
+ return;
+ }
+ $.addClass(doc, 'anti-autoplay');
+ ref = $$('audio[autoplay]', doc);
+ for (i = 0, len = ref.length; i < len; i++) {
+ audio = ref[i];
+ this.stop(audio);
+ }
+ window.addEventListener('loadstart', ((function(_this) {
+ return function(e) {
+ return _this.stop(e.target);
+ };
+ })(this)), true);
+ Callbacks.Post.push({
+ name: 'Disable Autoplaying Sounds',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Disable Autoplaying Sounds',
+ cb: this.node
+ });
+ return $.ready((function(_this) {
+ return function() {
+ return _this.process(d.body);
+ };
+ })(this));
+ },
+ stop: function(audio) {
+ if (!audio.autoplay) {
+ return;
+ }
+ audio.pause();
+ audio.autoplay = false;
+ if (audio.controls) {
+ return;
+ }
+ audio.controls = true;
+ return $.addClass(audio, 'controls-added');
+ },
+ node: function() {
+ return AntiAutoplay.process(this.nodes.root);
+ },
+ process: function(root) {
+ var i, iframe, j, len, len1, object, ref, ref1;
+ ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
+ for (i = 0, len = ref.length; i < len; i++) {
+ iframe = ref[i];
+ iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
+ $.addClass(iframe, 'autoplay-removed');
+ }
+ ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ object = ref1[j];
+ object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
+ $.addClass(object, 'autoplay-removed');
+ }
+ }
+ };
+
+ return AntiAutoplay;
+
+}).call(this);
+
+Banner = (function() {
+ var Banner,
+ slice = [].slice;
+
+ Banner = {
+ banners: ["0.jpg","1.jpg","2.jpg","4.jpg","6.jpg","7.jpg","8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg","14.jpg","16.jpg","17.jpg","18.jpg","19.jpg","20.jpg","21.jpg","22.jpg","24.jpg","25.jpg","26.jpg","28.jpg","29.jpg","33.jpg","38.jpg","39.jpg","43.jpg","44.jpg","45.jpg","46.jpg","47.jpg","52.jpg","54.jpg","57.jpg","59.jpg","60.jpg","61.jpg","64.jpg","66.jpg","67.jpg","69.jpg","71.jpg","72.jpg","76.jpg","77.jpg","81.jpg","82.jpg","83.jpg","84.jpg","88.jpg","90.jpg","91.jpg","96.jpg","98.jpg","99.jpg","100.jpg","104.jpg","106.jpg","116.jpg","119.jpg","137.jpg","140.jpg","148.jpg","149.jpg","150.jpg","154.jpg","156.jpg","157.jpg","158.jpg","159.jpg","161.jpg","162.jpg","164.jpg","165.jpg","166.jpg","167.jpg","168.jpg","169.jpg","170.jpg","171.jpg","172.jpg","173.jpg","174.jpg","175.jpg","176.jpg","178.jpg","179.jpg","180.jpg","181.jpg","182.jpg","183.jpg","186.jpg","189.jpg","190.jpg","192.jpg","193.jpg","194.jpg","197.jpg","198.jpg","200.jpg","201.jpg","202.jpg","203.jpg","205.jpg","206.jpg","207.jpg","208.jpg","210.jpg","213.jpg","214.jpg","215.jpg","216.jpg","218.jpg","219.jpg","220.jpg","221.jpg","222.jpg","223.jpg","224.jpg","227.jpg","0.png","1.png","2.png","3.png","5.png","6.png","9.png","10.png","11.png","12.png","14.png","16.png","19.png","20.png","21.png","22.png","23.png","24.png","26.png","27.png","28.png","29.png","30.png","31.png","32.png","33.png","34.png","37.png","39.png","40.png","41.png","42.png","43.png","44.png","45.png","48.png","49.png","50.png","51.png","52.png","53.png","57.png","58.png","59.png","64.png","66.png","67.png","68.png","69.png","70.png","71.png","72.png","76.png","78.png","79.png","81.png","82.png","85.png","86.png","87.png","89.png","95.png","98.png","100.png","101.png","102.png","105.png","106.png","107.png","109.png","110.png","111.png","112.png","113.png","114.png","115.png","116.png","118.png","119.png","120.png","121.png","122.png","123.png","126.png","128.png","130.png","134.png","136.png","138.png","139.png","140.png","142.png","145.png","146.png","149.png","150.png","151.png","152.png","153.png","154.png","155.png","156.png","157.png","158.png","159.png","160.png","163.png","164.png","165.png","166.png","167.png","168.png","169.png","170.png","171.png","172.png","173.png","174.png","178.png","179.png","180.png","181.png","182.png","184.png","186.png","188.png","190.png","192.png","193.png","194.png","195.png","196.png","197.png","198.png","200.png","202.png","203.png","205.png","206.png","207.png","209.png","212.png","213.png","214.png","216.png","217.png","218.png","219.png","220.png","221.png","222.png","223.png","224.png","225.png","226.png","229.png","231.png","232.png","233.png","234.png","235.png","237.png","238.png","239.png","240.png","241.png","242.png","244.png","245.png","246.png","247.png","248.png","249.png","250.png","253.png","254.png","255.png","256.png","257.png","258.png","259.png","260.png","262.png","268.png","0.gif","1.gif","2.gif","3.gif","4.gif","5.gif","6.gif","7.gif","8.gif","9.gif","10.gif","12.gif","13.gif","14.gif","15.gif","16.gif","18.gif","19.gif","20.gif","21.gif","22.gif","23.gif","24.gif","28.gif","29.gif","30.gif","33.gif","34.gif","35.gif","36.gif","37.gif","39.gif","40.gif","42.gif","44.gif","45.gif","46.gif","48.gif","50.gif","52.gif","54.gif","55.gif","57.gif","58.gif","59.gif","60.gif","61.gif","63.gif","64.gif","66.gif","67.gif","68.gif","69.gif","70.gif","72.gif","73.gif","75.gif","76.gif","77.gif","78.gif","80.gif","81.gif","82.gif","83.gif","86.gif","87.gif","88.gif","92.gif","93.gif","94.gif","95.gif","96.gif","97.gif","98.gif","99.gif","100.gif","101.gif","102.gif","103.gif","104.gif","105.gif","106.gif","108.gif","109.gif","110.gif","111.gif","112.gif","113.gif","115.gif","116.gif","117.gif","118.gif","119.gif","120.gif","122.gif","123.gif","124.gif","127.gif","129.gif","130.gif","131.gif","134.gif","135.gif","136.gif","138.gif","139.gif","141.gif","144.gif","146.gif","148.gif","149.gif","153.gif","154.gif","155.gif","157.gif","158.gif","159.gif","160.gif","161.gif","162.gif","164.gif","166.gif","167.gif","168.gif","169.gif","170.gif","171.gif","172.gif","173.gif","174.gif","175.gif","176.gif","177.gif","178.gif","181.gif","182.gif","183.gif","185.gif","186.gif","187.gif","188.gif","189.gif","190.gif","191.gif","192.gif","193.gif","195.gif","196.gif","197.gif","200.gif","201.gif","202.gif","203.gif","204.gif","205.gif","206.gif","207.gif","208.gif","209.gif","210.gif","211.gif","212.gif","213.gif","214.gif","215.gif","216.gif","217.gif","219.gif","220.gif","221.gif","222.gif","224.gif","225.gif","226.gif","227.gif","228.gif","230.gif","232.gif","233.gif","234.gif","235.gif","238.gif","240.gif","241.gif","243.gif","244.gif","245.gif","246.gif","247.gif","249.gif","250.gif","251.gif","253.gif"],
+ init: function() {
+ if (Conf['Custom Board Titles']) {
+ this.db = new DataBoard('customTitles', null, true);
+ }
+ $.asap((function() {
+ return d.body;
+ }), function() {
+ return $.asap((function() {
+ return $('hr');
+ }), Banner.ready);
+ });
+ if (g.BOARD.ID !== 'f') {
+ return Main.ready(function() {
+ return $.queueTask(Banner.load);
+ });
+ }
+ },
+ ready: function() {
+ var banner, children;
+ banner = $(".boardBanner");
+ children = banner.children;
+ if (g.BOARD.ID !== 'f' && g.VIEW === 'thread' && Conf['Remove Thread Excerpt']) {
+ Banner.setTitle(children[1].textContent);
+ }
+ children[0].title = "Click to change";
+ $.on(children[0], 'click', Banner.cb.toggle);
+ if (Conf['Custom Board Titles']) {
+ Banner.custom(children[1]);
+ if (children[2]) {
+ return Banner.custom(children[2]);
+ }
+ }
+ },
+ load: function() {
+ var bannerCnt, img;
+ bannerCnt = $.id('bannerCnt');
+ if (!bannerCnt.firstChild) {
+ img = $.el('img', {
+ alt: '4chan',
+ src: '//s.4cdn.org/image/title/' + bannerCnt.dataset.src
+ });
+ return $.add(bannerCnt, img);
+ }
+ },
+ setTitle: function(title) {
+ if (Unread.title != null) {
+ Unread.title = title;
+ return Unread.update();
+ } else {
+ return d.title = title;
+ }
+ },
+ cb: {
+ toggle: function() {
+ var banner, i, ref;
+ if (!((ref = Banner.choices) != null ? ref.length : void 0)) {
+ Banner.choices = Banner.banners.slice();
+ }
+ i = Math.floor(Banner.choices.length * Math.random());
+ banner = Banner.choices.splice(i, 1);
+ return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner;
+ },
+ click: function(e) {
+ var base, br, j, len, name, ref;
+ if (!(e.ctrlKey || e.metaKey)) {
+ return;
+ }
+ if ((base = Banner.original)[name = this.className] == null) {
+ base[name] = this.cloneNode(true);
+ }
+ this.contentEditable = true;
+ ref = $$('br', this);
+ for (j = 0, len = ref.length; j < len; j++) {
+ br = ref[j];
+ $.replace(br, $.tn('\n'));
+ }
+ return this.focus();
+ },
+ keydown: function(e) {
+ e.stopPropagation();
+ if (!e.shiftKey && e.keyCode === 13) {
+ return this.blur();
+ }
+ },
+ blur: function() {
+ var br, j, len, ref;
+ ref = $$('br', this);
+ for (j = 0, len = ref.length; j < len; j++) {
+ br = ref[j];
+ $.replace(br, $.tn('\n'));
+ }
+ if (this.textContent = this.textContent.replace(/\n*$/, '')) {
+ this.contentEditable = false;
+ return Banner.db.set({
+ boardID: g.BOARD.ID,
+ threadID: this.className,
+ val: {
+ title: this.textContent,
+ orig: Banner.original[this.className].textContent
+ }
+ });
+ } else {
+ $.rmAll(this);
+ $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes));
+ return Banner.db["delete"]({
+ boardID: g.BOARD.ID,
+ threadID: this.className
+ });
+ }
+ }
+ },
+ original: {},
+ custom: function(child) {
+ var className, data, event, items, j, len, ref, string, string2;
+ className = child.className;
+ child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase());
+ child.spellcheck = false;
+ ref = ['click', 'keydown', 'blur'];
+ for (j = 0, len = ref.length; j < len; j++) {
+ event = ref[j];
+ $.on(child, event, Banner.cb[event]);
+ }
+ string = g.BOARD + "." + className;
+ string2 = string + ".orig";
+ items = {};
+ items[string] = '';
+ items[string2] = child.textContent;
+ $.get(items, function(items) {
+ if (items[string]) {
+ Banner.db.set({
+ boardID: g.BOARD.ID,
+ threadID: className,
+ val: {
+ title: items[string],
+ orig: items[string2]
+ }
+ });
+ }
+ return $["delete"]([string, string2]);
+ });
+ if (data = Banner.db.get({
+ boardID: g.BOARD.ID,
+ threadID: className
+ })) {
+ if (Conf['Persistent Custom Board Titles'] || data.orig === child.textContent) {
+ Banner.original[className] = child.cloneNode(true);
+ return child.textContent = data.title;
+ } else {
+ return Banner.db["delete"]({
+ boardID: g.BOARD.ID,
+ threadID: className
+ });
+ }
+ }
+ }
+ };
+
+ return Banner;
+
+}).call(this);
+
+CatalogLinks = (function() {
+ var CatalogLinks;
+
+ CatalogLinks = {
+ init: function() {
+ var el, input, selector;
+ if ((Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) {
+ selector = (function() {
+ switch (g.VIEW) {
+ case 'thread':
+ case 'archive':
+ return '.navLinks.desktop > a';
+ case 'catalog':
+ return '.navLinks > :first-child > a';
+ case 'index':
+ return '#ctrl-top > a, .cataloglink > a';
+ }
+ })();
+ $.ready(function() {
+ var catalogLink, i, len, link, ref;
+ ref = $$(selector);
+ for (i = 0, len = ref.length; i < len; i++) {
+ link = ref[i];
+ switch (link.pathname.replace(/\/+/g, '/')) {
+ case "/" + g.BOARD + "/":
+ if (Conf['JSON Index']) {
+ link.textContent = 'Index';
+ }
+ link.href = CatalogLinks.index();
+ break;
+ case "/" + g.BOARD + "/catalog":
+ link.href = CatalogLinks.catalog();
+ }
+ if (g.VIEW === 'catalog' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
+ catalogLink = link.parentNode.cloneNode(true);
+ catalogLink.firstElementChild.textContent = '4chan X Catalog';
+ catalogLink.firstElementChild.href = CatalogLinks.catalog();
+ $.after(link.parentNode, [$.tn(' '), catalogLink]);
+ }
+ }
+ });
+ }
+ if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
+ Callbacks.Post.push({
+ name: 'Catalog Link Rewrite',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Catalog Link Rewrite',
+ cb: this.node
+ });
+ }
+ if (Conf['Catalog Links']) {
+ CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links');
+ el.id = 'toggleCatalog';
+ input = $('input', el);
+ $.on(input, 'change', this.toggle);
+ $.sync('Header catalog links', CatalogLinks.set);
+ return Header.menu.addEntry({
+ el: el,
+ order: 95
+ });
+ }
+ },
+ node: function() {
+ var a, i, len, m, ref;
+ ref = $$('a', this.nodes.comment);
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
+ a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
+ }
+ }
+ },
+ initBoardList: function() {
+ if (!CatalogLinks.el) {
+ return;
+ }
+ return CatalogLinks.set(Conf['Header catalog links']);
+ },
+ toggle: function() {
+ $.event('CloseMenu');
+ $.set('Header catalog links', this.checked);
+ return CatalogLinks.set(this.checked);
+ },
+ set: function(useCatalog) {
+ var a, board, i, len, ref, ref1;
+ ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ if (((ref1 = a.hostname) !== 'boards.4chan.org' && ref1 !== 'catalog.neet.tv') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
+ continue;
+ }
+ a.href = useCatalog ? CatalogLinks.catalog(board) : "/" + board + "/";
+ if (a.dataset.indexOptions && a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
+ a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions;
+ }
+ }
+ CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
+ return $('input', CatalogLinks.el).checked = useCatalog;
+ },
+ catalog: function(board) {
+ if (board == null) {
+ board = g.BOARD.ID;
+ }
+ if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) {
+ return "http://catalog.neet.tv/" + board + "/";
+ } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
+ if (g.BOARD.ID === board && g.VIEW === 'index') {
+ return '#catalog';
+ } else {
+ return "/" + board + "/#catalog";
+ }
+ } else {
+ return "/" + board + "/catalog";
+ }
+ },
+ index: function(board) {
+ if (board == null) {
+ board = g.BOARD.ID;
+ }
+ if (Conf['JSON Index'] && board !== 'f') {
+ if (g.BOARD.ID === board && g.VIEW === 'index') {
+ return '#index';
+ } else {
+ return "/" + board + "/#index";
+ }
+ } else {
+ return "/" + board + "/";
+ }
+ }
+ };
+
+ return CatalogLinks;
+
+}).call(this);
+
+CustomCSS = (function() {
+ var CustomCSS;
+
+ CustomCSS = {
+ init: function() {
+ if (!Conf['Custom CSS']) {
+ return;
+ }
+ return this.addStyle();
+ },
+ addStyle: function() {
+ return this.style = $.addStyle(Conf['usercss'], 'custom-css', '#fourchanx-css');
+ },
+ rmStyle: function() {
+ if (this.style) {
+ $.rm(this.style);
+ return delete this.style;
+ }
+ },
+ update: function() {
+ if (!this.style) {
+ return this.addStyle();
+ }
+ return this.style.textContent = Conf['usercss'];
+ }
+ };
+
+ return CustomCSS;
+
+}).call(this);
+
+ExpandComment = (function() {
+ var ExpandComment;
+
+ ExpandComment = {
+ init: function() {
+ if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) {
+ return;
+ }
+ if (g.BOARD.ID === 'g') {
+ this.callbacks.push(Fourchan.code);
+ }
+ if (g.BOARD.ID === 'sci') {
+ this.callbacks.push(Fourchan.math);
+ }
+ return Callbacks.Post.push({
+ name: 'Comment Expansion',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var a;
+ if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
+ return $.on(a, 'click', ExpandComment.cb);
+ }
+ },
+ callbacks: [],
+ cb: function(e) {
+ e.preventDefault();
+ return ExpandComment.expand(Get.postFromNode(this));
+ },
+ 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;
+ return;
+ }
+ if (!(a = $('.abbr > a', post.nodes.comment))) {
+ return;
+ }
+ a.textContent = "Post No." + post + " Loading...";
+ return $.cache("//a.4cdn.org" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + ".json", function() {
+ return ExpandComment.parse(this, a, post);
+ });
+ },
+ contract: function(post) {
+ var a;
+ if (!post.nodes.shortComment) {
+ return;
+ }
+ a = $('.abbr > a', post.nodes.shortComment);
+ a.textContent = 'here';
+ $.replace(post.nodes.longComment, post.nodes.shortComment);
+ return post.nodes.comment = post.nodes.shortComment;
+ },
+ parse: function(req, a, post) {
+ var callback, clone, comment, href, i, j, k, len, len1, len2, postObj, posts, quote, ref, ref1, spoilerRange, status;
+ status = req.status;
+ if (status !== 200 && status !== 304) {
+ a.textContent = "Error " + req.statusText + " (" + status + ")";
+ return;
+ }
+ posts = req.response.posts;
+ if (spoilerRange = posts[0].custom_spoiler) {
+ Build.spoilerRange[g.BOARD] = spoilerRange;
+ }
+ for (i = 0, len = posts.length; i < len; i++) {
+ postObj = posts[i];
+ if (postObj.no === post.ID) {
+ break;
+ }
+ }
+ if (postObj.no !== post.ID) {
+ a.textContent = "Post No." + post + " not found.";
+ return;
+ }
+ comment = post.nodes.comment;
+ clone = comment.cloneNode(false);
+ clone.innerHTML = postObj.com;
+ ref = $$('.quotelink', clone);
+ for (j = 0, len1 = ref.length; j < len1; j++) {
+ quote = ref[j];
+ href = quote.getAttribute('href');
+ if (href[0] === '/') {
+ continue;
+ }
+ if (href[0] === '#') {
+ quote.href = "" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + href;
+ } else {
+ quote.href = (a.pathname.split(/\/+/).splice(0, 3).join('/')) + "/" + href;
+ }
+ }
+ post.nodes.shortComment = comment;
+ $.replace(comment, clone);
+ post.nodes.comment = post.nodes.longComment = clone;
+ post.parseComment();
+ post.parseQuotes();
+ ref1 = ExpandComment.callbacks;
+ for (k = 0, len2 = ref1.length; k < len2; k++) {
+ callback = ref1[k];
+ callback.call(post);
+ }
+ }
+ };
+
+ return ExpandComment;
+
+}).call(this);
+
+ExpandThread = (function() {
+ var ExpandThread,
+ slice = [].slice;
+
+ ExpandThread = {
+ statuses: {},
+ init: function() {
+ if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
+ return;
+ }
+ if (Conf['JSON Index']) {
+ return $.on(d, 'IndexRefresh', this.onIndexRefresh);
+ } else {
+ return Callbacks.Thread.push({
+ name: 'Expand Thread',
+ cb: function() {
+ return ExpandThread.setButton(this);
+ }
+ });
+ }
+ },
+ setButton: function(thread) {
+ var a;
+ if (!(a = $.x('following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
+ return;
+ }
+ a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
+ a.style.cursor = 'pointer';
+ return $.on(a, 'click', ExpandThread.cbToggle);
+ },
+ disconnect: function(refresh) {
+ var ref, ref1, status, threadID;
+ if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
+ return;
+ }
+ ref = ExpandThread.statuses;
+ for (threadID in ref) {
+ status = ref[threadID];
+ if ((ref1 = status.req) != null) {
+ ref1.abort();
+ }
+ delete ExpandThread.statuses[threadID];
+ }
+ if (!refresh) {
+ return $.off(d, 'IndexRefresh', this.onIndexRefresh);
+ }
+ },
+ onIndexRefresh: function() {
+ ExpandThread.disconnect(true);
+ return g.BOARD.threads.forEach(function(thread) {
+ return ExpandThread.setButton(thread);
+ });
+ },
+ cbToggle: function(e) {
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ e.preventDefault();
+ return ExpandThread.toggle(Get.threadFromNode(this));
+ },
+ toggle: function(thread) {
+ var a, threadRoot;
+ threadRoot = thread.OP.nodes.root.parentNode;
+ if (!(a = $('.summary', threadRoot))) {
+ return;
+ }
+ if (thread.ID in ExpandThread.statuses) {
+ return ExpandThread.contract(thread, a, threadRoot);
+ } else {
+ return ExpandThread.expand(thread, a);
+ }
+ },
+ expand: function(thread, a) {
+ var status;
+ ExpandThread.statuses[thread] = status = {};
+ a.textContent = Build.summaryText.apply(Build, ['...'].concat(slice.call(a.textContent.match(/\d+/g))));
+ return status.req = $.cache("//a.4cdn.org/" + thread.board + "/thread/" + thread + ".json", function() {
+ delete status.req;
+ return ExpandThread.parse(this, thread, a);
+ });
+ },
+ contract: function(thread, a, threadRoot) {
+ var filesCount, i, inlined, len, num, postsCount, replies, reply, status;
+ status = ExpandThread.statuses[thread];
+ delete ExpandThread.statuses[thread];
+ if (status.req) {
+ status.req.abort();
+ if (a) {
+ a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
+ }
+ return;
+ }
+ replies = $$('.thread > .replyContainer', threadRoot);
+ if (!Conf['JSON Index'] || Conf['Show Replies']) {
+ num = (function() {
+ if (thread.isSticky) {
+ return 1;
+ } else {
+ switch (g.BOARD.ID) {
+ case 'b':
+ case 'vg':
+ return 3;
+ case 't':
+ return 1;
+ default:
+ return 5;
+ }
+ }
+ })();
+ replies = replies.slice(0, -num);
+ }
+ postsCount = 0;
+ filesCount = 0;
+ for (i = 0, len = replies.length; i < len; i++) {
+ reply = replies[i];
+ if (Conf['Quote Inlining']) {
+ while (inlined = $('.inlined', reply)) {
+ inlined.click();
+ }
+ }
+ postsCount++;
+ if ('file' in Get.postFromRoot(reply)) {
+ filesCount++;
+ }
+ $.rm(reply);
+ }
+ return a.textContent = Build.summaryText('+', postsCount, filesCount);
+ },
+ parse: function(req, thread, a) {
+ var filesCount, i, len, post, postData, posts, postsCount, postsRoot, ref, ref1, root;
+ if ((ref = req.status) !== 200 && ref !== 304) {
+ a.textContent = "Error " + req.statusText + " (" + req.status + ")";
+ return;
+ }
+ Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler;
+ posts = [];
+ postsRoot = [];
+ filesCount = 0;
+ ref1 = req.response.posts;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ postData = ref1[i];
+ if (postData.no === thread.ID) {
+ continue;
+ }
+ if ((post = thread.posts[postData.no]) && !post.isFetchedQuote) {
+ if ('file' in post) {
+ filesCount++;
+ }
+ postsRoot.push(post.nodes.root);
+ continue;
+ }
+ root = Build.postFromObject(postData, thread.board.ID);
+ post = new Post(root, thread, thread.board);
+ if ('file' in post) {
+ filesCount++;
+ }
+ posts.push(post);
+ postsRoot.push(root);
+ }
+ Main.callbackNodes('Post', posts);
+ $.after(a, postsRoot);
+ $.event('PostsInserted');
+ postsCount = postsRoot.length;
+ return a.textContent = Build.summaryText('-', postsCount, filesCount);
+ }
+ };
+
+ return ExpandThread;
+
+}).call(this);
+
+FileInfo = (function() {
+ var FileInfo;
+
+ FileInfo = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['File Info Formatting']) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'File Info Formatting',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var info, oldInfo;
+ if (!this.file || this.isClone) {
+ return;
+ }
+ oldInfo = $.el('span', {
+ className: 'fileText-original'
+ });
+ $.prepend(this.file.link.parentNode, oldInfo);
+ $.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]);
+ info = $.el('span', {
+ className: 'file-info'
+ });
+ FileInfo.format(Conf['fileInfo'], this, info);
+ return $.prepend(this.file.text, info);
+ },
+ format: function(formatString, post, outputNode) {
+ var output;
+ output = [];
+ formatString.replace(/%(.)|[^%]+/g, function(s, c) {
+ output.push(c in FileInfo.formatters ? FileInfo.formatters[c].call(post) : {
+ innerHTML: E(s)
+ });
+ return '';
+ });
+ return $.extend(outputNode, {
+ innerHTML: E.cat(output)
+ });
+ },
+ formatters: {
+ t: function() {
+ return {
+ innerHTML: E(this.file.url.match(/[^/]*$/)[0])
+ };
+ },
+ T: function() {
+ return {
+ innerHTML: "
" + (FileInfo.formatters.t.call(this)).innerHTML + " "
+ };
+ },
+ l: function() {
+ return {
+ innerHTML: "
" + (FileInfo.formatters.n.call(this)).innerHTML + " "
+ };
+ },
+ L: function() {
+ return {
+ innerHTML: "
" + (FileInfo.formatters.N.call(this)).innerHTML + " "
+ };
+ },
+ n: function() {
+ var fullname, shortname;
+ fullname = this.file.name;
+ shortname = Build.shortFilename(this.file.name, this.isReply);
+ if (fullname === shortname) {
+ return {
+ innerHTML: E(fullname)
+ };
+ } else {
+ return {
+ innerHTML: "
" + E(shortname) + " " + E(fullname) + " "
+ };
+ }
+ },
+ N: function() {
+ return {
+ innerHTML: E(this.file.name)
+ };
+ },
+ p: function() {
+ return {
+ innerHTML: ((this.file.isSpoiler) ? "Spoiler, " : "")
+ };
+ },
+ s: function() {
+ return {
+ innerHTML: E(this.file.size)
+ };
+ },
+ B: function() {
+ return {
+ innerHTML: E(Math.round(this.file.sizeInBytes)) + " Bytes"
+ };
+ },
+ K: function() {
+ return {
+ innerHTML: E(Math.round(this.file.sizeInBytes/1024)) + " KB"
+ };
+ },
+ M: function() {
+ return {
+ innerHTML: E(Math.round(this.file.sizeInBytes/1048576*100)/100) + " MB"
+ };
+ },
+ r: function() {
+ return {
+ innerHTML: E(this.file.dimensions || "PDF")
+ };
+ },
+ g: function() {
+ return {
+ innerHTML: ((this.file.tag) ? ", " + E(this.file.tag) : "")
+ };
+ },
+ '%': function() {
+ return {
+ innerHTML: "%"
+ };
+ }
+ }
+ };
+
+ return FileInfo;
+
+}).call(this);
+
+Flash = (function() {
+ var Flash;
+
+ Flash = {
+ init: function() {
+ if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) {
+ return $.ready(Flash.initReady);
+ }
+ },
+ initReady: function() {
+ if ($.hasStorage) {
+ return $.global(function() {
+ if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) {
+ return window.SWFEmbed.init();
+ }
+ });
+ } else {
+ if (g.VIEW === 'thread') {
+ $.global(function() {
+ return window.Main.tid = location.pathname.split(/\/+/)[3];
+ });
+ }
+ return $.global(function() {
+ return window.SWFEmbed.init();
+ });
+ }
+ }
+ };
+
+ return Flash;
+
+}).call(this);
+
+Fourchan = (function() {
+ var Fourchan;
+
+ Fourchan = {
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ if (g.BOARD.ID === 'g') {
+ $.on(window, 'prettyprint:cb', function(e) {
+ var post, pre;
+ if (!(post = g.posts[e.detail.ID])) {
+ return;
+ }
+ if (!(pre = $$('.prettyprint', post.nodes.comment)[e.detail.i])) {
+ return;
+ }
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ pre.innerHTML = e.detail.html;
+ return $.addClass(pre, 'prettyprinted');
+ }
+ });
+ $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: {\n ID: e.detail.ID,\n i: e.detail.i,\n html: prettyPrintOne(e.detail.html)\n }\n }));\n}, false);');
+ Callbacks.Post.push({
+ name: 'Parse /g/ code',
+ cb: this.code
+ });
+ }
+ if (g.BOARD.ID === 'sci') {
+ $.global(function() {
+ return window.addEventListener('mathjax', function(e) {
+ if (window.MathJax) {
+ return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
+ } else {
+ if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) {
+ window.loadMathJax();
+ window.loadMathJax = function() {};
+ }
+ if (!e.target.classList.contains('postMessage')) {
+ return document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener('load', function() {
+ return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
+ }, false);
+ }
+ }
+ }, false);
+ });
+ Callbacks.Post.push({
+ name: 'Parse /sci/ math',
+ cb: this.math
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Parse /sci/ math',
+ cb: this.math
+ });
+ }
+ return Main.ready(function() {
+ return $.global(function() {
+ var j, len, node, ref1;
+ window.clickable_ids = false;
+ ref1 = document.querySelectorAll('.posteruid, .capcode');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ node = ref1[j];
+ node.removeEventListener('click', window.idClick, false);
+ }
+ });
+ });
+ },
+ code: function() {
+ if (this.isClone) {
+ return;
+ }
+ return $.ready((function(_this) {
+ return function() {
+ var i, j, len, pre, ref;
+ ref = $$('.prettyprint', _this.nodes.comment);
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ pre = ref[i];
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ $.event('prettyprint', {
+ ID: _this.fullID,
+ i: i,
+ html: pre.innerHTML
+ }, window);
+ }
+ }
+ };
+ })(this));
+ },
+ math: function() {
+ var cb, j, len, wbr, wbrs;
+ if (!/\[(math|eqn)\]/.test(this.nodes.comment.textContent)) {
+ return;
+ }
+ if ((wbrs = $$('wbr', this.nodes.comment)).length) {
+ for (j = 0, len = wbrs.length; j < len; j++) {
+ wbr = wbrs[j];
+ $.rm(wbr);
+ }
+ this.nodes.comment.normalize();
+ }
+ cb = (function(_this) {
+ return function() {
+ if (!doc.contains(_this.nodes.comment)) {
+ return;
+ }
+ $.off(d, 'PostsInserted', cb);
+ return $.event('mathjax', null, _this.nodes.comment);
+ };
+ })(this);
+ $.on(d, 'PostsInserted', cb);
+ return cb();
+ }
+ };
+
+ return Fourchan;
+
+}).call(this);
+
+IDColor = (function() {
+ var IDColor;
+
+ IDColor = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) {
+ return;
+ }
+ this.ids = {
+ Heaven: [0, 0, 0, '#fff']
+ };
+ return Callbacks.Post.push({
+ name: 'Color User IDs',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var rgb, span, style, uid;
+ if (this.isClone || !((uid = this.info.uniqueID) && (span = $('span.hand', this.nodes.uniqueID)))) {
+ return;
+ }
+ rgb = IDColor.ids[uid] || IDColor.compute(uid);
+ style = span.style;
+ style.color = rgb[3];
+ style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
+ return $.addClass(span, 'painted');
+ },
+ compute: function(uid) {
+ var hash, rgb;
+ hash = IDColor.hash(uid);
+ rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
+ rgb.push((rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff');
+ return this.ids[uid] = rgb;
+ },
+ hash: function(uid) {
+ var i, msg;
+ msg = 0;
+ i = 0;
+ while (i < 8) {
+ msg = (msg << 5) - msg + uid.charCodeAt(i++);
+ }
+ return msg;
+ }
+ };
+
+ return IDColor;
+
+}).call(this);
+
+IDHighlight = (function() {
+ var IDHighlight;
+
+ IDHighlight = {
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Highlight by User ID',
+ cb: this.node
+ });
+ },
+ uniqueID: null,
+ node: function() {
+ if (this.nodes.uniqueID) {
+ $.on(this.nodes.uniqueID, 'click', IDHighlight.click(this));
+ }
+ if (this.nodes.capcode) {
+ $.on(this.nodes.capcode, 'click', IDHighlight.click(this));
+ }
+ if (!this.isClone) {
+ return IDHighlight.set(this);
+ }
+ },
+ set: function(post) {
+ var match;
+ match = (post.info.uniqueID || post.info.capcode) === IDHighlight.uniqueID;
+ return $[match ? 'addClass' : 'rmClass'](post.nodes.post, 'highlight');
+ },
+ click: function(post) {
+ return function() {
+ var uniqueID;
+ uniqueID = post.info.uniqueID || post.info.capcode;
+ IDHighlight.uniqueID = IDHighlight.uniqueID === uniqueID ? null : uniqueID;
+ return g.posts.forEach(IDHighlight.set);
+ };
+ }
+ };
+
+ return IDHighlight;
+
+}).call(this);
+
+Keybinds = (function() {
+ var Keybinds;
+
+ Keybinds = {
+ init: function() {
+ var hotkey, init;
+ if (!Conf['Keybinds']) {
+ return;
+ }
+ for (hotkey in Config.hotkeys) {
+ $.sync(hotkey, Keybinds.sync);
+ }
+ init = function() {
+ var i, len, node, ref;
+ $.off(d, '4chanXInitFinished', init);
+ $.on(d, 'keydown', Keybinds.keydown);
+ ref = $$('[accesskey]');
+ for (i = 0, len = ref.length; i < len; i++) {
+ node = ref[i];
+ node.removeAttribute('accesskey');
+ }
+ };
+ return $.on(d, '4chanXInitFinished', init);
+ },
+ sync: function(key, hotkey) {
+ return Conf[hotkey] = key;
+ },
+ keydown: function(e) {
+ var form, i, key, len, notification, notifications, op, ref, ref1, ref2, ref3, ref4, ref5, searchInput, target, thread, threadRoot;
+ if (!(key = Keybinds.keyCode(e))) {
+ return;
+ }
+ target = e.target;
+ if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') {
+ if (!(/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) && !/^Alt\+(\d|Up|Down|Left|Right)$/.test(key))) {
+ return;
+ }
+ }
+ if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Index'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
+ threadRoot = Nav.getThread();
+ if (op = $('.op', threadRoot)) {
+ thread = Get.postFromNode(op).thread;
+ }
+ }
+ switch (key) {
+ case Conf['Toggle board list']:
+ if (!Conf['Custom Board Navigation']) {
+ return;
+ }
+ Header.toggleBoardList();
+ break;
+ case Conf['Toggle header']:
+ Header.toggleBarVisibility();
+ break;
+ case Conf['Open empty QR']:
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ Keybinds.qr();
+ break;
+ case Conf['Open QR']:
+ if (!(QR.postingIsEnabled && threadRoot)) {
+ return;
+ }
+ Keybinds.qr(threadRoot);
+ break;
+ case Conf['Open settings']:
+ Settings.open();
+ break;
+ case Conf['Close']:
+ if (Settings.dialog) {
+ Settings.close();
+ } else if ((notifications = $$('.notification')).length) {
+ for (i = 0, len = notifications.length; i < len; i++) {
+ notification = notifications[i];
+ $('.close', notification).click();
+ }
+ } else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) {
+ if (Conf['Persistent QR']) {
+ QR.hide();
+ } else {
+ QR.close();
+ }
+ } else if (Embedding.lastEmbed) {
+ Embedding.closeFloat();
+ } else {
+ return;
+ }
+ break;
+ case Conf['Spoiler tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('spoiler', target);
+ break;
+ case Conf['Code tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('code', target);
+ break;
+ case Conf['Eqn tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('eqn', target);
+ break;
+ case Conf['Math tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('math', target);
+ break;
+ case Conf['SJIS tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('sjis', target);
+ break;
+ case Conf['Toggle sage']:
+ if (!(QR.nodes && !QR.nodes.el.hidden)) {
+ return;
+ }
+ Keybinds.sage();
+ break;
+ case Conf['Submit QR']:
+ if (!(QR.nodes && !QR.nodes.el.hidden)) {
+ return;
+ }
+ if (!QR.status()) {
+ QR.submit();
+ }
+ break;
+ case Conf['Update']:
+ switch (g.VIEW) {
+ case 'thread':
+ if (!Conf['Thread Updater']) {
+ return;
+ }
+ ThreadUpdater.update();
+ break;
+ case 'index':
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ Index.update();
+ break;
+ default:
+ return;
+ }
+ break;
+ case Conf['Watch']:
+ if (!(ThreadWatcher.enabled && thread)) {
+ return;
+ }
+ ThreadWatcher.toggle(thread);
+ break;
+ case Conf['Update thread watcher']:
+ if (!ThreadWatcher.enabled) {
+ return;
+ }
+ ThreadWatcher.buttonFetchAll();
+ break;
+ case Conf['Expand image']:
+ if (!(ImageExpand.enabled && threadRoot)) {
+ return;
+ }
+ Keybinds.img(threadRoot);
+ break;
+ case Conf['Expand images']:
+ if (!(ImageExpand.enabled && threadRoot)) {
+ return;
+ }
+ Keybinds.img(threadRoot, true);
+ break;
+ case Conf['Open Gallery']:
+ if (!Gallery.enabled) {
+ return;
+ }
+ Gallery.cb.toggle();
+ break;
+ case Conf['fappeTyme']:
+ if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread'))) {
+ return;
+ }
+ FappeTyme.toggle('fappe');
+ break;
+ case Conf['werkTyme']:
+ if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread'))) {
+ return;
+ }
+ FappeTyme.toggle('werk');
+ break;
+ case Conf['Front page']:
+ if (Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
+ Index.userPageNav(1);
+ } else {
+ window.location = "/" + g.BOARD + "/";
+ }
+ break;
+ case Conf['Open front page']:
+ $.open("/" + g.BOARD + "/");
+ break;
+ case Conf['Next page']:
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ if (Conf['JSON Index']) {
+ if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
+ return;
+ }
+ $('.next button', Index.pagelist).click();
+ } else {
+ if (form = $('.next form')) {
+ window.location = form.action;
+ }
+ }
+ break;
+ case Conf['Previous page']:
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ if (Conf['JSON Index']) {
+ if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
+ return;
+ }
+ $('.prev button', Index.pagelist).click();
+ } else {
+ if (form = $('.prev form')) {
+ window.location = form.action;
+ }
+ }
+ break;
+ case Conf['Search form']:
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ searchInput = Conf['JSON Index'] ? Index.searchInput : $.id('search-box');
+ Header.scrollToIfNeeded(searchInput);
+ searchInput.focus();
+ break;
+ case Conf['Paged mode']:
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
+ break;
+ case Conf['Infinite scrolling mode']:
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
+ break;
+ case Conf['All pages mode']:
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
+ break;
+ case Conf['Open catalog']:
+ if (g.BOARD.ID === 'f') {
+ return;
+ }
+ window.location = CatalogLinks.catalog();
+ break;
+ case Conf['Cycle sort type']:
+ if (!(Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ Index.cycleSortType();
+ break;
+ case Conf['Next thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Nav.scroll(+1);
+ break;
+ case Conf['Previous thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Nav.scroll(-1);
+ break;
+ case Conf['Expand thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ ExpandThread.toggle(thread);
+ break;
+ case Conf['Open thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Keybinds.open(thread);
+ break;
+ case Conf['Open thread tab']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Keybinds.open(thread, true);
+ break;
+ case Conf['Next reply']:
+ if (!threadRoot) {
+ return;
+ }
+ Keybinds.hl(+1, threadRoot);
+ break;
+ case Conf['Previous reply']:
+ if (!threadRoot) {
+ return;
+ }
+ Keybinds.hl(-1, threadRoot);
+ break;
+ case Conf['Deselect reply']:
+ if (!threadRoot) {
+ return;
+ }
+ Keybinds.hl(0, threadRoot);
+ break;
+ case Conf['Hide']:
+ if (!thread) {
+ return;
+ }
+ if (ThreadHiding.db) {
+ ThreadHiding.toggle(thread);
+ }
+ break;
+ case Conf['Previous Post Quoting You']:
+ if (!(threadRoot && QuoteYou.db)) {
+ return;
+ }
+ QuoteYou.cb.seek('preceding');
+ break;
+ case Conf['Next Post Quoting You']:
+ if (!(threadRoot && QuoteYou.db)) {
+ return;
+ }
+ QuoteYou.cb.seek('following');
+ break;
+ default:
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ },
+ keyCode: function(e) {
+ var kc, key;
+ key = (function() {
+ switch (kc = e.keyCode) {
+ case 8:
+ return '';
+ case 13:
+ return 'Enter';
+ case 27:
+ return 'Esc';
+ case 32:
+ return 'Space';
+ case 37:
+ return 'Left';
+ case 38:
+ return 'Up';
+ case 39:
+ return 'Right';
+ case 40:
+ return 'Down';
+ case 188:
+ return 'Comma';
+ case 190:
+ return 'Period';
+ case 191:
+ return 'Slash';
+ case 59:
+ case 186:
+ return 'Semicolon';
+ default:
+ if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) {
+ return String.fromCharCode(kc).toLowerCase();
+ } else if ((96 <= kc && kc <= 105)) {
+ return String.fromCharCode(kc - 48).toLowerCase();
+ } else {
+ return null;
+ }
+ }
+ })();
+ if (key) {
+ if (e.altKey) {
+ key = 'Alt+' + key;
+ }
+ if (e.ctrlKey) {
+ key = 'Ctrl+' + key;
+ }
+ if (e.metaKey) {
+ key = 'Meta+' + key;
+ }
+ if (e.shiftKey) {
+ key = 'Shift+' + key;
+ }
+ }
+ return key;
+ },
+ qr: function(thread) {
+ QR.open();
+ if (thread != null) {
+ QR.quote.call($('input', $('.post.highlight', thread) || thread));
+ }
+ return QR.nodes.com.focus();
+ },
+ tags: function(tag, ta) {
+ var range, selEnd, selStart, supported, value;
+ supported = (function() {
+ switch (tag) {
+ case 'spoiler':
+ return !!$('.postForm input[name=spoiler]');
+ case 'code':
+ return g.BOARD.ID === 'g';
+ case 'math':
+ case 'eqn':
+ return g.BOARD.ID === 'sci';
+ case 'sjis':
+ return g.BOARD.ID === 'jp';
+ }
+ })();
+ if (!supported) {
+ new Notice('warning', "[" + tag + "] tags are not supported on /" + g.BOARD + "/.", 20);
+ }
+ value = ta.value;
+ selStart = ta.selectionStart;
+ selEnd = ta.selectionEnd;
+ ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd);
+ range = ("[" + tag + "]").length + selEnd;
+ ta.setSelectionRange(range, range);
+ return $.event('input', null, ta);
+ },
+ 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 {
+ post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread));
+ return ImageExpand.toggle(post);
+ }
+ },
+ open: function(thread, tab) {
+ var url;
+ if (g.VIEW !== 'index') {
+ return;
+ }
+ url = "/" + thread.board + "/thread/" + thread;
+ if (tab) {
+ return $.open(url);
+ } else {
+ return location.href = url;
+ }
+ },
+ hl: function(delta, thread) {
+ var axis, height, i, len, next, postEl, replies, reply, root;
+ postEl = $('.reply.highlight', thread);
+ if (!delta) {
+ if (postEl) {
+ $.rmClass(postEl, 'highlight');
+ }
+ return;
+ }
+ if (postEl) {
+ height = postEl.getBoundingClientRect().height;
+ if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
+ root = postEl.parentNode;
+ axis = delta === +1 ? 'following' : 'preceding';
+ if (!(next = $.x(axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
+ return;
+ }
+ Header.scrollToIfNeeded(next, delta === +1);
+ this.focus(next);
+ $.rmClass(postEl, 'highlight');
+ return;
+ }
+ $.rmClass(postEl, 'highlight');
+ }
+ replies = $$('.reply', thread);
+ if (delta === -1) {
+ replies.reverse();
+ }
+ for (i = 0, len = replies.length; i < len; i++) {
+ reply = replies[i];
+ if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) {
+ this.focus(reply);
+ return;
+ }
+ }
+ },
+ focus: function(post) {
+ return $.addClass(post, 'highlight');
+ }
+ };
+
+ return Keybinds;
+
+}).call(this);
+
+Nav = (function() {
+ var Nav;
+
+ Nav = {
+ init: function() {
+ var append, next, prev, span;
+ switch (g.VIEW) {
+ case 'index':
+ if (!Conf['Index Navigation']) {
+ return;
+ }
+ break;
+ case 'thread':
+ if (!Conf['Reply Navigation']) {
+ return;
+ }
+ break;
+ default:
+ return;
+ }
+ span = $.el('span', {
+ id: 'navlinks'
+ });
+ prev = $.el('a', {
+ textContent: 'â–²',
+ href: 'javascript:;'
+ });
+ next = $.el('a', {
+ textContent: 'â–¼',
+ href: 'javascript:;'
+ });
+ $.on(prev, 'click', this.prev);
+ $.on(next, 'click', this.next);
+ $.add(span, [prev, $.tn(' '), next]);
+ append = function() {
+ $.off(d, '4chanXInitFinished', append);
+ return $.add(d.body, span);
+ };
+ return $.on(d, '4chanXInitFinished', append);
+ },
+ prev: function() {
+ if (g.VIEW === 'thread') {
+ return window.scrollTo(0, 0);
+ } else {
+ return Nav.scroll(-1);
+ }
+ },
+ next: function() {
+ if (g.VIEW === 'thread') {
+ return window.scrollTo(0, d.body.scrollHeight);
+ } else {
+ return Nav.scroll(+1);
+ }
+ },
+ getThread: function() {
+ var i, len, ref, thread, threadRoot;
+ ref = $$('.thread');
+ for (i = 0, len = ref.length; i < len; i++) {
+ threadRoot = ref[i];
+ thread = Get.threadFromRoot(threadRoot);
+ if (thread.isHidden && !thread.stub) {
+ continue;
+ }
+ if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) {
+ return threadRoot;
+ }
+ }
+ return $('.board');
+ },
+ scroll: function(delta) {
+ var axis, extra, next, ref, thread, top;
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
+ }
+ thread = Nav.getThread();
+ axis = delta === +1 ? 'following' : 'preceding';
+ if (next = $.x(axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
+ top = Header.getTopOf(thread);
+ if (delta === +1 && top < 5 || delta === -1 && top > -5) {
+ thread = next;
+ }
+ }
+ extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom;
+ if (extra > 0) {
+ d.body.style.marginBottom = extra + "px";
+ }
+ Header.scrollTo(thread);
+ if (extra > 0 && !Nav.haveExtra) {
+ Nav.haveExtra = true;
+ return $.on(d, 'scroll', Nav.removeExtra);
+ }
+ },
+ removeExtra: function() {
+ var extra;
+ extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;
+ if (extra > 0) {
+ return d.body.style.marginBottom = extra + "px";
+ } else {
+ d.body.style.marginBottom = null;
+ delete Nav.haveExtra;
+ return $.off(d, 'scroll', Nav.removeExtra);
+ }
+ }
+ };
+
+ return Nav;
+
+}).call(this);
+
+NormalizeURL = (function() {
+ var NormalizeURL;
+
+ NormalizeURL = {
+ init: function() {
+ var pathname;
+ if (!Conf['Normalize URL']) {
+ return;
+ }
+ pathname = location.pathname.split(/\/+/);
+ switch (g.VIEW) {
+ case 'thread':
+ pathname[2] = 'thread';
+ pathname = pathname.slice(0, 4);
+ break;
+ case 'index':
+ pathname = pathname.slice(0, 3);
+ }
+ pathname = pathname.join('/');
+ if (location.pathname !== pathname) {
+ return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
+ }
+ }
+ };
+
+ return NormalizeURL;
+
+}).call(this);
+
+PSAHiding = (function() {
+ var PSAHiding;
+
+ PSAHiding = {
+ init: function() {
+ if (!Conf['Announcement Hiding']) {
+ return;
+ }
+ $.addClass(doc, 'hide-announcement');
+ return $.one(d, '4chanXInitFinished', this.setup);
+ },
+ setup: function() {
+ var btn, entry, hr, psa, ref;
+ if (!(psa = PSAHiding.psa = $.id('globalMessage'))) {
+ $.rmClass(doc, 'hide-announcement');
+ return;
+ }
+ if ((hr = (ref = $.id('globalToggle')) != null ? ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
+ PSAHiding.hr = hr;
+ }
+ entry = {
+ el: $.el('a', {
+ textContent: 'Show announcement',
+ className: 'show-announcement',
+ href: 'javascript:;'
+ }),
+ order: 50,
+ open: function() {
+ return PSAHiding.hidden;
+ }
+ };
+ Header.menu.addEntry(entry);
+ $.on(entry.el, 'click', PSAHiding.toggle);
+ PSAHiding.btn = btn = $.el('span', {
+ title: 'Mark announcement as read and hide.',
+ className: 'hide-announcement'
+ });
+ $.extend(btn, {
+ innerHTML: "[
Dismiss ]"
+ });
+ $.on(btn, 'click', PSAHiding.toggle);
+ $.get('hiddenPSA', 0, function(arg) {
+ var hiddenPSA;
+ hiddenPSA = arg.hiddenPSA;
+ PSAHiding.sync(hiddenPSA);
+ $.add(psa, btn);
+ return $.rmClass(doc, 'hide-announcement');
+ });
+ return $.sync('hiddenPSA', PSAHiding.sync);
+ },
+ toggle: function() {
+ var UTC;
+ if ($.hasClass(this, 'hide-announcement')) {
+ UTC = +$.id('globalMessage').dataset.utc;
+ $.set('hiddenPSA', UTC);
+ } else {
+ $.event('CloseMenu');
+ $["delete"]('hiddenPSA');
+ }
+ return PSAHiding.sync(UTC);
+ },
+ sync: function(UTC) {
+ var psa, ref;
+ psa = PSAHiding.psa;
+ PSAHiding.hidden = PSAHiding.btn.hidden = (UTC != null) && UTC >= +psa.dataset.utc;
+ if (PSAHiding.hidden) {
+ $.rm(psa);
+ } else {
+ $.after($.id('globalToggle'), psa);
+ }
+ if ((ref = PSAHiding.hr) != null) {
+ ref.hidden = PSAHiding.hidden;
+ }
+ }
+ };
+
+ return PSAHiding;
+
+}).call(this);
+
+RelativeDates = (function() {
+ var RelativeDates,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ RelativeDates = {
+ INTERVAL: $.MINUTE / 2,
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Index'] && g.BOARD.ID !== 'f') {
+ this.flush();
+ $.on(d, 'visibilitychange ThreadUpdate', this.flush);
+ }
+ if (Conf['Relative Post Dates']) {
+ return Callbacks.Post.push({
+ name: 'Relative Post Dates',
+ cb: this.node
+ });
+ }
+ },
+ node: function() {
+ var dateEl;
+ dateEl = this.nodes.date;
+ if (Conf['Relative Date Title']) {
+ $.on(dateEl, 'mouseover', (function(_this) {
+ return function() {
+ return RelativeDates.hover(_this);
+ };
+ })(this));
+ return;
+ }
+ if (this.isClone) {
+ return;
+ }
+ dateEl.title = dateEl.textContent;
+ return RelativeDates.update(this);
+ },
+ 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 * years) > 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) {
+ unit += 's';
+ }
+ return rounded + " " + unit + " ago";
+ },
+ stale: [],
+ flush: function() {
+ var data, i, len, now, ref;
+ if (d.hidden) {
+ return;
+ }
+ now = new Date();
+ ref = RelativeDates.stale;
+ for (i = 0, len = ref.length; i < len; i++) {
+ data = ref[i];
+ RelativeDates.update(data, now);
+ }
+ RelativeDates.stale = [];
+ clearTimeout(RelativeDates.timeout);
+ return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL);
+ },
+ hover: function(post) {
+ var date, diff, now;
+ date = post.info.date;
+ now = new Date();
+ diff = now - date;
+ return post.nodes.date.title = RelativeDates.relative(diff, now, date);
+ },
+ update: function(data, now) {
+ var date, diff, i, isPost, len, ref, relative, singlePost;
+ isPost = data instanceof Post;
+ date = isPost ? data.info.date : new Date(+data.dataset.utc);
+ now || (now = new Date());
+ diff = now - date;
+ relative = RelativeDates.relative(diff, now, date);
+ if (isPost) {
+ ref = [data].concat(data.clones);
+ for (i = 0, len = ref.length; i < len; i++) {
+ singlePost = ref[i];
+ singlePost.nodes.date.firstChild.textContent = relative;
+ }
+ } else {
+ data.firstChild.textContent = relative;
+ }
+ return RelativeDates.setOwnTimeout(diff, data);
+ },
+ setOwnTimeout: function(diff, data) {
+ var delay;
+ delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY;
+ return setTimeout(RelativeDates.markStale, delay, data);
+ },
+ markStale: function(data) {
+ if (indexOf.call(RelativeDates.stale, data) >= 0) {
+ return;
+ }
+ if (data instanceof Post && !g.posts[data.fullID]) {
+ return;
+ }
+ return RelativeDates.stale.push(data);
+ }
+ };
+
+ return RelativeDates;
+
+}).call(this);
+
+RemoveSpoilers = (function() {
+ var RemoveSpoilers,
+ slice = [].slice;
+
+ RemoveSpoilers = {
+ init: function() {
+ if (Conf['Reveal Spoilers']) {
+ $.addClass(doc, 'reveal-spoilers');
+ }
+ if (!Conf['Remove Spoilers']) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Reveal Spoilers',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Reveal Spoilers',
+ cb: this.node
+ });
+ if (g.VIEW === 'archive') {
+ return $.ready(function() {
+ return RemoveSpoilers.unspoiler($.id('arc-list'));
+ });
+ }
+ },
+ node: function() {
+ return RemoveSpoilers.unspoiler(this.nodes.comment);
+ },
+ unspoiler: function(el) {
+ var i, len, span, spoiler, spoilers;
+ spoilers = $$('s', el);
+ for (i = 0, len = spoilers.length; i < len; i++) {
+ spoiler = spoilers[i];
+ span = $.el('span', {
+ className: 'removed-spoiler'
+ });
+ $.replace(spoiler, span);
+ $.add(span, slice.call(spoiler.childNodes));
+ }
+ }
+ };
+
+ return RemoveSpoilers;
+
+}).call(this);
+
+Report = (function() {
+ var Report;
+
+ Report = {
+ init: function() {
+ var match;
+ if (!(match = location.search.match(/\bno=(\d+)/))) {
+ return;
+ }
+ Captcha.replace.init();
+ this.postID = +match[1];
+ return $.ready(this.ready);
+ },
+ ready: function() {
+ var passAd, prev, ref;
+ $.addStyle(CSS.report);
+ if (Conf['Archive Report']) {
+ Report.archive();
+ }
+ if ((passAd = $('a[href="https://www.4chan.org/pass"]'))) {
+ $.extend(passAd, {
+ textContent: 'Complain',
+ href: 'https://www.4chan-x.net/captchas.html',
+ tabIndex: -1
+ });
+ passAd.parentNode.normalize();
+ if (((ref = (prev = passAd.previousSibling)) != null ? ref.nodeType : void 0) === Node.TEXT_NODE) {
+ prev.nodeValue = prev.nodeValue.replace(/4chan Pass[^\.]*\./i, 'reCAPTCHA malfunctioning?');
+ }
+ $.after(passAd, [
+ $.tn('] ['), $.el('a', {
+ href: 'mailto:4chanpass@4chan.org?subject=4chan%20Pass%20-%20Purchase%20Support',
+ textContent: 'Email 4chan',
+ target: '_blank',
+ tabIndex: -1
+ })
+ ]);
+ }
+ if (!Conf['Use Recaptcha v1 in Reports'] && !Conf['Force Noscript Captcha'] && Main.jsEnabled) {
+ return new MutationObserver(function() {
+ Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
+ return Report.fit('body');
+ }).observe(d.body, {
+ childList: true,
+ attributes: true,
+ subtree: true
+ });
+ } else {
+ return Report.fit('body');
+ }
+ },
+ fit: function(selector) {
+ var dy, el;
+ if (!((el = $(selector, doc)) && getComputedStyle(el).visibility !== 'hidden')) {
+ return;
+ }
+ dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8;
+ if (dy > 0) {
+ return window.resizeBy(0, dy);
+ }
+ },
+ archive: function() {
+ var link, message, types, url;
+ Redirect.init();
+ if (!(url = Redirect.to('report', {
+ boardID: g.BOARD.ID,
+ postID: Report.postID
+ }))) {
+ return;
+ }
+ if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) {
+ if (location.hash === '#redirect') {
+ $.globalEval('self.close = function(){};');
+ window.resizeTo(700, 475);
+ location.replace(url);
+ }
+ return;
+ }
+ link = $.el('a', {
+ href: url,
+ textContent: 'Report to archive'
+ });
+ $.on(link, 'click', function(e) {
+ if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) {
+ return window.resizeTo(700, 475);
+ }
+ });
+ $.add(d.body, [$.tn(' ['), link, $.tn(']')]);
+ if (types = $.id('reportTypes')) {
+ return $.on(types, 'change', function(e) {
+ return $('form').action = e.target.value === 'illegal' ? '#redirect' : '';
+ });
+ }
+ }
+ };
+
+ return Report;
+
+}).call(this);
+
+ThreadLinks = (function() {
+ var ThreadLinks;
+
+ ThreadLinks = {
+ init: function() {
+ if (!(g.VIEW === 'index' && Conf['Open Threads in New Tab'])) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Thread Links',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Thread Links',
+ cb: this.catalogNode
+ });
+ },
+ node: function() {
+ if (this.isReply || this.isClone) {
+ return;
+ }
+ return ThreadLinks.process($('.replylink', this.nodes.info));
+ },
+ catalogNode: function() {
+ return ThreadLinks.process(this.nodes.thumb.parentNode);
+ },
+ process: function(link) {
+ return link.target = '_blank';
+ }
+ };
+
+ return ThreadLinks;
+
+}).call(this);
+
+Time = (function() {
+ var Time;
+
+ Time = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Time Formatting'])) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Time Formatting',
+ cb: this.node
+ });
+ },
+ node: function() {
+ if (this.isClone) {
+ return;
+ }
+ return this.nodes.date.textContent = Time.format(Conf['time'], this.info.date);
+ },
+ format: function(formatString, date) {
+ return formatString.replace(/%(.)/g, function(s, c) {
+ if (c in Time.formatters) {
+ return Time.formatters[c].call(date);
+ } else {
+ return s;
+ }
+ });
+ },
+ day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+ month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ zeroPad: function(n) {
+ if (n < 10) {
+ return "0" + n;
+ } else {
+ return n;
+ }
+ },
+ formatters: {
+ a: function() {
+ return Time.day[this.getDay()].slice(0, 3);
+ },
+ A: function() {
+ return Time.day[this.getDay()];
+ },
+ b: function() {
+ return Time.month[this.getMonth()].slice(0, 3);
+ },
+ B: function() {
+ return Time.month[this.getMonth()];
+ },
+ d: function() {
+ return Time.zeroPad(this.getDate());
+ },
+ e: function() {
+ return this.getDate();
+ },
+ H: function() {
+ return Time.zeroPad(this.getHours());
+ },
+ I: function() {
+ return Time.zeroPad(this.getHours() % 12 || 12);
+ },
+ k: function() {
+ return this.getHours();
+ },
+ l: function() {
+ return this.getHours() % 12 || 12;
+ },
+ m: function() {
+ return Time.zeroPad(this.getMonth() + 1);
+ },
+ M: function() {
+ return Time.zeroPad(this.getMinutes());
+ },
+ p: function() {
+ if (this.getHours() < 12) {
+ return 'AM';
+ } else {
+ return 'PM';
+ }
+ },
+ P: function() {
+ if (this.getHours() < 12) {
+ return 'am';
+ } else {
+ return 'pm';
+ }
+ },
+ S: function() {
+ return Time.zeroPad(this.getSeconds());
+ },
+ y: function() {
+ return this.getFullYear().toString().slice(2);
+ },
+ Y: function() {
+ return this.getFullYear();
+ },
+ '%': function() {
+ return '%';
+ }
+ }
+ };
+
+ return Time;
+
+}).call(this);
+
+Favicon = (function() {
+ var Favicon;
+
+ Favicon = {
+ init: function() {
+ return $.asap((function() {
+ return d.head && (Favicon.el = $('link[rel="shortcut icon"]', d.head));
+ }), Favicon.initAsap);
+ },
+ initAsap: function() {
+ var href;
+ Favicon.el.type = 'image/x-icon';
+ href = Favicon.el.href;
+ Favicon.SFW = /ws\.ico$/.test(href);
+ Favicon["default"] = href;
+ return Favicon["switch"]();
+ },
+ "switch": function() {
+ var f, i, items, t;
+ items = {
+ ferongr: ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC', 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ApAAAsAAA4AABsAACQAAC/AAD///9SVhtjAAAAA3RSTlMAPse+s4iwAAAAM0lEQVQIW2NggAGuVasWgDBpDDAQUoSaob0Jao73lgVojOitUEazBZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAA1/GhpCidAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAAACAkAISUALzQAMTcAQEcAeokAorYA1/H///8BrzTFAAAAA3RSTlMAPse+s4iwAAAAM0lEQVQIW2NggAGuVasWgDBpDDAQUoSaob0Jao73lgVojOitUEazBZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAADCgANKAASOAATOwAZTAAwkQBAwQBV/wH////+Fmy4AAAAA3RSTlMAPse+s4iwAAAAM0lEQVQIW2NggAGuVasWgDBpDDAQUoSaob0Jao73lgVojOitUEazBZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC']
+ }[Conf['favicon']];
+ f = Favicon;
+ t = 'data:image/png;base64,';
+ i = 0;
+ while (items[i]) {
+ items[i] = t + items[i++];
+ }
+ f.unreadDead = items[0], f.unreadDeadY = items[1], f.unreadSFW = items[2], f.unreadSFWY = items[3], f.unreadNSFW = items[4], f.unreadNSFWY = items[5];
+ return f.update();
+ },
+ update: function() {
+ if (this.SFW) {
+ this.unread = this.unreadSFW;
+ return this.unreadY = this.unreadSFWY;
+ } else {
+ this.unread = this.unreadNSFW;
+ return this.unreadY = this.unreadNSFWY;
+ }
+ },
+ dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
+ logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAgMAAAC+UIlYAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAGlJREFUWMPtlkEKADEIA/tJP9lXLttQto2yHxgDHozTi0ToGK2WKZZ+HAQQMZc+xBwI4EZ+wAC2IfPuSIDOZJrSZQEAX9eVJhhwIuUYAnQe8rhAEMAZlTI2MID9f5Clyh0JeE1V1ZEAvB4qDfwuJTSGRAAAAABJRU5ErkJggg=='
+ };
+
+ return Favicon;
+
+}).call(this);
+
+MarkNewIPs = (function() {
+ var MarkNewIPs;
+
+ MarkNewIPs = {
+ init: function() {
+ if (g.VIEW !== 'thread' || !Conf['Mark New IPs']) {
+ return;
+ }
+ return Callbacks.Thread.push({
+ name: 'Mark New IPs',
+ cb: this.node
+ });
+ },
+ node: function() {
+ MarkNewIPs.ipCount = this.ipCount;
+ MarkNewIPs.postCount = this.posts.keys.length;
+ return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
+ },
+ onUpdate: function(e) {
+ var deletedPosts, fullID, i, ipCount, j, k, len, len1, newPosts, postCount, ref;
+ ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
+ if (ipCount == null) {
+ return;
+ }
+ switch (ipCount - MarkNewIPs.ipCount) {
+ case postCount - MarkNewIPs.postCount + deletedPosts.length:
+ i = MarkNewIPs.ipCount;
+ for (j = 0, len = newPosts.length; j < len; j++) {
+ fullID = newPosts[j];
+ MarkNewIPs.markNew(g.posts[fullID], ++i);
+ }
+ break;
+ case -deletedPosts.length:
+ for (k = 0, len1 = newPosts.length; k < len1; k++) {
+ fullID = newPosts[k];
+ MarkNewIPs.markOld(g.posts[fullID]);
+ }
+ }
+ MarkNewIPs.ipCount = ipCount;
+ return MarkNewIPs.postCount = postCount;
+ },
+ markNew: function(post, ipCount) {
+ var counter, suffix;
+ suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
+ counter = $.el('span', {
+ className: 'ip-counter',
+ textContent: "(" + ipCount + ")"
+ });
+ post.nodes.nameBlock.title = "This is the " + ipCount + suffix + " IP in the thread.";
+ $.add(post.nodes.nameBlock, [$.tn(' '), counter]);
+ return $.addClass(post.nodes.root, 'new-ip');
+ },
+ markOld: function(post) {
+ post.nodes.nameBlock.title = 'Not the first post from this IP.';
+ return $.addClass(post.nodes.root, 'old-ip');
+ }
+ };
+
+ return MarkNewIPs;
+
+}).call(this);
+
+ReplyPruning = (function() {
+ var ReplyPruning;
+
+ ReplyPruning = {
+ init: function() {
+ var el, label;
+ if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) {
+ return;
+ }
+ this.active = !(Conf['Quote Threading'] && Conf['Thread Quotes']);
+ this.container = $.frag();
+ this.summary = $.el('span', {
+ hidden: true,
+ className: 'summary'
+ });
+ this.summary.style.cursor = 'pointer';
+ $.on(this.summary, 'click', (function(_this) {
+ return function() {
+ _this.inputs.enabled.checked = !_this.inputs.enabled.checked;
+ return $.event('change', null, _this.inputs.enabled);
+ };
+ })(this));
+ label = UI.checkbox('Prune Replies', 'Show Last', this.active);
+ el = $.el('span', {
+ title: 'Maximum number of replies to show.'
+ }, {
+ innerHTML: "
"
+ });
+ $.prepend(el, label);
+ this.inputs = {
+ enabled: label.firstElementChild,
+ replies: el.lastElementChild
+ };
+ $.on(this.inputs.enabled, 'change', this.setEnabled);
+ $.on(this.inputs.replies, 'change', $.cb.value);
+ Header.menu.addEntry({
+ el: el,
+ order: 190
+ });
+ return Callbacks.Thread.push({
+ name: 'Reply Pruning',
+ cb: this.node
+ });
+ },
+ position: 0,
+ hidden: 0,
+ hiddenFiles: 0,
+ total: 0,
+ totalFiles: 0,
+ setEnabled: function() {
+ var other;
+ other = QuoteThreading.input;
+ if (this.checked && (other != null ? other.checked : void 0)) {
+ other.checked = false;
+ $.event('change', null, other);
+ }
+ return ReplyPruning.active = this.checked;
+ },
+ showIfHidden: function(id) {
+ var ref;
+ if ((ref = ReplyPruning.container) != null ? ref.getElementById(id) : void 0) {
+ ReplyPruning.inputs.enabled.checked = false;
+ return $.event('change', null, ReplyPruning.inputs.enabled);
+ }
+ },
+ node: function() {
+ var ref;
+ ReplyPruning.thread = this;
+ this.posts.forEach(function(post) {
+ if (post.isReply) {
+ ReplyPruning.total++;
+ if (post.file) {
+ return ReplyPruning.totalFiles++;
+ }
+ }
+ });
+ if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (0 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) {
+ ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false;
+ }
+ $.after(this.OP.nodes.root, ReplyPruning.summary);
+ $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update);
+ $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update);
+ $.on(d, 'ThreadUpdate', ReplyPruning.updateCount);
+ $.on(d, 'ThreadUpdate', ReplyPruning.update);
+ return ReplyPruning.update();
+ },
+ updateCount: function(e) {
+ var fullID, i, len, ref;
+ if (e.detail[404]) {
+ return;
+ }
+ ref = e.detail.newPosts;
+ for (i = 0, len = ref.length; i < len; i++) {
+ fullID = ref[i];
+ ReplyPruning.total++;
+ if (g.posts[fullID].file) {
+ ReplyPruning.totalFiles++;
+ }
+ }
+ },
+ update: function() {
+ var boardTop, frag, hidden2, oldPos, post, posts;
+ hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0;
+ oldPos = d.body.clientHeight - window.scrollY;
+ posts = ReplyPruning.thread.posts;
+ if (ReplyPruning.hidden < hidden2) {
+ while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) {
+ post = posts[posts.keys[ReplyPruning.position++]];
+ if (post.isReply && !post.isFetchedQuote) {
+ $.add(ReplyPruning.container, post.nodes.root);
+ ReplyPruning.hidden++;
+ if (post.file) {
+ ReplyPruning.hiddenFiles++;
+ }
+ }
+ }
+ } else if (ReplyPruning.hidden > hidden2) {
+ frag = $.frag();
+ while (ReplyPruning.hidden > hidden2 && ReplyPruning.position > 0) {
+ post = posts[posts.keys[--ReplyPruning.position]];
+ if (post.isReply && !post.isFetchedQuote) {
+ $.prepend(frag, post.nodes.root);
+ ReplyPruning.hidden--;
+ if (post.file) {
+ ReplyPruning.hiddenFiles--;
+ }
+ }
+ }
+ $.after(ReplyPruning.summary, frag);
+ $.event('PostsInserted');
+ }
+ ReplyPruning.summary.textContent = ReplyPruning.active ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles);
+ ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"];
+ if ((boardTop = Header.getTopOf($('.board'))) < 0) {
+ return window.scroll(window.scrollX, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop));
+ }
+ }
+ };
+
+ return ReplyPruning;
+
+}).call(this);
+
+ThreadExcerpt = (function() {
+ var ThreadExcerpt;
+
+ ThreadExcerpt = {
+ init: function() {
+ if (g.BOARD.ID !== 'f' || g.VIEW !== 'thread' || !Conf['Thread Excerpt']) {
+ return;
+ }
+ return Callbacks.Thread.push({
+ name: 'Thread Excerpt',
+ cb: this.node
+ });
+ },
+ node: function() {
+ return d.title = Get.threadExcerpt(this);
+ }
+ };
+
+ return ThreadExcerpt;
+
+}).call(this);
+
+ThreadStats = (function() {
+ var ThreadStats;
+
+ ThreadStats = {
+ init: function() {
+ var sc, statsHTML, statsTitle;
+ if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
+ return;
+ }
+ statsHTML = {
+ innerHTML: "
? /
? " + ((Conf["IP Count in Stats"]) ? " /
? " : "") + ((Conf["Page Count in Stats"]) ? " /
? " : "")
+ };
+ statsTitle = 'Posts / Files';
+ if (Conf['IP Count in Stats']) {
+ statsTitle += ' / IPs';
+ }
+ if (Conf['Page Count in Stats']) {
+ statsTitle += (g.BOARD.ID === 'f' ? ' / Purge Position' : ' / Page');
+ }
+ if (Conf['Updater and Stats in Header']) {
+ this.dialog = sc = $.el('span', {
+ id: 'thread-stats',
+ title: statsTitle
+ });
+ $.extend(sc, statsHTML);
+ $.ready(function() {
+ return Header.addShortcut(sc);
+ });
+ } else {
+ this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', {
+ innerHTML: "
" + (statsHTML).innerHTML + "
"
+ });
+ $.addClass(doc, 'float');
+ $.ready(function() {
+ return $.add(d.body, sc);
+ });
+ }
+ this.postCountEl = $('#post-count', sc);
+ this.fileCountEl = $('#file-count', sc);
+ this.ipCountEl = $('#ip-count', sc);
+ this.pageCountEl = $('#page-count', sc);
+ if (this.pageCountEl) {
+ $.on(this.pageCountEl, 'click', ThreadStats.fetchPage);
+ }
+ return Callbacks.Thread.push({
+ name: 'Thread Stats',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var fileCount, postCount;
+ postCount = 0;
+ fileCount = 0;
+ this.posts.forEach(function(post) {
+ postCount++;
+ if (post.file) {
+ fileCount++;
+ }
+ if (ThreadStats.pageCountEl) {
+ return ThreadStats.lastPost = post.info.date;
+ }
+ });
+ ThreadStats.thread = this;
+ ThreadStats.fetchPage();
+ ThreadStats.update(postCount, fileCount, this.ipCount);
+ return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate);
+ },
+ onUpdate: function(e) {
+ var fileCount, ipCount, newPosts, postCount, ref, ref1;
+ if (e.detail[404]) {
+ return;
+ }
+ ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount, ipCount = ref.ipCount, newPosts = ref.newPosts;
+ ThreadStats.update(postCount, fileCount, ipCount);
+ if (!ThreadStats.pageCountEl) {
+ return;
+ }
+ if (newPosts.length) {
+ ThreadStats.lastPost = g.posts[newPosts[newPosts.length - 1]].info.date;
+ }
+ if (g.BOARD.ID !== 'f' && ((ref1 = ThreadStats.pageCountEl) != null ? ref1.textContent : void 0) !== '1') {
+ return ThreadStats.fetchPage();
+ }
+ },
+ update: function(postCount, fileCount, ipCount) {
+ var fileCountEl, ipCountEl, postCountEl, thread;
+ thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl, ipCountEl = ThreadStats.ipCountEl;
+ postCountEl.textContent = postCount;
+ fileCountEl.textContent = fileCount;
+ if ((ipCount != null) && ipCountEl) {
+ ipCountEl.textContent = ipCount;
+ }
+ (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning');
+ return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning');
+ },
+ fetchPage: function() {
+ if (!ThreadStats.pageCountEl) {
+ return;
+ }
+ clearTimeout(ThreadStats.timeout);
+ if (ThreadStats.thread.isDead) {
+ ThreadStats.pageCountEl.textContent = 'Dead';
+ $.addClass(ThreadStats.pageCountEl, 'warning');
+ return;
+ }
+ ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 2 * $.MINUTE);
+ return $.ajax("//a.4cdn.org/" + ThreadStats.thread.board + "/threads.json", {
+ onload: ThreadStats.onThreadsLoad
+ }, {
+ whenModified: 'ThreadStats'
+ });
+ },
+ onThreadsLoad: function() {
+ var i, j, k, len, len1, len2, page, purgePos, ref, ref1, ref2, thread;
+ if (this.status === 200) {
+ ref = this.response;
+ for (i = 0, len = ref.length; i < len; i++) {
+ page = ref[i];
+ if (g.BOARD.ID === 'f') {
+ purgePos = 1;
+ ref1 = page.threads;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ thread = ref1[j];
+ if (thread.no < ThreadStats.thread.ID) {
+ purgePos++;
+ }
+ }
+ ThreadStats.pageCountEl.textContent = purgePos;
+ } else {
+ ref2 = page.threads;
+ for (k = 0, len2 = ref2.length; k < len2; k++) {
+ thread = ref2[k];
+ if (!(thread.no === ThreadStats.thread.ID)) {
+ continue;
+ }
+ ThreadStats.pageCountEl.textContent = page.page;
+ (page.page === this.response.length ? $.addClass : $.rmClass)(ThreadStats.pageCountEl, 'warning');
+ ThreadStats.lastPageUpdate = new Date(thread.last_modified * $.SECOND);
+ ThreadStats.retry();
+ return;
+ }
+ }
+ }
+ } else if (this.status === 304) {
+ return ThreadStats.retry();
+ }
+ },
+ retry: function() {
+ var ref;
+ if (g.BOARD.ID !== 'f' && ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((ref = ThreadStats.pageCountEl) != null ? ref.textContent : void 0) !== '1') {
+ clearTimeout(ThreadStats.timeout);
+ return ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 5 * $.SECOND);
+ }
+ }
+ };
+
+ return ThreadStats;
+
+}).call(this);
+
+ThreadUpdater = (function() {
+ var ThreadUpdater,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ ThreadUpdater = {
+ init: function() {
+ var conf, el, input, name, ref, sc, subEntries, updateLink;
+ if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
+ return;
+ }
+ this.audio = $.el('audio', {
+ src: ThreadUpdater.beep
+ });
+ if (Conf['Updater and Stats in Header']) {
+ this.dialog = sc = $.el('span', {
+ id: 'updater'
+ });
+ $.extend(sc, {
+ innerHTML: "
"
+ });
+ $.ready(function() {
+ return Header.addShortcut(sc);
+ });
+ } else {
+ this.dialog = sc = UI.dialog('updater', 'bottom: 0px; left: 0px;', {
+ innerHTML: "
"
+ });
+ $.addClass(doc, 'float');
+ $.ready(function() {
+ return $.add(d.body, sc);
+ });
+ }
+ this.checkPostCount = 0;
+ this.timer = $('#update-timer', sc);
+ this.status = $('#update-status', sc);
+ $.on(this.timer, 'click', this.update);
+ $.on(this.status, 'click', this.update);
+ updateLink = $.el('span', {
+ className: 'brackets-wrap updatelink'
+ });
+ $.extend(updateLink, {
+ innerHTML: "
Update "
+ });
+ Main.ready(function() {
+ var navLinksBot;
+ if ((navLinksBot = $('.navLinksBot'))) {
+ return $.add(navLinksBot, [$.tn(' '), updateLink]);
+ }
+ });
+ $.on(updateLink.firstElementChild, 'click', this.update);
+ subEntries = [];
+ ref = Config.updater.checkbox;
+ for (name in ref) {
+ conf = ref[name];
+ el = UI.checkbox(name, name);
+ el.title = conf[1];
+ input = el.firstElementChild;
+ $.on(input, 'change', $.cb.checked);
+ if (input.name === 'Scroll BG') {
+ $.on(input, 'change', this.cb.scrollBG);
+ this.cb.scrollBG();
+ } else if (input.name === 'Auto Update') {
+ $.on(input, 'change', this.setInterval);
+ }
+ subEntries.push({
+ el: el
+ });
+ }
+ this.settings = $.el('span', {
+ innerHTML: "
Interval "
+ });
+ $.on(this.settings, 'click', this.intervalShortcut);
+ subEntries.push({
+ el: this.settings
+ });
+ Header.menu.addEntry(this.entry = {
+ el: $.el('span', {
+ textContent: 'Updater'
+ }),
+ order: 110,
+ subEntries: subEntries
+ });
+ return Callbacks.Thread.push({
+ name: 'Thread Updater',
+ cb: this.node
+ });
+ },
+ node: function() {
+ ThreadUpdater.thread = this;
+ ThreadUpdater.root = this.OP.nodes.root.parentNode;
+ ThreadUpdater.outdateCount = 0;
+ ThreadUpdater.postIDs = [];
+ ThreadUpdater.fileIDs = [];
+ this.posts.forEach(function(post) {
+ ThreadUpdater.postIDs.push(post.ID);
+ if (post.file) {
+ return ThreadUpdater.fileIDs.push(post.ID);
+ }
+ });
+ ThreadUpdater.cb.interval.call($.el('input', {
+ value: Conf['Interval']
+ }));
+ $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);
+ $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
+ return ThreadUpdater.setInterval();
+ },
+
+ /*
+ http://freesound.org/people/pierrecartoons1979/sounds/90112/
+ cc-by-nc-3.0
+ */
+ beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA',
+ playBeep: function() {
+ var audio;
+ audio = ThreadUpdater.audio;
+ if (audio.paused) {
+ return audio.play();
+ } else {
+ return $.one(audio, 'ended', ThreadUpdater.playBeep);
+ }
+ },
+ cb: {
+ checkpost: function(e) {
+ if (e.detail.threadID !== ThreadUpdater.thread.ID) {
+ return;
+ }
+ ThreadUpdater.postID = e.detail.postID;
+ ThreadUpdater.checkPostCount = 0;
+ ThreadUpdater.outdateCount = 0;
+ return ThreadUpdater.setInterval();
+ },
+ visibility: function() {
+ if (d.hidden) {
+ return;
+ }
+ ThreadUpdater.outdateCount = 0;
+ if (ThreadUpdater.seconds > ThreadUpdater.interval) {
+ return ThreadUpdater.setInterval();
+ }
+ },
+ scrollBG: function() {
+ return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() {
+ return true;
+ } : function() {
+ return !d.hidden;
+ };
+ },
+ interval: function(e) {
+ var val;
+ val = parseInt(this.value, 10);
+ if (val < 1) {
+ val = 1;
+ }
+ ThreadUpdater.interval = this.value = val;
+ if (e) {
+ return $.cb.value.call(this);
+ }
+ },
+ load: function() {
+ var req;
+ req = ThreadUpdater.req;
+ switch (req.status) {
+ case 200:
+ ThreadUpdater.parse(req);
+ if (ThreadUpdater.thread.isArchived) {
+ return ThreadUpdater.kill();
+ } else {
+ return ThreadUpdater.setInterval();
+ }
+ break;
+ case 404:
+ return $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/catalog.json", {
+ onloadend: function() {
+ var confirmed, i, k, len, len1, page, ref, ref1, thread;
+ if (this.status === 200) {
+ confirmed = true;
+ ref = this.response;
+ for (i = 0, len = ref.length; i < len; i++) {
+ page = ref[i];
+ ref1 = page.threads;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ thread = ref1[k];
+ if (thread.no === ThreadUpdater.thread.ID) {
+ confirmed = false;
+ break;
+ }
+ }
+ }
+ } else {
+ confirmed = false;
+ }
+ if (confirmed) {
+ return ThreadUpdater.kill();
+ } else {
+ return ThreadUpdater.error(req);
+ }
+ }
+ });
+ default:
+ return ThreadUpdater.error(req);
+ }
+ }
+ },
+ kill: function() {
+ ThreadUpdater.thread.kill();
+ ThreadUpdater.setInterval();
+ return $.event('ThreadUpdate', {
+ 404: true,
+ threadID: ThreadUpdater.thread.fullID
+ });
+ },
+ error: function(req) {
+ if (req.status === 304) {
+ ThreadUpdater.set('status', '');
+ }
+ ThreadUpdater.setInterval();
+ if (!req.status) {
+ return ThreadUpdater.set('status', 'Connection Failed', 'warning');
+ } else if (req.status !== 304) {
+ return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning');
+ }
+ },
+ setInterval: function() {
+ var cur, interval, j, limit;
+ clearTimeout(ThreadUpdater.timeoutID);
+ if (ThreadUpdater.thread.isDead) {
+ ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning');
+ ThreadUpdater.set('timer', '');
+ return;
+ }
+ if (ThreadUpdater.postID && ThreadUpdater.checkPostCount < 5) {
+ ThreadUpdater.set('timer', '...', 'loading');
+ ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND);
+ return;
+ }
+ if (!Conf['Auto Update']) {
+ ThreadUpdater.set('timer', 'Update');
+ return;
+ }
+ interval = ThreadUpdater.interval;
+ if (Conf['Optional Increase']) {
+ limit = d.hidden ? 10 : 5;
+ j = Math.min(ThreadUpdater.outdateCount, limit);
+ cur = (Math.floor(interval * 0.1) || 1) * j * j;
+ ThreadUpdater.seconds = $.minmax(cur, interval, 300);
+ } else {
+ ThreadUpdater.seconds = interval;
+ }
+ return ThreadUpdater.timeout();
+ },
+ 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;
+ } else {
+ el.textContent = text;
+ }
+ return el.className = klass != null ? klass : (text === '' ? 'empty' : '');
+ },
+ timeout: function() {
+ if (ThreadUpdater.seconds) {
+ ThreadUpdater.set('timer', ThreadUpdater.seconds);
+ ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
+ } else {
+ ThreadUpdater.outdateCount++;
+ ThreadUpdater.update();
+ }
+ return ThreadUpdater.seconds--;
+ },
+ update: function() {
+ var ref;
+ clearTimeout(ThreadUpdater.timeoutID);
+ ThreadUpdater.set('timer', '...', 'loading');
+ if ((ref = ThreadUpdater.req) != null) {
+ ref.abort();
+ }
+ return ThreadUpdater.req = $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/thread/" + ThreadUpdater.thread + ".json", {
+ onloadend: ThreadUpdater.cb.load,
+ timeout: $.MINUTE
+ }, {
+ whenModified: 'ThreadUpdater'
+ });
+ },
+ updateThreadStatus: function(type, status) {
+ var change, hasChanged;
+ if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) {
+ return;
+ }
+ ThreadUpdater.thread.setStatus(type, status);
+ if (type === 'Closed' && ThreadUpdater.thread.isArchived) {
+ return;
+ }
+ change = type === 'Sticky' ? status ? 'now a sticky' : 'not a sticky anymore' : status ? 'now closed' : 'not closed anymore';
+ return new Notice('info', "The thread is " + change + ".", 30);
+ },
+ parse: function(req) {
+ var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, i, index, ipCountEl, k, l, lastPost, len, len1, len2, len3, m, newPosts, node, post, postObject, postObjects, posts, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, scroll, thread, unreadCount, unreadQYCount;
+ postObjects = req.response.posts;
+ OP = postObjects[0];
+ thread = ThreadUpdater.thread;
+ board = thread.board;
+ ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1];
+ if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts[lastPost].info.date < 30 * $.SECOND) {
+ return;
+ }
+ Build.spoilerRange[board] = OP.custom_spoiler;
+ thread.setStatus('Archived', !!OP.archived);
+ ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
+ ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
+ thread.postLimit = !!OP.bumplimit;
+ thread.fileLimit = !!OP.imagelimit;
+ if (OP.unique_ips != null) {
+ thread.ipCount = OP.unique_ips;
+ }
+ posts = [];
+ index = [];
+ files = [];
+ newPosts = [];
+ for (i = 0, len = postObjects.length; i < len; i++) {
+ postObject = postObjects[i];
+ ID = postObject.no;
+ index.push(ID);
+ if (postObject.fsize) {
+ files.push(ID);
+ }
+ if (ID <= lastPost) {
+ continue;
+ }
+ if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
+ post.resurrect();
+ continue;
+ }
+ newPosts.push(board + "." + ID);
+ node = Build.postFromObject(postObject, board.ID);
+ posts.push(new Post(node, thread, board));
+ if (ThreadUpdater.postID === ID) {
+ delete ThreadUpdater.postID;
+ }
+ }
+ deletedPosts = [];
+ ref1 = ThreadUpdater.postIDs;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ ID = ref1[k];
+ if (!(indexOf.call(index, ID) < 0)) {
+ continue;
+ }
+ thread.posts[ID].kill();
+ deletedPosts.push(board + "." + ID);
+ }
+ ThreadUpdater.postIDs = index;
+ deletedFiles = [];
+ ref2 = ThreadUpdater.fileIDs;
+ for (l = 0, len2 = ref2.length; l < len2; l++) {
+ ID = ref2[l];
+ if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) {
+ continue;
+ }
+ thread.posts[ID].kill(true);
+ deletedFiles.push(board + "." + ID);
+ }
+ ThreadUpdater.fileIDs = files;
+ if (!posts.length) {
+ ThreadUpdater.set('status', '');
+ } else {
+ ThreadUpdater.set('status', "+" + posts.length, 'new');
+ ThreadUpdater.outdateCount = 0;
+ unreadCount = (ref4 = Unread.posts) != null ? ref4.size : void 0;
+ unreadQYCount = (ref5 = Unread.postsQuotingYou) != null ? ref5.size : void 0;
+ Main.callbackNodes('Post', posts);
+ if (d.hidden || !d.hasFocus()) {
+ if (Conf['Beep Quoting You'] && ((ref6 = Unread.postsQuotingYou) != null ? ref6.size : void 0) > unreadQYCount) {
+ ThreadUpdater.playBeep();
+ if (Conf['Beep']) {
+ ThreadUpdater.playBeep();
+ }
+ } else if (Conf['Beep'] && ((ref7 = Unread.posts) != null ? ref7.size : void 0) > 0 && unreadCount === 0) {
+ ThreadUpdater.playBeep();
+ }
+ }
+ scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
+ firstPost = null;
+ for (m = 0, len3 = posts.length; m < len3; m++) {
+ post = posts[m];
+ if (!QuoteThreading.insert(post)) {
+ firstPost || (firstPost = post.nodes.root);
+ $.add(ThreadUpdater.root, post.nodes.root);
+ }
+ }
+ $.event('PostsInserted');
+ if (scroll) {
+ if (Conf['Bottom Scroll']) {
+ window.scrollTo(0, d.body.clientHeight);
+ } else {
+ if (firstPost) {
+ Header.scrollTo(firstPost);
+ }
+ }
+ }
+ }
+ if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) {
+ ipCountEl.textContent = OP.unique_ips;
+ ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are');
+ ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters');
+ }
+ return $.event('ThreadUpdate', {
+ 404: false,
+ threadID: thread.fullID,
+ newPosts: newPosts,
+ deletedPosts: deletedPosts,
+ deletedFiles: deletedFiles,
+ postCount: OP.replies + 1,
+ fileCount: OP.images + !!OP.fsize,
+ ipCount: OP.unique_ips
+ });
+ }
+ };
+
+ return ThreadUpdater;
+
+}).call(this);
+
+ThreadWatcher = (function() {
+ var ThreadWatcher,
+ slice = [].slice;
+
+ ThreadWatcher = {
+ init: function() {
+ var sc;
+ if (!(this.enabled = Conf['Thread Watcher'])) {
+ return;
+ }
+ this.shortcut = sc = $.el('a', {
+ id: 'watcher-link',
+ textContent: 'Watcher',
+ title: 'Thread Watcher',
+ href: 'javascript:;',
+ className: 'disabled fa fa-eye'
+ });
+ this.db = new DataBoard('watchedThreads', this.refresh, true);
+ this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', {
+ innerHTML: "
"
+ });
+ this.status = $('#watcher-status', this.dialog);
+ this.list = this.dialog.lastElementChild;
+ this.refreshButton = $('.refresh', this.dialog);
+ this.closeButton = $('.move > .close', this.dialog);
+ this.unreaddb = Unread.db || new DataBoard('lastReadPosts');
+ this.unreadEnabled = Conf['Remember Last Read Post'];
+ $.on(d, 'QRPostSuccessful', this.cb.post);
+ $.on(sc, 'click', this.toggleWatcher);
+ $.on(this.refreshButton, 'click', this.buttonFetchAll);
+ $.on(this.closeButton, 'click', this.toggleWatcher);
+ $.on(d, '4chanXInitFinished', this.ready);
+ switch (g.VIEW) {
+ case 'index':
+ $.on(d, 'IndexRefresh', this.cb.onIndexRefresh);
+ break;
+ case 'thread':
+ $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh);
+ }
+ if (Conf['Fixed Thread Watcher']) {
+ $.addClass(doc, 'fixed-watcher');
+ }
+ if (Conf['Toggleable Thread Watcher']) {
+ this.dialog.hidden = true;
+ Header.addShortcut(sc);
+ $.addClass(doc, 'toggleable-watcher');
+ }
+ ThreadWatcher.fetchAuto();
+ if (g.VIEW === 'index' && Conf['JSON Index'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
+ Menu.menu.addEntry({
+ el: $.el('a', {
+ href: 'javascript:;',
+ className: 'has-shortcut-text'
+ }, {
+ innerHTML: "
Alt+click "
+ }),
+ order: 6,
+ open: function(arg) {
+ var thread;
+ thread = arg.thread;
+ if (Conf['Index Mode'] !== 'catalog') {
+ return false;
+ }
+ this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? 'Unwatch' : 'Watch';
+ if (this.cb) {
+ $.off(this.el, 'click', this.cb);
+ }
+ this.cb = function() {
+ $.event('CloseMenu');
+ return ThreadWatcher.toggle(thread);
+ };
+ $.on(this.el, 'click', this.cb);
+ return true;
+ }
+ });
+ }
+ Callbacks.Post.push({
+ name: 'Thread Watcher',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Thread Watcher',
+ cb: this.catalogNode
+ });
+ },
+ isWatched: function(thread) {
+ var ref;
+ return (ref = ThreadWatcher.db) != null ? ref.get({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ }) : void 0;
+ },
+ node: function() {
+ var toggler;
+ if (this.isReply) {
+ return;
+ }
+ if (this.isClone) {
+ toggler = $('.watch-thread-link', this.nodes.post);
+ } else {
+ toggler = $.el('a', {
+ href: 'javascript:;',
+ className: 'watch-thread-link'
+ });
+ $.before($('input', this.nodes.post), toggler);
+ }
+ return $.on(toggler, 'click', ThreadWatcher.cb.toggle);
+ },
+ catalogNode: function() {
+ if (ThreadWatcher.isWatched(this.thread)) {
+ $.addClass(this.nodes.root, 'watched');
+ }
+ $.on(this.nodes.thumb.parentNode, 'click', (function(_this) {
+ return function(e) {
+ if (!(e.button === 0 && e.altKey)) {
+ return;
+ }
+ ThreadWatcher.toggle(_this.thread);
+ return e.preventDefault();
+ };
+ })(this));
+ return $.on(this.nodes.thumb.parentNode, 'mousedown', function(e) {
+ if (e.button === 0 && e.altKey) {
+ return e.preventDefault();
+ }
+ });
+ },
+ ready: function() {
+ $.off(d, '4chanXInitFinished', ThreadWatcher.ready);
+ if (!Main.isThisPageLegit()) {
+ return;
+ }
+ ThreadWatcher.refresh();
+ $.add(d.body, ThreadWatcher.dialog);
+ if (!Conf['Auto Watch']) {
+ return;
+ }
+ return $.get('AutoWatch', 0, function(arg) {
+ var AutoWatch, thread;
+ AutoWatch = arg.AutoWatch;
+ if (!(thread = g.BOARD.threads[AutoWatch])) {
+ return;
+ }
+ ThreadWatcher.add(thread);
+ return $["delete"]('AutoWatch');
+ });
+ },
+ toggleWatcher: function() {
+ $.toggleClass(ThreadWatcher.shortcut, 'disabled');
+ return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden;
+ },
+ cb: {
+ openAll: function() {
+ var a, i, len, ref;
+ if ($.hasClass(this, 'disabled')) {
+ return;
+ }
+ ref = $$('a[title]', ThreadWatcher.list);
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ $.open(a.href);
+ }
+ return $.event('CloseMenu');
+ },
+ pruneDeads: function() {
+ var boardID, data, i, len, ref, ref1, threadID;
+ if ($.hasClass(this, 'disabled')) {
+ return;
+ }
+ ThreadWatcher.db.forceSync();
+ ref = ThreadWatcher.getAll();
+ for (i = 0, len = ref.length; i < len; i++) {
+ ref1 = ref[i], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
+ if (!data.isDead) {
+ continue;
+ }
+ delete ThreadWatcher.db.data.boards[boardID][threadID];
+ ThreadWatcher.db.deleteIfEmpty({
+ boardID: boardID
+ });
+ }
+ ThreadWatcher.db.save();
+ ThreadWatcher.refresh();
+ return $.event('CloseMenu');
+ },
+ toggle: function() {
+ var thread;
+ thread = Get.postFromNode(this).thread;
+ Index.followedThreadID = thread.ID;
+ ThreadWatcher.toggle(thread);
+ return delete Index.followedThreadID;
+ },
+ rm: function() {
+ var boardID, ref, threadID;
+ ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1];
+ return ThreadWatcher.rm(boardID, +threadID);
+ },
+ post: function(e) {
+ var boardID, postID, ref, threadID;
+ ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ if (postID === threadID) {
+ if (Conf['Auto Watch']) {
+ return $.set('AutoWatch', threadID);
+ }
+ } else if (Conf['Auto Watch Reply']) {
+ return ThreadWatcher.add(g.threads[boardID + '.' + threadID]);
+ }
+ },
+ onIndexRefresh: function() {
+ var boardID, data, db, ref, threadID;
+ db = ThreadWatcher.db;
+ boardID = g.BOARD.ID;
+ db.forceSync();
+ ref = db.data.boards[boardID];
+ for (threadID in ref) {
+ data = ref[threadID];
+ if (!(data != null ? data.isDead : void 0) && !(threadID in g.BOARD.threads)) {
+ if (Conf['Auto Prune'] || !(data && typeof data === 'object')) {
+ db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ } else {
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
+ ThreadWatcher.fetchStatus({
+ boardID: boardID,
+ threadID: threadID,
+ data: data
+ });
+ }
+ data.isDead = true;
+ db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ }
+ }
+ }
+ return ThreadWatcher.refresh();
+ },
+ onThreadRefresh: function(e) {
+ var thread;
+ thread = g.threads[e.detail.threadID];
+ if (!(e.detail[404] && ThreadWatcher.db.get({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ }))) {
+ return;
+ }
+ return ThreadWatcher.add(thread);
+ }
+ },
+ requests: [],
+ fetched: 0,
+ clearRequests: function() {
+ ThreadWatcher.requests = [];
+ ThreadWatcher.fetched = 0;
+ ThreadWatcher.status.textContent = '';
+ return $.rmClass(ThreadWatcher.refreshButton, 'fa-spin');
+ },
+ abort: function() {
+ var i, len, ref, req;
+ ref = ThreadWatcher.requests;
+ for (i = 0, len = ref.length; i < len; i++) {
+ req = ref[i];
+ if (req.readyState !== 4) {
+ req.abort();
+ }
+ }
+ return ThreadWatcher.clearRequests();
+ },
+ fetchAuto: function() {
+ var db, interval, now;
+ clearTimeout(ThreadWatcher.timeout);
+ if (!Conf['Auto Update Thread Watcher']) {
+ return;
+ }
+ db = ThreadWatcher.db;
+ interval = ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] ? 5 * $.MINUTE : 2 * $.HOUR;
+ now = Date.now();
+ if (now >= (db.data.lastChecked || 0) + interval) {
+ db.data.lastChecked = now;
+ ThreadWatcher.fetchAllStatus();
+ db.save();
+ }
+ return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);
+ },
+ buttonFetchAll: function() {
+ if (ThreadWatcher.requests.length) {
+ return ThreadWatcher.abort();
+ } else {
+ return ThreadWatcher.fetchAllStatus();
+ }
+ },
+ fetchAllStatus: function() {
+ var i, len, ref, thread, threads;
+ ThreadWatcher.db.forceSync();
+ ThreadWatcher.unreaddb.forceSync();
+ if ((ref = QuoteYou.db) != null) {
+ ref.forceSync();
+ }
+ if (!(threads = ThreadWatcher.getAll()).length) {
+ return;
+ }
+ for (i = 0, len = threads.length; i < len; i++) {
+ thread = threads[i];
+ ThreadWatcher.fetchStatus(thread);
+ }
+ },
+ fetchStatus: function(thread, force) {
+ var boardID, data, req, threadID;
+ boardID = thread.boardID, threadID = thread.threadID, data = thread.data;
+ if (data.isDead && !force) {
+ return;
+ }
+ if (ThreadWatcher.requests.length === 0) {
+ ThreadWatcher.status.textContent = '...';
+ $.addClass(ThreadWatcher.refreshButton, 'fa-spin');
+ }
+ req = $.ajax("//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json", {
+ onloadend: function() {
+ return ThreadWatcher.parseStatus.call(this, thread);
+ },
+ timeout: $.MINUTE
+ }, {
+ whenModified: force ? false : 'ThreadWatcher'
+ });
+ return ThreadWatcher.requests.push(req);
+ },
+ parseStatus: function(arg) {
+ var boardID, data, i, isDead, lastReadPost, len, match, postObj, quotesYou, quotingYou, ref, ref1, regexp, threadID, unread;
+ boardID = arg.boardID, threadID = arg.threadID, data = arg.data;
+ ThreadWatcher.fetched++;
+ if (ThreadWatcher.fetched === ThreadWatcher.requests.length) {
+ ThreadWatcher.clearRequests();
+ } else {
+ ThreadWatcher.status.textContent = (Math.round(ThreadWatcher.fetched / ThreadWatcher.requests.length * 100)) + "%";
+ }
+ if (this.status === 200 && this.response) {
+ isDead = !!this.response.posts[0].archived;
+ if (isDead && Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ ThreadWatcher.refresh();
+ return;
+ }
+ lastReadPost = ThreadWatcher.unreaddb.get({
+ boardID: boardID,
+ threadID: threadID,
+ defaultValue: 0
+ });
+ unread = quotingYou = 0;
+ ref = this.response.posts;
+ for (i = 0, len = ref.length; i < len; i++) {
+ postObj = ref[i];
+ if (!(postObj.no > lastReadPost)) {
+ continue;
+ }
+ if ((ref1 = QuoteYou.db) != null ? ref1.get({
+ boardID: boardID,
+ threadID: threadID,
+ postID: postObj.no
+ }) : void 0) {
+ continue;
+ }
+ unread++;
+ if (!(QuoteYou.db && postObj.com)) {
+ continue;
+ }
+ quotesYou = false;
+ regexp = /
]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g;
+ while (match = regexp.exec(postObj.com)) {
+ if (QuoteYou.db.get({
+ boardID: match[1] || boardID,
+ threadID: match[2] || threadID,
+ postID: match[3] || match[2] || threadID
+ })) {
+ quotesYou = true;
+ break;
+ }
+ }
+ if (quotesYou && !Filter.isHidden(Build.parseJSON(postObj, boardID))) {
+ quotingYou++;
+ }
+ }
+ if (isDead !== data.isDead || unread !== data.unread || quotingYou !== data.quotingYou) {
+ data.isDead = isDead;
+ data.unread = unread;
+ data.quotingYou = quotingYou;
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ return ThreadWatcher.refresh();
+ }
+ } else if (this.status === 404) {
+ if (Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ } else {
+ data.isDead = true;
+ delete data.unread;
+ delete data.quotingYou;
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ }
+ return ThreadWatcher.refresh();
+ }
+ },
+ getAll: function() {
+ var all, boardID, data, ref, threadID, threads;
+ all = [];
+ ref = ThreadWatcher.db.data.boards;
+ for (boardID in ref) {
+ threads = ref[boardID];
+ if (Conf['Current Board'] && boardID !== g.BOARD.ID) {
+ continue;
+ }
+ for (threadID in threads) {
+ data = threads[threadID];
+ if (data && typeof data === 'object') {
+ all.push({
+ boardID: boardID,
+ threadID: threadID,
+ data: data
+ });
+ }
+ }
+ }
+ return all;
+ },
+ makeLine: function(boardID, threadID, data) {
+ var count, div, fullID, link, title, x;
+ x = $.el('a', {
+ className: 'fa fa-times',
+ href: 'javascript:;'
+ });
+ $.on(x, 'click', ThreadWatcher.cb.rm);
+ link = $.el('a', {
+ href: "/" + boardID + "/thread/" + threadID,
+ title: data.excerpt,
+ className: 'watcher-link'
+ });
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) {
+ count = $.el('span', {
+ textContent: "(" + data.unread + ")",
+ className: 'watcher-unread'
+ });
+ $.add(link, count);
+ }
+ title = $.el('span', {
+ textContent: data.excerpt,
+ className: 'watcher-title'
+ });
+ $.add(link, title);
+ div = $.el('div');
+ fullID = boardID + "." + threadID;
+ div.dataset.fullID = fullID;
+ if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) {
+ $.addClass(div, 'current');
+ }
+ if (data.isDead) {
+ $.addClass(div, 'dead-thread');
+ }
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
+ if (data.unread === 0) {
+ $.addClass(div, 'replies-read');
+ }
+ if (data.unread) {
+ $.addClass(div, 'replies-unread');
+ }
+ if (data.quotingYou) {
+ $.addClass(div, 'replies-quoting-you');
+ }
+ }
+ $.add(div, [x, $.tn(' '), link]);
+ return div;
+ },
+ refresh: function() {
+ var boardID, data, i, j, len, len1, list, nodes, ref, ref1, ref2, refresher, threadID;
+ nodes = [];
+ ref = ThreadWatcher.getAll();
+ for (i = 0, len = ref.length; i < len; i++) {
+ ref1 = ref[i], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
+ nodes.push(ThreadWatcher.makeLine(boardID, threadID, data));
+ }
+ list = ThreadWatcher.list;
+ $.rmAll(list);
+ $.add(list, nodes);
+ g.threads.forEach(function(thread) {
+ var helper, j, len1, post, ref2, toggler;
+ helper = ThreadWatcher.isWatched(thread) ? ['addClass', 'Unwatch'] : ['rmClass', 'Watch'];
+ if (thread.OP) {
+ ref2 = [thread.OP].concat(slice.call(thread.OP.clones));
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ post = ref2[j];
+ toggler = $('.watch-thread-link', post.nodes.post);
+ $[helper[0]](toggler, 'watched');
+ toggler.title = helper[1] + " Thread";
+ }
+ }
+ if (thread.catalogView) {
+ return $[helper[0]](thread.catalogView.nodes.root, 'watched');
+ }
+ });
+ ThreadWatcher.refreshIcon();
+ ref2 = ThreadWatcher.menu.refreshers;
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ refresher = ref2[j];
+ refresher();
+ }
+ if (Index.nodes && Conf['Pin Watched Threads']) {
+ Index.sort();
+ return Index.buildIndex();
+ }
+ },
+ refreshIcon: function() {
+ var className, i, len, ref;
+ ref = ['replies-unread', 'replies-quoting-you'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ className = ref[i];
+ ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog));
+ }
+ },
+ update: function(boardID, threadID, newData) {
+ var data, key, line, n, newLine, ref, val;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
+ boardID: boardID,
+ threadID: threadID
+ }) : void 0)) {
+ return;
+ }
+ if (newData.isDead && Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ ThreadWatcher.refresh();
+ return;
+ }
+ n = 0;
+ for (key in newData) {
+ val = newData[key];
+ if (data[key] !== val) {
+ n++;
+ }
+ }
+ if (!n) {
+ return;
+ }
+ ThreadWatcher.db.forceSync();
+ if (!(data = ThreadWatcher.db.get({
+ boardID: boardID,
+ threadID: threadID
+ }))) {
+ return;
+ }
+ $.extend(data, newData);
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ if (line = $("#watched-threads > [data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog)) {
+ newLine = ThreadWatcher.makeLine(boardID, threadID, data);
+ $.replace(line, newLine);
+ return ThreadWatcher.refreshIcon();
+ } else {
+ return ThreadWatcher.refresh();
+ }
+ },
+ set404: function(boardID, threadID, cb) {
+ var data, ref;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
+ boardID: boardID,
+ threadID: threadID
+ }) : void 0)) {
+ return cb();
+ }
+ if (Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ return cb();
+ }
+ if (data.isDead && !((data.unread != null) || (data.quotingYou != null))) {
+ return cb();
+ }
+ data.isDead = true;
+ delete data.unread;
+ delete data.quotingYou;
+ return ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ }, cb);
+ },
+ toggle: function(thread) {
+ var boardID, threadID;
+ boardID = thread.board.ID;
+ threadID = thread.ID;
+ if (ThreadWatcher.db.get({
+ boardID: boardID,
+ threadID: threadID
+ })) {
+ return ThreadWatcher.rm(boardID, threadID);
+ } else {
+ return ThreadWatcher.add(thread);
+ }
+ },
+ add: function(thread) {
+ var boardID, data, threadID;
+ data = {};
+ boardID = thread.board.ID;
+ threadID = thread.ID;
+ if (thread.isDead) {
+ if (Conf['Auto Prune'] && ThreadWatcher.db.get({
+ boardID: boardID,
+ threadID: threadID
+ })) {
+ ThreadWatcher.rm(boardID, threadID);
+ return;
+ }
+ data.isDead = true;
+ }
+ data.excerpt = Get.threadExcerpt(thread);
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ ThreadWatcher.refresh();
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
+ return ThreadWatcher.fetchStatus({
+ boardID: boardID,
+ threadID: threadID,
+ data: data
+ }, true);
+ }
+ },
+ rm: function(boardID, threadID) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ return ThreadWatcher.refresh();
+ },
+ menu: {
+ refreshers: [],
+ init: function() {
+ var menu;
+ if (!Conf['Thread Watcher']) {
+ return;
+ }
+ menu = this.menu = new UI.Menu('thread watcher');
+ $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) {
+ return menu.toggle(e, this, ThreadWatcher);
+ });
+ this.addHeaderMenuEntry();
+ return this.addMenuEntries();
+ },
+ addHeaderMenuEntry: function() {
+ var entryEl;
+ if (g.VIEW !== 'thread') {
+ return;
+ }
+ entryEl = $.el('a', {
+ href: 'javascript:;'
+ });
+ Header.menu.addEntry({
+ el: entryEl,
+ order: 60
+ });
+ $.on(entryEl, 'click', function() {
+ return ThreadWatcher.toggle(g.threads[g.BOARD + "." + g.THREADID]);
+ });
+ return this.refreshers.push(function() {
+ var addClass, ref, rmClass, text;
+ ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = ref[0], rmClass = ref[1], text = ref[2];
+ $.addClass(entryEl, addClass);
+ $.rmClass(entryEl, rmClass);
+ return entryEl.textContent = text;
+ });
+ },
+ addMenuEntries: function() {
+ var cb, conf, entries, entry, i, len, name, ref, ref1, refresh, subEntries;
+ entries = [];
+ entries.push({
+ cb: ThreadWatcher.cb.openAll,
+ entry: {
+ el: $.el('a', {
+ textContent: 'Open all threads'
+ })
+ },
+ refresh: function() {
+ return (ThreadWatcher.list.firstElementChild ? $.rmClass : $.addClass)(this.el, 'disabled');
+ }
+ });
+ entries.push({
+ cb: ThreadWatcher.cb.pruneDeads,
+ entry: {
+ el: $.el('a', {
+ textContent: 'Prune dead threads'
+ })
+ },
+ refresh: function() {
+ return ($('.dead-thread', ThreadWatcher.list) ? $.rmClass : $.addClass)(this.el, 'disabled');
+ }
+ });
+ subEntries = [];
+ ref = Config.threadWatcher;
+ for (name in ref) {
+ conf = ref[name];
+ subEntries.push(this.createSubEntry(name, conf[1]));
+ }
+ entries.push({
+ entry: {
+ el: $.el('span', {
+ textContent: 'Settings'
+ }),
+ subEntries: subEntries
+ }
+ });
+ for (i = 0, len = entries.length; i < len; i++) {
+ ref1 = entries[i], entry = ref1.entry, cb = ref1.cb, refresh = ref1.refresh;
+ if (entry.el.nodeName === 'A') {
+ entry.el.href = 'javascript:;';
+ }
+ if (cb) {
+ $.on(entry.el, 'click', cb);
+ }
+ if (refresh) {
+ this.refreshers.push(refresh.bind(entry));
+ }
+ this.menu.addEntry(entry);
+ }
+ },
+ createSubEntry: function(name, desc) {
+ var entry, input;
+ entry = {
+ type: 'thread watcher',
+ el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
+ };
+ entry.el.title = desc;
+ input = entry.el.firstElementChild;
+ if (name === 'Show Unread Count' && !ThreadWatcher.unreadEnabled) {
+ input.disabled = true;
+ $.addClass(entry.el, 'disabled');
+ entry.el.title += '\n[Remember Last Read Post is disabled.]';
+ }
+ $.on(input, 'change', $.cb.checked);
+ if (name === 'Current Board' || name === 'Show Unread Count') {
+ $.on(input, 'change', ThreadWatcher.refresh);
+ }
+ if (name === 'Show Unread Count' || name === 'Auto Update Thread Watcher') {
+ $.on(input, 'change', ThreadWatcher.fetchAuto);
+ }
+ return entry;
+ }
+ }
+ };
+
+ return ThreadWatcher;
+
+}).call(this);
+
+Unread = (function() {
+ var Unread;
+
+ Unread = {
+ init: function() {
+ if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Remember Last Read Post'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) {
+ return;
+ }
+ if (Conf['Remember Last Read Post']) {
+ $.sync('Remember Last Read Post', function(enabled) {
+ return Conf['Remember Last Read Post'] = enabled;
+ });
+ this.db = new DataBoard('lastReadPosts', this.sync);
+ }
+ this.hr = $.el('hr', {
+ id: 'unread-line'
+ });
+ this.posts = new Set();
+ this.postsQuotingYou = new Set();
+ this.order = new RandomAccessList();
+ this.position = null;
+ Callbacks.Thread.push({
+ name: 'Unread',
+ cb: this.node
+ });
+ return Callbacks.Post.push({
+ name: 'Unread',
+ cb: this.addPost
+ });
+ },
+ node: function() {
+ var ID, j, len, ref, ref1;
+ Unread.thread = this;
+ Unread.title = d.title;
+ Unread.lastReadPost = ((ref = Unread.db) != null ? ref.get({
+ boardID: this.board.ID,
+ threadID: this.ID
+ }) : void 0) || 0;
+ Unread.readCount = 0;
+ ref1 = this.posts.keys;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ ID = ref1[j];
+ if (+ID <= Unread.lastReadPost) {
+ Unread.readCount++;
+ }
+ }
+ $.one(d, '4chanXInitFinished', Unread.ready);
+ return $.on(d, 'ThreadUpdate', Unread.onUpdate);
+ },
+ ready: function() {
+ if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) {
+ Unread.scroll();
+ }
+ Unread.setLine(true);
+ Unread.read();
+ Unread.update();
+ $.on(d, 'scroll visibilitychange', Unread.read);
+ if (Conf['Unread Line']) {
+ return $.on(d, 'visibilitychange', Unread.setLine);
+ }
+ },
+ positionPrev: function() {
+ if (Unread.position) {
+ return Unread.position.prev;
+ } else {
+ return Unread.order.last;
+ }
+ },
+ scroll: function() {
+ var hash, position, ref, root;
+ if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
+ return;
+ }
+ ReplyPruning.showIfHidden((ref = Unread.position) != null ? ref.data.nodes.root.id : void 0);
+ position = Unread.positionPrev();
+ while (position) {
+ root = position.data.nodes.root;
+ if (!root.getBoundingClientRect().height) {
+ position = position.prev;
+ } else {
+ Header.scrollToIfNeeded(root, true);
+ break;
+ }
+ }
+ },
+ sync: function() {
+ var ID, i, j, lastReadPost, postIDs, ref, ref1;
+ if (Unread.lastReadPost == null) {
+ return;
+ }
+ lastReadPost = Unread.db.get({
+ boardID: Unread.thread.board.ID,
+ threadID: Unread.thread.ID,
+ defaultValue: 0
+ });
+ if (!(Unread.lastReadPost < lastReadPost)) {
+ return;
+ }
+ Unread.lastReadPost = lastReadPost;
+ postIDs = Unread.thread.posts.keys;
+ for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) {
+ ID = +postIDs[i];
+ if (!Unread.thread.posts[ID].isFetchedQuote) {
+ if (ID > Unread.lastReadPost) {
+ break;
+ }
+ Unread.posts["delete"](ID);
+ Unread.postsQuotingYou["delete"](ID);
+ }
+ Unread.readCount++;
+ }
+ Unread.updatePosition();
+ Unread.setLine();
+ return Unread.update();
+ },
+ addPost: function() {
+ var ref;
+ if (this.isFetchedQuote || this.isClone) {
+ return;
+ }
+ Unread.order.push(this);
+ if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QuoteYou.db) != null ? ref.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ }) : void 0)) {
+ return;
+ }
+ Unread.posts.add(this.ID);
+ Unread.addPostQuotingYou(this);
+ return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
+ },
+ addPostQuotingYou: function(post) {
+ var j, len, quotelink, ref, ref1;
+ ref = post.nodes.quotelinks;
+ for (j = 0, len = ref.length; j < len; j++) {
+ quotelink = ref[j];
+ if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
+ continue;
+ }
+ Unread.postsQuotingYou.add(post.ID);
+ Unread.openNotification(post);
+ return;
+ }
+ },
+ openNotification: function(post) {
+ var notif;
+ if (!Header.areNotificationsEnabled) {
+ return;
+ }
+ try {
+ notif = new Notification(post.info.nameBlock + " replied to you", {
+ body: post.info.commentDisplay,
+ icon: Favicon.logo
+ });
+ notif.onclick = function() {
+ Header.scrollToIfNeeded(post.nodes.root, true);
+ return $.global(function() {
+ return window.focus();
+ });
+ };
+ return notif.onshow = function() {
+ return setTimeout(function() {
+ return notif.close();
+ }, 7 * $.SECOND);
+ };
+ } catch (_error) {}
+ },
+ onUpdate: function(e) {
+ if (!e.detail[404]) {
+ Unread.setLine();
+ Unread.read();
+ }
+ return Unread.update();
+ },
+ readSinglePost: function(post) {
+ var ID;
+ ID = post.ID;
+ if (!Unread.posts.has(ID)) {
+ return;
+ }
+ Unread.posts["delete"](ID);
+ Unread.postsQuotingYou["delete"](ID);
+ Unread.updatePosition();
+ Unread.saveLastReadPost();
+ return Unread.update();
+ },
+ read: $.debounce(100, function(e) {
+ var ID, count, data, ref, ref1, root;
+ if (!Unread.posts.size && Unread.readCount !== Unread.thread.posts.keys.length) {
+ Unread.saveLastReadPost();
+ }
+ if (d.hidden || !Unread.posts.size) {
+ return;
+ }
+ count = 0;
+ while (Unread.position) {
+ ref = Unread.position, ID = ref.ID, data = ref.data;
+ root = data.nodes.root;
+ if (!(!root.getBoundingClientRect().height || Header.getBottomOf(root) > -1)) {
+ break;
+ }
+ count++;
+ Unread.posts["delete"](ID);
+ Unread.postsQuotingYou["delete"](ID);
+ if ((ref1 = QuoteYou.db) != null ? ref1.get({
+ boardID: data.board.ID,
+ threadID: data.thread.ID,
+ postID: ID
+ }) : void 0) {
+ QuoteYou.lastRead = root;
+ }
+ Unread.position = Unread.position.next;
+ }
+ if (!count) {
+ return;
+ }
+ Unread.updatePosition();
+ Unread.saveLastReadPost();
+ if (e) {
+ return Unread.update();
+ }
+ }),
+ updatePosition: function() {
+ while (Unread.position && !Unread.posts.has(Unread.position.ID)) {
+ Unread.position = Unread.position.next;
+ }
+ },
+ saveLastReadPost: $.debounce(2 * $.SECOND, function() {
+ var ID, i, j, postIDs, ref, ref1;
+ $.forceSync('Remember Last Read Post');
+ if (!(Conf['Remember Last Read Post'] && Unread.db)) {
+ return;
+ }
+ postIDs = Unread.thread.posts.keys;
+ for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) {
+ ID = +postIDs[i];
+ if (!Unread.thread.posts[ID].isFetchedQuote) {
+ if (Unread.posts.has(ID)) {
+ break;
+ }
+ Unread.lastReadPost = ID;
+ }
+ Unread.readCount++;
+ }
+ if (Unread.thread.isDead && !Unread.thread.isArchived) {
+ return;
+ }
+ Unread.db.forceSync();
+ return Unread.db.set({
+ boardID: Unread.thread.board.ID,
+ threadID: Unread.thread.ID,
+ val: Unread.lastReadPost
+ });
+ }),
+ setLine: function(force) {
+ if (!Conf['Unread Line']) {
+ return;
+ }
+ if (Unread.hr.hidden || d.hidden || (force === true)) {
+ if ((Unread.linePosition = Unread.positionPrev())) {
+ $.after(Unread.linePosition.data.nodes.root, Unread.hr);
+ } else {
+ $.rm(Unread.hr);
+ }
+ }
+ return Unread.hr.hidden = Unread.linePosition === Unread.order.last;
+ },
+ update: function() {
+ var count, countQuotingYou, isDead, titleCount, titleDead, titleQuotingYou;
+ count = Unread.posts.size;
+ countQuotingYou = Unread.postsQuotingYou.size;
+ if (Conf['Unread Count']) {
+ titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : '';
+ titleCount = count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '';
+ titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title;
+ d.title = "" + titleQuotingYou + titleCount + titleDead;
+ }
+ $.forceSync('Remember Last Read Post');
+ if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) {
+ ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, {
+ isDead: Unread.thread.isDead,
+ unread: count,
+ quotingYou: countQuotingYou
+ });
+ }
+ if (Conf['Unread Favicon']) {
+ isDead = Unread.thread.isDead;
+ Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default'];
+ return $.add(d.head, Favicon.el);
+ }
+ }
+ };
+
+ return Unread;
+
+}).call(this);
+
+Captcha = {};
+
+(function() {
+ Captcha.fixes = {
+ imageKeys: '789456123uiojklm'.split('').concat(['Comma', 'Period']),
+ imageKeys16: '7890uiopjkl'.split('').concat(['Semicolon', 'm', 'Comma', 'Period', 'Slash']),
+ css: '.rc-imageselect-target > div:focus, .rc-image-tile-target:focus {\n outline: 2px solid #4a90e2;\n}\n.rc-imageselect-target td:focus {\n box-shadow: inset 0 0 0 2px #4a90e2;\n outline: none;\n}\n.rc-button-default:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}',
+ cssNoscript: '.fbc-payload-imageselect {\n position: relative;\n}\n.fbc-payload-imageselect > label {\n position: absolute;\n display: block;\n height: 93.3px;\n width: 93.3px;\n}\nlabel[data-row="0"] {top: 0px;}\nlabel[data-row="1"] {top: 93.3px;}\nlabel[data-row="2"] {top: 186.6px;}\nlabel[data-col="0"] {left: 0px;}\nlabel[data-col="1"] {left: 93.3px;}\nlabel[data-col="2"] {left: 186.6px;}\n.fbc-payload-imageselect > input:focus + label {\n outline: 2px solid #4a90e2;\n}\n.fbc-button-verify input:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}\nbody.focus .fbc {\n box-shadow: inset 0 0 0 2px #4a90e2;\n}',
+ init: function() {
+ switch (location.pathname.split('/')[3]) {
+ case 'anchor':
+ return this.initMain();
+ case 'frame':
+ return this.initPopup();
+ case 'fallback':
+ return this.initNoscript();
+ }
+ },
+ initMain: function() {
+ var a, j, len, ref;
+ $.onExists(d.body, '#recaptcha-anchor', function(checkbox) {
+ var focus;
+ focus = function() {
+ var ref;
+ if (d.hasFocus() && ((ref = d.activeElement) === d.documentElement || ref === d.body)) {
+ return checkbox.focus();
+ }
+ };
+ focus();
+ return $.on(window, 'focus', function() {
+ return $.queueTask(focus);
+ });
+ });
+ ref = $$('.rc-anchor-pt a');
+ for (j = 0, len = ref.length; j < len; j++) {
+ a = ref[j];
+ a.tabIndex = -1;
+ }
+ },
+ initPopup: function() {
+ $.addStyle(this.css);
+ this.fixImages();
+ new MutationObserver((function(_this) {
+ return function() {
+ return _this.fixImages();
+ };
+ })(this)).observe(d.body, {
+ childList: true,
+ subtree: true
+ });
+ return $.on(d, 'keydown', this.keybinds.bind(this));
+ },
+ initNoscript: function() {
+ var data, ref, token;
+ this.noscript = true;
+ data = (token = (ref = $('.fbc-verification-token > textarea')) != null ? ref.value : void 0) ? {
+ token: token
+ } : {
+ working: true
+ };
+ new Connection(window.parent, '*').send(data);
+ d.body.classList.toggle('focus', d.hasFocus());
+ $.on(window, 'focus blur', function() {
+ return d.body.classList.toggle('focus', d.hasFocus());
+ });
+ this.images = $$('.fbc-payload-imageselect > input');
+ this.width = 3;
+ if (this.images.length !== 9) {
+ return;
+ }
+ $.addStyle(this.cssNoscript);
+ this.addLabels();
+ $.on(d, 'keydown', this.keybinds.bind(this));
+ return $.on($('.fbc-imageselect-challenge > form'), 'submit', this.checkForm.bind(this));
+ },
+ fixImages: function() {
+ var img, j, len, ref;
+ this.images = $$('.rc-image-tile-target');
+ if (!this.images.length) {
+ this.images = $$('.rc-imageselect-target > div, .rc-imageselect-target td');
+ }
+ this.width = $$('.rc-imageselect-target tr:first-of-type td').length || Math.round(Math.sqrt(this.images.length));
+ ref = this.images;
+ for (j = 0, len = ref.length; j < len; j++) {
+ img = ref[j];
+ img.tabIndex = 0;
+ }
+ if (this.images.length === 9) {
+ this.addTooltips(this.images);
+ } else {
+ this.addTooltips16(this.images);
+ }
+ return this.complaintLinks();
+ },
+ complaintLinks: function() {
+ var errmsg, j, len, link, ref;
+ ref = $$('.rc-imageselect-incorrect-response, .rc-imageselect-error-select-one, .rc-imageselect-error-select-more, .rc-imageselect-error-dynamic-more');
+ for (j = 0, len = ref.length; j < len; j++) {
+ errmsg = ref[j];
+ if (!$('a', errmsg)) {
+ link = $.el('a', {
+ href: 'https://www.4chan-x.net/captchas.html',
+ target: '_blank',
+ textContent: '[complain]'
+ });
+ $.add(errmsg, [$.tn(' '), link]);
+ }
+ }
+ },
+ addLabels: function() {
+ var checkbox, i, imageSelect, label, labels;
+ imageSelect = $('.fbc-payload-imageselect');
+ labels = (function() {
+ var j, len, ref, results;
+ ref = this.images;
+ results = [];
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ checkbox = ref[i];
+ checkbox.id = "checkbox-" + i;
+ label = $.el('label', {
+ htmlFor: checkbox.id
+ });
+ label.dataset.row = Math.floor(i / 3);
+ label.dataset.col = i % 3;
+ $.after(checkbox, label);
+ results.push(label);
+ }
+ return results;
+ }).call(this);
+ return this.addTooltips(labels);
+ },
+ addTooltips: function(nodes) {
+ var i, j, len, node;
+ for (i = j = 0, len = nodes.length; j < len; i = ++j) {
+ node = nodes[i];
+ node.title = this.imageKeys[i] + " or " + (this.imageKeys[i + 9][0].toUpperCase()) + this.imageKeys[i + 9].slice(1);
+ }
+ },
+ addTooltips16: function(nodes) {
+ var i, j, key, len, node, ref;
+ ref = this.imageKeys16;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ key = ref[i];
+ if (i % 4 < this.width && (node = nodes[nodes.length - (4 - Math.floor(i / 4)) * this.width + (i % 4)])) {
+ node.title = "" + (key[0].toUpperCase()) + key.slice(1);
+ }
+ }
+ },
+ checkForm: function(e) {
+ var checkbox, j, len, n, ref;
+ n = 0;
+ ref = this.images;
+ for (j = 0, len = ref.length; j < len; j++) {
+ checkbox = ref[j];
+ if (checkbox.checked) {
+ n++;
+ }
+ }
+ if (n === 0) {
+ return e.preventDefault();
+ }
+ },
+ keybinds: function(e) {
+ var dx, i, img, key, last, n, reload, verify, w, x;
+ if (!(this.images && doc.contains(this.images[0]))) {
+ return;
+ }
+ n = this.images.length;
+ w = this.width;
+ last = n + w - 1;
+ reload = $('#recaptcha-reload-button, .fbc-button-reload');
+ verify = $('#recaptcha-verify-button, .fbc-button-verify > input');
+ x = this.images.indexOf(d.activeElement);
+ if (x < 0) {
+ x = d.activeElement === verify ? last : n;
+ }
+ key = Keybinds.keyCode(e);
+ if (!this.noscript && key === 'Space' && x < n) {
+ this.images[x].click();
+ } else if (n === 9 && (i = this.imageKeys.indexOf(key)) >= 0) {
+ this.images[i % 9].click();
+ verify.focus();
+ } else if (n !== 9 && (i = this.imageKeys16.indexOf(key)) >= 0 && i % 4 < w && (img = this.images[n - (4 - Math.floor(i / 4)) * w + (i % 4)])) {
+ img.click();
+ verify.focus();
+ } else if (dx = {
+ 'Up': n,
+ 'Down': w,
+ 'Left': last,
+ 'Right': 1
+ }[key]) {
+ x = (x + dx) % (n + w);
+ if ((n < x && x < last)) {
+ x = dx === last ? n : last;
+ }
+ (this.images[x] || (x === n ? reload : void 0) || (x === last ? verify : void 0)).focus();
+ } else {
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ }
+ };
+
+}).call(this);
+
+(function() {
+ Captcha.replace = {
+ init: function() {
+ if (!(d.cookie.indexOf('pass_enabled=1') < 0)) {
+ return;
+ }
+ if (location.hostname === 'sys.4chan.org' && /[?&]altc\b/.test(location.search) && Main.jsEnabled) {
+ $.onExists(doc, 'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', function() {
+ $.global(function() {
+ return window.el.onload = null;
+ });
+ return Captcha.v1.create();
+ });
+ return;
+ }
+ if (((Conf['Use Recaptcha v1'] && location.hostname === 'boards.4chan.org') || (Conf['Use Recaptcha v1 in Reports'] && location.hostname === 'sys.4chan.org')) && Main.jsEnabled) {
+ $.ready(Captcha.replace.v1);
+ return;
+ }
+ if (Conf['Force Noscript Captcha'] && Main.jsEnabled) {
+ $.ready(Captcha.replace.noscript);
+ return;
+ }
+ if (Conf['captchaLanguage'].trim() || Conf['Captcha Fixes']) {
+ if (location.hostname === 'boards.4chan.org') {
+ return $.onExists(doc, '#captchaFormPart', function(node) {
+ return $.onExists(node, 'iframe', Captcha.replace.iframe);
+ });
+ } else {
+ return $.onExists(doc, 'iframe', Captcha.replace.iframe);
+ }
+ }
+ },
+ noscript: function() {
+ var insert, noscript, original, span, toggle;
+ if (!((original = $('#g-recaptcha, #captchaContainerAlt')) && (noscript = $('noscript')))) {
+ return;
+ }
+ span = $.el('span', {
+ id: 'captcha-forced-noscript'
+ });
+ $.replace(noscript, span);
+ $.rm(original);
+ insert = function() {
+ span.innerHTML = noscript.textContent;
+ return Captcha.replace.iframe($('iframe', span));
+ };
+ if ((toggle = $('#togglePostFormLink a, #form-link'))) {
+ return $.on(toggle, 'click', insert);
+ } else {
+ return insert();
+ }
+ },
+ v1: function() {
+ var form, link;
+ if (!$.id('g-recaptcha')) {
+ return;
+ }
+ Captcha.v1.replace();
+ if ((link = $.id('form-link'))) {
+ return $.on(link, 'click', function() {
+ return Captcha.v1.create();
+ });
+ } else if (location.hostname === 'boards.4chan.org') {
+ form = $.id('postForm');
+ return form.addEventListener('focus', (function() {
+ return Captcha.v1.create();
+ }), true);
+ } else {
+ return Captcha.v1.create();
+ }
+ },
+ iframe: function(iframe) {
+ var lang, src;
+ if ((lang = Conf['captchaLanguage'].trim())) {
+ src = /[?&]hl=/.test(iframe.src) ? iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) : iframe.src + ("&hl=" + (encodeURIComponent(lang)));
+ if (iframe.src !== src) {
+ iframe.src = src;
+ }
+ }
+ return Captcha.replace.autocopy(iframe);
+ },
+ autocopy: function(iframe) {
+ if (!(Conf['Captcha Fixes'] && /^https:\/\/www\.google\.com\/recaptcha\/api\/fallback\?/.test(iframe.src))) {
+ return;
+ }
+ return new Connection(iframe, 'https://www.google.com', {
+ working: function() {
+ var ref, ref1;
+ if ((ref = $.id('qr')) != null ? ref.contains(iframe) : void 0) {
+ return (ref1 = $('#qr .captcha-container textarea')) != null ? ref1.parentNode.hidden = true : void 0;
+ }
+ },
+ token: function(token) {
+ var node, textarea;
+ node = iframe;
+ while ((node = node.parentNode)) {
+ if ((textarea = $('textarea', node))) {
+ break;
+ }
+ }
+ textarea.value = token;
+ return $.event('input', null, textarea);
+ }
+ });
+ }
+ };
+
+}).call(this);
+
+(function() {
+ Captcha.v1 = {
+ blank: "data:image/svg+xml, ",
+ init: function() {
+ var imgContainer, input;
+ if (d.cookie.indexOf('pass_enabled=1') >= 0) {
+ return;
+ }
+ if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt'))) {
+ return;
+ }
+ imgContainer = $.el('div', {
+ className: 'captcha-img',
+ title: 'Reload reCAPTCHA'
+ });
+ $.extend(imgContainer, {
+ innerHTML: " "
+ });
+ input = $.el('input', {
+ className: 'captcha-input field',
+ title: 'Verification',
+ autocomplete: 'off',
+ spellcheck: false
+ });
+ this.nodes = {
+ img: imgContainer.firstChild,
+ input: input
+ };
+ $.on(input, 'blur', QR.focusout);
+ $.on(input, 'focus', QR.focusin);
+ $.on(input, 'keydown', QR.captcha.keydown.bind(QR.captcha));
+ $.on(this.nodes.img.parentNode, 'click', QR.captcha.reload.bind(QR.captcha));
+ $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v1');
+ $.after(QR.nodes.com.parentNode, [imgContainer, input]);
+ this.captchas = [];
+ $.get('captchas', [], function(arg) {
+ var captchas;
+ captchas = arg.captchas;
+ QR.captcha.sync(captchas);
+ return QR.captcha.clear();
+ });
+ $.sync('captchas', this.sync);
+ this.replace();
+ this.beforeSetup();
+ if (Conf['Auto-load captcha']) {
+ this.setup();
+ }
+ new MutationObserver(this.afterSetup).observe($.id('captchaContainerAlt'), {
+ childList: true
+ });
+ return this.afterSetup();
+ },
+ replace: function() {
+ var container, old;
+ if (this.script) {
+ return;
+ }
+ if (!(this.script = $('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', d.head))) {
+ this.script = $.el('script', {
+ src: '//www.google.com/recaptcha/api/js/recaptcha_ajax.js'
+ });
+ $.add(d.head, this.script);
+ }
+ if (old = $.id('g-recaptcha')) {
+ container = $.el('div', {
+ id: 'captchaContainerAlt'
+ });
+ return $.replace(old, container);
+ }
+ },
+ create: function() {
+ var cont, lang;
+ cont = $.id('captchaContainerAlt');
+ if (this.occupied) {
+ return;
+ }
+ this.occupied = true;
+ if ((lang = Conf['captchaLanguage'].trim())) {
+ cont.dataset.lang = lang;
+ }
+ $.onExists(cont, '#recaptcha_image', function(image) {
+ return $.on(image, 'click', function() {
+ if ($.id('recaptcha_challenge_image')) {
+ return $.global(function() {
+ return window.Recaptcha.reload();
+ });
+ }
+ });
+ });
+ $.onExists(cont, '#recaptcha_response_field', function(field) {
+ $.on(field, 'keydown', function(e) {
+ if (e.keyCode === 8 && !field.value) {
+ return $.global(function() {
+ return window.Recaptcha.reload();
+ });
+ }
+ });
+ if (location.hostname === 'sys.4chan.org') {
+ return field.focus();
+ }
+ });
+ return $.global(function() {
+ var container, options, script;
+ container = document.getElementById('captchaContainerAlt');
+ options = {
+ theme: 'clean',
+ tabindex: {
+ "boards.4chan.org": 5
+ }[location.hostname],
+ lang: container.dataset.lang
+ };
+ if (window.Recaptcha) {
+ return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
+ } else {
+ script = document.head.querySelector('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]');
+ return script.addEventListener('load', function() {
+ return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
+ }, false);
+ }
+ });
+ },
+ cb: {
+ focus: function() {
+ return QR.captcha.setup(false, true);
+ }
+ },
+ beforeSetup: function() {
+ var img, input, ref;
+ ref = this.nodes, img = ref.img, input = ref.input;
+ img.parentNode.hidden = true;
+ img.src = this.blank;
+ input.value = '';
+ input.placeholder = 'Focus to load reCAPTCHA';
+ this.count();
+ return $.on(input, 'focus click', this.cb.focus);
+ },
+ needed: function() {
+ var captchaCount, postsCount;
+ captchaCount = this.captchas.length;
+ if (QR.req) {
+ captchaCount++;
+ }
+ postsCount = QR.posts.length;
+ if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
+ postsCount = 0;
+ }
+ return captchaCount < postsCount;
+ },
+ onNewPost: function() {},
+ onPostChange: function() {},
+ setup: function(focus, force) {
+ if (!(this.isEnabled && (force || this.needed()))) {
+ return;
+ }
+ this.create();
+ if (focus) {
+ $.addClass(QR.nodes.el, 'focus');
+ return this.nodes.input.focus();
+ }
+ },
+ afterSetup: function() {
+ var challenge, img, input, ref, setLifetime;
+ if (!(challenge = $.id('recaptcha_challenge_field_holder'))) {
+ return;
+ }
+ if (challenge === QR.captcha.nodes.challenge) {
+ return;
+ }
+ setLifetime = function(e) {
+ return QR.captcha.lifetime = e.detail;
+ };
+ $.on(window, 'captcha:timeout', setLifetime);
+ $.global(function() {
+ return window.dispatchEvent(new CustomEvent('captcha:timeout', {
+ detail: window.RecaptchaState.timeout
+ }));
+ });
+ $.off(window, 'captcha:timeout', setLifetime);
+ ref = QR.captcha.nodes, img = ref.img, input = ref.input;
+ img.parentNode.hidden = false;
+ input.placeholder = 'Verification';
+ QR.captcha.count();
+ $.off(input, 'focus click', QR.captcha.cb.focus);
+ QR.captcha.nodes.challenge = challenge;
+ new MutationObserver(QR.captcha.load.bind(QR.captcha)).observe(challenge, {
+ childList: true,
+ subtree: true,
+ attributes: true
+ });
+ QR.captcha.load();
+ if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
+ QR.nodes.el.style.top = null;
+ return QR.nodes.el.style.bottom = '0px';
+ }
+ },
+ destroy: function() {
+ if (!this.script) {
+ return;
+ }
+ $.global(function() {
+ return window.Recaptcha.destroy();
+ });
+ delete this.occupied;
+ if (this.nodes) {
+ return this.beforeSetup();
+ }
+ },
+ sync: function(captchas) {
+ if (captchas == null) {
+ captchas = [];
+ }
+ QR.captcha.captchas = captchas;
+ return QR.captcha.count();
+ },
+ getOne: function() {
+ var captcha, challenge, response, timeout;
+ this.clear();
+ if (captcha = this.captchas.shift()) {
+ this.count();
+ $.set('captchas', this.captchas);
+ return captcha;
+ } else {
+ challenge = this.nodes.img.alt;
+ timeout = this.timeout;
+ if (/\S/.test(response = this.nodes.input.value)) {
+ this.destroy();
+ return {
+ challenge: challenge,
+ response: response,
+ timeout: timeout
+ };
+ } else {
+ return null;
+ }
+ }
+ },
+ save: function() {
+ var response;
+ if (!/\S/.test(response = this.nodes.input.value)) {
+ return;
+ }
+ this.nodes.input.value = '';
+ this.captchas.push({
+ challenge: this.nodes.img.alt,
+ response: response,
+ timeout: this.timeout
+ });
+ this.captchas.sort(function(a, b) {
+ return a.timeout - b.timeout;
+ });
+ this.count();
+ this.destroy();
+ this.setup(false, true);
+ return $.set('captchas', this.captchas);
+ },
+ clear: function() {
+ var captcha, i, j, len, now, ref;
+ if (!this.captchas.length) {
+ return;
+ }
+ $.forceSync('captchas');
+ now = Date.now();
+ ref = this.captchas;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ captcha = ref[i];
+ if (captcha.timeout > now) {
+ break;
+ }
+ }
+ if (!i) {
+ return;
+ }
+ this.captchas = this.captchas.slice(i);
+ this.count();
+ return $.set('captchas', this.captchas);
+ },
+ load: function() {
+ var challenge, challenge_image;
+ if ($('#captchaContainerAlt[class~="recaptcha_is_showing_audio"]')) {
+ this.nodes.img.src = this.blank;
+ return;
+ }
+ if (!this.nodes.challenge.firstChild) {
+ return;
+ }
+ if (!(challenge_image = $.id('recaptcha_challenge_image'))) {
+ return;
+ }
+ this.timeout = Date.now() + this.lifetime * $.SECOND - $.MINUTE;
+ challenge = this.nodes.challenge.firstChild.value;
+ this.nodes.img.alt = challenge;
+ this.nodes.img.src = challenge_image.src;
+ this.nodes.input.value = '';
+ return this.clear();
+ },
+ count: function() {
+ var count, placeholder;
+ count = this.captchas ? this.captchas.length : 0;
+ placeholder = this.nodes.input.placeholder.replace(/\ \(.*\)$/, '');
+ placeholder += (function() {
+ switch (count) {
+ case 0:
+ if (placeholder === 'Verification') {
+ return ' (Shift + Enter to cache)';
+ } else {
+ return '';
+ }
+ break;
+ case 1:
+ return ' (1 cached captcha)';
+ default:
+ return " (" + count + " cached captchas)";
+ }
+ })();
+ this.nodes.input.placeholder = placeholder;
+ this.nodes.input.alt = count;
+ clearTimeout(this.timer);
+ if (count) {
+ return this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
+ }
+ },
+ reload: function(focus) {
+ $.global(function() {
+ if (window.Recaptcha.type === 'image') {
+ window.Recaptcha.reload();
+ } else {
+ window.Recaptcha.switch_type('image');
+ }
+ return window.Recaptcha.should_focus = false;
+ });
+ if (focus) {
+ return this.nodes.input.focus();
+ }
+ },
+ keydown: function(e) {
+ if (e.keyCode === 8 && !this.nodes.input.value) {
+ this.reload();
+ } else if (e.keyCode === 13 && e.shiftKey) {
+ this.save();
+ } else {
+ return;
+ }
+ return e.preventDefault();
+ }
+ };
+
+}).call(this);
+
+(function() {
+ Captcha.v2 = {
+ lifetime: 2 * $.MINUTE,
+ init: function() {
+ var counter, root;
+ if (d.cookie.indexOf('pass_enabled=1') >= 0) {
+ return;
+ }
+ if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt, #captcha-forced-noscript'))) {
+ return;
+ }
+ if ((this.noscript = Conf['Force Noscript Captcha'] || !Main.jsEnabled)) {
+ $.addClass(QR.nodes.el, 'noscript-captcha');
+ }
+ this.captchas = [];
+ $.get('captchas', [], function(arg) {
+ var captchas;
+ captchas = arg.captchas;
+ return QR.captcha.sync(captchas);
+ });
+ $.sync('captchas', this.sync.bind(this));
+ root = $.el('div', {
+ className: 'captcha-root'
+ });
+ $.extend(root, {
+ innerHTML: ""
+ });
+ counter = $('.captcha-counter > a', root);
+ this.nodes = {
+ root: root,
+ counter: counter
+ };
+ this.count();
+ $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2');
+ $.after(QR.nodes.com.parentNode, root);
+ $.on(counter, 'click', this.toggle.bind(this));
+ $.on(counter, 'keydown', (function(_this) {
+ return function(e) {
+ if (Keybinds.keyCode(e) !== 'Space') {
+ return;
+ }
+ _this.toggle();
+ e.preventDefault();
+ return e.stopPropagation();
+ };
+ })(this));
+ return $.on(window, 'captcha:success', (function(_this) {
+ return function() {
+ return $.queueTask(function() {
+ return _this.save(false);
+ });
+ };
+ })(this));
+ },
+ timeouts: {},
+ postsCount: 0,
+ noscriptURL: function() {
+ var lang, url;
+ url = 'https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc';
+ if ((lang = Conf['captchaLanguage'].trim())) {
+ url += "&hl=" + (encodeURIComponent(lang));
+ }
+ return url;
+ },
+ needed: function() {
+ var captchaCount;
+ captchaCount = this.captchas.length;
+ if (QR.req) {
+ captchaCount++;
+ }
+ this.postsCount = QR.posts.length;
+ if (this.postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
+ this.postsCount = 0;
+ }
+ return captchaCount < this.postsCount;
+ },
+ onNewPost: function() {
+ return this.setup();
+ },
+ onPostChange: function() {
+ if (this.postsCount === 0) {
+ this.setup();
+ }
+ if (QR.posts.length === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
+ return this.postsCount = 0;
+ }
+ },
+ toggle: function() {
+ if (this.nodes.container && !this.timeouts.destroy) {
+ return this.destroy();
+ } else {
+ return this.setup(true, true);
+ }
+ },
+ setup: function(focus, force) {
+ if (!(this.isEnabled && (this.needed() || force))) {
+ return;
+ }
+ if (focus) {
+ $.addClass(QR.nodes.el, 'focus');
+ this.nodes.counter.focus();
+ }
+ if (this.timeouts.destroy) {
+ clearTimeout(this.timeouts.destroy);
+ delete this.timeouts.destroy;
+ return this.reload();
+ }
+ if (this.nodes.container) {
+ $.queueTask((function(_this) {
+ return function() {
+ var iframe;
+ if (_this.nodes.container && d.activeElement === _this.nodes.counter && (iframe = $('iframe', _this.nodes.container))) {
+ iframe.focus();
+ return QR.focus();
+ }
+ };
+ })(this));
+ return;
+ }
+ this.nodes.container = $.el('div', {
+ className: 'captcha-container'
+ });
+ $.prepend(this.nodes.root, this.nodes.container);
+ new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, {
+ childList: true,
+ subtree: true
+ });
+ if (this.noscript) {
+ return this.setupNoscript();
+ } else {
+ return this.setupJS();
+ }
+ },
+ setupNoscript: function() {
+ var div, iframe, textarea;
+ iframe = $.el('iframe', {
+ id: 'qr-captcha-iframe',
+ src: this.noscriptURL()
+ });
+ div = $.el('div');
+ textarea = $.el('textarea');
+ $.add(div, textarea);
+ return $.add(this.nodes.container, [iframe, div]);
+ },
+ setupJS: function() {
+ return $.global(function() {
+ var cbNative, render;
+ render = function() {
+ var classList, container;
+ classList = document.documentElement.classList;
+ container = document.querySelector('#qr .captcha-container');
+ return container.dataset.widgetID = window.grecaptcha.render(container, {
+ sitekey: '6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc',
+ theme: classList.contains('tomorrow') || classList.contains('dark-captcha') ? 'dark' : 'light',
+ callback: function(response) {
+ return window.dispatchEvent(new CustomEvent('captcha:success', {
+ detail: response
+ }));
+ }
+ });
+ };
+ if (window.grecaptcha) {
+ return render();
+ } else {
+ cbNative = window.onRecaptchaLoaded;
+ return window.onRecaptchaLoaded = function() {
+ render();
+ return cbNative();
+ };
+ }
+ });
+ },
+ afterSetup: function(mutations) {
+ var iframe, j, k, len, len1, mutation, node, ref, textarea;
+ for (j = 0, len = mutations.length; j < len; j++) {
+ mutation = mutations[j];
+ ref = mutation.addedNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
+ if ((iframe = $.x('./descendant-or-self::iframe', node))) {
+ this.setupIFrame(iframe);
+ }
+ if ((textarea = $.x('./descendant-or-self::textarea', node))) {
+ this.setupTextArea(textarea);
+ }
+ }
+ }
+ },
+ setupIFrame: function(iframe) {
+ if (!doc.contains(iframe)) {
+ return;
+ }
+ Captcha.replace.iframe(iframe);
+ $.addClass(QR.nodes.el, 'captcha-open');
+ this.fixQRPosition();
+ $.on(iframe, 'load', this.fixQRPosition);
+ if (d.activeElement === this.nodes.counter) {
+ iframe.focus();
+ }
+ return $.global(function() {
+ var f;
+ f = document.querySelector('#qr iframe');
+ return f.focus = f.blur = function() {};
+ });
+ },
+ fixQRPosition: function() {
+ if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
+ QR.nodes.el.style.top = null;
+ return QR.nodes.el.style.bottom = '0px';
+ }
+ },
+ setupTextArea: function(textarea) {
+ return $.one(textarea, 'input', (function(_this) {
+ return function() {
+ return _this.save(true);
+ };
+ })(this));
+ },
+ destroy: function() {
+ var garbage, i, ins, node, ref;
+ if (!this.isEnabled) {
+ return;
+ }
+ delete this.timeouts.destroy;
+ $.rmClass(QR.nodes.el, 'captcha-open');
+ if (this.nodes.container) {
+ $.rm(this.nodes.container);
+ }
+ delete this.nodes.container;
+ garbage = $.X('//iframe[starts-with(@src, "https://www.google.com/recaptcha/api2/frame")]/ancestor-or-self::*[parent::body]');
+ i = 0;
+ while (node = garbage.snapshotItem(i++)) {
+ if (((ref = (ins = node.nextSibling)) != null ? ref.nodeName : void 0) === 'INS') {
+ $.rm(ins);
+ }
+ $.rm(node);
+ }
+ },
+ sync: function(captchas) {
+ if (captchas == null) {
+ captchas = [];
+ }
+ this.captchas = captchas;
+ this.clear();
+ return this.count();
+ },
+ getOne: function() {
+ var captcha;
+ this.clear();
+ if ((captcha = this.captchas.shift())) {
+ $.set('captchas', this.captchas);
+ this.count();
+ return captcha;
+ } else {
+ return null;
+ }
+ },
+ save: function(pasted, token) {
+ var base, focus, ref;
+ $.forceSync('captchas');
+ this.captchas.push({
+ response: token || $('textarea', this.nodes.container).value,
+ timeout: Date.now() + this.lifetime
+ });
+ this.captchas.sort(function(a, b) {
+ return a.timeout - b.timeout;
+ });
+ $.set('captchas', this.captchas);
+ this.count();
+ focus = ((ref = d.activeElement) != null ? ref.nodeName : void 0) === 'IFRAME' && /https?:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src);
+ if (this.needed()) {
+ if (focus) {
+ if (QR.cooldown.auto || Conf['Post on Captcha Completion']) {
+ this.nodes.counter.focus();
+ } else {
+ QR.nodes.status.focus();
+ }
+ }
+ this.reload();
+ } else {
+ if (pasted) {
+ this.destroy();
+ } else {
+ if ((base = this.timeouts).destroy == null) {
+ base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
+ }
+ }
+ if (focus) {
+ QR.nodes.status.focus();
+ }
+ }
+ if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) {
+ return QR.submit();
+ }
+ },
+ clear: function() {
+ var captcha, i, j, len, now, ref;
+ if (!this.captchas.length) {
+ return;
+ }
+ $.forceSync('captchas');
+ now = Date.now();
+ ref = this.captchas;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ captcha = ref[i];
+ if (captcha.timeout > now) {
+ break;
+ }
+ }
+ if (!i) {
+ return;
+ }
+ this.captchas = this.captchas.slice(i);
+ this.count();
+ $.set('captchas', this.captchas);
+ return this.setup(d.activeElement === QR.nodes.status);
+ },
+ count: function() {
+ this.nodes.counter.textContent = "Captchas: " + this.captchas.length;
+ clearTimeout(this.timeouts.clear);
+ if (this.captchas.length) {
+ return this.timeouts.clear = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
+ }
+ },
+ reload: function() {
+ if ($('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) {
+ this.destroy();
+ return this.setup(false, true);
+ } else {
+ return $.global(function() {
+ var container;
+ container = document.querySelector('#qr .captcha-container');
+ return window.grecaptcha.reset(container.dataset.widgetID);
+ });
+ }
+ }
+ };
+
+}).call(this);
+
+PassLink = (function() {
+ var PassLink;
+
+ PassLink = {
+ init: function() {
+ if (!Conf['Pass Link']) {
+ return;
+ }
+ return Main.ready(this.ready);
+ },
+ ready: function() {
+ var passLink, styleSelector;
+ if (!(styleSelector = $.id('styleSelector'))) {
+ return;
+ }
+ passLink = $.el('span', {
+ className: 'brackets-wrap pass-link-container'
+ });
+ $.extend(passLink, {
+ innerHTML: " 4chan Pass "
+ });
+ $.on(passLink.firstElementChild, 'click', function() {
+ return window.open('//sys.4chan.org/auth', Date.now(), 'width=500,height=280,toolbar=0');
+ });
+ return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]);
+ }
+ };
+
+ return PassLink;
+
+}).call(this);
+
+PostSuccessful = (function() {
+ var PostSuccessful;
+
+ PostSuccessful = {
+ init: function() {
+ if (!Conf['Remember Your Posts']) {
+ return;
+ }
+ return $.ready(this.ready);
+ },
+ ready: function() {
+ var _, db, postID, ref, threadID;
+ if (d.title !== 'Post successful!') {
+ return;
+ }
+ ref = $('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref[0], threadID = ref[1], postID = ref[2];
+ postID = +postID;
+ threadID = +threadID || postID;
+ db = new DataBoard('yourPosts');
+ return db.set({
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ postID: postID,
+ val: true
+ });
+ }
+ };
+
+ return PostSuccessful;
+
+}).call(this);
+
+QR = (function() {
+ var QR,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ slice = [].slice;
+
+ QR = {
+ mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'],
+ validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i,
+ typeFromExtension: {
+ 'jpg': 'image/jpeg',
+ 'jpeg': 'image/jpeg',
+ 'png': 'image/png',
+ 'gif': 'image/gif',
+ 'pdf': 'application/pdf',
+ 'swf': 'application/vnd.adobe.flash.movie',
+ 'webm': 'video/webm'
+ },
+ extensionFromType: {
+ 'image/jpeg': 'jpg',
+ 'image/png': 'png',
+ 'image/gif': 'gif',
+ 'application/pdf': 'pdf',
+ 'application/vnd.adobe.flash.movie': 'swf',
+ 'application/x-shockwave-flash': 'swf',
+ 'video/webm': 'webm'
+ },
+ init: function() {
+ var sc, version;
+ if (!Conf['Quick Reply']) {
+ return;
+ }
+ this.posts = [];
+ if (g.VIEW === 'archive') {
+ return;
+ }
+ version = Conf['Use Recaptcha v1'] && Main.jsEnabled ? 'v1' : 'v2';
+ this.captcha = Captcha[version];
+ $.on(d, '4chanXInitFinished', this.initReady);
+ Callbacks.Post.push({
+ name: 'Quick Reply',
+ cb: this.node
+ });
+ if (Conf['QR Shortcut']) {
+ this.shortcut = sc = $.el('a', {
+ className: 'qr-shortcut fa fa-comment-o disabled',
+ textContent: 'QR',
+ title: 'Quick Reply',
+ href: 'javascript:;'
+ });
+ $.on(sc, 'click', function() {
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) {
+ QR.open();
+ return QR.nodes.com.focus();
+ } else {
+ return QR.close();
+ }
+ });
+ return Header.addShortcut(sc);
+ }
+ },
+ initReady: function() {
+ var link, linkBot, navLinksBot, origToggle;
+ $.off(d, '4chanXInitFinished', this.initReady);
+ QR.postingIsEnabled = !!$.id('postForm');
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ link = $.el('h1', {
+ className: "qr-link-container"
+ });
+ $.extend(link, {
+ innerHTML: "
" + ((g.VIEW === "thread") ? "Reply to Thread" : "Start a Thread") + " "
+ });
+ QR.link = link.firstElementChild;
+ $.on(link.firstChild, 'click', function() {
+ QR.open();
+ return QR.nodes.com.focus();
+ });
+ if (Conf['Bottom QR Link'] && g.VIEW === 'thread') {
+ linkBot = $.el('div', {
+ className: "brackets-wrap qr-link-container-bottom"
+ });
+ $.extend(linkBot, {
+ innerHTML: "
Reply to Thread "
+ });
+ $.on(linkBot.firstElementChild, 'click', function() {
+ QR.open();
+ return QR.nodes.com.focus();
+ });
+ if ((navLinksBot = $('.navLinksBot'))) {
+ $.prepend(navLinksBot, linkBot);
+ }
+ }
+ origToggle = $.id('togglePostFormLink');
+ $.before(origToggle, link);
+ origToggle.firstElementChild.textContent = 'Original Form';
+ $.on(d, 'QRGetFile', QR.getFile);
+ $.on(d, 'QRSetFile', QR.setFile);
+ $.on(d, 'paste', QR.paste);
+ $.on(d, 'dragover', QR.dragOver);
+ $.on(d, 'drop', QR.dropFile);
+ $.on(d, 'dragstart dragend', QR.drag);
+ $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
+ $.on(d, 'ThreadUpdate', QR.statusCheck);
+ if (!Conf['Persistent QR']) {
+ return;
+ }
+ QR.open();
+ if (Conf['Auto Hide QR']) {
+ return QR.hide();
+ }
+ },
+ statusCheck: function() {
+ var thread;
+ if (!QR.nodes) {
+ return;
+ }
+ thread = QR.posts[0].thread;
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
+ return QR.abort();
+ } else {
+ return QR.status();
+ }
+ },
+ node: function() {
+ $.on(this.nodes.quote, 'click', QR.quote);
+ if (this.isFetchedQuote) {
+ return QR.generatePostableThreadsList();
+ }
+ },
+ open: function() {
+ var err;
+ if (QR.nodes) {
+ if (QR.nodes.el.hidden) {
+ QR.captcha.setup();
+ }
+ QR.nodes.el.hidden = false;
+ QR.unhide();
+ } else {
+ try {
+ QR.dialog();
+ } catch (_error) {
+ err = _error;
+ delete QR.nodes;
+ Main.handleErrors({
+ message: 'Quick Reply dialog creation crashed.',
+ error: err
+ });
+ return;
+ }
+ }
+ if (Conf['QR Shortcut']) {
+ return $.rmClass(QR.shortcut, 'disabled');
+ }
+ },
+ close: function() {
+ var j, len, post, ref;
+ if (QR.req) {
+ QR.abort();
+ return;
+ }
+ QR.nodes.el.hidden = true;
+ QR.cleanNotifications();
+ d.activeElement.blur();
+ $.rmClass(QR.nodes.el, 'dump');
+ if (Conf['QR Shortcut']) {
+ $.addClass(QR.shortcut, 'disabled');
+ }
+ new QR.post(true);
+ ref = QR.posts.splice(0, QR.posts.length - 1);
+ for (j = 0, len = ref.length; j < len; j++) {
+ post = ref[j];
+ post["delete"]();
+ }
+ QR.cooldown.auto = false;
+ QR.status();
+ return QR.captcha.destroy();
+ },
+ focus: function() {
+ return $.queueTask(function() {
+ if (!QR.inBubble()) {
+ QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement);
+ return QR.nodes.el.classList.toggle('focus', QR.hasFocus);
+ }
+ });
+ },
+ inBubble: function() {
+ var bubbles, ref;
+ bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
+ return (ref = d.activeElement, indexOf.call(bubbles, ref) >= 0) || bubbles.some(function(el) {
+ return getComputedStyle(el).visibility !== 'hidden' && el.getBoundingClientRect().bottom > 0;
+ });
+ },
+ hide: function() {
+ d.activeElement.blur();
+ $.addClass(QR.nodes.el, 'autohide');
+ return QR.nodes.autohide.checked = true;
+ },
+ unhide: function() {
+ $.rmClass(QR.nodes.el, 'autohide');
+ return QR.nodes.autohide.checked = false;
+ },
+ toggleHide: function() {
+ if (this.checked) {
+ return QR.hide();
+ } else {
+ return QR.unhide();
+ }
+ },
+ toggleSJIS: function(e) {
+ e.preventDefault();
+ Conf['sjisPreview'] = !Conf['sjisPreview'];
+ $.set('sjisPreview', Conf['sjisPreview']);
+ return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']);
+ },
+ texPreviewShow: function() {
+ if ($.hasClass(QR.nodes.el, 'tex-preview')) {
+ return QR.texPreviewHide();
+ }
+ $.addClass(QR.nodes.el, 'tex-preview');
+ QR.nodes.texPreview.textContent = QR.nodes.com.value;
+ return $.event('mathjax', null, QR.nodes.texPreview);
+ },
+ texPreviewHide: function() {
+ return $.rmClass(QR.nodes.el, 'tex-preview');
+ },
+ setCustomCooldown: function(enabled) {
+ Conf['customCooldownEnabled'] = enabled;
+ QR.cooldown.customCooldown = enabled;
+ return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);
+ },
+ toggleCustomCooldown: function() {
+ var enabled;
+ enabled = $.hasClass(this, 'disabled');
+ QR.setCustomCooldown(enabled);
+ return $.set('customCooldownEnabled', enabled);
+ },
+ error: function(err, focusOverride) {
+ var el, notice, notif;
+ QR.open();
+ if (typeof err === 'string') {
+ el = $.tn(err);
+ } else {
+ el = err;
+ el.removeAttribute('style');
+ }
+ notice = new Notice('warning', el);
+ QR.notifications.push(notice);
+ if (!Header.areNotificationsEnabled) {
+ if (d.hidden && !QR.cooldown.auto) {
+ return alert(el.textContent);
+ }
+ } else if (d.hidden || !(focusOverride || d.hasFocus())) {
+ try {
+ notif = new Notification(el.textContent, {
+ body: el.textContent,
+ icon: Favicon.logo
+ });
+ notif.onclick = function() {
+ return $.global(function() {
+ return window.focus();
+ });
+ };
+ if ($.engine !== 'gecko') {
+ notif.onclose = function() {
+ return notice.close();
+ };
+ return notif.onshow = function() {
+ return setTimeout(function() {
+ notif.onclose = null;
+ return notif.close();
+ }, 7 * $.SECOND);
+ };
+ }
+ } catch (_error) {}
+ }
+ },
+ notifications: [],
+ cleanNotifications: function() {
+ var j, len, notification, ref;
+ ref = QR.notifications;
+ for (j = 0, len = ref.length; j < len; j++) {
+ notification = ref[j];
+ notification.close();
+ }
+ return QR.notifications = [];
+ },
+ status: function() {
+ var disabled, status, thread, value;
+ if (!QR.nodes) {
+ return;
+ }
+ thread = QR.posts[0].thread;
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
+ value = 'Dead';
+ disabled = true;
+ QR.cooldown.auto = false;
+ }
+ value = QR.req ? QR.req.progress : QR.cooldown.seconds || value;
+ status = QR.nodes.status;
+ status.value = !value ? 'Submit' : QR.cooldown.auto ? "Auto " + value : value;
+ return status.disabled = disabled || false;
+ },
+ openPost: function() {
+ var index;
+ QR.open();
+ if (QR.selected.isLocked) {
+ index = QR.posts.indexOf(QR.selected);
+ (QR.posts[index + 1] || new QR.post()).select();
+ $.addClass(QR.nodes.el, 'dump');
+ return QR.cooldown.auto = true;
+ }
+ },
+ quote: function(e) {
+ var ancestor, caretPos, com, frag, insideCode, j, k, l, len, len1, len2, len3, len4, len5, n, node, o, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread;
+ if (e != null) {
+ e.preventDefault();
+ }
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ sel = d.getSelection();
+ post = Get.postFromNode(this);
+ text = post.board.ID === g.BOARD.ID ? ">>" + post + "\n" : ">>>/" + post.board + "/" + post + "\n";
+ if (sel.toString().trim() && post === Get.postFromNode(sel.anchorNode)) {
+ range = sel.getRangeAt(0);
+ frag = range.cloneContents();
+ ancestor = range.commonAncestorContainer;
+ if ($.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) {
+ $.prepend(frag, $.tn('[spoiler]'));
+ $.add(frag, $.tn('[/spoiler]'));
+ }
+ if (insideCode = $.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) {
+ $.prepend(frag, $.tn('[code]'));
+ $.add(frag, $.tn('[/code]'));
+ }
+ ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
+ for (j = 0, len = ref.length; j < len; j++) {
+ node = ref[j];
+ $.replace(node, $.tn('\n'));
+ }
+ ref1 = $$('br', frag);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ node = ref1[k];
+ if (node !== frag.lastChild) {
+ $.replace(node, $.tn('\n>'));
+ }
+ }
+ ref2 = $$('s, .removed-spoiler', frag);
+ for (l = 0, len2 = ref2.length; l < len2; l++) {
+ node = ref2[l];
+ $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')]));
+ }
+ ref3 = $$('.prettyprint', frag);
+ for (n = 0, len3 = ref3.length; n < len3; n++) {
+ node = ref3[n];
+ $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')]));
+ }
+ ref4 = $$('.linkify[data-original]', frag);
+ for (o = 0, len4 = ref4.length; o < len4; o++) {
+ node = ref4[o];
+ $.replace(node, $.tn(node.dataset.original));
+ }
+ ref5 = $$('.embedder', frag);
+ for (q = 0, len5 = ref5.length; q < len5; q++) {
+ node = ref5[q];
+ if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') {
+ $.rm(node.previousSibling);
+ }
+ $.rm(node);
+ }
+ text += ">" + (frag.textContent.trim()) + "\n";
+ }
+ QR.openPost();
+ ref7 = QR.nodes, com = ref7.com, thread = ref7.thread;
+ if (!com.value) {
+ thread.value = Get.threadFromNode(this);
+ }
+ caretPos = com.selectionStart;
+ com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
+ range = caretPos + text.length;
+ com.setSelectionRange(range, range);
+ com.focus();
+ QR.selected.save(com);
+ return QR.selected.save(thread);
+ },
+ characterCount: function() {
+ var count, counter;
+ counter = QR.nodes.charCount;
+ count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
+ counter.textContent = count;
+ counter.hidden = count < QR.max_comment / 2;
+ return (count > QR.max_comment ? $.addClass : $.rmClass)(counter, 'warning');
+ },
+ getFile: function() {
+ var ref;
+ return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0);
+ },
+ setFile: function(e) {
+ var file, name, ref, source;
+ ref = e.detail, file = ref.file, name = ref.name, source = ref.source;
+ if (name != null) {
+ file.name = name;
+ }
+ if (source != null) {
+ file.source = source;
+ }
+ QR.open();
+ return QR.handleFiles([file]);
+ },
+ drag: function(e) {
+ var toggle;
+ toggle = e.type === 'dragstart' ? $.off : $.on;
+ toggle(d, 'dragover', QR.dragOver);
+ return toggle(d, 'drop', QR.dropFile);
+ },
+ dragOver: function(e) {
+ e.preventDefault();
+ return e.dataTransfer.dropEffect = 'copy';
+ },
+ dropFile: function(e) {
+ if (!e.dataTransfer.files.length) {
+ return;
+ }
+ e.preventDefault();
+ QR.open();
+ return QR.handleFiles(e.dataTransfer.files);
+ },
+ paste: function(e) {
+ var blob, files, item, j, len, ref;
+ if (!e.clipboardData.items) {
+ return;
+ }
+ files = [];
+ ref = e.clipboardData.items;
+ for (j = 0, len = ref.length; j < len; j++) {
+ item = ref[j];
+ if (!(item.kind === 'file')) {
+ continue;
+ }
+ blob = item.getAsFile();
+ blob.name = 'file';
+ if (blob.type) {
+ blob.name += '.' + blob.type.split('/')[1];
+ }
+ files.push(blob);
+ }
+ if (!files.length) {
+ return;
+ }
+ QR.open();
+ QR.handleFiles(files);
+ return $.addClass(QR.nodes.el, 'dump');
+ },
+ pasteFF: function() {
+ var arr, blob, bstr, i, images, img, j, k, len, m, pasteArea, ref, src;
+ pasteArea = QR.nodes.pasteArea;
+ if (!pasteArea.childNodes.length) {
+ return;
+ }
+ images = $$('img', pasteArea);
+ $.rmAll(pasteArea);
+ for (j = 0, len = images.length; j < len; j++) {
+ img = images[j];
+ src = img.src;
+ if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) {
+ bstr = atob(m[3]);
+ arr = new Uint8Array(bstr.length);
+ for (i = k = 0, ref = bstr.length; 0 <= ref ? k < ref : k > ref; i = 0 <= ref ? ++k : --k) {
+ arr[i] = bstr.charCodeAt(i);
+ }
+ blob = new Blob([arr], {
+ type: m[1]
+ });
+ blob.name = "file." + m[2];
+ QR.handleFiles([blob]);
+ } else if (/^https?:\/\//.test(src)) {
+ QR.handleUrl(src);
+ }
+ }
+ },
+ handleUrl: function(urlDefault) {
+ var url;
+ url = prompt('Enter a URL:', urlDefault);
+ if (url === null) {
+ return;
+ }
+ QR.nodes.fileButton.focus();
+ return CrossOrigin.file(url, function(blob) {
+ if (blob && !/^text\//.test(blob.type)) {
+ return QR.handleFiles([blob]);
+ } else {
+ return QR.error("Can't load file.");
+ }
+ });
+ },
+ handleFiles: function(files) {
+ var file, j, len;
+ if (this !== QR) {
+ files = slice.call(this.files);
+ this.value = null;
+ }
+ if (!files.length) {
+ return;
+ }
+ QR.cleanNotifications();
+ for (j = 0, len = files.length; j < len; j++) {
+ file = files[j];
+ QR.handleFile(file, files.length);
+ }
+ if (files.length !== 1) {
+ $.addClass(QR.nodes.el, 'dump');
+ }
+ if (d.activeElement === QR.nodes.fileButton && $.hasClass(QR.nodes.fileSubmit, 'has-file')) {
+ return QR.nodes.filename.focus();
+ }
+ },
+ handleFile: function(file, nfiles) {
+ var isText, post;
+ isText = /^text\//.test(file.type);
+ if (nfiles === 1) {
+ post = QR.selected;
+ } else {
+ post = QR.posts[QR.posts.length - 1];
+ if ((isText ? post.com || post.pasting : post.file)) {
+ post = new QR.post();
+ }
+ }
+ return post[isText ? 'pasteText' : 'setFile'](file);
+ },
+ openFileInput: function() {
+ if (QR.nodes.fileButton.disabled) {
+ return;
+ }
+ QR.nodes.fileInput.click();
+ return QR.nodes.fileButton.focus();
+ },
+ generatePostableThreadsList: function() {
+ var j, len, list, options, ref, thread, val;
+ if (!QR.nodes) {
+ return;
+ }
+ list = QR.nodes.thread;
+ options = [list.firstElementChild];
+ ref = g.BOARD.threads.keys;
+ for (j = 0, len = ref.length; j < len; j++) {
+ thread = ref[j];
+ options.push($.el('option', {
+ value: thread,
+ textContent: "Thread " + thread
+ }));
+ }
+ val = list.value;
+ $.rmAll(list);
+ $.add(list, options);
+ list.value = val;
+ if (list.value === val) {
+ return;
+ }
+ list.value = g.VIEW === 'thread' ? g.THREADID : 'new';
+ return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
+ },
+ dialog: function() {
+ var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, scriptData, setNode;
+ QR.nodes = nodes = {
+ el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
+ innerHTML: "
∀ TE X
Width: Height:
Hentai Porn Japanese Anime Game Loop Other "
+ })
+ };
+ setNode = function(name, query) {
+ return nodes[name] = $(query, dialog);
+ };
+ setNode('move', '.move');
+ setNode('autohide', '#autohide');
+ setNode('close', '.close');
+ setNode('thread', 'select');
+ setNode('form', 'form');
+ setNode('sjisToggle', '#sjis-toggle');
+ setNode('texButton', '#tex-preview-button');
+ setNode('name', '[data-name=name]');
+ setNode('email', '[data-name=email]');
+ setNode('sub', '[data-name=sub]');
+ setNode('com', '[data-name=com]');
+ setNode('charCount', '#char-count');
+ setNode('texPreview', '#tex-preview');
+ setNode('dumpList', '#dump-list');
+ setNode('addPost', '#add-post');
+ setNode('oekaki', '.oekaki');
+ setNode('drawButton', '#qr-draw-button');
+ setNode('fileSubmit', '#file-n-submit');
+ setNode('fileButton', '#qr-file-button');
+ setNode('noFile', '#qr-no-file');
+ setNode('filename', '#qr-filename');
+ setNode('spoiler', '#qr-file-spoiler');
+ setNode('oekakiButton', '#qr-oekaki-button');
+ setNode('fileRM', '#qr-filerm');
+ setNode('urlButton', '#url-button');
+ setNode('pasteArea', '#paste-area');
+ setNode('customCooldown', '#custom-cooldown-button');
+ setNode('dumpButton', '#dump-button');
+ setNode('status', '[type=submit]');
+ setNode('flashTag', '[name=filetag]');
+ setNode('fileInput', '[type=file]');
+ rules = $('ul.rules').textContent.trim();
+ match_min = rules.match(/.+smaller than (\d+)x(\d+).+/);
+ match_max = rules.match(/.+greater than (\d+)x(\d+).+/);
+ QR.min_width = +(match_min != null ? match_min[1] : void 0) || 1;
+ QR.min_height = +(match_min != null ? match_min[2] : void 0) || 1;
+ QR.max_width = +(match_max != null ? match_max[1] : void 0) || 10000;
+ QR.max_height = +(match_max != null ? match_max[2] : void 0) || 10000;
+ scriptData = Get.scriptData();
+ QR.max_size = (m = scriptData.match(/\bmaxFilesize *= *(\d+)\b/)) ? +m[1] : 4194304;
+ QR.max_size_video = (m = scriptData.match(/\bmaxWebmFilesize *= *(\d+)\b/)) ? +m[1] : QR.max_size;
+ QR.max_comment = (m = scriptData.match(/\bcomlen *= *(\d+)\b/)) ? +m[1] : 2000;
+ QR.max_width_video = QR.max_height_video = 2048;
+ QR.max_duration_video = (ref = g.BOARD.ID) === 'gif' || ref === 'wsg' ? 300 : 120;
+ if (Conf['Show New Thread Option in Threads']) {
+ $.addClass(QR.nodes.el, 'show-new-thread-option');
+ }
+ if (Conf['Show Name and Subject']) {
+ $.addClass(QR.nodes.name, 'force-show');
+ $.addClass(QR.nodes.sub, 'force-show');
+ QR.nodes.email.placeholder = 'E-mail';
+ }
+ QR.forcedAnon = !!$('form[name="post"] input[name="name"][type="hidden"]');
+ if (QR.forcedAnon) {
+ $.addClass(QR.nodes.el, 'forced-anon');
+ }
+ QR.spoiler = !!$('.postForm input[name=spoiler]');
+ if (QR.spoiler) {
+ $.addClass(QR.nodes.el, 'has-spoiler');
+ }
+ if (g.BOARD.ID === 'jp' && Conf['sjisPreview']) {
+ $.addClass(QR.nodes.el, 'sjis-preview');
+ }
+ if (parseInt(Conf['customCooldown'], 10) > 0) {
+ $.addClass(QR.nodes.fileSubmit, 'custom-cooldown');
+ $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) {
+ var customCooldownEnabled;
+ customCooldownEnabled = arg.customCooldownEnabled;
+ QR.setCustomCooldown(customCooldownEnabled);
+ return $.sync('customCooldownEnabled', QR.setCustomCooldown);
+ });
+ }
+ $.on(nodes.autohide, 'change', QR.toggleHide);
+ $.on(nodes.close, 'click', QR.close);
+ $.on(nodes.form, 'submit', QR.submit);
+ $.on(nodes.sjisToggle, 'click', QR.toggleSJIS);
+ $.on(nodes.texButton, 'mousedown', QR.texPreviewShow);
+ $.on(nodes.texButton, 'mouseup', QR.texPreviewHide);
+ $.on(nodes.addPost, 'click', function() {
+ return new QR.post(true);
+ });
+ $.on(nodes.drawButton, 'click', QR.oekaki.draw);
+ $.on(nodes.fileButton, 'click', QR.openFileInput);
+ $.on(nodes.noFile, 'click', QR.openFileInput);
+ $.on(nodes.filename, 'focus', function() {
+ return $.addClass(this.parentNode, 'focus');
+ });
+ $.on(nodes.filename, 'blur', function() {
+ return $.rmClass(this.parentNode, 'focus');
+ });
+ $.on(nodes.spoiler, 'change', function() {
+ return QR.selected.nodes.spoiler.click();
+ });
+ $.on(nodes.oekakiButton, 'click', QR.oekaki.button);
+ $.on(nodes.fileRM, 'click', function() {
+ return QR.selected.rmFile();
+ });
+ $.on(nodes.urlButton, 'click', function() {
+ return QR.handleUrl('');
+ });
+ $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);
+ $.on(nodes.dumpButton, 'click', function() {
+ return nodes.el.classList.toggle('dump');
+ });
+ $.on(nodes.fileInput, 'change', QR.handleFiles);
+ window.addEventListener('focus', QR.focus, true);
+ window.addEventListener('blur', QR.focus, true);
+ $.on(d, 'click', QR.focus);
+ if ($.engine === 'gecko') {
+ nodes.pasteArea.hidden = false;
+ new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {
+ childList: true
+ });
+ }
+ items = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
+ i = 0;
+ save = function() {
+ return QR.selected.save(this);
+ };
+ while (name = items[i++]) {
+ if (!(node = nodes[name])) {
+ continue;
+ }
+ event = node.nodeName === 'SELECT' ? 'change' : 'input';
+ $.on(nodes[name], event, save);
+ }
+ if ($.engine === 'gecko' && Conf['Remember QR Size']) {
+ $.get('QR Size', '', function(item) {
+ return nodes.com.style.cssText = item['QR Size'];
+ });
+ $.on(nodes.com, 'mouseup', function(e) {
+ if (e.button !== 0) {
+ return;
+ }
+ return $.set('QR Size', this.style.cssText);
+ });
+ }
+ QR.generatePostableThreadsList();
+ QR.persona.load();
+ new QR.post(true);
+ QR.status();
+ QR.cooldown.setup();
+ QR.captcha.init();
+ $.add(d.body, dialog);
+ QR.captcha.setup();
+ QR.oekaki.setup();
+ return $.event('QRDialogCreation', null, dialog);
+ },
+ submit: function(e) {
+ var captcha, cb, err, extra, filetag, formData, options, post, ref, textOnly, thread, threadID;
+ if (e != null) {
+ e.preventDefault();
+ }
+ if (QR.req) {
+ QR.abort();
+ return;
+ }
+ if (QR.cooldown.seconds) {
+ QR.cooldown.auto = !QR.cooldown.auto;
+ QR.status();
+ return;
+ }
+ post = QR.posts[0];
+ post.forceSave();
+ threadID = post.thread;
+ thread = g.BOARD.threads[threadID];
+ if (g.BOARD.ID === 'f' && threadID === 'new') {
+ filetag = QR.nodes.flashTag.value;
+ }
+ if (threadID === 'new') {
+ threadID = null;
+ if (g.BOARD.ID === 'vg' && !post.sub) {
+ err = 'New threads require a subject.';
+ } else if (!($.hasClass(d.body, 'text_only') || post.file || (textOnly = !!$('input[name=textonly]', $.id('postForm'))))) {
+ err = 'No file selected.';
+ }
+ } else if (g.BOARD.threads[threadID].isClosed) {
+ err = 'You can\'t reply to this thread anymore.';
+ } else if (!(post.com || post.file)) {
+ err = 'No comment or file.';
+ } else if (post.file && thread.fileLimit) {
+ err = 'Max limit of image replies has been reached.';
+ }
+ if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
+ err || (err = 'Original comment required.');
+ }
+ if (QR.captcha.isEnabled && !err) {
+ captcha = QR.captcha.getOne();
+ if (!captcha) {
+ err = 'No valid captcha.';
+ QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
+ }
+ }
+ QR.cleanNotifications();
+ if (err) {
+ QR.cooldown.auto = false;
+ QR.status();
+ QR.error(err);
+ return;
+ }
+ QR.cooldown.auto = QR.posts.length > 1;
+ if (Conf['Auto Hide QR'] && !QR.cooldown.auto) {
+ QR.hide();
+ }
+ if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) {
+ d.activeElement.blur();
+ }
+ post.lock();
+ formData = {
+ resto: threadID,
+ name: !QR.forcedAnon ? post.name : void 0,
+ email: post.email,
+ sub: !(QR.forcedAnon || threadID) ? post.sub : void 0,
+ com: post.com,
+ upfile: post.file,
+ filetag: filetag,
+ spoiler: post.spoiler,
+ textonly: textOnly,
+ mode: 'regist',
+ pwd: QR.persona.getPassword()
+ };
+ options = {
+ responseType: 'document',
+ withCredentials: true,
+ onload: QR.response,
+ onerror: function() {
+ delete QR.req;
+ post.unlock();
+ QR.cooldown.auto = false;
+ QR.status();
+ return QR.error($.el('span', {
+ innerHTML: "Connection error while posting. [
More info ]"
+ }));
+ }
+ };
+ extra = {
+ form: $.formData(formData),
+ upCallbacks: {
+ onload: function() {
+ QR.req.isUploadFinished = true;
+ QR.req.progress = '...';
+ return QR.status();
+ },
+ onprogress: function(e) {
+ QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%";
+ return QR.status();
+ }
+ }
+ };
+ cb = function(response) {
+ if (response != null) {
+ if (response.challenge != null) {
+ extra.form.append('recaptcha_challenge_field', response.challenge);
+ extra.form.append('recaptcha_response_field', response.response);
+ } else {
+ extra.form.append('g-recaptcha-response', response.response);
+ }
+ }
+ QR.req = $.ajax("https://sys.4chan.org/" + g.BOARD + "/post", options, extra);
+ return QR.req.progress = '...';
+ };
+ if (typeof captcha === 'function') {
+ QR.req = {
+ progress: '...',
+ abort: function() {
+ return cb = null;
+ }
+ };
+ captcha(function(response) {
+ if (response) {
+ return typeof cb === "function" ? cb(response) : void 0;
+ } else {
+ delete QR.req;
+ post.unlock();
+ QR.cooldown.auto = !!QR.captcha.captchas.length;
+ return QR.status();
+ }
+ });
+ } else {
+ cb(captcha);
+ }
+ return QR.status();
+ },
+ response: function() {
+ var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, req, resDoc, seconds, threadID;
+ req = QR.req;
+ delete QR.req;
+ post = QR.posts[0];
+ post.unlock();
+ resDoc = req.response;
+ if (ban = $('.banType', resDoc)) {
+ err = $.el('span', ban.textContent.toLowerCase() === 'banned' ? {
+ innerHTML: "You are banned on " + ($(".board", resDoc)).innerHTML + "! ;_;
Click
here to see the reason."
+ } : {
+ innerHTML: "You were issued a warning on " + ($(".board", resDoc)).innerHTML + " as " + ($(".nameBlock", resDoc)).innerHTML + ".
Reason: " + ($(".reason", resDoc)).innerHTML
+ });
+ } else if (err = resDoc.getElementById('errmsg')) {
+ if ((ref = $('a', err)) != null) {
+ ref.target = '_blank';
+ }
+ } else if (resDoc.title !== 'Post successful!') {
+ err = 'Connection error with sys.4chan.org.';
+ } else if (req.status !== 200) {
+ err = "Error " + req.statusText + " (" + req.status + ")";
+ }
+ if (err) {
+ if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
+ if (/mistyped/i.test(err.textContent)) {
+ err = $.el('span', {
+ innerHTML: "You mistyped the CAPTCHA, or the CAPTCHA malfunctioned [
complain here ]."
+ });
+ } else if (/expired/i.test(err.textContent)) {
+ err = 'This CAPTCHA is no longer valid because it has expired.';
+ }
+ QR.cooldown.auto = QR.captcha.isEnabled || err === 'Connection error with sys.4chan.org.';
+ QR.cooldown.addDelay(post, 2);
+ } else if (err.textContent && (m = err.textContent.match(/(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i)) && !/duplicate|hour/i.test(err.textContent)) {
+ QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent);
+ seconds = 60 * (+(m[1] || 0)) + (+m[2]);
+ if (/muted/i.test(err.textContent)) {
+ QR.cooldown.addMute(seconds);
+ } else {
+ QR.cooldown.addDelay(post, seconds);
+ }
+ } else {
+ QR.cooldown.auto = false;
+ }
+ QR.captcha.setup(QR.cooldown.auto && ((ref1 = d.activeElement) === QR.nodes.status || ref1 === d.body));
+ if (QR.captcha.isEnabled && !QR.captcha.captchas.length) {
+ QR.cooldown.auto = false;
+ }
+ QR.status();
+ QR.error(err);
+ return;
+ }
+ h1 = $('h1', resDoc);
+ QR.cleanNotifications();
+ if (Conf['Posting Success Notifications']) {
+ QR.notifications.push(new Notice('success', h1.textContent, 5));
+ }
+ ref2 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref2[0], threadID = ref2[1], postID = ref2[2];
+ postID = +postID;
+ threadID = +threadID || postID;
+ isReply = threadID !== postID;
+ $.event('QRPostSuccessful', {
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ postID: postID
+ });
+ $.event('QRPostSuccessful_', {
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ postID: postID
+ });
+ postsCount = QR.posts.length - 1;
+ QR.cooldown.auto = postsCount && isReply;
+ lastPostToThread = !((function() {
+ var j, len, p, ref3;
+ ref3 = QR.posts.slice(1);
+ for (j = 0, len = ref3.length; j < len; j++) {
+ p = ref3[j];
+ if (p.thread === post.thread) {
+ return true;
+ }
+ }
+ })());
+ if (!(Conf['Persistent QR'] || postsCount)) {
+ QR.close();
+ } else {
+ post.rm();
+ QR.captcha.setup(d.activeElement === QR.nodes.status);
+ }
+ QR.cooldown.add(threadID, postID);
+ URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && lastPostToThread && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
+ if (URL) {
+ open = Conf['Open Post in New Tab'] || postsCount ? function() {
+ return $.open(URL);
+ } : function() {
+ return window.location = URL;
+ };
+ if (threadID === postID) {
+ QR.waitForThread(URL, open);
+ } else {
+ open();
+ }
+ }
+ return QR.status();
+ },
+ waitForThread: function(url, cb) {
+ var attempts, check;
+ attempts = 0;
+ check = function() {
+ return $.ajax(url, {
+ onloadend: function() {
+ attempts++;
+ if (attempts >= 6 || this.status === 200) {
+ return cb();
+ } else {
+ return setTimeout(check, attempts * $.SECOND);
+ }
+ }
+ }, {
+ type: 'HEAD'
+ });
+ };
+ return check();
+ },
+ abort: function() {
+ if (QR.req && !QR.req.isUploadFinished) {
+ QR.req.abort();
+ delete QR.req;
+ QR.posts[0].unlock();
+ QR.cooldown.auto = false;
+ QR.notifications.push(new Notice('info', 'QR upload aborted.', 5));
+ }
+ return QR.status();
+ }
+ };
+
+ return QR;
+
+}).call(this);
+
+(function() {
+ QR.cooldown = {
+ seconds: 0,
+ delays: {
+ thread: 0,
+ reply: 0,
+ image: 0,
+ reply_intra: 0,
+ image_intra: 0,
+ deletion: 60,
+ thread_global: 300
+ },
+ init: function() {
+ if (!Conf['Quick Reply']) {
+ return;
+ }
+ this.data = Conf['cooldowns'];
+ return $.sync('cooldowns', this.sync);
+ },
+ setup: function() {
+ var delay, m, ref, type;
+ if (m = Get.scriptData().match(/\bcooldowns *= *({[^}]+})/)) {
+ $.extend(QR.cooldown.delays, JSON.parse(m[1]));
+ }
+ QR.cooldown.maxDelay = 0;
+ ref = QR.cooldown.delays;
+ for (type in ref) {
+ delay = ref[type];
+ if (type !== 'thread' && type !== 'thread_global') {
+ QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay);
+ }
+ }
+ QR.cooldown.isSetup = true;
+ return QR.cooldown.start();
+ },
+ start: function() {
+ var data;
+ data = QR.cooldown.data;
+ if (!(Conf['Cooldown'] && QR.cooldown.isSetup && !QR.cooldown.isCounting && Object.keys(data[g.BOARD.ID] || {}).length + Object.keys(data.global || {}).length > 0)) {
+ return;
+ }
+ QR.cooldown.isCounting = true;
+ return QR.cooldown.count();
+ },
+ sync: function(data) {
+ QR.cooldown.data = data || {};
+ return QR.cooldown.start();
+ },
+ add: function(threadID, postID) {
+ var boardID, start;
+ if (!Conf['Cooldown']) {
+ return;
+ }
+ start = Date.now();
+ boardID = g.BOARD.ID;
+ QR.cooldown.set(boardID, start, {
+ threadID: threadID,
+ postID: postID
+ });
+ if (threadID === postID) {
+ QR.cooldown.set('global', start, {
+ boardID: boardID,
+ threadID: threadID,
+ postID: postID
+ });
+ }
+ return QR.cooldown.start();
+ },
+ addDelay: function(post, delay) {
+ var cooldown;
+ if (!Conf['Cooldown']) {
+ return;
+ }
+ cooldown = QR.cooldown.categorize(post);
+ cooldown.delay = delay;
+ QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown);
+ return QR.cooldown.start();
+ },
+ addMute: function(delay) {
+ if (!Conf['Cooldown']) {
+ return;
+ }
+ QR.cooldown.set(g.BOARD.ID, Date.now(), {
+ type: 'mute',
+ delay: delay
+ });
+ return QR.cooldown.start();
+ },
+ "delete": function(post) {
+ var base, cooldown, cooldowns, id, name;
+ if (!QR.cooldown.data) {
+ return;
+ }
+ $.forceSync('cooldowns');
+ cooldowns = ((base = QR.cooldown.data)[name = post.board.ID] || (base[name] = {}));
+ for (id in cooldowns) {
+ cooldown = cooldowns[id];
+ if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
+ delete cooldowns[id];
+ }
+ }
+ return QR.cooldown.save([post.board.ID]);
+ },
+ secondsDeletion: function(post) {
+ var cooldown, cooldowns, seconds, start;
+ if (!(QR.cooldown.data && Conf['Cooldown'])) {
+ return 0;
+ }
+ cooldowns = QR.cooldown.data[post.board.ID] || {};
+ for (start in cooldowns) {
+ cooldown = cooldowns[start];
+ if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
+ seconds = QR.cooldown.delays.deletion - Math.floor((Date.now() - start) / $.SECOND);
+ return Math.max(seconds, 0);
+ }
+ }
+ return 0;
+ },
+ categorize: function(post) {
+ if (post.thread === 'new') {
+ return {
+ type: 'thread'
+ };
+ } else {
+ return {
+ type: !!post.file ? 'image' : 'reply',
+ threadID: +post.thread
+ };
+ }
+ },
+ set: function(scope, id, value) {
+ var base, cooldowns;
+ $.forceSync('cooldowns');
+ cooldowns = ((base = QR.cooldown.data)[scope] || (base[scope] = {}));
+ cooldowns[id] = value;
+ return $.set('cooldowns', QR.cooldown.data);
+ },
+ save: function(scopes) {
+ var data, i, len, scope;
+ data = QR.cooldown.data;
+ for (i = 0, len = scopes.length; i < len; i++) {
+ scope = scopes[i];
+ if (scope in data && !Object.keys(data[scope]).length) {
+ delete data[scope];
+ }
+ }
+ return $.set('cooldowns', data);
+ },
+ count: function() {
+ var base, cooldown, cooldowns, elapsed, i, len, maxDelay, nCooldowns, now, ref, ref1, save, scope, seconds, start, suffix, threadID, type, update;
+ $.forceSync('cooldowns');
+ save = [];
+ nCooldowns = 0;
+ now = Date.now();
+ ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID;
+ seconds = 0;
+ if (Conf['Cooldown']) {
+ ref1 = [g.BOARD.ID, 'global'];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ scope = ref1[i];
+ cooldowns = ((base = QR.cooldown.data)[scope] || (base[scope] = {}));
+ for (start in cooldowns) {
+ cooldown = cooldowns[start];
+ start = +start;
+ elapsed = Math.floor((now - start) / $.SECOND);
+ if (elapsed < 0) {
+ delete cooldowns[start];
+ save.push(scope);
+ continue;
+ }
+ if (cooldown.delay != null) {
+ if (cooldown.delay <= elapsed) {
+ delete cooldowns[start];
+ save.push(scope);
+ } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') {
+ seconds = Math.max(seconds, cooldown.delay - elapsed);
+ }
+ continue;
+ }
+ maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread'];
+ if (QR.cooldown.customCooldown) {
+ maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10));
+ }
+ if (maxDelay <= elapsed) {
+ delete cooldowns[start];
+ save.push(scope);
+ continue;
+ }
+ if ((type === 'thread') === (cooldown.threadID === cooldown.postID) && cooldown.boardID !== g.BOARD.ID) {
+ suffix = scope === 'global' ? '_global' : type !== 'thread' && threadID === cooldown.threadID ? '_intra' : '';
+ seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed);
+ }
+ if (QR.cooldown.customCooldown) {
+ seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed);
+ }
+ }
+ nCooldowns += Object.keys(cooldowns).length;
+ }
+ }
+ if (save.length) {
+ QR.cooldown.save(save);
+ }
+ if (nCooldowns) {
+ clearTimeout(QR.cooldown.timeout);
+ QR.cooldown.timeout = setTimeout(QR.cooldown.count, $.SECOND);
+ } else {
+ delete QR.cooldown.isCounting;
+ }
+ update = seconds !== QR.cooldown.seconds;
+ QR.cooldown.seconds = seconds;
+ if (update) {
+ QR.status();
+ }
+ if (seconds === 0 && QR.cooldown.auto && !QR.req) {
+ return QR.submit();
+ }
+ }
+ };
+
+}).call(this);
+
+(function() {
+ QR.oekaki = {
+ menu: {
+ init: function() {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Edit Link'] && Conf['Quick Reply'])) {
+ return;
+ }
+ a = $.el('a', {
+ className: 'edit-link',
+ href: 'javascript:;',
+ textContent: 'Edit image'
+ });
+ $.on(a, 'click', this.editFile);
+ return Menu.menu.addEntry({
+ el: a,
+ order: 95,
+ open: function(post) {
+ var file;
+ QR.oekaki.menu.post = post;
+ file = post.file;
+ return QR.postingIsEnabled && !!file && (file.isImage || file.isVideo);
+ }
+ });
+ },
+ editFile: function() {
+ var currentTime, isVideo, post, ref;
+ post = QR.oekaki.menu.post;
+ QR.quote.call(post.nodes.post);
+ isVideo = post.file.isVideo;
+ currentTime = ((ref = post.file.fullImage) != null ? ref.currentTime : void 0) || 0;
+ return CrossOrigin.file(post.file.url, function(blob) {
+ var video;
+ if (!blob) {
+ return QR.error("Can't load file.");
+ } else if (isVideo) {
+ video = $.el('video');
+ $.on(video, 'loadedmetadata', function() {
+ $.on(video, 'seeked', function() {
+ var canvas;
+ canvas = $.el('canvas', {
+ width: video.videoWidth,
+ height: video.videoHeight
+ });
+ canvas.getContext('2d').drawImage(video, 0, 0);
+ return canvas.toBlob(function(snapshot) {
+ snapshot.name = post.file.name.replace(/\.\w+$/, '') + '.png';
+ QR.handleFiles([snapshot]);
+ return QR.oekaki.edit();
+ });
+ });
+ return video.currentTime = currentTime;
+ });
+ return video.src = URL.createObjectURL(blob);
+ } else {
+ blob.name = post.file.name;
+ QR.handleFiles([blob]);
+ return QR.oekaki.edit();
+ }
+ });
+ }
+ },
+ setup: function() {
+ return $.global(function() {
+ var FCX;
+ FCX = window.FCX;
+ FCX.oekakiCB = function() {
+ return window.Tegaki.flatten().toBlob(function(file) {
+ var source;
+ source = "oekaki-" + (Date.now());
+ FCX.oekakiLatest = source;
+ return document.dispatchEvent(new CustomEvent('QRSetFile', {
+ bubbles: true,
+ detail: {
+ file: file,
+ name: FCX.oekakiName,
+ source: source
+ }
+ }));
+ });
+ };
+ if (window.Tegaki) {
+ return document.querySelector('#qr .oekaki').hidden = false;
+ }
+ });
+ },
+ load: function(cb) {
+ var n, onload, script, style;
+ if ($('script[src^="//s.4cdn.org/js/painter"]', d.head)) {
+ return cb();
+ } else {
+ style = $.el('link', {
+ rel: 'stylesheet',
+ href: "//s.4cdn.org/css/painter." + (Date.now()) + ".css"
+ });
+ script = $.el('script', {
+ src: "//s.4cdn.org/js/painter.min." + (Date.now()) + ".js"
+ });
+ n = 0;
+ onload = function() {
+ if (++n === 2) {
+ return cb();
+ }
+ };
+ $.on(style, 'load', onload);
+ $.on(script, 'load', onload);
+ return $.add(d.head, [style, script]);
+ }
+ },
+ draw: function() {
+ return $.global(function() {
+ var FCX, Tegaki;
+ Tegaki = window.Tegaki, FCX = window.FCX;
+ if (Tegaki.bg) {
+ Tegaki.destroy();
+ }
+ FCX.oekakiName = 'tegaki.png';
+ return Tegaki.open({
+ onDone: FCX.oekakiCB,
+ onCancel: function() {
+ return Tegaki.bgColor = '#ffffff';
+ },
+ width: +document.querySelector('#qr [name=oekaki-width]').value,
+ height: +document.querySelector('#qr [name=oekaki-height]').value,
+ bgColor: document.querySelector('#qr [name=oekaki-bg]').checked ? document.querySelector('#qr [name=oekaki-bgcolor]').value : 'transparent'
+ });
+ });
+ },
+ button: function() {
+ if (QR.selected.file) {
+ return QR.oekaki.edit();
+ } else {
+ return QR.oekaki.toggle();
+ }
+ },
+ edit: function() {
+ return QR.oekaki.load(function() {
+ return $.global(function() {
+ var FCX, Tegaki, cb, error, name, source;
+ Tegaki = window.Tegaki, FCX = window.FCX;
+ name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png';
+ source = document.getElementById('file-n-submit').dataset.source;
+ error = function(content) {
+ return document.dispatchEvent(new CustomEvent('CreateNotification', {
+ bubbles: true,
+ detail: {
+ type: 'warning',
+ content: content,
+ lifetime: 20
+ }
+ }));
+ };
+ cb = function(e) {
+ var file, isVideo;
+ document.removeEventListener('QRFile', cb, false);
+ if (!e.detail) {
+ return error('No file to edit.');
+ }
+ if (!/^(image|video)\//.test(e.detail.type)) {
+ return error('Not an image.');
+ }
+ isVideo = /^video\//.test(e.detail.type);
+ file = document.createElement(isVideo ? 'video' : 'img');
+ file.addEventListener('error', function() {
+ return error('Could not open file.', false);
+ });
+ file.addEventListener((isVideo ? 'loadeddata' : 'load'), function() {
+ if (Tegaki.bg) {
+ Tegaki.destroy();
+ }
+ FCX.oekakiName = name;
+ Tegaki.open({
+ onDone: FCX.oekakiCB,
+ onCancel: function() {
+ return Tegaki.bgColor = '#ffffff';
+ },
+ width: file.naturalWidth || file.videoWidth,
+ height: file.naturalHeight || file.videoHeight,
+ bgColor: 'transparent'
+ });
+ return Tegaki.activeCtx.drawImage(file, 0, 0);
+ }, false);
+ return file.src = URL.createObjectURL(e.detail);
+ };
+ if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) {
+ FCX.oekakiName = name;
+ return Tegaki.resume();
+ } else {
+ document.addEventListener('QRFile', cb, false);
+ return document.dispatchEvent(new CustomEvent('QRGetFile', {
+ bubbles: true
+ }));
+ }
+ });
+ });
+ },
+ toggle: function() {
+ return QR.oekaki.load(function() {
+ return QR.nodes.oekaki.hidden = !QR.nodes.oekaki.hidden;
+ });
+ }
+ };
+
+}).call(this);
+
+(function() {
+ var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ QR.persona = {
+ always: {},
+ types: {
+ name: [],
+ email: [],
+ sub: []
+ },
+ init: function() {
+ var i, item, len, ref;
+ if (!(Conf['Quick Reply'] || (Conf['Menu'] && Conf['Delete Link']))) {
+ return;
+ }
+ ref = Conf['QR.personas'].split('\n');
+ for (i = 0, len = ref.length; i < len; i++) {
+ item = ref[i];
+ QR.persona.parseItem(item.trim());
+ }
+ },
+ parseItem: function(item) {
+ var boards, match, ref, ref1, ref2, type, val;
+ if (item[0] === '#') {
+ return;
+ }
+ if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) {
+ return;
+ }
+ ref = match, match = ref[0], type = ref[1], val = ref[2];
+ item = item.replace(match, '');
+ boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global';
+ if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) {
+ return;
+ }
+ if (type === 'password') {
+ QR.persona.pwd = val;
+ return;
+ }
+ if (type === 'options') {
+ type = 'email';
+ }
+ if (type === 'subject') {
+ type = 'sub';
+ }
+ if (/always/i.test(item)) {
+ QR.persona.always[type] = val;
+ }
+ if (indexOf.call(QR.persona.types[type], val) < 0) {
+ return QR.persona.types[type].push(val);
+ }
+ },
+ load: function() {
+ var arr, i, len, list, ref, type, val;
+ ref = QR.persona.types;
+ for (type in ref) {
+ arr = ref[type];
+ list = $("#list-" + type, QR.nodes.el);
+ for (i = 0, len = arr.length; i < len; i++) {
+ val = arr[i];
+ if (val) {
+ $.add(list, $.el('option', {
+ textContent: val
+ }));
+ }
+ }
+ }
+ },
+ getPassword: function() {
+ var m;
+ if (QR.persona.pwd != null) {
+ return QR.persona.pwd;
+ } else if ((m = d.cookie.match(/4chan_pass=([^;]+)/))) {
+ return decodeURIComponent(m[1]);
+ } else {
+ return '';
+ }
+ },
+ get: function(cb) {
+ return $.get('QR.persona', {}, function(arg) {
+ var persona;
+ persona = arg['QR.persona'];
+ return cb(persona);
+ });
+ },
+ set: function(post) {
+ return $.get('QR.persona', {}, function(arg) {
+ var persona;
+ persona = arg['QR.persona'];
+ persona = {
+ name: post.name
+ };
+ return $.set('QR.persona', persona);
+ });
+ }
+ };
+
+}).call(this);
+
+(function() {
+ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ slice = [].slice;
+
+ QR.post = (function() {
+ function _Class(select) {
+ this.select = bind(this.select, this);
+ var el, event, i, j, label, len, len1, prev, ref, ref1;
+ el = $.el('a', {
+ className: 'qr-preview',
+ draggable: true,
+ href: 'javascript:;'
+ });
+ $.extend(el, {
+ innerHTML: "
Spoiler"
+ });
+ this.nodes = {
+ el: el,
+ rm: el.firstChild,
+ spoiler: $('.qr-preview-spoiler input', el),
+ span: el.lastChild
+ };
+ $.on(el, 'click', this.select);
+ $.on(this.nodes.rm, 'click', (function(_this) {
+ return function(e) {
+ e.stopPropagation();
+ return _this.rm();
+ };
+ })(this));
+ $.on(this.nodes.spoiler, 'change', (function(_this) {
+ return function(e) {
+ _this.spoiler = e.target.checked;
+ if (_this === QR.selected) {
+ return QR.nodes.spoiler.checked = _this.spoiler;
+ }
+ };
+ })(this));
+ ref = $$('label', el);
+ for (i = 0, len = ref.length; i < len; i++) {
+ label = ref[i];
+ $.on(label, 'click', function(e) {
+ return e.stopPropagation();
+ });
+ }
+ $.add(QR.nodes.dumpList, el);
+ ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ event = ref1[j];
+ $.on(el, event.toLowerCase(), this[event]);
+ }
+ this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
+ prev = QR.posts[QR.posts.length - 1];
+ QR.posts.push(this);
+ this.nodes.spoiler.checked = this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false;
+ QR.persona.get((function(_this) {
+ return function(persona) {
+ _this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name;
+ _this.email = 'email' in QR.persona.always ? QR.persona.always.email : '';
+ _this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : '';
+ if (QR.selected === _this) {
+ return _this.load();
+ }
+ };
+ })(this));
+ if (select) {
+ this.select();
+ }
+ this.unlock();
+ $.queueTask(function() {
+ return QR.captcha.onNewPost();
+ });
+ }
+
+ _Class.prototype.rm = function() {
+ var index;
+ this["delete"]();
+ index = QR.posts.indexOf(this);
+ if (QR.posts.length === 1) {
+ new QR.post(true);
+ $.rmClass(QR.nodes.el, 'dump');
+ } else if (this === QR.selected) {
+ (QR.posts[index - 1] || QR.posts[index + 1]).select();
+ }
+ QR.posts.splice(index, 1);
+ return QR.status();
+ };
+
+ _Class.prototype["delete"] = function() {
+ $.rm(this.nodes.el);
+ URL.revokeObjectURL(this.URL);
+ return this.dismissErrors();
+ };
+
+ _Class.prototype.lock = function(lock) {
+ var i, len, name, node, ref;
+ if (lock == null) {
+ lock = true;
+ }
+ this.isLocked = lock;
+ if (this !== QR.selected) {
+ return;
+ }
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ if (node = QR.nodes[name]) {
+ node.disabled = lock;
+ }
+ }
+ this.nodes.rm.style.visibility = lock ? 'hidden' : '';
+ this.nodes.spoiler.disabled = lock;
+ return this.nodes.el.draggable = !lock;
+ };
+
+ _Class.prototype.unlock = function() {
+ return this.lock(false);
+ };
+
+ _Class.prototype.select = function() {
+ var rectEl, rectList;
+ if (QR.selected) {
+ QR.selected.nodes.el.removeAttribute('id');
+ QR.selected.forceSave();
+ }
+ QR.selected = this;
+ this.lock(this.isLocked);
+ this.nodes.el.id = 'selected';
+ rectEl = this.nodes.el.getBoundingClientRect();
+ rectList = this.nodes.el.parentNode.getBoundingClientRect();
+ this.nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2;
+ return this.load();
+ };
+
+ _Class.prototype.load = function() {
+ var i, len, name, node, ref;
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ if (!(node = QR.nodes[name])) {
+ continue;
+ }
+ node.value = this[name] || node.dataset["default"] || '';
+ }
+ (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
+ this.showFileData();
+ return QR.characterCount();
+ };
+
+ _Class.prototype.save = function(input) {
+ var name, ref;
+ if (input.type === 'checkbox') {
+ this.spoiler = input.checked;
+ return;
+ }
+ name = input.dataset.name;
+ this[name] = input.value || input.dataset["default"] || null;
+ switch (name) {
+ case 'thread':
+ (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
+ return QR.status();
+ case 'com':
+ this.updateComment();
+ if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
+ return QR.cooldown.auto = false;
+ }
+ break;
+ case 'filename':
+ if (!this.file) {
+ return;
+ }
+ this.saveFilename();
+ return this.updateFilename();
+ case 'name':
+ return QR.persona.set(this);
+ }
+ };
+
+ _Class.prototype.forceSave = function() {
+ var i, len, name, node, ref;
+ if (this !== QR.selected) {
+ return;
+ }
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ if (!(node = QR.nodes[name])) {
+ continue;
+ }
+ this.save(node);
+ }
+ };
+
+ _Class.prototype.setComment = function(com) {
+ this.com = com || null;
+ if (this === QR.selected) {
+ QR.nodes.com.value = this.com;
+ }
+ return this.updateComment();
+ };
+
+ _Class.prototype.updateComment = function() {
+ if (this === QR.selected) {
+ QR.characterCount();
+ }
+ this.nodes.span.textContent = this.com;
+ return $.queueTask(function() {
+ return QR.captcha.onPostChange();
+ });
+ };
+
+ _Class.rmErrored = function(e) {
+ var error, errors, i, j, len, post, ref;
+ e.stopPropagation();
+ ref = QR.posts;
+ for (i = ref.length - 1; i >= 0; i += -1) {
+ post = ref[i];
+ if (errors = post.errors) {
+ for (j = 0, len = errors.length; j < len; j++) {
+ error = errors[j];
+ if (!(doc.contains(error))) {
+ continue;
+ }
+ post.rm();
+ break;
+ }
+ }
+ }
+ };
+
+ _Class.prototype.error = function(className, message) {
+ var div, ref, rm, rmAll;
+ div = $.el('div', {
+ className: className
+ });
+ $.extend(div, {
+ innerHTML: E(message) + "
[
delete ] [
delete all ]"
+ });
+ (this.errors || (this.errors = [])).push(div);
+ ref = $$('a', div), rm = ref[0], rmAll = ref[1];
+ $.on(div, 'click', (function(_this) {
+ return function() {
+ if (indexOf.call(QR.posts, _this) >= 0) {
+ return _this.select();
+ }
+ };
+ })(this));
+ $.on(rm, 'click', (function(_this) {
+ return function(e) {
+ e.stopPropagation();
+ if (indexOf.call(QR.posts, _this) >= 0) {
+ return _this.rm();
+ }
+ };
+ })(this));
+ $.on(rmAll, 'click', QR.post.rmErrored);
+ return QR.error(div, true);
+ };
+
+ _Class.prototype.fileError = function(message) {
+ return this.error('file-error', this.filename + ": " + message);
+ };
+
+ _Class.prototype.dismissErrors = function(test) {
+ var error, i, len, ref;
+ if (test == null) {
+ test = function() {
+ return true;
+ };
+ }
+ if (this.errors) {
+ ref = this.errors;
+ for (i = 0, len = ref.length; i < len; i++) {
+ error = ref[i];
+ if (doc.contains(error) && test(error)) {
+ error.parentNode.previousElementSibling.click();
+ }
+ }
+ }
+ };
+
+ _Class.prototype.setFile = function(file1) {
+ var ext, ref;
+ this.file = file1;
+ if (Conf['Randomize Filename'] && g.BOARD.ID !== 'f') {
+ this.filename = "" + (Date.now() - Math.floor(Math.random() * 365 * $.DAY));
+ if (ext = this.file.name.match(QR.validExtension)) {
+ this.filename += ext[0];
+ }
+ } else {
+ this.filename = this.file.name;
+ }
+ this.filesize = $.bytesToString(this.file.size);
+ this.checkSize();
+ $.addClass(this.nodes.el, 'has-file');
+ $.queueTask(function() {
+ return QR.captcha.onPostChange();
+ });
+ URL.revokeObjectURL(this.URL);
+ this.saveFilename();
+ if (this === QR.selected) {
+ this.showFileData();
+ } else {
+ this.updateFilename();
+ }
+ this.nodes.el.style.backgroundImage = null;
+ if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) {
+ return this.fileError('Unsupported file type.');
+ } else if (/^(image|video)\//.test(this.file.type)) {
+ return this.readFile();
+ }
+ };
+
+ _Class.prototype.checkSize = function() {
+ var max;
+ max = QR.max_size;
+ if (/^video\//.test(this.file.type)) {
+ max = Math.min(max, QR.max_size_video);
+ }
+ if (this.file.size > max) {
+ return this.fileError("File too large (file: " + this.filesize + ", max: " + ($.bytesToString(max)) + ").");
+ }
+ };
+
+ _Class.prototype.readFile = function() {
+ var el, event, isVideo, onerror, onload;
+ isVideo = /^video\//.test(this.file.type);
+ el = $.el(isVideo ? 'video' : 'img');
+ if (isVideo && !el.canPlayType(this.file.type)) {
+ return;
+ }
+ event = isVideo ? 'loadeddata' : 'load';
+ onload = (function(_this) {
+ return function() {
+ $.off(el, event, onload);
+ $.off(el, 'error', onerror);
+ _this.checkDimensions(el);
+ return _this.setThumbnail(el);
+ };
+ })(this);
+ onerror = (function(_this) {
+ return function() {
+ $.off(el, event, onload);
+ $.off(el, 'error', onerror);
+ _this.fileError((isVideo ? 'Video' : 'Image') + " appears corrupt");
+ return URL.revokeObjectURL(el.src);
+ };
+ })(this);
+ $.on(el, event, onload);
+ $.on(el, 'error', onerror);
+ return el.src = URL.createObjectURL(this.file);
+ };
+
+ _Class.prototype.checkDimensions = function(el) {
+ var duration, height, max_height, max_width, ref, videoHeight, videoWidth, width;
+ if (el.tagName === 'IMG') {
+ height = el.height, width = el.width;
+ if (height > QR.max_height || width > QR.max_width) {
+ this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
+ }
+ if (height < QR.min_height || width < QR.min_width) {
+ return this.fileError("Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ }
+ } else {
+ videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration;
+ max_height = Math.min(QR.max_height, QR.max_height_video);
+ max_width = Math.min(QR.max_width, QR.max_width_video);
+ if (videoHeight > max_height || videoWidth > max_width) {
+ this.fileError("Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
+ }
+ if (videoHeight < QR.min_height || videoWidth < QR.min_width) {
+ this.fileError("Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ }
+ if (!isFinite(duration)) {
+ this.fileError('Video lacks duration metadata (try remuxing)');
+ } else if (duration > QR.max_duration_video) {
+ this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
+ }
+ if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg') && $.hasAudio(el)) {
+ return this.fileError('Audio not allowed');
+ }
+ }
+ };
+
+ _Class.prototype.setThumbnail = function(el) {
+ var cv, height, isVideo, s, width;
+ isVideo = el.tagName === 'VIDEO';
+ s = 90 * 2 * window.devicePixelRatio;
+ if (this.file.type === 'image/gif') {
+ s *= 3;
+ }
+ if (isVideo) {
+ height = el.videoHeight;
+ width = el.videoWidth;
+ } else {
+ height = el.height, width = el.width;
+ if (height < s || width < s) {
+ this.URL = el.src;
+ this.nodes.el.style.backgroundImage = "url(" + this.URL + ")";
+ return;
+ }
+ }
+ if (height <= width) {
+ width = s / height * width;
+ height = s;
+ } else {
+ height = s / width * height;
+ width = s;
+ }
+ cv = $.el('canvas');
+ cv.height = height;
+ cv.width = width;
+ cv.getContext('2d').drawImage(el, 0, 0, width, height);
+ URL.revokeObjectURL(el.src);
+ return cv.toBlob((function(_this) {
+ return function(blob) {
+ _this.URL = URL.createObjectURL(blob);
+ return _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")";
+ };
+ })(this));
+ };
+
+ _Class.prototype.rmFile = function() {
+ if (this.isLocked) {
+ return;
+ }
+ delete this.file;
+ delete this.filename;
+ delete this.filesize;
+ this.nodes.el.removeAttribute('title');
+ QR.nodes.filename.removeAttribute('title');
+ this.nodes.el.style.backgroundImage = null;
+ $.rmClass(this.nodes.el, 'has-file');
+ this.showFileData();
+ URL.revokeObjectURL(this.URL);
+ return this.dismissErrors(function(error) {
+ return $.hasClass(error, 'file-error');
+ });
+ };
+
+ _Class.prototype.saveFilename = function() {
+ this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-');
+ if (!QR.validExtension.test(this.filename)) {
+ return this.file.newName += "." + (QR.extensionFromType[this.file.type] || 'jpg');
+ }
+ };
+
+ _Class.prototype.updateFilename = function() {
+ var long;
+ long = this.filename + " (" + this.filesize + ")";
+ this.nodes.el.title = long;
+ if (this !== QR.selected) {
+ return;
+ }
+ return QR.nodes.filename.title = long;
+ };
+
+ _Class.prototype.showFileData = function() {
+ var ref;
+ if (this.file) {
+ this.updateFilename();
+ QR.nodes.filename.value = this.filename;
+ $.addClass(QR.nodes.oekaki, 'has-file');
+ $.addClass(QR.nodes.fileSubmit, 'has-file');
+ } else {
+ $.rmClass(QR.nodes.oekaki, 'has-file');
+ $.rmClass(QR.nodes.fileSubmit, 'has-file');
+ }
+ if (((ref = this.file) != null ? ref.source : void 0) != null) {
+ QR.nodes.fileSubmit.dataset.source = this.file.source;
+ } else {
+ QR.nodes.fileSubmit.removeAttribute('data-source');
+ }
+ return QR.nodes.spoiler.checked = this.spoiler;
+ };
+
+ _Class.prototype.pasteText = function(file) {
+ var reader;
+ this.pasting = true;
+ reader = new FileReader();
+ reader.onload = (function(_this) {
+ return function(e) {
+ var result;
+ result = e.target.result;
+ _this.setComment((_this.com ? _this.com + "\n" + result : result));
+ return delete _this.pasting;
+ };
+ })(this);
+ return reader.readAsText(file);
+ };
+
+ _Class.prototype.dragStart = function(e) {
+ var left, ref, top;
+ ref = this.getBoundingClientRect(), left = ref.left, top = ref.top;
+ e.dataTransfer.setDragImage(this, e.clientX - left, e.clientY - top);
+ return $.addClass(this, 'drag');
+ };
+
+ _Class.prototype.dragEnd = function() {
+ return $.rmClass(this, 'drag');
+ };
+
+ _Class.prototype.dragEnter = function() {
+ return $.addClass(this, 'over');
+ };
+
+ _Class.prototype.dragLeave = function() {
+ return $.rmClass(this, 'over');
+ };
+
+ _Class.prototype.dragOver = function(e) {
+ e.preventDefault();
+ return e.dataTransfer.dropEffect = 'move';
+ };
+
+ _Class.prototype.drop = function() {
+ var el, index, newIndex, oldIndex, post;
+ $.rmClass(this, 'over');
+ if (!this.draggable) {
+ return;
+ }
+ el = $('.drag', this.parentNode);
+ index = function(el) {
+ return slice.call(el.parentNode.children).indexOf(el);
+ };
+ oldIndex = index(el);
+ newIndex = index(this);
+ (oldIndex < newIndex ? $.after : $.before)(this, el);
+ post = QR.posts.splice(oldIndex, 1)[0];
+ QR.posts.splice(newIndex, 0, post);
+ return QR.status();
+ };
+
+ return _Class;
+
+ })();
+
+}).call(this);
+
+QuoteBacklink = (function() {
+ var QuoteBacklink;
+
+ QuoteBacklink = {
+ containers: {},
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Quote Backlinking Part 1',
+ cb: this.firstNode
+ });
+ return Callbacks.Post.push({
+ name: 'Quote Backlinking Part 2',
+ cb: this.secondNode
+ });
+ },
+ firstNode: function() {
+ var a, clone, container, containers, hash, i, j, k, len, len1, len2, link, markYours, nodes, post, quote, ref, ref1, ref2;
+ if (this.isClone || !this.quotes.length || this.isRebuilt) {
+ return;
+ }
+ markYours = Conf['Mark Quotes of You'] && ((ref = QuoteYou.db) != null ? ref.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ }) : void 0);
+ a = $.el('a', {
+ href: Build.postURL(this.board.ID, this.thread.ID, this.ID),
+ className: this.isHidden ? 'filtered backlink' : 'backlink',
+ textContent: Conf['backlink'].replace(/%(?:id|%)/g, (function(_this) {
+ return function(x) {
+ return {
+ '%id': _this.ID,
+ '%%': '%'
+ }[x];
+ };
+ })(this)) + (markYours ? '\u00A0(You)' : '')
+ });
+ ref1 = this.quotes;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ quote = ref1[i];
+ containers = [QuoteBacklink.getContainer(quote)];
+ if ((post = g.posts[quote]) && post.nodes.backlinkContainer) {
+ ref2 = post.clones;
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ clone = ref2[j];
+ containers.push(clone.nodes.backlinkContainer);
+ }
+ }
+ for (k = 0, len2 = containers.length; k < len2; k++) {
+ container = containers[k];
+ link = a.cloneNode(true);
+ nodes = container.firstChild ? [$.tn(' '), link] : [link];
+ if (Conf['Quote Previewing']) {
+ $.on(link, 'mouseover', QuotePreview.mouseover);
+ }
+ if (Conf['Quote Inlining']) {
+ $.on(link, 'click', QuoteInline.toggle);
+ if (Conf['Quote Hash Navigation']) {
+ hash = QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
+ nodes.push(hash);
+ }
+ }
+ $.add(container, nodes);
+ }
+ }
+ },
+ secondNode: function() {
+ var container;
+ if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
+ this.nodes.backlinkContainer = $('.container', this.nodes.info);
+ return;
+ }
+ if (!(this.isReply || Conf['OP Backlinks'])) {
+ return;
+ }
+ container = QuoteBacklink.getContainer(this.fullID);
+ this.nodes.backlinkContainer = container;
+ return $.add(this.nodes.info, container);
+ },
+ getContainer: function(id) {
+ var base;
+ return (base = this.containers)[id] || (base[id] = $.el('span', {
+ className: 'container'
+ }));
+ }
+ };
+
+ return QuoteBacklink;
+
+}).call(this);
+
+QuoteCT = (function() {
+ var QuoteCT;
+
+ QuoteCT = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ this.text = '\u00A0(Cross-thread)';
+ return Callbacks.Post.push({
+ name: 'Mark Cross-thread Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var board, boardID, i, len, quotelink, ref, ref1, ref2, thread, threadID;
+ if (this.isClone && this.thread === this.context.thread) {
+ return;
+ }
+ ref = this.context, board = ref.board, thread = ref.thread;
+ ref1 = this.nodes.quotelinks;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ quotelink = ref1[i];
+ ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID;
+ if (!threadID) {
+ continue;
+ }
+ if (this.isClone) {
+ quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, '');
+ }
+ if (boardID === board.ID && threadID !== thread.ID) {
+ $.add(quotelink, $.tn(QuoteCT.text));
+ }
+ }
+ }
+ };
+
+ return QuoteCT;
+
+}).call(this);
+
+QuoteInline = (function() {
+ var QuoteInline;
+
+ QuoteInline = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ return Callbacks.Post.push({
+ name: 'Quote Inlining',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, isClone, j, len, len1, link, process, ref, ref1;
+ process = QuoteInline.process;
+ isClone = this.isClone;
+ ref = this.nodes.quotelinks;
+ for (i = 0, len = ref.length; i < len; i++) {
+ link = ref[i];
+ process(link, isClone);
+ }
+ ref1 = this.nodes.backlinks;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ link = ref1[j];
+ process(link, isClone);
+ }
+ },
+ process: function(link, clone) {
+ if (Conf['Quote Hash Navigation']) {
+ if (!clone) {
+ $.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')));
+ }
+ }
+ return $.on(link, 'click', QuoteInline.toggle);
+ },
+ qiQuote: function(link, hidden) {
+ var name;
+ name = "hashlink";
+ if (hidden) {
+ name += " filtered";
+ }
+ return $.el('a', {
+ className: name,
+ textContent: '#',
+ href: link.href
+ });
+ },
+ toggle: function(e) {
+ var boardID, context, postID, quoter, ref, ref1, threadID;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ if (Conf['Inline Cross-thread Quotes Only'] && g.VIEW === 'thread' && ((ref1 = g.posts[boardID + "." + postID]) != null ? ref1.nodes.root.offsetParent : void 0)) {
+ return;
+ }
+ e.preventDefault();
+ quoter = Get.postFromNode(this);
+ context = quoter.context;
+ if ($.hasClass(this, 'inlined')) {
+ QuoteInline.rm(this, boardID, threadID, postID, context);
+ } else {
+ if ($.x("ancestor::div[@data-full-i-d='" + boardID + "." + postID + "']", this)) {
+ return;
+ }
+ QuoteInline.add(this, boardID, threadID, postID, context, quoter);
+ }
+ return this.classList.toggle('inlined');
+ },
+ findRoot: function(quotelink, isBacklink) {
+ if (isBacklink) {
+ return quotelink.parentNode.parentNode;
+ } else {
+ return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink);
+ }
+ },
+ add: function(quotelink, boardID, threadID, postID, context, quoter) {
+ var inline, isBacklink, post, qroot, root;
+ isBacklink = $.hasClass(quotelink, 'backlink');
+ inline = $.el('div', {
+ className: 'inline'
+ });
+ inline.dataset.fullID = boardID + "." + postID;
+ root = QuoteInline.findRoot(quotelink, isBacklink);
+ $.after(root, inline);
+ qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
+ $.addClass(qroot, 'hasInline');
+ new Fetcher(boardID, threadID, postID, inline, quoter);
+ if (!((post = g.posts[boardID + "." + postID]) && context.thread === post.thread)) {
+ return;
+ }
+ if (isBacklink && Conf['Forward Hiding']) {
+ $.addClass(post.nodes.root, 'forwarded');
+ post.forwarded++ || (post.forwarded = 1);
+ }
+ if (!Unread.posts) {
+ return;
+ }
+ return Unread.readSinglePost(post);
+ },
+ rm: function(quotelink, boardID, threadID, postID, context) {
+ var el, inlined, isBacklink, post, qroot, ref, root;
+ isBacklink = $.hasClass(quotelink, 'backlink');
+ root = QuoteInline.findRoot(quotelink, isBacklink);
+ root = $.x("following-sibling::div[@data-full-i-d='" + boardID + "." + postID + "'][1]", root);
+ qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
+ $.rm(root);
+ if (!$('.inline', qroot)) {
+ $.rmClass(qroot, 'hasInline');
+ }
+ if (!(el = root.firstElementChild)) {
+ return;
+ }
+ post = g.posts[boardID + "." + postID];
+ post.rmClone(el.dataset.clone);
+ if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads[boardID + "." + threadID] && !--post.forwarded) {
+ delete post.forwarded;
+ $.rmClass(post.nodes.root, 'forwarded');
+ }
+ while (inlined = $('.inlined', el)) {
+ ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ QuoteInline.rm(inlined, boardID, threadID, postID, context);
+ $.rmClass(inlined, 'inlined');
+ }
+ }
+ };
+
+ return QuoteInline;
+
+}).call(this);
+
+QuoteOP = (function() {
+ var QuoteOP,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ QuoteOP = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ this.text = '\u00A0(OP)';
+ return Callbacks.Post.push({
+ name: 'Mark OP Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1;
+ if (this.isClone && this.thread === this.context.thread) {
+ return;
+ }
+ if (!(quotes = this.quotes).length) {
+ return;
+ }
+ quotelinks = this.nodes.quotelinks;
+ if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) {
+ i = 0;
+ while (quotelink = quotelinks[i++]) {
+ quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, '');
+ }
+ }
+ fullID = this.context.thread.fullID;
+ if (indexOf.call(quotes, fullID) < 0) {
+ return;
+ }
+ i = 0;
+ while (quotelink = quotelinks[i++]) {
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((boardID + "." + postID) === fullID) {
+ $.add(quotelink, $.tn(QuoteOP.text));
+ }
+ }
+ }
+ };
+
+ return QuoteOP;
+
+}).call(this);
+
+QuotePreview = (function() {
+ var QuotePreview,
+ slice = [].slice;
+
+ QuotePreview = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Quote Previewing'])) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ return Callbacks.Post.push({
+ name: 'Quote Previewing',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, len, link, ref;
+ ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks));
+ for (i = 0, len = ref.length; i < len; i++) {
+ link = ref[i];
+ $.on(link, 'mouseover', QuotePreview.mouseover);
+ }
+ },
+ mouseover: function(e) {
+ var boardID, i, len, origin, post, postID, posts, qp, ref, threadID;
+ if ($.hasClass(this, 'inlined') || !d.contains(this)) {
+ return;
+ }
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ qp = $.el('div', {
+ id: 'qp',
+ className: 'dialog'
+ });
+ $.add(Header.hover, qp);
+ new Fetcher(boardID, threadID, postID, qp, Get.postFromNode(this));
+ UI.hover({
+ root: this,
+ el: qp,
+ latestEvent: e,
+ endEvents: 'mouseout click',
+ cb: QuotePreview.mouseout
+ });
+ if (Conf['Quote Highlighting'] && (origin = g.posts[boardID + "." + postID])) {
+ posts = [origin].concat(origin.clones);
+ posts.pop();
+ for (i = 0, len = posts.length; i < len; i++) {
+ post = posts[i];
+ $.addClass(post.nodes.post, 'qphl');
+ }
+ }
+ },
+ mouseout: function() {
+ var clone, i, len, post, ref, root;
+ if (!(root = this.el.firstElementChild)) {
+ return;
+ }
+ clone = Get.postFromRoot(root);
+ post = clone.origin;
+ post.rmClone(root.dataset.clone);
+ if (!Conf['Quote Highlighting']) {
+ return;
+ }
+ ref = [post].concat(post.clones);
+ for (i = 0, len = ref.length; i < len; i++) {
+ post = ref[i];
+ $.rmClass(post.nodes.post, 'qphl');
+ }
+ }
+ };
+
+ return QuotePreview;
+
+}).call(this);
+
+QuoteStrikeThrough = (function() {
+ var QuoteStrikeThrough;
+
+ QuoteStrikeThrough = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Strike-through Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var boardID, i, len, postID, quotelink, ref, ref1, ref2;
+ if (this.isClone) {
+ return;
+ }
+ ref = this.nodes.quotelinks;
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((ref2 = g.posts[boardID + "." + postID]) != null ? ref2.isHidden : void 0) {
+ $.addClass(quotelink, 'filtered');
+ }
+ }
+ }
+ };
+
+ return QuoteStrikeThrough;
+
+}).call(this);
+
+QuoteThreading =
+/*
+ <3 aeosynth
+ */
+
+(function() {
+ var QuoteThreading;
+
+ QuoteThreading = {
+ init: function() {
+ if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
+ return;
+ }
+ this.controls = $.el('label', {
+ innerHTML: "
Threading"
+ });
+ this.threadNewLink = $.el('span', {
+ className: 'brackets-wrap threadnewlink',
+ hidden: true
+ });
+ $.extend(this.threadNewLink, {
+ innerHTML: "
Thread New Posts "
+ });
+ this.input = $('input', this.controls);
+ this.input.checked = Conf['Thread Quotes'];
+ $.on(this.input, 'change', this.setEnabled);
+ $.on(this.input, 'change', this.rethread);
+ $.on(this.threadNewLink.firstElementChild, 'click', this.rethread);
+ $.on(d, '4chanXInitFinished', (function(_this) {
+ return function() {
+ return _this.ready = true;
+ };
+ })(this));
+ Header.menu.addEntry(this.entry = {
+ el: this.controls,
+ order: 99
+ });
+ Callbacks.Thread.push({
+ name: 'Quote Threading',
+ cb: this.setThread
+ });
+ return Callbacks.Post.push({
+ name: 'Quote Threading',
+ cb: this.node
+ });
+ },
+ parent: {},
+ children: {},
+ inserted: {},
+ setEnabled: function() {
+ var other, ref;
+ other = (ref = ReplyPruning.inputs) != null ? ref.enabled : void 0;
+ if (this.checked && (other != null ? other.checked : void 0)) {
+ other.checked = false;
+ $.event('change', null, other);
+ }
+ return $.cb.checked.call(this);
+ },
+ setThread: function() {
+ QuoteThreading.thread = this;
+ return $.asap((function() {
+ return !Conf['Thread Updater'] || $('.navLinksBot > .updatelink');
+ }), function() {
+ var navLinksBot;
+ if ((navLinksBot = $('.navLinksBot'))) {
+ return $.add(navLinksBot, [$.tn(' '), QuoteThreading.threadNewLink]);
+ }
+ });
+ },
+ node: function() {
+ var ancestor, j, lastParent, len, parent, parents, quote, ref;
+ if (this.isFetchedQuote || this.isClone || !this.isReply) {
+ return;
+ }
+ parents = new Set();
+ lastParent = null;
+ ref = this.quotes;
+ for (j = 0, len = ref.length; j < len; j++) {
+ quote = ref[j];
+ if (parent = g.posts[quote]) {
+ if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) {
+ parents.add(parent.ID);
+ if (!lastParent || parent.ID > lastParent.ID) {
+ lastParent = parent;
+ }
+ }
+ }
+ }
+ if (!lastParent) {
+ return;
+ }
+ ancestor = lastParent;
+ while (ancestor = QuoteThreading.parent[ancestor.fullID]) {
+ parents["delete"](ancestor.ID);
+ }
+ if (parents.size === 1) {
+ return QuoteThreading.parent[this.fullID] = lastParent;
+ }
+ },
+ descendants: function(post) {
+ var child, children, j, len, posts;
+ posts = [post];
+ if (children = QuoteThreading.children[post.fullID]) {
+ for (j = 0, len = children.length; j < len; j++) {
+ child = children[j];
+ posts = posts.concat(QuoteThreading.descendants(child));
+ }
+ }
+ return posts;
+ },
+ insert: function(post) {
+ var base, child, children, descendants, i, j, k, l, len, name, next, nodes, order, parent, prev, prev2, threadContainer, x;
+ if (!(Conf['Thread Quotes'] && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) {
+ return false;
+ }
+ descendants = QuoteThreading.descendants(post);
+ if (!Unread.posts.has(parent.ID)) {
+ if ((function() {
+ var j, len, x;
+ for (j = 0, len = descendants.length; j < len; j++) {
+ x = descendants[j];
+ if (Unread.posts.has(x.ID)) {
+ return true;
+ }
+ }
+ })()) {
+ QuoteThreading.threadNewLink.hidden = false;
+ return false;
+ }
+ }
+ order = Unread.order;
+ children = ((base = QuoteThreading.children)[name = parent.fullID] || (base[name] = []));
+ threadContainer = parent.nodes.threadContainer || $.el('div', {
+ className: 'threadContainer'
+ });
+ nodes = [post.nodes.root];
+ if (post.nodes.threadContainer) {
+ nodes.push(post.nodes.threadContainer);
+ }
+ i = children.length;
+ for (j = children.length - 1; j >= 0; j += -1) {
+ child = children[j];
+ if (child.ID >= post.ID) {
+ i--;
+ }
+ }
+ if (i !== children.length) {
+ next = children[i];
+ for (k = 0, len = descendants.length; k < len; k++) {
+ x = descendants[k];
+ order.before(order[next.ID], order[x.ID]);
+ }
+ children.splice(i, 0, post);
+ $.before(next.nodes.root, nodes);
+ } else {
+ prev = parent;
+ while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
+ prev = prev2[prev2.length - 1];
+ }
+ for (l = descendants.length - 1; l >= 0; l += -1) {
+ x = descendants[l];
+ order.after(order[prev.ID], order[x.ID]);
+ }
+ children.push(post);
+ $.add(threadContainer, nodes);
+ }
+ QuoteThreading.inserted[post.fullID] = true;
+ if (!parent.nodes.threadContainer) {
+ parent.nodes.threadContainer = threadContainer;
+ $.addClass(parent.nodes.root, 'threadOP');
+ $.after(parent.nodes.root, threadContainer);
+ }
+ return true;
+ },
+ rethread: function() {
+ var nodes, posts, thread;
+ if (!QuoteThreading.ready) {
+ return;
+ }
+ thread = QuoteThreading.thread;
+ posts = thread.posts;
+ QuoteThreading.threadNewLink.hidden = true;
+ if (Conf['Thread Quotes']) {
+ posts.forEach(QuoteThreading.insert);
+ } else {
+ nodes = [];
+ Unread.order = new RandomAccessList();
+ QuoteThreading.inserted = {};
+ posts.forEach(function(post) {
+ if (post.isFetchedQuote) {
+ return;
+ }
+ Unread.order.push(post);
+ if (post.isReply) {
+ nodes.push(post.nodes.root);
+ }
+ if (QuoteThreading.children[post.fullID]) {
+ delete QuoteThreading.children[post.fullID];
+ $.rmClass(post.nodes.root, 'threadOP');
+ $.rm(post.nodes.threadContainer);
+ return delete post.nodes.threadContainer;
+ }
+ });
+ $.add(thread.OP.nodes.root.parentNode, nodes);
+ }
+ Unread.position = Unread.order.first;
+ Unread.updatePosition();
+ Unread.setLine(true);
+ Unread.read();
+ return Unread.update();
+ }
+ };
+
+ return QuoteThreading;
+
+}).call(this);
+
+QuoteYou = (function() {
+ var QuoteYou;
+
+ QuoteYou = {
+ init: function() {
+ var ref;
+ if (!Conf['Remember Your Posts']) {
+ return;
+ }
+ this.db = new DataBoard('yourPosts');
+ $.sync('Remember Your Posts', function(enabled) {
+ return Conf['Remember Your Posts'] = enabled;
+ });
+ $.on(d, 'QRPostSuccessful', function(e) {
+ var boardID, postID, ref, threadID;
+ $.forceSync('Remember Your Posts');
+ if (Conf['Remember Your Posts']) {
+ ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ return QuoteYou.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ postID: postID,
+ val: true
+ });
+ }
+ });
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ if (Conf['Highlight Own Posts']) {
+ $.addClass(doc, 'highlight-own');
+ }
+ if (Conf['Highlight Posts Quoting You']) {
+ $.addClass(doc, 'highlight-you');
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ this.text = '\u00A0(You)';
+ return Callbacks.Post.push({
+ name: 'Mark Quotes of You',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, len, quotelink, ref;
+ if (this.isClone) {
+ return;
+ }
+ if (QuoteYou.db.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ })) {
+ $.addClass(this.nodes.root, 'yourPost');
+ }
+ if (!this.quotes.length) {
+ return;
+ }
+ ref = this.nodes.quotelinks;
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) {
+ continue;
+ }
+ if (Conf['Mark Quotes of You']) {
+ $.add(quotelink, $.tn(QuoteYou.text));
+ }
+ $.addClass(quotelink, 'you');
+ $.addClass(this.nodes.root, 'quotesYou');
+ }
+ },
+ cb: {
+ seek: function(type) {
+ var highlight, post, posts, result, str;
+ if (highlight = $('.highlight')) {
+ $.rmClass(highlight, 'highlight');
+ }
+ if (!(QuoteYou.lastRead && doc.contains(QuoteYou.lastRead) && $.hasClass(QuoteYou.lastRead, 'quotesYou'))) {
+ if (!(post = QuoteYou.lastRead = $('.quotesYou'))) {
+ new Notice('warning', 'No posts are currently quoting you, loser.', 20);
+ return;
+ }
+ if (QuoteYou.cb.scroll(post)) {
+ return;
+ }
+ } else {
+ post = QuoteYou.lastRead;
+ }
+ str = type + "::div[contains(@class,'quotesYou')]";
+ while ((post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0))) {
+ if (QuoteYou.cb.scroll(post)) {
+ return;
+ }
+ }
+ posts = $$('.quotesYou');
+ return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]);
+ },
+ scroll: function(root) {
+ var post;
+ post = $('.post', root);
+ if (!post.getBoundingClientRect().height) {
+ return false;
+ } else {
+ QuoteYou.lastRead = root;
+ window.location = "#" + post.id;
+ Header.scrollTo(post);
+ $.addClass(post, 'highlight');
+ return true;
+ }
+ }
+ }
+ };
+
+ return QuoteYou;
+
+}).call(this);
+
+Quotify = (function() {
+ var Quotify,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ slice = [].slice;
+
+ Quotify = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ return Callbacks.Post.push({
+ name: 'Resurrect Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var deadlink, i, len, ref;
+ if (this.isClone) {
+ return;
+ }
+ ref = $$('.deadlink', this.nodes.comment);
+ for (i = 0, len = ref.length; i < len; i++) {
+ deadlink = ref[i];
+ Quotify.parseDeadlink.call(this, deadlink);
+ }
+ },
+ parseDeadlink: function(deadlink) {
+ var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref;
+ if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
+ Quotify.fixDeadlink(deadlink);
+ return;
+ }
+ quote = deadlink.textContent;
+ if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) {
+ return;
+ }
+ if (postID[0] === '0') {
+ Quotify.fixDeadlink(deadlink);
+ return;
+ }
+ boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID;
+ quoteID = boardID + "." + postID;
+ if (post = g.posts[quoteID]) {
+ if (!post.isDead) {
+ a = $.el('a', {
+ href: Build.postURL(boardID, post.thread.ID, postID),
+ className: 'quotelink',
+ textContent: quote
+ });
+ } else {
+ a = $.el('a', {
+ href: Build.postURL(boardID, post.thread.ID, postID),
+ className: 'quotelink deadlink',
+ textContent: quote + "\u00A0(Dead)"
+ });
+ $.extend(a.dataset, {
+ boardID: boardID,
+ threadID: post.thread.ID,
+ postID: postID
+ });
+ }
+ } else {
+ redirect = Redirect.to('thread', {
+ boardID: boardID,
+ threadID: 0,
+ postID: postID
+ });
+ fetchable = Redirect.to('post', {
+ boardID: boardID,
+ postID: postID
+ });
+ if (redirect || fetchable) {
+ a = $.el('a', {
+ href: redirect || 'javascript:;',
+ className: 'deadlink',
+ textContent: quote + "\u00A0(Dead)"
+ });
+ if (fetchable) {
+ $.addClass(a, 'quotelink');
+ $.extend(a.dataset, {
+ boardID: boardID,
+ postID: postID
+ });
+ }
+ }
+ }
+ if (indexOf.call(this.quotes, quoteID) < 0) {
+ this.quotes.push(quoteID);
+ }
+ if (!a) {
+ deadlink.textContent = quote + "\u00A0(Dead)";
+ return;
+ }
+ $.replace(deadlink, a);
+ if ($.hasClass(a, 'quotelink')) {
+ return this.nodes.quotelinks.push(a);
+ }
+ },
+ fixDeadlink: function(deadlink) {
+ var el, green;
+ if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') {
+ green = $.el('span', {
+ className: 'quote'
+ });
+ $.before(deadlink, green);
+ $.add(green, deadlink);
+ }
+ return $.replace(deadlink, slice.call(deadlink.childNodes));
+ }
+ };
+
+ return Quotify;
+
+}).call(this);
+
+Main = (function() {
+ var Main;
+
+ Main = {
+ init: function() {
+ var db, flatten, items, j, key, len, ref;
+ if (d.body && !$('title', d.head)) {
+ return;
+ }
+ if (window['4chan X antidup']) {
+ return;
+ }
+ window['4chan X antidup'] = true;
+ if (location.hostname === 'www.google.com') {
+ $.get('Captcha Fixes', true, function(arg) {
+ var enabled;
+ enabled = arg['Captcha Fixes'];
+ if (enabled) {
+ return $.ready(function() {
+ return Captcha.fixes.init();
+ });
+ }
+ });
+ return;
+ }
+ $.global(function() {
+ var j, len, nuke, prop, ref;
+ nuke = function(obj, prop) {
+ try {
+ return Object.defineProperty(obj, prop, {
+ configurable: false,
+ get: function() {
+ throw new Error();
+ },
+ set: function() {
+ throw new Error();
+ }
+ });
+ } catch (_error) {}
+ };
+ ref = ['atOptions', 'adsterra_key', 'EpmadsConfig', 'epmads_key', 'EpomConfig', 'epom_key', 'exoDocumentProtocol'];
+ for (j = 0, len = ref.length; j < len; j++) {
+ prop = ref[j];
+ nuke(window, prop);
+ }
+ });
+ $.on(window, 'beforescriptexecute', function(e) {
+ var host, ref, ref1;
+ host = (ref = e.target.src.split('/')[2]) != null ? (ref1 = ref.match(/[^.]+\.[^.]+$/)) != null ? ref1[0] : void 0 : void 0;
+ if (host === 'bnhtml.com' || host === 'ecpmrocks.com' || host === 'advertisation.com' || host === 'exoclick.com') {
+ return e.preventDefault();
+ }
+ });
+ $.on(d, '4chanXInitFinished', function() {
+ if (Main.expectInitFinished) {
+ return delete Main.expectInitFinished;
+ } else {
+ new Notice('error', 'Error: Multiple copies of 4chan X are enabled.');
+ return $.addClass(doc, 'tainted');
+ }
+ });
+ flatten = function(parent, obj) {
+ var key, val;
+ if (obj instanceof Array) {
+ Conf[parent] = obj[0];
+ } else if (typeof obj === 'object') {
+ for (key in obj) {
+ val = obj[key];
+ flatten(key, val);
+ }
+ } else {
+ Conf[parent] = obj;
+ }
+ };
+ flatten(null, Config);
+ ref = DataBoard.keys;
+ for (j = 0, len = ref.length; j < len; j++) {
+ db = ref[j];
+ Conf[db] = {
+ boards: {}
+ };
+ }
+ Conf['selectedArchives'] = {};
+ Conf['cooldowns'] = {};
+ Conf['Index Sort'] = {};
+ Conf['Except Archives from Encryption'] = false;
+ Conf['JSON Navigation'] = true;
+ Conf['Oekaki Links'] = true;
+ items = {};
+ for (key in Conf) {
+ items[key] = void 0;
+ }
+ items['previousversion'] = void 0;
+ return $.get(items, function(items) {
+ return $.asap((function() {
+ var doc;
+ return doc = d.documentElement;
+ }), function() {
+ var ref1, val;
+ if ($.cantSet) {
+
+ } else if (items.previousversion == null) {
+ Main.ready(function() {
+ $.set('previousversion', g.VERSION);
+ return Settings.open();
+ });
+ } else if (items.previousversion !== g.VERSION) {
+ Main.upgrade(items);
+ }
+ for (key in Conf) {
+ val = Conf[key];
+ Conf[key] = (ref1 = items[key]) != null ? ref1 : val;
+ }
+ return Main.initFeatures();
+ });
+ });
+ },
+ upgrade: function(items) {
+ var changes, previousversion;
+ previousversion = items.previousversion;
+ changes = Settings.upgrade(items, previousversion);
+ items.previousversion = changes.previousversion = g.VERSION;
+ return $.set(changes, function() {
+ var el, ref;
+ if ((ref = items['Show Updated Notifications']) != null ? ref : true) {
+ el = $.el('span', {
+ innerHTML: "4chan X has been updated to
version " + E(g.VERSION) + " ."
+ });
+ return new Notice('info', el, 15);
+ }
+ });
+ },
+ initFeatures: function() {
+ var err, feature, hostname, j, len, match, name, pathname, ref, ref1, ref2, ref3, search;
+ hostname = location.hostname, search = location.search;
+ pathname = location.pathname.split(/\/+/);
+ if (hostname !== 'www.4chan.org') {
+ g.BOARD = new Board(pathname[1]);
+ }
+ if (hostname === 'boards.4chan.org' || hostname === 'sys.4chan.org' || hostname === 'www.4chan.org') {
+ $.global(function() {
+ document.documentElement.classList.add('js-enabled');
+ return window.FCX = {};
+ });
+ Main.jsEnabled = $.hasClass(doc, 'js-enabled');
+ }
+ switch (hostname) {
+ case 'www.4chan.org':
+ $.onExists(doc, 'body', function() {
+ return $.addStyle(CSS.www);
+ });
+ Captcha.replace.init();
+ return;
+ case 'sys.4chan.org':
+ if (pathname[2] === 'imgboard.php') {
+ if (/\bmode=report\b/.test(search)) {
+ Report.init();
+ } else if ((match = search.match(/\bres=(\d+)/))) {
+ $.ready(function() {
+ var ref;
+ if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') {
+ return Redirect.navigate('thread', {
+ boardID: g.BOARD.ID,
+ postID: +match[1]
+ });
+ }
+ });
+ }
+ } else if (pathname[2] === 'post') {
+ PostSuccessful.init();
+ }
+ return;
+ case 'i.4cdn.org':
+ if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) {
+ return;
+ }
+ $.asap((function() {
+ return d.readyState !== 'loading';
+ }), function() {
+ var ref, video;
+ if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
+ return Redirect.navigate('file', {
+ boardID: g.BOARD.ID,
+ filename: pathname[pathname.length - 1]
+ });
+ } else if (video = $('video')) {
+ if (Conf['Volume in New Tab']) {
+ Volume.setup(video);
+ }
+ if (Conf['Loop in New Tab']) {
+ video.loop = true;
+ video.controls = false;
+ video.play();
+ return ImageCommon.addControls(video);
+ }
+ }
+ });
+ return;
+ }
+ if ((ref = pathname[2]) === 'thread' || ref === 'res') {
+ g.VIEW = 'thread';
+ g.THREADID = +pathname[3];
+ } else if ((ref1 = pathname[2]) === 'catalog' || ref1 === 'archive') {
+ g.VIEW = pathname[2];
+ } else if (pathname[2].match(/^\d*$/)) {
+ g.VIEW = 'index';
+ } else {
+ return;
+ }
+ g.threads = new SimpleDict();
+ g.posts = new SimpleDict();
+ $.onExists(doc, 'body', Main.initStyle);
+ ref2 = Main.features;
+ for (j = 0, len = ref2.length; j < len; j++) {
+ ref3 = ref2[j], name = ref3[0], feature = ref3[1];
+ try {
+ feature.init();
+ } catch (_error) {
+ err = _error;
+ Main.handleErrors({
+ message: "\"" + name + "\" initialization crashed.",
+ error: err
+ });
+ }
+ }
+ return $.ready(Main.initReady);
+ },
+ initStyle: function() {
+ var keyboard, ref;
+ if (!Main.isThisPageLegit()) {
+ return;
+ }
+ if ((ref = $('link[href*=mobile]', d.head)) != null) {
+ ref.disabled = true;
+ }
+ $.addClass(doc, 'fourchan-x', 'seaweedchan');
+ $.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW);
+ if ($.engine) {
+ $.addClass(doc, $.engine);
+ }
+ $.onExists(doc, '.ad-cnt', function(ad) {
+ return $.onExists(ad, 'img', function() {
+ return $.addClass(doc, 'ads-loaded');
+ });
+ });
+ if (Conf['Autohiding Scrollbar']) {
+ $.addClass(doc, 'autohiding-scrollbar');
+ }
+ $.ready(function() {
+ if (d.body.clientHeight > doc.clientHeight && (window.innerWidth === doc.clientWidth) !== Conf['Autohiding Scrollbar']) {
+ Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar'];
+ $.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar']);
+ return $.toggleClass(doc, 'autohiding-scrollbar');
+ }
+ });
+ $.addStyle(CSS.boards, 'fourchanx-css');
+ Main.bgColorStyle = $.el('style', {
+ id: 'fourchanx-bgcolor-css'
+ });
+ keyboard = false;
+ $.on(d, 'mousedown', function() {
+ return keyboard = false;
+ });
+ $.on(d, 'keydown', function(e) {
+ if (e.keyCode === 9) {
+ return keyboard = true;
+ }
+ });
+ window.addEventListener('focus', (function() {
+ return doc.classList.toggle('keyboard-focus', keyboard);
+ }), true);
+ return Main.setClass();
+ },
+ setClass: function() {
+ var mainStyleSheet, setStyle, style, styleSheets;
+ if (g.VIEW === 'catalog') {
+ $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-'));
+ return;
+ }
+ style = 'yotsuba-b';
+ mainStyleSheet = $('link[title=switch]', d.head);
+ styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
+ setStyle = function() {
+ var bgColor, div, j, len, styleSheet;
+ $.rmClass(doc, style);
+ style = null;
+ for (j = 0, len = styleSheets.length; j < len; j++) {
+ styleSheet = styleSheets[j];
+ if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) {
+ style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-');
+ break;
+ }
+ }
+ if (style) {
+ $.addClass(doc, style);
+ return $.rm(Main.bgColorStyle);
+ } else {
+ div = $.el('div', {
+ className: 'reply'
+ });
+ div.style.cssText = 'position: absolute; visibility: hidden;';
+ $.add(d.body, div);
+ bgColor = window.getComputedStyle(div).backgroundColor;
+ $.rm(div);
+ Main.bgColorStyle.textContent = ".dialog, .suboption-list > div:last-of-type {\n background-color: " + bgColor + ";\n}";
+ return $.after($.id('fourchanx-css'), Main.bgColorStyle);
+ }
+ };
+ setStyle();
+ if (!mainStyleSheet) {
+ return;
+ }
+ return new MutationObserver(setStyle).observe(mainStyleSheet, {
+ attributes: true,
+ attributeFilter: ['href']
+ });
+ },
+ initReady: function() {
+ var msg, ref, ref1, ref2;
+ if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) {
+ ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
+ if (Conf['404 Redirect']) {
+ return Redirect.navigate('thread', {
+ boardID: g.BOARD.ID,
+ threadID: g.THREADID,
+ postID: +location.hash.match(/\d+/)
+ }, "/" + g.BOARD + "/");
+ }
+ });
+ return;
+ }
+ if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') {
+ return;
+ }
+ if (((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && !$('.board + *')) {
+ msg = $.el('div', {
+ innerHTML: "The page didn't load completely.
Some features may not work unless you
reload ."
+ });
+ $.on($('a', msg), 'click', function() {
+ return location.reload();
+ });
+ new Notice('warning', msg);
+ }
+ if (!(Conf['JSON Index'] && g.VIEW === 'index')) {
+ return Main.initThread();
+ } else {
+ Main.expectInitFinished = true;
+ return $.event('4chanXInitFinished');
+ }
+ },
+ initThread: function() {
+ var board, err, errors, j, k, len, len1, m, postRoot, posts, ref, ref1, scriptData, thread, threadRoot, threads;
+ if ((board = $('.board'))) {
+ threads = [];
+ posts = [];
+ ref = $$('.board > .thread', board);
+ for (j = 0, len = ref.length; j < len; j++) {
+ threadRoot = ref[j];
+ thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
+ threads.push(thread);
+ ref1 = $$('.thread > .postContainer', threadRoot);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ postRoot = ref1[k];
+ if ($('.postMessage', postRoot)) {
+ try {
+ posts.push(new Post(postRoot, thread, g.BOARD));
+ } catch (_error) {
+ err = _error;
+ if (!errors) {
+ errors = [];
+ }
+ errors.push({
+ message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.",
+ error: err
+ });
+ }
+ }
+ }
+ }
+ if (errors) {
+ Main.handleErrors(errors);
+ }
+ if (g.VIEW === 'thread') {
+ scriptData = Get.scriptData();
+ threads[0].postLimit = /\bbumplimit *= *1\b/.test(scriptData);
+ threads[0].fileLimit = /\bimagelimit *= *1\b/.test(scriptData);
+ threads[0].ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : void 0;
+ }
+ Main.callbackNodes('Thread', threads);
+ return Main.callbackNodesDB('Post', posts, function() {
+ var l, len2, post;
+ for (l = 0, len2 = posts.length; l < len2; l++) {
+ post = posts[l];
+ QuoteThreading.insert(post);
+ }
+ Main.expectInitFinished = true;
+ return $.event('4chanXInitFinished');
+ });
+ } else {
+ Main.expectInitFinished = true;
+ return $.event('4chanXInitFinished');
+ }
+ },
+ callbackNodes: function(klass, nodes) {
+ var cb, i, node;
+ i = 0;
+ cb = Callbacks[klass];
+ while (node = nodes[i++]) {
+ cb.execute(node);
+ }
+ },
+ callbackNodesDB: function(klass, nodes, cb) {
+ var cbs, fn, i, softTask;
+ i = 0;
+ cbs = Callbacks[klass];
+ fn = function() {
+ var node;
+ if (!(node = nodes[i])) {
+ return false;
+ }
+ cbs.execute(node);
+ return ++i % 25;
+ };
+ softTask = function() {
+ while (fn()) {
+ continue;
+ }
+ if (!nodes[i]) {
+ if (cb) {
+ cb();
+ }
+ return;
+ }
+ return setTimeout(softTask, 0);
+ };
+ return softTask();
+ },
+ handleErrors: function(errors) {
+ var div, error, j, len, logs;
+ if (!(errors instanceof Array)) {
+ error = errors;
+ } else if (errors.length === 1) {
+ error = errors[0];
+ }
+ if (error) {
+ new Notice('error', Main.parseError(error, Main.reportLink([error])), 15);
+ return;
+ }
+ div = $.el('div', {
+ innerHTML: E(errors.length) + " errors occurred." + (Main.reportLink(errors)).innerHTML + " [
show ]"
+ });
+ $.on(div.lastElementChild, 'click', function() {
+ var ref;
+ return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref;
+ });
+ logs = $.el('div', {
+ hidden: true
+ });
+ for (j = 0, len = errors.length; j < len; j++) {
+ error = errors[j];
+ $.add(logs, Main.parseError(error));
+ }
+ return new Notice('error', [div, logs], 30);
+ },
+ parseError: function(data, reportLink) {
+ var context, error, lines, message, ref, ref1;
+ c.error(data.message, data.error.stack);
+ message = $.el('div', {
+ innerHTML: E(data.message) + ((reportLink) ? (reportLink).innerHTML : "")
+ });
+ error = $.el('div', {
+ textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
+ });
+ lines = ((ref = data.error.stack) != null ? (ref1 = ref.match(/\d+(?=:\d+\)?$)/mg)) != null ? ref1.join().replace(/^/, ' at ') : void 0 : void 0) || '';
+ context = $.el('div', {
+ textContent: "(4chan X ccd0 v" + g.VERSION + " " + $.platform + " on " + $.engine + lines + ")"
+ });
+ return [message, error, context];
+ },
+ reportLink: function(errors) {
+ var data, details, ref, title, url;
+ data = errors[0];
+ title = data.message;
+ if (errors.length > 1) {
+ title += " (+" + (errors.length - 1) + " other errors)";
+ }
+ details = "[Please describe the steps needed to reproduce this error.]\n\nScript: 4chan X ccd0 v" + g.VERSION + " " + $.platform + "\nUser agent: " + navigator.userAgent + "\nURL: " + location.href + "\n\n" + data.error + "\n" + (((ref = data.error.stack) != null ? ref.replace(data.error.toString(), '').trim() : void 0) || '');
+ details = details.replace(/file:\/{3}.+\//g, '');
+ url = "https://gitreports.com/issue/ccd0/4chan-x?issue_title=" + (encodeURIComponent(title)) + "&details=" + (encodeURIComponent(details));
+ return {
+ innerHTML: "
[report ] "
+ };
+ },
+ 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');
+ }
+ return Main.thisPageIsLegit;
+ },
+ ready: function(cb) {
+ return $.ready(function() {
+ if (Main.isThisPageLegit()) {
+ return cb();
+ }
+ });
+ },
+ features: [['Polyfill', Polyfill], ['Normalize URL', NormalizeURL], ['Captcha Configuration', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply Personas', QR.persona], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Edit Link', QR.oekaki.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash], ['Reply Pruning', ReplyPruning]]
+ };
+
+ return Main;
+
+}).call(this);
+
+Main.init();
}).call(this);
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index 7c4320766..8e7b1865d 100644
Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ
diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js
index 171427df9..d2724fc43 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.11.30.3
+// @version 1.11.31.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 7c43b962e..ec07ab623 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,7 +1,6 @@
-// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
-// @version 1.11.30.3
+// @version 1.11.31.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -107,7 +106,7 @@
/*
* Contains data from external sources:
*
-* audio/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/
+* src/Monitoring/ThreadUpdater/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/
* cc-by-nc-3.0
*
* Font Awesome by Dave Gandy (http://fontawesome.io)
@@ -119,12 +118,56 @@
'use strict';
(function() {
- var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, NormalizeURL, Notice, PSAHiding, PassLink, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReplyPruning, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g,
- slice = [].slice,
- indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty,
- bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, CSS, Callbacks, Captcha, CatalogLinks, CatalogThread, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, NormalizeURL, Notice, PSAHiding, PassLink, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReplyPruning, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume;
+
+var Conf, E, c, d, doc, g;
+
+Conf = {};
+c = console;
+d = document;
+doc = d.documentElement;
+
+g = {
+ VERSION: '1.11.31.0',
+ NAMESPACE: '4chan X.',
+ boards: {}
+};
+
+E = (function() {
+ var fn, r, regex, str;
+ str = {
+ '&': '&',
+ "'": ''',
+ '"': '"',
+ '<': '<',
+ '>': '>'
+ };
+ r = String.prototype.replace;
+ regex = /[&"'<>]/g;
+ fn = function(x) {
+ return str[x];
+ };
+ return function(text) {
+ return r.call(text, regex, fn);
+ };
+})();
+
+E.cat = function(templates) {
+ var html, i, len;
+ html = '';
+ for (i = 0, len = templates.length; i < len; i++) {
+ html += templates[i].innerHTML;
+ }
+ return html;
+};
+
+E.url = function(content) {
+ return "data:text/html;charset=utf-8," + encodeURIComponent(content.innerHTML);
+};
+
+Config = (function() {
+ var Config;
Config = {
main: {
@@ -368,7 +411,7 @@
":root.tomorrow div.boardTitle {\n" +
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n" +
-"}",
+"}\n",
hotkeys: {
'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'],
'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'],
@@ -434,18204 +477,23 @@
'Autohiding Scrollbar': false
};
- Conf = {};
+ return Config;
- c = console;
+}).call(this);
- d = document;
+CSS = {
- doc = d.documentElement;
-
- g = {
- VERSION: '1.11.30.3',
- NAMESPACE: '4chan X.',
- boards: {}
- };
-
- E = (function() {
- var fn, r, regex, str;
- str = {
- '&': '&',
- "'": ''',
- '"': '"',
- '<': '<',
- '>': '>'
- };
- r = String.prototype.replace;
- regex = /[&"'<>]/g;
- fn = function(x) {
- return str[x];
- };
- return function(text) {
- return r.call(text, regex, fn);
- };
- })();
-
- E.cat = function(templates) {
- var html, k, len1, x;
- html = '';
- for (k = 0, len1 = templates.length; k < len1; k++) {
- x = templates[k];
- html += x.innerHTML;
- }
- return html;
- };
-
- E.url = function(content) {
- return "data:text/html;charset=utf-8," + (encodeURIComponent(content.innerHTML));
- };
-
- $ = function(selector, root) {
- if (root == null) {
- root = d.body;
- }
- return root.querySelector(selector);
- };
-
- $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000)));
-
- $.id = function(id) {
- return d.getElementById(id);
- };
-
- $.ready = function(fc) {
- var cb;
- if (d.readyState !== 'loading') {
- $.queueTask(fc);
- return;
- }
- cb = function() {
- $.off(d, 'DOMContentLoaded', cb);
- return fc();
- };
- return $.on(d, 'DOMContentLoaded', cb);
- };
-
- $.formData = function(form) {
- var fd, key, val;
- if (form instanceof HTMLFormElement) {
- return new FormData(form);
- }
- fd = new FormData();
- for (key in form) {
- val = form[key];
- if (val) {
- if (typeof val === 'object' && 'newName' in val) {
- fd.append(key, val, val.newName);
- } else {
- fd.append(key, val);
- }
- }
- }
- return fd;
- };
-
- $.extend = function(object, properties) {
- var key, val;
- for (key in properties) {
- val = properties[key];
- object[key] = val;
- }
- };
-
- $.ajax = (function() {
- var blockedError, blockedURLs, lastModified;
- lastModified = {};
- blockedURLs = {};
- blockedError = function(url) {
- var message;
- if (blockedURLs[url]) {
- return;
- }
- blockedURLs[url] = true;
- message = $.el('div', {
- innerHTML: "4chan X was blocked from loading the following URL:
[
More info ]"
- });
- $('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
- return new Notice('warning', message, 30, function() {
- return delete blockedURLs[url];
- });
- };
- return function(url, options, extra) {
- var err, event, form, k, len1, r, ref, ref1, type, upCallbacks, whenModified;
- if (options == null) {
- options = {};
- }
- if (extra == null) {
- extra = {};
- }
- type = extra.type, whenModified = extra.whenModified, upCallbacks = extra.upCallbacks, form = extra.form;
- url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/');
- r = new XMLHttpRequest();
- type || (type = form && 'post' || 'get');
- try {
- r.open(type, url, true);
- } catch (_error) {
- err = _error;
- blockedError(url);
- ref = ['error', 'loadend'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- event = ref[k];
- r["on" + event] = options["on" + event];
- $.queueTask($.event, event, null, r);
- }
- return;
- }
- if (whenModified) {
- if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
- r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
- }
- $.on(r, 'load', function() {
- return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
- });
- }
- if (/\.json$/.test(url)) {
- if (options.responseType == null) {
- options.responseType = 'json';
- }
- }
- $.extend(r, options);
- if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
- Object.defineProperty(r, 'response', {
- configurable: true,
- enumerable: true,
- get: function() {
- return JSON.parse(r.responseText);
- }
- });
- }
- $.extend(r.upload, upCallbacks);
- r.send(form);
- return r;
- };
- })();
-
- (function() {
- var reqs;
- reqs = {};
- $.cache = function(url, cb, options) {
- var err, req, rm;
- if (req = reqs[url]) {
- if (req.readyState === 4) {
- $.queueTask(function() {
- return cb.call(req, req.evt, true);
- });
- } else {
- req.callbacks.push(cb);
- }
- return req;
- }
- rm = function() {
- return delete reqs[url];
- };
- try {
- if (!(req = $.ajax(url, options))) {
- return;
- }
- } catch (_error) {
- err = _error;
- return;
- }
- $.on(req, 'load', function(e) {
- var fn1, k, len1, ref;
- this.evt = e;
- ref = this.callbacks;
- fn1 = (function(_this) {
- return function(cb) {
- return $.queueTask(function() {
- return cb.call(_this, e, false);
- });
- };
- })(this);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- cb = ref[k];
- fn1(cb);
- }
- return delete this.callbacks;
- });
- $.on(req, 'abort error', rm);
- req.callbacks = [cb];
- return reqs[url] = req;
- };
- return $.cleanCache = function(testf) {
- var url;
- for (url in reqs) {
- if (testf(url)) {
- delete reqs[url];
- }
- }
- };
- })();
-
- $.cb = {
- checked: function() {
- $.set(this.name, this.checked);
- return Conf[this.name] = this.checked;
- },
- value: function() {
- $.set(this.name, this.value.trim());
- return Conf[this.name] = this.value;
- }
- };
-
- $.asap = function(test, cb) {
- if (test()) {
- return cb();
- } else {
- return setTimeout($.asap, 25, test, cb);
- }
- };
-
- $.onExists = function(root, selector, cb) {
- var el, observer;
- if (el = $(selector, root)) {
- return cb(el);
- }
- if ($.engine === 'edge' && d.readyState === 'loading') {
- $.asap((function() {
- return d.readyState !== 'loading' || $(selector, root);
- }), function() {
- return $.onExists(root, selector, cb);
- });
- return;
- }
- observer = new MutationObserver(function() {
- if (el = $(selector, root)) {
- observer.disconnect();
- return cb(el);
- }
- });
- return observer.observe(root, {
- childList: true,
- subtree: true
- });
- };
-
- $.addStyle = function(css, id, test) {
- var style;
- if (test == null) {
- test = 'head';
- }
- style = $.el('style', {
- textContent: css
- });
- if (id != null) {
- style.id = id;
- }
- $.onExists(doc, test, function() {
- return $.add(d.head, style);
- });
- return style;
- };
-
- $.x = function(path, root) {
- root || (root = d.body);
- return d.evaluate(path, root, null, 8, null).singleNodeValue;
- };
-
- $.X = function(path, root) {
- root || (root = d.body);
- return d.evaluate(path, root, null, 7, null);
- };
-
- $.addClass = function() {
- var className, classNames, el, k, len1;
- el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
- for (k = 0, len1 = classNames.length; k < len1; k++) {
- className = classNames[k];
- el.classList.add(className);
- }
- };
-
- $.rmClass = function() {
- var className, classNames, el, k, len1;
- el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
- for (k = 0, len1 = classNames.length; k < len1; k++) {
- className = classNames[k];
- el.classList.remove(className);
- }
- };
-
- $.toggleClass = function(el, className) {
- return el.classList.toggle(className);
- };
-
- $.hasClass = function(el, className) {
- return indexOf.call(el.classList, className) >= 0;
- };
-
- $.rm = function(el) {
- return el != null ? el.remove() : void 0;
- };
-
- $.rmAll = function(root) {
- return root.textContent = null;
- };
-
- $.tn = function(s) {
- return d.createTextNode(s);
- };
-
- $.frag = function() {
- return d.createDocumentFragment();
- };
-
- $.nodes = function(nodes) {
- var frag, k, len1, node;
- if (!(nodes instanceof Array)) {
- return nodes;
- }
- frag = $.frag();
- for (k = 0, len1 = nodes.length; k < len1; k++) {
- node = nodes[k];
- frag.appendChild(node);
- }
- return frag;
- };
-
- $.add = function(parent, el) {
- return parent.appendChild($.nodes(el));
- };
-
- $.prepend = function(parent, el) {
- return parent.insertBefore($.nodes(el), parent.firstChild);
- };
-
- $.after = function(root, el) {
- return root.parentNode.insertBefore($.nodes(el), root.nextSibling);
- };
-
- $.before = function(root, el) {
- return root.parentNode.insertBefore($.nodes(el), root);
- };
-
- $.replace = function(root, el) {
- return root.parentNode.replaceChild($.nodes(el), root);
- };
-
- $.el = function(tag, properties, properties2) {
- var el;
- el = d.createElement(tag);
- if (properties) {
- $.extend(el, properties);
- }
- if (properties2) {
- $.extend(el, properties2);
- }
- return el;
- };
-
- $.on = function(el, events, handler) {
- var event, k, len1, ref;
- ref = events.split(' ');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- event = ref[k];
- el.addEventListener(event, handler, false);
- }
- };
-
- $.off = function(el, events, handler) {
- var event, k, len1, ref;
- ref = events.split(' ');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- event = ref[k];
- el.removeEventListener(event, handler, false);
- }
- };
-
- $.one = function(el, events, handler) {
- var cb;
- cb = function(e) {
- $.off(el, events, cb);
- return handler.call(this, e);
- };
- return $.on(el, events, cb);
- };
-
- $.event = function(event, detail, root) {
- if (root == null) {
- root = d;
- }
- if ((detail != null) && typeof cloneInto === 'function') {
- detail = cloneInto(detail, d.defaultView);
- }
- return root.dispatchEvent(new CustomEvent(event, {
- bubbles: true,
- detail: detail
- }));
- };
-
- (function() {
- var clone, err, ref, unsafeConstructors;
- if (!(/PaleMoon\//.test(navigator.userAgent) && +(typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.version) != null ? ref.split('.')[0] : void 0 : void 0) >= 2 && typeof cloneInto === 'undefined')) {
- return;
- }
- try {
- return new CustomEvent('x', {
- detail: {}
- });
- } catch (_error) {
- err = _error;
- unsafeConstructors = {
- Object: unsafeWindow.Object,
- Array: unsafeWindow.Array
- };
- clone = function(obj) {
- var constructor, key, obj2, val;
- if ((obj != null) && typeof obj === 'object' && (constructor = unsafeConstructors[obj.constructor.name])) {
- obj2 = new constructor();
- for (key in obj) {
- val = obj[key];
- obj2[key] = clone(val);
- }
- return obj2;
- } else {
- return obj;
- }
- };
- return $.event = function(event, detail, root) {
- if (root == null) {
- root = d;
- }
- return root.dispatchEvent(new CustomEvent(event, {
- bubbles: true,
- detail: clone(detail)
- }));
- };
- }
- })();
-
- $.open = typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) {
- return window.open(url, '_blank');
- };
-
- $.debounce = function(wait, fn) {
- var args, exec, lastCall, that, timeout;
- lastCall = 0;
- timeout = null;
- that = null;
- args = null;
- exec = function() {
- lastCall = Date.now();
- return fn.apply(that, args);
- };
- return function() {
- args = arguments;
- that = this;
- if (lastCall < Date.now() - wait) {
- return exec();
- }
- clearTimeout(timeout);
- return timeout = setTimeout(exec, wait);
- };
- };
-
- $.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);
- return func.apply(func, args);
- };
- if (window.MessageChannel) {
- taskChannel = new MessageChannel();
- taskChannel.port1.onmessage = execTask;
- return function() {
- taskQueue.push(arguments);
- return taskChannel.port2.postMessage(null);
- };
- } else {
- return function() {
- taskQueue.push(arguments);
- return setTimeout(execTask, 0);
- };
- }
- })();
-
- $.globalEval = function(code) {
- var script;
- script = $.el('script', {
- textContent: code
- });
- $.add(d.head || doc, script);
- return $.rm(script);
- };
-
- $.global = function(fn) {
- if (doc) {
- return $.globalEval("(" + fn + ")();");
- } else {
- return fn();
- }
- };
-
- $.bytesToString = function(size) {
- var unit;
- unit = 0;
- while (size >= 1024) {
- size /= 1024;
- unit++;
- }
- size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size);
- return size + " " + ['B', 'KB', 'MB', 'GB'][unit];
- };
-
- $.minmax = function(value, min, max) {
- return (value < min ? min : value > max ? max : value);
- };
-
- $.hasAudio = function(video) {
- return video.mozHasAudio || !!video.webkitAudioDecodedByteCount;
- };
-
- $.engine = (function() {
- if (/Edge\//.test(navigator.userAgent)) {
- return 'edge';
- }
- if (/Chrome\//.test(navigator.userAgent)) {
- return 'blink';
- }
- if (/WebKit\//.test(navigator.userAgent)) {
- return 'webkit';
- }
- if (/Gecko\/|Goanna/.test(navigator.userAgent)) {
- return 'gecko';
- }
- })();
-
- try {
- localStorage.getItem('x');
- $.hasStorage = true;
- } catch (_error) {
- $.hasStorage = false;
- }
-
- $.item = function(key, val) {
- var item;
- item = {};
- item[key] = val;
- return item;
- };
-
- $.syncing = {};
-
- if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
- $.getValue = GM_getValue;
- $.listValues = function() {
- return GM_listValues();
- };
- } else if ($.hasStorage) {
- $.getValue = function(key) {
- return localStorage[key];
- };
- $.listValues = function() {
- var key, results;
- results = [];
- for (key in localStorage) {
- if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
- results.push(key);
- }
- }
- return results;
- };
- } else {
- $.getValue = function() {};
- $.listValues = function() {
- return [];
- };
- }
-
- if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
- $.setValue = GM_setValue;
- $.deleteValue = GM_deleteValue;
- } else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
- $.oldValue = {};
- $.setValue = function(key, val) {
- GM_setValue(key, val);
- if (key in $.syncing) {
- $.oldValue[key] = val;
- if ($.hasStorage) {
- return localStorage[key] = val;
- }
- }
- };
- $.deleteValue = function(key) {
- GM_deleteValue(key);
- if (key in $.syncing) {
- delete $.oldValue[key];
- if ($.hasStorage) {
- return localStorage.removeItem(key);
- }
- }
- };
- if (!$.hasStorage) {
- $.cantSync = true;
- }
- } else if ($.hasStorage) {
- $.oldValue = {};
- $.setValue = function(key, val) {
- if (key in $.syncing) {
- $.oldValue[key] = val;
- }
- return localStorage[key] = val;
- };
- $.deleteValue = function(key) {
- if (key in $.syncing) {
- delete $.oldValue[key];
- }
- return localStorage.removeItem(key);
- };
- } else {
- $.setValue = function() {};
- $.deleteValue = function() {};
- $.cantSync = $.cantSet = true;
- }
-
- if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
- $.sync = function(key, cb) {
- return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) {
- if (remote) {
- if (newValue !== void 0) {
- newValue = JSON.parse(newValue);
- }
- return cb(newValue, key);
- }
- });
- };
- $.forceSync = function() {};
- } else if ((typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) || $.hasStorage) {
- $.sync = function(key, cb) {
- key = g.NAMESPACE + key;
- $.syncing[key] = cb;
- return $.oldValue[key] = $.getValue(key);
- };
- (function() {
- var onChange;
- onChange = function(arg) {
- var cb, key, newValue;
- key = arg.key, newValue = arg.newValue;
- if (!(cb = $.syncing[key])) {
- return;
- }
- if (newValue != null) {
- if (newValue === $.oldValue[key]) {
- return;
- }
- $.oldValue[key] = newValue;
- return cb(JSON.parse(newValue), key.slice(g.NAMESPACE.length));
- } else {
- if ($.oldValue[key] == null) {
- return;
- }
- delete $.oldValue[key];
- return cb(void 0, key.slice(g.NAMESPACE.length));
- }
- };
- $.on(window, 'storage', onChange);
- return $.forceSync = function(key) {
- key = g.NAMESPACE + key;
- return onChange({
- key: key,
- newValue: $.getValue(key)
- });
- };
- })();
- } else {
- $.sync = function() {};
- $.forceSync = function() {};
- }
-
- $["delete"] = function(keys) {
- var k, key, len1;
- if (!(keys instanceof Array)) {
- keys = [keys];
- }
- for (k = 0, len1 = keys.length; k < len1; k++) {
- key = keys[k];
- $.deleteValue(g.NAMESPACE + key);
- }
- };
-
- $.get = function(key, val, cb) {
- var items;
- if (typeof cb === 'function') {
- items = $.item(key, val);
- } else {
- items = key;
- cb = val;
- }
- return $.queueTask(function() {
- for (key in items) {
- if (val = $.getValue(g.NAMESPACE + key)) {
- items[key] = JSON.parse(val);
- }
- }
- return cb(items);
- });
- };
-
- $.set = function(keys, val, cb) {
- var key, value;
- if (typeof keys === 'string') {
- $.setValue(g.NAMESPACE + keys, JSON.stringify(val));
- } else {
- for (key in keys) {
- value = keys[key];
- $.setValue(g.NAMESPACE + key, JSON.stringify(value));
- }
- cb = val;
- }
- return typeof cb === "function" ? cb() : void 0;
- };
-
- $.clear = function(cb) {
- var id;
- $["delete"](Object.keys(Conf));
- $["delete"](['previousversion', 'AutoWatch', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']);
- $["delete"]((function() {
- var k, len1, ref, results;
- ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
- results = [];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- id = ref[k];
- results.push(id + ".position");
- }
- return results;
- })());
- try {
- $["delete"]($.listValues().map(function(key) {
- return key.replace(g.NAMESPACE, '');
- }));
- } catch (_error) {}
- return typeof cb === "function" ? cb() : void 0;
- };
-
- $$ = function(selector, root) {
- if (root == null) {
- root = d.body;
- }
- return slice.call(root.querySelectorAll(selector));
- };
-
- Callbacks = (function() {
- function Callbacks(type1) {
- this.type = type1;
- this.keys = [];
- }
-
- Callbacks.prototype.push = function(arg) {
- var cb, name;
- name = arg.name, cb = arg.cb;
- if (!this[name]) {
- this.keys.push(name);
- }
- return this[name] = cb;
- };
-
- Callbacks.prototype.execute = function(node, keys) {
- var err, errors, k, len1, name, ref;
- if (keys == null) {
- keys = this.keys;
- }
- for (k = 0, len1 = keys.length; k < len1; k++) {
- name = keys[k];
- try {
- if ((ref = this[name]) != null) {
- ref.call(node);
- }
- } catch (_error) {
- err = _error;
- if (!errors) {
- errors = [];
- }
- errors.push({
- message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''),
- error: err
- });
- }
- }
- if (errors) {
- return Main.handleErrors(errors);
- }
- };
-
- return Callbacks;
-
- })();
-
- Board = (function() {
- Board.prototype.toString = function() {
- return this.ID;
- };
-
- function Board(ID1) {
- this.ID = ID1;
- this.threads = new SimpleDict();
- this.posts = new SimpleDict();
- g.boards[this] = this;
- }
-
- return Board;
-
- })();
-
- Thread = (function() {
- Thread.callbacks = new Callbacks('Thread');
-
- Thread.prototype.toString = function() {
- return this.ID;
- };
-
- function Thread(ID1, board1) {
- this.ID = ID1;
- this.board = board1;
- this.fullID = this.board + "." + this.ID;
- this.posts = new SimpleDict();
- this.isDead = false;
- this.isHidden = false;
- this.isOnTop = false;
- this.isSticky = false;
- this.isClosed = false;
- this.isArchived = false;
- this.postLimit = false;
- this.fileLimit = false;
- this.ipCount = void 0;
- this.OP = null;
- this.catalogView = null;
- this.board.threads.push(this.ID, this);
- g.threads.push(this.fullID, this);
- }
-
- Thread.prototype.setPage = function(pageNum) {
- var icon, info, quote, ref;
- ref = this.OP.nodes, info = ref.info, quote = ref.quote;
- if (!(icon = $('.page-num', info))) {
- icon = $.el('span', {
- className: 'page-num'
- });
- $.after(quote, [$.tn(' '), icon]);
- }
- icon.title = "This thread is on page " + pageNum + " in the original index.";
- icon.textContent = "[" + pageNum + "]";
- if (this.catalogView) {
- return this.catalogView.nodes.pageCount.textContent = pageNum;
- }
- };
-
- Thread.prototype.setCount = function(type, count, reachedLimit) {
- var el;
- if (!this.catalogView) {
- return;
- }
- el = this.catalogView.nodes[type + "Count"];
- el.textContent = count;
- return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning');
- };
-
- Thread.prototype.setStatus = function(type, status) {
- var name;
- name = "is" + type;
- if (this[name] === status) {
- return;
- }
- this[name] = status;
- if (!this.OP) {
- return;
- }
- this.setIcon('Sticky', this.isSticky);
- this.setIcon('Closed', this.isClosed && !this.isArchived);
- return this.setIcon('Archived', this.isArchived);
- };
-
- Thread.prototype.setIcon = function(type, status) {
- var icon, root, typeLC;
- typeLC = type.toLowerCase();
- icon = $("." + typeLC + "Icon", this.OP.nodes.info);
- if (!!icon === status) {
- return;
- }
- if (!status) {
- $.rm(icon.previousSibling);
- $.rm(icon);
- if (this.catalogView) {
- $.rm($("." + typeLC + "Icon", this.catalogView.nodes.icons));
- }
- return;
- }
- icon = $.el('img', {
- src: "" + Build.staticPath + typeLC + Build.gifIcon,
- alt: type,
- title: type,
- className: typeLC + "Icon retina"
- });
- root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote;
- $.after(root, [$.tn(' '), icon]);
- if (!this.catalogView) {
- return;
- }
- return (type === 'Sticky' && this.isClosed ? $.prepend : $.add)(this.catalogView.nodes.icons, icon.cloneNode());
- };
-
- Thread.prototype.kill = function() {
- return this.isDead = true;
- };
-
- Thread.prototype.collect = function() {
- this.posts.forEach(function(post) {
- return post.collect();
- });
- g.threads.rm(this.fullID);
- return this.board.threads.rm(this);
- };
-
- return Thread;
-
- })();
-
- CatalogThread = (function() {
- CatalogThread.callbacks = new Callbacks('Catalog Thread');
-
- CatalogThread.prototype.toString = function() {
- return this.ID;
- };
-
- function CatalogThread(root, thread1) {
- this.thread = thread1;
- this.ID = this.thread.ID;
- this.board = this.thread.board;
- this.nodes = {
- root: root,
- thumb: $('.catalog-thumb', root),
- icons: $('.catalog-icons', root),
- postCount: $('.post-count', root),
- fileCount: $('.file-count', root),
- pageCount: $('.page-count', root),
- comment: $('.comment', root)
- };
- this.thread.catalogView = this;
- }
-
- return CatalogThread;
-
- })();
-
- Post = (function() {
- Post.callbacks = new Callbacks('Post');
-
- Post.prototype.toString = function() {
- return this.ID;
- };
-
- function Post(root, thread1, board1) {
- var capcode, clone, date, email, flag, info, k, len1, name, post, ref, subject, tripcode, uniqueID;
- this.thread = thread1;
- this.board = board1;
- this.ID = +root.id.slice(2);
- this.fullID = this.board + "." + this.ID;
- this.context = this;
- root.dataset.fullID = this.fullID;
- post = $('.post', root);
- info = $('.postInfo', post);
- this.nodes = {
- root: root,
- post: post,
- info: info,
- nameBlock: $('.nameBlock', info),
- quote: $('.postNum > a:nth-of-type(2)', info),
- comment: $('.postMessage', post),
- links: [],
- quotelinks: []
- };
- if ($.engine === 'edge') {
- Object.defineProperty(this.nodes, 'backlinks', {
- configurable: true,
- enumerable: true,
- get: function() {
- return info.getElementsByClassName('backlink');
- }
- });
- } else {
- this.nodes.backlinks = info.getElementsByClassName('backlink');
- }
- if (!(this.isReply = $.hasClass(post, 'reply'))) {
- this.thread.OP = this;
- this.thread.isArchived = !!$('.archivedIcon', info);
- this.thread.isSticky = !!$('.stickyIcon', info);
- this.thread.isClosed = this.thread.isArchived || !!$('.closedIcon', info);
- if (this.thread.isArchived) {
- this.thread.kill();
- }
- }
- this.info = {};
- this.info.nameBlock = Conf['Anonymize'] ? 'Anonymous' : this.nodes.nameBlock.textContent.trim();
- if (subject = $('.subject', info)) {
- this.nodes.subject = subject;
- this.info.subject = subject.textContent || void 0;
- }
- if (name = $('.name', info)) {
- this.nodes.name = name;
- this.info.name = name.textContent;
- }
- if (email = $('.useremail', info)) {
- this.nodes.email = email;
- this.info.email = decodeURIComponent(email.href.slice(7));
- }
- if (tripcode = $('.postertrip', info)) {
- this.nodes.tripcode = tripcode;
- this.info.tripcode = tripcode.textContent;
- }
- if (uniqueID = $('.posteruid', info)) {
- this.nodes.uniqueID = uniqueID;
- this.info.uniqueID = uniqueID.firstElementChild.textContent;
- }
- if (capcode = $('.capcode.hand', info)) {
- this.nodes.capcode = capcode;
- this.info.capcode = capcode.textContent.replace('## ', '');
- }
- if (flag = $('.flag, .countryFlag', info)) {
- this.nodes.flag = flag;
- this.info.flag = flag.title;
- }
- if (date = $('.dateTime', info)) {
- this.nodes.date = date;
- this.info.date = new Date(date.dataset.utc * 1000);
- }
- this.parseComment();
- this.parseQuotes();
- this.parseFile();
- this.isDead = false;
- this.isHidden = false;
- this.clones = [];
- if (g.posts[this.fullID]) {
- this.isRebuilt = true;
- this.clones = g.posts[this.fullID].clones;
- ref = this.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.origin = this;
- }
- }
- this.board.posts.push(this.ID, this);
- this.thread.posts.push(this.ID, this);
- g.posts.push(this.fullID, this);
- }
-
- Post.prototype.parseComment = function() {
- var abbr, bq, commentDisplay, k, len1, len2, node, q, ref, spoilers;
- this.nodes.comment.normalize();
- bq = this.nodes.comment.cloneNode(true);
- ref = $$('.abbr + br, .exif, b, .fortune', bq);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- node = ref[k];
- $.rm(node);
- }
- if (abbr = $('.abbr', bq)) {
- $.rm(abbr);
- }
- this.info.comment = this.nodesToText(bq);
- if (abbr) {
- this.info.comment = this.info.comment.replace(/\n\n$/, '');
- }
- commentDisplay = this.info.comment;
- if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) {
- spoilers = $$('s', bq);
- if (spoilers.length) {
- for (q = 0, len2 = spoilers.length; q < len2; q++) {
- node = spoilers[q];
- $.replace(node, $.tn('[spoiler]'));
- }
- commentDisplay = this.nodesToText(bq);
- }
- }
- return this.info.commentDisplay = commentDisplay.trim().replace(/\s+$/gm, '');
- };
-
- Post.prototype.nodesToText = function(bq) {
- var i, node, nodes, text;
- text = "";
- nodes = $.X('.//br|.//text()', bq);
- i = 0;
- while (node = nodes.snapshotItem(i++)) {
- text += node.data || '\n';
- }
- return text;
- };
-
- Post.prototype.parseQuotes = function() {
- var k, len1, quotelink, ref;
- this.quotes = [];
- ref = $$(':not(pre) > .quotelink', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- this.parseQuote(quotelink);
- }
- };
-
- Post.prototype.parseQuote = function(quotelink) {
- var fullID, match;
- match = quotelink.href.match(/^https?:\/\/boards\.4chan\.org\/+([^\/]+)\/+(?:res|thread)\/+\d+(?:\/[^#]*)?#p(\d+)$/);
- if (!(match || (this.isClone && quotelink.dataset.postID))) {
- return;
- }
- this.nodes.quotelinks.push(quotelink);
- if (this.isClone) {
- return;
- }
- fullID = match[1] + "." + match[2];
- if (indexOf.call(this.quotes, fullID) < 0) {
- return this.quotes.push(fullID);
- }
- };
-
- Post.prototype.parseFile = function() {
- var fileEl, fileText, info, link, m, ref, ref1, ref2, size, thumb, unit;
- if (!(fileEl = $('.file', this.nodes.post))) {
- return;
- }
- if (!(link = $('.fileText > a, .fileText-original > a', fileEl))) {
- return;
- }
- if (!(info = (ref = link.nextSibling) != null ? ref.textContent.match(/\(([\d.]+ [KMG]?B).*\)/) : void 0)) {
- return;
- }
- fileText = fileEl.firstElementChild;
- this.file = {
- text: fileText,
- link: link,
- url: link.href,
- name: fileText.title || link.title || link.textContent,
- size: info[1],
- isImage: /(jpg|png|gif)$/i.test(link.href),
- isVideo: /webm$/i.test(link.href),
- dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0,
- tag: (ref2 = info[0].match(/,[^,]*, ([a-z]+)\)/i)) != null ? ref2[1] : void 0
- };
- size = +this.file.size.match(/[\d.]+/)[0];
- unit = ['B', 'KB', 'MB', 'GB'].indexOf(this.file.size.match(/\w+$/)[0]);
- while (unit-- > 0) {
- size *= 1024;
- }
- this.file.sizeInBytes = size;
- if ((thumb = $('.fileThumb > [data-md5]', fileEl))) {
- return $.extend(this.file, {
- thumb: thumb,
- thumbURL: (m = link.href.match(/\d+(?=\.\w+$)/)) ? location.protocol + "//i.4cdn.org/" + this.board + "/" + m[0] + "s.jpg" : void 0,
- MD5: thumb.dataset.md5,
- isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler')
- });
- }
- };
-
- Post.prototype.kill = function(file) {
- var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
- if (file) {
- if (this.file.isDead) {
- return;
- }
- this.file.isDead = true;
- $.addClass(this.nodes.root, 'deleted-file');
- } else {
- if (this.isDead) {
- return;
- }
- this.isDead = true;
- $.addClass(this.nodes.root, 'deleted-post');
- }
- if (!(strong = $('strong.warning', this.nodes.info))) {
- strong = $.el('strong', {
- className: 'warning',
- textContent: this.isReply ? '[Deleted]' : '[Dead]'
- });
- $.after($('input', this.nodes.info), strong);
- }
- strong.textContent = file ? '[File deleted]' : '[Deleted]';
- if (this.isClone) {
- return;
- }
- ref = this.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.kill(file);
- }
- if (file) {
- return;
- }
- ref1 = Get.allQuotelinksLinkingTo(this);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- quotelink = ref1[q];
- if (!(!$.hasClass(quotelink, 'deadlink'))) {
- continue;
- }
- quotelink.textContent = quotelink.textContent + '\u00A0(Dead)';
- $.addClass(quotelink, 'deadlink');
- }
- };
-
- Post.prototype.resurrect = function() {
- var clone, k, len1, len2, q, quotelink, ref, ref1, strong;
- this.isDead = false;
- $.rmClass(this.nodes.root, 'deleted-post');
- strong = $('strong.warning', this.nodes.info);
- if (this.file && this.file.isDead) {
- strong.textContent = '[File deleted]';
- } else {
- $.rm(strong);
- }
- if (this.isClone) {
- return;
- }
- ref = this.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.resurrect();
- }
- ref1 = Get.allQuotelinksLinkingTo(this);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- quotelink = ref1[q];
- if (!($.hasClass(quotelink, 'deadlink'))) {
- continue;
- }
- quotelink.textContent = quotelink.textContent.replace('\u00A0(Dead)', '');
- $.rmClass(quotelink, 'deadlink');
- }
- };
-
- Post.prototype.collect = function() {
- g.posts.rm(this.fullID);
- this.thread.posts.rm(this);
- return this.board.posts.rm(this);
- };
-
- Post.prototype.addClone = function(context, contractThumb) {
- return new Clone(this, context, contractThumb);
- };
-
- Post.prototype.rmClone = function(index) {
- var clone, k, len1, ref;
- this.clones.splice(index, 1);
- ref = this.clones.slice(index);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.nodes.root.dataset.clone = index++;
- }
- };
-
- return Post;
-
- })();
-
- Clone = (function(superClass) {
- extend(Clone, superClass);
-
- Clone.prototype.isClone = true;
-
- function Clone(origin1, context1, contractThumb) {
- var file, info, inline, inlined, k, key, len1, len2, len3, len4, node, nodes, post, q, ref, ref1, ref2, ref3, ref4, ref5, root, u, v, val;
- this.origin = origin1;
- this.context = context1;
- ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- key = ref[k];
- this[key] = this.origin[key];
- }
- nodes = this.origin.nodes;
- root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true);
- Clone.prefix || (Clone.prefix = 0);
- ref1 = [root].concat(slice.call($$('[id]', root)));
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- node = ref1[q];
- node.id = Clone.prefix + node.id;
- }
- Clone.prefix++;
- post = $('.post', root);
- info = $('.postInfo', post);
- this.nodes = {
- root: root,
- post: post,
- info: info,
- nameBlock: $('.nameBlock', info),
- quote: $('.postNum > a:nth-of-type(2)', info),
- comment: $('.postMessage', post),
- quotelinks: []
- };
- if ($.engine === 'edge') {
- Object.defineProperty(this.nodes, 'backlinks', {
- configurable: true,
- enumerable: true,
- get: function() {
- return info.getElementsByClassName('backlink');
- }
- });
- } else {
- this.nodes.backlinks = info.getElementsByClassName('backlink');
- }
- ref2 = $$('.inline', post);
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- inline = ref2[u];
- $.rm(inline);
- }
- ref3 = $$('.inlined', post);
- for (v = 0, len4 = ref3.length; v < len4; v++) {
- inlined = ref3[v];
- $.rmClass(inlined, 'inlined');
- }
- root.hidden = false;
- $.rmClass(root, 'forwarded');
- $.rmClass(post, 'highlight');
- if (nodes.subject) {
- this.nodes.subject = $('.subject', info);
- }
- if (nodes.name) {
- this.nodes.name = $('.name', info);
- }
- if (nodes.email) {
- this.nodes.email = $('.useremail', info);
- }
- if (nodes.tripcode) {
- this.nodes.tripcode = $('.postertrip', info);
- }
- if (nodes.uniqueID) {
- this.nodes.uniqueID = $('.posteruid', info);
- }
- if (nodes.capcode) {
- this.nodes.capcode = $('.capcode.hand', info);
- }
- if (nodes.flag) {
- this.nodes.flag = $('.flag, .countryFlag', info);
- }
- if (nodes.date) {
- this.nodes.date = $('.dateTime', info);
- }
- this.parseQuotes();
- this.quotes = slice.call(this.origin.quotes);
- if (this.origin.file) {
- this.file = {};
- ref4 = this.origin.file;
- for (key in ref4) {
- val = ref4[key];
- this.file[key] = val;
- }
- file = $('.file', post);
- this.file.text = file.firstElementChild;
- this.file.link = $('.fileText > a, .fileText-original', file);
- this.file.thumb = $('.fileThumb > [data-md5]', file);
- this.file.fullImage = $('.full-image', file);
- this.file.videoControls = $('.video-controls', this.file.text);
- if (this.file.videoThumb) {
- this.file.thumb.muted = true;
- }
- if ((ref5 = this.file.thumb) != null ? ref5.dataset.src : void 0) {
- this.file.thumb.src = this.file.thumb.dataset.src;
- this.file.thumb.removeAttribute('data-src');
- }
- if (this.file.thumb && contractThumb) {
- ImageExpand.contract(this);
- }
- }
- if (this.origin.isDead) {
- this.isDead = true;
- }
- root.dataset.clone = this.origin.clones.push(this) - 1;
- }
-
- Clone.prototype.cloneWithoutVideo = function(node) {
- var child, clone, k, len1, ref;
- if (node.tagName === 'VIDEO' && !node.dataset.md5) {
- return [];
- } else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) {
- clone = node.cloneNode(false);
- ref = node.childNodes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- child = ref[k];
- $.add(clone, this.cloneWithoutVideo(child));
- }
- return clone;
- } else {
- return node.cloneNode(true);
- }
- };
-
- return Clone;
-
- })(Post);
-
- DataBoard = (function() {
- DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'customTitles'];
-
- function DataBoard(key1, sync, dontClean) {
- var init;
- this.key = key1;
- this.onSync = bind(this.onSync, this);
- this.data = Conf[this.key];
- $.sync(this.key, this.onSync);
- if (!dontClean) {
- this.clean();
- }
- if (!sync) {
- return;
- }
- init = (function(_this) {
- return function() {
- $.off(d, '4chanXInitFinished', init);
- return _this.sync = sync;
- };
- })(this);
- $.on(d, '4chanXInitFinished', init);
- }
-
- DataBoard.prototype.save = function(cb) {
- return $.set(this.key, this.data, cb);
- };
-
- DataBoard.prototype["delete"] = function(arg) {
- var boardID, postID, ref, threadID;
- boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
- $.forceSync(this.key);
- if (postID) {
- if (!((ref = this.data.boards[boardID]) != null ? ref[threadID] : void 0)) {
- return;
- }
- delete this.data.boards[boardID][threadID][postID];
- this.deleteIfEmpty({
- boardID: boardID,
- threadID: threadID
- });
- } else if (threadID) {
- if (!this.data.boards[boardID]) {
- return;
- }
- delete this.data.boards[boardID][threadID];
- this.deleteIfEmpty({
- boardID: boardID
- });
- } else {
- delete this.data.boards[boardID];
- }
- return this.save();
- };
-
- DataBoard.prototype.deleteIfEmpty = function(arg) {
- var boardID, threadID;
- boardID = arg.boardID, threadID = arg.threadID;
- $.forceSync(this.key);
- if (threadID) {
- if (!Object.keys(this.data.boards[boardID][threadID]).length) {
- delete this.data.boards[boardID][threadID];
- return this.deleteIfEmpty({
- boardID: boardID
- });
- }
- } else if (!Object.keys(this.data.boards[boardID]).length) {
- return delete this.data.boards[boardID];
- }
- };
-
- DataBoard.prototype.set = function(arg, cb) {
- var base1, base2, base3, boardID, postID, threadID, val;
- boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val;
- $.forceSync(this.key);
- if (postID !== void 0) {
- ((base1 = ((base2 = this.data.boards)[boardID] || (base2[boardID] = {})))[threadID] || (base1[threadID] = {}))[postID] = val;
- } else if (threadID !== void 0) {
- ((base3 = this.data.boards)[boardID] || (base3[boardID] = {}))[threadID] = val;
- } else {
- this.data.boards[boardID] = val;
- }
- return this.save(cb);
- };
-
- DataBoard.prototype.get = function(arg) {
- var ID, board, boardID, defaultValue, k, len1, postID, thread, threadID, val;
- boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue;
- if (board = this.data.boards[boardID]) {
- if (threadID == null) {
- if (postID != null) {
- for (thread = k = 0, len1 = board.length; k < len1; thread = ++k) {
- ID = board[thread];
- if (postID in thread) {
- val = thread[postID];
- break;
- }
- }
- } else {
- val = board;
- }
- } else if (thread = board[threadID]) {
- val = postID != null ? thread[postID] : thread;
- }
- }
- return val || defaultValue;
- };
-
- DataBoard.prototype.forceSync = function() {
- return $.forceSync(this.key);
- };
-
- DataBoard.prototype.clean = function() {
- var boardID, now, ref, val;
- $.forceSync(this.key);
- ref = this.data.boards;
- for (boardID in ref) {
- val = ref[boardID];
- this.deleteIfEmpty({
- boardID: boardID
- });
- }
- now = Date.now();
- if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) {
- this.data.lastChecked = now;
- for (boardID in this.data.boards) {
- this.ajaxClean(boardID);
- }
- }
- };
-
- DataBoard.prototype.ajaxClean = function(boardID) {
- return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) {
- return function(e1) {
- var ref;
- if ((ref = e1.target.status) !== 200 && ref !== 404) {
- return;
- }
- return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
- var ref1;
- if ((ref1 = e2.target.status) !== 200 && ref1 !== 404) {
- return;
- }
- return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
- });
- };
- })(this));
- };
-
- DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
- var ID, board, k, len1, len2, len3, page, q, ref, thread, threads, u;
- if (!(board = this.data.boards[boardID])) {
- return;
- }
- threads = {};
- if (response1) {
- for (k = 0, len1 = response1.length; k < len1; k++) {
- page = response1[k];
- ref = page.threads;
- for (q = 0, len2 = ref.length; q < len2; q++) {
- thread = ref[q];
- ID = thread.no;
- if (ID in board) {
- threads[ID] = board[ID];
- }
- }
- }
- }
- if (response2) {
- for (u = 0, len3 = response2.length; u < len3; u++) {
- ID = response2[u];
- if (ID in board) {
- threads[ID] = board[ID];
- }
- }
- }
- this.data.boards[boardID] = threads;
- this.deleteIfEmpty({
- boardID: boardID
- });
- return this.save();
- };
-
- DataBoard.prototype.onSync = function(data) {
- this.data = data || {
- boards: {}
- };
- return typeof this.sync === "function" ? this.sync() : void 0;
- };
-
- return DataBoard;
-
- })();
-
- Notice = (function() {
- function Notice(type, content, timeout1, onclose) {
- this.timeout = timeout1;
- this.onclose = onclose;
- this.close = bind(this.close, this);
- this.add = bind(this.add, this);
- this.el = $.el('div', {
- innerHTML: "
"
- });
- this.el.style.opacity = 0;
- this.setType(type);
- $.on(this.el.firstElementChild, 'click', this.close);
- if (typeof content === 'string') {
- content = $.tn(content);
- }
- $.add(this.el.lastElementChild, content);
- $.ready(this.add);
- }
-
- Notice.prototype.setType = function(type) {
- return this.el.className = "notification " + type;
- };
-
- Notice.prototype.add = function() {
- if (d.hidden) {
- $.on(d, 'visibilitychange', this.add);
- return;
- }
- $.off(d, 'visibilitychange', this.add);
- $.add(Header.noticesRoot, this.el);
- this.el.clientHeight;
- this.el.style.opacity = 1;
- if (this.timeout) {
- return setTimeout(this.close, this.timeout * $.SECOND);
- }
- };
-
- Notice.prototype.close = function() {
- $.off(d, 'visibilitychange', this.add);
- $.rm(this.el);
- return typeof this.onclose === "function" ? this.onclose() : void 0;
- };
-
- return Notice;
-
- })();
-
- RandomAccessList = (function() {
- function RandomAccessList(items) {
- var item, k, len1;
- this.length = 0;
- if (items) {
- for (k = 0, len1 = items.length; k < len1; k++) {
- item = items[k];
- this.push(item);
- }
- }
- }
-
- RandomAccessList.prototype.push = function(data) {
- var ID, item, last;
- ID = data.ID;
- ID || (ID = data.id);
- if (this[ID]) {
- return;
- }
- last = this.last;
- this[ID] = item = {
- prev: last,
- next: null,
- data: data,
- ID: ID
- };
- item.prev = last;
- this.last = last ? last.next = item : this.first = item;
- return this.length++;
- };
-
- RandomAccessList.prototype.before = function(root, item) {
- var prev;
- if (item.next === root || item === root) {
- return;
- }
- this.rmi(item);
- prev = root.prev;
- root.prev = item;
- item.next = root;
- item.prev = prev;
- if (prev) {
- return prev.next = item;
- } else {
- return this.first = item;
- }
- };
-
- RandomAccessList.prototype.after = function(root, item) {
- var next;
- if (item.prev === root || item === root) {
- return;
- }
- this.rmi(item);
- next = root.next;
- root.next = item;
- item.prev = root;
- item.next = next;
- if (next) {
- return next.prev = item;
- } else {
- return this.last = item;
- }
- };
-
- RandomAccessList.prototype.prepend = function(item) {
- var first;
- first = this.first;
- if (item === first || !this[item.ID]) {
- return;
- }
- this.rmi(item);
- item.next = first;
- if (first) {
- first.prev = item;
- } else {
- this.last = item;
- }
- this.first = item;
- return delete item.prev;
- };
-
- RandomAccessList.prototype.shift = function() {
- return this.rm(this.first.ID);
- };
-
- RandomAccessList.prototype.order = function() {
- var item, order;
- order = [item = this.first];
- while (item = item.next) {
- order.push(item);
- }
- return order;
- };
-
- RandomAccessList.prototype.rm = function(ID) {
- var item;
- item = this[ID];
- if (!item) {
- return;
- }
- delete this[ID];
- this.length--;
- this.rmi(item);
- delete item.next;
- return delete item.prev;
- };
-
- RandomAccessList.prototype.rmi = function(item) {
- var next, prev;
- prev = item.prev, next = item.next;
- if (prev) {
- prev.next = next;
- } else {
- this.first = next;
- }
- if (next) {
- return next.prev = prev;
- } else {
- return this.last = prev;
- }
- };
-
- return RandomAccessList;
-
- })();
-
- SimpleDict = (function() {
- function SimpleDict() {
- this.keys = [];
- }
-
- SimpleDict.prototype.push = function(key, data) {
- key = "" + key;
- if (!this[key]) {
- this.keys.push(key);
- }
- return this[key] = data;
- };
-
- SimpleDict.prototype.rm = function(key) {
- var i;
- key = "" + key;
- if ((i = this.keys.indexOf(key)) !== -1) {
- this.keys.splice(i, 1);
- return delete this[key];
- }
- };
-
- SimpleDict.prototype.forEach = function(fn) {
- var k, key, len1, ref;
- ref = slice.call(this.keys);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- key = ref[k];
- fn(this[key]);
- }
- };
-
- return SimpleDict;
-
- })();
-
- ShimSet = (function() {
- function ShimSet() {
- this.elements = {};
- this.size = 0;
- }
-
- ShimSet.prototype.has = function(value) {
- return value in this.elements;
- };
-
- ShimSet.prototype.add = function(value) {
- if (this.elements[value]) {
- return;
- }
- this.elements[value] = true;
- return this.size++;
- };
-
- ShimSet.prototype["delete"] = function(value) {
- if (!this.elements[value]) {
- return;
- }
- delete this.elements[value];
- return this.size--;
- };
-
- return ShimSet;
-
- })();
-
- if (!('Set' in window)) {
- window.Set = ShimSet;
- }
-
- Connection = (function() {
- function Connection(target1, origin1, cb1) {
- this.target = target1;
- this.origin = origin1;
- this.cb = cb1 != null ? cb1 : {};
- this.onMessage = bind(this.onMessage, this);
- this.send = bind(this.send, this);
- $.on(window, 'message', this.onMessage);
- }
-
- Connection.prototype.targetWindow = function() {
- if (this.target instanceof window.HTMLIFrameElement) {
- return this.target.contentWindow;
- } else {
- return this.target;
- }
- };
-
- Connection.prototype.send = function(data) {
- return this.targetWindow().postMessage("" + g.NAMESPACE + (JSON.stringify(data)), this.origin);
- };
-
- Connection.prototype.onMessage = function(e) {
- var base1, data, type, value;
- if (!(e.source === this.targetWindow() && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) {
- return;
- }
- data = JSON.parse(e.data.slice(g.NAMESPACE.length));
- for (type in data) {
- value = data[type];
- if (typeof (base1 = this.cb)[type] === "function") {
- base1[type](value);
- }
- }
- };
-
- return Connection;
-
- })();
-
- Fetcher = (function() {
- function Fetcher(boardID1, threadID1, postID1, root1, quoter1) {
- var post;
- this.boardID = boardID1;
- this.threadID = threadID1;
- this.postID = postID1;
- this.root = root1;
- this.quoter = quoter1;
- if (post = g.posts[this.boardID + "." + this.postID]) {
- this.insert(post);
- return;
- }
- this.root.textContent = "Loading post No." + this.postID + "...";
- if (this.threadID) {
- $.cache("//a.4cdn.org/" + this.boardID + "/thread/" + this.threadID + ".json", (function(_this) {
- return function(e, isCached) {
- return _this.fetchedPost(e.target, isCached);
- };
- })(this));
- } else {
- this.archivedPost();
- }
- }
-
- Fetcher.prototype.insert = function(post) {
- var boardID, clone, k, len1, nodes, postID, quote, ref, ref1;
- if (!this.root.parentNode) {
- return;
- }
- clone = post.addClone(this.quoter.context, $.hasClass(this.root, 'dialog'));
- Main.callbackNodes(Clone, [clone]);
- nodes = clone.nodes;
- $.rmAll(nodes.root);
- $.add(nodes.root, nodes.post);
- ref = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- ref1 = Get.postDataFromLink(quote), boardID = ref1.boardID, postID = ref1.postID;
- if (postID === this.quoter.ID && boardID === this.quoter.board.ID) {
- $.addClass(quote, 'forwardlink');
- }
- }
- $.rmAll(this.root);
- $.add(this.root, nodes.root);
- return $.event('PostsInserted');
- };
-
- Fetcher.prototype.fetchedPost = function(req, isCached) {
- var api, board, k, len1, post, posts, status, thread;
- if (post = g.posts[this.boardID + "." + this.postID]) {
- this.insert(post);
- return;
- }
- status = req.status;
- if (status !== 200 && status !== 304) {
- if (this.archivedPost()) {
- return;
- }
- $.addClass(this.root, 'warning');
- this.root.textContent = status === 404 ? "Thread No." + this.threadID + " 404'd." : "Error " + req.statusText + " (" + req.status + ").";
- return;
- }
- posts = req.response.posts;
- Build.spoilerRange[this.boardID] = posts[0].custom_spoiler;
- for (k = 0, len1 = posts.length; k < len1; k++) {
- post = posts[k];
- if (post.no === this.postID) {
- break;
- }
- }
- if (post.no !== this.postID) {
- if (isCached) {
- api = "//a.4cdn.org/" + this.boardID + "/thread/" + this.threadID + ".json";
- $.cleanCache(function(url) {
- return url === api;
- });
- $.cache(api, (function(_this) {
- return function(e) {
- return _this.fetchedPost(e.target, false);
- };
- })(this));
- return;
- }
- if (this.archivedPost()) {
- return;
- }
- $.addClass(this.root, 'warning');
- this.root.textContent = "Post No." + this.postID + " was not found.";
- return;
- }
- board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
- post = new Post(Build.postFromObject(post, this.boardID), thread, board);
- post.isFetchedQuote = true;
- Main.callbackNodes(Post, [post]);
- return this.insert(post);
- };
-
- Fetcher.prototype.archivedPost = function() {
- var archive, url;
- if (!Conf['Resurrect Quotes']) {
- return false;
- }
- if (!(url = Redirect.to('post', {
- boardID: this.boardID,
- postID: this.postID
- }))) {
- return false;
- }
- archive = Redirect.data.post[this.boardID];
- if (/^https:\/\//.test(url) || location.protocol === 'http:') {
- $.cache(url, (function(_this) {
- return function(e) {
- return _this.parseArchivedPost(e.target.response, url, archive);
- };
- })(this), {
- responseType: 'json',
- withCredentials: archive.withCredentials
- });
- return true;
- } else if (Conf['Exempt Archives from Encryption']) {
- CrossOrigin.json(url, (function(_this) {
- return function(response) {
- var key, media, ref;
- media = response.media;
- if (media) {
- for (key in media) {
- if (/_link$/.test(key)) {
- if (!((ref = media[key]) != null ? ref.match(/^http:\/\//) : void 0)) {
- delete media[key];
- }
- }
- }
- }
- return _this.parseArchivedPost(response, url, archive);
- };
- })(this));
- return true;
- }
- return false;
- };
-
- Fetcher.prototype.parseArchivedPost = function(data, url, archive) {
- var board, comment, greentext, i, j, key, o, post, ref, ref1, text, text2, thread, val;
- if (post = g.posts[this.boardID + "." + this.postID]) {
- this.insert(post);
- return;
- }
- if (data == null) {
- $.addClass(this.root, 'warning');
- this.root.textContent = "Error fetching Post No." + this.postID + " from " + archive.name + ".";
- return;
- }
- if (data.error) {
- $.addClass(this.root, 'warning');
- this.root.textContent = data.error;
- return;
- }
- comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned)\])/);
- comment = (function() {
- var k, len1, results;
- results = [];
- for (i = k = 0, len1 = comment.length; k < len1; i = ++k) {
- text = comment[i];
- if (i % 2 === 1) {
- results.push(this.archiveTags[text]);
- } else {
- greentext = text[0] === '>';
- text = text.replace(/(\[\/?[a-z]+):lit(\])/g, '$1$2');
- text = (function() {
- var len2, q, ref, results1;
- ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
- results1 = [];
- for (j = q = 0, len2 = ref.length; q < len2; j = ++q) {
- text2 = ref[j];
- results1.push({
- innerHTML: (j % 2 ? "
" + E(text2) + " " : E(text2))
- });
- }
- return results1;
- })();
- text = {
- innerHTML: (greentext ? "
" + E.cat(text) + " " : E.cat(text))
- };
- results.push(text);
- }
- }
- return results;
- }).call(this);
- comment = {
- innerHTML: E.cat(comment)
- };
- this.threadID = +data.thread_num;
- o = {
- postID: this.postID,
- threadID: this.threadID,
- boardID: this.boardID,
- isReply: this.postID !== this.threadID
- };
- o.info = {
- subject: data.title,
- email: data.email,
- name: data.name || '',
- tripcode: data.trip,
- capcode: (function() {
- switch (data.capcode) {
- case 'M':
- return 'Mod';
- case 'A':
- return 'Admin';
- case 'D':
- return 'Developer';
- }
- })(),
- uniqueID: data.poster_hash,
- flagCode: data.poster_country,
- flag: data.poster_country_name,
- dateUTC: data.timestamp,
- dateText: data.fourchan_date,
- commentHTML: comment
- };
- if (o.info.capcode) {
- delete o.info.uniqueID;
- }
- if ((ref = data.media) != null ? ref.media_filename : void 0) {
- ref1 = data.media;
- for (key in ref1) {
- val = ref1[key];
- if (/_link$/.test(key) && (val != null ? val[0] : void 0) === '/') {
- data.media[key] = url.split('/', 3).join('/') + val;
- }
- }
- o.file = {
- name: data.media.media_filename,
- url: data.media.media_link || data.media.remote_media_link || (location.protocol + "//i.4cdn.org/" + this.boardID + "/" + (encodeURIComponent(data.media[this.boardID === 'f' ? 'media_filename' : 'media_orig']))),
- height: data.media.media_h,
- width: data.media.media_w,
- MD5: data.media.media_hash,
- size: $.bytesToString(data.media.media_size),
- thumbURL: data.media.thumb_link || (location.protocol + "//i.4cdn.org/" + this.boardID + "/" + data.media.preview_orig),
- theight: data.media.preview_h,
- twidth: data.media.preview_w,
- isSpoiler: data.media.spoiler === '1'
- };
- if (!/\.pdf$/.test(o.file.url)) {
- o.file.dimensions = o.file.width + "x" + o.file.height;
- }
- if (this.boardID === 'f' && data.media.exif) {
- o.file.tag = JSON.parse(data.media.exif).Tag;
- }
- }
- board = g.boards[this.boardID] || new Board(this.boardID);
- thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
- post = new Post(Build.post(o), thread, board);
- post.kill();
- if (post.file) {
- post.file.thumbURL = o.file.thumbURL;
- }
- post.isFetchedQuote = true;
- Main.callbackNodes(Post, [post]);
- return this.insert(post);
- };
-
- Fetcher.prototype.archiveTags = {
- '\n': {
- innerHTML: "
"
- },
- '[b]': {
- innerHTML: "
"
- },
- '[/b]': {
- innerHTML: " "
- },
- '[spoiler]': {
- innerHTML: "
"
- },
- '[/spoiler]': {
- innerHTML: " "
- },
- '[code]': {
- innerHTML: "
"
- },
- '[/code]': {
- innerHTML: " "
- },
- '[moot]': {
- innerHTML: "
"
- },
- '[/moot]': {
- innerHTML: "
"
- },
- '[banned]': {
- innerHTML: "
"
- },
- '[/banned]': {
- innerHTML: " "
- }
- };
-
- return Fetcher;
-
- })();
-
- Polyfill = {
- init: function() {
- return this.toBlob();
- },
- toBlob: function() {
- if (HTMLCanvasElement.prototype.toBlob) {
- return;
- }
- HTMLCanvasElement.prototype.toBlob = function(cb, type, encoderOptions) {
- var data, i, k, l, ref, ui8a, url;
- if (type == null) {
- type = 'image/png';
- }
- url = this.toDataURL(type, encoderOptions);
- data = atob(url.slice(url.indexOf(',') + 1));
- l = data.length;
- ui8a = new Uint8Array(l);
- for (i = k = 0, ref = l; k < ref; i = k += 1) {
- ui8a[i] = data.charCodeAt(i);
- }
- return cb(new Blob([ui8a], {
- type: type
- }));
- };
- return $.globalEval("HTMLCanvasElement.prototype.toBlob = (" + HTMLCanvasElement.prototype.toBlob + ");");
- }
- };
-
- Header = {
- init: function() {
- var barFixedToggler, barPositionToggler, box, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler;
- this.menu = new UI.Menu('header');
- menuButton = $.el('span', {
- className: 'menu-button'
- });
- $.extend(menuButton, {
- innerHTML: "
"
- });
- box = UI.checkbox;
- barFixedToggler = box('Fixed Header', 'Fixed Header');
- headerToggler = box('Header auto-hide', 'Auto-hide header');
- scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll');
- barPositionToggler = box('Bottom Header', 'Bottom header');
- linkJustifyToggler = box('Centered links', 'Centered links');
- customNavToggler = box('Custom Board Navigation', 'Custom board navigation');
- footerToggler = box('Bottom Board List', 'Hide bottom board list');
- shortcutToggler = box('Shortcut Icons', 'Shortcut Icons');
- editCustomNav = $.el('a', {
- textContent: 'Edit custom board navigation',
- href: 'javascript:;'
- });
- this.barFixedToggler = barFixedToggler.firstElementChild;
- this.scrollHeaderToggler = scrollHeaderToggler.firstElementChild;
- this.barPositionToggler = barPositionToggler.firstElementChild;
- this.linkJustifyToggler = linkJustifyToggler.firstElementChild;
- this.headerToggler = headerToggler.firstElementChild;
- this.footerToggler = footerToggler.firstElementChild;
- this.shortcutToggler = shortcutToggler.firstElementChild;
- this.customNavToggler = customNavToggler.firstElementChild;
- $.on(menuButton, 'click', this.menuToggle);
- $.on(this.headerToggler, 'change', this.toggleBarVisibility);
- $.on(this.barFixedToggler, 'change', this.toggleBarFixed);
- $.on(this.barPositionToggler, 'change', this.toggleBarPosition);
- $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll);
- $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify);
- $.on(this.footerToggler, 'change', this.toggleFooterVisibility);
- $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons);
- $.on(this.customNavToggler, 'change', this.toggleCustomNav);
- $.on(editCustomNav, 'click', this.editCustomNav);
- this.setBarFixed(Conf['Fixed Header']);
- this.setHideBarOnScroll(Conf['Header auto-hide on scroll']);
- this.setBarVisibility(Conf['Header auto-hide']);
- this.setLinkJustify(Conf['Centered links']);
- this.setShortcutIcons(Conf['Shortcut Icons']);
- this.setFooterVisibility(Conf['Bottom Board List']);
- $.sync('Fixed Header', this.setBarFixed);
- $.sync('Header auto-hide on scroll', this.setHideBarOnScroll);
- $.sync('Bottom Header', this.setBarPosition);
- $.sync('Shortcut Icons', this.setShortcutIcons);
- $.sync('Header auto-hide', this.setBarVisibility);
- $.sync('Centered links', this.setLinkJustify);
- $.sync('Bottom Board List', this.setFooterVisibility);
- this.addShortcut(menuButton);
- this.menu.addEntry({
- el: $.el('span', {
- textContent: 'Header'
- }),
- order: 107,
- subEntries: [
- {
- el: barFixedToggler
- }, {
- el: headerToggler
- }, {
- el: scrollHeaderToggler
- }, {
- el: barPositionToggler
- }, {
- el: linkJustifyToggler
- }, {
- el: footerToggler
- }, {
- el: shortcutToggler
- }, {
- el: customNavToggler
- }, {
- el: editCustomNav
- }
- ]
- });
- $.on(window, 'load popstate', Header.hashScroll);
- $.on(d, 'CreateNotification', this.createNotification);
- $.asap((function() {
- return d.body;
- }), (function(_this) {
- return function() {
- if (!Main.isThisPageLegit()) {
- return;
- }
- $.asap((function() {
- return $.id('boardNavMobile') || d.readyState !== 'loading';
- }), function() {
- var a, footer;
- footer = $.id('boardNavDesktop').cloneNode(true);
- footer.id = 'boardNavDesktopFoot';
- $('#navtopright', footer).id = 'navbotright';
- $('#settingsWindowLink', footer).id = 'settingsWindowLinkBot';
- Header.bottomBoardList = $('.boardList', footer);
- if (a = $("a[href*='/" + g.BOARD + "/']", footer)) {
- a.className = 'current';
- }
- Main.ready(function() {
- var absbot, oldFooter;
- if ((oldFooter = $.id('boardNavDesktopFoot'))) {
- return $.replace($('.boardList', oldFooter), Header.bottomBoardList);
- } else if ((absbot = $.id('absbot'))) {
- $.before(absbot, footer);
- return $.globalEval('window.cloneTopNav = function() {};');
- }
- });
- return Header.setBoardList();
- });
- $.prepend(d.body, _this.bar);
- $.add(d.body, Header.hover);
- _this.setBarPosition(Conf['Bottom Header']);
- return _this;
- };
- })(this));
- Main.ready((function(_this) {
- return function() {
- var cs;
- if (g.VIEW === 'catalog' || !Conf['Disable Native Extension']) {
- cs = $.el('a', {
- href: 'javascript:;'
- });
- if (g.VIEW === 'catalog') {
- cs.title = cs.textContent = 'Catalog Settings';
- cs.className = 'fa fa-book';
- } else {
- cs.title = cs.textContent = '4chan Settings';
- cs.className = 'fa fa-leaf';
- }
- $.on(cs, 'click', function() {
- return $.id('settingsWindowLink').click();
- });
- return _this.addShortcut(cs);
- }
- };
- })(this));
- return this.enableDesktopNotifications();
- },
- bar: $.el('div', {
- id: 'header-bar'
- }),
- noticesRoot: $.el('div', {
- id: 'notifications'
- }),
- shortcuts: $.el('span', {
- id: 'shortcuts'
- }),
- hover: $.el('div', {
- id: 'hoverUI'
- }),
- toggle: $.el('div', {
- id: 'scroll-marker'
- }),
- setBoardList: function() {
- var a, boardList, btn, chr, k, len1, len2, node, nodes, q, ref, ref1, spacer, span;
- Header.boardList = boardList = $.el('span', {
- id: 'board-list'
- });
- $.extend(boardList, {
- innerHTML: "
- "
- });
- btn = $('.hide-board-list-button', boardList);
- $.on(btn, 'click', Header.toggleBoardList);
- nodes = [];
- spacer = function() {
- return $.el('span', {
- className: 'spacer'
- });
- };
- ref = $('#boardNavDesktop > .boardList').childNodes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- node = ref[k];
- switch (node.nodeName) {
- case '#text':
- ref1 = node.nodeValue;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- chr = ref1[q];
- span = $.el('span', {
- textContent: chr
- });
- if (chr === ' ') {
- span.className = 'space';
- }
- if (chr === ']') {
- nodes.push(spacer());
- }
- nodes.push(span);
- if (chr === '[') {
- nodes.push(spacer());
- }
- }
- break;
- case 'A':
- a = node.cloneNode(true);
- if (a.pathname.split('/')[1] === g.BOARD.ID) {
- a.className = 'current';
- }
- nodes.push(a);
- }
- }
- $.add($('.boardList', boardList), nodes);
- $.add(Header.bar, [Header.boardList, Header.shortcuts, Header.noticesRoot, Header.toggle]);
- Header.setCustomNav(Conf['Custom Board Navigation']);
- Header.generateBoardList(Conf['boardnav']);
- $.sync('Custom Board Navigation', Header.setCustomNav);
- return $.sync('boardnav', Header.generateBoardList);
- },
- generateBoardList: function(boardnav) {
- var as, list, nodes, re, t;
- list = $('#custom-board-list', Header.boardList);
- $.rmAll(list);
- if (!boardnav) {
- return;
- }
- boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' ');
- as = $$('#full-board-list a[title]', Header.boardList);
- re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
- nodes = (function() {
- var k, len1, ref, results;
- ref = boardnav.match(re);
- results = [];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- t = ref[k];
- results.push(Header.mapCustomNavigation(t, as));
- }
- return results;
- })();
- $.add(list, nodes);
- return $.ready(CatalogLinks.initBoardList);
- },
- mapCustomNavigation: function(t, as) {
- var a, boardID, href, indexOptions, m, text, url;
- if (/^[^\w@]/.test(t)) {
- return $.tn(t);
- }
- text = url = null;
- t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) {
- text = m1;
- url = m2;
- return '';
- });
- indexOptions = [];
- t = t.replace(/-(?:mode|sort):"([^"]+)"/g, function(m0, m1) {
- indexOptions.push(m1.toLowerCase().replace(/\ /g, '-'));
- return '';
- });
- indexOptions = indexOptions.join('/');
- if (/^toggle-all/.test(t)) {
- a = $.el('a', {
- className: 'show-board-list-button',
- textContent: text || '+',
- href: 'javascript:;'
- });
- $.on(a, 'click', Header.toggleBoardList);
- return a;
- }
- if (/^external/.test(t)) {
- a = $.el('a', {
- href: url || 'javascript:;',
- textContent: text || '+',
- className: 'external'
- });
- return a;
- }
- boardID = t.split('-')[0];
- if (boardID === 'current') {
- boardID = g.BOARD.ID;
- }
- a = (function() {
- var k, len1, ref;
- if (boardID === '@') {
- return $.el('a', {
- href: 'https://twitter.com/4chan',
- title: '4chan Twitter',
- textContent: '@'
- });
- }
- for (k = 0, len1 = as.length; k < len1; k++) {
- a = as[k];
- if (a.textContent === boardID) {
- return a.cloneNode(true);
- }
- }
- a = $.el('a', {
- href: "/" + boardID + "/",
- textContent: boardID
- });
- if ((ref = g.VIEW) === 'catalog' || ref === 'archive') {
- a.href += g.VIEW;
- }
- if (boardID === g.BOARD.ID) {
- a.className = 'current';
- }
- return a;
- })();
- a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID;
- if (m = t.match(/-(index|catalog)/)) {
- if (!(boardID === 'f' && m[1] === 'catalog')) {
- a.dataset.only = m[1];
- a.href = CatalogLinks[m[1]](boardID);
- if (m[1] === 'catalog') {
- $.addClass(a, 'catalog');
- }
- } else {
- return a.firstChild;
- }
- }
- if (Conf['JSON Index'] && indexOptions) {
- a.dataset.indexOptions = indexOptions;
- if (a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
- a.href += (a.hash ? '/' : '#') + indexOptions;
- }
- }
- if (/-archive/.test(t)) {
- if (href = Redirect.to('board', {
- boardID: boardID
- })) {
- a.href = href;
- } else {
- return a.firstChild;
- }
- }
- if (/-expired/.test(t)) {
- if (boardID !== 'b' && boardID !== 'f' && boardID !== 'trash') {
- a.href = "/" + boardID + "/archive";
- } else {
- return a.firstChild;
- }
- }
- if (boardID === '@') {
- $.addClass(a, 'navSmall');
- }
- return a;
- },
- toggleBoardList: function() {
- var bar, custom, full, showBoardList;
- bar = Header.bar;
- custom = $('#custom-board-list', bar);
- full = $('#full-board-list', bar);
- showBoardList = !full.hidden;
- custom.hidden = !showBoardList;
- return full.hidden = showBoardList;
- },
- setLinkJustify: function(centered) {
- Header.linkJustifyToggler.checked = centered;
- if (centered) {
- return $.addClass(doc, 'centered-links');
- } else {
- return $.rmClass(doc, 'centered-links');
- }
- },
- toggleLinkJustify: function() {
- var centered;
- $.event('CloseMenu');
- centered = this.nodeName === 'INPUT' ? this.checked : void 0;
- Header.setLinkJustify(centered);
- return $.set('Centered links', centered);
- },
- setBarFixed: function(fixed) {
- Header.barFixedToggler.checked = fixed;
- if (fixed) {
- $.addClass(doc, 'fixed');
- return $.addClass(Header.bar, 'dialog');
- } else {
- $.rmClass(doc, 'fixed');
- return $.rmClass(Header.bar, 'dialog');
- }
- },
- toggleBarFixed: function() {
- $.event('CloseMenu');
- Header.setBarFixed(this.checked);
- Conf['Fixed Header'] = this.checked;
- return $.set('Fixed Header', this.checked);
- },
- setShortcutIcons: function(show) {
- Header.shortcutToggler.checked = show;
- if (show) {
- return $.addClass(doc, 'shortcut-icons');
- } else {
- return $.rmClass(doc, 'shortcut-icons');
- }
- },
- toggleShortcutIcons: function() {
- $.event('CloseMenu');
- Header.setShortcutIcons(this.checked);
- Conf['Shortcut Icons'] = this.checked;
- return $.set('Shortcut Icons', this.checked);
- },
- setBarVisibility: function(hide) {
- Header.headerToggler.checked = hide;
- $.event('CloseMenu');
- (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide');
- return (hide ? $.addClass : $.rmClass)(doc, 'autohide');
- },
- toggleBarVisibility: function() {
- var hide, message;
- hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
- Conf['Header auto-hide'] = hide;
- $.set('Header auto-hide', hide);
- Header.setBarVisibility(hide);
- message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.');
- return new Notice('info', message, 2);
- },
- setHideBarOnScroll: function(hide) {
- Header.scrollHeaderToggler.checked = hide;
- if (hide) {
- $.on(window, 'scroll', Header.hideBarOnScroll);
- return;
- }
- $.off(window, 'scroll', Header.hideBarOnScroll);
- $.rmClass(Header.bar, 'scroll');
- if (!Conf['Header auto-hide']) {
- return $.rmClass(Header.bar, 'autohide');
- }
- },
- toggleHideBarOnScroll: function() {
- var hide;
- hide = this.checked;
- $.cb.checked.call(this);
- return Header.setHideBarOnScroll(hide);
- },
- hideBarOnScroll: function() {
- var offsetY;
- offsetY = window.pageYOffset;
- if (offsetY > (Header.previousOffset || 0)) {
- $.addClass(Header.bar, 'autohide', 'scroll');
- } else {
- $.rmClass(Header.bar, 'autohide', 'scroll');
- }
- return Header.previousOffset = offsetY;
- },
- setBarPosition: function(bottom) {
- var args;
- Header.barPositionToggler.checked = bottom;
- $.event('CloseMenu');
- args = bottom ? ['bottom-header', 'top-header', 'after'] : ['top-header', 'bottom-header', 'add'];
- $.addClass(doc, args[0]);
- $.rmClass(doc, args[1]);
- return $[args[2]](Header.bar, Header.noticesRoot);
- },
- toggleBarPosition: function() {
- $.cb.checked.call(this);
- return Header.setBarPosition(this.checked);
- },
- setFooterVisibility: function(hide) {
- Header.footerToggler.checked = hide;
- return doc.classList.toggle('hide-bottom-board-list', hide);
- },
- toggleFooterVisibility: function() {
- var hide, message;
- $.event('CloseMenu');
- hide = this.nodeName === 'INPUT' ? this.checked : $.hasClass(doc, 'hide-bottom-board-list');
- Header.setFooterVisibility(hide);
- $.set('Bottom Board List', hide);
- message = hide ? 'The bottom navigation will now be hidden.' : 'The bottom navigation will remain visible.';
- return new Notice('info', message, 2);
- },
- setCustomNav: function(show) {
- var btn, cust, full, ref;
- Header.customNavToggler.checked = show;
- cust = $('#custom-board-list', Header.bar);
- full = $('#full-board-list', Header.bar);
- btn = $('.hide-board-list-container', full);
- return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref;
- },
- toggleCustomNav: function() {
- $.cb.checked.call(this);
- return Header.setCustomNav(this.checked);
- },
- editCustomNav: function() {
- var settings;
- Settings.open('Advanced');
- settings = $.id('fourchanx-settings');
- return $('[name=boardnav]', settings).focus();
- },
- hashScroll: function(e) {
- var el, hash;
- if (e) {
- if (e.state) {
- return;
- }
- if (!history.state) {
- history.replaceState({}, '');
- }
- }
- if ((hash = location.hash.slice(1))) {
- ReplyPruning.showIfHidden(hash);
- if ((el = $.id(hash))) {
- return $.queueTask(function() {
- return Header.scrollTo(el);
- });
- }
- }
- },
- scrollTo: function(root, down, needed) {
- var height, x;
- if (!root.offsetParent) {
- return;
- }
- if (down) {
- x = Header.getBottomOf(root);
- if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && Conf['Bottom header']) {
- height = Header.bar.getBoundingClientRect().height;
- if (x <= 0) {
- if (!Header.isHidden()) {
- x += height;
- }
- } else {
- if (Header.isHidden()) {
- x -= height;
- }
- }
- }
- if (!(needed && x >= 0)) {
- return window.scrollBy(0, -x);
- }
- } else {
- x = Header.getTopOf(root);
- if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && !Conf['Bottom header']) {
- height = Header.bar.getBoundingClientRect().height;
- if (x >= 0) {
- if (!Header.isHidden()) {
- x += height;
- }
- } else {
- if (Header.isHidden()) {
- x -= height;
- }
- }
- }
- if (!(needed && x >= 0)) {
- return window.scrollBy(0, x);
- }
- }
- },
- scrollToIfNeeded: function(root, down) {
- return Header.scrollTo(root, down, true);
- },
- getTopOf: function(root) {
- var headRect, top;
- top = root.getBoundingClientRect().top;
- if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
- headRect = Header.toggle.getBoundingClientRect();
- top -= headRect.top + headRect.height;
- }
- return top;
- },
- getBottomOf: function(root) {
- var bottom, clientHeight, headRect;
- clientHeight = doc.clientHeight;
- bottom = clientHeight - root.getBoundingClientRect().bottom;
- if (Conf['Fixed Header'] && Conf['Bottom Header']) {
- headRect = Header.toggle.getBoundingClientRect();
- bottom -= clientHeight - headRect.bottom + headRect.height;
- }
- return bottom;
- },
- isNodeVisible: function(node) {
- var height;
- if (d.hidden || !doc.contains(node)) {
- return false;
- }
- height = node.getBoundingClientRect().height;
- return Header.getTopOf(node) + height >= 0 && Header.getBottomOf(node) + height >= 0;
- },
- isHidden: function() {
- var top;
- top = Header.bar.getBoundingClientRect().top;
- if (Conf['Bottom header']) {
- return top === doc.clientHeight;
- } else {
- return top < 0;
- }
- },
- addShortcut: function(el) {
- var shortcut;
- shortcut = $.el('span', {
- className: 'shortcut brackets-wrap'
- });
- $.add(shortcut, el);
- return $.prepend(Header.shortcuts, shortcut);
- },
- rmShortcut: function(el) {
- return $.rm(el.parentElement);
- },
- menuToggle: function(e) {
- return Header.menu.toggle(e, this, g);
- },
- createNotification: function(e) {
- var content, lifetime, notice, ref, type;
- ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime;
- return notice = new Notice(type, content, lifetime);
- },
- areNotificationsEnabled: false,
- enableDesktopNotifications: function() {
- var authorize, disable, el, notice, ref;
- if (!(window.Notification && Conf['Desktop Notifications'])) {
- return;
- }
- switch (Notification.permission) {
- case 'granted':
- Header.areNotificationsEnabled = true;
- return;
- case 'denied':
- return;
- }
- el = $.el('span', {
- innerHTML: "4chan X needs your permission to show desktop notifications. [
FAQ ]
Authorize or
Disable "
- });
- ref = $$('button', el), authorize = ref[0], disable = ref[1];
- $.on(authorize, 'click', function() {
- return Notification.requestPermission(function(status) {
- Header.areNotificationsEnabled = status === 'granted';
- if (status === 'default') {
- return;
- }
- return notice.close();
- });
- });
- $.on(disable, 'click', function() {
- $.set('Desktop Notifications', false);
- return notice.close();
- });
- return notice = new Notice('info', el);
- }
- };
-
- Index = {
- showHiddenThreads: false,
- changed: {},
- init: function() {
- var anchorEntry, input, k, label, len1, len2, name, pinEntry, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, refNavEntry, repliesEntry, select, sortEntry;
- if (g.BOARD.ID === 'f' || !Conf['JSON Index'] || g.VIEW !== 'index') {
- return;
- }
- CatalogThread.callbacks.push({
- name: 'Catalog Features',
- cb: this.catalogNode
- });
- this.search = ((ref = history.state) != null ? ref.searched : void 0) || '';
- if ((ref1 = history.state) != null ? ref1.mode : void 0) {
- Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0;
- }
- this.currentSort = (ref3 = history.state) != null ? ref3.sort : void 0;
- this.currentSort || (this.currentSort = typeof Conf['Index Sort'] === 'object' ? Conf['Index Sort'][g.BOARD.ID] || 'bump' : Conf['Index Sort']);
- this.currentPage = this.getCurrentPage();
- this.processHash();
- $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
- $.on(window, 'popstate', this.cb.popstate);
- $.on(d, 'scroll', Index.scroll);
- this.button = $.el('a', {
- className: 'index-refresh-shortcut fa fa-refresh',
- title: 'Refresh',
- href: 'javascript:;',
- textContent: 'Refresh Index'
- });
- $.on(this.button, 'click', function() {
- return Index.update();
- });
- Header.addShortcut(this.button, 1);
- repliesEntry = {
- el: UI.checkbox('Show Replies', 'Show replies')
- };
- sortEntry = {
- el: UI.checkbox('Per-Board Sort Type', 'Per-board sort type', typeof Conf['Index Sort'] === 'object')
- };
- pinEntry = {
- el: UI.checkbox('Pin Watched Threads', 'Pin watched threads')
- };
- anchorEntry = {
- el: UI.checkbox('Anchor Hidden Threads', 'Anchor hidden threads')
- };
- refNavEntry = {
- el: UI.checkbox('Refreshed Navigation', 'Refreshed navigation')
- };
- sortEntry.el.title = 'Set the sorting order of each board independently.';
- pinEntry.el.title = 'Move watched threads to the start of the index.';
- anchorEntry.el.title = 'Move hidden threads to the end of the index.';
- refNavEntry.el.title = 'Refresh index when navigating through pages.';
- ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
- for (k = 0, len1 = ref4.length; k < len1; k++) {
- label = ref4[k];
- input = label.el.firstChild;
- name = input.name;
- $.on(input, 'change', $.cb.checked);
- switch (name) {
- case 'Show Replies':
- $.on(input, 'change', this.cb.replies);
- break;
- case 'Pin Watched Threads':
- case 'Anchor Hidden Threads':
- $.on(input, 'change', this.cb.resort);
- }
- }
- $.on(sortEntry.el.firstChild, 'change', this.cb.perBoardSort);
- Header.menu.addEntry({
- el: $.el('span', {
- textContent: 'Index Navigation'
- }),
- order: 100,
- subEntries: [repliesEntry, sortEntry, pinEntry, anchorEntry, refNavEntry]
- });
- this.navLinks = $.el('div', {
- className: 'navLinks json-index'
- });
- $.extend(this.navLinks, {
- innerHTML: "
Index Catalog Archive Bottom ... × — [Show ] Index Mode Paged Infinite scrolling All threads Catalog Index Sort Bump order Last reply Last long reply Creation date Reply count File count Image Size Small Large "
- });
- $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog();
- if ((ref5 = g.BOARD.ID) === 'b' || ref5 === 'trash') {
- $('.archlistlink', this.navLinks).hidden = true;
- }
- $.on($('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront);
- this.searchInput = $('#index-search', this.navLinks);
- this.setupSearch();
- $.on(this.searchInput, 'input', this.onSearchInput);
- $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
- this.hideLabel = $('#hidden-label', this.navLinks);
- $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
- this.selectMode = $('#index-mode', this.navLinks);
- this.selectSort = $('#index-sort', this.navLinks);
- this.selectSize = $('#index-size', this.navLinks);
- $.on(this.selectMode, 'change', this.cb.mode);
- $.on(this.selectSort, 'change', this.cb.sort);
- $.on(this.selectSize, 'change', $.cb.value);
- $.on(this.selectSize, 'change', this.cb.size);
- ref6 = [this.selectMode, this.selectSize];
- for (q = 0, len2 = ref6.length; q < len2; q++) {
- select = ref6[q];
- select.value = Conf[select.name];
- }
- this.selectSort.value = Index.currentSort;
- this.root = $.el('div', {
- className: 'board json-index'
- });
- this.cb.size();
- this.pagelist = $.el('div', {
- className: 'pagelist json-index'
- });
- $.extend(this.pagelist, {
- innerHTML: "
"
- });
- $('.cataloglink a', this.pagelist).href = CatalogLinks.catalog();
- $.on(this.pagelist, 'click', this.cb.pageNav);
- this.update(true);
- $.onExists(doc, 'title + *', function() {
- return d.title = d.title.replace(/\ -\ Page\ \d+/, '');
- });
- $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() {
- var board, el, len3, len4, ref7, ref8, threadRoot, topNavPos, u, v;
- Index.hat = $('.board > .thread > img:first-child');
- if (Index.hat) {
- if (Index.nodes) {
- ref7 = Index.nodes;
- for (u = 0, len3 = ref7.length; u < len3; u++) {
- threadRoot = ref7[u];
- $.prepend(threadRoot, Index.hat.cloneNode(false));
- }
- }
- $.addClass(doc, 'hats-enabled');
- $.addStyle(".catalog-thread::after {background-image: url(" + Index.hat.src + ");}");
- }
- board = $('.board');
- $.replace(board, Index.root);
- $.event('PostsInserted');
- try {
- d.implementation.createDocument(null, null, null).appendChild(board);
- } catch (_error) {}
- ref8 = $$('.navLinks');
- for (v = 0, len4 = ref8.length; v < len4; v++) {
- el = ref8[v];
- $.rm(el);
- }
- $.rm($.id('ctrl-top'));
- topNavPos = $.id('delform').previousElementSibling;
- $.before(topNavPos, $.el('hr'));
- return $.before(topNavPos, Index.navLinks);
- });
- return Main.ready(function() {
- var pagelist;
- if ((pagelist = $('.pagelist'))) {
- $.replace(pagelist, Index.pagelist);
- }
- return $.rmClass(doc, 'index-loading');
- });
- },
- scroll: function() {
- var nodes, pageNum;
- if (Index.req || !Index.liveThreadData || Conf['Index Mode'] !== 'infinite' || (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight))) {
- return;
- }
- if (Index.pageNum == null) {
- Index.pageNum = Index.currentPage;
- }
- pageNum = ++Index.pageNum;
- if (pageNum > Index.pagesNum) {
- return Index.endNotice();
- }
- nodes = Index.buildSinglePage(pageNum);
- if (Conf['Show Replies']) {
- Index.buildReplies(nodes);
- }
- return Index.buildStructure(nodes);
- },
- endNotice: (function() {
- var notify, reset;
- notify = false;
- reset = function() {
- return notify = false;
- };
- return function() {
- if (notify) {
- return;
- }
- notify = true;
- new Notice('info', "Last page reached.", 2);
- return setTimeout(reset, 3 * $.SECOND);
- };
- })(),
- menu: {
- init: function() {
- if (g.VIEW !== 'index' || !Conf['JSON Index'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
- return;
- }
- return Menu.menu.addEntry({
- el: $.el('a', {
- href: 'javascript:;',
- className: 'has-shortcut-text'
- }, {
- innerHTML: "
Shift+click "
- }),
- order: 20,
- open: function(arg) {
- var thread;
- thread = arg.thread;
- if (Conf['Index Mode'] !== 'catalog') {
- return false;
- }
- this.el.firstElementChild.textContent = thread.isHidden ? 'Unhide' : 'Hide';
- if (this.cb) {
- $.off(this.el, 'click', this.cb);
- }
- this.cb = function() {
- $.event('CloseMenu');
- return Index.toggleHide(thread);
- };
- $.on(this.el, 'click', this.cb);
- return true;
- }
- });
- }
- },
- catalogNode: function() {
- return $.on(this.nodes.thumb.parentNode, 'click', Index.onClick);
- },
- onClick: function(e) {
- var thread;
- if (e.button !== 0) {
- return;
- }
- thread = g.threads[this.parentNode.dataset.fullID];
- if (e.shiftKey) {
- Index.toggleHide(thread);
- } else {
- return;
- }
- return e.preventDefault();
- },
- toggleHide: function(thread) {
- $.rm(thread.catalogView.nodes.root);
- if (Index.showHiddenThreads) {
- ThreadHiding.show(thread);
- if (!ThreadHiding.db.get({
- boardID: thread.board.ID,
- threadID: thread.ID
- })) {
- return;
- }
- } else {
- ThreadHiding.hide(thread);
- }
- return ThreadHiding.saveHiddenState(thread);
- },
- cycleSortType: function() {
- var i, k, len1, type, types;
- types = slice.call(Index.selectSort.options).filter(function(option) {
- return !option.disabled;
- });
- for (i = k = 0, len1 = types.length; k < len1; i = ++k) {
- type = types[i];
- if (type.selected) {
- break;
- }
- }
- types[(i + 1) % types.length].selected = true;
- return $.event('change', null, Index.selectSort);
- },
- cb: {
- toggleHiddenThreads: function() {
- $('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? 'Hide' : 'Show';
- Index.sort();
- return Index.buildIndex();
- },
- mode: function() {
- Index.pushState({
- mode: this.value
- });
- return Index.pageLoad(false);
- },
- sort: function() {
- Index.pushState({
- sort: this.value
- });
- return Index.pageLoad(false);
- },
- resort: function() {
- Index.sort();
- return Index.buildIndex();
- },
- perBoardSort: function() {
- Conf['Index Sort'] = this.checked ? {} : '';
- return Index.saveSort();
- },
- size: function(e) {
- if (Conf['Index Mode'] !== 'catalog') {
- $.rmClass(Index.root, 'catalog-small');
- $.rmClass(Index.root, 'catalog-large');
- } else if (Conf['Index Size'] === 'small') {
- $.addClass(Index.root, 'catalog-small');
- $.rmClass(Index.root, 'catalog-large');
- } else {
- $.addClass(Index.root, 'catalog-large');
- $.rmClass(Index.root, 'catalog-small');
- }
- if (e) {
- return Index.buildIndex();
- }
- },
- replies: function() {
- Index.buildThreads();
- Index.sort();
- return Index.buildIndex();
- },
- popstate: function(e) {
- var mode, nCommands, page, ref, searched, sort;
- if (e != null ? e.state : void 0) {
- ref = e.state, searched = ref.searched, mode = ref.mode, sort = ref.sort;
- page = Index.getCurrentPage();
- Index.setState({
- search: searched,
- mode: mode,
- sort: sort,
- page: page
- });
- return Index.pageLoad(false);
- } else {
- nCommands = Index.processHash();
- if (Conf['Refreshed Navigation'] && nCommands) {
- return Index.update();
- } else {
- return Index.pageLoad();
- }
- }
- },
- pageNav: function(e) {
- var a;
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- switch (e.target.nodeName) {
- case 'BUTTON':
- e.target.blur();
- a = e.target.parentNode;
- break;
- case 'A':
- a = e.target;
- break;
- default:
- return;
- }
- if (a.textContent === 'Catalog') {
- return;
- }
- e.preventDefault();
- return Index.userPageNav(+a.pathname.split(/\/+/)[2] || 1);
- },
- refreshFront: function() {
- Index.pushState({
- page: 1
- });
- return Index.update();
- }
- },
- scrollToIndex: function() {
- return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root));
- },
- getCurrentPage: function() {
- return +window.location.pathname.split(/\/+/)[2] || 1;
- },
- userPageNav: function(page) {
- Index.pushState({
- page: page
- });
- if (Conf['Refreshed Navigation']) {
- return Index.update();
- } else {
- return Index.pageLoad();
- }
- },
- hashCommands: {
- mode: {
- 'paged': 'paged',
- 'infinite-scrolling': 'infinite',
- 'infinite': 'infinite',
- 'all-threads': 'all pages',
- 'all-pages': 'all pages',
- 'catalog': 'catalog'
- },
- sort: {
- 'bump-order': 'bump',
- 'last-reply': 'lastreply',
- 'last-long-reply': 'lastlong',
- 'creation-date': 'birth',
- 'reply-count': 'replycount',
- 'file-count': 'filecount'
- }
- },
- processHash: function() {
- var command, commands, hash, k, leftover, len1, mode, ref, sort, state;
- hash = ((ref = location.href.match(/#.*/)) != null ? ref[0] : void 0) || '';
- state = {
- replace: true
- };
- commands = hash.slice(1).split('/');
- leftover = [];
- for (k = 0, len1 = commands.length; k < len1; k++) {
- command = commands[k];
- if ((mode = Index.hashCommands.mode[command])) {
- state.mode = mode;
- } else if (command === 'index') {
- state.mode = Conf['Previous Index Mode'];
- state.page = 1;
- } else if ((sort = Index.hashCommands.sort[command])) {
- state.sort = sort;
- } else if (/^s=/.test(command)) {
- state.search = decodeURIComponent(command.slice(2)).replace(/\+/g, ' ').trim();
- } else {
- leftover.push(command);
- }
- }
- hash = leftover.join('/');
- if (hash) {
- state.hash = "#" + hash;
- }
- Index.pushState(state);
- return commands.length - leftover.length;
- },
- pushState: function(state) {
- var hash, pageBeforeSearch, pathname, ref, replace, search;
- search = state.search, hash = state.hash, replace = state.replace;
- pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0;
- if ((search != null) && search !== Index.search) {
- state.page = search ? 1 : pageBeforeSearch || 1;
- if (!search) {
- pageBeforeSearch = void 0;
- } else if (!Index.search) {
- pageBeforeSearch = Index.currentPage;
- }
- }
- Index.setState(state);
- pathname = Index.currentPage === 1 ? "/" + g.BOARD + "/" : "/" + g.BOARD + "/" + Index.currentPage;
- hash || (hash = '');
- return history[replace ? 'replaceState' : 'pushState']({
- mode: Conf['Index Mode'],
- sort: Index.currentSort,
- searched: Index.search,
- oldpage: pageBeforeSearch
- }, '', location.protocol + "//" + location.host + pathname + hash);
- },
- setState: function(arg) {
- var hash, mode, page, ref, search, sort;
- search = arg.search, mode = arg.mode, sort = arg.sort, page = arg.page, hash = arg.hash;
- if ((search != null) && search !== Index.search) {
- Index.changed.search = true;
- Index.search = search;
- }
- if ((mode != null) && mode !== Conf['Index Mode']) {
- Index.changed.mode = true;
- Conf['Index Mode'] = mode;
- $.set('Index Mode', mode);
- if (!(mode === 'catalog' || Conf['Previous Index Mode'] === mode)) {
- Conf['Previous Index Mode'] = mode;
- $.set('Previous Index Mode', mode);
- }
- }
- if ((sort != null) && sort !== Index.currentSort) {
- Index.changed.sort = true;
- Index.currentSort = sort;
- Index.saveSort();
- }
- if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') {
- page = 1;
- }
- if ((page != null) && page !== Index.currentPage) {
- Index.changed.page = true;
- Index.currentPage = page;
- }
- if (hash != null) {
- return Index.changed.hash = true;
- }
- },
- saveSort: function() {
- if (typeof Conf['Index Sort'] === 'object') {
- Conf['Index Sort'][g.BOARD.ID] = Index.currentSort;
- } else {
- Conf['Index Sort'] = Index.currentSort;
- }
- return $.set('Index Sort', Conf['Index Sort']);
- },
- pageLoad: function(scroll) {
- var hash, mode, page, ref, search, sort, threads;
- if (scroll == null) {
- scroll = true;
- }
- if (!Index.liveThreadData) {
- return;
- }
- ref = Index.changed, threads = ref.threads, search = ref.search, mode = ref.mode, sort = ref.sort, page = ref.page, hash = ref.hash;
- if (threads || search || sort) {
- Index.sort();
- }
- if (threads || search) {
- Index.buildPagelist();
- }
- if (search) {
- Index.setupSearch();
- }
- if (mode) {
- Index.setupMode();
- }
- if (sort) {
- Index.setupSort();
- }
- if (threads || search || mode || page || sort) {
- Index.buildIndex();
- }
- if (threads || search || mode || page) {
- Index.setPage();
- }
- if (scroll && !hash) {
- Index.scrollToIndex();
- }
- if (hash) {
- Header.hashScroll();
- }
- return Index.changed = {};
- },
- setupMode: function() {
- var k, len1, mode, ref;
- ref = ['paged', 'infinite', 'all pages', 'catalog'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- mode = ref[k];
- $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode");
- }
- Index.selectMode.value = Conf['Index Mode'];
- Index.cb.size();
- Index.showHiddenThreads = false;
- return $('#hidden-toggle a', Index.navLinks).textContent = 'Show';
- },
- setupSort: function() {
- return Index.selectSort.value = Index.currentSort;
- },
- getPagesNum: function() {
- if (Index.search) {
- return Math.ceil(Index.sortedNodes.length / Index.threadsNumPerPage);
- } else {
- return Index.pagesNum;
- }
- },
- getMaxPageNum: function() {
- return Math.max(1, Index.getPagesNum());
- },
- buildPagelist: function() {
- var a, i, k, maxPageNum, nodes, pagesRoot, ref;
- pagesRoot = $('.pages', Index.pagelist);
- maxPageNum = Index.getMaxPageNum();
- if (pagesRoot.childElementCount !== maxPageNum) {
- nodes = [];
- for (i = k = 1, ref = maxPageNum; k <= ref; i = k += 1) {
- a = $.el('a', {
- textContent: i,
- href: i === 1 ? './' : i
- });
- nodes.push($.tn('['), a, $.tn('] '));
- }
- $.rmAll(pagesRoot);
- return $.add(pagesRoot, nodes);
- }
- },
- setPage: function() {
- var a, href, maxPageNum, next, pageNum, pagesRoot, prev, strong;
- pageNum = Index.currentPage;
- maxPageNum = Index.getMaxPageNum();
- pagesRoot = $('.pages', Index.pagelist);
- prev = pagesRoot.previousSibling.firstChild;
- next = pagesRoot.nextSibling.firstChild;
- href = Math.max(pageNum - 1, 1);
- prev.href = href === 1 ? './' : href;
- prev.firstChild.disabled = href === pageNum;
- href = Math.min(pageNum + 1, maxPageNum);
- next.href = href === 1 ? './' : href;
- next.firstChild.disabled = href === pageNum;
- if (strong = $('strong', pagesRoot)) {
- if (+strong.textContent === pageNum) {
- return;
- }
- $.replace(strong, strong.firstChild);
- } else {
- strong = $.el('strong');
- }
- a = pagesRoot.children[pageNum - 1];
- $.before(a, strong);
- return $.add(strong, a);
- },
- updateHideLabel: function() {
- var hiddenCount, ref, ref1, thread, threadID;
- hiddenCount = 0;
- ref = g.BOARD.threads;
- for (threadID in ref) {
- thread = ref[threadID];
- if (thread.isHidden) {
- if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) >= 0) {
- hiddenCount++;
- }
- }
- }
- if (!hiddenCount) {
- Index.hideLabel.hidden = true;
- if (Index.showHiddenThreads) {
- Index.cb.toggleHiddenThreads();
- }
- return;
- }
- Index.hideLabel.hidden = false;
- return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads";
- },
- update: function(firstTime) {
- var now, ref, ref1;
- if ((ref = Index.req) != null) {
- ref.abort();
- }
- if ((ref1 = Index.notice) != null) {
- ref1.close();
- }
- if (Conf['Index Refresh Notifications'] && d.readyState !== 'loading') {
- Index.notice = new Notice('info', 'Refreshing index...');
- } else {
- now = Date.now();
- $.ready(function() {
- return Index.nTimeout = setTimeout((function() {
- if (Index.req && !Index.notice) {
- return Index.notice = new Notice('info', 'Refreshing index...');
- }
- }), 3 * $.SECOND - (Date.now() - now));
- });
- }
- if (!firstTime && d.readyState !== 'loading' && !$('.board + *')) {
- location.reload();
- return;
- }
- Index.req = $.ajax("//a.4cdn.org/" + g.BOARD + "/catalog.json", {
- onabort: Index.load,
- onloadend: Index.load
- }, {
- whenModified: 'Index'
- });
- return $.addClass(Index.button, 'fa-spin');
- },
- load: function(e) {
- var err, nTimeout, notice, ref, req, timeEl;
- $.rmClass(Index.button, 'fa-spin');
- req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
- if (nTimeout) {
- clearTimeout(nTimeout);
- }
- delete Index.nTimeout;
- delete Index.req;
- delete Index.notice;
- if (e.type === 'abort') {
- req.onloadend = null;
- if (notice != null) {
- notice.close();
- }
- return;
- }
- if ((ref = req.status) !== 200 && ref !== 304) {
- err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
- if (notice) {
- notice.setType('warning');
- notice.el.lastElementChild.textContent = err;
- setTimeout(notice.close, $.SECOND);
- } else {
- new Notice('warning', err, 1);
- }
- return;
- }
- try {
- if (req.status === 200) {
- Index.parse(req.response);
- } else if (req.status === 304) {
- Index.pageLoad();
- }
- } catch (_error) {
- err = _error;
- c.error("Index failure: " + err.message, err.stack);
- if (notice) {
- notice.setType('error');
- notice.el.lastElementChild.textContent = 'Index refresh failed.';
- setTimeout(notice.close, $.SECOND);
- } else {
- new Notice('error', 'Index refresh failed.', 1);
- }
- return;
- }
- if (notice) {
- if (Conf['Index Refresh Notifications']) {
- notice.setType('success');
- notice.el.lastElementChild.textContent = 'Index refreshed!';
- setTimeout(notice.close, $.SECOND);
- } else {
- notice.close();
- }
- }
- timeEl = $('#index-last-refresh time', Index.navLinks);
- timeEl.dataset.utc = Date.parse(req.getResponseHeader('Last-Modified'));
- return RelativeDates.update(timeEl);
- },
- parse: function(pages) {
- $.cleanCache(function(url) {
- return /^\/\/a\.4cdn\.org\//.test(url);
- });
- Index.parseThreadList(pages);
- Index.buildThreads();
- Index.changed.threads = true;
- return Index.pageLoad();
- },
- parseThreadList: function(pages) {
- var ref;
- Index.pagesNum = pages.length;
- Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1;
- Index.liveThreadData = pages.reduce((function(arr, next) {
- return arr.concat(next.threads);
- }), []);
- Index.liveThreadIDs = Index.liveThreadData.map(function(data) {
- return data.no;
- });
- g.BOARD.threads.forEach(function(thread) {
- var ref1;
- if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) < 0) {
- return thread.collect();
- }
- });
- },
- buildThreads: function() {
- var err, errors, i, k, len1, posts, ref, thread, threadData, threadRoot, threads;
- if (!Index.liveThreadData) {
- return;
- }
- Index.nodes = [];
- threads = [];
- posts = [];
- ref = Index.liveThreadData;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- threadData = ref[i];
- try {
- threadRoot = Build.thread(g.BOARD, threadData);
- if (Index.hat) {
- $.prepend(threadRoot, Index.hat.cloneNode(false));
- }
- if (thread = g.BOARD.threads[threadData.no]) {
- thread.setCount('post', threadData.replies + 1, threadData.bumplimit);
- thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit);
- thread.setStatus('Sticky', !!threadData.sticky);
- thread.setStatus('Closed', !!threadData.closed);
- } else {
- thread = new Thread(threadData.no, g.BOARD);
- threads.push(thread);
- }
- Index.nodes.push(threadRoot);
- if (!(thread.OP && !thread.OP.isFetchedQuote)) {
- posts.push(new Post($('.opContainer', threadRoot), thread, g.BOARD));
- }
- thread.setPage(Math.floor(i / Index.threadsNumPerPage) + 1);
- } catch (_error) {
- err = _error;
- if (!errors) {
- errors = [];
- }
- errors.push({
- message: "Parsing of Thread No." + thread + " failed. Thread will be skipped.",
- error: err
- });
- }
- }
- if (errors) {
- Main.handleErrors(errors);
- }
- $.nodes(Index.nodes);
- Main.callbackNodes(Thread, threads);
- Main.callbackNodes(Post, posts);
- Index.updateHideLabel();
- return $.event('IndexRefresh');
- },
- buildReplies: function(threadRoots) {
- var data, err, errors, i, k, lastReplies, len1, len2, node, nodes, post, posts, q, thread, threadRoot;
- posts = [];
- for (k = 0, len1 = threadRoots.length; k < len1; k++) {
- threadRoot = threadRoots[k];
- thread = Get.threadFromRoot(threadRoot);
- i = Index.liveThreadIDs.indexOf(thread.ID);
- if (!(lastReplies = Index.liveThreadData[i].last_replies)) {
- continue;
- }
- nodes = [];
- for (q = 0, len2 = lastReplies.length; q < len2; q++) {
- data = lastReplies[q];
- if ((post = thread.posts[data.no]) && !post.isFetchedQuote) {
- nodes.push(post.nodes.root);
- continue;
- }
- nodes.push(node = Build.postFromObject(data, thread.board.ID));
- try {
- posts.push(new Post(node, thread, thread.board));
- } catch (_error) {
- err = _error;
- if (!errors) {
- errors = [];
- }
- errors.push({
- message: "Parsing of Post No." + data.no + " failed. Post will be skipped.",
- error: err
- });
- }
- }
- $.add(threadRoot, nodes);
- }
- if (errors) {
- Main.handleErrors(errors);
- }
- return Main.callbackNodes(Post, posts);
- },
- buildCatalogViews: function() {
- var catalogThreads, k, len1, thread, threads;
- threads = Index.sortedNodes.map(function(threadRoot) {
- return Get.threadFromRoot(threadRoot);
- }).filter(function(thread) {
- return !thread.isHidden !== Index.showHiddenThreads;
- });
- catalogThreads = [];
- for (k = 0, len1 = threads.length; k < len1; k++) {
- thread = threads[k];
- if (!thread.catalogView) {
- catalogThreads.push(new CatalogThread(Build.catalogThread(thread), thread));
- }
- }
- Main.callbackNodes(CatalogThread, catalogThreads);
- return threads.map(function(thread) {
- return thread.catalogView.nodes.root;
- });
- },
- sizeCatalogViews: function(nodes) {
- var height, k, len1, node, ratio, ref, size, thumb, width;
- size = Conf['Index Size'] === 'small' ? 150 : 250;
- for (k = 0, len1 = nodes.length; k < len1; k++) {
- node = nodes[k];
- thumb = $('.catalog-thumb', node);
- ref = thumb.dataset, width = ref.width, height = ref.height;
- if (!width) {
- continue;
- }
- ratio = size / Math.max(width, height);
- thumb.style.width = width * ratio + 'px';
- thumb.style.height = height * ratio + 'px';
- }
- },
- sort: function() {
- var k, lastlong, len1, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
- liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
- if (!liveThreadData) {
- return;
- }
- sortedThreadIDs = (function() {
- switch (Index.currentSort) {
- case 'lastreply':
- return slice.call(liveThreadData).sort(function(a, b) {
- var num;
- if ((num = a.last_replies)) {
- a = num[num.length - 1];
- }
- if ((num = b.last_replies)) {
- b = num[num.length - 1];
- }
- return b.no - a.no;
- }).map(function(post) {
- return post.no;
- });
- case 'lastlong':
- lastlong = function(thread) {
- var i, k, r, ref;
- ref = thread.last_replies || [];
- for (i = k = ref.length - 1; k >= 0; i = k += -1) {
- r = ref[i];
- if (r.com && Build.parseComment(r.com).replace(/[^a-z]/ig, '').length >= 100) {
- return r;
- }
- }
- return thread;
- };
- return slice.call(liveThreadData).sort(function(a, b) {
- return lastlong(b).no - lastlong(a).no;
- }).map(function(post) {
- return post.no;
- });
- case 'bump':
- return liveThreadIDs;
- case 'birth':
- return slice.call(liveThreadIDs).sort(function(a, b) {
- return b - a;
- });
- case 'replycount':
- return slice.call(liveThreadData).sort(function(a, b) {
- return b.replies - a.replies;
- }).map(function(post) {
- return post.no;
- });
- case 'filecount':
- return slice.call(liveThreadData).sort(function(a, b) {
- return b.images - a.images;
- }).map(function(post) {
- return post.no;
- });
- }
- })();
- Index.sortedNodes = sortedNodes = [];
- nodes = Index.nodes;
- for (k = 0, len1 = sortedThreadIDs.length; k < len1; k++) {
- threadID = sortedThreadIDs[k];
- sortedNodes.push(nodes[Index.liveThreadIDs.indexOf(threadID)]);
- }
- if (Index.search && (nodes = Index.querySearch(Index.search))) {
- Index.sortedNodes = nodes;
- }
- Index.sortOnTop(function(thread) {
- return thread.isSticky;
- });
- Index.sortOnTop(function(thread) {
- return thread.isOnTop || Conf['Pin Watched Threads'] && ThreadWatcher.isWatched(thread);
- });
- if (Conf['Anchor Hidden Threads']) {
- return Index.sortOnTop(function(thread) {
- return !thread.isHidden;
- });
- }
- },
- sortOnTop: function(match) {
- var bottomNodes, k, len1, ref, threadRoot, topNodes;
- topNodes = [];
- bottomNodes = [];
- ref = Index.sortedNodes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- threadRoot = ref[k];
- (match(Get.threadFromRoot(threadRoot)) ? topNodes : bottomNodes).push(threadRoot);
- }
- return Index.sortedNodes = topNodes.concat(bottomNodes);
- },
- buildIndex: function() {
- var i, nodes, page, post;
- if (!Index.liveThreadData) {
- return;
- }
- switch (Conf['Index Mode']) {
- case 'all pages':
- nodes = Index.sortedNodes;
- break;
- case 'catalog':
- nodes = Index.buildCatalogViews();
- Index.sizeCatalogViews(nodes);
- break;
- default:
- if (Index.followedThreadID != null) {
- i = 0;
- while (Index.followedThreadID !== Get.threadFromRoot(Index.sortedNodes[i]).ID) {
- i++;
- }
- page = Math.floor(i / Index.threadsNumPerPage) + 1;
- if (page !== Index.currentPage) {
- Index.currentPage = page;
- Index.pushState({
- page: page
- });
- Index.setPage();
- }
- }
- nodes = Index.buildSinglePage(Index.currentPage);
- }
- delete Index.pageNum;
- $.rmAll(Index.root);
- $.rmAll(Header.hover);
- if (Conf['Index Mode'] === 'catalog') {
- return $.add(Index.root, nodes);
- } else {
- if (Conf['Show Replies']) {
- Index.buildReplies(nodes);
- }
- Index.buildStructure(nodes);
- if ((Index.followedThreadID != null) && (post = g.posts[g.BOARD + "." + Index.followedThreadID])) {
- return Header.scrollTo(post.nodes.root);
- }
- }
- },
- buildSinglePage: function(pageNum) {
- var nodesPerPage, offset;
- nodesPerPage = Index.threadsNumPerPage;
- offset = nodesPerPage * (pageNum - 1);
- return Index.sortedNodes.slice(offset, offset + nodesPerPage);
- },
- buildStructure: function(nodes) {
- var k, len1, node, thumb;
- for (k = 0, len1 = nodes.length; k < len1; k++) {
- node = nodes[k];
- if (thumb = $('img[data-src]', node)) {
- thumb.src = thumb.dataset.src;
- thumb.removeAttribute('data-src');
- }
- $.add(Index.root, [node, $.el('hr')]);
- }
- if (doc.contains(Index.root)) {
- $.event('PostsInserted');
- }
- return ThreadHiding.onIndexBuild(nodes);
- },
- clearSearch: function() {
- Index.searchInput.value = '';
- Index.onSearchInput();
- return Index.searchInput.focus();
- },
- setupSearch: function() {
- Index.searchInput.value = Index.search;
- if (Index.search) {
- return Index.searchInput.dataset.searching = 1;
- } else {
- return Index.searchInput.removeAttribute('data-searching');
- }
- },
- onSearchInput: function() {
- var search;
- search = Index.searchInput.value.trim();
- if (search === Index.search) {
- return;
- }
- Index.pushState({
- search: search,
- replace: !!search === !!Index.search
- });
- return Index.pageLoad(false);
- },
- querySearch: function(query) {
- var keywords;
- if (!(keywords = query.toLowerCase().match(/\S+/g))) {
- return;
- }
- return Index.sortedNodes.filter(function(threadRoot) {
- return Index.searchMatch(Get.threadFromRoot(threadRoot), keywords);
- });
- },
- searchMatch: function(thread, keywords) {
- var file, info, k, key, keyword, len1, len2, q, ref, ref1, text;
- ref = thread.OP, info = ref.info, file = ref.file;
- text = [];
- ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- key = ref1[k];
- if (key in info) {
- text.push(info[key]);
- }
- }
- if (file) {
- text.push(file.name);
- }
- text = text.join(' ').toLowerCase();
- for (q = 0, len2 = keywords.length; q < len2; q++) {
- keyword = keywords[q];
- if (-1 === text.indexOf(keyword)) {
- return false;
- }
- }
- return true;
- }
- };
-
- Build = {
- staticPath: '//s.4cdn.org/image/',
- gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif',
- spoilerRange: {},
- unescape: function(text) {
- if (text == null) {
- return text;
- }
- return text.replace(/<[^>]*>/g, '').replace(/&(amp|#039|quot|lt|gt|#44);/g, function(c) {
- return {
- '&': '&',
- ''': "'",
- '"': '"',
- '<': '<',
- '>': '>',
- ',': ','
- }[c];
- });
- },
- shortFilename: function(filename) {
- var ext, threshold;
- threshold = 30;
- ext = filename.match(/\.?[^\.]*$/)[0];
- if (filename.length - ext.length > threshold) {
- return filename.slice(0, threshold - 5) + "(...)" + ext;
- } else {
- return filename;
- }
- },
- spoilerThumb: function(boardID) {
- var spoilerRange;
- if (spoilerRange = Build.spoilerRange[boardID]) {
- return Build.staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png";
- } else {
- return Build.staticPath + "spoiler.png";
- }
- },
- sameThread: function(boardID, threadID) {
- return g.VIEW === 'thread' && g.BOARD.ID === boardID && g.THREADID === +threadID;
- },
- postURL: function(boardID, threadID, postID) {
- if (Build.sameThread(boardID, threadID)) {
- return "#p" + postID;
- } else {
- return "/" + boardID + "/thread/" + threadID + "#p" + postID;
- }
- },
- parseJSON: function(data, boardID) {
- var o;
- o = {
- postID: data.no,
- threadID: data.resto || data.no,
- boardID: boardID,
- isReply: !!data.resto,
- isSticky: !!data.sticky,
- isClosed: !!data.closed,
- isArchived: !!data.archived,
- fileDeleted: !!data.filedeleted
- };
- o.info = {
- subject: Build.unescape(data.sub),
- email: Build.unescape(data.email),
- name: Build.unescape(data.name) || '',
- tripcode: data.trip,
- uniqueID: data.id,
- flagCode: data.country,
- flag: Build.unescape(data.country_name),
- dateUTC: data.time,
- dateText: data.now,
- commentHTML: {
- innerHTML: data.com || ''
- }
- };
- if (data.capcode) {
- o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, function(c) {
- return c.toUpperCase();
- });
- o.capcodeHighlight = /_highlight$/.test(data.capcode);
- delete o.info.uniqueID;
- }
- if (data.ext) {
- o.file = {
- name: (Build.unescape(data.filename)) + data.ext,
- url: boardID === 'f' ? location.protocol + "//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.filename)) + data.ext : location.protocol + "//i.4cdn.org/" + boardID + "/" + data.tim + data.ext,
- height: data.h,
- width: data.w,
- MD5: data.md5,
- size: $.bytesToString(data.fsize),
- thumbURL: location.protocol + "//i.4cdn.org/" + boardID + "/" + data.tim + "s.jpg",
- theight: data.tn_h,
- twidth: data.tn_w,
- isSpoiler: !!data.spoiler,
- tag: data.tag
- };
- if (!/\.pdf$/.test(o.file.url)) {
- o.file.dimensions = o.file.width + "x" + o.file.height;
- }
- }
- return o;
- },
- parseComment: function(html) {
- html = html.replace(/
/gi, '\n').replace(/\n\n
Rolled [^<]*<\/b>/i, '').replace(/]*>/g, '');
- return Build.unescape(html);
- },
- postFromObject: function(data, boardID, suppressThumb) {
- var o;
- o = Build.parseJSON(data, boardID);
- return Build.post(o, suppressThumb);
- },
- post: function(o, suppressThumb) {
- var boardID, capcode, capcodeDescription, capcodeLC, capcodeLong, capcodePlural, commentHTML, container, dateText, dateUTC, email, file, fileBlock, fileThumb, fileURL, flag, flagCode, gifIcon, href, k, len1, match, name, postClass, postID, postInfo, postLink, protocol, quote, quoteLink, ref, ref1, shortFilename, staticPath, subject, threadID, tripcode, uniqueID, wholePost;
- postID = o.postID, threadID = o.threadID, boardID = o.boardID, file = o.file;
- ref = o.info, subject = ref.subject, email = ref.email, name = ref.name, tripcode = ref.tripcode, capcode = ref.capcode, uniqueID = ref.uniqueID, flagCode = ref.flagCode, flag = ref.flag, dateUTC = ref.dateUTC, dateText = ref.dateText, commentHTML = ref.commentHTML;
- staticPath = Build.staticPath, gifIcon = Build.gifIcon;
-
- /* Post Info */
- if (capcode) {
- capcodeLC = capcode.toLowerCase();
- if (capcode === 'Founder') {
- capcodePlural = 'the Founder';
- capcodeDescription = "4chan's Founder";
- } else {
- capcodeLong = {
- 'Admin': 'Administrator',
- 'Mod': 'Moderator'
- }[capcode] || capcode;
- capcodePlural = capcodeLong + "s";
- capcodeDescription = "a 4chan " + capcodeLong;
- }
- }
- postLink = Build.postURL(boardID, threadID, postID);
- quoteLink = Build.sameThread(boardID, threadID) ? "javascript:quote('" + (+postID) + "');" : "/" + boardID + "/thread/" + threadID + "#q" + postID;
- postInfo = {
- innerHTML: ""
- };
-
- /* File Info */
- if (file) {
- protocol = /^https?:(?=\/\/i\.4cdn\.org\/)/;
- fileURL = file.url.replace(protocol, '');
- shortFilename = Build.shortFilename(file.name);
- fileThumb = file.isSpoiler ? Build.spoilerThumb(boardID) : file.thumbURL.replace(protocol, '');
- }
- fileBlock = {
- innerHTML: (file ? "" : (o.fileDeleted ? "" : ""))
- };
-
- /* Whole Post */
- postClass = o.isReply ? 'reply' : 'op';
- wholePost = {
- innerHTML: (o.isReply ? ">>
" : "") + "" + (o.isReply ? postInfo.innerHTML + fileBlock.innerHTML : fileBlock.innerHTML + postInfo.innerHTML) + "
" + commentHTML.innerHTML + " "
- };
- container = $.el('div', {
- className: "postContainer " + postClass + "Container",
- id: "pc" + postID
- });
- $.extend(container, wholePost);
- ref1 = $$('.quotelink', container);
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- quote = ref1[k];
- href = quote.getAttribute('href');
- if ((href[0] === '#') && !(Build.sameThread(boardID, threadID))) {
- quote.href = ("/" + boardID + "/thread/" + threadID) + href;
- } else if ((match = href.match(/^\/([^\/]+)\/thread\/(\d+)/)) && (Build.sameThread(match[1], match[2]))) {
- quote.href = href.match(/(#[^#]*)?$/)[0] || '#';
- } else if (/^\d+(#|$)/.test(href) && !(g.VIEW === 'thread' && g.BOARD.ID === boardID)) {
- quote.href = "/" + boardID + "/thread/" + href;
- }
- }
- return container;
- },
- summaryText: function(status, posts, files) {
- var text;
- text = '';
- if (status) {
- text += status + " ";
- }
- text += posts + " post" + (posts > 1 ? 's' : '');
- if (+files) {
- text += " and " + files + " image repl" + (files > 1 ? 'ies' : 'y');
- }
- return text += " " + (status === '-' ? 'shown' : 'omitted') + ".";
- },
- summary: function(boardID, threadID, posts, files) {
- return $.el('a', {
- className: 'summary',
- textContent: Build.summaryText('', posts, files),
- href: "/" + boardID + "/thread/" + threadID
- });
- },
- thread: function(board, data, full) {
- var OP, root;
- Build.spoilerRange[board] = data.custom_spoiler;
- if (OP = board.posts[data.no]) {
- if (OP.isFetchedQuote) {
- OP = null;
- }
- }
- if (OP && (root = OP.nodes.root.parentNode)) {
- $.rmAll(root);
- } else {
- root = $.el('div', {
- className: 'thread',
- id: "t" + data.no
- });
- }
- $.add(root, Build[full ? 'fullThread' : 'excerptThread'](board, data, OP));
- return root;
- },
- excerptThread: function(board, data, OP) {
- var files, nodes, posts, ref;
- nodes = [OP ? OP.nodes.root : Build.postFromObject(data, board.ID, true)];
- if (data.omitted_posts || !Conf['Show Replies'] && data.replies) {
- ref = Conf['Show Replies'] ? [
- data.omitted_posts, data.images - data.last_replies.filter(function(data) {
- return !!data.ext;
- }).length
- ] : [data.replies, data.images], posts = ref[0], files = ref[1];
- nodes.push(Build.summary(board.ID, data.no, posts, files));
- }
- return nodes;
- },
- fullThread: function(board, data) {
- return Build.postFromObject(data, board.ID);
- },
- catalogThread: function(thread) {
- var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, u, v;
- staticPath = Build.staticPath, gifIcon = Build.gifIcon;
- data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)];
- if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) {
- src = staticPath + "spoiler";
- if (spoilerRange = Build.spoilerRange[thread.board]) {
- src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random());
- }
- src += '.png';
- imgClass = 'spoiler-file';
- } else if (data.filedeleted) {
- src = staticPath + "filedeleted-res" + gifIcon;
- imgClass = 'deleted-file';
- } else if (thread.OP.file) {
- src = thread.OP.file.thumbURL;
- } else {
- src = staticPath + "nofile.png";
- imgClass = 'no-file';
- }
- postCount = data.replies + 1;
- fileCount = data.images + !!data.ext;
- pageCount = Math.floor(Index.liveThreadIDs.indexOf(thread.ID) / Index.threadsNumPerPage) + 1;
- comment = {
- innerHTML: data.com || ''
- };
- root = $.el('div', {
- className: 'catalog-thread'
- });
- $.extend(root, {
- innerHTML: "" + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "
" + (thread.OP.info.subject ? "" + E(thread.OP.info.subject) + "
" : "") + ""
- });
- root.dataset.fullID = thread.fullID;
- if (thread.OP.highlights) {
- $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights)));
- }
- ref = $$('.quotelink', root.lastElementChild);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- href = quote.getAttribute('href');
- if (href[0] === '#') {
- quote.href = ("/" + thread.board + "/thread/" + thread.ID) + href;
- }
- }
- ref1 = $$('.abbr, .exif', root.lastElementChild);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- exif = ref1[q];
- $.rm(exif);
- }
- ref2 = $$('.prettyprint', root.lastElementChild);
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- pp = ref2[u];
- cc = $.el('span', {
- className: 'catalog-code'
- });
- $.add(cc, slice.call(pp.childNodes));
- $.replace(pp, cc);
- }
- ref3 = $$('br', root.lastElementChild);
- for (v = 0, len4 = ref3.length; v < len4; v++) {
- br = ref3[v];
- if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') {
- $.rm(br);
- }
- }
- if (thread.isSticky) {
- $.add($('.catalog-icons', root), $.el('img', {
- src: staticPath + "sticky" + gifIcon,
- className: 'stickyIcon',
- title: 'Sticky'
- }));
- }
- if (thread.isClosed) {
- $.add($('.catalog-icons', root), $.el('img', {
- src: staticPath + "closed" + gifIcon,
- className: 'closedIcon',
- title: 'Closed'
- }));
- }
- if (data.bumplimit) {
- $.addClass($('.post-count', root), 'warning');
- }
- if (data.imagelimit) {
- $.addClass($('.file-count', root), 'warning');
- }
- return root;
- }
- };
-
- Get = {
- threadExcerpt: function(thread) {
- var OP, excerpt, ref;
- OP = thread.OP;
- excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.commentDisplay.replace(/\n+/g, ' // ') || OP.info.nameBlock);
- if (excerpt.length > 73) {
- return excerpt.slice(0, 70) + "...";
- }
- return excerpt;
- },
- threadFromRoot: function(root) {
- return g.threads[g.BOARD + "." + root.id.slice(1)];
- },
- threadFromNode: function(node) {
- return Get.threadFromRoot($.x('ancestor::div[@class="thread"]', node));
- },
- postFromRoot: function(root) {
- var index, post;
- if (root == null) {
- return null;
- }
- post = g.posts[root.dataset.fullID];
- index = root.dataset.clone;
- if (index) {
- return post.clones[index];
- } else {
- return post;
- }
- },
- postFromNode: function(root) {
- return Get.postFromRoot($.x('(ancestor::div[contains(@class,"postContainer")][1]|following::div[contains(@class,"postContainer")][1])', root));
- },
- postDataFromLink: function(link) {
- var boardID, path, postID, ref, threadID;
- if (link.hostname === 'boards.4chan.org') {
- path = link.pathname.split(/\/+/);
- boardID = path[1];
- threadID = path[3];
- postID = link.hash.slice(2);
- } else {
- ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- threadID || (threadID = 0);
- }
- return {
- boardID: boardID,
- threadID: +threadID,
- postID: +postID
- };
- },
- allQuotelinksLinkingTo: function(post) {
- var fullID, handleQuotes, k, len1, posts, qPost, quote, quotelinks, ref;
- quotelinks = [];
- posts = g.posts;
- fullID = post.fullID;
- handleQuotes = function(qPost, type) {
- var clone, k, len1, ref;
- quotelinks.push.apply(quotelinks, qPost.nodes[type]);
- ref = qPost.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- quotelinks.push.apply(quotelinks, clone.nodes[type]);
- }
- };
- posts.forEach(function(qPost) {
- if (indexOf.call(qPost.quotes, fullID) >= 0) {
- return handleQuotes(qPost, 'quotelinks');
- }
- });
- if (Conf['Quote Backlinks']) {
- ref = post.quotes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- if (qPost = posts[quote]) {
- handleQuotes(qPost, 'backlinks');
- }
- }
- }
- return quotelinks.filter(function(quotelink) {
- var boardID, postID, ref1;
- ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
- return boardID === post.board.ID && postID === post.ID;
- });
- },
- scriptData: function() {
- var k, len1, ref, script;
- ref = $$('script:not([src])', d.head);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- script = ref[k];
- if (/\bcooldowns *=/.test(script.textContent)) {
- return script.textContent;
- }
- }
- return '';
- }
- };
-
- UI = (function() {
- var Menu, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove;
- dialog = function(id, position, properties) {
- var child, el, k, len1, move, ref;
- el = $.el('div', {
- className: 'dialog',
- id: id
- });
- $.extend(el, properties);
- el.style.cssText = position;
- $.get(id + ".position", position, function(item) {
- return el.style.cssText = item[id + ".position"];
- });
- move = $('.move', el);
- $.on(move, 'touchstart mousedown', dragstart);
- ref = move.children;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- child = ref[k];
- if (!child.tagName) {
- continue;
- }
- $.on(child, 'touchstart mousedown', function(e) {
- return e.stopPropagation();
- });
- }
- return el;
- };
- Menu = (function() {
- var currentMenu, lastToggledButton;
-
- currentMenu = null;
-
- lastToggledButton = null;
-
- function Menu(type1) {
- this.type = type1;
- this.addEntry = bind(this.addEntry, this);
- this.onFocus = bind(this.onFocus, this);
- this.keybinds = bind(this.keybinds, this);
- this.close = bind(this.close, this);
- $.on(d, 'AddMenuEntry', (function(_this) {
- return function(arg) {
- var detail;
- detail = arg.detail;
- if (detail.type !== _this.type) {
- return;
- }
- delete detail.open;
- return _this.addEntry(detail);
- };
- })(this));
- this.entries = [];
- }
-
- Menu.prototype.makeMenu = function() {
- var menu;
- menu = $.el('div', {
- className: 'dialog',
- id: 'menu',
- tabIndex: 0
- });
- $.on(menu, 'click', function(e) {
- return e.stopPropagation();
- });
- $.on(menu, 'keydown', this.keybinds);
- return menu;
- };
-
- Menu.prototype.toggle = function(e, button, data) {
- var previousButton;
- e.preventDefault();
- e.stopPropagation();
- if (currentMenu) {
- previousButton = lastToggledButton;
- currentMenu.close();
- if (previousButton === button) {
- return;
- }
- }
- if (!this.entries.length) {
- return;
- }
- return this.open(button, data);
- };
-
- Menu.prototype.open = function(button, data) {
- var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, k, left, len1, mRect, menu, ref, ref1, ref2, right, style, top;
- menu = this.menu = this.makeMenu();
- currentMenu = this;
- lastToggledButton = button;
- this.entries.sort(function(first, second) {
- return first.order - second.order;
- });
- ref = this.entries;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- entry = ref[k];
- this.insertEntry(entry, menu, data);
- }
- $.addClass(lastToggledButton, 'active');
- $.on(d, 'click CloseMenu', this.close);
- if (this.type !== 'gallery') {
- $.on(d, 'scroll', this.close);
- }
- $.add(button, menu);
- mRect = menu.getBoundingClientRect();
- bRect = button.getBoundingClientRect();
- bTop = window.scrollY + bRect.top;
- bLeft = window.scrollX + bRect.left;
- cHeight = doc.clientHeight;
- cWidth = doc.clientWidth;
- ref1 = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom, null] : [null, cHeight - bRect.top], top = ref1[0], bottom = ref1[1];
- ref2 = bRect.left + mRect.width < cWidth ? [bRect.left, null] : [null, cWidth - bRect.right], left = ref2[0], right = ref2[1];
- style = menu.style;
- style.top = top + "px";
- style.right = right + "px";
- style.bottom = bottom + "px";
- style.left = left + "px";
- if (right) {
- $.addClass(menu, 'left');
- }
- entry = $('.entry', menu);
- this.focus(entry);
- return menu.focus();
- };
-
- Menu.prototype.insertEntry = function(entry, parent, data) {
- var err, k, len1, ref, subEntry, submenu;
- if (typeof entry.open === 'function') {
- try {
- if (!entry.open(data)) {
- return;
- }
- } catch (_error) {
- err = _error;
- Main.handleErrors({
- message: "Error in building the " + this.type + " menu.",
- error: err
- });
- return;
- }
- }
- $.add(parent, entry.el);
- if (!entry.subEntries) {
- return;
- }
- if (submenu = $('.submenu', entry.el)) {
- $.rm(submenu);
- }
- submenu = $.el('div', {
- className: 'dialog submenu'
- });
- ref = entry.subEntries;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- subEntry = ref[k];
- this.insertEntry(subEntry, submenu, data);
- }
- $.add(entry.el, submenu);
- };
-
- Menu.prototype.close = function() {
- $.rm(this.menu);
- delete this.menu;
- $.rmClass(lastToggledButton, 'active');
- currentMenu = null;
- lastToggledButton = null;
- return $.off(d, 'click scroll CloseMenu', this.close);
- };
-
- Menu.prototype.findNextEntry = function(entry, direction) {
- var entries;
- entries = slice.call(entry.parentNode.children);
- entries.sort(function(first, second) {
- return first.style.order - second.style.order;
- });
- return entries[entries.indexOf(entry) + direction];
- };
-
- Menu.prototype.keybinds = function(e) {
- var entry, next, nextPrev, subEntry, submenu;
- entry = $('.focused', this.menu);
- while (subEntry = $('.focused', entry)) {
- entry = subEntry;
- }
- switch (e.keyCode) {
- case 27:
- lastToggledButton.focus();
- this.close();
- break;
- case 13:
- case 32:
- entry.click();
- break;
- case 38:
- if (next = this.findNextEntry(entry, -1)) {
- this.focus(next);
- }
- break;
- case 40:
- if (next = this.findNextEntry(entry, +1)) {
- this.focus(next);
- }
- break;
- case 39:
- if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) {
- while (nextPrev = this.findNextEntry(next, -1)) {
- next = nextPrev;
- }
- this.focus(next);
- }
- break;
- case 37:
- if (next = $.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) {
- this.focus(next);
- }
- break;
- default:
- return;
- }
- e.preventDefault();
- return e.stopPropagation();
- };
-
- Menu.prototype.onFocus = function(e) {
- e.stopPropagation();
- return this.focus(e.target);
- };
-
- Menu.prototype.focus = function(entry) {
- var bottom, cHeight, cWidth, eRect, focused, k, left, len1, ref, ref1, ref2, right, sRect, style, submenu, top;
- while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
- $.rmClass(focused, 'focused');
- }
- ref = $$('.focused', entry);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- focused = ref[k];
- $.rmClass(focused, 'focused');
- }
- $.addClass(entry, 'focused');
- if (!(submenu = $('.submenu', entry))) {
- return;
- }
- sRect = submenu.getBoundingClientRect();
- eRect = entry.getBoundingClientRect();
- cHeight = doc.clientHeight;
- cWidth = doc.clientWidth;
- ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1];
- ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1];
- style = submenu.style;
- style.top = top;
- style.bottom = bottom;
- style.left = left;
- return style.right = right;
- };
-
- Menu.prototype.addEntry = function(entry) {
- this.parseEntry(entry);
- return this.entries.push(entry);
- };
-
- Menu.prototype.parseEntry = function(entry) {
- var el, k, len1, subEntries, subEntry;
- el = entry.el, subEntries = entry.subEntries;
- $.addClass(el, 'entry');
- $.on(el, 'focus mouseover', this.onFocus);
- el.style.order = entry.order || 100;
- if (!subEntries) {
- return;
- }
- $.addClass(el, 'has-submenu');
- for (k = 0, len1 = subEntries.length; k < len1; k++) {
- subEntry = subEntries[k];
- this.parseEntry(subEntry);
- }
- };
-
- return Menu;
-
- })();
- dragstart = function(e) {
- var el, isTouching, o, rect, ref, screenHeight, screenWidth;
- if (e.type === 'mousedown' && e.button !== 0) {
- return;
- }
- e.preventDefault();
- if (isTouching = e.type === 'touchstart') {
- e = e.changedTouches[e.changedTouches.length - 1];
- }
- el = $.x('ancestor::div[contains(@class,"dialog")][1]', this);
- rect = el.getBoundingClientRect();
- screenHeight = doc.clientHeight;
- screenWidth = doc.clientWidth;
- o = {
- id: el.id,
- style: el.style,
- dx: e.clientX - rect.left,
- dy: e.clientY - rect.top,
- height: screenHeight - rect.height,
- width: screenWidth - rect.width,
- screenHeight: screenHeight,
- screenWidth: screenWidth,
- isTouching: isTouching
- };
- ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1];
- if (isTouching) {
- o.identifier = e.identifier;
- o.move = touchmove.bind(o);
- o.up = touchend.bind(o);
- $.on(d, 'touchmove', o.move);
- return $.on(d, 'touchend touchcancel', o.up);
- } else {
- o.move = drag.bind(o);
- o.up = dragend.bind(o);
- $.on(d, 'mousemove', o.move);
- return $.on(d, 'mouseup', o.up);
- }
- };
- touchmove = function(e) {
- var k, len1, ref, touch;
- ref = e.changedTouches;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- touch = ref[k];
- if (touch.identifier === this.identifier) {
- drag.call(this, touch);
- return;
- }
- }
- };
- 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 + '%';
- top = clientY - this.dy;
- top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%';
- right = left === null ? 0 : null;
- bottom = top === null ? this.bottomBorder + 'px' : null;
- style = this.style;
- style.left = left;
- style.right = right;
- style.top = top;
- return style.bottom = bottom;
- };
- touchend = function(e) {
- var k, len1, ref, touch;
- ref = e.changedTouches;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- touch = ref[k];
- if (touch.identifier === this.identifier) {
- dragend.call(this);
- return;
- }
- }
- };
- dragend = function() {
- if (this.isTouching) {
- $.off(d, 'touchmove', this.move);
- $.off(d, 'touchend touchcancel', this.up);
- } else {
- $.off(d, 'mousemove', this.move);
- $.off(d, 'mouseup', this.up);
- }
- return $.set(this.id + ".position", this.style.cssText);
- };
- hoverstart = function(arg) {
- var cb, el, endEvents, height, latestEvent, noRemove, o, ref, root;
- root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, height = arg.height, cb = arg.cb, noRemove = arg.noRemove;
- o = {
- root: root,
- el: el,
- style: el.style,
- isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO',
- cb: cb,
- endEvents: endEvents,
- latestEvent: latestEvent,
- clientHeight: doc.clientHeight,
- clientWidth: doc.clientWidth,
- height: height,
- noRemove: noRemove
- };
- o.hover = hover.bind(o);
- o.hoverend = hoverend.bind(o);
- o.hover(o.latestEvent);
- new MutationObserver(function() {
- if (el.parentNode) {
- return o.hover(o.latestEvent);
- }
- }).observe(el, {
- childList: true
- });
- $.on(root, endEvents, o.hoverend);
- if ($.x('ancestor::div[contains(@class,"inline")][1]', root)) {
- $.on(d, 'keydown', o.hoverend);
- }
- $.on(root, 'mousemove', o.hover);
- o.workaround = function(e) {
- if (!root.contains(e.target)) {
- return o.hoverend(e);
- }
- };
- return $.on(doc, 'mousemove', o.workaround);
- };
- hoverstart.padding = 25;
- hover = function(e) {
- var clientX, clientY, height, left, ref, right, style, threshold, top;
- this.latestEvent = e;
- height = (this.height || this.el.offsetHeight) + hoverstart.padding;
- clientX = e.clientX, clientY = e.clientY;
- top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120));
- threshold = this.clientWidth / 2;
- if (!this.isImage) {
- threshold = Math.max(threshold, this.clientWidth - 400);
- }
- ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
- style = this.style;
- style.top = top + 'px';
- style.left = left;
- return style.right = right;
- };
- hoverend = function(e) {
- if (e.type === 'keydown' && e.keyCode !== 13 || e.target.nodeName === "TEXTAREA") {
- return;
- }
- if (!this.noRemove) {
- $.rm(this.el);
- }
- $.off(this.root, this.endEvents, this.hoverend);
- $.off(d, 'keydown', this.hoverend);
- $.off(this.root, 'mousemove', this.hover);
- $.off(doc, 'mousemove', this.workaround);
- if (this.cb) {
- return this.cb.call(this);
- }
- };
- checkbox = function(name, text, checked) {
- var input, label;
- if (checked == null) {
- checked = Conf[name];
- }
- label = $.el('label');
- input = $.el('input', {
- type: 'checkbox',
- name: name,
- checked: checked
- });
- $.add(label, [input, $.tn(" " + text)]);
- return label;
- };
- return {
- dialog: dialog,
- Menu: Menu,
- hover: hoverstart,
- checkbox: checkbox
- };
- })();
-
- CrossOrigin = (function() {
- return {
- binary: function(url, cb, headers) {
- var options, ref, workaround;
- if (headers == null) {
- headers = {};
- }
- url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/');
- workaround = $.engine === 'gecko' && (typeof GM_info !== "undefined" && GM_info !== null) && /^[0-2]\.|^3\.[01](?!\d)/.test(GM_info.version);
- workaround || (workaround = /PaleMoon\//.test(navigator.userAgent));
- workaround || (workaround = (typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.script) != null ? ref.includeJSB : void 0 : void 0) != null);
- options = {
- method: "GET",
- url: url,
- headers: headers,
- onload: function(xhr) {
- var contentDisposition, contentType, data, i, r, ref1, ref2;
- if (workaround) {
- r = xhr.responseText;
- data = new Uint8Array(r.length);
- i = 0;
- while (i < r.length) {
- data[i] = r.charCodeAt(i);
- i++;
- }
- } else {
- data = new Uint8Array(xhr.response);
- }
- if (typeof xhr.responseHeaders === 'object') {
- contentType = xhr.responseHeaders['Content-Type'];
- contentDisposition = xhr.responseHeaders['Content-Disposition'];
- } else {
- contentType = (ref1 = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0;
- contentDisposition = (ref2 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0;
- }
- return cb(data, contentType, contentDisposition);
- },
- onerror: function() {
- return cb(null);
- },
- onabort: function() {
- return cb(null);
- }
- };
- if (workaround) {
- options.overrideMimeType = options.mimeType = 'text/plain; charset=x-user-defined';
- } else {
- options.responseType = 'arraybuffer';
- }
- return GM_xmlhttpRequest(options);
- },
- file: function(url, cb) {
- return CrossOrigin.binary(url, function(data, contentType, contentDisposition) {
- var blob, match, mime, name, ref, ref1, ref2, ref3;
- if (data == null) {
- return cb(null);
- }
- name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0;
- mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream';
- match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0);
- if (match) {
- name = match.replace(/\\"/g, '"');
- }
- if ((typeof GM_info !== "undefined" && GM_info !== null ? (ref3 = GM_info.script) != null ? ref3.includeJSB : void 0 : void 0) != null) {
- mime = QR.typeFromExtension[name.match(/[^.]*$/)[0].toLowerCase()] || 'application/octet-stream';
- }
- blob = new Blob([data], {
- type: mime
- });
- blob.name = name;
- return cb(blob);
- });
- },
- json: (function() {
- var callbacks, responses;
- callbacks = {};
- responses = {};
- return function(url, cb) {
- if (responses[url]) {
- cb(responses[url]);
- return;
- }
- if (callbacks[url]) {
- callbacks[url].push(cb);
- return;
- }
- callbacks[url] = [cb];
- return GM_xmlhttpRequest({
- method: "GET",
- url: url + '',
- onload: function(xhr) {
- var k, len1, ref, response;
- response = JSON.parse(xhr.responseText);
- ref = callbacks[url];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- cb = ref[k];
- cb(response);
- }
- delete callbacks[url];
- return responses[url] = response;
- },
- onerror: function() {
- return delete callbacks[url];
- },
- onabort: function() {
- return delete callbacks[url];
- }
- });
- };
- })()
- };
- })();
-
- Anonymize = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Anonymize'])) {
- return;
- }
- if (g.VIEW === 'archive') {
- return this.archive();
- }
- return Post.callbacks.push({
- name: 'Anonymize',
- cb: this.node
- });
- },
- node: function() {
- var email, name, ref, tripcode;
- if (this.info.capcode || this.isClone) {
- return;
- }
- ref = this.nodes, name = ref.name, tripcode = ref.tripcode, email = ref.email;
- if (this.info.name !== 'Anonymous') {
- name.textContent = 'Anonymous';
- }
- if (tripcode) {
- $.rm(tripcode);
- delete this.nodes.tripcode;
- }
- if (this.info.email) {
- $.replace(email, name);
- return delete this.nodes.email;
- }
- },
- archive: function() {
- return $.ready(function() {
- var k, len1, len2, name, q, ref, ref1, trip;
- ref = $$('.name');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- name = ref[k];
- name.textContent = 'Anonymous';
- }
- ref1 = $$('.postertrip');
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- trip = ref1[q];
- $.rm(trip);
- }
- });
- }
- };
-
- Filter = {
- filters: {},
- init: function() {
- var boards, err, excludes, filter, hl, k, key, len1, line, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, regexp, stub, top;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
- return;
- }
- if (!Conf['Filtered Backlinks']) {
- $.addClass(doc, 'hide-backlinks');
- }
- for (key in Config.filter) {
- this.filters[key] = [];
- ref1 = Conf[key].split('\n');
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- line = ref1[k];
- if (line[0] === '#') {
- continue;
- }
- if (!(regexp = line.match(/\/(.+)\/(\w*)/))) {
- continue;
- }
- filter = line.replace(regexp[0], '');
- boards = ((ref2 = filter.match(/boards:([^;]+)/)) != null ? ref2[1].toLowerCase() : void 0) || 'global';
- boards = boards === 'global' ? null : boards.split(',');
- if (boards === null) {
- excludes = ((ref3 = filter.match(/exclude:([^;]+)/)) != null ? ref3[1].toLowerCase().split(',') : void 0) || null;
- }
- if (key === 'uniqueID' || key === 'MD5') {
- regexp = regexp[1];
- } else {
- try {
- regexp = RegExp(regexp[1], regexp[2]);
- } catch (_error) {
- err = _error;
- new Notice('warning', [$.tn("Invalid " + key + " filter:"), $.el('br'), $.tn(line), $.el('br'), $.tn(err.message)], 60);
- continue;
- }
- }
- op = ((ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? ref4[1] : void 0) || 'yes';
- stub = (function() {
- var ref5;
- switch ((ref5 = filter.match(/stub:(yes|no)/)) != null ? ref5[1] : void 0) {
- case 'yes':
- return true;
- case 'no':
- return false;
- default:
- return Conf['Stubs'];
- }
- })();
- if (hl = /highlight/.test(filter)) {
- hl = ((ref5 = filter.match(/highlight:([\w-]+)/)) != null ? ref5[1] : void 0) || 'filter-highlight';
- top = ((ref6 = filter.match(/top:(yes|no)/)) != null ? ref6[1] : void 0) || 'yes';
- top = top === 'yes';
- }
- this.filters[key].push(this.createFilter(regexp, boards, excludes, op, stub, hl, top));
- }
- if (!this.filters[key].length) {
- delete this.filters[key];
- }
- }
- if (!Object.keys(this.filters).length) {
- return;
- }
- return Post.callbacks.push({
- name: 'Filter',
- cb: this.node
- });
- },
- createFilter: function(regexp, boards, excludes, op, stub, hl, top) {
- var settings, test;
- test = typeof regexp === 'string' ? function(value) {
- return regexp === value;
- } : function(value) {
- return regexp.test(value);
- };
- settings = {
- hide: !hl,
- stub: stub,
- "class": hl,
- top: top
- };
- return function(value, boardID, isReply) {
- if (boards && indexOf.call(boards, boardID) < 0) {
- return false;
- }
- if (excludes && indexOf.call(excludes, boardID) >= 0) {
- return false;
- }
- if (isReply && op === 'only' || !isReply && op === 'no') {
- return false;
- }
- if (!test(value)) {
- return false;
- }
- return settings;
- };
- },
- node: function() {
- var filter, k, key, len1, ref, ref1, result, value;
- if (this.isClone) {
- return;
- }
- for (key in Filter.filters) {
- if ((value = Filter[key](this)) != null) {
- ref = Filter.filters[key];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- filter = ref[k];
- if (!(result = filter(value, this.board.ID, this.isReply))) {
- continue;
- }
- if (result.hide && !this.isFetchedQuote) {
- if (this.isReply) {
- PostHiding.hide(this, result.stub);
- } else if (g.VIEW === 'index') {
- ThreadHiding.hide(this.thread, result.stub);
- } else {
- continue;
- }
- return;
- }
- $.addClass(this.nodes.root, result["class"]);
- if (!(this.highlights && (ref1 = result["class"], indexOf.call(this.highlights, ref1) >= 0))) {
- (this.highlights || (this.highlights = [])).push(result["class"]);
- }
- if (!this.isReply && result.top) {
- this.thread.isOnTop = true;
- }
- }
- }
- }
- },
- isHidden: function(post) {
- var filter, k, key, len1, ref, result, value;
- for (key in Filter.filters) {
- if ((value = Filter[key](post)) != null) {
- ref = Filter.filters[key];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- filter = ref[k];
- if (result = filter(value, post.boardID, post.isReply)) {
- if (result.hide) {
- return true;
- }
- }
- }
- }
- }
- return false;
- },
- postID: function(post) {
- var ref;
- return "" + ((ref = post.ID) != null ? ref : post.postID);
- },
- name: function(post) {
- return post.info.name;
- },
- uniqueID: function(post) {
- return post.info.uniqueID;
- },
- tripcode: function(post) {
- return post.info.tripcode;
- },
- capcode: function(post) {
- return post.info.capcode;
- },
- subject: function(post) {
- return post.info.subject;
- },
- comment: function(post) {
- var base1;
- return (base1 = post.info).comment != null ? base1.comment : base1.comment = Build.parseComment(post.info.commentHTML.innerHTML);
- },
- flag: function(post) {
- return post.info.flag;
- },
- filename: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.name : void 0;
- },
- dimensions: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.dimensions : void 0;
- },
- filesize: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.size : void 0;
- },
- MD5: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.MD5 : void 0;
- },
- menu: {
- init: function() {
- var div, entry, k, len1, ref, ref1, type;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
- return;
- }
- div = $.el('div', {
- textContent: 'Filter'
- });
- entry = {
- el: div,
- order: 50,
- open: function(post) {
- Filter.menu.post = post;
- return true;
- },
- subEntries: []
- };
- ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- type = ref1[k];
- entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1]));
- }
- return Menu.menu.addEntry(entry);
- },
- createSubEntry: function(text, type) {
- var el;
- el = $.el('a', {
- href: 'javascript:;',
- textContent: text
- });
- el.dataset.type = type;
- $.on(el, 'click', Filter.menu.makeFilter);
- return {
- el: el,
- open: function(post) {
- var value;
- value = Filter[type](post);
- return value != null;
- }
- };
- },
- makeFilter: function() {
- var re, type, value;
- type = this.dataset.type;
- value = Filter[type](Filter.menu.post);
- re = type === 'uniqueID' || type === 'MD5' ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
- if (c === '\n') {
- return '\\n';
- } else if (c === '\\') {
- return '\\\\';
- } else {
- return "\\" + c;
- }
- });
- re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
- return $.get(type, Conf[type], function(item) {
- var save, section, select, ta, tl;
- save = item[type];
- save = save ? save + "\n" + re : re;
- $.set(type, save);
- Settings.open('Filter');
- section = $('.section-container');
- select = $('select[name=filter]', section);
- select.value = type;
- Settings.selectFilter.call(select);
- ta = $('textarea', section);
- tl = ta.textLength;
- ta.setSelectionRange(tl, tl);
- return ta.focus();
- });
- }
- }
- };
-
- PostHiding = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
- return;
- }
- if (Conf['Reply Hiding Buttons']) {
- $.addClass(doc, "reply-hide");
- }
- this.db = new DataBoard('hiddenPosts');
- return Post.callbacks.push({
- name: 'Reply Hiding',
- cb: this.node
- });
- },
- node: function() {
- var data, sideArrows;
- if (!this.isReply || this.isClone || this.isFetchedQuote) {
- return;
- }
- if (data = PostHiding.db.get({
- boardID: this.board.ID,
- threadID: this.thread.ID,
- postID: this.ID
- })) {
- if (data.thisPost) {
- PostHiding.hide(this, data.makeStub, data.hideRecursively);
- } else {
- Recursive.apply(PostHiding.hide, this, data.makeStub, true);
- Recursive.add(PostHiding.hide, this, data.makeStub, true);
- }
- }
- if (!Conf['Reply Hiding Buttons']) {
- return;
- }
- sideArrows = $('.sideArrows', this.nodes.root);
- $.replace(sideArrows.firstChild, PostHiding.makeButton(this, 'hide'));
- return sideArrows.removeAttribute('class');
- },
- menu: {
- init: function() {
- var apply, div, hideStubLink, makeStub, ref, replies, thisPost;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
- return;
- }
- div = $.el('div', {
- className: 'hide-reply-link',
- textContent: 'Hide'
- });
- apply = $.el('a', {
- textContent: 'Apply',
- href: 'javascript:;'
- });
- $.on(apply, 'click', PostHiding.menu.hide);
- thisPost = UI.checkbox('thisPost', 'This post', true);
- replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']);
- makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']);
- Menu.menu.addEntry({
- el: div,
- order: 20,
- open: function(post) {
- if (!post.isReply || post.isClone || post.isHidden) {
- return false;
- }
- PostHiding.menu.post = post;
- return true;
- },
- subEntries: [
- {
- el: apply
- }, {
- el: thisPost
- }, {
- el: replies
- }, {
- el: makeStub
- }
- ]
- });
- div = $.el('div', {
- className: 'show-reply-link',
- textContent: 'Show'
- });
- apply = $.el('a', {
- textContent: 'Apply',
- href: 'javascript:;'
- });
- $.on(apply, 'click', PostHiding.menu.show);
- thisPost = UI.checkbox('thisPost', 'This post', false);
- replies = UI.checkbox('replies', 'Show replies', false);
- hideStubLink = $.el('a', {
- textContent: 'Hide stub',
- href: 'javascript:;'
- });
- $.on(hideStubLink, 'click', PostHiding.menu.hideStub);
- Menu.menu.addEntry({
- el: div,
- order: 20,
- open: function(post) {
- var data;
- if (!post.isReply || post.isClone || !post.isHidden) {
- return false;
- }
- if (!(data = PostHiding.db.get({
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- }))) {
- return false;
- }
- PostHiding.menu.post = post;
- thisPost.firstChild.checked = post.isHidden;
- replies.firstChild.checked = (data != null ? data.hideRecursively : void 0) != null ? data.hideRecursively : Conf['Recursive Hiding'];
- return true;
- },
- subEntries: [
- {
- el: apply
- }, {
- el: thisPost
- }, {
- el: replies
- }
- ]
- });
- return Menu.menu.addEntry({
- el: hideStubLink,
- order: 15,
- open: function(post) {
- var data;
- if (!post.isReply || post.isClone || !post.isHidden) {
- return false;
- }
- if (!(data = PostHiding.db.get({
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- }))) {
- return false;
- }
- return PostHiding.menu.post = post;
- }
- });
- },
- hide: function() {
- var makeStub, parent, post, replies, thisPost;
- parent = this.parentNode;
- thisPost = $('input[name=thisPost]', parent).checked;
- replies = $('input[name=replies]', parent).checked;
- makeStub = $('input[name=makeStub]', parent).checked;
- post = PostHiding.menu.post;
- if (thisPost) {
- PostHiding.hide(post, makeStub, replies);
- } else if (replies) {
- Recursive.apply(PostHiding.hide, post, makeStub, true);
- Recursive.add(PostHiding.hide, post, makeStub, true);
- } else {
- return;
- }
- PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies);
- return $.event('CloseMenu');
- },
- show: function() {
- var data, parent, post, replies, thisPost;
- parent = this.parentNode;
- thisPost = $('input[name=thisPost]', parent).checked;
- replies = $('input[name=replies]', parent).checked;
- post = PostHiding.menu.post;
- if (thisPost) {
- PostHiding.show(post, replies);
- } else if (replies) {
- Recursive.apply(PostHiding.show, post, true);
- Recursive.rm(PostHiding.hide, post, true);
- } else {
- return;
- }
- if (data = PostHiding.db.get({
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- })) {
- PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
- }
- return $.event('CloseMenu');
- },
- hideStub: function() {
- var data, post;
- post = PostHiding.menu.post;
- if (data = PostHiding.db.get({
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- })) {
- PostHiding.show(post, data.hideRecursively);
- PostHiding.hide(post, false, data.hideRecursively);
- PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively);
- }
- $.event('CloseMenu');
- }
- },
- makeButton: function(post, type) {
- var a, span;
- span = $.el('span', {
- className: "fa fa-" + (type === 'hide' ? 'minus' : 'plus') + "-square-o",
- textContent: ""
- });
- a = $.el('a', {
- className: type + "-reply-button",
- href: 'javascript:;'
- });
- $.add(a, span);
- $.on(a, 'click', PostHiding.toggle);
- return a;
- },
- saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
- var data;
- data = {
- boardID: post.board.ID,
- threadID: post.thread.ID,
- postID: post.ID
- };
- if (isHiding) {
- data.val = {
- thisPost: thisPost !== false,
- makeStub: makeStub,
- hideRecursively: hideRecursively
- };
- return PostHiding.db.set(data);
- } else {
- return PostHiding.db["delete"](data);
- }
- },
- 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, k, len1, quotelink, ref;
- if (makeStub == null) {
- makeStub = Conf['Stubs'];
- }
- if (hideRecursively == null) {
- hideRecursively = Conf['Recursive Hiding'];
- }
- if (post.isHidden) {
- return;
- }
- post.isHidden = true;
- if (hideRecursively) {
- Recursive.apply(PostHiding.hide, post, makeStub, true);
- Recursive.add(PostHiding.hide, post, makeStub, true);
- }
- ref = Get.allQuotelinksLinkingTo(post);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- $.addClass(quotelink, 'filtered');
- }
- if (!makeStub) {
- post.nodes.root.hidden = true;
- return;
- }
- a = PostHiding.makeButton(post, 'show');
- $.add(a, $.tn(" " + post.info.nameBlock));
- post.nodes.stub = $.el('div', {
- className: 'stub'
- });
- $.add(post.nodes.stub, a);
- if (Conf['Menu']) {
- $.add(post.nodes.stub, Menu.makeButton(post));
- }
- return $.prepend(post.nodes.root, post.nodes.stub);
- },
- show: function(post, showRecursively) {
- var k, len1, quotelink, ref;
- if (showRecursively == null) {
- showRecursively = Conf['Recursive Hiding'];
- }
- if (post.nodes.stub) {
- $.rm(post.nodes.stub);
- delete post.nodes.stub;
- } else {
- post.nodes.root.hidden = false;
- }
- post.isHidden = false;
- if (showRecursively) {
- Recursive.apply(PostHiding.show, post, true);
- Recursive.rm(PostHiding.hide, post);
- }
- ref = Get.allQuotelinksLinkingTo(post);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- $.rmClass(quotelink, 'filtered');
- }
- }
- };
-
- Recursive = {
- recursives: {},
- init: function() {
- var ref;
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- return Post.callbacks.push({
- name: 'Recursive',
- cb: this.node
- });
- },
- node: function() {
- var i, k, len1, len2, obj, q, quote, recursive, ref, ref1;
- if (this.isClone || this.isFetchedQuote) {
- return;
- }
- ref = this.quotes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- if (obj = Recursive.recursives[quote]) {
- ref1 = obj.recursives;
- for (i = q = 0, len2 = ref1.length; q < len2; i = ++q) {
- recursive = ref1[i];
- recursive.apply(null, [this].concat(slice.call(obj.args[i])));
- }
- }
- }
- },
- add: function() {
- var args, base1, name1, obj, post, recursive;
- recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
- obj = (base1 = Recursive.recursives)[name1 = post.fullID] || (base1[name1] = {
- recursives: [],
- args: []
- });
- obj.recursives.push(recursive);
- return obj.args.push(args);
- },
- rm: function(recursive, post) {
- var i, k, len1, obj, rec, ref;
- if (!(obj = Recursive.recursives[post.fullID])) {
- return;
- }
- ref = obj.recursives;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- rec = ref[i];
- if (!(rec === recursive)) {
- continue;
- }
- obj.recursives.splice(i, 1);
- obj.args.splice(i, 1);
- }
- },
- apply: function() {
- var args, fullID, post, recursive;
- recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
- fullID = post.fullID;
- return g.posts.forEach(function(post) {
- if (indexOf.call(post.quotes, fullID) >= 0) {
- return recursive.apply(null, [post].concat(slice.call(args)));
- }
- });
- }
- };
-
- ThreadHiding = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) {
- return;
- }
- this.db = new DataBoard('hiddenThreads');
- if (g.VIEW === 'catalog') {
- return this.catalogWatch();
- }
- this.catalogSet(g.BOARD);
- return Post.callbacks.push({
- name: 'Thread Hiding',
- cb: this.node
- });
- },
- catalogSet: function(board) {
- var hiddenThreads, threadID;
- if (!$.hasStorage) {
- return;
- }
- hiddenThreads = ThreadHiding.db.get({
- boardID: board.ID,
- defaultValue: {}
- });
- for (threadID in hiddenThreads) {
- hiddenThreads[threadID] = true;
- }
- return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads));
- },
- catalogWatch: function() {
- if (!$.hasStorage) {
- return;
- }
- this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
- return Main.ready(function() {
- return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), {
- attributes: true,
- subtree: true,
- attributeFilter: ['style']
- });
- });
- },
- catalogSave: function() {
- var hiddenThreads2, threadID;
- hiddenThreads2 = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
- for (threadID in hiddenThreads2) {
- if (!(threadID in ThreadHiding.hiddenThreads)) {
- ThreadHiding.db.set({
- boardID: g.BOARD.ID,
- threadID: threadID,
- val: {
- makeStub: Conf['Stubs']
- }
- });
- }
- }
- for (threadID in ThreadHiding.hiddenThreads) {
- if (!(threadID in hiddenThreads2)) {
- ThreadHiding.db["delete"]({
- boardID: g.BOARD.ID,
- threadID: threadID
- });
- }
- }
- return ThreadHiding.hiddenThreads = hiddenThreads2;
- },
- node: function() {
- var data;
- if (this.isReply || this.isClone || this.isFetchedQuote) {
- return;
- }
- if (data = ThreadHiding.db.get({
- boardID: this.board.ID,
- threadID: this.ID
- })) {
- ThreadHiding.hide(this.thread, data.makeStub);
- }
- if (!Conf['Thread Hiding Buttons']) {
- return;
- }
- return $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide'));
- },
- onIndexBuild: function(nodes) {
- var k, len1, root, thread;
- for (k = 0, len1 = nodes.length; k < len1; k++) {
- root = nodes[k];
- thread = Get.threadFromRoot(root);
- if (thread.isHidden && thread.stub && !root.contains(thread.stub)) {
- ThreadHiding.makeStub(thread, root);
- }
- }
- },
- menu: {
- init: function() {
- var apply, div, hideStubLink, makeStub;
- if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
- return;
- }
- div = $.el('div', {
- className: 'hide-thread-link',
- textContent: 'Hide'
- });
- apply = $.el('a', {
- textContent: 'Apply',
- href: 'javascript:;'
- });
- $.on(apply, 'click', ThreadHiding.menu.hide);
- makeStub = UI.checkbox('Stubs', 'Make stub');
- Menu.menu.addEntry({
- el: div,
- order: 20,
- open: function(arg) {
- var isReply, thread;
- thread = arg.thread, isReply = arg.isReply;
- if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
- return false;
- }
- ThreadHiding.menu.thread = thread;
- return true;
- },
- subEntries: [
- {
- el: apply
- }, {
- el: makeStub
- }
- ]
- });
- div = $.el('a', {
- className: 'show-thread-link',
- textContent: 'Show',
- href: 'javascript:;'
- });
- $.on(div, 'click', ThreadHiding.menu.show);
- Menu.menu.addEntry({
- el: div,
- order: 20,
- open: function(arg) {
- var isReply, thread;
- thread = arg.thread, isReply = arg.isReply;
- if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
- return false;
- }
- ThreadHiding.menu.thread = thread;
- return true;
- }
- });
- hideStubLink = $.el('a', {
- textContent: 'Hide stub',
- href: 'javascript:;'
- });
- $.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);
- return Menu.menu.addEntry({
- el: hideStubLink,
- order: 15,
- open: function(arg) {
- var isReply, thread;
- thread = arg.thread, isReply = arg.isReply;
- if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
- return false;
- }
- return ThreadHiding.menu.thread = thread;
- }
- });
- },
- hide: function() {
- var makeStub, thread;
- makeStub = $('input', this.parentNode).checked;
- thread = ThreadHiding.menu.thread;
- ThreadHiding.hide(thread, makeStub);
- ThreadHiding.saveHiddenState(thread, makeStub);
- return $.event('CloseMenu');
- },
- show: function() {
- var thread;
- thread = ThreadHiding.menu.thread;
- ThreadHiding.show(thread);
- ThreadHiding.saveHiddenState(thread);
- return $.event('CloseMenu');
- },
- hideStub: function() {
- var thread;
- thread = ThreadHiding.menu.thread;
- ThreadHiding.show(thread);
- ThreadHiding.hide(thread, false);
- ThreadHiding.saveHiddenState(thread, false);
- $.event('CloseMenu');
- }
- },
- makeButton: function(thread, type) {
- var a;
- a = $.el('a', {
- className: type + "-thread-button",
- href: 'javascript:;'
- });
- $.extend(a, {
- innerHTML: " "
- });
- a.dataset.fullID = thread.fullID;
- $.on(a, 'click', ThreadHiding.toggle);
- return a;
- },
- makeStub: function(thread, root) {
- var a, numReplies, summary;
- numReplies = $$('.thread > .replyContainer', root).length;
- if (summary = $('.summary', root)) {
- numReplies += +summary.textContent.match(/\d+/);
- }
- a = ThreadHiding.makeButton(thread, 'show');
- $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")"));
- thread.stub = $.el('div', {
- className: 'stub'
- });
- if (Conf['Menu']) {
- $.add(thread.stub, [a, Menu.makeButton(thread.OP)]);
- } else {
- $.add(thread.stub, a);
- }
- return $.prepend(root, thread.stub);
- },
- saveHiddenState: function(thread, makeStub) {
- if (thread.isHidden) {
- ThreadHiding.db.set({
- boardID: thread.board.ID,
- threadID: thread.ID,
- val: {
- makeStub: makeStub
- }
- });
- } else {
- ThreadHiding.db["delete"]({
- boardID: thread.board.ID,
- threadID: thread.ID
- });
- }
- return ThreadHiding.catalogSet(thread.board);
- },
- toggle: function(thread) {
- if (!(thread instanceof Thread)) {
- thread = g.threads[this.dataset.fullID];
- }
- if (thread.isHidden) {
- ThreadHiding.show(thread);
- } else {
- ThreadHiding.hide(thread);
- }
- return ThreadHiding.saveHiddenState(thread);
- },
- hide: function(thread, makeStub) {
- var threadRoot;
- if (makeStub == null) {
- makeStub = Conf['Stubs'];
- }
- if (thread.isHidden) {
- return;
- }
- threadRoot = thread.OP.nodes.root.parentNode;
- thread.isHidden = true;
- if (Conf['JSON Index']) {
- Index.updateHideLabel();
- }
- if (!makeStub) {
- return threadRoot.hidden = true;
- }
- return ThreadHiding.makeStub(thread, threadRoot);
- },
- show: function(thread) {
- var threadRoot;
- if (thread.stub) {
- $.rm(thread.stub);
- delete thread.stub;
- }
- threadRoot = thread.OP.nodes.root.parentNode;
- threadRoot.hidden = thread.isHidden = false;
- if (Conf['JSON Index']) {
- return Index.updateHideLabel();
- }
- }
- };
-
- QuoteBacklink = {
- containers: {},
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) {
- return;
- }
- Post.callbacks.push({
- name: 'Quote Backlinking Part 1',
- cb: this.firstNode
- });
- return Post.callbacks.push({
- name: 'Quote Backlinking Part 2',
- cb: this.secondNode
- });
- },
- firstNode: function() {
- var a, clone, container, containers, hash, k, len1, len2, len3, link, markYours, nodes, post, q, quote, ref, ref1, ref2, u;
- if (this.isClone || !this.quotes.length || this.isRebuilt) {
- return;
- }
- markYours = Conf['Mark Quotes of You'] && ((ref = QuoteYou.db) != null ? ref.get({
- boardID: this.board.ID,
- threadID: this.thread.ID,
- postID: this.ID
- }) : void 0);
- a = $.el('a', {
- href: Build.postURL(this.board.ID, this.thread.ID, this.ID),
- className: this.isHidden ? 'filtered backlink' : 'backlink',
- textContent: Conf['backlink'].replace(/%(?:id|%)/g, (function(_this) {
- return function(x) {
- return {
- '%id': _this.ID,
- '%%': '%'
- }[x];
- };
- })(this)) + (markYours ? '\u00A0(You)' : '')
- });
- ref1 = this.quotes;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- quote = ref1[k];
- containers = [QuoteBacklink.getContainer(quote)];
- if ((post = g.posts[quote]) && post.nodes.backlinkContainer) {
- ref2 = post.clones;
- for (q = 0, len2 = ref2.length; q < len2; q++) {
- clone = ref2[q];
- containers.push(clone.nodes.backlinkContainer);
- }
- }
- for (u = 0, len3 = containers.length; u < len3; u++) {
- container = containers[u];
- link = a.cloneNode(true);
- nodes = container.firstChild ? [$.tn(' '), link] : [link];
- if (Conf['Quote Previewing']) {
- $.on(link, 'mouseover', QuotePreview.mouseover);
- }
- if (Conf['Quote Inlining']) {
- $.on(link, 'click', QuoteInline.toggle);
- if (Conf['Quote Hash Navigation']) {
- hash = QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
- nodes.push(hash);
- }
- }
- $.add(container, nodes);
- }
- }
- },
- secondNode: function() {
- var container;
- if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
- this.nodes.backlinkContainer = $('.container', this.nodes.info);
- return;
- }
- if (!(this.isReply || Conf['OP Backlinks'])) {
- return;
- }
- container = QuoteBacklink.getContainer(this.fullID);
- this.nodes.backlinkContainer = container;
- return $.add(this.nodes.info, container);
- },
- getContainer: function(id) {
- var base1;
- return (base1 = this.containers)[id] || (base1[id] = $.el('span', {
- className: 'container'
- }));
- }
- };
-
- QuoteCT = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- this.text = '\u00A0(Cross-thread)';
- return Post.callbacks.push({
- name: 'Mark Cross-thread Quotes',
- cb: this.node
- });
- },
- node: function() {
- var board, boardID, k, len1, quotelink, ref, ref1, ref2, thread, threadID;
- if (this.isClone && this.thread === this.context.thread) {
- return;
- }
- ref = this.context, board = ref.board, thread = ref.thread;
- ref1 = this.nodes.quotelinks;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- quotelink = ref1[k];
- ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID;
- if (!threadID) {
- continue;
- }
- if (this.isClone) {
- quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, '');
- }
- if (boardID === board.ID && threadID !== thread.ID) {
- $.add(quotelink, $.tn(QuoteCT.text));
- }
- }
- }
- };
-
- QuoteInline = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- return Post.callbacks.push({
- name: 'Quote Inlining',
- cb: this.node
- });
- },
- node: function() {
- var isClone, k, len1, len2, link, process, q, ref, ref1;
- process = QuoteInline.process;
- isClone = this.isClone;
- ref = this.nodes.quotelinks;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- process(link, isClone);
- }
- ref1 = this.nodes.backlinks;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- link = ref1[q];
- process(link, isClone);
- }
- },
- process: function(link, clone) {
- if (Conf['Quote Hash Navigation']) {
- if (!clone) {
- $.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')));
- }
- }
- return $.on(link, 'click', QuoteInline.toggle);
- },
- qiQuote: function(link, hidden) {
- var name;
- name = "hashlink";
- if (hidden) {
- name += " filtered";
- }
- return $.el('a', {
- className: name,
- textContent: '#',
- href: link.href
- });
- },
- toggle: function(e) {
- var boardID, context, postID, quoter, ref, ref1, threadID;
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- if (Conf['Inline Cross-thread Quotes Only'] && g.VIEW === 'thread' && ((ref1 = g.posts[boardID + "." + postID]) != null ? ref1.nodes.root.offsetParent : void 0)) {
- return;
- }
- e.preventDefault();
- quoter = Get.postFromNode(this);
- context = quoter.context;
- if ($.hasClass(this, 'inlined')) {
- QuoteInline.rm(this, boardID, threadID, postID, context);
- } else {
- if ($.x("ancestor::div[@data-full-i-d='" + boardID + "." + postID + "']", this)) {
- return;
- }
- QuoteInline.add(this, boardID, threadID, postID, context, quoter);
- }
- return this.classList.toggle('inlined');
- },
- findRoot: function(quotelink, isBacklink) {
- if (isBacklink) {
- return quotelink.parentNode.parentNode;
- } else {
- return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink);
- }
- },
- add: function(quotelink, boardID, threadID, postID, context, quoter) {
- var inline, isBacklink, post, qroot, root;
- isBacklink = $.hasClass(quotelink, 'backlink');
- inline = $.el('div', {
- className: 'inline'
- });
- inline.dataset.fullID = boardID + "." + postID;
- root = QuoteInline.findRoot(quotelink, isBacklink);
- $.after(root, inline);
- qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
- $.addClass(qroot, 'hasInline');
- new Fetcher(boardID, threadID, postID, inline, quoter);
- if (!((post = g.posts[boardID + "." + postID]) && context.thread === post.thread)) {
- return;
- }
- if (isBacklink && Conf['Forward Hiding']) {
- $.addClass(post.nodes.root, 'forwarded');
- post.forwarded++ || (post.forwarded = 1);
- }
- if (!Unread.posts) {
- return;
- }
- return Unread.readSinglePost(post);
- },
- rm: function(quotelink, boardID, threadID, postID, context) {
- var el, inlined, isBacklink, post, qroot, ref, root;
- isBacklink = $.hasClass(quotelink, 'backlink');
- root = QuoteInline.findRoot(quotelink, isBacklink);
- root = $.x("following-sibling::div[@data-full-i-d='" + boardID + "." + postID + "'][1]", root);
- qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
- $.rm(root);
- if (!$('.inline', qroot)) {
- $.rmClass(qroot, 'hasInline');
- }
- if (!(el = root.firstElementChild)) {
- return;
- }
- post = g.posts[boardID + "." + postID];
- post.rmClone(el.dataset.clone);
- if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads[boardID + "." + threadID] && !--post.forwarded) {
- delete post.forwarded;
- $.rmClass(post.nodes.root, 'forwarded');
- }
- while (inlined = $('.inlined', el)) {
- ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- QuoteInline.rm(inlined, boardID, threadID, postID, context);
- $.rmClass(inlined, 'inlined');
- }
- }
- };
-
- QuoteOP = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- this.text = '\u00A0(OP)';
- return Post.callbacks.push({
- name: 'Mark OP Quotes',
- cb: this.node
- });
- },
- node: function() {
- var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1;
- if (this.isClone && this.thread === this.context.thread) {
- return;
- }
- if (!(quotes = this.quotes).length) {
- return;
- }
- quotelinks = this.nodes.quotelinks;
- if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) {
- i = 0;
- while (quotelink = quotelinks[i++]) {
- quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, '');
- }
- }
- fullID = this.context.thread.fullID;
- if (indexOf.call(quotes, fullID) < 0) {
- return;
- }
- i = 0;
- while (quotelink = quotelinks[i++]) {
- ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
- if ((boardID + "." + postID) === fullID) {
- $.add(quotelink, $.tn(QuoteOP.text));
- }
- }
- }
- };
-
- QuotePreview = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Quote Previewing'])) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- return Post.callbacks.push({
- name: 'Quote Previewing',
- cb: this.node
- });
- },
- node: function() {
- var k, len1, link, ref;
- ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- $.on(link, 'mouseover', QuotePreview.mouseover);
- }
- },
- mouseover: function(e) {
- var boardID, k, len1, origin, post, postID, posts, qp, ref, threadID;
- if ($.hasClass(this, 'inlined') || !d.contains(this)) {
- return;
- }
- ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- qp = $.el('div', {
- id: 'qp',
- className: 'dialog'
- });
- $.add(Header.hover, qp);
- new Fetcher(boardID, threadID, postID, qp, Get.postFromNode(this));
- UI.hover({
- root: this,
- el: qp,
- latestEvent: e,
- endEvents: 'mouseout click',
- cb: QuotePreview.mouseout
- });
- if (Conf['Quote Highlighting'] && (origin = g.posts[boardID + "." + postID])) {
- posts = [origin].concat(origin.clones);
- posts.pop();
- for (k = 0, len1 = posts.length; k < len1; k++) {
- post = posts[k];
- $.addClass(post.nodes.post, 'qphl');
- }
- }
- },
- mouseout: function() {
- var clone, k, len1, post, ref, root;
- if (!(root = this.el.firstElementChild)) {
- return;
- }
- clone = Get.postFromRoot(root);
- post = clone.origin;
- post.rmClone(root.dataset.clone);
- if (!Conf['Quote Highlighting']) {
- return;
- }
- ref = [post].concat(post.clones);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post = ref[k];
- $.rmClass(post.nodes.post, 'qphl');
- }
- }
- };
-
- QuoteStrikeThrough = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
- return;
- }
- return Post.callbacks.push({
- name: 'Strike-through Quotes',
- cb: this.node
- });
- },
- node: function() {
- var boardID, k, len1, postID, quotelink, ref, ref1, ref2;
- if (this.isClone) {
- return;
- }
- ref = this.nodes.quotelinks;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
- if ((ref2 = g.posts[boardID + "." + postID]) != null ? ref2.isHidden : void 0) {
- $.addClass(quotelink, 'filtered');
- }
- }
- }
- };
-
-
- /*
- <3 aeosynth
- */
-
- QuoteThreading = {
- init: function() {
- if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
- return;
- }
- this.controls = $.el('label', {
- innerHTML: " Threading"
- });
- this.threadNewLink = $.el('span', {
- className: 'brackets-wrap threadnewlink',
- hidden: true
- });
- $.extend(this.threadNewLink, {
- innerHTML: "Thread New Posts "
- });
- this.input = $('input', this.controls);
- this.input.checked = Conf['Thread Quotes'];
- $.on(this.input, 'change', this.setEnabled);
- $.on(this.input, 'change', this.rethread);
- $.on(this.threadNewLink.firstElementChild, 'click', this.rethread);
- $.on(d, '4chanXInitFinished', (function(_this) {
- return function() {
- return _this.ready = true;
- };
- })(this));
- Header.menu.addEntry(this.entry = {
- el: this.controls,
- order: 99
- });
- Thread.callbacks.push({
- name: 'Quote Threading',
- cb: this.setThread
- });
- return Post.callbacks.push({
- name: 'Quote Threading',
- cb: this.node
- });
- },
- parent: {},
- children: {},
- inserted: {},
- setEnabled: function() {
- var other, ref;
- other = (ref = ReplyPruning.inputs) != null ? ref.enabled : void 0;
- if (this.checked && (other != null ? other.checked : void 0)) {
- other.checked = false;
- $.event('change', null, other);
- }
- return $.cb.checked.call(this);
- },
- setThread: function() {
- QuoteThreading.thread = this;
- return $.asap((function() {
- return !Conf['Thread Updater'] || $('.navLinksBot > .updatelink');
- }), function() {
- var navLinksBot;
- if ((navLinksBot = $('.navLinksBot'))) {
- return $.add(navLinksBot, [$.tn(' '), QuoteThreading.threadNewLink]);
- }
- });
- },
- node: function() {
- var ancestor, k, lastParent, len1, parent, parents, quote, ref;
- if (this.isFetchedQuote || this.isClone || !this.isReply) {
- return;
- }
- parents = new Set();
- lastParent = null;
- ref = this.quotes;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quote = ref[k];
- if (parent = g.posts[quote]) {
- if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) {
- parents.add(parent.ID);
- if (!lastParent || parent.ID > lastParent.ID) {
- lastParent = parent;
- }
- }
- }
- }
- if (!lastParent) {
- return;
- }
- ancestor = lastParent;
- while (ancestor = QuoteThreading.parent[ancestor.fullID]) {
- parents["delete"](ancestor.ID);
- }
- if (parents.size === 1) {
- return QuoteThreading.parent[this.fullID] = lastParent;
- }
- },
- descendants: function(post) {
- var child, children, k, len1, posts;
- posts = [post];
- if (children = QuoteThreading.children[post.fullID]) {
- for (k = 0, len1 = children.length; k < len1; k++) {
- child = children[k];
- posts = posts.concat(QuoteThreading.descendants(child));
- }
- }
- return posts;
- },
- insert: function(post) {
- var base1, child, children, descendants, i, k, len1, name1, next, nodes, order, parent, prev, prev2, q, threadContainer, u, x;
- if (!(Conf['Thread Quotes'] && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) {
- return false;
- }
- descendants = QuoteThreading.descendants(post);
- if (!Unread.posts.has(parent.ID)) {
- if ((function() {
- var k, len1, x;
- for (k = 0, len1 = descendants.length; k < len1; k++) {
- x = descendants[k];
- if (Unread.posts.has(x.ID)) {
- return true;
- }
- }
- })()) {
- QuoteThreading.threadNewLink.hidden = false;
- return false;
- }
- }
- order = Unread.order;
- children = ((base1 = QuoteThreading.children)[name1 = parent.fullID] || (base1[name1] = []));
- threadContainer = parent.nodes.threadContainer || $.el('div', {
- className: 'threadContainer'
- });
- nodes = [post.nodes.root];
- if (post.nodes.threadContainer) {
- nodes.push(post.nodes.threadContainer);
- }
- i = children.length;
- for (k = children.length - 1; k >= 0; k += -1) {
- child = children[k];
- if (child.ID >= post.ID) {
- i--;
- }
- }
- if (i !== children.length) {
- next = children[i];
- for (q = 0, len1 = descendants.length; q < len1; q++) {
- x = descendants[q];
- order.before(order[next.ID], order[x.ID]);
- }
- children.splice(i, 0, post);
- $.before(next.nodes.root, nodes);
- } else {
- prev = parent;
- while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
- prev = prev2[prev2.length - 1];
- }
- for (u = descendants.length - 1; u >= 0; u += -1) {
- x = descendants[u];
- order.after(order[prev.ID], order[x.ID]);
- }
- children.push(post);
- $.add(threadContainer, nodes);
- }
- QuoteThreading.inserted[post.fullID] = true;
- if (!parent.nodes.threadContainer) {
- parent.nodes.threadContainer = threadContainer;
- $.addClass(parent.nodes.root, 'threadOP');
- $.after(parent.nodes.root, threadContainer);
- }
- return true;
- },
- rethread: function() {
- var nodes, posts, thread;
- if (!QuoteThreading.ready) {
- return;
- }
- thread = QuoteThreading.thread;
- posts = thread.posts;
- QuoteThreading.threadNewLink.hidden = true;
- if (Conf['Thread Quotes']) {
- posts.forEach(QuoteThreading.insert);
- } else {
- nodes = [];
- Unread.order = new RandomAccessList();
- QuoteThreading.inserted = {};
- posts.forEach(function(post) {
- if (post.isFetchedQuote) {
- return;
- }
- Unread.order.push(post);
- if (post.isReply) {
- nodes.push(post.nodes.root);
- }
- if (QuoteThreading.children[post.fullID]) {
- delete QuoteThreading.children[post.fullID];
- $.rmClass(post.nodes.root, 'threadOP');
- $.rm(post.nodes.threadContainer);
- return delete post.nodes.threadContainer;
- }
- });
- $.add(thread.OP.nodes.root.parentNode, nodes);
- }
- Unread.position = Unread.order.first;
- Unread.updatePosition();
- Unread.setLine(true);
- Unread.read();
- return Unread.update();
- }
- };
-
- QuoteYou = {
- init: function() {
- var ref;
- if (!Conf['Remember Your Posts']) {
- return;
- }
- this.db = new DataBoard('yourPosts');
- $.sync('Remember Your Posts', function(enabled) {
- return Conf['Remember Your Posts'] = enabled;
- });
- $.on(d, 'QRPostSuccessful', function(e) {
- var boardID, postID, ref, threadID;
- $.forceSync('Remember Your Posts');
- if (Conf['Remember Your Posts']) {
- ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- return QuoteYou.db.set({
- boardID: boardID,
- threadID: threadID,
- postID: postID,
- val: true
- });
- }
- });
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- if (Conf['Highlight Own Posts']) {
- $.addClass(doc, 'highlight-own');
- }
- if (Conf['Highlight Posts Quoting You']) {
- $.addClass(doc, 'highlight-you');
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- this.text = '\u00A0(You)';
- return Post.callbacks.push({
- name: 'Mark Quotes of You',
- cb: this.node
- });
- },
- node: function() {
- var k, len1, quotelink, ref;
- if (this.isClone) {
- return;
- }
- if (QuoteYou.db.get({
- boardID: this.board.ID,
- threadID: this.thread.ID,
- postID: this.ID
- })) {
- $.addClass(this.nodes.root, 'yourPost');
- }
- if (!this.quotes.length) {
- return;
- }
- ref = this.nodes.quotelinks;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) {
- continue;
- }
- if (Conf['Mark Quotes of You']) {
- $.add(quotelink, $.tn(QuoteYou.text));
- }
- $.addClass(quotelink, 'you');
- $.addClass(this.nodes.root, 'quotesYou');
- }
- },
- cb: {
- seek: function(type) {
- var highlight, post, posts, result, str;
- if (highlight = $('.highlight')) {
- $.rmClass(highlight, 'highlight');
- }
- if (!(QuoteYou.lastRead && doc.contains(QuoteYou.lastRead) && $.hasClass(QuoteYou.lastRead, 'quotesYou'))) {
- if (!(post = QuoteYou.lastRead = $('.quotesYou'))) {
- new Notice('warning', 'No posts are currently quoting you, loser.', 20);
- return;
- }
- if (QuoteYou.cb.scroll(post)) {
- return;
- }
- } else {
- post = QuoteYou.lastRead;
- }
- str = type + "::div[contains(@class,'quotesYou')]";
- while ((post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0))) {
- if (QuoteYou.cb.scroll(post)) {
- return;
- }
- }
- posts = $$('.quotesYou');
- return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]);
- },
- scroll: function(root) {
- var post;
- post = $('.post', root);
- if (!post.getBoundingClientRect().height) {
- return false;
- } else {
- QuoteYou.lastRead = root;
- window.location = "#" + post.id;
- Header.scrollTo(post);
- $.addClass(post, 'highlight');
- return true;
- }
- }
- }
- };
-
- Quotify = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- return Post.callbacks.push({
- name: 'Resurrect Quotes',
- cb: this.node
- });
- },
- node: function() {
- var deadlink, k, len1, ref;
- if (this.isClone) {
- return;
- }
- ref = $$('.deadlink', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- deadlink = ref[k];
- Quotify.parseDeadlink.call(this, deadlink);
- }
- },
- parseDeadlink: function(deadlink) {
- var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref;
- if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
- Quotify.fixDeadlink(deadlink);
- return;
- }
- quote = deadlink.textContent;
- if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) {
- return;
- }
- if (postID[0] === '0') {
- Quotify.fixDeadlink(deadlink);
- return;
- }
- boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID;
- quoteID = boardID + "." + postID;
- if (post = g.posts[quoteID]) {
- if (!post.isDead) {
- a = $.el('a', {
- href: Build.postURL(boardID, post.thread.ID, postID),
- className: 'quotelink',
- textContent: quote
- });
- } else {
- a = $.el('a', {
- href: Build.postURL(boardID, post.thread.ID, postID),
- className: 'quotelink deadlink',
- textContent: quote + "\u00A0(Dead)"
- });
- $.extend(a.dataset, {
- boardID: boardID,
- threadID: post.thread.ID,
- postID: postID
- });
- }
- } else {
- redirect = Redirect.to('thread', {
- boardID: boardID,
- threadID: 0,
- postID: postID
- });
- fetchable = Redirect.to('post', {
- boardID: boardID,
- postID: postID
- });
- if (redirect || fetchable) {
- a = $.el('a', {
- href: redirect || 'javascript:;',
- className: 'deadlink',
- textContent: quote + "\u00A0(Dead)"
- });
- if (fetchable) {
- $.addClass(a, 'quotelink');
- $.extend(a.dataset, {
- boardID: boardID,
- postID: postID
- });
- }
- }
- }
- if (indexOf.call(this.quotes, quoteID) < 0) {
- this.quotes.push(quoteID);
- }
- if (!a) {
- deadlink.textContent = quote + "\u00A0(Dead)";
- return;
- }
- $.replace(deadlink, a);
- if ($.hasClass(a, 'quotelink')) {
- return this.nodes.quotelinks.push(a);
- }
- },
- fixDeadlink: function(deadlink) {
- var el, green;
- if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') {
- green = $.el('span', {
- className: 'quote'
- });
- $.before(deadlink, green);
- $.add(green, deadlink);
- }
- return $.replace(deadlink, slice.call(deadlink.childNodes));
- }
- };
-
- QR = {
- mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'],
- validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i,
- typeFromExtension: {
- 'jpg': 'image/jpeg',
- 'jpeg': 'image/jpeg',
- 'png': 'image/png',
- 'gif': 'image/gif',
- 'pdf': 'application/pdf',
- 'swf': 'application/vnd.adobe.flash.movie',
- 'webm': 'video/webm'
- },
- extensionFromType: {
- 'image/jpeg': 'jpg',
- 'image/png': 'png',
- 'image/gif': 'gif',
- 'application/pdf': 'pdf',
- 'application/vnd.adobe.flash.movie': 'swf',
- 'application/x-shockwave-flash': 'swf',
- 'video/webm': 'webm'
- },
- init: function() {
- var sc, version;
- if (!Conf['Quick Reply']) {
- return;
- }
- this.posts = [];
- if (g.VIEW === 'archive') {
- return;
- }
- version = Conf['Use Recaptcha v1'] && Main.jsEnabled ? 'v1' : 'v2';
- this.captcha = Captcha[version];
- $.on(d, '4chanXInitFinished', this.initReady);
- Post.callbacks.push({
- name: 'Quick Reply',
- cb: this.node
- });
- if (Conf['QR Shortcut']) {
- this.shortcut = sc = $.el('a', {
- className: 'qr-shortcut fa fa-comment-o disabled',
- textContent: 'QR',
- title: 'Quick Reply',
- href: 'javascript:;'
- });
- $.on(sc, 'click', function() {
- if (!QR.postingIsEnabled) {
- return;
- }
- if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) {
- QR.open();
- return QR.nodes.com.focus();
- } else {
- return QR.close();
- }
- });
- return Header.addShortcut(sc);
- }
- },
- initReady: function() {
- var link, linkBot, navLinksBot, origToggle;
- $.off(d, '4chanXInitFinished', this.initReady);
- QR.postingIsEnabled = !!$.id('postForm');
- if (!QR.postingIsEnabled) {
- return;
- }
- link = $.el('h1', {
- className: "qr-link-container"
- });
- $.extend(link, {
- innerHTML: "" + (g.VIEW === "thread" ? "Reply to Thread" : "Start a Thread") + " "
- });
- QR.link = link.firstElementChild;
- $.on(link.firstChild, 'click', function() {
- QR.open();
- return QR.nodes.com.focus();
- });
- if (Conf['Bottom QR Link'] && g.VIEW === 'thread') {
- linkBot = $.el('div', {
- className: "brackets-wrap qr-link-container-bottom"
- });
- $.extend(linkBot, {
- innerHTML: "Reply to Thread "
- });
- $.on(linkBot.firstElementChild, 'click', function() {
- QR.open();
- return QR.nodes.com.focus();
- });
- if ((navLinksBot = $('.navLinksBot'))) {
- $.prepend(navLinksBot, linkBot);
- }
- }
- origToggle = $.id('togglePostFormLink');
- $.before(origToggle, link);
- origToggle.firstElementChild.textContent = 'Original Form';
- $.on(d, 'QRGetFile', QR.getFile);
- $.on(d, 'QRSetFile', QR.setFile);
- $.on(d, 'paste', QR.paste);
- $.on(d, 'dragover', QR.dragOver);
- $.on(d, 'drop', QR.dropFile);
- $.on(d, 'dragstart dragend', QR.drag);
- $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
- $.on(d, 'ThreadUpdate', QR.statusCheck);
- if (!Conf['Persistent QR']) {
- return;
- }
- QR.open();
- if (Conf['Auto Hide QR']) {
- return QR.hide();
- }
- },
- statusCheck: function() {
- var thread;
- if (!QR.nodes) {
- return;
- }
- thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
- return QR.abort();
- } else {
- return QR.status();
- }
- },
- node: function() {
- $.on(this.nodes.quote, 'click', QR.quote);
- if (this.isFetchedQuote) {
- return QR.generatePostableThreadsList();
- }
- },
- open: function() {
- var err;
- if (QR.nodes) {
- if (QR.nodes.el.hidden) {
- QR.captcha.setup();
- }
- QR.nodes.el.hidden = false;
- QR.unhide();
- } else {
- try {
- QR.dialog();
- } catch (_error) {
- err = _error;
- delete QR.nodes;
- Main.handleErrors({
- message: 'Quick Reply dialog creation crashed.',
- error: err
- });
- return;
- }
- }
- if (Conf['QR Shortcut']) {
- return $.rmClass(QR.shortcut, 'disabled');
- }
- },
- close: function() {
- var k, len1, post, ref;
- if (QR.req) {
- QR.abort();
- return;
- }
- QR.nodes.el.hidden = true;
- QR.cleanNotifications();
- d.activeElement.blur();
- $.rmClass(QR.nodes.el, 'dump');
- if (Conf['QR Shortcut']) {
- $.addClass(QR.shortcut, 'disabled');
- }
- new QR.post(true);
- ref = QR.posts.splice(0, QR.posts.length - 1);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post = ref[k];
- post["delete"]();
- }
- QR.cooldown.auto = false;
- QR.status();
- return QR.captcha.destroy();
- },
- focus: function() {
- return $.queueTask(function() {
- if (!QR.inBubble()) {
- QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement);
- return QR.nodes.el.classList.toggle('focus', QR.hasFocus);
- }
- });
- },
- inBubble: function() {
- var bubbles, ref;
- bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
- return (ref = d.activeElement, indexOf.call(bubbles, ref) >= 0) || bubbles.some(function(el) {
- return getComputedStyle(el).visibility !== 'hidden' && el.getBoundingClientRect().bottom > 0;
- });
- },
- hide: function() {
- d.activeElement.blur();
- $.addClass(QR.nodes.el, 'autohide');
- return QR.nodes.autohide.checked = true;
- },
- unhide: function() {
- $.rmClass(QR.nodes.el, 'autohide');
- return QR.nodes.autohide.checked = false;
- },
- toggleHide: function() {
- if (this.checked) {
- return QR.hide();
- } else {
- return QR.unhide();
- }
- },
- toggleSJIS: function(e) {
- e.preventDefault();
- Conf['sjisPreview'] = !Conf['sjisPreview'];
- $.set('sjisPreview', Conf['sjisPreview']);
- return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']);
- },
- texPreviewShow: function() {
- if ($.hasClass(QR.nodes.el, 'tex-preview')) {
- return QR.texPreviewHide();
- }
- $.addClass(QR.nodes.el, 'tex-preview');
- QR.nodes.texPreview.textContent = QR.nodes.com.value;
- return $.event('mathjax', null, QR.nodes.texPreview);
- },
- texPreviewHide: function() {
- return $.rmClass(QR.nodes.el, 'tex-preview');
- },
- setCustomCooldown: function(enabled) {
- Conf['customCooldownEnabled'] = enabled;
- QR.cooldown.customCooldown = enabled;
- return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);
- },
- toggleCustomCooldown: function() {
- var enabled;
- enabled = $.hasClass(this, 'disabled');
- QR.setCustomCooldown(enabled);
- return $.set('customCooldownEnabled', enabled);
- },
- error: function(err, focusOverride) {
- var el, notice, notif;
- QR.open();
- if (typeof err === 'string') {
- el = $.tn(err);
- } else {
- el = err;
- el.removeAttribute('style');
- }
- notice = new Notice('warning', el);
- QR.notifications.push(notice);
- if (!Header.areNotificationsEnabled) {
- if (d.hidden && !QR.cooldown.auto) {
- return alert(el.textContent);
- }
- } else if (d.hidden || !(focusOverride || d.hasFocus())) {
- try {
- notif = new Notification(el.textContent, {
- body: el.textContent,
- icon: Favicon.logo
- });
- notif.onclick = function() {
- return $.global(function() {
- return window.focus();
- });
- };
- if ($.engine !== 'gecko') {
- notif.onclose = function() {
- return notice.close();
- };
- return notif.onshow = function() {
- return setTimeout(function() {
- notif.onclose = null;
- return notif.close();
- }, 7 * $.SECOND);
- };
- }
- } catch (_error) {}
- }
- },
- notifications: [],
- cleanNotifications: function() {
- var k, len1, notification, ref;
- ref = QR.notifications;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- notification = ref[k];
- notification.close();
- }
- return QR.notifications = [];
- },
- status: function() {
- var disabled, status, thread, value;
- if (!QR.nodes) {
- return;
- }
- thread = QR.posts[0].thread;
- if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
- value = 'Dead';
- disabled = true;
- QR.cooldown.auto = false;
- }
- value = QR.req ? QR.req.progress : QR.cooldown.seconds || value;
- status = QR.nodes.status;
- status.value = !value ? 'Submit' : QR.cooldown.auto ? "Auto " + value : value;
- return status.disabled = disabled || false;
- },
- openPost: function() {
- var index;
- QR.open();
- if (QR.selected.isLocked) {
- index = QR.posts.indexOf(QR.selected);
- (QR.posts[index + 1] || new QR.post()).select();
- $.addClass(QR.nodes.el, 'dump');
- return QR.cooldown.auto = true;
- }
- },
- quote: function(e) {
- var aa, ancestor, caretPos, com, frag, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, v, z;
- if (e != null) {
- e.preventDefault();
- }
- if (!QR.postingIsEnabled) {
- return;
- }
- sel = d.getSelection();
- post = Get.postFromNode(this);
- text = post.board.ID === g.BOARD.ID ? ">>" + post + "\n" : ">>>/" + post.board + "/" + post + "\n";
- if (sel.toString().trim() && post === Get.postFromNode(sel.anchorNode)) {
- range = sel.getRangeAt(0);
- frag = range.cloneContents();
- ancestor = range.commonAncestorContainer;
- if ($.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) {
- $.prepend(frag, $.tn('[spoiler]'));
- $.add(frag, $.tn('[/spoiler]'));
- }
- if (insideCode = $.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) {
- $.prepend(frag, $.tn('[code]'));
- $.add(frag, $.tn('[/code]'));
- }
- ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- node = ref[k];
- $.replace(node, $.tn('\n'));
- }
- ref1 = $$('br', frag);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- node = ref1[q];
- if (node !== frag.lastChild) {
- $.replace(node, $.tn('\n>'));
- }
- }
- ref2 = $$('s, .removed-spoiler', frag);
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- node = ref2[u];
- $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')]));
- }
- ref3 = $$('.prettyprint', frag);
- for (v = 0, len4 = ref3.length; v < len4; v++) {
- node = ref3[v];
- $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')]));
- }
- ref4 = $$('.linkify[data-original]', frag);
- for (z = 0, len5 = ref4.length; z < len5; z++) {
- node = ref4[z];
- $.replace(node, $.tn(node.dataset.original));
- }
- ref5 = $$('.embedder', frag);
- for (aa = 0, len6 = ref5.length; aa < len6; aa++) {
- node = ref5[aa];
- if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') {
- $.rm(node.previousSibling);
- }
- $.rm(node);
- }
- text += ">" + (frag.textContent.trim()) + "\n";
- }
- QR.openPost();
- ref7 = QR.nodes, com = ref7.com, thread = ref7.thread;
- if (!com.value) {
- thread.value = Get.threadFromNode(this);
- }
- caretPos = com.selectionStart;
- com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
- range = caretPos + text.length;
- com.setSelectionRange(range, range);
- com.focus();
- QR.selected.save(com);
- return QR.selected.save(thread);
- },
- characterCount: function() {
- var count, counter;
- counter = QR.nodes.charCount;
- count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
- counter.textContent = count;
- counter.hidden = count < QR.max_comment / 2;
- return (count > QR.max_comment ? $.addClass : $.rmClass)(counter, 'warning');
- },
- getFile: function() {
- var ref;
- return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0);
- },
- setFile: function(e) {
- var file, name, ref, source;
- ref = e.detail, file = ref.file, name = ref.name, source = ref.source;
- if (name != null) {
- file.name = name;
- }
- if (source != null) {
- file.source = source;
- }
- QR.open();
- return QR.handleFiles([file]);
- },
- drag: function(e) {
- var toggle;
- toggle = e.type === 'dragstart' ? $.off : $.on;
- toggle(d, 'dragover', QR.dragOver);
- return toggle(d, 'drop', QR.dropFile);
- },
- dragOver: function(e) {
- e.preventDefault();
- return e.dataTransfer.dropEffect = 'copy';
- },
- dropFile: function(e) {
- if (!e.dataTransfer.files.length) {
- return;
- }
- e.preventDefault();
- QR.open();
- return QR.handleFiles(e.dataTransfer.files);
- },
- paste: function(e) {
- var blob, files, item, k, len1, ref;
- if (!e.clipboardData.items) {
- return;
- }
- files = [];
- ref = e.clipboardData.items;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- item = ref[k];
- if (!(item.kind === 'file')) {
- continue;
- }
- blob = item.getAsFile();
- blob.name = 'file';
- if (blob.type) {
- blob.name += '.' + blob.type.split('/')[1];
- }
- files.push(blob);
- }
- if (!files.length) {
- return;
- }
- QR.open();
- QR.handleFiles(files);
- return $.addClass(QR.nodes.el, 'dump');
- },
- pasteFF: function() {
- var arr, blob, bstr, i, images, img, k, len1, m, pasteArea, q, ref, src;
- pasteArea = QR.nodes.pasteArea;
- if (!pasteArea.childNodes.length) {
- return;
- }
- images = $$('img', pasteArea);
- $.rmAll(pasteArea);
- for (k = 0, len1 = images.length; k < len1; k++) {
- img = images[k];
- src = img.src;
- if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) {
- bstr = atob(m[3]);
- arr = new Uint8Array(bstr.length);
- for (i = q = 0, ref = bstr.length; 0 <= ref ? q < ref : q > ref; i = 0 <= ref ? ++q : --q) {
- arr[i] = bstr.charCodeAt(i);
- }
- blob = new Blob([arr], {
- type: m[1]
- });
- blob.name = "file." + m[2];
- QR.handleFiles([blob]);
- } else if (/^https?:\/\//.test(src)) {
- QR.handleUrl(src);
- }
- }
- },
- handleUrl: function(urlDefault) {
- var url;
- url = prompt('Enter a URL:', urlDefault);
- if (url === null) {
- return;
- }
- QR.nodes.fileButton.focus();
- return CrossOrigin.file(url, function(blob) {
- if (blob && !/^text\//.test(blob.type)) {
- return QR.handleFiles([blob]);
- } else {
- return QR.error("Can't load file.");
- }
- });
- },
- handleFiles: function(files) {
- var file, k, len1;
- if (this !== QR) {
- files = slice.call(this.files);
- this.value = null;
- }
- if (!files.length) {
- return;
- }
- QR.cleanNotifications();
- for (k = 0, len1 = files.length; k < len1; k++) {
- file = files[k];
- QR.handleFile(file, files.length);
- }
- if (files.length !== 1) {
- $.addClass(QR.nodes.el, 'dump');
- }
- if (d.activeElement === QR.nodes.fileButton && $.hasClass(QR.nodes.fileSubmit, 'has-file')) {
- return QR.nodes.filename.focus();
- }
- },
- handleFile: function(file, nfiles) {
- var isText, post;
- isText = /^text\//.test(file.type);
- if (nfiles === 1) {
- post = QR.selected;
- } else {
- post = QR.posts[QR.posts.length - 1];
- if ((isText ? post.com || post.pasting : post.file)) {
- post = new QR.post();
- }
- }
- return post[isText ? 'pasteText' : 'setFile'](file);
- },
- openFileInput: function() {
- if (QR.nodes.fileButton.disabled) {
- return;
- }
- QR.nodes.fileInput.click();
- return QR.nodes.fileButton.focus();
- },
- generatePostableThreadsList: function() {
- var k, len1, list, options, ref, thread, val;
- if (!QR.nodes) {
- return;
- }
- list = QR.nodes.thread;
- options = [list.firstElementChild];
- ref = g.BOARD.threads.keys;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- thread = ref[k];
- options.push($.el('option', {
- value: thread,
- textContent: "Thread " + thread
- }));
- }
- val = list.value;
- $.rmAll(list);
- $.add(list, options);
- list.value = val;
- if (list.value === val) {
- return;
- }
- list.value = g.VIEW === 'thread' ? g.THREADID : 'new';
- return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
- },
- dialog: function() {
- var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, scriptData, setNode;
- QR.nodes = nodes = {
- el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
- innerHTML: "∀ TE X
Width: Height:
Hentai Porn Japanese Anime Game Loop Other "
- })
- };
- setNode = function(name, query) {
- return nodes[name] = $(query, dialog);
- };
- setNode('move', '.move');
- setNode('autohide', '#autohide');
- setNode('close', '.close');
- setNode('thread', 'select');
- setNode('form', 'form');
- setNode('sjisToggle', '#sjis-toggle');
- setNode('texButton', '#tex-preview-button');
- setNode('name', '[data-name=name]');
- setNode('email', '[data-name=email]');
- setNode('sub', '[data-name=sub]');
- setNode('com', '[data-name=com]');
- setNode('charCount', '#char-count');
- setNode('texPreview', '#tex-preview');
- setNode('dumpList', '#dump-list');
- setNode('addPost', '#add-post');
- setNode('oekaki', '.oekaki');
- setNode('drawButton', '#qr-draw-button');
- setNode('fileSubmit', '#file-n-submit');
- setNode('fileButton', '#qr-file-button');
- setNode('noFile', '#qr-no-file');
- setNode('filename', '#qr-filename');
- setNode('spoiler', '#qr-file-spoiler');
- setNode('oekakiButton', '#qr-oekaki-button');
- setNode('fileRM', '#qr-filerm');
- setNode('urlButton', '#url-button');
- setNode('pasteArea', '#paste-area');
- setNode('customCooldown', '#custom-cooldown-button');
- setNode('dumpButton', '#dump-button');
- setNode('status', '[type=submit]');
- setNode('flashTag', '[name=filetag]');
- setNode('fileInput', '[type=file]');
- rules = $('ul.rules').textContent.trim();
- match_min = rules.match(/.+smaller than (\d+)x(\d+).+/);
- match_max = rules.match(/.+greater than (\d+)x(\d+).+/);
- QR.min_width = +(match_min != null ? match_min[1] : void 0) || 1;
- QR.min_height = +(match_min != null ? match_min[2] : void 0) || 1;
- QR.max_width = +(match_max != null ? match_max[1] : void 0) || 10000;
- QR.max_height = +(match_max != null ? match_max[2] : void 0) || 10000;
- scriptData = Get.scriptData();
- QR.max_size = (m = scriptData.match(/\bmaxFilesize *= *(\d+)\b/)) ? +m[1] : 4194304;
- QR.max_size_video = (m = scriptData.match(/\bmaxWebmFilesize *= *(\d+)\b/)) ? +m[1] : QR.max_size;
- QR.max_comment = (m = scriptData.match(/\bcomlen *= *(\d+)\b/)) ? +m[1] : 2000;
- QR.max_width_video = QR.max_height_video = 2048;
- QR.max_duration_video = (ref = g.BOARD.ID) === 'gif' || ref === 'wsg' ? 300 : 120;
- if (Conf['Show New Thread Option in Threads']) {
- $.addClass(QR.nodes.el, 'show-new-thread-option');
- }
- if (Conf['Show Name and Subject']) {
- $.addClass(QR.nodes.name, 'force-show');
- $.addClass(QR.nodes.sub, 'force-show');
- QR.nodes.email.placeholder = 'E-mail';
- }
- QR.forcedAnon = !!$('form[name="post"] input[name="name"][type="hidden"]');
- if (QR.forcedAnon) {
- $.addClass(QR.nodes.el, 'forced-anon');
- }
- QR.spoiler = !!$('.postForm input[name=spoiler]');
- if (QR.spoiler) {
- $.addClass(QR.nodes.el, 'has-spoiler');
- }
- if (g.BOARD.ID === 'jp' && Conf['sjisPreview']) {
- $.addClass(QR.nodes.el, 'sjis-preview');
- }
- if (parseInt(Conf['customCooldown'], 10) > 0) {
- $.addClass(QR.nodes.fileSubmit, 'custom-cooldown');
- $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) {
- var customCooldownEnabled;
- customCooldownEnabled = arg.customCooldownEnabled;
- QR.setCustomCooldown(customCooldownEnabled);
- return $.sync('customCooldownEnabled', QR.setCustomCooldown);
- });
- }
- $.on(nodes.autohide, 'change', QR.toggleHide);
- $.on(nodes.close, 'click', QR.close);
- $.on(nodes.form, 'submit', QR.submit);
- $.on(nodes.sjisToggle, 'click', QR.toggleSJIS);
- $.on(nodes.texButton, 'mousedown', QR.texPreviewShow);
- $.on(nodes.texButton, 'mouseup', QR.texPreviewHide);
- $.on(nodes.addPost, 'click', function() {
- return new QR.post(true);
- });
- $.on(nodes.drawButton, 'click', QR.oekaki.draw);
- $.on(nodes.fileButton, 'click', QR.openFileInput);
- $.on(nodes.noFile, 'click', QR.openFileInput);
- $.on(nodes.filename, 'focus', function() {
- return $.addClass(this.parentNode, 'focus');
- });
- $.on(nodes.filename, 'blur', function() {
- return $.rmClass(this.parentNode, 'focus');
- });
- $.on(nodes.spoiler, 'change', function() {
- return QR.selected.nodes.spoiler.click();
- });
- $.on(nodes.oekakiButton, 'click', QR.oekaki.button);
- $.on(nodes.fileRM, 'click', function() {
- return QR.selected.rmFile();
- });
- $.on(nodes.urlButton, 'click', function() {
- return QR.handleUrl('');
- });
- $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);
- $.on(nodes.dumpButton, 'click', function() {
- return nodes.el.classList.toggle('dump');
- });
- $.on(nodes.fileInput, 'change', QR.handleFiles);
- window.addEventListener('focus', QR.focus, true);
- window.addEventListener('blur', QR.focus, true);
- $.on(d, 'click', QR.focus);
- if ($.engine === 'gecko') {
- nodes.pasteArea.hidden = false;
- new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {
- childList: true
- });
- }
- items = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
- i = 0;
- save = function() {
- return QR.selected.save(this);
- };
- while (name = items[i++]) {
- if (!(node = nodes[name])) {
- continue;
- }
- event = node.nodeName === 'SELECT' ? 'change' : 'input';
- $.on(nodes[name], event, save);
- }
- if ($.engine === 'gecko' && Conf['Remember QR Size']) {
- $.get('QR Size', '', function(item) {
- return nodes.com.style.cssText = item['QR Size'];
- });
- $.on(nodes.com, 'mouseup', function(e) {
- if (e.button !== 0) {
- return;
- }
- return $.set('QR Size', this.style.cssText);
- });
- }
- QR.generatePostableThreadsList();
- QR.persona.init();
- new QR.post(true);
- QR.status();
- QR.cooldown.setup();
- QR.captcha.init();
- $.add(d.body, dialog);
- QR.captcha.setup();
- QR.oekaki.setup();
- return $.event('QRDialogCreation', null, dialog);
- },
- submit: function(e) {
- var captcha, cb, err, extra, filetag, formData, options, post, ref, textOnly, thread, threadID;
- if (e != null) {
- e.preventDefault();
- }
- if (QR.req) {
- QR.abort();
- return;
- }
- if (QR.cooldown.seconds) {
- QR.cooldown.auto = !QR.cooldown.auto;
- QR.status();
- return;
- }
- post = QR.posts[0];
- post.forceSave();
- threadID = post.thread;
- thread = g.BOARD.threads[threadID];
- if (g.BOARD.ID === 'f' && threadID === 'new') {
- filetag = QR.nodes.flashTag.value;
- }
- if (threadID === 'new') {
- threadID = null;
- if (g.BOARD.ID === 'vg' && !post.sub) {
- err = 'New threads require a subject.';
- } else if (!($.hasClass(d.body, 'text_only') || post.file || (textOnly = !!$('input[name=textonly]', $.id('postForm'))))) {
- err = 'No file selected.';
- }
- } else if (g.BOARD.threads[threadID].isClosed) {
- err = 'You can\'t reply to this thread anymore.';
- } else if (!(post.com || post.file)) {
- err = 'No comment or file.';
- } else if (post.file && thread.fileLimit) {
- err = 'Max limit of image replies has been reached.';
- }
- if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
- err || (err = 'Original comment required.');
- }
- if (QR.captcha.isEnabled && !err) {
- captcha = QR.captcha.getOne();
- if (!captcha) {
- err = 'No valid captcha.';
- QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
- }
- }
- QR.cleanNotifications();
- if (err) {
- QR.cooldown.auto = false;
- QR.status();
- QR.error(err);
- return;
- }
- QR.cooldown.auto = QR.posts.length > 1;
- if (Conf['Auto Hide QR'] && !QR.cooldown.auto) {
- QR.hide();
- }
- if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) {
- d.activeElement.blur();
- }
- post.lock();
- formData = {
- resto: threadID,
- name: !QR.forcedAnon ? post.name : void 0,
- email: post.email,
- sub: !(QR.forcedAnon || threadID) ? post.sub : void 0,
- com: post.com,
- upfile: post.file,
- filetag: filetag,
- spoiler: post.spoiler,
- textonly: textOnly,
- mode: 'regist',
- pwd: QR.persona.pwd
- };
- options = {
- responseType: 'document',
- withCredentials: true,
- onload: QR.response,
- onerror: function() {
- delete QR.req;
- post.unlock();
- QR.cooldown.auto = false;
- QR.status();
- return QR.error($.el('span', {
- innerHTML: "4chan X encountered an error while posting. [Banned? ] [More info ]"
- }));
- }
- };
- extra = {
- form: $.formData(formData),
- upCallbacks: {
- onload: function() {
- QR.req.isUploadFinished = true;
- QR.req.progress = '...';
- return QR.status();
- },
- onprogress: function(e) {
- QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%";
- return QR.status();
- }
- }
- };
- cb = function(response) {
- if (response != null) {
- if (response.challenge != null) {
- extra.form.append('recaptcha_challenge_field', response.challenge);
- extra.form.append('recaptcha_response_field', response.response);
- } else {
- extra.form.append('g-recaptcha-response', response.response);
- }
- }
- QR.req = $.ajax("https://sys.4chan.org/" + g.BOARD + "/post", options, extra);
- return QR.req.progress = '...';
- };
- if (typeof captcha === 'function') {
- QR.req = {
- progress: '...',
- abort: function() {
- return cb = null;
- }
- };
- captcha(function(response) {
- if (response) {
- return typeof cb === "function" ? cb(response) : void 0;
- } else {
- delete QR.req;
- post.unlock();
- QR.cooldown.auto = !!QR.captcha.captchas.length;
- return QR.status();
- }
- });
- } else {
- cb(captcha);
- }
- return QR.status();
- },
- response: function() {
- var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, req, resDoc, seconds, threadID;
- req = QR.req;
- delete QR.req;
- post = QR.posts[0];
- post.unlock();
- resDoc = req.response;
- if (ban = $('.banType', resDoc)) {
- err = $.el('span', ban.textContent.toLowerCase() === 'banned' ? {
- innerHTML: "You are banned on " + $(".board", resDoc).innerHTML + "! ;_; Click here to see the reason."
- } : {
- innerHTML: "You were issued a warning on " + $(".board", resDoc).innerHTML + " as " + $(".nameBlock", resDoc).innerHTML + ". Reason: " + $(".reason", resDoc).innerHTML
- });
- } else if (err = resDoc.getElementById('errmsg')) {
- if ((ref = $('a', err)) != null) {
- ref.target = '_blank';
- }
- } else if (resDoc.title !== 'Post successful!') {
- err = 'Connection error with sys.4chan.org.';
- } else if (req.status !== 200) {
- err = "Error " + req.statusText + " (" + req.status + ")";
- }
- if (err) {
- if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
- if (/mistyped/i.test(err.textContent)) {
- err = $.el('span', {
- innerHTML: "You mistyped the CAPTCHA, or the CAPTCHA malfunctioned [complain here ]."
- });
- } else if (/expired/i.test(err.textContent)) {
- err = 'This CAPTCHA is no longer valid because it has expired.';
- }
- QR.cooldown.auto = QR.captcha.isEnabled || err === 'Connection error with sys.4chan.org.';
- QR.cooldown.addDelay(post, 2);
- } else if (err.textContent && (m = err.textContent.match(/(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i)) && !/duplicate|hour/i.test(err.textContent)) {
- QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent);
- seconds = 60 * (+(m[1] || 0)) + (+m[2]);
- if (/muted/i.test(err.textContent)) {
- QR.cooldown.addMute(seconds);
- } else {
- QR.cooldown.addDelay(post, seconds);
- }
- } else {
- QR.cooldown.auto = false;
- }
- QR.captcha.setup(QR.cooldown.auto && ((ref1 = d.activeElement) === QR.nodes.status || ref1 === d.body));
- if (QR.captcha.isEnabled && !QR.captcha.captchas.length) {
- QR.cooldown.auto = false;
- }
- QR.status();
- QR.error(err);
- return;
- }
- h1 = $('h1', resDoc);
- QR.cleanNotifications();
- if (Conf['Posting Success Notifications']) {
- QR.notifications.push(new Notice('success', h1.textContent, 5));
- }
- ref2 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref2[0], threadID = ref2[1], postID = ref2[2];
- postID = +postID;
- threadID = +threadID || postID;
- isReply = threadID !== postID;
- $.event('QRPostSuccessful', {
- boardID: g.BOARD.ID,
- threadID: threadID,
- postID: postID
- });
- $.event('QRPostSuccessful_', {
- boardID: g.BOARD.ID,
- threadID: threadID,
- postID: postID
- });
- postsCount = QR.posts.length - 1;
- QR.cooldown.auto = postsCount && isReply;
- lastPostToThread = !((function() {
- var k, len1, p, ref3;
- ref3 = QR.posts.slice(1);
- for (k = 0, len1 = ref3.length; k < len1; k++) {
- p = ref3[k];
- if (p.thread === post.thread) {
- return true;
- }
- }
- })());
- if (!(Conf['Persistent QR'] || postsCount)) {
- QR.close();
- } else {
- post.rm();
- QR.captcha.setup(d.activeElement === QR.nodes.status);
- }
- QR.cooldown.add(threadID, postID);
- URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && lastPostToThread && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
- if (URL) {
- open = Conf['Open Post in New Tab'] || postsCount ? function() {
- return $.open(URL);
- } : function() {
- return window.location = URL;
- };
- if (threadID === postID) {
- QR.waitForThread(URL, open);
- } else {
- open();
- }
- }
- return QR.status();
- },
- waitForThread: function(url, cb) {
- var attempts, check;
- attempts = 0;
- check = function() {
- return $.ajax(url, {
- onloadend: function() {
- attempts++;
- if (attempts >= 6 || this.status === 200) {
- return cb();
- } else {
- return setTimeout(check, attempts * $.SECOND);
- }
- }
- }, {
- type: 'HEAD'
- });
- };
- return check();
- },
- abort: function() {
- if (QR.req && !QR.req.isUploadFinished) {
- QR.req.abort();
- delete QR.req;
- QR.posts[0].unlock();
- QR.cooldown.auto = false;
- QR.notifications.push(new Notice('info', 'QR upload aborted.', 5));
- }
- return QR.status();
- }
- };
-
- Captcha = {};
-
- Captcha.fixes = {
- imageKeys: '789456123uiojklm'.split('').concat(['Comma', 'Period']),
- imageKeys16: '7890uiopjkl'.split('').concat(['Semicolon', 'm', 'Comma', 'Period', 'Slash']),
- css: '.rc-imageselect-target > div:focus, .rc-image-tile-target:focus {\n outline: 2px solid #4a90e2;\n}\n.rc-imageselect-target td:focus {\n box-shadow: inset 0 0 0 2px #4a90e2;\n outline: none;\n}\n.rc-button-default:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}',
- cssNoscript: '.fbc-payload-imageselect {\n position: relative;\n}\n.fbc-payload-imageselect > label {\n position: absolute;\n display: block;\n height: 93.3px;\n width: 93.3px;\n}\nlabel[data-row="0"] {top: 0px;}\nlabel[data-row="1"] {top: 93.3px;}\nlabel[data-row="2"] {top: 186.6px;}\nlabel[data-col="0"] {left: 0px;}\nlabel[data-col="1"] {left: 93.3px;}\nlabel[data-col="2"] {left: 186.6px;}\n.fbc-payload-imageselect > input:focus + label {\n outline: 2px solid #4a90e2;\n}\n.fbc-button-verify input:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}\nbody.focus .fbc {\n box-shadow: inset 0 0 0 2px #4a90e2;\n}',
- init: function() {
- switch (location.pathname.split('/')[3]) {
- case 'anchor':
- return this.initMain();
- case 'frame':
- return this.initPopup();
- case 'fallback':
- return this.initNoscript();
- }
- },
- initMain: function() {
- var a, k, len1, ref;
- $.onExists(d.body, '#recaptcha-anchor', function(checkbox) {
- var focus;
- focus = function() {
- var ref;
- if (d.hasFocus() && ((ref = d.activeElement) === d.documentElement || ref === d.body)) {
- return checkbox.focus();
- }
- };
- focus();
- return $.on(window, 'focus', function() {
- return $.queueTask(focus);
- });
- });
- ref = $$('.rc-anchor-pt a');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- a = ref[k];
- a.tabIndex = -1;
- }
- },
- initPopup: function() {
- $.addStyle(this.css);
- this.fixImages();
- new MutationObserver((function(_this) {
- return function() {
- return _this.fixImages();
- };
- })(this)).observe(d.body, {
- childList: true,
- subtree: true
- });
- return $.on(d, 'keydown', this.keybinds.bind(this));
- },
- initNoscript: function() {
- var data, ref, token;
- this.noscript = true;
- data = (token = (ref = $('.fbc-verification-token > textarea')) != null ? ref.value : void 0) ? {
- token: token
- } : {
- working: true
- };
- new Connection(window.parent, '*').send(data);
- d.body.classList.toggle('focus', d.hasFocus());
- $.on(window, 'focus blur', function() {
- return d.body.classList.toggle('focus', d.hasFocus());
- });
- this.images = $$('.fbc-payload-imageselect > input');
- this.width = 3;
- if (this.images.length !== 9) {
- return;
- }
- $.addStyle(this.cssNoscript);
- this.addLabels();
- $.on(d, 'keydown', this.keybinds.bind(this));
- return $.on($('.fbc-imageselect-challenge > form'), 'submit', this.checkForm.bind(this));
- },
- fixImages: function() {
- var img, k, len1, ref;
- this.images = $$('.rc-image-tile-target');
- if (!this.images.length) {
- this.images = $$('.rc-imageselect-target > div, .rc-imageselect-target td');
- }
- this.width = $$('.rc-imageselect-target tr:first-of-type td').length || Math.round(Math.sqrt(this.images.length));
- ref = this.images;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- img = ref[k];
- img.tabIndex = 0;
- }
- if (this.images.length === 9) {
- this.addTooltips(this.images);
- } else {
- this.addTooltips16(this.images);
- }
- return this.complaintLinks();
- },
- complaintLinks: function() {
- var errmsg, k, len1, link, ref;
- ref = $$('.rc-imageselect-incorrect-response, .rc-imageselect-error-select-one, .rc-imageselect-error-select-more, .rc-imageselect-error-dynamic-more');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- errmsg = ref[k];
- if (!$('a', errmsg)) {
- link = $.el('a', {
- href: 'https://www.4chan-x.net/captchas.html',
- target: '_blank',
- textContent: '[complain]'
- });
- $.add(errmsg, [$.tn(' '), link]);
- }
- }
- },
- addLabels: function() {
- var checkbox, i, imageSelect, label, labels;
- imageSelect = $('.fbc-payload-imageselect');
- labels = (function() {
- var k, len1, ref, results;
- ref = this.images;
- results = [];
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- checkbox = ref[i];
- checkbox.id = "checkbox-" + i;
- label = $.el('label', {
- htmlFor: checkbox.id
- });
- label.dataset.row = Math.floor(i / 3);
- label.dataset.col = i % 3;
- $.after(checkbox, label);
- results.push(label);
- }
- return results;
- }).call(this);
- return this.addTooltips(labels);
- },
- addTooltips: function(nodes) {
- var i, k, len1, node;
- for (i = k = 0, len1 = nodes.length; k < len1; i = ++k) {
- node = nodes[i];
- node.title = this.imageKeys[i] + " or " + (this.imageKeys[i + 9][0].toUpperCase()) + this.imageKeys[i + 9].slice(1);
- }
- },
- addTooltips16: function(nodes) {
- var i, k, key, len1, node, ref;
- ref = this.imageKeys16;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- key = ref[i];
- if (i % 4 < this.width && (node = nodes[nodes.length - (4 - Math.floor(i / 4)) * this.width + (i % 4)])) {
- node.title = "" + (key[0].toUpperCase()) + key.slice(1);
- }
- }
- },
- checkForm: function(e) {
- var checkbox, k, len1, n, ref;
- n = 0;
- ref = this.images;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- checkbox = ref[k];
- if (checkbox.checked) {
- n++;
- }
- }
- if (n === 0) {
- return e.preventDefault();
- }
- },
- keybinds: function(e) {
- var dx, i, img, key, last, n, reload, verify, w, x;
- if (!(this.images && doc.contains(this.images[0]))) {
- return;
- }
- n = this.images.length;
- w = this.width;
- last = n + w - 1;
- reload = $('#recaptcha-reload-button, .fbc-button-reload');
- verify = $('#recaptcha-verify-button, .fbc-button-verify > input');
- x = this.images.indexOf(d.activeElement);
- if (x < 0) {
- x = d.activeElement === verify ? last : n;
- }
- key = Keybinds.keyCode(e);
- if (!this.noscript && key === 'Space' && x < n) {
- this.images[x].click();
- } else if (n === 9 && (i = this.imageKeys.indexOf(key)) >= 0) {
- this.images[i % 9].click();
- verify.focus();
- } else if (n !== 9 && (i = this.imageKeys16.indexOf(key)) >= 0 && i % 4 < w && (img = this.images[n - (4 - Math.floor(i / 4)) * w + (i % 4)])) {
- img.click();
- verify.focus();
- } else if (dx = {
- 'Up': n,
- 'Down': w,
- 'Left': last,
- 'Right': 1
- }[key]) {
- x = (x + dx) % (n + w);
- if ((n < x && x < last)) {
- x = dx === last ? n : last;
- }
- (this.images[x] || (x === n ? reload : void 0) || (x === last ? verify : void 0)).focus();
- } else {
- return;
- }
- e.preventDefault();
- return e.stopPropagation();
- }
- };
-
- Captcha.replace = {
- init: function() {
- if (!(d.cookie.indexOf('pass_enabled=1') < 0)) {
- return;
- }
- if (location.hostname === 'sys.4chan.org' && /[?&]altc\b/.test(location.search) && Main.jsEnabled) {
- $.onExists(doc, 'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', function() {
- $.global(function() {
- return window.el.onload = null;
- });
- return Captcha.v1.create();
- });
- return;
- }
- if (((Conf['Use Recaptcha v1'] && location.hostname === 'boards.4chan.org') || (Conf['Use Recaptcha v1 in Reports'] && location.hostname === 'sys.4chan.org')) && Main.jsEnabled) {
- $.ready(Captcha.replace.v1);
- return;
- }
- if (Conf['Force Noscript Captcha'] && Main.jsEnabled) {
- $.ready(Captcha.replace.noscript);
- return;
- }
- if (Conf['captchaLanguage'].trim() || Conf['Captcha Fixes']) {
- if (location.hostname === 'boards.4chan.org') {
- return $.onExists(doc, '#captchaFormPart', function(node) {
- return $.onExists(node, 'iframe', Captcha.replace.iframe);
- });
- } else {
- return $.onExists(doc, 'iframe', Captcha.replace.iframe);
- }
- }
- },
- noscript: function() {
- var insert, noscript, original, span, toggle;
- if (!((original = $('#g-recaptcha, #captchaContainerAlt')) && (noscript = $('noscript')))) {
- return;
- }
- span = $.el('span', {
- id: 'captcha-forced-noscript'
- });
- $.replace(noscript, span);
- $.rm(original);
- insert = function() {
- span.innerHTML = noscript.textContent;
- return Captcha.replace.iframe($('iframe', span));
- };
- if ((toggle = $('#togglePostFormLink a, #form-link'))) {
- return $.on(toggle, 'click', insert);
- } else {
- return insert();
- }
- },
- v1: function() {
- var form, link;
- if (!$.id('g-recaptcha')) {
- return;
- }
- Captcha.v1.replace();
- if ((link = $.id('form-link'))) {
- return $.on(link, 'click', function() {
- return Captcha.v1.create();
- });
- } else if (location.hostname === 'boards.4chan.org') {
- form = $.id('postForm');
- return form.addEventListener('focus', (function() {
- return Captcha.v1.create();
- }), true);
- } else {
- return Captcha.v1.create();
- }
- },
- iframe: function(iframe) {
- var lang, src;
- if ((lang = Conf['captchaLanguage'].trim())) {
- src = /[?&]hl=/.test(iframe.src) ? iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) : iframe.src + ("&hl=" + (encodeURIComponent(lang)));
- if (iframe.src !== src) {
- iframe.src = src;
- }
- }
- return Captcha.replace.autocopy(iframe);
- },
- autocopy: function(iframe) {
- if (!(Conf['Captcha Fixes'] && /^https:\/\/www\.google\.com\/recaptcha\/api\/fallback\?/.test(iframe.src))) {
- return;
- }
- return new Connection(iframe, 'https://www.google.com', {
- working: function() {
- var ref, ref1;
- if ((ref = $.id('qr')) != null ? ref.contains(iframe) : void 0) {
- return (ref1 = $('#qr .captcha-container textarea')) != null ? ref1.parentNode.hidden = true : void 0;
- }
- },
- token: function(token) {
- var node, textarea;
- node = iframe;
- while ((node = node.parentNode)) {
- if ((textarea = $('textarea', node))) {
- break;
- }
- }
- textarea.value = token;
- return $.event('input', null, textarea);
- }
- });
- }
- };
-
- Captcha.v1 = {
- blank: "data:image/svg+xml, ",
- init: function() {
- var imgContainer, input;
- if (d.cookie.indexOf('pass_enabled=1') >= 0) {
- return;
- }
- if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt'))) {
- return;
- }
- imgContainer = $.el('div', {
- className: 'captcha-img',
- title: 'Reload reCAPTCHA'
- });
- $.extend(imgContainer, {
- innerHTML: " "
- });
- input = $.el('input', {
- className: 'captcha-input field',
- title: 'Verification',
- autocomplete: 'off',
- spellcheck: false
- });
- this.nodes = {
- img: imgContainer.firstChild,
- input: input
- };
- $.on(input, 'blur', QR.focusout);
- $.on(input, 'focus', QR.focusin);
- $.on(input, 'keydown', QR.captcha.keydown.bind(QR.captcha));
- $.on(this.nodes.img.parentNode, 'click', QR.captcha.reload.bind(QR.captcha));
- $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v1');
- $.after(QR.nodes.com.parentNode, [imgContainer, input]);
- this.captchas = [];
- $.get('captchas', [], function(arg) {
- var captchas;
- captchas = arg.captchas;
- QR.captcha.sync(captchas);
- return QR.captcha.clear();
- });
- $.sync('captchas', this.sync);
- this.replace();
- this.beforeSetup();
- if (Conf['Auto-load captcha']) {
- this.setup();
- }
- new MutationObserver(this.afterSetup).observe($.id('captchaContainerAlt'), {
- childList: true
- });
- return this.afterSetup();
- },
- replace: function() {
- var container, old;
- if (this.script) {
- return;
- }
- if (!(this.script = $('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', d.head))) {
- this.script = $.el('script', {
- src: '//www.google.com/recaptcha/api/js/recaptcha_ajax.js'
- });
- $.add(d.head, this.script);
- }
- if (old = $.id('g-recaptcha')) {
- container = $.el('div', {
- id: 'captchaContainerAlt'
- });
- return $.replace(old, container);
- }
- },
- create: function() {
- var cont, lang;
- cont = $.id('captchaContainerAlt');
- if (this.occupied) {
- return;
- }
- this.occupied = true;
- if ((lang = Conf['captchaLanguage'].trim())) {
- cont.dataset.lang = lang;
- }
- $.onExists(cont, '#recaptcha_image', function(image) {
- return $.on(image, 'click', function() {
- if ($.id('recaptcha_challenge_image')) {
- return $.global(function() {
- return window.Recaptcha.reload();
- });
- }
- });
- });
- $.onExists(cont, '#recaptcha_response_field', function(field) {
- $.on(field, 'keydown', function(e) {
- if (e.keyCode === 8 && !field.value) {
- return $.global(function() {
- return window.Recaptcha.reload();
- });
- }
- });
- if (location.hostname === 'sys.4chan.org') {
- return field.focus();
- }
- });
- return $.global(function() {
- var container, options, script;
- container = document.getElementById('captchaContainerAlt');
- options = {
- theme: 'clean',
- tabindex: {
- "boards.4chan.org": 5
- }[location.hostname],
- lang: container.dataset.lang
- };
- if (window.Recaptcha) {
- return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
- } else {
- script = document.head.querySelector('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]');
- return script.addEventListener('load', function() {
- return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
- }, false);
- }
- });
- },
- cb: {
- focus: function() {
- return QR.captcha.setup(false, true);
- }
- },
- beforeSetup: function() {
- var img, input, ref;
- ref = this.nodes, img = ref.img, input = ref.input;
- img.parentNode.hidden = true;
- img.src = this.blank;
- input.value = '';
- input.placeholder = 'Focus to load reCAPTCHA';
- this.count();
- return $.on(input, 'focus click', this.cb.focus);
- },
- needed: function() {
- var captchaCount, postsCount;
- captchaCount = this.captchas.length;
- if (QR.req) {
- captchaCount++;
- }
- postsCount = QR.posts.length;
- if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
- postsCount = 0;
- }
- return captchaCount < postsCount;
- },
- onNewPost: function() {},
- onPostChange: function() {},
- setup: function(focus, force) {
- if (!(this.isEnabled && (force || this.needed()))) {
- return;
- }
- this.create();
- if (focus) {
- $.addClass(QR.nodes.el, 'focus');
- return this.nodes.input.focus();
- }
- },
- afterSetup: function() {
- var challenge, img, input, ref, setLifetime;
- if (!(challenge = $.id('recaptcha_challenge_field_holder'))) {
- return;
- }
- if (challenge === QR.captcha.nodes.challenge) {
- return;
- }
- setLifetime = function(e) {
- return QR.captcha.lifetime = e.detail;
- };
- $.on(window, 'captcha:timeout', setLifetime);
- $.global(function() {
- return window.dispatchEvent(new CustomEvent('captcha:timeout', {
- detail: window.RecaptchaState.timeout
- }));
- });
- $.off(window, 'captcha:timeout', setLifetime);
- ref = QR.captcha.nodes, img = ref.img, input = ref.input;
- img.parentNode.hidden = false;
- input.placeholder = 'Verification';
- QR.captcha.count();
- $.off(input, 'focus click', QR.captcha.cb.focus);
- QR.captcha.nodes.challenge = challenge;
- new MutationObserver(QR.captcha.load.bind(QR.captcha)).observe(challenge, {
- childList: true,
- subtree: true,
- attributes: true
- });
- QR.captcha.load();
- if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
- QR.nodes.el.style.top = null;
- return QR.nodes.el.style.bottom = '0px';
- }
- },
- destroy: function() {
- if (!this.script) {
- return;
- }
- $.global(function() {
- return window.Recaptcha.destroy();
- });
- delete this.occupied;
- if (this.nodes) {
- return this.beforeSetup();
- }
- },
- sync: function(captchas) {
- if (captchas == null) {
- captchas = [];
- }
- QR.captcha.captchas = captchas;
- return QR.captcha.count();
- },
- getOne: function() {
- var captcha, challenge, response, timeout;
- this.clear();
- if (captcha = this.captchas.shift()) {
- this.count();
- $.set('captchas', this.captchas);
- return captcha;
- } else {
- challenge = this.nodes.img.alt;
- timeout = this.timeout;
- if (/\S/.test(response = this.nodes.input.value)) {
- this.destroy();
- return {
- challenge: challenge,
- response: response,
- timeout: timeout
- };
- } else {
- return null;
- }
- }
- },
- save: function() {
- var response;
- if (!/\S/.test(response = this.nodes.input.value)) {
- return;
- }
- this.nodes.input.value = '';
- this.captchas.push({
- challenge: this.nodes.img.alt,
- response: response,
- timeout: this.timeout
- });
- this.captchas.sort(function(a, b) {
- return a.timeout - b.timeout;
- });
- this.count();
- this.destroy();
- this.setup(false, true);
- return $.set('captchas', this.captchas);
- },
- clear: function() {
- var captcha, i, k, len1, now, ref;
- if (!this.captchas.length) {
- return;
- }
- $.forceSync('captchas');
- now = Date.now();
- ref = this.captchas;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- captcha = ref[i];
- if (captcha.timeout > now) {
- break;
- }
- }
- if (!i) {
- return;
- }
- this.captchas = this.captchas.slice(i);
- this.count();
- return $.set('captchas', this.captchas);
- },
- load: function() {
- var challenge, challenge_image;
- if ($('#captchaContainerAlt[class~="recaptcha_is_showing_audio"]')) {
- this.nodes.img.src = this.blank;
- return;
- }
- if (!this.nodes.challenge.firstChild) {
- return;
- }
- if (!(challenge_image = $.id('recaptcha_challenge_image'))) {
- return;
- }
- this.timeout = Date.now() + this.lifetime * $.SECOND - $.MINUTE;
- challenge = this.nodes.challenge.firstChild.value;
- this.nodes.img.alt = challenge;
- this.nodes.img.src = challenge_image.src;
- this.nodes.input.value = '';
- return this.clear();
- },
- count: function() {
- var count, placeholder;
- count = this.captchas ? this.captchas.length : 0;
- placeholder = this.nodes.input.placeholder.replace(/\ \(.*\)$/, '');
- placeholder += (function() {
- switch (count) {
- case 0:
- if (placeholder === 'Verification') {
- return ' (Shift + Enter to cache)';
- } else {
- return '';
- }
- break;
- case 1:
- return ' (1 cached captcha)';
- default:
- return " (" + count + " cached captchas)";
- }
- })();
- this.nodes.input.placeholder = placeholder;
- this.nodes.input.alt = count;
- clearTimeout(this.timer);
- if (count) {
- return this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
- }
- },
- reload: function(focus) {
- $.global(function() {
- if (window.Recaptcha.type === 'image') {
- window.Recaptcha.reload();
- } else {
- window.Recaptcha.switch_type('image');
- }
- return window.Recaptcha.should_focus = false;
- });
- if (focus) {
- return this.nodes.input.focus();
- }
- },
- keydown: function(e) {
- if (e.keyCode === 8 && !this.nodes.input.value) {
- this.reload();
- } else if (e.keyCode === 13 && e.shiftKey) {
- this.save();
- } else {
- return;
- }
- return e.preventDefault();
- }
- };
-
- Captcha.v2 = {
- lifetime: 2 * $.MINUTE,
- init: function() {
- var counter, root;
- if (d.cookie.indexOf('pass_enabled=1') >= 0) {
- return;
- }
- if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt, #captcha-forced-noscript'))) {
- return;
- }
- if ((this.noscript = Conf['Force Noscript Captcha'] || !Main.jsEnabled)) {
- $.addClass(QR.nodes.el, 'noscript-captcha');
- }
- this.captchas = [];
- $.get('captchas', [], function(arg) {
- var captchas;
- captchas = arg.captchas;
- return QR.captcha.sync(captchas);
- });
- $.sync('captchas', this.sync.bind(this));
- root = $.el('div', {
- className: 'captcha-root'
- });
- $.extend(root, {
- innerHTML: ""
- });
- counter = $('.captcha-counter > a', root);
- this.nodes = {
- root: root,
- counter: counter
- };
- this.count();
- $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2');
- $.after(QR.nodes.com.parentNode, root);
- $.on(counter, 'click', this.toggle.bind(this));
- $.on(counter, 'keydown', (function(_this) {
- return function(e) {
- if (Keybinds.keyCode(e) !== 'Space') {
- return;
- }
- _this.toggle();
- e.preventDefault();
- return e.stopPropagation();
- };
- })(this));
- return $.on(window, 'captcha:success', (function(_this) {
- return function() {
- return $.queueTask(function() {
- return _this.save(false);
- });
- };
- })(this));
- },
- timeouts: {},
- postsCount: 0,
- noscriptURL: function() {
- var lang, url;
- url = 'https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc';
- if ((lang = Conf['captchaLanguage'].trim())) {
- url += "&hl=" + (encodeURIComponent(lang));
- }
- return url;
- },
- needed: function() {
- var captchaCount;
- captchaCount = this.captchas.length;
- if (QR.req) {
- captchaCount++;
- }
- this.postsCount = QR.posts.length;
- if (this.postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
- this.postsCount = 0;
- }
- return captchaCount < this.postsCount;
- },
- onNewPost: function() {
- return this.setup();
- },
- onPostChange: function() {
- if (this.postsCount === 0) {
- this.setup();
- }
- if (QR.posts.length === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
- return this.postsCount = 0;
- }
- },
- toggle: function() {
- if (this.nodes.container && !this.timeouts.destroy) {
- return this.destroy();
- } else {
- return this.setup(true, true);
- }
- },
- setup: function(focus, force) {
- if (!(this.isEnabled && (this.needed() || force))) {
- return;
- }
- if (focus) {
- $.addClass(QR.nodes.el, 'focus');
- this.nodes.counter.focus();
- }
- if (this.timeouts.destroy) {
- clearTimeout(this.timeouts.destroy);
- delete this.timeouts.destroy;
- return this.reload();
- }
- if (this.nodes.container) {
- $.queueTask((function(_this) {
- return function() {
- var iframe;
- if (_this.nodes.container && d.activeElement === _this.nodes.counter && (iframe = $('iframe', _this.nodes.container))) {
- iframe.focus();
- return QR.focus();
- }
- };
- })(this));
- return;
- }
- this.nodes.container = $.el('div', {
- className: 'captcha-container'
- });
- $.prepend(this.nodes.root, this.nodes.container);
- new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, {
- childList: true,
- subtree: true
- });
- if (this.noscript) {
- return this.setupNoscript();
- } else {
- return this.setupJS();
- }
- },
- setupNoscript: function() {
- var div, iframe, textarea;
- iframe = $.el('iframe', {
- id: 'qr-captcha-iframe',
- src: this.noscriptURL()
- });
- div = $.el('div');
- textarea = $.el('textarea');
- $.add(div, textarea);
- return $.add(this.nodes.container, [iframe, div]);
- },
- setupJS: function() {
- return $.global(function() {
- var cbNative, render;
- render = function() {
- var classList, container;
- classList = document.documentElement.classList;
- container = document.querySelector('#qr .captcha-container');
- return container.dataset.widgetID = window.grecaptcha.render(container, {
- sitekey: '6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc',
- theme: classList.contains('tomorrow') || classList.contains('dark-captcha') ? 'dark' : 'light',
- callback: function(response) {
- return window.dispatchEvent(new CustomEvent('captcha:success', {
- detail: response
- }));
- }
- });
- };
- if (window.grecaptcha) {
- return render();
- } else {
- cbNative = window.onRecaptchaLoaded;
- return window.onRecaptchaLoaded = function() {
- render();
- return cbNative();
- };
- }
- });
- },
- afterSetup: function(mutations) {
- var iframe, k, len1, len2, mutation, node, q, ref, textarea;
- for (k = 0, len1 = mutations.length; k < len1; k++) {
- mutation = mutations[k];
- ref = mutation.addedNodes;
- for (q = 0, len2 = ref.length; q < len2; q++) {
- node = ref[q];
- if ((iframe = $.x('./descendant-or-self::iframe', node))) {
- this.setupIFrame(iframe);
- }
- if ((textarea = $.x('./descendant-or-self::textarea', node))) {
- this.setupTextArea(textarea);
- }
- }
- }
- },
- setupIFrame: function(iframe) {
- if (!doc.contains(iframe)) {
- return;
- }
- Captcha.replace.iframe(iframe);
- $.addClass(QR.nodes.el, 'captcha-open');
- this.fixQRPosition();
- $.on(iframe, 'load', this.fixQRPosition);
- if (d.activeElement === this.nodes.counter) {
- iframe.focus();
- }
- return $.global(function() {
- var f;
- f = document.querySelector('#qr iframe');
- return f.focus = f.blur = function() {};
- });
- },
- fixQRPosition: function() {
- if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
- QR.nodes.el.style.top = null;
- return QR.nodes.el.style.bottom = '0px';
- }
- },
- setupTextArea: function(textarea) {
- return $.one(textarea, 'input', (function(_this) {
- return function() {
- return _this.save(true);
- };
- })(this));
- },
- destroy: function() {
- var garbage, i, ins, node, ref;
- if (!this.isEnabled) {
- return;
- }
- delete this.timeouts.destroy;
- $.rmClass(QR.nodes.el, 'captcha-open');
- if (this.nodes.container) {
- $.rm(this.nodes.container);
- }
- delete this.nodes.container;
- garbage = $.X('//iframe[starts-with(@src, "https://www.google.com/recaptcha/api2/frame")]/ancestor-or-self::*[parent::body]');
- i = 0;
- while (node = garbage.snapshotItem(i++)) {
- if (((ref = (ins = node.nextSibling)) != null ? ref.nodeName : void 0) === 'INS') {
- $.rm(ins);
- }
- $.rm(node);
- }
- },
- sync: function(captchas) {
- if (captchas == null) {
- captchas = [];
- }
- this.captchas = captchas;
- this.clear();
- return this.count();
- },
- getOne: function() {
- var captcha;
- this.clear();
- if ((captcha = this.captchas.shift())) {
- $.set('captchas', this.captchas);
- this.count();
- return captcha;
- } else {
- return null;
- }
- },
- save: function(pasted, token) {
- var base1, focus, ref;
- $.forceSync('captchas');
- this.captchas.push({
- response: token || $('textarea', this.nodes.container).value,
- timeout: Date.now() + this.lifetime
- });
- this.captchas.sort(function(a, b) {
- return a.timeout - b.timeout;
- });
- $.set('captchas', this.captchas);
- this.count();
- focus = ((ref = d.activeElement) != null ? ref.nodeName : void 0) === 'IFRAME' && /https?:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src);
- if (this.needed()) {
- if (focus) {
- if (QR.cooldown.auto || Conf['Post on Captcha Completion']) {
- this.nodes.counter.focus();
- } else {
- QR.nodes.status.focus();
- }
- }
- this.reload();
- } else {
- if (pasted) {
- this.destroy();
- } else {
- if ((base1 = this.timeouts).destroy == null) {
- base1.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
- }
- }
- if (focus) {
- QR.nodes.status.focus();
- }
- }
- if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) {
- return QR.submit();
- }
- },
- clear: function() {
- var captcha, i, k, len1, now, ref;
- if (!this.captchas.length) {
- return;
- }
- $.forceSync('captchas');
- now = Date.now();
- ref = this.captchas;
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- captcha = ref[i];
- if (captcha.timeout > now) {
- break;
- }
- }
- if (!i) {
- return;
- }
- this.captchas = this.captchas.slice(i);
- this.count();
- $.set('captchas', this.captchas);
- return this.setup(d.activeElement === QR.nodes.status);
- },
- count: function() {
- this.nodes.counter.textContent = "Captchas: " + this.captchas.length;
- clearTimeout(this.timeouts.clear);
- if (this.captchas.length) {
- return this.timeouts.clear = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
- }
- },
- reload: function() {
- if ($('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) {
- this.destroy();
- return this.setup(false, true);
- } else {
- return $.global(function() {
- var container;
- container = document.querySelector('#qr .captcha-container');
- return window.grecaptcha.reset(container.dataset.widgetID);
- });
- }
- }
- };
-
- PassLink = {
- init: function() {
- if (!Conf['Pass Link']) {
- return;
- }
- return Main.ready(this.ready);
- },
- ready: function() {
- var passLink, styleSelector;
- if (!(styleSelector = $.id('styleSelector'))) {
- return;
- }
- passLink = $.el('span', {
- className: 'brackets-wrap pass-link-container'
- });
- $.extend(passLink, {
- innerHTML: "4chan Pass "
- });
- $.on(passLink.firstElementChild, 'click', function() {
- return window.open('//sys.4chan.org/auth', Date.now(), 'width=500,height=280,toolbar=0');
- });
- return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]);
- }
- };
-
- PostSuccessful = {
- init: function() {
- if (!Conf['Remember Your Posts']) {
- return;
- }
- return $.ready(this.ready);
- },
- ready: function() {
- var _, db, postID, ref, threadID;
- if (d.title !== 'Post successful!') {
- return;
- }
- ref = $('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref[0], threadID = ref[1], postID = ref[2];
- postID = +postID;
- threadID = +threadID || postID;
- db = new DataBoard('yourPosts');
- return db.set({
- boardID: g.BOARD.ID,
- threadID: threadID,
- postID: postID,
- val: true
- });
- }
- };
-
- QR.cooldown = {
- seconds: 0,
- delays: {
- thread: 0,
- reply: 0,
- image: 0,
- reply_intra: 0,
- image_intra: 0,
- deletion: 60,
- thread_global: 300
- },
- init: function() {
- if (!Conf['Quick Reply']) {
- return;
- }
- this.data = Conf['cooldowns'];
- return $.sync('cooldowns', this.sync);
- },
- setup: function() {
- var delay, m, ref, type;
- if (m = Get.scriptData().match(/\bcooldowns *= *({[^}]+})/)) {
- $.extend(QR.cooldown.delays, JSON.parse(m[1]));
- }
- QR.cooldown.maxDelay = 0;
- ref = QR.cooldown.delays;
- for (type in ref) {
- delay = ref[type];
- if (type !== 'thread' && type !== 'thread_global') {
- QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay);
- }
- }
- QR.cooldown.isSetup = true;
- return QR.cooldown.start();
- },
- start: function() {
- var data;
- data = QR.cooldown.data;
- if (!(Conf['Cooldown'] && QR.cooldown.isSetup && !QR.cooldown.isCounting && Object.keys(data[g.BOARD.ID] || {}).length + Object.keys(data.global || {}).length > 0)) {
- return;
- }
- QR.cooldown.isCounting = true;
- return QR.cooldown.count();
- },
- sync: function(data) {
- QR.cooldown.data = data || {};
- return QR.cooldown.start();
- },
- add: function(threadID, postID) {
- var boardID, start;
- if (!Conf['Cooldown']) {
- return;
- }
- start = Date.now();
- boardID = g.BOARD.ID;
- QR.cooldown.set(boardID, start, {
- threadID: threadID,
- postID: postID
- });
- if (threadID === postID) {
- QR.cooldown.set('global', start, {
- boardID: boardID,
- threadID: threadID,
- postID: postID
- });
- }
- return QR.cooldown.start();
- },
- addDelay: function(post, delay) {
- var cooldown;
- if (!Conf['Cooldown']) {
- return;
- }
- cooldown = QR.cooldown.categorize(post);
- cooldown.delay = delay;
- QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown);
- return QR.cooldown.start();
- },
- addMute: function(delay) {
- if (!Conf['Cooldown']) {
- return;
- }
- QR.cooldown.set(g.BOARD.ID, Date.now(), {
- type: 'mute',
- delay: delay
- });
- return QR.cooldown.start();
- },
- "delete": function(post) {
- var base1, cooldown, cooldowns, id, name1;
- if (!QR.cooldown.data) {
- return;
- }
- $.forceSync('cooldowns');
- cooldowns = ((base1 = QR.cooldown.data)[name1 = post.board.ID] || (base1[name1] = {}));
- for (id in cooldowns) {
- cooldown = cooldowns[id];
- if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
- delete cooldowns[id];
- }
- }
- return QR.cooldown.save([post.board.ID]);
- },
- secondsDeletion: function(post) {
- var cooldown, cooldowns, seconds, start;
- if (!(QR.cooldown.data && Conf['Cooldown'])) {
- return 0;
- }
- cooldowns = QR.cooldown.data[post.board.ID] || {};
- for (start in cooldowns) {
- cooldown = cooldowns[start];
- if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
- seconds = QR.cooldown.delays.deletion - Math.floor((Date.now() - start) / $.SECOND);
- return Math.max(seconds, 0);
- }
- }
- return 0;
- },
- categorize: function(post) {
- if (post.thread === 'new') {
- return {
- type: 'thread'
- };
- } else {
- return {
- type: !!post.file ? 'image' : 'reply',
- threadID: +post.thread
- };
- }
- },
- set: function(scope, id, value) {
- var base1, cooldowns;
- $.forceSync('cooldowns');
- cooldowns = ((base1 = QR.cooldown.data)[scope] || (base1[scope] = {}));
- cooldowns[id] = value;
- return $.set('cooldowns', QR.cooldown.data);
- },
- save: function(scopes) {
- var data, k, len1, scope;
- data = QR.cooldown.data;
- for (k = 0, len1 = scopes.length; k < len1; k++) {
- scope = scopes[k];
- if (scope in data && !Object.keys(data[scope]).length) {
- delete data[scope];
- }
- }
- return $.set('cooldowns', data);
- },
- count: function() {
- var base1, cooldown, cooldowns, elapsed, k, len1, maxDelay, nCooldowns, now, ref, ref1, save, scope, seconds, start, suffix, threadID, type, update;
- $.forceSync('cooldowns');
- save = [];
- nCooldowns = 0;
- now = Date.now();
- ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID;
- seconds = 0;
- if (Conf['Cooldown']) {
- ref1 = [g.BOARD.ID, 'global'];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- scope = ref1[k];
- cooldowns = ((base1 = QR.cooldown.data)[scope] || (base1[scope] = {}));
- for (start in cooldowns) {
- cooldown = cooldowns[start];
- start = +start;
- elapsed = Math.floor((now - start) / $.SECOND);
- if (elapsed < 0) {
- delete cooldowns[start];
- save.push(scope);
- continue;
- }
- if (cooldown.delay != null) {
- if (cooldown.delay <= elapsed) {
- delete cooldowns[start];
- save.push(scope);
- } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') {
- seconds = Math.max(seconds, cooldown.delay - elapsed);
- }
- continue;
- }
- maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread'];
- if (QR.cooldown.customCooldown) {
- maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10));
- }
- if (maxDelay <= elapsed) {
- delete cooldowns[start];
- save.push(scope);
- continue;
- }
- if ((type === 'thread') === (cooldown.threadID === cooldown.postID) && cooldown.boardID !== g.BOARD.ID) {
- suffix = scope === 'global' ? '_global' : type !== 'thread' && threadID === cooldown.threadID ? '_intra' : '';
- seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed);
- }
- if (QR.cooldown.customCooldown) {
- seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed);
- }
- }
- nCooldowns += Object.keys(cooldowns).length;
- }
- }
- if (save.length) {
- QR.cooldown.save(save);
- }
- if (nCooldowns) {
- clearTimeout(QR.cooldown.timeout);
- QR.cooldown.timeout = setTimeout(QR.cooldown.count, $.SECOND);
- } else {
- delete QR.cooldown.isCounting;
- }
- update = seconds !== QR.cooldown.seconds;
- QR.cooldown.seconds = seconds;
- if (update) {
- QR.status();
- }
- if (seconds === 0 && QR.cooldown.auto && !QR.req) {
- return QR.submit();
- }
- }
- };
-
- QR.oekaki = {
- menu: {
- init: function() {
- var a, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Edit Link'] && Conf['Quick Reply'])) {
- return;
- }
- a = $.el('a', {
- className: 'edit-link',
- href: 'javascript:;',
- textContent: 'Edit image'
- });
- $.on(a, 'click', this.editFile);
- return Menu.menu.addEntry({
- el: a,
- order: 95,
- open: function(post) {
- var file;
- QR.oekaki.menu.post = post;
- file = post.file;
- return QR.postingIsEnabled && !!file && (file.isImage || file.isVideo);
- }
- });
- },
- editFile: function() {
- var currentTime, isVideo, post, ref;
- post = QR.oekaki.menu.post;
- QR.quote.call(post.nodes.post);
- isVideo = post.file.isVideo;
- currentTime = ((ref = post.file.fullImage) != null ? ref.currentTime : void 0) || 0;
- return CrossOrigin.file(post.file.url, function(blob) {
- var video;
- if (!blob) {
- return QR.error("Can't load file.");
- } else if (isVideo) {
- video = $.el('video');
- $.on(video, 'loadedmetadata', function() {
- $.on(video, 'seeked', function() {
- var canvas;
- canvas = $.el('canvas', {
- width: video.videoWidth,
- height: video.videoHeight
- });
- canvas.getContext('2d').drawImage(video, 0, 0);
- return canvas.toBlob(function(snapshot) {
- snapshot.name = post.file.name.replace(/\.\w+$/, '') + '.png';
- QR.handleFiles([snapshot]);
- return QR.oekaki.edit();
- });
- });
- return video.currentTime = currentTime;
- });
- return video.src = URL.createObjectURL(blob);
- } else {
- blob.name = post.file.name;
- QR.handleFiles([blob]);
- return QR.oekaki.edit();
- }
- });
- }
- },
- setup: function() {
- return $.global(function() {
- var FCX;
- FCX = window.FCX;
- FCX.oekakiCB = function() {
- return window.Tegaki.flatten().toBlob(function(file) {
- var source;
- source = "oekaki-" + (Date.now());
- FCX.oekakiLatest = source;
- return document.dispatchEvent(new CustomEvent('QRSetFile', {
- bubbles: true,
- detail: {
- file: file,
- name: FCX.oekakiName,
- source: source
- }
- }));
- });
- };
- if (window.Tegaki) {
- return document.querySelector('#qr .oekaki').hidden = false;
- }
- });
- },
- load: function(cb) {
- var n, onload, script, style;
- if ($('script[src^="//s.4cdn.org/js/painter"]', d.head)) {
- return cb();
- } else {
- style = $.el('link', {
- rel: 'stylesheet',
- href: "//s.4cdn.org/css/painter." + (Date.now()) + ".css"
- });
- script = $.el('script', {
- src: "//s.4cdn.org/js/painter.min." + (Date.now()) + ".js"
- });
- n = 0;
- onload = function() {
- if (++n === 2) {
- return cb();
- }
- };
- $.on(style, 'load', onload);
- $.on(script, 'load', onload);
- return $.add(d.head, [style, script]);
- }
- },
- draw: function() {
- return $.global(function() {
- var FCX, Tegaki;
- Tegaki = window.Tegaki, FCX = window.FCX;
- if (Tegaki.bg) {
- Tegaki.destroy();
- }
- FCX.oekakiName = 'tegaki.png';
- return Tegaki.open({
- onDone: FCX.oekakiCB,
- onCancel: function() {
- return Tegaki.bgColor = '#ffffff';
- },
- width: +document.querySelector('#qr [name=oekaki-width]').value,
- height: +document.querySelector('#qr [name=oekaki-height]').value,
- bgColor: document.querySelector('#qr [name=oekaki-bg]').checked ? document.querySelector('#qr [name=oekaki-bgcolor]').value : 'transparent'
- });
- });
- },
- button: function() {
- if (QR.selected.file) {
- return QR.oekaki.edit();
- } else {
- return QR.oekaki.toggle();
- }
- },
- edit: function() {
- return QR.oekaki.load(function() {
- return $.global(function() {
- var FCX, Tegaki, cb, error, name, source;
- Tegaki = window.Tegaki, FCX = window.FCX;
- name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png';
- source = document.getElementById('file-n-submit').dataset.source;
- error = function(content) {
- return document.dispatchEvent(new CustomEvent('CreateNotification', {
- bubbles: true,
- detail: {
- type: 'warning',
- content: content,
- lifetime: 20
- }
- }));
- };
- cb = function(e) {
- var file, isVideo;
- document.removeEventListener('QRFile', cb, false);
- if (!e.detail) {
- return error('No file to edit.');
- }
- if (!/^(image|video)\//.test(e.detail.type)) {
- return error('Not an image.');
- }
- isVideo = /^video\//.test(e.detail.type);
- file = document.createElement(isVideo ? 'video' : 'img');
- file.addEventListener('error', function() {
- return error('Could not open file.', false);
- });
- file.addEventListener((isVideo ? 'loadeddata' : 'load'), function() {
- if (Tegaki.bg) {
- Tegaki.destroy();
- }
- FCX.oekakiName = name;
- Tegaki.open({
- onDone: FCX.oekakiCB,
- onCancel: function() {
- return Tegaki.bgColor = '#ffffff';
- },
- width: file.naturalWidth || file.videoWidth,
- height: file.naturalHeight || file.videoHeight,
- bgColor: 'transparent'
- });
- return Tegaki.activeCtx.drawImage(file, 0, 0);
- }, false);
- return file.src = URL.createObjectURL(e.detail);
- };
- if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) {
- FCX.oekakiName = name;
- return Tegaki.resume();
- } else {
- document.addEventListener('QRFile', cb, false);
- return document.dispatchEvent(new CustomEvent('QRGetFile', {
- bubbles: true
- }));
- }
- });
- });
- },
- toggle: function() {
- return QR.oekaki.load(function() {
- return QR.nodes.oekaki.hidden = !QR.nodes.oekaki.hidden;
- });
- }
- };
-
- QR.persona = {
- pwd: '',
- always: {},
- init: function() {
- QR.persona.getPassword();
- return $.get('QR.personas', Conf['QR.personas'], function(arg) {
- var arr, item, k, len1, personas, ref, type, types;
- personas = arg['QR.personas'];
- types = {
- name: [],
- email: [],
- sub: []
- };
- ref = personas.split('\n');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- item = ref[k];
- QR.persona.parseItem(item.trim(), types);
- }
- for (type in types) {
- arr = types[type];
- QR.persona.loadPersonas(type, arr);
- }
- });
- },
- parseItem: function(item, types) {
- var boards, match, ref, ref1, ref2, type, val;
- if (item[0] === '#') {
- return;
- }
- if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) {
- return;
- }
- ref = match, match = ref[0], type = ref[1], val = ref[2];
- item = item.replace(match, '');
- boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global';
- if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) {
- return;
- }
- if (type === 'password') {
- QR.persona.pwd = val;
- return;
- }
- if (type === 'options') {
- type = 'email';
- }
- if (type === 'subject') {
- type = 'sub';
- }
- if (/always/i.test(item)) {
- QR.persona.always[type] = val;
- }
- if (indexOf.call(types[type], val) < 0) {
- return types[type].push(val);
- }
- },
- loadPersonas: function(type, arr) {
- var k, len1, list, val;
- list = $("#list-" + type, QR.nodes.el);
- for (k = 0, len1 = arr.length; k < len1; k++) {
- val = arr[k];
- if (val) {
- $.add(list, $.el('option', {
- textContent: val
- }));
- }
- }
- },
- getPassword: function() {
- var input, m, ref;
- if (!QR.persona.pwd) {
- QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : ((ref = $.id('delPassword')) != null ? ref.value : void 0) || '';
- }
- return QR.persona.pwd;
- },
- get: function(cb) {
- return $.get('QR.persona', {}, function(arg) {
- var persona;
- persona = arg['QR.persona'];
- return cb(persona);
- });
- },
- set: function(post) {
- return $.get('QR.persona', {}, function(arg) {
- var persona;
- persona = arg['QR.persona'];
- persona = {
- name: post.name
- };
- return $.set('QR.persona', persona);
- });
- }
- };
-
- QR.post = (function() {
- function _Class(select) {
- this.select = bind(this.select, this);
- var el, event, k, label, len1, len2, prev, q, ref, ref1;
- el = $.el('a', {
- className: 'qr-preview',
- draggable: true,
- href: 'javascript:;'
- });
- $.extend(el, {
- innerHTML: " Spoiler "
- });
- this.nodes = {
- el: el,
- rm: el.firstChild,
- spoiler: $('.qr-preview-spoiler input', el),
- span: el.lastChild
- };
- $.on(el, 'click', this.select);
- $.on(this.nodes.rm, 'click', (function(_this) {
- return function(e) {
- e.stopPropagation();
- return _this.rm();
- };
- })(this));
- $.on(this.nodes.spoiler, 'change', (function(_this) {
- return function(e) {
- _this.spoiler = e.target.checked;
- if (_this === QR.selected) {
- return QR.nodes.spoiler.checked = _this.spoiler;
- }
- };
- })(this));
- ref = $$('label', el);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- label = ref[k];
- $.on(label, 'click', function(e) {
- return e.stopPropagation();
- });
- }
- $.add(QR.nodes.dumpList, el);
- ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- event = ref1[q];
- $.on(el, event.toLowerCase(), this[event]);
- }
- this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
- prev = QR.posts[QR.posts.length - 1];
- QR.posts.push(this);
- this.nodes.spoiler.checked = this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false;
- QR.persona.get((function(_this) {
- return function(persona) {
- _this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name;
- _this.email = 'email' in QR.persona.always ? QR.persona.always.email : '';
- _this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : '';
- if (QR.selected === _this) {
- return _this.load();
- }
- };
- })(this));
- if (select) {
- this.select();
- }
- this.unlock();
- $.queueTask(function() {
- return QR.captcha.onNewPost();
- });
- }
-
- _Class.prototype.rm = function() {
- var index;
- this["delete"]();
- index = QR.posts.indexOf(this);
- if (QR.posts.length === 1) {
- new QR.post(true);
- $.rmClass(QR.nodes.el, 'dump');
- } else if (this === QR.selected) {
- (QR.posts[index - 1] || QR.posts[index + 1]).select();
- }
- QR.posts.splice(index, 1);
- return QR.status();
- };
-
- _Class.prototype["delete"] = function() {
- $.rm(this.nodes.el);
- URL.revokeObjectURL(this.URL);
- return this.dismissErrors();
- };
-
- _Class.prototype.lock = function(lock) {
- var k, len1, name, node, ref;
- if (lock == null) {
- lock = true;
- }
- this.isLocked = lock;
- if (this !== QR.selected) {
- return;
- }
- ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- name = ref[k];
- if (node = QR.nodes[name]) {
- node.disabled = lock;
- }
- }
- this.nodes.rm.style.visibility = lock ? 'hidden' : '';
- this.nodes.spoiler.disabled = lock;
- return this.nodes.el.draggable = !lock;
- };
-
- _Class.prototype.unlock = function() {
- return this.lock(false);
- };
-
- _Class.prototype.select = function() {
- var rectEl, rectList;
- if (QR.selected) {
- QR.selected.nodes.el.removeAttribute('id');
- QR.selected.forceSave();
- }
- QR.selected = this;
- this.lock(this.isLocked);
- this.nodes.el.id = 'selected';
- rectEl = this.nodes.el.getBoundingClientRect();
- rectList = this.nodes.el.parentNode.getBoundingClientRect();
- this.nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2;
- return this.load();
- };
-
- _Class.prototype.load = function() {
- var k, len1, name, node, ref;
- ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- name = ref[k];
- if (!(node = QR.nodes[name])) {
- continue;
- }
- node.value = this[name] || node.dataset["default"] || '';
- }
- (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
- this.showFileData();
- return QR.characterCount();
- };
-
- _Class.prototype.save = function(input) {
- var name, ref;
- if (input.type === 'checkbox') {
- this.spoiler = input.checked;
- return;
- }
- name = input.dataset.name;
- this[name] = input.value || input.dataset["default"] || null;
- switch (name) {
- case 'thread':
- (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
- return QR.status();
- case 'com':
- this.updateComment();
- if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
- return QR.cooldown.auto = false;
- }
- break;
- case 'filename':
- if (!this.file) {
- return;
- }
- this.saveFilename();
- return this.updateFilename();
- case 'name':
- return QR.persona.set(this);
- }
- };
-
- _Class.prototype.forceSave = function() {
- var k, len1, name, node, ref;
- if (this !== QR.selected) {
- return;
- }
- ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- name = ref[k];
- if (!(node = QR.nodes[name])) {
- continue;
- }
- this.save(node);
- }
- };
-
- _Class.prototype.setComment = function(com) {
- this.com = com || null;
- if (this === QR.selected) {
- QR.nodes.com.value = this.com;
- }
- return this.updateComment();
- };
-
- _Class.prototype.updateComment = function() {
- if (this === QR.selected) {
- QR.characterCount();
- }
- this.nodes.span.textContent = this.com;
- return $.queueTask(function() {
- return QR.captcha.onPostChange();
- });
- };
-
- _Class.rmErrored = function(e) {
- var error, errors, k, len1, post, q, ref;
- e.stopPropagation();
- ref = QR.posts;
- for (k = ref.length - 1; k >= 0; k += -1) {
- post = ref[k];
- if (errors = post.errors) {
- for (q = 0, len1 = errors.length; q < len1; q++) {
- error = errors[q];
- if (!(doc.contains(error))) {
- continue;
- }
- post.rm();
- break;
- }
- }
- }
- };
-
- _Class.prototype.error = function(className, message) {
- var div, ref, rm, rmAll;
- div = $.el('div', {
- className: className
- });
- $.extend(div, {
- innerHTML: E(message) + " [delete ] [delete all ]"
- });
- (this.errors || (this.errors = [])).push(div);
- ref = $$('a', div), rm = ref[0], rmAll = ref[1];
- $.on(div, 'click', (function(_this) {
- return function() {
- if (indexOf.call(QR.posts, _this) >= 0) {
- return _this.select();
- }
- };
- })(this));
- $.on(rm, 'click', (function(_this) {
- return function(e) {
- e.stopPropagation();
- if (indexOf.call(QR.posts, _this) >= 0) {
- return _this.rm();
- }
- };
- })(this));
- $.on(rmAll, 'click', QR.post.rmErrored);
- return QR.error(div, true);
- };
-
- _Class.prototype.fileError = function(message) {
- return this.error('file-error', this.filename + ": " + message);
- };
-
- _Class.prototype.dismissErrors = function(test) {
- var error, k, len1, ref;
- if (test == null) {
- test = function() {
- return true;
- };
- }
- if (this.errors) {
- ref = this.errors;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- error = ref[k];
- if (doc.contains(error) && test(error)) {
- error.parentNode.previousElementSibling.click();
- }
- }
- }
- };
-
- _Class.prototype.setFile = function(file1) {
- var ext, ref;
- this.file = file1;
- if (Conf['Randomize Filename'] && g.BOARD.ID !== 'f') {
- this.filename = "" + (Date.now() - Math.floor(Math.random() * 365 * $.DAY));
- if (ext = this.file.name.match(QR.validExtension)) {
- this.filename += ext[0];
- }
- } else {
- this.filename = this.file.name;
- }
- this.filesize = $.bytesToString(this.file.size);
- this.checkSize();
- $.addClass(this.nodes.el, 'has-file');
- $.queueTask(function() {
- return QR.captcha.onPostChange();
- });
- URL.revokeObjectURL(this.URL);
- this.saveFilename();
- if (this === QR.selected) {
- this.showFileData();
- } else {
- this.updateFilename();
- }
- this.nodes.el.style.backgroundImage = null;
- if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) {
- return this.fileError('Unsupported file type.');
- } else if (/^(image|video)\//.test(this.file.type)) {
- return this.readFile();
- }
- };
-
- _Class.prototype.checkSize = function() {
- var max;
- max = QR.max_size;
- if (/^video\//.test(this.file.type)) {
- max = Math.min(max, QR.max_size_video);
- }
- if (this.file.size > max) {
- return this.fileError("File too large (file: " + this.filesize + ", max: " + ($.bytesToString(max)) + ").");
- }
- };
-
- _Class.prototype.readFile = function() {
- var el, event, isVideo, onerror, onload;
- isVideo = /^video\//.test(this.file.type);
- el = $.el(isVideo ? 'video' : 'img');
- if (isVideo && !el.canPlayType(this.file.type)) {
- return;
- }
- event = isVideo ? 'loadeddata' : 'load';
- onload = (function(_this) {
- return function() {
- $.off(el, event, onload);
- $.off(el, 'error', onerror);
- _this.checkDimensions(el);
- return _this.setThumbnail(el);
- };
- })(this);
- onerror = (function(_this) {
- return function() {
- $.off(el, event, onload);
- $.off(el, 'error', onerror);
- _this.fileError((isVideo ? 'Video' : 'Image') + " appears corrupt");
- return URL.revokeObjectURL(el.src);
- };
- })(this);
- $.on(el, event, onload);
- $.on(el, 'error', onerror);
- return el.src = URL.createObjectURL(this.file);
- };
-
- _Class.prototype.checkDimensions = function(el) {
- var duration, height, max_height, max_width, ref, videoHeight, videoWidth, width;
- if (el.tagName === 'IMG') {
- height = el.height, width = el.width;
- if (height > QR.max_height || width > QR.max_width) {
- this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
- }
- if (height < QR.min_height || width < QR.min_width) {
- return this.fileError("Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
- }
- } else {
- videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration;
- max_height = Math.min(QR.max_height, QR.max_height_video);
- max_width = Math.min(QR.max_width, QR.max_width_video);
- if (videoHeight > max_height || videoWidth > max_width) {
- this.fileError("Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
- }
- if (videoHeight < QR.min_height || videoWidth < QR.min_width) {
- this.fileError("Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
- }
- if (!isFinite(duration)) {
- this.fileError('Video lacks duration metadata (try remuxing)');
- } else if (duration > QR.max_duration_video) {
- this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
- }
- if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg') && $.hasAudio(el)) {
- return this.fileError('Audio not allowed');
- }
- }
- };
-
- _Class.prototype.setThumbnail = function(el) {
- var cv, height, isVideo, s, width;
- isVideo = el.tagName === 'VIDEO';
- s = 90 * 2 * window.devicePixelRatio;
- if (this.file.type === 'image/gif') {
- s *= 3;
- }
- if (isVideo) {
- height = el.videoHeight;
- width = el.videoWidth;
- } else {
- height = el.height, width = el.width;
- if (height < s || width < s) {
- this.URL = el.src;
- this.nodes.el.style.backgroundImage = "url(" + this.URL + ")";
- return;
- }
- }
- if (height <= width) {
- width = s / height * width;
- height = s;
- } else {
- height = s / width * height;
- width = s;
- }
- cv = $.el('canvas');
- cv.height = height;
- cv.width = width;
- cv.getContext('2d').drawImage(el, 0, 0, width, height);
- URL.revokeObjectURL(el.src);
- return cv.toBlob((function(_this) {
- return function(blob) {
- _this.URL = URL.createObjectURL(blob);
- return _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")";
- };
- })(this));
- };
-
- _Class.prototype.rmFile = function() {
- if (this.isLocked) {
- return;
- }
- delete this.file;
- delete this.filename;
- delete this.filesize;
- this.nodes.el.removeAttribute('title');
- QR.nodes.filename.removeAttribute('title');
- this.nodes.el.style.backgroundImage = null;
- $.rmClass(this.nodes.el, 'has-file');
- this.showFileData();
- URL.revokeObjectURL(this.URL);
- return this.dismissErrors(function(error) {
- return $.hasClass(error, 'file-error');
- });
- };
-
- _Class.prototype.saveFilename = function() {
- this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-');
- if (!QR.validExtension.test(this.filename)) {
- return this.file.newName += "." + (QR.extensionFromType[this.file.type] || 'jpg');
- }
- };
-
- _Class.prototype.updateFilename = function() {
- var long;
- long = this.filename + " (" + this.filesize + ")";
- this.nodes.el.title = long;
- if (this !== QR.selected) {
- return;
- }
- return QR.nodes.filename.title = long;
- };
-
- _Class.prototype.showFileData = function() {
- var ref;
- if (this.file) {
- this.updateFilename();
- QR.nodes.filename.value = this.filename;
- $.addClass(QR.nodes.oekaki, 'has-file');
- $.addClass(QR.nodes.fileSubmit, 'has-file');
- } else {
- $.rmClass(QR.nodes.oekaki, 'has-file');
- $.rmClass(QR.nodes.fileSubmit, 'has-file');
- }
- if (((ref = this.file) != null ? ref.source : void 0) != null) {
- QR.nodes.fileSubmit.dataset.source = this.file.source;
- } else {
- QR.nodes.fileSubmit.removeAttribute('data-source');
- }
- return QR.nodes.spoiler.checked = this.spoiler;
- };
-
- _Class.prototype.pasteText = function(file) {
- var reader;
- this.pasting = true;
- reader = new FileReader();
- reader.onload = (function(_this) {
- return function(e) {
- var result;
- result = e.target.result;
- _this.setComment((_this.com ? _this.com + "\n" + result : result));
- return delete _this.pasting;
- };
- })(this);
- return reader.readAsText(file);
- };
-
- _Class.prototype.dragStart = function(e) {
- var left, ref, top;
- ref = this.getBoundingClientRect(), left = ref.left, top = ref.top;
- e.dataTransfer.setDragImage(this, e.clientX - left, e.clientY - top);
- return $.addClass(this, 'drag');
- };
-
- _Class.prototype.dragEnd = function() {
- return $.rmClass(this, 'drag');
- };
-
- _Class.prototype.dragEnter = function() {
- return $.addClass(this, 'over');
- };
-
- _Class.prototype.dragLeave = function() {
- return $.rmClass(this, 'over');
- };
-
- _Class.prototype.dragOver = function(e) {
- e.preventDefault();
- return e.dataTransfer.dropEffect = 'move';
- };
-
- _Class.prototype.drop = function() {
- var el, index, newIndex, oldIndex, post;
- $.rmClass(this, 'over');
- if (!this.draggable) {
- return;
- }
- el = $('.drag', this.parentNode);
- index = function(el) {
- return slice.call(el.parentNode.children).indexOf(el);
- };
- oldIndex = index(el);
- newIndex = index(this);
- (oldIndex < newIndex ? $.after : $.before)(this, el);
- post = QR.posts.splice(oldIndex, 1)[0];
- QR.posts.splice(newIndex, 0, post);
- return QR.status();
- };
-
- return _Class;
-
- })();
-
- FappeTyme = {
- init: function() {
- var el, k, lc, len1, ref, ref1, type;
- if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread'))) {
- return;
- }
- this.nodes = {};
- this.enabled = {
- fappe: false,
- werk: Conf['werk']
- };
- ref1 = ["Fappe", "Werk"];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- type = ref1[k];
- if (!Conf[type + " Tyme"]) {
- continue;
- }
- lc = type.toLowerCase();
- el = UI.checkbox(lc, type + " Tyme", false);
- el.title = type + " Tyme";
- this.nodes[lc] = el.firstElementChild;
- if (Conf[lc]) {
- this.set(lc, true);
- }
- $.on(this.nodes[lc], 'change', this.toggle.bind(this, lc));
- Header.menu.addEntry({
- el: el,
- order: 97
- });
- }
- if (Conf['Werk Tyme']) {
- $.sync('werk', this.set.bind(this, 'werk'));
- }
- Post.callbacks.push({
- name: 'Fappe Tyme',
- cb: this.node
- });
- return CatalogThread.callbacks.push({
- name: 'Werk Tyme',
- cb: this.catalogNode
- });
- },
- node: function() {
- return this.nodes.root.classList.toggle('noFile', !this.file);
- },
- catalogNode: function() {
- var file, filename;
- file = this.thread.OP.file;
- if (!file) {
- return;
- }
- filename = $.el('div', {
- textContent: file.name,
- className: 'werkTyme-filename'
- });
- return $.add(this.nodes.thumb.parentNode, filename);
- },
- set: function(type, enabled) {
- this.enabled[type] = this.nodes[type].checked = enabled;
- return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme");
- },
- toggle: function(type) {
- this.set(type, !this.enabled[type]);
- if (type === 'werk') {
- return $.cb.checked.call(this.nodes[type]);
- }
- }
- };
-
- Gallery = {
- init: function() {
- var el, ref;
- if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
- return;
- }
- this.delay = Conf['Slide Delay'];
- el = $.el('a', {
- href: 'javascript:;',
- id: 'appchan-gal',
- title: 'Gallery',
- className: 'fa fa-picture-o',
- textContent: 'Gallery'
- });
- $.on(el, 'click', this.cb.toggle);
- Header.addShortcut(el);
- return Post.callbacks.push({
- name: 'Gallery',
- cb: this.node
- });
- },
- node: function() {
- var ref;
- if (!((ref = this.file) != null ? ref.thumb : void 0)) {
- return;
- }
- if (Gallery.nodes) {
- Gallery.generateThumb(this);
- Gallery.nodes.total.textContent = Gallery.images.length;
- }
- if (!Conf['Image Expansion']) {
- return $.on(this.file.thumb.parentNode, 'click', Gallery.cb.image);
- }
- },
- build: function(image) {
- var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, ref3, thumb, value;
- cb = Gallery.cb;
- if (Conf['Fullscreen Gallery']) {
- $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
- return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
- });
- if (typeof doc.mozRequestFullScreen === "function") {
- doc.mozRequestFullScreen();
- }
- if (typeof doc.webkitRequestFullScreen === "function") {
- doc.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
- }
- }
- Gallery.images = [];
- nodes = Gallery.nodes = {};
- Gallery.fullIDs = {};
- Gallery.slideshow = false;
- nodes.el = dialog = $.el('div', {
- id: 'a-gallery'
- });
- $.extend(dialog, {
- innerHTML: "
"
- });
- ref = {
- buttons: '.gal-buttons',
- frame: '.gal-image',
- name: '.gal-name',
- count: '.count',
- total: '.total',
- thumbs: '.gal-thumbnails',
- next: '.gal-image a',
- current: '.gal-image img'
- };
- for (key in ref) {
- value = ref[key];
- nodes[key] = $(value, dialog);
- }
- menuButton = $('.menu-button', dialog);
- nodes.menu = new UI.Menu('gallery');
- $.on(nodes.frame, 'click', cb.blank);
- if (Conf['Mouse Wheel Volume']) {
- $.on(nodes.frame, 'wheel', Volume.wheel);
- }
- $.on(nodes.next, 'click', cb.click);
- $.on(nodes.name, 'click', ImageCommon.download);
- $.on($('.gal-prev', dialog), 'click', cb.prev);
- $.on($('.gal-next', dialog), 'click', cb.next);
- $.on($('.gal-start', dialog), 'click', cb.start);
- $.on($('.gal-stop', dialog), 'click', cb.stop);
- $.on($('.gal-close', dialog), 'click', cb.close);
- $.on(menuButton, 'click', function(e) {
- return nodes.menu.toggle(e, this, g);
- });
- ref1 = Gallery.menu.createSubEntries();
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- entry = ref1[k];
- entry.order = 0;
- nodes.menu.addEntry(entry);
- }
- $.on(d, 'keydown', cb.keybinds);
- if (Conf['Keybinds']) {
- $.off(d, 'keydown', Keybinds.keydown);
- }
- $.on(window, 'resize', Gallery.cb.setHeight);
- ref2 = $$('.post .file');
- for (q = 0, len2 = ref2.length; q < len2; q++) {
- file = ref2[q];
- post = Get.postFromNode(file);
- if (!((ref3 = post.file) != null ? ref3.thumb : void 0)) {
- continue;
- }
- Gallery.generateThumb(post);
- if (!image && Gallery.fullIDs[post.fullID]) {
- candidate = post.file.thumb.parentNode;
- if (Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0) {
- image = candidate;
- }
- }
- }
- $.addClass(doc, 'gallery-open');
- $.add(d.body, dialog);
- nodes.thumbs.scrollTop = 0;
- nodes.current.parentElement.scrollTop = 0;
- if (image) {
- thumb = $("[href='" + image.href + "']", nodes.thumbs);
- }
- thumb || (thumb = Gallery.images[Gallery.images.length - 1]);
- if (thumb) {
- Gallery.open(thumb);
- }
- doc.style.overflow = 'hidden';
- return nodes.total.textContent = Gallery.images.length;
- },
- generateThumb: function(post) {
- var thumb, thumbImg;
- if (post.isClone || post.isHidden) {
- return;
- }
- if (!(post.file && post.file.thumb && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
- return;
- }
- if (Gallery.fullIDs[post.fullID]) {
- return;
- }
- Gallery.fullIDs[post.fullID] = true;
- thumb = $.el('a', {
- className: 'gal-thumb',
- href: post.file.url,
- target: '_blank',
- title: post.file.name
- });
- thumb.dataset.id = Gallery.images.length;
- thumb.dataset.post = post.fullID;
- thumbImg = post.file.thumb.cloneNode(false);
- thumbImg.style.cssText = '';
- $.add(thumb, thumbImg);
- $.on(thumb, 'click', Gallery.cb.open);
- Gallery.images.push(thumb);
- return $.add(Gallery.nodes.thumbs, thumb);
- },
- load: function(thumb, errorCB) {
- var elType, ext, file;
- ext = thumb.href.match(/\w*$/);
- elType = {
- 'webm': 'video',
- 'pdf': 'iframe'
- }[ext] || 'img';
- file = $.el(elType, {
- title: thumb.title
- });
- $.extend(file.dataset, thumb.dataset);
- $.on(file, 'error', errorCB);
- file.src = thumb.href;
- return file;
- },
- open: function(thumb) {
- var el, file, newID, nodes, oldID, post, ref;
- nodes = Gallery.nodes;
- oldID = +nodes.current.dataset.id;
- newID = +thumb.dataset.id;
- if (el = Gallery.images[oldID]) {
- $.rmClass(el, 'gal-highlight');
- }
- $.addClass(thumb, 'gal-highlight');
- nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
- if (((ref = Gallery.cache) != null ? ref.dataset.id : void 0) === '' + newID) {
- file = Gallery.cache;
- $.off(file, 'error', Gallery.cacheError);
- $.on(file, 'error', Gallery.error);
- } else {
- file = Gallery.load(thumb, Gallery.error);
- }
- $.off(nodes.current, 'error', Gallery.error);
- ImageCommon.pause(nodes.current);
- $.replace(nodes.current, file);
- nodes.current = file;
- if (file.nodeName === 'VIDEO') {
- file.loop = true;
- Volume.setup(file);
- if (Conf['Autoplay']) {
- file.play();
- }
- if (Conf['Show Controls']) {
- ImageCommon.addControls(file);
- }
- }
- doc.classList.toggle('gal-pdf', file.nodeName === 'IFRAME');
- Gallery.cb.setHeight();
- nodes.count.textContent = +thumb.dataset.id + 1;
- nodes.name.download = nodes.name.textContent = thumb.title;
- nodes.name.href = thumb.href;
- nodes.frame.scrollTop = 0;
- nodes.next.focus();
- if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) {
- Gallery.setupTimer();
- } else {
- Gallery.cb.stop();
- }
- if (Conf['Scroll to Post'] && (post = g.posts[file.dataset.post])) {
- Header.scrollTo(post.nodes.root);
- }
- if (isNaN(oldID) || newID === (oldID + 1) % Gallery.images.length) {
- return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError);
- }
- },
- error: function() {
- var ref;
- if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
- return new Notice('error', 'Corrupt or unplayable video', 30);
- }
- if (this.src.split('/')[2] !== 'i.4cdn.org') {
- return;
- }
- return ImageCommon.error(this, g.posts[this.dataset.post], null, (function(_this) {
- return function(url) {
- if (!url) {
- return;
- }
- Gallery.images[_this.dataset.id].href = url;
- if (Gallery.nodes.current === _this) {
- return _this.src = url;
- }
- };
- })(this));
- },
- cacheError: function() {
- return delete Gallery.cache;
- },
- cleanupTimer: function() {
- var current;
- clearTimeout(Gallery.timeoutID);
- current = Gallery.nodes.current;
- $.off(current, 'canplaythrough load', Gallery.startTimer);
- return $.off(current, 'ended', Gallery.cb.next);
- },
- startTimer: function() {
- return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * $.SECOND);
- },
- setupTimer: function() {
- var current, isVideo;
- Gallery.cleanupTimer();
- current = Gallery.nodes.current;
- isVideo = current.nodeName === 'VIDEO';
- if (isVideo) {
- current.play();
- }
- if ((isVideo ? current.readyState >= 4 : current.complete) || current.nodeName === 'IFRAME') {
- return Gallery.startTimer();
- } else {
- return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer);
- }
- },
- checkTimer: function() {
- var current;
- current = Gallery.nodes.current;
- if (current.nodeName === 'VIDEO' && !current.paused) {
- $.on(current, 'ended', Gallery.cb.next);
- return current.loop = false;
- } else {
- return Gallery.cb.next();
- }
- },
- cb: {
- keybinds: function(e) {
- var cb, key;
- if (!(key = Keybinds.keyCode(e))) {
- return;
- }
- cb = (function() {
- switch (key) {
- case Conf['Close']:
- case Conf['Open Gallery']:
- return Gallery.cb.close;
- case 'Right':
- return Gallery.cb.next;
- case 'Enter':
- return Gallery.cb.advance;
- case 'Left':
- case '':
- return Gallery.cb.prev;
- case Conf['Pause']:
- return Gallery.cb.pause;
- case Conf['Slideshow']:
- return Gallery.cb.toggleSlideshow;
- }
- })();
- if (!cb) {
- return;
- }
- e.stopPropagation();
- e.preventDefault();
- return cb();
- },
- open: function(e) {
- if (e) {
- e.preventDefault();
- }
- if (this) {
- return Gallery.open(this);
- }
- },
- image: function(e) {
- e.preventDefault();
- e.stopPropagation();
- return Gallery.build(this);
- },
- prev: function() {
- return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]);
- },
- next: function() {
- return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]);
- },
- click: function(e) {
- if (ImageCommon.onControls(e)) {
- return;
- }
- e.preventDefault();
- return Gallery.cb.advance();
- },
- advance: function() {
- if (!Conf['Autoplay'] && Gallery.nodes.current.paused) {
- return Gallery.nodes.current.play();
- } else {
- return Gallery.cb.next();
- }
- },
- toggle: function() {
- return (Gallery.nodes ? Gallery.cb.close : Gallery.build)();
- },
- blank: function(e) {
- if (e.target === this) {
- return Gallery.cb.close();
- }
- },
- toggleSlideshow: function() {
- return Gallery.cb[Gallery.slideshow ? 'stop' : 'start']();
- },
- pause: function() {
- var current;
- Gallery.cb.stop();
- current = Gallery.nodes.current;
- if (current.nodeName === 'VIDEO') {
- return current[current.paused ? 'play' : 'pause']();
- }
- },
- start: function() {
- $.addClass(Gallery.nodes.buttons, 'gal-playing');
- Gallery.slideshow = true;
- return Gallery.setupTimer();
- },
- stop: function() {
- var current;
- if (!Gallery.slideshow) {
- return;
- }
- Gallery.cleanupTimer();
- current = Gallery.nodes.current;
- if (current.nodeName === 'VIDEO') {
- current.loop = true;
- }
- $.rmClass(Gallery.nodes.buttons, 'gal-playing');
- return Gallery.slideshow = false;
- },
- close: function() {
- $.off(Gallery.nodes.current, 'error', Gallery.error);
- ImageCommon.pause(Gallery.nodes.current);
- $.rm(Gallery.nodes.el);
- $.rmClass(doc, 'gallery-open');
- if (Conf['Fullscreen Gallery']) {
- $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close);
- if (typeof d.mozCancelFullScreen === "function") {
- d.mozCancelFullScreen();
- }
- if (typeof d.webkitExitFullscreen === "function") {
- d.webkitExitFullscreen();
- }
- }
- delete Gallery.nodes;
- delete Gallery.fullIDs;
- doc.style.overflow = '';
- $.off(d, 'keydown', Gallery.cb.keybinds);
- if (Conf['Keybinds']) {
- $.on(d, 'keydown', Keybinds.keydown);
- }
- $.off(window, 'resize', Gallery.cb.setHeight);
- return clearTimeout(Gallery.timeoutID);
- },
- setFitness: function() {
- return (this.checked ? $.addClass : $.rmClass)(doc, "gal-" + (this.name.toLowerCase().replace(/\s+/g, '-')));
- },
- setHeight: $.debounce(100, function() {
- var current, dim, frame, height, minHeight, ref, ref1, ref2, style, width;
- ref = Gallery.nodes, current = ref.current, frame = ref.frame;
- style = current.style;
- if (Conf['Stretch to Fit'] && (dim = (ref1 = g.posts[current.dataset.post]) != null ? ref1.file.dimensions : void 0)) {
- ref2 = dim.split('x'), width = ref2[0], height = ref2[1];
- minHeight = Math.min(doc.clientHeight - 25, height / width * frame.clientWidth);
- style.minHeight = minHeight + 'px';
- return style.minWidth = (width / height * minHeight) + 'px';
- } else {
- return style.minHeight = style.minWidth = null;
- }
- }),
- setDelay: function() {
- return Gallery.delay = +this.value;
- }
- },
- menu: {
- init: function() {
- var el;
- if (!Gallery.enabled) {
- return;
- }
- el = $.el('span', {
- textContent: 'Gallery',
- className: 'gallery-link'
- });
- return Header.menu.addEntry({
- el: el,
- order: 105,
- subEntries: Gallery.menu.createSubEntries()
- });
- },
- createSubEntry: function(name) {
- var input, label;
- label = UI.checkbox(name, name);
- input = label.firstElementChild;
- if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height') {
- $.on(input, 'change', Gallery.cb.setFitness);
- }
- $.event('change', null, input);
- $.on(input, 'change', $.cb.checked);
- if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height' || name === 'Stretch to Fit') {
- $.on(input, 'change', Gallery.cb.setHeight);
- }
- return {
- el: label
- };
- },
- createSubEntries: function() {
- var delayInput, delayLabel, item, subEntries;
- subEntries = (function() {
- var k, len1, ref, results;
- ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'];
- results = [];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- item = ref[k];
- results.push(Gallery.menu.createSubEntry(item));
- }
- return results;
- })();
- delayLabel = $.el('label', {
- innerHTML: "Slide Delay: "
- });
- delayInput = delayLabel.firstElementChild;
- delayInput.value = Gallery.delay;
- $.on(delayInput, 'change', Gallery.cb.setDelay);
- $.on(delayInput, 'change', $.cb.value);
- subEntries.push({
- el: delayLabel
- });
- return subEntries;
- }
- }
- };
-
- ImageCommon = {
- pause: function(video) {
- if (video.nodeName !== 'VIDEO') {
- return;
- }
- video.pause();
- $.off(video, 'volumechange', Volume.change);
- return video.muted = true;
- },
- rewind: function(el) {
- if (el.nodeName === 'VIDEO') {
- if (el.readyState >= el.HAVE_METADATA) {
- return el.currentTime = 0;
- }
- } else if (/\.gif$/.test(el.src)) {
- return $.queueTask(function() {
- return el.src = el.src;
- });
- }
- },
- pushCache: function(el) {
- ImageCommon.cache = el;
- return $.on(el, 'error', ImageCommon.cacheError);
- },
- popCache: function() {
- var el;
- el = ImageCommon.cache;
- $.off(el, 'error', ImageCommon.cacheError);
- delete ImageCommon.cache;
- return el;
- },
- cacheError: function() {
- if (ImageCommon.cache === this) {
- return delete ImageCommon.cache;
- }
- },
- decodeError: function(file, post) {
- var message, ref;
- if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
- return false;
- }
- if (!(message = $('.warning', post.file.thumb.parentNode))) {
- message = $.el('div', {
- className: 'warning'
- });
- $.after(post.file.thumb, message);
- }
- message.textContent = 'Error: Corrupt or unplayable video';
- return true;
- },
- error: function(file, post, delay, cb) {
- var URL, redirect, src, timeoutID;
- src = post.file.url.split('/');
- URL = Redirect.to('file', {
- boardID: post.board.ID,
- filename: src[src.length - 1]
- });
- if (!(Conf['404 Redirect'] && URL && Redirect.securityCheck(URL))) {
- URL = null;
- }
- if ((post.isDead || post.file.isDead) && file.src.split('/')[2] === 'i.4cdn.org') {
- return cb(URL);
- }
- if (delay != null) {
- timeoutID = setTimeout((function() {
- return cb(URL);
- }), delay);
- }
- if (post.isDead || post.file.isDead) {
- return;
- }
- redirect = function() {
- if (file.src.split('/')[2] === 'i.4cdn.org') {
- if (delay != null) {
- clearTimeout(timeoutID);
- }
- return cb(URL);
- }
- };
- return $.ajax("//a.4cdn.org/" + post.board + "/thread/" + post.thread + ".json", {
- onload: function() {
- var k, len1, postObj, ref;
- if (this.status === 404) {
- post.kill();
- }
- if (this.status !== 200) {
- return redirect();
- }
- ref = this.response.posts;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- postObj = ref[k];
- if (postObj.no === post.ID) {
- break;
- }
- }
- if (postObj.no !== post.ID) {
- post.kill();
- return redirect();
- } else if (postObj.filedeleted) {
- post.kill(true);
- return redirect();
- } else {
- return URL = post.file.url;
- }
- }
- });
- },
- addControls: function(video) {
- var handler;
- handler = function() {
- var t;
- $.off(video, 'mouseover', handler);
- t = new Date().getTime();
- return $.asap((function() {
- return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000;
- }), function() {
- return video.controls = true;
- });
- };
- return $.on(video, 'mouseover', handler);
- },
- onControls: function(e) {
- return (Conf['Show Controls'] && Conf['Click Passthrough'] && e.target.nodeName === 'VIDEO') || (e.target.controls && e.target.getBoundingClientRect().bottom - e.clientY < 35);
- },
- download: function(e) {
- if (this.protocol === 'blob:') {
- return true;
- }
- e.preventDefault();
- return CrossOrigin.file(this.href, (function(_this) {
- return function(blob) {
- if (blob) {
- _this.href = URL.createObjectURL(blob);
- return _this.click();
- } else {
- return new Notice('error', "Could not download " + _this.href, 30);
- }
- };
- })(this));
- }
- };
-
- ImageExpand = {
- init: function() {
- var ref;
- if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
- return;
- }
- this.EAI = $.el('a', {
- className: 'expand-all-shortcut fa fa-expand',
- textContent: 'EAI',
- title: 'Expand All Images',
- href: 'javascript:;'
- });
- $.on(this.EAI, 'click', this.cb.toggleAll);
- Header.addShortcut(this.EAI, 3);
- $.on(d, 'scroll visibilitychange', this.cb.playVideos);
- this.videoControls = $.el('span', {
- className: 'video-controls'
- });
- $.extend(this.videoControls, {
- innerHTML: "Â contract "
- });
- return Post.callbacks.push({
- name: 'Image Expansion',
- cb: this.node
- });
- },
- node: function() {
- var ref;
- if (!(this.file && (this.file.isImage || this.file.isVideo))) {
- return;
- }
- $.on(this.file.thumb.parentNode, 'click', ImageExpand.cb.toggle);
- if (this.isClone) {
- if (this.file.isExpanding) {
- ImageExpand.contract(this);
- return ImageExpand.expand(this);
- } else if (this.file.isExpanded && this.file.isVideo) {
- Volume.setup(this.file.fullImage);
- ImageExpand.setupVideoCB(this);
- return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
- }
- } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) {
- return ImageExpand.expand(this);
- }
- },
- cb: {
- toggle: function(e) {
- var file, post, ref;
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- post = Get.postFromNode(this);
- file = post.file;
- if (file.isExpanded && ImageCommon.onControls(e)) {
- return;
- }
- e.preventDefault();
- if (!Conf['Autoplay'] && ((ref = file.fullImage) != null ? ref.paused : void 0)) {
- return file.fullImage.play();
- } else {
- return ImageExpand.toggle(post);
- }
- },
- toggleAll: function() {
- var func, toggle;
- $.event('CloseMenu');
- toggle = function(post) {
- var file;
- file = post.file;
- if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
- return;
- }
- if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || !Conf['Expand videos'] && file.isVideo || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
- return;
- }
- return $.queueTask(func, post);
- };
- if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) {
- ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress';
- ImageExpand.EAI.title = 'Contract All Images';
- func = ImageExpand.expand;
- } else {
- ImageExpand.EAI.className = 'expand-all-shortcut fa fa-expand';
- ImageExpand.EAI.title = 'Expand All Images';
- func = ImageExpand.contract;
- }
- return g.posts.forEach(function(post) {
- var k, len1, ref;
- ref = [post].concat(slice.call(post.clones));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post = ref[k];
- toggle(post);
- }
- });
- },
- playVideos: function() {
- return g.posts.forEach(function(post) {
- var file, k, len1, ref, video, visible;
- ref = [post].concat(slice.call(post.clones));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post = ref[k];
- file = post.file;
- if (!(file && file.isVideo && file.isExpanded)) {
- continue;
- }
- video = file.fullImage;
- visible = ($.hasAudio(video) && !video.muted) || Header.isNodeVisible(video);
- if (visible && file.wasPlaying) {
- delete file.wasPlaying;
- video.play();
- } else if (!visible && !video.paused) {
- file.wasPlaying = true;
- video.pause();
- }
- }
- });
- },
- setFitness: function() {
- return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\s+/g, '-'));
- }
- },
- toggle: function(post) {
- var next;
- if (!(post.file.isExpanding || post.file.isExpanded)) {
- post.file.scrollIntoView = Conf['Scroll into view'];
- ImageExpand.expand(post);
- return;
- }
- ImageExpand.contract(post);
- if (Conf['Advance on contract']) {
- next = post.nodes.root;
- while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
- if (!($('.stub', next) || next.offsetHeight === 0)) {
- break;
- }
- }
- if (next) {
- return Header.scrollTo(next);
- }
- }
- },
- contract: function(post) {
- var bottom, cb, el, eventName, file, k, len1, oldHeight, ref, ref1, scrollY, top, x;
- file = post.file;
- if (el = file.fullImage) {
- top = Header.getTopOf(el);
- bottom = top + el.getBoundingClientRect().height;
- oldHeight = d.body.clientHeight;
- scrollY = window.scrollY;
- }
- $.rmClass(post.nodes.root, 'expanded-image');
- $.rmClass(file.thumb, 'expanding');
- $.rm(file.videoControls);
- file.thumb.parentNode.href = file.url;
- file.thumb.parentNode.target = '_blank';
- ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- x = ref[k];
- delete file[x];
- }
- if (!el) {
- return;
- }
- if (doc.contains(el)) {
- if (bottom <= 0) {
- window.scroll(0, scrollY + d.body.clientHeight - oldHeight);
- } else {
- Header.scrollToIfNeeded(post.nodes.root);
- }
- if (window.scrollX > 0) {
- window.scroll(0, window.scrollY);
- }
- }
- $.off(el, 'error', ImageExpand.error);
- ImageCommon.pushCache(el);
- if (file.isVideo) {
- ImageCommon.pause(el);
- ref1 = ImageExpand.videoCB;
- for (eventName in ref1) {
- cb = ref1[eventName];
- $.off(el, eventName, cb);
- }
- }
- if (Conf['Restart when Opened']) {
- ImageCommon.rewind(file.thumb);
- }
- delete file.fullImage;
- return $.queueTask(function() {
- if (file.isExpanding || file.isExpanded) {
- return;
- }
- $.rmClass(el, 'full-image');
- if (el.id) {
- return;
- }
- return $.rm(el);
- });
- },
- expand: function(post, src) {
- var el, file, isVideo, ref, thumb;
- file = post.file;
- thumb = file.thumb, isVideo = file.isVideo;
- if (post.isHidden || file.isExpanding || file.isExpanded) {
- return;
- }
- $.addClass(thumb, 'expanding');
- file.isExpanding = true;
- if (file.fullImage) {
- el = file.fullImage;
- } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
- el = file.fullImage = ImageCommon.popCache();
- $.on(el, 'error', ImageExpand.error);
- if (Conf['Restart when Opened'] && el.id !== 'ihover') {
- ImageCommon.rewind(el);
- }
- el.removeAttribute('id');
- } else {
- el = file.fullImage = $.el((isVideo ? 'video' : 'img'));
- el.dataset.fullID = post.fullID;
- $.on(el, 'error', ImageExpand.error);
- el.src = src || file.url;
- }
- el.className = 'full-image';
- $.after(thumb, el);
- if (isVideo) {
- if (Conf['Show Controls'] && Conf['Click Passthrough'] && !file.videoControls) {
- file.videoControls = ImageExpand.videoControls.cloneNode(true);
- $.add(file.text, file.videoControls);
- }
- thumb.parentNode.removeAttribute('href');
- thumb.parentNode.removeAttribute('target');
- el.loop = true;
- Volume.setup(el);
- ImageExpand.setupVideoCB(post);
- }
- if (!isVideo) {
- return $.asap((function() {
- return el.naturalHeight;
- }), function() {
- return ImageExpand.completeExpand(post);
- });
- } else if (el.readyState >= el.HAVE_METADATA) {
- return ImageExpand.completeExpand(post);
- } else {
- return $.on(el, 'loadedmetadata', function() {
- return ImageExpand.completeExpand(post);
- });
- }
- },
- completeExpand: function(post) {
- var bottom, file, imageBottom, oldHeight, scrollY;
- file = post.file;
- if (!file.isExpanding) {
- return;
- }
- bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height;
- oldHeight = d.body.clientHeight;
- scrollY = window.scrollY;
- $.addClass(post.nodes.root, 'expanded-image');
- $.rmClass(file.thumb, 'expanding');
- file.isExpanded = true;
- delete file.isExpanding;
- if (doc.contains(post.nodes.root) && bottom <= 0) {
- window.scroll(window.scrollX, scrollY + d.body.clientHeight - oldHeight);
- }
- if (file.scrollIntoView) {
- delete file.scrollIntoView;
- imageBottom = Math.min(doc.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header.getBottomOf(file.fullImage));
- if (imageBottom < 0) {
- window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage)));
- }
- }
- if (file.isVideo) {
- return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']);
- }
- },
- setupVideo: function(post, playing, controls) {
- var fullImage;
- fullImage = post.file.fullImage;
- if (!playing) {
- fullImage.controls = controls;
- return;
- }
- fullImage.controls = false;
- $.asap((function() {
- return doc.contains(fullImage);
- }), function() {
- if (!d.hidden && Header.isNodeVisible(fullImage)) {
- return fullImage.play();
- } else {
- return post.file.wasPlaying = true;
- }
- });
- if (controls) {
- return ImageCommon.addControls(fullImage);
- }
- },
- videoCB: (function() {
- var mousedown;
- mousedown = false;
- return {
- mouseover: function() {
- return mousedown = false;
- },
- mousedown: function(e) {
- if (e.button === 0) {
- return mousedown = true;
- }
- },
- mouseup: function(e) {
- if (e.button === 0) {
- return mousedown = false;
- }
- },
- mouseout: function(e) {
- if (mousedown && e.clientX <= this.getBoundingClientRect().left) {
- return ImageExpand.toggle(Get.postFromNode(this));
- }
- }
- };
- })(),
- setupVideoCB: function(post) {
- var cb, eventName, ref;
- ref = ImageExpand.videoCB;
- for (eventName in ref) {
- cb = ref[eventName];
- $.on(post.file.fullImage, eventName, cb);
- }
- if (post.file.videoControls) {
- return $.on(post.file.videoControls.firstElementChild, 'click', function() {
- return ImageExpand.toggle(post);
- });
- }
- },
- error: function() {
- var post;
- post = Get.postFromNode(this);
- $.rm(this);
- delete post.file.fullImage;
- if (!(post.file.isExpanding || post.file.isExpanded)) {
- return;
- }
- if (ImageCommon.decodeError(this, post)) {
- return ImageExpand.contract(post);
- }
- if (this.src.split('/')[2] !== 'i.4cdn.org') {
- return ImageExpand.contract(post);
- }
- return ImageCommon.error(this, post, 10 * $.SECOND, function(URL) {
- if (post.file.isExpanding || post.file.isExpanded) {
- ImageExpand.contract(post);
- if (URL) {
- return ImageExpand.expand(post, URL);
- }
- }
- });
- },
- menu: {
- init: function() {
- var conf, createSubEntry, el, name, ref, subEntries;
- if (!ImageExpand.enabled) {
- return;
- }
- el = $.el('span', {
- textContent: 'Image Expansion',
- className: 'image-expansion-link'
- });
- createSubEntry = ImageExpand.menu.createSubEntry;
- subEntries = [];
- ref = Config.imageExpansion;
- for (name in ref) {
- conf = ref[name];
- subEntries.push(createSubEntry(name, conf[1]));
- }
- return Header.menu.addEntry({
- el: el,
- order: 105,
- subEntries: subEntries
- });
- },
- createSubEntry: function(name, desc) {
- var input, label;
- label = UI.checkbox(name, name);
- label.title = desc;
- input = label.firstElementChild;
- if (name === 'Fit width' || name === 'Fit height') {
- $.on(input, 'change', ImageExpand.cb.setFitness);
- }
- $.event('change', null, input);
- $.on(input, 'change', $.cb.checked);
- return {
- el: label
- };
- }
- }
- };
-
- ImageHover = {
- init: function() {
- var ref;
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- if (Conf['Image Hover']) {
- Post.callbacks.push({
- name: 'Image Hover',
- cb: this.node
- });
- }
- if (Conf['Image Hover in Catalog']) {
- return CatalogThread.callbacks.push({
- name: 'Image Hover',
- cb: this.catalogNode
- });
- }
- },
- node: function() {
- if (!(this.file && (this.file.isImage || this.file.isVideo))) {
- return;
- }
- return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover(this));
- },
- catalogNode: function() {
- var file;
- file = this.thread.OP.file;
- if (!(file && (file.isImage || file.isVideo))) {
- return;
- }
- return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover(this.thread.OP));
- },
- mouseover: function(post) {
- return function(e) {
- var el, error, file, height, isVideo, left, maxHeight, maxWidth, ref, ref1, ref2, right, scale, width, x;
- if (!doc.contains(this)) {
- return;
- }
- file = post.file;
- isVideo = file.isVideo;
- if (file.isExpanding || file.isExpanded) {
- return;
- }
- error = ImageHover.error(post);
- if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
- el = ImageCommon.popCache();
- $.on(el, 'error', error);
- } else {
- el = $.el((isVideo ? 'video' : 'img'));
- el.dataset.fullID = post.fullID;
- $.on(el, 'error', error);
- el.src = file.url;
- }
- if (Conf['Restart when Opened']) {
- ImageCommon.rewind(el);
- ImageCommon.rewind(this);
- }
- el.id = 'ihover';
- $.add(Header.hover, el);
- if (isVideo) {
- el.loop = true;
- el.controls = false;
- Volume.setup(el);
- if (Conf['Autoplay']) {
- el.play();
- }
- }
- ref1 = (function() {
- var k, len1, ref1, results;
- ref1 = file.dimensions.split('x');
- results = [];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- x = ref1[k];
- results.push(+x);
- }
- return results;
- })(), width = ref1[0], height = ref1[1];
- ref2 = this.getBoundingClientRect(), left = ref2.left, right = ref2.right;
- maxWidth = Math.max(left, doc.clientWidth - right);
- maxHeight = doc.clientHeight - UI.hover.padding;
- scale = Math.min(1, maxWidth / width, maxHeight / height);
- el.style.maxWidth = (scale * width) + "px";
- el.style.maxHeight = (scale * height) + "px";
- return UI.hover({
- root: this,
- el: el,
- latestEvent: e,
- endEvents: 'mouseout click',
- height: scale * height,
- noRemove: true,
- cb: function() {
- $.off(el, 'error', error);
- ImageCommon.pushCache(el);
- ImageCommon.pause(el);
- $.rm(el);
- return el.removeAttribute('style');
- }
- });
- };
- },
- error: function(post) {
- return function() {
- if (ImageCommon.decodeError(this, post)) {
- return;
- }
- return ImageCommon.error(this, post, 3 * $.SECOND, (function(_this) {
- return function(URL) {
- if (URL) {
- return _this.src = URL + (_this.src === URL ? '?' + Date.now() : '');
- } else {
- return $.rm(_this);
- }
- };
- })(this));
- };
- }
- };
-
- ImageLoader = {
- init: function() {
- var prefetch, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
- return;
- }
- if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
- return;
- }
- Post.callbacks.push({
- name: 'Image Replace',
- cb: this.node
- });
- $.on(d, 'PostsInserted', function() {
- return g.posts.forEach(ImageLoader.prefetch);
- });
- if (Conf['Replace WEBM']) {
- $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
- }
- if (!Conf['Image Prefetching']) {
- return;
- }
- prefetch = $.el('label', {
- innerHTML: " Prefetch Images"
- });
- this.el = prefetch.firstElementChild;
- $.on(this.el, 'change', this.toggle);
- return Header.menu.addEntry({
- el: prefetch,
- order: 98
- });
- },
- node: function() {
- if (this.isClone || !this.file) {
- return;
- }
- if (Conf['Replace WEBM'] && this.file.isVideo) {
- ImageLoader.replaceVideo(this);
- }
- return ImageLoader.prefetch(this);
- },
- replaceVideo: function(post) {
- var attr, file, k, len1, ref, thumb, video;
- file = post.file;
- thumb = file.thumb;
- video = $.el('video', {
- preload: 'none',
- loop: true,
- muted: true,
- poster: thumb.src || thumb.dataset.src,
- textContent: thumb.alt,
- className: thumb.className
- });
- video.setAttribute('muted', 'muted');
- video.dataset.md5 = thumb.dataset.md5;
- ref = ['height', 'width', 'maxHeight', 'maxWidth'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- attr = ref[k];
- video.style[attr] = thumb.style[attr];
- }
- video.src = file.url;
- $.replace(thumb, video);
- file.thumb = video;
- return file.videoThumb = true;
- },
- prefetch: function(post) {
- var clone, el, file, isImage, isVideo, k, len1, match, ref, replace, thumb, type, url;
- file = post.file;
- if (!file) {
- return;
- }
- isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, url = file.url;
- if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) {
- return;
- }
- type = (match = url.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
- replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src);
- if (!(replace || Conf['prefetch'])) {
- return;
- }
- if (![post].concat(slice.call(post.clones)).some(function(clone) {
- return doc.contains(clone.nodes.root);
- })) {
- return;
- }
- file.isPrefetched = true;
- if (file.videoThumb) {
- ref = post.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- clone = ref[k];
- clone.file.thumb.preload = 'auto';
- }
- thumb.preload = 'auto';
- if ($.engine === 'gecko') {
- $.on(thumb, 'loadeddata', function() {
- return this.removeAttribute('poster');
- });
- }
- return;
- }
- el = $.el(isImage ? 'img' : 'video');
- if (replace && isImage) {
- $.on(el, 'load', function() {
- var len2, q, ref1;
- ref1 = post.clones;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- clone = ref1[q];
- clone.file.thumb.src = url;
- }
- thumb.src = url;
- return thumb.removeAttribute('data-src');
- });
- }
- return el.src = url;
- },
- toggle: function() {
- if (Conf['prefetch'] = this.checked) {
- g.posts.forEach(ImageLoader.prefetch);
- }
- },
- playVideos: function() {
- var qpClone, ref;
- qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0;
- return g.posts.forEach(function(post) {
- var k, len1, ref1, ref2, thumb;
- ref1 = [post].concat(slice.call(post.clones));
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- post = ref1[k];
- if (!((ref2 = post.file) != null ? ref2.videoThumb : void 0)) {
- continue;
- }
- thumb = post.file.thumb;
- if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) {
- thumb.play();
- } else {
- thumb.pause();
- }
- }
- });
- }
- };
-
- Metadata = {
- init: function() {
- var ref;
- if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
- return;
- }
- return Post.callbacks.push({
- name: 'WEBM Metadata',
- cb: this.node
- });
- },
- node: function() {
- var el;
- if (!(this.file && /webm$/i.test(this.file.url))) {
- return;
- }
- if (this.isClone) {
- el = $('.webm-title', this.file.text);
- } else {
- el = $.el('span', {
- className: 'webm-title'
- });
- $.extend(el, {
- innerHTML: " "
- });
- $.add(this.file.text, [$.tn('\u00A0'), el]);
- }
- if (el.children.length === 1) {
- return $.one(el.lastElementChild, 'mouseover focus', Metadata.load);
- }
- },
- load: function() {
- $.rmClass(this.parentNode, 'error');
- $.addClass(this.parentNode, 'loading');
- return CrossOrigin.binary(Get.postFromNode(this).file.url, (function(_this) {
- return function(data) {
- var output, title;
- $.rmClass(_this.parentNode, 'loading');
- if (data != null) {
- title = Metadata.parse(data);
- output = $.el('span', {
- textContent: title || ''
- });
- if (title == null) {
- $.addClass(_this.parentNode, 'not-found');
- }
- $.before(_this, output);
- _this.parentNode.tabIndex = 0;
- if (d.activeElement === _this) {
- _this.parentNode.focus();
- }
- return _this.tabIndex = -1;
- } else {
- $.addClass(_this.parentNode, 'error');
- return $.one(_this, 'click', Metadata.load);
- }
- };
- })(this), {
- Range: 'bytes=0-9999'
- });
- },
- parse: function(data) {
- var element, i, readInt, size, title;
- readInt = function() {
- var len, n;
- n = data[i++];
- len = 0;
- while (n < (0x80 >> len)) {
- len++;
- }
- n ^= 0x80 >> len;
- while (len-- && i < data.length) {
- n = (n << 8) ^ data[i++];
- }
- return n;
- };
- i = 0;
- while (i < data.length) {
- element = readInt();
- size = readInt();
- if (element === 0x3BA9) {
- title = '';
- while (size-- && i < data.length) {
- title += String.fromCharCode(data[i++]);
- }
- return decodeURIComponent(escape(title));
- } else if (element !== 0x8538067 && element !== 0x549A966) {
- i += size;
- }
- }
- return null;
- }
- };
-
- RevealSpoilers = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
- return;
- }
- return Post.callbacks.push({
- name: 'Reveal Spoiler Thumbnails',
- cb: this.node
- });
- },
- node: function() {
- var thumb;
- if (!(!this.isClone && this.file && this.file.thumb && this.file.isSpoiler)) {
- return;
- }
- thumb = this.file.thumb;
- thumb.removeAttribute('style');
- thumb.style.maxHeight = thumb.style.maxWidth = this.isReply ? '125px' : '250px';
- if (thumb.src) {
- return thumb.src = this.file.thumbURL;
- } else {
- return thumb.dataset.src = this.file.thumbURL;
- }
- }
- };
-
- Sauce = {
- init: function() {
- var err, k, len1, link, links, ref, ref1;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
- return;
- }
- links = [];
- ref1 = Conf['sauces'].split('\n');
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- link = ref1[k];
- try {
- if (link[0] !== '#') {
- links.push(link.trim());
- }
- } catch (_error) {
- err = _error;
- }
- }
- if (!links.length) {
- return;
- }
- this.links = links;
- this.link = $.el('a', {
- target: '_blank',
- className: 'sauce'
- });
- return Post.callbacks.push({
- name: 'Sauce',
- cb: this.node
- });
- },
- sandbox: function(url) {
- return E.url({
- innerHTML: "[sb] " + E(url) + " "
- });
- },
- rmOrigin: function(e) {
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- $.open(this.href);
- return e.preventDefault();
- },
- createSauceLink: function(link, post) {
- var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip, url;
- if (!(link = link.trim())) {
- return null;
- }
- parts = {};
- ref = link.split(/;(?=(?:text|boards|types|sandbox):?)/);
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- part = ref[i];
- if (i === 0) {
- parts['url'] = part;
- } else {
- m = part.match(/^(\w*):?(.*)$/);
- parts[m[1]] = m[2];
- }
- }
- parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
- ext = post.file.url.match(/[^.]*$/)[0];
- skip = false;
- for (key in parts) {
- parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi)/g, function(_, parameter) {
- var type;
- type = Sauce.formatters[parameter](post, ext);
- if (type == null) {
- skip = true;
- return '';
- }
- if (key === 'url' && (parameter !== '%' && parameter !== 'semi')) {
- if (/^javascript:/i.test(parts['url'])) {
- type = JSON.stringify(type);
- }
- type = encodeURIComponent(type);
- }
- return type;
- });
- }
- if (skip) {
- return null;
- }
- if (!(!parts['boards'] || (ref2 = post.board.ID, indexOf.call(parts['boards'].split(','), ref2) >= 0))) {
- return null;
- }
- if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
- return null;
- }
- url = parts['url'];
- if (parts['sandbox'] != null) {
- url = Sauce.sandbox(url);
- }
- a = Sauce.link.cloneNode(true);
- a.href = url;
- a.textContent = parts['text'];
- if (/^javascript:/i.test(parts['url'])) {
- a.removeAttribute('target');
- }
- if (parts['sandbox'] != null) {
- $.on(a, 'click', Sauce.rmOrigin);
- }
- return a;
- },
- node: function() {
- var k, len1, link, node, nodes, ref;
- if (this.isClone || !this.file) {
- return;
- }
- nodes = [];
- ref = Sauce.links;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- if (node = Sauce.createSauceLink(link, this)) {
- nodes.push($.tn('\u00A0'), node);
- }
- }
- return $.add(this.file.text, nodes);
- },
- formatters: {
- TURL: function(post) {
- return post.file.thumbURL;
- },
- URL: function(post) {
- return post.file.url;
- },
- IMG: function(post, ext) {
- if (ext === 'gif' || ext === 'jpg' || ext === 'png') {
- return post.file.url;
- } else {
- return post.file.thumbURL;
- }
- },
- MD5: function(post) {
- return post.file.MD5;
- },
- sMD5: function(post) {
- var ref;
- return (ref = post.file.MD5) != null ? ref.replace(/[+\/=]/g, function(c) {
- return {
- '+': '-',
- '/': '_',
- '=': ''
- }[c];
- }) : void 0;
- },
- hMD5: function(post) {
- if (post.file.MD5) {
- return ((function() {
- var k, len1, ref, results;
- ref = atob(post.file.MD5);
- results = [];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- c = ref[k];
- results.push(("0" + (c.charCodeAt(0).toString(16))).slice(-2));
- }
- return results;
- })()).join('');
- }
- },
- board: function(post) {
- return post.board.ID;
- },
- name: function(post) {
- return post.file.name;
- },
- '%': function() {
- return '%';
- },
- semi: function() {
- return ';';
- }
- }
- };
-
- Volume = {
- init: function() {
- var ref, ref1, unmuteEntry, volumeEntry;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
- return;
- }
- $.sync('Allow Sound', function(x) {
- var ref1;
- Conf['Allow Sound'] = x;
- return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0;
- });
- $.sync('Default Volume', function(x) {
- var ref1;
- Conf['Default Volume'] = x;
- return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0;
- });
- if (Conf['Mouse Wheel Volume']) {
- Post.callbacks.push({
- name: 'Mouse Wheel Volume',
- cb: this.node
- });
- }
- if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg') {
- return;
- }
- if (Conf['Mouse Wheel Volume']) {
- CatalogThread.callbacks.push({
- name: 'Mouse Wheel Volume',
- cb: this.catalogNode
- });
- }
- unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound');
- unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1];
- volumeEntry = $.el('label', {
- title: 'Default volume for videos.'
- });
- $.extend(volumeEntry, {
- innerHTML: " Volume"
- });
- this.inputs = {
- unmute: unmuteEntry.firstElementChild,
- volume: volumeEntry.firstElementChild
- };
- $.on(this.inputs.unmute, 'change', $.cb.checked);
- $.on(this.inputs.volume, 'change', $.cb.value);
- Header.menu.addEntry({
- el: unmuteEntry,
- order: 200
- });
- return Header.menu.addEntry({
- el: volumeEntry,
- order: 201
- });
- },
- setup: function(video) {
- video.muted = !Conf['Allow Sound'];
- video.volume = Conf['Default Volume'];
- return $.on(video, 'volumechange', Volume.change);
- },
- change: function() {
- var items, key, muted, val, volume;
- muted = this.muted, volume = this.volume;
- items = {
- 'Allow Sound': !muted,
- 'Default Volume': volume
- };
- for (key in items) {
- val = items[key];
- if (Conf[key] === val) {
- delete items[key];
- }
- }
- $.set(items);
- $.extend(Conf, items);
- if (Volume.inputs) {
- Volume.inputs.unmute.checked = !muted;
- return Volume.inputs.volume.value = volume;
- }
- },
- node: function() {
- var ref, ref1;
- if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) {
- return;
- }
- $.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover));
- return $.on($('a', this.file.text), 'wheel', Volume.wheel.bind(this.file.thumb.parentNode));
- },
- catalogNode: function() {
- var file;
- file = this.thread.OP.file;
- if (!(file != null ? file.isVideo : void 0)) {
- return;
- }
- return $.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header.hover));
- },
- wheel: function(e) {
- var el, volume;
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
- return;
- }
- if (!(el = $('video:not([data-md5])', this))) {
- return;
- }
- if (el.muted || !$.hasAudio(el)) {
- return;
- }
- volume = el.volume + 0.1;
- if (e.deltaY < 0) {
- volume *= 1.1;
- }
- if (e.deltaY > 0) {
- volume /= 1.1;
- }
- el.volume = $.minmax(volume - 0.1, 0, 1);
- return e.preventDefault();
- }
- };
-
- Embedding = {
- init: function() {
- var k, len1, ref, type;
- if (!(Conf['Embedding'] || Conf['Link Title'])) {
- return;
- }
- this.types = {};
- ref = this.ordered_types;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- type = ref[k];
- this.types[type.key] = type;
- }
- if (Conf['Floating Embeds']) {
- this.dialog = UI.dialog('embedding', 'top: 50px; right: 0px;', {
- innerHTML: ""
- });
- this.media = $('#media-embed', this.dialog);
- $.one(d, '4chanXInitFinished', this.ready);
- }
- if (Conf['Link Title']) {
- return $.on(d, '4chanXInitFinished PostsInserted', function() {
- var key, ref1, ref2, service;
- ref1 = Embedding.types;
- for (key in ref1) {
- service = ref1[key];
- if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
- Embedding.flushTitles(service.title);
- }
- }
- });
- }
- },
- events: function(post) {
- var el, i, items;
- if (!Conf['Embedding']) {
- return;
- }
- i = 0;
- items = $$('.embedder', post.nodes.comment);
- while (el = items[i++]) {
- $.on(el, 'click', Embedding.cb.toggle);
- if ($.hasClass(el, 'embedded')) {
- Embedding.cb.toggle.call(el);
- }
- }
- },
- process: function(link, post) {
- var data;
- if (!(Conf['Embedding'] || Conf['Link Title'])) {
- return;
- }
- if ($.x('ancestor::pre', link)) {
- return;
- }
- if (data = Embedding.services(link)) {
- data.post = post;
- if (Conf['Embedding']) {
- Embedding.embed(data);
- }
- if (Conf['Link Title']) {
- return Embedding.title(data);
- }
- }
- },
- services: function(link) {
- var href, k, len1, match, ref, type;
- href = link.href;
- ref = Embedding.ordered_types;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- type = ref[k];
- if (!(match = type.regExp.exec(href))) {
- continue;
- }
- if (type.dummy) {
- return;
- }
- return {
- key: type.key,
- uid: match[1],
- options: match[2],
- link: link
- };
- }
- },
- embed: function(data) {
- var embed, href, key, link, name, options, post, ref, uid, value;
- key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
- href = link.href;
- if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
- return;
- }
- $.addClass(link, key.toLowerCase());
- embed = $.el('a', {
- className: 'embedder',
- href: 'javascript:;',
- textContent: '(embed)'
- });
- ref = {
- key: key,
- uid: uid,
- options: options,
- href: href
- };
- for (name in ref) {
- value = ref[name];
- embed.dataset[name] = value;
- }
- $.on(embed, 'click', Embedding.cb.toggle);
- $.after(link, [$.tn(' '), embed]);
- if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote && key !== 'TwitchTV') {
- return $.asap((function() {
- return doc.contains(embed);
- }), function() {
- return Embedding.cb.toggle.call(embed);
- });
- }
- },
- ready: function() {
- $.addClass(Embedding.dialog, 'empty');
- $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat);
- $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed);
- $.on($('.jump', Embedding.dialog), 'click', function() {
- if (doc.contains(Embedding.lastEmbed)) {
- return Header.scrollTo(Embedding.lastEmbed);
- }
- });
- return $.add(d.body, Embedding.dialog);
- },
- closeFloat: function() {
- delete Embedding.lastEmbed;
- $.addClass(Embedding.dialog, 'empty');
- return $.replace(Embedding.media.firstChild, $.el('div'));
- },
- dragEmbed: function() {
- var style;
- style = Embedding.media.style;
- if (Embedding.dragEmbed.mouseup) {
- $.off(d, 'mouseup', Embedding.dragEmbed);
- Embedding.dragEmbed.mouseup = false;
- style.visibility = '';
- return;
- }
- $.on(d, 'mouseup', Embedding.dragEmbed);
- Embedding.dragEmbed.mouseup = true;
- return style.visibility = 'hidden';
- },
- title: function(data) {
- var key, link, options, post, service, uid;
- key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
- if (!(service = Embedding.types[key].title)) {
- return;
- }
- $.addClass(link, key.toLowerCase());
- if (service.batchSize) {
- (service.queue || (service.queue = [])).push(data);
- if (service.queue.length >= service.batchSize) {
- return Embedding.flushTitles(service);
- }
- } else {
- if (!$.cache(service.api(uid), (function() {
- return Embedding.cb.title(this, data);
- }), {
- responseType: 'json'
- })) {
- return $.extend(link, {
- innerHTML: "[" + E(key) + "] Title Link Blocked (are you using NoScript?)"
- });
- }
- }
- },
- flushTitles: function(service) {
- var cb, data, k, len1, queue;
- queue = service.queue;
- if (!(queue != null ? queue.length : void 0)) {
- return;
- }
- service.queue = [];
- cb = function() {
- var data, k, len1;
- for (k = 0, len1 = queue.length; k < len1; k++) {
- data = queue[k];
- Embedding.cb.title(this, data);
- }
- };
- if (!$.cache(service.api((function() {
- var k, len1, results;
- results = [];
- for (k = 0, len1 = queue.length; k < len1; k++) {
- data = queue[k];
- results.push(data.uid);
- }
- return results;
- })()), cb, {
- responseType: 'json'
- })) {
- for (k = 0, len1 = queue.length; k < len1; k++) {
- data = queue[k];
- $.extend(data.link, {
- innerHTML: "[" + E(data.key) + "] Title Link Blocked (are you using NoScript?)"
- });
- }
- }
- },
- cb: {
- toggle: function(e) {
- var div;
- if (e != null) {
- e.preventDefault();
- }
- if (Conf['Floating Embeds']) {
- if (!(div = Embedding.media.firstChild)) {
- return;
- }
- $.replace(div, Embedding.cb.embed(this));
- Embedding.lastEmbed = Get.postFromNode(this).nodes.root;
- $.rmClass(Embedding.dialog, 'empty');
- return;
- }
- if ($.hasClass(this, "embedded")) {
- $.rm(this.nextElementSibling);
- this.textContent = '(embed)';
- } else {
- $.after(this, Embedding.cb.embed(this));
- this.textContent = '(unembed)';
- }
- return $.toggleClass(this, 'embedded');
- },
- embed: function(a) {
- var container, el, type;
- container = $.el('div');
- $.add(container, el = (type = Embedding.types[a.dataset.key]).el(a));
- el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
- return container;
- },
- title: function(req, data) {
- var base1, k, key, len1, len2, link, link2, options, post, post2, q, ref, ref1, service, status, text, uid;
- key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
- status = req.status;
- service = Embedding.types[key].title;
- text = "[" + key + "] " + ((function() {
- switch (status) {
- case 200:
- case 304:
- return service.text(req.response, uid);
- case 404:
- return "Not Found";
- case 403:
- return "Forbidden or Private";
- default:
- return status + "'d";
- }
- })());
- link.dataset.original = link.textContent;
- link.textContent = text;
- ref = post.clones;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- post2 = ref[k];
- ref1 = $$('a.linkify', post2.nodes.comment);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- link2 = ref1[q];
- if (!(link2.href === link.href)) {
- continue;
- }
- if ((base1 = link2.dataset).original == null) {
- base1.original = link2.textContent;
- }
- link2.textContent = text;
- }
- }
- }
- },
- ordered_types: [
- {
- key: 'audio',
- regExp: /\.(?:mp3|ogg|wav)(?:\?|$)/i,
- style: '',
- el: function(a) {
- return $.el('audio', {
- controls: true,
- preload: 'auto',
- src: a.dataset.href
- });
- }
- }, {
- key: 'Dailymotion',
- regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/,
- el: function(a) {
- var el, options, start;
- options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? "?" + start[1] : '';
- el = $.el('iframe', {
- src: "//www.dailymotion.com/embed/video/" + a.dataset.uid + options
- });
- el.setAttribute("allowfullscreen", "true");
- return el;
- },
- title: {
- api: function(uid) {
- return "https://api.dailymotion.com/video/" + uid;
- },
- text: function(_) {
- return _.title;
- }
- }
- }, {
- key: 'Gist',
- regExp: /^\w+:\/\/gist\.github\.com\/(?:[\w\-]+\/)?(\w+)/,
- el: function(a) {
- var content, el;
- el = $.el('iframe');
- el.setAttribute('sandbox', 'allow-scripts');
- content = {
- innerHTML: "" + E(a.dataset.uid) + " "
- };
- el.src = E.url(content);
- return el;
- },
- title: {
- api: function(uid) {
- return "https://api.github.com/gists/" + uid;
- },
- text: function(arg) {
- var file, files;
- files = arg.files;
- for (file in files) {
- if (files.hasOwnProperty(file)) {
- return file;
- }
- }
- }
- }
- }, {
- key: 'image',
- regExp: /\.(?:gif|png|jpg|jpeg|bmp)(?:\?|$)/i,
- style: '',
- el: function(a) {
- return $.el('div', {
- innerHTML: " "
- });
- }
- }, {
- key: 'InstallGentoo',
- regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,
- el: function(a) {
- return $.el('iframe', {
- src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid
- });
- }
- }, {
- key: 'Twitter',
- regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
- el: function(a) {
- return $.el('iframe', {
- src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
- });
- }
- }, {
- key: 'LiveLeak',
- regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*i=(\w+)/,
- httpOnly: true,
- el: function(a) {
- var el;
- el = $.el('iframe', {
- src: "http://www.liveleak.com/ll_embed?i=" + a.dataset.uid
- });
- el.setAttribute("allowfullscreen", "true");
- return el;
- }
- }, {
- key: 'Pastebin',
- regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
- httpOnly: true,
- el: function(a) {
- var div;
- return div = $.el('iframe', {
- src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid
- });
- }
- }, {
- key: 'Gfycat',
- regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
- el: function(a) {
- var div;
- return div = $.el('iframe', {
- src: "//gfycat.com/iframe/" + a.dataset.uid
- });
- }
- }, {
- key: 'SoundCloud',
- regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/,
- style: 'border: 0; width: 500px; height: 400px;',
- el: function(a) {
- return $.el('iframe', {
- src: "https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(a.dataset.uid))
- });
- },
- title: {
- api: function(uid) {
- return "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(uid));
- },
- text: function(_) {
- return _.title;
- }
- }
- }, {
- key: 'StrawPoll',
- regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
- style: 'border: 0; width: 600px; height: 406px;',
- el: function(a) {
- return $.el('iframe', {
- src: "//strawpoll.me/embed_1/" + a.dataset.uid
- });
- }
- }, {
- key: 'TwitchTV',
- regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/(\w[^#\&\?]*)/,
- style: "border: none; width: 620px; height: 378px;",
- el: function(a) {
- var _, channel, flashvars, id, idprefix, k, len1, obj, part, ref, result, seconds, start, type;
- if (result = /(\w+)\/([bcv])\/(\d+)/i.exec(a.dataset.uid)) {
- _ = result[0], channel = result[1], type = result[2], id = result[3];
- idprefix = type === 'b' ? 'a' : type;
- flashvars = "channel=" + channel + "&start_volume=25&auto_play=false&videoId=" + idprefix + id;
- if (start = a.dataset.href.match(/\bt=(\w+)/)) {
- seconds = 0;
- ref = start[1].match(/\d+[hms]/g);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- part = ref[k];
- seconds += +part.slice(0, -1) * {
- 'h': 3600,
- 'm': 60,
- 's': 1
- }[part.slice(-1)];
- }
- flashvars += "&initial_time=" + seconds;
- }
- } else {
- channel = (/(\w+)/.exec(a.dataset.uid))[0];
- flashvars = "channel=" + channel + "&start_volume=25&auto_play=false";
- }
- obj = $.el('object', {
- data: '//www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf'
- });
- $.extend(obj, {
- innerHTML: " "
- });
- obj.children[1].value = flashvars;
- return obj;
- }
- }, {
- key: 'Vocaroo',
- regExp: /^\w+:\/\/(?:www\.)?vocaroo\.com\/i\/(\w+)/,
- style: '',
- el: function(a) {
- var el, type;
- el = $.el('audio', {
- controls: true,
- preload: 'auto'
- });
- type = el.canPlayType('audio/webm') ? 'webm' : 'mp3';
- el.src = "http://vocaroo.com/media_command.php?media=" + a.dataset.uid + "&command=download_" + type;
- return el;
- }
- }, {
- key: 'Vimeo',
- regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/,
- el: function(a) {
- return $.el('iframe', {
- src: "//player.vimeo.com/video/" + a.dataset.uid + "?wmode=opaque"
- });
- },
- title: {
- api: function(uid) {
- return "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" + uid;
- },
- text: function(_) {
- return _.title;
- }
- }
- }, {
- key: 'Vine',
- regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/,
- style: 'border: none; width: 500px; height: 500px;',
- el: function(a) {
- return $.el('iframe', {
- src: "https://vine.co/v/" + a.dataset.uid + "/card"
- });
- }
- }, {
- key: 'YouTube',
- regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/))([\w\-]{11})(.*)/,
- el: function(a) {
- var el, start;
- start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/);
- if (start) {
- start = start[1];
- }
- if (start && !/^\d+$/.test(start)) {
- start += ' 0h0m0s';
- start = 3600 * start.match(/(\d+)h/)[1] + 60 * start.match(/(\d+)m/)[1] + 1 * start.match(/(\d+)s/)[1];
- }
- el = $.el('iframe', {
- src: "//www.youtube.com/embed/" + a.dataset.uid + "?wmode=opaque" + (start ? '&start=' + start : '')
- });
- el.setAttribute("allowfullscreen", "true");
- return el;
- },
- title: {
- batchSize: 50,
- api: function(uids) {
- var ids, key;
- ids = encodeURIComponent(uids.join(','));
- key = 'AIzaSyB5_zaen_-46Uhz1xGR-lz1YoUMHqCD6CE';
- return "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + ids + "&fields=items%28id%2Csnippet%28title%29%29&key=" + key;
- },
- text: function(data, uid) {
- var item, k, len1, ref;
- ref = data.items;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- item = ref[k];
- if (item.id === uid) {
- return item.snippet.title;
- }
- }
- return 'Not Found';
- }
- }
- }, {
- key: 'Loopvid',
- regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|pc|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
- style: 'max-width: 80vw; max-height: 80vh;',
- el: function(a) {
- var _, base, el, host, k, len1, len2, name, names, q, ref, ref1, type, types, url;
- el = $.el('video', {
- controls: true,
- preload: 'auto',
- loop: true
- });
- ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
- types = (function() {
- switch (host) {
- case 'gd':
- case 'wu':
- case 'fc':
- return [''];
- case 'gc':
- return ['giant', 'fat', 'zippy'];
- default:
- return ['.webm', '.mp4'];
- }
- })();
- ref1 = names.split(',');
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- name = ref1[k];
- for (q = 0, len2 = types.length; q < len2; q++) {
- type = types[q];
- base = "" + name + type;
- url = (function() {
- switch (host) {
- case 'pf':
- return "https://web.archive.org/web/2/http://a.pomf.se/" + base;
- case 'kd':
- return "http://kastden.org/loopvid/" + base;
- case 'lv':
- return "http://kastden.org/_loopvid_media/lv/" + base;
- case 'gd':
- return "https://docs.google.com/uc?export=download&id=" + base;
- case 'gh':
- return "https://googledrive.com/host/" + base;
- case 'db':
- return "https://dl.dropboxusercontent.com/u/" + base;
- case 'dx':
- return "https://dl.dropboxusercontent.com/" + base;
- case 'nn':
- return "http://naenara.eu/loopvids/" + base;
- case 'cp':
- return "https://copy.com/" + base;
- case 'wu':
- return "http://webmup.com/" + base + "/vid.webm";
- case 'ig':
- return "https://i.imgur.com/" + base;
- case 'ky':
- return "https://kiyo.me/" + base;
- case 'mf':
- return "https://d.maxfile.ro/" + base;
- case 'pc':
- return "http://a.pomf.cat/" + base;
- case 'fc':
- return "//i.4cdn.org/" + base + ".webm";
- case 'gc':
- return "https://" + type + ".gfycat.com/" + name + ".webm";
- }
- })();
- $.add(el, $.el('source', {
- src: url
- }));
- }
- }
- return el;
- }
- }, {
- key: 'Clyp',
- regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w+)/,
- style: '',
- el: function(a) {
- var el, type;
- el = $.el('audio', {
- controls: true,
- preload: 'auto'
- });
- type = el.canPlayType('audio/ogg') ? 'ogg' : 'mp3';
- el.src = "https://clyp.it/" + a.dataset.uid + "." + type;
- return el;
- }
- }, {
- key: 'Loopvid-dummy',
- regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\//,
- dummy: true
- }, {
- key: 'MediaFire-dummy',
- regExp: /^\w+:\/\/(?:www\.)?mediafire.com\//,
- dummy: true
- }, {
- key: 'video',
- regExp: /\.(?:ogv|webm|mp4)(?:\?|$)/i,
- style: 'max-width: 80vw; max-height: 80vh;',
- el: function(a) {
- return $.el('video', {
- controls: true,
- preload: 'auto',
- src: a.dataset.href,
- loop: /^https?:\/\/i\.4cdn\.org\//.test(a.dataset.href)
- });
- }
- }
- ]
- };
-
- Linkify = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Linkify']) {
- return;
- }
- if (Conf['Comment Expansion']) {
- ExpandComment.callbacks.push(this.node);
- }
- Post.callbacks.push({
- name: 'Linkify',
- cb: this.node
- });
- CatalogThread.callbacks.push({
- name: 'Linkify',
- cb: this.catalogNode
- });
- return Embedding.init();
- },
- node: function() {
- var k, len1, len2, link, links, q, ref;
- if (this.isClone) {
- return Embedding.events(this);
- }
- if (!Linkify.regString.test(this.info.comment)) {
- return;
- }
- ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"]', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- $.addClass(link, 'linkify');
- Embedding.process(link, this);
- }
- links = Linkify.process(this.nodes.comment);
- for (q = 0, len2 = links.length; q < len2; q++) {
- link = links[q];
- Embedding.process(link, this);
- }
- },
- catalogNode: function() {
- if (!Linkify.regString.test(this.thread.OP.info.comment)) {
- return;
- }
- return Linkify.process(this.nodes.comment);
- },
- process: function(node) {
- var data, end, endNode, i, index, length, links, part1, part2, ref, ref1, result, saved, snapshot, space, test, word;
- test = /[^\s"]+/g;
- space = /[\s"]/;
- snapshot = $.X('.//br|.//text()', node);
- i = 0;
- links = [];
- while (node = snapshot.snapshotItem(i++)) {
- data = node.data;
- if (!data || node.parentElement.nodeName === "A") {
- continue;
- }
- while (result = test.exec(data)) {
- index = result.index;
- endNode = node;
- word = result[0];
- if ((length = index + word.length) === data.length) {
- test.lastIndex = 0;
- while ((saved = snapshot.snapshotItem(i++))) {
- if (saved.nodeName === 'BR') {
- if ((part1 = word.match(/(https?:\/\/)?([a-z\d-]+\.)*[a-z\d-]+$/i)) && (part2 = (ref = snapshot.snapshotItem(i)) != null ? (ref1 = ref.data) != null ? ref1.match(/^(\.[a-z\d-]+)*\//i) : void 0 : void 0) && (part1[0] + part2[0]).search(Linkify.regString) === 0) {
- continue;
- } else {
- break;
- }
- }
- endNode = saved;
- data = saved.data;
- if (end = space.exec(data)) {
- word += data.slice(0, end.index);
- test.lastIndex = length = end.index;
- i--;
- break;
- } else {
- length = data.length;
- word += data;
- }
- }
- }
- if (Linkify.regString.test(word)) {
- links.push(Linkify.makeRange(node, endNode, index, length));
- }
- if (!(test.lastIndex && node === endNode)) {
- break;
- }
- }
- }
- i = links.length;
- while (i--) {
- links[i] = Linkify.makeLink(links[i]);
- }
- return links;
- },
- regString: /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/?])|([-a-z\d]+[.])+(aero|asia|biz|cat|com|coop|dance|info|int|jobs|mobi|moe|museum|name|net|org|post|pro|tel|travel|xxx|xyz|edu|gov|mil|[a-z]{2})([:\/]|(?![^\s"]))|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i,
- makeRange: function(startNode, endNode, startOffset, endOffset) {
- var range;
- range = document.createRange();
- range.setStart(startNode, startOffset);
- range.setEnd(endNode, endOffset);
- return range;
- },
- makeLink: function(range) {
- var a, encodedDomain, i, t, text;
- text = range.toString();
- i = text.search(Linkify.regString);
- if (i > 0) {
- text = text.slice(i);
- while (range.startOffset + i >= range.startContainer.data.length) {
- i--;
- }
- if (i) {
- range.setStart(range.startContainer, range.startOffset + i);
- }
- }
- i = 0;
- while (/[)\]}>.,]/.test(t = text.charAt(text.length - (1 + i)))) {
- if (!(/[.,]/.test(t) || (text.match(/[()\[\]{}<>]/g)).length % 2)) {
- break;
- }
- i++;
- }
- if (i) {
- text = text.slice(0, -i);
- while (range.endOffset - i < 0) {
- i--;
- }
- if (i) {
- range.setEnd(range.endContainer, range.endOffset - i);
- }
- }
- if (!/((mailto|magnet):|.+:\/\/)/.test(text)) {
- text = (/@/.test(text) ? 'mailto:' : 'http://') + text;
- }
- if (encodedDomain = text.match(/^(https?:\/\/[^\/]*%[0-9a-f]{2})(.*)$/i)) {
- text = encodedDomain[1].replace(/%([0-9a-f]{2})/ig, function(x, y) {
- if (y === '25') {
- return x;
- } else {
- return String.fromCharCode(parseInt(y, 16));
- }
- }) + encodedDomain[2];
- }
- a = $.el('a', {
- className: 'linkify',
- rel: 'nofollow noreferrer',
- target: '_blank',
- href: text
- });
- $.add(a, range.extractContents());
- range.insertNode(a);
- return a;
- }
- };
-
- ArchiveLink = {
- init: function() {
- var div, entry, k, len1, ref, ref1, type;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
- return;
- }
- div = $.el('div', {
- textContent: 'Archive'
- });
- entry = {
- el: div,
- order: 90,
- open: function(arg) {
- var ID, board, thread;
- ID = arg.ID, thread = arg.thread, board = arg.board;
- return !!Redirect.to('thread', {
- postID: ID,
- threadID: thread.ID,
- boardID: board.ID
- });
- },
- subEntries: []
- };
- ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- type = ref1[k];
- entry.subEntries.push(this.createSubEntry(type[0], type[1]));
- }
- return Menu.menu.addEntry(entry);
- },
- 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,
- threadID: thread.ID,
- boardID: board.ID
- });
- return true;
- } : function(post) {
- var value;
- value = Filter[type](post);
- if (!value) {
- return false;
- }
- el.href = Redirect.to('search', {
- boardID: post.board.ID,
- type: type,
- value: value,
- isSearch: true
- });
- return true;
- };
- return {
- el: el,
- open: open
- };
- }
- };
-
- DeleteLink = {
- auto: [{}, {}],
- init: function() {
- var div, fileEl, fileEntry, postEl, postEntry, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
- return;
- }
- div = $.el('div', {
- className: 'delete-link',
- textContent: 'Delete'
- });
- postEl = $.el('a', {
- className: 'delete-post',
- href: 'javascript:;'
- });
- fileEl = $.el('a', {
- className: 'delete-file',
- href: 'javascript:;'
- });
- this.nodes = {
- menu: div.firstChild,
- links: [postEl, fileEl]
- };
- postEntry = {
- el: postEl,
- open: function() {
- postEl.textContent = DeleteLink.linkText(false);
- $.on(postEl, 'click', DeleteLink.toggle);
- return true;
- }
- };
- fileEntry = {
- el: fileEl,
- open: function(arg) {
- var file;
- file = arg.file;
- if (!file || file.isDead) {
- return false;
- }
- fileEl.textContent = DeleteLink.linkText(true);
- $.on(fileEl, 'click', DeleteLink.toggle);
- return true;
- }
- };
- return Menu.menu.addEntry({
- el: div,
- order: 40,
- open: function(post) {
- if (post.isDead) {
- return false;
- }
- DeleteLink.post = post;
- DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
- DeleteLink.cooldown.start(post);
- return true;
- },
- subEntries: [postEntry, fileEntry]
- });
- },
- menuText: function() {
- var seconds;
- if (seconds = DeleteLink.cooldown.seconds[DeleteLink.post.fullID]) {
- return "Delete (" + seconds + ")";
- } else {
- return 'Delete';
- }
- },
- linkText: function(fileOnly) {
- var text;
- text = fileOnly ? 'File' : 'Post';
- if (DeleteLink.auto[+fileOnly][DeleteLink.post.fullID]) {
- text = "Deleting " + (text.toLowerCase()) + "...";
- }
- return text;
- },
- toggle: function() {
- var auto, fileOnly, post;
- post = DeleteLink.post;
- fileOnly = $.hasClass(this, 'delete-file');
- auto = DeleteLink.auto[+fileOnly];
- if (auto[post.fullID]) {
- delete auto[post.fullID];
- } else {
- auto[post.fullID] = true;
- }
- this.textContent = DeleteLink.linkText(fileOnly);
- if (!DeleteLink.cooldown.seconds[post.fullID]) {
- return DeleteLink["delete"](post, fileOnly);
- }
- },
- "delete": function(post, fileOnly) {
- var form, link;
- link = DeleteLink.nodes.links[+fileOnly];
- delete DeleteLink.auto[+fileOnly][post.fullID];
- if (post.fullID === DeleteLink.post.fullID) {
- $.off(link, 'click', DeleteLink.toggle);
- }
- form = {
- mode: 'usrdel',
- onlyimgdel: fileOnly,
- pwd: QR.persona.getPassword()
- };
- form[post.ID] = 'delete';
- return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), {
- responseType: 'document',
- withCredentials: true,
- onload: function() {
- return DeleteLink.load(link, post, fileOnly, this.response);
- },
- onerror: function() {
- return DeleteLink.error(link, post);
- }
- }, {
- form: $.formData(form)
- });
- },
- load: function(link, post, fileOnly, resDoc) {
- var el, msg;
- link.textContent = DeleteLink.linkText(fileOnly);
- if (resDoc.title === '4chan - Banned') {
- el = $.el('span', {
- innerHTML: "You can't delete posts because you are banned ."
- });
- return new Notice('warning', el, 20);
- } else if (msg = resDoc.getElementById('errmsg')) {
- new Notice('warning', msg.textContent, 20);
- if (post.fullID === DeleteLink.post.fullID) {
- $.on(link, 'click', DeleteLink.toggle);
- }
- if (QR.cooldown.data && Conf['Cooldown'] && /\bwait\b/i.test(msg.textContent)) {
- DeleteLink.cooldown.start(post, 5);
- DeleteLink.auto[+fileOnly][post.fullID] = true;
- return DeleteLink.nodes.links[+fileOnly].textContent = DeleteLink.linkText(fileOnly);
- }
- } else {
- if (!fileOnly) {
- QR.cooldown["delete"](post);
- }
- if (resDoc.title === 'Updating index...') {
- (post.origin || post).kill(fileOnly);
- }
- if (post.fullID === DeleteLink.post.fullID) {
- return link.textContent = 'Deleted';
- }
- }
- },
- error: function(link, post) {
- new Notice('warning', 'Connection error, please retry.', 20);
- if (post.fullID === DeleteLink.post.fullID) {
- return $.on(link, 'click', DeleteLink.toggle);
- }
- },
- cooldown: {
- seconds: {},
- start: function(post, seconds) {
- if (DeleteLink.cooldown.seconds[post.fullID] != null) {
- return;
- }
- if (seconds == null) {
- seconds = QR.cooldown.secondsDeletion(post);
- }
- if (seconds > 0) {
- DeleteLink.cooldown.seconds[post.fullID] = seconds;
- return DeleteLink.cooldown.count(post);
- }
- },
- count: function(post) {
- var fileOnly, k, len1, ref;
- if (post.fullID === DeleteLink.post.fullID) {
- DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
- }
- if (DeleteLink.cooldown.seconds[post.fullID] > 0 && Conf['Cooldown']) {
- DeleteLink.cooldown.seconds[post.fullID]--;
- setTimeout(DeleteLink.cooldown.count, 1000, post);
- } else {
- delete DeleteLink.cooldown.seconds[post.fullID];
- ref = [false, true];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- fileOnly = ref[k];
- if (DeleteLink.auto[+fileOnly][post.fullID]) {
- DeleteLink["delete"](post, fileOnly);
- }
- }
- }
- }
- }
- };
-
- DownloadLink = {
- init: function() {
- var a, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
- return;
- }
- a = $.el('a', {
- className: 'download-link',
- textContent: 'Download file'
- });
- $.on(a, 'click', ImageCommon.download);
- return Menu.menu.addEntry({
- el: a,
- order: 100,
- open: function(arg) {
- var file;
- file = arg.file;
- if (!file) {
- return false;
- }
- a.href = file.url;
- a.download = file.name;
- return true;
- }
- });
- }
- };
-
- Menu = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) {
- return;
- }
- this.button = $.el('a', {
- className: 'menu-button',
- href: 'javascript:;'
- });
- $.extend(this.button, {
- innerHTML: " "
- });
- this.menu = new UI.Menu('post');
- Post.callbacks.push({
- name: 'Menu',
- cb: this.node
- });
- return CatalogThread.callbacks.push({
- name: 'Menu',
- cb: this.catalogNode
- });
- },
- node: function() {
- if (this.isClone) {
- Menu.makeButton(this, $('.menu-button', this.nodes.info));
- return;
- }
- return $.add(this.nodes.info, Menu.makeButton(this));
- },
- catalogNode: function() {
- return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP));
- },
- makeButton: function(post, button) {
- button || (button = Menu.button.cloneNode(true));
- $.on(button, 'click', function(e) {
- return Menu.menu.toggle(e, this, post);
- });
- return button;
- }
- };
-
- ReportLink = {
- init: function() {
- var a, ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
- return;
- }
- a = $.el('a', {
- className: 'report-link',
- href: 'javascript:;'
- });
- $.on(a, 'click', ReportLink.report);
- return Menu.menu.addEntry({
- el: a,
- order: 10,
- open: function(post) {
- if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) {
- a.textContent = 'Report';
- ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
- if ((Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled) || d.cookie.indexOf('pass_enabled=1') >= 0) {
- ReportLink.url += '&altc=1';
- ReportLink.dims = 'width=350,height=275';
- } else {
- ReportLink.dims = 'width=400,height=550';
- }
- } else if (Conf['Archive Report']) {
- a.textContent = 'Report to archive';
- ReportLink.url = Redirect.to('report', {
- boardID: post.board.ID,
- postID: post.ID
- });
- ReportLink.dims = 'width=700,height=475';
- } else {
- ReportLink.url = '';
- }
- return !!ReportLink.url;
- }
- });
- },
- report: function() {
- var dims, id, set, url;
- url = ReportLink.url, dims = ReportLink.dims;
- id = Date.now();
- set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1," + dims;
- return window.open(url, id, set);
- }
- };
-
- Favicon = {
- init: function() {
- return $.asap((function() {
- return d.head && (Favicon.el = $('link[rel="shortcut icon"]', d.head));
- }), Favicon.initAsap);
- },
- initAsap: function() {
- var href;
- Favicon.el.type = 'image/x-icon';
- href = Favicon.el.href;
- Favicon.SFW = /ws\.ico$/.test(href);
- Favicon["default"] = href;
- return Favicon["switch"]();
- },
- "switch": function() {
- var f, i, items, t;
- items = {
- ferongr: ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9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TkSuQmCC']
- }[Conf['favicon']];
- f = Favicon;
- t = 'data:image/png;base64,';
- i = 0;
- while (items[i]) {
- items[i] = t + items[i++];
- }
- f.unreadDead = items[0], f.unreadDeadY = items[1], f.unreadSFW = items[2], f.unreadSFWY = items[3], f.unreadNSFW = items[4], f.unreadNSFWY = items[5];
- return f.update();
- },
- update: function() {
- if (this.SFW) {
- this.unread = this.unreadSFW;
- return this.unreadY = this.unreadSFWY;
- } else {
- this.unread = this.unreadNSFW;
- return this.unreadY = this.unreadNSFWY;
- }
- },
- dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
- logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAgMAAAC+UIlYAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAGlJREFUWMPtlkEKADEIA/tJP9lXLttQto2yHxgDHozTi0ToGK2WKZZ+HAQQMZc+xBwI4EZ+wAC2IfPuSIDOZJrSZQEAX9eVJhhwIuUYAnQe8rhAEMAZlTI2MID9f5Clyh0JeE1V1ZEAvB4qDfwuJTSGRAAAAABJRU5ErkJggg=='
- };
-
- MarkNewIPs = {
- init: function() {
- if (g.VIEW !== 'thread' || !Conf['Mark New IPs']) {
- return;
- }
- return Thread.callbacks.push({
- name: 'Mark New IPs',
- cb: this.node
- });
- },
- node: function() {
- MarkNewIPs.ipCount = this.ipCount;
- MarkNewIPs.postCount = this.posts.keys.length;
- return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
- },
- onUpdate: function(e) {
- var deletedPosts, fullID, i, ipCount, k, len1, len2, newPosts, postCount, q, ref;
- ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
- if (ipCount == null) {
- return;
- }
- switch (ipCount - MarkNewIPs.ipCount) {
- case postCount - MarkNewIPs.postCount + deletedPosts.length:
- i = MarkNewIPs.ipCount;
- for (k = 0, len1 = newPosts.length; k < len1; k++) {
- fullID = newPosts[k];
- MarkNewIPs.markNew(g.posts[fullID], ++i);
- }
- break;
- case -deletedPosts.length:
- for (q = 0, len2 = newPosts.length; q < len2; q++) {
- fullID = newPosts[q];
- MarkNewIPs.markOld(g.posts[fullID]);
- }
- }
- MarkNewIPs.ipCount = ipCount;
- return MarkNewIPs.postCount = postCount;
- },
- markNew: function(post, ipCount) {
- var counter, suffix;
- suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
- counter = $.el('span', {
- className: 'ip-counter',
- textContent: "(" + ipCount + ")"
- });
- post.nodes.nameBlock.title = "This is the " + ipCount + suffix + " IP in the thread.";
- $.add(post.nodes.nameBlock, [$.tn(' '), counter]);
- return $.addClass(post.nodes.root, 'new-ip');
- },
- markOld: function(post) {
- post.nodes.nameBlock.title = 'Not the first post from this IP.';
- return $.addClass(post.nodes.root, 'old-ip');
- }
- };
-
- ReplyPruning = {
- init: function() {
- var el, label;
- if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) {
- return;
- }
- this.active = !(Conf['Quote Threading'] && Conf['Thread Quotes']);
- this.container = $.frag();
- this.summary = $.el('span', {
- hidden: true,
- className: 'summary'
- });
- this.summary.style.cursor = 'pointer';
- $.on(this.summary, 'click', (function(_this) {
- return function() {
- _this.inputs.enabled.checked = !_this.inputs.enabled.checked;
- return $.event('change', null, _this.inputs.enabled);
- };
- })(this));
- label = UI.checkbox('Prune Replies', 'Show Last', this.active);
- el = $.el('span', {
- title: 'Maximum number of replies to show.'
- }, {
- innerHTML: " "
- });
- $.prepend(el, label);
- this.inputs = {
- enabled: label.firstElementChild,
- replies: el.lastElementChild
- };
- $.on(this.inputs.enabled, 'change', this.setEnabled);
- $.on(this.inputs.replies, 'change', $.cb.value);
- Header.menu.addEntry({
- el: el,
- order: 190
- });
- return Thread.callbacks.push({
- name: 'Reply Pruning',
- cb: this.node
- });
- },
- position: 0,
- hidden: 0,
- hiddenFiles: 0,
- total: 0,
- totalFiles: 0,
- setEnabled: function() {
- var other;
- other = QuoteThreading.input;
- if (this.checked && (other != null ? other.checked : void 0)) {
- other.checked = false;
- $.event('change', null, other);
- }
- return ReplyPruning.active = this.checked;
- },
- showIfHidden: function(id) {
- var ref;
- if ((ref = ReplyPruning.container) != null ? ref.getElementById(id) : void 0) {
- ReplyPruning.inputs.enabled.checked = false;
- return $.event('change', null, ReplyPruning.inputs.enabled);
- }
- },
- node: function() {
- var ref;
- ReplyPruning.thread = this;
- this.posts.forEach(function(post) {
- if (post.isReply) {
- ReplyPruning.total++;
- if (post.file) {
- return ReplyPruning.totalFiles++;
- }
- }
- });
- if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (0 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) {
- ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false;
- }
- $.after(this.OP.nodes.root, ReplyPruning.summary);
- $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update);
- $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update);
- $.on(d, 'ThreadUpdate', ReplyPruning.updateCount);
- $.on(d, 'ThreadUpdate', ReplyPruning.update);
- return ReplyPruning.update();
- },
- updateCount: function(e) {
- var fullID, k, len1, ref;
- if (e.detail[404]) {
- return;
- }
- ref = e.detail.newPosts;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- fullID = ref[k];
- ReplyPruning.total++;
- if (g.posts[fullID].file) {
- ReplyPruning.totalFiles++;
- }
- }
- },
- update: function() {
- var frag, hidden2, post, posts;
- hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0;
- posts = ReplyPruning.thread.posts;
- if (ReplyPruning.hidden < hidden2) {
- while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) {
- post = posts[posts.keys[ReplyPruning.position++]];
- if (post.isReply && !post.isFetchedQuote) {
- $.add(ReplyPruning.container, post.nodes.root);
- ReplyPruning.hidden++;
- if (post.file) {
- ReplyPruning.hiddenFiles++;
- }
- }
- }
- } else if (ReplyPruning.hidden > hidden2) {
- frag = $.frag();
- while (ReplyPruning.hidden > hidden2 && ReplyPruning.position > 0) {
- post = posts[posts.keys[--ReplyPruning.position]];
- if (post.isReply && !post.isFetchedQuote) {
- $.prepend(frag, post.nodes.root);
- ReplyPruning.hidden--;
- if (post.file) {
- ReplyPruning.hiddenFiles--;
- }
- }
- }
- $.after(ReplyPruning.summary, frag);
- $.event('PostsInserted');
- }
- ReplyPruning.summary.textContent = ReplyPruning.active ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles);
- return ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"];
- }
- };
-
- ThreadExcerpt = {
- init: function() {
- if (g.BOARD.ID !== 'f' || g.VIEW !== 'thread' || !Conf['Thread Excerpt']) {
- return;
- }
- return Thread.callbacks.push({
- name: 'Thread Excerpt',
- cb: this.node
- });
- },
- node: function() {
- return d.title = Get.threadExcerpt(this);
- }
- };
-
- ThreadStats = {
- init: function() {
- var sc, statsHTML, statsTitle;
- if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
- return;
- }
- statsHTML = {
- innerHTML: "? / ? " + (Conf["IP Count in Stats"] ? " / ? " : "") + (Conf["Page Count in Stats"] ? " / ? " : "")
- };
- statsTitle = 'Posts / Files';
- if (Conf['IP Count in Stats']) {
- statsTitle += ' / IPs';
- }
- if (Conf['Page Count in Stats']) {
- statsTitle += (g.BOARD.ID === 'f' ? ' / Purge Position' : ' / Page');
- }
- if (Conf['Updater and Stats in Header']) {
- this.dialog = sc = $.el('span', {
- id: 'thread-stats',
- title: statsTitle
- });
- $.extend(sc, statsHTML);
- $.ready(function() {
- return Header.addShortcut(sc);
- });
- } else {
- this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', {
- innerHTML: "" + statsHTML.innerHTML + "
"
- });
- $.addClass(doc, 'float');
- $.ready(function() {
- return $.add(d.body, sc);
- });
- }
- this.postCountEl = $('#post-count', sc);
- this.fileCountEl = $('#file-count', sc);
- this.ipCountEl = $('#ip-count', sc);
- this.pageCountEl = $('#page-count', sc);
- if (this.pageCountEl) {
- $.on(this.pageCountEl, 'click', ThreadStats.fetchPage);
- }
- return Thread.callbacks.push({
- name: 'Thread Stats',
- cb: this.node
- });
- },
- node: function() {
- var fileCount, postCount;
- postCount = 0;
- fileCount = 0;
- this.posts.forEach(function(post) {
- postCount++;
- if (post.file) {
- fileCount++;
- }
- if (ThreadStats.pageCountEl) {
- return ThreadStats.lastPost = post.info.date;
- }
- });
- ThreadStats.thread = this;
- ThreadStats.fetchPage();
- ThreadStats.update(postCount, fileCount, this.ipCount);
- return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate);
- },
- onUpdate: function(e) {
- var fileCount, ipCount, newPosts, postCount, ref, ref1;
- if (e.detail[404]) {
- return;
- }
- ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount, ipCount = ref.ipCount, newPosts = ref.newPosts;
- ThreadStats.update(postCount, fileCount, ipCount);
- if (!ThreadStats.pageCountEl) {
- return;
- }
- if (newPosts.length) {
- ThreadStats.lastPost = g.posts[newPosts[newPosts.length - 1]].info.date;
- }
- if (g.BOARD.ID !== 'f' && ((ref1 = ThreadStats.pageCountEl) != null ? ref1.textContent : void 0) !== '1') {
- return ThreadStats.fetchPage();
- }
- },
- update: function(postCount, fileCount, ipCount) {
- var fileCountEl, ipCountEl, postCountEl, thread;
- thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl, ipCountEl = ThreadStats.ipCountEl;
- postCountEl.textContent = postCount;
- fileCountEl.textContent = fileCount;
- if ((ipCount != null) && ipCountEl) {
- ipCountEl.textContent = ipCount;
- }
- (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning');
- return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning');
- },
- fetchPage: function() {
- if (!ThreadStats.pageCountEl) {
- return;
- }
- clearTimeout(ThreadStats.timeout);
- if (ThreadStats.thread.isDead) {
- ThreadStats.pageCountEl.textContent = 'Dead';
- $.addClass(ThreadStats.pageCountEl, 'warning');
- return;
- }
- ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 2 * $.MINUTE);
- return $.ajax("//a.4cdn.org/" + ThreadStats.thread.board + "/threads.json", {
- onload: ThreadStats.onThreadsLoad
- }, {
- whenModified: 'ThreadStats'
- });
- },
- onThreadsLoad: function() {
- var k, len1, len2, len3, page, purgePos, q, ref, ref1, ref2, thread, u;
- if (this.status === 200) {
- ref = this.response;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- page = ref[k];
- if (g.BOARD.ID === 'f') {
- purgePos = 1;
- ref1 = page.threads;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- thread = ref1[q];
- if (thread.no < ThreadStats.thread.ID) {
- purgePos++;
- }
- }
- ThreadStats.pageCountEl.textContent = purgePos;
- } else {
- ref2 = page.threads;
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- thread = ref2[u];
- if (!(thread.no === ThreadStats.thread.ID)) {
- continue;
- }
- ThreadStats.pageCountEl.textContent = page.page;
- (page.page === this.response.length ? $.addClass : $.rmClass)(ThreadStats.pageCountEl, 'warning');
- ThreadStats.lastPageUpdate = new Date(thread.last_modified * $.SECOND);
- ThreadStats.retry();
- return;
- }
- }
- }
- } else if (this.status === 304) {
- return ThreadStats.retry();
- }
- },
- retry: function() {
- var ref;
- if (g.BOARD.ID !== 'f' && ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((ref = ThreadStats.pageCountEl) != null ? ref.textContent : void 0) !== '1') {
- clearTimeout(ThreadStats.timeout);
- return ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 5 * $.SECOND);
- }
- }
- };
-
- ThreadUpdater = {
- init: function() {
- var conf, el, input, name, ref, sc, subEntries, updateLink;
- if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
- return;
- }
- this.audio = $.el('audio', {
- src: ThreadUpdater.beep
- });
- if (Conf['Updater and Stats in Header']) {
- this.dialog = sc = $.el('span', {
- id: 'updater'
- });
- $.extend(sc, {
- innerHTML: " "
- });
- $.ready(function() {
- return Header.addShortcut(sc);
- });
- } else {
- this.dialog = sc = UI.dialog('updater', 'bottom: 0px; left: 0px;', {
- innerHTML: "
"
- });
- $.addClass(doc, 'float');
- $.ready(function() {
- return $.add(d.body, sc);
- });
- }
- this.checkPostCount = 0;
- this.timer = $('#update-timer', sc);
- this.status = $('#update-status', sc);
- $.on(this.timer, 'click', this.update);
- $.on(this.status, 'click', this.update);
- updateLink = $.el('span', {
- className: 'brackets-wrap updatelink'
- });
- $.extend(updateLink, {
- innerHTML: "Update "
- });
- Main.ready(function() {
- var navLinksBot;
- if ((navLinksBot = $('.navLinksBot'))) {
- return $.add(navLinksBot, [$.tn(' '), updateLink]);
- }
- });
- $.on(updateLink.firstElementChild, 'click', this.update);
- subEntries = [];
- ref = Config.updater.checkbox;
- for (name in ref) {
- conf = ref[name];
- el = UI.checkbox(name, name);
- el.title = conf[1];
- input = el.firstElementChild;
- $.on(input, 'change', $.cb.checked);
- if (input.name === 'Scroll BG') {
- $.on(input, 'change', this.cb.scrollBG);
- this.cb.scrollBG();
- } else if (input.name === 'Auto Update') {
- $.on(input, 'change', this.setInterval);
- }
- subEntries.push({
- el: el
- });
- }
- this.settings = $.el('span', {
- innerHTML: "Interval "
- });
- $.on(this.settings, 'click', this.intervalShortcut);
- subEntries.push({
- el: this.settings
- });
- Header.menu.addEntry(this.entry = {
- el: $.el('span', {
- textContent: 'Updater'
- }),
- order: 110,
- subEntries: subEntries
- });
- return Thread.callbacks.push({
- name: 'Thread Updater',
- cb: this.node
- });
- },
- node: function() {
- ThreadUpdater.thread = this;
- ThreadUpdater.root = this.OP.nodes.root.parentNode;
- ThreadUpdater.outdateCount = 0;
- ThreadUpdater.postIDs = [];
- ThreadUpdater.fileIDs = [];
- this.posts.forEach(function(post) {
- ThreadUpdater.postIDs.push(post.ID);
- if (post.file) {
- return ThreadUpdater.fileIDs.push(post.ID);
- }
- });
- ThreadUpdater.cb.interval.call($.el('input', {
- value: Conf['Interval']
- }));
- $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);
- $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
- return ThreadUpdater.setInterval();
- },
-
- /*
- http://freesound.org/people/pierrecartoons1979/sounds/90112/
- cc-by-nc-3.0
- */
- beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA',
- playBeep: function() {
- var audio;
- audio = ThreadUpdater.audio;
- if (audio.paused) {
- return audio.play();
- } else {
- return $.one(audio, 'ended', ThreadUpdater.playBeep);
- }
- },
- cb: {
- checkpost: function(e) {
- if (e.detail.threadID !== ThreadUpdater.thread.ID) {
- return;
- }
- ThreadUpdater.postID = e.detail.postID;
- ThreadUpdater.checkPostCount = 0;
- ThreadUpdater.outdateCount = 0;
- return ThreadUpdater.setInterval();
- },
- visibility: function() {
- if (d.hidden) {
- return;
- }
- ThreadUpdater.outdateCount = 0;
- if (ThreadUpdater.seconds > ThreadUpdater.interval) {
- return ThreadUpdater.setInterval();
- }
- },
- scrollBG: function() {
- return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() {
- return true;
- } : function() {
- return !d.hidden;
- };
- },
- interval: function(e) {
- var val;
- val = parseInt(this.value, 10);
- if (val < 1) {
- val = 1;
- }
- ThreadUpdater.interval = this.value = val;
- if (e) {
- return $.cb.value.call(this);
- }
- },
- load: function() {
- var req;
- req = ThreadUpdater.req;
- switch (req.status) {
- case 200:
- ThreadUpdater.parse(req);
- if (ThreadUpdater.thread.isArchived) {
- return ThreadUpdater.kill();
- } else {
- return ThreadUpdater.setInterval();
- }
- break;
- case 404:
- return $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/catalog.json", {
- onloadend: function() {
- var confirmed, k, len1, len2, page, q, ref, ref1, thread;
- if (this.status === 200) {
- confirmed = true;
- ref = this.response;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- page = ref[k];
- ref1 = page.threads;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- thread = ref1[q];
- if (thread.no === ThreadUpdater.thread.ID) {
- confirmed = false;
- break;
- }
- }
- }
- } else {
- confirmed = false;
- }
- if (confirmed) {
- return ThreadUpdater.kill();
- } else {
- return ThreadUpdater.error(req);
- }
- }
- });
- default:
- return ThreadUpdater.error(req);
- }
- }
- },
- kill: function() {
- ThreadUpdater.thread.kill();
- ThreadUpdater.setInterval();
- return $.event('ThreadUpdate', {
- 404: true,
- threadID: ThreadUpdater.thread.fullID
- });
- },
- error: function(req) {
- if (req.status === 304) {
- ThreadUpdater.set('status', '');
- }
- ThreadUpdater.setInterval();
- if (!req.status) {
- return ThreadUpdater.set('status', 'Connection Failed', 'warning');
- } else if (req.status !== 304) {
- return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning');
- }
- },
- setInterval: function() {
- var cur, interval, j, limit;
- clearTimeout(ThreadUpdater.timeoutID);
- if (ThreadUpdater.thread.isDead) {
- ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning');
- ThreadUpdater.set('timer', '');
- return;
- }
- if (ThreadUpdater.postID && ThreadUpdater.checkPostCount < 5) {
- ThreadUpdater.set('timer', '...', 'loading');
- ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND);
- return;
- }
- if (!Conf['Auto Update']) {
- ThreadUpdater.set('timer', 'Update');
- return;
- }
- interval = ThreadUpdater.interval;
- if (Conf['Optional Increase']) {
- limit = d.hidden ? 10 : 5;
- j = Math.min(ThreadUpdater.outdateCount, limit);
- cur = (Math.floor(interval * 0.1) || 1) * j * j;
- ThreadUpdater.seconds = $.minmax(cur, interval, 300);
- } else {
- ThreadUpdater.seconds = interval;
- }
- return ThreadUpdater.timeout();
- },
- 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;
- } else {
- el.textContent = text;
- }
- return el.className = klass != null ? klass : (text === '' ? 'empty' : '');
- },
- timeout: function() {
- if (ThreadUpdater.seconds) {
- ThreadUpdater.set('timer', ThreadUpdater.seconds);
- ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
- } else {
- ThreadUpdater.outdateCount++;
- ThreadUpdater.update();
- }
- return ThreadUpdater.seconds--;
- },
- update: function() {
- var ref;
- clearTimeout(ThreadUpdater.timeoutID);
- ThreadUpdater.set('timer', '...', 'loading');
- if ((ref = ThreadUpdater.req) != null) {
- ref.abort();
- }
- return ThreadUpdater.req = $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/thread/" + ThreadUpdater.thread + ".json", {
- onloadend: ThreadUpdater.cb.load,
- timeout: $.MINUTE
- }, {
- whenModified: 'ThreadUpdater'
- });
- },
- updateThreadStatus: function(type, status) {
- var change, hasChanged;
- if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) {
- return;
- }
- ThreadUpdater.thread.setStatus(type, status);
- if (type === 'Closed' && ThreadUpdater.thread.isArchived) {
- return;
- }
- change = type === 'Sticky' ? status ? 'now a sticky' : 'not a sticky anymore' : status ? 'now closed' : 'not closed anymore';
- return new Notice('info', "The thread is " + change + ".", 30);
- },
- parse: function(req) {
- var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, scroll, thread, u, unreadCount, unreadQYCount, v;
- postObjects = req.response.posts;
- OP = postObjects[0];
- thread = ThreadUpdater.thread;
- board = thread.board;
- ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1];
- if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts[lastPost].info.date < 30 * $.SECOND) {
- return;
- }
- Build.spoilerRange[board] = OP.custom_spoiler;
- thread.setStatus('Archived', !!OP.archived);
- ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
- ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
- thread.postLimit = !!OP.bumplimit;
- thread.fileLimit = !!OP.imagelimit;
- if (OP.unique_ips != null) {
- thread.ipCount = OP.unique_ips;
- }
- posts = [];
- index = [];
- files = [];
- newPosts = [];
- for (k = 0, len1 = postObjects.length; k < len1; k++) {
- postObject = postObjects[k];
- ID = postObject.no;
- index.push(ID);
- if (postObject.fsize) {
- files.push(ID);
- }
- if (ID <= lastPost) {
- continue;
- }
- if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
- post.resurrect();
- continue;
- }
- newPosts.push(board + "." + ID);
- node = Build.postFromObject(postObject, board.ID);
- posts.push(new Post(node, thread, board));
- if (ThreadUpdater.postID === ID) {
- delete ThreadUpdater.postID;
- }
- }
- deletedPosts = [];
- ref1 = ThreadUpdater.postIDs;
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- ID = ref1[q];
- if (!(indexOf.call(index, ID) < 0)) {
- continue;
- }
- thread.posts[ID].kill();
- deletedPosts.push(board + "." + ID);
- }
- ThreadUpdater.postIDs = index;
- deletedFiles = [];
- ref2 = ThreadUpdater.fileIDs;
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- ID = ref2[u];
- if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) {
- continue;
- }
- thread.posts[ID].kill(true);
- deletedFiles.push(board + "." + ID);
- }
- ThreadUpdater.fileIDs = files;
- if (!posts.length) {
- ThreadUpdater.set('status', '');
- } else {
- ThreadUpdater.set('status', "+" + posts.length, 'new');
- ThreadUpdater.outdateCount = 0;
- unreadCount = (ref4 = Unread.posts) != null ? ref4.size : void 0;
- unreadQYCount = (ref5 = Unread.postsQuotingYou) != null ? ref5.size : void 0;
- Main.callbackNodes(Post, posts);
- if (d.hidden || !d.hasFocus()) {
- if (Conf['Beep Quoting You'] && ((ref6 = Unread.postsQuotingYou) != null ? ref6.size : void 0) > unreadQYCount) {
- ThreadUpdater.playBeep();
- if (Conf['Beep']) {
- ThreadUpdater.playBeep();
- }
- } else if (Conf['Beep'] && ((ref7 = Unread.posts) != null ? ref7.size : void 0) > 0 && unreadCount === 0) {
- ThreadUpdater.playBeep();
- }
- }
- scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
- firstPost = null;
- for (v = 0, len4 = posts.length; v < len4; v++) {
- post = posts[v];
- if (!QuoteThreading.insert(post)) {
- firstPost || (firstPost = post.nodes.root);
- $.add(ThreadUpdater.root, post.nodes.root);
- }
- }
- $.event('PostsInserted');
- if (scroll) {
- if (Conf['Bottom Scroll']) {
- window.scrollTo(0, d.body.clientHeight);
- } else {
- if (firstPost) {
- Header.scrollTo(firstPost);
- }
- }
- }
- }
- if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) {
- ipCountEl.textContent = OP.unique_ips;
- ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are');
- ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters');
- }
- return $.event('ThreadUpdate', {
- 404: false,
- threadID: thread.fullID,
- newPosts: newPosts,
- deletedPosts: deletedPosts,
- deletedFiles: deletedFiles,
- postCount: OP.replies + 1,
- fileCount: OP.images + !!OP.fsize,
- ipCount: OP.unique_ips
- });
- }
- };
-
- ThreadWatcher = {
- init: function() {
- var sc;
- if (!(this.enabled = Conf['Thread Watcher'])) {
- return;
- }
- this.shortcut = sc = $.el('a', {
- id: 'watcher-link',
- textContent: 'Watcher',
- title: 'Thread Watcher',
- href: 'javascript:;',
- className: 'disabled fa fa-eye'
- });
- this.db = new DataBoard('watchedThreads', this.refresh, true);
- this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', {
- innerHTML: "
"
- });
- this.status = $('#watcher-status', this.dialog);
- this.list = this.dialog.lastElementChild;
- this.refreshButton = $('.refresh', this.dialog);
- this.closeButton = $('.move > .close', this.dialog);
- this.unreaddb = Unread.db || new DataBoard('lastReadPosts');
- this.unreadEnabled = Conf['Remember Last Read Post'];
- $.on(d, 'QRPostSuccessful', this.cb.post);
- $.on(sc, 'click', this.toggleWatcher);
- $.on(this.refreshButton, 'click', this.buttonFetchAll);
- $.on(this.closeButton, 'click', this.toggleWatcher);
- $.on(d, '4chanXInitFinished', this.ready);
- switch (g.VIEW) {
- case 'index':
- $.on(d, 'IndexRefresh', this.cb.onIndexRefresh);
- break;
- case 'thread':
- $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh);
- }
- if (Conf['Fixed Thread Watcher']) {
- $.addClass(doc, 'fixed-watcher');
- }
- if (Conf['Toggleable Thread Watcher']) {
- this.dialog.hidden = true;
- Header.addShortcut(sc);
- $.addClass(doc, 'toggleable-watcher');
- }
- ThreadWatcher.fetchAuto();
- if (g.VIEW === 'index' && Conf['JSON Index'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
- Menu.menu.addEntry({
- el: $.el('a', {
- href: 'javascript:;',
- className: 'has-shortcut-text'
- }, {
- innerHTML: "Alt+click "
- }),
- order: 6,
- open: function(arg) {
- var thread;
- thread = arg.thread;
- if (Conf['Index Mode'] !== 'catalog') {
- return false;
- }
- this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? 'Unwatch' : 'Watch';
- if (this.cb) {
- $.off(this.el, 'click', this.cb);
- }
- this.cb = function() {
- $.event('CloseMenu');
- return ThreadWatcher.toggle(thread);
- };
- $.on(this.el, 'click', this.cb);
- return true;
- }
- });
- }
- Post.callbacks.push({
- name: 'Thread Watcher',
- cb: this.node
- });
- return CatalogThread.callbacks.push({
- name: 'Thread Watcher',
- cb: this.catalogNode
- });
- },
- isWatched: function(thread) {
- var ref;
- return (ref = ThreadWatcher.db) != null ? ref.get({
- boardID: thread.board.ID,
- threadID: thread.ID
- }) : void 0;
- },
- node: function() {
- var toggler;
- if (this.isReply) {
- return;
- }
- if (this.isClone) {
- toggler = $('.watch-thread-link', this.nodes.post);
- } else {
- toggler = $.el('a', {
- href: 'javascript:;',
- className: 'watch-thread-link'
- });
- $.before($('input', this.nodes.post), toggler);
- }
- return $.on(toggler, 'click', ThreadWatcher.cb.toggle);
- },
- catalogNode: function() {
- if (ThreadWatcher.isWatched(this.thread)) {
- $.addClass(this.nodes.root, 'watched');
- }
- $.on(this.nodes.thumb.parentNode, 'click', (function(_this) {
- return function(e) {
- if (!(e.button === 0 && e.altKey)) {
- return;
- }
- ThreadWatcher.toggle(_this.thread);
- return e.preventDefault();
- };
- })(this));
- return $.on(this.nodes.thumb.parentNode, 'mousedown', function(e) {
- if (e.button === 0 && e.altKey) {
- return e.preventDefault();
- }
- });
- },
- ready: function() {
- $.off(d, '4chanXInitFinished', ThreadWatcher.ready);
- if (!Main.isThisPageLegit()) {
- return;
- }
- ThreadWatcher.refresh();
- $.add(d.body, ThreadWatcher.dialog);
- if (!Conf['Auto Watch']) {
- return;
- }
- return $.get('AutoWatch', 0, function(arg) {
- var AutoWatch, thread;
- AutoWatch = arg.AutoWatch;
- if (!(thread = g.BOARD.threads[AutoWatch])) {
- return;
- }
- ThreadWatcher.add(thread);
- return $["delete"]('AutoWatch');
- });
- },
- toggleWatcher: function() {
- $.toggleClass(ThreadWatcher.shortcut, 'disabled');
- return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden;
- },
- cb: {
- openAll: function() {
- var a, k, len1, ref;
- if ($.hasClass(this, 'disabled')) {
- return;
- }
- ref = $$('a[title]', ThreadWatcher.list);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- a = ref[k];
- $.open(a.href);
- }
- return $.event('CloseMenu');
- },
- pruneDeads: function() {
- var boardID, data, k, len1, ref, ref1, threadID;
- if ($.hasClass(this, 'disabled')) {
- return;
- }
- ThreadWatcher.db.forceSync();
- ref = ThreadWatcher.getAll();
- for (k = 0, len1 = ref.length; k < len1; k++) {
- ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
- if (!data.isDead) {
- continue;
- }
- delete ThreadWatcher.db.data.boards[boardID][threadID];
- ThreadWatcher.db.deleteIfEmpty({
- boardID: boardID
- });
- }
- ThreadWatcher.db.save();
- ThreadWatcher.refresh();
- return $.event('CloseMenu');
- },
- toggle: function() {
- var thread;
- thread = Get.postFromNode(this).thread;
- Index.followedThreadID = thread.ID;
- ThreadWatcher.toggle(thread);
- return delete Index.followedThreadID;
- },
- rm: function() {
- var boardID, ref, threadID;
- ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1];
- return ThreadWatcher.rm(boardID, +threadID);
- },
- post: function(e) {
- var boardID, postID, ref, threadID;
- ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
- if (postID === threadID) {
- if (Conf['Auto Watch']) {
- return $.set('AutoWatch', threadID);
- }
- } else if (Conf['Auto Watch Reply']) {
- return ThreadWatcher.add(g.threads[boardID + '.' + threadID]);
- }
- },
- onIndexRefresh: function() {
- var boardID, data, db, ref, threadID;
- db = ThreadWatcher.db;
- boardID = g.BOARD.ID;
- db.forceSync();
- ref = db.data.boards[boardID];
- for (threadID in ref) {
- data = ref[threadID];
- if (!(data != null ? data.isDead : void 0) && !(threadID in g.BOARD.threads)) {
- if (Conf['Auto Prune'] || !(data && typeof data === 'object')) {
- db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- } else {
- if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
- ThreadWatcher.fetchStatus({
- boardID: boardID,
- threadID: threadID,
- data: data
- });
- }
- data.isDead = true;
- db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- }
- }
- }
- return ThreadWatcher.refresh();
- },
- onThreadRefresh: function(e) {
- var thread;
- thread = g.threads[e.detail.threadID];
- if (!(e.detail[404] && ThreadWatcher.db.get({
- boardID: thread.board.ID,
- threadID: thread.ID
- }))) {
- return;
- }
- return ThreadWatcher.add(thread);
- }
- },
- requests: [],
- fetched: 0,
- clearRequests: function() {
- ThreadWatcher.requests = [];
- ThreadWatcher.fetched = 0;
- ThreadWatcher.status.textContent = '';
- return $.rmClass(ThreadWatcher.refreshButton, 'fa-spin');
- },
- abort: function() {
- var k, len1, ref, req;
- ref = ThreadWatcher.requests;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- req = ref[k];
- if (req.readyState !== 4) {
- req.abort();
- }
- }
- return ThreadWatcher.clearRequests();
- },
- fetchAuto: function() {
- var db, interval, now;
- clearTimeout(ThreadWatcher.timeout);
- if (!Conf['Auto Update Thread Watcher']) {
- return;
- }
- db = ThreadWatcher.db;
- interval = ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] ? 5 * $.MINUTE : 2 * $.HOUR;
- now = Date.now();
- if (now >= (db.data.lastChecked || 0) + interval) {
- db.data.lastChecked = now;
- ThreadWatcher.fetchAllStatus();
- db.save();
- }
- return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);
- },
- buttonFetchAll: function() {
- if (ThreadWatcher.requests.length) {
- return ThreadWatcher.abort();
- } else {
- return ThreadWatcher.fetchAllStatus();
- }
- },
- fetchAllStatus: function() {
- var k, len1, ref, thread, threads;
- ThreadWatcher.db.forceSync();
- ThreadWatcher.unreaddb.forceSync();
- if ((ref = QuoteYou.db) != null) {
- ref.forceSync();
- }
- if (!(threads = ThreadWatcher.getAll()).length) {
- return;
- }
- for (k = 0, len1 = threads.length; k < len1; k++) {
- thread = threads[k];
- ThreadWatcher.fetchStatus(thread);
- }
- },
- fetchStatus: function(thread, force) {
- var boardID, data, req, threadID;
- boardID = thread.boardID, threadID = thread.threadID, data = thread.data;
- if (data.isDead && !force) {
- return;
- }
- if (ThreadWatcher.requests.length === 0) {
- ThreadWatcher.status.textContent = '...';
- $.addClass(ThreadWatcher.refreshButton, 'fa-spin');
- }
- req = $.ajax("//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json", {
- onloadend: function() {
- return ThreadWatcher.parseStatus.call(this, thread);
- },
- timeout: $.MINUTE
- }, {
- whenModified: force ? false : 'ThreadWatcher'
- });
- return ThreadWatcher.requests.push(req);
- },
- parseStatus: function(arg) {
- var boardID, data, isDead, k, lastReadPost, len1, match, postObj, quotesYou, quotingYou, ref, ref1, regexp, threadID, unread;
- boardID = arg.boardID, threadID = arg.threadID, data = arg.data;
- ThreadWatcher.fetched++;
- if (ThreadWatcher.fetched === ThreadWatcher.requests.length) {
- ThreadWatcher.clearRequests();
- } else {
- ThreadWatcher.status.textContent = (Math.round(ThreadWatcher.fetched / ThreadWatcher.requests.length * 100)) + "%";
- }
- if (this.status === 200 && this.response) {
- isDead = !!this.response.posts[0].archived;
- if (isDead && Conf['Auto Prune']) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- ThreadWatcher.refresh();
- return;
- }
- lastReadPost = ThreadWatcher.unreaddb.get({
- boardID: boardID,
- threadID: threadID,
- defaultValue: 0
- });
- unread = quotingYou = 0;
- ref = this.response.posts;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- postObj = ref[k];
- if (!(postObj.no > lastReadPost)) {
- continue;
- }
- if ((ref1 = QuoteYou.db) != null ? ref1.get({
- boardID: boardID,
- threadID: threadID,
- postID: postObj.no
- }) : void 0) {
- continue;
- }
- unread++;
- if (!(QuoteYou.db && postObj.com)) {
- continue;
- }
- quotesYou = false;
- regexp = /]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g;
- while (match = regexp.exec(postObj.com)) {
- if (QuoteYou.db.get({
- boardID: match[1] || boardID,
- threadID: match[2] || threadID,
- postID: match[3] || match[2] || threadID
- })) {
- quotesYou = true;
- break;
- }
- }
- if (quotesYou && !Filter.isHidden(Build.parseJSON(postObj, boardID))) {
- quotingYou++;
- }
- }
- if (isDead !== data.isDead || unread !== data.unread || quotingYou !== data.quotingYou) {
- data.isDead = isDead;
- data.unread = unread;
- data.quotingYou = quotingYou;
- ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- return ThreadWatcher.refresh();
- }
- } else if (this.status === 404) {
- if (Conf['Auto Prune']) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- } else {
- data.isDead = true;
- delete data.unread;
- delete data.quotingYou;
- ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- }
- return ThreadWatcher.refresh();
- }
- },
- getAll: function() {
- var all, boardID, data, ref, threadID, threads;
- all = [];
- ref = ThreadWatcher.db.data.boards;
- for (boardID in ref) {
- threads = ref[boardID];
- if (Conf['Current Board'] && boardID !== g.BOARD.ID) {
- continue;
- }
- for (threadID in threads) {
- data = threads[threadID];
- if (data && typeof data === 'object') {
- all.push({
- boardID: boardID,
- threadID: threadID,
- data: data
- });
- }
- }
- }
- return all;
- },
- makeLine: function(boardID, threadID, data) {
- var count, div, fullID, link, title, x;
- x = $.el('a', {
- className: 'fa fa-times',
- href: 'javascript:;'
- });
- $.on(x, 'click', ThreadWatcher.cb.rm);
- link = $.el('a', {
- href: "/" + boardID + "/thread/" + threadID,
- title: data.excerpt,
- className: 'watcher-link'
- });
- if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) {
- count = $.el('span', {
- textContent: "(" + data.unread + ")",
- className: 'watcher-unread'
- });
- $.add(link, count);
- }
- title = $.el('span', {
- textContent: data.excerpt,
- className: 'watcher-title'
- });
- $.add(link, title);
- div = $.el('div');
- fullID = boardID + "." + threadID;
- div.dataset.fullID = fullID;
- if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) {
- $.addClass(div, 'current');
- }
- if (data.isDead) {
- $.addClass(div, 'dead-thread');
- }
- if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
- if (data.unread === 0) {
- $.addClass(div, 'replies-read');
- }
- if (data.unread) {
- $.addClass(div, 'replies-unread');
- }
- if (data.quotingYou) {
- $.addClass(div, 'replies-quoting-you');
- }
- }
- $.add(div, [x, $.tn(' '), link]);
- return div;
- },
- refresh: function() {
- var boardID, data, k, len1, len2, list, nodes, q, ref, ref1, ref2, refresher, threadID;
- nodes = [];
- ref = ThreadWatcher.getAll();
- for (k = 0, len1 = ref.length; k < len1; k++) {
- ref1 = ref[k], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
- nodes.push(ThreadWatcher.makeLine(boardID, threadID, data));
- }
- list = ThreadWatcher.list;
- $.rmAll(list);
- $.add(list, nodes);
- g.threads.forEach(function(thread) {
- var helper, len2, post, q, ref2, toggler;
- helper = ThreadWatcher.isWatched(thread) ? ['addClass', 'Unwatch'] : ['rmClass', 'Watch'];
- if (thread.OP) {
- ref2 = [thread.OP].concat(slice.call(thread.OP.clones));
- for (q = 0, len2 = ref2.length; q < len2; q++) {
- post = ref2[q];
- toggler = $('.watch-thread-link', post.nodes.post);
- $[helper[0]](toggler, 'watched');
- toggler.title = helper[1] + " Thread";
- }
- }
- if (thread.catalogView) {
- return $[helper[0]](thread.catalogView.nodes.root, 'watched');
- }
- });
- ThreadWatcher.refreshIcon();
- ref2 = ThreadWatcher.menu.refreshers;
- for (q = 0, len2 = ref2.length; q < len2; q++) {
- refresher = ref2[q];
- refresher();
- }
- if (Index.nodes && Conf['Pin Watched Threads']) {
- Index.sort();
- return Index.buildIndex();
- }
- },
- refreshIcon: function() {
- var className, k, len1, ref;
- ref = ['replies-unread', 'replies-quoting-you'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- className = ref[k];
- ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog));
- }
- },
- update: function(boardID, threadID, newData) {
- var data, key, line, n, newLine, ref, val;
- if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
- boardID: boardID,
- threadID: threadID
- }) : void 0)) {
- return;
- }
- if (newData.isDead && Conf['Auto Prune']) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- ThreadWatcher.refresh();
- return;
- }
- n = 0;
- for (key in newData) {
- val = newData[key];
- if (data[key] !== val) {
- n++;
- }
- }
- if (!n) {
- return;
- }
- ThreadWatcher.db.forceSync();
- if (!(data = ThreadWatcher.db.get({
- boardID: boardID,
- threadID: threadID
- }))) {
- return;
- }
- $.extend(data, newData);
- ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- if (line = $("#watched-threads > [data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog)) {
- newLine = ThreadWatcher.makeLine(boardID, threadID, data);
- $.replace(line, newLine);
- return ThreadWatcher.refreshIcon();
- } else {
- return ThreadWatcher.refresh();
- }
- },
- set404: function(boardID, threadID, cb) {
- var data, ref;
- if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
- boardID: boardID,
- threadID: threadID
- }) : void 0)) {
- return cb();
- }
- if (Conf['Auto Prune']) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- return cb();
- }
- if (data.isDead && !((data.unread != null) || (data.quotingYou != null))) {
- return cb();
- }
- data.isDead = true;
- delete data.unread;
- delete data.quotingYou;
- return ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- }, cb);
- },
- toggle: function(thread) {
- var boardID, threadID;
- boardID = thread.board.ID;
- threadID = thread.ID;
- if (ThreadWatcher.db.get({
- boardID: boardID,
- threadID: threadID
- })) {
- return ThreadWatcher.rm(boardID, threadID);
- } else {
- return ThreadWatcher.add(thread);
- }
- },
- add: function(thread) {
- var boardID, data, threadID;
- data = {};
- boardID = thread.board.ID;
- threadID = thread.ID;
- if (thread.isDead) {
- if (Conf['Auto Prune'] && ThreadWatcher.db.get({
- boardID: boardID,
- threadID: threadID
- })) {
- ThreadWatcher.rm(boardID, threadID);
- return;
- }
- data.isDead = true;
- }
- data.excerpt = Get.threadExcerpt(thread);
- ThreadWatcher.db.set({
- boardID: boardID,
- threadID: threadID,
- val: data
- });
- ThreadWatcher.refresh();
- if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
- return ThreadWatcher.fetchStatus({
- boardID: boardID,
- threadID: threadID,
- data: data
- }, true);
- }
- },
- rm: function(boardID, threadID) {
- ThreadWatcher.db["delete"]({
- boardID: boardID,
- threadID: threadID
- });
- return ThreadWatcher.refresh();
- },
- menu: {
- refreshers: [],
- init: function() {
- var menu;
- if (!Conf['Thread Watcher']) {
- return;
- }
- menu = this.menu = new UI.Menu('thread watcher');
- $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) {
- return menu.toggle(e, this, ThreadWatcher);
- });
- this.addHeaderMenuEntry();
- return this.addMenuEntries();
- },
- addHeaderMenuEntry: function() {
- var entryEl;
- if (g.VIEW !== 'thread') {
- return;
- }
- entryEl = $.el('a', {
- href: 'javascript:;'
- });
- Header.menu.addEntry({
- el: entryEl,
- order: 60
- });
- $.on(entryEl, 'click', function() {
- return ThreadWatcher.toggle(g.threads[g.BOARD + "." + g.THREADID]);
- });
- return this.refreshers.push(function() {
- var addClass, ref, rmClass, text;
- ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = ref[0], rmClass = ref[1], text = ref[2];
- $.addClass(entryEl, addClass);
- $.rmClass(entryEl, rmClass);
- return entryEl.textContent = text;
- });
- },
- addMenuEntries: function() {
- var cb, conf, entries, entry, k, len1, name, ref, ref1, refresh, subEntries;
- entries = [];
- entries.push({
- cb: ThreadWatcher.cb.openAll,
- entry: {
- el: $.el('a', {
- textContent: 'Open all threads'
- })
- },
- refresh: function() {
- return (ThreadWatcher.list.firstElementChild ? $.rmClass : $.addClass)(this.el, 'disabled');
- }
- });
- entries.push({
- cb: ThreadWatcher.cb.pruneDeads,
- entry: {
- el: $.el('a', {
- textContent: 'Prune dead threads'
- })
- },
- refresh: function() {
- return ($('.dead-thread', ThreadWatcher.list) ? $.rmClass : $.addClass)(this.el, 'disabled');
- }
- });
- subEntries = [];
- ref = Config.threadWatcher;
- for (name in ref) {
- conf = ref[name];
- subEntries.push(this.createSubEntry(name, conf[1]));
- }
- entries.push({
- entry: {
- el: $.el('span', {
- textContent: 'Settings'
- }),
- subEntries: subEntries
- }
- });
- for (k = 0, len1 = entries.length; k < len1; k++) {
- ref1 = entries[k], entry = ref1.entry, cb = ref1.cb, refresh = ref1.refresh;
- if (entry.el.nodeName === 'A') {
- entry.el.href = 'javascript:;';
- }
- if (cb) {
- $.on(entry.el, 'click', cb);
- }
- if (refresh) {
- this.refreshers.push(refresh.bind(entry));
- }
- this.menu.addEntry(entry);
- }
- },
- createSubEntry: function(name, desc) {
- var entry, input;
- entry = {
- type: 'thread watcher',
- el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
- };
- entry.el.title = desc;
- input = entry.el.firstElementChild;
- if (name === 'Show Unread Count' && !ThreadWatcher.unreadEnabled) {
- input.disabled = true;
- $.addClass(entry.el, 'disabled');
- entry.el.title += '\n[Remember Last Read Post is disabled.]';
- }
- $.on(input, 'change', $.cb.checked);
- if (name === 'Current Board' || name === 'Show Unread Count') {
- $.on(input, 'change', ThreadWatcher.refresh);
- }
- if (name === 'Show Unread Count' || name === 'Auto Update Thread Watcher') {
- $.on(input, 'change', ThreadWatcher.fetchAuto);
- }
- return entry;
- }
- }
- };
-
- Unread = {
- init: function() {
- if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Remember Last Read Post'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) {
- return;
- }
- if (Conf['Remember Last Read Post']) {
- $.sync('Remember Last Read Post', function(enabled) {
- return Conf['Remember Last Read Post'] = enabled;
- });
- this.db = new DataBoard('lastReadPosts', this.sync);
- }
- this.hr = $.el('hr', {
- id: 'unread-line'
- });
- this.posts = new Set();
- this.postsQuotingYou = new Set();
- this.order = new RandomAccessList();
- this.position = null;
- Thread.callbacks.push({
- name: 'Unread',
- cb: this.node
- });
- return Post.callbacks.push({
- name: 'Unread',
- cb: this.addPost
- });
- },
- node: function() {
- var ID, k, len1, ref, ref1;
- Unread.thread = this;
- Unread.title = d.title;
- Unread.lastReadPost = ((ref = Unread.db) != null ? ref.get({
- boardID: this.board.ID,
- threadID: this.ID
- }) : void 0) || 0;
- Unread.readCount = 0;
- ref1 = this.posts.keys;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- ID = ref1[k];
- if (+ID <= Unread.lastReadPost) {
- Unread.readCount++;
- }
- }
- $.one(d, '4chanXInitFinished', Unread.ready);
- return $.on(d, 'ThreadUpdate', Unread.onUpdate);
- },
- ready: function() {
- if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) {
- Unread.scroll();
- }
- Unread.setLine(true);
- Unread.read();
- Unread.update();
- $.on(d, 'scroll visibilitychange', Unread.read);
- if (Conf['Unread Line']) {
- return $.on(d, 'visibilitychange', Unread.setLine);
- }
- },
- positionPrev: function() {
- if (Unread.position) {
- return Unread.position.prev;
- } else {
- return Unread.order.last;
- }
- },
- scroll: function() {
- var hash, position, ref, root;
- if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
- return;
- }
- ReplyPruning.showIfHidden((ref = Unread.position) != null ? ref.data.nodes.root.id : void 0);
- position = Unread.positionPrev();
- while (position) {
- root = position.data.nodes.root;
- if (!root.getBoundingClientRect().height) {
- position = position.prev;
- } else {
- Header.scrollToIfNeeded(root, true);
- break;
- }
- }
- },
- sync: function() {
- var ID, i, k, lastReadPost, postIDs, ref, ref1;
- if (Unread.lastReadPost == null) {
- return;
- }
- lastReadPost = Unread.db.get({
- boardID: Unread.thread.board.ID,
- threadID: Unread.thread.ID,
- defaultValue: 0
- });
- if (!(Unread.lastReadPost < lastReadPost)) {
- return;
- }
- Unread.lastReadPost = lastReadPost;
- postIDs = Unread.thread.posts.keys;
- for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
- ID = +postIDs[i];
- if (!Unread.thread.posts[ID].isFetchedQuote) {
- if (ID > Unread.lastReadPost) {
- break;
- }
- Unread.posts["delete"](ID);
- Unread.postsQuotingYou["delete"](ID);
- }
- Unread.readCount++;
- }
- Unread.updatePosition();
- Unread.setLine();
- return Unread.update();
- },
- addPost: function() {
- var ref;
- if (this.isFetchedQuote || this.isClone) {
- return;
- }
- Unread.order.push(this);
- if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QuoteYou.db) != null ? ref.get({
- boardID: this.board.ID,
- threadID: this.thread.ID,
- postID: this.ID
- }) : void 0)) {
- return;
- }
- Unread.posts.add(this.ID);
- Unread.addPostQuotingYou(this);
- return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
- },
- addPostQuotingYou: function(post) {
- var k, len1, quotelink, ref, ref1;
- ref = post.nodes.quotelinks;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- quotelink = ref[k];
- if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
- continue;
- }
- Unread.postsQuotingYou.add(post.ID);
- Unread.openNotification(post);
- return;
- }
- },
- openNotification: function(post) {
- var notif;
- if (!Header.areNotificationsEnabled) {
- return;
- }
- try {
- notif = new Notification(post.info.nameBlock + " replied to you", {
- body: post.info.commentDisplay,
- icon: Favicon.logo
- });
- notif.onclick = function() {
- Header.scrollToIfNeeded(post.nodes.root, true);
- return $.global(function() {
- return window.focus();
- });
- };
- return notif.onshow = function() {
- return setTimeout(function() {
- return notif.close();
- }, 7 * $.SECOND);
- };
- } catch (_error) {}
- },
- onUpdate: function(e) {
- if (!e.detail[404]) {
- Unread.setLine();
- Unread.read();
- }
- return Unread.update();
- },
- readSinglePost: function(post) {
- var ID;
- ID = post.ID;
- if (!Unread.posts.has(ID)) {
- return;
- }
- Unread.posts["delete"](ID);
- Unread.postsQuotingYou["delete"](ID);
- Unread.updatePosition();
- Unread.saveLastReadPost();
- return Unread.update();
- },
- read: $.debounce(100, function(e) {
- var ID, count, data, ref, ref1, root;
- if (!Unread.posts.size && Unread.readCount !== Unread.thread.posts.keys.length) {
- Unread.saveLastReadPost();
- }
- if (d.hidden || !Unread.posts.size) {
- return;
- }
- count = 0;
- while (Unread.position) {
- ref = Unread.position, ID = ref.ID, data = ref.data;
- root = data.nodes.root;
- if (!(!root.getBoundingClientRect().height || Header.getBottomOf(root) > -1)) {
- break;
- }
- count++;
- Unread.posts["delete"](ID);
- Unread.postsQuotingYou["delete"](ID);
- if ((ref1 = QuoteYou.db) != null ? ref1.get({
- boardID: data.board.ID,
- threadID: data.thread.ID,
- postID: ID
- }) : void 0) {
- QuoteYou.lastRead = root;
- }
- Unread.position = Unread.position.next;
- }
- if (!count) {
- return;
- }
- Unread.updatePosition();
- Unread.saveLastReadPost();
- if (e) {
- return Unread.update();
- }
- }),
- updatePosition: function() {
- while (Unread.position && !Unread.posts.has(Unread.position.ID)) {
- Unread.position = Unread.position.next;
- }
- },
- saveLastReadPost: $.debounce(2 * $.SECOND, function() {
- var ID, i, k, postIDs, ref, ref1;
- $.forceSync('Remember Last Read Post');
- if (!(Conf['Remember Last Read Post'] && Unread.db)) {
- return;
- }
- postIDs = Unread.thread.posts.keys;
- for (i = k = ref = Unread.readCount, ref1 = postIDs.length; k < ref1; i = k += 1) {
- ID = +postIDs[i];
- if (!Unread.thread.posts[ID].isFetchedQuote) {
- if (Unread.posts.has(ID)) {
- break;
- }
- Unread.lastReadPost = ID;
- }
- Unread.readCount++;
- }
- if (Unread.thread.isDead && !Unread.thread.isArchived) {
- return;
- }
- Unread.db.forceSync();
- return Unread.db.set({
- boardID: Unread.thread.board.ID,
- threadID: Unread.thread.ID,
- val: Unread.lastReadPost
- });
- }),
- setLine: function(force) {
- if (!Conf['Unread Line']) {
- return;
- }
- if (Unread.hr.hidden || d.hidden || (force === true)) {
- if ((Unread.linePosition = Unread.positionPrev())) {
- $.after(Unread.linePosition.data.nodes.root, Unread.hr);
- } else {
- $.rm(Unread.hr);
- }
- }
- return Unread.hr.hidden = Unread.linePosition === Unread.order.last;
- },
- update: function() {
- var count, countQuotingYou, isDead, titleCount, titleDead, titleQuotingYou;
- count = Unread.posts.size;
- countQuotingYou = Unread.postsQuotingYou.size;
- if (Conf['Unread Count']) {
- titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : '';
- titleCount = count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '';
- titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title;
- d.title = "" + titleQuotingYou + titleCount + titleDead;
- }
- $.forceSync('Remember Last Read Post');
- if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) {
- ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, {
- isDead: Unread.thread.isDead,
- unread: count,
- quotingYou: countQuotingYou
- });
- }
- if (Conf['Unread Favicon']) {
- isDead = Unread.thread.isDead;
- Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default'];
- return $.add(d.head, Favicon.el);
- }
- }
- };
-
- Redirect = {
- init: function() {
- var archive, archives, boardID, boards, data, files, id, k, len1, len2, name, o, q, record, ref, ref1, software, type, uid, withCredentials;
- o = {
- thread: {},
- post: {},
- file: {},
- report: {}
- };
- archives = {};
- ref = Redirect.archives;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- data = ref[k];
- uid = data.uid, name = data.name, boards = data.boards, files = data.files, software = data.software, withCredentials = data.withCredentials;
- archives[JSON.stringify(uid != null ? uid : name)] = data;
- for (q = 0, len2 = boards.length; q < len2; q++) {
- boardID = boards[q];
- if (!withCredentials) {
- if (!(boardID in o.thread)) {
- o.thread[boardID] = data;
- }
- if (!(boardID in o.post || software !== 'foolfuuka')) {
- o.post[boardID] = data;
- }
- if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) {
- o.file[boardID] = data;
- }
- }
- if (name === 'fgts') {
- o.report[boardID] = data;
- }
- }
- }
- ref1 = Conf['selectedArchives'];
- for (boardID in ref1) {
- record = ref1[boardID];
- for (type in record) {
- id = record[type];
- if (id === null) {
- delete o[type][boardID];
- } else if (archive = archives[JSON.stringify(id)]) {
- boards = type === 'file' ? archive.files : archive.boards;
- if (indexOf.call(boards, boardID) >= 0) {
- o[type][boardID] = archive;
- }
- }
- }
- }
- return Redirect.data = o;
- },
- archives: [{"uid":3,"name":"4plebs","domain":"archive.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["adv","f","hr","o","pol","s4s","sp","tg","trv","tv","x"],"files":["adv","f","hr","o","pol","s4s","sp","tg","trv","tv","x"]},{"uid":4,"name":"Nyafuu Archive","domain":"archive.nyafuu.org","http":true,"https":true,"software":"foolfuuka","boards":["c","e","news","w","wg","wsr"],"files":["c","e","news","w","wg","wsr"]},{"uid":8,"name":"Rebecca Black Tech","domain":"rbt.asia","http":false,"https":true,"software":"fuuka","boards":["cgl","g","mu"],"files":["cgl","g","mu"]},{"uid":10,"name":"warosu","domain":"warosu.org","http":false,"https":true,"software":"fuuka","boards":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"],"files":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"]},{"uid":15,"name":"fgts","domain":"fgts.jp","http":true,"https":true,"software":"foolfuuka","boards":["asp","b","cm","gd","h","hc","hm","n","out","p","po","qa","r","s","soc","toy","vp","y"],"files":["asp","b","cm","gd","h","hc","hm","n","out","p","po","qa","r","s","soc","toy","vp","y"]},{"uid":23,"name":"Desustorage","domain":"desustorage.org","http":true,"https":true,"software":"foolfuuka","boards":["a","aco","an","c","co","d","fit","gif","his","int","k","m","mlp","qa","r9k","tg","trash","vr","wsg"],"files":["a","aco","an","c","co","d","fit","gif","his","int","k","m","mlp","qa","r9k","tg","trash","vr","wsg"]},{"uid":24,"name":"fireden.net","domain":"boards.fireden.net","http":false,"https":true,"software":"foolfuuka","boards":["a","cm","ic","sci","tg","v","vg","y"],"files":["a","cm","ic","sci","tg","v","vg","y"]},{"uid":25,"name":"arch.b4k.co","domain":"arch.b4k.co","http":true,"https":true,"software":"foolfuuka","boards":["g","jp","mlp","v"],"files":[]},{"uid":5,"name":"Love is Over","domain":"deploy.loveisover.me","http":true,"https":false,"software":"foolfuuka","boards":["c","d","e","i","lgbt","t","u"],"files":["c","d","e","i","lgbt","t","u"],"search":[]},{"uid":28,"name":"bstats","domain":"archive.b-stats.org","http":true,"https":true,"software":"foolfuuka","boards":["f","cm","hm","lgbt","news","trash","y"],"files":[]}],
- to: function(dest, data) {
- var archive;
- archive = (dest === 'search' || dest === 'board' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
- if (!archive) {
- return '';
- }
- return Redirect[dest](archive, data);
- },
- protocol: function(archive) {
- var protocol;
- protocol = location.protocol;
- if (!archive[protocol.slice(0, -1)]) {
- protocol = protocol === 'https:' ? 'http:' : 'https:';
- }
- return protocol + "//";
- },
- 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') {
- path += '/';
- }
- if (threadID && postID) {
- path += archive.software === 'foolfuuka' ? "#" + postID : "#p" + postID;
- }
- return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
- },
- post: function(archive, arg) {
- var boardID, postID, protocol, url;
- boardID = arg.boardID, postID = arg.postID;
- protocol = Redirect.protocol(archive);
- url = "" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID;
- if (!Redirect.securityCheck(url)) {
- return '';
- }
- return url;
- },
- file: function(archive, arg) {
- var boardID, filename;
- boardID = arg.boardID, filename = arg.filename;
- return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
- },
- board: function(archive, arg) {
- var boardID;
- boardID = arg.boardID;
- return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/";
- },
- 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;
- if (type === 'capcode') {
- value = {
- 'Developer': 'dev'
- }[value] || value.toLowerCase();
- } else if (type === 'image') {
- value = value.replace(/[+\/=]/g, function(c) {
- return {
- '+': '-',
- '/': '_',
- '=': ''
- }[c];
- });
- }
- value = encodeURIComponent(value);
- path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value + "/" : type === 'image' ? boardID + "/image/" + value : boardID + "/?task=search2&search_" + type + "=" + value;
- return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
- },
- report: function(archive, arg) {
- var boardID, postID;
- boardID = arg.boardID, postID = arg.postID;
- return "https://so.fgts.jp/report/?board=" + boardID + "&no=" + postID;
- },
- securityCheck: function(url) {
- return /^https:\/\//.test(url) || location.protocol === 'http:' || Conf['Exempt Archives from Encryption'];
- },
- navigate: function(dest, data, alternative) {
- var url;
- if (!Redirect.data) {
- Redirect.init();
- }
- url = Redirect.to(dest, data);
- if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) {
- return location.replace(url);
- } else if (alternative) {
- return location.replace(alternative);
- }
- }
- };
-
- PSAHiding = {
- init: function() {
- if (!Conf['Announcement Hiding']) {
- return;
- }
- $.addClass(doc, 'hide-announcement');
- return $.one(d, '4chanXInitFinished', this.setup);
- },
- setup: function() {
- var btn, entry, hr, psa, ref;
- if (!(psa = PSAHiding.psa = $.id('globalMessage'))) {
- $.rmClass(doc, 'hide-announcement');
- return;
- }
- if ((hr = (ref = $.id('globalToggle')) != null ? ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
- PSAHiding.hr = hr;
- }
- entry = {
- el: $.el('a', {
- textContent: 'Show announcement',
- className: 'show-announcement',
- href: 'javascript:;'
- }),
- order: 50,
- open: function() {
- return PSAHiding.hidden;
- }
- };
- Header.menu.addEntry(entry);
- $.on(entry.el, 'click', PSAHiding.toggle);
- PSAHiding.btn = btn = $.el('span', {
- title: 'Mark announcement as read and hide.',
- className: 'hide-announcement'
- });
- $.extend(btn, {
- innerHTML: "[ Dismiss ]"
- });
- $.on(btn, 'click', PSAHiding.toggle);
- $.get('hiddenPSA', 0, function(arg) {
- var hiddenPSA;
- hiddenPSA = arg.hiddenPSA;
- PSAHiding.sync(hiddenPSA);
- $.add(psa, btn);
- return $.rmClass(doc, 'hide-announcement');
- });
- return $.sync('hiddenPSA', PSAHiding.sync);
- },
- toggle: function() {
- var UTC;
- if ($.hasClass(this, 'hide-announcement')) {
- UTC = +$.id('globalMessage').dataset.utc;
- $.set('hiddenPSA', UTC);
- } else {
- $.event('CloseMenu');
- $["delete"]('hiddenPSA');
- }
- return PSAHiding.sync(UTC);
- },
- sync: function(UTC) {
- var psa, ref;
- psa = PSAHiding.psa;
- PSAHiding.hidden = PSAHiding.btn.hidden = (UTC != null) && UTC >= +psa.dataset.utc;
- if (PSAHiding.hidden) {
- $.rm(psa);
- } else {
- $.after($.id('globalToggle'), psa);
- }
- if ((ref = PSAHiding.hr) != null) {
- ref.hidden = PSAHiding.hidden;
- }
- }
- };
-
- AntiAutoplay = {
- init: function() {
- var audio, k, len1, ref;
- if (!Conf['Disable Autoplaying Sounds']) {
- return;
- }
- $.addClass(doc, 'anti-autoplay');
- ref = $$('audio[autoplay]', doc);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- audio = ref[k];
- this.stop(audio);
- }
- window.addEventListener('loadstart', ((function(_this) {
- return function(e) {
- return _this.stop(e.target);
- };
- })(this)), true);
- Post.callbacks.push({
- name: 'Disable Autoplaying Sounds',
- cb: this.node
- });
- CatalogThread.callbacks.push({
- name: 'Disable Autoplaying Sounds',
- cb: this.node
- });
- return $.ready((function(_this) {
- return function() {
- return _this.process(d.body);
- };
- })(this));
- },
- stop: function(audio) {
- if (!audio.autoplay) {
- return;
- }
- audio.pause();
- audio.autoplay = false;
- if (audio.controls) {
- return;
- }
- audio.controls = true;
- return $.addClass(audio, 'controls-added');
- },
- node: function() {
- return AntiAutoplay.process(this.nodes.root);
- },
- process: function(root) {
- var iframe, k, len1, len2, object, q, ref, ref1;
- ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- iframe = ref[k];
- iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
- $.addClass(iframe, 'autoplay-removed');
- }
- ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- object = ref1[q];
- object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
- $.addClass(object, 'autoplay-removed');
- }
- }
- };
-
- Banner = {
- banners: ["0.jpg","1.jpg","2.jpg","4.jpg","6.jpg","7.jpg","8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg","14.jpg","16.jpg","17.jpg","18.jpg","19.jpg","20.jpg","21.jpg","22.jpg","24.jpg","25.jpg","26.jpg","28.jpg","29.jpg","33.jpg","38.jpg","39.jpg","43.jpg","44.jpg","45.jpg","46.jpg","47.jpg","52.jpg","54.jpg","57.jpg","59.jpg","60.jpg","61.jpg","64.jpg","66.jpg","67.jpg","69.jpg","71.jpg","72.jpg","76.jpg","77.jpg","81.jpg","82.jpg","83.jpg","84.jpg","88.jpg","90.jpg","91.jpg","96.jpg","98.jpg","99.jpg","100.jpg","104.jpg","106.jpg","116.jpg","119.jpg","137.jpg","140.jpg","148.jpg","149.jpg","150.jpg","154.jpg","156.jpg","157.jpg","158.jpg","159.jpg","161.jpg","162.jpg","164.jpg","165.jpg","166.jpg","167.jpg","168.jpg","169.jpg","170.jpg","171.jpg","172.jpg","173.jpg","174.jpg","175.jpg","176.jpg","178.jpg","179.jpg","180.jpg","181.jpg","182.jpg","183.jpg","186.jpg","189.jpg","190.jpg","192.jpg","193.jpg","194.jpg","197.jpg","198.jpg","200.jpg","201.jpg","202.jpg","203.jpg","205.jpg","206.jpg","207.jpg","208.jpg","210.jpg","213.jpg","214.jpg","215.jpg","216.jpg","218.jpg","219.jpg","220.jpg","221.jpg","222.jpg","223.jpg","224.jpg","227.jpg","0.png","1.png","2.png","3.png","5.png","6.png","9.png","10.png","11.png","12.png","14.png","16.png","19.png","20.png","21.png","22.png","23.png","24.png","26.png","27.png","28.png","29.png","30.png","31.png","32.png","33.png","34.png","37.png","39.png","40.png","41.png","42.png","43.png","44.png","45.png","48.png","49.png","50.png","51.png","52.png","53.png","57.png","58.png","59.png","64.png","66.png","67.png","68.png","69.png","70.png","71.png","72.png","76.png","78.png","79.png","81.png","82.png","85.png","86.png","87.png","89.png","95.png","98.png","100.png","101.png","102.png","105.png","106.png","107.png","109.png","110.png","111.png","112.png","113.png","114.png","115.png","116.png","118.png","119.png","120.png","121.png","122.png","123.png","126.png","128.png","130.png","134.png","136.png","138.png","139.png","140.png","142.png","145.png","146.png","149.png","150.png","151.png","152.png","153.png","154.png","155.png","156.png","157.png","158.png","159.png","160.png","163.png","164.png","165.png","166.png","167.png","168.png","169.png","170.png","171.png","172.png","173.png","174.png","178.png","179.png","180.png","181.png","182.png","184.png","186.png","188.png","190.png","192.png","193.png","194.png","195.png","196.png","197.png","198.png","200.png","202.png","203.png","205.png","206.png","207.png","209.png","212.png","213.png","214.png","216.png","217.png","218.png","219.png","220.png","221.png","222.png","223.png","224.png","225.png","226.png","229.png","231.png","232.png","233.png","234.png","235.png","237.png","238.png","239.png","240.png","241.png","242.png","244.png","245.png","246.png","247.png","248.png","249.png","250.png","253.png","254.png","255.png","256.png","257.png","258.png","259.png","260.png","262.png","268.png","0.gif","1.gif","2.gif","3.gif","4.gif","5.gif","6.gif","7.gif","8.gif","9.gif","10.gif","12.gif","13.gif","14.gif","15.gif","16.gif","18.gif","19.gif","20.gif","21.gif","22.gif","23.gif","24.gif","28.gif","29.gif","30.gif","33.gif","34.gif","35.gif","36.gif","37.gif","39.gif","40.gif","42.gif","44.gif","45.gif","46.gif","48.gif","50.gif","52.gif","54.gif","55.gif","57.gif","58.gif","59.gif","60.gif","61.gif","63.gif","64.gif","66.gif","67.gif","68.gif","69.gif","70.gif","72.gif","73.gif","75.gif","76.gif","77.gif","78.gif","80.gif","81.gif","82.gif","83.gif","86.gif","87.gif","88.gif","92.gif","93.gif","94.gif","95.gif","96.gif","97.gif","98.gif","99.gif","100.gif","101.gif","102.gif","103.gif","104.gif","105.gif","106.gif","108.gif","109.gif","110.gif","111.gif","112.gif","113.gif","115.gif","116.gif","117.gif","118.gif","119.gif","120.gif","122.gif","123.gif","124.gif","127.gif","129.gif","130.gif","131.gif","134.gif","135.gif","136.gif","138.gif","139.gif","141.gif","144.gif","146.gif","148.gif","149.gif","153.gif","154.gif","155.gif","157.gif","158.gif","159.gif","160.gif","161.gif","162.gif","164.gif","166.gif","167.gif","168.gif","169.gif","170.gif","171.gif","172.gif","173.gif","174.gif","175.gif","176.gif","177.gif","178.gif","181.gif","182.gif","183.gif","185.gif","186.gif","187.gif","188.gif","189.gif","190.gif","191.gif","192.gif","193.gif","195.gif","196.gif","197.gif","200.gif","201.gif","202.gif","203.gif","204.gif","205.gif","206.gif","207.gif","208.gif","209.gif","210.gif","211.gif","212.gif","213.gif","214.gif","215.gif","216.gif","217.gif","219.gif","220.gif","221.gif","222.gif","224.gif","225.gif","226.gif","227.gif","228.gif","230.gif","232.gif","233.gif","234.gif","235.gif","238.gif","240.gif","241.gif","243.gif","244.gif","245.gif","246.gif","247.gif","249.gif","250.gif","251.gif","253.gif"],
- init: function() {
- if (Conf['Custom Board Titles']) {
- this.db = new DataBoard('customTitles', null, true);
- }
- $.asap((function() {
- return d.body;
- }), function() {
- return $.asap((function() {
- return $('hr');
- }), Banner.ready);
- });
- if (g.BOARD.ID !== 'f') {
- return Main.ready(function() {
- return $.queueTask(Banner.load);
- });
- }
- },
- ready: function() {
- var banner, children;
- banner = $(".boardBanner");
- children = banner.children;
- if (g.BOARD.ID !== 'f' && g.VIEW === 'thread' && Conf['Remove Thread Excerpt']) {
- Banner.setTitle(children[1].textContent);
- }
- children[0].title = "Click to change";
- $.on(children[0], 'click', Banner.cb.toggle);
- if (Conf['Custom Board Titles']) {
- Banner.custom(children[1]);
- if (children[2]) {
- return Banner.custom(children[2]);
- }
- }
- },
- load: function() {
- var bannerCnt, img;
- bannerCnt = $.id('bannerCnt');
- if (!bannerCnt.firstChild) {
- img = $.el('img', {
- alt: '4chan',
- src: '//s.4cdn.org/image/title/' + bannerCnt.dataset.src
- });
- return $.add(bannerCnt, img);
- }
- },
- setTitle: function(title) {
- if (Unread.title != null) {
- Unread.title = title;
- return Unread.update();
- } else {
- return d.title = title;
- }
- },
- cb: {
- toggle: function() {
- var banner, i, ref;
- if (!((ref = Banner.choices) != null ? ref.length : void 0)) {
- Banner.choices = Banner.banners.slice();
- }
- i = Math.floor(Banner.choices.length * Math.random());
- banner = Banner.choices.splice(i, 1);
- return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner;
- },
- click: function(e) {
- var base1, br, k, len1, name1, ref;
- if (!(e.ctrlKey || e.metaKey)) {
- return;
- }
- if ((base1 = Banner.original)[name1 = this.className] == null) {
- base1[name1] = this.cloneNode(true);
- }
- this.contentEditable = true;
- ref = $$('br', this);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- br = ref[k];
- $.replace(br, $.tn('\n'));
- }
- return this.focus();
- },
- keydown: function(e) {
- e.stopPropagation();
- if (!e.shiftKey && e.keyCode === 13) {
- return this.blur();
- }
- },
- blur: function() {
- var br, k, len1, ref;
- ref = $$('br', this);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- br = ref[k];
- $.replace(br, $.tn('\n'));
- }
- if (this.textContent = this.textContent.replace(/\n*$/, '')) {
- this.contentEditable = false;
- return Banner.db.set({
- boardID: g.BOARD.ID,
- threadID: this.className,
- val: {
- title: this.textContent,
- orig: Banner.original[this.className].textContent
- }
- });
- } else {
- $.rmAll(this);
- $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes));
- return Banner.db["delete"]({
- boardID: g.BOARD.ID,
- threadID: this.className
- });
- }
- }
- },
- original: {},
- custom: function(child) {
- var className, data, event, items, k, len1, ref, string, string2;
- className = child.className;
- child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase());
- child.spellcheck = false;
- ref = ['click', 'keydown', 'blur'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- event = ref[k];
- $.on(child, event, Banner.cb[event]);
- }
- string = g.BOARD + "." + className;
- string2 = string + ".orig";
- items = {};
- items[string] = '';
- items[string2] = child.textContent;
- $.get(items, function(items) {
- if (items[string]) {
- Banner.db.set({
- boardID: g.BOARD.ID,
- threadID: className,
- val: {
- title: items[string],
- orig: items[string2]
- }
- });
- }
- return $["delete"]([string, string2]);
- });
- if (data = Banner.db.get({
- boardID: g.BOARD.ID,
- threadID: className
- })) {
- if (Conf['Persistent Custom Board Titles'] || data.orig === child.textContent) {
- Banner.original[className] = child.cloneNode(true);
- return child.textContent = data.title;
- } else {
- return Banner.db["delete"]({
- boardID: g.BOARD.ID,
- threadID: className
- });
- }
- }
- }
- };
-
- CatalogLinks = {
- init: function() {
- var el, input, selector;
- if ((Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) {
- selector = (function() {
- switch (g.VIEW) {
- case 'thread':
- case 'archive':
- return '.navLinks.desktop > a';
- case 'catalog':
- return '.navLinks > :first-child > a';
- case 'index':
- return '#ctrl-top > a, .cataloglink > a';
- }
- })();
- $.ready(function() {
- var catalogLink, k, len1, link, ref;
- ref = $$(selector);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- link = ref[k];
- switch (link.pathname.replace(/\/+/g, '/')) {
- case "/" + g.BOARD + "/":
- if (Conf['JSON Index']) {
- link.textContent = 'Index';
- }
- link.href = CatalogLinks.index();
- break;
- case "/" + g.BOARD + "/catalog":
- link.href = CatalogLinks.catalog();
- }
- if (g.VIEW === 'catalog' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
- catalogLink = link.parentNode.cloneNode(true);
- catalogLink.firstElementChild.textContent = '4chan X Catalog';
- catalogLink.firstElementChild.href = CatalogLinks.catalog();
- $.after(link.parentNode, [$.tn(' '), catalogLink]);
- }
- }
- });
- }
- if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
- Post.callbacks.push({
- name: 'Catalog Link Rewrite',
- cb: this.node
- });
- CatalogThread.callbacks.push({
- name: 'Catalog Link Rewrite',
- cb: this.node
- });
- }
- if (Conf['Catalog Links']) {
- CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links');
- el.id = 'toggleCatalog';
- input = $('input', el);
- $.on(input, 'change', this.toggle);
- $.sync('Header catalog links', CatalogLinks.set);
- return Header.menu.addEntry({
- el: el,
- order: 95
- });
- }
- },
- node: function() {
- var a, k, len1, m, ref;
- ref = $$('a', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- a = ref[k];
- if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
- a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
- }
- }
- },
- initBoardList: function() {
- if (!CatalogLinks.el) {
- return;
- }
- return CatalogLinks.set(Conf['Header catalog links']);
- },
- toggle: function() {
- $.event('CloseMenu');
- $.set('Header catalog links', this.checked);
- return CatalogLinks.set(this.checked);
- },
- set: function(useCatalog) {
- var a, board, k, len1, ref, ref1;
- ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
- for (k = 0, len1 = ref.length; k < len1; k++) {
- a = ref[k];
- if (((ref1 = a.hostname) !== 'boards.4chan.org' && ref1 !== 'catalog.neet.tv') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
- continue;
- }
- a.href = useCatalog ? CatalogLinks.catalog(board) : "/" + board + "/";
- if (a.dataset.indexOptions && a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
- a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions;
- }
- }
- CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
- return $('input', CatalogLinks.el).checked = useCatalog;
- },
- catalog: function(board) {
- if (board == null) {
- board = g.BOARD.ID;
- }
- if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) {
- return "http://catalog.neet.tv/" + board + "/";
- } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
- if (g.BOARD.ID === board && g.VIEW === 'index') {
- return '#catalog';
- } else {
- return "/" + board + "/#catalog";
- }
- } else {
- return "/" + board + "/catalog";
- }
- },
- index: function(board) {
- if (board == null) {
- board = g.BOARD.ID;
- }
- if (Conf['JSON Index'] && board !== 'f') {
- if (g.BOARD.ID === board && g.VIEW === 'index') {
- return '#index';
- } else {
- return "/" + board + "/#index";
- }
- } else {
- return "/" + board + "/";
- }
- }
- };
-
- CustomCSS = {
- init: function() {
- if (!Conf['Custom CSS']) {
- return;
- }
- return this.addStyle();
- },
- addStyle: function() {
- return this.style = $.addStyle(Conf['usercss'], 'custom-css', '#fourchanx-css');
- },
- rmStyle: function() {
- if (this.style) {
- $.rm(this.style);
- return delete this.style;
- }
- },
- update: function() {
- if (!this.style) {
- return this.addStyle();
- }
- return this.style.textContent = Conf['usercss'];
- }
- };
-
- ExpandComment = {
- init: function() {
- if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) {
- return;
- }
- if (g.BOARD.ID === 'g') {
- this.callbacks.push(Fourchan.code);
- }
- if (g.BOARD.ID === 'sci') {
- this.callbacks.push(Fourchan.math);
- }
- return Post.callbacks.push({
- name: 'Comment Expansion',
- cb: this.node
- });
- },
- node: function() {
- var a;
- if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
- return $.on(a, 'click', ExpandComment.cb);
- }
- },
- callbacks: [],
- cb: function(e) {
- e.preventDefault();
- return ExpandComment.expand(Get.postFromNode(this));
- },
- 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;
- return;
- }
- if (!(a = $('.abbr > a', post.nodes.comment))) {
- return;
- }
- a.textContent = "Post No." + post + " Loading...";
- return $.cache("//a.4cdn.org" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + ".json", function() {
- return ExpandComment.parse(this, a, post);
- });
- },
- contract: function(post) {
- var a;
- if (!post.nodes.shortComment) {
- return;
- }
- a = $('.abbr > a', post.nodes.shortComment);
- a.textContent = 'here';
- $.replace(post.nodes.longComment, post.nodes.shortComment);
- return post.nodes.comment = post.nodes.shortComment;
- },
- parse: function(req, a, post) {
- var callback, clone, comment, href, k, len1, len2, len3, postObj, posts, q, quote, ref, ref1, spoilerRange, status, u;
- status = req.status;
- if (status !== 200 && status !== 304) {
- a.textContent = "Error " + req.statusText + " (" + status + ")";
- return;
- }
- posts = req.response.posts;
- if (spoilerRange = posts[0].custom_spoiler) {
- Build.spoilerRange[g.BOARD] = spoilerRange;
- }
- for (k = 0, len1 = posts.length; k < len1; k++) {
- postObj = posts[k];
- if (postObj.no === post.ID) {
- break;
- }
- }
- if (postObj.no !== post.ID) {
- a.textContent = "Post No." + post + " not found.";
- return;
- }
- comment = post.nodes.comment;
- clone = comment.cloneNode(false);
- clone.innerHTML = postObj.com;
- ref = $$('.quotelink', clone);
- for (q = 0, len2 = ref.length; q < len2; q++) {
- quote = ref[q];
- href = quote.getAttribute('href');
- if (href[0] === '/') {
- continue;
- }
- if (href[0] === '#') {
- quote.href = "" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + href;
- } else {
- quote.href = (a.pathname.split(/\/+/).splice(0, 3).join('/')) + "/" + href;
- }
- }
- post.nodes.shortComment = comment;
- $.replace(comment, clone);
- post.nodes.comment = post.nodes.longComment = clone;
- post.parseComment();
- post.parseQuotes();
- ref1 = ExpandComment.callbacks;
- for (u = 0, len3 = ref1.length; u < len3; u++) {
- callback = ref1[u];
- callback.call(post);
- }
- }
- };
-
- ExpandThread = {
- statuses: {},
- init: function() {
- if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
- return;
- }
- if (Conf['JSON Index']) {
- return $.on(d, 'IndexRefresh', this.onIndexRefresh);
- } else {
- return Thread.callbacks.push({
- name: 'Expand Thread',
- cb: function() {
- return ExpandThread.setButton(this);
- }
- });
- }
- },
- setButton: function(thread) {
- var a;
- if (!(a = $.x('following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
- return;
- }
- a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
- a.style.cursor = 'pointer';
- return $.on(a, 'click', ExpandThread.cbToggle);
- },
- disconnect: function(refresh) {
- var ref, ref1, status, threadID;
- if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
- return;
- }
- ref = ExpandThread.statuses;
- for (threadID in ref) {
- status = ref[threadID];
- if ((ref1 = status.req) != null) {
- ref1.abort();
- }
- delete ExpandThread.statuses[threadID];
- }
- if (!refresh) {
- return $.off(d, 'IndexRefresh', this.onIndexRefresh);
- }
- },
- onIndexRefresh: function() {
- ExpandThread.disconnect(true);
- return g.BOARD.threads.forEach(function(thread) {
- return ExpandThread.setButton(thread);
- });
- },
- cbToggle: function(e) {
- if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
- return;
- }
- e.preventDefault();
- return ExpandThread.toggle(Get.threadFromNode(this));
- },
- toggle: function(thread) {
- var a, threadRoot;
- threadRoot = thread.OP.nodes.root.parentNode;
- if (!(a = $('.summary', threadRoot))) {
- return;
- }
- if (thread.ID in ExpandThread.statuses) {
- return ExpandThread.contract(thread, a, threadRoot);
- } else {
- return ExpandThread.expand(thread, a);
- }
- },
- expand: function(thread, a) {
- var status;
- ExpandThread.statuses[thread] = status = {};
- a.textContent = Build.summaryText.apply(Build, ['...'].concat(slice.call(a.textContent.match(/\d+/g))));
- return status.req = $.cache("//a.4cdn.org/" + thread.board + "/thread/" + thread + ".json", function() {
- delete status.req;
- return ExpandThread.parse(this, thread, a);
- });
- },
- contract: function(thread, a, threadRoot) {
- var filesCount, inlined, k, len1, num, postsCount, replies, reply, status;
- status = ExpandThread.statuses[thread];
- delete ExpandThread.statuses[thread];
- if (status.req) {
- status.req.abort();
- if (a) {
- a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
- }
- return;
- }
- replies = $$('.thread > .replyContainer', threadRoot);
- if (!Conf['JSON Index'] || Conf['Show Replies']) {
- num = (function() {
- if (thread.isSticky) {
- return 1;
- } else {
- switch (g.BOARD.ID) {
- case 'b':
- case 'vg':
- return 3;
- case 't':
- return 1;
- default:
- return 5;
- }
- }
- })();
- replies = replies.slice(0, -num);
- }
- postsCount = 0;
- filesCount = 0;
- for (k = 0, len1 = replies.length; k < len1; k++) {
- reply = replies[k];
- if (Conf['Quote Inlining']) {
- while (inlined = $('.inlined', reply)) {
- inlined.click();
- }
- }
- postsCount++;
- if ('file' in Get.postFromRoot(reply)) {
- filesCount++;
- }
- $.rm(reply);
- }
- return a.textContent = Build.summaryText('+', postsCount, filesCount);
- },
- parse: function(req, thread, a) {
- var filesCount, k, len1, post, postData, posts, postsCount, postsRoot, ref, ref1, root;
- if ((ref = req.status) !== 200 && ref !== 304) {
- a.textContent = "Error " + req.statusText + " (" + req.status + ")";
- return;
- }
- Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler;
- posts = [];
- postsRoot = [];
- filesCount = 0;
- ref1 = req.response.posts;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- postData = ref1[k];
- if (postData.no === thread.ID) {
- continue;
- }
- if ((post = thread.posts[postData.no]) && !post.isFetchedQuote) {
- if ('file' in post) {
- filesCount++;
- }
- postsRoot.push(post.nodes.root);
- continue;
- }
- root = Build.postFromObject(postData, thread.board.ID);
- post = new Post(root, thread, thread.board);
- if ('file' in post) {
- filesCount++;
- }
- posts.push(post);
- postsRoot.push(root);
- }
- Main.callbackNodes(Post, posts);
- $.after(a, postsRoot);
- $.event('PostsInserted');
- postsCount = postsRoot.length;
- return a.textContent = Build.summaryText('-', postsCount, filesCount);
- }
- };
-
- FileInfo = {
- init: function() {
- var ref;
- if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['File Info Formatting']) {
- return;
- }
- return Post.callbacks.push({
- name: 'File Info Formatting',
- cb: this.node
- });
- },
- node: function() {
- var info, oldInfo;
- if (!this.file || this.isClone) {
- return;
- }
- oldInfo = $.el('span', {
- className: 'fileText-original'
- });
- $.prepend(this.file.link.parentNode, oldInfo);
- $.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]);
- info = $.el('span', {
- className: 'file-info'
- });
- FileInfo.format(Conf['fileInfo'], this, info);
- return $.prepend(this.file.text, info);
- },
- format: function(formatString, post, outputNode) {
- var output;
- output = [];
- formatString.replace(/%(.)|[^%]+/g, function(s, c) {
- output.push(c in FileInfo.formatters ? FileInfo.formatters[c].call(post) : {
- innerHTML: E(s)
- });
- return '';
- });
- return $.extend(outputNode, {
- innerHTML: E.cat(output)
- });
- },
- formatters: {
- t: function() {
- return {
- innerHTML: E(this.file.url.match(/[^/]*$/)[0])
- };
- },
- T: function() {
- return {
- innerHTML: "" + FileInfo.formatters.t.call(this).innerHTML + " "
- };
- },
- l: function() {
- return {
- innerHTML: "" + FileInfo.formatters.n.call(this).innerHTML + " "
- };
- },
- L: function() {
- return {
- innerHTML: "" + FileInfo.formatters.N.call(this).innerHTML + " "
- };
- },
- n: function() {
- var fullname, shortname;
- fullname = this.file.name;
- shortname = Build.shortFilename(this.file.name, this.isReply);
- if (fullname === shortname) {
- return {
- innerHTML: E(fullname)
- };
- } else {
- return {
- innerHTML: "" + E(shortname) + " " + E(fullname) + " "
- };
- }
- },
- N: function() {
- return {
- innerHTML: E(this.file.name)
- };
- },
- p: function() {
- return {
- innerHTML: (this.file.isSpoiler ? "Spoiler, " : "")
- };
- },
- s: function() {
- return {
- innerHTML: E(this.file.size)
- };
- },
- B: function() {
- return {
- innerHTML: E(Math.round(this.file.sizeInBytes)) + " Bytes"
- };
- },
- K: function() {
- return {
- innerHTML: E(Math.round(this.file.sizeInBytes/1024)) + " KB"
- };
- },
- M: function() {
- return {
- innerHTML: E(Math.round(this.file.sizeInBytes/1048576*100)/100) + " MB"
- };
- },
- r: function() {
- return {
- innerHTML: E(this.file.dimensions || "PDF")
- };
- },
- g: function() {
- return {
- innerHTML: (this.file.tag ? ", " + E(this.file.tag) : "")
- };
- },
- '%': function() {
- return {
- innerHTML: "%"
- };
- }
- }
- };
-
- Flash = {
- init: function() {
- if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) {
- return $.ready(Flash.initReady);
- }
- },
- initReady: function() {
- if ($.hasStorage) {
- return $.global(function() {
- if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) {
- return window.SWFEmbed.init();
- }
- });
- } else {
- if (g.VIEW === 'thread') {
- $.global(function() {
- return window.Main.tid = location.pathname.split(/\/+/)[3];
- });
- }
- return $.global(function() {
- return window.SWFEmbed.init();
- });
- }
- }
- };
-
- Fourchan = {
- init: function() {
- var ref;
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- if (g.BOARD.ID === 'g') {
- $.on(window, 'prettyprint:cb', function(e) {
- var post, pre;
- if (!(post = g.posts[e.detail.ID])) {
- return;
- }
- if (!(pre = $$('.prettyprint', post.nodes.comment)[e.detail.i])) {
- return;
- }
- if (!$.hasClass(pre, 'prettyprinted')) {
- pre.innerHTML = e.detail.html;
- return $.addClass(pre, 'prettyprinted');
- }
- });
- $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: {\n ID: e.detail.ID,\n i: e.detail.i,\n html: prettyPrintOne(e.detail.html)\n }\n }));\n}, false);');
- Post.callbacks.push({
- name: 'Parse /g/ code',
- cb: this.code
- });
- }
- if (g.BOARD.ID === 'sci') {
- $.global(function() {
- return window.addEventListener('mathjax', function(e) {
- if (window.MathJax) {
- return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
- } else {
- if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) {
- window.loadMathJax();
- window.loadMathJax = function() {};
- }
- if (!e.target.classList.contains('postMessage')) {
- return document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener('load', function() {
- return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
- }, false);
- }
- }
- }, false);
- });
- Post.callbacks.push({
- name: 'Parse /sci/ math',
- cb: this.math
- });
- CatalogThread.callbacks.push({
- name: 'Parse /sci/ math',
- cb: this.math
- });
- }
- return Main.ready(function() {
- return $.global(function() {
- var k, len1, node, ref1;
- window.clickable_ids = false;
- ref1 = document.querySelectorAll('.posteruid, .capcode');
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- node = ref1[k];
- node.removeEventListener('click', window.idClick, false);
- }
- });
- });
- },
- code: function() {
- if (this.isClone) {
- return;
- }
- return $.ready((function(_this) {
- return function() {
- var i, k, len1, pre, ref;
- ref = $$('.prettyprint', _this.nodes.comment);
- for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
- pre = ref[i];
- if (!$.hasClass(pre, 'prettyprinted')) {
- $.event('prettyprint', {
- ID: _this.fullID,
- i: i,
- html: pre.innerHTML
- }, window);
- }
- }
- };
- })(this));
- },
- math: function() {
- var cb, k, len1, wbr, wbrs;
- if (!/\[(math|eqn)\]/.test(this.nodes.comment.textContent)) {
- return;
- }
- if ((wbrs = $$('wbr', this.nodes.comment)).length) {
- for (k = 0, len1 = wbrs.length; k < len1; k++) {
- wbr = wbrs[k];
- $.rm(wbr);
- }
- this.nodes.comment.normalize();
- }
- cb = (function(_this) {
- return function() {
- if (!doc.contains(_this.nodes.comment)) {
- return;
- }
- $.off(d, 'PostsInserted', cb);
- return $.event('mathjax', null, _this.nodes.comment);
- };
- })(this);
- $.on(d, 'PostsInserted', cb);
- return cb();
- }
- };
-
- IDColor = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) {
- return;
- }
- this.ids = {
- Heaven: [0, 0, 0, '#fff']
- };
- return Post.callbacks.push({
- name: 'Color User IDs',
- cb: this.node
- });
- },
- node: function() {
- var rgb, span, style, uid;
- if (this.isClone || !((uid = this.info.uniqueID) && (span = $('span.hand', this.nodes.uniqueID)))) {
- return;
- }
- rgb = IDColor.ids[uid] || IDColor.compute(uid);
- style = span.style;
- style.color = rgb[3];
- style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
- return $.addClass(span, 'painted');
- },
- compute: function(uid) {
- var hash, rgb;
- hash = IDColor.hash(uid);
- rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
- rgb.push((rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff');
- return this.ids[uid] = rgb;
- },
- hash: function(uid) {
- var i, msg;
- msg = 0;
- i = 0;
- while (i < 8) {
- msg = (msg << 5) - msg + uid.charCodeAt(i++);
- }
- return msg;
- }
- };
-
- IDHighlight = {
- init: function() {
- var ref;
- if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
- return;
- }
- return Post.callbacks.push({
- name: 'Highlight by User ID',
- cb: this.node
- });
- },
- uniqueID: null,
- node: function() {
- if (this.nodes.uniqueID) {
- $.on(this.nodes.uniqueID, 'click', IDHighlight.click(this));
- }
- if (this.nodes.capcode) {
- $.on(this.nodes.capcode, 'click', IDHighlight.click(this));
- }
- if (!this.isClone) {
- return IDHighlight.set(this);
- }
- },
- set: function(post) {
- var match;
- match = (post.info.uniqueID || post.info.capcode) === IDHighlight.uniqueID;
- return $[match ? 'addClass' : 'rmClass'](post.nodes.post, 'highlight');
- },
- click: function(post) {
- return function() {
- var uniqueID;
- uniqueID = post.info.uniqueID || post.info.capcode;
- IDHighlight.uniqueID = IDHighlight.uniqueID === uniqueID ? null : uniqueID;
- return g.posts.forEach(IDHighlight.set);
- };
- }
- };
-
- Keybinds = {
- init: function() {
- var hotkey, init;
- if (!Conf['Keybinds']) {
- return;
- }
- for (hotkey in Config.hotkeys) {
- $.sync(hotkey, Keybinds.sync);
- }
- init = function() {
- var k, len1, node, ref;
- $.off(d, '4chanXInitFinished', init);
- $.on(d, 'keydown', Keybinds.keydown);
- ref = $$('[accesskey]');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- node = ref[k];
- node.removeAttribute('accesskey');
- }
- };
- return $.on(d, '4chanXInitFinished', init);
- },
- sync: function(key, hotkey) {
- return Conf[hotkey] = key;
- },
- keydown: function(e) {
- var form, k, key, len1, notification, notifications, op, ref, ref1, ref2, ref3, ref4, ref5, searchInput, target, thread, threadRoot;
- if (!(key = Keybinds.keyCode(e))) {
- return;
- }
- target = e.target;
- if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') {
- if (!(/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) && !/^Alt\+(\d|Up|Down|Left|Right)$/.test(key))) {
- return;
- }
- }
- if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Index'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
- threadRoot = Nav.getThread();
- if (op = $('.op', threadRoot)) {
- thread = Get.postFromNode(op).thread;
- }
- }
- switch (key) {
- case Conf['Toggle board list']:
- if (!Conf['Custom Board Navigation']) {
- return;
- }
- Header.toggleBoardList();
- break;
- case Conf['Toggle header']:
- Header.toggleBarVisibility();
- break;
- case Conf['Open empty QR']:
- if (!QR.postingIsEnabled) {
- return;
- }
- Keybinds.qr();
- break;
- case Conf['Open QR']:
- if (!(QR.postingIsEnabled && threadRoot)) {
- return;
- }
- Keybinds.qr(threadRoot);
- break;
- case Conf['Open settings']:
- Settings.open();
- break;
- case Conf['Close']:
- if (Settings.dialog) {
- Settings.close();
- } else if ((notifications = $$('.notification')).length) {
- for (k = 0, len1 = notifications.length; k < len1; k++) {
- notification = notifications[k];
- $('.close', notification).click();
- }
- } else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) {
- if (Conf['Persistent QR']) {
- QR.hide();
- } else {
- QR.close();
- }
- } else if (Embedding.lastEmbed) {
- Embedding.closeFloat();
- } else {
- return;
- }
- break;
- case Conf['Spoiler tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('spoiler', target);
- break;
- case Conf['Code tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('code', target);
- break;
- case Conf['Eqn tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('eqn', target);
- break;
- case Conf['Math tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('math', target);
- break;
- case Conf['SJIS tags']:
- if (target.nodeName !== 'TEXTAREA') {
- return;
- }
- Keybinds.tags('sjis', target);
- break;
- case Conf['Toggle sage']:
- if (!(QR.nodes && !QR.nodes.el.hidden)) {
- return;
- }
- Keybinds.sage();
- break;
- case Conf['Submit QR']:
- if (!(QR.nodes && !QR.nodes.el.hidden)) {
- return;
- }
- if (!QR.status()) {
- QR.submit();
- }
- break;
- case Conf['Update']:
- switch (g.VIEW) {
- case 'thread':
- if (!Conf['Thread Updater']) {
- return;
- }
- ThreadUpdater.update();
- break;
- case 'index':
- if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
- return;
- }
- Index.update();
- break;
- default:
- return;
- }
- break;
- case Conf['Watch']:
- if (!(ThreadWatcher.enabled && thread)) {
- return;
- }
- ThreadWatcher.toggle(thread);
- break;
- case Conf['Update thread watcher']:
- if (!ThreadWatcher.enabled) {
- return;
- }
- ThreadWatcher.buttonFetchAll();
- break;
- case Conf['Expand image']:
- if (!(ImageExpand.enabled && threadRoot)) {
- return;
- }
- Keybinds.img(threadRoot);
- break;
- case Conf['Expand images']:
- if (!(ImageExpand.enabled && threadRoot)) {
- return;
- }
- Keybinds.img(threadRoot, true);
- break;
- case Conf['Open Gallery']:
- if (!Gallery.enabled) {
- return;
- }
- Gallery.cb.toggle();
- break;
- case Conf['fappeTyme']:
- if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread'))) {
- return;
- }
- FappeTyme.toggle('fappe');
- break;
- case Conf['werkTyme']:
- if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread'))) {
- return;
- }
- FappeTyme.toggle('werk');
- break;
- case Conf['Front page']:
- if (Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
- Index.userPageNav(1);
- } else {
- window.location = "/" + g.BOARD + "/";
- }
- break;
- case Conf['Open front page']:
- $.open("/" + g.BOARD + "/");
- break;
- case Conf['Next page']:
- if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
- return;
- }
- if (Conf['JSON Index']) {
- if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
- return;
- }
- $('.next button', Index.pagelist).click();
- } else {
- if (form = $('.next form')) {
- window.location = form.action;
- }
- }
- break;
- case Conf['Previous page']:
- if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
- return;
- }
- if (Conf['JSON Index']) {
- if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
- return;
- }
- $('.prev button', Index.pagelist).click();
- } else {
- if (form = $('.prev form')) {
- window.location = form.action;
- }
- }
- break;
- case Conf['Search form']:
- if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
- return;
- }
- searchInput = Conf['JSON Index'] ? Index.searchInput : $.id('search-box');
- Header.scrollToIfNeeded(searchInput);
- searchInput.focus();
- break;
- case Conf['Paged mode']:
- if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
- return;
- }
- window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
- break;
- case Conf['Infinite scrolling mode']:
- if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
- return;
- }
- window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
- break;
- case Conf['All pages mode']:
- if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
- return;
- }
- window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
- break;
- case Conf['Open catalog']:
- if (g.BOARD.ID === 'f') {
- return;
- }
- window.location = CatalogLinks.catalog();
- break;
- case Conf['Cycle sort type']:
- if (!(Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
- return;
- }
- Index.cycleSortType();
- break;
- case Conf['Next thread']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- Nav.scroll(+1);
- break;
- case Conf['Previous thread']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- Nav.scroll(-1);
- break;
- case Conf['Expand thread']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- ExpandThread.toggle(thread);
- break;
- case Conf['Open thread']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- Keybinds.open(thread);
- break;
- case Conf['Open thread tab']:
- if (!(g.VIEW === 'index' && threadRoot)) {
- return;
- }
- Keybinds.open(thread, true);
- break;
- case Conf['Next reply']:
- if (!threadRoot) {
- return;
- }
- Keybinds.hl(+1, threadRoot);
- break;
- case Conf['Previous reply']:
- if (!threadRoot) {
- return;
- }
- Keybinds.hl(-1, threadRoot);
- break;
- case Conf['Deselect reply']:
- if (!threadRoot) {
- return;
- }
- Keybinds.hl(0, threadRoot);
- break;
- case Conf['Hide']:
- if (!thread) {
- return;
- }
- if (ThreadHiding.db) {
- ThreadHiding.toggle(thread);
- }
- break;
- case Conf['Previous Post Quoting You']:
- if (!(threadRoot && QuoteYou.db)) {
- return;
- }
- QuoteYou.cb.seek('preceding');
- break;
- case Conf['Next Post Quoting You']:
- if (!(threadRoot && QuoteYou.db)) {
- return;
- }
- QuoteYou.cb.seek('following');
- break;
- default:
- return;
- }
- e.preventDefault();
- return e.stopPropagation();
- },
- keyCode: function(e) {
- var kc, key;
- key = (function() {
- switch (kc = e.keyCode) {
- case 8:
- return '';
- case 13:
- return 'Enter';
- case 27:
- return 'Esc';
- case 32:
- return 'Space';
- case 37:
- return 'Left';
- case 38:
- return 'Up';
- case 39:
- return 'Right';
- case 40:
- return 'Down';
- case 188:
- return 'Comma';
- case 190:
- return 'Period';
- case 191:
- return 'Slash';
- case 59:
- case 186:
- return 'Semicolon';
- default:
- if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) {
- return String.fromCharCode(kc).toLowerCase();
- } else if ((96 <= kc && kc <= 105)) {
- return String.fromCharCode(kc - 48).toLowerCase();
- } else {
- return null;
- }
- }
- })();
- if (key) {
- if (e.altKey) {
- key = 'Alt+' + key;
- }
- if (e.ctrlKey) {
- key = 'Ctrl+' + key;
- }
- if (e.metaKey) {
- key = 'Meta+' + key;
- }
- if (e.shiftKey) {
- key = 'Shift+' + key;
- }
- }
- return key;
- },
- qr: function(thread) {
- QR.open();
- if (thread != null) {
- QR.quote.call($('input', $('.post.highlight', thread) || thread));
- }
- return QR.nodes.com.focus();
- },
- tags: function(tag, ta) {
- var range, selEnd, selStart, supported, value;
- supported = (function() {
- switch (tag) {
- case 'spoiler':
- return !!$('.postForm input[name=spoiler]');
- case 'code':
- return g.BOARD.ID === 'g';
- case 'math':
- case 'eqn':
- return g.BOARD.ID === 'sci';
- case 'sjis':
- return g.BOARD.ID === 'jp';
- }
- })();
- if (!supported) {
- new Notice('warning', "[" + tag + "] tags are not supported on /" + g.BOARD + "/.", 20);
- }
- value = ta.value;
- selStart = ta.selectionStart;
- selEnd = ta.selectionEnd;
- ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd);
- range = ("[" + tag + "]").length + selEnd;
- ta.setSelectionRange(range, range);
- return $.event('input', null, ta);
- },
- 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 {
- post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread));
- return ImageExpand.toggle(post);
- }
- },
- open: function(thread, tab) {
- var url;
- if (g.VIEW !== 'index') {
- return;
- }
- url = "/" + thread.board + "/thread/" + thread;
- if (tab) {
- return $.open(url);
- } else {
- return location.href = url;
- }
- },
- hl: function(delta, thread) {
- var axis, height, k, len1, next, postEl, replies, reply, root;
- postEl = $('.reply.highlight', thread);
- if (!delta) {
- if (postEl) {
- $.rmClass(postEl, 'highlight');
- }
- return;
- }
- if (postEl) {
- height = postEl.getBoundingClientRect().height;
- if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
- root = postEl.parentNode;
- axis = delta === +1 ? 'following' : 'preceding';
- if (!(next = $.x(axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
- return;
- }
- Header.scrollToIfNeeded(next, delta === +1);
- this.focus(next);
- $.rmClass(postEl, 'highlight');
- return;
- }
- $.rmClass(postEl, 'highlight');
- }
- replies = $$('.reply', thread);
- if (delta === -1) {
- replies.reverse();
- }
- for (k = 0, len1 = replies.length; k < len1; k++) {
- reply = replies[k];
- if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) {
- this.focus(reply);
- return;
- }
- }
- },
- focus: function(post) {
- return $.addClass(post, 'highlight');
- }
- };
-
- Nav = {
- init: function() {
- var append, next, prev, span;
- switch (g.VIEW) {
- case 'index':
- if (!Conf['Index Navigation']) {
- return;
- }
- break;
- case 'thread':
- if (!Conf['Reply Navigation']) {
- return;
- }
- break;
- default:
- return;
- }
- span = $.el('span', {
- id: 'navlinks'
- });
- prev = $.el('a', {
- textContent: 'â–²',
- href: 'javascript:;'
- });
- next = $.el('a', {
- textContent: 'â–¼',
- href: 'javascript:;'
- });
- $.on(prev, 'click', this.prev);
- $.on(next, 'click', this.next);
- $.add(span, [prev, $.tn(' '), next]);
- append = function() {
- $.off(d, '4chanXInitFinished', append);
- return $.add(d.body, span);
- };
- return $.on(d, '4chanXInitFinished', append);
- },
- prev: function() {
- if (g.VIEW === 'thread') {
- return window.scrollTo(0, 0);
- } else {
- return Nav.scroll(-1);
- }
- },
- next: function() {
- if (g.VIEW === 'thread') {
- return window.scrollTo(0, d.body.scrollHeight);
- } else {
- return Nav.scroll(+1);
- }
- },
- getThread: function() {
- var k, len1, ref, thread, threadRoot;
- ref = $$('.thread');
- for (k = 0, len1 = ref.length; k < len1; k++) {
- threadRoot = ref[k];
- thread = Get.threadFromRoot(threadRoot);
- if (thread.isHidden && !thread.stub) {
- continue;
- }
- if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) {
- return threadRoot;
- }
- }
- return $('.board');
- },
- scroll: function(delta) {
- var axis, extra, next, ref, thread, top;
- if ((ref = d.activeElement) != null) {
- ref.blur();
- }
- thread = Nav.getThread();
- axis = delta === +1 ? 'following' : 'preceding';
- if (next = $.x(axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
- top = Header.getTopOf(thread);
- if (delta === +1 && top < 5 || delta === -1 && top > -5) {
- thread = next;
- }
- }
- extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom;
- if (extra > 0) {
- d.body.style.marginBottom = extra + "px";
- }
- Header.scrollTo(thread);
- if (extra > 0 && !Nav.haveExtra) {
- Nav.haveExtra = true;
- return $.on(d, 'scroll', Nav.removeExtra);
- }
- },
- removeExtra: function() {
- var extra;
- extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;
- if (extra > 0) {
- return d.body.style.marginBottom = extra + "px";
- } else {
- d.body.style.marginBottom = null;
- delete Nav.haveExtra;
- return $.off(d, 'scroll', Nav.removeExtra);
- }
- }
- };
-
- NormalizeURL = {
- init: function() {
- var pathname;
- if (!Conf['Normalize URL']) {
- return;
- }
- pathname = location.pathname.split(/\/+/);
- switch (g.VIEW) {
- case 'thread':
- pathname[2] = 'thread';
- pathname = pathname.slice(0, 4);
- break;
- case 'index':
- pathname = pathname.slice(0, 3);
- }
- pathname = pathname.join('/');
- if (location.pathname !== pathname) {
- return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
- }
- }
- };
-
- RelativeDates = {
- INTERVAL: $.MINUTE / 2,
- init: function() {
- var ref;
- if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Index'] && g.BOARD.ID !== 'f') {
- this.flush();
- $.on(d, 'visibilitychange ThreadUpdate', this.flush);
- }
- if (Conf['Relative Post Dates']) {
- return Post.callbacks.push({
- name: 'Relative Post Dates',
- cb: this.node
- });
- }
- },
- node: function() {
- var dateEl;
- dateEl = this.nodes.date;
- if (Conf['Relative Date Title']) {
- $.on(dateEl, 'mouseover', (function(_this) {
- return function() {
- return RelativeDates.hover(_this);
- };
- })(this));
- return;
- }
- if (this.isClone) {
- return;
- }
- dateEl.title = dateEl.textContent;
- return RelativeDates.update(this);
- },
- 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 * years) > 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) {
- unit += 's';
- }
- return rounded + " " + unit + " ago";
- },
- stale: [],
- flush: function() {
- var data, k, len1, now, ref;
- if (d.hidden) {
- return;
- }
- now = new Date();
- ref = RelativeDates.stale;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- data = ref[k];
- RelativeDates.update(data, now);
- }
- RelativeDates.stale = [];
- clearTimeout(RelativeDates.timeout);
- return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL);
- },
- hover: function(post) {
- var date, diff, now;
- date = post.info.date;
- now = new Date();
- diff = now - date;
- return post.nodes.date.title = RelativeDates.relative(diff, now, date);
- },
- update: function(data, now) {
- var date, diff, isPost, k, len1, ref, relative, singlePost;
- isPost = data instanceof Post;
- date = isPost ? data.info.date : new Date(+data.dataset.utc);
- now || (now = new Date());
- diff = now - date;
- relative = RelativeDates.relative(diff, now, date);
- if (isPost) {
- ref = [data].concat(data.clones);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- singlePost = ref[k];
- singlePost.nodes.date.firstChild.textContent = relative;
- }
- } else {
- data.firstChild.textContent = relative;
- }
- return RelativeDates.setOwnTimeout(diff, data);
- },
- setOwnTimeout: function(diff, data) {
- var delay;
- delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY;
- return setTimeout(RelativeDates.markStale, delay, data);
- },
- markStale: function(data) {
- if (indexOf.call(RelativeDates.stale, data) >= 0) {
- return;
- }
- if (data instanceof Post && !g.posts[data.fullID]) {
- return;
- }
- return RelativeDates.stale.push(data);
- }
- };
-
- RemoveSpoilers = {
- init: function() {
- if (Conf['Reveal Spoilers']) {
- $.addClass(doc, 'reveal-spoilers');
- }
- if (!Conf['Remove Spoilers']) {
- return;
- }
- Post.callbacks.push({
- name: 'Reveal Spoilers',
- cb: this.node
- });
- CatalogThread.callbacks.push({
- name: 'Reveal Spoilers',
- cb: this.node
- });
- if (g.VIEW === 'archive') {
- return $.ready(function() {
- return RemoveSpoilers.unspoiler($.id('arc-list'));
- });
- }
- },
- node: function() {
- return RemoveSpoilers.unspoiler(this.nodes.comment);
- },
- unspoiler: function(el) {
- var k, len1, span, spoiler, spoilers;
- spoilers = $$('s', el);
- for (k = 0, len1 = spoilers.length; k < len1; k++) {
- spoiler = spoilers[k];
- span = $.el('span', {
- className: 'removed-spoiler'
- });
- $.replace(spoiler, span);
- $.add(span, slice.call(spoiler.childNodes));
- }
- }
- };
-
- Report = {
- css: "#g-recaptcha,\n" +
-":root:not(.js-enabled) #captchaContainerAlt {\n" +
-" height: auto;\n" +
-"}\n" +
-"#captchaContainerAlt td:nth-child(2) {\n" +
-" display: table-cell !important;\n" +
-"}",
- init: function() {
- var match;
- if (!(match = location.search.match(/\bno=(\d+)/))) {
- return;
- }
- Captcha.replace.init();
- this.postID = +match[1];
- return $.ready(this.ready);
- },
- ready: function() {
- var passAd, prev, ref;
- $.addStyle(Report.css);
- if (Conf['Archive Report']) {
- Report.archive();
- }
- if ((passAd = $('a[href="https://www.4chan.org/pass"]'))) {
- $.extend(passAd, {
- textContent: 'Complain',
- href: 'https://www.4chan-x.net/captchas.html',
- tabIndex: -1
- });
- passAd.parentNode.normalize();
- if (((ref = (prev = passAd.previousSibling)) != null ? ref.nodeType : void 0) === Node.TEXT_NODE) {
- prev.nodeValue = prev.nodeValue.replace(/4chan Pass[^\.]*\./i, 'reCAPTCHA malfunctioning?');
- }
- $.after(passAd, [
- $.tn('] ['), $.el('a', {
- href: 'mailto:4chanpass@4chan.org?subject=4chan%20Pass%20-%20Purchase%20Support',
- textContent: 'Email 4chan',
- target: '_blank',
- tabIndex: -1
- })
- ]);
- }
- if (!Conf['Use Recaptcha v1 in Reports'] && !Conf['Force Noscript Captcha'] && Main.jsEnabled) {
- return new MutationObserver(function() {
- Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
- return Report.fit('body');
- }).observe(d.body, {
- childList: true,
- attributes: true,
- subtree: true
- });
- } else {
- return Report.fit('body');
- }
- },
- fit: function(selector) {
- var dy, el;
- if (!((el = $(selector, doc)) && getComputedStyle(el).visibility !== 'hidden')) {
- return;
- }
- dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8;
- if (dy > 0) {
- return window.resizeBy(0, dy);
- }
- },
- archive: function() {
- var link, message, types, url;
- Redirect.init();
- if (!(url = Redirect.to('report', {
- boardID: g.BOARD.ID,
- postID: Report.postID
- }))) {
- return;
- }
- if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) {
- if (location.hash === '#redirect') {
- $.globalEval('self.close = function(){};');
- window.resizeTo(700, 475);
- location.replace(url);
- }
- return;
- }
- link = $.el('a', {
- href: url,
- textContent: 'Report to archive'
- });
- $.on(link, 'click', function(e) {
- if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) {
- return window.resizeTo(700, 475);
- }
- });
- $.add(d.body, [$.tn(' ['), link, $.tn(']')]);
- if (types = $.id('reportTypes')) {
- return $.on(types, 'change', function(e) {
- return $('form').action = e.target.value === 'illegal' ? '#redirect' : '';
- });
- }
- }
- };
-
- ThreadLinks = {
- init: function() {
- if (!(g.VIEW === 'index' && Conf['Open Threads in New Tab'])) {
- return;
- }
- Post.callbacks.push({
- name: 'Thread Links',
- cb: this.node
- });
- return CatalogThread.callbacks.push({
- name: 'Thread Links',
- cb: this.catalogNode
- });
- },
- node: function() {
- if (this.isReply || this.isClone) {
- return;
- }
- return ThreadLinks.process($('.replylink', this.nodes.info));
- },
- catalogNode: function() {
- return ThreadLinks.process(this.nodes.thumb.parentNode);
- },
- process: function(link) {
- return link.target = '_blank';
- }
- };
-
- Time = {
- init: function() {
- var ref;
- if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Time Formatting'])) {
- return;
- }
- return Post.callbacks.push({
- name: 'Time Formatting',
- cb: this.node
- });
- },
- node: function() {
- if (this.isClone) {
- return;
- }
- return this.nodes.date.textContent = Time.format(Conf['time'], this.info.date);
- },
- format: function(formatString, date) {
- return formatString.replace(/%(.)/g, function(s, c) {
- if (c in Time.formatters) {
- return Time.formatters[c].call(date);
- } else {
- return s;
- }
- });
- },
- day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
- month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
- zeroPad: function(n) {
- if (n < 10) {
- return "0" + n;
- } else {
- return n;
- }
- },
- formatters: {
- a: function() {
- return Time.day[this.getDay()].slice(0, 3);
- },
- A: function() {
- return Time.day[this.getDay()];
- },
- b: function() {
- return Time.month[this.getMonth()].slice(0, 3);
- },
- B: function() {
- return Time.month[this.getMonth()];
- },
- d: function() {
- return Time.zeroPad(this.getDate());
- },
- e: function() {
- return this.getDate();
- },
- H: function() {
- return Time.zeroPad(this.getHours());
- },
- I: function() {
- return Time.zeroPad(this.getHours() % 12 || 12);
- },
- k: function() {
- return this.getHours();
- },
- l: function() {
- return this.getHours() % 12 || 12;
- },
- m: function() {
- return Time.zeroPad(this.getMonth() + 1);
- },
- M: function() {
- return Time.zeroPad(this.getMinutes());
- },
- p: function() {
- if (this.getHours() < 12) {
- return 'AM';
- } else {
- return 'PM';
- }
- },
- P: function() {
- if (this.getHours() < 12) {
- return 'am';
- } else {
- return 'pm';
- }
- },
- S: function() {
- return Time.zeroPad(this.getSeconds());
- },
- y: function() {
- return this.getFullYear().toString().slice(2);
- },
- Y: function() {
- return this.getFullYear();
- },
- '%': function() {
- return '%';
- }
- }
- };
-
- Settings = {
- init: function() {
- var add, link, settings;
- link = $.el('a', {
- className: 'settings-link fa fa-wrench',
- textContent: 'Settings',
- title: '4chan X Settings',
- href: 'javascript:;'
- });
- $.on(link, 'click', Settings.open);
- Header.addShortcut(link);
- add = this.addSection;
- add('Main', this.main);
- add('Filter', this.filter);
- add('Sauce', this.sauce);
- add('Advanced', this.advanced);
- add('Keybinds', this.keybinds);
- $.on(d, 'AddSettingsSection', Settings.addSection);
- $.on(d, 'OpenSettings', function(e) {
- return Settings.open(e.detail);
- });
- if (Conf['Disable Native Extension']) {
- if ($.hasStorage) {
- settings = JSON.parse(localStorage.getItem('4chan-settings')) || {};
- if (settings.disableAll) {
- return;
- }
- settings.disableAll = true;
- return localStorage.setItem('4chan-settings', JSON.stringify(settings));
- } else {
- return $.onExists(doc, 'body', function() {
- return $.global(function() {
- return window.Config.disableAll = true;
- });
- });
- }
- }
- },
- open: function(openSection) {
- var dialog, k, len1, link, links, overlay, ref, section, sectionToOpen;
- if (Settings.overlay) {
- return;
- }
- $.event('CloseMenu');
- Settings.dialog = dialog = $.el('div', {
- id: 'fourchanx-settings',
- className: 'dialog'
- });
- $.extend(dialog, {
- innerHTML: "
"
- });
- Settings.overlay = overlay = $.el('div', {
- id: 'overlay'
- });
- $.on($('.export', dialog), 'click', Settings["export"]);
- $.on($('.import', dialog), 'click', Settings["import"]);
- $.on($('.reset', dialog), 'click', Settings.reset);
- $.on($('input', dialog), 'change', Settings.onImport);
- links = [];
- ref = Settings.sections;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- section = ref[k];
- link = $.el('a', {
- className: "tab-" + section.hyphenatedTitle,
- textContent: section.title,
- href: 'javascript:;'
- });
- $.on(link, 'click', Settings.openSection.bind(section));
- links.push(link, $.tn(' | '));
- if (section.title === openSection) {
- sectionToOpen = link;
- }
- }
- links.pop();
- $.add($('.sections-list', dialog), links);
- if (openSection !== 'none') {
- (sectionToOpen ? sectionToOpen : links[0]).click();
- }
- $.on($('.close', dialog), 'click', Settings.close);
- $.on(overlay, 'click', Settings.close);
- $.add(d.body, [overlay, dialog]);
- return $.event('OpenSettings', null, dialog);
- },
- close: function() {
- var ref;
- if (!Settings.dialog) {
- return;
- }
- if ((ref = d.activeElement) != null) {
- ref.blur();
- }
- $.rm(Settings.overlay);
- $.rm(Settings.dialog);
- delete Settings.overlay;
- return delete Settings.dialog;
- },
- sections: [],
- addSection: function(title, open) {
- var hyphenatedTitle, ref;
- if (typeof title !== 'string') {
- ref = title.detail, title = ref.title, open = ref.open;
- }
- hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-');
- return Settings.sections.push({
- title: title,
- hyphenatedTitle: hyphenatedTitle,
- open: open
- });
- },
- openSection: function() {
- var section, selected;
- if (selected = $('.tab-selected', Settings.dialog)) {
- $.rmClass(selected, 'tab-selected');
- }
- $.addClass($(".tab-" + this.hyphenatedTitle, Settings.dialog), 'tab-selected');
- section = $('section', Settings.dialog);
- $.rmAll(section);
- section.className = "section-" + this.hyphenatedTitle;
- this.open(section, g);
- section.scrollTop = 0;
- return $.event('OpenSettings', null, section);
- },
- warnings: {
- localStorage: function(cb) {
- var why;
- if ($.cantSync) {
- why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs';
- return cb($.el('li', {
- textContent: "4chan X needs local storage to " + why + ".\nEnable it on boards.4chan.org in your browser's privacy settings (may be listed as part of \"local data\" or \"cookies\")."
- }));
- }
- },
- ads: function(cb) {
- return $.onExists(doc, '.ad-cnt', function(ad) {
- return $.onExists(ad, 'img', function() {
- return cb($.el('li', {
- innerHTML: "To protect yourself from malicious ads , you should block ads on 4chan."
- }));
- });
- });
- }
- },
- main: function(section) {
- var addWarning, arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, ref, ref1, warning, warnings;
- warnings = $.el('fieldset', {
- hidden: true
- }, {
- innerHTML: "Warnings "
- });
- addWarning = function(item) {
- $.add($('ul', warnings), item);
- return warnings.hidden = false;
- };
- ref = Settings.warnings;
- for (key in ref) {
- warning = ref[key];
- warning(addWarning);
- }
- $.add(section, warnings);
- items = {};
- inputs = {};
- ref1 = Config.main;
- for (key in ref1) {
- obj = ref1[key];
- fs = $.el('fieldset', {
- innerHTML: "" + E(key) + " "
- });
- containers = [fs];
- for (key in obj) {
- arr = obj[key];
- description = arr[1];
- div = $.el('div', {
- innerHTML: " " + E(key) + ": " + E(description) + " "
- });
- if ($.engine !== 'gecko' && key === 'Remember QR Size') {
- div.hidden = true;
- }
- input = $('input', div);
- $.on(input, 'change', function() {
- this.parentNode.parentNode.dataset.checked = this.checked;
- return $.cb.checked.call(this);
- });
- items[key] = Conf[key];
- inputs[key] = input;
- level = arr[2] || 0;
- if (containers.length <= level) {
- container = $.el('div', {
- className: 'suboption-list'
- });
- $.add(containers[containers.length - 1].lastElementChild, container);
- containers[level] = container;
- } else if (containers.length > level + 1) {
- containers.splice(level + 1, containers.length - (level + 1));
- }
- $.add(containers[level], div);
- }
- $.add(section, fs);
- }
- $.get(items, function(items) {
- var val;
- for (key in items) {
- val = items[key];
- inputs[key].checked = val;
- inputs[key].parentNode.parentNode.dataset.checked = val;
- }
- });
- div = $.el('div', {
- innerHTML: ": Clear manually-hidden threads and posts on all boards. Reload the page to apply."
- });
- button = $('button', div);
- $.get({
- hiddenThreads: {},
- hiddenPosts: {}
- }, function(arg) {
- var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref2, ref3, thread;
- hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts;
- hiddenNum = 0;
- ref2 = hiddenThreads.boards;
- for (ID in ref2) {
- board = ref2[ID];
- hiddenNum += Object.keys(board).length;
- }
- ref3 = hiddenPosts.boards;
- for (ID in ref3) {
- board = ref3[ID];
- for (ID in board) {
- thread = board[ID];
- hiddenNum += Object.keys(thread).length;
- }
- }
- return button.textContent = "Hidden: " + hiddenNum;
- });
- $.on(button, 'click', function() {
- this.textContent = 'Hidden: 0';
- return $.get('hiddenThreads', {}, function(arg) {
- var boardID, hiddenThreads;
- hiddenThreads = arg.hiddenThreads;
- if ($.hasStorage) {
- for (boardID in hiddenThreads.boards) {
- localStorage.removeItem("4chan-hide-t-" + boardID);
- }
- }
- return $["delete"](['hiddenThreads', 'hiddenPosts']);
- });
- });
- return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
- },
- "export": function() {
- return $.get(Conf, function(Conf) {
- return Settings.downloadExport({
- version: g.VERSION,
- date: Date.now(),
- Conf: Conf
- });
- });
- },
- downloadExport: function(data) {
- var a, p;
- a = $.el('a', {
- download: "4chan X v" + g.VERSION + "-" + data.date + ".json",
- href: "data:application/json;base64," + (btoa(unescape(encodeURIComponent(JSON.stringify(data, null, 2)))))
- });
- p = $('.imp-exp-result', Settings.dialog);
- $.rmAll(p);
- $.add(p, a);
- return a.click();
- },
- "import": function() {
- return $('input[type=file]', this.parentNode).click();
- },
- onImport: function() {
- var file, output, reader;
- if (!(file = this.files[0])) {
- return;
- }
- this.value = null;
- output = $('.imp-exp-result');
- if (!confirm('Your current settings will be entirely overwritten, are you sure?')) {
- output.textContent = 'Import aborted.';
- return;
- }
- reader = new FileReader();
- reader.onload = function(e) {
- var err;
- try {
- return Settings.loadSettings(JSON.parse(e.target.result), function(err) {
- if (err) {
- return output.textContent = 'Import failed due to an error.';
- } else if (confirm('Import successful. Reload now?')) {
- return window.location.reload();
- }
- });
- } catch (_error) {
- err = _error;
- output.textContent = 'Import failed due to an error.';
- return c.error(err.stack);
- }
- };
- return reader.readAsText(file);
- },
- convertFrom: {
- loadletter: function(data) {
- var base1, boardID, convertSettings, key, ref, ref1, threadData, threadID, threads, val;
- convertSettings = function(data, map) {
- var newKey, prevKey;
- for (prevKey in map) {
- newKey = map[prevKey];
- if (newKey) {
- data.Conf[newKey] = data.Conf[prevKey];
- }
- delete data.Conf[prevKey];
- }
- return data;
- };
- data = convertSettings(data, {
- 'Disable 4chan\'s extension': 'Disable Native Extension',
- 'Comment Auto-Expansion': '',
- 'Remove Slug': '',
- 'Check for Updates': '',
- 'Recursive Filtering': 'Recursive Hiding',
- 'Reply Hiding': 'Reply Hiding Buttons',
- 'Thread Hiding': 'Thread Hiding Buttons',
- 'Show Stubs': 'Stubs',
- 'Image Auto-Gif': 'Replace GIF',
- 'Reveal Spoilers': 'Reveal Spoiler Thumbnails',
- 'Expand From Current': 'Expand from here',
- 'Post in Title': 'Thread Excerpt',
- 'Current Page': 'Page Count in Stats',
- 'Current Page Position': '',
- 'Alternative captcha': 'Use Recaptcha v1',
- 'Auto Submit': 'Post on Captcha Completion',
- 'Open Reply in New Tab': 'Open Post in New Tab',
- 'Remember QR size': 'Remember QR Size',
- 'Remember Subject': '',
- 'Quote Inline': 'Quote Inlining',
- 'Quote Preview': 'Quote Previewing',
- 'Indicate OP quote': 'Mark OP Quotes',
- 'Indicate You quote': 'Mark Quotes of You',
- 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes',
- 'uniqueid': 'uniqueID',
- 'mod': 'capcode',
- 'email': '',
- 'country': 'flag',
- 'md5': 'MD5',
- 'openEmptyQR': 'Open empty QR',
- 'openQR': 'Open QR',
- 'openOptions': 'Open settings',
- 'close': 'Close',
- 'spoiler': 'Spoiler tags',
- 'sageru': 'Toggle sage',
- 'code': 'Code tags',
- 'submit': 'Submit QR',
- 'watch': 'Watch',
- 'update': 'Update',
- 'unreadCountTo0': '',
- 'expandAllImages': 'Expand images',
- 'expandImage': 'Expand image',
- 'zero': 'Front page',
- 'nextPage': 'Next page',
- 'previousPage': 'Previous page',
- 'nextThread': 'Next thread',
- 'previousThread': 'Previous thread',
- 'expandThread': 'Expand thread',
- 'openThreadTab': 'Open thread',
- 'openThread': 'Open thread tab',
- 'nextReply': 'Next reply',
- 'previousReply': 'Previous reply',
- 'hide': 'Hide',
- 'Scrolling': 'Auto Scroll',
- 'Verbose': ''
- });
- data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) {
- switch (c) {
- case '$1':
- return '%TURL';
- case '$2':
- return '%URL';
- case '$3':
- return '%MD5';
- case '$4':
- return '%board';
- default:
- return c;
- }
- });
- ref = Config.hotkeys;
- for (key in ref) {
- val = ref[key];
- if (key in data.Conf) {
- data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) {
- return "" + (s[0].toUpperCase()) + s.slice(1);
- }).replace(/(^|.+\+)[A-Z]$/g, function(s) {
- return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase());
- });
- }
- }
- if (data.WatchedThreads) {
- data.Conf['watchedThreads'] = {
- boards: {}
- };
- ref1 = data.WatchedThreads;
- for (boardID in ref1) {
- threads = ref1[boardID];
- for (threadID in threads) {
- threadData = threads[threadID];
- ((base1 = data.Conf['watchedThreads'].boards)[boardID] || (base1[boardID] = {}))[threadID] = {
- excerpt: threadData.textContent
- };
- }
- }
- }
- return data;
- }
- },
- upgrade: function(data, version) {
- var boardID, changes, compareString, k, key, len1, name, record, ref, ref1, ref2, ref3, ref4, ref5, rice, set, type, uids, value;
- changes = {};
- set = function(key, value) {
- return data[key] = changes[key] = value;
- };
- compareString = version.replace(/\d+/g, function(x) {
- return ('0000' + x).slice(-5);
- });
- if (compareString < '00001.00011.00008.00000') {
- if (data['Fixed Thread Watcher'] == null) {
- set('Fixed Thread Watcher', (ref = data['Toggleable Thread Watcher']) != null ? ref : true);
- }
- if (data['Exempt Archives from Encryption'] == null) {
- set('Exempt Archives from Encryption', (ref1 = data['Except Archives from Encryption']) != null ? ref1 : false);
- }
- }
- if (compareString < '00001.00011.00010.00001') {
- if (data['selectedArchives'] != null) {
- uids = {
- "Moe": 0,
- "4plebs Archive": 3,
- "Nyafuu Archive": 4,
- "Love is Over": 5,
- "Rebecca Black Tech": 8,
- "warosu": 10,
- "fgts": 15,
- "not4plebs": 22,
- "DesuStorage": 23,
- "fireden.net": 24,
- "disabled": null
- };
- ref2 = data['selectedArchives'];
- for (boardID in ref2) {
- record = ref2[boardID];
- for (type in record) {
- name = record[type];
- if (name in uids) {
- record[type] = uids[name];
- }
- }
- }
- set('selectedArchives', data['selectedArchives']);
- }
- }
- if (compareString < '00001.00011.00016.00000') {
- if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) {
- if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) {
- set('usercss', rice + '\n\n' + data['usercss']);
- }
- }
- }
- if (compareString < '00001.00011.00017.00000') {
- ref3 = ['Persistent QR', 'Color User IDs', 'Fappe Tyme', 'Werk Tyme', 'Highlight Posts Quoting You', 'Highlight Own Posts'];
- for (k = 0, len1 = ref3.length; k < len1; k++) {
- key = ref3[k];
- if (data[key] == null) {
- set(key, key === 'Persistent QR');
- }
- }
- }
- if (compareString < '00001.00011.00017.00006') {
- if (data['sauces'] != null) {
- set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/iqdb\.org\//mg, '$1//iqdb.org/'));
- }
- }
- if (compareString < '00001.00011.00019.00003' && !Settings.overlay) {
- $.queueTask(function() {
- return Settings.warnings.ads(function(item) {
- return new Notice('warning', slice.call(item.childNodes));
- });
- });
- }
- if (compareString < '00001.00011.00020.00003') {
- ref4 = {
- 'Inline Cross-thread Quotes Only': false,
- 'Pass Link': true
- };
- for (key in ref4) {
- value = ref4[key];
- if (data[key] == null) {
- set(key, value);
- }
- }
- }
- if (compareString < '00001.00011.00021.00003') {
- if (data['Remember Your Posts'] == null) {
- set('Remember Your Posts', (ref5 = data['Mark Quotes of You']) != null ? ref5 : true);
- }
- }
- if (compareString < '00001.00011.00022.00000') {
- if (data['sauces'] != null) {
- set('sauces', data['sauces'].replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/mg, '$1'));
- set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/mg, '$&&safe=off'));
- }
- }
- if (compareString < '00001.00011.00022.00002') {
- if ((data['Use Recaptcha v1 in Reports'] == null) && data['Use Recaptcha v1'] && !data['Use Recaptcha v2 in Reports']) {
- set('Use Recaptcha v1 in Reports', true);
- }
- }
- if (compareString < '00001.00011.00024.00000') {
- if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) {
- set('JSON Index', data['JSON Navigation']);
- }
- }
- if (compareString < '00001.00011.00026.00000') {
- if ((data['Oekaki Links'] != null) && (data['Edit Link'] == null)) {
- set('Edit Link', data['Oekaki Links']);
- }
- if (data['Inline Cross-thread Quotes Only'] == null) {
- set('Inline Cross-thread Quotes Only', true);
- }
- }
- if (compareString < '00001.00011.00030.00000') {
- if (data['Quote Threading'] && (data['Thread Quotes'] == null)) {
- set('Thread Quotes', true);
- }
- }
- return changes;
- },
- loadSettings: function(data, cb) {
- if (data.version.split('.')[0] === '2') {
- data = Settings.convertFrom.loadletter(data);
- } else if (data.version !== g.VERSION) {
- Settings.upgrade(data.Conf, data.version);
- }
- return $.clear(function(err) {
- if (err) {
- return cb(err);
- }
- return $.set(data.Conf, cb);
- });
- },
- reset: function() {
- if (confirm('Your current settings will be entirely wiped, are you sure?')) {
- return $.clear(function(err) {
- if (err) {
- return $('.imp-exp-result').textContent = 'Import failed due to an error.';
- } else if (confirm('Reset successful. Reload now?')) {
- return window.location.reload();
- }
- });
- }
- },
- filter: function(section) {
- var select;
- $.extend(section, {
- innerHTML: "Guide Post number Name Unique ID Tripcode Capcode Subject Comment Flag Filename Image dimensions Filesize Image MD5
"
- });
- select = $('select', section);
- $.on(select, 'change', Settings.selectFilter);
- return Settings.selectFilter.call(select);
- },
- selectFilter: function() {
- var div, name, ta;
- div = this.nextElementSibling;
- if ((name = this.value) !== 'guide') {
- $.rmAll(div);
- ta = $.el('textarea', {
- name: name,
- className: 'field',
- spellcheck: false
- });
- $.get(name, Conf[name], function(item) {
- return ta.value = item[name];
- });
- $.on(ta, 'change', $.cb.value);
- $.add(div, ta);
- return;
- }
- $.extend(div, {
- innerHTML: "Filter is disabled.
Use regular expressions , one per line. Lines starting with a # will be ignored. For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive. MD5 filtering uses exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:Per boards, separate them with commas. It is global if not specified. For example: boards:a,jp;. In case of a global rule, select boards to be excluded from the filter. For example: exclude:vg,v;. Filter OPs only along with their threads (\`only\`), replies only (\`no\`), or both (\`yes\`, this is default). For example: op:only;, op:no; or op:yes;. Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`). For example: stub:yes; or stub:no;. Highlight instead of hiding. You can specify a class name to use with a userstyle. For example: highlight; or highlight:wallpaper;. Highlighted OPs will have their threads put on top of the board index by default. For example: top:yes; or top:no;. Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there. The native catalog has its own separate filter list.
"
- });
- return $('.warning', div).hidden = Conf['Filter'];
- },
- sauce: function(section) {
- var ta;
- $.extend(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.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
You can open links with scripts and popups disabled by appending ;sandbox.
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.%MD5: MD5 hash in base64.%sMD5: MD5 hash in base64 using - and _.%hMD5: MD5 hash in hexadecimal.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;. "
- });
- $('.warning', section).hidden = Conf['Sauce'];
- ta = $('textarea', section);
- $.get('sauces', Conf['sauces'], function(item) {
- return ta.value = item['sauces'];
- });
- return $.on(ta, 'change', $.cb.value);
- },
- advanced: function(section) {
- var aa, ab, applyCSS, archBoards, archive, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, uid, v, warning, withCredentials, z;
- $.extend(section, {
- innerHTML: "Archiver 404 Redirect is disabled.
Thread redirection Post fetching File redirection
Captcha Language
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 Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
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
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
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"] will give you[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy] if you are on /g/.
Time Formatting is disabled. :
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled. :
File Info Formatting is disabled. :
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag:
%gLiteral %: %%
Quick Reply Personas One item per line. Items will be added in the relevant input's auto-completion list. Password items will always be used, since there is no password input. Lines starting with a # will be ignored.
You can use these settings with each item, separate them with semicolons:Possible items are: name, options (or equivalently email), subject and password. Wrap values of items with quotes, like this: options:"sage". Force values as defaults with the always keyword, for example: options:"sage";always. Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always. Unread Favicon is disabled. ferongr xat- 4chanJS Mayhem Original Metro Thread Updater is disabled. Interval: seconds
Custom Cooldown Time Seconds:
Custom CSSApply CSS "
- });
- ref = $$('.warning', section);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- warning = ref[k];
- warning.hidden = Conf[warning.dataset.feature];
- }
- items = {};
- inputs = {};
- ref1 = ['captchaLanguage', 'boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'customCooldown'];
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- name = ref1[q];
- input = $("[name='" + name + "']", section);
- items[name] = Conf[name];
- inputs[name] = input;
- if (name === 'usercss') {
- $.on(input, 'change', $.cb.value);
- } else if (name === 'favicon') {
- $.on(input, 'change', $.cb.value);
- $.on(input, 'change', Settings[name]);
- } else {
- $.on(input, 'input', $.cb.value);
- if (name in Settings) {
- $.on(input, 'input', Settings[name]);
- }
- }
- }
- ta = $('.personafield', section);
- $.get('QR.personas', Conf['QR.personas'], function(item) {
- return ta.value = item['QR.personas'];
- });
- $.on(ta, 'change', $.cb.value);
- $.get(items, function(items) {
- var key, val;
- for (key in items) {
- val = items[key];
- input = inputs[key];
- input.value = val;
- if (key in Settings && key !== 'usercss') {
- Settings[key].call(input);
- }
- }
- });
- interval = $('input[name="Interval"]', section);
- customCSS = $('input[name="Custom CSS"]', section);
- applyCSS = $('#apply-css', section);
- interval.value = Conf['Interval'];
- customCSS.checked = Conf['Custom CSS'];
- inputs['usercss'].disabled = !Conf['Custom CSS'];
- applyCSS.disabled = !Conf['Custom CSS'];
- $.on(interval, 'change', ThreadUpdater.cb.interval);
- $.on(customCSS, 'change', Settings.togglecss);
- $.on(applyCSS, 'click', Settings.usercss);
- archBoards = {};
- ref2 = Redirect.archives;
- for (u = 0, len3 = ref2.length; u < len3; u++) {
- ref3 = ref2[u], uid = ref3.uid, name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials;
- for (v = 0, len4 = boards.length; v < len4; v++) {
- boardID = boards[v];
- o = archBoards[boardID] || (archBoards[boardID] = {
- thread: [[], []],
- post: [[], []],
- file: [[], []]
- });
- i = +(!!withCredentials);
- archive = [uid != null ? uid : name, name];
- o.thread[i].push(archive);
- if (software === 'foolfuuka') {
- o.post[i].push(archive);
- }
- if (indexOf.call(files, boardID) >= 0) {
- o.file[i].push(archive);
- }
- }
- }
- for (boardID in archBoards) {
- o = archBoards[boardID];
- ref4 = ['thread', 'post', 'file'];
- for (z = 0, len5 = ref4.length; z < len5; z++) {
- item = ref4[z];
- i = o[item][0].length ? 1 : 0;
- o[item][i].push([null, 'disabled']);
- o[item] = o[item][0].concat(o[item][1]);
- }
- }
- rows = [];
- boardOptions = [];
- ref5 = Object.keys(archBoards).sort();
- for (aa = 0, len6 = ref5.length; aa < len6; aa++) {
- boardID = ref5[aa];
- row = $.el('tr', {
- className: "board-" + boardID
- });
- row.hidden = boardID !== g.BOARD.ID;
- boardOptions.push($.el('option', {
- textContent: "/" + boardID + "/",
- value: "board-" + boardID,
- selected: boardID === g.BOARD.ID
- }));
- o = archBoards[boardID];
- ref6 = ['thread', 'post', 'file'];
- for (ab = 0, len7 = ref6.length; ab < len7; ab++) {
- item = ref6[ab];
- $.add(row, Settings.addArchiveCell(boardID, o, item));
- }
- rows.push(row);
- }
- if (!(g.BOARD.ID in archBoards)) {
- rows[0].hidden = false;
- }
- $.add($('tbody', section), rows);
- boardSelect = $('#archive-board-select', section);
- $.add(boardSelect, boardOptions);
- table = $('#archive-table', section);
- $.on(boardSelect, 'change', function() {
- $('tbody > :not([hidden])', table).hidden = true;
- return $("tbody > ." + this.value, table).hidden = false;
- });
- $.get('selectedArchives', Conf['selectedArchives'], function(arg) {
- var data, id, select, selectedArchives, type;
- selectedArchives = arg.selectedArchives;
- for (boardID in selectedArchives) {
- data = selectedArchives[boardID];
- for (type in data) {
- id = data[type];
- if (select = $("select[data-boardid='" + boardID + "'][data-type='" + type + "']", section)) {
- select.value = JSON.stringify(id);
- }
- }
- }
- });
- },
- addArchiveCell: function(boardID, data, type) {
- var archive, i, length, options, select, td;
- length = data[type].length;
- td = $.el('td', {
- className: 'archive-cell'
- });
- if (!length) {
- td.textContent = '--';
- return td;
- }
- options = [];
- i = 0;
- while (i < length) {
- archive = data[type][i++];
- options.push($.el('option', {
- value: JSON.stringify(archive[0]),
- textContent: archive[1]
- }));
- }
- $.extend(td, {
- innerHTML: "
"
- });
- select = td.firstElementChild;
- if (!(select.disabled = length === 1)) {
- select.setAttribute('data-boardid', boardID);
- select.setAttribute('data-type', type);
- $.on(select, 'change', Settings.saveSelectedArchive);
- }
- $.add(select, options);
- return td;
- },
- saveSelectedArchive: function() {
- return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) {
- return function(arg) {
- var name1, selectedArchives;
- selectedArchives = arg.selectedArchives;
- (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = {}))[_this.dataset.type] = JSON.parse(_this.value);
- return $.set('selectedArchives', selectedArchives);
- };
- })(this));
- },
- boardnav: function() {
- return Header.generateBoardList(this.value);
- },
- time: function() {
- return this.nextElementSibling.textContent = Time.format(this.value, new Date());
- },
- backlink: function() {
- return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) {
- return {
- '%id': '123456789',
- '%%': '%'
- }[x];
- });
- },
- fileInfo: function() {
- var data;
- data = {
- isReply: true,
- file: {
- url: '//i.4cdn.org/g/1334437723720.jpg',
- name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg',
- size: '276 KB',
- sizeInBytes: 276 * 1024,
- dimensions: '1280x720',
- isImage: true,
- isVideo: false,
- isSpoiler: true,
- tag: 'Loop'
- }
- };
- return FileInfo.format(this.value, data, this.nextElementSibling);
- },
- favicon: function() {
- var img;
- Favicon["switch"]();
- if (g.VIEW === 'thread' && Conf['Unread Favicon']) {
- Unread.update();
- }
- img = this.nextElementSibling.children;
- img[0].src = Favicon["default"];
- img[1].src = Favicon.unreadSFW;
- img[2].src = Favicon.unreadNSFW;
- return img[3].src = Favicon.unreadDead;
- },
- togglecss: function() {
- if ($('textarea[name=usercss]', $.x('ancestor::fieldset[1]', this)).disabled = $.id('apply-css').disabled = !this.checked) {
- CustomCSS.rmStyle();
- } else {
- CustomCSS.addStyle();
- }
- return $.cb.checked.call(this);
- },
- usercss: function() {
- return CustomCSS.update();
- },
- keybinds: function(section) {
- var arr, input, inputs, items, key, ref, tbody, tr;
- $.extend(section, {
- innerHTML: "
Keybinds are disabled.
Allowed keys: a-z , 0-9 , Ctrl , Shift , Alt , Meta , Enter , Esc , Up , Down , Right , Left .
Press Backspace to disable a keybind.
"
- });
- $('.warning', section).hidden = Conf['Keybinds'];
- tbody = $('tbody', section);
- items = {};
- inputs = {};
- ref = Config.hotkeys;
- for (key in ref) {
- arr = ref[key];
- tr = $.el('tr', {
- innerHTML: "
" + E(arr[1]) + " "
- });
- input = $('input', tr);
- input.name = key;
- input.spellcheck = false;
- items[key] = Conf[key];
- inputs[key] = input;
- $.on(input, 'keydown', Settings.keybind);
- $.add(tbody, tr);
- }
- return $.get(items, function(items) {
- var val;
- for (key in items) {
- val = items[key];
- inputs[key].value = val;
- }
- });
- },
- keybind: function(e) {
- var key;
- if (e.keyCode === 9) {
- return;
- }
- e.preventDefault();
- e.stopPropagation();
- if ((key = Keybinds.keyCode(e)) == null) {
- return;
- }
- this.value = key;
- return $.cb.value.call(this);
- }
- };
-
- Main = {
- init: function() {
- var db, flatten, items, k, key, len1, ref;
- if (d.body && !$('title', d.head)) {
- return;
- }
- if (window['4chan X antidup']) {
- return;
- }
- window['4chan X antidup'] = true;
- if (location.hostname === 'www.google.com') {
- $.get('Captcha Fixes', true, function(arg) {
- var enabled;
- enabled = arg['Captcha Fixes'];
- if (enabled) {
- return $.ready(function() {
- return Captcha.fixes.init();
- });
- }
- });
- return;
- }
- $.global(function() {
- var k, len1, nuke, prop, ref;
- nuke = function(obj, prop) {
- try {
- return Object.defineProperty(obj, prop, {
- configurable: false,
- get: function() {
- throw new Error();
- },
- set: function() {
- throw new Error();
- }
- });
- } catch (_error) {}
- };
- ref = ['atOptions', 'adsterra_key', 'EpmadsConfig', 'epmads_key', 'EpomConfig', 'epom_key', 'exoDocumentProtocol'];
- for (k = 0, len1 = ref.length; k < len1; k++) {
- prop = ref[k];
- nuke(window, prop);
- }
- });
- $.on(window, 'beforescriptexecute', function(e) {
- var host, ref, ref1;
- host = (ref = e.target.src.split('/')[2]) != null ? (ref1 = ref.match(/[^.]+\.[^.]+$/)) != null ? ref1[0] : void 0 : void 0;
- if (host === 'bnhtml.com' || host === 'ecpmrocks.com' || host === 'advertisation.com' || host === 'exoclick.com') {
- return e.preventDefault();
- }
- });
- $.on(d, '4chanXInitFinished', function() {
- if (Main.expectInitFinished) {
- return delete Main.expectInitFinished;
- } else {
- new Notice('error', 'Error: Multiple copies of 4chan X are enabled.');
- return $.addClass(doc, 'tainted');
- }
- });
- flatten = function(parent, obj) {
- var key, val;
- if (obj instanceof Array) {
- Conf[parent] = obj[0];
- } else if (typeof obj === 'object') {
- for (key in obj) {
- val = obj[key];
- flatten(key, val);
- }
- } else {
- Conf[parent] = obj;
- }
- };
- flatten(null, Config);
- ref = DataBoard.keys;
- for (k = 0, len1 = ref.length; k < len1; k++) {
- db = ref[k];
- Conf[db] = {
- boards: {}
- };
- }
- Conf['selectedArchives'] = {};
- Conf['cooldowns'] = {};
- Conf['Index Sort'] = {};
- Conf['Except Archives from Encryption'] = false;
- Conf['JSON Navigation'] = true;
- Conf['Oekaki Links'] = true;
- items = {};
- for (key in Conf) {
- items[key] = void 0;
- }
- items['previousversion'] = void 0;
- return $.get(items, function(items) {
- return $.asap((function() {
- return doc = d.documentElement;
- }), function() {
- var ref1, val;
- if ($.cantSet) {
-
- } else if (items.previousversion == null) {
- Main.ready(function() {
- $.set('previousversion', g.VERSION);
- return Settings.open();
- });
- } else if (items.previousversion !== g.VERSION) {
- Main.upgrade(items);
- }
- for (key in Conf) {
- val = Conf[key];
- Conf[key] = (ref1 = items[key]) != null ? ref1 : val;
- }
- return Main.initFeatures();
- });
- });
- },
- upgrade: function(items) {
- var changes, previousversion;
- previousversion = items.previousversion;
- changes = Settings.upgrade(items, previousversion);
- items.previousversion = changes.previousversion = g.VERSION;
- return $.set(changes, function() {
- var el, ref;
- if ((ref = items['Show Updated Notifications']) != null ? ref : true) {
- el = $.el('span', {
- innerHTML: "4chan X has been updated to
version " + E(g.VERSION) + " ."
- });
- return new Notice('info', el, 15);
- }
- });
- },
- initFeatures: function() {
- var err, feature, hostname, k, len1, match, name, pathname, ref, ref1, ref2, ref3, search;
- hostname = location.hostname, search = location.search;
- pathname = location.pathname.split(/\/+/);
- if (hostname !== 'www.4chan.org') {
- g.BOARD = new Board(pathname[1]);
- }
- if (hostname === 'boards.4chan.org' || hostname === 'sys.4chan.org' || hostname === 'www.4chan.org') {
- $.global(function() {
- document.documentElement.classList.add('js-enabled');
- return window.FCX = {};
- });
- Main.jsEnabled = $.hasClass(doc, 'js-enabled');
- }
- switch (hostname) {
- case 'www.4chan.org':
- $.onExists(doc, 'body', function() {
- return $.addStyle(Main.cssWWW);
- });
- Captcha.replace.init();
- return;
- case 'sys.4chan.org':
- if (pathname[2] === 'imgboard.php') {
- if (/\bmode=report\b/.test(search)) {
- Report.init();
- } else if ((match = search.match(/\bres=(\d+)/))) {
- $.ready(function() {
- var ref;
- if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') {
- return Redirect.navigate('thread', {
- boardID: g.BOARD.ID,
- postID: +match[1]
- });
- }
- });
- }
- } else if (pathname[2] === 'post') {
- PostSuccessful.init();
- }
- return;
- case 'i.4cdn.org':
- if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) {
- return;
- }
- $.asap((function() {
- return d.readyState !== 'loading';
- }), function() {
- var ref, video;
- if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
- return Redirect.navigate('file', {
- boardID: g.BOARD.ID,
- filename: pathname[pathname.length - 1]
- });
- } else if (video = $('video')) {
- if (Conf['Volume in New Tab']) {
- Volume.setup(video);
- }
- if (Conf['Loop in New Tab']) {
- video.loop = true;
- video.controls = false;
- video.play();
- return ImageCommon.addControls(video);
- }
- }
- });
- return;
- }
- if ((ref = pathname[2]) === 'thread' || ref === 'res') {
- g.VIEW = 'thread';
- g.THREADID = +pathname[3];
- } else if ((ref1 = pathname[2]) === 'catalog' || ref1 === 'archive') {
- g.VIEW = pathname[2];
- } else if (pathname[2].match(/^\d*$/)) {
- g.VIEW = 'index';
- } else {
- return;
- }
- g.threads = new SimpleDict();
- g.posts = new SimpleDict();
- $.onExists(doc, 'body', Main.initStyle);
- ref2 = Main.features;
- for (k = 0, len1 = ref2.length; k < len1; k++) {
- ref3 = ref2[k], name = ref3[0], feature = ref3[1];
- try {
- feature.init();
- } catch (_error) {
- err = _error;
- Main.handleErrors({
- message: "\"" + name + "\" initialization crashed.",
- error: err
- });
- }
- }
- return $.ready(Main.initReady);
- },
- initStyle: function() {
- var keyboard, ref;
- if (!Main.isThisPageLegit()) {
- return;
- }
- if ((ref = $('link[href*=mobile]', d.head)) != null) {
- ref.disabled = true;
- }
- $.addClass(doc, 'fourchan-x', 'seaweedchan');
- $.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW);
- if ($.engine) {
- $.addClass(doc, $.engine);
- }
- $.onExists(doc, '.ad-cnt', function(ad) {
- return $.onExists(ad, 'img', function() {
- return $.addClass(doc, 'ads-loaded');
- });
- });
- if (Conf['Autohiding Scrollbar']) {
- $.addClass(doc, 'autohiding-scrollbar');
- }
- $.ready(function() {
- if (d.body.clientHeight > doc.clientHeight && (window.innerWidth === doc.clientWidth) !== Conf['Autohiding Scrollbar']) {
- Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar'];
- $.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar']);
- return $.toggleClass(doc, 'autohiding-scrollbar');
- }
- });
- $.addStyle(Main.css, 'fourchanx-css');
- Main.bgColorStyle = $.el('style', {
- id: 'fourchanx-bgcolor-css'
- });
- keyboard = false;
- $.on(d, 'mousedown', function() {
- return keyboard = false;
- });
- $.on(d, 'keydown', function(e) {
- if (e.keyCode === 9) {
- return keyboard = true;
- }
- });
- window.addEventListener('focus', (function() {
- return doc.classList.toggle('keyboard-focus', keyboard);
- }), true);
- return Main.setClass();
- },
- setClass: function() {
- var mainStyleSheet, setStyle, style, styleSheets;
- if (g.VIEW === 'catalog') {
- $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-'));
- return;
- }
- style = 'yotsuba-b';
- mainStyleSheet = $('link[title=switch]', d.head);
- styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
- setStyle = function() {
- var bgColor, div, k, len1, styleSheet;
- $.rmClass(doc, style);
- style = null;
- for (k = 0, len1 = styleSheets.length; k < len1; k++) {
- styleSheet = styleSheets[k];
- if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) {
- style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-');
- break;
- }
- }
- if (style) {
- $.addClass(doc, style);
- return $.rm(Main.bgColorStyle);
- } else {
- div = $.el('div', {
- className: 'reply'
- });
- div.style.cssText = 'position: absolute; visibility: hidden;';
- $.add(d.body, div);
- bgColor = window.getComputedStyle(div).backgroundColor;
- $.rm(div);
- Main.bgColorStyle.textContent = ".dialog, .suboption-list > div:last-of-type {\n background-color: " + bgColor + ";\n}";
- return $.after($.id('fourchanx-css'), Main.bgColorStyle);
- }
- };
- setStyle();
- if (!mainStyleSheet) {
- return;
- }
- return new MutationObserver(setStyle).observe(mainStyleSheet, {
- attributes: true,
- attributeFilter: ['href']
- });
- },
- initReady: function() {
- var msg, ref, ref1, ref2;
- if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) {
- ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
- if (Conf['404 Redirect']) {
- return Redirect.navigate('thread', {
- boardID: g.BOARD.ID,
- threadID: g.THREADID,
- postID: +location.hash.match(/\d+/)
- }, "/" + g.BOARD + "/");
- }
- });
- return;
- }
- if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') {
- return;
- }
- if (((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && !$('.board + *')) {
- msg = $.el('div', {
- innerHTML: "The page didn't load completely.
Some features may not work unless you
reload ."
- });
- $.on($('a', msg), 'click', function() {
- return location.reload();
- });
- new Notice('warning', msg);
- }
- if (!(Conf['JSON Index'] && g.VIEW === 'index')) {
- return Main.initThread();
- } else {
- Main.expectInitFinished = true;
- return $.event('4chanXInitFinished');
- }
- },
- initThread: function() {
- var board, err, errors, k, len1, len2, m, postRoot, posts, q, ref, ref1, scriptData, thread, threadRoot, threads;
- if ((board = $('.board'))) {
- threads = [];
- posts = [];
- ref = $$('.board > .thread', board);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- threadRoot = ref[k];
- thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
- threads.push(thread);
- ref1 = $$('.thread > .postContainer', threadRoot);
- for (q = 0, len2 = ref1.length; q < len2; q++) {
- postRoot = ref1[q];
- if ($('.postMessage', postRoot)) {
- try {
- posts.push(new Post(postRoot, thread, g.BOARD));
- } catch (_error) {
- err = _error;
- if (!errors) {
- errors = [];
- }
- errors.push({
- message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.",
- error: err
- });
- }
- }
- }
- }
- if (errors) {
- Main.handleErrors(errors);
- }
- if (g.VIEW === 'thread') {
- scriptData = Get.scriptData();
- threads[0].postLimit = /\bbumplimit *= *1\b/.test(scriptData);
- threads[0].fileLimit = /\bimagelimit *= *1\b/.test(scriptData);
- threads[0].ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : void 0;
- }
- Main.callbackNodes(Thread, threads);
- return Main.callbackNodesDB(Post, posts, function() {
- var len3, post, u;
- for (u = 0, len3 = posts.length; u < len3; u++) {
- post = posts[u];
- QuoteThreading.insert(post);
- }
- Main.expectInitFinished = true;
- return $.event('4chanXInitFinished');
- });
- } else {
- Main.expectInitFinished = true;
- return $.event('4chanXInitFinished');
- }
- },
- callbackNodes: function(klass, nodes) {
- var cb, i, node;
- i = 0;
- cb = klass.callbacks;
- while (node = nodes[i++]) {
- cb.execute(node);
- }
- },
- callbackNodesDB: function(klass, nodes, cb) {
- var cbs, fn, i, softTask;
- i = 0;
- cbs = klass.callbacks;
- fn = function() {
- var node;
- if (!(node = nodes[i])) {
- return false;
- }
- cbs.execute(node);
- return ++i % 25;
- };
- softTask = function() {
- while (fn()) {
- continue;
- }
- if (!nodes[i]) {
- if (cb) {
- cb();
- }
- return;
- }
- return setTimeout(softTask, 0);
- };
- return softTask();
- },
- handleErrors: function(errors) {
- var div, error, k, len1, logs;
- if (!(errors instanceof Array)) {
- error = errors;
- } else if (errors.length === 1) {
- error = errors[0];
- }
- if (error) {
- new Notice('error', Main.parseError(error, Main.reportLink([error])), 15);
- return;
- }
- div = $.el('div', {
- innerHTML: E(errors.length) + " errors occurred." + Main.reportLink(errors).innerHTML + " [
show ]"
- });
- $.on(div.lastElementChild, 'click', function() {
- var ref;
- return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref;
- });
- logs = $.el('div', {
- hidden: true
- });
- for (k = 0, len1 = errors.length; k < len1; k++) {
- error = errors[k];
- $.add(logs, Main.parseError(error));
- }
- return new Notice('error', [div, logs], 30);
- },
- parseError: function(data, reportLink) {
- var context, error, lines, message, ref, ref1;
- c.error(data.message, data.error.stack);
- message = $.el('div', {
- innerHTML: E(data.message) + (reportLink ? reportLink.innerHTML : "")
- });
- error = $.el('div', {
- textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
- });
- lines = ((ref = data.error.stack) != null ? (ref1 = ref.match(/\d+(?=:\d+\)?$)/mg)) != null ? ref1.join().replace(/^/, ' at ') : void 0 : void 0) || '';
- context = $.el('div', {
- textContent: "(4chan X ccd0 v" + g.VERSION + " userscript on " + $.engine + lines + ")"
- });
- return [message, error, context];
- },
- reportLink: function(errors) {
- var data, details, ref, title, url;
- data = errors[0];
- title = data.message;
- if (errors.length > 1) {
- title += " (+" + (errors.length - 1) + " other errors)";
- }
- details = "[Please describe the steps needed to reproduce this error.]\n\nScript: 4chan X ccd0 v" + g.VERSION + " userscript\nUser agent: " + navigator.userAgent + "\nURL: " + location.href + "\n\n" + data.error + "\n" + (((ref = data.error.stack) != null ? ref.replace(data.error.toString(), '').trim() : void 0) || '');
- details = details.replace(/file:\/{3}.+\//g, '');
- url = "https://gitreports.com/issue/ccd0/4chan-x?issue_title=" + (encodeURIComponent(title)) + "&details=" + (encodeURIComponent(details));
- return {
- innerHTML: "
[report ] "
- };
- },
- 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');
- }
- return Main.thisPageIsLegit;
- },
- ready: function(cb) {
- return $.ready(function() {
- if (Main.isThisPageLegit()) {
- return cb();
- }
- });
- },
- css: "/*!\n" +
-" * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome\n" +
+boards:
+"/*!\n" +
+" * Font Awesome 4.6.1 by @davegandy - http://fontawesome.io - @fontawesome\n" +
" * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n" +
" */\n" +
"@font-face {\n" +
" font-family: FontAwesome;\n" +
-" src: url('data:application/font-woff;base64,d09GRgABAAAAAUaEAA4AAAACKvgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABRAAAABwAAAAcagNvKUdERUYAAAFgAAAAHwAAACACtAAET1MvMgAAAYAAAAA/AAAAYIhZeh5jbWFwAAABwAAAAXcAAALyp8d/bWdhc3AAAAM4AAAACAAAAAj//wADZ2x5ZgAAA0AAASr8AAH7LBMsk3FoZWFkAAEuPAAAADEAAAA2DQzHVWhoZWEAAS5wAAAAHwAAACQPAwpbaG10eAABLpAAAAK8AAAKCpMpFypsb2NhAAExTAAABPUAAAUQaY3nVm1heHAAATZEAAAAHwAAACAC8AIcbmFtZQABNmQAAAGhAAADiDNGhcdwb3N0AAE4CAAADnIAABggxzdjQXdlYmYAAUZ8AAAABgAAAAaOKlZPAAAAAQAAAADMPaLPAAAAAMtQjbAAAAAA0nU+qXjaY2BkYGDgA2IJBhBgYmBkYGRqA5IsYB4DAAokALsAeNpjYGZzZ5zAwMrAwtLDYszAwNAGoZmKGRgYuxjwgILKomIGBwaFrwxsDP+BfDYGRmUgxYikRIGBEQDIZghzAHjazZI/a9pxEMbvZ4xJE+pd/jWxDfan0DWVvAARsotDlgy1Dp3FVyBOHcVXII7tIlI6hAwlU8bgWAIaIYP5Y9J7rk3SNtZvfqkQaKFLh9KDe44HHu4DxxHRBI17lbxAyRsEzvvpw147mCXK0CSlyKcGvaUmvac9+ujP+M/9l4lkMp4sPBtqVOOa1qzmtahlrWpdm/pO97WrFzpCFHGsIY0s8iiijCrqaOID9tHFBUYWtbilLWt5K1rZqla/JOcC8h3xzT2RfiGSiiY0ozktaEkrWtOGtnRX29pTBUHgI4UMciighApqa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GJSIQYkYlIhBiRiUiEGJGJSIQYkYlIhBiRiUpC9VFURVEFVBiAZUVRA1QdQEUROEUK+EeiXUK6FeCfVKqFc1QShBCO9KeFfCuxLelfCuhHclvCvhXQnvSnhXwrsS3pXwrgxBGIIQ0pUhCEMQTHqvwghuBMGkc08QQroS0lVdEHVBCOlKSFdCuhLSlZCuhHQlpCshXQnpSkhXQroS0pWQroR0JaQrIV01BCGZQEkmUJIJFJPeq9R1JNPK3GxiGWcI9YZQbyT5oDKnEmvIZF2aOWnYnyFaMoR/Q/g3hH9D+DeEf0P4N4R/Q/g3hH9D+DeEf0P4N4R/Q/g3hH9D+DeEf0P4NyrxtazMJzucLye2kthqYpOtzidbnTcSW0/sXGIn680ntpnYdYldn9gNsW0mfpuJ32bit5n4bSZ+m4nfZuK3mfhtJn6bid9m4reZ+G0mfpuJ3+aG/wKaCq5qAAABVwz+AQAA') format('woff');\n" +
" font-weight: 400;\n" +
" font-style: normal;\n" +
"}\n" +
-".fa::before {\n" +
-" font-family: FontAwesome;\n" +
-" font-weight: 400;\n" +
-" font-style: normal;\n" +
-" -webkit-font-smoothing: antialiased;\n" +
-" text-decoration: inherit;\n" +
-" speak: none;\n" +
-" display: inline-block;\n" +
-" font-size: 13px;\n" +
-" visibility: visible;\n" +
-"}\n" +
-":root:not(.shortcut-icons) #shortcuts .fa::before {\n" +
-" display: none;\n" +
-"}\n" +
-":root.shortcut-icons #shortcuts .fa::before {\n" +
-" font-size: 15px !important;\n" +
-" margin-top: -3px !important;\n" +
-" position: relative;\n" +
-" top: 1px;\n" +
-"}\n" +
-":root.shortcut-icons #shortcuts .fa, .menu-button .fa {\n" +
-" font-size: 0;\n" +
-" visibility: hidden;\n" +
-"}\n" +
-":root.shortcut-icons .shortcut.brackets-wrap::after,\n" +
-":root.shortcut-icons .shortcut.brackets-wrap::before {\n" +
-" display: none;\n" +
-"}\n" +
-":root.shortcut-icons #shortcuts a .fa,\n" +
-".menu-button .fa,\n" +
-".hide-reply-button .fa,\n" +
-".hide-thread-button .fa {\n" +
-" display: inline;\n" +
-"}\n" +
".fa-glass:before {content: \"\\f000\";}\n" +
".fa-music:before {content: \"\\f001\";}\n" +
".fa-search:before {content: \"\\f002\";}\n" +
@@ -19237,6 +1099,63 @@
".fa-bluetooth:before {content: \"\\f293\";}\n" +
".fa-bluetooth-b:before {content: \"\\f294\";}\n" +
".fa-percent:before {content: \"\\f295\";}\n" +
+".fa-gitlab:before {content: \"\\f296\";}\n" +
+".fa-wpbeginner:before {content: \"\\f297\";}\n" +
+".fa-wpforms:before {content: \"\\f298\";}\n" +
+".fa-envira:before {content: \"\\f299\";}\n" +
+".fa-universal-access:before {content: \"\\f29a\";}\n" +
+".fa-wheelchair-alt:before {content: \"\\f29b\";}\n" +
+".fa-question-circle-o:before {content: \"\\f29c\";}\n" +
+".fa-blind:before {content: \"\\f29d\";}\n" +
+".fa-audio-description:before {content: \"\\f29e\";}\n" +
+".fa-volume-control-phone:before {content: \"\\f2a0\";}\n" +
+".fa-braille:before {content: \"\\f2a1\";}\n" +
+".fa-assistive-listening-systems:before {content: \"\\f2a2\";}\n" +
+".fa-asl-interpreting:before, .fa-american-sign-language-interpreting:before {content: \"\\f2a3\";}\n" +
+".fa-deafness:before, .fa-hard-of-hearing:before, .fa-deaf:before {content: \"\\f2a4\";}\n" +
+".fa-glide:before {content: \"\\f2a5\";}\n" +
+".fa-glide-g:before {content: \"\\f2a6\";}\n" +
+".fa-signing:before, .fa-sign-language:before {content: \"\\f2a7\";}\n" +
+".fa-low-vision:before {content: \"\\f2a8\";}\n" +
+".fa-viadeo:before {content: \"\\f2a9\";}\n" +
+".fa-viadeo-square:before {content: \"\\f2aa\";}\n" +
+".fa-snapchat:before {content: \"\\f2ab\";}\n" +
+".fa-snapchat-ghost:before {content: \"\\f2ac\";}\n" +
+".fa-snapchat-square:before {content: \"\\f2ad\";}\n" +
+".fa::before {\n" +
+" font-family: FontAwesome;\n" +
+" font-weight: 400;\n" +
+" font-style: normal;\n" +
+" -webkit-font-smoothing: antialiased;\n" +
+" text-decoration: inherit;\n" +
+" speak: none;\n" +
+" display: inline-block;\n" +
+" font-size: 13px;\n" +
+" visibility: visible;\n" +
+"}\n" +
+":root:not(.shortcut-icons) #shortcuts .fa::before {\n" +
+" display: none;\n" +
+"}\n" +
+":root.shortcut-icons #shortcuts .fa::before {\n" +
+" font-size: 15px !important;\n" +
+" margin-top: -3px !important;\n" +
+" position: relative;\n" +
+" top: 1px;\n" +
+"}\n" +
+":root.shortcut-icons #shortcuts .fa, .menu-button .fa {\n" +
+" font-size: 0;\n" +
+" visibility: hidden;\n" +
+"}\n" +
+":root.shortcut-icons .shortcut.brackets-wrap::after,\n" +
+":root.shortcut-icons .shortcut.brackets-wrap::before {\n" +
+" display: none;\n" +
+"}\n" +
+":root.shortcut-icons #shortcuts a .fa,\n" +
+".menu-button .fa,\n" +
+".hide-reply-button .fa,\n" +
+".hide-thread-button .fa {\n" +
+" display: inline;\n" +
+"}\n" +
".fa-spin::before {\n" +
" -webkit-animation:spin 2s infinite linear;\n" +
" -moz-animation:spin 2s infinite linear;\n" +
@@ -20093,7 +2012,7 @@
":root.float #updater {\n" +
" padding: 0px 3px;\n" +
"}\n" +
-":root:not(.float) #updater {\n" +
+":root:not(.float).shortcut-icons #updater {\n" +
" display: inline-block;\n" +
" min-width: 12pt;\n" +
" text-align: right;\n" +
@@ -21046,75 +2965,6 @@
".boardSubtitle[contenteditable=\"true\"] {\n" +
" cursor: text !important;\n" +
"}\n" +
-"/* Link Title Favicons */\n" +
-".linkify.audio {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.clyp {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.dailymotion {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.gfycat {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8qLf86Pi9Kzj9K7k9LHp9sDp98Lq98Ps+Mr0++L5/O75/fD6/fH6/fL6/fP7/fT7/fb8/ff8/vj8/vn+/v7///91X4cfAAAAcklEQVR42o3M2xKBUACF4aVQckrIuRJK6H//x2sme4/MuPDfre9i6c/Cc3U5Dj87BuAxsXvGu6JvIIXEHRWwNHCHQNrCzkAFkbSBg4EM8i+Yw7PXBa3zRfuxVyf/Bis7nKwGKAcWxgC8prI5Sc315OlnDfzpDar2S9/oAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.gist {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABblBMVEXc3NykpKTW1tbb29ugoKCdnZ0AAAACAgIEDRcKCgoMDAwODg4QIzYRDAoTExMUDwwVAg0WICsaEw8aGhoiCBklGxUmERwwKCQ7LSU7Ozs8LSZFLyNINi1JNyxJNy1KSklMOi5VR1FXV1daQTRkZGRseYZwU0F4eHh7dnR8bWV/YE6IdGiKcGCKkJaNgYeNjY2RdGOScWCUcWCZmZmhoaGkpKSoqKirfmaurq6xsbG1tbW6urq+vr7AbmzBb23CwsLGxsbHx8fHyMjJycnJysrMzMzOiYbPi4fQ0NDRoYbT09PU1NTW1tbY2NjZqIzZ2dnb29vd3d3f39/i4uLktZrk5OTl5eXm5ubn5+fo6Ojq6urs7OzttKLu7u7wuqbw8PDx8fHz8/P4+Pj5+fn7uZj8vpz9ya79ybD/tZf/upr/wZ//w6H/xKH/xaL/xrH/yqj/y7T/zqv/z7D/07D/17n/2Lv/2Lz/3L//38n/4Mk3Q/ZuAAAABnRSTlMSFcbGzc5MNKFvAAAA1klEQVQoz2NgYPZHAswMDEwRSclwkBTBxOARn4gE4j0YXBOiJNUDg7y8Ar1UlOITXBkcY73Z2Li42dg42dn4wmIdGeyjQ7nZoEA4PNqewSZKlw0O9KJsGKwjBdl4ZeWkJGQUhNjEIq0ZrMI5+D0ri7Jz8itCRAXCrRgsQ3mUy+xicrPSbfO0REItGSyCVaVL3ONSU9LcCtQUgy0YzIJ85M1LizMzCsv9xF2CzBhMAwN99TV1DI0MtDWcAgNNGUycA5CAswkDi5kDwrMOZiwMjKzGSICVEQDhZj0UQV7PewAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.image {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAs5JREFUOE+lk/tvi1EYx98/xT8gW4REIpGFMEQWl2FiM9ZMZhm2xRAyOsmujFFmdFRHu0tWm87UypxStr69zPauN5e5rHVp3IYhbOvHy+wHEQlxkm+ek+d8nm9OznkeSfrfldmgJC7QyUlTymsJTfuTZ25z4HdWYwyLreYhtpgekGPw0+kKvo1Eo+IXRSIiEhkWZuc9tqnsJD9EqTUopCxjSGTpB0iueczSo1HyW8cpsExQ1DbxI2pt45j9cXpexul4FEd79RnZphAa/SD7WvuFtO6UItbU9LC+YQxNI2w0wwYT5LRAdhOU3oBTIXC9gXP3oUSGgz2vST3gYHejR0jptT1C332f8yrUEYHrz8CgxDnpm6DKCUfc0KnmXa/AEVPPwnDcD0cvetA2uYRk67Ive/lpjO7YBO1PPuF8Df3vwf4cbNE4tqdw7YVq8HYyHx6FvhE1hkMEg8HDUqvFkjT4aIjMqkqyqkswDSrcfBfH+Q561YLAZ/B+BLda6FXlU/cPv0AoEPhuoP1h4Av7Wbh9E/Py15NWWUjeSR3nZDfeN+N0DY9hG/7K1eGP3P0S5/EYRFUF/IOTBrUXHPm9fT6mr1xEwupkZqxbzLyiDJYUZ5NSnkdqdSHpxyrYdFpPgdmAsdfJwPMI/Yr65bf7tZLGGBQ7DNdJWFtIYvoOZmbuZE7OXpIKKli86zAr9p9gTVktWTVnKTI2U95uRWe3U2IJUDbVB5p6hVm5x5m9Vc/cnedZUNzC8lILaQesZBy6hEZ3maKzgvJWFzVWD9XtXvVGQbSWASFtMATVRlJIKbOTWtlJXaeXepuPM1f6MNp9GLt8mLvvYLmp0OhQ2Fwvk6m7xaqDTvY0eYWUVtcnllXfYlGpnfklVuraHHg8HjxuN+6fktUHlWWZPaZeUo/ILK0UKttBcbNbSB9GP0yLxWJJUxoZGUn80zD9C/vXQ/4NHY10h3M1zmQAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.installgentoo {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABcVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3dIYAAAAAAAAAAAAbGh4BBAcCBgoBBgoCBwsCCQ/QzucCCA7MyuXZ1eUBBQmTh8fo5/i9svIAAADh3vQAAAACCA0CCQ8CCQ4DDBQbGCUDChDr6vgAAAAAAAAREBIDCxK6tdfe2fTv7/cDCxIDDBQEDRUHDhgMJjXk4PZdXWdLUFoUNEYOKDgSMUMRLUBneI4eTGj08/QmW3onW3rTzvfOx/giU3IiVHMkWHdEaYJobHv3+PokWHpua6TNy9xZgZ+1quz8/foQKj0XPFInWn0nW38tZ4o6fqg8gq48grA9hrU/i7pAhrNAiLdBjLtEjr1FksNIjr5Il8pImMtKWnNqhL97odKFqti5q/q5rPq60+nCt/vLw/vPx/jV0vHY0/rc1/rg2/vh3fzn4fzu6/vx8vf19Pv19Pz49/v5+Pv8/Pv8/fr9/vv+/frziVtUAAAAT3RSTlMABQYHCAoNDhARGRobL0ZOV1xdXV5fYGBmZnB0eX2MjZSaoaGio6mqqqustLq7zubo6Ojo6evt7u/x8fLy9/f4+Pj5+vr6+vr6+/39/v7+XKgUSwAAAMhJREFUKM9jYGDg4OZmZgABKINT1dBAhBHIYFMxMBIDisjbhoZbCTExsCu5hoeY8DEwcOkEx8fY6MqpucTGB0izglVEplcU5/gmRYWBVQDNMK+s0hN3SvMyBpsBNJxXw0NfwTEjVQZqHQMHj5RfWW5mliSEC7TPzK6yJD/bXZQRzGdXcisqLy309okA2Q4Eis4peQWmstqBCdGW/CABraC45ERBBs3A6Fh/AbAKTwsHa34QZW8NVsGuLqwswQSjQICTmYMFQaEDAAF8JHLfKGswAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.liveleak {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAlNJREFUGBkFwU2LVmUYAODrPu8Z5x1xSpRBXQyFoLsBE+wfiO5atJOgnf9DUPwFgtGinUgEaQsRhHYuMtpEiEWuG5iNjuOcj+c8z911xXcXL/68c3Dw1fzhg0QgEQAAEYGUKXFie9vxlSs/xk/rdavjGEkmkWSih65z4osv9GfOiK6LzEyZ2uGh4dUrmzs72ddlUUhkoiMr4PT167589Mh6c1N0nSRlqrX67dat+PDyZXRT19m5edPnt28rGFHxMcJ6d9fprS1/37tneP3aemPD1uamUydPOru3p5DdGOH0tWsu3LhhxIQJM2qEpRT/Pn3q/du3AhARSmvGTH0lplKMrVkiYpVpQaJlighzhDkzhmEA0fcWoqAfyaFW4zTlgCABxlrNmY4ylUzLsiREprFWc0T2M+ZSjKWY0AEaltZUjJixZJIpuk5pTWlNP2BYFvOyKJkCAKU1tTXHrZlqVWolUxdhxsfVSj9FmJfFMM9GdICGGa01HyMstYpMIFPJVNDPmYZSTOPoOEKHzNRlKpmWWh1j6TpLa2SKTKVWU6Z+Qolwdm/P9QcPZKa2LH69e9eIMs+WCL/cv2/98CGZPrt61am+V9APq1X89eyZ/968obVYaiXT4dGREgG+vnPHeHgYMsH2+fP+efEihtVKv7SWw/6+9/v7KYLMhIywTJPamvOXLomukyRsrNf+ePzYkpl9dJ3SWgSCSCQCfz5/7pMLF2yfO6eLiAQcHRz4/cmT+HR7O+Ob3d0fNt69+7a2BiICQCJbA0EgE5lpvbXl1OXL3/8Pfax4+6SjSukAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.pastebin {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB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eat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.soundcloud {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABsklEQVQ4y5WTy2pUQRCGv2rbzDjJeAlIBmOyipGIIJqFEBDElwh4yULGeRFXPoEIBl/AvQ/gC2RnxCAoxijiwks852S6+3dxzslcHJCpTXVX11/Xv0097gLPgVNMJxnQNfX4zsqleWbnpoMf/oa9d988MM9MC/rp+E0a+A0dsVobMNMCOO8B6McRoABJI+A6gJmN3D2A8jgEBCEkSEMBrcrsDAzDWWn3AjgKFaDMmgRqniGFgsaDp1jrLOngDf1XT1D+A1dFc4MKAkkiCVKjjVu7g9+4Rzx4i1u6hjXbuMWr0O5QPNvCu7IaCZwEKQukLGDrm5x8uI0tr6MkiGlkiv7yLfzN+6S5i6QsIMABkEfcxhbWWYMkVAOjxvYAjc3HNHrbKI9VBQBFwF25XQKSBjqIf1YBuAurEMrczgDygD6/x2LCpFLXLUyQ+PoldphhBhYfIX09XU1+Flaukz7uYqs3SHs7cG4BmTsmkBUF9mmXEwa28BNLPaQPLepuNcbGSWQquQC2/Kdcox1FUGkcB0ykck1nA2+wTzMs8stGnP4rbWGw74EuS/GFQWfK7/wF6P4F7fzIAYkdmdEAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.twitchtv {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAYUExURf///2RBpWRBpWRBpWRBpWRBpWRBpf///+zQyUYAAAAGdFJOUwFdZX0lTzs4r5oAAAABYktHRAcWYYjrAAAAB3RJTUUH4AINEi42iSXRNAAAAD1JREFUCNdjYEiDAAZGGIMtjQEEUBlMCWoEGci6mGEMsxQgIy0BiB3AjLS0FAYQIw0kwABipoI1AhkBQBIAFCIXxiHgq80AAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.twitter {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAEsUExURf///1Cf21Gg3FGi31Gh3VKj4FGh3lKj4VKk4lKl41Ol5FOn51Sp6VSo6FOn5lCf21Gg3FGh3VGi31Gi31Gh3lGg3FGg3FGg3FGg3FGh3lGg3FGi31Kk4lKj4FGh3lGi31Kk4lGh3lGg3FGh3lOm5FOm5VGi31Kj4VSo6FGi31Gh3VGg3FKj4FOn51Gi31So6FWr7VOl5FGi31On51Sq6lKk4lOo51Sp6VOm5FSq61Ws7VOn51Oo51Sq61Ol5FOm5FSq61Wr7VOo51On51Sr7FWs7VSp6lGg3FGh3VOm5FWr7VSp6lKj4VOm5FSo6FSr7FWs7VWs7VWr7VSq6lOo51Om5FOo51So6FOm5VOl5FSq61Ws7VSr7FSp6lSp6VWs7lWr7VKk4lSq6v///6E3MNsAAABVdFJOUwAAAAAAAAAAAAAAAAAAAB0Ii+3xnBVTJhfsMKb+qTEp9GwBF/7lLAbo0m4pLkUTdvk2Ev3+EZnOBo/3Z8ffCRzH/D0OqPxiLnvx3UI8m9n1++GwXQZNS29BAAAAAWJLR0QAiAUdSAAAAAd0SU1FB+ACDRIwBwy67tEAAADKSURBVBjTY2BAB4xogIGRH8IQEBQSFhEVE2eQkJQC8ZmkQ8PCI2Rk5RjkIxUUlRgZlVWioqNjYlXVGNQ14iI1tbR14qLj4+MTdJkZ9PQNosJCE0OjgPz4KEMWBiPjhPiEmKQokIJ4E1MmBmazhHg4MGdlYmCzsLSC8ROsmRkZmFht4Eps7ViADmOzd4DyHZ2YmYACTOzOLmATXd04mIBOd/eQ9owFCXh5c7KB/MLi4+vnHxAYFBzCwcYEEmBi5uLm4eHl42RmAnsSAMZBLgZiFUQ5AAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.video {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAxgDGAP8nNqN7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gMZBjQQLEEqGwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAA5SURBVDjLY2AYaMDIwMDwn1JD/lPCZhpwL+B1wf///ykzgBhDiAoDfIYQZQAjIyP5BuDTPJqQqAQAvW0ZAMk8+EEAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.vimeo {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAAIdZUKh6sLlLkLmr4LmsAMp88NrdYVW3MZj7Acstkrt9s1e5E7vN5EfI9JvdtKwuBijp5kpbl30eiDt8aG1uqRr7qTyNehxM+k4PCy3enB3OTg6Ovv9PXw+fz////L9U5WAAAAAXRSTlMAQObYZgAAAIFJREFUeNplz90OwiAMBWAQpAoyxclkP3je/y0H2AQXz0WT8100rRD6kNI9/cRroemQL3hXhoujZYj4OHoAmBvYGcBISwbWBvfXCrytnIDUQMkbsBpagMA7zhtQdyTFQAmIG7IkYniiZuh3XGsPqoOZkMOJOpAcLqUzNFGGu/57fwc1hgtp0mVSyQAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.vine {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAA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1Q30WGi19fb1KzAwyKFhYGSUY+MTkwpMTXNmFpibX+Di0rICWFldW9/A5tb2zu7ePtTrg0MeHePklPYzuDRw7uDF5RWvbwC32O0d7x8en55f4DHF6xv5/vHp6f/k6/vH+evuf1LAObptvSvrAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.vocaroo {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAw9JREFUOE9jYMABuMwYmCyTJKUCGlSnFSy02TTzeOyCiQcDViX26qVz2TAyYtWmEMwuoZ3M7V40LcB79pHkc0svpvzY8jD//87nxf+3Pyn8v/ZO8v+VNyP/2mZJumI1QCWSI8232Hjumitlfw5+qPp/9l8TCt76JP//xkdx/wsXWCzjtWFkwTCkbWFe9plPk/+ga4Txz/xt/D/hkN//gMXif21a+NbyWjIwoRiy6GDT5rP/mlFsPfyp5n/NpOj/22+0gMUXXIz/H7hC/L/bFKFbPDZMrHAD5H35OPt2J9zacDv/f3V7xv9FhwrBGubsT/1//Pjx/1GJ/mD+/nfl/1v3Ovy3KRJNQbHdOlXCvOO03/+pm1P/v3v37n90hhtYw9HPtf8Xb2v937cmHswHeWPRxYj/LvkK3igGKARwicTO07118H3V/5kbi/4vPZMJtK3s/6YH2f+Pfq1B8VbjWrdnMu5s4nAD9CNFhKwz5DTUvLl419zKvAcLtG1P84BRl/b/5M/6/6f/NPzf/qzo84yj0Uus0xUU4Zor54bm9+4OfZG02OCuoAMTb9ZkC9ull1Nvrr2Z+XvRpaRfc65H/68F+jl9svEhzyLFWoccWVc+eyTHq/twydjlKRln7jX9bNMkMJnbhoFRL1xCqmKx6/yi2fYXa/c5/e846PV/5fW0/7OPx/yfcjzop34ulxdGGvDuU8mMXaX507lBuiN6ueadmQeT/p/93vf/1O+G//sP5fw/eL3o/5JLif8zVxs+Tlir9S26UyeFQQvJGBE7FvaFZ9LfN+1y+WjbItSb3GmXvXd15v8zroH/HxgE/D+aGPx/18vi/z07PeZNPRKxe/Kh0Ae8toxscCO4zBkYXArk9C1SxJUYjBkYPPIVtbbuTftz3cz//2O9wP/75iSAXdO72/dt2HL5F6YlfBW4MiJYXMiBiW3t7azHBx+V/t89N+H/8a+1//e9K/9attDp5LQjYX8SuvVL8RoAkmxa65299Erq1FnHo0qrl7t4BddriIs4MrM3rfWcFd+pGwVSAwBZ0bKP8yrZPAAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
-".linkify.youtube {\n" +
-" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
-" padding-left: 18px;\n" +
-"}\n" +
"/* Embedding */\n" +
"#embedding {\n" +
" padding: 1px 4px 1px 4px;\n" +
@@ -21874,6 +3724,75 @@
"{\n" +
" background-image: url(\"data:image/svg+xml,
\");\n" +
"}\n" +
+"/* Link Title Favicons */\n" +
+".linkify.audio {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.clyp {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.dailymotion {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.gfycat {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8qLf86Pi9Kzj9K7k9LHp9sDp98Lq98Ps+Mr0++L5/O75/fD6/fH6/fL6/fP7/fT7/fb8/ff8/vj8/vn+/v7///91X4cfAAAAcklEQVR42o3M2xKBUACF4aVQckrIuRJK6H//x2sme4/MuPDfre9i6c/Cc3U5Dj87BuAxsXvGu6JvIIXEHRWwNHCHQNrCzkAFkbSBg4EM8i+Yw7PXBa3zRfuxVyf/Bis7nKwGKAcWxgC8prI5Sc315OlnDfzpDar2S9/oAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.gist {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABblBMVEXc3NykpKTW1tbb29ugoKCdnZ0AAAACAgIEDRcKCgoMDAwODg4QIzYRDAoTExMUDwwVAg0WICsaEw8aGhoiCBklGxUmERwwKCQ7LSU7Ozs8LSZFLyNINi1JNyxJNy1KSklMOi5VR1FXV1daQTRkZGRseYZwU0F4eHh7dnR8bWV/YE6IdGiKcGCKkJaNgYeNjY2RdGOScWCUcWCZmZmhoaGkpKSoqKirfmaurq6xsbG1tbW6urq+vr7AbmzBb23CwsLGxsbHx8fHyMjJycnJysrMzMzOiYbPi4fQ0NDRoYbT09PU1NTW1tbY2NjZqIzZ2dnb29vd3d3f39/i4uLktZrk5OTl5eXm5ubn5+fo6Ojq6urs7OzttKLu7u7wuqbw8PDx8fHz8/P4+Pj5+fn7uZj8vpz9ya79ybD/tZf/upr/wZ//w6H/xKH/xaL/xrH/yqj/y7T/zqv/z7D/07D/17n/2Lv/2Lz/3L//38n/4Mk3Q/ZuAAAABnRSTlMSFcbGzc5MNKFvAAAA1klEQVQoz2NgYPZHAswMDEwRSclwkBTBxOARn4gE4j0YXBOiJNUDg7y8Ar1UlOITXBkcY73Z2Li42dg42dn4wmIdGeyjQ7nZoEA4PNqewSZKlw0O9KJsGKwjBdl4ZeWkJGQUhNjEIq0ZrMI5+D0ri7Jz8itCRAXCrRgsQ3mUy+xicrPSbfO0REItGSyCVaVL3ONSU9LcCtQUgy0YzIJ85M1LizMzCsv9xF2CzBhMAwN99TV1DI0MtDWcAgNNGUycA5CAswkDi5kDwrMOZiwMjKzGSICVEQDhZj0UQV7PewAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.image {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAs5JREFUOE+lk/tvi1EYx98/xT8gW4REIpGFMEQWl2FiM9ZMZhm2xRAyOsmujFFmdFRHu0tWm87UypxStr69zPauN5e5rHVp3IYhbOvHy+wHEQlxkm+ek+d8nm9OznkeSfrfldmgJC7QyUlTymsJTfuTZ25z4HdWYwyLreYhtpgekGPw0+kKvo1Eo+IXRSIiEhkWZuc9tqnsJD9EqTUopCxjSGTpB0iueczSo1HyW8cpsExQ1DbxI2pt45j9cXpexul4FEd79RnZphAa/SD7WvuFtO6UItbU9LC+YQxNI2w0wwYT5LRAdhOU3oBTIXC9gXP3oUSGgz2vST3gYHejR0jptT1C332f8yrUEYHrz8CgxDnpm6DKCUfc0KnmXa/AEVPPwnDcD0cvetA2uYRk67Ive/lpjO7YBO1PPuF8Df3vwf4cbNE4tqdw7YVq8HYyHx6FvhE1hkMEg8HDUqvFkjT4aIjMqkqyqkswDSrcfBfH+Q561YLAZ/B+BLda6FXlU/cPv0AoEPhuoP1h4Av7Wbh9E/Py15NWWUjeSR3nZDfeN+N0DY9hG/7K1eGP3P0S5/EYRFUF/IOTBrUXHPm9fT6mr1xEwupkZqxbzLyiDJYUZ5NSnkdqdSHpxyrYdFpPgdmAsdfJwPMI/Yr65bf7tZLGGBQ7DNdJWFtIYvoOZmbuZE7OXpIKKli86zAr9p9gTVktWTVnKTI2U95uRWe3U2IJUDbVB5p6hVm5x5m9Vc/cnedZUNzC8lILaQesZBy6hEZ3maKzgvJWFzVWD9XtXvVGQbSWASFtMATVRlJIKbOTWtlJXaeXepuPM1f6MNp9GLt8mLvvYLmp0OhQ2Fwvk6m7xaqDTvY0eYWUVtcnllXfYlGpnfklVuraHHg8HjxuN+6fktUHlWWZPaZeUo/ILK0UKttBcbNbSB9GP0yLxWJJUxoZGUn80zD9C/vXQ/4NHY10h3M1zmQAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.installgentoo {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABcVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3dIYAAAAAAAAAAAAbGh4BBAcCBgoBBgoCBwsCCQ/QzucCCA7MyuXZ1eUBBQmTh8fo5/i9svIAAADh3vQAAAACCA0CCQ8CCQ4DDBQbGCUDChDr6vgAAAAAAAAREBIDCxK6tdfe2fTv7/cDCxIDDBQEDRUHDhgMJjXk4PZdXWdLUFoUNEYOKDgSMUMRLUBneI4eTGj08/QmW3onW3rTzvfOx/giU3IiVHMkWHdEaYJobHv3+PokWHpua6TNy9xZgZ+1quz8/foQKj0XPFInWn0nW38tZ4o6fqg8gq48grA9hrU/i7pAhrNAiLdBjLtEjr1FksNIjr5Il8pImMtKWnNqhL97odKFqti5q/q5rPq60+nCt/vLw/vPx/jV0vHY0/rc1/rg2/vh3fzn4fzu6/vx8vf19Pv19Pz49/v5+Pv8/Pv8/fr9/vv+/frziVtUAAAAT3RSTlMABQYHCAoNDhARGRobL0ZOV1xdXV5fYGBmZnB0eX2MjZSaoaGio6mqqqustLq7zubo6Ojo6evt7u/x8fLy9/f4+Pj5+vr6+vr6+/39/v7+XKgUSwAAAMhJREFUKM9jYGDg4OZmZgABKINT1dBAhBHIYFMxMBIDisjbhoZbCTExsCu5hoeY8DEwcOkEx8fY6MqpucTGB0izglVEplcU5/gmRYWBVQDNMK+s0hN3SvMyBpsBNJxXw0NfwTEjVQZqHQMHj5RfWW5mliSEC7TPzK6yJD/bXZQRzGdXcisqLy309okA2Q4Eis4peQWmstqBCdGW/CABraC45ERBBs3A6Fh/AbAKTwsHa34QZW8NVsGuLqwswQSjQICTmYMFQaEDAAF8JHLfKGswAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.liveleak {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAlNJREFUGBkFwU2LVmUYAODrPu8Z5x1xSpRBXQyFoLsBE+wfiO5atJOgnf9DUPwFgtGinUgEaQsRhHYuMtpEiEWuG5iNjuOcj+c8z911xXcXL/68c3Dw1fzhg0QgEQAAEYGUKXFie9vxlSs/xk/rdavjGEkmkWSih65z4osv9GfOiK6LzEyZ2uGh4dUrmzs72ddlUUhkoiMr4PT167589Mh6c1N0nSRlqrX67dat+PDyZXRT19m5edPnt28rGFHxMcJ6d9fprS1/37tneP3aemPD1uamUydPOru3p5DdGOH0tWsu3LhhxIQJM2qEpRT/Pn3q/du3AhARSmvGTH0lplKMrVkiYpVpQaJlighzhDkzhmEA0fcWoqAfyaFW4zTlgCABxlrNmY4ylUzLsiREprFWc0T2M+ZSjKWY0AEaltZUjJixZJIpuk5pTWlNP2BYFvOyKJkCAKU1tTXHrZlqVWolUxdhxsfVSj9FmJfFMM9GdICGGa01HyMstYpMIFPJVNDPmYZSTOPoOEKHzNRlKpmWWh1j6TpLa2SKTKVWU6Z+Qolwdm/P9QcPZKa2LH69e9eIMs+WCL/cv2/98CGZPrt61am+V9APq1X89eyZ/968obVYaiXT4dGREgG+vnPHeHgYMsH2+fP+efEihtVKv7SWw/6+9/v7KYLMhIywTJPamvOXLomukyRsrNf+ePzYkpl9dJ3SWgSCSCQCfz5/7pMLF2yfO6eLiAQcHRz4/cmT+HR7O+Ob3d0fNt69+7a2BiICQCJbA0EgE5lpvbXl1OXL3/8Pfax4+6SjSukAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.pastebin {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB1FBMVEUAAAAAAAAAAABWYWwAAABbY3BbYm5dZnFdZXJeZnMEBAQHCAhYYGpdZnFdZnBgaHIlJyomKCooKi09QkdESU5eZGtdYmhdYmleY2lrcXdqb3Rqb3Rqb3SSmJ+SlJeWmJutr7GtrrCWm6ChpKhbW1tmZmZvb290dHR3d3d4eHh5eXl6enp8fHx+gIJ/f3+CgoKDg4OEhISFhYWHh4eKioqKjI2Li4uMjIyOjo6Pj4+QkJCRkZGSkpKUlJSVl5mWlpaYmZqZm52ampqbm5ucnJydnZ2enp6fn5+hoaGioqKkpKSkpaalpaWmp6mmp6qnqauoqKioqquoqq2qqqqrrK2srKysra6srrCsrrGurq6vr6+wsLCxsbGysrKztLa0tLS1t7m2tra3t7e4uLi5ubm6urq7u7u8vLy9vb2+vr7AwMDAwsTBwcHExcfFxcXFxsnGxsbHx8fIyMjJycnMzMzNzc3Ozs7O0NLPz8/Q0NDR0dHR09XT09PV1dXV1dbV1tfV19rW1tbX19fX19jY2tzZ2dnZ2tva2tra3N3a3N7c3Nze3t7f39/f4OHg4ODi4uLl5+jm5ubs7Ozs7e3u7u7v7+/v8PDw8PDx8fHy8vLz8/P29vYSoLMZAAAAJHRSTlMABAUGCwsNHCAiLzMzMzZEYGJwgIuOnJycnqmqq9bc3+/w8fkZ0N/uAAAA/klEQVQoU2NgYGDl5YMDdgYGBmZZ3964CYFtIR3e9Q7K/AwMHI55KfaFmcHWMy3K3MwlGRg4wz0zdYpcorRbNbL0LaWAAp3ts2umV8wo6MupTauQBgqUG03VL7W3sfZSb1erAgm02M+yzYrVCXUy6zapAQlUx/dEdyX3J3ZHVUYVywAF8o2rDNN1Go2jzGLMokAC2QbuSc42mXmaOXop9iAtCXrJ5qXWjT59Abl2ESJAAX/tSIMMiyrrqQ3T6uS5gQK6kSqpqkUermGTexQFmYACflqR+hlWZSamzQpCLEDPsSmVVDT1TJw0JUhOAMRnYOARFRMTE5cQF+ZiBPIAII5B3EVG0b4AAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.soundcloud {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABsklEQVQ4y5WTy2pUQRCGv2rbzDjJeAlIBmOyipGIIJqFEBDElwh4yULGeRFXPoEIBl/AvQ/gC2RnxCAoxijiwks852S6+3dxzslcHJCpTXVX11/Xv0097gLPgVNMJxnQNfX4zsqleWbnpoMf/oa9d988MM9MC/rp+E0a+A0dsVobMNMCOO8B6McRoABJI+A6gJmN3D2A8jgEBCEkSEMBrcrsDAzDWWn3AjgKFaDMmgRqniGFgsaDp1jrLOngDf1XT1D+A1dFc4MKAkkiCVKjjVu7g9+4Rzx4i1u6hjXbuMWr0O5QPNvCu7IaCZwEKQukLGDrm5x8uI0tr6MkiGlkiv7yLfzN+6S5i6QsIMABkEfcxhbWWYMkVAOjxvYAjc3HNHrbKI9VBQBFwF25XQKSBjqIf1YBuAurEMrczgDygD6/x2LCpFLXLUyQ+PoldphhBhYfIX09XU1+Flaukz7uYqs3SHs7cG4BmTsmkBUF9mmXEwa28BNLPaQPLepuNcbGSWQquQC2/Kdcox1FUGkcB0ykck1nA2+wTzMs8stGnP4rbWGw74EuS/GFQWfK7/wF6P4F7fzIAYkdmdEAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.twitchtv {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAYUExURf///2RBpWRBpWRBpWRBpWRBpWRBpf///+zQyUYAAAAGdFJOUwFdZX0lTzs4r5oAAAABYktHRAcWYYjrAAAAB3RJTUUH4AINEi42iSXRNAAAAD1JREFUCNdjYEiDAAZGGIMtjQEEUBlMCWoEGci6mGEMsxQgIy0BiB3AjLS0FAYQIw0kwABipoI1AhkBQBIAFCIXxiHgq80AAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.twitter {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAEsUExURf///1Cf21Gg3FGi31Gh3VKj4FGh3lKj4VKk4lKl41Ol5FOn51Sp6VSo6FOn5lCf21Gg3FGh3VGi31Gi31Gh3lGg3FGg3FGg3FGg3FGh3lGg3FGi31Kk4lKj4FGh3lGi31Kk4lGh3lGg3FGh3lOm5FOm5VGi31Kj4VSo6FGi31Gh3VGg3FKj4FOn51Gi31So6FWr7VOl5FGi31On51Sq6lKk4lOo51Sp6VOm5FSq61Ws7VOn51Oo51Sq61Ol5FOm5FSq61Wr7VOo51On51Sr7FWs7VSp6lGg3FGh3VOm5FWr7VSp6lKj4VOm5FSo6FSr7FWs7VWs7VWr7VSq6lOo51Om5FOo51So6FOm5VOl5FSq61Ws7VSr7FSp6lSp6VWs7lWr7VKk4lSq6v///6E3MNsAAABVdFJOUwAAAAAAAAAAAAAAAAAAAB0Ii+3xnBVTJhfsMKb+qTEp9GwBF/7lLAbo0m4pLkUTdvk2Ev3+EZnOBo/3Z8ffCRzH/D0OqPxiLnvx3UI8m9n1++GwXQZNS29BAAAAAWJLR0QAiAUdSAAAAAd0SU1FB+ACDRIwBwy67tEAAADKSURBVBjTY2BAB4xogIGRH8IQEBQSFhEVE2eQkJQC8ZmkQ8PCI2Rk5RjkIxUUlRgZlVWioqNjYlXVGNQ14iI1tbR14qLj4+MTdJkZ9PQNosJCE0OjgPz4KEMWBiPjhPiEmKQokIJ4E1MmBmazhHg4MGdlYmCzsLSC8ROsmRkZmFht4Eps7ViADmOzd4DyHZ2YmYACTOzOLmATXd04mIBOd/eQ9owFCXh5c7KB/MLi4+vnHxAYFBzCwcYEEmBi5uLm4eHl42RmAnsSAMZBLgZiFUQ5AAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.video {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAxgDGAP8nNqN7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gMZBjQQLEEqGwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAA5SURBVDjLY2AYaMDIwMDwn1JD/lPCZhpwL+B1wf///ykzgBhDiAoDfIYQZQAjIyP5BuDTPJqQqAQAvW0ZAMk8+EEAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.vimeo {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAAIdZUKh6sLlLkLmr4LmsAMp88NrdYVW3MZj7Acstkrt9s1e5E7vN5EfI9JvdtKwuBijp5kpbl30eiDt8aG1uqRr7qTyNehxM+k4PCy3enB3OTg6Ovv9PXw+fz////L9U5WAAAAAXRSTlMAQObYZgAAAIFJREFUeNplz90OwiAMBWAQpAoyxclkP3je/y0H2AQXz0WT8100rRD6kNI9/cRroemQL3hXhoujZYj4OHoAmBvYGcBISwbWBvfXCrytnIDUQMkbsBpagMA7zhtQdyTFQAmIG7IkYniiZuh3XGsPqoOZkMOJOpAcLqUzNFGGu/57fwc1hgtp0mVSyQAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.vine {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAHCUExURQAAAAC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+jwC+j////54tRLAAAACUdFJOUwAAAEK+9/e+QQIDAwEqzskfUZmUNHz2mrT++V1w+f5tCanNFUDwfEjtjAyyvg027Hki27QMBJzaHE/1+FkNsN0iZvv6bxyAlB589lQeyud0KB8PQO+ZBUrc+eXgcRG/3CoATe316Wxw/P6BAgBt+fp4IAwh0d4zM9q7Fm76qi605EMSrvfX/PRtAivF9IAJNMLxhA2KYlJ9AAAAAWJLR0SVCGB6gwAAAAd0SU1FB+ACDRI2MOJd7FgAAADrSURBVBjTLY9VWwJgGEPfiYWBha2YYHcHditgd3d3odjdivvBfgK727nYsyPiCrw03j6+fv6AaAMCgyAI1lElJBQSFh6hBxDJqOiY2Lh4SEKiIQlITmFqWrqRJkhGJrOA7Bzm5uUXsBBSVMySUpSVs6KyqrqmFmKuY30D0NjU3NLa1t6h9jvZ1Q30WGi19fb1KzAwyKFhYGSUY+MTkwpMTXNmFpibX+Di0rICWFldW9/A5tb2zu7ePtTrg0MeHePklPYzuDRw7uDF5RWvbwC32O0d7x8en55f4DHF6xv5/vHp6f/k6/vH+evuf1LAObptvSvrAAAAAElFTkSuQmCC') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.vocaroo {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAw9JREFUOE9jYMABuMwYmCyTJKUCGlSnFSy02TTzeOyCiQcDViX26qVz2TAyYtWmEMwuoZ3M7V40LcB79pHkc0svpvzY8jD//87nxf+3Pyn8v/ZO8v+VNyP/2mZJumI1QCWSI8232Hjumitlfw5+qPp/9l8TCt76JP//xkdx/wsXWCzjtWFkwTCkbWFe9plPk/+ga4Txz/xt/D/hkN//gMXif21a+NbyWjIwoRiy6GDT5rP/mlFsPfyp5n/NpOj/22+0gMUXXIz/H7hC/L/bFKFbPDZMrHAD5H35OPt2J9zacDv/f3V7xv9FhwrBGubsT/1//Pjx/1GJ/mD+/nfl/1v3Ovy3KRJNQbHdOlXCvOO03/+pm1P/v3v37n90hhtYw9HPtf8Xb2v937cmHswHeWPRxYj/LvkK3igGKARwicTO07118H3V/5kbi/4vPZMJtK3s/6YH2f+Pfq1B8VbjWrdnMu5s4nAD9CNFhKwz5DTUvLl419zKvAcLtG1P84BRl/b/5M/6/6f/NPzf/qzo84yj0Uus0xUU4Zor54bm9+4OfZG02OCuoAMTb9ZkC9ull1Nvrr2Z+XvRpaRfc65H/68F+jl9svEhzyLFWoccWVc+eyTHq/twydjlKRln7jX9bNMkMJnbhoFRL1xCqmKx6/yi2fYXa/c5/e846PV/5fW0/7OPx/yfcjzop34ulxdGGvDuU8mMXaX507lBuiN6ueadmQeT/p/93vf/1O+G//sP5fw/eL3o/5JLif8zVxs+Tlir9S26UyeFQQvJGBE7FvaFZ9LfN+1y+WjbItSb3GmXvXd15v8zroH/HxgE/D+aGPx/18vi/z07PeZNPRKxe/Kh0Ae8toxscCO4zBkYXArk9C1SxJUYjBkYPPIVtbbuTftz3cz//2O9wP/75iSAXdO72/dt2HL5F6YlfBW4MiJYXMiBiW3t7azHBx+V/t89N+H/8a+1//e9K/9attDp5LQjYX8SuvVL8RoAkmxa65299Erq1FnHo0qrl7t4BddriIs4MrM3rfWcFd+pGwVSAwBZ0bKP8yrZPAAAAABJRU5ErkJggg==') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
+".linkify.youtube {\n" +
+" background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII=') center left no-repeat!important;\n" +
+" padding-left: 18px;\n" +
+"}\n" +
"/* XXX Moved to end of stylesheet to avoid breaking whole stylesheet in Maxthon. */\n" +
"@supports (text-decoration-style: dashed) or (-moz-text-decoration-style: dashed) {\n" +
" .quotelink.forwardlink,\n" +
@@ -21883,13 +3802,18839 @@
" text-decoration-style: dashed;\n" +
" border-bottom: none;\n" +
" }\n" +
-"}",
- cssWWW: "#captcha-cnt {\n" +
+"}\n",
+
+report:
+"#g-recaptcha,\n" +
+":root:not(.js-enabled) #captchaContainerAlt {\n" +
" height: auto;\n" +
-"}",
- features: [['Polyfill', Polyfill], ['Normalize URL', NormalizeURL], ['Captcha Configuration', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Edit Link', QR.oekaki.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash], ['Reply Pruning', ReplyPruning]]
+"}\n" +
+"#captchaContainerAlt td:nth-child(2) {\n" +
+" display: table-cell !important;\n" +
+"}\n",
+
+www:
+"#captcha-cnt {\n" +
+" height: auto;\n" +
+"}\n"
+
+};
+
+$ = (function() {
+ var $,
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ $ = function(selector, root) {
+ if (root == null) {
+ root = d.body;
+ }
+ return root.querySelector(selector);
};
- Main.init();
+ $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000)));
+
+ $.id = function(id) {
+ return d.getElementById(id);
+ };
+
+ $.ready = function(fc) {
+ var cb;
+ if (d.readyState !== 'loading') {
+ $.queueTask(fc);
+ return;
+ }
+ cb = function() {
+ $.off(d, 'DOMContentLoaded', cb);
+ return fc();
+ };
+ return $.on(d, 'DOMContentLoaded', cb);
+ };
+
+ $.formData = function(form) {
+ var fd, key, val;
+ if (form instanceof HTMLFormElement) {
+ return new FormData(form);
+ }
+ fd = new FormData();
+ for (key in form) {
+ val = form[key];
+ if (val) {
+ if (typeof val === 'object' && 'newName' in val) {
+ fd.append(key, val, val.newName);
+ } else {
+ fd.append(key, val);
+ }
+ }
+ }
+ return fd;
+ };
+
+ $.extend = function(object, properties) {
+ var key, val;
+ for (key in properties) {
+ val = properties[key];
+ object[key] = val;
+ }
+ };
+
+ $.ajax = (function() {
+ var blockedError, blockedURLs, lastModified;
+ lastModified = {};
+ blockedURLs = {};
+ blockedError = function(url) {
+ var message;
+ if (blockedURLs[url]) {
+ return;
+ }
+ blockedURLs[url] = true;
+ message = $.el('div', {
+ innerHTML: "4chan X was blocked from loading the following URL:
[
More info ]"
+ });
+ $('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
+ return new Notice('warning', message, 30, function() {
+ return delete blockedURLs[url];
+ });
+ };
+ return function(url, options, extra) {
+ var err, event, form, i, len, r, ref, ref1, type, upCallbacks, whenModified;
+ if (options == null) {
+ options = {};
+ }
+ if (extra == null) {
+ extra = {};
+ }
+ type = extra.type, whenModified = extra.whenModified, upCallbacks = extra.upCallbacks, form = extra.form;
+ url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/');
+ r = new XMLHttpRequest();
+ type || (type = form && 'post' || 'get');
+ try {
+ r.open(type, url, true);
+ } catch (_error) {
+ err = _error;
+ blockedError(url);
+ ref = ['error', 'loadend'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ event = ref[i];
+ r["on" + event] = options["on" + event];
+ $.queueTask($.event, event, null, r);
+ }
+ return;
+ }
+ if (whenModified) {
+ if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
+ r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
+ }
+ $.on(r, 'load', function() {
+ return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
+ });
+ }
+ if (/\.json$/.test(url)) {
+ if (options.responseType == null) {
+ options.responseType = 'json';
+ }
+ }
+ $.extend(r, options);
+ if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
+ Object.defineProperty(r, 'response', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return JSON.parse(r.responseText);
+ }
+ });
+ }
+ $.extend(r.upload, upCallbacks);
+ r.send(form);
+ return r;
+ };
+ })();
+
+ (function() {
+ var reqs;
+ reqs = {};
+ $.cache = function(url, cb, options) {
+ var err, req, rm;
+ if (req = reqs[url]) {
+ if (req.readyState === 4) {
+ $.queueTask(function() {
+ return cb.call(req, req.evt, true);
+ });
+ } else {
+ req.callbacks.push(cb);
+ }
+ return req;
+ }
+ rm = function() {
+ return delete reqs[url];
+ };
+ try {
+ if (!(req = $.ajax(url, options))) {
+ return;
+ }
+ } catch (_error) {
+ err = _error;
+ return;
+ }
+ $.on(req, 'load', function(e) {
+ var fn1, i, len, ref;
+ this.evt = e;
+ ref = this.callbacks;
+ fn1 = (function(_this) {
+ return function(cb) {
+ return $.queueTask(function() {
+ return cb.call(_this, e, false);
+ });
+ };
+ })(this);
+ for (i = 0, len = ref.length; i < len; i++) {
+ cb = ref[i];
+ fn1(cb);
+ }
+ return delete this.callbacks;
+ });
+ $.on(req, 'abort error', rm);
+ req.callbacks = [cb];
+ return reqs[url] = req;
+ };
+ return $.cleanCache = function(testf) {
+ var url;
+ for (url in reqs) {
+ if (testf(url)) {
+ delete reqs[url];
+ }
+ }
+ };
+ })();
+
+ $.cb = {
+ checked: function() {
+ $.set(this.name, this.checked);
+ return Conf[this.name] = this.checked;
+ },
+ value: function() {
+ $.set(this.name, this.value.trim());
+ return Conf[this.name] = this.value;
+ }
+ };
+
+ $.asap = function(test, cb) {
+ if (test()) {
+ return cb();
+ } else {
+ return setTimeout($.asap, 25, test, cb);
+ }
+ };
+
+ $.onExists = function(root, selector, cb) {
+ var el, observer;
+ if (el = $(selector, root)) {
+ return cb(el);
+ }
+ if ($.engine === 'edge' && d.readyState === 'loading') {
+ $.asap((function() {
+ return d.readyState !== 'loading' || $(selector, root);
+ }), function() {
+ return $.onExists(root, selector, cb);
+ });
+ return;
+ }
+ observer = new MutationObserver(function() {
+ if (el = $(selector, root)) {
+ observer.disconnect();
+ return cb(el);
+ }
+ });
+ return observer.observe(root, {
+ childList: true,
+ subtree: true
+ });
+ };
+
+ $.addStyle = function(css, id, test) {
+ var style;
+ if (test == null) {
+ test = 'head';
+ }
+ style = $.el('style', {
+ textContent: css
+ });
+ if (id != null) {
+ style.id = id;
+ }
+ $.onExists(doc, test, function() {
+ return $.add(d.head, style);
+ });
+ return style;
+ };
+
+ $.x = function(path, root) {
+ root || (root = d.body);
+ return d.evaluate(path, root, null, 8, null).singleNodeValue;
+ };
+
+ $.X = function(path, root) {
+ root || (root = d.body);
+ return d.evaluate(path, root, null, 7, null);
+ };
+
+ $.addClass = function() {
+ var className, classNames, el, i, len;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (i = 0, len = classNames.length; i < len; i++) {
+ className = classNames[i];
+ el.classList.add(className);
+ }
+ };
+
+ $.rmClass = function() {
+ var className, classNames, el, i, len;
+ el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ for (i = 0, len = classNames.length; i < len; i++) {
+ className = classNames[i];
+ el.classList.remove(className);
+ }
+ };
+
+ $.toggleClass = function(el, className) {
+ return el.classList.toggle(className);
+ };
+
+ $.hasClass = function(el, className) {
+ return indexOf.call(el.classList, className) >= 0;
+ };
+
+ $.rm = function(el) {
+ return el != null ? el.remove() : void 0;
+ };
+
+ $.rmAll = function(root) {
+ return root.textContent = null;
+ };
+
+ $.tn = function(s) {
+ return d.createTextNode(s);
+ };
+
+ $.frag = function() {
+ return d.createDocumentFragment();
+ };
+
+ $.nodes = function(nodes) {
+ var frag, i, len, node;
+ if (!(nodes instanceof Array)) {
+ return nodes;
+ }
+ frag = $.frag();
+ for (i = 0, len = nodes.length; i < len; i++) {
+ node = nodes[i];
+ frag.appendChild(node);
+ }
+ return frag;
+ };
+
+ $.add = function(parent, el) {
+ return parent.appendChild($.nodes(el));
+ };
+
+ $.prepend = function(parent, el) {
+ return parent.insertBefore($.nodes(el), parent.firstChild);
+ };
+
+ $.after = function(root, el) {
+ return root.parentNode.insertBefore($.nodes(el), root.nextSibling);
+ };
+
+ $.before = function(root, el) {
+ return root.parentNode.insertBefore($.nodes(el), root);
+ };
+
+ $.replace = function(root, el) {
+ return root.parentNode.replaceChild($.nodes(el), root);
+ };
+
+ $.el = function(tag, properties, properties2) {
+ var el;
+ el = d.createElement(tag);
+ if (properties) {
+ $.extend(el, properties);
+ }
+ if (properties2) {
+ $.extend(el, properties2);
+ }
+ return el;
+ };
+
+ $.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];
+ el.addEventListener(event, handler, false);
+ }
+ };
+
+ $.off = function(el, events, handler) {
+ var event, i, len, ref;
+ ref = events.split(' ');
+ for (i = 0, len = ref.length; i < len; i++) {
+ event = ref[i];
+ el.removeEventListener(event, handler, false);
+ }
+ };
+
+ $.one = function(el, events, handler) {
+ var cb;
+ cb = function(e) {
+ $.off(el, events, cb);
+ return handler.call(this, e);
+ };
+ return $.on(el, events, cb);
+ };
+
+ $.event = function(event, detail, root) {
+ if (root == null) {
+ root = d;
+ }
+ if ((detail != null) && typeof cloneInto === 'function') {
+ detail = cloneInto(detail, d.defaultView);
+ }
+ return root.dispatchEvent(new CustomEvent(event, {
+ bubbles: true,
+ detail: detail
+ }));
+ };
+
+ (function() {
+ var clone, err, ref, unsafeConstructors;
+ if (!(/PaleMoon\//.test(navigator.userAgent) && +(typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.version) != null ? ref.split('.')[0] : void 0 : void 0) >= 2 && typeof cloneInto === 'undefined')) {
+ return;
+ }
+ try {
+ return new CustomEvent('x', {
+ detail: {}
+ });
+ } catch (_error) {
+ err = _error;
+ unsafeConstructors = {
+ Object: unsafeWindow.Object,
+ Array: unsafeWindow.Array
+ };
+ clone = function(obj) {
+ var constructor, key, obj2, val;
+ if ((obj != null) && typeof obj === 'object' && (constructor = unsafeConstructors[obj.constructor.name])) {
+ obj2 = new constructor();
+ for (key in obj) {
+ val = obj[key];
+ obj2[key] = clone(val);
+ }
+ return obj2;
+ } else {
+ return obj;
+ }
+ };
+ return $.event = function(event, detail, root) {
+ if (root == null) {
+ root = d;
+ }
+ return root.dispatchEvent(new CustomEvent(event, {
+ bubbles: true,
+ detail: clone(detail)
+ }));
+ };
+ }
+ })();
+
+ $.open = typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) {
+ return window.open(url, '_blank');
+ };
+
+ $.debounce = function(wait, fn) {
+ var args, exec, lastCall, that, timeout;
+ lastCall = 0;
+ timeout = null;
+ that = null;
+ args = null;
+ exec = function() {
+ lastCall = Date.now();
+ return fn.apply(that, args);
+ };
+ return function() {
+ args = arguments;
+ that = this;
+ if (lastCall < Date.now() - wait) {
+ return exec();
+ }
+ clearTimeout(timeout);
+ return timeout = setTimeout(exec, wait);
+ };
+ };
+
+ $.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);
+ return func.apply(func, args);
+ };
+ if (window.MessageChannel) {
+ taskChannel = new MessageChannel();
+ taskChannel.port1.onmessage = execTask;
+ return function() {
+ taskQueue.push(arguments);
+ return taskChannel.port2.postMessage(null);
+ };
+ } else {
+ return function() {
+ taskQueue.push(arguments);
+ return setTimeout(execTask, 0);
+ };
+ }
+ })();
+
+ $.globalEval = function(code) {
+ var script;
+ script = $.el('script', {
+ textContent: code
+ });
+ $.add(d.head || doc, script);
+ return $.rm(script);
+ };
+
+ $.global = function(fn) {
+ if (doc) {
+ return $.globalEval("(" + fn + ")();");
+ } else {
+ return fn();
+ }
+ };
+
+ $.bytesToString = function(size) {
+ var unit;
+ unit = 0;
+ while (size >= 1024) {
+ size /= 1024;
+ unit++;
+ }
+ size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size);
+ return size + " " + ['B', 'KB', 'MB', 'GB'][unit];
+ };
+
+ $.minmax = function(value, min, max) {
+ return (value < min ? min : value > max ? max : value);
+ };
+
+ $.hasAudio = function(video) {
+ return video.mozHasAudio || !!video.webkitAudioDecodedByteCount;
+ };
+
+ $.engine = (function() {
+ if (/Edge\//.test(navigator.userAgent)) {
+ return 'edge';
+ }
+ if (/Chrome\//.test(navigator.userAgent)) {
+ return 'blink';
+ }
+ if (/WebKit\//.test(navigator.userAgent)) {
+ return 'webkit';
+ }
+ if (/Gecko\/|Goanna/.test(navigator.userAgent)) {
+ return 'gecko';
+ }
+ })();
+
+ $.platform = 'userscript';
+
+ try {
+ localStorage.getItem('x');
+ $.hasStorage = true;
+ } catch (_error) {
+ $.hasStorage = false;
+ }
+
+ $.item = function(key, val) {
+ var item;
+ item = {};
+ item[key] = val;
+ return item;
+ };
+
+ $.syncing = {};
+
+ if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
+ $.getValue = GM_getValue;
+ $.listValues = function() {
+ return GM_listValues();
+ };
+ } else if ($.hasStorage) {
+ $.getValue = function(key) {
+ return localStorage[key];
+ };
+ $.listValues = function() {
+ var key, results;
+ results = [];
+ for (key in localStorage) {
+ if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) {
+ results.push(key);
+ }
+ }
+ return results;
+ };
+ } else {
+ $.getValue = function() {};
+ $.listValues = function() {
+ return [];
+ };
+ }
+
+ if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
+ $.setValue = GM_setValue;
+ $.deleteValue = GM_deleteValue;
+ } else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) {
+ $.oldValue = {};
+ $.setValue = function(key, val) {
+ GM_setValue(key, val);
+ if (key in $.syncing) {
+ $.oldValue[key] = val;
+ if ($.hasStorage) {
+ return localStorage[key] = val;
+ }
+ }
+ };
+ $.deleteValue = function(key) {
+ GM_deleteValue(key);
+ if (key in $.syncing) {
+ delete $.oldValue[key];
+ if ($.hasStorage) {
+ return localStorage.removeItem(key);
+ }
+ }
+ };
+ if (!$.hasStorage) {
+ $.cantSync = true;
+ }
+ } else if ($.hasStorage) {
+ $.oldValue = {};
+ $.setValue = function(key, val) {
+ if (key in $.syncing) {
+ $.oldValue[key] = val;
+ }
+ return localStorage[key] = val;
+ };
+ $.deleteValue = function(key) {
+ if (key in $.syncing) {
+ delete $.oldValue[key];
+ }
+ return localStorage.removeItem(key);
+ };
+ } else {
+ $.setValue = function() {};
+ $.deleteValue = function() {};
+ $.cantSync = $.cantSet = true;
+ }
+
+ if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) {
+ $.sync = function(key, cb) {
+ return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) {
+ if (remote) {
+ if (newValue !== void 0) {
+ newValue = JSON.parse(newValue);
+ }
+ return cb(newValue, key);
+ }
+ });
+ };
+ $.forceSync = function() {};
+ } else if ((typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) || $.hasStorage) {
+ $.sync = function(key, cb) {
+ key = g.NAMESPACE + key;
+ $.syncing[key] = cb;
+ return $.oldValue[key] = $.getValue(key);
+ };
+ (function() {
+ var onChange;
+ onChange = function(arg) {
+ var cb, key, newValue;
+ key = arg.key, newValue = arg.newValue;
+ if (!(cb = $.syncing[key])) {
+ return;
+ }
+ if (newValue != null) {
+ if (newValue === $.oldValue[key]) {
+ return;
+ }
+ $.oldValue[key] = newValue;
+ return cb(JSON.parse(newValue), key.slice(g.NAMESPACE.length));
+ } else {
+ if ($.oldValue[key] == null) {
+ return;
+ }
+ delete $.oldValue[key];
+ return cb(void 0, key.slice(g.NAMESPACE.length));
+ }
+ };
+ $.on(window, 'storage', onChange);
+ return $.forceSync = function(key) {
+ key = g.NAMESPACE + key;
+ return onChange({
+ key: key,
+ newValue: $.getValue(key)
+ });
+ };
+ })();
+ } else {
+ $.sync = function() {};
+ $.forceSync = function() {};
+ }
+
+ $["delete"] = function(keys) {
+ var i, key, len;
+ if (!(keys instanceof Array)) {
+ keys = [keys];
+ }
+ for (i = 0, len = keys.length; i < len; i++) {
+ key = keys[i];
+ $.deleteValue(g.NAMESPACE + key);
+ }
+ };
+
+ $.get = function(key, val, cb) {
+ var items;
+ if (typeof cb === 'function') {
+ items = $.item(key, val);
+ } else {
+ items = key;
+ cb = val;
+ }
+ return $.queueTask(function() {
+ for (key in items) {
+ if (val = $.getValue(g.NAMESPACE + key)) {
+ items[key] = JSON.parse(val);
+ }
+ }
+ return cb(items);
+ });
+ };
+
+ $.set = function(keys, val, cb) {
+ var key, value;
+ if (typeof keys === 'string') {
+ $.setValue(g.NAMESPACE + keys, JSON.stringify(val));
+ } else {
+ for (key in keys) {
+ value = keys[key];
+ $.setValue(g.NAMESPACE + key, JSON.stringify(value));
+ }
+ cb = val;
+ }
+ return typeof cb === "function" ? cb() : void 0;
+ };
+
+ $.clear = function(cb) {
+ var id;
+ $["delete"](Object.keys(Conf));
+ $["delete"](['previousversion', 'AutoWatch', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']);
+ $["delete"]((function() {
+ var i, len, ref, results;
+ ref = ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'];
+ results = [];
+ for (i = 0, len = ref.length; i < len; i++) {
+ id = ref[i];
+ results.push(id + ".position");
+ }
+ return results;
+ })());
+ try {
+ $["delete"]($.listValues().map(function(key) {
+ return key.replace(g.NAMESPACE, '');
+ }));
+ } catch (_error) {}
+ return typeof cb === "function" ? cb() : void 0;
+ };
+
+ return $;
+
+}).call(this);
+
+$$ = (function() {
+ var slice = [].slice;
+
+ return function(selector, root) {
+ if (root == null) {
+ root = d.body;
+ }
+ return slice.call(root.querySelectorAll(selector));
+ };
+
+}).call(this);
+
+CrossOrigin = (function() {
+ var CrossOrigin;
+
+ CrossOrigin = {
+ binary: function(url, cb, headers) {
+ var options, ref, workaround;
+ if (headers == null) {
+ headers = {};
+ }
+ url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/');
+ workaround = $.engine === 'gecko' && (typeof GM_info !== "undefined" && GM_info !== null) && /^[0-2]\.|^3\.[01](?!\d)/.test(GM_info.version);
+ workaround || (workaround = /PaleMoon\//.test(navigator.userAgent));
+ workaround || (workaround = (typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.script) != null ? ref.includeJSB : void 0 : void 0) != null);
+ options = {
+ method: "GET",
+ url: url,
+ headers: headers,
+ onload: function(xhr) {
+ var contentDisposition, contentType, data, i, r, ref1, ref2;
+ if (workaround) {
+ r = xhr.responseText;
+ data = new Uint8Array(r.length);
+ i = 0;
+ while (i < r.length) {
+ data[i] = r.charCodeAt(i);
+ i++;
+ }
+ } else {
+ data = new Uint8Array(xhr.response);
+ }
+ if (typeof xhr.responseHeaders === 'object') {
+ contentType = xhr.responseHeaders['Content-Type'];
+ contentDisposition = xhr.responseHeaders['Content-Disposition'];
+ } else {
+ contentType = (ref1 = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0;
+ contentDisposition = (ref2 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0;
+ }
+ return cb(data, contentType, contentDisposition);
+ },
+ onerror: function() {
+ return cb(null);
+ },
+ onabort: function() {
+ return cb(null);
+ }
+ };
+ if (workaround) {
+ options.overrideMimeType = options.mimeType = 'text/plain; charset=x-user-defined';
+ } else {
+ options.responseType = 'arraybuffer';
+ }
+ return GM_xmlhttpRequest(options);
+ },
+ file: function(url, cb) {
+ return CrossOrigin.binary(url, function(data, contentType, contentDisposition) {
+ var blob, match, mime, name, ref, ref1, ref2, ref3;
+ if (data == null) {
+ return cb(null);
+ }
+ name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0;
+ mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream';
+ match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0);
+ if (match) {
+ name = match.replace(/\\"/g, '"');
+ }
+ if ((typeof GM_info !== "undefined" && GM_info !== null ? (ref3 = GM_info.script) != null ? ref3.includeJSB : void 0 : void 0) != null) {
+ mime = QR.typeFromExtension[name.match(/[^.]*$/)[0].toLowerCase()] || 'application/octet-stream';
+ }
+ blob = new Blob([data], {
+ type: mime
+ });
+ blob.name = name;
+ return cb(blob);
+ });
+ },
+ json: (function() {
+ var callbacks, responses;
+ callbacks = {};
+ responses = {};
+ return function(url, cb) {
+ if (responses[url]) {
+ cb(responses[url]);
+ return;
+ }
+ if (callbacks[url]) {
+ callbacks[url].push(cb);
+ return;
+ }
+ callbacks[url] = [cb];
+ return GM_xmlhttpRequest({
+ method: "GET",
+ url: url + '',
+ onload: function(xhr) {
+ var j, len, ref, response;
+ response = JSON.parse(xhr.responseText);
+ ref = callbacks[url];
+ for (j = 0, len = ref.length; j < len; j++) {
+ cb = ref[j];
+ cb(response);
+ }
+ delete callbacks[url];
+ return responses[url] = response;
+ },
+ onerror: function() {
+ return delete callbacks[url];
+ },
+ onabort: function() {
+ return delete callbacks[url];
+ }
+ });
+ };
+ })()
+ };
+
+ return CrossOrigin;
+
+}).call(this);
+
+Board = (function() {
+ var Board;
+
+ Board = (function() {
+ Board.prototype.toString = function() {
+ return this.ID;
+ };
+
+ function Board(ID) {
+ this.ID = ID;
+ this.threads = new SimpleDict();
+ this.posts = new SimpleDict();
+ g.boards[this] = this;
+ }
+
+ return Board;
+
+ })();
+
+ return Board;
+
+}).call(this);
+
+Callbacks = (function() {
+ var Callbacks;
+
+ Callbacks = (function() {
+ Callbacks.Post = new Callbacks('Post');
+
+ Callbacks.Thread = new Callbacks('Thread');
+
+ Callbacks.CatalogThread = new Callbacks('Catalog Thread');
+
+ function Callbacks(type) {
+ this.type = type;
+ this.keys = [];
+ }
+
+ Callbacks.prototype.push = function(arg) {
+ var cb, name;
+ name = arg.name, cb = arg.cb;
+ if (!this[name]) {
+ this.keys.push(name);
+ }
+ return this[name] = cb;
+ };
+
+ Callbacks.prototype.execute = function(node, keys) {
+ var err, errors, i, len, name, ref;
+ if (keys == null) {
+ keys = this.keys;
+ }
+ for (i = 0, len = keys.length; i < len; i++) {
+ name = keys[i];
+ try {
+ if ((ref = this[name]) != null) {
+ ref.call(node);
+ }
+ } catch (_error) {
+ err = _error;
+ if (!errors) {
+ errors = [];
+ }
+ errors.push({
+ message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''),
+ error: err
+ });
+ }
+ }
+ if (errors) {
+ return Main.handleErrors(errors);
+ }
+ };
+
+ return Callbacks;
+
+ })();
+
+ return Callbacks;
+
+}).call(this);
+
+CatalogThread = (function() {
+ var CatalogThread;
+
+ CatalogThread = (function() {
+ CatalogThread.prototype.toString = function() {
+ return this.ID;
+ };
+
+ function CatalogThread(root, thread) {
+ this.thread = thread;
+ this.ID = this.thread.ID;
+ this.board = this.thread.board;
+ this.nodes = {
+ root: root,
+ thumb: $('.catalog-thumb', root),
+ icons: $('.catalog-icons', root),
+ postCount: $('.post-count', root),
+ fileCount: $('.file-count', root),
+ pageCount: $('.page-count', root),
+ comment: $('.comment', root)
+ };
+ this.thread.catalogView = this;
+ }
+
+ return CatalogThread;
+
+ })();
+
+ return CatalogThread;
+
+}).call(this);
+
+Connection = (function() {
+ var Connection,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+ Connection = (function() {
+ function Connection(target, origin, cb) {
+ this.target = target;
+ this.origin = origin;
+ this.cb = cb != null ? cb : {};
+ this.onMessage = bind(this.onMessage, this);
+ this.send = bind(this.send, this);
+ $.on(window, 'message', this.onMessage);
+ }
+
+ Connection.prototype.targetWindow = function() {
+ if (this.target instanceof window.HTMLIFrameElement) {
+ return this.target.contentWindow;
+ } else {
+ return this.target;
+ }
+ };
+
+ Connection.prototype.send = function(data) {
+ return this.targetWindow().postMessage("" + g.NAMESPACE + (JSON.stringify(data)), this.origin);
+ };
+
+ Connection.prototype.onMessage = function(e) {
+ var base, data, type, value;
+ if (!(e.source === this.targetWindow() && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) {
+ return;
+ }
+ data = JSON.parse(e.data.slice(g.NAMESPACE.length));
+ for (type in data) {
+ value = data[type];
+ if (typeof (base = this.cb)[type] === "function") {
+ base[type](value);
+ }
+ }
+ };
+
+ return Connection;
+
+ })();
+
+ return Connection;
+
+}).call(this);
+
+DataBoard = (function() {
+ var DataBoard,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+ DataBoard = (function() {
+ DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'customTitles'];
+
+ function DataBoard(key, sync, dontClean) {
+ var init;
+ this.key = key;
+ this.onSync = bind(this.onSync, this);
+ this.data = Conf[this.key];
+ $.sync(this.key, this.onSync);
+ if (!dontClean) {
+ this.clean();
+ }
+ if (!sync) {
+ return;
+ }
+ init = (function(_this) {
+ return function() {
+ $.off(d, '4chanXInitFinished', init);
+ return _this.sync = sync;
+ };
+ })(this);
+ $.on(d, '4chanXInitFinished', init);
+ }
+
+ DataBoard.prototype.save = function(cb) {
+ return $.set(this.key, this.data, cb);
+ };
+
+ DataBoard.prototype["delete"] = function(arg) {
+ var boardID, postID, ref, threadID;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID;
+ $.forceSync(this.key);
+ if (postID) {
+ if (!((ref = this.data.boards[boardID]) != null ? ref[threadID] : void 0)) {
+ return;
+ }
+ delete this.data.boards[boardID][threadID][postID];
+ this.deleteIfEmpty({
+ boardID: boardID,
+ threadID: threadID
+ });
+ } else if (threadID) {
+ if (!this.data.boards[boardID]) {
+ return;
+ }
+ delete this.data.boards[boardID][threadID];
+ this.deleteIfEmpty({
+ boardID: boardID
+ });
+ } else {
+ delete this.data.boards[boardID];
+ }
+ return this.save();
+ };
+
+ DataBoard.prototype.deleteIfEmpty = function(arg) {
+ var boardID, threadID;
+ boardID = arg.boardID, threadID = arg.threadID;
+ $.forceSync(this.key);
+ if (threadID) {
+ if (!Object.keys(this.data.boards[boardID][threadID]).length) {
+ delete this.data.boards[boardID][threadID];
+ return this.deleteIfEmpty({
+ boardID: boardID
+ });
+ }
+ } else if (!Object.keys(this.data.boards[boardID]).length) {
+ return delete this.data.boards[boardID];
+ }
+ };
+
+ DataBoard.prototype.set = function(arg, cb) {
+ var base, base1, base2, boardID, postID, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val;
+ $.forceSync(this.key);
+ if (postID !== void 0) {
+ ((base = ((base1 = this.data.boards)[boardID] || (base1[boardID] = {})))[threadID] || (base[threadID] = {}))[postID] = val;
+ } else if (threadID !== void 0) {
+ ((base2 = this.data.boards)[boardID] || (base2[boardID] = {}))[threadID] = val;
+ } else {
+ this.data.boards[boardID] = val;
+ }
+ return this.save(cb);
+ };
+
+ DataBoard.prototype.get = function(arg) {
+ var ID, board, boardID, defaultValue, i, len, postID, thread, threadID, val;
+ boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue;
+ if (board = this.data.boards[boardID]) {
+ if (threadID == null) {
+ if (postID != null) {
+ for (thread = i = 0, len = board.length; i < len; thread = ++i) {
+ ID = board[thread];
+ if (postID in thread) {
+ val = thread[postID];
+ break;
+ }
+ }
+ } else {
+ val = board;
+ }
+ } else if (thread = board[threadID]) {
+ val = postID != null ? thread[postID] : thread;
+ }
+ }
+ return val || defaultValue;
+ };
+
+ DataBoard.prototype.forceSync = function() {
+ return $.forceSync(this.key);
+ };
+
+ DataBoard.prototype.clean = function() {
+ var boardID, now, ref, val;
+ $.forceSync(this.key);
+ ref = this.data.boards;
+ for (boardID in ref) {
+ val = ref[boardID];
+ this.deleteIfEmpty({
+ boardID: boardID
+ });
+ }
+ now = Date.now();
+ if ((this.data.lastChecked || 0) < now - 2 * $.HOUR) {
+ this.data.lastChecked = now;
+ for (boardID in this.data.boards) {
+ this.ajaxClean(boardID);
+ }
+ }
+ };
+
+ DataBoard.prototype.ajaxClean = function(boardID) {
+ return $.cache("//a.4cdn.org/" + boardID + "/threads.json", (function(_this) {
+ return function(e1) {
+ var ref;
+ if ((ref = e1.target.status) !== 200 && ref !== 404) {
+ return;
+ }
+ return $.cache("//a.4cdn.org/" + boardID + "/archive.json", function(e2) {
+ var ref1;
+ if ((ref1 = e2.target.status) !== 200 && ref1 !== 404) {
+ return;
+ }
+ return _this.ajaxCleanParse(boardID, e1.target.response, e2.target.response);
+ });
+ };
+ })(this));
+ };
+
+ DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) {
+ var ID, board, i, j, k, len, len1, len2, page, ref, thread, threads;
+ if (!(board = this.data.boards[boardID])) {
+ return;
+ }
+ threads = {};
+ if (response1) {
+ for (i = 0, len = response1.length; i < len; i++) {
+ page = response1[i];
+ ref = page.threads;
+ for (j = 0, len1 = ref.length; j < len1; j++) {
+ thread = ref[j];
+ ID = thread.no;
+ if (ID in board) {
+ threads[ID] = board[ID];
+ }
+ }
+ }
+ }
+ if (response2) {
+ for (k = 0, len2 = response2.length; k < len2; k++) {
+ ID = response2[k];
+ if (ID in board) {
+ threads[ID] = board[ID];
+ }
+ }
+ }
+ this.data.boards[boardID] = threads;
+ this.deleteIfEmpty({
+ boardID: boardID
+ });
+ return this.save();
+ };
+
+ DataBoard.prototype.onSync = function(data) {
+ this.data = data || {
+ boards: {}
+ };
+ return typeof this.sync === "function" ? this.sync() : void 0;
+ };
+
+ return DataBoard;
+
+ })();
+
+ return DataBoard;
+
+}).call(this);
+
+Fetcher = (function() {
+ var Fetcher,
+ slice = [].slice;
+
+ Fetcher = (function() {
+ function Fetcher(boardID1, threadID, postID1, root, quoter) {
+ var post;
+ this.boardID = boardID1;
+ this.threadID = threadID;
+ this.postID = postID1;
+ this.root = root;
+ this.quoter = quoter;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
+ this.insert(post);
+ return;
+ }
+ this.root.textContent = "Loading post No." + this.postID + "...";
+ if (this.threadID) {
+ $.cache("//a.4cdn.org/" + this.boardID + "/thread/" + this.threadID + ".json", (function(_this) {
+ return function(e, isCached) {
+ return _this.fetchedPost(e.target, isCached);
+ };
+ })(this));
+ } else {
+ this.archivedPost();
+ }
+ }
+
+ Fetcher.prototype.insert = function(post) {
+ var boardID, clone, k, len, nodes, postID, quote, ref, ref1;
+ if (!this.root.parentNode) {
+ return;
+ }
+ clone = post.addClone(this.quoter.context, $.hasClass(this.root, 'dialog'));
+ Main.callbackNodes('Post', [clone]);
+ nodes = clone.nodes;
+ $.rmAll(nodes.root);
+ $.add(nodes.root, nodes.post);
+ ref = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks));
+ for (k = 0, len = ref.length; k < len; k++) {
+ quote = ref[k];
+ ref1 = Get.postDataFromLink(quote), boardID = ref1.boardID, postID = ref1.postID;
+ if (postID === this.quoter.ID && boardID === this.quoter.board.ID) {
+ $.addClass(quote, 'forwardlink');
+ }
+ }
+ $.rmAll(this.root);
+ $.add(this.root, nodes.root);
+ return $.event('PostsInserted');
+ };
+
+ Fetcher.prototype.fetchedPost = function(req, isCached) {
+ var api, board, k, len, post, posts, status, thread;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
+ this.insert(post);
+ return;
+ }
+ status = req.status;
+ if (status !== 200 && status !== 304) {
+ if (this.archivedPost()) {
+ return;
+ }
+ $.addClass(this.root, 'warning');
+ this.root.textContent = status === 404 ? "Thread No." + this.threadID + " 404'd." : "Error " + req.statusText + " (" + req.status + ").";
+ return;
+ }
+ posts = req.response.posts;
+ Build.spoilerRange[this.boardID] = posts[0].custom_spoiler;
+ for (k = 0, len = posts.length; k < len; k++) {
+ post = posts[k];
+ if (post.no === this.postID) {
+ break;
+ }
+ }
+ if (post.no !== this.postID) {
+ if (isCached) {
+ api = "//a.4cdn.org/" + this.boardID + "/thread/" + this.threadID + ".json";
+ $.cleanCache(function(url) {
+ return url === api;
+ });
+ $.cache(api, (function(_this) {
+ return function(e) {
+ return _this.fetchedPost(e.target, false);
+ };
+ })(this));
+ return;
+ }
+ if (this.archivedPost()) {
+ return;
+ }
+ $.addClass(this.root, 'warning');
+ this.root.textContent = "Post No." + this.postID + " was not found.";
+ return;
+ }
+ board = g.boards[this.boardID] || new Board(this.boardID);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ post = new Post(Build.postFromObject(post, this.boardID), thread, board);
+ post.isFetchedQuote = true;
+ Main.callbackNodes('Post', [post]);
+ return this.insert(post);
+ };
+
+ Fetcher.prototype.archivedPost = function() {
+ var archive, url;
+ if (!Conf['Resurrect Quotes']) {
+ return false;
+ }
+ if (!(url = Redirect.to('post', {
+ boardID: this.boardID,
+ postID: this.postID
+ }))) {
+ return false;
+ }
+ archive = Redirect.data.post[this.boardID];
+ if (/^https:\/\//.test(url) || location.protocol === 'http:') {
+ $.cache(url, (function(_this) {
+ return function(e) {
+ return _this.parseArchivedPost(e.target.response, url, archive);
+ };
+ })(this), {
+ responseType: 'json',
+ withCredentials: archive.withCredentials
+ });
+ return true;
+ } else if (Conf['Exempt Archives from Encryption']) {
+ CrossOrigin.json(url, (function(_this) {
+ return function(response) {
+ var key, media, ref;
+ media = response.media;
+ if (media) {
+ for (key in media) {
+ if (/_link$/.test(key)) {
+ if (!((ref = media[key]) != null ? ref.match(/^http:\/\//) : void 0)) {
+ delete media[key];
+ }
+ }
+ }
+ }
+ return _this.parseArchivedPost(response, url, archive);
+ };
+ })(this));
+ return true;
+ }
+ return false;
+ };
+
+ Fetcher.prototype.parseArchivedPost = function(data, url, archive) {
+ var board, comment, greentext, i, j, key, o, post, ref, ref1, text, text2, thread, val;
+ if (post = g.posts[this.boardID + "." + this.postID]) {
+ this.insert(post);
+ return;
+ }
+ if (data == null) {
+ $.addClass(this.root, 'warning');
+ this.root.textContent = "Error fetching Post No." + this.postID + " from " + archive.name + ".";
+ return;
+ }
+ if (data.error) {
+ $.addClass(this.root, 'warning');
+ this.root.textContent = data.error;
+ return;
+ }
+ comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned)\])/);
+ comment = (function() {
+ var k, len, results;
+ results = [];
+ for (i = k = 0, len = comment.length; k < len; i = ++k) {
+ text = comment[i];
+ if (i % 2 === 1) {
+ results.push(this.archiveTags[text]);
+ } else {
+ greentext = text[0] === '>';
+ text = text.replace(/(\[\/?[a-z]+):lit(\])/g, '$1$2');
+ text = (function() {
+ var l, len1, ref, results1;
+ ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g);
+ results1 = [];
+ for (j = l = 0, len1 = ref.length; l < len1; j = ++l) {
+ text2 = ref[j];
+ results1.push({
+ innerHTML: ((j % 2) ? "
" + E(text2) + " " : E(text2))
+ });
+ }
+ return results1;
+ })();
+ text = {
+ innerHTML: ((greentext) ? "
" + E.cat(text) + " " : E.cat(text))
+ };
+ results.push(text);
+ }
+ }
+ return results;
+ }).call(this);
+ comment = {
+ innerHTML: E.cat(comment)
+ };
+ this.threadID = +data.thread_num;
+ o = {
+ postID: this.postID,
+ threadID: this.threadID,
+ boardID: this.boardID,
+ isReply: this.postID !== this.threadID
+ };
+ o.info = {
+ subject: data.title,
+ email: data.email,
+ name: data.name || '',
+ tripcode: data.trip,
+ capcode: (function() {
+ switch (data.capcode) {
+ case 'M':
+ return 'Mod';
+ case 'A':
+ return 'Admin';
+ case 'D':
+ return 'Developer';
+ }
+ })(),
+ uniqueID: data.poster_hash,
+ flagCode: data.poster_country,
+ flag: data.poster_country_name,
+ dateUTC: data.timestamp,
+ dateText: data.fourchan_date,
+ commentHTML: comment
+ };
+ if (o.info.capcode) {
+ delete o.info.uniqueID;
+ }
+ if ((ref = data.media) != null ? ref.media_filename : void 0) {
+ ref1 = data.media;
+ for (key in ref1) {
+ val = ref1[key];
+ if (/_link$/.test(key) && (val != null ? val[0] : void 0) === '/') {
+ data.media[key] = url.split('/', 3).join('/') + val;
+ }
+ }
+ o.file = {
+ name: data.media.media_filename,
+ url: data.media.media_link || data.media.remote_media_link || (location.protocol + "//i.4cdn.org/" + this.boardID + "/" + (encodeURIComponent(data.media[this.boardID === 'f' ? 'media_filename' : 'media_orig']))),
+ height: data.media.media_h,
+ width: data.media.media_w,
+ MD5: data.media.media_hash,
+ size: $.bytesToString(data.media.media_size),
+ thumbURL: data.media.thumb_link || (location.protocol + "//i.4cdn.org/" + this.boardID + "/" + data.media.preview_orig),
+ theight: data.media.preview_h,
+ twidth: data.media.preview_w,
+ isSpoiler: data.media.spoiler === '1'
+ };
+ if (!/\.pdf$/.test(o.file.url)) {
+ o.file.dimensions = o.file.width + "x" + o.file.height;
+ }
+ if (this.boardID === 'f' && data.media.exif) {
+ o.file.tag = JSON.parse(data.media.exif).Tag;
+ }
+ }
+ board = g.boards[this.boardID] || new Board(this.boardID);
+ thread = g.threads[this.boardID + "." + this.threadID] || new Thread(this.threadID, board);
+ post = new Post(Build.post(o), thread, board);
+ post.kill();
+ if (post.file) {
+ post.file.thumbURL = o.file.thumbURL;
+ }
+ post.isFetchedQuote = true;
+ Main.callbackNodes('Post', [post]);
+ return this.insert(post);
+ };
+
+ Fetcher.prototype.archiveTags = {
+ '\n': {
+ innerHTML: "
"
+ },
+ '[b]': {
+ innerHTML: "
"
+ },
+ '[/b]': {
+ innerHTML: " "
+ },
+ '[spoiler]': {
+ innerHTML: "
"
+ },
+ '[/spoiler]': {
+ innerHTML: " "
+ },
+ '[code]': {
+ innerHTML: "
"
+ },
+ '[/code]': {
+ innerHTML: " "
+ },
+ '[moot]': {
+ innerHTML: "
"
+ },
+ '[/moot]': {
+ innerHTML: "
"
+ },
+ '[banned]': {
+ innerHTML: "
"
+ },
+ '[/banned]': {
+ innerHTML: " "
+ }
+ };
+
+ return Fetcher;
+
+ })();
+
+ return Fetcher;
+
+}).call(this);
+
+Notice = (function() {
+ var Notice,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+ Notice = (function() {
+ function Notice(type, content, timeout, onclose) {
+ this.timeout = timeout;
+ this.onclose = onclose;
+ this.close = bind(this.close, this);
+ this.add = bind(this.add, this);
+ this.el = $.el('div', {
+ innerHTML: "
"
+ });
+ this.el.style.opacity = 0;
+ this.setType(type);
+ $.on(this.el.firstElementChild, 'click', this.close);
+ if (typeof content === 'string') {
+ content = $.tn(content);
+ }
+ $.add(this.el.lastElementChild, content);
+ $.ready(this.add);
+ }
+
+ Notice.prototype.setType = function(type) {
+ return this.el.className = "notification " + type;
+ };
+
+ Notice.prototype.add = function() {
+ if (this.closed) {
+ return;
+ }
+ if (d.hidden) {
+ $.on(d, 'visibilitychange', this.add);
+ return;
+ }
+ $.off(d, 'visibilitychange', this.add);
+ $.add(Header.noticesRoot, this.el);
+ this.el.clientHeight;
+ this.el.style.opacity = 1;
+ if (this.timeout) {
+ return setTimeout(this.close, this.timeout * $.SECOND);
+ }
+ };
+
+ Notice.prototype.close = function() {
+ this.closed = true;
+ $.off(d, 'visibilitychange', this.add);
+ $.rm(this.el);
+ return typeof this.onclose === "function" ? this.onclose() : void 0;
+ };
+
+ return Notice;
+
+ })();
+
+ return Notice;
+
+}).call(this);
+
+Post = (function() {
+ var Post,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Post = (function() {
+ Post.prototype.toString = function() {
+ return this.ID;
+ };
+
+ function Post(root, thread, board) {
+ var capcode, clone, date, email, flag, info, j, len, name, post, ref, subject, tripcode, uniqueID;
+ this.thread = thread;
+ this.board = board;
+ this.ID = +root.id.slice(2);
+ this.fullID = this.board + "." + this.ID;
+ this.context = this;
+ root.dataset.fullID = this.fullID;
+ post = $('.post', root);
+ info = $('.postInfo', post);
+ this.nodes = {
+ root: root,
+ post: post,
+ info: info,
+ nameBlock: $('.nameBlock', info),
+ quote: $('.postNum > a:nth-of-type(2)', info),
+ comment: $('.postMessage', post),
+ links: [],
+ quotelinks: []
+ };
+ if ($.engine === 'edge') {
+ Object.defineProperty(this.nodes, 'backlinks', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return info.getElementsByClassName('backlink');
+ }
+ });
+ } else {
+ this.nodes.backlinks = info.getElementsByClassName('backlink');
+ }
+ if (!(this.isReply = $.hasClass(post, 'reply'))) {
+ this.thread.OP = this;
+ this.thread.isArchived = !!$('.archivedIcon', info);
+ this.thread.isSticky = !!$('.stickyIcon', info);
+ this.thread.isClosed = this.thread.isArchived || !!$('.closedIcon', info);
+ if (this.thread.isArchived) {
+ this.thread.kill();
+ }
+ }
+ this.info = {};
+ this.info.nameBlock = Conf['Anonymize'] ? 'Anonymous' : this.nodes.nameBlock.textContent.trim();
+ if (subject = $('.subject', info)) {
+ this.nodes.subject = subject;
+ this.info.subject = subject.textContent || void 0;
+ }
+ if (name = $('.name', info)) {
+ this.nodes.name = name;
+ this.info.name = name.textContent;
+ }
+ if (email = $('.useremail', info)) {
+ this.nodes.email = email;
+ this.info.email = decodeURIComponent(email.href.slice(7));
+ }
+ if (tripcode = $('.postertrip', info)) {
+ this.nodes.tripcode = tripcode;
+ this.info.tripcode = tripcode.textContent;
+ }
+ if (uniqueID = $('.posteruid', info)) {
+ this.nodes.uniqueID = uniqueID;
+ this.info.uniqueID = uniqueID.firstElementChild.textContent;
+ }
+ if (capcode = $('.capcode.hand', info)) {
+ this.nodes.capcode = capcode;
+ this.info.capcode = capcode.textContent.replace('## ', '');
+ }
+ if (flag = $('.flag, .countryFlag', info)) {
+ this.nodes.flag = flag;
+ this.info.flag = flag.title;
+ }
+ if (date = $('.dateTime', info)) {
+ this.nodes.date = date;
+ this.info.date = new Date(date.dataset.utc * 1000);
+ }
+ this.parseComment();
+ this.parseQuotes();
+ this.parseFile();
+ this.isDead = false;
+ this.isHidden = false;
+ this.clones = [];
+ if (g.posts[this.fullID]) {
+ this.isRebuilt = true;
+ this.clones = g.posts[this.fullID].clones;
+ ref = this.clones;
+ for (j = 0, len = ref.length; j < len; j++) {
+ clone = ref[j];
+ clone.origin = this;
+ }
+ }
+ this.board.posts.push(this.ID, this);
+ this.thread.posts.push(this.ID, this);
+ g.posts.push(this.fullID, this);
+ }
+
+ Post.prototype.parseComment = function() {
+ var abbr, bq, commentDisplay, j, k, len, len1, node, ref, spoilers;
+ this.nodes.comment.normalize();
+ bq = this.nodes.comment.cloneNode(true);
+ ref = $$('.abbr + br, .exif, b, .fortune', bq);
+ for (j = 0, len = ref.length; j < len; j++) {
+ node = ref[j];
+ $.rm(node);
+ }
+ if (abbr = $('.abbr', bq)) {
+ $.rm(abbr);
+ }
+ this.info.comment = this.nodesToText(bq);
+ if (abbr) {
+ this.info.comment = this.info.comment.replace(/\n\n$/, '');
+ }
+ commentDisplay = this.info.comment;
+ if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) {
+ spoilers = $$('s', bq);
+ if (spoilers.length) {
+ for (k = 0, len1 = spoilers.length; k < len1; k++) {
+ node = spoilers[k];
+ $.replace(node, $.tn('[spoiler]'));
+ }
+ commentDisplay = this.nodesToText(bq);
+ }
+ }
+ return this.info.commentDisplay = commentDisplay.trim().replace(/\s+$/gm, '');
+ };
+
+ Post.prototype.nodesToText = function(bq) {
+ var i, node, nodes, text;
+ text = "";
+ nodes = $.X('.//br|.//text()', bq);
+ i = 0;
+ while (node = nodes.snapshotItem(i++)) {
+ text += node.data || '\n';
+ }
+ return text;
+ };
+
+ Post.prototype.parseQuotes = function() {
+ var j, len, quotelink, ref;
+ this.quotes = [];
+ ref = $$(':not(pre) > .quotelink', this.nodes.comment);
+ for (j = 0, len = ref.length; j < len; j++) {
+ quotelink = ref[j];
+ this.parseQuote(quotelink);
+ }
+ };
+
+ Post.prototype.parseQuote = function(quotelink) {
+ var fullID, match;
+ match = quotelink.href.match(/^https?:\/\/boards\.4chan\.org\/+([^\/]+)\/+(?:res|thread)\/+\d+(?:\/[^#]*)?#p(\d+)$/);
+ if (!(match || (this.isClone && quotelink.dataset.postID))) {
+ return;
+ }
+ this.nodes.quotelinks.push(quotelink);
+ if (this.isClone) {
+ return;
+ }
+ fullID = match[1] + "." + match[2];
+ if (indexOf.call(this.quotes, fullID) < 0) {
+ return this.quotes.push(fullID);
+ }
+ };
+
+ Post.prototype.parseFile = function() {
+ var fileEl, fileText, info, link, m, ref, ref1, ref2, size, thumb, unit;
+ if (!(fileEl = $('.file', this.nodes.post))) {
+ return;
+ }
+ if (!(link = $('.fileText > a, .fileText-original > a', fileEl))) {
+ return;
+ }
+ if (!(info = (ref = link.nextSibling) != null ? ref.textContent.match(/\(([\d.]+ [KMG]?B).*\)/) : void 0)) {
+ return;
+ }
+ fileText = fileEl.firstElementChild;
+ this.file = {
+ text: fileText,
+ link: link,
+ url: link.href,
+ name: fileText.title || link.title || link.textContent,
+ size: info[1],
+ isImage: /(jpg|png|gif)$/i.test(link.href),
+ isVideo: /webm$/i.test(link.href),
+ dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0,
+ tag: (ref2 = info[0].match(/,[^,]*, ([a-z]+)\)/i)) != null ? ref2[1] : void 0
+ };
+ size = +this.file.size.match(/[\d.]+/)[0];
+ unit = ['B', 'KB', 'MB', 'GB'].indexOf(this.file.size.match(/\w+$/)[0]);
+ while (unit-- > 0) {
+ size *= 1024;
+ }
+ this.file.sizeInBytes = size;
+ if ((thumb = $('.fileThumb > [data-md5]', fileEl))) {
+ return $.extend(this.file, {
+ thumb: thumb,
+ thumbURL: (m = link.href.match(/\d+(?=\.\w+$)/)) ? location.protocol + "//i.4cdn.org/" + this.board + "/" + m[0] + "s.jpg" : void 0,
+ MD5: thumb.dataset.md5,
+ isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler')
+ });
+ }
+ };
+
+ Post.prototype.kill = function(file) {
+ var clone, j, k, len, len1, quotelink, ref, ref1, strong;
+ if (file) {
+ if (this.isDead || this.file.isDead) {
+ return;
+ }
+ this.file.isDead = true;
+ $.addClass(this.nodes.root, 'deleted-file');
+ } else {
+ if (this.isDead) {
+ return;
+ }
+ this.isDead = true;
+ $.rmClass(this.nodes.root, 'deleted-file');
+ $.addClass(this.nodes.root, 'deleted-post');
+ }
+ if (!(strong = $('strong.warning', this.nodes.info))) {
+ strong = $.el('strong', {
+ className: 'warning'
+ });
+ $.after($('input', this.nodes.info), strong);
+ }
+ strong.textContent = file ? '[File deleted]' : '[Deleted]';
+ if (this.isClone) {
+ return;
+ }
+ ref = this.clones;
+ for (j = 0, len = ref.length; j < len; j++) {
+ clone = ref[j];
+ clone.kill(file);
+ }
+ if (file) {
+ return;
+ }
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ quotelink = ref1[k];
+ if (!(!$.hasClass(quotelink, 'deadlink'))) {
+ continue;
+ }
+ quotelink.textContent = quotelink.textContent + '\u00A0(Dead)';
+ $.addClass(quotelink, 'deadlink');
+ }
+ };
+
+ Post.prototype.resurrect = function() {
+ var clone, j, k, len, len1, quotelink, ref, ref1, strong;
+ this.isDead = false;
+ $.rmClass(this.nodes.root, 'deleted-post');
+ strong = $('strong.warning', this.nodes.info);
+ if (this.file && this.file.isDead) {
+ strong.textContent = '[File deleted]';
+ } else {
+ $.rm(strong);
+ }
+ if (this.isClone) {
+ return;
+ }
+ ref = this.clones;
+ for (j = 0, len = ref.length; j < len; j++) {
+ clone = ref[j];
+ clone.resurrect();
+ }
+ ref1 = Get.allQuotelinksLinkingTo(this);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ quotelink = ref1[k];
+ if (!($.hasClass(quotelink, 'deadlink'))) {
+ continue;
+ }
+ quotelink.textContent = quotelink.textContent.replace('\u00A0(Dead)', '');
+ $.rmClass(quotelink, 'deadlink');
+ }
+ };
+
+ Post.prototype.collect = function() {
+ g.posts.rm(this.fullID);
+ this.thread.posts.rm(this);
+ return this.board.posts.rm(this);
+ };
+
+ Post.prototype.addClone = function(context, contractThumb) {
+ return new Post.Clone(this, context, contractThumb);
+ };
+
+ Post.prototype.rmClone = function(index) {
+ var clone, j, len, ref;
+ this.clones.splice(index, 1);
+ ref = this.clones.slice(index);
+ for (j = 0, len = ref.length; j < len; j++) {
+ clone = ref[j];
+ clone.nodes.root.dataset.clone = index++;
+ }
+ };
+
+ return Post;
+
+ })();
+
+ return Post;
+
+}).call(this);
+
+(function() {
+ var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty,
+ slice = [].slice;
+
+ Post.Clone = (function(superClass) {
+ extend(_Class, superClass);
+
+ _Class.prototype.isClone = true;
+
+ function _Class(origin, context, contractThumb) {
+ var base, file, i, info, inline, inlined, j, k, key, l, len, len1, len2, len3, node, nodes, post, ref, ref1, ref2, ref3, ref4, ref5, root, val;
+ this.origin = origin;
+ this.context = context;
+ ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ key = ref[i];
+ this[key] = this.origin[key];
+ }
+ nodes = this.origin.nodes;
+ root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true);
+ (base = Post.Clone).prefix || (base.prefix = 0);
+ ref1 = [root].concat(slice.call($$('[id]', root)));
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ node = ref1[j];
+ node.id = Post.Clone.prefix + node.id;
+ }
+ Post.Clone.prefix++;
+ post = $('.post', root);
+ info = $('.postInfo', post);
+ this.nodes = {
+ root: root,
+ post: post,
+ info: info,
+ nameBlock: $('.nameBlock', info),
+ quote: $('.postNum > a:nth-of-type(2)', info),
+ comment: $('.postMessage', post),
+ quotelinks: []
+ };
+ if ($.engine === 'edge') {
+ Object.defineProperty(this.nodes, 'backlinks', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return info.getElementsByClassName('backlink');
+ }
+ });
+ } else {
+ this.nodes.backlinks = info.getElementsByClassName('backlink');
+ }
+ ref2 = $$('.inline', post);
+ for (k = 0, len2 = ref2.length; k < len2; k++) {
+ inline = ref2[k];
+ $.rm(inline);
+ }
+ ref3 = $$('.inlined', post);
+ for (l = 0, len3 = ref3.length; l < len3; l++) {
+ inlined = ref3[l];
+ $.rmClass(inlined, 'inlined');
+ }
+ root.hidden = false;
+ $.rmClass(root, 'forwarded');
+ $.rmClass(post, 'highlight');
+ if (nodes.subject) {
+ this.nodes.subject = $('.subject', info);
+ }
+ if (nodes.name) {
+ this.nodes.name = $('.name', info);
+ }
+ if (nodes.email) {
+ this.nodes.email = $('.useremail', info);
+ }
+ if (nodes.tripcode) {
+ this.nodes.tripcode = $('.postertrip', info);
+ }
+ if (nodes.uniqueID) {
+ this.nodes.uniqueID = $('.posteruid', info);
+ }
+ if (nodes.capcode) {
+ this.nodes.capcode = $('.capcode.hand', info);
+ }
+ if (nodes.flag) {
+ this.nodes.flag = $('.flag, .countryFlag', info);
+ }
+ if (nodes.date) {
+ this.nodes.date = $('.dateTime', info);
+ }
+ this.parseQuotes();
+ this.quotes = slice.call(this.origin.quotes);
+ if (this.origin.file) {
+ this.file = {};
+ ref4 = this.origin.file;
+ for (key in ref4) {
+ val = ref4[key];
+ this.file[key] = val;
+ }
+ file = $('.file', post);
+ this.file.text = file.firstElementChild;
+ this.file.link = $('.fileText > a, .fileText-original', file);
+ this.file.thumb = $('.fileThumb > [data-md5]', file);
+ this.file.fullImage = $('.full-image', file);
+ this.file.videoControls = $('.video-controls', this.file.text);
+ if (this.file.videoThumb) {
+ this.file.thumb.muted = true;
+ }
+ if ((ref5 = this.file.thumb) != null ? ref5.dataset.src : void 0) {
+ this.file.thumb.src = this.file.thumb.dataset.src;
+ this.file.thumb.removeAttribute('data-src');
+ }
+ if (this.file.thumb && contractThumb) {
+ ImageExpand.contract(this);
+ }
+ }
+ if (this.origin.isDead) {
+ this.isDead = true;
+ }
+ root.dataset.clone = this.origin.clones.push(this) - 1;
+ }
+
+ _Class.prototype.cloneWithoutVideo = function(node) {
+ var child, clone, i, len, ref;
+ if (node.tagName === 'VIDEO' && !node.dataset.md5) {
+ return [];
+ } else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) {
+ clone = node.cloneNode(false);
+ ref = node.childNodes;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ $.add(clone, this.cloneWithoutVideo(child));
+ }
+ return clone;
+ } else {
+ return node.cloneNode(true);
+ }
+ };
+
+ return _Class;
+
+ })(Post);
+
+}).call(this);
+
+RandomAccessList = (function() {
+ var RandomAccessList;
+
+ RandomAccessList = (function() {
+ function RandomAccessList(items) {
+ var i, item, len;
+ this.length = 0;
+ if (items) {
+ for (i = 0, len = items.length; i < len; i++) {
+ item = items[i];
+ this.push(item);
+ }
+ }
+ }
+
+ RandomAccessList.prototype.push = function(data) {
+ var ID, item, last;
+ ID = data.ID;
+ ID || (ID = data.id);
+ if (this[ID]) {
+ return;
+ }
+ last = this.last;
+ this[ID] = item = {
+ prev: last,
+ next: null,
+ data: data,
+ ID: ID
+ };
+ item.prev = last;
+ this.last = last ? last.next = item : this.first = item;
+ return this.length++;
+ };
+
+ RandomAccessList.prototype.before = function(root, item) {
+ var prev;
+ if (item.next === root || item === root) {
+ return;
+ }
+ this.rmi(item);
+ prev = root.prev;
+ root.prev = item;
+ item.next = root;
+ item.prev = prev;
+ if (prev) {
+ return prev.next = item;
+ } else {
+ return this.first = item;
+ }
+ };
+
+ RandomAccessList.prototype.after = function(root, item) {
+ var next;
+ if (item.prev === root || item === root) {
+ return;
+ }
+ this.rmi(item);
+ next = root.next;
+ root.next = item;
+ item.prev = root;
+ item.next = next;
+ if (next) {
+ return next.prev = item;
+ } else {
+ return this.last = item;
+ }
+ };
+
+ RandomAccessList.prototype.prepend = function(item) {
+ var first;
+ first = this.first;
+ if (item === first || !this[item.ID]) {
+ return;
+ }
+ this.rmi(item);
+ item.next = first;
+ if (first) {
+ first.prev = item;
+ } else {
+ this.last = item;
+ }
+ this.first = item;
+ return delete item.prev;
+ };
+
+ RandomAccessList.prototype.shift = function() {
+ return this.rm(this.first.ID);
+ };
+
+ RandomAccessList.prototype.order = function() {
+ var item, order;
+ order = [item = this.first];
+ while (item = item.next) {
+ order.push(item);
+ }
+ return order;
+ };
+
+ RandomAccessList.prototype.rm = function(ID) {
+ var item;
+ item = this[ID];
+ if (!item) {
+ return;
+ }
+ delete this[ID];
+ this.length--;
+ this.rmi(item);
+ delete item.next;
+ return delete item.prev;
+ };
+
+ RandomAccessList.prototype.rmi = function(item) {
+ var next, prev;
+ prev = item.prev, next = item.next;
+ if (prev) {
+ prev.next = next;
+ } else {
+ this.first = next;
+ }
+ if (next) {
+ return next.prev = prev;
+ } else {
+ return this.last = prev;
+ }
+ };
+
+ return RandomAccessList;
+
+ })();
+
+ return RandomAccessList;
+
+}).call(this);
+
+ShimSet = (function() {
+ var ShimSet;
+
+ ShimSet = (function() {
+ function ShimSet() {
+ this.elements = {};
+ this.size = 0;
+ }
+
+ ShimSet.prototype.has = function(value) {
+ return value in this.elements;
+ };
+
+ ShimSet.prototype.add = function(value) {
+ if (this.elements[value]) {
+ return;
+ }
+ this.elements[value] = true;
+ return this.size++;
+ };
+
+ ShimSet.prototype["delete"] = function(value) {
+ if (!this.elements[value]) {
+ return;
+ }
+ delete this.elements[value];
+ return this.size--;
+ };
+
+ return ShimSet;
+
+ })();
+
+ if (!('Set' in window)) {
+ window.Set = ShimSet;
+ }
+
+ return ShimSet;
+
+}).call(this);
+
+SimpleDict = (function() {
+ var SimpleDict,
+ slice = [].slice;
+
+ SimpleDict = (function() {
+ function SimpleDict() {
+ this.keys = [];
+ }
+
+ SimpleDict.prototype.push = function(key, data) {
+ key = "" + key;
+ if (!this[key]) {
+ this.keys.push(key);
+ }
+ return this[key] = data;
+ };
+
+ SimpleDict.prototype.rm = function(key) {
+ var i;
+ key = "" + key;
+ if ((i = this.keys.indexOf(key)) !== -1) {
+ this.keys.splice(i, 1);
+ return delete this[key];
+ }
+ };
+
+ SimpleDict.prototype.forEach = function(fn) {
+ var j, key, len, ref;
+ ref = slice.call(this.keys);
+ for (j = 0, len = ref.length; j < len; j++) {
+ key = ref[j];
+ fn(this[key]);
+ }
+ };
+
+ return SimpleDict;
+
+ })();
+
+ return SimpleDict;
+
+}).call(this);
+
+Thread = (function() {
+ var Thread;
+
+ Thread = (function() {
+ Thread.prototype.toString = function() {
+ return this.ID;
+ };
+
+ function Thread(ID, board) {
+ this.ID = ID;
+ this.board = board;
+ this.fullID = this.board + "." + this.ID;
+ this.posts = new SimpleDict();
+ this.isDead = false;
+ this.isHidden = false;
+ this.isOnTop = false;
+ this.isSticky = false;
+ this.isClosed = false;
+ this.isArchived = false;
+ this.postLimit = false;
+ this.fileLimit = false;
+ this.ipCount = void 0;
+ this.OP = null;
+ this.catalogView = null;
+ this.board.threads.push(this.ID, this);
+ g.threads.push(this.fullID, this);
+ }
+
+ Thread.prototype.setPage = function(pageNum) {
+ var icon, info, quote, ref;
+ ref = this.OP.nodes, info = ref.info, quote = ref.quote;
+ if (!(icon = $('.page-num', info))) {
+ icon = $.el('span', {
+ className: 'page-num'
+ });
+ $.after(quote, [$.tn(' '), icon]);
+ }
+ icon.title = "This thread is on page " + pageNum + " in the original index.";
+ icon.textContent = "[" + pageNum + "]";
+ if (this.catalogView) {
+ return this.catalogView.nodes.pageCount.textContent = pageNum;
+ }
+ };
+
+ Thread.prototype.setCount = function(type, count, reachedLimit) {
+ var el;
+ if (!this.catalogView) {
+ return;
+ }
+ el = this.catalogView.nodes[type + "Count"];
+ el.textContent = count;
+ return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning');
+ };
+
+ Thread.prototype.setStatus = function(type, status) {
+ var name;
+ name = "is" + type;
+ if (this[name] === status) {
+ return;
+ }
+ this[name] = status;
+ if (!this.OP) {
+ return;
+ }
+ this.setIcon('Sticky', this.isSticky);
+ this.setIcon('Closed', this.isClosed && !this.isArchived);
+ return this.setIcon('Archived', this.isArchived);
+ };
+
+ Thread.prototype.setIcon = function(type, status) {
+ var icon, root, typeLC;
+ typeLC = type.toLowerCase();
+ icon = $("." + typeLC + "Icon", this.OP.nodes.info);
+ if (!!icon === status) {
+ return;
+ }
+ if (!status) {
+ $.rm(icon.previousSibling);
+ $.rm(icon);
+ if (this.catalogView) {
+ $.rm($("." + typeLC + "Icon", this.catalogView.nodes.icons));
+ }
+ return;
+ }
+ icon = $.el('img', {
+ src: "" + Build.staticPath + typeLC + Build.gifIcon,
+ alt: type,
+ title: type,
+ className: typeLC + "Icon retina"
+ });
+ root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote;
+ $.after(root, [$.tn(' '), icon]);
+ if (!this.catalogView) {
+ return;
+ }
+ return (type === 'Sticky' && this.isClosed ? $.prepend : $.add)(this.catalogView.nodes.icons, icon.cloneNode());
+ };
+
+ Thread.prototype.kill = function() {
+ return this.isDead = true;
+ };
+
+ Thread.prototype.collect = function() {
+ this.posts.forEach(function(post) {
+ return post.collect();
+ });
+ g.threads.rm(this.fullID);
+ return this.board.threads.rm(this);
+ };
+
+ return Thread;
+
+ })();
+
+ return Thread;
+
+}).call(this);
+
+Redirect = (function() {
+ var Redirect,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Redirect = {
+ init: function() {
+ var archive, archives, boardID, boards, data, files, i, id, j, len, len1, name, o, record, ref, ref1, software, type, uid, withCredentials;
+ o = {
+ thread: {},
+ post: {},
+ file: {},
+ report: {}
+ };
+ archives = {};
+ ref = Redirect.archives;
+ for (i = 0, len = ref.length; i < len; i++) {
+ data = ref[i];
+ uid = data.uid, name = data.name, boards = data.boards, files = data.files, software = data.software, withCredentials = data.withCredentials;
+ archives[JSON.stringify(uid != null ? uid : name)] = data;
+ for (j = 0, len1 = boards.length; j < len1; j++) {
+ boardID = boards[j];
+ if (!withCredentials) {
+ if (!(boardID in o.thread)) {
+ o.thread[boardID] = data;
+ }
+ if (!(boardID in o.post || software !== 'foolfuuka')) {
+ o.post[boardID] = data;
+ }
+ if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) {
+ o.file[boardID] = data;
+ }
+ }
+ if (name === 'fgts') {
+ o.report[boardID] = data;
+ }
+ }
+ }
+ ref1 = Conf['selectedArchives'];
+ for (boardID in ref1) {
+ record = ref1[boardID];
+ for (type in record) {
+ id = record[type];
+ if (id === null) {
+ delete o[type][boardID];
+ } else if (archive = archives[JSON.stringify(id)]) {
+ boards = type === 'file' ? archive.files : archive.boards;
+ if (indexOf.call(boards, boardID) >= 0) {
+ o[type][boardID] = archive;
+ }
+ }
+ }
+ }
+ return Redirect.data = o;
+ },
+ archives: [
+ { "uid": 3, "name": "4plebs", "domain": "archive.4plebs.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "adv", "f", "hr", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ], "files": [ "adv", "f", "hr", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ] },
+ { "uid": 4, "name": "Nyafuu Archive", "domain": "archive.nyafuu.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "c", "e", "news", "w", "wg", "wsr" ], "files": [ "c", "e", "news", "w", "wg", "wsr" ] },
+ { "uid": 8, "name": "Rebecca Black Tech", "domain": "rbt.asia", "http": false, "https": true, "software": "fuuka", "boards": [ "cgl", "g", "mu" ], "files": [ "cgl", "g", "mu" ] },
+ { "uid": 10, "name": "warosu", "domain": "warosu.org", "http": false, "https": true, "software": "fuuka", "boards": [ "3", "biz", "cgl", "ck", "diy", "fa", "g", "ic", "jp", "lit", "sci", "tg", "vr" ], "files": [ "3", "biz", "cgl", "ck", "diy", "fa", "g", "ic", "jp", "lit", "sci", "tg", "vr" ] },
+ { "uid": 15, "name": "fgts", "domain": "fgts.jp", "http": true, "https": true, "software": "foolfuuka", "boards": [ "asp", "b", "cm", "gd", "h", "hc", "hm", "n", "out", "p", "po", "qa", "r", "s", "soc", "toy", "vp", "y" ], "files": [ "asp", "b", "cm", "gd", "h", "hc", "hm", "n", "out", "p", "po", "qa", "r", "s", "soc", "toy", "vp", "y" ] },
+ { "uid": 23, "name": "Desustorage", "domain": "desustorage.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "a", "aco", "an", "c", "co", "d", "fit", "gif", "his", "int", "k", "m", "mlp", "qa", "r9k", "tg", "trash", "vr", "wsg" ], "files": [ "a", "aco", "an", "c", "co", "d", "fit", "gif", "his", "int", "k", "m", "mlp", "qa", "r9k", "tg", "trash", "vr", "wsg" ] },
+ { "uid": 24, "name": "fireden.net", "domain": "boards.fireden.net", "http": false, "https": true, "software": "foolfuuka", "boards": [ "a", "cm", "ic", "sci", "tg", "v", "vg", "y" ], "files": [ "a", "cm", "ic", "sci", "tg", "v", "vg", "y" ] },
+ { "uid": 25, "name": "arch.b4k.co", "domain": "arch.b4k.co", "http": true, "https": true, "software": "foolfuuka", "boards": [ "g", "jp", "mlp", "v" ], "files": [] },
+ { "uid": 5, "name": "Love is Over", "domain": "deploy.loveisover.me", "http": true, "https": false, "software": "foolfuuka", "boards": [ "c", "d", "e", "i", "lgbt", "t", "u" ], "files": [ "c", "d", "e", "i", "lgbt", "t", "u" ], "search": [] },
+ { "uid": 28, "name": "bstats", "domain": "archive.b-stats.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "f", "cm", "hm", "lgbt", "news", "trash", "y" ], "files": [] }
+ ],
+ to: function(dest, data) {
+ var archive;
+ archive = (dest === 'search' || dest === 'board' ? Redirect.data.thread : Redirect.data[dest])[data.boardID];
+ if (!archive) {
+ return '';
+ }
+ return Redirect[dest](archive, data);
+ },
+ protocol: function(archive) {
+ var protocol;
+ protocol = location.protocol;
+ if (!archive[protocol.slice(0, -1)]) {
+ protocol = protocol === 'https:' ? 'http:' : 'https:';
+ }
+ return protocol + "//";
+ },
+ 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') {
+ path += '/';
+ }
+ if (threadID && postID) {
+ path += archive.software === 'foolfuuka' ? "#" + postID : "#p" + postID;
+ }
+ return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
+ },
+ post: function(archive, arg) {
+ var boardID, postID, protocol, url;
+ boardID = arg.boardID, postID = arg.postID;
+ protocol = Redirect.protocol(archive);
+ url = "" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID;
+ if (!Redirect.securityCheck(url)) {
+ return '';
+ }
+ return url;
+ },
+ file: function(archive, arg) {
+ var boardID, filename;
+ boardID = arg.boardID, filename = arg.filename;
+ return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename;
+ },
+ board: function(archive, arg) {
+ var boardID;
+ boardID = arg.boardID;
+ return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/";
+ },
+ 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;
+ if (type === 'capcode') {
+ value = {
+ 'Developer': 'dev'
+ }[value] || value.toLowerCase();
+ } else if (type === 'image') {
+ value = value.replace(/[+\/=]/g, function(c) {
+ return {
+ '+': '-',
+ '/': '_',
+ '=': ''
+ }[c];
+ });
+ }
+ value = encodeURIComponent(value);
+ path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value + "/" : type === 'image' ? boardID + "/image/" + value : boardID + "/?task=search2&search_" + type + "=" + value;
+ return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
+ },
+ report: function(archive, arg) {
+ var boardID, postID;
+ boardID = arg.boardID, postID = arg.postID;
+ return "https://so.fgts.jp/report/?board=" + boardID + "&no=" + postID;
+ },
+ securityCheck: function(url) {
+ return /^https:\/\//.test(url) || location.protocol === 'http:' || Conf['Exempt Archives from Encryption'];
+ },
+ navigate: function(dest, data, alternative) {
+ var url;
+ if (!Redirect.data) {
+ Redirect.init();
+ }
+ url = Redirect.to(dest, data);
+ if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) {
+ return location.replace(url);
+ } else if (alternative) {
+ return location.replace(alternative);
+ }
+ }
+ };
+
+ return Redirect;
+
+}).call(this);
+
+Anonymize = (function() {
+ var Anonymize;
+
+ Anonymize = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Anonymize'])) {
+ return;
+ }
+ if (g.VIEW === 'archive') {
+ return this.archive();
+ }
+ return Callbacks.Post.push({
+ name: 'Anonymize',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var email, name, ref, tripcode;
+ if (this.info.capcode || this.isClone) {
+ return;
+ }
+ ref = this.nodes, name = ref.name, tripcode = ref.tripcode, email = ref.email;
+ if (this.info.name !== 'Anonymous') {
+ name.textContent = 'Anonymous';
+ }
+ if (tripcode) {
+ $.rm(tripcode);
+ delete this.nodes.tripcode;
+ }
+ if (this.info.email) {
+ $.replace(email, name);
+ return delete this.nodes.email;
+ }
+ },
+ archive: function() {
+ return $.ready(function() {
+ var i, j, len, len1, name, ref, ref1, trip;
+ ref = $$('.name');
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ name.textContent = 'Anonymous';
+ }
+ ref1 = $$('.postertrip');
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ trip = ref1[j];
+ $.rm(trip);
+ }
+ });
+ }
+ };
+
+ return Anonymize;
+
+}).call(this);
+
+Filter = (function() {
+ var Filter,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Filter = {
+ filters: {},
+ init: function() {
+ var boards, err, excludes, filter, hl, i, key, len, line, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, regexp, stub, top;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
+ return;
+ }
+ if (!Conf['Filtered Backlinks']) {
+ $.addClass(doc, 'hide-backlinks');
+ }
+ for (key in Config.filter) {
+ this.filters[key] = [];
+ ref1 = Conf[key].split('\n');
+ for (i = 0, len = ref1.length; i < len; i++) {
+ line = ref1[i];
+ if (line[0] === '#') {
+ continue;
+ }
+ if (!(regexp = line.match(/\/(.+)\/(\w*)/))) {
+ continue;
+ }
+ filter = line.replace(regexp[0], '');
+ boards = ((ref2 = filter.match(/boards:([^;]+)/)) != null ? ref2[1].toLowerCase() : void 0) || 'global';
+ boards = boards === 'global' ? null : boards.split(',');
+ if (boards === null) {
+ excludes = ((ref3 = filter.match(/exclude:([^;]+)/)) != null ? ref3[1].toLowerCase().split(',') : void 0) || null;
+ }
+ if (key === 'uniqueID' || key === 'MD5') {
+ regexp = regexp[1];
+ } else {
+ try {
+ regexp = RegExp(regexp[1], regexp[2]);
+ } catch (_error) {
+ err = _error;
+ new Notice('warning', [$.tn("Invalid " + key + " filter:"), $.el('br'), $.tn(line), $.el('br'), $.tn(err.message)], 60);
+ continue;
+ }
+ }
+ op = ((ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? ref4[1] : void 0) || 'yes';
+ stub = (function() {
+ var ref5;
+ switch ((ref5 = filter.match(/stub:(yes|no)/)) != null ? ref5[1] : void 0) {
+ case 'yes':
+ return true;
+ case 'no':
+ return false;
+ default:
+ return Conf['Stubs'];
+ }
+ })();
+ if (hl = /highlight/.test(filter)) {
+ hl = ((ref5 = filter.match(/highlight:([\w-]+)/)) != null ? ref5[1] : void 0) || 'filter-highlight';
+ top = ((ref6 = filter.match(/top:(yes|no)/)) != null ? ref6[1] : void 0) || 'yes';
+ top = top === 'yes';
+ }
+ this.filters[key].push(this.createFilter(regexp, boards, excludes, op, stub, hl, top));
+ }
+ if (!this.filters[key].length) {
+ delete this.filters[key];
+ }
+ }
+ if (!Object.keys(this.filters).length) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Filter',
+ cb: this.node
+ });
+ },
+ createFilter: function(regexp, boards, excludes, op, stub, hl, top) {
+ var settings, test;
+ test = typeof regexp === 'string' ? function(value) {
+ return regexp === value;
+ } : function(value) {
+ return regexp.test(value);
+ };
+ settings = {
+ hide: !hl,
+ stub: stub,
+ "class": hl,
+ top: top
+ };
+ return function(value, boardID, isReply) {
+ if (boards && indexOf.call(boards, boardID) < 0) {
+ return false;
+ }
+ if (excludes && indexOf.call(excludes, boardID) >= 0) {
+ return false;
+ }
+ if (isReply && op === 'only' || !isReply && op === 'no') {
+ return false;
+ }
+ if (!test(value)) {
+ return false;
+ }
+ return settings;
+ };
+ },
+ node: function() {
+ var filter, i, key, len, ref, ref1, result, value;
+ if (this.isClone) {
+ return;
+ }
+ for (key in Filter.filters) {
+ if ((value = Filter[key](this)) != null) {
+ ref = Filter.filters[key];
+ for (i = 0, len = ref.length; i < len; i++) {
+ filter = ref[i];
+ if (!(result = filter(value, this.board.ID, this.isReply))) {
+ continue;
+ }
+ if (result.hide && !this.isFetchedQuote) {
+ if (this.isReply) {
+ PostHiding.hide(this, result.stub);
+ } else if (g.VIEW === 'index') {
+ ThreadHiding.hide(this.thread, result.stub);
+ } else {
+ continue;
+ }
+ return;
+ }
+ $.addClass(this.nodes.root, result["class"]);
+ if (!(this.highlights && (ref1 = result["class"], indexOf.call(this.highlights, ref1) >= 0))) {
+ (this.highlights || (this.highlights = [])).push(result["class"]);
+ }
+ if (!this.isReply && result.top) {
+ this.thread.isOnTop = true;
+ }
+ }
+ }
+ }
+ },
+ isHidden: function(post) {
+ var filter, i, key, len, ref, result, value;
+ for (key in Filter.filters) {
+ if ((value = Filter[key](post)) != null) {
+ ref = Filter.filters[key];
+ for (i = 0, len = ref.length; i < len; i++) {
+ filter = ref[i];
+ if (result = filter(value, post.boardID, post.isReply)) {
+ if (result.hide) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ },
+ postID: function(post) {
+ var ref;
+ return "" + ((ref = post.ID) != null ? ref : post.postID);
+ },
+ name: function(post) {
+ return post.info.name;
+ },
+ uniqueID: function(post) {
+ return post.info.uniqueID;
+ },
+ tripcode: function(post) {
+ return post.info.tripcode;
+ },
+ capcode: function(post) {
+ return post.info.capcode;
+ },
+ subject: function(post) {
+ return post.info.subject;
+ },
+ comment: function(post) {
+ var base;
+ return (base = post.info).comment != null ? base.comment : base.comment = Build.parseComment(post.info.commentHTML.innerHTML);
+ },
+ flag: function(post) {
+ return post.info.flag;
+ },
+ filename: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.name : void 0;
+ },
+ dimensions: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.dimensions : void 0;
+ },
+ filesize: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.size : void 0;
+ },
+ MD5: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.MD5 : void 0;
+ },
+ menu: {
+ init: function() {
+ var div, entry, i, len, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) {
+ return;
+ }
+ div = $.el('div', {
+ textContent: 'Filter'
+ });
+ entry = {
+ el: div,
+ order: 50,
+ open: function(post) {
+ Filter.menu.post = post;
+ return true;
+ },
+ subEntries: []
+ };
+ ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ type = ref1[i];
+ entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1]));
+ }
+ return Menu.menu.addEntry(entry);
+ },
+ createSubEntry: function(text, type) {
+ var el;
+ el = $.el('a', {
+ href: 'javascript:;',
+ textContent: text
+ });
+ el.dataset.type = type;
+ $.on(el, 'click', Filter.menu.makeFilter);
+ return {
+ el: el,
+ open: function(post) {
+ var value;
+ value = Filter[type](post);
+ return value != null;
+ }
+ };
+ },
+ makeFilter: function() {
+ var re, type, value;
+ type = this.dataset.type;
+ value = Filter[type](Filter.menu.post);
+ re = type === 'uniqueID' || type === 'MD5' ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) {
+ if (c === '\n') {
+ return '\\n';
+ } else if (c === '\\') {
+ return '\\\\';
+ } else {
+ return "\\" + c;
+ }
+ });
+ re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
+ return $.get(type, Conf[type], function(item) {
+ var save, section, select, ta, tl;
+ save = item[type];
+ save = save ? save + "\n" + re : re;
+ $.set(type, save);
+ Settings.open('Filter');
+ section = $('.section-container');
+ select = $('select[name=filter]', section);
+ select.value = type;
+ Settings.selectFilter.call(select);
+ ta = $('textarea', section);
+ tl = ta.textLength;
+ ta.setSelectionRange(tl, tl);
+ return ta.focus();
+ });
+ }
+ }
+ };
+
+ return Filter;
+
+}).call(this);
+
+PostHiding = (function() {
+ var PostHiding;
+
+ PostHiding = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) {
+ return;
+ }
+ if (Conf['Reply Hiding Buttons']) {
+ $.addClass(doc, "reply-hide");
+ }
+ this.db = new DataBoard('hiddenPosts');
+ return Callbacks.Post.push({
+ name: 'Reply Hiding',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var data, sideArrows;
+ if (!this.isReply || this.isClone || this.isFetchedQuote) {
+ return;
+ }
+ if (data = PostHiding.db.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ })) {
+ if (data.thisPost) {
+ PostHiding.hide(this, data.makeStub, data.hideRecursively);
+ } else {
+ Recursive.apply(PostHiding.hide, this, data.makeStub, true);
+ Recursive.add(PostHiding.hide, this, data.makeStub, true);
+ }
+ }
+ if (!Conf['Reply Hiding Buttons']) {
+ return;
+ }
+ sideArrows = $('.sideArrows', this.nodes.root);
+ $.replace(sideArrows.firstChild, PostHiding.makeButton(this, 'hide'));
+ return sideArrows.removeAttribute('class');
+ },
+ menu: {
+ init: function() {
+ var apply, div, hideStubLink, makeStub, ref, replies, thisPost;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
+ return;
+ }
+ div = $.el('div', {
+ className: 'hide-reply-link',
+ textContent: 'Hide'
+ });
+ apply = $.el('a', {
+ textContent: 'Apply',
+ href: 'javascript:;'
+ });
+ $.on(apply, 'click', PostHiding.menu.hide);
+ thisPost = UI.checkbox('thisPost', 'This post', true);
+ replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']);
+ makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']);
+ Menu.menu.addEntry({
+ el: div,
+ order: 20,
+ open: function(post) {
+ if (!post.isReply || post.isClone || post.isHidden) {
+ return false;
+ }
+ PostHiding.menu.post = post;
+ return true;
+ },
+ subEntries: [
+ {
+ el: apply
+ }, {
+ el: thisPost
+ }, {
+ el: replies
+ }, {
+ el: makeStub
+ }
+ ]
+ });
+ div = $.el('div', {
+ className: 'show-reply-link',
+ textContent: 'Show'
+ });
+ apply = $.el('a', {
+ textContent: 'Apply',
+ href: 'javascript:;'
+ });
+ $.on(apply, 'click', PostHiding.menu.show);
+ thisPost = UI.checkbox('thisPost', 'This post', false);
+ replies = UI.checkbox('replies', 'Show replies', false);
+ hideStubLink = $.el('a', {
+ textContent: 'Hide stub',
+ href: 'javascript:;'
+ });
+ $.on(hideStubLink, 'click', PostHiding.menu.hideStub);
+ Menu.menu.addEntry({
+ el: div,
+ order: 20,
+ open: function(post) {
+ var data;
+ if (!post.isReply || post.isClone || !post.isHidden) {
+ return false;
+ }
+ if (!(data = PostHiding.db.get({
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ }))) {
+ return false;
+ }
+ PostHiding.menu.post = post;
+ thisPost.firstChild.checked = post.isHidden;
+ replies.firstChild.checked = (data != null ? data.hideRecursively : void 0) != null ? data.hideRecursively : Conf['Recursive Hiding'];
+ return true;
+ },
+ subEntries: [
+ {
+ el: apply
+ }, {
+ el: thisPost
+ }, {
+ el: replies
+ }
+ ]
+ });
+ return Menu.menu.addEntry({
+ el: hideStubLink,
+ order: 15,
+ open: function(post) {
+ var data;
+ if (!post.isReply || post.isClone || !post.isHidden) {
+ return false;
+ }
+ if (!(data = PostHiding.db.get({
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ }))) {
+ return false;
+ }
+ return PostHiding.menu.post = post;
+ }
+ });
+ },
+ hide: function() {
+ var makeStub, parent, post, replies, thisPost;
+ parent = this.parentNode;
+ thisPost = $('input[name=thisPost]', parent).checked;
+ replies = $('input[name=replies]', parent).checked;
+ makeStub = $('input[name=makeStub]', parent).checked;
+ post = PostHiding.menu.post;
+ if (thisPost) {
+ PostHiding.hide(post, makeStub, replies);
+ } else if (replies) {
+ Recursive.apply(PostHiding.hide, post, makeStub, true);
+ Recursive.add(PostHiding.hide, post, makeStub, true);
+ } else {
+ return;
+ }
+ PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies);
+ return $.event('CloseMenu');
+ },
+ show: function() {
+ var data, parent, post, replies, thisPost;
+ parent = this.parentNode;
+ thisPost = $('input[name=thisPost]', parent).checked;
+ replies = $('input[name=replies]', parent).checked;
+ post = PostHiding.menu.post;
+ if (thisPost) {
+ PostHiding.show(post, replies);
+ } else if (replies) {
+ Recursive.apply(PostHiding.show, post, true);
+ Recursive.rm(PostHiding.hide, post, true);
+ } else {
+ return;
+ }
+ if (data = PostHiding.db.get({
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ })) {
+ PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
+ }
+ return $.event('CloseMenu');
+ },
+ hideStub: function() {
+ var data, post;
+ post = PostHiding.menu.post;
+ if (data = PostHiding.db.get({
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ })) {
+ PostHiding.show(post, data.hideRecursively);
+ PostHiding.hide(post, false, data.hideRecursively);
+ PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively);
+ }
+ $.event('CloseMenu');
+ }
+ },
+ makeButton: function(post, type) {
+ var a, span;
+ span = $.el('span', {
+ className: "fa fa-" + (type === 'hide' ? 'minus' : 'plus') + "-square-o",
+ textContent: ""
+ });
+ a = $.el('a', {
+ className: type + "-reply-button",
+ href: 'javascript:;'
+ });
+ $.add(a, span);
+ $.on(a, 'click', PostHiding.toggle);
+ return a;
+ },
+ saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) {
+ var data;
+ data = {
+ boardID: post.board.ID,
+ threadID: post.thread.ID,
+ postID: post.ID
+ };
+ if (isHiding) {
+ data.val = {
+ thisPost: thisPost !== false,
+ makeStub: makeStub,
+ hideRecursively: hideRecursively
+ };
+ return PostHiding.db.set(data);
+ } else {
+ return PostHiding.db["delete"](data);
+ }
+ },
+ 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, i, len, quotelink, ref;
+ if (makeStub == null) {
+ makeStub = Conf['Stubs'];
+ }
+ if (hideRecursively == null) {
+ hideRecursively = Conf['Recursive Hiding'];
+ }
+ if (post.isHidden) {
+ return;
+ }
+ post.isHidden = true;
+ if (hideRecursively) {
+ Recursive.apply(PostHiding.hide, post, makeStub, true);
+ Recursive.add(PostHiding.hide, post, makeStub, true);
+ }
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ $.addClass(quotelink, 'filtered');
+ }
+ if (!makeStub) {
+ post.nodes.root.hidden = true;
+ return;
+ }
+ a = PostHiding.makeButton(post, 'show');
+ $.add(a, $.tn(" " + post.info.nameBlock));
+ post.nodes.stub = $.el('div', {
+ className: 'stub'
+ });
+ $.add(post.nodes.stub, a);
+ if (Conf['Menu']) {
+ $.add(post.nodes.stub, Menu.makeButton(post));
+ }
+ return $.prepend(post.nodes.root, post.nodes.stub);
+ },
+ show: function(post, showRecursively) {
+ var i, len, quotelink, ref;
+ if (showRecursively == null) {
+ showRecursively = Conf['Recursive Hiding'];
+ }
+ if (post.nodes.stub) {
+ $.rm(post.nodes.stub);
+ delete post.nodes.stub;
+ } else {
+ post.nodes.root.hidden = false;
+ }
+ post.isHidden = false;
+ if (showRecursively) {
+ Recursive.apply(PostHiding.show, post, true);
+ Recursive.rm(PostHiding.hide, post);
+ }
+ ref = Get.allQuotelinksLinkingTo(post);
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ $.rmClass(quotelink, 'filtered');
+ }
+ }
+ };
+
+ return PostHiding;
+
+}).call(this);
+
+Recursive = (function() {
+ var Recursive,
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Recursive = {
+ recursives: {},
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Recursive',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, j, k, len, len1, obj, quote, recursive, ref, ref1;
+ if (this.isClone || this.isFetchedQuote) {
+ return;
+ }
+ ref = this.quotes;
+ for (j = 0, len = ref.length; j < len; j++) {
+ quote = ref[j];
+ if (obj = Recursive.recursives[quote]) {
+ ref1 = obj.recursives;
+ for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) {
+ recursive = ref1[i];
+ recursive.apply(null, [this].concat(slice.call(obj.args[i])));
+ }
+ }
+ }
+ },
+ add: function() {
+ var args, base, name, obj, post, recursive;
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
+ obj = (base = Recursive.recursives)[name = post.fullID] || (base[name] = {
+ recursives: [],
+ args: []
+ });
+ obj.recursives.push(recursive);
+ return obj.args.push(args);
+ },
+ rm: function(recursive, post) {
+ var i, j, len, obj, rec, ref;
+ if (!(obj = Recursive.recursives[post.fullID])) {
+ return;
+ }
+ ref = obj.recursives;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ rec = ref[i];
+ if (!(rec === recursive)) {
+ continue;
+ }
+ obj.recursives.splice(i, 1);
+ obj.args.splice(i, 1);
+ }
+ },
+ apply: function() {
+ var args, fullID, post, recursive;
+ recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
+ fullID = post.fullID;
+ return g.posts.forEach(function(post) {
+ if (indexOf.call(post.quotes, fullID) >= 0) {
+ return recursive.apply(null, [post].concat(slice.call(args)));
+ }
+ });
+ }
+ };
+
+ return Recursive;
+
+}).call(this);
+
+ThreadHiding = (function() {
+ var ThreadHiding;
+
+ ThreadHiding = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) {
+ return;
+ }
+ this.db = new DataBoard('hiddenThreads');
+ if (g.VIEW === 'catalog') {
+ return this.catalogWatch();
+ }
+ this.catalogSet(g.BOARD);
+ return Callbacks.Post.push({
+ name: 'Thread Hiding',
+ cb: this.node
+ });
+ },
+ catalogSet: function(board) {
+ var hiddenThreads, threadID;
+ if (!$.hasStorage) {
+ return;
+ }
+ hiddenThreads = ThreadHiding.db.get({
+ boardID: board.ID,
+ defaultValue: {}
+ });
+ for (threadID in hiddenThreads) {
+ hiddenThreads[threadID] = true;
+ }
+ return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads));
+ },
+ catalogWatch: function() {
+ if (!$.hasStorage) {
+ return;
+ }
+ this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
+ return Main.ready(function() {
+ return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), {
+ attributes: true,
+ subtree: true,
+ attributeFilter: ['style']
+ });
+ });
+ },
+ catalogSave: function() {
+ var hiddenThreads2, threadID;
+ hiddenThreads2 = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {};
+ for (threadID in hiddenThreads2) {
+ if (!(threadID in ThreadHiding.hiddenThreads)) {
+ ThreadHiding.db.set({
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ val: {
+ makeStub: Conf['Stubs']
+ }
+ });
+ }
+ }
+ for (threadID in ThreadHiding.hiddenThreads) {
+ if (!(threadID in hiddenThreads2)) {
+ ThreadHiding.db["delete"]({
+ boardID: g.BOARD.ID,
+ threadID: threadID
+ });
+ }
+ }
+ return ThreadHiding.hiddenThreads = hiddenThreads2;
+ },
+ node: function() {
+ var data;
+ if (this.isReply || this.isClone || this.isFetchedQuote) {
+ return;
+ }
+ if (data = ThreadHiding.db.get({
+ boardID: this.board.ID,
+ threadID: this.ID
+ })) {
+ ThreadHiding.hide(this.thread, data.makeStub);
+ }
+ if (!Conf['Thread Hiding Buttons']) {
+ return;
+ }
+ return $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide'));
+ },
+ onIndexBuild: function(nodes) {
+ var i, len, root, thread;
+ for (i = 0, len = nodes.length; i < len; i++) {
+ root = nodes[i];
+ thread = Get.threadFromRoot(root);
+ if (thread.isHidden && thread.stub && !root.contains(thread.stub)) {
+ ThreadHiding.makeStub(thread, root);
+ }
+ }
+ },
+ menu: {
+ init: function() {
+ var apply, div, hideStubLink, makeStub;
+ if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
+ return;
+ }
+ div = $.el('div', {
+ className: 'hide-thread-link',
+ textContent: 'Hide'
+ });
+ apply = $.el('a', {
+ textContent: 'Apply',
+ href: 'javascript:;'
+ });
+ $.on(apply, 'click', ThreadHiding.menu.hide);
+ makeStub = UI.checkbox('Stubs', 'Make stub');
+ Menu.menu.addEntry({
+ el: div,
+ order: 20,
+ open: function(arg) {
+ var isReply, thread;
+ thread = arg.thread, isReply = arg.isReply;
+ if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
+ return false;
+ }
+ ThreadHiding.menu.thread = thread;
+ return true;
+ },
+ subEntries: [
+ {
+ el: apply
+ }, {
+ el: makeStub
+ }
+ ]
+ });
+ div = $.el('a', {
+ className: 'show-thread-link',
+ textContent: 'Show',
+ href: 'javascript:;'
+ });
+ $.on(div, 'click', ThreadHiding.menu.show);
+ Menu.menu.addEntry({
+ el: div,
+ order: 20,
+ open: function(arg) {
+ var isReply, thread;
+ thread = arg.thread, isReply = arg.isReply;
+ if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
+ return false;
+ }
+ ThreadHiding.menu.thread = thread;
+ return true;
+ }
+ });
+ hideStubLink = $.el('a', {
+ textContent: 'Hide stub',
+ href: 'javascript:;'
+ });
+ $.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);
+ return Menu.menu.addEntry({
+ el: hideStubLink,
+ order: 15,
+ open: function(arg) {
+ var isReply, thread;
+ thread = arg.thread, isReply = arg.isReply;
+ if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') {
+ return false;
+ }
+ return ThreadHiding.menu.thread = thread;
+ }
+ });
+ },
+ hide: function() {
+ var makeStub, thread;
+ makeStub = $('input', this.parentNode).checked;
+ thread = ThreadHiding.menu.thread;
+ ThreadHiding.hide(thread, makeStub);
+ ThreadHiding.saveHiddenState(thread, makeStub);
+ return $.event('CloseMenu');
+ },
+ show: function() {
+ var thread;
+ thread = ThreadHiding.menu.thread;
+ ThreadHiding.show(thread);
+ ThreadHiding.saveHiddenState(thread);
+ return $.event('CloseMenu');
+ },
+ hideStub: function() {
+ var thread;
+ thread = ThreadHiding.menu.thread;
+ ThreadHiding.show(thread);
+ ThreadHiding.hide(thread, false);
+ ThreadHiding.saveHiddenState(thread, false);
+ $.event('CloseMenu');
+ }
+ },
+ makeButton: function(thread, type) {
+ var a;
+ a = $.el('a', {
+ className: type + "-thread-button",
+ href: 'javascript:;'
+ });
+ $.extend(a, {
+ innerHTML: "
"
+ });
+ a.dataset.fullID = thread.fullID;
+ $.on(a, 'click', ThreadHiding.toggle);
+ return a;
+ },
+ makeStub: function(thread, root) {
+ var a, numReplies, summary;
+ numReplies = $$('.thread > .replyContainer', root).length;
+ if (summary = $('.summary', root)) {
+ numReplies += +summary.textContent.match(/\d+/);
+ }
+ a = ThreadHiding.makeButton(thread, 'show');
+ $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")"));
+ thread.stub = $.el('div', {
+ className: 'stub'
+ });
+ if (Conf['Menu']) {
+ $.add(thread.stub, [a, Menu.makeButton(thread.OP)]);
+ } else {
+ $.add(thread.stub, a);
+ }
+ return $.prepend(root, thread.stub);
+ },
+ saveHiddenState: function(thread, makeStub) {
+ if (thread.isHidden) {
+ ThreadHiding.db.set({
+ boardID: thread.board.ID,
+ threadID: thread.ID,
+ val: {
+ makeStub: makeStub
+ }
+ });
+ } else {
+ ThreadHiding.db["delete"]({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ });
+ }
+ return ThreadHiding.catalogSet(thread.board);
+ },
+ toggle: function(thread) {
+ if (!(thread instanceof Thread)) {
+ thread = g.threads[this.dataset.fullID];
+ }
+ if (thread.isHidden) {
+ ThreadHiding.show(thread);
+ } else {
+ ThreadHiding.hide(thread);
+ }
+ return ThreadHiding.saveHiddenState(thread);
+ },
+ hide: function(thread, makeStub) {
+ var threadRoot;
+ if (makeStub == null) {
+ makeStub = Conf['Stubs'];
+ }
+ if (thread.isHidden) {
+ return;
+ }
+ threadRoot = thread.OP.nodes.root.parentNode;
+ thread.isHidden = true;
+ if (Conf['JSON Index']) {
+ Index.updateHideLabel();
+ }
+ if (!makeStub) {
+ return threadRoot.hidden = true;
+ }
+ return ThreadHiding.makeStub(thread, threadRoot);
+ },
+ show: function(thread) {
+ var threadRoot;
+ if (thread.stub) {
+ $.rm(thread.stub);
+ delete thread.stub;
+ }
+ threadRoot = thread.OP.nodes.root.parentNode;
+ threadRoot.hidden = thread.isHidden = false;
+ if (Conf['JSON Index']) {
+ return Index.updateHideLabel();
+ }
+ }
+ };
+
+ return ThreadHiding;
+
+}).call(this);
+
+Build = (function() {
+ var Build,
+ slice = [].slice;
+
+ Build = {
+ staticPath: '//s.4cdn.org/image/',
+ gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif',
+ spoilerRange: {},
+ unescape: function(text) {
+ if (text == null) {
+ return text;
+ }
+ return text.replace(/<[^>]*>/g, '').replace(/&(amp|#039|quot|lt|gt|#44);/g, function(c) {
+ return {
+ '&': '&',
+ ''': "'",
+ '"': '"',
+ '<': '<',
+ '>': '>',
+ ',': ','
+ }[c];
+ });
+ },
+ shortFilename: function(filename) {
+ var ext, threshold;
+ threshold = 30;
+ ext = filename.match(/\.?[^\.]*$/)[0];
+ if (filename.length - ext.length > threshold) {
+ return filename.slice(0, threshold - 5) + "(...)" + ext;
+ } else {
+ return filename;
+ }
+ },
+ spoilerThumb: function(boardID) {
+ var spoilerRange;
+ if (spoilerRange = Build.spoilerRange[boardID]) {
+ return Build.staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png";
+ } else {
+ return Build.staticPath + "spoiler.png";
+ }
+ },
+ sameThread: function(boardID, threadID) {
+ return g.VIEW === 'thread' && g.BOARD.ID === boardID && g.THREADID === +threadID;
+ },
+ postURL: function(boardID, threadID, postID) {
+ if (Build.sameThread(boardID, threadID)) {
+ return "#p" + postID;
+ } else {
+ return "/" + boardID + "/thread/" + threadID + "#p" + postID;
+ }
+ },
+ parseJSON: function(data, boardID) {
+ var o;
+ o = {
+ postID: data.no,
+ threadID: data.resto || data.no,
+ boardID: boardID,
+ isReply: !!data.resto,
+ isSticky: !!data.sticky,
+ isClosed: !!data.closed,
+ isArchived: !!data.archived,
+ fileDeleted: !!data.filedeleted
+ };
+ o.info = {
+ subject: Build.unescape(data.sub),
+ email: Build.unescape(data.email),
+ name: Build.unescape(data.name) || '',
+ tripcode: data.trip,
+ uniqueID: data.id,
+ flagCode: data.country,
+ flag: Build.unescape(data.country_name),
+ dateUTC: data.time,
+ dateText: data.now,
+ commentHTML: {
+ innerHTML: data.com || ''
+ }
+ };
+ if (data.capcode) {
+ o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, function(c) {
+ return c.toUpperCase();
+ });
+ o.capcodeHighlight = /_highlight$/.test(data.capcode);
+ delete o.info.uniqueID;
+ }
+ if (data.ext) {
+ o.file = {
+ name: (Build.unescape(data.filename)) + data.ext,
+ url: boardID === 'f' ? location.protocol + "//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.filename)) + data.ext : location.protocol + "//i.4cdn.org/" + boardID + "/" + data.tim + data.ext,
+ height: data.h,
+ width: data.w,
+ MD5: data.md5,
+ size: $.bytesToString(data.fsize),
+ thumbURL: location.protocol + "//i.4cdn.org/" + boardID + "/" + data.tim + "s.jpg",
+ theight: data.tn_h,
+ twidth: data.tn_w,
+ isSpoiler: !!data.spoiler,
+ tag: data.tag
+ };
+ if (!/\.pdf$/.test(o.file.url)) {
+ o.file.dimensions = o.file.width + "x" + o.file.height;
+ }
+ }
+ return o;
+ },
+ parseComment: function(html) {
+ html = html.replace(/
/gi, '\n').replace(/\n\n
Rolled [^<]*<\/b>/i, '').replace(/]*>/g, '');
+ return Build.unescape(html);
+ },
+ postFromObject: function(data, boardID, suppressThumb) {
+ var o;
+ o = Build.parseJSON(data, boardID);
+ return Build.post(o, suppressThumb);
+ },
+ post: function(o, suppressThumb) {
+ var boardID, capcode, capcodeDescription, capcodeLC, capcodeLong, capcodePlural, commentHTML, container, dateText, dateUTC, email, file, fileBlock, fileThumb, fileURL, flag, flagCode, gifIcon, href, i, len, match, name, postClass, postID, postInfo, postLink, protocol, quote, quoteLink, ref, ref1, shortFilename, staticPath, subject, threadID, tripcode, uniqueID, wholePost;
+ postID = o.postID, threadID = o.threadID, boardID = o.boardID, file = o.file;
+ ref = o.info, subject = ref.subject, email = ref.email, name = ref.name, tripcode = ref.tripcode, capcode = ref.capcode, uniqueID = ref.uniqueID, flagCode = ref.flagCode, flag = ref.flag, dateUTC = ref.dateUTC, dateText = ref.dateText, commentHTML = ref.commentHTML;
+ staticPath = Build.staticPath, gifIcon = Build.gifIcon;
+
+ /* Post Info */
+ if (capcode) {
+ capcodeLC = capcode.toLowerCase();
+ if (capcode === 'Founder') {
+ capcodePlural = 'the Founder';
+ capcodeDescription = "4chan's Founder";
+ } else {
+ capcodeLong = {
+ 'Admin': 'Administrator',
+ 'Mod': 'Moderator'
+ }[capcode] || capcode;
+ capcodePlural = capcodeLong + "s";
+ capcodeDescription = "a 4chan " + capcodeLong;
+ }
+ }
+ postLink = Build.postURL(boardID, threadID, postID);
+ quoteLink = Build.sameThread(boardID, threadID) ? "javascript:quote('" + (+postID) + "');" : "/" + boardID + "/thread/" + threadID + "#q" + postID;
+ postInfo = {
+ innerHTML: ""
+ };
+
+ /* File Info */
+ if (file) {
+ protocol = /^https?:(?=\/\/i\.4cdn\.org\/)/;
+ fileURL = file.url.replace(protocol, '');
+ shortFilename = Build.shortFilename(file.name);
+ fileThumb = file.isSpoiler ? Build.spoilerThumb(boardID) : file.thumbURL.replace(protocol, '');
+ }
+ fileBlock = {
+ innerHTML: ((file) ? "" : ((o.fileDeleted) ? "" : ""))
+ };
+
+ /* Whole Post */
+ postClass = o.isReply ? 'reply' : 'op';
+ wholePost = {
+ innerHTML: ((o.isReply) ? ">>
" : "") + "" + ((o.isReply) ? (postInfo).innerHTML + (fileBlock).innerHTML : (fileBlock).innerHTML + (postInfo).innerHTML) + "
" + (commentHTML).innerHTML + " "
+ };
+ container = $.el('div', {
+ className: "postContainer " + postClass + "Container",
+ id: "pc" + postID
+ });
+ $.extend(container, wholePost);
+ ref1 = $$('.quotelink', container);
+ for (i = 0, len = ref1.length; i < len; i++) {
+ quote = ref1[i];
+ href = quote.getAttribute('href');
+ if ((href[0] === '#') && !(Build.sameThread(boardID, threadID))) {
+ quote.href = ("/" + boardID + "/thread/" + threadID) + href;
+ } else if ((match = href.match(/^\/([^\/]+)\/thread\/(\d+)/)) && (Build.sameThread(match[1], match[2]))) {
+ quote.href = href.match(/(#[^#]*)?$/)[0] || '#';
+ } else if (/^\d+(#|$)/.test(href) && !(g.VIEW === 'thread' && g.BOARD.ID === boardID)) {
+ quote.href = "/" + boardID + "/thread/" + href;
+ }
+ }
+ return container;
+ },
+ summaryText: function(status, posts, files) {
+ var text;
+ text = '';
+ if (status) {
+ text += status + " ";
+ }
+ text += posts + " post" + (posts > 1 ? 's' : '');
+ if (+files) {
+ text += " and " + files + " image repl" + (files > 1 ? 'ies' : 'y');
+ }
+ return text += " " + (status === '-' ? 'shown' : 'omitted') + ".";
+ },
+ summary: function(boardID, threadID, posts, files) {
+ return $.el('a', {
+ className: 'summary',
+ textContent: Build.summaryText('', posts, files),
+ href: "/" + boardID + "/thread/" + threadID
+ });
+ },
+ thread: function(board, data, full) {
+ var OP, root;
+ Build.spoilerRange[board] = data.custom_spoiler;
+ if (OP = board.posts[data.no]) {
+ if (OP.isFetchedQuote) {
+ OP = null;
+ }
+ }
+ if (OP && (root = OP.nodes.root.parentNode)) {
+ $.rmAll(root);
+ } else {
+ root = $.el('div', {
+ className: 'thread',
+ id: "t" + data.no
+ });
+ }
+ $.add(root, Build[full ? 'fullThread' : 'excerptThread'](board, data, OP));
+ return root;
+ },
+ excerptThread: function(board, data, OP) {
+ var files, nodes, posts, ref;
+ nodes = [OP ? OP.nodes.root : Build.postFromObject(data, board.ID, true)];
+ if (data.omitted_posts || !Conf['Show Replies'] && data.replies) {
+ ref = Conf['Show Replies'] ? [
+ data.omitted_posts, data.images - data.last_replies.filter(function(data) {
+ return !!data.ext;
+ }).length
+ ] : [data.replies, data.images], posts = ref[0], files = ref[1];
+ nodes.push(Build.summary(board.ID, data.no, posts, files));
+ }
+ return nodes;
+ },
+ fullThread: function(board, data) {
+ return Build.postFromObject(data, board.ID);
+ },
+ catalogThread: function(thread) {
+ var br, cc, comment, data, exif, fileCount, gifIcon, href, i, imgClass, j, k, l, len, len1, len2, len3, pageCount, postCount, pp, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath;
+ staticPath = Build.staticPath, gifIcon = Build.gifIcon;
+ data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)];
+ if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) {
+ src = staticPath + "spoiler";
+ if (spoilerRange = Build.spoilerRange[thread.board]) {
+ src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random());
+ }
+ src += '.png';
+ imgClass = 'spoiler-file';
+ } else if (data.filedeleted) {
+ src = staticPath + "filedeleted-res" + gifIcon;
+ imgClass = 'deleted-file';
+ } else if (thread.OP.file) {
+ src = thread.OP.file.thumbURL;
+ } else {
+ src = staticPath + "nofile.png";
+ imgClass = 'no-file';
+ }
+ postCount = data.replies + 1;
+ fileCount = data.images + !!data.ext;
+ pageCount = Math.floor(Index.liveThreadIDs.indexOf(thread.ID) / Index.threadsNumPerPage) + 1;
+ comment = {
+ innerHTML: data.com || ''
+ };
+ root = $.el('div', {
+ className: 'catalog-thread'
+ });
+ $.extend(root, {
+ innerHTML: "" + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "
" + ((thread.OP.info.subject) ? "" + E(thread.OP.info.subject) + "
" : "") + ""
+ });
+ root.dataset.fullID = thread.fullID;
+ if (thread.OP.highlights) {
+ $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights)));
+ }
+ ref = $$('.quotelink', root.lastElementChild);
+ for (i = 0, len = ref.length; i < len; i++) {
+ quote = ref[i];
+ href = quote.getAttribute('href');
+ if (href[0] === '#') {
+ quote.href = ("/" + thread.board + "/thread/" + thread.ID) + href;
+ }
+ }
+ ref1 = $$('.abbr, .exif', root.lastElementChild);
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ exif = ref1[j];
+ $.rm(exif);
+ }
+ ref2 = $$('.prettyprint', root.lastElementChild);
+ for (k = 0, len2 = ref2.length; k < len2; k++) {
+ pp = ref2[k];
+ cc = $.el('span', {
+ className: 'catalog-code'
+ });
+ $.add(cc, slice.call(pp.childNodes));
+ $.replace(pp, cc);
+ }
+ ref3 = $$('br', root.lastElementChild);
+ for (l = 0, len3 = ref3.length; l < len3; l++) {
+ br = ref3[l];
+ if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') {
+ $.rm(br);
+ }
+ }
+ if (thread.isSticky) {
+ $.add($('.catalog-icons', root), $.el('img', {
+ src: staticPath + "sticky" + gifIcon,
+ className: 'stickyIcon',
+ title: 'Sticky'
+ }));
+ }
+ if (thread.isClosed) {
+ $.add($('.catalog-icons', root), $.el('img', {
+ src: staticPath + "closed" + gifIcon,
+ className: 'closedIcon',
+ title: 'Closed'
+ }));
+ }
+ if (data.bumplimit) {
+ $.addClass($('.post-count', root), 'warning');
+ }
+ if (data.imagelimit) {
+ $.addClass($('.file-count', root), 'warning');
+ }
+ return root;
+ }
+ };
+
+ return Build;
+
+}).call(this);
+
+(function() {
+
+
+}).call(this);
+
+Get = (function() {
+ var Get,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Get = {
+ threadExcerpt: function(thread) {
+ var OP, excerpt, ref;
+ OP = thread.OP;
+ excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.commentDisplay.replace(/\n+/g, ' // ') || OP.info.nameBlock);
+ if (excerpt.length > 73) {
+ return excerpt.slice(0, 70) + "...";
+ }
+ return excerpt;
+ },
+ threadFromRoot: function(root) {
+ return g.threads[g.BOARD + "." + root.id.slice(1)];
+ },
+ threadFromNode: function(node) {
+ return Get.threadFromRoot($.x('ancestor::div[@class="thread"]', node));
+ },
+ postFromRoot: function(root) {
+ var index, post;
+ if (root == null) {
+ return null;
+ }
+ post = g.posts[root.dataset.fullID];
+ index = root.dataset.clone;
+ if (index) {
+ return post.clones[index];
+ } else {
+ return post;
+ }
+ },
+ postFromNode: function(root) {
+ return Get.postFromRoot($.x('(ancestor::div[contains(@class,"postContainer")][1]|following::div[contains(@class,"postContainer")][1])', root));
+ },
+ postDataFromLink: function(link) {
+ var boardID, path, postID, ref, threadID;
+ if (link.hostname === 'boards.4chan.org') {
+ path = link.pathname.split(/\/+/);
+ boardID = path[1];
+ threadID = path[3];
+ postID = link.hash.slice(2);
+ } else {
+ ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ threadID || (threadID = 0);
+ }
+ return {
+ boardID: boardID,
+ threadID: +threadID,
+ postID: +postID
+ };
+ },
+ allQuotelinksLinkingTo: function(post) {
+ var fullID, handleQuotes, i, len, posts, qPost, quote, quotelinks, ref;
+ quotelinks = [];
+ posts = g.posts;
+ fullID = post.fullID;
+ handleQuotes = function(qPost, type) {
+ var clone, i, len, ref;
+ quotelinks.push.apply(quotelinks, qPost.nodes[type]);
+ ref = qPost.clones;
+ for (i = 0, len = ref.length; i < len; i++) {
+ clone = ref[i];
+ quotelinks.push.apply(quotelinks, clone.nodes[type]);
+ }
+ };
+ posts.forEach(function(qPost) {
+ if (indexOf.call(qPost.quotes, fullID) >= 0) {
+ return handleQuotes(qPost, 'quotelinks');
+ }
+ });
+ if (Conf['Quote Backlinks']) {
+ ref = post.quotes;
+ for (i = 0, len = ref.length; i < len; i++) {
+ quote = ref[i];
+ if (qPost = posts[quote]) {
+ handleQuotes(qPost, 'backlinks');
+ }
+ }
+ }
+ return quotelinks.filter(function(quotelink) {
+ var boardID, postID, ref1;
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ return boardID === post.board.ID && postID === post.ID;
+ });
+ },
+ scriptData: function() {
+ var i, len, ref, script;
+ ref = $$('script:not([src])', d.head);
+ for (i = 0, len = ref.length; i < len; i++) {
+ script = ref[i];
+ if (/\bcooldowns *=/.test(script.textContent)) {
+ return script.textContent;
+ }
+ }
+ return '';
+ }
+ };
+
+ return Get;
+
+}).call(this);
+
+Header = (function() {
+ var Header;
+
+ Header = {
+ init: function() {
+ var barFixedToggler, barPositionToggler, box, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler;
+ this.menu = new UI.Menu('header');
+ menuButton = $.el('span', {
+ className: 'menu-button'
+ });
+ $.extend(menuButton, {
+ innerHTML: " "
+ });
+ box = UI.checkbox;
+ barFixedToggler = box('Fixed Header', 'Fixed Header');
+ headerToggler = box('Header auto-hide', 'Auto-hide header');
+ scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll');
+ barPositionToggler = box('Bottom Header', 'Bottom header');
+ linkJustifyToggler = box('Centered links', 'Centered links');
+ customNavToggler = box('Custom Board Navigation', 'Custom board navigation');
+ footerToggler = box('Bottom Board List', 'Hide bottom board list');
+ shortcutToggler = box('Shortcut Icons', 'Shortcut Icons');
+ editCustomNav = $.el('a', {
+ textContent: 'Edit custom board navigation',
+ href: 'javascript:;'
+ });
+ this.barFixedToggler = barFixedToggler.firstElementChild;
+ this.scrollHeaderToggler = scrollHeaderToggler.firstElementChild;
+ this.barPositionToggler = barPositionToggler.firstElementChild;
+ this.linkJustifyToggler = linkJustifyToggler.firstElementChild;
+ this.headerToggler = headerToggler.firstElementChild;
+ this.footerToggler = footerToggler.firstElementChild;
+ this.shortcutToggler = shortcutToggler.firstElementChild;
+ this.customNavToggler = customNavToggler.firstElementChild;
+ $.on(menuButton, 'click', this.menuToggle);
+ $.on(this.headerToggler, 'change', this.toggleBarVisibility);
+ $.on(this.barFixedToggler, 'change', this.toggleBarFixed);
+ $.on(this.barPositionToggler, 'change', this.toggleBarPosition);
+ $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll);
+ $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify);
+ $.on(this.footerToggler, 'change', this.toggleFooterVisibility);
+ $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons);
+ $.on(this.customNavToggler, 'change', this.toggleCustomNav);
+ $.on(editCustomNav, 'click', this.editCustomNav);
+ this.setBarFixed(Conf['Fixed Header']);
+ this.setHideBarOnScroll(Conf['Header auto-hide on scroll']);
+ this.setBarVisibility(Conf['Header auto-hide']);
+ this.setLinkJustify(Conf['Centered links']);
+ this.setShortcutIcons(Conf['Shortcut Icons']);
+ this.setFooterVisibility(Conf['Bottom Board List']);
+ $.sync('Fixed Header', this.setBarFixed);
+ $.sync('Header auto-hide on scroll', this.setHideBarOnScroll);
+ $.sync('Bottom Header', this.setBarPosition);
+ $.sync('Shortcut Icons', this.setShortcutIcons);
+ $.sync('Header auto-hide', this.setBarVisibility);
+ $.sync('Centered links', this.setLinkJustify);
+ $.sync('Bottom Board List', this.setFooterVisibility);
+ this.addShortcut(menuButton);
+ this.menu.addEntry({
+ el: $.el('span', {
+ textContent: 'Header'
+ }),
+ order: 107,
+ subEntries: [
+ {
+ el: barFixedToggler
+ }, {
+ el: headerToggler
+ }, {
+ el: scrollHeaderToggler
+ }, {
+ el: barPositionToggler
+ }, {
+ el: linkJustifyToggler
+ }, {
+ el: footerToggler
+ }, {
+ el: shortcutToggler
+ }, {
+ el: customNavToggler
+ }, {
+ el: editCustomNav
+ }
+ ]
+ });
+ $.on(window, 'load popstate', Header.hashScroll);
+ $.on(d, 'CreateNotification', this.createNotification);
+ $.asap((function() {
+ return d.body;
+ }), (function(_this) {
+ return function() {
+ if (!Main.isThisPageLegit()) {
+ return;
+ }
+ $.asap((function() {
+ return $.id('boardNavMobile') || d.readyState !== 'loading';
+ }), function() {
+ var a, footer;
+ footer = $.id('boardNavDesktop').cloneNode(true);
+ footer.id = 'boardNavDesktopFoot';
+ $('#navtopright', footer).id = 'navbotright';
+ $('#settingsWindowLink', footer).id = 'settingsWindowLinkBot';
+ Header.bottomBoardList = $('.boardList', footer);
+ if (a = $("a[href*='/" + g.BOARD + "/']", footer)) {
+ a.className = 'current';
+ }
+ Main.ready(function() {
+ var absbot, oldFooter;
+ if ((oldFooter = $.id('boardNavDesktopFoot'))) {
+ return $.replace($('.boardList', oldFooter), Header.bottomBoardList);
+ } else if ((absbot = $.id('absbot'))) {
+ $.before(absbot, footer);
+ return $.globalEval('window.cloneTopNav = function() {};');
+ }
+ });
+ return Header.setBoardList();
+ });
+ $.prepend(d.body, _this.bar);
+ $.add(d.body, Header.hover);
+ _this.setBarPosition(Conf['Bottom Header']);
+ return _this;
+ };
+ })(this));
+ Main.ready((function(_this) {
+ return function() {
+ var cs;
+ if (g.VIEW === 'catalog' || !Conf['Disable Native Extension']) {
+ cs = $.el('a', {
+ href: 'javascript:;'
+ });
+ if (g.VIEW === 'catalog') {
+ cs.title = cs.textContent = 'Catalog Settings';
+ cs.className = 'fa fa-book';
+ } else {
+ cs.title = cs.textContent = '4chan Settings';
+ cs.className = 'fa fa-leaf';
+ }
+ $.on(cs, 'click', function() {
+ return $.id('settingsWindowLink').click();
+ });
+ return _this.addShortcut(cs);
+ }
+ };
+ })(this));
+ return this.enableDesktopNotifications();
+ },
+ bar: $.el('div', {
+ id: 'header-bar'
+ }),
+ noticesRoot: $.el('div', {
+ id: 'notifications'
+ }),
+ shortcuts: $.el('span', {
+ id: 'shortcuts'
+ }),
+ hover: $.el('div', {
+ id: 'hoverUI'
+ }),
+ toggle: $.el('div', {
+ id: 'scroll-marker'
+ }),
+ setBoardList: function() {
+ var a, boardList, btn, chr, i, j, len, len1, node, nodes, ref, ref1, spacer, span;
+ Header.boardList = boardList = $.el('span', {
+ id: 'board-list'
+ });
+ $.extend(boardList, {
+ innerHTML: " - "
+ });
+ btn = $('.hide-board-list-button', boardList);
+ $.on(btn, 'click', Header.toggleBoardList);
+ nodes = [];
+ spacer = function() {
+ return $.el('span', {
+ className: 'spacer'
+ });
+ };
+ ref = $('#boardNavDesktop > .boardList').childNodes;
+ for (i = 0, len = ref.length; i < len; i++) {
+ node = ref[i];
+ switch (node.nodeName) {
+ case '#text':
+ ref1 = node.nodeValue;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ chr = ref1[j];
+ span = $.el('span', {
+ textContent: chr
+ });
+ if (chr === ' ') {
+ span.className = 'space';
+ }
+ if (chr === ']') {
+ nodes.push(spacer());
+ }
+ nodes.push(span);
+ if (chr === '[') {
+ nodes.push(spacer());
+ }
+ }
+ break;
+ case 'A':
+ a = node.cloneNode(true);
+ if (a.pathname.split('/')[1] === g.BOARD.ID) {
+ a.className = 'current';
+ }
+ nodes.push(a);
+ }
+ }
+ $.add($('.boardList', boardList), nodes);
+ $.add(Header.bar, [Header.boardList, Header.shortcuts, Header.noticesRoot, Header.toggle]);
+ Header.setCustomNav(Conf['Custom Board Navigation']);
+ Header.generateBoardList(Conf['boardnav']);
+ $.sync('Custom Board Navigation', Header.setCustomNav);
+ return $.sync('boardnav', Header.generateBoardList);
+ },
+ generateBoardList: function(boardnav) {
+ var as, list, nodes, re, t;
+ list = $('#custom-board-list', Header.boardList);
+ $.rmAll(list);
+ if (!boardnav) {
+ return;
+ }
+ boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' ');
+ as = $$('#full-board-list a[title]', Header.boardList);
+ re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
+ nodes = (function() {
+ var i, len, ref, results;
+ ref = boardnav.match(re);
+ results = [];
+ for (i = 0, len = ref.length; i < len; i++) {
+ t = ref[i];
+ results.push(Header.mapCustomNavigation(t, as));
+ }
+ return results;
+ })();
+ $.add(list, nodes);
+ return $.ready(CatalogLinks.initBoardList);
+ },
+ mapCustomNavigation: function(t, as) {
+ var a, boardID, href, indexOptions, m, text, url;
+ if (/^[^\w@]/.test(t)) {
+ return $.tn(t);
+ }
+ text = url = null;
+ t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) {
+ text = m1;
+ url = m2;
+ return '';
+ });
+ indexOptions = [];
+ t = t.replace(/-(?:mode|sort):"([^"]+)"/g, function(m0, m1) {
+ indexOptions.push(m1.toLowerCase().replace(/\ /g, '-'));
+ return '';
+ });
+ indexOptions = indexOptions.join('/');
+ if (/^toggle-all/.test(t)) {
+ a = $.el('a', {
+ className: 'show-board-list-button',
+ textContent: text || '+',
+ href: 'javascript:;'
+ });
+ $.on(a, 'click', Header.toggleBoardList);
+ return a;
+ }
+ if (/^external/.test(t)) {
+ a = $.el('a', {
+ href: url || 'javascript:;',
+ textContent: text || '+',
+ className: 'external'
+ });
+ return a;
+ }
+ boardID = t.split('-')[0];
+ if (boardID === 'current') {
+ boardID = g.BOARD.ID;
+ }
+ a = (function() {
+ var i, len, ref;
+ if (boardID === '@') {
+ return $.el('a', {
+ href: 'https://twitter.com/4chan',
+ title: '4chan Twitter',
+ textContent: '@'
+ });
+ }
+ for (i = 0, len = as.length; i < len; i++) {
+ a = as[i];
+ if (a.textContent === boardID) {
+ return a.cloneNode(true);
+ }
+ }
+ a = $.el('a', {
+ href: "/" + boardID + "/",
+ textContent: boardID
+ });
+ if ((ref = g.VIEW) === 'catalog' || ref === 'archive') {
+ a.href += g.VIEW;
+ }
+ if (boardID === g.BOARD.ID) {
+ a.className = 'current';
+ }
+ return a;
+ })();
+ a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID;
+ if (m = t.match(/-(index|catalog)/)) {
+ if (!(boardID === 'f' && m[1] === 'catalog')) {
+ a.dataset.only = m[1];
+ a.href = CatalogLinks[m[1]](boardID);
+ if (m[1] === 'catalog') {
+ $.addClass(a, 'catalog');
+ }
+ } else {
+ return a.firstChild;
+ }
+ }
+ if (Conf['JSON Index'] && indexOptions) {
+ a.dataset.indexOptions = indexOptions;
+ if (a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
+ a.href += (a.hash ? '/' : '#') + indexOptions;
+ }
+ }
+ if (/-archive/.test(t)) {
+ if (href = Redirect.to('board', {
+ boardID: boardID
+ })) {
+ a.href = href;
+ } else {
+ return a.firstChild;
+ }
+ }
+ if (/-expired/.test(t)) {
+ if (boardID !== 'b' && boardID !== 'f' && boardID !== 'trash') {
+ a.href = "/" + boardID + "/archive";
+ } else {
+ return a.firstChild;
+ }
+ }
+ if (boardID === '@') {
+ $.addClass(a, 'navSmall');
+ }
+ return a;
+ },
+ toggleBoardList: function() {
+ var bar, custom, full, showBoardList;
+ bar = Header.bar;
+ custom = $('#custom-board-list', bar);
+ full = $('#full-board-list', bar);
+ showBoardList = !full.hidden;
+ custom.hidden = !showBoardList;
+ return full.hidden = showBoardList;
+ },
+ setLinkJustify: function(centered) {
+ Header.linkJustifyToggler.checked = centered;
+ if (centered) {
+ return $.addClass(doc, 'centered-links');
+ } else {
+ return $.rmClass(doc, 'centered-links');
+ }
+ },
+ toggleLinkJustify: function() {
+ var centered;
+ $.event('CloseMenu');
+ centered = this.nodeName === 'INPUT' ? this.checked : void 0;
+ Header.setLinkJustify(centered);
+ return $.set('Centered links', centered);
+ },
+ setBarFixed: function(fixed) {
+ Header.barFixedToggler.checked = fixed;
+ if (fixed) {
+ $.addClass(doc, 'fixed');
+ return $.addClass(Header.bar, 'dialog');
+ } else {
+ $.rmClass(doc, 'fixed');
+ return $.rmClass(Header.bar, 'dialog');
+ }
+ },
+ toggleBarFixed: function() {
+ $.event('CloseMenu');
+ Header.setBarFixed(this.checked);
+ Conf['Fixed Header'] = this.checked;
+ return $.set('Fixed Header', this.checked);
+ },
+ setShortcutIcons: function(show) {
+ Header.shortcutToggler.checked = show;
+ if (show) {
+ return $.addClass(doc, 'shortcut-icons');
+ } else {
+ return $.rmClass(doc, 'shortcut-icons');
+ }
+ },
+ toggleShortcutIcons: function() {
+ $.event('CloseMenu');
+ Header.setShortcutIcons(this.checked);
+ Conf['Shortcut Icons'] = this.checked;
+ return $.set('Shortcut Icons', this.checked);
+ },
+ setBarVisibility: function(hide) {
+ Header.headerToggler.checked = hide;
+ $.event('CloseMenu');
+ (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide');
+ return (hide ? $.addClass : $.rmClass)(doc, 'autohide');
+ },
+ toggleBarVisibility: function() {
+ var hide, message;
+ hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
+ Conf['Header auto-hide'] = hide;
+ $.set('Header auto-hide', hide);
+ Header.setBarVisibility(hide);
+ message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.');
+ return new Notice('info', message, 2);
+ },
+ setHideBarOnScroll: function(hide) {
+ Header.scrollHeaderToggler.checked = hide;
+ if (hide) {
+ $.on(window, 'scroll', Header.hideBarOnScroll);
+ return;
+ }
+ $.off(window, 'scroll', Header.hideBarOnScroll);
+ $.rmClass(Header.bar, 'scroll');
+ if (!Conf['Header auto-hide']) {
+ return $.rmClass(Header.bar, 'autohide');
+ }
+ },
+ toggleHideBarOnScroll: function() {
+ var hide;
+ hide = this.checked;
+ $.cb.checked.call(this);
+ return Header.setHideBarOnScroll(hide);
+ },
+ hideBarOnScroll: function() {
+ var offsetY;
+ offsetY = window.pageYOffset;
+ if (offsetY > (Header.previousOffset || 0)) {
+ $.addClass(Header.bar, 'autohide', 'scroll');
+ } else {
+ $.rmClass(Header.bar, 'autohide', 'scroll');
+ }
+ return Header.previousOffset = offsetY;
+ },
+ setBarPosition: function(bottom) {
+ var args;
+ Header.barPositionToggler.checked = bottom;
+ $.event('CloseMenu');
+ args = bottom ? ['bottom-header', 'top-header', 'after'] : ['top-header', 'bottom-header', 'add'];
+ $.addClass(doc, args[0]);
+ $.rmClass(doc, args[1]);
+ return $[args[2]](Header.bar, Header.noticesRoot);
+ },
+ toggleBarPosition: function() {
+ $.cb.checked.call(this);
+ return Header.setBarPosition(this.checked);
+ },
+ setFooterVisibility: function(hide) {
+ Header.footerToggler.checked = hide;
+ return doc.classList.toggle('hide-bottom-board-list', hide);
+ },
+ toggleFooterVisibility: function() {
+ var hide, message;
+ $.event('CloseMenu');
+ hide = this.nodeName === 'INPUT' ? this.checked : $.hasClass(doc, 'hide-bottom-board-list');
+ Header.setFooterVisibility(hide);
+ $.set('Bottom Board List', hide);
+ message = hide ? 'The bottom navigation will now be hidden.' : 'The bottom navigation will remain visible.';
+ return new Notice('info', message, 2);
+ },
+ setCustomNav: function(show) {
+ var btn, cust, full, ref;
+ Header.customNavToggler.checked = show;
+ cust = $('#custom-board-list', Header.bar);
+ full = $('#full-board-list', Header.bar);
+ btn = $('.hide-board-list-container', full);
+ return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref;
+ },
+ toggleCustomNav: function() {
+ $.cb.checked.call(this);
+ return Header.setCustomNav(this.checked);
+ },
+ editCustomNav: function() {
+ var settings;
+ Settings.open('Advanced');
+ settings = $.id('fourchanx-settings');
+ return $('[name=boardnav]', settings).focus();
+ },
+ hashScroll: function(e) {
+ var el, hash;
+ if (e) {
+ if (e.state) {
+ return;
+ }
+ if (!history.state) {
+ history.replaceState({}, '');
+ }
+ }
+ if ((hash = location.hash.slice(1))) {
+ ReplyPruning.showIfHidden(hash);
+ if ((el = $.id(hash))) {
+ return $.queueTask(function() {
+ return Header.scrollTo(el);
+ });
+ }
+ }
+ },
+ scrollTo: function(root, down, needed) {
+ var height, x;
+ if (!root.offsetParent) {
+ return;
+ }
+ if (down) {
+ x = Header.getBottomOf(root);
+ if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && Conf['Bottom header']) {
+ height = Header.bar.getBoundingClientRect().height;
+ if (x <= 0) {
+ if (!Header.isHidden()) {
+ x += height;
+ }
+ } else {
+ if (Header.isHidden()) {
+ x -= height;
+ }
+ }
+ }
+ if (!(needed && x >= 0)) {
+ return window.scrollBy(0, -x);
+ }
+ } else {
+ x = Header.getTopOf(root);
+ if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && !Conf['Bottom header']) {
+ height = Header.bar.getBoundingClientRect().height;
+ if (x >= 0) {
+ if (!Header.isHidden()) {
+ x += height;
+ }
+ } else {
+ if (Header.isHidden()) {
+ x -= height;
+ }
+ }
+ }
+ if (!(needed && x >= 0)) {
+ return window.scrollBy(0, x);
+ }
+ }
+ },
+ scrollToIfNeeded: function(root, down) {
+ return Header.scrollTo(root, down, true);
+ },
+ getTopOf: function(root) {
+ var headRect, top;
+ top = root.getBoundingClientRect().top;
+ if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
+ headRect = Header.toggle.getBoundingClientRect();
+ top -= headRect.top + headRect.height;
+ }
+ return top;
+ },
+ getBottomOf: function(root) {
+ var bottom, clientHeight, headRect;
+ clientHeight = doc.clientHeight;
+ bottom = clientHeight - root.getBoundingClientRect().bottom;
+ if (Conf['Fixed Header'] && Conf['Bottom Header']) {
+ headRect = Header.toggle.getBoundingClientRect();
+ bottom -= clientHeight - headRect.bottom + headRect.height;
+ }
+ return bottom;
+ },
+ isNodeVisible: function(node) {
+ var height;
+ if (d.hidden || !doc.contains(node)) {
+ return false;
+ }
+ height = node.getBoundingClientRect().height;
+ return Header.getTopOf(node) + height >= 0 && Header.getBottomOf(node) + height >= 0;
+ },
+ isHidden: function() {
+ var top;
+ top = Header.bar.getBoundingClientRect().top;
+ if (Conf['Bottom header']) {
+ return top === doc.clientHeight;
+ } else {
+ return top < 0;
+ }
+ },
+ addShortcut: function(el) {
+ var shortcut;
+ shortcut = $.el('span', {
+ className: 'shortcut brackets-wrap'
+ });
+ $.add(shortcut, el);
+ return $.prepend(Header.shortcuts, shortcut);
+ },
+ rmShortcut: function(el) {
+ return $.rm(el.parentElement);
+ },
+ menuToggle: function(e) {
+ return Header.menu.toggle(e, this, g);
+ },
+ createNotification: function(e) {
+ var content, lifetime, notice, ref, type;
+ ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime;
+ return notice = new Notice(type, content, lifetime);
+ },
+ areNotificationsEnabled: false,
+ enableDesktopNotifications: function() {
+ var authorize, disable, el, notice, ref;
+ if (!(window.Notification && Conf['Desktop Notifications'])) {
+ return;
+ }
+ switch (Notification.permission) {
+ case 'granted':
+ Header.areNotificationsEnabled = true;
+ return;
+ case 'denied':
+ return;
+ }
+ el = $.el('span', {
+ innerHTML: "4chan X needs your permission to show desktop notifications. [FAQ ]Authorize or Disable "
+ });
+ ref = $$('button', el), authorize = ref[0], disable = ref[1];
+ $.on(authorize, 'click', function() {
+ return Notification.requestPermission(function(status) {
+ Header.areNotificationsEnabled = status === 'granted';
+ if (status === 'default') {
+ return;
+ }
+ return notice.close();
+ });
+ });
+ $.on(disable, 'click', function() {
+ $.set('Desktop Notifications', false);
+ return notice.close();
+ });
+ return notice = new Notice('info', el);
+ }
+ };
+
+ return Header;
+
+}).call(this);
+
+Index = (function() {
+ var Index,
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Index = {
+ showHiddenThreads: false,
+ changed: {},
+ init: function() {
+ var anchorEntry, input, j, k, label, len, len1, name, pinEntry, ref, ref1, ref2, ref3, ref4, ref5, ref6, refNavEntry, repliesEntry, select, sortEntry;
+ if (g.BOARD.ID === 'f' || !Conf['JSON Index'] || g.VIEW !== 'index') {
+ return;
+ }
+ Callbacks.CatalogThread.push({
+ name: 'Catalog Features',
+ cb: this.catalogNode
+ });
+ this.search = ((ref = history.state) != null ? ref.searched : void 0) || '';
+ if ((ref1 = history.state) != null ? ref1.mode : void 0) {
+ Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0;
+ }
+ this.currentSort = (ref3 = history.state) != null ? ref3.sort : void 0;
+ this.currentSort || (this.currentSort = typeof Conf['Index Sort'] === 'object' ? Conf['Index Sort'][g.BOARD.ID] || 'bump' : Conf['Index Sort']);
+ this.currentPage = this.getCurrentPage();
+ this.processHash();
+ $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode");
+ $.on(window, 'popstate', this.cb.popstate);
+ $.on(d, 'scroll', Index.scroll);
+ this.button = $.el('a', {
+ className: 'index-refresh-shortcut fa fa-refresh',
+ title: 'Refresh',
+ href: 'javascript:;',
+ textContent: 'Refresh Index'
+ });
+ $.on(this.button, 'click', function() {
+ return Index.update();
+ });
+ Header.addShortcut(this.button, 1);
+ repliesEntry = {
+ el: UI.checkbox('Show Replies', 'Show replies')
+ };
+ sortEntry = {
+ el: UI.checkbox('Per-Board Sort Type', 'Per-board sort type', typeof Conf['Index Sort'] === 'object')
+ };
+ pinEntry = {
+ el: UI.checkbox('Pin Watched Threads', 'Pin watched threads')
+ };
+ anchorEntry = {
+ el: UI.checkbox('Anchor Hidden Threads', 'Anchor hidden threads')
+ };
+ refNavEntry = {
+ el: UI.checkbox('Refreshed Navigation', 'Refreshed navigation')
+ };
+ sortEntry.el.title = 'Set the sorting order of each board independently.';
+ pinEntry.el.title = 'Move watched threads to the start of the index.';
+ anchorEntry.el.title = 'Move hidden threads to the end of the index.';
+ refNavEntry.el.title = 'Refresh index when navigating through pages.';
+ ref4 = [repliesEntry, pinEntry, anchorEntry, refNavEntry];
+ for (j = 0, len = ref4.length; j < len; j++) {
+ label = ref4[j];
+ input = label.el.firstChild;
+ name = input.name;
+ $.on(input, 'change', $.cb.checked);
+ switch (name) {
+ case 'Show Replies':
+ $.on(input, 'change', this.cb.replies);
+ break;
+ case 'Pin Watched Threads':
+ case 'Anchor Hidden Threads':
+ $.on(input, 'change', this.cb.resort);
+ }
+ }
+ $.on(sortEntry.el.firstChild, 'change', this.cb.perBoardSort);
+ Header.menu.addEntry({
+ el: $.el('span', {
+ textContent: 'Index Navigation'
+ }),
+ order: 100,
+ subEntries: [repliesEntry, sortEntry, pinEntry, anchorEntry, refNavEntry]
+ });
+ this.navLinks = $.el('div', {
+ className: 'navLinks json-index'
+ });
+ $.extend(this.navLinks, {
+ innerHTML: "Index Catalog Archive Bottom ... × — [Show ] Index Mode Paged Infinite scrolling All threads Catalog Index Sort Bump order Last reply Last long reply Creation date Reply count File count Image Size Small Large "
+ });
+ $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog();
+ if ((ref5 = g.BOARD.ID) === 'b' || ref5 === 'trash') {
+ $('.archlistlink', this.navLinks).hidden = true;
+ }
+ $.on($('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront);
+ this.searchInput = $('#index-search', this.navLinks);
+ this.setupSearch();
+ $.on(this.searchInput, 'input', this.onSearchInput);
+ $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
+ this.hideLabel = $('#hidden-label', this.navLinks);
+ $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
+ this.selectMode = $('#index-mode', this.navLinks);
+ this.selectSort = $('#index-sort', this.navLinks);
+ this.selectSize = $('#index-size', this.navLinks);
+ $.on(this.selectMode, 'change', this.cb.mode);
+ $.on(this.selectSort, 'change', this.cb.sort);
+ $.on(this.selectSize, 'change', $.cb.value);
+ $.on(this.selectSize, 'change', this.cb.size);
+ ref6 = [this.selectMode, this.selectSize];
+ for (k = 0, len1 = ref6.length; k < len1; k++) {
+ select = ref6[k];
+ select.value = Conf[select.name];
+ }
+ this.selectSort.value = Index.currentSort;
+ this.root = $.el('div', {
+ className: 'board json-index'
+ });
+ this.cb.size();
+ this.pagelist = $.el('div', {
+ className: 'pagelist json-index'
+ });
+ $.extend(this.pagelist, {
+ innerHTML: "
"
+ });
+ $('.cataloglink a', this.pagelist).href = CatalogLinks.catalog();
+ $.on(this.pagelist, 'click', this.cb.pageNav);
+ this.update(true);
+ $.onExists(doc, 'title + *', function() {
+ return d.title = d.title.replace(/\ -\ Page\ \d+/, '');
+ });
+ $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() {
+ var board, el, l, len2, len3, m, ref7, ref8, threadRoot, topNavPos;
+ Index.hat = $('.board > .thread > img:first-child');
+ if (Index.hat) {
+ if (Index.nodes) {
+ ref7 = Index.nodes;
+ for (l = 0, len2 = ref7.length; l < len2; l++) {
+ threadRoot = ref7[l];
+ $.prepend(threadRoot, Index.hat.cloneNode(false));
+ }
+ }
+ $.addClass(doc, 'hats-enabled');
+ $.addStyle(".catalog-thread::after {background-image: url(" + Index.hat.src + ");}");
+ }
+ board = $('.board');
+ $.replace(board, Index.root);
+ $.event('PostsInserted');
+ try {
+ d.implementation.createDocument(null, null, null).appendChild(board);
+ } catch (_error) {}
+ ref8 = $$('.navLinks');
+ for (m = 0, len3 = ref8.length; m < len3; m++) {
+ el = ref8[m];
+ $.rm(el);
+ }
+ $.rm($.id('ctrl-top'));
+ topNavPos = $.id('delform').previousElementSibling;
+ $.before(topNavPos, $.el('hr'));
+ return $.before(topNavPos, Index.navLinks);
+ });
+ return Main.ready(function() {
+ var pagelist;
+ if ((pagelist = $('.pagelist'))) {
+ $.replace(pagelist, Index.pagelist);
+ }
+ return $.rmClass(doc, 'index-loading');
+ });
+ },
+ scroll: function() {
+ var nodes, pageNum;
+ if (Index.req || !Index.liveThreadData || Conf['Index Mode'] !== 'infinite' || (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight))) {
+ return;
+ }
+ if (Index.pageNum == null) {
+ Index.pageNum = Index.currentPage;
+ }
+ pageNum = ++Index.pageNum;
+ if (pageNum > Index.pagesNum) {
+ return Index.endNotice();
+ }
+ nodes = Index.buildSinglePage(pageNum);
+ if (Conf['Show Replies']) {
+ Index.buildReplies(nodes);
+ }
+ return Index.buildStructure(nodes);
+ },
+ endNotice: (function() {
+ var notify, reset;
+ notify = false;
+ reset = function() {
+ return notify = false;
+ };
+ return function() {
+ if (notify) {
+ return;
+ }
+ notify = true;
+ new Notice('info', "Last page reached.", 2);
+ return setTimeout(reset, 3 * $.SECOND);
+ };
+ })(),
+ menu: {
+ init: function() {
+ if (g.VIEW !== 'index' || !Conf['JSON Index'] || !Conf['Menu'] || !Conf['Thread Hiding Link'] || g.BOARD.ID === 'f') {
+ return;
+ }
+ return Menu.menu.addEntry({
+ el: $.el('a', {
+ href: 'javascript:;',
+ className: 'has-shortcut-text'
+ }, {
+ innerHTML: "Shift+click "
+ }),
+ order: 20,
+ open: function(arg) {
+ var thread;
+ thread = arg.thread;
+ if (Conf['Index Mode'] !== 'catalog') {
+ return false;
+ }
+ this.el.firstElementChild.textContent = thread.isHidden ? 'Unhide' : 'Hide';
+ if (this.cb) {
+ $.off(this.el, 'click', this.cb);
+ }
+ this.cb = function() {
+ $.event('CloseMenu');
+ return Index.toggleHide(thread);
+ };
+ $.on(this.el, 'click', this.cb);
+ return true;
+ }
+ });
+ }
+ },
+ catalogNode: function() {
+ return $.on(this.nodes.thumb.parentNode, 'click', Index.onClick);
+ },
+ onClick: function(e) {
+ var thread;
+ if (e.button !== 0) {
+ return;
+ }
+ thread = g.threads[this.parentNode.dataset.fullID];
+ if (e.shiftKey) {
+ Index.toggleHide(thread);
+ } else {
+ return;
+ }
+ return e.preventDefault();
+ },
+ toggleHide: function(thread) {
+ $.rm(thread.catalogView.nodes.root);
+ if (Index.showHiddenThreads) {
+ ThreadHiding.show(thread);
+ if (!ThreadHiding.db.get({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ })) {
+ return;
+ }
+ } else {
+ ThreadHiding.hide(thread);
+ }
+ return ThreadHiding.saveHiddenState(thread);
+ },
+ cycleSortType: function() {
+ var i, j, len, type, types;
+ types = slice.call(Index.selectSort.options).filter(function(option) {
+ return !option.disabled;
+ });
+ for (i = j = 0, len = types.length; j < len; i = ++j) {
+ type = types[i];
+ if (type.selected) {
+ break;
+ }
+ }
+ types[(i + 1) % types.length].selected = true;
+ return $.event('change', null, Index.selectSort);
+ },
+ cb: {
+ toggleHiddenThreads: function() {
+ $('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? 'Hide' : 'Show';
+ Index.sort();
+ return Index.buildIndex();
+ },
+ mode: function() {
+ Index.pushState({
+ mode: this.value
+ });
+ return Index.pageLoad(false);
+ },
+ sort: function() {
+ Index.pushState({
+ sort: this.value
+ });
+ return Index.pageLoad(false);
+ },
+ resort: function() {
+ Index.sort();
+ return Index.buildIndex();
+ },
+ perBoardSort: function() {
+ Conf['Index Sort'] = this.checked ? {} : '';
+ return Index.saveSort();
+ },
+ size: function(e) {
+ if (Conf['Index Mode'] !== 'catalog') {
+ $.rmClass(Index.root, 'catalog-small');
+ $.rmClass(Index.root, 'catalog-large');
+ } else if (Conf['Index Size'] === 'small') {
+ $.addClass(Index.root, 'catalog-small');
+ $.rmClass(Index.root, 'catalog-large');
+ } else {
+ $.addClass(Index.root, 'catalog-large');
+ $.rmClass(Index.root, 'catalog-small');
+ }
+ if (e) {
+ return Index.buildIndex();
+ }
+ },
+ replies: function() {
+ Index.buildThreads();
+ Index.sort();
+ return Index.buildIndex();
+ },
+ popstate: function(e) {
+ var mode, nCommands, page, ref, searched, sort;
+ if (e != null ? e.state : void 0) {
+ ref = e.state, searched = ref.searched, mode = ref.mode, sort = ref.sort;
+ page = Index.getCurrentPage();
+ Index.setState({
+ search: searched,
+ mode: mode,
+ sort: sort,
+ page: page
+ });
+ return Index.pageLoad(false);
+ } else {
+ nCommands = Index.processHash();
+ if (Conf['Refreshed Navigation'] && nCommands) {
+ return Index.update();
+ } else {
+ return Index.pageLoad();
+ }
+ }
+ },
+ pageNav: function(e) {
+ var a;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ switch (e.target.nodeName) {
+ case 'BUTTON':
+ e.target.blur();
+ a = e.target.parentNode;
+ break;
+ case 'A':
+ a = e.target;
+ break;
+ default:
+ return;
+ }
+ if (a.textContent === 'Catalog') {
+ return;
+ }
+ e.preventDefault();
+ return Index.userPageNav(+a.pathname.split(/\/+/)[2] || 1);
+ },
+ refreshFront: function() {
+ Index.pushState({
+ page: 1
+ });
+ return Index.update();
+ }
+ },
+ scrollToIndex: function() {
+ return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root));
+ },
+ getCurrentPage: function() {
+ return +window.location.pathname.split(/\/+/)[2] || 1;
+ },
+ userPageNav: function(page) {
+ Index.pushState({
+ page: page
+ });
+ if (Conf['Refreshed Navigation']) {
+ return Index.update();
+ } else {
+ return Index.pageLoad();
+ }
+ },
+ hashCommands: {
+ mode: {
+ 'paged': 'paged',
+ 'infinite-scrolling': 'infinite',
+ 'infinite': 'infinite',
+ 'all-threads': 'all pages',
+ 'all-pages': 'all pages',
+ 'catalog': 'catalog'
+ },
+ sort: {
+ 'bump-order': 'bump',
+ 'last-reply': 'lastreply',
+ 'last-long-reply': 'lastlong',
+ 'creation-date': 'birth',
+ 'reply-count': 'replycount',
+ 'file-count': 'filecount'
+ }
+ },
+ processHash: function() {
+ var command, commands, hash, j, leftover, len, mode, ref, sort, state;
+ hash = ((ref = location.href.match(/#.*/)) != null ? ref[0] : void 0) || '';
+ state = {
+ replace: true
+ };
+ commands = hash.slice(1).split('/');
+ leftover = [];
+ for (j = 0, len = commands.length; j < len; j++) {
+ command = commands[j];
+ if ((mode = Index.hashCommands.mode[command])) {
+ state.mode = mode;
+ } else if (command === 'index') {
+ state.mode = Conf['Previous Index Mode'];
+ state.page = 1;
+ } else if ((sort = Index.hashCommands.sort[command])) {
+ state.sort = sort;
+ } else if (/^s=/.test(command)) {
+ state.search = decodeURIComponent(command.slice(2)).replace(/\+/g, ' ').trim();
+ } else {
+ leftover.push(command);
+ }
+ }
+ hash = leftover.join('/');
+ if (hash) {
+ state.hash = "#" + hash;
+ }
+ Index.pushState(state);
+ return commands.length - leftover.length;
+ },
+ pushState: function(state) {
+ var hash, pageBeforeSearch, pathname, ref, replace, search;
+ search = state.search, hash = state.hash, replace = state.replace;
+ pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0;
+ if ((search != null) && search !== Index.search) {
+ state.page = search ? 1 : pageBeforeSearch || 1;
+ if (!search) {
+ pageBeforeSearch = void 0;
+ } else if (!Index.search) {
+ pageBeforeSearch = Index.currentPage;
+ }
+ }
+ Index.setState(state);
+ pathname = Index.currentPage === 1 ? "/" + g.BOARD + "/" : "/" + g.BOARD + "/" + Index.currentPage;
+ hash || (hash = '');
+ return history[replace ? 'replaceState' : 'pushState']({
+ mode: Conf['Index Mode'],
+ sort: Index.currentSort,
+ searched: Index.search,
+ oldpage: pageBeforeSearch
+ }, '', location.protocol + "//" + location.host + pathname + hash);
+ },
+ setState: function(arg) {
+ var hash, mode, page, ref, search, sort;
+ search = arg.search, mode = arg.mode, sort = arg.sort, page = arg.page, hash = arg.hash;
+ if ((search != null) && search !== Index.search) {
+ Index.changed.search = true;
+ Index.search = search;
+ }
+ if ((mode != null) && mode !== Conf['Index Mode']) {
+ Index.changed.mode = true;
+ Conf['Index Mode'] = mode;
+ $.set('Index Mode', mode);
+ if (!(mode === 'catalog' || Conf['Previous Index Mode'] === mode)) {
+ Conf['Previous Index Mode'] = mode;
+ $.set('Previous Index Mode', mode);
+ }
+ }
+ if ((sort != null) && sort !== Index.currentSort) {
+ Index.changed.sort = true;
+ Index.currentSort = sort;
+ Index.saveSort();
+ }
+ if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') {
+ page = 1;
+ }
+ if ((page != null) && page !== Index.currentPage) {
+ Index.changed.page = true;
+ Index.currentPage = page;
+ }
+ if (hash != null) {
+ return Index.changed.hash = true;
+ }
+ },
+ saveSort: function() {
+ if (typeof Conf['Index Sort'] === 'object') {
+ Conf['Index Sort'][g.BOARD.ID] = Index.currentSort;
+ } else {
+ Conf['Index Sort'] = Index.currentSort;
+ }
+ return $.set('Index Sort', Conf['Index Sort']);
+ },
+ pageLoad: function(scroll) {
+ var hash, mode, page, ref, search, sort, threads;
+ if (scroll == null) {
+ scroll = true;
+ }
+ if (!Index.liveThreadData) {
+ return;
+ }
+ ref = Index.changed, threads = ref.threads, search = ref.search, mode = ref.mode, sort = ref.sort, page = ref.page, hash = ref.hash;
+ if (threads || search || sort) {
+ Index.sort();
+ }
+ if (threads || search) {
+ Index.buildPagelist();
+ }
+ if (search) {
+ Index.setupSearch();
+ }
+ if (mode) {
+ Index.setupMode();
+ }
+ if (sort) {
+ Index.setupSort();
+ }
+ if (threads || search || mode || page || sort) {
+ Index.buildIndex();
+ }
+ if (threads || search || mode || page) {
+ Index.setPage();
+ }
+ if (scroll && !hash) {
+ Index.scrollToIndex();
+ }
+ if (hash) {
+ Header.hashScroll();
+ }
+ return Index.changed = {};
+ },
+ setupMode: function() {
+ var j, len, mode, ref;
+ ref = ['paged', 'infinite', 'all pages', 'catalog'];
+ for (j = 0, len = ref.length; j < len; j++) {
+ mode = ref[j];
+ $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode");
+ }
+ Index.selectMode.value = Conf['Index Mode'];
+ Index.cb.size();
+ Index.showHiddenThreads = false;
+ return $('#hidden-toggle a', Index.navLinks).textContent = 'Show';
+ },
+ setupSort: function() {
+ return Index.selectSort.value = Index.currentSort;
+ },
+ getPagesNum: function() {
+ if (Index.search) {
+ return Math.ceil(Index.sortedNodes.length / Index.threadsNumPerPage);
+ } else {
+ return Index.pagesNum;
+ }
+ },
+ getMaxPageNum: function() {
+ return Math.max(1, Index.getPagesNum());
+ },
+ buildPagelist: function() {
+ var a, i, j, maxPageNum, nodes, pagesRoot, ref;
+ pagesRoot = $('.pages', Index.pagelist);
+ maxPageNum = Index.getMaxPageNum();
+ if (pagesRoot.childElementCount !== maxPageNum) {
+ nodes = [];
+ for (i = j = 1, ref = maxPageNum; j <= ref; i = j += 1) {
+ a = $.el('a', {
+ textContent: i,
+ href: i === 1 ? './' : i
+ });
+ nodes.push($.tn('['), a, $.tn('] '));
+ }
+ $.rmAll(pagesRoot);
+ return $.add(pagesRoot, nodes);
+ }
+ },
+ setPage: function() {
+ var a, href, maxPageNum, next, pageNum, pagesRoot, prev, strong;
+ pageNum = Index.currentPage;
+ maxPageNum = Index.getMaxPageNum();
+ pagesRoot = $('.pages', Index.pagelist);
+ prev = pagesRoot.previousSibling.firstChild;
+ next = pagesRoot.nextSibling.firstChild;
+ href = Math.max(pageNum - 1, 1);
+ prev.href = href === 1 ? './' : href;
+ prev.firstChild.disabled = href === pageNum;
+ href = Math.min(pageNum + 1, maxPageNum);
+ next.href = href === 1 ? './' : href;
+ next.firstChild.disabled = href === pageNum;
+ if (strong = $('strong', pagesRoot)) {
+ if (+strong.textContent === pageNum) {
+ return;
+ }
+ $.replace(strong, strong.firstChild);
+ } else {
+ strong = $.el('strong');
+ }
+ a = pagesRoot.children[pageNum - 1];
+ $.before(a, strong);
+ return $.add(strong, a);
+ },
+ updateHideLabel: function() {
+ var hiddenCount, ref, ref1, thread, threadID;
+ hiddenCount = 0;
+ ref = g.BOARD.threads;
+ for (threadID in ref) {
+ thread = ref[threadID];
+ if (thread.isHidden) {
+ if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) >= 0) {
+ hiddenCount++;
+ }
+ }
+ }
+ if (!hiddenCount) {
+ Index.hideLabel.hidden = true;
+ if (Index.showHiddenThreads) {
+ Index.cb.toggleHiddenThreads();
+ }
+ return;
+ }
+ Index.hideLabel.hidden = false;
+ return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads";
+ },
+ update: function(firstTime) {
+ var now, ref, ref1;
+ if ((ref = Index.req) != null) {
+ ref.abort();
+ }
+ if ((ref1 = Index.notice) != null) {
+ ref1.close();
+ }
+ if (Conf['Index Refresh Notifications'] && d.readyState !== 'loading') {
+ Index.notice = new Notice('info', 'Refreshing index...');
+ } else {
+ now = Date.now();
+ $.ready(function() {
+ return Index.nTimeout = setTimeout((function() {
+ if (Index.req && !Index.notice) {
+ return Index.notice = new Notice('info', 'Refreshing index...');
+ }
+ }), 3 * $.SECOND - (Date.now() - now));
+ });
+ }
+ if (!firstTime && d.readyState !== 'loading' && !$('.board + *')) {
+ location.reload();
+ return;
+ }
+ Index.req = $.ajax("//a.4cdn.org/" + g.BOARD + "/catalog.json", {
+ onabort: Index.load,
+ onloadend: Index.load
+ }, {
+ whenModified: 'Index'
+ });
+ return $.addClass(Index.button, 'fa-spin');
+ },
+ load: function(e) {
+ var err, nTimeout, notice, ref, req, timeEl;
+ $.rmClass(Index.button, 'fa-spin');
+ req = Index.req, notice = Index.notice, nTimeout = Index.nTimeout;
+ if (nTimeout) {
+ clearTimeout(nTimeout);
+ }
+ delete Index.nTimeout;
+ delete Index.req;
+ delete Index.notice;
+ if (e.type === 'abort') {
+ req.onloadend = null;
+ if (notice != null) {
+ notice.close();
+ }
+ return;
+ }
+ if ((ref = req.status) !== 200 && ref !== 304) {
+ err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
+ if (notice) {
+ notice.setType('warning');
+ notice.el.lastElementChild.textContent = err;
+ setTimeout(notice.close, $.SECOND);
+ } else {
+ new Notice('warning', err, 1);
+ }
+ return;
+ }
+ try {
+ if (req.status === 200) {
+ Index.parse(req.response);
+ } else if (req.status === 304) {
+ Index.pageLoad();
+ }
+ } catch (_error) {
+ err = _error;
+ c.error("Index failure: " + err.message, err.stack);
+ if (notice) {
+ notice.setType('error');
+ notice.el.lastElementChild.textContent = 'Index refresh failed.';
+ setTimeout(notice.close, $.SECOND);
+ } else {
+ new Notice('error', 'Index refresh failed.', 1);
+ }
+ return;
+ }
+ if (notice) {
+ if (Conf['Index Refresh Notifications']) {
+ notice.setType('success');
+ notice.el.lastElementChild.textContent = 'Index refreshed!';
+ setTimeout(notice.close, $.SECOND);
+ } else {
+ notice.close();
+ }
+ }
+ timeEl = $('#index-last-refresh time', Index.navLinks);
+ timeEl.dataset.utc = Date.parse(req.getResponseHeader('Last-Modified'));
+ return RelativeDates.update(timeEl);
+ },
+ parse: function(pages) {
+ $.cleanCache(function(url) {
+ return /^\/\/a\.4cdn\.org\//.test(url);
+ });
+ Index.parseThreadList(pages);
+ Index.buildThreads();
+ Index.changed.threads = true;
+ return Index.pageLoad();
+ },
+ parseThreadList: function(pages) {
+ var ref;
+ Index.pagesNum = pages.length;
+ Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1;
+ Index.liveThreadData = pages.reduce((function(arr, next) {
+ return arr.concat(next.threads);
+ }), []);
+ Index.liveThreadIDs = Index.liveThreadData.map(function(data) {
+ return data.no;
+ });
+ g.BOARD.threads.forEach(function(thread) {
+ var ref1;
+ if (ref1 = thread.ID, indexOf.call(Index.liveThreadIDs, ref1) < 0) {
+ return thread.collect();
+ }
+ });
+ },
+ buildThreads: function() {
+ var err, errors, i, j, len, posts, ref, thread, threadData, threadRoot, threads;
+ if (!Index.liveThreadData) {
+ return;
+ }
+ Index.nodes = [];
+ threads = [];
+ posts = [];
+ ref = Index.liveThreadData;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ threadData = ref[i];
+ try {
+ threadRoot = Build.thread(g.BOARD, threadData);
+ if (Index.hat) {
+ $.prepend(threadRoot, Index.hat.cloneNode(false));
+ }
+ if (thread = g.BOARD.threads[threadData.no]) {
+ thread.setCount('post', threadData.replies + 1, threadData.bumplimit);
+ thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit);
+ thread.setStatus('Sticky', !!threadData.sticky);
+ thread.setStatus('Closed', !!threadData.closed);
+ } else {
+ thread = new Thread(threadData.no, g.BOARD);
+ threads.push(thread);
+ }
+ Index.nodes.push(threadRoot);
+ if (!(thread.OP && !thread.OP.isFetchedQuote)) {
+ posts.push(new Post($('.opContainer', threadRoot), thread, g.BOARD));
+ }
+ thread.setPage(Math.floor(i / Index.threadsNumPerPage) + 1);
+ } catch (_error) {
+ err = _error;
+ if (!errors) {
+ errors = [];
+ }
+ errors.push({
+ message: "Parsing of Thread No." + thread + " failed. Thread will be skipped.",
+ error: err
+ });
+ }
+ }
+ if (errors) {
+ Main.handleErrors(errors);
+ }
+ $.nodes(Index.nodes);
+ Main.callbackNodes('Thread', threads);
+ Main.callbackNodes('Post', posts);
+ Index.updateHideLabel();
+ return $.event('IndexRefresh');
+ },
+ buildReplies: function(threadRoots) {
+ var data, err, errors, i, j, k, lastReplies, len, len1, node, nodes, post, posts, thread, threadRoot;
+ posts = [];
+ for (j = 0, len = threadRoots.length; j < len; j++) {
+ threadRoot = threadRoots[j];
+ thread = Get.threadFromRoot(threadRoot);
+ i = Index.liveThreadIDs.indexOf(thread.ID);
+ if (!(lastReplies = Index.liveThreadData[i].last_replies)) {
+ continue;
+ }
+ nodes = [];
+ for (k = 0, len1 = lastReplies.length; k < len1; k++) {
+ data = lastReplies[k];
+ if ((post = thread.posts[data.no]) && !post.isFetchedQuote) {
+ nodes.push(post.nodes.root);
+ continue;
+ }
+ nodes.push(node = Build.postFromObject(data, thread.board.ID));
+ try {
+ posts.push(new Post(node, thread, thread.board));
+ } catch (_error) {
+ err = _error;
+ if (!errors) {
+ errors = [];
+ }
+ errors.push({
+ message: "Parsing of Post No." + data.no + " failed. Post will be skipped.",
+ error: err
+ });
+ }
+ }
+ $.add(threadRoot, nodes);
+ }
+ if (errors) {
+ Main.handleErrors(errors);
+ }
+ return Main.callbackNodes('Post', posts);
+ },
+ buildCatalogViews: function() {
+ var catalogThreads, j, len, thread, threads;
+ threads = Index.sortedNodes.map(function(threadRoot) {
+ return Get.threadFromRoot(threadRoot);
+ }).filter(function(thread) {
+ return !thread.isHidden !== Index.showHiddenThreads;
+ });
+ catalogThreads = [];
+ for (j = 0, len = threads.length; j < len; j++) {
+ thread = threads[j];
+ if (!thread.catalogView) {
+ catalogThreads.push(new CatalogThread(Build.catalogThread(thread), thread));
+ }
+ }
+ Main.callbackNodes('CatalogThread', catalogThreads);
+ return threads.map(function(thread) {
+ return thread.catalogView.nodes.root;
+ });
+ },
+ sizeCatalogViews: function(nodes) {
+ var height, j, len, node, ratio, ref, size, thumb, width;
+ size = Conf['Index Size'] === 'small' ? 150 : 250;
+ for (j = 0, len = nodes.length; j < len; j++) {
+ node = nodes[j];
+ thumb = $('.catalog-thumb', node);
+ ref = thumb.dataset, width = ref.width, height = ref.height;
+ if (!width) {
+ continue;
+ }
+ ratio = size / Math.max(width, height);
+ thumb.style.width = width * ratio + 'px';
+ thumb.style.height = height * ratio + 'px';
+ }
+ },
+ sort: function() {
+ var j, lastlong, len, liveThreadData, liveThreadIDs, nodes, sortedNodes, sortedThreadIDs, threadID;
+ liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData;
+ if (!liveThreadData) {
+ return;
+ }
+ sortedThreadIDs = (function() {
+ switch (Index.currentSort) {
+ case 'lastreply':
+ return slice.call(liveThreadData).sort(function(a, b) {
+ var num;
+ if ((num = a.last_replies)) {
+ a = num[num.length - 1];
+ }
+ if ((num = b.last_replies)) {
+ b = num[num.length - 1];
+ }
+ return b.no - a.no;
+ }).map(function(post) {
+ return post.no;
+ });
+ case 'lastlong':
+ lastlong = function(thread) {
+ var i, j, r, ref;
+ ref = thread.last_replies || [];
+ for (i = j = ref.length - 1; j >= 0; i = j += -1) {
+ r = ref[i];
+ if (r.com && Build.parseComment(r.com).replace(/[^a-z]/ig, '').length >= 100) {
+ return r;
+ }
+ }
+ return thread;
+ };
+ return slice.call(liveThreadData).sort(function(a, b) {
+ return lastlong(b).no - lastlong(a).no;
+ }).map(function(post) {
+ return post.no;
+ });
+ case 'bump':
+ return liveThreadIDs;
+ case 'birth':
+ return slice.call(liveThreadIDs).sort(function(a, b) {
+ return b - a;
+ });
+ case 'replycount':
+ return slice.call(liveThreadData).sort(function(a, b) {
+ return b.replies - a.replies;
+ }).map(function(post) {
+ return post.no;
+ });
+ case 'filecount':
+ return slice.call(liveThreadData).sort(function(a, b) {
+ return b.images - a.images;
+ }).map(function(post) {
+ return post.no;
+ });
+ }
+ })();
+ Index.sortedNodes = sortedNodes = [];
+ nodes = Index.nodes;
+ for (j = 0, len = sortedThreadIDs.length; j < len; j++) {
+ threadID = sortedThreadIDs[j];
+ sortedNodes.push(nodes[Index.liveThreadIDs.indexOf(threadID)]);
+ }
+ if (Index.search && (nodes = Index.querySearch(Index.search))) {
+ Index.sortedNodes = nodes;
+ }
+ Index.sortOnTop(function(thread) {
+ return thread.isSticky;
+ });
+ Index.sortOnTop(function(thread) {
+ return thread.isOnTop || Conf['Pin Watched Threads'] && ThreadWatcher.isWatched(thread);
+ });
+ if (Conf['Anchor Hidden Threads']) {
+ return Index.sortOnTop(function(thread) {
+ return !thread.isHidden;
+ });
+ }
+ },
+ sortOnTop: function(match) {
+ var bottomNodes, j, len, ref, threadRoot, topNodes;
+ topNodes = [];
+ bottomNodes = [];
+ ref = Index.sortedNodes;
+ for (j = 0, len = ref.length; j < len; j++) {
+ threadRoot = ref[j];
+ (match(Get.threadFromRoot(threadRoot)) ? topNodes : bottomNodes).push(threadRoot);
+ }
+ return Index.sortedNodes = topNodes.concat(bottomNodes);
+ },
+ buildIndex: function() {
+ var i, nodes, page, post;
+ if (!Index.liveThreadData) {
+ return;
+ }
+ switch (Conf['Index Mode']) {
+ case 'all pages':
+ nodes = Index.sortedNodes;
+ break;
+ case 'catalog':
+ nodes = Index.buildCatalogViews();
+ Index.sizeCatalogViews(nodes);
+ break;
+ default:
+ if (Index.followedThreadID != null) {
+ i = 0;
+ while (Index.followedThreadID !== Get.threadFromRoot(Index.sortedNodes[i]).ID) {
+ i++;
+ }
+ page = Math.floor(i / Index.threadsNumPerPage) + 1;
+ if (page !== Index.currentPage) {
+ Index.currentPage = page;
+ Index.pushState({
+ page: page
+ });
+ Index.setPage();
+ }
+ }
+ nodes = Index.buildSinglePage(Index.currentPage);
+ }
+ delete Index.pageNum;
+ $.rmAll(Index.root);
+ $.rmAll(Header.hover);
+ if (Conf['Index Mode'] === 'catalog') {
+ return $.add(Index.root, nodes);
+ } else {
+ if (Conf['Show Replies']) {
+ Index.buildReplies(nodes);
+ }
+ Index.buildStructure(nodes);
+ if ((Index.followedThreadID != null) && (post = g.posts[g.BOARD + "." + Index.followedThreadID])) {
+ return Header.scrollTo(post.nodes.root);
+ }
+ }
+ },
+ buildSinglePage: function(pageNum) {
+ var nodesPerPage, offset;
+ nodesPerPage = Index.threadsNumPerPage;
+ offset = nodesPerPage * (pageNum - 1);
+ return Index.sortedNodes.slice(offset, offset + nodesPerPage);
+ },
+ buildStructure: function(nodes) {
+ var j, len, node, thumb;
+ for (j = 0, len = nodes.length; j < len; j++) {
+ node = nodes[j];
+ if (thumb = $('img[data-src]', node)) {
+ thumb.src = thumb.dataset.src;
+ thumb.removeAttribute('data-src');
+ }
+ $.add(Index.root, [node, $.el('hr')]);
+ }
+ if (doc.contains(Index.root)) {
+ $.event('PostsInserted');
+ }
+ return ThreadHiding.onIndexBuild(nodes);
+ },
+ clearSearch: function() {
+ Index.searchInput.value = '';
+ Index.onSearchInput();
+ return Index.searchInput.focus();
+ },
+ setupSearch: function() {
+ Index.searchInput.value = Index.search;
+ if (Index.search) {
+ return Index.searchInput.dataset.searching = 1;
+ } else {
+ return Index.searchInput.removeAttribute('data-searching');
+ }
+ },
+ onSearchInput: function() {
+ var search;
+ search = Index.searchInput.value.trim();
+ if (search === Index.search) {
+ return;
+ }
+ Index.pushState({
+ search: search,
+ replace: !!search === !!Index.search
+ });
+ return Index.pageLoad(false);
+ },
+ querySearch: function(query) {
+ var keywords;
+ if (!(keywords = query.toLowerCase().match(/\S+/g))) {
+ return;
+ }
+ return Index.sortedNodes.filter(function(threadRoot) {
+ return Index.searchMatch(Get.threadFromRoot(threadRoot), keywords);
+ });
+ },
+ searchMatch: function(thread, keywords) {
+ var file, info, j, k, key, keyword, len, len1, ref, ref1, text;
+ ref = thread.OP, info = ref.info, file = ref.file;
+ text = [];
+ ref1 = ['comment', 'subject', 'name', 'tripcode', 'email'];
+ for (j = 0, len = ref1.length; j < len; j++) {
+ key = ref1[j];
+ if (key in info) {
+ text.push(info[key]);
+ }
+ }
+ if (file) {
+ text.push(file.name);
+ }
+ text = text.join(' ').toLowerCase();
+ for (k = 0, len1 = keywords.length; k < len1; k++) {
+ keyword = keywords[k];
+ if (-1 === text.indexOf(keyword)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ };
+
+ return Index;
+
+}).call(this);
+
+Polyfill = (function() {
+ var Polyfill;
+
+ Polyfill = {
+ init: function() {
+ return this.toBlob();
+ },
+ toBlob: function() {
+ if (HTMLCanvasElement.prototype.toBlob) {
+ return;
+ }
+ HTMLCanvasElement.prototype.toBlob = function(cb, type, encoderOptions) {
+ var data, i, j, l, ref, ui8a, url;
+ if (type == null) {
+ type = 'image/png';
+ }
+ url = this.toDataURL(type, encoderOptions);
+ data = atob(url.slice(url.indexOf(',') + 1));
+ l = data.length;
+ ui8a = new Uint8Array(l);
+ for (i = j = 0, ref = l; j < ref; i = j += 1) {
+ ui8a[i] = data.charCodeAt(i);
+ }
+ return cb(new Blob([ui8a], {
+ type: type
+ }));
+ };
+ return $.globalEval("HTMLCanvasElement.prototype.toBlob = (" + HTMLCanvasElement.prototype.toBlob + ");");
+ }
+ };
+
+ return Polyfill;
+
+}).call(this);
+
+Settings = (function() {
+ var Settings,
+ slice = [].slice,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Settings = {
+ init: function() {
+ var add, link, settings;
+ link = $.el('a', {
+ className: 'settings-link fa fa-wrench',
+ textContent: 'Settings',
+ title: '4chan X Settings',
+ href: 'javascript:;'
+ });
+ $.on(link, 'click', Settings.open);
+ Header.addShortcut(link);
+ add = this.addSection;
+ add('Main', this.main);
+ add('Filter', this.filter);
+ add('Sauce', this.sauce);
+ add('Advanced', this.advanced);
+ add('Keybinds', this.keybinds);
+ $.on(d, 'AddSettingsSection', Settings.addSection);
+ $.on(d, 'OpenSettings', function(e) {
+ return Settings.open(e.detail);
+ });
+ if (Conf['Disable Native Extension']) {
+ if ($.hasStorage) {
+ settings = JSON.parse(localStorage.getItem('4chan-settings')) || {};
+ if (settings.disableAll) {
+ return;
+ }
+ settings.disableAll = true;
+ return localStorage.setItem('4chan-settings', JSON.stringify(settings));
+ } else {
+ return $.onExists(doc, 'body', function() {
+ return $.global(function() {
+ return window.Config.disableAll = true;
+ });
+ });
+ }
+ }
+ },
+ open: function(openSection) {
+ var dialog, j, len, link, links, overlay, ref, section, sectionToOpen;
+ if (Settings.overlay) {
+ return;
+ }
+ $.event('CloseMenu');
+ Settings.dialog = dialog = $.el('div', {
+ id: 'fourchanx-settings',
+ className: 'dialog'
+ });
+ $.extend(dialog, {
+ innerHTML: "
"
+ });
+ Settings.overlay = overlay = $.el('div', {
+ id: 'overlay'
+ });
+ $.on($('.export', dialog), 'click', Settings["export"]);
+ $.on($('.import', dialog), 'click', Settings["import"]);
+ $.on($('.reset', dialog), 'click', Settings.reset);
+ $.on($('input', dialog), 'change', Settings.onImport);
+ links = [];
+ ref = Settings.sections;
+ for (j = 0, len = ref.length; j < len; j++) {
+ section = ref[j];
+ link = $.el('a', {
+ className: "tab-" + section.hyphenatedTitle,
+ textContent: section.title,
+ href: 'javascript:;'
+ });
+ $.on(link, 'click', Settings.openSection.bind(section));
+ links.push(link, $.tn(' | '));
+ if (section.title === openSection) {
+ sectionToOpen = link;
+ }
+ }
+ links.pop();
+ $.add($('.sections-list', dialog), links);
+ if (openSection !== 'none') {
+ (sectionToOpen ? sectionToOpen : links[0]).click();
+ }
+ $.on($('.close', dialog), 'click', Settings.close);
+ $.on(overlay, 'click', Settings.close);
+ $.add(d.body, [overlay, dialog]);
+ return $.event('OpenSettings', null, dialog);
+ },
+ close: function() {
+ var ref;
+ if (!Settings.dialog) {
+ return;
+ }
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
+ }
+ $.rm(Settings.overlay);
+ $.rm(Settings.dialog);
+ delete Settings.overlay;
+ return delete Settings.dialog;
+ },
+ sections: [],
+ addSection: function(title, open) {
+ var hyphenatedTitle, ref;
+ if (typeof title !== 'string') {
+ ref = title.detail, title = ref.title, open = ref.open;
+ }
+ hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-');
+ return Settings.sections.push({
+ title: title,
+ hyphenatedTitle: hyphenatedTitle,
+ open: open
+ });
+ },
+ openSection: function() {
+ var section, selected;
+ if (selected = $('.tab-selected', Settings.dialog)) {
+ $.rmClass(selected, 'tab-selected');
+ }
+ $.addClass($(".tab-" + this.hyphenatedTitle, Settings.dialog), 'tab-selected');
+ section = $('section', Settings.dialog);
+ $.rmAll(section);
+ section.className = "section-" + this.hyphenatedTitle;
+ this.open(section, g);
+ section.scrollTop = 0;
+ return $.event('OpenSettings', null, section);
+ },
+ warnings: {
+ localStorage: function(cb) {
+ var why;
+ if ($.cantSync) {
+ why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs';
+ return cb($.el('li', {
+ textContent: "4chan X needs local storage to " + why + ".\nEnable it on boards.4chan.org in your browser's privacy settings (may be listed as part of \"local data\" or \"cookies\")."
+ }));
+ }
+ },
+ ads: function(cb) {
+ return $.onExists(doc, '.ad-cnt', function(ad) {
+ return $.onExists(ad, 'img', function() {
+ return cb($.el('li', {
+ innerHTML: "To protect yourself from malicious ads , you should block ads on 4chan."
+ }));
+ });
+ });
+ }
+ },
+ main: function(section) {
+ var addWarning, arr, button, container, containers, description, div, fs, input, inputs, items, key, level, obj, ref, ref1, warning, warnings;
+ warnings = $.el('fieldset', {
+ hidden: true
+ }, {
+ innerHTML: "Warnings "
+ });
+ addWarning = function(item) {
+ $.add($('ul', warnings), item);
+ return warnings.hidden = false;
+ };
+ ref = Settings.warnings;
+ for (key in ref) {
+ warning = ref[key];
+ warning(addWarning);
+ }
+ $.add(section, warnings);
+ items = {};
+ inputs = {};
+ ref1 = Config.main;
+ for (key in ref1) {
+ obj = ref1[key];
+ fs = $.el('fieldset', {
+ innerHTML: "" + E(key) + " "
+ });
+ containers = [fs];
+ for (key in obj) {
+ arr = obj[key];
+ description = arr[1];
+ div = $.el('div', {
+ innerHTML: " " + E(key) + ": " + E(description) + " "
+ });
+ if ($.engine !== 'gecko' && key === 'Remember QR Size') {
+ div.hidden = true;
+ }
+ input = $('input', div);
+ $.on(input, 'change', function() {
+ this.parentNode.parentNode.dataset.checked = this.checked;
+ return $.cb.checked.call(this);
+ });
+ items[key] = Conf[key];
+ inputs[key] = input;
+ level = arr[2] || 0;
+ if (containers.length <= level) {
+ container = $.el('div', {
+ className: 'suboption-list'
+ });
+ $.add(containers[containers.length - 1].lastElementChild, container);
+ containers[level] = container;
+ } else if (containers.length > level + 1) {
+ containers.splice(level + 1, containers.length - (level + 1));
+ }
+ $.add(containers[level], div);
+ }
+ $.add(section, fs);
+ }
+ $.get(items, function(items) {
+ var val;
+ for (key in items) {
+ val = items[key];
+ inputs[key].checked = val;
+ inputs[key].parentNode.parentNode.dataset.checked = val;
+ }
+ });
+ div = $.el('div', {
+ innerHTML: ": Clear manually-hidden threads and posts on all boards. Reload the page to apply."
+ });
+ button = $('button', div);
+ $.get({
+ hiddenThreads: {},
+ hiddenPosts: {}
+ }, function(arg) {
+ var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref2, ref3, thread;
+ hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts;
+ hiddenNum = 0;
+ ref2 = hiddenThreads.boards;
+ for (ID in ref2) {
+ board = ref2[ID];
+ hiddenNum += Object.keys(board).length;
+ }
+ ref3 = hiddenPosts.boards;
+ for (ID in ref3) {
+ board = ref3[ID];
+ for (ID in board) {
+ thread = board[ID];
+ hiddenNum += Object.keys(thread).length;
+ }
+ }
+ return button.textContent = "Hidden: " + hiddenNum;
+ });
+ $.on(button, 'click', function() {
+ this.textContent = 'Hidden: 0';
+ return $.get('hiddenThreads', {}, function(arg) {
+ var boardID, hiddenThreads;
+ hiddenThreads = arg.hiddenThreads;
+ if ($.hasStorage) {
+ for (boardID in hiddenThreads.boards) {
+ localStorage.removeItem("4chan-hide-t-" + boardID);
+ }
+ }
+ return $["delete"](['hiddenThreads', 'hiddenPosts']);
+ });
+ });
+ return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
+ },
+ "export": function() {
+ return $.get(Conf, function(Conf) {
+ return Settings.downloadExport({
+ version: g.VERSION,
+ date: Date.now(),
+ Conf: Conf
+ });
+ });
+ },
+ downloadExport: function(data) {
+ var a, p;
+ a = $.el('a', {
+ download: "4chan X v" + g.VERSION + "-" + data.date + ".json",
+ href: "data:application/json;base64," + (btoa(unescape(encodeURIComponent(JSON.stringify(data, null, 2)))))
+ });
+ p = $('.imp-exp-result', Settings.dialog);
+ $.rmAll(p);
+ $.add(p, a);
+ return a.click();
+ },
+ "import": function() {
+ return $('input[type=file]', this.parentNode).click();
+ },
+ onImport: function() {
+ var file, output, reader;
+ if (!(file = this.files[0])) {
+ return;
+ }
+ this.value = null;
+ output = $('.imp-exp-result');
+ if (!confirm('Your current settings will be entirely overwritten, are you sure?')) {
+ output.textContent = 'Import aborted.';
+ return;
+ }
+ reader = new FileReader();
+ reader.onload = function(e) {
+ var err;
+ try {
+ return Settings.loadSettings(JSON.parse(e.target.result), function(err) {
+ if (err) {
+ return output.textContent = 'Import failed due to an error.';
+ } else if (confirm('Import successful. Reload now?')) {
+ return window.location.reload();
+ }
+ });
+ } catch (_error) {
+ err = _error;
+ output.textContent = 'Import failed due to an error.';
+ return c.error(err.stack);
+ }
+ };
+ return reader.readAsText(file);
+ },
+ convertFrom: {
+ loadletter: function(data) {
+ var base, boardID, convertSettings, key, ref, ref1, threadData, threadID, threads, val;
+ convertSettings = function(data, map) {
+ var newKey, prevKey;
+ for (prevKey in map) {
+ newKey = map[prevKey];
+ if (newKey) {
+ data.Conf[newKey] = data.Conf[prevKey];
+ }
+ delete data.Conf[prevKey];
+ }
+ return data;
+ };
+ data = convertSettings(data, {
+ 'Disable 4chan\'s extension': 'Disable Native Extension',
+ 'Comment Auto-Expansion': '',
+ 'Remove Slug': '',
+ 'Check for Updates': '',
+ 'Recursive Filtering': 'Recursive Hiding',
+ 'Reply Hiding': 'Reply Hiding Buttons',
+ 'Thread Hiding': 'Thread Hiding Buttons',
+ 'Show Stubs': 'Stubs',
+ 'Image Auto-Gif': 'Replace GIF',
+ 'Reveal Spoilers': 'Reveal Spoiler Thumbnails',
+ 'Expand From Current': 'Expand from here',
+ 'Post in Title': 'Thread Excerpt',
+ 'Current Page': 'Page Count in Stats',
+ 'Current Page Position': '',
+ 'Alternative captcha': 'Use Recaptcha v1',
+ 'Auto Submit': 'Post on Captcha Completion',
+ 'Open Reply in New Tab': 'Open Post in New Tab',
+ 'Remember QR size': 'Remember QR Size',
+ 'Remember Subject': '',
+ 'Quote Inline': 'Quote Inlining',
+ 'Quote Preview': 'Quote Previewing',
+ 'Indicate OP quote': 'Mark OP Quotes',
+ 'Indicate You quote': 'Mark Quotes of You',
+ 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes',
+ 'uniqueid': 'uniqueID',
+ 'mod': 'capcode',
+ 'email': '',
+ 'country': 'flag',
+ 'md5': 'MD5',
+ 'openEmptyQR': 'Open empty QR',
+ 'openQR': 'Open QR',
+ 'openOptions': 'Open settings',
+ 'close': 'Close',
+ 'spoiler': 'Spoiler tags',
+ 'sageru': 'Toggle sage',
+ 'code': 'Code tags',
+ 'submit': 'Submit QR',
+ 'watch': 'Watch',
+ 'update': 'Update',
+ 'unreadCountTo0': '',
+ 'expandAllImages': 'Expand images',
+ 'expandImage': 'Expand image',
+ 'zero': 'Front page',
+ 'nextPage': 'Next page',
+ 'previousPage': 'Previous page',
+ 'nextThread': 'Next thread',
+ 'previousThread': 'Previous thread',
+ 'expandThread': 'Expand thread',
+ 'openThreadTab': 'Open thread',
+ 'openThread': 'Open thread tab',
+ 'nextReply': 'Next reply',
+ 'previousReply': 'Previous reply',
+ 'hide': 'Hide',
+ 'Scrolling': 'Auto Scroll',
+ 'Verbose': ''
+ });
+ data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) {
+ switch (c) {
+ case '$1':
+ return '%TURL';
+ case '$2':
+ return '%URL';
+ case '$3':
+ return '%MD5';
+ case '$4':
+ return '%board';
+ default:
+ return c;
+ }
+ });
+ ref = Config.hotkeys;
+ for (key in ref) {
+ val = ref[key];
+ if (key in data.Conf) {
+ data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) {
+ return "" + (s[0].toUpperCase()) + s.slice(1);
+ }).replace(/(^|.+\+)[A-Z]$/g, function(s) {
+ return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase());
+ });
+ }
+ }
+ if (data.WatchedThreads) {
+ data.Conf['watchedThreads'] = {
+ boards: {}
+ };
+ ref1 = data.WatchedThreads;
+ for (boardID in ref1) {
+ threads = ref1[boardID];
+ for (threadID in threads) {
+ threadData = threads[threadID];
+ ((base = data.Conf['watchedThreads'].boards)[boardID] || (base[boardID] = {}))[threadID] = {
+ excerpt: threadData.textContent
+ };
+ }
+ }
+ }
+ return data;
+ }
+ },
+ upgrade: function(data, version) {
+ var boardID, changes, compareString, j, key, len, name, record, ref, ref1, ref2, ref3, ref4, ref5, rice, set, type, uids, value;
+ changes = {};
+ set = function(key, value) {
+ return data[key] = changes[key] = value;
+ };
+ compareString = version.replace(/\d+/g, function(x) {
+ return ('0000' + x).slice(-5);
+ });
+ if (compareString < '00001.00011.00008.00000') {
+ if (data['Fixed Thread Watcher'] == null) {
+ set('Fixed Thread Watcher', (ref = data['Toggleable Thread Watcher']) != null ? ref : true);
+ }
+ if (data['Exempt Archives from Encryption'] == null) {
+ set('Exempt Archives from Encryption', (ref1 = data['Except Archives from Encryption']) != null ? ref1 : false);
+ }
+ }
+ if (compareString < '00001.00011.00010.00001') {
+ if (data['selectedArchives'] != null) {
+ uids = {
+ "Moe": 0,
+ "4plebs Archive": 3,
+ "Nyafuu Archive": 4,
+ "Love is Over": 5,
+ "Rebecca Black Tech": 8,
+ "warosu": 10,
+ "fgts": 15,
+ "not4plebs": 22,
+ "DesuStorage": 23,
+ "fireden.net": 24,
+ "disabled": null
+ };
+ ref2 = data['selectedArchives'];
+ for (boardID in ref2) {
+ record = ref2[boardID];
+ for (type in record) {
+ name = record[type];
+ if (name in uids) {
+ record[type] = uids[name];
+ }
+ }
+ }
+ set('selectedArchives', data['selectedArchives']);
+ }
+ }
+ if (compareString < '00001.00011.00016.00000') {
+ if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) {
+ if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) {
+ set('usercss', rice + '\n\n' + data['usercss']);
+ }
+ }
+ }
+ if (compareString < '00001.00011.00017.00000') {
+ ref3 = ['Persistent QR', 'Color User IDs', 'Fappe Tyme', 'Werk Tyme', 'Highlight Posts Quoting You', 'Highlight Own Posts'];
+ for (j = 0, len = ref3.length; j < len; j++) {
+ key = ref3[j];
+ if (data[key] == null) {
+ set(key, key === 'Persistent QR');
+ }
+ }
+ }
+ if (compareString < '00001.00011.00017.00006') {
+ if (data['sauces'] != null) {
+ set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/iqdb\.org\//mg, '$1//iqdb.org/'));
+ }
+ }
+ if (compareString < '00001.00011.00019.00003' && !Settings.overlay) {
+ $.queueTask(function() {
+ return Settings.warnings.ads(function(item) {
+ return new Notice('warning', slice.call(item.childNodes));
+ });
+ });
+ }
+ if (compareString < '00001.00011.00020.00003') {
+ ref4 = {
+ 'Inline Cross-thread Quotes Only': false,
+ 'Pass Link': true
+ };
+ for (key in ref4) {
+ value = ref4[key];
+ if (data[key] == null) {
+ set(key, value);
+ }
+ }
+ }
+ if (compareString < '00001.00011.00021.00003') {
+ if (data['Remember Your Posts'] == null) {
+ set('Remember Your Posts', (ref5 = data['Mark Quotes of You']) != null ? ref5 : true);
+ }
+ }
+ if (compareString < '00001.00011.00022.00000') {
+ if (data['sauces'] != null) {
+ set('sauces', data['sauces'].replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/mg, '$1'));
+ set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/mg, '$&&safe=off'));
+ }
+ }
+ if (compareString < '00001.00011.00022.00002') {
+ if ((data['Use Recaptcha v1 in Reports'] == null) && data['Use Recaptcha v1'] && !data['Use Recaptcha v2 in Reports']) {
+ set('Use Recaptcha v1 in Reports', true);
+ }
+ }
+ if (compareString < '00001.00011.00024.00000') {
+ if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) {
+ set('JSON Index', data['JSON Navigation']);
+ }
+ }
+ if (compareString < '00001.00011.00026.00000') {
+ if ((data['Oekaki Links'] != null) && (data['Edit Link'] == null)) {
+ set('Edit Link', data['Oekaki Links']);
+ }
+ if (data['Inline Cross-thread Quotes Only'] == null) {
+ set('Inline Cross-thread Quotes Only', true);
+ }
+ }
+ if (compareString < '00001.00011.00030.00000') {
+ if (data['Quote Threading'] && (data['Thread Quotes'] == null)) {
+ set('Thread Quotes', true);
+ }
+ }
+ return changes;
+ },
+ loadSettings: function(data, cb) {
+ if (data.version.split('.')[0] === '2') {
+ data = Settings.convertFrom.loadletter(data);
+ } else if (data.version !== g.VERSION) {
+ Settings.upgrade(data.Conf, data.version);
+ }
+ return $.clear(function(err) {
+ if (err) {
+ return cb(err);
+ }
+ return $.set(data.Conf, cb);
+ });
+ },
+ reset: function() {
+ if (confirm('Your current settings will be entirely wiped, are you sure?')) {
+ return $.clear(function(err) {
+ if (err) {
+ return $('.imp-exp-result').textContent = 'Import failed due to an error.';
+ } else if (confirm('Reset successful. Reload now?')) {
+ return window.location.reload();
+ }
+ });
+ }
+ },
+ filter: function(section) {
+ var select;
+ $.extend(section, {
+ innerHTML: "Guide Post number Name Unique ID Tripcode Capcode Subject Comment Flag Filename Image dimensions Filesize Image MD5
"
+ });
+ select = $('select', section);
+ $.on(select, 'change', Settings.selectFilter);
+ return Settings.selectFilter.call(select);
+ },
+ selectFilter: function() {
+ var div, name, ta;
+ div = this.nextElementSibling;
+ if ((name = this.value) !== 'guide') {
+ $.rmAll(div);
+ ta = $.el('textarea', {
+ name: name,
+ className: 'field',
+ spellcheck: false
+ });
+ $.get(name, Conf[name], function(item) {
+ return ta.value = item[name];
+ });
+ $.on(ta, 'change', $.cb.value);
+ $.add(div, ta);
+ return;
+ }
+ $.extend(div, {
+ innerHTML: "Filter is disabled.
Use regular expressions , one per line. Lines starting with a # will be ignored. For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive. MD5 filtering uses exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:Per boards, separate them with commas. It is global if not specified. For example: boards:a,jp;. In case of a global rule, select boards to be excluded from the filter. For example: exclude:vg,v;. Filter OPs only along with their threads (\`only\`), replies only (\`no\`), or both (\`yes\`, this is default). For example: op:only;, op:no; or op:yes;. Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`). For example: stub:yes; or stub:no;. Highlight instead of hiding. You can specify a class name to use with a userstyle. For example: highlight; or highlight:wallpaper;. Highlighted OPs will have their threads put on top of the board index by default. For example: top:yes; or top:no;. Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there. The native catalog has its own separate filter list.
"
+ });
+ return $('.warning', div).hidden = Conf['Filter'];
+ },
+ sauce: function(section) {
+ var ta;
+ $.extend(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.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
You can open links with scripts and popups disabled by appending ;sandbox.
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.%MD5: MD5 hash in base64.%sMD5: MD5 hash in base64 using - and _.%hMD5: MD5 hash in hexadecimal.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;. "
+ });
+ $('.warning', section).hidden = Conf['Sauce'];
+ ta = $('textarea', section);
+ $.get('sauces', Conf['sauces'], function(item) {
+ return ta.value = item['sauces'];
+ });
+ return $.on(ta, 'change', $.cb.value);
+ },
+ advanced: function(section) {
+ var applyCSS, archBoards, archive, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, j, k, l, len, len1, len2, len3, len4, len5, len6, m, n, name, o, q, r, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, uid, warning, withCredentials;
+ $.extend(section, {
+ innerHTML: "Archiver 404 Redirect is disabled.
Thread redirection Post fetching File redirection
Captcha Language
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 Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
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
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
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"] will give you[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy] if you are on /g/.
Time Formatting is disabled. :
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled. :
File Info Formatting is disabled. :
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag:
%gLiteral %: %%
Quick Reply Personas One item per line. Items will be added in the relevant input's auto-completion list. Password items will always be used, since there is no password input. Lines starting with a # will be ignored.
You can use these settings with each item, separate them with semicolons:Possible items are: name, options (or equivalently email), subject and password. Wrap values of items with quotes, like this: options:"sage". Force values as defaults with the always keyword, for example: options:"sage";always. Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always. Unread Favicon is disabled. ferongr xat- 4chanJS Mayhem Original Metro Thread Updater is disabled. Interval: seconds
Custom Cooldown Time Seconds:
Custom CSSApply CSS "
+ });
+ ref = $$('.warning', section);
+ for (j = 0, len = ref.length; j < len; j++) {
+ warning = ref[j];
+ warning.hidden = Conf[warning.dataset.feature];
+ }
+ items = {};
+ inputs = {};
+ ref1 = ['captchaLanguage', 'boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'customCooldown'];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ name = ref1[k];
+ input = $("[name='" + name + "']", section);
+ items[name] = Conf[name];
+ inputs[name] = input;
+ if (name === 'usercss') {
+ $.on(input, 'change', $.cb.value);
+ } else if (name === 'favicon') {
+ $.on(input, 'change', $.cb.value);
+ $.on(input, 'change', Settings[name]);
+ } else {
+ $.on(input, 'input', $.cb.value);
+ if (name in Settings) {
+ $.on(input, 'input', Settings[name]);
+ }
+ }
+ }
+ ta = $('.personafield', section);
+ $.get('QR.personas', Conf['QR.personas'], function(item) {
+ return ta.value = item['QR.personas'];
+ });
+ $.on(ta, 'change', $.cb.value);
+ $.get(items, function(items) {
+ var key, val;
+ for (key in items) {
+ val = items[key];
+ input = inputs[key];
+ input.value = val;
+ if (key in Settings && key !== 'usercss') {
+ Settings[key].call(input);
+ }
+ }
+ });
+ interval = $('input[name="Interval"]', section);
+ customCSS = $('input[name="Custom CSS"]', section);
+ applyCSS = $('#apply-css', section);
+ interval.value = Conf['Interval'];
+ customCSS.checked = Conf['Custom CSS'];
+ inputs['usercss'].disabled = !Conf['Custom CSS'];
+ applyCSS.disabled = !Conf['Custom CSS'];
+ $.on(interval, 'change', ThreadUpdater.cb.interval);
+ $.on(customCSS, 'change', Settings.togglecss);
+ $.on(applyCSS, 'click', Settings.usercss);
+ archBoards = {};
+ ref2 = Redirect.archives;
+ for (l = 0, len2 = ref2.length; l < len2; l++) {
+ ref3 = ref2[l], uid = ref3.uid, name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials;
+ for (m = 0, len3 = boards.length; m < len3; m++) {
+ boardID = boards[m];
+ o = archBoards[boardID] || (archBoards[boardID] = {
+ thread: [[], []],
+ post: [[], []],
+ file: [[], []]
+ });
+ i = +(!!withCredentials);
+ archive = [uid != null ? uid : name, name];
+ o.thread[i].push(archive);
+ if (software === 'foolfuuka') {
+ o.post[i].push(archive);
+ }
+ if (indexOf.call(files, boardID) >= 0) {
+ o.file[i].push(archive);
+ }
+ }
+ }
+ for (boardID in archBoards) {
+ o = archBoards[boardID];
+ ref4 = ['thread', 'post', 'file'];
+ for (n = 0, len4 = ref4.length; n < len4; n++) {
+ item = ref4[n];
+ i = o[item][0].length ? 1 : 0;
+ o[item][i].push([null, 'disabled']);
+ o[item] = o[item][0].concat(o[item][1]);
+ }
+ }
+ rows = [];
+ boardOptions = [];
+ ref5 = Object.keys(archBoards).sort();
+ for (q = 0, len5 = ref5.length; q < len5; q++) {
+ boardID = ref5[q];
+ row = $.el('tr', {
+ className: "board-" + boardID
+ });
+ row.hidden = boardID !== g.BOARD.ID;
+ boardOptions.push($.el('option', {
+ textContent: "/" + boardID + "/",
+ value: "board-" + boardID,
+ selected: boardID === g.BOARD.ID
+ }));
+ o = archBoards[boardID];
+ ref6 = ['thread', 'post', 'file'];
+ for (r = 0, len6 = ref6.length; r < len6; r++) {
+ item = ref6[r];
+ $.add(row, Settings.addArchiveCell(boardID, o, item));
+ }
+ rows.push(row);
+ }
+ if (!(g.BOARD.ID in archBoards)) {
+ rows[0].hidden = false;
+ }
+ $.add($('tbody', section), rows);
+ boardSelect = $('#archive-board-select', section);
+ $.add(boardSelect, boardOptions);
+ table = $('#archive-table', section);
+ $.on(boardSelect, 'change', function() {
+ $('tbody > :not([hidden])', table).hidden = true;
+ return $("tbody > ." + this.value, table).hidden = false;
+ });
+ $.get('selectedArchives', Conf['selectedArchives'], function(arg) {
+ var data, id, select, selectedArchives, type;
+ selectedArchives = arg.selectedArchives;
+ for (boardID in selectedArchives) {
+ data = selectedArchives[boardID];
+ for (type in data) {
+ id = data[type];
+ if (select = $("select[data-boardid='" + boardID + "'][data-type='" + type + "']", section)) {
+ select.value = JSON.stringify(id);
+ }
+ }
+ }
+ });
+ },
+ addArchiveCell: function(boardID, data, type) {
+ var archive, i, length, options, select, td;
+ length = data[type].length;
+ td = $.el('td', {
+ className: 'archive-cell'
+ });
+ if (!length) {
+ td.textContent = '--';
+ return td;
+ }
+ options = [];
+ i = 0;
+ while (i < length) {
+ archive = data[type][i++];
+ options.push($.el('option', {
+ value: JSON.stringify(archive[0]),
+ textContent: archive[1]
+ }));
+ }
+ $.extend(td, {
+ innerHTML: "
"
+ });
+ select = td.firstElementChild;
+ if (!(select.disabled = length === 1)) {
+ select.setAttribute('data-boardid', boardID);
+ select.setAttribute('data-type', type);
+ $.on(select, 'change', Settings.saveSelectedArchive);
+ }
+ $.add(select, options);
+ return td;
+ },
+ saveSelectedArchive: function() {
+ return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) {
+ return function(arg) {
+ var name1, selectedArchives;
+ selectedArchives = arg.selectedArchives;
+ (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = {}))[_this.dataset.type] = JSON.parse(_this.value);
+ return $.set('selectedArchives', selectedArchives);
+ };
+ })(this));
+ },
+ boardnav: function() {
+ return Header.generateBoardList(this.value);
+ },
+ time: function() {
+ return this.nextElementSibling.textContent = Time.format(this.value, new Date());
+ },
+ backlink: function() {
+ return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) {
+ return {
+ '%id': '123456789',
+ '%%': '%'
+ }[x];
+ });
+ },
+ fileInfo: function() {
+ var data;
+ data = {
+ isReply: true,
+ file: {
+ url: '//i.4cdn.org/g/1334437723720.jpg',
+ name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg',
+ size: '276 KB',
+ sizeInBytes: 276 * 1024,
+ dimensions: '1280x720',
+ isImage: true,
+ isVideo: false,
+ isSpoiler: true,
+ tag: 'Loop'
+ }
+ };
+ return FileInfo.format(this.value, data, this.nextElementSibling);
+ },
+ favicon: function() {
+ var img;
+ Favicon["switch"]();
+ if (g.VIEW === 'thread' && Conf['Unread Favicon']) {
+ Unread.update();
+ }
+ img = this.nextElementSibling.children;
+ img[0].src = Favicon["default"];
+ img[1].src = Favicon.unreadSFW;
+ img[2].src = Favicon.unreadNSFW;
+ return img[3].src = Favicon.unreadDead;
+ },
+ togglecss: function() {
+ if ($('textarea[name=usercss]', $.x('ancestor::fieldset[1]', this)).disabled = $.id('apply-css').disabled = !this.checked) {
+ CustomCSS.rmStyle();
+ } else {
+ CustomCSS.addStyle();
+ }
+ return $.cb.checked.call(this);
+ },
+ usercss: function() {
+ return CustomCSS.update();
+ },
+ keybinds: function(section) {
+ var arr, input, inputs, items, key, ref, tbody, tr;
+ $.extend(section, {
+ innerHTML: "
Keybinds are disabled.
Allowed keys: a-z , 0-9 , Ctrl , Shift , Alt , Meta , Enter , Esc , Up , Down , Right , Left .
Press Backspace to disable a keybind.
"
+ });
+ $('.warning', section).hidden = Conf['Keybinds'];
+ tbody = $('tbody', section);
+ items = {};
+ inputs = {};
+ ref = Config.hotkeys;
+ for (key in ref) {
+ arr = ref[key];
+ tr = $.el('tr', {
+ innerHTML: "
" + E(arr[1]) + " "
+ });
+ input = $('input', tr);
+ input.name = key;
+ input.spellcheck = false;
+ items[key] = Conf[key];
+ inputs[key] = input;
+ $.on(input, 'keydown', Settings.keybind);
+ $.add(tbody, tr);
+ }
+ return $.get(items, function(items) {
+ var val;
+ for (key in items) {
+ val = items[key];
+ inputs[key].value = val;
+ }
+ });
+ },
+ keybind: function(e) {
+ var key;
+ if (e.keyCode === 9) {
+ return;
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ if ((key = Keybinds.keyCode(e)) == null) {
+ return;
+ }
+ this.value = key;
+ return $.cb.value.call(this);
+ }
+ };
+
+ return Settings;
+
+}).call(this);
+
+UI = (function() {
+ var Menu, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ slice = [].slice;
+
+ dialog = function(id, position, properties) {
+ var child, el, i, len, move, ref;
+ el = $.el('div', {
+ className: 'dialog',
+ id: id
+ });
+ $.extend(el, properties);
+ el.style.cssText = position;
+ $.get(id + ".position", position, function(item) {
+ return el.style.cssText = item[id + ".position"];
+ });
+ move = $('.move', el);
+ $.on(move, 'touchstart mousedown', dragstart);
+ ref = move.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if (!child.tagName) {
+ continue;
+ }
+ $.on(child, 'touchstart mousedown', function(e) {
+ return e.stopPropagation();
+ });
+ }
+ return el;
+ };
+
+ Menu = (function() {
+ var currentMenu, lastToggledButton;
+
+ currentMenu = null;
+
+ lastToggledButton = null;
+
+ function Menu(type) {
+ this.type = type;
+ this.addEntry = bind(this.addEntry, this);
+ this.onFocus = bind(this.onFocus, this);
+ this.keybinds = bind(this.keybinds, this);
+ this.close = bind(this.close, this);
+ this.setPosition = bind(this.setPosition, this);
+ $.on(d, 'AddMenuEntry', (function(_this) {
+ return function(arg) {
+ var detail;
+ detail = arg.detail;
+ if (detail.type !== _this.type) {
+ return;
+ }
+ delete detail.open;
+ return _this.addEntry(detail);
+ };
+ })(this));
+ this.entries = [];
+ }
+
+ Menu.prototype.makeMenu = function() {
+ var menu;
+ menu = $.el('div', {
+ className: 'dialog',
+ id: 'menu',
+ tabIndex: 0
+ });
+ $.on(menu, 'click', function(e) {
+ return e.stopPropagation();
+ });
+ $.on(menu, 'keydown', this.keybinds);
+ return menu;
+ };
+
+ Menu.prototype.toggle = function(e, button, data) {
+ var previousButton;
+ e.preventDefault();
+ e.stopPropagation();
+ if (currentMenu) {
+ previousButton = lastToggledButton;
+ currentMenu.close();
+ if (previousButton === button) {
+ return;
+ }
+ }
+ if (!this.entries.length) {
+ return;
+ }
+ return this.open(button, data);
+ };
+
+ Menu.prototype.open = function(button, data) {
+ var entry, i, len, menu, ref;
+ menu = this.menu = this.makeMenu();
+ currentMenu = this;
+ lastToggledButton = button;
+ this.entries.sort(function(first, second) {
+ return first.order - second.order;
+ });
+ ref = this.entries;
+ for (i = 0, len = ref.length; i < len; i++) {
+ entry = ref[i];
+ this.insertEntry(entry, menu, data);
+ }
+ $.addClass(lastToggledButton, 'active');
+ $.on(d, 'click CloseMenu', this.close);
+ $.on(d, 'scroll', this.setPosition);
+ $.on(window, 'resize', this.setPosition);
+ $.add(button, menu);
+ this.setPosition();
+ entry = $('.entry', menu);
+ this.focus(entry);
+ return menu.focus();
+ };
+
+ Menu.prototype.setPosition = function() {
+ var bLeft, bRect, bTop, bottom, cHeight, cWidth, left, mRect, ref, ref1, right, top;
+ mRect = this.menu.getBoundingClientRect();
+ bRect = lastToggledButton.getBoundingClientRect();
+ bTop = window.scrollY + bRect.top;
+ bLeft = window.scrollX + bRect.left;
+ cHeight = doc.clientHeight;
+ cWidth = doc.clientWidth;
+ ref = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom + "px", ''] : ['', (cHeight - bRect.top) + "px"], top = ref[0], bottom = ref[1];
+ ref1 = bRect.left + mRect.width < cWidth ? [bRect.left + "px", ''] : ['', (cWidth - bRect.right) + "px"], left = ref1[0], right = ref1[1];
+ $.extend(this.menu.style, {
+ top: top,
+ right: right,
+ bottom: bottom,
+ left: left
+ });
+ return this.menu.classList.toggle('left', right);
+ };
+
+ Menu.prototype.insertEntry = function(entry, parent, data) {
+ var err, i, len, ref, subEntry, submenu;
+ if (typeof entry.open === 'function') {
+ try {
+ if (!entry.open(data)) {
+ return;
+ }
+ } catch (_error) {
+ err = _error;
+ Main.handleErrors({
+ message: "Error in building the " + this.type + " menu.",
+ error: err
+ });
+ return;
+ }
+ }
+ $.add(parent, entry.el);
+ if (!entry.subEntries) {
+ return;
+ }
+ if (submenu = $('.submenu', entry.el)) {
+ $.rm(submenu);
+ }
+ submenu = $.el('div', {
+ className: 'dialog submenu'
+ });
+ ref = entry.subEntries;
+ for (i = 0, len = ref.length; i < len; i++) {
+ subEntry = ref[i];
+ this.insertEntry(subEntry, submenu, data);
+ }
+ $.add(entry.el, submenu);
+ };
+
+ Menu.prototype.close = function() {
+ $.rm(this.menu);
+ delete this.menu;
+ $.rmClass(lastToggledButton, 'active');
+ currentMenu = null;
+ lastToggledButton = null;
+ $.off(d, 'click scroll CloseMenu', this.close);
+ $.off(d, 'scroll', this.setPosition);
+ return $.off(window, 'resize', this.setPosition);
+ };
+
+ Menu.prototype.findNextEntry = function(entry, direction) {
+ var entries;
+ entries = slice.call(entry.parentNode.children);
+ entries.sort(function(first, second) {
+ return first.style.order - second.style.order;
+ });
+ return entries[entries.indexOf(entry) + direction];
+ };
+
+ Menu.prototype.keybinds = function(e) {
+ var entry, next, nextPrev, subEntry, submenu;
+ entry = $('.focused', this.menu);
+ while (subEntry = $('.focused', entry)) {
+ entry = subEntry;
+ }
+ switch (e.keyCode) {
+ case 27:
+ lastToggledButton.focus();
+ this.close();
+ break;
+ case 13:
+ case 32:
+ entry.click();
+ break;
+ case 38:
+ if (next = this.findNextEntry(entry, -1)) {
+ this.focus(next);
+ }
+ break;
+ case 40:
+ if (next = this.findNextEntry(entry, +1)) {
+ this.focus(next);
+ }
+ break;
+ case 39:
+ if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) {
+ while (nextPrev = this.findNextEntry(next, -1)) {
+ next = nextPrev;
+ }
+ this.focus(next);
+ }
+ break;
+ case 37:
+ if (next = $.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) {
+ this.focus(next);
+ }
+ break;
+ default:
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ };
+
+ Menu.prototype.onFocus = function(e) {
+ e.stopPropagation();
+ return this.focus(e.target);
+ };
+
+ Menu.prototype.focus = function(entry) {
+ var bottom, cHeight, cWidth, eRect, focused, i, left, len, ref, ref1, ref2, right, sRect, style, submenu, top;
+ while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) {
+ $.rmClass(focused, 'focused');
+ }
+ ref = $$('.focused', entry);
+ for (i = 0, len = ref.length; i < len; i++) {
+ focused = ref[i];
+ $.rmClass(focused, 'focused');
+ }
+ $.addClass(entry, 'focused');
+ if (!(submenu = $('.submenu', entry))) {
+ return;
+ }
+ sRect = submenu.getBoundingClientRect();
+ eRect = entry.getBoundingClientRect();
+ cHeight = doc.clientHeight;
+ cWidth = doc.clientWidth;
+ ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1];
+ ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1];
+ style = submenu.style;
+ style.top = top;
+ style.bottom = bottom;
+ style.left = left;
+ return style.right = right;
+ };
+
+ Menu.prototype.addEntry = function(entry) {
+ this.parseEntry(entry);
+ return this.entries.push(entry);
+ };
+
+ Menu.prototype.parseEntry = function(entry) {
+ var el, i, len, subEntries, subEntry;
+ el = entry.el, subEntries = entry.subEntries;
+ $.addClass(el, 'entry');
+ $.on(el, 'focus mouseover', this.onFocus);
+ el.style.order = entry.order || 100;
+ if (!subEntries) {
+ return;
+ }
+ $.addClass(el, 'has-submenu');
+ for (i = 0, len = subEntries.length; i < len; i++) {
+ subEntry = subEntries[i];
+ this.parseEntry(subEntry);
+ }
+ };
+
+ return Menu;
+
+ })();
+
+ dragstart = function(e) {
+ var el, isTouching, o, rect, ref, screenHeight, screenWidth;
+ if (e.type === 'mousedown' && e.button !== 0) {
+ return;
+ }
+ e.preventDefault();
+ if (isTouching = e.type === 'touchstart') {
+ e = e.changedTouches[e.changedTouches.length - 1];
+ }
+ el = $.x('ancestor::div[contains(@class,"dialog")][1]', this);
+ rect = el.getBoundingClientRect();
+ screenHeight = doc.clientHeight;
+ screenWidth = doc.clientWidth;
+ o = {
+ id: el.id,
+ style: el.style,
+ dx: e.clientX - rect.left,
+ dy: e.clientY - rect.top,
+ height: screenHeight - rect.height,
+ width: screenWidth - rect.width,
+ screenHeight: screenHeight,
+ screenWidth: screenWidth,
+ isTouching: isTouching
+ };
+ ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1];
+ if (isTouching) {
+ o.identifier = e.identifier;
+ o.move = touchmove.bind(o);
+ o.up = touchend.bind(o);
+ $.on(d, 'touchmove', o.move);
+ return $.on(d, 'touchend touchcancel', o.up);
+ } else {
+ o.move = drag.bind(o);
+ o.up = dragend.bind(o);
+ $.on(d, 'mousemove', o.move);
+ return $.on(d, 'mouseup', o.up);
+ }
+ };
+
+ touchmove = function(e) {
+ var i, len, ref, touch;
+ ref = e.changedTouches;
+ for (i = 0, len = ref.length; i < len; i++) {
+ touch = ref[i];
+ if (touch.identifier === this.identifier) {
+ drag.call(this, touch);
+ return;
+ }
+ }
+ };
+
+ 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 + '%';
+ top = clientY - this.dy;
+ top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%';
+ right = left === null ? 0 : null;
+ bottom = top === null ? this.bottomBorder + 'px' : null;
+ style = this.style;
+ style.left = left;
+ style.right = right;
+ style.top = top;
+ return style.bottom = bottom;
+ };
+
+ touchend = function(e) {
+ var i, len, ref, touch;
+ ref = e.changedTouches;
+ for (i = 0, len = ref.length; i < len; i++) {
+ touch = ref[i];
+ if (touch.identifier === this.identifier) {
+ dragend.call(this);
+ return;
+ }
+ }
+ };
+
+ dragend = function() {
+ if (this.isTouching) {
+ $.off(d, 'touchmove', this.move);
+ $.off(d, 'touchend touchcancel', this.up);
+ } else {
+ $.off(d, 'mousemove', this.move);
+ $.off(d, 'mouseup', this.up);
+ }
+ return $.set(this.id + ".position", this.style.cssText);
+ };
+
+ hoverstart = function(arg) {
+ var cb, el, endEvents, height, latestEvent, noRemove, o, ref, root;
+ root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, height = arg.height, cb = arg.cb, noRemove = arg.noRemove;
+ o = {
+ root: root,
+ el: el,
+ style: el.style,
+ isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO',
+ cb: cb,
+ endEvents: endEvents,
+ latestEvent: latestEvent,
+ clientHeight: doc.clientHeight,
+ clientWidth: doc.clientWidth,
+ height: height,
+ noRemove: noRemove
+ };
+ o.hover = hover.bind(o);
+ o.hoverend = hoverend.bind(o);
+ o.hover(o.latestEvent);
+ new MutationObserver(function() {
+ if (el.parentNode) {
+ return o.hover(o.latestEvent);
+ }
+ }).observe(el, {
+ childList: true
+ });
+ $.on(root, endEvents, o.hoverend);
+ if ($.x('ancestor::div[contains(@class,"inline")][1]', root)) {
+ $.on(d, 'keydown', o.hoverend);
+ }
+ $.on(root, 'mousemove', o.hover);
+ o.workaround = function(e) {
+ if (!root.contains(e.target)) {
+ return o.hoverend(e);
+ }
+ };
+ return $.on(doc, 'mousemove', o.workaround);
+ };
+
+ hoverstart.padding = 25;
+
+ hover = function(e) {
+ var clientX, clientY, height, left, ref, right, style, threshold, top;
+ this.latestEvent = e;
+ height = (this.height || this.el.offsetHeight) + hoverstart.padding;
+ clientX = e.clientX, clientY = e.clientY;
+ top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120));
+ threshold = this.clientWidth / 2;
+ if (!this.isImage) {
+ threshold = Math.max(threshold, this.clientWidth - 400);
+ }
+ ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
+ style = this.style;
+ style.top = top + 'px';
+ style.left = left;
+ return style.right = right;
+ };
+
+ hoverend = function(e) {
+ if (e.type === 'keydown' && e.keyCode !== 13 || e.target.nodeName === "TEXTAREA") {
+ return;
+ }
+ if (!this.noRemove) {
+ $.rm(this.el);
+ }
+ $.off(this.root, this.endEvents, this.hoverend);
+ $.off(d, 'keydown', this.hoverend);
+ $.off(this.root, 'mousemove', this.hover);
+ $.off(doc, 'mousemove', this.workaround);
+ if (this.cb) {
+ return this.cb.call(this);
+ }
+ };
+
+ checkbox = function(name, text, checked) {
+ var input, label;
+ if (checked == null) {
+ checked = Conf[name];
+ }
+ label = $.el('label');
+ input = $.el('input', {
+ type: 'checkbox',
+ name: name,
+ checked: checked
+ });
+ $.add(label, [input, $.tn(" " + text)]);
+ return label;
+ };
+
+ return {
+ dialog: dialog,
+ Menu: Menu,
+ hover: hoverstart,
+ checkbox: checkbox
+ };
+
+}).call(this);
+
+FappeTyme = (function() {
+ var FappeTyme;
+
+ FappeTyme = {
+ init: function() {
+ var el, i, lc, len, ref, ref1, type;
+ if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread'))) {
+ return;
+ }
+ this.nodes = {};
+ this.enabled = {
+ fappe: false,
+ werk: Conf['werk']
+ };
+ ref1 = ["Fappe", "Werk"];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ type = ref1[i];
+ if (!Conf[type + " Tyme"]) {
+ continue;
+ }
+ lc = type.toLowerCase();
+ el = UI.checkbox(lc, type + " Tyme", false);
+ el.title = type + " Tyme";
+ this.nodes[lc] = el.firstElementChild;
+ if (Conf[lc]) {
+ this.set(lc, true);
+ }
+ $.on(this.nodes[lc], 'change', this.toggle.bind(this, lc));
+ Header.menu.addEntry({
+ el: el,
+ order: 97
+ });
+ }
+ if (Conf['Werk Tyme']) {
+ $.sync('werk', this.set.bind(this, 'werk'));
+ }
+ Callbacks.Post.push({
+ name: 'Fappe Tyme',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Werk Tyme',
+ cb: this.catalogNode
+ });
+ },
+ node: function() {
+ return this.nodes.root.classList.toggle('noFile', !this.file);
+ },
+ catalogNode: function() {
+ var file, filename;
+ file = this.thread.OP.file;
+ if (!file) {
+ return;
+ }
+ filename = $.el('div', {
+ textContent: file.name,
+ className: 'werkTyme-filename'
+ });
+ return $.add(this.nodes.thumb.parentNode, filename);
+ },
+ set: function(type, enabled) {
+ this.enabled[type] = this.nodes[type].checked = enabled;
+ return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme");
+ },
+ toggle: function(type) {
+ this.set(type, !this.enabled[type]);
+ if (type === 'werk') {
+ return $.cb.checked.call(this.nodes[type]);
+ }
+ }
+ };
+
+ return FappeTyme;
+
+}).call(this);
+
+Gallery = (function() {
+ var Gallery;
+
+ Gallery = {
+ init: function() {
+ var el, ref;
+ if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ this.delay = Conf['Slide Delay'];
+ el = $.el('a', {
+ href: 'javascript:;',
+ id: 'appchan-gal',
+ title: 'Gallery',
+ className: 'fa fa-picture-o',
+ textContent: 'Gallery'
+ });
+ $.on(el, 'click', this.cb.toggle);
+ Header.addShortcut(el);
+ return Callbacks.Post.push({
+ name: 'Gallery',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var ref;
+ if (!((ref = this.file) != null ? ref.thumb : void 0)) {
+ return;
+ }
+ if (Gallery.nodes) {
+ Gallery.generateThumb(this);
+ Gallery.nodes.total.textContent = Gallery.images.length;
+ }
+ if (!Conf['Image Expansion']) {
+ return $.on(this.file.thumb.parentNode, 'click', Gallery.cb.image);
+ }
+ },
+ build: function(image) {
+ var candidate, cb, dialog, entry, file, i, j, key, len, len1, menuButton, nodes, post, ref, ref1, ref2, ref3, thumb, value;
+ cb = Gallery.cb;
+ if (Conf['Fullscreen Gallery']) {
+ $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
+ return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
+ });
+ if (typeof doc.mozRequestFullScreen === "function") {
+ doc.mozRequestFullScreen();
+ }
+ if (typeof doc.webkitRequestFullScreen === "function") {
+ doc.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
+ }
+ }
+ Gallery.images = [];
+ nodes = Gallery.nodes = {};
+ Gallery.fullIDs = {};
+ Gallery.slideshow = false;
+ nodes.el = dialog = $.el('div', {
+ id: 'a-gallery'
+ });
+ $.extend(dialog, {
+ innerHTML: "
"
+ });
+ ref = {
+ buttons: '.gal-buttons',
+ frame: '.gal-image',
+ name: '.gal-name',
+ count: '.count',
+ total: '.total',
+ thumbs: '.gal-thumbnails',
+ next: '.gal-image a',
+ current: '.gal-image img'
+ };
+ for (key in ref) {
+ value = ref[key];
+ nodes[key] = $(value, dialog);
+ }
+ menuButton = $('.menu-button', dialog);
+ nodes.menu = new UI.Menu('gallery');
+ $.on(nodes.frame, 'click', cb.blank);
+ if (Conf['Mouse Wheel Volume']) {
+ $.on(nodes.frame, 'wheel', Volume.wheel);
+ }
+ $.on(nodes.next, 'click', cb.click);
+ $.on(nodes.name, 'click', ImageCommon.download);
+ $.on($('.gal-prev', dialog), 'click', cb.prev);
+ $.on($('.gal-next', dialog), 'click', cb.next);
+ $.on($('.gal-start', dialog), 'click', cb.start);
+ $.on($('.gal-stop', dialog), 'click', cb.stop);
+ $.on($('.gal-close', dialog), 'click', cb.close);
+ $.on(menuButton, 'click', function(e) {
+ return nodes.menu.toggle(e, this, g);
+ });
+ ref1 = Gallery.menu.createSubEntries();
+ for (i = 0, len = ref1.length; i < len; i++) {
+ entry = ref1[i];
+ entry.order = 0;
+ nodes.menu.addEntry(entry);
+ }
+ $.on(d, 'keydown', cb.keybinds);
+ if (Conf['Keybinds']) {
+ $.off(d, 'keydown', Keybinds.keydown);
+ }
+ $.on(window, 'resize', Gallery.cb.setHeight);
+ ref2 = $$('.post .file');
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ file = ref2[j];
+ post = Get.postFromNode(file);
+ if (!((ref3 = post.file) != null ? ref3.thumb : void 0)) {
+ continue;
+ }
+ Gallery.generateThumb(post);
+ if (!image && Gallery.fullIDs[post.fullID]) {
+ candidate = post.file.thumb.parentNode;
+ if (Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0) {
+ image = candidate;
+ }
+ }
+ }
+ $.addClass(doc, 'gallery-open');
+ $.add(d.body, dialog);
+ nodes.thumbs.scrollTop = 0;
+ nodes.current.parentElement.scrollTop = 0;
+ if (image) {
+ thumb = $("[href='" + image.href + "']", nodes.thumbs);
+ }
+ thumb || (thumb = Gallery.images[Gallery.images.length - 1]);
+ if (thumb) {
+ Gallery.open(thumb);
+ }
+ doc.style.overflow = 'hidden';
+ return nodes.total.textContent = Gallery.images.length;
+ },
+ generateThumb: function(post) {
+ var thumb, thumbImg;
+ if (post.isClone || post.isHidden) {
+ return;
+ }
+ if (!(post.file && post.file.thumb && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
+ return;
+ }
+ if (Gallery.fullIDs[post.fullID]) {
+ return;
+ }
+ Gallery.fullIDs[post.fullID] = true;
+ thumb = $.el('a', {
+ className: 'gal-thumb',
+ href: post.file.url,
+ target: '_blank',
+ title: post.file.name
+ });
+ thumb.dataset.id = Gallery.images.length;
+ thumb.dataset.post = post.fullID;
+ thumbImg = post.file.thumb.cloneNode(false);
+ thumbImg.style.cssText = '';
+ $.add(thumb, thumbImg);
+ $.on(thumb, 'click', Gallery.cb.open);
+ Gallery.images.push(thumb);
+ return $.add(Gallery.nodes.thumbs, thumb);
+ },
+ load: function(thumb, errorCB) {
+ var elType, ext, file;
+ ext = thumb.href.match(/\w*$/);
+ elType = {
+ 'webm': 'video',
+ 'pdf': 'iframe'
+ }[ext] || 'img';
+ file = $.el(elType, {
+ title: thumb.title
+ });
+ $.extend(file.dataset, thumb.dataset);
+ $.on(file, 'error', errorCB);
+ file.src = thumb.href;
+ return file;
+ },
+ open: function(thumb) {
+ var el, file, newID, nodes, oldID, post, ref;
+ nodes = Gallery.nodes;
+ oldID = +nodes.current.dataset.id;
+ newID = +thumb.dataset.id;
+ if (el = Gallery.images[oldID]) {
+ $.rmClass(el, 'gal-highlight');
+ }
+ $.addClass(thumb, 'gal-highlight');
+ nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
+ if (((ref = Gallery.cache) != null ? ref.dataset.id : void 0) === '' + newID) {
+ file = Gallery.cache;
+ $.off(file, 'error', Gallery.cacheError);
+ $.on(file, 'error', Gallery.error);
+ } else {
+ file = Gallery.load(thumb, Gallery.error);
+ }
+ $.off(nodes.current, 'error', Gallery.error);
+ ImageCommon.pause(nodes.current);
+ $.replace(nodes.current, file);
+ nodes.current = file;
+ if (file.nodeName === 'VIDEO') {
+ file.loop = true;
+ Volume.setup(file);
+ if (Conf['Autoplay']) {
+ file.play();
+ }
+ if (Conf['Show Controls']) {
+ ImageCommon.addControls(file);
+ }
+ }
+ doc.classList.toggle('gal-pdf', file.nodeName === 'IFRAME');
+ Gallery.cb.setHeight();
+ nodes.count.textContent = +thumb.dataset.id + 1;
+ nodes.name.download = nodes.name.textContent = thumb.title;
+ nodes.name.href = thumb.href;
+ nodes.frame.scrollTop = 0;
+ nodes.next.focus();
+ if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) {
+ Gallery.setupTimer();
+ } else {
+ Gallery.cb.stop();
+ }
+ if (Conf['Scroll to Post'] && (post = g.posts[file.dataset.post])) {
+ Header.scrollTo(post.nodes.root);
+ }
+ if (isNaN(oldID) || newID === (oldID + 1) % Gallery.images.length) {
+ return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError);
+ }
+ },
+ error: function() {
+ var ref;
+ if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
+ return new Notice('error', 'Corrupt or unplayable video', 30);
+ }
+ if (this.src.split('/')[2] !== 'i.4cdn.org') {
+ return;
+ }
+ return ImageCommon.error(this, g.posts[this.dataset.post], null, (function(_this) {
+ return function(url) {
+ if (!url) {
+ return;
+ }
+ Gallery.images[_this.dataset.id].href = url;
+ if (Gallery.nodes.current === _this) {
+ return _this.src = url;
+ }
+ };
+ })(this));
+ },
+ cacheError: function() {
+ return delete Gallery.cache;
+ },
+ cleanupTimer: function() {
+ var current;
+ clearTimeout(Gallery.timeoutID);
+ current = Gallery.nodes.current;
+ $.off(current, 'canplaythrough load', Gallery.startTimer);
+ return $.off(current, 'ended', Gallery.cb.next);
+ },
+ startTimer: function() {
+ return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * $.SECOND);
+ },
+ setupTimer: function() {
+ var current, isVideo;
+ Gallery.cleanupTimer();
+ current = Gallery.nodes.current;
+ isVideo = current.nodeName === 'VIDEO';
+ if (isVideo) {
+ current.play();
+ }
+ if ((isVideo ? current.readyState >= 4 : current.complete) || current.nodeName === 'IFRAME') {
+ return Gallery.startTimer();
+ } else {
+ return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer);
+ }
+ },
+ checkTimer: function() {
+ var current;
+ current = Gallery.nodes.current;
+ if (current.nodeName === 'VIDEO' && !current.paused) {
+ $.on(current, 'ended', Gallery.cb.next);
+ return current.loop = false;
+ } else {
+ return Gallery.cb.next();
+ }
+ },
+ cb: {
+ keybinds: function(e) {
+ var cb, key;
+ if (!(key = Keybinds.keyCode(e))) {
+ return;
+ }
+ cb = (function() {
+ switch (key) {
+ case Conf['Close']:
+ case Conf['Open Gallery']:
+ return Gallery.cb.close;
+ case 'Right':
+ return Gallery.cb.next;
+ case 'Enter':
+ return Gallery.cb.advance;
+ case 'Left':
+ case '':
+ return Gallery.cb.prev;
+ case Conf['Pause']:
+ return Gallery.cb.pause;
+ case Conf['Slideshow']:
+ return Gallery.cb.toggleSlideshow;
+ }
+ })();
+ if (!cb) {
+ return;
+ }
+ e.stopPropagation();
+ e.preventDefault();
+ return cb();
+ },
+ open: function(e) {
+ if (e) {
+ e.preventDefault();
+ }
+ if (this) {
+ return Gallery.open(this);
+ }
+ },
+ image: function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ return Gallery.build(this);
+ },
+ prev: function() {
+ return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]);
+ },
+ next: function() {
+ return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]);
+ },
+ click: function(e) {
+ if (ImageCommon.onControls(e)) {
+ return;
+ }
+ e.preventDefault();
+ return Gallery.cb.advance();
+ },
+ advance: function() {
+ if (!Conf['Autoplay'] && Gallery.nodes.current.paused) {
+ return Gallery.nodes.current.play();
+ } else {
+ return Gallery.cb.next();
+ }
+ },
+ toggle: function() {
+ return (Gallery.nodes ? Gallery.cb.close : Gallery.build)();
+ },
+ blank: function(e) {
+ if (e.target === this) {
+ return Gallery.cb.close();
+ }
+ },
+ toggleSlideshow: function() {
+ return Gallery.cb[Gallery.slideshow ? 'stop' : 'start']();
+ },
+ pause: function() {
+ var current;
+ Gallery.cb.stop();
+ current = Gallery.nodes.current;
+ if (current.nodeName === 'VIDEO') {
+ return current[current.paused ? 'play' : 'pause']();
+ }
+ },
+ start: function() {
+ $.addClass(Gallery.nodes.buttons, 'gal-playing');
+ Gallery.slideshow = true;
+ return Gallery.setupTimer();
+ },
+ stop: function() {
+ var current;
+ if (!Gallery.slideshow) {
+ return;
+ }
+ Gallery.cleanupTimer();
+ current = Gallery.nodes.current;
+ if (current.nodeName === 'VIDEO') {
+ current.loop = true;
+ }
+ $.rmClass(Gallery.nodes.buttons, 'gal-playing');
+ return Gallery.slideshow = false;
+ },
+ close: function() {
+ $.off(Gallery.nodes.current, 'error', Gallery.error);
+ ImageCommon.pause(Gallery.nodes.current);
+ $.rm(Gallery.nodes.el);
+ $.rmClass(doc, 'gallery-open');
+ if (Conf['Fullscreen Gallery']) {
+ $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close);
+ if (typeof d.mozCancelFullScreen === "function") {
+ d.mozCancelFullScreen();
+ }
+ if (typeof d.webkitExitFullscreen === "function") {
+ d.webkitExitFullscreen();
+ }
+ }
+ delete Gallery.nodes;
+ delete Gallery.fullIDs;
+ doc.style.overflow = '';
+ $.off(d, 'keydown', Gallery.cb.keybinds);
+ if (Conf['Keybinds']) {
+ $.on(d, 'keydown', Keybinds.keydown);
+ }
+ $.off(window, 'resize', Gallery.cb.setHeight);
+ return clearTimeout(Gallery.timeoutID);
+ },
+ setFitness: function() {
+ return (this.checked ? $.addClass : $.rmClass)(doc, "gal-" + (this.name.toLowerCase().replace(/\s+/g, '-')));
+ },
+ setHeight: $.debounce(100, function() {
+ var current, dim, frame, height, minHeight, ref, ref1, ref2, style, width;
+ ref = Gallery.nodes, current = ref.current, frame = ref.frame;
+ style = current.style;
+ if (Conf['Stretch to Fit'] && (dim = (ref1 = g.posts[current.dataset.post]) != null ? ref1.file.dimensions : void 0)) {
+ ref2 = dim.split('x'), width = ref2[0], height = ref2[1];
+ minHeight = Math.min(doc.clientHeight - 25, height / width * frame.clientWidth);
+ style.minHeight = minHeight + 'px';
+ return style.minWidth = (width / height * minHeight) + 'px';
+ } else {
+ return style.minHeight = style.minWidth = null;
+ }
+ }),
+ setDelay: function() {
+ return Gallery.delay = +this.value;
+ }
+ },
+ menu: {
+ init: function() {
+ var el;
+ if (!Gallery.enabled) {
+ return;
+ }
+ el = $.el('span', {
+ textContent: 'Gallery',
+ className: 'gallery-link'
+ });
+ return Header.menu.addEntry({
+ el: el,
+ order: 105,
+ subEntries: Gallery.menu.createSubEntries()
+ });
+ },
+ createSubEntry: function(name) {
+ var input, label;
+ label = UI.checkbox(name, name);
+ input = label.firstElementChild;
+ if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height') {
+ $.on(input, 'change', Gallery.cb.setFitness);
+ }
+ $.event('change', null, input);
+ $.on(input, 'change', $.cb.checked);
+ if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height' || name === 'Stretch to Fit') {
+ $.on(input, 'change', Gallery.cb.setHeight);
+ }
+ return {
+ el: label
+ };
+ },
+ createSubEntries: function() {
+ var delayInput, delayLabel, item, subEntries;
+ subEntries = (function() {
+ var i, len, ref, results;
+ ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'];
+ results = [];
+ for (i = 0, len = ref.length; i < len; i++) {
+ item = ref[i];
+ results.push(Gallery.menu.createSubEntry(item));
+ }
+ return results;
+ })();
+ delayLabel = $.el('label', {
+ innerHTML: "Slide Delay:
"
+ });
+ delayInput = delayLabel.firstElementChild;
+ delayInput.value = Gallery.delay;
+ $.on(delayInput, 'change', Gallery.cb.setDelay);
+ $.on(delayInput, 'change', $.cb.value);
+ subEntries.push({
+ el: delayLabel
+ });
+ return subEntries;
+ }
+ }
+ };
+
+ return Gallery;
+
+}).call(this);
+
+ImageCommon = (function() {
+ var ImageCommon;
+
+ ImageCommon = {
+ pause: function(video) {
+ if (video.nodeName !== 'VIDEO') {
+ return;
+ }
+ video.pause();
+ $.off(video, 'volumechange', Volume.change);
+ return video.muted = true;
+ },
+ rewind: function(el) {
+ if (el.nodeName === 'VIDEO') {
+ if (el.readyState >= el.HAVE_METADATA) {
+ return el.currentTime = 0;
+ }
+ } else if (/\.gif$/.test(el.src)) {
+ return $.queueTask(function() {
+ return el.src = el.src;
+ });
+ }
+ },
+ pushCache: function(el) {
+ ImageCommon.cache = el;
+ return $.on(el, 'error', ImageCommon.cacheError);
+ },
+ popCache: function() {
+ var el;
+ el = ImageCommon.cache;
+ $.off(el, 'error', ImageCommon.cacheError);
+ delete ImageCommon.cache;
+ return el;
+ },
+ cacheError: function() {
+ if (ImageCommon.cache === this) {
+ return delete ImageCommon.cache;
+ }
+ },
+ decodeError: function(file, post) {
+ var message, ref;
+ if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) {
+ return false;
+ }
+ if (!(message = $('.warning', post.file.thumb.parentNode))) {
+ message = $.el('div', {
+ className: 'warning'
+ });
+ $.after(post.file.thumb, message);
+ }
+ message.textContent = 'Error: Corrupt or unplayable video';
+ return true;
+ },
+ error: function(file, post, delay, cb) {
+ var URL, redirect, src, timeoutID;
+ src = post.file.url.split('/');
+ URL = Redirect.to('file', {
+ boardID: post.board.ID,
+ filename: src[src.length - 1]
+ });
+ if (!(Conf['404 Redirect'] && URL && Redirect.securityCheck(URL))) {
+ URL = null;
+ }
+ if ((post.isDead || post.file.isDead) && file.src.split('/')[2] === 'i.4cdn.org') {
+ return cb(URL);
+ }
+ if (delay != null) {
+ timeoutID = setTimeout((function() {
+ return cb(URL);
+ }), delay);
+ }
+ if (post.isDead || post.file.isDead) {
+ return;
+ }
+ redirect = function() {
+ if (file.src.split('/')[2] === 'i.4cdn.org') {
+ if (delay != null) {
+ clearTimeout(timeoutID);
+ }
+ return cb(URL);
+ }
+ };
+ return $.ajax("//a.4cdn.org/" + post.board + "/thread/" + post.thread + ".json", {
+ onload: function() {
+ var i, len, postObj, ref;
+ if (this.status === 404) {
+ post.kill(!post.isClone);
+ }
+ if (this.status !== 200) {
+ return redirect();
+ }
+ ref = this.response.posts;
+ for (i = 0, len = ref.length; i < len; i++) {
+ postObj = ref[i];
+ if (postObj.no === post.ID) {
+ break;
+ }
+ }
+ if (postObj.no !== post.ID) {
+ post.kill();
+ return redirect();
+ } else if (postObj.filedeleted) {
+ post.kill(true);
+ return redirect();
+ } else {
+ return URL = post.file.url;
+ }
+ }
+ });
+ },
+ addControls: function(video) {
+ var handler;
+ handler = function() {
+ var t;
+ $.off(video, 'mouseover', handler);
+ t = new Date().getTime();
+ return $.asap((function() {
+ return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000;
+ }), function() {
+ return video.controls = true;
+ });
+ };
+ return $.on(video, 'mouseover', handler);
+ },
+ onControls: function(e) {
+ return (Conf['Show Controls'] && Conf['Click Passthrough'] && e.target.nodeName === 'VIDEO') || (e.target.controls && e.target.getBoundingClientRect().bottom - e.clientY < 35);
+ },
+ download: function(e) {
+ if (this.protocol === 'blob:') {
+ return true;
+ }
+ e.preventDefault();
+ return CrossOrigin.file(this.href, (function(_this) {
+ return function(blob) {
+ if (blob) {
+ _this.href = URL.createObjectURL(blob);
+ return _this.click();
+ } else {
+ return new Notice('error', "Could not download " + _this.href, 30);
+ }
+ };
+ })(this));
+ }
+ };
+
+ return ImageCommon;
+
+}).call(this);
+
+ImageExpand = (function() {
+ var ImageExpand,
+ slice = [].slice;
+
+ ImageExpand = {
+ init: function() {
+ var ref;
+ if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ this.EAI = $.el('a', {
+ className: 'expand-all-shortcut fa fa-expand',
+ textContent: 'EAI',
+ title: 'Expand All Images',
+ href: 'javascript:;'
+ });
+ $.on(this.EAI, 'click', this.cb.toggleAll);
+ Header.addShortcut(this.EAI, 3);
+ $.on(d, 'scroll visibilitychange', this.cb.playVideos);
+ this.videoControls = $.el('span', {
+ className: 'video-controls'
+ });
+ $.extend(this.videoControls, {
+ innerHTML: "Â
contract "
+ });
+ return Callbacks.Post.push({
+ name: 'Image Expansion',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var ref;
+ if (!(this.file && (this.file.isImage || this.file.isVideo))) {
+ return;
+ }
+ $.on(this.file.thumb.parentNode, 'click', ImageExpand.cb.toggle);
+ if (this.isClone) {
+ if (this.file.isExpanding) {
+ ImageExpand.contract(this);
+ return ImageExpand.expand(this);
+ } else if (this.file.isExpanded && this.file.isVideo) {
+ Volume.setup(this.file.fullImage);
+ ImageExpand.setupVideoCB(this);
+ return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls);
+ }
+ } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) {
+ return ImageExpand.expand(this);
+ }
+ },
+ cb: {
+ toggle: function(e) {
+ var file, post, ref;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ post = Get.postFromNode(this);
+ file = post.file;
+ if (file.isExpanded && ImageCommon.onControls(e)) {
+ return;
+ }
+ e.preventDefault();
+ if (!Conf['Autoplay'] && ((ref = file.fullImage) != null ? ref.paused : void 0)) {
+ return file.fullImage.play();
+ } else {
+ return ImageExpand.toggle(post);
+ }
+ },
+ toggleAll: function() {
+ var func, toggle;
+ $.event('CloseMenu');
+ toggle = function(post) {
+ var file;
+ file = post.file;
+ if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
+ return;
+ }
+ if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || !Conf['Expand videos'] && file.isVideo || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
+ return;
+ }
+ return $.queueTask(func, post);
+ };
+ if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) {
+ ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress';
+ ImageExpand.EAI.title = 'Contract All Images';
+ func = ImageExpand.expand;
+ } else {
+ ImageExpand.EAI.className = 'expand-all-shortcut fa fa-expand';
+ ImageExpand.EAI.title = 'Expand All Images';
+ func = ImageExpand.contract;
+ }
+ return g.posts.forEach(function(post) {
+ var i, len, ref;
+ ref = [post].concat(slice.call(post.clones));
+ for (i = 0, len = ref.length; i < len; i++) {
+ post = ref[i];
+ toggle(post);
+ }
+ });
+ },
+ playVideos: function() {
+ return g.posts.forEach(function(post) {
+ var file, i, len, ref, video, visible;
+ ref = [post].concat(slice.call(post.clones));
+ for (i = 0, len = ref.length; i < len; i++) {
+ post = ref[i];
+ file = post.file;
+ if (!(file && file.isVideo && file.isExpanded)) {
+ continue;
+ }
+ video = file.fullImage;
+ visible = ($.hasAudio(video) && !video.muted) || Header.isNodeVisible(video);
+ if (visible && file.wasPlaying) {
+ delete file.wasPlaying;
+ video.play();
+ } else if (!visible && !video.paused) {
+ file.wasPlaying = true;
+ video.pause();
+ }
+ }
+ });
+ },
+ setFitness: function() {
+ return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\s+/g, '-'));
+ }
+ },
+ toggle: function(post) {
+ var next;
+ if (!(post.file.isExpanding || post.file.isExpanded)) {
+ post.file.scrollIntoView = Conf['Scroll into view'];
+ ImageExpand.expand(post);
+ return;
+ }
+ ImageExpand.contract(post);
+ if (Conf['Advance on contract']) {
+ next = post.nodes.root;
+ while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
+ if (!($('.stub', next) || next.offsetHeight === 0)) {
+ break;
+ }
+ }
+ if (next) {
+ return Header.scrollTo(next);
+ }
+ }
+ },
+ contract: function(post) {
+ var bottom, cb, el, eventName, file, i, len, oldHeight, ref, ref1, scrollY, top, x;
+ file = post.file;
+ if (el = file.fullImage) {
+ top = Header.getTopOf(el);
+ bottom = top + el.getBoundingClientRect().height;
+ oldHeight = d.body.clientHeight;
+ scrollY = window.scrollY;
+ }
+ $.rmClass(post.nodes.root, 'expanded-image');
+ $.rmClass(file.thumb, 'expanding');
+ $.rm(file.videoControls);
+ file.thumb.parentNode.href = file.url;
+ file.thumb.parentNode.target = '_blank';
+ ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ x = ref[i];
+ delete file[x];
+ }
+ if (!el) {
+ return;
+ }
+ if (doc.contains(el)) {
+ if (bottom <= 0) {
+ window.scroll(0, scrollY + d.body.clientHeight - oldHeight);
+ } else {
+ Header.scrollToIfNeeded(post.nodes.root);
+ }
+ if (window.scrollX > 0) {
+ window.scroll(0, window.scrollY);
+ }
+ }
+ $.off(el, 'error', ImageExpand.error);
+ ImageCommon.pushCache(el);
+ if (file.isVideo) {
+ ImageCommon.pause(el);
+ ref1 = ImageExpand.videoCB;
+ for (eventName in ref1) {
+ cb = ref1[eventName];
+ $.off(el, eventName, cb);
+ }
+ }
+ if (Conf['Restart when Opened']) {
+ ImageCommon.rewind(file.thumb);
+ }
+ delete file.fullImage;
+ return $.queueTask(function() {
+ if (file.isExpanding || file.isExpanded) {
+ return;
+ }
+ $.rmClass(el, 'full-image');
+ if (el.id) {
+ return;
+ }
+ return $.rm(el);
+ });
+ },
+ expand: function(post, src) {
+ var el, file, isVideo, ref, thumb;
+ file = post.file;
+ thumb = file.thumb, isVideo = file.isVideo;
+ if (post.isHidden || file.isExpanding || file.isExpanded) {
+ return;
+ }
+ $.addClass(thumb, 'expanding');
+ file.isExpanding = true;
+ if (file.fullImage) {
+ el = file.fullImage;
+ } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
+ el = file.fullImage = ImageCommon.popCache();
+ $.on(el, 'error', ImageExpand.error);
+ if (Conf['Restart when Opened'] && el.id !== 'ihover') {
+ ImageCommon.rewind(el);
+ }
+ el.removeAttribute('id');
+ } else {
+ el = file.fullImage = $.el((isVideo ? 'video' : 'img'));
+ el.dataset.fullID = post.fullID;
+ $.on(el, 'error', ImageExpand.error);
+ el.src = src || file.url;
+ }
+ el.className = 'full-image';
+ $.after(thumb, el);
+ if (isVideo) {
+ if (Conf['Show Controls'] && Conf['Click Passthrough'] && !file.videoControls) {
+ file.videoControls = ImageExpand.videoControls.cloneNode(true);
+ $.add(file.text, file.videoControls);
+ }
+ thumb.parentNode.removeAttribute('href');
+ thumb.parentNode.removeAttribute('target');
+ el.loop = true;
+ Volume.setup(el);
+ ImageExpand.setupVideoCB(post);
+ }
+ if (!isVideo) {
+ return $.asap((function() {
+ return el.naturalHeight;
+ }), function() {
+ return ImageExpand.completeExpand(post);
+ });
+ } else if (el.readyState >= el.HAVE_METADATA) {
+ return ImageExpand.completeExpand(post);
+ } else {
+ return $.on(el, 'loadedmetadata', function() {
+ return ImageExpand.completeExpand(post);
+ });
+ }
+ },
+ completeExpand: function(post) {
+ var bottom, file, imageBottom, oldHeight, scrollY;
+ file = post.file;
+ if (!file.isExpanding) {
+ return;
+ }
+ bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height;
+ oldHeight = d.body.clientHeight;
+ scrollY = window.scrollY;
+ $.addClass(post.nodes.root, 'expanded-image');
+ $.rmClass(file.thumb, 'expanding');
+ file.isExpanded = true;
+ delete file.isExpanding;
+ if (doc.contains(post.nodes.root) && bottom <= 0) {
+ window.scroll(window.scrollX, scrollY + d.body.clientHeight - oldHeight);
+ }
+ if (file.scrollIntoView) {
+ delete file.scrollIntoView;
+ imageBottom = Math.min(doc.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header.getBottomOf(file.fullImage));
+ if (imageBottom < 0) {
+ window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage)));
+ }
+ }
+ if (file.isVideo) {
+ return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']);
+ }
+ },
+ setupVideo: function(post, playing, controls) {
+ var fullImage;
+ fullImage = post.file.fullImage;
+ if (!playing) {
+ fullImage.controls = controls;
+ return;
+ }
+ fullImage.controls = false;
+ $.asap((function() {
+ return doc.contains(fullImage);
+ }), function() {
+ if (!d.hidden && Header.isNodeVisible(fullImage)) {
+ return fullImage.play();
+ } else {
+ return post.file.wasPlaying = true;
+ }
+ });
+ if (controls) {
+ return ImageCommon.addControls(fullImage);
+ }
+ },
+ videoCB: (function() {
+ var mousedown;
+ mousedown = false;
+ return {
+ mouseover: function() {
+ return mousedown = false;
+ },
+ mousedown: function(e) {
+ if (e.button === 0) {
+ return mousedown = true;
+ }
+ },
+ mouseup: function(e) {
+ if (e.button === 0) {
+ return mousedown = false;
+ }
+ },
+ mouseout: function(e) {
+ if (mousedown && e.clientX <= this.getBoundingClientRect().left) {
+ return ImageExpand.toggle(Get.postFromNode(this));
+ }
+ }
+ };
+ })(),
+ setupVideoCB: function(post) {
+ var cb, eventName, ref;
+ ref = ImageExpand.videoCB;
+ for (eventName in ref) {
+ cb = ref[eventName];
+ $.on(post.file.fullImage, eventName, cb);
+ }
+ if (post.file.videoControls) {
+ return $.on(post.file.videoControls.firstElementChild, 'click', function() {
+ return ImageExpand.toggle(post);
+ });
+ }
+ },
+ error: function() {
+ var post;
+ post = Get.postFromNode(this);
+ $.rm(this);
+ delete post.file.fullImage;
+ if (!(post.file.isExpanding || post.file.isExpanded)) {
+ return;
+ }
+ if (ImageCommon.decodeError(this, post)) {
+ return ImageExpand.contract(post);
+ }
+ if (this.src.split('/')[2] !== 'i.4cdn.org') {
+ return ImageExpand.contract(post);
+ }
+ return ImageCommon.error(this, post, 10 * $.SECOND, function(URL) {
+ if (post.file.isExpanding || post.file.isExpanded) {
+ ImageExpand.contract(post);
+ if (URL) {
+ return ImageExpand.expand(post, URL);
+ }
+ }
+ });
+ },
+ menu: {
+ init: function() {
+ var conf, createSubEntry, el, name, ref, subEntries;
+ if (!ImageExpand.enabled) {
+ return;
+ }
+ el = $.el('span', {
+ textContent: 'Image Expansion',
+ className: 'image-expansion-link'
+ });
+ createSubEntry = ImageExpand.menu.createSubEntry;
+ subEntries = [];
+ ref = Config.imageExpansion;
+ for (name in ref) {
+ conf = ref[name];
+ subEntries.push(createSubEntry(name, conf[1]));
+ }
+ return Header.menu.addEntry({
+ el: el,
+ order: 105,
+ subEntries: subEntries
+ });
+ },
+ createSubEntry: function(name, desc) {
+ var input, label;
+ label = UI.checkbox(name, name);
+ label.title = desc;
+ input = label.firstElementChild;
+ if (name === 'Fit width' || name === 'Fit height') {
+ $.on(input, 'change', ImageExpand.cb.setFitness);
+ }
+ $.event('change', null, input);
+ $.on(input, 'change', $.cb.checked);
+ return {
+ el: label
+ };
+ }
+ }
+ };
+
+ return ImageExpand;
+
+}).call(this);
+
+ImageHover = (function() {
+ var ImageHover;
+
+ ImageHover = {
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ if (Conf['Image Hover']) {
+ Callbacks.Post.push({
+ name: 'Image Hover',
+ cb: this.node
+ });
+ }
+ if (Conf['Image Hover in Catalog']) {
+ return Callbacks.CatalogThread.push({
+ name: 'Image Hover',
+ cb: this.catalogNode
+ });
+ }
+ },
+ node: function() {
+ if (!(this.file && (this.file.isImage || this.file.isVideo))) {
+ return;
+ }
+ return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover(this));
+ },
+ catalogNode: function() {
+ var file;
+ file = this.thread.OP.file;
+ if (!(file && (file.isImage || file.isVideo))) {
+ return;
+ }
+ return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover(this.thread.OP));
+ },
+ mouseover: function(post) {
+ return function(e) {
+ var el, error, file, height, isVideo, left, maxHeight, maxWidth, ref, ref1, ref2, right, scale, width, x;
+ if (!doc.contains(this)) {
+ return;
+ }
+ file = post.file;
+ isVideo = file.isVideo;
+ if (file.isExpanding || file.isExpanded) {
+ return;
+ }
+ error = ImageHover.error(post);
+ if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) {
+ el = ImageCommon.popCache();
+ $.on(el, 'error', error);
+ } else {
+ el = $.el((isVideo ? 'video' : 'img'));
+ el.dataset.fullID = post.fullID;
+ $.on(el, 'error', error);
+ el.src = file.url;
+ }
+ if (Conf['Restart when Opened']) {
+ ImageCommon.rewind(el);
+ ImageCommon.rewind(this);
+ }
+ el.id = 'ihover';
+ $.add(Header.hover, el);
+ if (isVideo) {
+ el.loop = true;
+ el.controls = false;
+ Volume.setup(el);
+ if (Conf['Autoplay']) {
+ el.play();
+ }
+ }
+ ref1 = (function() {
+ var i, len, ref1, results;
+ ref1 = file.dimensions.split('x');
+ results = [];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ x = ref1[i];
+ results.push(+x);
+ }
+ return results;
+ })(), width = ref1[0], height = ref1[1];
+ ref2 = this.getBoundingClientRect(), left = ref2.left, right = ref2.right;
+ maxWidth = Math.max(left, doc.clientWidth - right);
+ maxHeight = doc.clientHeight - UI.hover.padding;
+ scale = Math.min(1, maxWidth / width, maxHeight / height);
+ el.style.maxWidth = (scale * width) + "px";
+ el.style.maxHeight = (scale * height) + "px";
+ return UI.hover({
+ root: this,
+ el: el,
+ latestEvent: e,
+ endEvents: 'mouseout click',
+ height: scale * height,
+ noRemove: true,
+ cb: function() {
+ $.off(el, 'error', error);
+ ImageCommon.pushCache(el);
+ ImageCommon.pause(el);
+ $.rm(el);
+ return el.removeAttribute('style');
+ }
+ });
+ };
+ },
+ error: function(post) {
+ return function() {
+ if (ImageCommon.decodeError(this, post)) {
+ return;
+ }
+ return ImageCommon.error(this, post, 3 * $.SECOND, (function(_this) {
+ return function(URL) {
+ if (URL) {
+ return _this.src = URL + (_this.src === URL ? '?' + Date.now() : '');
+ } else {
+ return $.rm(_this);
+ }
+ };
+ })(this));
+ };
+ }
+ };
+
+ return ImageHover;
+
+}).call(this);
+
+ImageLoader = (function() {
+ var ImageLoader,
+ slice = [].slice;
+
+ ImageLoader = {
+ init: function() {
+ var prefetch, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Image Replace',
+ cb: this.node
+ });
+ $.on(d, 'PostsInserted', function() {
+ return g.posts.forEach(ImageLoader.prefetch);
+ });
+ if (Conf['Replace WEBM']) {
+ $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
+ }
+ if (!Conf['Image Prefetching']) {
+ return;
+ }
+ prefetch = $.el('label', {
+ innerHTML: "
Prefetch Images"
+ });
+ this.el = prefetch.firstElementChild;
+ $.on(this.el, 'change', this.toggle);
+ return Header.menu.addEntry({
+ el: prefetch,
+ order: 98
+ });
+ },
+ node: function() {
+ if (this.isClone || !this.file) {
+ return;
+ }
+ if (Conf['Replace WEBM'] && this.file.isVideo) {
+ ImageLoader.replaceVideo(this);
+ }
+ return ImageLoader.prefetch(this);
+ },
+ replaceVideo: function(post) {
+ var attr, file, i, len, ref, thumb, video;
+ file = post.file;
+ thumb = file.thumb;
+ video = $.el('video', {
+ preload: 'none',
+ loop: true,
+ muted: true,
+ poster: thumb.src || thumb.dataset.src,
+ textContent: thumb.alt,
+ className: thumb.className
+ });
+ video.setAttribute('muted', 'muted');
+ video.dataset.md5 = thumb.dataset.md5;
+ ref = ['height', 'width', 'maxHeight', 'maxWidth'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ attr = ref[i];
+ video.style[attr] = thumb.style[attr];
+ }
+ video.src = file.url;
+ $.replace(thumb, video);
+ file.thumb = video;
+ return file.videoThumb = true;
+ },
+ prefetch: function(post) {
+ var clone, el, file, i, isImage, isVideo, len, match, ref, replace, thumb, type, url;
+ file = post.file;
+ if (!file) {
+ return;
+ }
+ isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, url = file.url;
+ if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) {
+ return;
+ }
+ type = (match = url.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
+ replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src);
+ if (!(replace || Conf['prefetch'])) {
+ return;
+ }
+ if (![post].concat(slice.call(post.clones)).some(function(clone) {
+ return doc.contains(clone.nodes.root);
+ })) {
+ return;
+ }
+ file.isPrefetched = true;
+ if (file.videoThumb) {
+ ref = post.clones;
+ for (i = 0, len = ref.length; i < len; i++) {
+ clone = ref[i];
+ clone.file.thumb.preload = 'auto';
+ }
+ thumb.preload = 'auto';
+ if ($.engine === 'gecko') {
+ $.on(thumb, 'loadeddata', function() {
+ return this.removeAttribute('poster');
+ });
+ }
+ return;
+ }
+ el = $.el(isImage ? 'img' : 'video');
+ if (replace && isImage) {
+ $.on(el, 'load', function() {
+ var j, len1, ref1;
+ ref1 = post.clones;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ clone = ref1[j];
+ clone.file.thumb.src = url;
+ }
+ thumb.src = url;
+ return thumb.removeAttribute('data-src');
+ });
+ }
+ return el.src = url;
+ },
+ toggle: function() {
+ if (Conf['prefetch'] = this.checked) {
+ g.posts.forEach(ImageLoader.prefetch);
+ }
+ },
+ playVideos: function() {
+ var qpClone, ref;
+ qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0;
+ return g.posts.forEach(function(post) {
+ var i, len, ref1, ref2, thumb;
+ ref1 = [post].concat(slice.call(post.clones));
+ for (i = 0, len = ref1.length; i < len; i++) {
+ post = ref1[i];
+ if (!((ref2 = post.file) != null ? ref2.videoThumb : void 0)) {
+ continue;
+ }
+ thumb = post.file.thumb;
+ if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) {
+ thumb.play();
+ } else {
+ thumb.pause();
+ }
+ }
+ });
+ }
+ };
+
+ return ImageLoader;
+
+}).call(this);
+
+Metadata = (function() {
+ var Metadata;
+
+ Metadata = {
+ init: function() {
+ var ref;
+ if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'WEBM Metadata',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var el;
+ if (!(this.file && /webm$/i.test(this.file.url))) {
+ return;
+ }
+ if (this.isClone) {
+ el = $('.webm-title', this.file.text);
+ } else {
+ el = $.el('span', {
+ className: 'webm-title'
+ });
+ $.extend(el, {
+ innerHTML: "
"
+ });
+ $.add(this.file.text, [$.tn('\u00A0'), el]);
+ }
+ if (el.children.length === 1) {
+ return $.one(el.lastElementChild, 'mouseover focus', Metadata.load);
+ }
+ },
+ load: function() {
+ $.rmClass(this.parentNode, 'error');
+ $.addClass(this.parentNode, 'loading');
+ return CrossOrigin.binary(Get.postFromNode(this).file.url, (function(_this) {
+ return function(data) {
+ var output, title;
+ $.rmClass(_this.parentNode, 'loading');
+ if (data != null) {
+ title = Metadata.parse(data);
+ output = $.el('span', {
+ textContent: title || ''
+ });
+ if (title == null) {
+ $.addClass(_this.parentNode, 'not-found');
+ }
+ $.before(_this, output);
+ _this.parentNode.tabIndex = 0;
+ if (d.activeElement === _this) {
+ _this.parentNode.focus();
+ }
+ return _this.tabIndex = -1;
+ } else {
+ $.addClass(_this.parentNode, 'error');
+ return $.one(_this, 'click', Metadata.load);
+ }
+ };
+ })(this), {
+ Range: 'bytes=0-9999'
+ });
+ },
+ parse: function(data) {
+ var element, i, readInt, size, title;
+ readInt = function() {
+ var len, n;
+ n = data[i++];
+ len = 0;
+ while (n < (0x80 >> len)) {
+ len++;
+ }
+ n ^= 0x80 >> len;
+ while (len-- && i < data.length) {
+ n = (n << 8) ^ data[i++];
+ }
+ return n;
+ };
+ i = 0;
+ while (i < data.length) {
+ element = readInt();
+ size = readInt();
+ if (element === 0x3BA9) {
+ title = '';
+ while (size-- && i < data.length) {
+ title += String.fromCharCode(data[i++]);
+ }
+ return decodeURIComponent(escape(title));
+ } else if (element !== 0x8538067 && element !== 0x549A966) {
+ i += size;
+ }
+ }
+ return null;
+ }
+ };
+
+ return Metadata;
+
+}).call(this);
+
+RevealSpoilers = (function() {
+ var RevealSpoilers;
+
+ RevealSpoilers = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Reveal Spoiler Thumbnails'])) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Reveal Spoiler Thumbnails',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var thumb;
+ if (!(!this.isClone && this.file && this.file.thumb && this.file.isSpoiler)) {
+ return;
+ }
+ thumb = this.file.thumb;
+ thumb.removeAttribute('style');
+ thumb.style.maxHeight = thumb.style.maxWidth = this.isReply ? '125px' : '250px';
+ if (thumb.src) {
+ return thumb.src = this.file.thumbURL;
+ } else {
+ return thumb.dataset.src = this.file.thumbURL;
+ }
+ }
+ };
+
+ return RevealSpoilers;
+
+}).call(this);
+
+Sauce = (function() {
+ var Sauce,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Sauce = {
+ init: function() {
+ var err, j, len, link, links, ref, ref1;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) {
+ return;
+ }
+ links = [];
+ ref1 = Conf['sauces'].split('\n');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ link = ref1[j];
+ try {
+ if (link[0] !== '#') {
+ links.push(link.trim());
+ }
+ } catch (_error) {
+ err = _error;
+ }
+ }
+ if (!links.length) {
+ return;
+ }
+ this.links = links;
+ this.link = $.el('a', {
+ target: '_blank',
+ className: 'sauce'
+ });
+ return Callbacks.Post.push({
+ name: 'Sauce',
+ cb: this.node
+ });
+ },
+ sandbox: function(url) {
+ return E.url({
+ innerHTML: "
[sb] " + E(url) + " "
+ });
+ },
+ rmOrigin: function(e) {
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ $.open(this.href);
+ return e.preventDefault();
+ },
+ createSauceLink: function(link, post) {
+ var a, ext, i, j, key, len, m, part, parts, ref, ref1, ref2, skip, url;
+ if (!(link = link.trim())) {
+ return null;
+ }
+ parts = {};
+ ref = link.split(/;(?=(?:text|boards|types|sandbox):?)/);
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ part = ref[i];
+ if (i === 0) {
+ parts['url'] = part;
+ } else {
+ m = part.match(/^(\w*):?(.*)$/);
+ parts[m[1]] = m[2];
+ }
+ }
+ parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
+ ext = post.file.url.match(/[^.]*$/)[0];
+ skip = false;
+ for (key in parts) {
+ parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi)/g, function(_, parameter) {
+ var type;
+ type = Sauce.formatters[parameter](post, ext);
+ if (type == null) {
+ skip = true;
+ return '';
+ }
+ if (key === 'url' && (parameter !== '%' && parameter !== 'semi')) {
+ if (/^javascript:/i.test(parts['url'])) {
+ type = JSON.stringify(type);
+ }
+ type = encodeURIComponent(type);
+ }
+ return type;
+ });
+ }
+ if (skip) {
+ return null;
+ }
+ if (!(!parts['boards'] || (ref2 = post.board.ID, indexOf.call(parts['boards'].split(','), ref2) >= 0))) {
+ return null;
+ }
+ if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
+ return null;
+ }
+ url = parts['url'];
+ if (parts['sandbox'] != null) {
+ url = Sauce.sandbox(url);
+ }
+ a = Sauce.link.cloneNode(true);
+ a.href = url;
+ a.textContent = parts['text'];
+ if (/^javascript:/i.test(parts['url'])) {
+ a.removeAttribute('target');
+ }
+ if (parts['sandbox'] != null) {
+ $.on(a, 'click', Sauce.rmOrigin);
+ }
+ return a;
+ },
+ node: function() {
+ var j, len, link, node, nodes, ref;
+ if (this.isClone || !this.file) {
+ return;
+ }
+ nodes = [];
+ ref = Sauce.links;
+ for (j = 0, len = ref.length; j < len; j++) {
+ link = ref[j];
+ if (node = Sauce.createSauceLink(link, this)) {
+ nodes.push($.tn('\u00A0'), node);
+ }
+ }
+ return $.add(this.file.text, nodes);
+ },
+ formatters: {
+ TURL: function(post) {
+ return post.file.thumbURL;
+ },
+ URL: function(post) {
+ return post.file.url;
+ },
+ IMG: function(post, ext) {
+ if (ext === 'gif' || ext === 'jpg' || ext === 'png') {
+ return post.file.url;
+ } else {
+ return post.file.thumbURL;
+ }
+ },
+ MD5: function(post) {
+ return post.file.MD5;
+ },
+ sMD5: function(post) {
+ var ref;
+ return (ref = post.file.MD5) != null ? ref.replace(/[+\/=]/g, function(c) {
+ return {
+ '+': '-',
+ '/': '_',
+ '=': ''
+ }[c];
+ }) : void 0;
+ },
+ hMD5: function(post) {
+ var c;
+ if (post.file.MD5) {
+ return ((function() {
+ var j, len, ref, results;
+ ref = atob(post.file.MD5);
+ results = [];
+ for (j = 0, len = ref.length; j < len; j++) {
+ c = ref[j];
+ results.push(("0" + (c.charCodeAt(0).toString(16))).slice(-2));
+ }
+ return results;
+ })()).join('');
+ }
+ },
+ board: function(post) {
+ return post.board.ID;
+ },
+ name: function(post) {
+ return post.file.name;
+ },
+ '%': function() {
+ return '%';
+ },
+ semi: function() {
+ return ';';
+ }
+ }
+ };
+
+ return Sauce;
+
+}).call(this);
+
+Volume = (function() {
+ var Volume;
+
+ Volume = {
+ init: function() {
+ var ref, ref1, unmuteEntry, volumeEntry;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) {
+ return;
+ }
+ $.sync('Allow Sound', function(x) {
+ var ref1;
+ Conf['Allow Sound'] = x;
+ return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0;
+ });
+ $.sync('Default Volume', function(x) {
+ var ref1;
+ Conf['Default Volume'] = x;
+ return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0;
+ });
+ if (Conf['Mouse Wheel Volume']) {
+ Callbacks.Post.push({
+ name: 'Mouse Wheel Volume',
+ cb: this.node
+ });
+ }
+ if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg') {
+ return;
+ }
+ if (Conf['Mouse Wheel Volume']) {
+ Callbacks.CatalogThread.push({
+ name: 'Mouse Wheel Volume',
+ cb: this.catalogNode
+ });
+ }
+ unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound');
+ unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1];
+ volumeEntry = $.el('label', {
+ title: 'Default volume for videos.'
+ });
+ $.extend(volumeEntry, {
+ innerHTML: "
Volume"
+ });
+ this.inputs = {
+ unmute: unmuteEntry.firstElementChild,
+ volume: volumeEntry.firstElementChild
+ };
+ $.on(this.inputs.unmute, 'change', $.cb.checked);
+ $.on(this.inputs.volume, 'change', $.cb.value);
+ Header.menu.addEntry({
+ el: unmuteEntry,
+ order: 200
+ });
+ return Header.menu.addEntry({
+ el: volumeEntry,
+ order: 201
+ });
+ },
+ setup: function(video) {
+ video.muted = !Conf['Allow Sound'];
+ video.volume = Conf['Default Volume'];
+ return $.on(video, 'volumechange', Volume.change);
+ },
+ change: function() {
+ var items, key, muted, val, volume;
+ muted = this.muted, volume = this.volume;
+ items = {
+ 'Allow Sound': !muted,
+ 'Default Volume': volume
+ };
+ for (key in items) {
+ val = items[key];
+ if (Conf[key] === val) {
+ delete items[key];
+ }
+ }
+ $.set(items);
+ $.extend(Conf, items);
+ if (Volume.inputs) {
+ Volume.inputs.unmute.checked = !muted;
+ return Volume.inputs.volume.value = volume;
+ }
+ },
+ node: function() {
+ var ref, ref1;
+ if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) {
+ return;
+ }
+ $.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover));
+ return $.on($('a', this.file.text), 'wheel', Volume.wheel.bind(this.file.thumb.parentNode));
+ },
+ catalogNode: function() {
+ var file;
+ file = this.thread.OP.file;
+ if (!(file != null ? file.isVideo : void 0)) {
+ return;
+ }
+ return $.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header.hover));
+ },
+ wheel: function(e) {
+ var el, volume;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
+ return;
+ }
+ if (!(el = $('video:not([data-md5])', this))) {
+ return;
+ }
+ if (el.muted || !$.hasAudio(el)) {
+ return;
+ }
+ volume = el.volume + 0.1;
+ if (e.deltaY < 0) {
+ volume *= 1.1;
+ }
+ if (e.deltaY > 0) {
+ volume /= 1.1;
+ }
+ el.volume = $.minmax(volume - 0.1, 0, 1);
+ return e.preventDefault();
+ }
+ };
+
+ return Volume;
+
+}).call(this);
+
+Embedding = (function() {
+ var Embedding;
+
+ Embedding = {
+ init: function() {
+ var j, len, ref, type;
+ if (!(Conf['Embedding'] || Conf['Link Title'])) {
+ return;
+ }
+ this.types = {};
+ ref = this.ordered_types;
+ for (j = 0, len = ref.length; j < len; j++) {
+ type = ref[j];
+ this.types[type.key] = type;
+ }
+ if (Conf['Floating Embeds']) {
+ this.dialog = UI.dialog('embedding', 'top: 50px; right: 0px;', {
+ innerHTML: "
"
+ });
+ this.media = $('#media-embed', this.dialog);
+ $.one(d, '4chanXInitFinished', this.ready);
+ }
+ if (Conf['Link Title']) {
+ return $.on(d, '4chanXInitFinished PostsInserted', function() {
+ var key, ref1, ref2, service;
+ ref1 = Embedding.types;
+ for (key in ref1) {
+ service = ref1[key];
+ if ((ref2 = service.title) != null ? ref2.batchSize : void 0) {
+ Embedding.flushTitles(service.title);
+ }
+ }
+ });
+ }
+ },
+ events: function(post) {
+ var el, i, items;
+ if (!Conf['Embedding']) {
+ return;
+ }
+ i = 0;
+ items = $$('.embedder', post.nodes.comment);
+ while (el = items[i++]) {
+ $.on(el, 'click', Embedding.cb.toggle);
+ if ($.hasClass(el, 'embedded')) {
+ Embedding.cb.toggle.call(el);
+ }
+ }
+ },
+ process: function(link, post) {
+ var data;
+ if (!(Conf['Embedding'] || Conf['Link Title'])) {
+ return;
+ }
+ if ($.x('ancestor::pre', link)) {
+ return;
+ }
+ if (data = Embedding.services(link)) {
+ data.post = post;
+ if (Conf['Embedding']) {
+ Embedding.embed(data);
+ }
+ if (Conf['Link Title']) {
+ return Embedding.title(data);
+ }
+ }
+ },
+ services: function(link) {
+ var href, j, len, match, ref, type;
+ href = link.href;
+ ref = Embedding.ordered_types;
+ for (j = 0, len = ref.length; j < len; j++) {
+ type = ref[j];
+ if (!(match = type.regExp.exec(href))) {
+ continue;
+ }
+ if (type.dummy) {
+ return;
+ }
+ return {
+ key: type.key,
+ uid: match[1],
+ options: match[2],
+ link: link
+ };
+ }
+ },
+ embed: function(data) {
+ var embed, href, key, link, name, options, post, ref, uid, value;
+ key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
+ href = link.href;
+ if (Embedding.types[key].httpOnly && location.protocol !== 'http:') {
+ return;
+ }
+ $.addClass(link, key.toLowerCase());
+ embed = $.el('a', {
+ className: 'embedder',
+ href: 'javascript:;',
+ textContent: '(embed)'
+ });
+ ref = {
+ key: key,
+ uid: uid,
+ options: options,
+ href: href
+ };
+ for (name in ref) {
+ value = ref[name];
+ embed.dataset[name] = value;
+ }
+ $.on(embed, 'click', Embedding.cb.toggle);
+ $.after(link, [$.tn(' '), embed]);
+ if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote && key !== 'TwitchTV') {
+ return $.asap((function() {
+ return doc.contains(embed);
+ }), function() {
+ return Embedding.cb.toggle.call(embed);
+ });
+ }
+ },
+ ready: function() {
+ $.addClass(Embedding.dialog, 'empty');
+ $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat);
+ $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed);
+ $.on($('.jump', Embedding.dialog), 'click', function() {
+ if (doc.contains(Embedding.lastEmbed)) {
+ return Header.scrollTo(Embedding.lastEmbed);
+ }
+ });
+ return $.add(d.body, Embedding.dialog);
+ },
+ closeFloat: function() {
+ delete Embedding.lastEmbed;
+ $.addClass(Embedding.dialog, 'empty');
+ return $.replace(Embedding.media.firstChild, $.el('div'));
+ },
+ dragEmbed: function() {
+ var style;
+ style = Embedding.media.style;
+ if (Embedding.dragEmbed.mouseup) {
+ $.off(d, 'mouseup', Embedding.dragEmbed);
+ Embedding.dragEmbed.mouseup = false;
+ style.visibility = '';
+ return;
+ }
+ $.on(d, 'mouseup', Embedding.dragEmbed);
+ Embedding.dragEmbed.mouseup = true;
+ return style.visibility = 'hidden';
+ },
+ title: function(data) {
+ var key, link, options, post, service, uid;
+ key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
+ if (!(service = Embedding.types[key].title)) {
+ return;
+ }
+ $.addClass(link, key.toLowerCase());
+ if (service.batchSize) {
+ (service.queue || (service.queue = [])).push(data);
+ if (service.queue.length >= service.batchSize) {
+ return Embedding.flushTitles(service);
+ }
+ } else {
+ if (!$.cache(service.api(uid), (function() {
+ return Embedding.cb.title(this, data);
+ }), {
+ responseType: 'json'
+ })) {
+ return $.extend(link, {
+ innerHTML: "[" + E(key) + "]
Title Link Blocked (are you using NoScript?)"
+ });
+ }
+ }
+ },
+ flushTitles: function(service) {
+ var cb, data, j, len, queue;
+ queue = service.queue;
+ if (!(queue != null ? queue.length : void 0)) {
+ return;
+ }
+ service.queue = [];
+ cb = function() {
+ var data, j, len;
+ for (j = 0, len = queue.length; j < len; j++) {
+ data = queue[j];
+ Embedding.cb.title(this, data);
+ }
+ };
+ if (!$.cache(service.api((function() {
+ var j, len, results;
+ results = [];
+ for (j = 0, len = queue.length; j < len; j++) {
+ data = queue[j];
+ results.push(data.uid);
+ }
+ return results;
+ })()), cb, {
+ responseType: 'json'
+ })) {
+ for (j = 0, len = queue.length; j < len; j++) {
+ data = queue[j];
+ $.extend(data.link, {
+ innerHTML: "[" + E(data.key) + "]
Title Link Blocked (are you using NoScript?)"
+ });
+ }
+ }
+ },
+ cb: {
+ toggle: function(e) {
+ var div;
+ if (e != null) {
+ e.preventDefault();
+ }
+ if (Conf['Floating Embeds']) {
+ if (!(div = Embedding.media.firstChild)) {
+ return;
+ }
+ $.replace(div, Embedding.cb.embed(this));
+ Embedding.lastEmbed = Get.postFromNode(this).nodes.root;
+ $.rmClass(Embedding.dialog, 'empty');
+ return;
+ }
+ if ($.hasClass(this, "embedded")) {
+ $.rm(this.nextElementSibling);
+ this.textContent = '(embed)';
+ } else {
+ $.after(this, Embedding.cb.embed(this));
+ this.textContent = '(unembed)';
+ }
+ return $.toggleClass(this, 'embedded');
+ },
+ embed: function(a) {
+ var container, el, type;
+ container = $.el('div');
+ $.add(container, el = (type = Embedding.types[a.dataset.key]).el(a));
+ el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;';
+ return container;
+ },
+ title: function(req, data) {
+ var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
+ key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
+ status = req.status;
+ service = Embedding.types[key].title;
+ text = "[" + key + "] " + ((function() {
+ switch (status) {
+ case 200:
+ case 304:
+ return service.text(req.response, uid);
+ case 404:
+ return "Not Found";
+ case 403:
+ return "Forbidden or Private";
+ default:
+ return status + "'d";
+ }
+ })());
+ link.dataset.original = link.textContent;
+ link.textContent = text;
+ ref = post.clones;
+ for (j = 0, len = ref.length; j < len; j++) {
+ post2 = ref[j];
+ ref1 = $$('a.linkify', post2.nodes.comment);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ link2 = ref1[k];
+ if (!(link2.href === link.href)) {
+ continue;
+ }
+ if ((base1 = link2.dataset).original == null) {
+ base1.original = link2.textContent;
+ }
+ link2.textContent = text;
+ }
+ }
+ }
+ },
+ ordered_types: [
+ {
+ key: 'audio',
+ regExp: /\.(?:mp3|ogg|wav)(?:\?|$)/i,
+ style: '',
+ el: function(a) {
+ return $.el('audio', {
+ controls: true,
+ preload: 'auto',
+ src: a.dataset.href
+ });
+ }
+ }, {
+ key: 'Dailymotion',
+ regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/,
+ el: function(a) {
+ var el, options, start;
+ options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? "?" + start[1] : '';
+ el = $.el('iframe', {
+ src: "//www.dailymotion.com/embed/video/" + a.dataset.uid + options
+ });
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ api: function(uid) {
+ return "https://api.dailymotion.com/video/" + uid;
+ },
+ text: function(_) {
+ return _.title;
+ }
+ }
+ }, {
+ key: 'Gist',
+ regExp: /^\w+:\/\/gist\.github\.com\/(?:[\w\-]+\/)?(\w+)/,
+ el: function(a) {
+ var content, el;
+ el = $.el('iframe');
+ el.setAttribute('sandbox', 'allow-scripts');
+ content = {
+ innerHTML: "
" + E(a.dataset.uid) + " "
+ };
+ el.src = E.url(content);
+ return el;
+ },
+ title: {
+ api: function(uid) {
+ return "https://api.github.com/gists/" + uid;
+ },
+ text: function(arg) {
+ var file, files;
+ files = arg.files;
+ for (file in files) {
+ if (files.hasOwnProperty(file)) {
+ return file;
+ }
+ }
+ }
+ }
+ }, {
+ key: 'image',
+ regExp: /\.(?:gif|png|jpg|jpeg|bmp)(?:\?|$)/i,
+ style: '',
+ el: function(a) {
+ return $.el('div', {
+ innerHTML: "
"
+ });
+ }
+ }, {
+ key: 'InstallGentoo',
+ regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'Twitter',
+ regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'LiveLeak',
+ regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*i=(\w+)/,
+ httpOnly: true,
+ el: function(a) {
+ var el;
+ el = $.el('iframe', {
+ src: "http://www.liveleak.com/ll_embed?i=" + a.dataset.uid
+ });
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ }
+ }, {
+ key: 'Pastebin',
+ regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
+ httpOnly: true,
+ el: function(a) {
+ var div;
+ return div = $.el('iframe', {
+ src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'Gfycat',
+ regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
+ el: function(a) {
+ var div;
+ return div = $.el('iframe', {
+ src: "//gfycat.com/iframe/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'SoundCloud',
+ regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/,
+ style: 'border: 0; width: 500px; height: 400px;',
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(a.dataset.uid))
+ });
+ },
+ title: {
+ api: function(uid) {
+ return "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(uid));
+ },
+ text: function(_) {
+ return _.title;
+ }
+ }
+ }, {
+ key: 'StrawPoll',
+ regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
+ style: 'border: 0; width: 600px; height: 406px;',
+ el: function(a) {
+ return $.el('iframe', {
+ src: "//strawpoll.me/embed_1/" + a.dataset.uid
+ });
+ }
+ }, {
+ key: 'TwitchTV',
+ regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/(\w[^#\&\?]*)/,
+ style: "border: none; width: 620px; height: 378px;",
+ el: function(a) {
+ var _, channel, flashvars, id, idprefix, j, len, obj, part, ref, result, seconds, start, type;
+ if (result = /(\w+)\/([bcv])\/(\d+)/i.exec(a.dataset.uid)) {
+ _ = result[0], channel = result[1], type = result[2], id = result[3];
+ idprefix = type === 'b' ? 'a' : type;
+ flashvars = "channel=" + channel + "&start_volume=25&auto_play=false&videoId=" + idprefix + id;
+ if (start = a.dataset.href.match(/\bt=(\w+)/)) {
+ seconds = 0;
+ ref = start[1].match(/\d+[hms]/g);
+ for (j = 0, len = ref.length; j < len; j++) {
+ part = ref[j];
+ seconds += +part.slice(0, -1) * {
+ 'h': 3600,
+ 'm': 60,
+ 's': 1
+ }[part.slice(-1)];
+ }
+ flashvars += "&initial_time=" + seconds;
+ }
+ } else {
+ channel = (/(\w+)/.exec(a.dataset.uid))[0];
+ flashvars = "channel=" + channel + "&start_volume=25&auto_play=false";
+ }
+ obj = $.el('object', {
+ data: '//www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf'
+ });
+ $.extend(obj, {
+ innerHTML: "
"
+ });
+ obj.children[1].value = flashvars;
+ return obj;
+ }
+ }, {
+ key: 'Vocaroo',
+ regExp: /^\w+:\/\/(?:www\.)?vocaroo\.com\/i\/(\w+)/,
+ style: '',
+ el: function(a) {
+ var el, type;
+ el = $.el('audio', {
+ controls: true,
+ preload: 'auto'
+ });
+ type = el.canPlayType('audio/webm') ? 'webm' : 'mp3';
+ el.src = "http://vocaroo.com/media_command.php?media=" + a.dataset.uid + "&command=download_" + type;
+ return el;
+ }
+ }, {
+ key: 'Vimeo',
+ regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "//player.vimeo.com/video/" + a.dataset.uid + "?wmode=opaque"
+ });
+ },
+ title: {
+ api: function(uid) {
+ return "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" + uid;
+ },
+ text: function(_) {
+ return _.title;
+ }
+ }
+ }, {
+ key: 'Vine',
+ regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/,
+ style: 'border: none; width: 500px; height: 500px;',
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://vine.co/v/" + a.dataset.uid + "/card"
+ });
+ }
+ }, {
+ key: 'YouTube',
+ regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/))([\w\-]{11})(.*)/,
+ el: function(a) {
+ var el, start;
+ start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/);
+ if (start) {
+ start = start[1];
+ }
+ if (start && !/^\d+$/.test(start)) {
+ start += ' 0h0m0s';
+ start = 3600 * start.match(/(\d+)h/)[1] + 60 * start.match(/(\d+)m/)[1] + 1 * start.match(/(\d+)s/)[1];
+ }
+ el = $.el('iframe', {
+ src: "//www.youtube.com/embed/" + a.dataset.uid + "?wmode=opaque" + (start ? '&start=' + start : '')
+ });
+ el.setAttribute("allowfullscreen", "true");
+ return el;
+ },
+ title: {
+ batchSize: 50,
+ api: function(uids) {
+ var ids, key;
+ ids = encodeURIComponent(uids.join(','));
+ key = 'AIzaSyB5_zaen_-46Uhz1xGR-lz1YoUMHqCD6CE';
+ return "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + ids + "&fields=items%28id%2Csnippet%28title%29%29&key=" + key;
+ },
+ text: function(data, uid) {
+ var item, j, len, ref;
+ ref = data.items;
+ for (j = 0, len = ref.length; j < len; j++) {
+ item = ref[j];
+ if (item.id === uid) {
+ return item.snippet.title;
+ }
+ }
+ return 'Not Found';
+ }
+ }
+ }, {
+ key: 'Loopvid',
+ regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|pc|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el: function(a) {
+ var _, base, el, host, j, k, len, len1, name, names, ref, ref1, type, types, url;
+ el = $.el('video', {
+ controls: true,
+ preload: 'auto',
+ loop: true
+ });
+ ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
+ types = (function() {
+ switch (host) {
+ case 'gd':
+ case 'wu':
+ case 'fc':
+ return [''];
+ case 'gc':
+ return ['giant', 'fat', 'zippy'];
+ default:
+ return ['.webm', '.mp4'];
+ }
+ })();
+ ref1 = names.split(',');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ name = ref1[j];
+ for (k = 0, len1 = types.length; k < len1; k++) {
+ type = types[k];
+ base = "" + name + type;
+ url = (function() {
+ switch (host) {
+ case 'pf':
+ return "https://web.archive.org/web/2/http://a.pomf.se/" + base;
+ case 'kd':
+ return "http://kastden.org/loopvid/" + base;
+ case 'lv':
+ return "http://kastden.org/_loopvid_media/lv/" + base;
+ case 'gd':
+ return "https://docs.google.com/uc?export=download&id=" + base;
+ case 'gh':
+ return "https://googledrive.com/host/" + base;
+ case 'db':
+ return "https://dl.dropboxusercontent.com/u/" + base;
+ case 'dx':
+ return "https://dl.dropboxusercontent.com/" + base;
+ case 'nn':
+ return "http://naenara.eu/loopvids/" + base;
+ case 'cp':
+ return "https://copy.com/" + base;
+ case 'wu':
+ return "http://webmup.com/" + base + "/vid.webm";
+ case 'ig':
+ return "https://i.imgur.com/" + base;
+ case 'ky':
+ return "https://kiyo.me/" + base;
+ case 'mf':
+ return "https://d.maxfile.ro/" + base;
+ case 'pc':
+ return "http://a.pomf.cat/" + base;
+ case 'fc':
+ return "//i.4cdn.org/" + base + ".webm";
+ case 'gc':
+ return "https://" + type + ".gfycat.com/" + name + ".webm";
+ }
+ })();
+ $.add(el, $.el('source', {
+ src: url
+ }));
+ }
+ }
+ return el;
+ }
+ }, {
+ key: 'Clyp',
+ regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w+)/,
+ style: '',
+ el: function(a) {
+ var el, type;
+ el = $.el('audio', {
+ controls: true,
+ preload: 'auto'
+ });
+ type = el.canPlayType('audio/ogg') ? 'ogg' : 'mp3';
+ el.src = "https://clyp.it/" + a.dataset.uid + "." + type;
+ return el;
+ }
+ }, {
+ key: 'Loopvid-dummy',
+ regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\//,
+ dummy: true
+ }, {
+ key: 'MediaFire-dummy',
+ regExp: /^\w+:\/\/(?:www\.)?mediafire.com\//,
+ dummy: true
+ }, {
+ key: 'video',
+ regExp: /\.(?:ogv|webm|mp4)(?:\?|$)/i,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el: function(a) {
+ return $.el('video', {
+ controls: true,
+ preload: 'auto',
+ src: a.dataset.href,
+ loop: /^https?:\/\/i\.4cdn\.org\//.test(a.dataset.href)
+ });
+ }
+ }
+ ]
+ };
+
+ return Embedding;
+
+}).call(this);
+
+Linkify = (function() {
+ var Linkify;
+
+ Linkify = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Linkify']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ Callbacks.Post.push({
+ name: 'Linkify',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Linkify',
+ cb: this.catalogNode
+ });
+ return Embedding.init();
+ },
+ node: function() {
+ var j, k, len, len1, link, links, ref;
+ if (this.isClone) {
+ return Embedding.events(this);
+ }
+ if (!Linkify.regString.test(this.info.comment)) {
+ return;
+ }
+ ref = $$('a[href^="http://i.4cdn.org/"], a[href^="https://i.4cdn.org/"]', this.nodes.comment);
+ for (j = 0, len = ref.length; j < len; j++) {
+ link = ref[j];
+ $.addClass(link, 'linkify');
+ Embedding.process(link, this);
+ }
+ links = Linkify.process(this.nodes.comment);
+ for (k = 0, len1 = links.length; k < len1; k++) {
+ link = links[k];
+ Embedding.process(link, this);
+ }
+ },
+ catalogNode: function() {
+ if (!Linkify.regString.test(this.thread.OP.info.comment)) {
+ return;
+ }
+ return Linkify.process(this.nodes.comment);
+ },
+ process: function(node) {
+ var data, end, endNode, i, index, length, links, part1, part2, ref, ref1, result, saved, snapshot, space, test, word;
+ test = /[^\s"]+/g;
+ space = /[\s"]/;
+ snapshot = $.X('.//br|.//text()', node);
+ i = 0;
+ links = [];
+ while (node = snapshot.snapshotItem(i++)) {
+ data = node.data;
+ if (!data || node.parentElement.nodeName === "A") {
+ continue;
+ }
+ while (result = test.exec(data)) {
+ index = result.index;
+ endNode = node;
+ word = result[0];
+ if ((length = index + word.length) === data.length) {
+ test.lastIndex = 0;
+ while ((saved = snapshot.snapshotItem(i++))) {
+ if (saved.nodeName === 'BR') {
+ if ((part1 = word.match(/(https?:\/\/)?([a-z\d-]+\.)*[a-z\d-]+$/i)) && (part2 = (ref = snapshot.snapshotItem(i)) != null ? (ref1 = ref.data) != null ? ref1.match(/^(\.[a-z\d-]+)*\//i) : void 0 : void 0) && (part1[0] + part2[0]).search(Linkify.regString) === 0) {
+ continue;
+ } else {
+ break;
+ }
+ }
+ endNode = saved;
+ data = saved.data;
+ if (end = space.exec(data)) {
+ word += data.slice(0, end.index);
+ test.lastIndex = length = end.index;
+ i--;
+ break;
+ } else {
+ length = data.length;
+ word += data;
+ }
+ }
+ }
+ if (Linkify.regString.test(word)) {
+ links.push(Linkify.makeRange(node, endNode, index, length));
+ }
+ if (!(test.lastIndex && node === endNode)) {
+ break;
+ }
+ }
+ }
+ i = links.length;
+ while (i--) {
+ links[i] = Linkify.makeLink(links[i]);
+ }
+ return links;
+ },
+ regString: /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/?])|([-a-z\d]+[.])+(aero|asia|biz|cat|com|coop|dance|info|int|jobs|mobi|moe|museum|name|net|org|post|pro|tel|travel|xxx|xyz|edu|gov|mil|[a-z]{2})([:\/]|(?![^\s"]))|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i,
+ makeRange: function(startNode, endNode, startOffset, endOffset) {
+ var range;
+ range = document.createRange();
+ range.setStart(startNode, startOffset);
+ range.setEnd(endNode, endOffset);
+ return range;
+ },
+ makeLink: function(range) {
+ var a, encodedDomain, i, t, text;
+ text = range.toString();
+ i = text.search(Linkify.regString);
+ if (i > 0) {
+ text = text.slice(i);
+ while (range.startOffset + i >= range.startContainer.data.length) {
+ i--;
+ }
+ if (i) {
+ range.setStart(range.startContainer, range.startOffset + i);
+ }
+ }
+ i = 0;
+ while (/[)\]}>.,]/.test(t = text.charAt(text.length - (1 + i)))) {
+ if (!(/[.,]/.test(t) || (text.match(/[()\[\]{}<>]/g)).length % 2)) {
+ break;
+ }
+ i++;
+ }
+ if (i) {
+ text = text.slice(0, -i);
+ while (range.endOffset - i < 0) {
+ i--;
+ }
+ if (i) {
+ range.setEnd(range.endContainer, range.endOffset - i);
+ }
+ }
+ if (!/((mailto|magnet):|.+:\/\/)/.test(text)) {
+ text = (/@/.test(text) ? 'mailto:' : 'http://') + text;
+ }
+ if (encodedDomain = text.match(/^(https?:\/\/[^\/]*%[0-9a-f]{2})(.*)$/i)) {
+ text = encodedDomain[1].replace(/%([0-9a-f]{2})/ig, function(x, y) {
+ if (y === '25') {
+ return x;
+ } else {
+ return String.fromCharCode(parseInt(y, 16));
+ }
+ }) + encodedDomain[2];
+ }
+ a = $.el('a', {
+ className: 'linkify',
+ rel: 'nofollow noreferrer',
+ target: '_blank',
+ href: text
+ });
+ $.add(a, range.extractContents());
+ range.insertNode(a);
+ return a;
+ }
+ };
+
+ return Linkify;
+
+}).call(this);
+
+ArchiveLink = (function() {
+ var ArchiveLink;
+
+ ArchiveLink = {
+ init: function() {
+ var div, entry, i, len, ref, ref1, type;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) {
+ return;
+ }
+ div = $.el('div', {
+ textContent: 'Archive'
+ });
+ entry = {
+ el: div,
+ order: 90,
+ open: function(arg) {
+ var ID, board, thread;
+ ID = arg.ID, thread = arg.thread, board = arg.board;
+ return !!Redirect.to('thread', {
+ postID: ID,
+ threadID: thread.ID,
+ boardID: board.ID
+ });
+ },
+ subEntries: []
+ };
+ ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ type = ref1[i];
+ entry.subEntries.push(this.createSubEntry(type[0], type[1]));
+ }
+ return Menu.menu.addEntry(entry);
+ },
+ 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,
+ threadID: thread.ID,
+ boardID: board.ID
+ });
+ return true;
+ } : function(post) {
+ var value;
+ value = Filter[type](post);
+ if (!value) {
+ return false;
+ }
+ el.href = Redirect.to('search', {
+ boardID: post.board.ID,
+ type: type,
+ value: value,
+ isSearch: true
+ });
+ return true;
+ };
+ return {
+ el: el,
+ open: open
+ };
+ }
+ };
+
+ return ArchiveLink;
+
+}).call(this);
+
+DeleteLink = (function() {
+ var DeleteLink;
+
+ DeleteLink = {
+ auto: [{}, {}],
+ init: function() {
+ var div, fileEl, fileEntry, postEl, postEntry, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) {
+ return;
+ }
+ div = $.el('div', {
+ className: 'delete-link',
+ textContent: 'Delete'
+ });
+ postEl = $.el('a', {
+ className: 'delete-post',
+ href: 'javascript:;'
+ });
+ fileEl = $.el('a', {
+ className: 'delete-file',
+ href: 'javascript:;'
+ });
+ this.nodes = {
+ menu: div.firstChild,
+ links: [postEl, fileEl]
+ };
+ postEntry = {
+ el: postEl,
+ open: function() {
+ postEl.textContent = DeleteLink.linkText(false);
+ $.on(postEl, 'click', DeleteLink.toggle);
+ return true;
+ }
+ };
+ fileEntry = {
+ el: fileEl,
+ open: function(arg) {
+ var file;
+ file = arg.file;
+ if (!file || file.isDead) {
+ return false;
+ }
+ fileEl.textContent = DeleteLink.linkText(true);
+ $.on(fileEl, 'click', DeleteLink.toggle);
+ return true;
+ }
+ };
+ return Menu.menu.addEntry({
+ el: div,
+ order: 40,
+ open: function(post) {
+ if (post.isDead) {
+ return false;
+ }
+ DeleteLink.post = post;
+ DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
+ DeleteLink.cooldown.start(post);
+ return true;
+ },
+ subEntries: [postEntry, fileEntry]
+ });
+ },
+ menuText: function() {
+ var seconds;
+ if (seconds = DeleteLink.cooldown.seconds[DeleteLink.post.fullID]) {
+ return "Delete (" + seconds + ")";
+ } else {
+ return 'Delete';
+ }
+ },
+ linkText: function(fileOnly) {
+ var text;
+ text = fileOnly ? 'File' : 'Post';
+ if (DeleteLink.auto[+fileOnly][DeleteLink.post.fullID]) {
+ text = "Deleting " + (text.toLowerCase()) + "...";
+ }
+ return text;
+ },
+ toggle: function() {
+ var auto, fileOnly, post;
+ post = DeleteLink.post;
+ fileOnly = $.hasClass(this, 'delete-file');
+ auto = DeleteLink.auto[+fileOnly];
+ if (auto[post.fullID]) {
+ delete auto[post.fullID];
+ } else {
+ auto[post.fullID] = true;
+ }
+ this.textContent = DeleteLink.linkText(fileOnly);
+ if (!DeleteLink.cooldown.seconds[post.fullID]) {
+ return DeleteLink["delete"](post, fileOnly);
+ }
+ },
+ "delete": function(post, fileOnly) {
+ var form, link;
+ link = DeleteLink.nodes.links[+fileOnly];
+ delete DeleteLink.auto[+fileOnly][post.fullID];
+ if (post.fullID === DeleteLink.post.fullID) {
+ $.off(link, 'click', DeleteLink.toggle);
+ }
+ form = {
+ mode: 'usrdel',
+ onlyimgdel: fileOnly,
+ pwd: QR.persona.getPassword()
+ };
+ form[post.ID] = 'delete';
+ return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), {
+ responseType: 'document',
+ withCredentials: true,
+ onload: function() {
+ return DeleteLink.load(link, post, fileOnly, this.response);
+ },
+ onerror: function() {
+ return DeleteLink.error(link, post);
+ }
+ }, {
+ form: $.formData(form)
+ });
+ },
+ load: function(link, post, fileOnly, resDoc) {
+ var el, msg;
+ link.textContent = DeleteLink.linkText(fileOnly);
+ if (resDoc.title === '4chan - Banned') {
+ el = $.el('span', {
+ innerHTML: "You can't delete posts because you are
banned ."
+ });
+ return new Notice('warning', el, 20);
+ } else if (msg = resDoc.getElementById('errmsg')) {
+ new Notice('warning', msg.textContent, 20);
+ if (post.fullID === DeleteLink.post.fullID) {
+ $.on(link, 'click', DeleteLink.toggle);
+ }
+ if (QR.cooldown.data && Conf['Cooldown'] && /\bwait\b/i.test(msg.textContent)) {
+ DeleteLink.cooldown.start(post, 5);
+ DeleteLink.auto[+fileOnly][post.fullID] = true;
+ return DeleteLink.nodes.links[+fileOnly].textContent = DeleteLink.linkText(fileOnly);
+ }
+ } else {
+ if (!fileOnly) {
+ QR.cooldown["delete"](post);
+ }
+ if (resDoc.title === 'Updating index...') {
+ (post.origin || post).kill(fileOnly);
+ }
+ if (post.fullID === DeleteLink.post.fullID) {
+ return link.textContent = 'Deleted';
+ }
+ }
+ },
+ error: function(link, post) {
+ new Notice('warning', 'Connection error, please retry.', 20);
+ if (post.fullID === DeleteLink.post.fullID) {
+ return $.on(link, 'click', DeleteLink.toggle);
+ }
+ },
+ cooldown: {
+ seconds: {},
+ start: function(post, seconds) {
+ if (DeleteLink.cooldown.seconds[post.fullID] != null) {
+ return;
+ }
+ if (seconds == null) {
+ seconds = QR.cooldown.secondsDeletion(post);
+ }
+ if (seconds > 0) {
+ DeleteLink.cooldown.seconds[post.fullID] = seconds;
+ return DeleteLink.cooldown.count(post);
+ }
+ },
+ count: function(post) {
+ var fileOnly, i, len, ref;
+ if (post.fullID === DeleteLink.post.fullID) {
+ DeleteLink.nodes.menu.textContent = DeleteLink.menuText();
+ }
+ if (DeleteLink.cooldown.seconds[post.fullID] > 0 && Conf['Cooldown']) {
+ DeleteLink.cooldown.seconds[post.fullID]--;
+ setTimeout(DeleteLink.cooldown.count, 1000, post);
+ } else {
+ delete DeleteLink.cooldown.seconds[post.fullID];
+ ref = [false, true];
+ for (i = 0, len = ref.length; i < len; i++) {
+ fileOnly = ref[i];
+ if (DeleteLink.auto[+fileOnly][post.fullID]) {
+ DeleteLink["delete"](post, fileOnly);
+ }
+ }
+ }
+ }
+ }
+ };
+
+ return DeleteLink;
+
+}).call(this);
+
+DownloadLink = (function() {
+ var DownloadLink;
+
+ DownloadLink = {
+ init: function() {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) {
+ return;
+ }
+ a = $.el('a', {
+ className: 'download-link',
+ textContent: 'Download file'
+ });
+ $.on(a, 'click', ImageCommon.download);
+ return Menu.menu.addEntry({
+ el: a,
+ order: 100,
+ open: function(arg) {
+ var file;
+ file = arg.file;
+ if (!file) {
+ return false;
+ }
+ a.href = file.url;
+ a.download = file.name;
+ return true;
+ }
+ });
+ }
+ };
+
+ return DownloadLink;
+
+}).call(this);
+
+Menu = (function() {
+ var Menu;
+
+ Menu = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) {
+ return;
+ }
+ this.button = $.el('a', {
+ className: 'menu-button',
+ href: 'javascript:;'
+ });
+ $.extend(this.button, {
+ innerHTML: "
"
+ });
+ this.menu = new UI.Menu('post');
+ Callbacks.Post.push({
+ name: 'Menu',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Menu',
+ cb: this.catalogNode
+ });
+ },
+ node: function() {
+ if (this.isClone) {
+ Menu.makeButton(this, $('.menu-button', this.nodes.info));
+ return;
+ }
+ return $.add(this.nodes.info, Menu.makeButton(this));
+ },
+ catalogNode: function() {
+ return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP));
+ },
+ makeButton: function(post, button) {
+ button || (button = Menu.button.cloneNode(true));
+ $.on(button, 'click', function(e) {
+ return Menu.menu.toggle(e, this, post);
+ });
+ return button;
+ }
+ };
+
+ return Menu;
+
+}).call(this);
+
+ReportLink = (function() {
+ var ReportLink;
+
+ ReportLink = {
+ init: function() {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) {
+ return;
+ }
+ a = $.el('a', {
+ className: 'report-link',
+ href: 'javascript:;'
+ });
+ $.on(a, 'click', ReportLink.report);
+ return Menu.menu.addEntry({
+ el: a,
+ order: 10,
+ open: function(post) {
+ if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) {
+ a.textContent = 'Report';
+ ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post;
+ if ((Conf['Use Recaptcha v1 in Reports'] && Main.jsEnabled) || d.cookie.indexOf('pass_enabled=1') >= 0) {
+ ReportLink.url += '&altc=1';
+ ReportLink.dims = 'width=350,height=275';
+ } else {
+ ReportLink.dims = 'width=400,height=550';
+ }
+ } else if (Conf['Archive Report']) {
+ a.textContent = 'Report to archive';
+ ReportLink.url = Redirect.to('report', {
+ boardID: post.board.ID,
+ postID: post.ID
+ });
+ ReportLink.dims = 'width=700,height=475';
+ } else {
+ ReportLink.url = '';
+ }
+ return !!ReportLink.url;
+ }
+ });
+ },
+ report: function() {
+ var dims, id, set, url;
+ url = ReportLink.url, dims = ReportLink.dims;
+ id = Date.now();
+ set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1," + dims;
+ return window.open(url, id, set);
+ }
+ };
+
+ return ReportLink;
+
+}).call(this);
+
+AntiAutoplay = (function() {
+ var AntiAutoplay;
+
+ AntiAutoplay = {
+ init: function() {
+ var audio, i, len, ref;
+ if (!Conf['Disable Autoplaying Sounds']) {
+ return;
+ }
+ $.addClass(doc, 'anti-autoplay');
+ ref = $$('audio[autoplay]', doc);
+ for (i = 0, len = ref.length; i < len; i++) {
+ audio = ref[i];
+ this.stop(audio);
+ }
+ window.addEventListener('loadstart', ((function(_this) {
+ return function(e) {
+ return _this.stop(e.target);
+ };
+ })(this)), true);
+ Callbacks.Post.push({
+ name: 'Disable Autoplaying Sounds',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Disable Autoplaying Sounds',
+ cb: this.node
+ });
+ return $.ready((function(_this) {
+ return function() {
+ return _this.process(d.body);
+ };
+ })(this));
+ },
+ stop: function(audio) {
+ if (!audio.autoplay) {
+ return;
+ }
+ audio.pause();
+ audio.autoplay = false;
+ if (audio.controls) {
+ return;
+ }
+ audio.controls = true;
+ return $.addClass(audio, 'controls-added');
+ },
+ node: function() {
+ return AntiAutoplay.process(this.nodes.root);
+ },
+ process: function(root) {
+ var i, iframe, j, len, len1, object, ref, ref1;
+ ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root);
+ for (i = 0, len = ref.length; i < len; i++) {
+ iframe = ref[i];
+ iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
+ $.addClass(iframe, 'autoplay-removed');
+ }
+ ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root);
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ object = ref1[j];
+ object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '');
+ $.addClass(object, 'autoplay-removed');
+ }
+ }
+ };
+
+ return AntiAutoplay;
+
+}).call(this);
+
+Banner = (function() {
+ var Banner,
+ slice = [].slice;
+
+ Banner = {
+ banners: ["0.jpg","1.jpg","2.jpg","4.jpg","6.jpg","7.jpg","8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg","14.jpg","16.jpg","17.jpg","18.jpg","19.jpg","20.jpg","21.jpg","22.jpg","24.jpg","25.jpg","26.jpg","28.jpg","29.jpg","33.jpg","38.jpg","39.jpg","43.jpg","44.jpg","45.jpg","46.jpg","47.jpg","52.jpg","54.jpg","57.jpg","59.jpg","60.jpg","61.jpg","64.jpg","66.jpg","67.jpg","69.jpg","71.jpg","72.jpg","76.jpg","77.jpg","81.jpg","82.jpg","83.jpg","84.jpg","88.jpg","90.jpg","91.jpg","96.jpg","98.jpg","99.jpg","100.jpg","104.jpg","106.jpg","116.jpg","119.jpg","137.jpg","140.jpg","148.jpg","149.jpg","150.jpg","154.jpg","156.jpg","157.jpg","158.jpg","159.jpg","161.jpg","162.jpg","164.jpg","165.jpg","166.jpg","167.jpg","168.jpg","169.jpg","170.jpg","171.jpg","172.jpg","173.jpg","174.jpg","175.jpg","176.jpg","178.jpg","179.jpg","180.jpg","181.jpg","182.jpg","183.jpg","186.jpg","189.jpg","190.jpg","192.jpg","193.jpg","194.jpg","197.jpg","198.jpg","200.jpg","201.jpg","202.jpg","203.jpg","205.jpg","206.jpg","207.jpg","208.jpg","210.jpg","213.jpg","214.jpg","215.jpg","216.jpg","218.jpg","219.jpg","220.jpg","221.jpg","222.jpg","223.jpg","224.jpg","227.jpg","0.png","1.png","2.png","3.png","5.png","6.png","9.png","10.png","11.png","12.png","14.png","16.png","19.png","20.png","21.png","22.png","23.png","24.png","26.png","27.png","28.png","29.png","30.png","31.png","32.png","33.png","34.png","37.png","39.png","40.png","41.png","42.png","43.png","44.png","45.png","48.png","49.png","50.png","51.png","52.png","53.png","57.png","58.png","59.png","64.png","66.png","67.png","68.png","69.png","70.png","71.png","72.png","76.png","78.png","79.png","81.png","82.png","85.png","86.png","87.png","89.png","95.png","98.png","100.png","101.png","102.png","105.png","106.png","107.png","109.png","110.png","111.png","112.png","113.png","114.png","115.png","116.png","118.png","119.png","120.png","121.png","122.png","123.png","126.png","128.png","130.png","134.png","136.png","138.png","139.png","140.png","142.png","145.png","146.png","149.png","150.png","151.png","152.png","153.png","154.png","155.png","156.png","157.png","158.png","159.png","160.png","163.png","164.png","165.png","166.png","167.png","168.png","169.png","170.png","171.png","172.png","173.png","174.png","178.png","179.png","180.png","181.png","182.png","184.png","186.png","188.png","190.png","192.png","193.png","194.png","195.png","196.png","197.png","198.png","200.png","202.png","203.png","205.png","206.png","207.png","209.png","212.png","213.png","214.png","216.png","217.png","218.png","219.png","220.png","221.png","222.png","223.png","224.png","225.png","226.png","229.png","231.png","232.png","233.png","234.png","235.png","237.png","238.png","239.png","240.png","241.png","242.png","244.png","245.png","246.png","247.png","248.png","249.png","250.png","253.png","254.png","255.png","256.png","257.png","258.png","259.png","260.png","262.png","268.png","0.gif","1.gif","2.gif","3.gif","4.gif","5.gif","6.gif","7.gif","8.gif","9.gif","10.gif","12.gif","13.gif","14.gif","15.gif","16.gif","18.gif","19.gif","20.gif","21.gif","22.gif","23.gif","24.gif","28.gif","29.gif","30.gif","33.gif","34.gif","35.gif","36.gif","37.gif","39.gif","40.gif","42.gif","44.gif","45.gif","46.gif","48.gif","50.gif","52.gif","54.gif","55.gif","57.gif","58.gif","59.gif","60.gif","61.gif","63.gif","64.gif","66.gif","67.gif","68.gif","69.gif","70.gif","72.gif","73.gif","75.gif","76.gif","77.gif","78.gif","80.gif","81.gif","82.gif","83.gif","86.gif","87.gif","88.gif","92.gif","93.gif","94.gif","95.gif","96.gif","97.gif","98.gif","99.gif","100.gif","101.gif","102.gif","103.gif","104.gif","105.gif","106.gif","108.gif","109.gif","110.gif","111.gif","112.gif","113.gif","115.gif","116.gif","117.gif","118.gif","119.gif","120.gif","122.gif","123.gif","124.gif","127.gif","129.gif","130.gif","131.gif","134.gif","135.gif","136.gif","138.gif","139.gif","141.gif","144.gif","146.gif","148.gif","149.gif","153.gif","154.gif","155.gif","157.gif","158.gif","159.gif","160.gif","161.gif","162.gif","164.gif","166.gif","167.gif","168.gif","169.gif","170.gif","171.gif","172.gif","173.gif","174.gif","175.gif","176.gif","177.gif","178.gif","181.gif","182.gif","183.gif","185.gif","186.gif","187.gif","188.gif","189.gif","190.gif","191.gif","192.gif","193.gif","195.gif","196.gif","197.gif","200.gif","201.gif","202.gif","203.gif","204.gif","205.gif","206.gif","207.gif","208.gif","209.gif","210.gif","211.gif","212.gif","213.gif","214.gif","215.gif","216.gif","217.gif","219.gif","220.gif","221.gif","222.gif","224.gif","225.gif","226.gif","227.gif","228.gif","230.gif","232.gif","233.gif","234.gif","235.gif","238.gif","240.gif","241.gif","243.gif","244.gif","245.gif","246.gif","247.gif","249.gif","250.gif","251.gif","253.gif"],
+ init: function() {
+ if (Conf['Custom Board Titles']) {
+ this.db = new DataBoard('customTitles', null, true);
+ }
+ $.asap((function() {
+ return d.body;
+ }), function() {
+ return $.asap((function() {
+ return $('hr');
+ }), Banner.ready);
+ });
+ if (g.BOARD.ID !== 'f') {
+ return Main.ready(function() {
+ return $.queueTask(Banner.load);
+ });
+ }
+ },
+ ready: function() {
+ var banner, children;
+ banner = $(".boardBanner");
+ children = banner.children;
+ if (g.BOARD.ID !== 'f' && g.VIEW === 'thread' && Conf['Remove Thread Excerpt']) {
+ Banner.setTitle(children[1].textContent);
+ }
+ children[0].title = "Click to change";
+ $.on(children[0], 'click', Banner.cb.toggle);
+ if (Conf['Custom Board Titles']) {
+ Banner.custom(children[1]);
+ if (children[2]) {
+ return Banner.custom(children[2]);
+ }
+ }
+ },
+ load: function() {
+ var bannerCnt, img;
+ bannerCnt = $.id('bannerCnt');
+ if (!bannerCnt.firstChild) {
+ img = $.el('img', {
+ alt: '4chan',
+ src: '//s.4cdn.org/image/title/' + bannerCnt.dataset.src
+ });
+ return $.add(bannerCnt, img);
+ }
+ },
+ setTitle: function(title) {
+ if (Unread.title != null) {
+ Unread.title = title;
+ return Unread.update();
+ } else {
+ return d.title = title;
+ }
+ },
+ cb: {
+ toggle: function() {
+ var banner, i, ref;
+ if (!((ref = Banner.choices) != null ? ref.length : void 0)) {
+ Banner.choices = Banner.banners.slice();
+ }
+ i = Math.floor(Banner.choices.length * Math.random());
+ banner = Banner.choices.splice(i, 1);
+ return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner;
+ },
+ click: function(e) {
+ var base, br, j, len, name, ref;
+ if (!(e.ctrlKey || e.metaKey)) {
+ return;
+ }
+ if ((base = Banner.original)[name = this.className] == null) {
+ base[name] = this.cloneNode(true);
+ }
+ this.contentEditable = true;
+ ref = $$('br', this);
+ for (j = 0, len = ref.length; j < len; j++) {
+ br = ref[j];
+ $.replace(br, $.tn('\n'));
+ }
+ return this.focus();
+ },
+ keydown: function(e) {
+ e.stopPropagation();
+ if (!e.shiftKey && e.keyCode === 13) {
+ return this.blur();
+ }
+ },
+ blur: function() {
+ var br, j, len, ref;
+ ref = $$('br', this);
+ for (j = 0, len = ref.length; j < len; j++) {
+ br = ref[j];
+ $.replace(br, $.tn('\n'));
+ }
+ if (this.textContent = this.textContent.replace(/\n*$/, '')) {
+ this.contentEditable = false;
+ return Banner.db.set({
+ boardID: g.BOARD.ID,
+ threadID: this.className,
+ val: {
+ title: this.textContent,
+ orig: Banner.original[this.className].textContent
+ }
+ });
+ } else {
+ $.rmAll(this);
+ $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes));
+ return Banner.db["delete"]({
+ boardID: g.BOARD.ID,
+ threadID: this.className
+ });
+ }
+ }
+ },
+ original: {},
+ custom: function(child) {
+ var className, data, event, items, j, len, ref, string, string2;
+ className = child.className;
+ child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase());
+ child.spellcheck = false;
+ ref = ['click', 'keydown', 'blur'];
+ for (j = 0, len = ref.length; j < len; j++) {
+ event = ref[j];
+ $.on(child, event, Banner.cb[event]);
+ }
+ string = g.BOARD + "." + className;
+ string2 = string + ".orig";
+ items = {};
+ items[string] = '';
+ items[string2] = child.textContent;
+ $.get(items, function(items) {
+ if (items[string]) {
+ Banner.db.set({
+ boardID: g.BOARD.ID,
+ threadID: className,
+ val: {
+ title: items[string],
+ orig: items[string2]
+ }
+ });
+ }
+ return $["delete"]([string, string2]);
+ });
+ if (data = Banner.db.get({
+ boardID: g.BOARD.ID,
+ threadID: className
+ })) {
+ if (Conf['Persistent Custom Board Titles'] || data.orig === child.textContent) {
+ Banner.original[className] = child.cloneNode(true);
+ return child.textContent = data.title;
+ } else {
+ return Banner.db["delete"]({
+ boardID: g.BOARD.ID,
+ threadID: className
+ });
+ }
+ }
+ }
+ };
+
+ return Banner;
+
+}).call(this);
+
+CatalogLinks = (function() {
+ var CatalogLinks;
+
+ CatalogLinks = {
+ init: function() {
+ var el, input, selector;
+ if ((Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) {
+ selector = (function() {
+ switch (g.VIEW) {
+ case 'thread':
+ case 'archive':
+ return '.navLinks.desktop > a';
+ case 'catalog':
+ return '.navLinks > :first-child > a';
+ case 'index':
+ return '#ctrl-top > a, .cataloglink > a';
+ }
+ })();
+ $.ready(function() {
+ var catalogLink, i, len, link, ref;
+ ref = $$(selector);
+ for (i = 0, len = ref.length; i < len; i++) {
+ link = ref[i];
+ switch (link.pathname.replace(/\/+/g, '/')) {
+ case "/" + g.BOARD + "/":
+ if (Conf['JSON Index']) {
+ link.textContent = 'Index';
+ }
+ link.href = CatalogLinks.index();
+ break;
+ case "/" + g.BOARD + "/catalog":
+ link.href = CatalogLinks.catalog();
+ }
+ if (g.VIEW === 'catalog' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
+ catalogLink = link.parentNode.cloneNode(true);
+ catalogLink.firstElementChild.textContent = '4chan X Catalog';
+ catalogLink.firstElementChild.href = CatalogLinks.catalog();
+ $.after(link.parentNode, [$.tn(' '), catalogLink]);
+ }
+ }
+ });
+ }
+ if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
+ Callbacks.Post.push({
+ name: 'Catalog Link Rewrite',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Catalog Link Rewrite',
+ cb: this.node
+ });
+ }
+ if (Conf['Catalog Links']) {
+ CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links');
+ el.id = 'toggleCatalog';
+ input = $('input', el);
+ $.on(input, 'change', this.toggle);
+ $.sync('Header catalog links', CatalogLinks.set);
+ return Header.menu.addEntry({
+ el: el,
+ order: 95
+ });
+ }
+ },
+ node: function() {
+ var a, i, len, m, ref;
+ ref = $$('a', this.nodes.comment);
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
+ a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
+ }
+ }
+ },
+ initBoardList: function() {
+ if (!CatalogLinks.el) {
+ return;
+ }
+ return CatalogLinks.set(Conf['Header catalog links']);
+ },
+ toggle: function() {
+ $.event('CloseMenu');
+ $.set('Header catalog links', this.checked);
+ return CatalogLinks.set(this.checked);
+ },
+ set: function(useCatalog) {
+ var a, board, i, len, ref, ref1;
+ ref = $$('a:not([data-only])', Header.boardList).concat($$('a', Header.bottomBoardList));
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ if (((ref1 = a.hostname) !== 'boards.4chan.org' && ref1 !== 'catalog.neet.tv') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
+ continue;
+ }
+ a.href = useCatalog ? CatalogLinks.catalog(board) : "/" + board + "/";
+ if (a.dataset.indexOptions && a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
+ a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions;
+ }
+ }
+ CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
+ return $('input', CatalogLinks.el).checked = useCatalog;
+ },
+ catalog: function(board) {
+ if (board == null) {
+ board = g.BOARD.ID;
+ }
+ if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) {
+ return "http://catalog.neet.tv/" + board + "/";
+ } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
+ if (g.BOARD.ID === board && g.VIEW === 'index') {
+ return '#catalog';
+ } else {
+ return "/" + board + "/#catalog";
+ }
+ } else {
+ return "/" + board + "/catalog";
+ }
+ },
+ index: function(board) {
+ if (board == null) {
+ board = g.BOARD.ID;
+ }
+ if (Conf['JSON Index'] && board !== 'f') {
+ if (g.BOARD.ID === board && g.VIEW === 'index') {
+ return '#index';
+ } else {
+ return "/" + board + "/#index";
+ }
+ } else {
+ return "/" + board + "/";
+ }
+ }
+ };
+
+ return CatalogLinks;
+
+}).call(this);
+
+CustomCSS = (function() {
+ var CustomCSS;
+
+ CustomCSS = {
+ init: function() {
+ if (!Conf['Custom CSS']) {
+ return;
+ }
+ return this.addStyle();
+ },
+ addStyle: function() {
+ return this.style = $.addStyle(Conf['usercss'], 'custom-css', '#fourchanx-css');
+ },
+ rmStyle: function() {
+ if (this.style) {
+ $.rm(this.style);
+ return delete this.style;
+ }
+ },
+ update: function() {
+ if (!this.style) {
+ return this.addStyle();
+ }
+ return this.style.textContent = Conf['usercss'];
+ }
+ };
+
+ return CustomCSS;
+
+}).call(this);
+
+ExpandComment = (function() {
+ var ExpandComment;
+
+ ExpandComment = {
+ init: function() {
+ if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) {
+ return;
+ }
+ if (g.BOARD.ID === 'g') {
+ this.callbacks.push(Fourchan.code);
+ }
+ if (g.BOARD.ID === 'sci') {
+ this.callbacks.push(Fourchan.math);
+ }
+ return Callbacks.Post.push({
+ name: 'Comment Expansion',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var a;
+ if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {
+ return $.on(a, 'click', ExpandComment.cb);
+ }
+ },
+ callbacks: [],
+ cb: function(e) {
+ e.preventDefault();
+ return ExpandComment.expand(Get.postFromNode(this));
+ },
+ 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;
+ return;
+ }
+ if (!(a = $('.abbr > a', post.nodes.comment))) {
+ return;
+ }
+ a.textContent = "Post No." + post + " Loading...";
+ return $.cache("//a.4cdn.org" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + ".json", function() {
+ return ExpandComment.parse(this, a, post);
+ });
+ },
+ contract: function(post) {
+ var a;
+ if (!post.nodes.shortComment) {
+ return;
+ }
+ a = $('.abbr > a', post.nodes.shortComment);
+ a.textContent = 'here';
+ $.replace(post.nodes.longComment, post.nodes.shortComment);
+ return post.nodes.comment = post.nodes.shortComment;
+ },
+ parse: function(req, a, post) {
+ var callback, clone, comment, href, i, j, k, len, len1, len2, postObj, posts, quote, ref, ref1, spoilerRange, status;
+ status = req.status;
+ if (status !== 200 && status !== 304) {
+ a.textContent = "Error " + req.statusText + " (" + status + ")";
+ return;
+ }
+ posts = req.response.posts;
+ if (spoilerRange = posts[0].custom_spoiler) {
+ Build.spoilerRange[g.BOARD] = spoilerRange;
+ }
+ for (i = 0, len = posts.length; i < len; i++) {
+ postObj = posts[i];
+ if (postObj.no === post.ID) {
+ break;
+ }
+ }
+ if (postObj.no !== post.ID) {
+ a.textContent = "Post No." + post + " not found.";
+ return;
+ }
+ comment = post.nodes.comment;
+ clone = comment.cloneNode(false);
+ clone.innerHTML = postObj.com;
+ ref = $$('.quotelink', clone);
+ for (j = 0, len1 = ref.length; j < len1; j++) {
+ quote = ref[j];
+ href = quote.getAttribute('href');
+ if (href[0] === '/') {
+ continue;
+ }
+ if (href[0] === '#') {
+ quote.href = "" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + href;
+ } else {
+ quote.href = (a.pathname.split(/\/+/).splice(0, 3).join('/')) + "/" + href;
+ }
+ }
+ post.nodes.shortComment = comment;
+ $.replace(comment, clone);
+ post.nodes.comment = post.nodes.longComment = clone;
+ post.parseComment();
+ post.parseQuotes();
+ ref1 = ExpandComment.callbacks;
+ for (k = 0, len2 = ref1.length; k < len2; k++) {
+ callback = ref1[k];
+ callback.call(post);
+ }
+ }
+ };
+
+ return ExpandComment;
+
+}).call(this);
+
+ExpandThread = (function() {
+ var ExpandThread,
+ slice = [].slice;
+
+ ExpandThread = {
+ statuses: {},
+ init: function() {
+ if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
+ return;
+ }
+ if (Conf['JSON Index']) {
+ return $.on(d, 'IndexRefresh', this.onIndexRefresh);
+ } else {
+ return Callbacks.Thread.push({
+ name: 'Expand Thread',
+ cb: function() {
+ return ExpandThread.setButton(this);
+ }
+ });
+ }
+ },
+ setButton: function(thread) {
+ var a;
+ if (!(a = $.x('following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root))) {
+ return;
+ }
+ a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
+ a.style.cursor = 'pointer';
+ return $.on(a, 'click', ExpandThread.cbToggle);
+ },
+ disconnect: function(refresh) {
+ var ref, ref1, status, threadID;
+ if (g.VIEW === 'thread' || !Conf['Thread Expansion']) {
+ return;
+ }
+ ref = ExpandThread.statuses;
+ for (threadID in ref) {
+ status = ref[threadID];
+ if ((ref1 = status.req) != null) {
+ ref1.abort();
+ }
+ delete ExpandThread.statuses[threadID];
+ }
+ if (!refresh) {
+ return $.off(d, 'IndexRefresh', this.onIndexRefresh);
+ }
+ },
+ onIndexRefresh: function() {
+ ExpandThread.disconnect(true);
+ return g.BOARD.threads.forEach(function(thread) {
+ return ExpandThread.setButton(thread);
+ });
+ },
+ cbToggle: function(e) {
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ e.preventDefault();
+ return ExpandThread.toggle(Get.threadFromNode(this));
+ },
+ toggle: function(thread) {
+ var a, threadRoot;
+ threadRoot = thread.OP.nodes.root.parentNode;
+ if (!(a = $('.summary', threadRoot))) {
+ return;
+ }
+ if (thread.ID in ExpandThread.statuses) {
+ return ExpandThread.contract(thread, a, threadRoot);
+ } else {
+ return ExpandThread.expand(thread, a);
+ }
+ },
+ expand: function(thread, a) {
+ var status;
+ ExpandThread.statuses[thread] = status = {};
+ a.textContent = Build.summaryText.apply(Build, ['...'].concat(slice.call(a.textContent.match(/\d+/g))));
+ return status.req = $.cache("//a.4cdn.org/" + thread.board + "/thread/" + thread + ".json", function() {
+ delete status.req;
+ return ExpandThread.parse(this, thread, a);
+ });
+ },
+ contract: function(thread, a, threadRoot) {
+ var filesCount, i, inlined, len, num, postsCount, replies, reply, status;
+ status = ExpandThread.statuses[thread];
+ delete ExpandThread.statuses[thread];
+ if (status.req) {
+ status.req.abort();
+ if (a) {
+ a.textContent = Build.summaryText.apply(Build, ['+'].concat(slice.call(a.textContent.match(/\d+/g))));
+ }
+ return;
+ }
+ replies = $$('.thread > .replyContainer', threadRoot);
+ if (!Conf['JSON Index'] || Conf['Show Replies']) {
+ num = (function() {
+ if (thread.isSticky) {
+ return 1;
+ } else {
+ switch (g.BOARD.ID) {
+ case 'b':
+ case 'vg':
+ return 3;
+ case 't':
+ return 1;
+ default:
+ return 5;
+ }
+ }
+ })();
+ replies = replies.slice(0, -num);
+ }
+ postsCount = 0;
+ filesCount = 0;
+ for (i = 0, len = replies.length; i < len; i++) {
+ reply = replies[i];
+ if (Conf['Quote Inlining']) {
+ while (inlined = $('.inlined', reply)) {
+ inlined.click();
+ }
+ }
+ postsCount++;
+ if ('file' in Get.postFromRoot(reply)) {
+ filesCount++;
+ }
+ $.rm(reply);
+ }
+ return a.textContent = Build.summaryText('+', postsCount, filesCount);
+ },
+ parse: function(req, thread, a) {
+ var filesCount, i, len, post, postData, posts, postsCount, postsRoot, ref, ref1, root;
+ if ((ref = req.status) !== 200 && ref !== 304) {
+ a.textContent = "Error " + req.statusText + " (" + req.status + ")";
+ return;
+ }
+ Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler;
+ posts = [];
+ postsRoot = [];
+ filesCount = 0;
+ ref1 = req.response.posts;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ postData = ref1[i];
+ if (postData.no === thread.ID) {
+ continue;
+ }
+ if ((post = thread.posts[postData.no]) && !post.isFetchedQuote) {
+ if ('file' in post) {
+ filesCount++;
+ }
+ postsRoot.push(post.nodes.root);
+ continue;
+ }
+ root = Build.postFromObject(postData, thread.board.ID);
+ post = new Post(root, thread, thread.board);
+ if ('file' in post) {
+ filesCount++;
+ }
+ posts.push(post);
+ postsRoot.push(root);
+ }
+ Main.callbackNodes('Post', posts);
+ $.after(a, postsRoot);
+ $.event('PostsInserted');
+ postsCount = postsRoot.length;
+ return a.textContent = Build.summaryText('-', postsCount, filesCount);
+ }
+ };
+
+ return ExpandThread;
+
+}).call(this);
+
+FileInfo = (function() {
+ var FileInfo;
+
+ FileInfo = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['File Info Formatting']) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'File Info Formatting',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var info, oldInfo;
+ if (!this.file || this.isClone) {
+ return;
+ }
+ oldInfo = $.el('span', {
+ className: 'fileText-original'
+ });
+ $.prepend(this.file.link.parentNode, oldInfo);
+ $.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]);
+ info = $.el('span', {
+ className: 'file-info'
+ });
+ FileInfo.format(Conf['fileInfo'], this, info);
+ return $.prepend(this.file.text, info);
+ },
+ format: function(formatString, post, outputNode) {
+ var output;
+ output = [];
+ formatString.replace(/%(.)|[^%]+/g, function(s, c) {
+ output.push(c in FileInfo.formatters ? FileInfo.formatters[c].call(post) : {
+ innerHTML: E(s)
+ });
+ return '';
+ });
+ return $.extend(outputNode, {
+ innerHTML: E.cat(output)
+ });
+ },
+ formatters: {
+ t: function() {
+ return {
+ innerHTML: E(this.file.url.match(/[^/]*$/)[0])
+ };
+ },
+ T: function() {
+ return {
+ innerHTML: "
" + (FileInfo.formatters.t.call(this)).innerHTML + " "
+ };
+ },
+ l: function() {
+ return {
+ innerHTML: "
" + (FileInfo.formatters.n.call(this)).innerHTML + " "
+ };
+ },
+ L: function() {
+ return {
+ innerHTML: "
" + (FileInfo.formatters.N.call(this)).innerHTML + " "
+ };
+ },
+ n: function() {
+ var fullname, shortname;
+ fullname = this.file.name;
+ shortname = Build.shortFilename(this.file.name, this.isReply);
+ if (fullname === shortname) {
+ return {
+ innerHTML: E(fullname)
+ };
+ } else {
+ return {
+ innerHTML: "
" + E(shortname) + " " + E(fullname) + " "
+ };
+ }
+ },
+ N: function() {
+ return {
+ innerHTML: E(this.file.name)
+ };
+ },
+ p: function() {
+ return {
+ innerHTML: ((this.file.isSpoiler) ? "Spoiler, " : "")
+ };
+ },
+ s: function() {
+ return {
+ innerHTML: E(this.file.size)
+ };
+ },
+ B: function() {
+ return {
+ innerHTML: E(Math.round(this.file.sizeInBytes)) + " Bytes"
+ };
+ },
+ K: function() {
+ return {
+ innerHTML: E(Math.round(this.file.sizeInBytes/1024)) + " KB"
+ };
+ },
+ M: function() {
+ return {
+ innerHTML: E(Math.round(this.file.sizeInBytes/1048576*100)/100) + " MB"
+ };
+ },
+ r: function() {
+ return {
+ innerHTML: E(this.file.dimensions || "PDF")
+ };
+ },
+ g: function() {
+ return {
+ innerHTML: ((this.file.tag) ? ", " + E(this.file.tag) : "")
+ };
+ },
+ '%': function() {
+ return {
+ innerHTML: "%"
+ };
+ }
+ }
+ };
+
+ return FileInfo;
+
+}).call(this);
+
+Flash = (function() {
+ var Flash;
+
+ Flash = {
+ init: function() {
+ if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) {
+ return $.ready(Flash.initReady);
+ }
+ },
+ initReady: function() {
+ if ($.hasStorage) {
+ return $.global(function() {
+ if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) {
+ return window.SWFEmbed.init();
+ }
+ });
+ } else {
+ if (g.VIEW === 'thread') {
+ $.global(function() {
+ return window.Main.tid = location.pathname.split(/\/+/)[3];
+ });
+ }
+ return $.global(function() {
+ return window.SWFEmbed.init();
+ });
+ }
+ }
+ };
+
+ return Flash;
+
+}).call(this);
+
+Fourchan = (function() {
+ var Fourchan;
+
+ Fourchan = {
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ if (g.BOARD.ID === 'g') {
+ $.on(window, 'prettyprint:cb', function(e) {
+ var post, pre;
+ if (!(post = g.posts[e.detail.ID])) {
+ return;
+ }
+ if (!(pre = $$('.prettyprint', post.nodes.comment)[e.detail.i])) {
+ return;
+ }
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ pre.innerHTML = e.detail.html;
+ return $.addClass(pre, 'prettyprinted');
+ }
+ });
+ $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: {\n ID: e.detail.ID,\n i: e.detail.i,\n html: prettyPrintOne(e.detail.html)\n }\n }));\n}, false);');
+ Callbacks.Post.push({
+ name: 'Parse /g/ code',
+ cb: this.code
+ });
+ }
+ if (g.BOARD.ID === 'sci') {
+ $.global(function() {
+ return window.addEventListener('mathjax', function(e) {
+ if (window.MathJax) {
+ return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
+ } else {
+ if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) {
+ window.loadMathJax();
+ window.loadMathJax = function() {};
+ }
+ if (!e.target.classList.contains('postMessage')) {
+ return document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener('load', function() {
+ return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]);
+ }, false);
+ }
+ }
+ }, false);
+ });
+ Callbacks.Post.push({
+ name: 'Parse /sci/ math',
+ cb: this.math
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Parse /sci/ math',
+ cb: this.math
+ });
+ }
+ return Main.ready(function() {
+ return $.global(function() {
+ var j, len, node, ref1;
+ window.clickable_ids = false;
+ ref1 = document.querySelectorAll('.posteruid, .capcode');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ node = ref1[j];
+ node.removeEventListener('click', window.idClick, false);
+ }
+ });
+ });
+ },
+ code: function() {
+ if (this.isClone) {
+ return;
+ }
+ return $.ready((function(_this) {
+ return function() {
+ var i, j, len, pre, ref;
+ ref = $$('.prettyprint', _this.nodes.comment);
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ pre = ref[i];
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ $.event('prettyprint', {
+ ID: _this.fullID,
+ i: i,
+ html: pre.innerHTML
+ }, window);
+ }
+ }
+ };
+ })(this));
+ },
+ math: function() {
+ var cb, j, len, wbr, wbrs;
+ if (!/\[(math|eqn)\]/.test(this.nodes.comment.textContent)) {
+ return;
+ }
+ if ((wbrs = $$('wbr', this.nodes.comment)).length) {
+ for (j = 0, len = wbrs.length; j < len; j++) {
+ wbr = wbrs[j];
+ $.rm(wbr);
+ }
+ this.nodes.comment.normalize();
+ }
+ cb = (function(_this) {
+ return function() {
+ if (!doc.contains(_this.nodes.comment)) {
+ return;
+ }
+ $.off(d, 'PostsInserted', cb);
+ return $.event('mathjax', null, _this.nodes.comment);
+ };
+ })(this);
+ $.on(d, 'PostsInserted', cb);
+ return cb();
+ }
+ };
+
+ return Fourchan;
+
+}).call(this);
+
+IDColor = (function() {
+ var IDColor;
+
+ IDColor = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) {
+ return;
+ }
+ this.ids = {
+ Heaven: [0, 0, 0, '#fff']
+ };
+ return Callbacks.Post.push({
+ name: 'Color User IDs',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var rgb, span, style, uid;
+ if (this.isClone || !((uid = this.info.uniqueID) && (span = $('span.hand', this.nodes.uniqueID)))) {
+ return;
+ }
+ rgb = IDColor.ids[uid] || IDColor.compute(uid);
+ style = span.style;
+ style.color = rgb[3];
+ style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
+ return $.addClass(span, 'painted');
+ },
+ compute: function(uid) {
+ var hash, rgb;
+ hash = IDColor.hash(uid);
+ rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
+ rgb.push((rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114) > 125 ? '#000' : '#fff');
+ return this.ids[uid] = rgb;
+ },
+ hash: function(uid) {
+ var i, msg;
+ msg = 0;
+ i = 0;
+ while (i < 8) {
+ msg = (msg << 5) - msg + uid.charCodeAt(i++);
+ }
+ return msg;
+ }
+ };
+
+ return IDColor;
+
+}).call(this);
+
+IDHighlight = (function() {
+ var IDHighlight;
+
+ IDHighlight = {
+ init: function() {
+ var ref;
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Highlight by User ID',
+ cb: this.node
+ });
+ },
+ uniqueID: null,
+ node: function() {
+ if (this.nodes.uniqueID) {
+ $.on(this.nodes.uniqueID, 'click', IDHighlight.click(this));
+ }
+ if (this.nodes.capcode) {
+ $.on(this.nodes.capcode, 'click', IDHighlight.click(this));
+ }
+ if (!this.isClone) {
+ return IDHighlight.set(this);
+ }
+ },
+ set: function(post) {
+ var match;
+ match = (post.info.uniqueID || post.info.capcode) === IDHighlight.uniqueID;
+ return $[match ? 'addClass' : 'rmClass'](post.nodes.post, 'highlight');
+ },
+ click: function(post) {
+ return function() {
+ var uniqueID;
+ uniqueID = post.info.uniqueID || post.info.capcode;
+ IDHighlight.uniqueID = IDHighlight.uniqueID === uniqueID ? null : uniqueID;
+ return g.posts.forEach(IDHighlight.set);
+ };
+ }
+ };
+
+ return IDHighlight;
+
+}).call(this);
+
+Keybinds = (function() {
+ var Keybinds;
+
+ Keybinds = {
+ init: function() {
+ var hotkey, init;
+ if (!Conf['Keybinds']) {
+ return;
+ }
+ for (hotkey in Config.hotkeys) {
+ $.sync(hotkey, Keybinds.sync);
+ }
+ init = function() {
+ var i, len, node, ref;
+ $.off(d, '4chanXInitFinished', init);
+ $.on(d, 'keydown', Keybinds.keydown);
+ ref = $$('[accesskey]');
+ for (i = 0, len = ref.length; i < len; i++) {
+ node = ref[i];
+ node.removeAttribute('accesskey');
+ }
+ };
+ return $.on(d, '4chanXInitFinished', init);
+ },
+ sync: function(key, hotkey) {
+ return Conf[hotkey] = key;
+ },
+ keydown: function(e) {
+ var form, i, key, len, notification, notifications, op, ref, ref1, ref2, ref3, ref4, ref5, searchInput, target, thread, threadRoot;
+ if (!(key = Keybinds.keyCode(e))) {
+ return;
+ }
+ target = e.target;
+ if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') {
+ if (!(/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) && !/^Alt\+(\d|Up|Down|Left|Right)$/.test(key))) {
+ return;
+ }
+ }
+ if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Index'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
+ threadRoot = Nav.getThread();
+ if (op = $('.op', threadRoot)) {
+ thread = Get.postFromNode(op).thread;
+ }
+ }
+ switch (key) {
+ case Conf['Toggle board list']:
+ if (!Conf['Custom Board Navigation']) {
+ return;
+ }
+ Header.toggleBoardList();
+ break;
+ case Conf['Toggle header']:
+ Header.toggleBarVisibility();
+ break;
+ case Conf['Open empty QR']:
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ Keybinds.qr();
+ break;
+ case Conf['Open QR']:
+ if (!(QR.postingIsEnabled && threadRoot)) {
+ return;
+ }
+ Keybinds.qr(threadRoot);
+ break;
+ case Conf['Open settings']:
+ Settings.open();
+ break;
+ case Conf['Close']:
+ if (Settings.dialog) {
+ Settings.close();
+ } else if ((notifications = $$('.notification')).length) {
+ for (i = 0, len = notifications.length; i < len; i++) {
+ notification = notifications[i];
+ $('.close', notification).click();
+ }
+ } else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) {
+ if (Conf['Persistent QR']) {
+ QR.hide();
+ } else {
+ QR.close();
+ }
+ } else if (Embedding.lastEmbed) {
+ Embedding.closeFloat();
+ } else {
+ return;
+ }
+ break;
+ case Conf['Spoiler tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('spoiler', target);
+ break;
+ case Conf['Code tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('code', target);
+ break;
+ case Conf['Eqn tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('eqn', target);
+ break;
+ case Conf['Math tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('math', target);
+ break;
+ case Conf['SJIS tags']:
+ if (target.nodeName !== 'TEXTAREA') {
+ return;
+ }
+ Keybinds.tags('sjis', target);
+ break;
+ case Conf['Toggle sage']:
+ if (!(QR.nodes && !QR.nodes.el.hidden)) {
+ return;
+ }
+ Keybinds.sage();
+ break;
+ case Conf['Submit QR']:
+ if (!(QR.nodes && !QR.nodes.el.hidden)) {
+ return;
+ }
+ if (!QR.status()) {
+ QR.submit();
+ }
+ break;
+ case Conf['Update']:
+ switch (g.VIEW) {
+ case 'thread':
+ if (!Conf['Thread Updater']) {
+ return;
+ }
+ ThreadUpdater.update();
+ break;
+ case 'index':
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ Index.update();
+ break;
+ default:
+ return;
+ }
+ break;
+ case Conf['Watch']:
+ if (!(ThreadWatcher.enabled && thread)) {
+ return;
+ }
+ ThreadWatcher.toggle(thread);
+ break;
+ case Conf['Update thread watcher']:
+ if (!ThreadWatcher.enabled) {
+ return;
+ }
+ ThreadWatcher.buttonFetchAll();
+ break;
+ case Conf['Expand image']:
+ if (!(ImageExpand.enabled && threadRoot)) {
+ return;
+ }
+ Keybinds.img(threadRoot);
+ break;
+ case Conf['Expand images']:
+ if (!(ImageExpand.enabled && threadRoot)) {
+ return;
+ }
+ Keybinds.img(threadRoot, true);
+ break;
+ case Conf['Open Gallery']:
+ if (!Gallery.enabled) {
+ return;
+ }
+ Gallery.cb.toggle();
+ break;
+ case Conf['fappeTyme']:
+ if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread'))) {
+ return;
+ }
+ FappeTyme.toggle('fappe');
+ break;
+ case Conf['werkTyme']:
+ if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread'))) {
+ return;
+ }
+ FappeTyme.toggle('werk');
+ break;
+ case Conf['Front page']:
+ if (Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
+ Index.userPageNav(1);
+ } else {
+ window.location = "/" + g.BOARD + "/";
+ }
+ break;
+ case Conf['Open front page']:
+ $.open("/" + g.BOARD + "/");
+ break;
+ case Conf['Next page']:
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ if (Conf['JSON Index']) {
+ if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') {
+ return;
+ }
+ $('.next button', Index.pagelist).click();
+ } else {
+ if (form = $('.next form')) {
+ window.location = form.action;
+ }
+ }
+ break;
+ case Conf['Previous page']:
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ if (Conf['JSON Index']) {
+ if ((ref5 = Conf['Index Mode']) !== 'paged' && ref5 !== 'infinite') {
+ return;
+ }
+ $('.prev button', Index.pagelist).click();
+ } else {
+ if (form = $('.prev form')) {
+ window.location = form.action;
+ }
+ }
+ break;
+ case Conf['Search form']:
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ searchInput = Conf['JSON Index'] ? Index.searchInput : $.id('search-box');
+ Header.scrollToIfNeeded(searchInput);
+ searchInput.focus();
+ break;
+ case Conf['Paged mode']:
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
+ break;
+ case Conf['Infinite scrolling mode']:
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
+ break;
+ case Conf['All pages mode']:
+ if (!(Conf['JSON Index'] && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
+ break;
+ case Conf['Open catalog']:
+ if (g.BOARD.ID === 'f') {
+ return;
+ }
+ window.location = CatalogLinks.catalog();
+ break;
+ case Conf['Cycle sort type']:
+ if (!(Conf['JSON Index'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
+ return;
+ }
+ Index.cycleSortType();
+ break;
+ case Conf['Next thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Nav.scroll(+1);
+ break;
+ case Conf['Previous thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Nav.scroll(-1);
+ break;
+ case Conf['Expand thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ ExpandThread.toggle(thread);
+ break;
+ case Conf['Open thread']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Keybinds.open(thread);
+ break;
+ case Conf['Open thread tab']:
+ if (!(g.VIEW === 'index' && threadRoot)) {
+ return;
+ }
+ Keybinds.open(thread, true);
+ break;
+ case Conf['Next reply']:
+ if (!threadRoot) {
+ return;
+ }
+ Keybinds.hl(+1, threadRoot);
+ break;
+ case Conf['Previous reply']:
+ if (!threadRoot) {
+ return;
+ }
+ Keybinds.hl(-1, threadRoot);
+ break;
+ case Conf['Deselect reply']:
+ if (!threadRoot) {
+ return;
+ }
+ Keybinds.hl(0, threadRoot);
+ break;
+ case Conf['Hide']:
+ if (!thread) {
+ return;
+ }
+ if (ThreadHiding.db) {
+ ThreadHiding.toggle(thread);
+ }
+ break;
+ case Conf['Previous Post Quoting You']:
+ if (!(threadRoot && QuoteYou.db)) {
+ return;
+ }
+ QuoteYou.cb.seek('preceding');
+ break;
+ case Conf['Next Post Quoting You']:
+ if (!(threadRoot && QuoteYou.db)) {
+ return;
+ }
+ QuoteYou.cb.seek('following');
+ break;
+ default:
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ },
+ keyCode: function(e) {
+ var kc, key;
+ key = (function() {
+ switch (kc = e.keyCode) {
+ case 8:
+ return '';
+ case 13:
+ return 'Enter';
+ case 27:
+ return 'Esc';
+ case 32:
+ return 'Space';
+ case 37:
+ return 'Left';
+ case 38:
+ return 'Up';
+ case 39:
+ return 'Right';
+ case 40:
+ return 'Down';
+ case 188:
+ return 'Comma';
+ case 190:
+ return 'Period';
+ case 191:
+ return 'Slash';
+ case 59:
+ case 186:
+ return 'Semicolon';
+ default:
+ if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) {
+ return String.fromCharCode(kc).toLowerCase();
+ } else if ((96 <= kc && kc <= 105)) {
+ return String.fromCharCode(kc - 48).toLowerCase();
+ } else {
+ return null;
+ }
+ }
+ })();
+ if (key) {
+ if (e.altKey) {
+ key = 'Alt+' + key;
+ }
+ if (e.ctrlKey) {
+ key = 'Ctrl+' + key;
+ }
+ if (e.metaKey) {
+ key = 'Meta+' + key;
+ }
+ if (e.shiftKey) {
+ key = 'Shift+' + key;
+ }
+ }
+ return key;
+ },
+ qr: function(thread) {
+ QR.open();
+ if (thread != null) {
+ QR.quote.call($('input', $('.post.highlight', thread) || thread));
+ }
+ return QR.nodes.com.focus();
+ },
+ tags: function(tag, ta) {
+ var range, selEnd, selStart, supported, value;
+ supported = (function() {
+ switch (tag) {
+ case 'spoiler':
+ return !!$('.postForm input[name=spoiler]');
+ case 'code':
+ return g.BOARD.ID === 'g';
+ case 'math':
+ case 'eqn':
+ return g.BOARD.ID === 'sci';
+ case 'sjis':
+ return g.BOARD.ID === 'jp';
+ }
+ })();
+ if (!supported) {
+ new Notice('warning', "[" + tag + "] tags are not supported on /" + g.BOARD + "/.", 20);
+ }
+ value = ta.value;
+ selStart = ta.selectionStart;
+ selEnd = ta.selectionEnd;
+ ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd);
+ range = ("[" + tag + "]").length + selEnd;
+ ta.setSelectionRange(range, range);
+ return $.event('input', null, ta);
+ },
+ 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 {
+ post = Get.postFromNode($('.post.highlight', thread) || $('.op', thread));
+ return ImageExpand.toggle(post);
+ }
+ },
+ open: function(thread, tab) {
+ var url;
+ if (g.VIEW !== 'index') {
+ return;
+ }
+ url = "/" + thread.board + "/thread/" + thread;
+ if (tab) {
+ return $.open(url);
+ } else {
+ return location.href = url;
+ }
+ },
+ hl: function(delta, thread) {
+ var axis, height, i, len, next, postEl, replies, reply, root;
+ postEl = $('.reply.highlight', thread);
+ if (!delta) {
+ if (postEl) {
+ $.rmClass(postEl, 'highlight');
+ }
+ return;
+ }
+ if (postEl) {
+ height = postEl.getBoundingClientRect().height;
+ if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
+ root = postEl.parentNode;
+ axis = delta === +1 ? 'following' : 'preceding';
+ if (!(next = $.x(axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
+ return;
+ }
+ Header.scrollToIfNeeded(next, delta === +1);
+ this.focus(next);
+ $.rmClass(postEl, 'highlight');
+ return;
+ }
+ $.rmClass(postEl, 'highlight');
+ }
+ replies = $$('.reply', thread);
+ if (delta === -1) {
+ replies.reverse();
+ }
+ for (i = 0, len = replies.length; i < len; i++) {
+ reply = replies[i];
+ if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) {
+ this.focus(reply);
+ return;
+ }
+ }
+ },
+ focus: function(post) {
+ return $.addClass(post, 'highlight');
+ }
+ };
+
+ return Keybinds;
+
+}).call(this);
+
+Nav = (function() {
+ var Nav;
+
+ Nav = {
+ init: function() {
+ var append, next, prev, span;
+ switch (g.VIEW) {
+ case 'index':
+ if (!Conf['Index Navigation']) {
+ return;
+ }
+ break;
+ case 'thread':
+ if (!Conf['Reply Navigation']) {
+ return;
+ }
+ break;
+ default:
+ return;
+ }
+ span = $.el('span', {
+ id: 'navlinks'
+ });
+ prev = $.el('a', {
+ textContent: 'â–²',
+ href: 'javascript:;'
+ });
+ next = $.el('a', {
+ textContent: 'â–¼',
+ href: 'javascript:;'
+ });
+ $.on(prev, 'click', this.prev);
+ $.on(next, 'click', this.next);
+ $.add(span, [prev, $.tn(' '), next]);
+ append = function() {
+ $.off(d, '4chanXInitFinished', append);
+ return $.add(d.body, span);
+ };
+ return $.on(d, '4chanXInitFinished', append);
+ },
+ prev: function() {
+ if (g.VIEW === 'thread') {
+ return window.scrollTo(0, 0);
+ } else {
+ return Nav.scroll(-1);
+ }
+ },
+ next: function() {
+ if (g.VIEW === 'thread') {
+ return window.scrollTo(0, d.body.scrollHeight);
+ } else {
+ return Nav.scroll(+1);
+ }
+ },
+ getThread: function() {
+ var i, len, ref, thread, threadRoot;
+ ref = $$('.thread');
+ for (i = 0, len = ref.length; i < len; i++) {
+ threadRoot = ref[i];
+ thread = Get.threadFromRoot(threadRoot);
+ if (thread.isHidden && !thread.stub) {
+ continue;
+ }
+ if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) {
+ return threadRoot;
+ }
+ }
+ return $('.board');
+ },
+ scroll: function(delta) {
+ var axis, extra, next, ref, thread, top;
+ if ((ref = d.activeElement) != null) {
+ ref.blur();
+ }
+ thread = Nav.getThread();
+ axis = delta === +1 ? 'following' : 'preceding';
+ if (next = $.x(axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
+ top = Header.getTopOf(thread);
+ if (delta === +1 && top < 5 || delta === -1 && top > -5) {
+ thread = next;
+ }
+ }
+ extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom;
+ if (extra > 0) {
+ d.body.style.marginBottom = extra + "px";
+ }
+ Header.scrollTo(thread);
+ if (extra > 0 && !Nav.haveExtra) {
+ Nav.haveExtra = true;
+ return $.on(d, 'scroll', Nav.removeExtra);
+ }
+ },
+ removeExtra: function() {
+ var extra;
+ extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;
+ if (extra > 0) {
+ return d.body.style.marginBottom = extra + "px";
+ } else {
+ d.body.style.marginBottom = null;
+ delete Nav.haveExtra;
+ return $.off(d, 'scroll', Nav.removeExtra);
+ }
+ }
+ };
+
+ return Nav;
+
+}).call(this);
+
+NormalizeURL = (function() {
+ var NormalizeURL;
+
+ NormalizeURL = {
+ init: function() {
+ var pathname;
+ if (!Conf['Normalize URL']) {
+ return;
+ }
+ pathname = location.pathname.split(/\/+/);
+ switch (g.VIEW) {
+ case 'thread':
+ pathname[2] = 'thread';
+ pathname = pathname.slice(0, 4);
+ break;
+ case 'index':
+ pathname = pathname.slice(0, 3);
+ }
+ pathname = pathname.join('/');
+ if (location.pathname !== pathname) {
+ return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash);
+ }
+ }
+ };
+
+ return NormalizeURL;
+
+}).call(this);
+
+PSAHiding = (function() {
+ var PSAHiding;
+
+ PSAHiding = {
+ init: function() {
+ if (!Conf['Announcement Hiding']) {
+ return;
+ }
+ $.addClass(doc, 'hide-announcement');
+ return $.one(d, '4chanXInitFinished', this.setup);
+ },
+ setup: function() {
+ var btn, entry, hr, psa, ref;
+ if (!(psa = PSAHiding.psa = $.id('globalMessage'))) {
+ $.rmClass(doc, 'hide-announcement');
+ return;
+ }
+ if ((hr = (ref = $.id('globalToggle')) != null ? ref.previousElementSibling : void 0) && hr.nodeName === 'HR') {
+ PSAHiding.hr = hr;
+ }
+ entry = {
+ el: $.el('a', {
+ textContent: 'Show announcement',
+ className: 'show-announcement',
+ href: 'javascript:;'
+ }),
+ order: 50,
+ open: function() {
+ return PSAHiding.hidden;
+ }
+ };
+ Header.menu.addEntry(entry);
+ $.on(entry.el, 'click', PSAHiding.toggle);
+ PSAHiding.btn = btn = $.el('span', {
+ title: 'Mark announcement as read and hide.',
+ className: 'hide-announcement'
+ });
+ $.extend(btn, {
+ innerHTML: "[
Dismiss ]"
+ });
+ $.on(btn, 'click', PSAHiding.toggle);
+ $.get('hiddenPSA', 0, function(arg) {
+ var hiddenPSA;
+ hiddenPSA = arg.hiddenPSA;
+ PSAHiding.sync(hiddenPSA);
+ $.add(psa, btn);
+ return $.rmClass(doc, 'hide-announcement');
+ });
+ return $.sync('hiddenPSA', PSAHiding.sync);
+ },
+ toggle: function() {
+ var UTC;
+ if ($.hasClass(this, 'hide-announcement')) {
+ UTC = +$.id('globalMessage').dataset.utc;
+ $.set('hiddenPSA', UTC);
+ } else {
+ $.event('CloseMenu');
+ $["delete"]('hiddenPSA');
+ }
+ return PSAHiding.sync(UTC);
+ },
+ sync: function(UTC) {
+ var psa, ref;
+ psa = PSAHiding.psa;
+ PSAHiding.hidden = PSAHiding.btn.hidden = (UTC != null) && UTC >= +psa.dataset.utc;
+ if (PSAHiding.hidden) {
+ $.rm(psa);
+ } else {
+ $.after($.id('globalToggle'), psa);
+ }
+ if ((ref = PSAHiding.hr) != null) {
+ ref.hidden = PSAHiding.hidden;
+ }
+ }
+ };
+
+ return PSAHiding;
+
+}).call(this);
+
+RelativeDates = (function() {
+ var RelativeDates,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ RelativeDates = {
+ INTERVAL: $.MINUTE / 2,
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Index'] && g.BOARD.ID !== 'f') {
+ this.flush();
+ $.on(d, 'visibilitychange ThreadUpdate', this.flush);
+ }
+ if (Conf['Relative Post Dates']) {
+ return Callbacks.Post.push({
+ name: 'Relative Post Dates',
+ cb: this.node
+ });
+ }
+ },
+ node: function() {
+ var dateEl;
+ dateEl = this.nodes.date;
+ if (Conf['Relative Date Title']) {
+ $.on(dateEl, 'mouseover', (function(_this) {
+ return function() {
+ return RelativeDates.hover(_this);
+ };
+ })(this));
+ return;
+ }
+ if (this.isClone) {
+ return;
+ }
+ dateEl.title = dateEl.textContent;
+ return RelativeDates.update(this);
+ },
+ 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 * years) > 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) {
+ unit += 's';
+ }
+ return rounded + " " + unit + " ago";
+ },
+ stale: [],
+ flush: function() {
+ var data, i, len, now, ref;
+ if (d.hidden) {
+ return;
+ }
+ now = new Date();
+ ref = RelativeDates.stale;
+ for (i = 0, len = ref.length; i < len; i++) {
+ data = ref[i];
+ RelativeDates.update(data, now);
+ }
+ RelativeDates.stale = [];
+ clearTimeout(RelativeDates.timeout);
+ return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL);
+ },
+ hover: function(post) {
+ var date, diff, now;
+ date = post.info.date;
+ now = new Date();
+ diff = now - date;
+ return post.nodes.date.title = RelativeDates.relative(diff, now, date);
+ },
+ update: function(data, now) {
+ var date, diff, i, isPost, len, ref, relative, singlePost;
+ isPost = data instanceof Post;
+ date = isPost ? data.info.date : new Date(+data.dataset.utc);
+ now || (now = new Date());
+ diff = now - date;
+ relative = RelativeDates.relative(diff, now, date);
+ if (isPost) {
+ ref = [data].concat(data.clones);
+ for (i = 0, len = ref.length; i < len; i++) {
+ singlePost = ref[i];
+ singlePost.nodes.date.firstChild.textContent = relative;
+ }
+ } else {
+ data.firstChild.textContent = relative;
+ }
+ return RelativeDates.setOwnTimeout(diff, data);
+ },
+ setOwnTimeout: function(diff, data) {
+ var delay;
+ delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY;
+ return setTimeout(RelativeDates.markStale, delay, data);
+ },
+ markStale: function(data) {
+ if (indexOf.call(RelativeDates.stale, data) >= 0) {
+ return;
+ }
+ if (data instanceof Post && !g.posts[data.fullID]) {
+ return;
+ }
+ return RelativeDates.stale.push(data);
+ }
+ };
+
+ return RelativeDates;
+
+}).call(this);
+
+RemoveSpoilers = (function() {
+ var RemoveSpoilers,
+ slice = [].slice;
+
+ RemoveSpoilers = {
+ init: function() {
+ if (Conf['Reveal Spoilers']) {
+ $.addClass(doc, 'reveal-spoilers');
+ }
+ if (!Conf['Remove Spoilers']) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Reveal Spoilers',
+ cb: this.node
+ });
+ Callbacks.CatalogThread.push({
+ name: 'Reveal Spoilers',
+ cb: this.node
+ });
+ if (g.VIEW === 'archive') {
+ return $.ready(function() {
+ return RemoveSpoilers.unspoiler($.id('arc-list'));
+ });
+ }
+ },
+ node: function() {
+ return RemoveSpoilers.unspoiler(this.nodes.comment);
+ },
+ unspoiler: function(el) {
+ var i, len, span, spoiler, spoilers;
+ spoilers = $$('s', el);
+ for (i = 0, len = spoilers.length; i < len; i++) {
+ spoiler = spoilers[i];
+ span = $.el('span', {
+ className: 'removed-spoiler'
+ });
+ $.replace(spoiler, span);
+ $.add(span, slice.call(spoiler.childNodes));
+ }
+ }
+ };
+
+ return RemoveSpoilers;
+
+}).call(this);
+
+Report = (function() {
+ var Report;
+
+ Report = {
+ init: function() {
+ var match;
+ if (!(match = location.search.match(/\bno=(\d+)/))) {
+ return;
+ }
+ Captcha.replace.init();
+ this.postID = +match[1];
+ return $.ready(this.ready);
+ },
+ ready: function() {
+ var passAd, prev, ref;
+ $.addStyle(CSS.report);
+ if (Conf['Archive Report']) {
+ Report.archive();
+ }
+ if ((passAd = $('a[href="https://www.4chan.org/pass"]'))) {
+ $.extend(passAd, {
+ textContent: 'Complain',
+ href: 'https://www.4chan-x.net/captchas.html',
+ tabIndex: -1
+ });
+ passAd.parentNode.normalize();
+ if (((ref = (prev = passAd.previousSibling)) != null ? ref.nodeType : void 0) === Node.TEXT_NODE) {
+ prev.nodeValue = prev.nodeValue.replace(/4chan Pass[^\.]*\./i, 'reCAPTCHA malfunctioning?');
+ }
+ $.after(passAd, [
+ $.tn('] ['), $.el('a', {
+ href: 'mailto:4chanpass@4chan.org?subject=4chan%20Pass%20-%20Purchase%20Support',
+ textContent: 'Email 4chan',
+ target: '_blank',
+ tabIndex: -1
+ })
+ ]);
+ }
+ if (!Conf['Use Recaptcha v1 in Reports'] && !Conf['Force Noscript Captcha'] && Main.jsEnabled) {
+ return new MutationObserver(function() {
+ Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
+ return Report.fit('body');
+ }).observe(d.body, {
+ childList: true,
+ attributes: true,
+ subtree: true
+ });
+ } else {
+ return Report.fit('body');
+ }
+ },
+ fit: function(selector) {
+ var dy, el;
+ if (!((el = $(selector, doc)) && getComputedStyle(el).visibility !== 'hidden')) {
+ return;
+ }
+ dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8;
+ if (dy > 0) {
+ return window.resizeBy(0, dy);
+ }
+ },
+ archive: function() {
+ var link, message, types, url;
+ Redirect.init();
+ if (!(url = Redirect.to('report', {
+ boardID: g.BOARD.ID,
+ postID: Report.postID
+ }))) {
+ return;
+ }
+ if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) {
+ if (location.hash === '#redirect') {
+ $.globalEval('self.close = function(){};');
+ window.resizeTo(700, 475);
+ location.replace(url);
+ }
+ return;
+ }
+ link = $.el('a', {
+ href: url,
+ textContent: 'Report to archive'
+ });
+ $.on(link, 'click', function(e) {
+ if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) {
+ return window.resizeTo(700, 475);
+ }
+ });
+ $.add(d.body, [$.tn(' ['), link, $.tn(']')]);
+ if (types = $.id('reportTypes')) {
+ return $.on(types, 'change', function(e) {
+ return $('form').action = e.target.value === 'illegal' ? '#redirect' : '';
+ });
+ }
+ }
+ };
+
+ return Report;
+
+}).call(this);
+
+ThreadLinks = (function() {
+ var ThreadLinks;
+
+ ThreadLinks = {
+ init: function() {
+ if (!(g.VIEW === 'index' && Conf['Open Threads in New Tab'])) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Thread Links',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Thread Links',
+ cb: this.catalogNode
+ });
+ },
+ node: function() {
+ if (this.isReply || this.isClone) {
+ return;
+ }
+ return ThreadLinks.process($('.replylink', this.nodes.info));
+ },
+ catalogNode: function() {
+ return ThreadLinks.process(this.nodes.thumb.parentNode);
+ },
+ process: function(link) {
+ return link.target = '_blank';
+ }
+ };
+
+ return ThreadLinks;
+
+}).call(this);
+
+Time = (function() {
+ var Time;
+
+ Time = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Time Formatting'])) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Time Formatting',
+ cb: this.node
+ });
+ },
+ node: function() {
+ if (this.isClone) {
+ return;
+ }
+ return this.nodes.date.textContent = Time.format(Conf['time'], this.info.date);
+ },
+ format: function(formatString, date) {
+ return formatString.replace(/%(.)/g, function(s, c) {
+ if (c in Time.formatters) {
+ return Time.formatters[c].call(date);
+ } else {
+ return s;
+ }
+ });
+ },
+ day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+ month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ zeroPad: function(n) {
+ if (n < 10) {
+ return "0" + n;
+ } else {
+ return n;
+ }
+ },
+ formatters: {
+ a: function() {
+ return Time.day[this.getDay()].slice(0, 3);
+ },
+ A: function() {
+ return Time.day[this.getDay()];
+ },
+ b: function() {
+ return Time.month[this.getMonth()].slice(0, 3);
+ },
+ B: function() {
+ return Time.month[this.getMonth()];
+ },
+ d: function() {
+ return Time.zeroPad(this.getDate());
+ },
+ e: function() {
+ return this.getDate();
+ },
+ H: function() {
+ return Time.zeroPad(this.getHours());
+ },
+ I: function() {
+ return Time.zeroPad(this.getHours() % 12 || 12);
+ },
+ k: function() {
+ return this.getHours();
+ },
+ l: function() {
+ return this.getHours() % 12 || 12;
+ },
+ m: function() {
+ return Time.zeroPad(this.getMonth() + 1);
+ },
+ M: function() {
+ return Time.zeroPad(this.getMinutes());
+ },
+ p: function() {
+ if (this.getHours() < 12) {
+ return 'AM';
+ } else {
+ return 'PM';
+ }
+ },
+ P: function() {
+ if (this.getHours() < 12) {
+ return 'am';
+ } else {
+ return 'pm';
+ }
+ },
+ S: function() {
+ return Time.zeroPad(this.getSeconds());
+ },
+ y: function() {
+ return this.getFullYear().toString().slice(2);
+ },
+ Y: function() {
+ return this.getFullYear();
+ },
+ '%': function() {
+ return '%';
+ }
+ }
+ };
+
+ return Time;
+
+}).call(this);
+
+Favicon = (function() {
+ var Favicon;
+
+ Favicon = {
+ init: function() {
+ return $.asap((function() {
+ return d.head && (Favicon.el = $('link[rel="shortcut icon"]', d.head));
+ }), Favicon.initAsap);
+ },
+ initAsap: function() {
+ var href;
+ Favicon.el.type = 'image/x-icon';
+ href = Favicon.el.href;
+ Favicon.SFW = /ws\.ico$/.test(href);
+ Favicon["default"] = href;
+ return Favicon["switch"]();
+ },
+ "switch": function() {
+ var f, i, items, t;
+ items = {
+ ferongr: ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxUlEQVR42q1TOwrCQBB9s0FRtJI0WoqFtSLYegoP4gVSeJsUHsHSI3iFeIqRXXgwrhlXwYHHhLwPTB7B36abBCV+0pA4DUBQUNZYQptGtW3jtoKyxgoe0yrBCoyZfL/5ioQ3URZOXW9I341l3oo+NXEZiW4CEuIzvPECopED4OaZ3RNmeAm4u+a8Jr5f17VyVoL8fr8qcltzwlyyj2iqcgPOQ9ExkHAITgD75bYBe0A5S4H/P9htuWMF3QXoQpwaKeT+lnsC6JE5I6aq6fEAAAAASUVORK5CYII=', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///8AcH4AtswA2PJ55fKi6fIA1/Ft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QVQIW2NggAGuVasWgDBpDDAQUoSaob0Jao73lgVojOitUEazBZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAADCgANKAASOAATOwAZTAAwkQBAwQBV/wH////+Fmy4AAAAA3RSTlMAPse+s4iwAAAAM0lEQVQIW2NggAGuVasWgDBpDDAQUoSaob0Jao73lgVojOitUEazBZRRvR3KmJa5AO4KAGBtLuMAuhIIAAAAAElFTkSuQmCC']
+ }[Conf['favicon']];
+ f = Favicon;
+ t = 'data:image/png;base64,';
+ i = 0;
+ while (items[i]) {
+ items[i] = t + items[i++];
+ }
+ f.unreadDead = items[0], f.unreadDeadY = items[1], f.unreadSFW = items[2], f.unreadSFWY = items[3], f.unreadNSFW = items[4], f.unreadNSFWY = items[5];
+ return f.update();
+ },
+ update: function() {
+ if (this.SFW) {
+ this.unread = this.unreadSFW;
+ return this.unreadY = this.unreadSFWY;
+ } else {
+ this.unread = this.unreadNSFW;
+ return this.unreadY = this.unreadNSFWY;
+ }
+ },
+ dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
+ logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAgMAAAC+UIlYAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAGlJREFUWMPtlkEKADEIA/tJP9lXLttQto2yHxgDHozTi0ToGK2WKZZ+HAQQMZc+xBwI4EZ+wAC2IfPuSIDOZJrSZQEAX9eVJhhwIuUYAnQe8rhAEMAZlTI2MID9f5Clyh0JeE1V1ZEAvB4qDfwuJTSGRAAAAABJRU5ErkJggg=='
+ };
+
+ return Favicon;
+
+}).call(this);
+
+MarkNewIPs = (function() {
+ var MarkNewIPs;
+
+ MarkNewIPs = {
+ init: function() {
+ if (g.VIEW !== 'thread' || !Conf['Mark New IPs']) {
+ return;
+ }
+ return Callbacks.Thread.push({
+ name: 'Mark New IPs',
+ cb: this.node
+ });
+ },
+ node: function() {
+ MarkNewIPs.ipCount = this.ipCount;
+ MarkNewIPs.postCount = this.posts.keys.length;
+ return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate);
+ },
+ onUpdate: function(e) {
+ var deletedPosts, fullID, i, ipCount, j, k, len, len1, newPosts, postCount, ref;
+ ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts;
+ if (ipCount == null) {
+ return;
+ }
+ switch (ipCount - MarkNewIPs.ipCount) {
+ case postCount - MarkNewIPs.postCount + deletedPosts.length:
+ i = MarkNewIPs.ipCount;
+ for (j = 0, len = newPosts.length; j < len; j++) {
+ fullID = newPosts[j];
+ MarkNewIPs.markNew(g.posts[fullID], ++i);
+ }
+ break;
+ case -deletedPosts.length:
+ for (k = 0, len1 = newPosts.length; k < len1; k++) {
+ fullID = newPosts[k];
+ MarkNewIPs.markOld(g.posts[fullID]);
+ }
+ }
+ MarkNewIPs.ipCount = ipCount;
+ return MarkNewIPs.postCount = postCount;
+ },
+ markNew: function(post, ipCount) {
+ var counter, suffix;
+ suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
+ counter = $.el('span', {
+ className: 'ip-counter',
+ textContent: "(" + ipCount + ")"
+ });
+ post.nodes.nameBlock.title = "This is the " + ipCount + suffix + " IP in the thread.";
+ $.add(post.nodes.nameBlock, [$.tn(' '), counter]);
+ return $.addClass(post.nodes.root, 'new-ip');
+ },
+ markOld: function(post) {
+ post.nodes.nameBlock.title = 'Not the first post from this IP.';
+ return $.addClass(post.nodes.root, 'old-ip');
+ }
+ };
+
+ return MarkNewIPs;
+
+}).call(this);
+
+ReplyPruning = (function() {
+ var ReplyPruning;
+
+ ReplyPruning = {
+ init: function() {
+ var el, label;
+ if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) {
+ return;
+ }
+ this.active = !(Conf['Quote Threading'] && Conf['Thread Quotes']);
+ this.container = $.frag();
+ this.summary = $.el('span', {
+ hidden: true,
+ className: 'summary'
+ });
+ this.summary.style.cursor = 'pointer';
+ $.on(this.summary, 'click', (function(_this) {
+ return function() {
+ _this.inputs.enabled.checked = !_this.inputs.enabled.checked;
+ return $.event('change', null, _this.inputs.enabled);
+ };
+ })(this));
+ label = UI.checkbox('Prune Replies', 'Show Last', this.active);
+ el = $.el('span', {
+ title: 'Maximum number of replies to show.'
+ }, {
+ innerHTML: "
"
+ });
+ $.prepend(el, label);
+ this.inputs = {
+ enabled: label.firstElementChild,
+ replies: el.lastElementChild
+ };
+ $.on(this.inputs.enabled, 'change', this.setEnabled);
+ $.on(this.inputs.replies, 'change', $.cb.value);
+ Header.menu.addEntry({
+ el: el,
+ order: 190
+ });
+ return Callbacks.Thread.push({
+ name: 'Reply Pruning',
+ cb: this.node
+ });
+ },
+ position: 0,
+ hidden: 0,
+ hiddenFiles: 0,
+ total: 0,
+ totalFiles: 0,
+ setEnabled: function() {
+ var other;
+ other = QuoteThreading.input;
+ if (this.checked && (other != null ? other.checked : void 0)) {
+ other.checked = false;
+ $.event('change', null, other);
+ }
+ return ReplyPruning.active = this.checked;
+ },
+ showIfHidden: function(id) {
+ var ref;
+ if ((ref = ReplyPruning.container) != null ? ref.getElementById(id) : void 0) {
+ ReplyPruning.inputs.enabled.checked = false;
+ return $.event('change', null, ReplyPruning.inputs.enabled);
+ }
+ },
+ node: function() {
+ var ref;
+ ReplyPruning.thread = this;
+ this.posts.forEach(function(post) {
+ if (post.isReply) {
+ ReplyPruning.total++;
+ if (post.file) {
+ return ReplyPruning.totalFiles++;
+ }
+ }
+ });
+ if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (0 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) {
+ ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false;
+ }
+ $.after(this.OP.nodes.root, ReplyPruning.summary);
+ $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update);
+ $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update);
+ $.on(d, 'ThreadUpdate', ReplyPruning.updateCount);
+ $.on(d, 'ThreadUpdate', ReplyPruning.update);
+ return ReplyPruning.update();
+ },
+ updateCount: function(e) {
+ var fullID, i, len, ref;
+ if (e.detail[404]) {
+ return;
+ }
+ ref = e.detail.newPosts;
+ for (i = 0, len = ref.length; i < len; i++) {
+ fullID = ref[i];
+ ReplyPruning.total++;
+ if (g.posts[fullID].file) {
+ ReplyPruning.totalFiles++;
+ }
+ }
+ },
+ update: function() {
+ var boardTop, frag, hidden2, oldPos, post, posts;
+ hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0;
+ oldPos = d.body.clientHeight - window.scrollY;
+ posts = ReplyPruning.thread.posts;
+ if (ReplyPruning.hidden < hidden2) {
+ while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) {
+ post = posts[posts.keys[ReplyPruning.position++]];
+ if (post.isReply && !post.isFetchedQuote) {
+ $.add(ReplyPruning.container, post.nodes.root);
+ ReplyPruning.hidden++;
+ if (post.file) {
+ ReplyPruning.hiddenFiles++;
+ }
+ }
+ }
+ } else if (ReplyPruning.hidden > hidden2) {
+ frag = $.frag();
+ while (ReplyPruning.hidden > hidden2 && ReplyPruning.position > 0) {
+ post = posts[posts.keys[--ReplyPruning.position]];
+ if (post.isReply && !post.isFetchedQuote) {
+ $.prepend(frag, post.nodes.root);
+ ReplyPruning.hidden--;
+ if (post.file) {
+ ReplyPruning.hiddenFiles--;
+ }
+ }
+ }
+ $.after(ReplyPruning.summary, frag);
+ $.event('PostsInserted');
+ }
+ ReplyPruning.summary.textContent = ReplyPruning.active ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles);
+ ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"];
+ if ((boardTop = Header.getTopOf($('.board'))) < 0) {
+ return window.scroll(window.scrollX, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop));
+ }
+ }
+ };
+
+ return ReplyPruning;
+
+}).call(this);
+
+ThreadExcerpt = (function() {
+ var ThreadExcerpt;
+
+ ThreadExcerpt = {
+ init: function() {
+ if (g.BOARD.ID !== 'f' || g.VIEW !== 'thread' || !Conf['Thread Excerpt']) {
+ return;
+ }
+ return Callbacks.Thread.push({
+ name: 'Thread Excerpt',
+ cb: this.node
+ });
+ },
+ node: function() {
+ return d.title = Get.threadExcerpt(this);
+ }
+ };
+
+ return ThreadExcerpt;
+
+}).call(this);
+
+ThreadStats = (function() {
+ var ThreadStats;
+
+ ThreadStats = {
+ init: function() {
+ var sc, statsHTML, statsTitle;
+ if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
+ return;
+ }
+ statsHTML = {
+ innerHTML: "
? /
? " + ((Conf["IP Count in Stats"]) ? " /
? " : "") + ((Conf["Page Count in Stats"]) ? " /
? " : "")
+ };
+ statsTitle = 'Posts / Files';
+ if (Conf['IP Count in Stats']) {
+ statsTitle += ' / IPs';
+ }
+ if (Conf['Page Count in Stats']) {
+ statsTitle += (g.BOARD.ID === 'f' ? ' / Purge Position' : ' / Page');
+ }
+ if (Conf['Updater and Stats in Header']) {
+ this.dialog = sc = $.el('span', {
+ id: 'thread-stats',
+ title: statsTitle
+ });
+ $.extend(sc, statsHTML);
+ $.ready(function() {
+ return Header.addShortcut(sc);
+ });
+ } else {
+ this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', {
+ innerHTML: "
" + (statsHTML).innerHTML + "
"
+ });
+ $.addClass(doc, 'float');
+ $.ready(function() {
+ return $.add(d.body, sc);
+ });
+ }
+ this.postCountEl = $('#post-count', sc);
+ this.fileCountEl = $('#file-count', sc);
+ this.ipCountEl = $('#ip-count', sc);
+ this.pageCountEl = $('#page-count', sc);
+ if (this.pageCountEl) {
+ $.on(this.pageCountEl, 'click', ThreadStats.fetchPage);
+ }
+ return Callbacks.Thread.push({
+ name: 'Thread Stats',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var fileCount, postCount;
+ postCount = 0;
+ fileCount = 0;
+ this.posts.forEach(function(post) {
+ postCount++;
+ if (post.file) {
+ fileCount++;
+ }
+ if (ThreadStats.pageCountEl) {
+ return ThreadStats.lastPost = post.info.date;
+ }
+ });
+ ThreadStats.thread = this;
+ ThreadStats.fetchPage();
+ ThreadStats.update(postCount, fileCount, this.ipCount);
+ return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate);
+ },
+ onUpdate: function(e) {
+ var fileCount, ipCount, newPosts, postCount, ref, ref1;
+ if (e.detail[404]) {
+ return;
+ }
+ ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount, ipCount = ref.ipCount, newPosts = ref.newPosts;
+ ThreadStats.update(postCount, fileCount, ipCount);
+ if (!ThreadStats.pageCountEl) {
+ return;
+ }
+ if (newPosts.length) {
+ ThreadStats.lastPost = g.posts[newPosts[newPosts.length - 1]].info.date;
+ }
+ if (g.BOARD.ID !== 'f' && ((ref1 = ThreadStats.pageCountEl) != null ? ref1.textContent : void 0) !== '1') {
+ return ThreadStats.fetchPage();
+ }
+ },
+ update: function(postCount, fileCount, ipCount) {
+ var fileCountEl, ipCountEl, postCountEl, thread;
+ thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl, ipCountEl = ThreadStats.ipCountEl;
+ postCountEl.textContent = postCount;
+ fileCountEl.textContent = fileCount;
+ if ((ipCount != null) && ipCountEl) {
+ ipCountEl.textContent = ipCount;
+ }
+ (thread.postLimit && !thread.isSticky ? $.addClass : $.rmClass)(postCountEl, 'warning');
+ return (thread.fileLimit && !thread.isSticky ? $.addClass : $.rmClass)(fileCountEl, 'warning');
+ },
+ fetchPage: function() {
+ if (!ThreadStats.pageCountEl) {
+ return;
+ }
+ clearTimeout(ThreadStats.timeout);
+ if (ThreadStats.thread.isDead) {
+ ThreadStats.pageCountEl.textContent = 'Dead';
+ $.addClass(ThreadStats.pageCountEl, 'warning');
+ return;
+ }
+ ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 2 * $.MINUTE);
+ return $.ajax("//a.4cdn.org/" + ThreadStats.thread.board + "/threads.json", {
+ onload: ThreadStats.onThreadsLoad
+ }, {
+ whenModified: 'ThreadStats'
+ });
+ },
+ onThreadsLoad: function() {
+ var i, j, k, len, len1, len2, page, purgePos, ref, ref1, ref2, thread;
+ if (this.status === 200) {
+ ref = this.response;
+ for (i = 0, len = ref.length; i < len; i++) {
+ page = ref[i];
+ if (g.BOARD.ID === 'f') {
+ purgePos = 1;
+ ref1 = page.threads;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ thread = ref1[j];
+ if (thread.no < ThreadStats.thread.ID) {
+ purgePos++;
+ }
+ }
+ ThreadStats.pageCountEl.textContent = purgePos;
+ } else {
+ ref2 = page.threads;
+ for (k = 0, len2 = ref2.length; k < len2; k++) {
+ thread = ref2[k];
+ if (!(thread.no === ThreadStats.thread.ID)) {
+ continue;
+ }
+ ThreadStats.pageCountEl.textContent = page.page;
+ (page.page === this.response.length ? $.addClass : $.rmClass)(ThreadStats.pageCountEl, 'warning');
+ ThreadStats.lastPageUpdate = new Date(thread.last_modified * $.SECOND);
+ ThreadStats.retry();
+ return;
+ }
+ }
+ }
+ } else if (this.status === 304) {
+ return ThreadStats.retry();
+ }
+ },
+ retry: function() {
+ var ref;
+ if (g.BOARD.ID !== 'f' && ThreadStats.lastPost > ThreadStats.lastPageUpdate && ((ref = ThreadStats.pageCountEl) != null ? ref.textContent : void 0) !== '1') {
+ clearTimeout(ThreadStats.timeout);
+ return ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 5 * $.SECOND);
+ }
+ }
+ };
+
+ return ThreadStats;
+
+}).call(this);
+
+ThreadUpdater = (function() {
+ var ThreadUpdater,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ ThreadUpdater = {
+ init: function() {
+ var conf, el, input, name, ref, sc, subEntries, updateLink;
+ if (g.VIEW !== 'thread' || !Conf['Thread Updater']) {
+ return;
+ }
+ this.audio = $.el('audio', {
+ src: ThreadUpdater.beep
+ });
+ if (Conf['Updater and Stats in Header']) {
+ this.dialog = sc = $.el('span', {
+ id: 'updater'
+ });
+ $.extend(sc, {
+ innerHTML: "
"
+ });
+ $.ready(function() {
+ return Header.addShortcut(sc);
+ });
+ } else {
+ this.dialog = sc = UI.dialog('updater', 'bottom: 0px; left: 0px;', {
+ innerHTML: "
"
+ });
+ $.addClass(doc, 'float');
+ $.ready(function() {
+ return $.add(d.body, sc);
+ });
+ }
+ this.checkPostCount = 0;
+ this.timer = $('#update-timer', sc);
+ this.status = $('#update-status', sc);
+ $.on(this.timer, 'click', this.update);
+ $.on(this.status, 'click', this.update);
+ updateLink = $.el('span', {
+ className: 'brackets-wrap updatelink'
+ });
+ $.extend(updateLink, {
+ innerHTML: "
Update "
+ });
+ Main.ready(function() {
+ var navLinksBot;
+ if ((navLinksBot = $('.navLinksBot'))) {
+ return $.add(navLinksBot, [$.tn(' '), updateLink]);
+ }
+ });
+ $.on(updateLink.firstElementChild, 'click', this.update);
+ subEntries = [];
+ ref = Config.updater.checkbox;
+ for (name in ref) {
+ conf = ref[name];
+ el = UI.checkbox(name, name);
+ el.title = conf[1];
+ input = el.firstElementChild;
+ $.on(input, 'change', $.cb.checked);
+ if (input.name === 'Scroll BG') {
+ $.on(input, 'change', this.cb.scrollBG);
+ this.cb.scrollBG();
+ } else if (input.name === 'Auto Update') {
+ $.on(input, 'change', this.setInterval);
+ }
+ subEntries.push({
+ el: el
+ });
+ }
+ this.settings = $.el('span', {
+ innerHTML: "
Interval "
+ });
+ $.on(this.settings, 'click', this.intervalShortcut);
+ subEntries.push({
+ el: this.settings
+ });
+ Header.menu.addEntry(this.entry = {
+ el: $.el('span', {
+ textContent: 'Updater'
+ }),
+ order: 110,
+ subEntries: subEntries
+ });
+ return Callbacks.Thread.push({
+ name: 'Thread Updater',
+ cb: this.node
+ });
+ },
+ node: function() {
+ ThreadUpdater.thread = this;
+ ThreadUpdater.root = this.OP.nodes.root.parentNode;
+ ThreadUpdater.outdateCount = 0;
+ ThreadUpdater.postIDs = [];
+ ThreadUpdater.fileIDs = [];
+ this.posts.forEach(function(post) {
+ ThreadUpdater.postIDs.push(post.ID);
+ if (post.file) {
+ return ThreadUpdater.fileIDs.push(post.ID);
+ }
+ });
+ ThreadUpdater.cb.interval.call($.el('input', {
+ value: Conf['Interval']
+ }));
+ $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);
+ $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);
+ return ThreadUpdater.setInterval();
+ },
+
+ /*
+ http://freesound.org/people/pierrecartoons1979/sounds/90112/
+ cc-by-nc-3.0
+ */
+ beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA',
+ playBeep: function() {
+ var audio;
+ audio = ThreadUpdater.audio;
+ if (audio.paused) {
+ return audio.play();
+ } else {
+ return $.one(audio, 'ended', ThreadUpdater.playBeep);
+ }
+ },
+ cb: {
+ checkpost: function(e) {
+ if (e.detail.threadID !== ThreadUpdater.thread.ID) {
+ return;
+ }
+ ThreadUpdater.postID = e.detail.postID;
+ ThreadUpdater.checkPostCount = 0;
+ ThreadUpdater.outdateCount = 0;
+ return ThreadUpdater.setInterval();
+ },
+ visibility: function() {
+ if (d.hidden) {
+ return;
+ }
+ ThreadUpdater.outdateCount = 0;
+ if (ThreadUpdater.seconds > ThreadUpdater.interval) {
+ return ThreadUpdater.setInterval();
+ }
+ },
+ scrollBG: function() {
+ return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() {
+ return true;
+ } : function() {
+ return !d.hidden;
+ };
+ },
+ interval: function(e) {
+ var val;
+ val = parseInt(this.value, 10);
+ if (val < 1) {
+ val = 1;
+ }
+ ThreadUpdater.interval = this.value = val;
+ if (e) {
+ return $.cb.value.call(this);
+ }
+ },
+ load: function() {
+ var req;
+ req = ThreadUpdater.req;
+ switch (req.status) {
+ case 200:
+ ThreadUpdater.parse(req);
+ if (ThreadUpdater.thread.isArchived) {
+ return ThreadUpdater.kill();
+ } else {
+ return ThreadUpdater.setInterval();
+ }
+ break;
+ case 404:
+ return $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/catalog.json", {
+ onloadend: function() {
+ var confirmed, i, k, len, len1, page, ref, ref1, thread;
+ if (this.status === 200) {
+ confirmed = true;
+ ref = this.response;
+ for (i = 0, len = ref.length; i < len; i++) {
+ page = ref[i];
+ ref1 = page.threads;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ thread = ref1[k];
+ if (thread.no === ThreadUpdater.thread.ID) {
+ confirmed = false;
+ break;
+ }
+ }
+ }
+ } else {
+ confirmed = false;
+ }
+ if (confirmed) {
+ return ThreadUpdater.kill();
+ } else {
+ return ThreadUpdater.error(req);
+ }
+ }
+ });
+ default:
+ return ThreadUpdater.error(req);
+ }
+ }
+ },
+ kill: function() {
+ ThreadUpdater.thread.kill();
+ ThreadUpdater.setInterval();
+ return $.event('ThreadUpdate', {
+ 404: true,
+ threadID: ThreadUpdater.thread.fullID
+ });
+ },
+ error: function(req) {
+ if (req.status === 304) {
+ ThreadUpdater.set('status', '');
+ }
+ ThreadUpdater.setInterval();
+ if (!req.status) {
+ return ThreadUpdater.set('status', 'Connection Failed', 'warning');
+ } else if (req.status !== 304) {
+ return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning');
+ }
+ },
+ setInterval: function() {
+ var cur, interval, j, limit;
+ clearTimeout(ThreadUpdater.timeoutID);
+ if (ThreadUpdater.thread.isDead) {
+ ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning');
+ ThreadUpdater.set('timer', '');
+ return;
+ }
+ if (ThreadUpdater.postID && ThreadUpdater.checkPostCount < 5) {
+ ThreadUpdater.set('timer', '...', 'loading');
+ ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND);
+ return;
+ }
+ if (!Conf['Auto Update']) {
+ ThreadUpdater.set('timer', 'Update');
+ return;
+ }
+ interval = ThreadUpdater.interval;
+ if (Conf['Optional Increase']) {
+ limit = d.hidden ? 10 : 5;
+ j = Math.min(ThreadUpdater.outdateCount, limit);
+ cur = (Math.floor(interval * 0.1) || 1) * j * j;
+ ThreadUpdater.seconds = $.minmax(cur, interval, 300);
+ } else {
+ ThreadUpdater.seconds = interval;
+ }
+ return ThreadUpdater.timeout();
+ },
+ 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;
+ } else {
+ el.textContent = text;
+ }
+ return el.className = klass != null ? klass : (text === '' ? 'empty' : '');
+ },
+ timeout: function() {
+ if (ThreadUpdater.seconds) {
+ ThreadUpdater.set('timer', ThreadUpdater.seconds);
+ ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
+ } else {
+ ThreadUpdater.outdateCount++;
+ ThreadUpdater.update();
+ }
+ return ThreadUpdater.seconds--;
+ },
+ update: function() {
+ var ref;
+ clearTimeout(ThreadUpdater.timeoutID);
+ ThreadUpdater.set('timer', '...', 'loading');
+ if ((ref = ThreadUpdater.req) != null) {
+ ref.abort();
+ }
+ return ThreadUpdater.req = $.ajax("//a.4cdn.org/" + ThreadUpdater.thread.board + "/thread/" + ThreadUpdater.thread + ".json", {
+ onloadend: ThreadUpdater.cb.load,
+ timeout: $.MINUTE
+ }, {
+ whenModified: 'ThreadUpdater'
+ });
+ },
+ updateThreadStatus: function(type, status) {
+ var change, hasChanged;
+ if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) {
+ return;
+ }
+ ThreadUpdater.thread.setStatus(type, status);
+ if (type === 'Closed' && ThreadUpdater.thread.isArchived) {
+ return;
+ }
+ change = type === 'Sticky' ? status ? 'now a sticky' : 'not a sticky anymore' : status ? 'now closed' : 'not closed anymore';
+ return new Notice('info', "The thread is " + change + ".", 30);
+ },
+ parse: function(req) {
+ var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, i, index, ipCountEl, k, l, lastPost, len, len1, len2, len3, m, newPosts, node, post, postObject, postObjects, posts, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, scroll, thread, unreadCount, unreadQYCount;
+ postObjects = req.response.posts;
+ OP = postObjects[0];
+ thread = ThreadUpdater.thread;
+ board = thread.board;
+ ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1];
+ if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts[lastPost].info.date < 30 * $.SECOND) {
+ return;
+ }
+ Build.spoilerRange[board] = OP.custom_spoiler;
+ thread.setStatus('Archived', !!OP.archived);
+ ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);
+ ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);
+ thread.postLimit = !!OP.bumplimit;
+ thread.fileLimit = !!OP.imagelimit;
+ if (OP.unique_ips != null) {
+ thread.ipCount = OP.unique_ips;
+ }
+ posts = [];
+ index = [];
+ files = [];
+ newPosts = [];
+ for (i = 0, len = postObjects.length; i < len; i++) {
+ postObject = postObjects[i];
+ ID = postObject.no;
+ index.push(ID);
+ if (postObject.fsize) {
+ files.push(ID);
+ }
+ if (ID <= lastPost) {
+ continue;
+ }
+ if ((post = thread.posts[ID]) && !post.isFetchedQuote) {
+ post.resurrect();
+ continue;
+ }
+ newPosts.push(board + "." + ID);
+ node = Build.postFromObject(postObject, board.ID);
+ posts.push(new Post(node, thread, board));
+ if (ThreadUpdater.postID === ID) {
+ delete ThreadUpdater.postID;
+ }
+ }
+ deletedPosts = [];
+ ref1 = ThreadUpdater.postIDs;
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ ID = ref1[k];
+ if (!(indexOf.call(index, ID) < 0)) {
+ continue;
+ }
+ thread.posts[ID].kill();
+ deletedPosts.push(board + "." + ID);
+ }
+ ThreadUpdater.postIDs = index;
+ deletedFiles = [];
+ ref2 = ThreadUpdater.fileIDs;
+ for (l = 0, len2 = ref2.length; l < len2; l++) {
+ ID = ref2[l];
+ if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) {
+ continue;
+ }
+ thread.posts[ID].kill(true);
+ deletedFiles.push(board + "." + ID);
+ }
+ ThreadUpdater.fileIDs = files;
+ if (!posts.length) {
+ ThreadUpdater.set('status', '');
+ } else {
+ ThreadUpdater.set('status', "+" + posts.length, 'new');
+ ThreadUpdater.outdateCount = 0;
+ unreadCount = (ref4 = Unread.posts) != null ? ref4.size : void 0;
+ unreadQYCount = (ref5 = Unread.postsQuotingYou) != null ? ref5.size : void 0;
+ Main.callbackNodes('Post', posts);
+ if (d.hidden || !d.hasFocus()) {
+ if (Conf['Beep Quoting You'] && ((ref6 = Unread.postsQuotingYou) != null ? ref6.size : void 0) > unreadQYCount) {
+ ThreadUpdater.playBeep();
+ if (Conf['Beep']) {
+ ThreadUpdater.playBeep();
+ }
+ } else if (Conf['Beep'] && ((ref7 = Unread.posts) != null ? ref7.size : void 0) > 0 && unreadCount === 0) {
+ ThreadUpdater.playBeep();
+ }
+ }
+ scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25;
+ firstPost = null;
+ for (m = 0, len3 = posts.length; m < len3; m++) {
+ post = posts[m];
+ if (!QuoteThreading.insert(post)) {
+ firstPost || (firstPost = post.nodes.root);
+ $.add(ThreadUpdater.root, post.nodes.root);
+ }
+ }
+ $.event('PostsInserted');
+ if (scroll) {
+ if (Conf['Bottom Scroll']) {
+ window.scrollTo(0, d.body.clientHeight);
+ } else {
+ if (firstPost) {
+ Header.scrollTo(firstPost);
+ }
+ }
+ }
+ }
+ if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) {
+ ipCountEl.textContent = OP.unique_ips;
+ ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are');
+ ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters');
+ }
+ return $.event('ThreadUpdate', {
+ 404: false,
+ threadID: thread.fullID,
+ newPosts: newPosts,
+ deletedPosts: deletedPosts,
+ deletedFiles: deletedFiles,
+ postCount: OP.replies + 1,
+ fileCount: OP.images + !!OP.fsize,
+ ipCount: OP.unique_ips
+ });
+ }
+ };
+
+ return ThreadUpdater;
+
+}).call(this);
+
+ThreadWatcher = (function() {
+ var ThreadWatcher,
+ slice = [].slice;
+
+ ThreadWatcher = {
+ init: function() {
+ var sc;
+ if (!(this.enabled = Conf['Thread Watcher'])) {
+ return;
+ }
+ this.shortcut = sc = $.el('a', {
+ id: 'watcher-link',
+ textContent: 'Watcher',
+ title: 'Thread Watcher',
+ href: 'javascript:;',
+ className: 'disabled fa fa-eye'
+ });
+ this.db = new DataBoard('watchedThreads', this.refresh, true);
+ this.dialog = UI.dialog('thread-watcher', 'top: 50px; left: 0px;', {
+ innerHTML: "
"
+ });
+ this.status = $('#watcher-status', this.dialog);
+ this.list = this.dialog.lastElementChild;
+ this.refreshButton = $('.refresh', this.dialog);
+ this.closeButton = $('.move > .close', this.dialog);
+ this.unreaddb = Unread.db || new DataBoard('lastReadPosts');
+ this.unreadEnabled = Conf['Remember Last Read Post'];
+ $.on(d, 'QRPostSuccessful', this.cb.post);
+ $.on(sc, 'click', this.toggleWatcher);
+ $.on(this.refreshButton, 'click', this.buttonFetchAll);
+ $.on(this.closeButton, 'click', this.toggleWatcher);
+ $.on(d, '4chanXInitFinished', this.ready);
+ switch (g.VIEW) {
+ case 'index':
+ $.on(d, 'IndexRefresh', this.cb.onIndexRefresh);
+ break;
+ case 'thread':
+ $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh);
+ }
+ if (Conf['Fixed Thread Watcher']) {
+ $.addClass(doc, 'fixed-watcher');
+ }
+ if (Conf['Toggleable Thread Watcher']) {
+ this.dialog.hidden = true;
+ Header.addShortcut(sc);
+ $.addClass(doc, 'toggleable-watcher');
+ }
+ ThreadWatcher.fetchAuto();
+ if (g.VIEW === 'index' && Conf['JSON Index'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
+ Menu.menu.addEntry({
+ el: $.el('a', {
+ href: 'javascript:;',
+ className: 'has-shortcut-text'
+ }, {
+ innerHTML: "
Alt+click "
+ }),
+ order: 6,
+ open: function(arg) {
+ var thread;
+ thread = arg.thread;
+ if (Conf['Index Mode'] !== 'catalog') {
+ return false;
+ }
+ this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? 'Unwatch' : 'Watch';
+ if (this.cb) {
+ $.off(this.el, 'click', this.cb);
+ }
+ this.cb = function() {
+ $.event('CloseMenu');
+ return ThreadWatcher.toggle(thread);
+ };
+ $.on(this.el, 'click', this.cb);
+ return true;
+ }
+ });
+ }
+ Callbacks.Post.push({
+ name: 'Thread Watcher',
+ cb: this.node
+ });
+ return Callbacks.CatalogThread.push({
+ name: 'Thread Watcher',
+ cb: this.catalogNode
+ });
+ },
+ isWatched: function(thread) {
+ var ref;
+ return (ref = ThreadWatcher.db) != null ? ref.get({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ }) : void 0;
+ },
+ node: function() {
+ var toggler;
+ if (this.isReply) {
+ return;
+ }
+ if (this.isClone) {
+ toggler = $('.watch-thread-link', this.nodes.post);
+ } else {
+ toggler = $.el('a', {
+ href: 'javascript:;',
+ className: 'watch-thread-link'
+ });
+ $.before($('input', this.nodes.post), toggler);
+ }
+ return $.on(toggler, 'click', ThreadWatcher.cb.toggle);
+ },
+ catalogNode: function() {
+ if (ThreadWatcher.isWatched(this.thread)) {
+ $.addClass(this.nodes.root, 'watched');
+ }
+ $.on(this.nodes.thumb.parentNode, 'click', (function(_this) {
+ return function(e) {
+ if (!(e.button === 0 && e.altKey)) {
+ return;
+ }
+ ThreadWatcher.toggle(_this.thread);
+ return e.preventDefault();
+ };
+ })(this));
+ return $.on(this.nodes.thumb.parentNode, 'mousedown', function(e) {
+ if (e.button === 0 && e.altKey) {
+ return e.preventDefault();
+ }
+ });
+ },
+ ready: function() {
+ $.off(d, '4chanXInitFinished', ThreadWatcher.ready);
+ if (!Main.isThisPageLegit()) {
+ return;
+ }
+ ThreadWatcher.refresh();
+ $.add(d.body, ThreadWatcher.dialog);
+ if (!Conf['Auto Watch']) {
+ return;
+ }
+ return $.get('AutoWatch', 0, function(arg) {
+ var AutoWatch, thread;
+ AutoWatch = arg.AutoWatch;
+ if (!(thread = g.BOARD.threads[AutoWatch])) {
+ return;
+ }
+ ThreadWatcher.add(thread);
+ return $["delete"]('AutoWatch');
+ });
+ },
+ toggleWatcher: function() {
+ $.toggleClass(ThreadWatcher.shortcut, 'disabled');
+ return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden;
+ },
+ cb: {
+ openAll: function() {
+ var a, i, len, ref;
+ if ($.hasClass(this, 'disabled')) {
+ return;
+ }
+ ref = $$('a[title]', ThreadWatcher.list);
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ $.open(a.href);
+ }
+ return $.event('CloseMenu');
+ },
+ pruneDeads: function() {
+ var boardID, data, i, len, ref, ref1, threadID;
+ if ($.hasClass(this, 'disabled')) {
+ return;
+ }
+ ThreadWatcher.db.forceSync();
+ ref = ThreadWatcher.getAll();
+ for (i = 0, len = ref.length; i < len; i++) {
+ ref1 = ref[i], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
+ if (!data.isDead) {
+ continue;
+ }
+ delete ThreadWatcher.db.data.boards[boardID][threadID];
+ ThreadWatcher.db.deleteIfEmpty({
+ boardID: boardID
+ });
+ }
+ ThreadWatcher.db.save();
+ ThreadWatcher.refresh();
+ return $.event('CloseMenu');
+ },
+ toggle: function() {
+ var thread;
+ thread = Get.postFromNode(this).thread;
+ Index.followedThreadID = thread.ID;
+ ThreadWatcher.toggle(thread);
+ return delete Index.followedThreadID;
+ },
+ rm: function() {
+ var boardID, ref, threadID;
+ ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1];
+ return ThreadWatcher.rm(boardID, +threadID);
+ },
+ post: function(e) {
+ var boardID, postID, ref, threadID;
+ ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ if (postID === threadID) {
+ if (Conf['Auto Watch']) {
+ return $.set('AutoWatch', threadID);
+ }
+ } else if (Conf['Auto Watch Reply']) {
+ return ThreadWatcher.add(g.threads[boardID + '.' + threadID]);
+ }
+ },
+ onIndexRefresh: function() {
+ var boardID, data, db, ref, threadID;
+ db = ThreadWatcher.db;
+ boardID = g.BOARD.ID;
+ db.forceSync();
+ ref = db.data.boards[boardID];
+ for (threadID in ref) {
+ data = ref[threadID];
+ if (!(data != null ? data.isDead : void 0) && !(threadID in g.BOARD.threads)) {
+ if (Conf['Auto Prune'] || !(data && typeof data === 'object')) {
+ db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ } else {
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
+ ThreadWatcher.fetchStatus({
+ boardID: boardID,
+ threadID: threadID,
+ data: data
+ });
+ }
+ data.isDead = true;
+ db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ }
+ }
+ }
+ return ThreadWatcher.refresh();
+ },
+ onThreadRefresh: function(e) {
+ var thread;
+ thread = g.threads[e.detail.threadID];
+ if (!(e.detail[404] && ThreadWatcher.db.get({
+ boardID: thread.board.ID,
+ threadID: thread.ID
+ }))) {
+ return;
+ }
+ return ThreadWatcher.add(thread);
+ }
+ },
+ requests: [],
+ fetched: 0,
+ clearRequests: function() {
+ ThreadWatcher.requests = [];
+ ThreadWatcher.fetched = 0;
+ ThreadWatcher.status.textContent = '';
+ return $.rmClass(ThreadWatcher.refreshButton, 'fa-spin');
+ },
+ abort: function() {
+ var i, len, ref, req;
+ ref = ThreadWatcher.requests;
+ for (i = 0, len = ref.length; i < len; i++) {
+ req = ref[i];
+ if (req.readyState !== 4) {
+ req.abort();
+ }
+ }
+ return ThreadWatcher.clearRequests();
+ },
+ fetchAuto: function() {
+ var db, interval, now;
+ clearTimeout(ThreadWatcher.timeout);
+ if (!Conf['Auto Update Thread Watcher']) {
+ return;
+ }
+ db = ThreadWatcher.db;
+ interval = ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] ? 5 * $.MINUTE : 2 * $.HOUR;
+ now = Date.now();
+ if (now >= (db.data.lastChecked || 0) + interval) {
+ db.data.lastChecked = now;
+ ThreadWatcher.fetchAllStatus();
+ db.save();
+ }
+ return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);
+ },
+ buttonFetchAll: function() {
+ if (ThreadWatcher.requests.length) {
+ return ThreadWatcher.abort();
+ } else {
+ return ThreadWatcher.fetchAllStatus();
+ }
+ },
+ fetchAllStatus: function() {
+ var i, len, ref, thread, threads;
+ ThreadWatcher.db.forceSync();
+ ThreadWatcher.unreaddb.forceSync();
+ if ((ref = QuoteYou.db) != null) {
+ ref.forceSync();
+ }
+ if (!(threads = ThreadWatcher.getAll()).length) {
+ return;
+ }
+ for (i = 0, len = threads.length; i < len; i++) {
+ thread = threads[i];
+ ThreadWatcher.fetchStatus(thread);
+ }
+ },
+ fetchStatus: function(thread, force) {
+ var boardID, data, req, threadID;
+ boardID = thread.boardID, threadID = thread.threadID, data = thread.data;
+ if (data.isDead && !force) {
+ return;
+ }
+ if (ThreadWatcher.requests.length === 0) {
+ ThreadWatcher.status.textContent = '...';
+ $.addClass(ThreadWatcher.refreshButton, 'fa-spin');
+ }
+ req = $.ajax("//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json", {
+ onloadend: function() {
+ return ThreadWatcher.parseStatus.call(this, thread);
+ },
+ timeout: $.MINUTE
+ }, {
+ whenModified: force ? false : 'ThreadWatcher'
+ });
+ return ThreadWatcher.requests.push(req);
+ },
+ parseStatus: function(arg) {
+ var boardID, data, i, isDead, lastReadPost, len, match, postObj, quotesYou, quotingYou, ref, ref1, regexp, threadID, unread;
+ boardID = arg.boardID, threadID = arg.threadID, data = arg.data;
+ ThreadWatcher.fetched++;
+ if (ThreadWatcher.fetched === ThreadWatcher.requests.length) {
+ ThreadWatcher.clearRequests();
+ } else {
+ ThreadWatcher.status.textContent = (Math.round(ThreadWatcher.fetched / ThreadWatcher.requests.length * 100)) + "%";
+ }
+ if (this.status === 200 && this.response) {
+ isDead = !!this.response.posts[0].archived;
+ if (isDead && Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ ThreadWatcher.refresh();
+ return;
+ }
+ lastReadPost = ThreadWatcher.unreaddb.get({
+ boardID: boardID,
+ threadID: threadID,
+ defaultValue: 0
+ });
+ unread = quotingYou = 0;
+ ref = this.response.posts;
+ for (i = 0, len = ref.length; i < len; i++) {
+ postObj = ref[i];
+ if (!(postObj.no > lastReadPost)) {
+ continue;
+ }
+ if ((ref1 = QuoteYou.db) != null ? ref1.get({
+ boardID: boardID,
+ threadID: threadID,
+ postID: postObj.no
+ }) : void 0) {
+ continue;
+ }
+ unread++;
+ if (!(QuoteYou.db && postObj.com)) {
+ continue;
+ }
+ quotesYou = false;
+ regexp = /
]*\bhref="(?:\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g;
+ while (match = regexp.exec(postObj.com)) {
+ if (QuoteYou.db.get({
+ boardID: match[1] || boardID,
+ threadID: match[2] || threadID,
+ postID: match[3] || match[2] || threadID
+ })) {
+ quotesYou = true;
+ break;
+ }
+ }
+ if (quotesYou && !Filter.isHidden(Build.parseJSON(postObj, boardID))) {
+ quotingYou++;
+ }
+ }
+ if (isDead !== data.isDead || unread !== data.unread || quotingYou !== data.quotingYou) {
+ data.isDead = isDead;
+ data.unread = unread;
+ data.quotingYou = quotingYou;
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ return ThreadWatcher.refresh();
+ }
+ } else if (this.status === 404) {
+ if (Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ } else {
+ data.isDead = true;
+ delete data.unread;
+ delete data.quotingYou;
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ }
+ return ThreadWatcher.refresh();
+ }
+ },
+ getAll: function() {
+ var all, boardID, data, ref, threadID, threads;
+ all = [];
+ ref = ThreadWatcher.db.data.boards;
+ for (boardID in ref) {
+ threads = ref[boardID];
+ if (Conf['Current Board'] && boardID !== g.BOARD.ID) {
+ continue;
+ }
+ for (threadID in threads) {
+ data = threads[threadID];
+ if (data && typeof data === 'object') {
+ all.push({
+ boardID: boardID,
+ threadID: threadID,
+ data: data
+ });
+ }
+ }
+ }
+ return all;
+ },
+ makeLine: function(boardID, threadID, data) {
+ var count, div, fullID, link, title, x;
+ x = $.el('a', {
+ className: 'fa fa-times',
+ href: 'javascript:;'
+ });
+ $.on(x, 'click', ThreadWatcher.cb.rm);
+ link = $.el('a', {
+ href: "/" + boardID + "/thread/" + threadID,
+ title: data.excerpt,
+ className: 'watcher-link'
+ });
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) {
+ count = $.el('span', {
+ textContent: "(" + data.unread + ")",
+ className: 'watcher-unread'
+ });
+ $.add(link, count);
+ }
+ title = $.el('span', {
+ textContent: data.excerpt,
+ className: 'watcher-title'
+ });
+ $.add(link, title);
+ div = $.el('div');
+ fullID = boardID + "." + threadID;
+ div.dataset.fullID = fullID;
+ if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) {
+ $.addClass(div, 'current');
+ }
+ if (data.isDead) {
+ $.addClass(div, 'dead-thread');
+ }
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
+ if (data.unread === 0) {
+ $.addClass(div, 'replies-read');
+ }
+ if (data.unread) {
+ $.addClass(div, 'replies-unread');
+ }
+ if (data.quotingYou) {
+ $.addClass(div, 'replies-quoting-you');
+ }
+ }
+ $.add(div, [x, $.tn(' '), link]);
+ return div;
+ },
+ refresh: function() {
+ var boardID, data, i, j, len, len1, list, nodes, ref, ref1, ref2, refresher, threadID;
+ nodes = [];
+ ref = ThreadWatcher.getAll();
+ for (i = 0, len = ref.length; i < len; i++) {
+ ref1 = ref[i], boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data;
+ nodes.push(ThreadWatcher.makeLine(boardID, threadID, data));
+ }
+ list = ThreadWatcher.list;
+ $.rmAll(list);
+ $.add(list, nodes);
+ g.threads.forEach(function(thread) {
+ var helper, j, len1, post, ref2, toggler;
+ helper = ThreadWatcher.isWatched(thread) ? ['addClass', 'Unwatch'] : ['rmClass', 'Watch'];
+ if (thread.OP) {
+ ref2 = [thread.OP].concat(slice.call(thread.OP.clones));
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ post = ref2[j];
+ toggler = $('.watch-thread-link', post.nodes.post);
+ $[helper[0]](toggler, 'watched');
+ toggler.title = helper[1] + " Thread";
+ }
+ }
+ if (thread.catalogView) {
+ return $[helper[0]](thread.catalogView.nodes.root, 'watched');
+ }
+ });
+ ThreadWatcher.refreshIcon();
+ ref2 = ThreadWatcher.menu.refreshers;
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ refresher = ref2[j];
+ refresher();
+ }
+ if (Index.nodes && Conf['Pin Watched Threads']) {
+ Index.sort();
+ return Index.buildIndex();
+ }
+ },
+ refreshIcon: function() {
+ var className, i, len, ref;
+ ref = ['replies-unread', 'replies-quoting-you'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ className = ref[i];
+ ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog));
+ }
+ },
+ update: function(boardID, threadID, newData) {
+ var data, key, line, n, newLine, ref, val;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
+ boardID: boardID,
+ threadID: threadID
+ }) : void 0)) {
+ return;
+ }
+ if (newData.isDead && Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ ThreadWatcher.refresh();
+ return;
+ }
+ n = 0;
+ for (key in newData) {
+ val = newData[key];
+ if (data[key] !== val) {
+ n++;
+ }
+ }
+ if (!n) {
+ return;
+ }
+ ThreadWatcher.db.forceSync();
+ if (!(data = ThreadWatcher.db.get({
+ boardID: boardID,
+ threadID: threadID
+ }))) {
+ return;
+ }
+ $.extend(data, newData);
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ if (line = $("#watched-threads > [data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog)) {
+ newLine = ThreadWatcher.makeLine(boardID, threadID, data);
+ $.replace(line, newLine);
+ return ThreadWatcher.refreshIcon();
+ } else {
+ return ThreadWatcher.refresh();
+ }
+ },
+ set404: function(boardID, threadID, cb) {
+ var data, ref;
+ if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({
+ boardID: boardID,
+ threadID: threadID
+ }) : void 0)) {
+ return cb();
+ }
+ if (Conf['Auto Prune']) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ return cb();
+ }
+ if (data.isDead && !((data.unread != null) || (data.quotingYou != null))) {
+ return cb();
+ }
+ data.isDead = true;
+ delete data.unread;
+ delete data.quotingYou;
+ return ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ }, cb);
+ },
+ toggle: function(thread) {
+ var boardID, threadID;
+ boardID = thread.board.ID;
+ threadID = thread.ID;
+ if (ThreadWatcher.db.get({
+ boardID: boardID,
+ threadID: threadID
+ })) {
+ return ThreadWatcher.rm(boardID, threadID);
+ } else {
+ return ThreadWatcher.add(thread);
+ }
+ },
+ add: function(thread) {
+ var boardID, data, threadID;
+ data = {};
+ boardID = thread.board.ID;
+ threadID = thread.ID;
+ if (thread.isDead) {
+ if (Conf['Auto Prune'] && ThreadWatcher.db.get({
+ boardID: boardID,
+ threadID: threadID
+ })) {
+ ThreadWatcher.rm(boardID, threadID);
+ return;
+ }
+ data.isDead = true;
+ }
+ data.excerpt = Get.threadExcerpt(thread);
+ ThreadWatcher.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ val: data
+ });
+ ThreadWatcher.refresh();
+ if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {
+ return ThreadWatcher.fetchStatus({
+ boardID: boardID,
+ threadID: threadID,
+ data: data
+ }, true);
+ }
+ },
+ rm: function(boardID, threadID) {
+ ThreadWatcher.db["delete"]({
+ boardID: boardID,
+ threadID: threadID
+ });
+ return ThreadWatcher.refresh();
+ },
+ menu: {
+ refreshers: [],
+ init: function() {
+ var menu;
+ if (!Conf['Thread Watcher']) {
+ return;
+ }
+ menu = this.menu = new UI.Menu('thread watcher');
+ $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) {
+ return menu.toggle(e, this, ThreadWatcher);
+ });
+ this.addHeaderMenuEntry();
+ return this.addMenuEntries();
+ },
+ addHeaderMenuEntry: function() {
+ var entryEl;
+ if (g.VIEW !== 'thread') {
+ return;
+ }
+ entryEl = $.el('a', {
+ href: 'javascript:;'
+ });
+ Header.menu.addEntry({
+ el: entryEl,
+ order: 60
+ });
+ $.on(entryEl, 'click', function() {
+ return ThreadWatcher.toggle(g.threads[g.BOARD + "." + g.THREADID]);
+ });
+ return this.refreshers.push(function() {
+ var addClass, ref, rmClass, text;
+ ref = $('.current', ThreadWatcher.list) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = ref[0], rmClass = ref[1], text = ref[2];
+ $.addClass(entryEl, addClass);
+ $.rmClass(entryEl, rmClass);
+ return entryEl.textContent = text;
+ });
+ },
+ addMenuEntries: function() {
+ var cb, conf, entries, entry, i, len, name, ref, ref1, refresh, subEntries;
+ entries = [];
+ entries.push({
+ cb: ThreadWatcher.cb.openAll,
+ entry: {
+ el: $.el('a', {
+ textContent: 'Open all threads'
+ })
+ },
+ refresh: function() {
+ return (ThreadWatcher.list.firstElementChild ? $.rmClass : $.addClass)(this.el, 'disabled');
+ }
+ });
+ entries.push({
+ cb: ThreadWatcher.cb.pruneDeads,
+ entry: {
+ el: $.el('a', {
+ textContent: 'Prune dead threads'
+ })
+ },
+ refresh: function() {
+ return ($('.dead-thread', ThreadWatcher.list) ? $.rmClass : $.addClass)(this.el, 'disabled');
+ }
+ });
+ subEntries = [];
+ ref = Config.threadWatcher;
+ for (name in ref) {
+ conf = ref[name];
+ subEntries.push(this.createSubEntry(name, conf[1]));
+ }
+ entries.push({
+ entry: {
+ el: $.el('span', {
+ textContent: 'Settings'
+ }),
+ subEntries: subEntries
+ }
+ });
+ for (i = 0, len = entries.length; i < len; i++) {
+ ref1 = entries[i], entry = ref1.entry, cb = ref1.cb, refresh = ref1.refresh;
+ if (entry.el.nodeName === 'A') {
+ entry.el.href = 'javascript:;';
+ }
+ if (cb) {
+ $.on(entry.el, 'click', cb);
+ }
+ if (refresh) {
+ this.refreshers.push(refresh.bind(entry));
+ }
+ this.menu.addEntry(entry);
+ }
+ },
+ createSubEntry: function(name, desc) {
+ var entry, input;
+ entry = {
+ type: 'thread watcher',
+ el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
+ };
+ entry.el.title = desc;
+ input = entry.el.firstElementChild;
+ if (name === 'Show Unread Count' && !ThreadWatcher.unreadEnabled) {
+ input.disabled = true;
+ $.addClass(entry.el, 'disabled');
+ entry.el.title += '\n[Remember Last Read Post is disabled.]';
+ }
+ $.on(input, 'change', $.cb.checked);
+ if (name === 'Current Board' || name === 'Show Unread Count') {
+ $.on(input, 'change', ThreadWatcher.refresh);
+ }
+ if (name === 'Show Unread Count' || name === 'Auto Update Thread Watcher') {
+ $.on(input, 'change', ThreadWatcher.fetchAuto);
+ }
+ return entry;
+ }
+ }
+ };
+
+ return ThreadWatcher;
+
+}).call(this);
+
+Unread = (function() {
+ var Unread;
+
+ Unread = {
+ init: function() {
+ if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Remember Last Read Post'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) {
+ return;
+ }
+ if (Conf['Remember Last Read Post']) {
+ $.sync('Remember Last Read Post', function(enabled) {
+ return Conf['Remember Last Read Post'] = enabled;
+ });
+ this.db = new DataBoard('lastReadPosts', this.sync);
+ }
+ this.hr = $.el('hr', {
+ id: 'unread-line'
+ });
+ this.posts = new Set();
+ this.postsQuotingYou = new Set();
+ this.order = new RandomAccessList();
+ this.position = null;
+ Callbacks.Thread.push({
+ name: 'Unread',
+ cb: this.node
+ });
+ return Callbacks.Post.push({
+ name: 'Unread',
+ cb: this.addPost
+ });
+ },
+ node: function() {
+ var ID, j, len, ref, ref1;
+ Unread.thread = this;
+ Unread.title = d.title;
+ Unread.lastReadPost = ((ref = Unread.db) != null ? ref.get({
+ boardID: this.board.ID,
+ threadID: this.ID
+ }) : void 0) || 0;
+ Unread.readCount = 0;
+ ref1 = this.posts.keys;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ ID = ref1[j];
+ if (+ID <= Unread.lastReadPost) {
+ Unread.readCount++;
+ }
+ }
+ $.one(d, '4chanXInitFinished', Unread.ready);
+ return $.on(d, 'ThreadUpdate', Unread.onUpdate);
+ },
+ ready: function() {
+ if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) {
+ Unread.scroll();
+ }
+ Unread.setLine(true);
+ Unread.read();
+ Unread.update();
+ $.on(d, 'scroll visibilitychange', Unread.read);
+ if (Conf['Unread Line']) {
+ return $.on(d, 'visibilitychange', Unread.setLine);
+ }
+ },
+ positionPrev: function() {
+ if (Unread.position) {
+ return Unread.position.prev;
+ } else {
+ return Unread.order.last;
+ }
+ },
+ scroll: function() {
+ var hash, position, ref, root;
+ if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
+ return;
+ }
+ ReplyPruning.showIfHidden((ref = Unread.position) != null ? ref.data.nodes.root.id : void 0);
+ position = Unread.positionPrev();
+ while (position) {
+ root = position.data.nodes.root;
+ if (!root.getBoundingClientRect().height) {
+ position = position.prev;
+ } else {
+ Header.scrollToIfNeeded(root, true);
+ break;
+ }
+ }
+ },
+ sync: function() {
+ var ID, i, j, lastReadPost, postIDs, ref, ref1;
+ if (Unread.lastReadPost == null) {
+ return;
+ }
+ lastReadPost = Unread.db.get({
+ boardID: Unread.thread.board.ID,
+ threadID: Unread.thread.ID,
+ defaultValue: 0
+ });
+ if (!(Unread.lastReadPost < lastReadPost)) {
+ return;
+ }
+ Unread.lastReadPost = lastReadPost;
+ postIDs = Unread.thread.posts.keys;
+ for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) {
+ ID = +postIDs[i];
+ if (!Unread.thread.posts[ID].isFetchedQuote) {
+ if (ID > Unread.lastReadPost) {
+ break;
+ }
+ Unread.posts["delete"](ID);
+ Unread.postsQuotingYou["delete"](ID);
+ }
+ Unread.readCount++;
+ }
+ Unread.updatePosition();
+ Unread.setLine();
+ return Unread.update();
+ },
+ addPost: function() {
+ var ref;
+ if (this.isFetchedQuote || this.isClone) {
+ return;
+ }
+ Unread.order.push(this);
+ if (this.ID <= Unread.lastReadPost || this.isHidden || ((ref = QuoteYou.db) != null ? ref.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ }) : void 0)) {
+ return;
+ }
+ Unread.posts.add(this.ID);
+ Unread.addPostQuotingYou(this);
+ return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID];
+ },
+ addPostQuotingYou: function(post) {
+ var j, len, quotelink, ref, ref1;
+ ref = post.nodes.quotelinks;
+ for (j = 0, len = ref.length; j < len; j++) {
+ quotelink = ref[j];
+ if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) {
+ continue;
+ }
+ Unread.postsQuotingYou.add(post.ID);
+ Unread.openNotification(post);
+ return;
+ }
+ },
+ openNotification: function(post) {
+ var notif;
+ if (!Header.areNotificationsEnabled) {
+ return;
+ }
+ try {
+ notif = new Notification(post.info.nameBlock + " replied to you", {
+ body: post.info.commentDisplay,
+ icon: Favicon.logo
+ });
+ notif.onclick = function() {
+ Header.scrollToIfNeeded(post.nodes.root, true);
+ return $.global(function() {
+ return window.focus();
+ });
+ };
+ return notif.onshow = function() {
+ return setTimeout(function() {
+ return notif.close();
+ }, 7 * $.SECOND);
+ };
+ } catch (_error) {}
+ },
+ onUpdate: function(e) {
+ if (!e.detail[404]) {
+ Unread.setLine();
+ Unread.read();
+ }
+ return Unread.update();
+ },
+ readSinglePost: function(post) {
+ var ID;
+ ID = post.ID;
+ if (!Unread.posts.has(ID)) {
+ return;
+ }
+ Unread.posts["delete"](ID);
+ Unread.postsQuotingYou["delete"](ID);
+ Unread.updatePosition();
+ Unread.saveLastReadPost();
+ return Unread.update();
+ },
+ read: $.debounce(100, function(e) {
+ var ID, count, data, ref, ref1, root;
+ if (!Unread.posts.size && Unread.readCount !== Unread.thread.posts.keys.length) {
+ Unread.saveLastReadPost();
+ }
+ if (d.hidden || !Unread.posts.size) {
+ return;
+ }
+ count = 0;
+ while (Unread.position) {
+ ref = Unread.position, ID = ref.ID, data = ref.data;
+ root = data.nodes.root;
+ if (!(!root.getBoundingClientRect().height || Header.getBottomOf(root) > -1)) {
+ break;
+ }
+ count++;
+ Unread.posts["delete"](ID);
+ Unread.postsQuotingYou["delete"](ID);
+ if ((ref1 = QuoteYou.db) != null ? ref1.get({
+ boardID: data.board.ID,
+ threadID: data.thread.ID,
+ postID: ID
+ }) : void 0) {
+ QuoteYou.lastRead = root;
+ }
+ Unread.position = Unread.position.next;
+ }
+ if (!count) {
+ return;
+ }
+ Unread.updatePosition();
+ Unread.saveLastReadPost();
+ if (e) {
+ return Unread.update();
+ }
+ }),
+ updatePosition: function() {
+ while (Unread.position && !Unread.posts.has(Unread.position.ID)) {
+ Unread.position = Unread.position.next;
+ }
+ },
+ saveLastReadPost: $.debounce(2 * $.SECOND, function() {
+ var ID, i, j, postIDs, ref, ref1;
+ $.forceSync('Remember Last Read Post');
+ if (!(Conf['Remember Last Read Post'] && Unread.db)) {
+ return;
+ }
+ postIDs = Unread.thread.posts.keys;
+ for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) {
+ ID = +postIDs[i];
+ if (!Unread.thread.posts[ID].isFetchedQuote) {
+ if (Unread.posts.has(ID)) {
+ break;
+ }
+ Unread.lastReadPost = ID;
+ }
+ Unread.readCount++;
+ }
+ if (Unread.thread.isDead && !Unread.thread.isArchived) {
+ return;
+ }
+ Unread.db.forceSync();
+ return Unread.db.set({
+ boardID: Unread.thread.board.ID,
+ threadID: Unread.thread.ID,
+ val: Unread.lastReadPost
+ });
+ }),
+ setLine: function(force) {
+ if (!Conf['Unread Line']) {
+ return;
+ }
+ if (Unread.hr.hidden || d.hidden || (force === true)) {
+ if ((Unread.linePosition = Unread.positionPrev())) {
+ $.after(Unread.linePosition.data.nodes.root, Unread.hr);
+ } else {
+ $.rm(Unread.hr);
+ }
+ }
+ return Unread.hr.hidden = Unread.linePosition === Unread.order.last;
+ },
+ update: function() {
+ var count, countQuotingYou, isDead, titleCount, titleDead, titleQuotingYou;
+ count = Unread.posts.size;
+ countQuotingYou = Unread.postsQuotingYou.size;
+ if (Conf['Unread Count']) {
+ titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : '';
+ titleCount = count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '';
+ titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title;
+ d.title = "" + titleQuotingYou + titleCount + titleDead;
+ }
+ $.forceSync('Remember Last Read Post');
+ if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) {
+ ThreadWatcher.update(Unread.thread.board.ID, Unread.thread.ID, {
+ isDead: Unread.thread.isDead,
+ unread: count,
+ quotingYou: countQuotingYou
+ });
+ }
+ if (Conf['Unread Favicon']) {
+ isDead = Unread.thread.isDead;
+ Favicon.el.href = countQuotingYou ? Favicon[isDead ? 'unreadDeadY' : 'unreadY'] : count ? Favicon[isDead ? 'unreadDead' : 'unread'] : Favicon[isDead ? 'dead' : 'default'];
+ return $.add(d.head, Favicon.el);
+ }
+ }
+ };
+
+ return Unread;
+
+}).call(this);
+
+Captcha = {};
+
+(function() {
+ Captcha.fixes = {
+ imageKeys: '789456123uiojklm'.split('').concat(['Comma', 'Period']),
+ imageKeys16: '7890uiopjkl'.split('').concat(['Semicolon', 'm', 'Comma', 'Period', 'Slash']),
+ css: '.rc-imageselect-target > div:focus, .rc-image-tile-target:focus {\n outline: 2px solid #4a90e2;\n}\n.rc-imageselect-target td:focus {\n box-shadow: inset 0 0 0 2px #4a90e2;\n outline: none;\n}\n.rc-button-default:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}',
+ cssNoscript: '.fbc-payload-imageselect {\n position: relative;\n}\n.fbc-payload-imageselect > label {\n position: absolute;\n display: block;\n height: 93.3px;\n width: 93.3px;\n}\nlabel[data-row="0"] {top: 0px;}\nlabel[data-row="1"] {top: 93.3px;}\nlabel[data-row="2"] {top: 186.6px;}\nlabel[data-col="0"] {left: 0px;}\nlabel[data-col="1"] {left: 93.3px;}\nlabel[data-col="2"] {left: 186.6px;}\n.fbc-payload-imageselect > input:focus + label {\n outline: 2px solid #4a90e2;\n}\n.fbc-button-verify input:focus {\n box-shadow: inset 0 0 0 2px #0063d6;\n}\nbody.focus .fbc {\n box-shadow: inset 0 0 0 2px #4a90e2;\n}',
+ init: function() {
+ switch (location.pathname.split('/')[3]) {
+ case 'anchor':
+ return this.initMain();
+ case 'frame':
+ return this.initPopup();
+ case 'fallback':
+ return this.initNoscript();
+ }
+ },
+ initMain: function() {
+ var a, j, len, ref;
+ $.onExists(d.body, '#recaptcha-anchor', function(checkbox) {
+ var focus;
+ focus = function() {
+ var ref;
+ if (d.hasFocus() && ((ref = d.activeElement) === d.documentElement || ref === d.body)) {
+ return checkbox.focus();
+ }
+ };
+ focus();
+ return $.on(window, 'focus', function() {
+ return $.queueTask(focus);
+ });
+ });
+ ref = $$('.rc-anchor-pt a');
+ for (j = 0, len = ref.length; j < len; j++) {
+ a = ref[j];
+ a.tabIndex = -1;
+ }
+ },
+ initPopup: function() {
+ $.addStyle(this.css);
+ this.fixImages();
+ new MutationObserver((function(_this) {
+ return function() {
+ return _this.fixImages();
+ };
+ })(this)).observe(d.body, {
+ childList: true,
+ subtree: true
+ });
+ return $.on(d, 'keydown', this.keybinds.bind(this));
+ },
+ initNoscript: function() {
+ var data, ref, token;
+ this.noscript = true;
+ data = (token = (ref = $('.fbc-verification-token > textarea')) != null ? ref.value : void 0) ? {
+ token: token
+ } : {
+ working: true
+ };
+ new Connection(window.parent, '*').send(data);
+ d.body.classList.toggle('focus', d.hasFocus());
+ $.on(window, 'focus blur', function() {
+ return d.body.classList.toggle('focus', d.hasFocus());
+ });
+ this.images = $$('.fbc-payload-imageselect > input');
+ this.width = 3;
+ if (this.images.length !== 9) {
+ return;
+ }
+ $.addStyle(this.cssNoscript);
+ this.addLabels();
+ $.on(d, 'keydown', this.keybinds.bind(this));
+ return $.on($('.fbc-imageselect-challenge > form'), 'submit', this.checkForm.bind(this));
+ },
+ fixImages: function() {
+ var img, j, len, ref;
+ this.images = $$('.rc-image-tile-target');
+ if (!this.images.length) {
+ this.images = $$('.rc-imageselect-target > div, .rc-imageselect-target td');
+ }
+ this.width = $$('.rc-imageselect-target tr:first-of-type td').length || Math.round(Math.sqrt(this.images.length));
+ ref = this.images;
+ for (j = 0, len = ref.length; j < len; j++) {
+ img = ref[j];
+ img.tabIndex = 0;
+ }
+ if (this.images.length === 9) {
+ this.addTooltips(this.images);
+ } else {
+ this.addTooltips16(this.images);
+ }
+ return this.complaintLinks();
+ },
+ complaintLinks: function() {
+ var errmsg, j, len, link, ref;
+ ref = $$('.rc-imageselect-incorrect-response, .rc-imageselect-error-select-one, .rc-imageselect-error-select-more, .rc-imageselect-error-dynamic-more');
+ for (j = 0, len = ref.length; j < len; j++) {
+ errmsg = ref[j];
+ if (!$('a', errmsg)) {
+ link = $.el('a', {
+ href: 'https://www.4chan-x.net/captchas.html',
+ target: '_blank',
+ textContent: '[complain]'
+ });
+ $.add(errmsg, [$.tn(' '), link]);
+ }
+ }
+ },
+ addLabels: function() {
+ var checkbox, i, imageSelect, label, labels;
+ imageSelect = $('.fbc-payload-imageselect');
+ labels = (function() {
+ var j, len, ref, results;
+ ref = this.images;
+ results = [];
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ checkbox = ref[i];
+ checkbox.id = "checkbox-" + i;
+ label = $.el('label', {
+ htmlFor: checkbox.id
+ });
+ label.dataset.row = Math.floor(i / 3);
+ label.dataset.col = i % 3;
+ $.after(checkbox, label);
+ results.push(label);
+ }
+ return results;
+ }).call(this);
+ return this.addTooltips(labels);
+ },
+ addTooltips: function(nodes) {
+ var i, j, len, node;
+ for (i = j = 0, len = nodes.length; j < len; i = ++j) {
+ node = nodes[i];
+ node.title = this.imageKeys[i] + " or " + (this.imageKeys[i + 9][0].toUpperCase()) + this.imageKeys[i + 9].slice(1);
+ }
+ },
+ addTooltips16: function(nodes) {
+ var i, j, key, len, node, ref;
+ ref = this.imageKeys16;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ key = ref[i];
+ if (i % 4 < this.width && (node = nodes[nodes.length - (4 - Math.floor(i / 4)) * this.width + (i % 4)])) {
+ node.title = "" + (key[0].toUpperCase()) + key.slice(1);
+ }
+ }
+ },
+ checkForm: function(e) {
+ var checkbox, j, len, n, ref;
+ n = 0;
+ ref = this.images;
+ for (j = 0, len = ref.length; j < len; j++) {
+ checkbox = ref[j];
+ if (checkbox.checked) {
+ n++;
+ }
+ }
+ if (n === 0) {
+ return e.preventDefault();
+ }
+ },
+ keybinds: function(e) {
+ var dx, i, img, key, last, n, reload, verify, w, x;
+ if (!(this.images && doc.contains(this.images[0]))) {
+ return;
+ }
+ n = this.images.length;
+ w = this.width;
+ last = n + w - 1;
+ reload = $('#recaptcha-reload-button, .fbc-button-reload');
+ verify = $('#recaptcha-verify-button, .fbc-button-verify > input');
+ x = this.images.indexOf(d.activeElement);
+ if (x < 0) {
+ x = d.activeElement === verify ? last : n;
+ }
+ key = Keybinds.keyCode(e);
+ if (!this.noscript && key === 'Space' && x < n) {
+ this.images[x].click();
+ } else if (n === 9 && (i = this.imageKeys.indexOf(key)) >= 0) {
+ this.images[i % 9].click();
+ verify.focus();
+ } else if (n !== 9 && (i = this.imageKeys16.indexOf(key)) >= 0 && i % 4 < w && (img = this.images[n - (4 - Math.floor(i / 4)) * w + (i % 4)])) {
+ img.click();
+ verify.focus();
+ } else if (dx = {
+ 'Up': n,
+ 'Down': w,
+ 'Left': last,
+ 'Right': 1
+ }[key]) {
+ x = (x + dx) % (n + w);
+ if ((n < x && x < last)) {
+ x = dx === last ? n : last;
+ }
+ (this.images[x] || (x === n ? reload : void 0) || (x === last ? verify : void 0)).focus();
+ } else {
+ return;
+ }
+ e.preventDefault();
+ return e.stopPropagation();
+ }
+ };
+
+}).call(this);
+
+(function() {
+ Captcha.replace = {
+ init: function() {
+ if (!(d.cookie.indexOf('pass_enabled=1') < 0)) {
+ return;
+ }
+ if (location.hostname === 'sys.4chan.org' && /[?&]altc\b/.test(location.search) && Main.jsEnabled) {
+ $.onExists(doc, 'script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', function() {
+ $.global(function() {
+ return window.el.onload = null;
+ });
+ return Captcha.v1.create();
+ });
+ return;
+ }
+ if (((Conf['Use Recaptcha v1'] && location.hostname === 'boards.4chan.org') || (Conf['Use Recaptcha v1 in Reports'] && location.hostname === 'sys.4chan.org')) && Main.jsEnabled) {
+ $.ready(Captcha.replace.v1);
+ return;
+ }
+ if (Conf['Force Noscript Captcha'] && Main.jsEnabled) {
+ $.ready(Captcha.replace.noscript);
+ return;
+ }
+ if (Conf['captchaLanguage'].trim() || Conf['Captcha Fixes']) {
+ if (location.hostname === 'boards.4chan.org') {
+ return $.onExists(doc, '#captchaFormPart', function(node) {
+ return $.onExists(node, 'iframe', Captcha.replace.iframe);
+ });
+ } else {
+ return $.onExists(doc, 'iframe', Captcha.replace.iframe);
+ }
+ }
+ },
+ noscript: function() {
+ var insert, noscript, original, span, toggle;
+ if (!((original = $('#g-recaptcha, #captchaContainerAlt')) && (noscript = $('noscript')))) {
+ return;
+ }
+ span = $.el('span', {
+ id: 'captcha-forced-noscript'
+ });
+ $.replace(noscript, span);
+ $.rm(original);
+ insert = function() {
+ span.innerHTML = noscript.textContent;
+ return Captcha.replace.iframe($('iframe', span));
+ };
+ if ((toggle = $('#togglePostFormLink a, #form-link'))) {
+ return $.on(toggle, 'click', insert);
+ } else {
+ return insert();
+ }
+ },
+ v1: function() {
+ var form, link;
+ if (!$.id('g-recaptcha')) {
+ return;
+ }
+ Captcha.v1.replace();
+ if ((link = $.id('form-link'))) {
+ return $.on(link, 'click', function() {
+ return Captcha.v1.create();
+ });
+ } else if (location.hostname === 'boards.4chan.org') {
+ form = $.id('postForm');
+ return form.addEventListener('focus', (function() {
+ return Captcha.v1.create();
+ }), true);
+ } else {
+ return Captcha.v1.create();
+ }
+ },
+ iframe: function(iframe) {
+ var lang, src;
+ if ((lang = Conf['captchaLanguage'].trim())) {
+ src = /[?&]hl=/.test(iframe.src) ? iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) : iframe.src + ("&hl=" + (encodeURIComponent(lang)));
+ if (iframe.src !== src) {
+ iframe.src = src;
+ }
+ }
+ return Captcha.replace.autocopy(iframe);
+ },
+ autocopy: function(iframe) {
+ if (!(Conf['Captcha Fixes'] && /^https:\/\/www\.google\.com\/recaptcha\/api\/fallback\?/.test(iframe.src))) {
+ return;
+ }
+ return new Connection(iframe, 'https://www.google.com', {
+ working: function() {
+ var ref, ref1;
+ if ((ref = $.id('qr')) != null ? ref.contains(iframe) : void 0) {
+ return (ref1 = $('#qr .captcha-container textarea')) != null ? ref1.parentNode.hidden = true : void 0;
+ }
+ },
+ token: function(token) {
+ var node, textarea;
+ node = iframe;
+ while ((node = node.parentNode)) {
+ if ((textarea = $('textarea', node))) {
+ break;
+ }
+ }
+ textarea.value = token;
+ return $.event('input', null, textarea);
+ }
+ });
+ }
+ };
+
+}).call(this);
+
+(function() {
+ Captcha.v1 = {
+ blank: "data:image/svg+xml, ",
+ init: function() {
+ var imgContainer, input;
+ if (d.cookie.indexOf('pass_enabled=1') >= 0) {
+ return;
+ }
+ if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt'))) {
+ return;
+ }
+ imgContainer = $.el('div', {
+ className: 'captcha-img',
+ title: 'Reload reCAPTCHA'
+ });
+ $.extend(imgContainer, {
+ innerHTML: " "
+ });
+ input = $.el('input', {
+ className: 'captcha-input field',
+ title: 'Verification',
+ autocomplete: 'off',
+ spellcheck: false
+ });
+ this.nodes = {
+ img: imgContainer.firstChild,
+ input: input
+ };
+ $.on(input, 'blur', QR.focusout);
+ $.on(input, 'focus', QR.focusin);
+ $.on(input, 'keydown', QR.captcha.keydown.bind(QR.captcha));
+ $.on(this.nodes.img.parentNode, 'click', QR.captcha.reload.bind(QR.captcha));
+ $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v1');
+ $.after(QR.nodes.com.parentNode, [imgContainer, input]);
+ this.captchas = [];
+ $.get('captchas', [], function(arg) {
+ var captchas;
+ captchas = arg.captchas;
+ QR.captcha.sync(captchas);
+ return QR.captcha.clear();
+ });
+ $.sync('captchas', this.sync);
+ this.replace();
+ this.beforeSetup();
+ if (Conf['Auto-load captcha']) {
+ this.setup();
+ }
+ new MutationObserver(this.afterSetup).observe($.id('captchaContainerAlt'), {
+ childList: true
+ });
+ return this.afterSetup();
+ },
+ replace: function() {
+ var container, old;
+ if (this.script) {
+ return;
+ }
+ if (!(this.script = $('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]', d.head))) {
+ this.script = $.el('script', {
+ src: '//www.google.com/recaptcha/api/js/recaptcha_ajax.js'
+ });
+ $.add(d.head, this.script);
+ }
+ if (old = $.id('g-recaptcha')) {
+ container = $.el('div', {
+ id: 'captchaContainerAlt'
+ });
+ return $.replace(old, container);
+ }
+ },
+ create: function() {
+ var cont, lang;
+ cont = $.id('captchaContainerAlt');
+ if (this.occupied) {
+ return;
+ }
+ this.occupied = true;
+ if ((lang = Conf['captchaLanguage'].trim())) {
+ cont.dataset.lang = lang;
+ }
+ $.onExists(cont, '#recaptcha_image', function(image) {
+ return $.on(image, 'click', function() {
+ if ($.id('recaptcha_challenge_image')) {
+ return $.global(function() {
+ return window.Recaptcha.reload();
+ });
+ }
+ });
+ });
+ $.onExists(cont, '#recaptcha_response_field', function(field) {
+ $.on(field, 'keydown', function(e) {
+ if (e.keyCode === 8 && !field.value) {
+ return $.global(function() {
+ return window.Recaptcha.reload();
+ });
+ }
+ });
+ if (location.hostname === 'sys.4chan.org') {
+ return field.focus();
+ }
+ });
+ return $.global(function() {
+ var container, options, script;
+ container = document.getElementById('captchaContainerAlt');
+ options = {
+ theme: 'clean',
+ tabindex: {
+ "boards.4chan.org": 5
+ }[location.hostname],
+ lang: container.dataset.lang
+ };
+ if (window.Recaptcha) {
+ return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
+ } else {
+ script = document.head.querySelector('script[src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"]');
+ return script.addEventListener('load', function() {
+ return window.Recaptcha.create('6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', container, options);
+ }, false);
+ }
+ });
+ },
+ cb: {
+ focus: function() {
+ return QR.captcha.setup(false, true);
+ }
+ },
+ beforeSetup: function() {
+ var img, input, ref;
+ ref = this.nodes, img = ref.img, input = ref.input;
+ img.parentNode.hidden = true;
+ img.src = this.blank;
+ input.value = '';
+ input.placeholder = 'Focus to load reCAPTCHA';
+ this.count();
+ return $.on(input, 'focus click', this.cb.focus);
+ },
+ needed: function() {
+ var captchaCount, postsCount;
+ captchaCount = this.captchas.length;
+ if (QR.req) {
+ captchaCount++;
+ }
+ postsCount = QR.posts.length;
+ if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
+ postsCount = 0;
+ }
+ return captchaCount < postsCount;
+ },
+ onNewPost: function() {},
+ onPostChange: function() {},
+ setup: function(focus, force) {
+ if (!(this.isEnabled && (force || this.needed()))) {
+ return;
+ }
+ this.create();
+ if (focus) {
+ $.addClass(QR.nodes.el, 'focus');
+ return this.nodes.input.focus();
+ }
+ },
+ afterSetup: function() {
+ var challenge, img, input, ref, setLifetime;
+ if (!(challenge = $.id('recaptcha_challenge_field_holder'))) {
+ return;
+ }
+ if (challenge === QR.captcha.nodes.challenge) {
+ return;
+ }
+ setLifetime = function(e) {
+ return QR.captcha.lifetime = e.detail;
+ };
+ $.on(window, 'captcha:timeout', setLifetime);
+ $.global(function() {
+ return window.dispatchEvent(new CustomEvent('captcha:timeout', {
+ detail: window.RecaptchaState.timeout
+ }));
+ });
+ $.off(window, 'captcha:timeout', setLifetime);
+ ref = QR.captcha.nodes, img = ref.img, input = ref.input;
+ img.parentNode.hidden = false;
+ input.placeholder = 'Verification';
+ QR.captcha.count();
+ $.off(input, 'focus click', QR.captcha.cb.focus);
+ QR.captcha.nodes.challenge = challenge;
+ new MutationObserver(QR.captcha.load.bind(QR.captcha)).observe(challenge, {
+ childList: true,
+ subtree: true,
+ attributes: true
+ });
+ QR.captcha.load();
+ if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
+ QR.nodes.el.style.top = null;
+ return QR.nodes.el.style.bottom = '0px';
+ }
+ },
+ destroy: function() {
+ if (!this.script) {
+ return;
+ }
+ $.global(function() {
+ return window.Recaptcha.destroy();
+ });
+ delete this.occupied;
+ if (this.nodes) {
+ return this.beforeSetup();
+ }
+ },
+ sync: function(captchas) {
+ if (captchas == null) {
+ captchas = [];
+ }
+ QR.captcha.captchas = captchas;
+ return QR.captcha.count();
+ },
+ getOne: function() {
+ var captcha, challenge, response, timeout;
+ this.clear();
+ if (captcha = this.captchas.shift()) {
+ this.count();
+ $.set('captchas', this.captchas);
+ return captcha;
+ } else {
+ challenge = this.nodes.img.alt;
+ timeout = this.timeout;
+ if (/\S/.test(response = this.nodes.input.value)) {
+ this.destroy();
+ return {
+ challenge: challenge,
+ response: response,
+ timeout: timeout
+ };
+ } else {
+ return null;
+ }
+ }
+ },
+ save: function() {
+ var response;
+ if (!/\S/.test(response = this.nodes.input.value)) {
+ return;
+ }
+ this.nodes.input.value = '';
+ this.captchas.push({
+ challenge: this.nodes.img.alt,
+ response: response,
+ timeout: this.timeout
+ });
+ this.captchas.sort(function(a, b) {
+ return a.timeout - b.timeout;
+ });
+ this.count();
+ this.destroy();
+ this.setup(false, true);
+ return $.set('captchas', this.captchas);
+ },
+ clear: function() {
+ var captcha, i, j, len, now, ref;
+ if (!this.captchas.length) {
+ return;
+ }
+ $.forceSync('captchas');
+ now = Date.now();
+ ref = this.captchas;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ captcha = ref[i];
+ if (captcha.timeout > now) {
+ break;
+ }
+ }
+ if (!i) {
+ return;
+ }
+ this.captchas = this.captchas.slice(i);
+ this.count();
+ return $.set('captchas', this.captchas);
+ },
+ load: function() {
+ var challenge, challenge_image;
+ if ($('#captchaContainerAlt[class~="recaptcha_is_showing_audio"]')) {
+ this.nodes.img.src = this.blank;
+ return;
+ }
+ if (!this.nodes.challenge.firstChild) {
+ return;
+ }
+ if (!(challenge_image = $.id('recaptcha_challenge_image'))) {
+ return;
+ }
+ this.timeout = Date.now() + this.lifetime * $.SECOND - $.MINUTE;
+ challenge = this.nodes.challenge.firstChild.value;
+ this.nodes.img.alt = challenge;
+ this.nodes.img.src = challenge_image.src;
+ this.nodes.input.value = '';
+ return this.clear();
+ },
+ count: function() {
+ var count, placeholder;
+ count = this.captchas ? this.captchas.length : 0;
+ placeholder = this.nodes.input.placeholder.replace(/\ \(.*\)$/, '');
+ placeholder += (function() {
+ switch (count) {
+ case 0:
+ if (placeholder === 'Verification') {
+ return ' (Shift + Enter to cache)';
+ } else {
+ return '';
+ }
+ break;
+ case 1:
+ return ' (1 cached captcha)';
+ default:
+ return " (" + count + " cached captchas)";
+ }
+ })();
+ this.nodes.input.placeholder = placeholder;
+ this.nodes.input.alt = count;
+ clearTimeout(this.timer);
+ if (count) {
+ return this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
+ }
+ },
+ reload: function(focus) {
+ $.global(function() {
+ if (window.Recaptcha.type === 'image') {
+ window.Recaptcha.reload();
+ } else {
+ window.Recaptcha.switch_type('image');
+ }
+ return window.Recaptcha.should_focus = false;
+ });
+ if (focus) {
+ return this.nodes.input.focus();
+ }
+ },
+ keydown: function(e) {
+ if (e.keyCode === 8 && !this.nodes.input.value) {
+ this.reload();
+ } else if (e.keyCode === 13 && e.shiftKey) {
+ this.save();
+ } else {
+ return;
+ }
+ return e.preventDefault();
+ }
+ };
+
+}).call(this);
+
+(function() {
+ Captcha.v2 = {
+ lifetime: 2 * $.MINUTE,
+ init: function() {
+ var counter, root;
+ if (d.cookie.indexOf('pass_enabled=1') >= 0) {
+ return;
+ }
+ if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt, #captcha-forced-noscript'))) {
+ return;
+ }
+ if ((this.noscript = Conf['Force Noscript Captcha'] || !Main.jsEnabled)) {
+ $.addClass(QR.nodes.el, 'noscript-captcha');
+ }
+ this.captchas = [];
+ $.get('captchas', [], function(arg) {
+ var captchas;
+ captchas = arg.captchas;
+ return QR.captcha.sync(captchas);
+ });
+ $.sync('captchas', this.sync.bind(this));
+ root = $.el('div', {
+ className: 'captcha-root'
+ });
+ $.extend(root, {
+ innerHTML: ""
+ });
+ counter = $('.captcha-counter > a', root);
+ this.nodes = {
+ root: root,
+ counter: counter
+ };
+ this.count();
+ $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2');
+ $.after(QR.nodes.com.parentNode, root);
+ $.on(counter, 'click', this.toggle.bind(this));
+ $.on(counter, 'keydown', (function(_this) {
+ return function(e) {
+ if (Keybinds.keyCode(e) !== 'Space') {
+ return;
+ }
+ _this.toggle();
+ e.preventDefault();
+ return e.stopPropagation();
+ };
+ })(this));
+ return $.on(window, 'captcha:success', (function(_this) {
+ return function() {
+ return $.queueTask(function() {
+ return _this.save(false);
+ });
+ };
+ })(this));
+ },
+ timeouts: {},
+ postsCount: 0,
+ noscriptURL: function() {
+ var lang, url;
+ url = 'https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc';
+ if ((lang = Conf['captchaLanguage'].trim())) {
+ url += "&hl=" + (encodeURIComponent(lang));
+ }
+ return url;
+ },
+ needed: function() {
+ var captchaCount;
+ captchaCount = this.captchas.length;
+ if (QR.req) {
+ captchaCount++;
+ }
+ this.postsCount = QR.posts.length;
+ if (this.postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
+ this.postsCount = 0;
+ }
+ return captchaCount < this.postsCount;
+ },
+ onNewPost: function() {
+ return this.setup();
+ },
+ onPostChange: function() {
+ if (this.postsCount === 0) {
+ this.setup();
+ }
+ if (QR.posts.length === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
+ return this.postsCount = 0;
+ }
+ },
+ toggle: function() {
+ if (this.nodes.container && !this.timeouts.destroy) {
+ return this.destroy();
+ } else {
+ return this.setup(true, true);
+ }
+ },
+ setup: function(focus, force) {
+ if (!(this.isEnabled && (this.needed() || force))) {
+ return;
+ }
+ if (focus) {
+ $.addClass(QR.nodes.el, 'focus');
+ this.nodes.counter.focus();
+ }
+ if (this.timeouts.destroy) {
+ clearTimeout(this.timeouts.destroy);
+ delete this.timeouts.destroy;
+ return this.reload();
+ }
+ if (this.nodes.container) {
+ $.queueTask((function(_this) {
+ return function() {
+ var iframe;
+ if (_this.nodes.container && d.activeElement === _this.nodes.counter && (iframe = $('iframe', _this.nodes.container))) {
+ iframe.focus();
+ return QR.focus();
+ }
+ };
+ })(this));
+ return;
+ }
+ this.nodes.container = $.el('div', {
+ className: 'captcha-container'
+ });
+ $.prepend(this.nodes.root, this.nodes.container);
+ new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, {
+ childList: true,
+ subtree: true
+ });
+ if (this.noscript) {
+ return this.setupNoscript();
+ } else {
+ return this.setupJS();
+ }
+ },
+ setupNoscript: function() {
+ var div, iframe, textarea;
+ iframe = $.el('iframe', {
+ id: 'qr-captcha-iframe',
+ src: this.noscriptURL()
+ });
+ div = $.el('div');
+ textarea = $.el('textarea');
+ $.add(div, textarea);
+ return $.add(this.nodes.container, [iframe, div]);
+ },
+ setupJS: function() {
+ return $.global(function() {
+ var cbNative, render;
+ render = function() {
+ var classList, container;
+ classList = document.documentElement.classList;
+ container = document.querySelector('#qr .captcha-container');
+ return container.dataset.widgetID = window.grecaptcha.render(container, {
+ sitekey: '6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc',
+ theme: classList.contains('tomorrow') || classList.contains('dark-captcha') ? 'dark' : 'light',
+ callback: function(response) {
+ return window.dispatchEvent(new CustomEvent('captcha:success', {
+ detail: response
+ }));
+ }
+ });
+ };
+ if (window.grecaptcha) {
+ return render();
+ } else {
+ cbNative = window.onRecaptchaLoaded;
+ return window.onRecaptchaLoaded = function() {
+ render();
+ return cbNative();
+ };
+ }
+ });
+ },
+ afterSetup: function(mutations) {
+ var iframe, j, k, len, len1, mutation, node, ref, textarea;
+ for (j = 0, len = mutations.length; j < len; j++) {
+ mutation = mutations[j];
+ ref = mutation.addedNodes;
+ for (k = 0, len1 = ref.length; k < len1; k++) {
+ node = ref[k];
+ if ((iframe = $.x('./descendant-or-self::iframe', node))) {
+ this.setupIFrame(iframe);
+ }
+ if ((textarea = $.x('./descendant-or-self::textarea', node))) {
+ this.setupTextArea(textarea);
+ }
+ }
+ }
+ },
+ setupIFrame: function(iframe) {
+ if (!doc.contains(iframe)) {
+ return;
+ }
+ Captcha.replace.iframe(iframe);
+ $.addClass(QR.nodes.el, 'captcha-open');
+ this.fixQRPosition();
+ $.on(iframe, 'load', this.fixQRPosition);
+ if (d.activeElement === this.nodes.counter) {
+ iframe.focus();
+ }
+ return $.global(function() {
+ var f;
+ f = document.querySelector('#qr iframe');
+ return f.focus = f.blur = function() {};
+ });
+ },
+ fixQRPosition: function() {
+ if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
+ QR.nodes.el.style.top = null;
+ return QR.nodes.el.style.bottom = '0px';
+ }
+ },
+ setupTextArea: function(textarea) {
+ return $.one(textarea, 'input', (function(_this) {
+ return function() {
+ return _this.save(true);
+ };
+ })(this));
+ },
+ destroy: function() {
+ var garbage, i, ins, node, ref;
+ if (!this.isEnabled) {
+ return;
+ }
+ delete this.timeouts.destroy;
+ $.rmClass(QR.nodes.el, 'captcha-open');
+ if (this.nodes.container) {
+ $.rm(this.nodes.container);
+ }
+ delete this.nodes.container;
+ garbage = $.X('//iframe[starts-with(@src, "https://www.google.com/recaptcha/api2/frame")]/ancestor-or-self::*[parent::body]');
+ i = 0;
+ while (node = garbage.snapshotItem(i++)) {
+ if (((ref = (ins = node.nextSibling)) != null ? ref.nodeName : void 0) === 'INS') {
+ $.rm(ins);
+ }
+ $.rm(node);
+ }
+ },
+ sync: function(captchas) {
+ if (captchas == null) {
+ captchas = [];
+ }
+ this.captchas = captchas;
+ this.clear();
+ return this.count();
+ },
+ getOne: function() {
+ var captcha;
+ this.clear();
+ if ((captcha = this.captchas.shift())) {
+ $.set('captchas', this.captchas);
+ this.count();
+ return captcha;
+ } else {
+ return null;
+ }
+ },
+ save: function(pasted, token) {
+ var base, focus, ref;
+ $.forceSync('captchas');
+ this.captchas.push({
+ response: token || $('textarea', this.nodes.container).value,
+ timeout: Date.now() + this.lifetime
+ });
+ this.captchas.sort(function(a, b) {
+ return a.timeout - b.timeout;
+ });
+ $.set('captchas', this.captchas);
+ this.count();
+ focus = ((ref = d.activeElement) != null ? ref.nodeName : void 0) === 'IFRAME' && /https?:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src);
+ if (this.needed()) {
+ if (focus) {
+ if (QR.cooldown.auto || Conf['Post on Captcha Completion']) {
+ this.nodes.counter.focus();
+ } else {
+ QR.nodes.status.focus();
+ }
+ }
+ this.reload();
+ } else {
+ if (pasted) {
+ this.destroy();
+ } else {
+ if ((base = this.timeouts).destroy == null) {
+ base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND);
+ }
+ }
+ if (focus) {
+ QR.nodes.status.focus();
+ }
+ }
+ if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) {
+ return QR.submit();
+ }
+ },
+ clear: function() {
+ var captcha, i, j, len, now, ref;
+ if (!this.captchas.length) {
+ return;
+ }
+ $.forceSync('captchas');
+ now = Date.now();
+ ref = this.captchas;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ captcha = ref[i];
+ if (captcha.timeout > now) {
+ break;
+ }
+ }
+ if (!i) {
+ return;
+ }
+ this.captchas = this.captchas.slice(i);
+ this.count();
+ $.set('captchas', this.captchas);
+ return this.setup(d.activeElement === QR.nodes.status);
+ },
+ count: function() {
+ this.nodes.counter.textContent = "Captchas: " + this.captchas.length;
+ clearTimeout(this.timeouts.clear);
+ if (this.captchas.length) {
+ return this.timeouts.clear = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
+ }
+ },
+ reload: function() {
+ if ($('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) {
+ this.destroy();
+ return this.setup(false, true);
+ } else {
+ return $.global(function() {
+ var container;
+ container = document.querySelector('#qr .captcha-container');
+ return window.grecaptcha.reset(container.dataset.widgetID);
+ });
+ }
+ }
+ };
+
+}).call(this);
+
+PassLink = (function() {
+ var PassLink;
+
+ PassLink = {
+ init: function() {
+ if (!Conf['Pass Link']) {
+ return;
+ }
+ return Main.ready(this.ready);
+ },
+ ready: function() {
+ var passLink, styleSelector;
+ if (!(styleSelector = $.id('styleSelector'))) {
+ return;
+ }
+ passLink = $.el('span', {
+ className: 'brackets-wrap pass-link-container'
+ });
+ $.extend(passLink, {
+ innerHTML: " 4chan Pass "
+ });
+ $.on(passLink.firstElementChild, 'click', function() {
+ return window.open('//sys.4chan.org/auth', Date.now(), 'width=500,height=280,toolbar=0');
+ });
+ return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]);
+ }
+ };
+
+ return PassLink;
+
+}).call(this);
+
+PostSuccessful = (function() {
+ var PostSuccessful;
+
+ PostSuccessful = {
+ init: function() {
+ if (!Conf['Remember Your Posts']) {
+ return;
+ }
+ return $.ready(this.ready);
+ },
+ ready: function() {
+ var _, db, postID, ref, threadID;
+ if (d.title !== 'Post successful!') {
+ return;
+ }
+ ref = $('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref[0], threadID = ref[1], postID = ref[2];
+ postID = +postID;
+ threadID = +threadID || postID;
+ db = new DataBoard('yourPosts');
+ return db.set({
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ postID: postID,
+ val: true
+ });
+ }
+ };
+
+ return PostSuccessful;
+
+}).call(this);
+
+QR = (function() {
+ var QR,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ slice = [].slice;
+
+ QR = {
+ mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'],
+ validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i,
+ typeFromExtension: {
+ 'jpg': 'image/jpeg',
+ 'jpeg': 'image/jpeg',
+ 'png': 'image/png',
+ 'gif': 'image/gif',
+ 'pdf': 'application/pdf',
+ 'swf': 'application/vnd.adobe.flash.movie',
+ 'webm': 'video/webm'
+ },
+ extensionFromType: {
+ 'image/jpeg': 'jpg',
+ 'image/png': 'png',
+ 'image/gif': 'gif',
+ 'application/pdf': 'pdf',
+ 'application/vnd.adobe.flash.movie': 'swf',
+ 'application/x-shockwave-flash': 'swf',
+ 'video/webm': 'webm'
+ },
+ init: function() {
+ var sc, version;
+ if (!Conf['Quick Reply']) {
+ return;
+ }
+ this.posts = [];
+ if (g.VIEW === 'archive') {
+ return;
+ }
+ version = Conf['Use Recaptcha v1'] && Main.jsEnabled ? 'v1' : 'v2';
+ this.captcha = Captcha[version];
+ $.on(d, '4chanXInitFinished', this.initReady);
+ Callbacks.Post.push({
+ name: 'Quick Reply',
+ cb: this.node
+ });
+ if (Conf['QR Shortcut']) {
+ this.shortcut = sc = $.el('a', {
+ className: 'qr-shortcut fa fa-comment-o disabled',
+ textContent: 'QR',
+ title: 'Quick Reply',
+ href: 'javascript:;'
+ });
+ $.on(sc, 'click', function() {
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) {
+ QR.open();
+ return QR.nodes.com.focus();
+ } else {
+ return QR.close();
+ }
+ });
+ return Header.addShortcut(sc);
+ }
+ },
+ initReady: function() {
+ var link, linkBot, navLinksBot, origToggle;
+ $.off(d, '4chanXInitFinished', this.initReady);
+ QR.postingIsEnabled = !!$.id('postForm');
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ link = $.el('h1', {
+ className: "qr-link-container"
+ });
+ $.extend(link, {
+ innerHTML: "
" + ((g.VIEW === "thread") ? "Reply to Thread" : "Start a Thread") + " "
+ });
+ QR.link = link.firstElementChild;
+ $.on(link.firstChild, 'click', function() {
+ QR.open();
+ return QR.nodes.com.focus();
+ });
+ if (Conf['Bottom QR Link'] && g.VIEW === 'thread') {
+ linkBot = $.el('div', {
+ className: "brackets-wrap qr-link-container-bottom"
+ });
+ $.extend(linkBot, {
+ innerHTML: "
Reply to Thread "
+ });
+ $.on(linkBot.firstElementChild, 'click', function() {
+ QR.open();
+ return QR.nodes.com.focus();
+ });
+ if ((navLinksBot = $('.navLinksBot'))) {
+ $.prepend(navLinksBot, linkBot);
+ }
+ }
+ origToggle = $.id('togglePostFormLink');
+ $.before(origToggle, link);
+ origToggle.firstElementChild.textContent = 'Original Form';
+ $.on(d, 'QRGetFile', QR.getFile);
+ $.on(d, 'QRSetFile', QR.setFile);
+ $.on(d, 'paste', QR.paste);
+ $.on(d, 'dragover', QR.dragOver);
+ $.on(d, 'drop', QR.dropFile);
+ $.on(d, 'dragstart dragend', QR.drag);
+ $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
+ $.on(d, 'ThreadUpdate', QR.statusCheck);
+ if (!Conf['Persistent QR']) {
+ return;
+ }
+ QR.open();
+ if (Conf['Auto Hide QR']) {
+ return QR.hide();
+ }
+ },
+ statusCheck: function() {
+ var thread;
+ if (!QR.nodes) {
+ return;
+ }
+ thread = QR.posts[0].thread;
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
+ return QR.abort();
+ } else {
+ return QR.status();
+ }
+ },
+ node: function() {
+ $.on(this.nodes.quote, 'click', QR.quote);
+ if (this.isFetchedQuote) {
+ return QR.generatePostableThreadsList();
+ }
+ },
+ open: function() {
+ var err;
+ if (QR.nodes) {
+ if (QR.nodes.el.hidden) {
+ QR.captcha.setup();
+ }
+ QR.nodes.el.hidden = false;
+ QR.unhide();
+ } else {
+ try {
+ QR.dialog();
+ } catch (_error) {
+ err = _error;
+ delete QR.nodes;
+ Main.handleErrors({
+ message: 'Quick Reply dialog creation crashed.',
+ error: err
+ });
+ return;
+ }
+ }
+ if (Conf['QR Shortcut']) {
+ return $.rmClass(QR.shortcut, 'disabled');
+ }
+ },
+ close: function() {
+ var j, len, post, ref;
+ if (QR.req) {
+ QR.abort();
+ return;
+ }
+ QR.nodes.el.hidden = true;
+ QR.cleanNotifications();
+ d.activeElement.blur();
+ $.rmClass(QR.nodes.el, 'dump');
+ if (Conf['QR Shortcut']) {
+ $.addClass(QR.shortcut, 'disabled');
+ }
+ new QR.post(true);
+ ref = QR.posts.splice(0, QR.posts.length - 1);
+ for (j = 0, len = ref.length; j < len; j++) {
+ post = ref[j];
+ post["delete"]();
+ }
+ QR.cooldown.auto = false;
+ QR.status();
+ return QR.captcha.destroy();
+ },
+ focus: function() {
+ return $.queueTask(function() {
+ if (!QR.inBubble()) {
+ QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement);
+ return QR.nodes.el.classList.toggle('focus', QR.hasFocus);
+ }
+ });
+ },
+ inBubble: function() {
+ var bubbles, ref;
+ bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');
+ return (ref = d.activeElement, indexOf.call(bubbles, ref) >= 0) || bubbles.some(function(el) {
+ return getComputedStyle(el).visibility !== 'hidden' && el.getBoundingClientRect().bottom > 0;
+ });
+ },
+ hide: function() {
+ d.activeElement.blur();
+ $.addClass(QR.nodes.el, 'autohide');
+ return QR.nodes.autohide.checked = true;
+ },
+ unhide: function() {
+ $.rmClass(QR.nodes.el, 'autohide');
+ return QR.nodes.autohide.checked = false;
+ },
+ toggleHide: function() {
+ if (this.checked) {
+ return QR.hide();
+ } else {
+ return QR.unhide();
+ }
+ },
+ toggleSJIS: function(e) {
+ e.preventDefault();
+ Conf['sjisPreview'] = !Conf['sjisPreview'];
+ $.set('sjisPreview', Conf['sjisPreview']);
+ return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']);
+ },
+ texPreviewShow: function() {
+ if ($.hasClass(QR.nodes.el, 'tex-preview')) {
+ return QR.texPreviewHide();
+ }
+ $.addClass(QR.nodes.el, 'tex-preview');
+ QR.nodes.texPreview.textContent = QR.nodes.com.value;
+ return $.event('mathjax', null, QR.nodes.texPreview);
+ },
+ texPreviewHide: function() {
+ return $.rmClass(QR.nodes.el, 'tex-preview');
+ },
+ setCustomCooldown: function(enabled) {
+ Conf['customCooldownEnabled'] = enabled;
+ QR.cooldown.customCooldown = enabled;
+ return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);
+ },
+ toggleCustomCooldown: function() {
+ var enabled;
+ enabled = $.hasClass(this, 'disabled');
+ QR.setCustomCooldown(enabled);
+ return $.set('customCooldownEnabled', enabled);
+ },
+ error: function(err, focusOverride) {
+ var el, notice, notif;
+ QR.open();
+ if (typeof err === 'string') {
+ el = $.tn(err);
+ } else {
+ el = err;
+ el.removeAttribute('style');
+ }
+ notice = new Notice('warning', el);
+ QR.notifications.push(notice);
+ if (!Header.areNotificationsEnabled) {
+ if (d.hidden && !QR.cooldown.auto) {
+ return alert(el.textContent);
+ }
+ } else if (d.hidden || !(focusOverride || d.hasFocus())) {
+ try {
+ notif = new Notification(el.textContent, {
+ body: el.textContent,
+ icon: Favicon.logo
+ });
+ notif.onclick = function() {
+ return $.global(function() {
+ return window.focus();
+ });
+ };
+ if ($.engine !== 'gecko') {
+ notif.onclose = function() {
+ return notice.close();
+ };
+ return notif.onshow = function() {
+ return setTimeout(function() {
+ notif.onclose = null;
+ return notif.close();
+ }, 7 * $.SECOND);
+ };
+ }
+ } catch (_error) {}
+ }
+ },
+ notifications: [],
+ cleanNotifications: function() {
+ var j, len, notification, ref;
+ ref = QR.notifications;
+ for (j = 0, len = ref.length; j < len; j++) {
+ notification = ref[j];
+ notification.close();
+ }
+ return QR.notifications = [];
+ },
+ status: function() {
+ var disabled, status, thread, value;
+ if (!QR.nodes) {
+ return;
+ }
+ thread = QR.posts[0].thread;
+ if (thread !== 'new' && g.threads[g.BOARD + "." + thread].isDead) {
+ value = 'Dead';
+ disabled = true;
+ QR.cooldown.auto = false;
+ }
+ value = QR.req ? QR.req.progress : QR.cooldown.seconds || value;
+ status = QR.nodes.status;
+ status.value = !value ? 'Submit' : QR.cooldown.auto ? "Auto " + value : value;
+ return status.disabled = disabled || false;
+ },
+ openPost: function() {
+ var index;
+ QR.open();
+ if (QR.selected.isLocked) {
+ index = QR.posts.indexOf(QR.selected);
+ (QR.posts[index + 1] || new QR.post()).select();
+ $.addClass(QR.nodes.el, 'dump');
+ return QR.cooldown.auto = true;
+ }
+ },
+ quote: function(e) {
+ var ancestor, caretPos, com, frag, insideCode, j, k, l, len, len1, len2, len3, len4, len5, n, node, o, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread;
+ if (e != null) {
+ e.preventDefault();
+ }
+ if (!QR.postingIsEnabled) {
+ return;
+ }
+ sel = d.getSelection();
+ post = Get.postFromNode(this);
+ text = post.board.ID === g.BOARD.ID ? ">>" + post + "\n" : ">>>/" + post.board + "/" + post + "\n";
+ if (sel.toString().trim() && post === Get.postFromNode(sel.anchorNode)) {
+ range = sel.getRangeAt(0);
+ frag = range.cloneContents();
+ ancestor = range.commonAncestorContainer;
+ if ($.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) {
+ $.prepend(frag, $.tn('[spoiler]'));
+ $.add(frag, $.tn('[/spoiler]'));
+ }
+ if (insideCode = $.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) {
+ $.prepend(frag, $.tn('[code]'));
+ $.add(frag, $.tn('[/code]'));
+ }
+ ref = $$((insideCode ? 'br' : '.prettyprint br'), frag);
+ for (j = 0, len = ref.length; j < len; j++) {
+ node = ref[j];
+ $.replace(node, $.tn('\n'));
+ }
+ ref1 = $$('br', frag);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ node = ref1[k];
+ if (node !== frag.lastChild) {
+ $.replace(node, $.tn('\n>'));
+ }
+ }
+ ref2 = $$('s, .removed-spoiler', frag);
+ for (l = 0, len2 = ref2.length; l < len2; l++) {
+ node = ref2[l];
+ $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')]));
+ }
+ ref3 = $$('.prettyprint', frag);
+ for (n = 0, len3 = ref3.length; n < len3; n++) {
+ node = ref3[n];
+ $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')]));
+ }
+ ref4 = $$('.linkify[data-original]', frag);
+ for (o = 0, len4 = ref4.length; o < len4; o++) {
+ node = ref4[o];
+ $.replace(node, $.tn(node.dataset.original));
+ }
+ ref5 = $$('.embedder', frag);
+ for (q = 0, len5 = ref5.length; q < len5; q++) {
+ node = ref5[q];
+ if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') {
+ $.rm(node.previousSibling);
+ }
+ $.rm(node);
+ }
+ text += ">" + (frag.textContent.trim()) + "\n";
+ }
+ QR.openPost();
+ ref7 = QR.nodes, com = ref7.com, thread = ref7.thread;
+ if (!com.value) {
+ thread.value = Get.threadFromNode(this);
+ }
+ caretPos = com.selectionStart;
+ com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
+ range = caretPos + text.length;
+ com.setSelectionRange(range, range);
+ com.focus();
+ QR.selected.save(com);
+ return QR.selected.save(thread);
+ },
+ characterCount: function() {
+ var count, counter;
+ counter = QR.nodes.charCount;
+ count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
+ counter.textContent = count;
+ counter.hidden = count < QR.max_comment / 2;
+ return (count > QR.max_comment ? $.addClass : $.rmClass)(counter, 'warning');
+ },
+ getFile: function() {
+ var ref;
+ return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0);
+ },
+ setFile: function(e) {
+ var file, name, ref, source;
+ ref = e.detail, file = ref.file, name = ref.name, source = ref.source;
+ if (name != null) {
+ file.name = name;
+ }
+ if (source != null) {
+ file.source = source;
+ }
+ QR.open();
+ return QR.handleFiles([file]);
+ },
+ drag: function(e) {
+ var toggle;
+ toggle = e.type === 'dragstart' ? $.off : $.on;
+ toggle(d, 'dragover', QR.dragOver);
+ return toggle(d, 'drop', QR.dropFile);
+ },
+ dragOver: function(e) {
+ e.preventDefault();
+ return e.dataTransfer.dropEffect = 'copy';
+ },
+ dropFile: function(e) {
+ if (!e.dataTransfer.files.length) {
+ return;
+ }
+ e.preventDefault();
+ QR.open();
+ return QR.handleFiles(e.dataTransfer.files);
+ },
+ paste: function(e) {
+ var blob, files, item, j, len, ref;
+ if (!e.clipboardData.items) {
+ return;
+ }
+ files = [];
+ ref = e.clipboardData.items;
+ for (j = 0, len = ref.length; j < len; j++) {
+ item = ref[j];
+ if (!(item.kind === 'file')) {
+ continue;
+ }
+ blob = item.getAsFile();
+ blob.name = 'file';
+ if (blob.type) {
+ blob.name += '.' + blob.type.split('/')[1];
+ }
+ files.push(blob);
+ }
+ if (!files.length) {
+ return;
+ }
+ QR.open();
+ QR.handleFiles(files);
+ return $.addClass(QR.nodes.el, 'dump');
+ },
+ pasteFF: function() {
+ var arr, blob, bstr, i, images, img, j, k, len, m, pasteArea, ref, src;
+ pasteArea = QR.nodes.pasteArea;
+ if (!pasteArea.childNodes.length) {
+ return;
+ }
+ images = $$('img', pasteArea);
+ $.rmAll(pasteArea);
+ for (j = 0, len = images.length; j < len; j++) {
+ img = images[j];
+ src = img.src;
+ if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) {
+ bstr = atob(m[3]);
+ arr = new Uint8Array(bstr.length);
+ for (i = k = 0, ref = bstr.length; 0 <= ref ? k < ref : k > ref; i = 0 <= ref ? ++k : --k) {
+ arr[i] = bstr.charCodeAt(i);
+ }
+ blob = new Blob([arr], {
+ type: m[1]
+ });
+ blob.name = "file." + m[2];
+ QR.handleFiles([blob]);
+ } else if (/^https?:\/\//.test(src)) {
+ QR.handleUrl(src);
+ }
+ }
+ },
+ handleUrl: function(urlDefault) {
+ var url;
+ url = prompt('Enter a URL:', urlDefault);
+ if (url === null) {
+ return;
+ }
+ QR.nodes.fileButton.focus();
+ return CrossOrigin.file(url, function(blob) {
+ if (blob && !/^text\//.test(blob.type)) {
+ return QR.handleFiles([blob]);
+ } else {
+ return QR.error("Can't load file.");
+ }
+ });
+ },
+ handleFiles: function(files) {
+ var file, j, len;
+ if (this !== QR) {
+ files = slice.call(this.files);
+ this.value = null;
+ }
+ if (!files.length) {
+ return;
+ }
+ QR.cleanNotifications();
+ for (j = 0, len = files.length; j < len; j++) {
+ file = files[j];
+ QR.handleFile(file, files.length);
+ }
+ if (files.length !== 1) {
+ $.addClass(QR.nodes.el, 'dump');
+ }
+ if (d.activeElement === QR.nodes.fileButton && $.hasClass(QR.nodes.fileSubmit, 'has-file')) {
+ return QR.nodes.filename.focus();
+ }
+ },
+ handleFile: function(file, nfiles) {
+ var isText, post;
+ isText = /^text\//.test(file.type);
+ if (nfiles === 1) {
+ post = QR.selected;
+ } else {
+ post = QR.posts[QR.posts.length - 1];
+ if ((isText ? post.com || post.pasting : post.file)) {
+ post = new QR.post();
+ }
+ }
+ return post[isText ? 'pasteText' : 'setFile'](file);
+ },
+ openFileInput: function() {
+ if (QR.nodes.fileButton.disabled) {
+ return;
+ }
+ QR.nodes.fileInput.click();
+ return QR.nodes.fileButton.focus();
+ },
+ generatePostableThreadsList: function() {
+ var j, len, list, options, ref, thread, val;
+ if (!QR.nodes) {
+ return;
+ }
+ list = QR.nodes.thread;
+ options = [list.firstElementChild];
+ ref = g.BOARD.threads.keys;
+ for (j = 0, len = ref.length; j < len; j++) {
+ thread = ref[j];
+ options.push($.el('option', {
+ value: thread,
+ textContent: "Thread " + thread
+ }));
+ }
+ val = list.value;
+ $.rmAll(list);
+ $.add(list, options);
+ list.value = val;
+ if (list.value === val) {
+ return;
+ }
+ list.value = g.VIEW === 'thread' ? g.THREADID : 'new';
+ return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
+ },
+ dialog: function() {
+ var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, scriptData, setNode;
+ QR.nodes = nodes = {
+ el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
+ innerHTML: "
∀ TE X
Width: Height:
Hentai Porn Japanese Anime Game Loop Other "
+ })
+ };
+ setNode = function(name, query) {
+ return nodes[name] = $(query, dialog);
+ };
+ setNode('move', '.move');
+ setNode('autohide', '#autohide');
+ setNode('close', '.close');
+ setNode('thread', 'select');
+ setNode('form', 'form');
+ setNode('sjisToggle', '#sjis-toggle');
+ setNode('texButton', '#tex-preview-button');
+ setNode('name', '[data-name=name]');
+ setNode('email', '[data-name=email]');
+ setNode('sub', '[data-name=sub]');
+ setNode('com', '[data-name=com]');
+ setNode('charCount', '#char-count');
+ setNode('texPreview', '#tex-preview');
+ setNode('dumpList', '#dump-list');
+ setNode('addPost', '#add-post');
+ setNode('oekaki', '.oekaki');
+ setNode('drawButton', '#qr-draw-button');
+ setNode('fileSubmit', '#file-n-submit');
+ setNode('fileButton', '#qr-file-button');
+ setNode('noFile', '#qr-no-file');
+ setNode('filename', '#qr-filename');
+ setNode('spoiler', '#qr-file-spoiler');
+ setNode('oekakiButton', '#qr-oekaki-button');
+ setNode('fileRM', '#qr-filerm');
+ setNode('urlButton', '#url-button');
+ setNode('pasteArea', '#paste-area');
+ setNode('customCooldown', '#custom-cooldown-button');
+ setNode('dumpButton', '#dump-button');
+ setNode('status', '[type=submit]');
+ setNode('flashTag', '[name=filetag]');
+ setNode('fileInput', '[type=file]');
+ rules = $('ul.rules').textContent.trim();
+ match_min = rules.match(/.+smaller than (\d+)x(\d+).+/);
+ match_max = rules.match(/.+greater than (\d+)x(\d+).+/);
+ QR.min_width = +(match_min != null ? match_min[1] : void 0) || 1;
+ QR.min_height = +(match_min != null ? match_min[2] : void 0) || 1;
+ QR.max_width = +(match_max != null ? match_max[1] : void 0) || 10000;
+ QR.max_height = +(match_max != null ? match_max[2] : void 0) || 10000;
+ scriptData = Get.scriptData();
+ QR.max_size = (m = scriptData.match(/\bmaxFilesize *= *(\d+)\b/)) ? +m[1] : 4194304;
+ QR.max_size_video = (m = scriptData.match(/\bmaxWebmFilesize *= *(\d+)\b/)) ? +m[1] : QR.max_size;
+ QR.max_comment = (m = scriptData.match(/\bcomlen *= *(\d+)\b/)) ? +m[1] : 2000;
+ QR.max_width_video = QR.max_height_video = 2048;
+ QR.max_duration_video = (ref = g.BOARD.ID) === 'gif' || ref === 'wsg' ? 300 : 120;
+ if (Conf['Show New Thread Option in Threads']) {
+ $.addClass(QR.nodes.el, 'show-new-thread-option');
+ }
+ if (Conf['Show Name and Subject']) {
+ $.addClass(QR.nodes.name, 'force-show');
+ $.addClass(QR.nodes.sub, 'force-show');
+ QR.nodes.email.placeholder = 'E-mail';
+ }
+ QR.forcedAnon = !!$('form[name="post"] input[name="name"][type="hidden"]');
+ if (QR.forcedAnon) {
+ $.addClass(QR.nodes.el, 'forced-anon');
+ }
+ QR.spoiler = !!$('.postForm input[name=spoiler]');
+ if (QR.spoiler) {
+ $.addClass(QR.nodes.el, 'has-spoiler');
+ }
+ if (g.BOARD.ID === 'jp' && Conf['sjisPreview']) {
+ $.addClass(QR.nodes.el, 'sjis-preview');
+ }
+ if (parseInt(Conf['customCooldown'], 10) > 0) {
+ $.addClass(QR.nodes.fileSubmit, 'custom-cooldown');
+ $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) {
+ var customCooldownEnabled;
+ customCooldownEnabled = arg.customCooldownEnabled;
+ QR.setCustomCooldown(customCooldownEnabled);
+ return $.sync('customCooldownEnabled', QR.setCustomCooldown);
+ });
+ }
+ $.on(nodes.autohide, 'change', QR.toggleHide);
+ $.on(nodes.close, 'click', QR.close);
+ $.on(nodes.form, 'submit', QR.submit);
+ $.on(nodes.sjisToggle, 'click', QR.toggleSJIS);
+ $.on(nodes.texButton, 'mousedown', QR.texPreviewShow);
+ $.on(nodes.texButton, 'mouseup', QR.texPreviewHide);
+ $.on(nodes.addPost, 'click', function() {
+ return new QR.post(true);
+ });
+ $.on(nodes.drawButton, 'click', QR.oekaki.draw);
+ $.on(nodes.fileButton, 'click', QR.openFileInput);
+ $.on(nodes.noFile, 'click', QR.openFileInput);
+ $.on(nodes.filename, 'focus', function() {
+ return $.addClass(this.parentNode, 'focus');
+ });
+ $.on(nodes.filename, 'blur', function() {
+ return $.rmClass(this.parentNode, 'focus');
+ });
+ $.on(nodes.spoiler, 'change', function() {
+ return QR.selected.nodes.spoiler.click();
+ });
+ $.on(nodes.oekakiButton, 'click', QR.oekaki.button);
+ $.on(nodes.fileRM, 'click', function() {
+ return QR.selected.rmFile();
+ });
+ $.on(nodes.urlButton, 'click', function() {
+ return QR.handleUrl('');
+ });
+ $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);
+ $.on(nodes.dumpButton, 'click', function() {
+ return nodes.el.classList.toggle('dump');
+ });
+ $.on(nodes.fileInput, 'change', QR.handleFiles);
+ window.addEventListener('focus', QR.focus, true);
+ window.addEventListener('blur', QR.focus, true);
+ $.on(d, 'click', QR.focus);
+ if ($.engine === 'gecko') {
+ nodes.pasteArea.hidden = false;
+ new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {
+ childList: true
+ });
+ }
+ items = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
+ i = 0;
+ save = function() {
+ return QR.selected.save(this);
+ };
+ while (name = items[i++]) {
+ if (!(node = nodes[name])) {
+ continue;
+ }
+ event = node.nodeName === 'SELECT' ? 'change' : 'input';
+ $.on(nodes[name], event, save);
+ }
+ if ($.engine === 'gecko' && Conf['Remember QR Size']) {
+ $.get('QR Size', '', function(item) {
+ return nodes.com.style.cssText = item['QR Size'];
+ });
+ $.on(nodes.com, 'mouseup', function(e) {
+ if (e.button !== 0) {
+ return;
+ }
+ return $.set('QR Size', this.style.cssText);
+ });
+ }
+ QR.generatePostableThreadsList();
+ QR.persona.load();
+ new QR.post(true);
+ QR.status();
+ QR.cooldown.setup();
+ QR.captcha.init();
+ $.add(d.body, dialog);
+ QR.captcha.setup();
+ QR.oekaki.setup();
+ return $.event('QRDialogCreation', null, dialog);
+ },
+ submit: function(e) {
+ var captcha, cb, err, extra, filetag, formData, options, post, ref, textOnly, thread, threadID;
+ if (e != null) {
+ e.preventDefault();
+ }
+ if (QR.req) {
+ QR.abort();
+ return;
+ }
+ if (QR.cooldown.seconds) {
+ QR.cooldown.auto = !QR.cooldown.auto;
+ QR.status();
+ return;
+ }
+ post = QR.posts[0];
+ post.forceSave();
+ threadID = post.thread;
+ thread = g.BOARD.threads[threadID];
+ if (g.BOARD.ID === 'f' && threadID === 'new') {
+ filetag = QR.nodes.flashTag.value;
+ }
+ if (threadID === 'new') {
+ threadID = null;
+ if (g.BOARD.ID === 'vg' && !post.sub) {
+ err = 'New threads require a subject.';
+ } else if (!($.hasClass(d.body, 'text_only') || post.file || (textOnly = !!$('input[name=textonly]', $.id('postForm'))))) {
+ err = 'No file selected.';
+ }
+ } else if (g.BOARD.threads[threadID].isClosed) {
+ err = 'You can\'t reply to this thread anymore.';
+ } else if (!(post.com || post.file)) {
+ err = 'No comment or file.';
+ } else if (post.file && thread.fileLimit) {
+ err = 'Max limit of image replies has been reached.';
+ }
+ if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
+ err || (err = 'Original comment required.');
+ }
+ if (QR.captcha.isEnabled && !err) {
+ captcha = QR.captcha.getOne();
+ if (!captcha) {
+ err = 'No valid captcha.';
+ QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
+ }
+ }
+ QR.cleanNotifications();
+ if (err) {
+ QR.cooldown.auto = false;
+ QR.status();
+ QR.error(err);
+ return;
+ }
+ QR.cooldown.auto = QR.posts.length > 1;
+ if (Conf['Auto Hide QR'] && !QR.cooldown.auto) {
+ QR.hide();
+ }
+ if (!QR.cooldown.auto && $.x('ancestor::div[@id="qr"]', d.activeElement)) {
+ d.activeElement.blur();
+ }
+ post.lock();
+ formData = {
+ resto: threadID,
+ name: !QR.forcedAnon ? post.name : void 0,
+ email: post.email,
+ sub: !(QR.forcedAnon || threadID) ? post.sub : void 0,
+ com: post.com,
+ upfile: post.file,
+ filetag: filetag,
+ spoiler: post.spoiler,
+ textonly: textOnly,
+ mode: 'regist',
+ pwd: QR.persona.getPassword()
+ };
+ options = {
+ responseType: 'document',
+ withCredentials: true,
+ onload: QR.response,
+ onerror: function() {
+ delete QR.req;
+ post.unlock();
+ QR.cooldown.auto = false;
+ QR.status();
+ return QR.error($.el('span', {
+ innerHTML: "Connection error while posting. [
More info ]"
+ }));
+ }
+ };
+ extra = {
+ form: $.formData(formData),
+ upCallbacks: {
+ onload: function() {
+ QR.req.isUploadFinished = true;
+ QR.req.progress = '...';
+ return QR.status();
+ },
+ onprogress: function(e) {
+ QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%";
+ return QR.status();
+ }
+ }
+ };
+ cb = function(response) {
+ if (response != null) {
+ if (response.challenge != null) {
+ extra.form.append('recaptcha_challenge_field', response.challenge);
+ extra.form.append('recaptcha_response_field', response.response);
+ } else {
+ extra.form.append('g-recaptcha-response', response.response);
+ }
+ }
+ QR.req = $.ajax("https://sys.4chan.org/" + g.BOARD + "/post", options, extra);
+ return QR.req.progress = '...';
+ };
+ if (typeof captcha === 'function') {
+ QR.req = {
+ progress: '...',
+ abort: function() {
+ return cb = null;
+ }
+ };
+ captcha(function(response) {
+ if (response) {
+ return typeof cb === "function" ? cb(response) : void 0;
+ } else {
+ delete QR.req;
+ post.unlock();
+ QR.cooldown.auto = !!QR.captcha.captchas.length;
+ return QR.status();
+ }
+ });
+ } else {
+ cb(captcha);
+ }
+ return QR.status();
+ },
+ response: function() {
+ var URL, _, ban, err, h1, isReply, lastPostToThread, m, open, post, postID, postsCount, ref, ref1, ref2, req, resDoc, seconds, threadID;
+ req = QR.req;
+ delete QR.req;
+ post = QR.posts[0];
+ post.unlock();
+ resDoc = req.response;
+ if (ban = $('.banType', resDoc)) {
+ err = $.el('span', ban.textContent.toLowerCase() === 'banned' ? {
+ innerHTML: "You are banned on " + ($(".board", resDoc)).innerHTML + "! ;_;
Click
here to see the reason."
+ } : {
+ innerHTML: "You were issued a warning on " + ($(".board", resDoc)).innerHTML + " as " + ($(".nameBlock", resDoc)).innerHTML + ".
Reason: " + ($(".reason", resDoc)).innerHTML
+ });
+ } else if (err = resDoc.getElementById('errmsg')) {
+ if ((ref = $('a', err)) != null) {
+ ref.target = '_blank';
+ }
+ } else if (resDoc.title !== 'Post successful!') {
+ err = 'Connection error with sys.4chan.org.';
+ } else if (req.status !== 200) {
+ err = "Error " + req.statusText + " (" + req.status + ")";
+ }
+ if (err) {
+ if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
+ if (/mistyped/i.test(err.textContent)) {
+ err = $.el('span', {
+ innerHTML: "You mistyped the CAPTCHA, or the CAPTCHA malfunctioned [
complain here ]."
+ });
+ } else if (/expired/i.test(err.textContent)) {
+ err = 'This CAPTCHA is no longer valid because it has expired.';
+ }
+ QR.cooldown.auto = QR.captcha.isEnabled || err === 'Connection error with sys.4chan.org.';
+ QR.cooldown.addDelay(post, 2);
+ } else if (err.textContent && (m = err.textContent.match(/(?:(\d+)\s+minutes?\s+)?(\d+)\s+second/i)) && !/duplicate|hour/i.test(err.textContent)) {
+ QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent);
+ seconds = 60 * (+(m[1] || 0)) + (+m[2]);
+ if (/muted/i.test(err.textContent)) {
+ QR.cooldown.addMute(seconds);
+ } else {
+ QR.cooldown.addDelay(post, seconds);
+ }
+ } else {
+ QR.cooldown.auto = false;
+ }
+ QR.captcha.setup(QR.cooldown.auto && ((ref1 = d.activeElement) === QR.nodes.status || ref1 === d.body));
+ if (QR.captcha.isEnabled && !QR.captcha.captchas.length) {
+ QR.cooldown.auto = false;
+ }
+ QR.status();
+ QR.error(err);
+ return;
+ }
+ h1 = $('h1', resDoc);
+ QR.cleanNotifications();
+ if (Conf['Posting Success Notifications']) {
+ QR.notifications.push(new Notice('success', h1.textContent, 5));
+ }
+ ref2 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref2[0], threadID = ref2[1], postID = ref2[2];
+ postID = +postID;
+ threadID = +threadID || postID;
+ isReply = threadID !== postID;
+ $.event('QRPostSuccessful', {
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ postID: postID
+ });
+ $.event('QRPostSuccessful_', {
+ boardID: g.BOARD.ID,
+ threadID: threadID,
+ postID: postID
+ });
+ postsCount = QR.posts.length - 1;
+ QR.cooldown.auto = postsCount && isReply;
+ lastPostToThread = !((function() {
+ var j, len, p, ref3;
+ ref3 = QR.posts.slice(1);
+ for (j = 0, len = ref3.length; j < len; j++) {
+ p = ref3[j];
+ if (p.thread === post.thread) {
+ return true;
+ }
+ }
+ })());
+ if (!(Conf['Persistent QR'] || postsCount)) {
+ QR.close();
+ } else {
+ post.rm();
+ QR.captcha.setup(d.activeElement === QR.nodes.status);
+ }
+ QR.cooldown.add(threadID, postID);
+ URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && lastPostToThread && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0;
+ if (URL) {
+ open = Conf['Open Post in New Tab'] || postsCount ? function() {
+ return $.open(URL);
+ } : function() {
+ return window.location = URL;
+ };
+ if (threadID === postID) {
+ QR.waitForThread(URL, open);
+ } else {
+ open();
+ }
+ }
+ return QR.status();
+ },
+ waitForThread: function(url, cb) {
+ var attempts, check;
+ attempts = 0;
+ check = function() {
+ return $.ajax(url, {
+ onloadend: function() {
+ attempts++;
+ if (attempts >= 6 || this.status === 200) {
+ return cb();
+ } else {
+ return setTimeout(check, attempts * $.SECOND);
+ }
+ }
+ }, {
+ type: 'HEAD'
+ });
+ };
+ return check();
+ },
+ abort: function() {
+ if (QR.req && !QR.req.isUploadFinished) {
+ QR.req.abort();
+ delete QR.req;
+ QR.posts[0].unlock();
+ QR.cooldown.auto = false;
+ QR.notifications.push(new Notice('info', 'QR upload aborted.', 5));
+ }
+ return QR.status();
+ }
+ };
+
+ return QR;
+
+}).call(this);
+
+(function() {
+ QR.cooldown = {
+ seconds: 0,
+ delays: {
+ thread: 0,
+ reply: 0,
+ image: 0,
+ reply_intra: 0,
+ image_intra: 0,
+ deletion: 60,
+ thread_global: 300
+ },
+ init: function() {
+ if (!Conf['Quick Reply']) {
+ return;
+ }
+ this.data = Conf['cooldowns'];
+ return $.sync('cooldowns', this.sync);
+ },
+ setup: function() {
+ var delay, m, ref, type;
+ if (m = Get.scriptData().match(/\bcooldowns *= *({[^}]+})/)) {
+ $.extend(QR.cooldown.delays, JSON.parse(m[1]));
+ }
+ QR.cooldown.maxDelay = 0;
+ ref = QR.cooldown.delays;
+ for (type in ref) {
+ delay = ref[type];
+ if (type !== 'thread' && type !== 'thread_global') {
+ QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay);
+ }
+ }
+ QR.cooldown.isSetup = true;
+ return QR.cooldown.start();
+ },
+ start: function() {
+ var data;
+ data = QR.cooldown.data;
+ if (!(Conf['Cooldown'] && QR.cooldown.isSetup && !QR.cooldown.isCounting && Object.keys(data[g.BOARD.ID] || {}).length + Object.keys(data.global || {}).length > 0)) {
+ return;
+ }
+ QR.cooldown.isCounting = true;
+ return QR.cooldown.count();
+ },
+ sync: function(data) {
+ QR.cooldown.data = data || {};
+ return QR.cooldown.start();
+ },
+ add: function(threadID, postID) {
+ var boardID, start;
+ if (!Conf['Cooldown']) {
+ return;
+ }
+ start = Date.now();
+ boardID = g.BOARD.ID;
+ QR.cooldown.set(boardID, start, {
+ threadID: threadID,
+ postID: postID
+ });
+ if (threadID === postID) {
+ QR.cooldown.set('global', start, {
+ boardID: boardID,
+ threadID: threadID,
+ postID: postID
+ });
+ }
+ return QR.cooldown.start();
+ },
+ addDelay: function(post, delay) {
+ var cooldown;
+ if (!Conf['Cooldown']) {
+ return;
+ }
+ cooldown = QR.cooldown.categorize(post);
+ cooldown.delay = delay;
+ QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown);
+ return QR.cooldown.start();
+ },
+ addMute: function(delay) {
+ if (!Conf['Cooldown']) {
+ return;
+ }
+ QR.cooldown.set(g.BOARD.ID, Date.now(), {
+ type: 'mute',
+ delay: delay
+ });
+ return QR.cooldown.start();
+ },
+ "delete": function(post) {
+ var base, cooldown, cooldowns, id, name;
+ if (!QR.cooldown.data) {
+ return;
+ }
+ $.forceSync('cooldowns');
+ cooldowns = ((base = QR.cooldown.data)[name = post.board.ID] || (base[name] = {}));
+ for (id in cooldowns) {
+ cooldown = cooldowns[id];
+ if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
+ delete cooldowns[id];
+ }
+ }
+ return QR.cooldown.save([post.board.ID]);
+ },
+ secondsDeletion: function(post) {
+ var cooldown, cooldowns, seconds, start;
+ if (!(QR.cooldown.data && Conf['Cooldown'])) {
+ return 0;
+ }
+ cooldowns = QR.cooldown.data[post.board.ID] || {};
+ for (start in cooldowns) {
+ cooldown = cooldowns[start];
+ if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) {
+ seconds = QR.cooldown.delays.deletion - Math.floor((Date.now() - start) / $.SECOND);
+ return Math.max(seconds, 0);
+ }
+ }
+ return 0;
+ },
+ categorize: function(post) {
+ if (post.thread === 'new') {
+ return {
+ type: 'thread'
+ };
+ } else {
+ return {
+ type: !!post.file ? 'image' : 'reply',
+ threadID: +post.thread
+ };
+ }
+ },
+ set: function(scope, id, value) {
+ var base, cooldowns;
+ $.forceSync('cooldowns');
+ cooldowns = ((base = QR.cooldown.data)[scope] || (base[scope] = {}));
+ cooldowns[id] = value;
+ return $.set('cooldowns', QR.cooldown.data);
+ },
+ save: function(scopes) {
+ var data, i, len, scope;
+ data = QR.cooldown.data;
+ for (i = 0, len = scopes.length; i < len; i++) {
+ scope = scopes[i];
+ if (scope in data && !Object.keys(data[scope]).length) {
+ delete data[scope];
+ }
+ }
+ return $.set('cooldowns', data);
+ },
+ count: function() {
+ var base, cooldown, cooldowns, elapsed, i, len, maxDelay, nCooldowns, now, ref, ref1, save, scope, seconds, start, suffix, threadID, type, update;
+ $.forceSync('cooldowns');
+ save = [];
+ nCooldowns = 0;
+ now = Date.now();
+ ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID;
+ seconds = 0;
+ if (Conf['Cooldown']) {
+ ref1 = [g.BOARD.ID, 'global'];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ scope = ref1[i];
+ cooldowns = ((base = QR.cooldown.data)[scope] || (base[scope] = {}));
+ for (start in cooldowns) {
+ cooldown = cooldowns[start];
+ start = +start;
+ elapsed = Math.floor((now - start) / $.SECOND);
+ if (elapsed < 0) {
+ delete cooldowns[start];
+ save.push(scope);
+ continue;
+ }
+ if (cooldown.delay != null) {
+ if (cooldown.delay <= elapsed) {
+ delete cooldowns[start];
+ save.push(scope);
+ } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') {
+ seconds = Math.max(seconds, cooldown.delay - elapsed);
+ }
+ continue;
+ }
+ maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread'];
+ if (QR.cooldown.customCooldown) {
+ maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10));
+ }
+ if (maxDelay <= elapsed) {
+ delete cooldowns[start];
+ save.push(scope);
+ continue;
+ }
+ if ((type === 'thread') === (cooldown.threadID === cooldown.postID) && cooldown.boardID !== g.BOARD.ID) {
+ suffix = scope === 'global' ? '_global' : type !== 'thread' && threadID === cooldown.threadID ? '_intra' : '';
+ seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed);
+ }
+ if (QR.cooldown.customCooldown) {
+ seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed);
+ }
+ }
+ nCooldowns += Object.keys(cooldowns).length;
+ }
+ }
+ if (save.length) {
+ QR.cooldown.save(save);
+ }
+ if (nCooldowns) {
+ clearTimeout(QR.cooldown.timeout);
+ QR.cooldown.timeout = setTimeout(QR.cooldown.count, $.SECOND);
+ } else {
+ delete QR.cooldown.isCounting;
+ }
+ update = seconds !== QR.cooldown.seconds;
+ QR.cooldown.seconds = seconds;
+ if (update) {
+ QR.status();
+ }
+ if (seconds === 0 && QR.cooldown.auto && !QR.req) {
+ return QR.submit();
+ }
+ }
+ };
+
+}).call(this);
+
+(function() {
+ QR.oekaki = {
+ menu: {
+ init: function() {
+ var a, ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Edit Link'] && Conf['Quick Reply'])) {
+ return;
+ }
+ a = $.el('a', {
+ className: 'edit-link',
+ href: 'javascript:;',
+ textContent: 'Edit image'
+ });
+ $.on(a, 'click', this.editFile);
+ return Menu.menu.addEntry({
+ el: a,
+ order: 95,
+ open: function(post) {
+ var file;
+ QR.oekaki.menu.post = post;
+ file = post.file;
+ return QR.postingIsEnabled && !!file && (file.isImage || file.isVideo);
+ }
+ });
+ },
+ editFile: function() {
+ var currentTime, isVideo, post, ref;
+ post = QR.oekaki.menu.post;
+ QR.quote.call(post.nodes.post);
+ isVideo = post.file.isVideo;
+ currentTime = ((ref = post.file.fullImage) != null ? ref.currentTime : void 0) || 0;
+ return CrossOrigin.file(post.file.url, function(blob) {
+ var video;
+ if (!blob) {
+ return QR.error("Can't load file.");
+ } else if (isVideo) {
+ video = $.el('video');
+ $.on(video, 'loadedmetadata', function() {
+ $.on(video, 'seeked', function() {
+ var canvas;
+ canvas = $.el('canvas', {
+ width: video.videoWidth,
+ height: video.videoHeight
+ });
+ canvas.getContext('2d').drawImage(video, 0, 0);
+ return canvas.toBlob(function(snapshot) {
+ snapshot.name = post.file.name.replace(/\.\w+$/, '') + '.png';
+ QR.handleFiles([snapshot]);
+ return QR.oekaki.edit();
+ });
+ });
+ return video.currentTime = currentTime;
+ });
+ return video.src = URL.createObjectURL(blob);
+ } else {
+ blob.name = post.file.name;
+ QR.handleFiles([blob]);
+ return QR.oekaki.edit();
+ }
+ });
+ }
+ },
+ setup: function() {
+ return $.global(function() {
+ var FCX;
+ FCX = window.FCX;
+ FCX.oekakiCB = function() {
+ return window.Tegaki.flatten().toBlob(function(file) {
+ var source;
+ source = "oekaki-" + (Date.now());
+ FCX.oekakiLatest = source;
+ return document.dispatchEvent(new CustomEvent('QRSetFile', {
+ bubbles: true,
+ detail: {
+ file: file,
+ name: FCX.oekakiName,
+ source: source
+ }
+ }));
+ });
+ };
+ if (window.Tegaki) {
+ return document.querySelector('#qr .oekaki').hidden = false;
+ }
+ });
+ },
+ load: function(cb) {
+ var n, onload, script, style;
+ if ($('script[src^="//s.4cdn.org/js/painter"]', d.head)) {
+ return cb();
+ } else {
+ style = $.el('link', {
+ rel: 'stylesheet',
+ href: "//s.4cdn.org/css/painter." + (Date.now()) + ".css"
+ });
+ script = $.el('script', {
+ src: "//s.4cdn.org/js/painter.min." + (Date.now()) + ".js"
+ });
+ n = 0;
+ onload = function() {
+ if (++n === 2) {
+ return cb();
+ }
+ };
+ $.on(style, 'load', onload);
+ $.on(script, 'load', onload);
+ return $.add(d.head, [style, script]);
+ }
+ },
+ draw: function() {
+ return $.global(function() {
+ var FCX, Tegaki;
+ Tegaki = window.Tegaki, FCX = window.FCX;
+ if (Tegaki.bg) {
+ Tegaki.destroy();
+ }
+ FCX.oekakiName = 'tegaki.png';
+ return Tegaki.open({
+ onDone: FCX.oekakiCB,
+ onCancel: function() {
+ return Tegaki.bgColor = '#ffffff';
+ },
+ width: +document.querySelector('#qr [name=oekaki-width]').value,
+ height: +document.querySelector('#qr [name=oekaki-height]').value,
+ bgColor: document.querySelector('#qr [name=oekaki-bg]').checked ? document.querySelector('#qr [name=oekaki-bgcolor]').value : 'transparent'
+ });
+ });
+ },
+ button: function() {
+ if (QR.selected.file) {
+ return QR.oekaki.edit();
+ } else {
+ return QR.oekaki.toggle();
+ }
+ },
+ edit: function() {
+ return QR.oekaki.load(function() {
+ return $.global(function() {
+ var FCX, Tegaki, cb, error, name, source;
+ Tegaki = window.Tegaki, FCX = window.FCX;
+ name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png';
+ source = document.getElementById('file-n-submit').dataset.source;
+ error = function(content) {
+ return document.dispatchEvent(new CustomEvent('CreateNotification', {
+ bubbles: true,
+ detail: {
+ type: 'warning',
+ content: content,
+ lifetime: 20
+ }
+ }));
+ };
+ cb = function(e) {
+ var file, isVideo;
+ document.removeEventListener('QRFile', cb, false);
+ if (!e.detail) {
+ return error('No file to edit.');
+ }
+ if (!/^(image|video)\//.test(e.detail.type)) {
+ return error('Not an image.');
+ }
+ isVideo = /^video\//.test(e.detail.type);
+ file = document.createElement(isVideo ? 'video' : 'img');
+ file.addEventListener('error', function() {
+ return error('Could not open file.', false);
+ });
+ file.addEventListener((isVideo ? 'loadeddata' : 'load'), function() {
+ if (Tegaki.bg) {
+ Tegaki.destroy();
+ }
+ FCX.oekakiName = name;
+ Tegaki.open({
+ onDone: FCX.oekakiCB,
+ onCancel: function() {
+ return Tegaki.bgColor = '#ffffff';
+ },
+ width: file.naturalWidth || file.videoWidth,
+ height: file.naturalHeight || file.videoHeight,
+ bgColor: 'transparent'
+ });
+ return Tegaki.activeCtx.drawImage(file, 0, 0);
+ }, false);
+ return file.src = URL.createObjectURL(e.detail);
+ };
+ if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) {
+ FCX.oekakiName = name;
+ return Tegaki.resume();
+ } else {
+ document.addEventListener('QRFile', cb, false);
+ return document.dispatchEvent(new CustomEvent('QRGetFile', {
+ bubbles: true
+ }));
+ }
+ });
+ });
+ },
+ toggle: function() {
+ return QR.oekaki.load(function() {
+ return QR.nodes.oekaki.hidden = !QR.nodes.oekaki.hidden;
+ });
+ }
+ };
+
+}).call(this);
+
+(function() {
+ var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ QR.persona = {
+ always: {},
+ types: {
+ name: [],
+ email: [],
+ sub: []
+ },
+ init: function() {
+ var i, item, len, ref;
+ if (!(Conf['Quick Reply'] || (Conf['Menu'] && Conf['Delete Link']))) {
+ return;
+ }
+ ref = Conf['QR.personas'].split('\n');
+ for (i = 0, len = ref.length; i < len; i++) {
+ item = ref[i];
+ QR.persona.parseItem(item.trim());
+ }
+ },
+ parseItem: function(item) {
+ var boards, match, ref, ref1, ref2, type, val;
+ if (item[0] === '#') {
+ return;
+ }
+ if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) {
+ return;
+ }
+ ref = match, match = ref[0], type = ref[1], val = ref[2];
+ item = item.replace(match, '');
+ boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global';
+ if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) {
+ return;
+ }
+ if (type === 'password') {
+ QR.persona.pwd = val;
+ return;
+ }
+ if (type === 'options') {
+ type = 'email';
+ }
+ if (type === 'subject') {
+ type = 'sub';
+ }
+ if (/always/i.test(item)) {
+ QR.persona.always[type] = val;
+ }
+ if (indexOf.call(QR.persona.types[type], val) < 0) {
+ return QR.persona.types[type].push(val);
+ }
+ },
+ load: function() {
+ var arr, i, len, list, ref, type, val;
+ ref = QR.persona.types;
+ for (type in ref) {
+ arr = ref[type];
+ list = $("#list-" + type, QR.nodes.el);
+ for (i = 0, len = arr.length; i < len; i++) {
+ val = arr[i];
+ if (val) {
+ $.add(list, $.el('option', {
+ textContent: val
+ }));
+ }
+ }
+ }
+ },
+ getPassword: function() {
+ var m;
+ if (QR.persona.pwd != null) {
+ return QR.persona.pwd;
+ } else if ((m = d.cookie.match(/4chan_pass=([^;]+)/))) {
+ return decodeURIComponent(m[1]);
+ } else {
+ return '';
+ }
+ },
+ get: function(cb) {
+ return $.get('QR.persona', {}, function(arg) {
+ var persona;
+ persona = arg['QR.persona'];
+ return cb(persona);
+ });
+ },
+ set: function(post) {
+ return $.get('QR.persona', {}, function(arg) {
+ var persona;
+ persona = arg['QR.persona'];
+ persona = {
+ name: post.name
+ };
+ return $.set('QR.persona', persona);
+ });
+ }
+ };
+
+}).call(this);
+
+(function() {
+ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ slice = [].slice;
+
+ QR.post = (function() {
+ function _Class(select) {
+ this.select = bind(this.select, this);
+ var el, event, i, j, label, len, len1, prev, ref, ref1;
+ el = $.el('a', {
+ className: 'qr-preview',
+ draggable: true,
+ href: 'javascript:;'
+ });
+ $.extend(el, {
+ innerHTML: "
Spoiler"
+ });
+ this.nodes = {
+ el: el,
+ rm: el.firstChild,
+ spoiler: $('.qr-preview-spoiler input', el),
+ span: el.lastChild
+ };
+ $.on(el, 'click', this.select);
+ $.on(this.nodes.rm, 'click', (function(_this) {
+ return function(e) {
+ e.stopPropagation();
+ return _this.rm();
+ };
+ })(this));
+ $.on(this.nodes.spoiler, 'change', (function(_this) {
+ return function(e) {
+ _this.spoiler = e.target.checked;
+ if (_this === QR.selected) {
+ return QR.nodes.spoiler.checked = _this.spoiler;
+ }
+ };
+ })(this));
+ ref = $$('label', el);
+ for (i = 0, len = ref.length; i < len; i++) {
+ label = ref[i];
+ $.on(label, 'click', function(e) {
+ return e.stopPropagation();
+ });
+ }
+ $.add(QR.nodes.dumpList, el);
+ ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ event = ref1[j];
+ $.on(el, event.toLowerCase(), this[event]);
+ }
+ this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
+ prev = QR.posts[QR.posts.length - 1];
+ QR.posts.push(this);
+ this.nodes.spoiler.checked = this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false;
+ QR.persona.get((function(_this) {
+ return function(persona) {
+ _this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name;
+ _this.email = 'email' in QR.persona.always ? QR.persona.always.email : '';
+ _this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : '';
+ if (QR.selected === _this) {
+ return _this.load();
+ }
+ };
+ })(this));
+ if (select) {
+ this.select();
+ }
+ this.unlock();
+ $.queueTask(function() {
+ return QR.captcha.onNewPost();
+ });
+ }
+
+ _Class.prototype.rm = function() {
+ var index;
+ this["delete"]();
+ index = QR.posts.indexOf(this);
+ if (QR.posts.length === 1) {
+ new QR.post(true);
+ $.rmClass(QR.nodes.el, 'dump');
+ } else if (this === QR.selected) {
+ (QR.posts[index - 1] || QR.posts[index + 1]).select();
+ }
+ QR.posts.splice(index, 1);
+ return QR.status();
+ };
+
+ _Class.prototype["delete"] = function() {
+ $.rm(this.nodes.el);
+ URL.revokeObjectURL(this.URL);
+ return this.dismissErrors();
+ };
+
+ _Class.prototype.lock = function(lock) {
+ var i, len, name, node, ref;
+ if (lock == null) {
+ lock = true;
+ }
+ this.isLocked = lock;
+ if (this !== QR.selected) {
+ return;
+ }
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ if (node = QR.nodes[name]) {
+ node.disabled = lock;
+ }
+ }
+ this.nodes.rm.style.visibility = lock ? 'hidden' : '';
+ this.nodes.spoiler.disabled = lock;
+ return this.nodes.el.draggable = !lock;
+ };
+
+ _Class.prototype.unlock = function() {
+ return this.lock(false);
+ };
+
+ _Class.prototype.select = function() {
+ var rectEl, rectList;
+ if (QR.selected) {
+ QR.selected.nodes.el.removeAttribute('id');
+ QR.selected.forceSave();
+ }
+ QR.selected = this;
+ this.lock(this.isLocked);
+ this.nodes.el.id = 'selected';
+ rectEl = this.nodes.el.getBoundingClientRect();
+ rectList = this.nodes.el.parentNode.getBoundingClientRect();
+ this.nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2;
+ return this.load();
+ };
+
+ _Class.prototype.load = function() {
+ var i, len, name, node, ref;
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ if (!(node = QR.nodes[name])) {
+ continue;
+ }
+ node.value = this[name] || node.dataset["default"] || '';
+ }
+ (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
+ this.showFileData();
+ return QR.characterCount();
+ };
+
+ _Class.prototype.save = function(input) {
+ var name, ref;
+ if (input.type === 'checkbox') {
+ this.spoiler = input.checked;
+ return;
+ }
+ name = input.dataset.name;
+ this[name] = input.value || input.dataset["default"] || null;
+ switch (name) {
+ case 'thread':
+ (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');
+ return QR.status();
+ case 'com':
+ this.updateComment();
+ if (QR.cooldown.auto && this === QR.posts[0] && (0 < (ref = QR.cooldown.seconds) && ref <= 5)) {
+ return QR.cooldown.auto = false;
+ }
+ break;
+ case 'filename':
+ if (!this.file) {
+ return;
+ }
+ this.saveFilename();
+ return this.updateFilename();
+ case 'name':
+ return QR.persona.set(this);
+ }
+ };
+
+ _Class.prototype.forceSave = function() {
+ var i, len, name, node, ref;
+ if (this !== QR.selected) {
+ return;
+ }
+ ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler'];
+ for (i = 0, len = ref.length; i < len; i++) {
+ name = ref[i];
+ if (!(node = QR.nodes[name])) {
+ continue;
+ }
+ this.save(node);
+ }
+ };
+
+ _Class.prototype.setComment = function(com) {
+ this.com = com || null;
+ if (this === QR.selected) {
+ QR.nodes.com.value = this.com;
+ }
+ return this.updateComment();
+ };
+
+ _Class.prototype.updateComment = function() {
+ if (this === QR.selected) {
+ QR.characterCount();
+ }
+ this.nodes.span.textContent = this.com;
+ return $.queueTask(function() {
+ return QR.captcha.onPostChange();
+ });
+ };
+
+ _Class.rmErrored = function(e) {
+ var error, errors, i, j, len, post, ref;
+ e.stopPropagation();
+ ref = QR.posts;
+ for (i = ref.length - 1; i >= 0; i += -1) {
+ post = ref[i];
+ if (errors = post.errors) {
+ for (j = 0, len = errors.length; j < len; j++) {
+ error = errors[j];
+ if (!(doc.contains(error))) {
+ continue;
+ }
+ post.rm();
+ break;
+ }
+ }
+ }
+ };
+
+ _Class.prototype.error = function(className, message) {
+ var div, ref, rm, rmAll;
+ div = $.el('div', {
+ className: className
+ });
+ $.extend(div, {
+ innerHTML: E(message) + "
[
delete ] [
delete all ]"
+ });
+ (this.errors || (this.errors = [])).push(div);
+ ref = $$('a', div), rm = ref[0], rmAll = ref[1];
+ $.on(div, 'click', (function(_this) {
+ return function() {
+ if (indexOf.call(QR.posts, _this) >= 0) {
+ return _this.select();
+ }
+ };
+ })(this));
+ $.on(rm, 'click', (function(_this) {
+ return function(e) {
+ e.stopPropagation();
+ if (indexOf.call(QR.posts, _this) >= 0) {
+ return _this.rm();
+ }
+ };
+ })(this));
+ $.on(rmAll, 'click', QR.post.rmErrored);
+ return QR.error(div, true);
+ };
+
+ _Class.prototype.fileError = function(message) {
+ return this.error('file-error', this.filename + ": " + message);
+ };
+
+ _Class.prototype.dismissErrors = function(test) {
+ var error, i, len, ref;
+ if (test == null) {
+ test = function() {
+ return true;
+ };
+ }
+ if (this.errors) {
+ ref = this.errors;
+ for (i = 0, len = ref.length; i < len; i++) {
+ error = ref[i];
+ if (doc.contains(error) && test(error)) {
+ error.parentNode.previousElementSibling.click();
+ }
+ }
+ }
+ };
+
+ _Class.prototype.setFile = function(file1) {
+ var ext, ref;
+ this.file = file1;
+ if (Conf['Randomize Filename'] && g.BOARD.ID !== 'f') {
+ this.filename = "" + (Date.now() - Math.floor(Math.random() * 365 * $.DAY));
+ if (ext = this.file.name.match(QR.validExtension)) {
+ this.filename += ext[0];
+ }
+ } else {
+ this.filename = this.file.name;
+ }
+ this.filesize = $.bytesToString(this.file.size);
+ this.checkSize();
+ $.addClass(this.nodes.el, 'has-file');
+ $.queueTask(function() {
+ return QR.captcha.onPostChange();
+ });
+ URL.revokeObjectURL(this.URL);
+ this.saveFilename();
+ if (this === QR.selected) {
+ this.showFileData();
+ } else {
+ this.updateFilename();
+ }
+ this.nodes.el.style.backgroundImage = null;
+ if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) {
+ return this.fileError('Unsupported file type.');
+ } else if (/^(image|video)\//.test(this.file.type)) {
+ return this.readFile();
+ }
+ };
+
+ _Class.prototype.checkSize = function() {
+ var max;
+ max = QR.max_size;
+ if (/^video\//.test(this.file.type)) {
+ max = Math.min(max, QR.max_size_video);
+ }
+ if (this.file.size > max) {
+ return this.fileError("File too large (file: " + this.filesize + ", max: " + ($.bytesToString(max)) + ").");
+ }
+ };
+
+ _Class.prototype.readFile = function() {
+ var el, event, isVideo, onerror, onload;
+ isVideo = /^video\//.test(this.file.type);
+ el = $.el(isVideo ? 'video' : 'img');
+ if (isVideo && !el.canPlayType(this.file.type)) {
+ return;
+ }
+ event = isVideo ? 'loadeddata' : 'load';
+ onload = (function(_this) {
+ return function() {
+ $.off(el, event, onload);
+ $.off(el, 'error', onerror);
+ _this.checkDimensions(el);
+ return _this.setThumbnail(el);
+ };
+ })(this);
+ onerror = (function(_this) {
+ return function() {
+ $.off(el, event, onload);
+ $.off(el, 'error', onerror);
+ _this.fileError((isVideo ? 'Video' : 'Image') + " appears corrupt");
+ return URL.revokeObjectURL(el.src);
+ };
+ })(this);
+ $.on(el, event, onload);
+ $.on(el, 'error', onerror);
+ return el.src = URL.createObjectURL(this.file);
+ };
+
+ _Class.prototype.checkDimensions = function(el) {
+ var duration, height, max_height, max_width, ref, videoHeight, videoWidth, width;
+ if (el.tagName === 'IMG') {
+ height = el.height, width = el.width;
+ if (height > QR.max_height || width > QR.max_width) {
+ this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)");
+ }
+ if (height < QR.min_height || width < QR.min_width) {
+ return this.fileError("Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ }
+ } else {
+ videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration;
+ max_height = Math.min(QR.max_height, QR.max_height_video);
+ max_width = Math.min(QR.max_width, QR.max_width_video);
+ if (videoHeight > max_height || videoWidth > max_width) {
+ this.fileError("Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)");
+ }
+ if (videoHeight < QR.min_height || videoWidth < QR.min_width) {
+ this.fileError("Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)");
+ }
+ if (!isFinite(duration)) {
+ this.fileError('Video lacks duration metadata (try remuxing)');
+ } else if (duration > QR.max_duration_video) {
+ this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
+ }
+ if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg') && $.hasAudio(el)) {
+ return this.fileError('Audio not allowed');
+ }
+ }
+ };
+
+ _Class.prototype.setThumbnail = function(el) {
+ var cv, height, isVideo, s, width;
+ isVideo = el.tagName === 'VIDEO';
+ s = 90 * 2 * window.devicePixelRatio;
+ if (this.file.type === 'image/gif') {
+ s *= 3;
+ }
+ if (isVideo) {
+ height = el.videoHeight;
+ width = el.videoWidth;
+ } else {
+ height = el.height, width = el.width;
+ if (height < s || width < s) {
+ this.URL = el.src;
+ this.nodes.el.style.backgroundImage = "url(" + this.URL + ")";
+ return;
+ }
+ }
+ if (height <= width) {
+ width = s / height * width;
+ height = s;
+ } else {
+ height = s / width * height;
+ width = s;
+ }
+ cv = $.el('canvas');
+ cv.height = height;
+ cv.width = width;
+ cv.getContext('2d').drawImage(el, 0, 0, width, height);
+ URL.revokeObjectURL(el.src);
+ return cv.toBlob((function(_this) {
+ return function(blob) {
+ _this.URL = URL.createObjectURL(blob);
+ return _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")";
+ };
+ })(this));
+ };
+
+ _Class.prototype.rmFile = function() {
+ if (this.isLocked) {
+ return;
+ }
+ delete this.file;
+ delete this.filename;
+ delete this.filesize;
+ this.nodes.el.removeAttribute('title');
+ QR.nodes.filename.removeAttribute('title');
+ this.nodes.el.style.backgroundImage = null;
+ $.rmClass(this.nodes.el, 'has-file');
+ this.showFileData();
+ URL.revokeObjectURL(this.URL);
+ return this.dismissErrors(function(error) {
+ return $.hasClass(error, 'file-error');
+ });
+ };
+
+ _Class.prototype.saveFilename = function() {
+ this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-');
+ if (!QR.validExtension.test(this.filename)) {
+ return this.file.newName += "." + (QR.extensionFromType[this.file.type] || 'jpg');
+ }
+ };
+
+ _Class.prototype.updateFilename = function() {
+ var long;
+ long = this.filename + " (" + this.filesize + ")";
+ this.nodes.el.title = long;
+ if (this !== QR.selected) {
+ return;
+ }
+ return QR.nodes.filename.title = long;
+ };
+
+ _Class.prototype.showFileData = function() {
+ var ref;
+ if (this.file) {
+ this.updateFilename();
+ QR.nodes.filename.value = this.filename;
+ $.addClass(QR.nodes.oekaki, 'has-file');
+ $.addClass(QR.nodes.fileSubmit, 'has-file');
+ } else {
+ $.rmClass(QR.nodes.oekaki, 'has-file');
+ $.rmClass(QR.nodes.fileSubmit, 'has-file');
+ }
+ if (((ref = this.file) != null ? ref.source : void 0) != null) {
+ QR.nodes.fileSubmit.dataset.source = this.file.source;
+ } else {
+ QR.nodes.fileSubmit.removeAttribute('data-source');
+ }
+ return QR.nodes.spoiler.checked = this.spoiler;
+ };
+
+ _Class.prototype.pasteText = function(file) {
+ var reader;
+ this.pasting = true;
+ reader = new FileReader();
+ reader.onload = (function(_this) {
+ return function(e) {
+ var result;
+ result = e.target.result;
+ _this.setComment((_this.com ? _this.com + "\n" + result : result));
+ return delete _this.pasting;
+ };
+ })(this);
+ return reader.readAsText(file);
+ };
+
+ _Class.prototype.dragStart = function(e) {
+ var left, ref, top;
+ ref = this.getBoundingClientRect(), left = ref.left, top = ref.top;
+ e.dataTransfer.setDragImage(this, e.clientX - left, e.clientY - top);
+ return $.addClass(this, 'drag');
+ };
+
+ _Class.prototype.dragEnd = function() {
+ return $.rmClass(this, 'drag');
+ };
+
+ _Class.prototype.dragEnter = function() {
+ return $.addClass(this, 'over');
+ };
+
+ _Class.prototype.dragLeave = function() {
+ return $.rmClass(this, 'over');
+ };
+
+ _Class.prototype.dragOver = function(e) {
+ e.preventDefault();
+ return e.dataTransfer.dropEffect = 'move';
+ };
+
+ _Class.prototype.drop = function() {
+ var el, index, newIndex, oldIndex, post;
+ $.rmClass(this, 'over');
+ if (!this.draggable) {
+ return;
+ }
+ el = $('.drag', this.parentNode);
+ index = function(el) {
+ return slice.call(el.parentNode.children).indexOf(el);
+ };
+ oldIndex = index(el);
+ newIndex = index(this);
+ (oldIndex < newIndex ? $.after : $.before)(this, el);
+ post = QR.posts.splice(oldIndex, 1)[0];
+ QR.posts.splice(newIndex, 0, post);
+ return QR.status();
+ };
+
+ return _Class;
+
+ })();
+
+}).call(this);
+
+QuoteBacklink = (function() {
+ var QuoteBacklink;
+
+ QuoteBacklink = {
+ containers: {},
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) {
+ return;
+ }
+ Callbacks.Post.push({
+ name: 'Quote Backlinking Part 1',
+ cb: this.firstNode
+ });
+ return Callbacks.Post.push({
+ name: 'Quote Backlinking Part 2',
+ cb: this.secondNode
+ });
+ },
+ firstNode: function() {
+ var a, clone, container, containers, hash, i, j, k, len, len1, len2, link, markYours, nodes, post, quote, ref, ref1, ref2;
+ if (this.isClone || !this.quotes.length || this.isRebuilt) {
+ return;
+ }
+ markYours = Conf['Mark Quotes of You'] && ((ref = QuoteYou.db) != null ? ref.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ }) : void 0);
+ a = $.el('a', {
+ href: Build.postURL(this.board.ID, this.thread.ID, this.ID),
+ className: this.isHidden ? 'filtered backlink' : 'backlink',
+ textContent: Conf['backlink'].replace(/%(?:id|%)/g, (function(_this) {
+ return function(x) {
+ return {
+ '%id': _this.ID,
+ '%%': '%'
+ }[x];
+ };
+ })(this)) + (markYours ? '\u00A0(You)' : '')
+ });
+ ref1 = this.quotes;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ quote = ref1[i];
+ containers = [QuoteBacklink.getContainer(quote)];
+ if ((post = g.posts[quote]) && post.nodes.backlinkContainer) {
+ ref2 = post.clones;
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ clone = ref2[j];
+ containers.push(clone.nodes.backlinkContainer);
+ }
+ }
+ for (k = 0, len2 = containers.length; k < len2; k++) {
+ container = containers[k];
+ link = a.cloneNode(true);
+ nodes = container.firstChild ? [$.tn(' '), link] : [link];
+ if (Conf['Quote Previewing']) {
+ $.on(link, 'mouseover', QuotePreview.mouseover);
+ }
+ if (Conf['Quote Inlining']) {
+ $.on(link, 'click', QuoteInline.toggle);
+ if (Conf['Quote Hash Navigation']) {
+ hash = QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
+ nodes.push(hash);
+ }
+ }
+ $.add(container, nodes);
+ }
+ }
+ },
+ secondNode: function() {
+ var container;
+ if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) {
+ this.nodes.backlinkContainer = $('.container', this.nodes.info);
+ return;
+ }
+ if (!(this.isReply || Conf['OP Backlinks'])) {
+ return;
+ }
+ container = QuoteBacklink.getContainer(this.fullID);
+ this.nodes.backlinkContainer = container;
+ return $.add(this.nodes.info, container);
+ },
+ getContainer: function(id) {
+ var base;
+ return (base = this.containers)[id] || (base[id] = $.el('span', {
+ className: 'container'
+ }));
+ }
+ };
+
+ return QuoteBacklink;
+
+}).call(this);
+
+QuoteCT = (function() {
+ var QuoteCT;
+
+ QuoteCT = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ this.text = '\u00A0(Cross-thread)';
+ return Callbacks.Post.push({
+ name: 'Mark Cross-thread Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var board, boardID, i, len, quotelink, ref, ref1, ref2, thread, threadID;
+ if (this.isClone && this.thread === this.context.thread) {
+ return;
+ }
+ ref = this.context, board = ref.board, thread = ref.thread;
+ ref1 = this.nodes.quotelinks;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ quotelink = ref1[i];
+ ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID;
+ if (!threadID) {
+ continue;
+ }
+ if (this.isClone) {
+ quotelink.textContent = quotelink.textContent.replace(QuoteCT.text, '');
+ }
+ if (boardID === board.ID && threadID !== thread.ID) {
+ $.add(quotelink, $.tn(QuoteCT.text));
+ }
+ }
+ }
+ };
+
+ return QuoteCT;
+
+}).call(this);
+
+QuoteInline = (function() {
+ var QuoteInline;
+
+ QuoteInline = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ return Callbacks.Post.push({
+ name: 'Quote Inlining',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, isClone, j, len, len1, link, process, ref, ref1;
+ process = QuoteInline.process;
+ isClone = this.isClone;
+ ref = this.nodes.quotelinks;
+ for (i = 0, len = ref.length; i < len; i++) {
+ link = ref[i];
+ process(link, isClone);
+ }
+ ref1 = this.nodes.backlinks;
+ for (j = 0, len1 = ref1.length; j < len1; j++) {
+ link = ref1[j];
+ process(link, isClone);
+ }
+ },
+ process: function(link, clone) {
+ if (Conf['Quote Hash Navigation']) {
+ if (!clone) {
+ $.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')));
+ }
+ }
+ return $.on(link, 'click', QuoteInline.toggle);
+ },
+ qiQuote: function(link, hidden) {
+ var name;
+ name = "hashlink";
+ if (hidden) {
+ name += " filtered";
+ }
+ return $.el('a', {
+ className: name,
+ textContent: '#',
+ href: link.href
+ });
+ },
+ toggle: function(e) {
+ var boardID, context, postID, quoter, ref, ref1, threadID;
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
+ return;
+ }
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ if (Conf['Inline Cross-thread Quotes Only'] && g.VIEW === 'thread' && ((ref1 = g.posts[boardID + "." + postID]) != null ? ref1.nodes.root.offsetParent : void 0)) {
+ return;
+ }
+ e.preventDefault();
+ quoter = Get.postFromNode(this);
+ context = quoter.context;
+ if ($.hasClass(this, 'inlined')) {
+ QuoteInline.rm(this, boardID, threadID, postID, context);
+ } else {
+ if ($.x("ancestor::div[@data-full-i-d='" + boardID + "." + postID + "']", this)) {
+ return;
+ }
+ QuoteInline.add(this, boardID, threadID, postID, context, quoter);
+ }
+ return this.classList.toggle('inlined');
+ },
+ findRoot: function(quotelink, isBacklink) {
+ if (isBacklink) {
+ return quotelink.parentNode.parentNode;
+ } else {
+ return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink);
+ }
+ },
+ add: function(quotelink, boardID, threadID, postID, context, quoter) {
+ var inline, isBacklink, post, qroot, root;
+ isBacklink = $.hasClass(quotelink, 'backlink');
+ inline = $.el('div', {
+ className: 'inline'
+ });
+ inline.dataset.fullID = boardID + "." + postID;
+ root = QuoteInline.findRoot(quotelink, isBacklink);
+ $.after(root, inline);
+ qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
+ $.addClass(qroot, 'hasInline');
+ new Fetcher(boardID, threadID, postID, inline, quoter);
+ if (!((post = g.posts[boardID + "." + postID]) && context.thread === post.thread)) {
+ return;
+ }
+ if (isBacklink && Conf['Forward Hiding']) {
+ $.addClass(post.nodes.root, 'forwarded');
+ post.forwarded++ || (post.forwarded = 1);
+ }
+ if (!Unread.posts) {
+ return;
+ }
+ return Unread.readSinglePost(post);
+ },
+ rm: function(quotelink, boardID, threadID, postID, context) {
+ var el, inlined, isBacklink, post, qroot, ref, root;
+ isBacklink = $.hasClass(quotelink, 'backlink');
+ root = QuoteInline.findRoot(quotelink, isBacklink);
+ root = $.x("following-sibling::div[@data-full-i-d='" + boardID + "." + postID + "'][1]", root);
+ qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root);
+ $.rm(root);
+ if (!$('.inline', qroot)) {
+ $.rmClass(qroot, 'hasInline');
+ }
+ if (!(el = root.firstElementChild)) {
+ return;
+ }
+ post = g.posts[boardID + "." + postID];
+ post.rmClone(el.dataset.clone);
+ if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads[boardID + "." + threadID] && !--post.forwarded) {
+ delete post.forwarded;
+ $.rmClass(post.nodes.root, 'forwarded');
+ }
+ while (inlined = $('.inlined', el)) {
+ ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ QuoteInline.rm(inlined, boardID, threadID, postID, context);
+ $.rmClass(inlined, 'inlined');
+ }
+ }
+ };
+
+ return QuoteInline;
+
+}).call(this);
+
+QuoteOP = (function() {
+ var QuoteOP,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ QuoteOP = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ this.text = '\u00A0(OP)';
+ return Callbacks.Post.push({
+ name: 'Mark OP Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1;
+ if (this.isClone && this.thread === this.context.thread) {
+ return;
+ }
+ if (!(quotes = this.quotes).length) {
+ return;
+ }
+ quotelinks = this.nodes.quotelinks;
+ if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) {
+ i = 0;
+ while (quotelink = quotelinks[i++]) {
+ quotelink.textContent = quotelink.textContent.replace(QuoteOP.text, '');
+ }
+ }
+ fullID = this.context.thread.fullID;
+ if (indexOf.call(quotes, fullID) < 0) {
+ return;
+ }
+ i = 0;
+ while (quotelink = quotelinks[i++]) {
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((boardID + "." + postID) === fullID) {
+ $.add(quotelink, $.tn(QuoteOP.text));
+ }
+ }
+ }
+ };
+
+ return QuoteOP;
+
+}).call(this);
+
+QuotePreview = (function() {
+ var QuotePreview,
+ slice = [].slice;
+
+ QuotePreview = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Quote Previewing'])) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ return Callbacks.Post.push({
+ name: 'Quote Previewing',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, len, link, ref;
+ ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks));
+ for (i = 0, len = ref.length; i < len; i++) {
+ link = ref[i];
+ $.on(link, 'mouseover', QuotePreview.mouseover);
+ }
+ },
+ mouseover: function(e) {
+ var boardID, i, len, origin, post, postID, posts, qp, ref, threadID;
+ if ($.hasClass(this, 'inlined') || !d.contains(this)) {
+ return;
+ }
+ ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ qp = $.el('div', {
+ id: 'qp',
+ className: 'dialog'
+ });
+ $.add(Header.hover, qp);
+ new Fetcher(boardID, threadID, postID, qp, Get.postFromNode(this));
+ UI.hover({
+ root: this,
+ el: qp,
+ latestEvent: e,
+ endEvents: 'mouseout click',
+ cb: QuotePreview.mouseout
+ });
+ if (Conf['Quote Highlighting'] && (origin = g.posts[boardID + "." + postID])) {
+ posts = [origin].concat(origin.clones);
+ posts.pop();
+ for (i = 0, len = posts.length; i < len; i++) {
+ post = posts[i];
+ $.addClass(post.nodes.post, 'qphl');
+ }
+ }
+ },
+ mouseout: function() {
+ var clone, i, len, post, ref, root;
+ if (!(root = this.el.firstElementChild)) {
+ return;
+ }
+ clone = Get.postFromRoot(root);
+ post = clone.origin;
+ post.rmClone(root.dataset.clone);
+ if (!Conf['Quote Highlighting']) {
+ return;
+ }
+ ref = [post].concat(post.clones);
+ for (i = 0, len = ref.length; i < len; i++) {
+ post = ref[i];
+ $.rmClass(post.nodes.post, 'qphl');
+ }
+ }
+ };
+
+ return QuotePreview;
+
+}).call(this);
+
+QuoteStrikeThrough = (function() {
+ var QuoteStrikeThrough;
+
+ QuoteStrikeThrough = {
+ init: function() {
+ var ref;
+ if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) {
+ return;
+ }
+ return Callbacks.Post.push({
+ name: 'Strike-through Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var boardID, i, len, postID, quotelink, ref, ref1, ref2;
+ if (this.isClone) {
+ return;
+ }
+ ref = this.nodes.quotelinks;
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID;
+ if ((ref2 = g.posts[boardID + "." + postID]) != null ? ref2.isHidden : void 0) {
+ $.addClass(quotelink, 'filtered');
+ }
+ }
+ }
+ };
+
+ return QuoteStrikeThrough;
+
+}).call(this);
+
+QuoteThreading =
+/*
+ <3 aeosynth
+ */
+
+(function() {
+ var QuoteThreading;
+
+ QuoteThreading = {
+ init: function() {
+ if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) {
+ return;
+ }
+ this.controls = $.el('label', {
+ innerHTML: "
Threading"
+ });
+ this.threadNewLink = $.el('span', {
+ className: 'brackets-wrap threadnewlink',
+ hidden: true
+ });
+ $.extend(this.threadNewLink, {
+ innerHTML: "
Thread New Posts "
+ });
+ this.input = $('input', this.controls);
+ this.input.checked = Conf['Thread Quotes'];
+ $.on(this.input, 'change', this.setEnabled);
+ $.on(this.input, 'change', this.rethread);
+ $.on(this.threadNewLink.firstElementChild, 'click', this.rethread);
+ $.on(d, '4chanXInitFinished', (function(_this) {
+ return function() {
+ return _this.ready = true;
+ };
+ })(this));
+ Header.menu.addEntry(this.entry = {
+ el: this.controls,
+ order: 99
+ });
+ Callbacks.Thread.push({
+ name: 'Quote Threading',
+ cb: this.setThread
+ });
+ return Callbacks.Post.push({
+ name: 'Quote Threading',
+ cb: this.node
+ });
+ },
+ parent: {},
+ children: {},
+ inserted: {},
+ setEnabled: function() {
+ var other, ref;
+ other = (ref = ReplyPruning.inputs) != null ? ref.enabled : void 0;
+ if (this.checked && (other != null ? other.checked : void 0)) {
+ other.checked = false;
+ $.event('change', null, other);
+ }
+ return $.cb.checked.call(this);
+ },
+ setThread: function() {
+ QuoteThreading.thread = this;
+ return $.asap((function() {
+ return !Conf['Thread Updater'] || $('.navLinksBot > .updatelink');
+ }), function() {
+ var navLinksBot;
+ if ((navLinksBot = $('.navLinksBot'))) {
+ return $.add(navLinksBot, [$.tn(' '), QuoteThreading.threadNewLink]);
+ }
+ });
+ },
+ node: function() {
+ var ancestor, j, lastParent, len, parent, parents, quote, ref;
+ if (this.isFetchedQuote || this.isClone || !this.isReply) {
+ return;
+ }
+ parents = new Set();
+ lastParent = null;
+ ref = this.quotes;
+ for (j = 0, len = ref.length; j < len; j++) {
+ quote = ref[j];
+ if (parent = g.posts[quote]) {
+ if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) {
+ parents.add(parent.ID);
+ if (!lastParent || parent.ID > lastParent.ID) {
+ lastParent = parent;
+ }
+ }
+ }
+ }
+ if (!lastParent) {
+ return;
+ }
+ ancestor = lastParent;
+ while (ancestor = QuoteThreading.parent[ancestor.fullID]) {
+ parents["delete"](ancestor.ID);
+ }
+ if (parents.size === 1) {
+ return QuoteThreading.parent[this.fullID] = lastParent;
+ }
+ },
+ descendants: function(post) {
+ var child, children, j, len, posts;
+ posts = [post];
+ if (children = QuoteThreading.children[post.fullID]) {
+ for (j = 0, len = children.length; j < len; j++) {
+ child = children[j];
+ posts = posts.concat(QuoteThreading.descendants(child));
+ }
+ }
+ return posts;
+ },
+ insert: function(post) {
+ var base, child, children, descendants, i, j, k, l, len, name, next, nodes, order, parent, prev, prev2, threadContainer, x;
+ if (!(Conf['Thread Quotes'] && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) {
+ return false;
+ }
+ descendants = QuoteThreading.descendants(post);
+ if (!Unread.posts.has(parent.ID)) {
+ if ((function() {
+ var j, len, x;
+ for (j = 0, len = descendants.length; j < len; j++) {
+ x = descendants[j];
+ if (Unread.posts.has(x.ID)) {
+ return true;
+ }
+ }
+ })()) {
+ QuoteThreading.threadNewLink.hidden = false;
+ return false;
+ }
+ }
+ order = Unread.order;
+ children = ((base = QuoteThreading.children)[name = parent.fullID] || (base[name] = []));
+ threadContainer = parent.nodes.threadContainer || $.el('div', {
+ className: 'threadContainer'
+ });
+ nodes = [post.nodes.root];
+ if (post.nodes.threadContainer) {
+ nodes.push(post.nodes.threadContainer);
+ }
+ i = children.length;
+ for (j = children.length - 1; j >= 0; j += -1) {
+ child = children[j];
+ if (child.ID >= post.ID) {
+ i--;
+ }
+ }
+ if (i !== children.length) {
+ next = children[i];
+ for (k = 0, len = descendants.length; k < len; k++) {
+ x = descendants[k];
+ order.before(order[next.ID], order[x.ID]);
+ }
+ children.splice(i, 0, post);
+ $.before(next.nodes.root, nodes);
+ } else {
+ prev = parent;
+ while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {
+ prev = prev2[prev2.length - 1];
+ }
+ for (l = descendants.length - 1; l >= 0; l += -1) {
+ x = descendants[l];
+ order.after(order[prev.ID], order[x.ID]);
+ }
+ children.push(post);
+ $.add(threadContainer, nodes);
+ }
+ QuoteThreading.inserted[post.fullID] = true;
+ if (!parent.nodes.threadContainer) {
+ parent.nodes.threadContainer = threadContainer;
+ $.addClass(parent.nodes.root, 'threadOP');
+ $.after(parent.nodes.root, threadContainer);
+ }
+ return true;
+ },
+ rethread: function() {
+ var nodes, posts, thread;
+ if (!QuoteThreading.ready) {
+ return;
+ }
+ thread = QuoteThreading.thread;
+ posts = thread.posts;
+ QuoteThreading.threadNewLink.hidden = true;
+ if (Conf['Thread Quotes']) {
+ posts.forEach(QuoteThreading.insert);
+ } else {
+ nodes = [];
+ Unread.order = new RandomAccessList();
+ QuoteThreading.inserted = {};
+ posts.forEach(function(post) {
+ if (post.isFetchedQuote) {
+ return;
+ }
+ Unread.order.push(post);
+ if (post.isReply) {
+ nodes.push(post.nodes.root);
+ }
+ if (QuoteThreading.children[post.fullID]) {
+ delete QuoteThreading.children[post.fullID];
+ $.rmClass(post.nodes.root, 'threadOP');
+ $.rm(post.nodes.threadContainer);
+ return delete post.nodes.threadContainer;
+ }
+ });
+ $.add(thread.OP.nodes.root.parentNode, nodes);
+ }
+ Unread.position = Unread.order.first;
+ Unread.updatePosition();
+ Unread.setLine(true);
+ Unread.read();
+ return Unread.update();
+ }
+ };
+
+ return QuoteThreading;
+
+}).call(this);
+
+QuoteYou = (function() {
+ var QuoteYou;
+
+ QuoteYou = {
+ init: function() {
+ var ref;
+ if (!Conf['Remember Your Posts']) {
+ return;
+ }
+ this.db = new DataBoard('yourPosts');
+ $.sync('Remember Your Posts', function(enabled) {
+ return Conf['Remember Your Posts'] = enabled;
+ });
+ $.on(d, 'QRPostSuccessful', function(e) {
+ var boardID, postID, ref, threadID;
+ $.forceSync('Remember Your Posts');
+ if (Conf['Remember Your Posts']) {
+ ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID;
+ return QuoteYou.db.set({
+ boardID: boardID,
+ threadID: threadID,
+ postID: postID,
+ val: true
+ });
+ }
+ });
+ if ((ref = g.VIEW) !== 'index' && ref !== 'thread') {
+ return;
+ }
+ if (Conf['Highlight Own Posts']) {
+ $.addClass(doc, 'highlight-own');
+ }
+ if (Conf['Highlight Posts Quoting You']) {
+ $.addClass(doc, 'highlight-you');
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ this.text = '\u00A0(You)';
+ return Callbacks.Post.push({
+ name: 'Mark Quotes of You',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var i, len, quotelink, ref;
+ if (this.isClone) {
+ return;
+ }
+ if (QuoteYou.db.get({
+ boardID: this.board.ID,
+ threadID: this.thread.ID,
+ postID: this.ID
+ })) {
+ $.addClass(this.nodes.root, 'yourPost');
+ }
+ if (!this.quotes.length) {
+ return;
+ }
+ ref = this.nodes.quotelinks;
+ for (i = 0, len = ref.length; i < len; i++) {
+ quotelink = ref[i];
+ if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) {
+ continue;
+ }
+ if (Conf['Mark Quotes of You']) {
+ $.add(quotelink, $.tn(QuoteYou.text));
+ }
+ $.addClass(quotelink, 'you');
+ $.addClass(this.nodes.root, 'quotesYou');
+ }
+ },
+ cb: {
+ seek: function(type) {
+ var highlight, post, posts, result, str;
+ if (highlight = $('.highlight')) {
+ $.rmClass(highlight, 'highlight');
+ }
+ if (!(QuoteYou.lastRead && doc.contains(QuoteYou.lastRead) && $.hasClass(QuoteYou.lastRead, 'quotesYou'))) {
+ if (!(post = QuoteYou.lastRead = $('.quotesYou'))) {
+ new Notice('warning', 'No posts are currently quoting you, loser.', 20);
+ return;
+ }
+ if (QuoteYou.cb.scroll(post)) {
+ return;
+ }
+ } else {
+ post = QuoteYou.lastRead;
+ }
+ str = type + "::div[contains(@class,'quotesYou')]";
+ while ((post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0))) {
+ if (QuoteYou.cb.scroll(post)) {
+ return;
+ }
+ }
+ posts = $$('.quotesYou');
+ return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]);
+ },
+ scroll: function(root) {
+ var post;
+ post = $('.post', root);
+ if (!post.getBoundingClientRect().height) {
+ return false;
+ } else {
+ QuoteYou.lastRead = root;
+ window.location = "#" + post.id;
+ Header.scrollTo(post);
+ $.addClass(post, 'highlight');
+ return true;
+ }
+ }
+ }
+ };
+
+ return QuoteYou;
+
+}).call(this);
+
+Quotify = (function() {
+ var Quotify,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ slice = [].slice;
+
+ Quotify = {
+ init: function() {
+ var ref;
+ if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) {
+ return;
+ }
+ if (Conf['Comment Expansion']) {
+ ExpandComment.callbacks.push(this.node);
+ }
+ return Callbacks.Post.push({
+ name: 'Resurrect Quotes',
+ cb: this.node
+ });
+ },
+ node: function() {
+ var deadlink, i, len, ref;
+ if (this.isClone) {
+ return;
+ }
+ ref = $$('.deadlink', this.nodes.comment);
+ for (i = 0, len = ref.length; i < len; i++) {
+ deadlink = ref[i];
+ Quotify.parseDeadlink.call(this, deadlink);
+ }
+ },
+ parseDeadlink: function(deadlink) {
+ var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref;
+ if ($.hasClass(deadlink.parentNode, 'prettyprint')) {
+ Quotify.fixDeadlink(deadlink);
+ return;
+ }
+ quote = deadlink.textContent;
+ if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) {
+ return;
+ }
+ if (postID[0] === '0') {
+ Quotify.fixDeadlink(deadlink);
+ return;
+ }
+ boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID;
+ quoteID = boardID + "." + postID;
+ if (post = g.posts[quoteID]) {
+ if (!post.isDead) {
+ a = $.el('a', {
+ href: Build.postURL(boardID, post.thread.ID, postID),
+ className: 'quotelink',
+ textContent: quote
+ });
+ } else {
+ a = $.el('a', {
+ href: Build.postURL(boardID, post.thread.ID, postID),
+ className: 'quotelink deadlink',
+ textContent: quote + "\u00A0(Dead)"
+ });
+ $.extend(a.dataset, {
+ boardID: boardID,
+ threadID: post.thread.ID,
+ postID: postID
+ });
+ }
+ } else {
+ redirect = Redirect.to('thread', {
+ boardID: boardID,
+ threadID: 0,
+ postID: postID
+ });
+ fetchable = Redirect.to('post', {
+ boardID: boardID,
+ postID: postID
+ });
+ if (redirect || fetchable) {
+ a = $.el('a', {
+ href: redirect || 'javascript:;',
+ className: 'deadlink',
+ textContent: quote + "\u00A0(Dead)"
+ });
+ if (fetchable) {
+ $.addClass(a, 'quotelink');
+ $.extend(a.dataset, {
+ boardID: boardID,
+ postID: postID
+ });
+ }
+ }
+ }
+ if (indexOf.call(this.quotes, quoteID) < 0) {
+ this.quotes.push(quoteID);
+ }
+ if (!a) {
+ deadlink.textContent = quote + "\u00A0(Dead)";
+ return;
+ }
+ $.replace(deadlink, a);
+ if ($.hasClass(a, 'quotelink')) {
+ return this.nodes.quotelinks.push(a);
+ }
+ },
+ fixDeadlink: function(deadlink) {
+ var el, green;
+ if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') {
+ green = $.el('span', {
+ className: 'quote'
+ });
+ $.before(deadlink, green);
+ $.add(green, deadlink);
+ }
+ return $.replace(deadlink, slice.call(deadlink.childNodes));
+ }
+ };
+
+ return Quotify;
+
+}).call(this);
+
+Main = (function() {
+ var Main;
+
+ Main = {
+ init: function() {
+ var db, flatten, items, j, key, len, ref;
+ if (d.body && !$('title', d.head)) {
+ return;
+ }
+ if (window['4chan X antidup']) {
+ return;
+ }
+ window['4chan X antidup'] = true;
+ if (location.hostname === 'www.google.com') {
+ $.get('Captcha Fixes', true, function(arg) {
+ var enabled;
+ enabled = arg['Captcha Fixes'];
+ if (enabled) {
+ return $.ready(function() {
+ return Captcha.fixes.init();
+ });
+ }
+ });
+ return;
+ }
+ $.global(function() {
+ var j, len, nuke, prop, ref;
+ nuke = function(obj, prop) {
+ try {
+ return Object.defineProperty(obj, prop, {
+ configurable: false,
+ get: function() {
+ throw new Error();
+ },
+ set: function() {
+ throw new Error();
+ }
+ });
+ } catch (_error) {}
+ };
+ ref = ['atOptions', 'adsterra_key', 'EpmadsConfig', 'epmads_key', 'EpomConfig', 'epom_key', 'exoDocumentProtocol'];
+ for (j = 0, len = ref.length; j < len; j++) {
+ prop = ref[j];
+ nuke(window, prop);
+ }
+ });
+ $.on(window, 'beforescriptexecute', function(e) {
+ var host, ref, ref1;
+ host = (ref = e.target.src.split('/')[2]) != null ? (ref1 = ref.match(/[^.]+\.[^.]+$/)) != null ? ref1[0] : void 0 : void 0;
+ if (host === 'bnhtml.com' || host === 'ecpmrocks.com' || host === 'advertisation.com' || host === 'exoclick.com') {
+ return e.preventDefault();
+ }
+ });
+ $.on(d, '4chanXInitFinished', function() {
+ if (Main.expectInitFinished) {
+ return delete Main.expectInitFinished;
+ } else {
+ new Notice('error', 'Error: Multiple copies of 4chan X are enabled.');
+ return $.addClass(doc, 'tainted');
+ }
+ });
+ flatten = function(parent, obj) {
+ var key, val;
+ if (obj instanceof Array) {
+ Conf[parent] = obj[0];
+ } else if (typeof obj === 'object') {
+ for (key in obj) {
+ val = obj[key];
+ flatten(key, val);
+ }
+ } else {
+ Conf[parent] = obj;
+ }
+ };
+ flatten(null, Config);
+ ref = DataBoard.keys;
+ for (j = 0, len = ref.length; j < len; j++) {
+ db = ref[j];
+ Conf[db] = {
+ boards: {}
+ };
+ }
+ Conf['selectedArchives'] = {};
+ Conf['cooldowns'] = {};
+ Conf['Index Sort'] = {};
+ Conf['Except Archives from Encryption'] = false;
+ Conf['JSON Navigation'] = true;
+ Conf['Oekaki Links'] = true;
+ items = {};
+ for (key in Conf) {
+ items[key] = void 0;
+ }
+ items['previousversion'] = void 0;
+ return $.get(items, function(items) {
+ return $.asap((function() {
+ var doc;
+ return doc = d.documentElement;
+ }), function() {
+ var ref1, val;
+ if ($.cantSet) {
+
+ } else if (items.previousversion == null) {
+ Main.ready(function() {
+ $.set('previousversion', g.VERSION);
+ return Settings.open();
+ });
+ } else if (items.previousversion !== g.VERSION) {
+ Main.upgrade(items);
+ }
+ for (key in Conf) {
+ val = Conf[key];
+ Conf[key] = (ref1 = items[key]) != null ? ref1 : val;
+ }
+ return Main.initFeatures();
+ });
+ });
+ },
+ upgrade: function(items) {
+ var changes, previousversion;
+ previousversion = items.previousversion;
+ changes = Settings.upgrade(items, previousversion);
+ items.previousversion = changes.previousversion = g.VERSION;
+ return $.set(changes, function() {
+ var el, ref;
+ if ((ref = items['Show Updated Notifications']) != null ? ref : true) {
+ el = $.el('span', {
+ innerHTML: "4chan X has been updated to
version " + E(g.VERSION) + " ."
+ });
+ return new Notice('info', el, 15);
+ }
+ });
+ },
+ initFeatures: function() {
+ var err, feature, hostname, j, len, match, name, pathname, ref, ref1, ref2, ref3, search;
+ hostname = location.hostname, search = location.search;
+ pathname = location.pathname.split(/\/+/);
+ if (hostname !== 'www.4chan.org') {
+ g.BOARD = new Board(pathname[1]);
+ }
+ if (hostname === 'boards.4chan.org' || hostname === 'sys.4chan.org' || hostname === 'www.4chan.org') {
+ $.global(function() {
+ document.documentElement.classList.add('js-enabled');
+ return window.FCX = {};
+ });
+ Main.jsEnabled = $.hasClass(doc, 'js-enabled');
+ }
+ switch (hostname) {
+ case 'www.4chan.org':
+ $.onExists(doc, 'body', function() {
+ return $.addStyle(CSS.www);
+ });
+ Captcha.replace.init();
+ return;
+ case 'sys.4chan.org':
+ if (pathname[2] === 'imgboard.php') {
+ if (/\bmode=report\b/.test(search)) {
+ Report.init();
+ } else if ((match = search.match(/\bres=(\d+)/))) {
+ $.ready(function() {
+ var ref;
+ if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') {
+ return Redirect.navigate('thread', {
+ boardID: g.BOARD.ID,
+ postID: +match[1]
+ });
+ }
+ });
+ }
+ } else if (pathname[2] === 'post') {
+ PostSuccessful.init();
+ }
+ return;
+ case 'i.4cdn.org':
+ if (!(pathname[2] && !/s\.jpg$/.test(pathname[2]))) {
+ return;
+ }
+ $.asap((function() {
+ return d.readyState !== 'loading';
+ }), function() {
+ var ref, video;
+ if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
+ return Redirect.navigate('file', {
+ boardID: g.BOARD.ID,
+ filename: pathname[pathname.length - 1]
+ });
+ } else if (video = $('video')) {
+ if (Conf['Volume in New Tab']) {
+ Volume.setup(video);
+ }
+ if (Conf['Loop in New Tab']) {
+ video.loop = true;
+ video.controls = false;
+ video.play();
+ return ImageCommon.addControls(video);
+ }
+ }
+ });
+ return;
+ }
+ if ((ref = pathname[2]) === 'thread' || ref === 'res') {
+ g.VIEW = 'thread';
+ g.THREADID = +pathname[3];
+ } else if ((ref1 = pathname[2]) === 'catalog' || ref1 === 'archive') {
+ g.VIEW = pathname[2];
+ } else if (pathname[2].match(/^\d*$/)) {
+ g.VIEW = 'index';
+ } else {
+ return;
+ }
+ g.threads = new SimpleDict();
+ g.posts = new SimpleDict();
+ $.onExists(doc, 'body', Main.initStyle);
+ ref2 = Main.features;
+ for (j = 0, len = ref2.length; j < len; j++) {
+ ref3 = ref2[j], name = ref3[0], feature = ref3[1];
+ try {
+ feature.init();
+ } catch (_error) {
+ err = _error;
+ Main.handleErrors({
+ message: "\"" + name + "\" initialization crashed.",
+ error: err
+ });
+ }
+ }
+ return $.ready(Main.initReady);
+ },
+ initStyle: function() {
+ var keyboard, ref;
+ if (!Main.isThisPageLegit()) {
+ return;
+ }
+ if ((ref = $('link[href*=mobile]', d.head)) != null) {
+ ref.disabled = true;
+ }
+ $.addClass(doc, 'fourchan-x', 'seaweedchan');
+ $.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW);
+ if ($.engine) {
+ $.addClass(doc, $.engine);
+ }
+ $.onExists(doc, '.ad-cnt', function(ad) {
+ return $.onExists(ad, 'img', function() {
+ return $.addClass(doc, 'ads-loaded');
+ });
+ });
+ if (Conf['Autohiding Scrollbar']) {
+ $.addClass(doc, 'autohiding-scrollbar');
+ }
+ $.ready(function() {
+ if (d.body.clientHeight > doc.clientHeight && (window.innerWidth === doc.clientWidth) !== Conf['Autohiding Scrollbar']) {
+ Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar'];
+ $.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar']);
+ return $.toggleClass(doc, 'autohiding-scrollbar');
+ }
+ });
+ $.addStyle(CSS.boards, 'fourchanx-css');
+ Main.bgColorStyle = $.el('style', {
+ id: 'fourchanx-bgcolor-css'
+ });
+ keyboard = false;
+ $.on(d, 'mousedown', function() {
+ return keyboard = false;
+ });
+ $.on(d, 'keydown', function(e) {
+ if (e.keyCode === 9) {
+ return keyboard = true;
+ }
+ });
+ window.addEventListener('focus', (function() {
+ return doc.classList.toggle('keyboard-focus', keyboard);
+ }), true);
+ return Main.setClass();
+ },
+ setClass: function() {
+ var mainStyleSheet, setStyle, style, styleSheets;
+ if (g.VIEW === 'catalog') {
+ $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-'));
+ return;
+ }
+ style = 'yotsuba-b';
+ mainStyleSheet = $('link[title=switch]', d.head);
+ styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
+ setStyle = function() {
+ var bgColor, div, j, len, styleSheet;
+ $.rmClass(doc, style);
+ style = null;
+ for (j = 0, len = styleSheets.length; j < len; j++) {
+ styleSheet = styleSheets[j];
+ if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) {
+ style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-');
+ break;
+ }
+ }
+ if (style) {
+ $.addClass(doc, style);
+ return $.rm(Main.bgColorStyle);
+ } else {
+ div = $.el('div', {
+ className: 'reply'
+ });
+ div.style.cssText = 'position: absolute; visibility: hidden;';
+ $.add(d.body, div);
+ bgColor = window.getComputedStyle(div).backgroundColor;
+ $.rm(div);
+ Main.bgColorStyle.textContent = ".dialog, .suboption-list > div:last-of-type {\n background-color: " + bgColor + ";\n}";
+ return $.after($.id('fourchanx-css'), Main.bgColorStyle);
+ }
+ };
+ setStyle();
+ if (!mainStyleSheet) {
+ return;
+ }
+ return new MutationObserver(setStyle).observe(mainStyleSheet, {
+ attributes: true,
+ attributeFilter: ['href']
+ });
+ },
+ initReady: function() {
+ var msg, ref, ref1, ref2;
+ if (g.VIEW === 'thread' && (((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || ($('.board') && !$('.opContainer')))) {
+ ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() {
+ if (Conf['404 Redirect']) {
+ return Redirect.navigate('thread', {
+ boardID: g.BOARD.ID,
+ threadID: g.THREADID,
+ postID: +location.hash.match(/\d+/)
+ }, "/" + g.BOARD + "/");
+ }
+ });
+ return;
+ }
+ if ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found') {
+ return;
+ }
+ if (((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && !$('.board + *')) {
+ msg = $.el('div', {
+ innerHTML: "The page didn't load completely.
Some features may not work unless you
reload ."
+ });
+ $.on($('a', msg), 'click', function() {
+ return location.reload();
+ });
+ new Notice('warning', msg);
+ }
+ if (!(Conf['JSON Index'] && g.VIEW === 'index')) {
+ return Main.initThread();
+ } else {
+ Main.expectInitFinished = true;
+ return $.event('4chanXInitFinished');
+ }
+ },
+ initThread: function() {
+ var board, err, errors, j, k, len, len1, m, postRoot, posts, ref, ref1, scriptData, thread, threadRoot, threads;
+ if ((board = $('.board'))) {
+ threads = [];
+ posts = [];
+ ref = $$('.board > .thread', board);
+ for (j = 0, len = ref.length; j < len; j++) {
+ threadRoot = ref[j];
+ thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
+ threads.push(thread);
+ ref1 = $$('.thread > .postContainer', threadRoot);
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ postRoot = ref1[k];
+ if ($('.postMessage', postRoot)) {
+ try {
+ posts.push(new Post(postRoot, thread, g.BOARD));
+ } catch (_error) {
+ err = _error;
+ if (!errors) {
+ errors = [];
+ }
+ errors.push({
+ message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.",
+ error: err
+ });
+ }
+ }
+ }
+ }
+ if (errors) {
+ Main.handleErrors(errors);
+ }
+ if (g.VIEW === 'thread') {
+ scriptData = Get.scriptData();
+ threads[0].postLimit = /\bbumplimit *= *1\b/.test(scriptData);
+ threads[0].fileLimit = /\bimagelimit *= *1\b/.test(scriptData);
+ threads[0].ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : void 0;
+ }
+ Main.callbackNodes('Thread', threads);
+ return Main.callbackNodesDB('Post', posts, function() {
+ var l, len2, post;
+ for (l = 0, len2 = posts.length; l < len2; l++) {
+ post = posts[l];
+ QuoteThreading.insert(post);
+ }
+ Main.expectInitFinished = true;
+ return $.event('4chanXInitFinished');
+ });
+ } else {
+ Main.expectInitFinished = true;
+ return $.event('4chanXInitFinished');
+ }
+ },
+ callbackNodes: function(klass, nodes) {
+ var cb, i, node;
+ i = 0;
+ cb = Callbacks[klass];
+ while (node = nodes[i++]) {
+ cb.execute(node);
+ }
+ },
+ callbackNodesDB: function(klass, nodes, cb) {
+ var cbs, fn, i, softTask;
+ i = 0;
+ cbs = Callbacks[klass];
+ fn = function() {
+ var node;
+ if (!(node = nodes[i])) {
+ return false;
+ }
+ cbs.execute(node);
+ return ++i % 25;
+ };
+ softTask = function() {
+ while (fn()) {
+ continue;
+ }
+ if (!nodes[i]) {
+ if (cb) {
+ cb();
+ }
+ return;
+ }
+ return setTimeout(softTask, 0);
+ };
+ return softTask();
+ },
+ handleErrors: function(errors) {
+ var div, error, j, len, logs;
+ if (!(errors instanceof Array)) {
+ error = errors;
+ } else if (errors.length === 1) {
+ error = errors[0];
+ }
+ if (error) {
+ new Notice('error', Main.parseError(error, Main.reportLink([error])), 15);
+ return;
+ }
+ div = $.el('div', {
+ innerHTML: E(errors.length) + " errors occurred." + (Main.reportLink(errors)).innerHTML + " [
show ]"
+ });
+ $.on(div.lastElementChild, 'click', function() {
+ var ref;
+ return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref;
+ });
+ logs = $.el('div', {
+ hidden: true
+ });
+ for (j = 0, len = errors.length; j < len; j++) {
+ error = errors[j];
+ $.add(logs, Main.parseError(error));
+ }
+ return new Notice('error', [div, logs], 30);
+ },
+ parseError: function(data, reportLink) {
+ var context, error, lines, message, ref, ref1;
+ c.error(data.message, data.error.stack);
+ message = $.el('div', {
+ innerHTML: E(data.message) + ((reportLink) ? (reportLink).innerHTML : "")
+ });
+ error = $.el('div', {
+ textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details')
+ });
+ lines = ((ref = data.error.stack) != null ? (ref1 = ref.match(/\d+(?=:\d+\)?$)/mg)) != null ? ref1.join().replace(/^/, ' at ') : void 0 : void 0) || '';
+ context = $.el('div', {
+ textContent: "(4chan X ccd0 v" + g.VERSION + " " + $.platform + " on " + $.engine + lines + ")"
+ });
+ return [message, error, context];
+ },
+ reportLink: function(errors) {
+ var data, details, ref, title, url;
+ data = errors[0];
+ title = data.message;
+ if (errors.length > 1) {
+ title += " (+" + (errors.length - 1) + " other errors)";
+ }
+ details = "[Please describe the steps needed to reproduce this error.]\n\nScript: 4chan X ccd0 v" + g.VERSION + " " + $.platform + "\nUser agent: " + navigator.userAgent + "\nURL: " + location.href + "\n\n" + data.error + "\n" + (((ref = data.error.stack) != null ? ref.replace(data.error.toString(), '').trim() : void 0) || '');
+ details = details.replace(/file:\/{3}.+\//g, '');
+ url = "https://gitreports.com/issue/ccd0/4chan-x?issue_title=" + (encodeURIComponent(title)) + "&details=" + (encodeURIComponent(details));
+ return {
+ innerHTML: "
[report ] "
+ };
+ },
+ 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');
+ }
+ return Main.thisPageIsLegit;
+ },
+ ready: function(cb) {
+ return $.ready(function() {
+ if (Main.isThisPageLegit()) {
+ return cb();
+ }
+ });
+ },
+ features: [['Polyfill', Polyfill], ['Normalize URL', NormalizeURL], ['Captcha Configuration', Captcha.replace], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply Personas', QR.persona], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Edit Link', QR.oekaki.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash], ['Reply Pruning', ReplyPruning]]
+ };
+
+ return Main;
+
+}).call(this);
+
+Main.init();
}).call(this);
diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip
index 7a7755bd9..6e47d2b47 100644
Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ
diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml
index f4c66585a..c58daf9bf 100644
--- a/builds/updates-beta.xml
+++ b/builds/updates-beta.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/builds/updates.xml b/builds/updates.xml
index 2bfaf58ef..2c1fff346 100644
--- a/builds/updates.xml
+++ b/builds/updates.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/version.json b/version.json
index d43bfd70a..a6887bb95 100644
--- a/version.json
+++ b/version.json
@@ -1,4 +1,4 @@
{
- "version": "1.11.30.3",
- "date": "2016-04-09T12:47:17.251Z"
-}
+ "version": "1.11.31.0",
+ "date": "2016-04-21T07:02:56.784Z"
+}
\ No newline at end of file