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).
<!-- 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
*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.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE

Binary file not shown.

View File

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

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

View File

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

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<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>
</gupdate>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<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>
</gupdate>

View File

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

View File

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