Merge branch 'master' into zixaphir-merge

This commit is contained in:
ccd0 2015-02-03 01:50:01 -08:00
commit 8bc8530bea
15 changed files with 435 additions and 361 deletions

View File

@ -3,6 +3,11 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor
The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x). The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x).
<!-- v1.9.23.x --> <!-- v1.9.23.x -->
### v1.9.23.2
*2015-02-03* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.2/builds/4chan-X-noupdate.crx "Chromium version")]
- Fix custom navigation for unlisted board links (e.g. /qa/) and the 4chan Twitter link.
### v1.9.23.1 ### v1.9.23.1
*2015-02-02* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.1/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.1/builds/4chan-X-noupdate.crx "Chromium version")] *2015-02-02* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.1/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.1/builds/4chan-X-noupdate.crx "Chromium version")]

View File

@ -1,5 +1,5 @@
/* /*
* 4chan X - Version 1.9.23.1 * 4chan X - Version 1.9.23.2
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE * https://github.com/ccd0/4chan-x/blob/master/LICENSE

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.9.23.1 // @version 1.9.23.2
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.9.23.1 // @version 1.9.23.2
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -25,7 +25,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.9.23.1 * 4chan X - Version 1.9.23.2
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE * https://github.com/ccd0/4chan-x/blob/master/LICENSE
@ -402,7 +402,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.9.23.1', VERSION: '1.9.23.2',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
NAME: '4chan X', NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@ -2054,7 +2054,7 @@
Header = { Header = {
init: function() { init: function() {
var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler; var barFixedToggler, barPositionToggler, box, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler;
this.menu = new UI.Menu('header'); this.menu = new UI.Menu('header');
menuButton = $.el('span', { menuButton = $.el('span', {
className: 'menu-button' className: 'menu-button'
@ -2062,14 +2062,15 @@
$.extend(menuButton, { $.extend(menuButton, {
innerHTML: "<i></i>" innerHTML: "<i></i>"
}); });
barFixedToggler = UI.checkbox('Fixed Header', ' Fixed Header'); box = UI.checkbox;
headerToggler = UI.checkbox('Header auto-hide', ' Auto-hide header'); barFixedToggler = box('Fixed Header', 'Fixed Header');
scrollHeaderToggler = UI.checkbox('Header auto-hide on scroll', ' Auto-hide header on scroll'); headerToggler = box('Header auto-hide', 'Auto-hide header');
barPositionToggler = UI.checkbox('Bottom Header', ' Bottom header'); scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll');
linkJustifyToggler = UI.checkbox('Centered links', ' Centered links'); barPositionToggler = box('Bottom Header', 'Bottom header');
customNavToggler = UI.checkbox('Custom Board Navigation', ' Custom board navigation'); linkJustifyToggler = box('Centered links', 'Centered links');
footerToggler = UI.checkbox('Bottom Board List', ' Hide bottom board list'); customNavToggler = box('Custom Board Navigation', 'Custom board navigation');
shortcutToggler = UI.checkbox('Shortcut Icons', ' Shortcut Icons'); footerToggler = box('Bottom Board List', 'Hide bottom board list');
shortcutToggler = box('Shortcut Icons', 'Shortcut Icons');
editCustomNav = $.el('a', { editCustomNav = $.el('a', {
textContent: 'Edit custom board navigation', textContent: 'Edit custom board navigation',
href: 'javascript:;' href: 'javascript:;'
@ -2088,7 +2089,6 @@
$.on(this.barPositionToggler, 'change', this.toggleBarPosition); $.on(this.barPositionToggler, 'change', this.toggleBarPosition);
$.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll); $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll);
$.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify); $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify);
$.on(this.headerToggler, 'change', this.toggleBarVisibility);
$.on(this.footerToggler, 'change', this.toggleFooterVisibility); $.on(this.footerToggler, 'change', this.toggleFooterVisibility);
$.on(this.shortcutToggler, 'change', this.toggleShortcutIcons); $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons);
$.on(this.customNavToggler, 'change', this.toggleCustomNav); $.on(this.customNavToggler, 'change', this.toggleCustomNav);
@ -2265,7 +2265,7 @@
return $.sync('boardnav', Header.generateBoardList); return $.sync('boardnav', Header.generateBoardList);
}, },
generateBoardList: function(boardnav) { generateBoardList: function(boardnav) {
var as, list, nodes; var as, list, nodes, re, t;
list = $('#custom-board-list', Header.boardList); list = $('#custom-board-list', Header.boardList);
$.rmAll(list); $.rmAll(list);
if (!boardnav) { if (!boardnav) {
@ -2273,83 +2273,108 @@
} }
boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' '); boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' ');
as = $$('#full-board-list a[title]', Header.boardList); as = $$('#full-board-list a[title]', Header.boardList);
nodes = boardnav.match(/[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g).map(function(t) { re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
var a, aOrig, boardID, href, m, text, url, _i, _len; nodes = (function() {
if (/^[^\w@]/.test(t)) { var _i, _len, _ref, _results;
return $.tn(t); _ref = boardnav.match(re);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
t = _ref[_i];
_results.push(Header.mapCustomNavigation(t, as));
} }
text = url = null; return _results;
t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) { })();
text = m1;
url = m2;
return '';
});
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 = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0];
for (_i = 0, _len = as.length; _i < _len; _i++) {
aOrig = as[_i];
if (aOrig.textContent === boardID) {
a = aOrig.cloneNode(true);
}
}
if (!a) {
if (/^current/.test(t)) {
a = $.el('a', {
href: "/" + boardID + "/",
textContent: boardID
});
} else {
return $.tn(t);
}
}
a.textContent = /-title/.test(t) || /-replace/.test(t) && $.hasClass(a, 'current') ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text ? text : a.textContent;
if (m = t.match(/-(index|catalog)/)) {
a.dataset.only = m[1];
a.href = CatalogLinks[m[1]](boardID);
if (m[1] === 'catalog') {
$.addClass(a, 'catalog');
}
}
if (/-archive/.test(t)) {
if (href = Redirect.to('board', {
boardID: boardID
})) {
a.href = href;
} else {
return $.tn(a.textContent);
}
}
if (/-expired/.test(t)) {
if (boardID !== 'b' && boardID !== 'f') {
a.href = "/" + boardID + "/archive";
} else {
return $.tn(a.textContent);
}
}
if (boardID === '@') {
$.addClass(a, 'navSmall');
}
return a;
});
$.add(list, nodes); $.add(list, nodes);
return $.ready(CatalogLinks.initBoardList); return $.ready(CatalogLinks.initBoardList);
}, },
mapCustomNavigation: function(t, as) {
var a, boardID, href, 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 '';
});
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)/)) {
a.dataset.only = m[1];
a.href = CatalogLinks[m[1]](boardID);
if (m[1] === 'catalog') {
$.addClass(a, 'catalog');
}
}
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') {
a.href = "/" + boardID + "/archive";
} else {
return a.firstChild;
}
}
if (boardID === '@') {
$.addClass(a, 'navSmall');
}
return a;
},
toggleBoardList: function() { toggleBoardList: function() {
var bar, custom, full, showBoardList; var bar, custom, full, showBoardList;
bar = Header.bar; bar = Header.bar;
@ -2413,8 +2438,8 @@
toggleBarVisibility: function() { toggleBarVisibility: function() {
var hide, message; var hide, message;
hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
this.checked = hide; Conf['Header auto-hide'] = hide;
$.set('Header auto-hide', Conf['Header auto-hide'] = hide); $.set('Header auto-hide', hide);
Header.setBarVisibility(hide); Header.setBarVisibility(hide);
message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.'); message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.');
return new Notice('info', message, 2); return new Notice('info', message, 2);
@ -2489,7 +2514,7 @@
var settings; var settings;
Settings.open('Advanced'); Settings.open('Advanced');
settings = $.id('fourchanx-settings'); settings = $.id('fourchanx-settings');
return $('textarea[name=boardnav]', settings).focus(); return $('[name=boardnav]', settings).focus();
}, },
hashScroll: function() { hashScroll: function() {
var hash, post; var hash, post;
@ -2664,16 +2689,16 @@
}); });
Header.addShortcut(this.button, 1); Header.addShortcut(this.button, 1);
repliesEntry = { repliesEntry = {
el: UI.checkbox('Show Replies', ' Show replies') el: UI.checkbox('Show Replies', 'Show replies')
}; };
pinEntry = { pinEntry = {
el: UI.checkbox('Pin Watched Threads', ' Pin watched threads') el: UI.checkbox('Pin Watched Threads', 'Pin watched threads')
}; };
anchorEntry = { anchorEntry = {
el: UI.checkbox('Anchor Hidden Threads', ' Anchor hidden threads') el: UI.checkbox('Anchor Hidden Threads', 'Anchor hidden threads')
}; };
refNavEntry = { refNavEntry = {
el: UI.checkbox('Refreshed Navigation', ' Refreshed navigation') el: UI.checkbox('Refreshed Navigation', 'Refreshed navigation')
}; };
pinEntry.el.title = 'Move watched threads to the start of the index.'; pinEntry.el.title = 'Move watched threads to the start of the index.';
anchorEntry.el.title = 'Move hidden threads to the end of the index.'; anchorEntry.el.title = 'Move hidden threads to the end of the index.';
@ -4799,7 +4824,7 @@
name: name, name: name,
checked: checked checked: checked
}); });
$.add(label, [input, $.tn(text)]); $.add(label, [input, $.tn(" " + text)]);
return label; return label;
}; };
return { return {
@ -5274,9 +5299,9 @@
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(apply, 'click', PostHiding.menu.hide); $.on(apply, 'click', PostHiding.menu.hide);
thisPost = UI.checkbox('thisPost', ' This post', true); thisPost = UI.checkbox('thisPost', 'This post', true);
replies = UI.checkbox('replies', ' Hide replies', Conf['Recursive Hiding']); replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']);
makeStub = UI.checkbox('makeStub', ' Make stub', Conf['Stubs']); makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']);
Menu.menu.addEntry({ Menu.menu.addEntry({
el: div, el: div,
order: 20, order: 20,
@ -5308,8 +5333,8 @@
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(apply, 'click', PostHiding.menu.show); $.on(apply, 'click', PostHiding.menu.show);
thisPost = UI.checkbox('thisPost', ' This post', false); thisPost = UI.checkbox('thisPost', 'This post', false);
replies = UI.checkbox('replies', ' Show replies', false); replies = UI.checkbox('replies', 'Show replies', false);
hideStubLink = $.el('a', { hideStubLink = $.el('a', {
textContent: 'Hide stub', textContent: 'Hide stub',
href: 'javascript:;' href: 'javascript:;'
@ -5682,7 +5707,7 @@
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(apply, 'click', ThreadHiding.menu.hide); $.on(apply, 'click', ThreadHiding.menu.hide);
makeStub = UI.checkbox('Stubs', ' Make stub'); makeStub = UI.checkbox('Stubs', 'Make stub');
Menu.menu.addEntry({ Menu.menu.addEntry({
el: div, el: div,
order: 20, order: 20,
@ -8828,7 +8853,7 @@
continue; continue;
} }
lc = type.toLowerCase(); lc = type.toLowerCase();
el = UI.checkbox(lc, " " + type + " Tyme", false); el = UI.checkbox(lc, "" + type + " Tyme", false);
el.title = "" + type + " Tyme"; el.title = "" + type + " Tyme";
this.nodes[lc] = el.firstElementChild; this.nodes[lc] = el.firstElementChild;
if (Conf[lc]) { if (Conf[lc]) {
@ -9288,7 +9313,7 @@
}, },
createSubEntry: function(name) { createSubEntry: function(name) {
var input, label; var input, label;
label = UI.checkbox(name, " " + name); label = UI.checkbox(name, name);
input = label.firstElementChild; input = label.firstElementChild;
if (name === 'Fit Width' || name === 'Fit Height' || name === 'Hide Thumbnails') { if (name === 'Fit Width' || name === 'Fit Height' || name === 'Hide Thumbnails') {
$.on(input, 'change', Gallery.cb.setFitness); $.on(input, 'change', Gallery.cb.setFitness);
@ -9845,7 +9870,7 @@
}, },
createSubEntry: function(name, desc) { createSubEntry: function(name, desc) {
var input, label; var input, label;
label = UI.checkbox(name, " " + name); label = UI.checkbox(name, name);
label.title = desc; label.title = desc;
input = label.firstElementChild; input = label.firstElementChild;
if (name === 'Fit width' || name === 'Fit height') { if (name === 'Fit width' || name === 'Fit height') {
@ -10374,7 +10399,7 @@
if ((_ref1 = g.BOARD.ID) !== 'gif' && _ref1 !== 'wsg') { if ((_ref1 = g.BOARD.ID) !== 'gif' && _ref1 !== 'wsg') {
return; return;
} }
unmuteEntry = UI.checkbox('Allow Sound', ' Allow Sound'); unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound');
unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]; unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1];
volumeEntry = $.el('label', { volumeEntry = $.el('label', {
title: 'Default volume for videos.' title: 'Default volume for videos.'
@ -11851,7 +11876,7 @@
_ref = Config.updater.checkbox; _ref = Config.updater.checkbox;
for (name in _ref) { for (name in _ref) {
conf = _ref[name]; conf = _ref[name];
el = UI.checkbox(name, " " + name); el = UI.checkbox(name, name);
el.title = conf[1]; el.title = conf[1];
input = el.firstElementChild; input = el.firstElementChild;
$.on(input, 'change', $.cb.checked); $.on(input, 'change', $.cb.checked);
@ -12902,7 +12927,7 @@
var entry, input; var entry, input;
entry = { entry = {
type: 'thread watcher', type: 'thread watcher',
el: UI.checkbox(name, " " + (name.replace(' Thread Watcher', ''))) el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
}; };
entry.el.title = desc; entry.el.title = desc;
input = entry.el.firstElementChild; input = entry.el.firstElementChild;
@ -13620,7 +13645,7 @@
}); });
} }
if (Conf['Catalog Links']) { if (Conf['Catalog Links']) {
CatalogLinks.el = el = UI.checkbox('Header catalog links', ' Catalog Links'); CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links');
el.id = 'toggleCatalog'; el.id = 'toggleCatalog';
input = $('input', el); input = $('input', el);
$.on(input, 'change', this.toggle); $.on(input, 'change', this.toggle);
@ -15173,13 +15198,9 @@
for (key in obj) { for (key in obj) {
arr = obj[key]; arr = obj[key];
description = arr[1]; description = arr[1];
div = $.el('div'); div = $.el('div', {
$.add(div, [ innerHTML: "<label><input type=\"checkbox\" name=\"" + E(key) + "\">" + E(key) + "</label><span class=\"description\">: " + E(description) + "</span>"
UI.checkbox(key, key, false), $.el('span', { });
"class": 'description',
textContent: ": " + description
})
]);
input = $('input', div); input = $('input', div);
$.on(input, 'change', $.cb.checked); $.on(input, 'change', $.cb.checked);
$.on(input, 'change', function() { $.on(input, 'change', function() {

Binary file not shown.

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.9.23.1 // @version 1.9.23.2
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -24,7 +24,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.9.23.1 * 4chan X - Version 1.9.23.2
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE * https://github.com/ccd0/4chan-x/blob/master/LICENSE
@ -401,7 +401,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.9.23.1', VERSION: '1.9.23.2',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
NAME: '4chan X', NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@ -2053,7 +2053,7 @@
Header = { Header = {
init: function() { init: function() {
var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler; var barFixedToggler, barPositionToggler, box, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler;
this.menu = new UI.Menu('header'); this.menu = new UI.Menu('header');
menuButton = $.el('span', { menuButton = $.el('span', {
className: 'menu-button' className: 'menu-button'
@ -2061,14 +2061,15 @@
$.extend(menuButton, { $.extend(menuButton, {
innerHTML: "<i></i>" innerHTML: "<i></i>"
}); });
barFixedToggler = UI.checkbox('Fixed Header', ' Fixed Header'); box = UI.checkbox;
headerToggler = UI.checkbox('Header auto-hide', ' Auto-hide header'); barFixedToggler = box('Fixed Header', 'Fixed Header');
scrollHeaderToggler = UI.checkbox('Header auto-hide on scroll', ' Auto-hide header on scroll'); headerToggler = box('Header auto-hide', 'Auto-hide header');
barPositionToggler = UI.checkbox('Bottom Header', ' Bottom header'); scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll');
linkJustifyToggler = UI.checkbox('Centered links', ' Centered links'); barPositionToggler = box('Bottom Header', 'Bottom header');
customNavToggler = UI.checkbox('Custom Board Navigation', ' Custom board navigation'); linkJustifyToggler = box('Centered links', 'Centered links');
footerToggler = UI.checkbox('Bottom Board List', ' Hide bottom board list'); customNavToggler = box('Custom Board Navigation', 'Custom board navigation');
shortcutToggler = UI.checkbox('Shortcut Icons', ' Shortcut Icons'); footerToggler = box('Bottom Board List', 'Hide bottom board list');
shortcutToggler = box('Shortcut Icons', 'Shortcut Icons');
editCustomNav = $.el('a', { editCustomNav = $.el('a', {
textContent: 'Edit custom board navigation', textContent: 'Edit custom board navigation',
href: 'javascript:;' href: 'javascript:;'
@ -2087,7 +2088,6 @@
$.on(this.barPositionToggler, 'change', this.toggleBarPosition); $.on(this.barPositionToggler, 'change', this.toggleBarPosition);
$.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll); $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll);
$.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify); $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify);
$.on(this.headerToggler, 'change', this.toggleBarVisibility);
$.on(this.footerToggler, 'change', this.toggleFooterVisibility); $.on(this.footerToggler, 'change', this.toggleFooterVisibility);
$.on(this.shortcutToggler, 'change', this.toggleShortcutIcons); $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons);
$.on(this.customNavToggler, 'change', this.toggleCustomNav); $.on(this.customNavToggler, 'change', this.toggleCustomNav);
@ -2264,7 +2264,7 @@
return $.sync('boardnav', Header.generateBoardList); return $.sync('boardnav', Header.generateBoardList);
}, },
generateBoardList: function(boardnav) { generateBoardList: function(boardnav) {
var as, list, nodes; var as, list, nodes, re, t;
list = $('#custom-board-list', Header.boardList); list = $('#custom-board-list', Header.boardList);
$.rmAll(list); $.rmAll(list);
if (!boardnav) { if (!boardnav) {
@ -2272,83 +2272,108 @@
} }
boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' '); boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' ');
as = $$('#full-board-list a[title]', Header.boardList); as = $$('#full-board-list a[title]', Header.boardList);
nodes = boardnav.match(/[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g).map(function(t) { re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
var a, aOrig, boardID, href, m, text, url, _i, _len; nodes = (function() {
if (/^[^\w@]/.test(t)) { var _i, _len, _ref, _results;
return $.tn(t); _ref = boardnav.match(re);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
t = _ref[_i];
_results.push(Header.mapCustomNavigation(t, as));
} }
text = url = null; return _results;
t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) { })();
text = m1;
url = m2;
return '';
});
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 = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0];
for (_i = 0, _len = as.length; _i < _len; _i++) {
aOrig = as[_i];
if (aOrig.textContent === boardID) {
a = aOrig.cloneNode(true);
}
}
if (!a) {
if (/^current/.test(t)) {
a = $.el('a', {
href: "/" + boardID + "/",
textContent: boardID
});
} else {
return $.tn(t);
}
}
a.textContent = /-title/.test(t) || /-replace/.test(t) && $.hasClass(a, 'current') ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text ? text : a.textContent;
if (m = t.match(/-(index|catalog)/)) {
a.dataset.only = m[1];
a.href = CatalogLinks[m[1]](boardID);
if (m[1] === 'catalog') {
$.addClass(a, 'catalog');
}
}
if (/-archive/.test(t)) {
if (href = Redirect.to('board', {
boardID: boardID
})) {
a.href = href;
} else {
return $.tn(a.textContent);
}
}
if (/-expired/.test(t)) {
if (boardID !== 'b' && boardID !== 'f') {
a.href = "/" + boardID + "/archive";
} else {
return $.tn(a.textContent);
}
}
if (boardID === '@') {
$.addClass(a, 'navSmall');
}
return a;
});
$.add(list, nodes); $.add(list, nodes);
return $.ready(CatalogLinks.initBoardList); return $.ready(CatalogLinks.initBoardList);
}, },
mapCustomNavigation: function(t, as) {
var a, boardID, href, 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 '';
});
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)/)) {
a.dataset.only = m[1];
a.href = CatalogLinks[m[1]](boardID);
if (m[1] === 'catalog') {
$.addClass(a, 'catalog');
}
}
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') {
a.href = "/" + boardID + "/archive";
} else {
return a.firstChild;
}
}
if (boardID === '@') {
$.addClass(a, 'navSmall');
}
return a;
},
toggleBoardList: function() { toggleBoardList: function() {
var bar, custom, full, showBoardList; var bar, custom, full, showBoardList;
bar = Header.bar; bar = Header.bar;
@ -2412,8 +2437,8 @@
toggleBarVisibility: function() { toggleBarVisibility: function() {
var hide, message; var hide, message;
hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
this.checked = hide; Conf['Header auto-hide'] = hide;
$.set('Header auto-hide', Conf['Header auto-hide'] = hide); $.set('Header auto-hide', hide);
Header.setBarVisibility(hide); Header.setBarVisibility(hide);
message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.'); message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.');
return new Notice('info', message, 2); return new Notice('info', message, 2);
@ -2488,7 +2513,7 @@
var settings; var settings;
Settings.open('Advanced'); Settings.open('Advanced');
settings = $.id('fourchanx-settings'); settings = $.id('fourchanx-settings');
return $('textarea[name=boardnav]', settings).focus(); return $('[name=boardnav]', settings).focus();
}, },
hashScroll: function() { hashScroll: function() {
var hash, post; var hash, post;
@ -2663,16 +2688,16 @@
}); });
Header.addShortcut(this.button, 1); Header.addShortcut(this.button, 1);
repliesEntry = { repliesEntry = {
el: UI.checkbox('Show Replies', ' Show replies') el: UI.checkbox('Show Replies', 'Show replies')
}; };
pinEntry = { pinEntry = {
el: UI.checkbox('Pin Watched Threads', ' Pin watched threads') el: UI.checkbox('Pin Watched Threads', 'Pin watched threads')
}; };
anchorEntry = { anchorEntry = {
el: UI.checkbox('Anchor Hidden Threads', ' Anchor hidden threads') el: UI.checkbox('Anchor Hidden Threads', 'Anchor hidden threads')
}; };
refNavEntry = { refNavEntry = {
el: UI.checkbox('Refreshed Navigation', ' Refreshed navigation') el: UI.checkbox('Refreshed Navigation', 'Refreshed navigation')
}; };
pinEntry.el.title = 'Move watched threads to the start of the index.'; pinEntry.el.title = 'Move watched threads to the start of the index.';
anchorEntry.el.title = 'Move hidden threads to the end of the index.'; anchorEntry.el.title = 'Move hidden threads to the end of the index.';
@ -4798,7 +4823,7 @@
name: name, name: name,
checked: checked checked: checked
}); });
$.add(label, [input, $.tn(text)]); $.add(label, [input, $.tn(" " + text)]);
return label; return label;
}; };
return { return {
@ -5273,9 +5298,9 @@
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(apply, 'click', PostHiding.menu.hide); $.on(apply, 'click', PostHiding.menu.hide);
thisPost = UI.checkbox('thisPost', ' This post', true); thisPost = UI.checkbox('thisPost', 'This post', true);
replies = UI.checkbox('replies', ' Hide replies', Conf['Recursive Hiding']); replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']);
makeStub = UI.checkbox('makeStub', ' Make stub', Conf['Stubs']); makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']);
Menu.menu.addEntry({ Menu.menu.addEntry({
el: div, el: div,
order: 20, order: 20,
@ -5307,8 +5332,8 @@
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(apply, 'click', PostHiding.menu.show); $.on(apply, 'click', PostHiding.menu.show);
thisPost = UI.checkbox('thisPost', ' This post', false); thisPost = UI.checkbox('thisPost', 'This post', false);
replies = UI.checkbox('replies', ' Show replies', false); replies = UI.checkbox('replies', 'Show replies', false);
hideStubLink = $.el('a', { hideStubLink = $.el('a', {
textContent: 'Hide stub', textContent: 'Hide stub',
href: 'javascript:;' href: 'javascript:;'
@ -5681,7 +5706,7 @@
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(apply, 'click', ThreadHiding.menu.hide); $.on(apply, 'click', ThreadHiding.menu.hide);
makeStub = UI.checkbox('Stubs', ' Make stub'); makeStub = UI.checkbox('Stubs', 'Make stub');
Menu.menu.addEntry({ Menu.menu.addEntry({
el: div, el: div,
order: 20, order: 20,
@ -8827,7 +8852,7 @@
continue; continue;
} }
lc = type.toLowerCase(); lc = type.toLowerCase();
el = UI.checkbox(lc, " " + type + " Tyme", false); el = UI.checkbox(lc, "" + type + " Tyme", false);
el.title = "" + type + " Tyme"; el.title = "" + type + " Tyme";
this.nodes[lc] = el.firstElementChild; this.nodes[lc] = el.firstElementChild;
if (Conf[lc]) { if (Conf[lc]) {
@ -9287,7 +9312,7 @@
}, },
createSubEntry: function(name) { createSubEntry: function(name) {
var input, label; var input, label;
label = UI.checkbox(name, " " + name); label = UI.checkbox(name, name);
input = label.firstElementChild; input = label.firstElementChild;
if (name === 'Fit Width' || name === 'Fit Height' || name === 'Hide Thumbnails') { if (name === 'Fit Width' || name === 'Fit Height' || name === 'Hide Thumbnails') {
$.on(input, 'change', Gallery.cb.setFitness); $.on(input, 'change', Gallery.cb.setFitness);
@ -9844,7 +9869,7 @@
}, },
createSubEntry: function(name, desc) { createSubEntry: function(name, desc) {
var input, label; var input, label;
label = UI.checkbox(name, " " + name); label = UI.checkbox(name, name);
label.title = desc; label.title = desc;
input = label.firstElementChild; input = label.firstElementChild;
if (name === 'Fit width' || name === 'Fit height') { if (name === 'Fit width' || name === 'Fit height') {
@ -10373,7 +10398,7 @@
if ((_ref1 = g.BOARD.ID) !== 'gif' && _ref1 !== 'wsg') { if ((_ref1 = g.BOARD.ID) !== 'gif' && _ref1 !== 'wsg') {
return; return;
} }
unmuteEntry = UI.checkbox('Allow Sound', ' Allow Sound'); unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound');
unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]; unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1];
volumeEntry = $.el('label', { volumeEntry = $.el('label', {
title: 'Default volume for videos.' title: 'Default volume for videos.'
@ -11850,7 +11875,7 @@
_ref = Config.updater.checkbox; _ref = Config.updater.checkbox;
for (name in _ref) { for (name in _ref) {
conf = _ref[name]; conf = _ref[name];
el = UI.checkbox(name, " " + name); el = UI.checkbox(name, name);
el.title = conf[1]; el.title = conf[1];
input = el.firstElementChild; input = el.firstElementChild;
$.on(input, 'change', $.cb.checked); $.on(input, 'change', $.cb.checked);
@ -12901,7 +12926,7 @@
var entry, input; var entry, input;
entry = { entry = {
type: 'thread watcher', type: 'thread watcher',
el: UI.checkbox(name, " " + (name.replace(' Thread Watcher', ''))) el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
}; };
entry.el.title = desc; entry.el.title = desc;
input = entry.el.firstElementChild; input = entry.el.firstElementChild;
@ -13619,7 +13644,7 @@
}); });
} }
if (Conf['Catalog Links']) { if (Conf['Catalog Links']) {
CatalogLinks.el = el = UI.checkbox('Header catalog links', ' Catalog Links'); CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links');
el.id = 'toggleCatalog'; el.id = 'toggleCatalog';
input = $('input', el); input = $('input', el);
$.on(input, 'change', this.toggle); $.on(input, 'change', this.toggle);
@ -15172,13 +15197,9 @@
for (key in obj) { for (key in obj) {
arr = obj[key]; arr = obj[key];
description = arr[1]; description = arr[1];
div = $.el('div'); div = $.el('div', {
$.add(div, [ innerHTML: "<label><input type=\"checkbox\" name=\"" + E(key) + "\">" + E(key) + "</label><span class=\"description\">: " + E(description) + "</span>"
UI.checkbox(key, key, false), $.el('span', { });
"class": 'description',
textContent: ": " + description
})
]);
input = $('input', div); input = $('input', div);
$.on(input, 'change', $.cb.checked); $.on(input, 'change', $.cb.checked);
$.on(input, 'change', function() { $.on(input, 'change', function() {

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.9.23.1 // @version 1.9.23.2
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript // Generated by CoffeeScript
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.9.23.1 // @version 1.9.23.2
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -25,7 +25,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.9.23.1 * 4chan X - Version 1.9.23.2
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE * https://github.com/ccd0/4chan-x/blob/master/LICENSE
@ -402,7 +402,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.9.23.1', VERSION: '1.9.23.2',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
NAME: '4chan X', NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@ -2054,7 +2054,7 @@
Header = { Header = {
init: function() { init: function() {
var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler; var barFixedToggler, barPositionToggler, box, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler;
this.menu = new UI.Menu('header'); this.menu = new UI.Menu('header');
menuButton = $.el('span', { menuButton = $.el('span', {
className: 'menu-button' className: 'menu-button'
@ -2062,14 +2062,15 @@
$.extend(menuButton, { $.extend(menuButton, {
innerHTML: "<i></i>" innerHTML: "<i></i>"
}); });
barFixedToggler = UI.checkbox('Fixed Header', ' Fixed Header'); box = UI.checkbox;
headerToggler = UI.checkbox('Header auto-hide', ' Auto-hide header'); barFixedToggler = box('Fixed Header', 'Fixed Header');
scrollHeaderToggler = UI.checkbox('Header auto-hide on scroll', ' Auto-hide header on scroll'); headerToggler = box('Header auto-hide', 'Auto-hide header');
barPositionToggler = UI.checkbox('Bottom Header', ' Bottom header'); scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll');
linkJustifyToggler = UI.checkbox('Centered links', ' Centered links'); barPositionToggler = box('Bottom Header', 'Bottom header');
customNavToggler = UI.checkbox('Custom Board Navigation', ' Custom board navigation'); linkJustifyToggler = box('Centered links', 'Centered links');
footerToggler = UI.checkbox('Bottom Board List', ' Hide bottom board list'); customNavToggler = box('Custom Board Navigation', 'Custom board navigation');
shortcutToggler = UI.checkbox('Shortcut Icons', ' Shortcut Icons'); footerToggler = box('Bottom Board List', 'Hide bottom board list');
shortcutToggler = box('Shortcut Icons', 'Shortcut Icons');
editCustomNav = $.el('a', { editCustomNav = $.el('a', {
textContent: 'Edit custom board navigation', textContent: 'Edit custom board navigation',
href: 'javascript:;' href: 'javascript:;'
@ -2088,7 +2089,6 @@
$.on(this.barPositionToggler, 'change', this.toggleBarPosition); $.on(this.barPositionToggler, 'change', this.toggleBarPosition);
$.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll); $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll);
$.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify); $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify);
$.on(this.headerToggler, 'change', this.toggleBarVisibility);
$.on(this.footerToggler, 'change', this.toggleFooterVisibility); $.on(this.footerToggler, 'change', this.toggleFooterVisibility);
$.on(this.shortcutToggler, 'change', this.toggleShortcutIcons); $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons);
$.on(this.customNavToggler, 'change', this.toggleCustomNav); $.on(this.customNavToggler, 'change', this.toggleCustomNav);
@ -2265,7 +2265,7 @@
return $.sync('boardnav', Header.generateBoardList); return $.sync('boardnav', Header.generateBoardList);
}, },
generateBoardList: function(boardnav) { generateBoardList: function(boardnav) {
var as, list, nodes; var as, list, nodes, re, t;
list = $('#custom-board-list', Header.boardList); list = $('#custom-board-list', Header.boardList);
$.rmAll(list); $.rmAll(list);
if (!boardnav) { if (!boardnav) {
@ -2273,83 +2273,108 @@
} }
boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' '); boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' ');
as = $$('#full-board-list a[title]', Header.boardList); as = $$('#full-board-list a[title]', Header.boardList);
nodes = boardnav.match(/[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g).map(function(t) { re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g;
var a, aOrig, boardID, href, m, text, url, _i, _len; nodes = (function() {
if (/^[^\w@]/.test(t)) { var _i, _len, _ref, _results;
return $.tn(t); _ref = boardnav.match(re);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
t = _ref[_i];
_results.push(Header.mapCustomNavigation(t, as));
} }
text = url = null; return _results;
t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) { })();
text = m1;
url = m2;
return '';
});
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 = /^current/.test(t) ? g.BOARD.ID : t.match(/^[^-]+/)[0];
for (_i = 0, _len = as.length; _i < _len; _i++) {
aOrig = as[_i];
if (aOrig.textContent === boardID) {
a = aOrig.cloneNode(true);
}
}
if (!a) {
if (/^current/.test(t)) {
a = $.el('a', {
href: "/" + boardID + "/",
textContent: boardID
});
} else {
return $.tn(t);
}
}
a.textContent = /-title/.test(t) || /-replace/.test(t) && $.hasClass(a, 'current') ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text ? text : a.textContent;
if (m = t.match(/-(index|catalog)/)) {
a.dataset.only = m[1];
a.href = CatalogLinks[m[1]](boardID);
if (m[1] === 'catalog') {
$.addClass(a, 'catalog');
}
}
if (/-archive/.test(t)) {
if (href = Redirect.to('board', {
boardID: boardID
})) {
a.href = href;
} else {
return $.tn(a.textContent);
}
}
if (/-expired/.test(t)) {
if (boardID !== 'b' && boardID !== 'f') {
a.href = "/" + boardID + "/archive";
} else {
return $.tn(a.textContent);
}
}
if (boardID === '@') {
$.addClass(a, 'navSmall');
}
return a;
});
$.add(list, nodes); $.add(list, nodes);
return $.ready(CatalogLinks.initBoardList); return $.ready(CatalogLinks.initBoardList);
}, },
mapCustomNavigation: function(t, as) {
var a, boardID, href, 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 '';
});
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)/)) {
a.dataset.only = m[1];
a.href = CatalogLinks[m[1]](boardID);
if (m[1] === 'catalog') {
$.addClass(a, 'catalog');
}
}
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') {
a.href = "/" + boardID + "/archive";
} else {
return a.firstChild;
}
}
if (boardID === '@') {
$.addClass(a, 'navSmall');
}
return a;
},
toggleBoardList: function() { toggleBoardList: function() {
var bar, custom, full, showBoardList; var bar, custom, full, showBoardList;
bar = Header.bar; bar = Header.bar;
@ -2413,8 +2438,8 @@
toggleBarVisibility: function() { toggleBarVisibility: function() {
var hide, message; var hide, message;
hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide');
this.checked = hide; Conf['Header auto-hide'] = hide;
$.set('Header auto-hide', Conf['Header auto-hide'] = hide); $.set('Header auto-hide', hide);
Header.setBarVisibility(hide); Header.setBarVisibility(hide);
message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.'); message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.');
return new Notice('info', message, 2); return new Notice('info', message, 2);
@ -2489,7 +2514,7 @@
var settings; var settings;
Settings.open('Advanced'); Settings.open('Advanced');
settings = $.id('fourchanx-settings'); settings = $.id('fourchanx-settings');
return $('textarea[name=boardnav]', settings).focus(); return $('[name=boardnav]', settings).focus();
}, },
hashScroll: function() { hashScroll: function() {
var hash, post; var hash, post;
@ -2664,16 +2689,16 @@
}); });
Header.addShortcut(this.button, 1); Header.addShortcut(this.button, 1);
repliesEntry = { repliesEntry = {
el: UI.checkbox('Show Replies', ' Show replies') el: UI.checkbox('Show Replies', 'Show replies')
}; };
pinEntry = { pinEntry = {
el: UI.checkbox('Pin Watched Threads', ' Pin watched threads') el: UI.checkbox('Pin Watched Threads', 'Pin watched threads')
}; };
anchorEntry = { anchorEntry = {
el: UI.checkbox('Anchor Hidden Threads', ' Anchor hidden threads') el: UI.checkbox('Anchor Hidden Threads', 'Anchor hidden threads')
}; };
refNavEntry = { refNavEntry = {
el: UI.checkbox('Refreshed Navigation', ' Refreshed navigation') el: UI.checkbox('Refreshed Navigation', 'Refreshed navigation')
}; };
pinEntry.el.title = 'Move watched threads to the start of the index.'; pinEntry.el.title = 'Move watched threads to the start of the index.';
anchorEntry.el.title = 'Move hidden threads to the end of the index.'; anchorEntry.el.title = 'Move hidden threads to the end of the index.';
@ -4799,7 +4824,7 @@
name: name, name: name,
checked: checked checked: checked
}); });
$.add(label, [input, $.tn(text)]); $.add(label, [input, $.tn(" " + text)]);
return label; return label;
}; };
return { return {
@ -5274,9 +5299,9 @@
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(apply, 'click', PostHiding.menu.hide); $.on(apply, 'click', PostHiding.menu.hide);
thisPost = UI.checkbox('thisPost', ' This post', true); thisPost = UI.checkbox('thisPost', 'This post', true);
replies = UI.checkbox('replies', ' Hide replies', Conf['Recursive Hiding']); replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']);
makeStub = UI.checkbox('makeStub', ' Make stub', Conf['Stubs']); makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']);
Menu.menu.addEntry({ Menu.menu.addEntry({
el: div, el: div,
order: 20, order: 20,
@ -5308,8 +5333,8 @@
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(apply, 'click', PostHiding.menu.show); $.on(apply, 'click', PostHiding.menu.show);
thisPost = UI.checkbox('thisPost', ' This post', false); thisPost = UI.checkbox('thisPost', 'This post', false);
replies = UI.checkbox('replies', ' Show replies', false); replies = UI.checkbox('replies', 'Show replies', false);
hideStubLink = $.el('a', { hideStubLink = $.el('a', {
textContent: 'Hide stub', textContent: 'Hide stub',
href: 'javascript:;' href: 'javascript:;'
@ -5682,7 +5707,7 @@
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(apply, 'click', ThreadHiding.menu.hide); $.on(apply, 'click', ThreadHiding.menu.hide);
makeStub = UI.checkbox('Stubs', ' Make stub'); makeStub = UI.checkbox('Stubs', 'Make stub');
Menu.menu.addEntry({ Menu.menu.addEntry({
el: div, el: div,
order: 20, order: 20,
@ -8828,7 +8853,7 @@
continue; continue;
} }
lc = type.toLowerCase(); lc = type.toLowerCase();
el = UI.checkbox(lc, " " + type + " Tyme", false); el = UI.checkbox(lc, "" + type + " Tyme", false);
el.title = "" + type + " Tyme"; el.title = "" + type + " Tyme";
this.nodes[lc] = el.firstElementChild; this.nodes[lc] = el.firstElementChild;
if (Conf[lc]) { if (Conf[lc]) {
@ -9288,7 +9313,7 @@
}, },
createSubEntry: function(name) { createSubEntry: function(name) {
var input, label; var input, label;
label = UI.checkbox(name, " " + name); label = UI.checkbox(name, name);
input = label.firstElementChild; input = label.firstElementChild;
if (name === 'Fit Width' || name === 'Fit Height' || name === 'Hide Thumbnails') { if (name === 'Fit Width' || name === 'Fit Height' || name === 'Hide Thumbnails') {
$.on(input, 'change', Gallery.cb.setFitness); $.on(input, 'change', Gallery.cb.setFitness);
@ -9845,7 +9870,7 @@
}, },
createSubEntry: function(name, desc) { createSubEntry: function(name, desc) {
var input, label; var input, label;
label = UI.checkbox(name, " " + name); label = UI.checkbox(name, name);
label.title = desc; label.title = desc;
input = label.firstElementChild; input = label.firstElementChild;
if (name === 'Fit width' || name === 'Fit height') { if (name === 'Fit width' || name === 'Fit height') {
@ -10374,7 +10399,7 @@
if ((_ref1 = g.BOARD.ID) !== 'gif' && _ref1 !== 'wsg') { if ((_ref1 = g.BOARD.ID) !== 'gif' && _ref1 !== 'wsg') {
return; return;
} }
unmuteEntry = UI.checkbox('Allow Sound', ' Allow Sound'); unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound');
unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]; unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1];
volumeEntry = $.el('label', { volumeEntry = $.el('label', {
title: 'Default volume for videos.' title: 'Default volume for videos.'
@ -11851,7 +11876,7 @@
_ref = Config.updater.checkbox; _ref = Config.updater.checkbox;
for (name in _ref) { for (name in _ref) {
conf = _ref[name]; conf = _ref[name];
el = UI.checkbox(name, " " + name); el = UI.checkbox(name, name);
el.title = conf[1]; el.title = conf[1];
input = el.firstElementChild; input = el.firstElementChild;
$.on(input, 'change', $.cb.checked); $.on(input, 'change', $.cb.checked);
@ -12902,7 +12927,7 @@
var entry, input; var entry, input;
entry = { entry = {
type: 'thread watcher', type: 'thread watcher',
el: UI.checkbox(name, " " + (name.replace(' Thread Watcher', ''))) el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
}; };
entry.el.title = desc; entry.el.title = desc;
input = entry.el.firstElementChild; input = entry.el.firstElementChild;
@ -13620,7 +13645,7 @@
}); });
} }
if (Conf['Catalog Links']) { if (Conf['Catalog Links']) {
CatalogLinks.el = el = UI.checkbox('Header catalog links', ' Catalog Links'); CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links');
el.id = 'toggleCatalog'; el.id = 'toggleCatalog';
input = $('input', el); input = $('input', el);
$.on(input, 'change', this.toggle); $.on(input, 'change', this.toggle);
@ -15173,13 +15198,9 @@
for (key in obj) { for (key in obj) {
arr = obj[key]; arr = obj[key];
description = arr[1]; description = arr[1];
div = $.el('div'); div = $.el('div', {
$.add(div, [ innerHTML: "<label><input type=\"checkbox\" name=\"" + E(key) + "\">" + E(key) + "</label><span class=\"description\">: " + E(description) + "</span>"
UI.checkbox(key, key, false), $.el('span', { });
"class": 'description',
textContent: ": " + description
})
]);
input = $('input', div); input = $('input', div);
$.on(input, 'change', $.cb.checked); $.on(input, 'change', $.cb.checked);
$.on(input, 'change', function() { $.on(input, 'change', function() {

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'> <app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.9.23.1' /> <updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.9.23.2' />
</app> </app>
</gupdate> </gupdate>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'> <app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.9.23.1' /> <updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.9.23.2' />
</app> </app>
</gupdate> </gupdate>

View File

@ -3,7 +3,7 @@
"description": "Cross-browser userscript for maximum lurking on 4chan.", "description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": { "meta": {
"name": "4chan X", "name": "4chan X",
"version": "1.9.23.1", "version": "1.9.23.2",
"repo": "https://github.com/ccd0/4chan-x/", "repo": "https://github.com/ccd0/4chan-x/",
"page": "https://github.com/ccd0/4chan-x", "page": "https://github.com/ccd0/4chan-x",
"downloads": "https://ccd0.github.io/4chan-x/builds/", "downloads": "https://ccd0.github.io/4chan-x/builds/",

View File

@ -220,16 +220,22 @@ Header =
boardID = t.split('-')[0] boardID = t.split('-')[0]
boardID = g.BOARD.ID if boardID is 'current' boardID = g.BOARD.ID if boardID is 'current'
for aOrig in as a = do ->
if aOrig.textContent is boardID if boardID is '@'
a = aOrig.cloneNode true return $.el 'a',
if !a href: 'https://twitter.com/4chan'
if /^current/.test t title: '4chan Twitter'
a = $.el 'a', textContent: '@'
href: "/#{boardID}/"
textContent: boardID for a in as when a.textContent is boardID
else return a.cloneNode true
return $.tn t
a = $.el 'a',
href: "/#{boardID}/"
textContent: boardID
a.href += g.VIEW if g.VIEW in ['catalog', 'archive']
a.className = 'current' if boardID is g.BOARD.ID
a
a.textContent = if /-title/.test(t) or /-replace/.test(t) and boardID is g.BOARD.ID a.textContent = if /-title/.test(t) or /-replace/.test(t) and boardID is g.BOARD.ID
a.title or a.textContent a.title or a.textContent