commit
815bd5e0b7
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* appchan x - Version 2.10.4 - 2015-01-24
|
||||
* appchan x - Version 2.10.4 - 2015-01-26
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
// ==/UserScript==
|
||||
|
||||
/*
|
||||
* appchan x - Version 2.10.4 - 2015-01-24
|
||||
* appchan x - Version 2.10.4 - 2015-01-26
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||
@ -163,7 +163,8 @@
|
||||
'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'],
|
||||
'Show Support Message': [true, 'Warn if your browser is unsupported. appchan x may not operate correctly on unsupported browser versions.'],
|
||||
'Normalize URL': [true, 'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'],
|
||||
'Announcement Hiding': [true, 'Enable announcements to be hidden.']
|
||||
'Announcement Hiding': [true, 'Enable announcements to be hidden.'],
|
||||
'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.']
|
||||
},
|
||||
'Linkification': {
|
||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||
@ -4927,8 +4928,8 @@
|
||||
Index = {
|
||||
showHiddenThreads: false,
|
||||
init: function() {
|
||||
var anchorEntry, input, label, modeEntry, name, pinEntry, refNavEntry, repliesEntry, returnLink, select, sortEntry, targetEntry, threadNumEntry, threadsNumInput, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) {
|
||||
var anchorEntry, input, label, modeEntry, name, pinEntry, refNavEntry, repliesEntry, returnLink, select, sortEntry, targetEntry, threadNumEntry, threadsNumInput, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;
|
||||
if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
this.board = "" + g.BOARD;
|
||||
@ -4969,9 +4970,9 @@
|
||||
}
|
||||
]
|
||||
};
|
||||
_ref = modeEntry.subEntries;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
label = _ref[_i];
|
||||
_ref1 = modeEntry.subEntries;
|
||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||
label = _ref1[_i];
|
||||
input = label.el.firstChild;
|
||||
input.checked = Conf['Index Mode'] === input.value;
|
||||
$.on(input, 'change', $.cb.value);
|
||||
@ -5018,9 +5019,9 @@
|
||||
pinEntry.el.title = 'Move watched threads to the start of the index.';
|
||||
anchorEntry.el.title = 'Move hidden threads to the end of the index.';
|
||||
refNavEntry.el.title = 'Refresh index when navigating through pages.';
|
||||
_ref1 = [targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry];
|
||||
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
||||
label = _ref1[_j];
|
||||
_ref2 = [targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry];
|
||||
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
|
||||
label = _ref2[_j];
|
||||
input = label.el.firstChild;
|
||||
name = input.name;
|
||||
input.checked = Conf[name];
|
||||
@ -5071,9 +5072,9 @@
|
||||
$.on(this.searchInput, 'input', this.onSearchInput);
|
||||
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
|
||||
$.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
|
||||
_ref2 = [this.selectMode, this.selectSort, this.selectSize];
|
||||
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
|
||||
select = _ref2[_k];
|
||||
_ref3 = [this.selectMode, this.selectSort, this.selectSize];
|
||||
for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) {
|
||||
select = _ref3[_k];
|
||||
select.value = Conf[select.name];
|
||||
$.on(select, 'change', $.cb.value);
|
||||
}
|
||||
@ -5116,17 +5117,17 @@
|
||||
$.asap((function() {
|
||||
return $('.board', doc) || d.readyState !== 'loading';
|
||||
}), function() {
|
||||
var board, navLink, _l, _len3, _ref3, _ref4;
|
||||
_ref3 = $$('.navLinks');
|
||||
for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
|
||||
navLink = _ref3[_l];
|
||||
var board, navLink, _l, _len3, _ref4, _ref5;
|
||||
_ref4 = $$('.navLinks');
|
||||
for (_l = 0, _len3 = _ref4.length; _l < _len3; _l++) {
|
||||
navLink = _ref4[_l];
|
||||
$.rm(navLink);
|
||||
}
|
||||
if ((_ref4 = $.id('search-box')) != null) {
|
||||
_ref4.parentNode.remove();
|
||||
if ((_ref5 = $.id('search-box')) != null) {
|
||||
_ref5.parentNode.remove();
|
||||
}
|
||||
$.after($.x('child::form/preceding-sibling::hr[1]'), Index.navLinks);
|
||||
if (g.VIEW !== 'index') {
|
||||
if (g.VIEW !== 'index' || Index.root.parentElement) {
|
||||
return;
|
||||
}
|
||||
board = $('.board');
|
||||
@ -7783,8 +7784,8 @@
|
||||
},
|
||||
menu: {
|
||||
init: function() {
|
||||
var apply, makeStub, replies, thisPost;
|
||||
if (!Conf['Menu'] || !Conf['Post Hiding Link']) {
|
||||
var apply, makeStub, replies, thisPost, _ref;
|
||||
if (!(Conf['Menu'] && Conf['Post Hiding Link'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) {
|
||||
return;
|
||||
}
|
||||
apply = {
|
||||
@ -7880,16 +7881,13 @@
|
||||
},
|
||||
subEntries: [apply, thisPost, replies]
|
||||
});
|
||||
if (g.VIEW !== 'index') {
|
||||
return;
|
||||
}
|
||||
return Menu.menu.addEntry({
|
||||
el: $.el('a', {
|
||||
href: 'javascript:;'
|
||||
}),
|
||||
order: 20,
|
||||
open: function(post) {
|
||||
if (post.isReply) {
|
||||
if (g.VIEW !== 'index' || post.isReply) {
|
||||
return false;
|
||||
}
|
||||
this.el.textContent = post.isHidden ? 'Unhide thread' : 'Hide thread';
|
||||
@ -10999,13 +10997,13 @@
|
||||
|
||||
FappeTyme = {
|
||||
init: function() {
|
||||
var el, lc, type, _i, _len, _ref;
|
||||
if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || g.BOARD.ID === 'f') {
|
||||
var el, lc, type, _i, _len, _ref, _ref1;
|
||||
if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
_ref = ["Fappe", "Werk"];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
type = _ref[_i];
|
||||
_ref1 = ["Fappe", "Werk"];
|
||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||
type = _ref1[_i];
|
||||
if (!Conf["" + type + " Tyme"]) {
|
||||
continue;
|
||||
}
|
||||
@ -11055,7 +11053,7 @@
|
||||
Gallery = {
|
||||
init: function() {
|
||||
var el, _ref;
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery']) || g.BOARD === 'f') {
|
||||
if (!(this.enabled = Conf['Gallery'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
this.delay = Conf['Slide Delay'];
|
||||
@ -11431,8 +11429,8 @@
|
||||
},
|
||||
menu: {
|
||||
init: function() {
|
||||
var el, _ref;
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery'])) {
|
||||
var el;
|
||||
if (!Gallery.enabled) {
|
||||
return;
|
||||
}
|
||||
el = $.el('span', {
|
||||
@ -11622,7 +11620,7 @@
|
||||
ImageExpand = {
|
||||
init: function() {
|
||||
var _ref;
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Image Expansion'])) {
|
||||
if (!(this.enabled = Conf['Image Expansion'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
this.EAI = $.el('a', {
|
||||
@ -11981,8 +11979,8 @@
|
||||
},
|
||||
menu: {
|
||||
init: function() {
|
||||
var conf, createSubEntry, el, name, subEntries, _ref, _ref1;
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Image Expansion'])) {
|
||||
var conf, createSubEntry, el, name, subEntries, _ref;
|
||||
if (!ImageExpand.enabled) {
|
||||
return;
|
||||
}
|
||||
el = $.el('span', {
|
||||
@ -11991,9 +11989,9 @@
|
||||
});
|
||||
createSubEntry = ImageExpand.menu.createSubEntry;
|
||||
subEntries = [];
|
||||
_ref1 = Config.imageExpansion;
|
||||
for (name in _ref1) {
|
||||
conf = _ref1[name];
|
||||
_ref = Config.imageExpansion;
|
||||
for (name in _ref) {
|
||||
conf = _ref[name];
|
||||
subEntries.push(createSubEntry(name, conf[1]));
|
||||
}
|
||||
return Header.menu.addEntry({
|
||||
@ -12144,10 +12142,10 @@
|
||||
ImageLoader = {
|
||||
init: function() {
|
||||
var prefetch, _ref;
|
||||
if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
if (!(Conf["Image Prefetching"] || Conf["Replace JPG"] || Conf["Replace PNG"] || Conf["Replace GIF"] || Conf["Replace WEBM"])) {
|
||||
if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
|
||||
return;
|
||||
}
|
||||
Post.callbacks.push({
|
||||
@ -13430,7 +13428,8 @@
|
||||
|
||||
Labels = {
|
||||
init: function() {
|
||||
if (!Conf['Menu']) {
|
||||
var _ref;
|
||||
if (!(Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) {
|
||||
return;
|
||||
}
|
||||
return Menu.menu.addEntry({
|
||||
@ -14297,7 +14296,7 @@
|
||||
|
||||
ThreadWatcher = {
|
||||
init: function() {
|
||||
var el;
|
||||
var el, _ref;
|
||||
if (!Conf['Thread Watcher']) {
|
||||
return;
|
||||
}
|
||||
@ -14329,7 +14328,7 @@
|
||||
});
|
||||
}
|
||||
ThreadWatcher.fetchAuto();
|
||||
if (Conf['JSON Navigation'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
|
||||
if (Conf['JSON Navigation'] && Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f') {
|
||||
Menu.menu.addEntry({
|
||||
el: $.el('a', {
|
||||
href: 'javascript:;'
|
||||
@ -16288,7 +16287,7 @@
|
||||
return Conf[hotkey] = key;
|
||||
},
|
||||
keydown: function(e) {
|
||||
var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
|
||||
var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
|
||||
if (!(key = Keybinds.keyCode(e))) {
|
||||
return;
|
||||
}
|
||||
@ -16419,25 +16418,25 @@
|
||||
ThreadWatcher.toggle(thread);
|
||||
break;
|
||||
case Conf['Expand image']:
|
||||
if (!threadRoot) {
|
||||
if (!(ImageExpand.enabled && threadRoot)) {
|
||||
return;
|
||||
}
|
||||
Keybinds.img(threadRoot);
|
||||
break;
|
||||
case Conf['Expand images']:
|
||||
if (!threadRoot) {
|
||||
if (!(ImageExpand.enabled && threadRoot)) {
|
||||
return;
|
||||
}
|
||||
Keybinds.img(threadRoot, true);
|
||||
break;
|
||||
case Conf['Open Gallery']:
|
||||
if ((_ref2 = g.VIEW) !== 'index' && _ref2 !== 'thread') {
|
||||
if (!Gallery.enabled) {
|
||||
return;
|
||||
}
|
||||
Gallery.cb.toggle();
|
||||
break;
|
||||
case Conf['fappeTyme']:
|
||||
if (!Conf['Fappe Tyme'] || ((_ref3 = g.VIEW) !== 'index' && _ref3 !== 'thread') || g.BOARD === 'f') {
|
||||
if (!(Conf['Fappe Tyme'] && ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
FappeTyme.cb.toggle.call({
|
||||
@ -16445,7 +16444,7 @@
|
||||
});
|
||||
break;
|
||||
case Conf['werkTyme']:
|
||||
if (!Conf['Fappe Tyme'] || ((_ref4 = g.VIEW) !== 'index' && _ref4 !== 'thread') || g.BOARD === 'f') {
|
||||
if (!(Conf['Werk Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
FappeTyme.cb.toggle.call({
|
||||
@ -16467,7 +16466,7 @@
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
|
||||
if ((_ref4 = Conf['Index Mode']) !== 'paged' && _ref4 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
$('.next button', Index.pagelist).click();
|
||||
@ -16482,7 +16481,7 @@
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if ((_ref6 = Conf['Index Mode']) !== 'paged' && _ref6 !== 'infinite') {
|
||||
if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
$('.prev button', Index.pagelist).click();
|
||||
@ -16771,6 +16770,9 @@
|
||||
if (!Conf['Reply Navigation']) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
prev = $.el('a', {
|
||||
href: 'javascript:;',
|
||||
@ -18494,7 +18496,8 @@
|
||||
Navigate = {
|
||||
path: window.location.pathname,
|
||||
init: function() {
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) {
|
||||
var _ref;
|
||||
if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
$.on(window, 'popstate', Navigate.popstate);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Generated by CoffeeScript
|
||||
/*
|
||||
* appchan x - Version 2.10.4 - 2015-01-24
|
||||
* appchan x - Version 2.10.4 - 2015-01-26
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||
@ -135,7 +135,8 @@
|
||||
'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'],
|
||||
'Show Support Message': [true, 'Warn if your browser is unsupported. appchan x may not operate correctly on unsupported browser versions.'],
|
||||
'Normalize URL': [true, 'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'],
|
||||
'Announcement Hiding': [true, 'Enable announcements to be hidden.']
|
||||
'Announcement Hiding': [true, 'Enable announcements to be hidden.'],
|
||||
'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.']
|
||||
},
|
||||
'Linkification': {
|
||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||
@ -4952,8 +4953,8 @@
|
||||
Index = {
|
||||
showHiddenThreads: false,
|
||||
init: function() {
|
||||
var anchorEntry, input, label, modeEntry, name, pinEntry, refNavEntry, repliesEntry, returnLink, select, sortEntry, targetEntry, threadNumEntry, threadsNumInput, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) {
|
||||
var anchorEntry, input, label, modeEntry, name, pinEntry, refNavEntry, repliesEntry, returnLink, select, sortEntry, targetEntry, threadNumEntry, threadsNumInput, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;
|
||||
if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
this.board = "" + g.BOARD;
|
||||
@ -4994,9 +4995,9 @@
|
||||
}
|
||||
]
|
||||
};
|
||||
_ref = modeEntry.subEntries;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
label = _ref[_i];
|
||||
_ref1 = modeEntry.subEntries;
|
||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||
label = _ref1[_i];
|
||||
input = label.el.firstChild;
|
||||
input.checked = Conf['Index Mode'] === input.value;
|
||||
$.on(input, 'change', $.cb.value);
|
||||
@ -5043,9 +5044,9 @@
|
||||
pinEntry.el.title = 'Move watched threads to the start of the index.';
|
||||
anchorEntry.el.title = 'Move hidden threads to the end of the index.';
|
||||
refNavEntry.el.title = 'Refresh index when navigating through pages.';
|
||||
_ref1 = [targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry];
|
||||
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
||||
label = _ref1[_j];
|
||||
_ref2 = [targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry];
|
||||
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
|
||||
label = _ref2[_j];
|
||||
input = label.el.firstChild;
|
||||
name = input.name;
|
||||
input.checked = Conf[name];
|
||||
@ -5096,9 +5097,9 @@
|
||||
$.on(this.searchInput, 'input', this.onSearchInput);
|
||||
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
|
||||
$.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);
|
||||
_ref2 = [this.selectMode, this.selectSort, this.selectSize];
|
||||
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
|
||||
select = _ref2[_k];
|
||||
_ref3 = [this.selectMode, this.selectSort, this.selectSize];
|
||||
for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) {
|
||||
select = _ref3[_k];
|
||||
select.value = Conf[select.name];
|
||||
$.on(select, 'change', $.cb.value);
|
||||
}
|
||||
@ -5141,17 +5142,17 @@
|
||||
$.asap((function() {
|
||||
return $('.board', doc) || d.readyState !== 'loading';
|
||||
}), function() {
|
||||
var board, navLink, _l, _len3, _ref3, _ref4;
|
||||
_ref3 = $$('.navLinks');
|
||||
for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
|
||||
navLink = _ref3[_l];
|
||||
var board, navLink, _l, _len3, _ref4, _ref5;
|
||||
_ref4 = $$('.navLinks');
|
||||
for (_l = 0, _len3 = _ref4.length; _l < _len3; _l++) {
|
||||
navLink = _ref4[_l];
|
||||
$.rm(navLink);
|
||||
}
|
||||
if ((_ref4 = $.id('search-box')) != null) {
|
||||
_ref4.parentNode.remove();
|
||||
if ((_ref5 = $.id('search-box')) != null) {
|
||||
_ref5.parentNode.remove();
|
||||
}
|
||||
$.after($.x('child::form/preceding-sibling::hr[1]'), Index.navLinks);
|
||||
if (g.VIEW !== 'index') {
|
||||
if (g.VIEW !== 'index' || Index.root.parentElement) {
|
||||
return;
|
||||
}
|
||||
board = $('.board');
|
||||
@ -7824,8 +7825,8 @@
|
||||
},
|
||||
menu: {
|
||||
init: function() {
|
||||
var apply, makeStub, replies, thisPost;
|
||||
if (!Conf['Menu'] || !Conf['Post Hiding Link']) {
|
||||
var apply, makeStub, replies, thisPost, _ref;
|
||||
if (!(Conf['Menu'] && Conf['Post Hiding Link'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) {
|
||||
return;
|
||||
}
|
||||
apply = {
|
||||
@ -7921,16 +7922,13 @@
|
||||
},
|
||||
subEntries: [apply, thisPost, replies]
|
||||
});
|
||||
if (g.VIEW !== 'index') {
|
||||
return;
|
||||
}
|
||||
return Menu.menu.addEntry({
|
||||
el: $.el('a', {
|
||||
href: 'javascript:;'
|
||||
}),
|
||||
order: 20,
|
||||
open: function(post) {
|
||||
if (post.isReply) {
|
||||
if (g.VIEW !== 'index' || post.isReply) {
|
||||
return false;
|
||||
}
|
||||
this.el.textContent = post.isHidden ? 'Unhide thread' : 'Hide thread';
|
||||
@ -11035,13 +11033,13 @@
|
||||
|
||||
FappeTyme = {
|
||||
init: function() {
|
||||
var el, lc, type, _i, _len, _ref;
|
||||
if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || g.BOARD.ID === 'f') {
|
||||
var el, lc, type, _i, _len, _ref, _ref1;
|
||||
if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
_ref = ["Fappe", "Werk"];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
type = _ref[_i];
|
||||
_ref1 = ["Fappe", "Werk"];
|
||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||
type = _ref1[_i];
|
||||
if (!Conf["" + type + " Tyme"]) {
|
||||
continue;
|
||||
}
|
||||
@ -11091,7 +11089,7 @@
|
||||
Gallery = {
|
||||
init: function() {
|
||||
var el, _ref;
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery']) || g.BOARD === 'f') {
|
||||
if (!(this.enabled = Conf['Gallery'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
this.delay = Conf['Slide Delay'];
|
||||
@ -11467,8 +11465,8 @@
|
||||
},
|
||||
menu: {
|
||||
init: function() {
|
||||
var el, _ref;
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery'])) {
|
||||
var el;
|
||||
if (!Gallery.enabled) {
|
||||
return;
|
||||
}
|
||||
el = $.el('span', {
|
||||
@ -11645,7 +11643,7 @@
|
||||
ImageExpand = {
|
||||
init: function() {
|
||||
var _ref;
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Image Expansion'])) {
|
||||
if (!(this.enabled = Conf['Image Expansion'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
this.EAI = $.el('a', {
|
||||
@ -12004,8 +12002,8 @@
|
||||
},
|
||||
menu: {
|
||||
init: function() {
|
||||
var conf, createSubEntry, el, name, subEntries, _ref, _ref1;
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Image Expansion'])) {
|
||||
var conf, createSubEntry, el, name, subEntries, _ref;
|
||||
if (!ImageExpand.enabled) {
|
||||
return;
|
||||
}
|
||||
el = $.el('span', {
|
||||
@ -12014,9 +12012,9 @@
|
||||
});
|
||||
createSubEntry = ImageExpand.menu.createSubEntry;
|
||||
subEntries = [];
|
||||
_ref1 = Config.imageExpansion;
|
||||
for (name in _ref1) {
|
||||
conf = _ref1[name];
|
||||
_ref = Config.imageExpansion;
|
||||
for (name in _ref) {
|
||||
conf = _ref[name];
|
||||
subEntries.push(createSubEntry(name, conf[1]));
|
||||
}
|
||||
return Header.menu.addEntry({
|
||||
@ -12167,10 +12165,10 @@
|
||||
ImageLoader = {
|
||||
init: function() {
|
||||
var prefetch, _ref;
|
||||
if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') {
|
||||
if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
if (!(Conf["Image Prefetching"] || Conf["Replace JPG"] || Conf["Replace PNG"] || Conf["Replace GIF"] || Conf["Replace WEBM"])) {
|
||||
if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
|
||||
return;
|
||||
}
|
||||
Post.callbacks.push({
|
||||
@ -13453,7 +13451,8 @@
|
||||
|
||||
Labels = {
|
||||
init: function() {
|
||||
if (!Conf['Menu']) {
|
||||
var _ref;
|
||||
if (!(Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) {
|
||||
return;
|
||||
}
|
||||
return Menu.menu.addEntry({
|
||||
@ -14320,7 +14319,7 @@
|
||||
|
||||
ThreadWatcher = {
|
||||
init: function() {
|
||||
var el;
|
||||
var el, _ref;
|
||||
if (!Conf['Thread Watcher']) {
|
||||
return;
|
||||
}
|
||||
@ -14352,7 +14351,7 @@
|
||||
});
|
||||
}
|
||||
ThreadWatcher.fetchAuto();
|
||||
if (Conf['JSON Navigation'] && Conf['Menu'] && g.BOARD.ID !== 'f') {
|
||||
if (Conf['JSON Navigation'] && Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f') {
|
||||
Menu.menu.addEntry({
|
||||
el: $.el('a', {
|
||||
href: 'javascript:;'
|
||||
@ -16310,7 +16309,7 @@
|
||||
return Conf[hotkey] = key;
|
||||
},
|
||||
keydown: function(e) {
|
||||
var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
|
||||
var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
|
||||
if (!(key = Keybinds.keyCode(e))) {
|
||||
return;
|
||||
}
|
||||
@ -16441,25 +16440,25 @@
|
||||
ThreadWatcher.toggle(thread);
|
||||
break;
|
||||
case Conf['Expand image']:
|
||||
if (!threadRoot) {
|
||||
if (!(ImageExpand.enabled && threadRoot)) {
|
||||
return;
|
||||
}
|
||||
Keybinds.img(threadRoot);
|
||||
break;
|
||||
case Conf['Expand images']:
|
||||
if (!threadRoot) {
|
||||
if (!(ImageExpand.enabled && threadRoot)) {
|
||||
return;
|
||||
}
|
||||
Keybinds.img(threadRoot, true);
|
||||
break;
|
||||
case Conf['Open Gallery']:
|
||||
if ((_ref2 = g.VIEW) !== 'index' && _ref2 !== 'thread') {
|
||||
if (!Gallery.enabled) {
|
||||
return;
|
||||
}
|
||||
Gallery.cb.toggle();
|
||||
break;
|
||||
case Conf['fappeTyme']:
|
||||
if (!Conf['Fappe Tyme'] || ((_ref3 = g.VIEW) !== 'index' && _ref3 !== 'thread') || g.BOARD === 'f') {
|
||||
if (!(Conf['Fappe Tyme'] && ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
FappeTyme.cb.toggle.call({
|
||||
@ -16467,7 +16466,7 @@
|
||||
});
|
||||
break;
|
||||
case Conf['werkTyme']:
|
||||
if (!Conf['Fappe Tyme'] || ((_ref4 = g.VIEW) !== 'index' && _ref4 !== 'thread') || g.BOARD === 'f') {
|
||||
if (!(Conf['Werk Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
FappeTyme.cb.toggle.call({
|
||||
@ -16489,7 +16488,7 @@
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
|
||||
if ((_ref4 = Conf['Index Mode']) !== 'paged' && _ref4 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
$('.next button', Index.pagelist).click();
|
||||
@ -16504,7 +16503,7 @@
|
||||
return;
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
if ((_ref6 = Conf['Index Mode']) !== 'paged' && _ref6 !== 'infinite') {
|
||||
if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
|
||||
return;
|
||||
}
|
||||
$('.prev button', Index.pagelist).click();
|
||||
@ -16793,6 +16792,9 @@
|
||||
if (!Conf['Reply Navigation']) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
prev = $.el('a', {
|
||||
href: 'javascript:;',
|
||||
@ -18522,8 +18524,8 @@
|
||||
Navigate = {
|
||||
path: window.location.pathname,
|
||||
init: function() {
|
||||
var popstateHack;
|
||||
if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) {
|
||||
var popstateHack, _ref;
|
||||
if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) {
|
||||
return;
|
||||
}
|
||||
popstateHack = function() {
|
||||
|
||||
@ -75,7 +75,7 @@ PostHiding =
|
||||
|
||||
menu:
|
||||
init: ->
|
||||
return if !Conf['Menu'] or !Conf['Post Hiding Link']
|
||||
return unless Conf['Menu'] and Conf['Post Hiding Link'] and g.VIEW in ['index', 'thread']
|
||||
|
||||
# Hide
|
||||
apply =
|
||||
@ -132,12 +132,11 @@ PostHiding =
|
||||
true
|
||||
subEntries: [apply, thisPost, replies]
|
||||
|
||||
return if g.VIEW isnt 'index'
|
||||
Menu.menu.addEntry
|
||||
el: $.el 'a', href: 'javascript:;'
|
||||
order: 20
|
||||
open: (post) ->
|
||||
return false if post.isReply
|
||||
return false if g.VIEW isnt 'index' or post.isReply
|
||||
@el.textContent = if post.isHidden
|
||||
'Unhide thread'
|
||||
else
|
||||
|
||||
@ -94,6 +94,10 @@ Config =
|
||||
true
|
||||
'Enable announcements to be hidden.'
|
||||
]
|
||||
'Disable Autoplaying Sounds': [
|
||||
false
|
||||
'Prevent sounds on the page from autoplaying.'
|
||||
]
|
||||
|
||||
'Linkification':
|
||||
'Linkify': [
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Index =
|
||||
showHiddenThreads: false
|
||||
init: ->
|
||||
return if g.BOARD.ID is 'f' or !Conf['JSON Navigation']
|
||||
return unless Conf['JSON Navigation'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||
|
||||
@board = "#{g.BOARD}"
|
||||
|
||||
@ -155,7 +155,7 @@ Index =
|
||||
$.id('search-box')?.parentNode.remove()
|
||||
$.after $.x('child::form/preceding-sibling::hr[1]'), Index.navLinks
|
||||
|
||||
return if g.VIEW isnt 'index'
|
||||
return if g.VIEW isnt 'index' or Index.root.parentElement
|
||||
|
||||
board = $ '.board'
|
||||
$.replace board, Index.root
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Navigate =
|
||||
path: window.location.pathname
|
||||
init: ->
|
||||
return if g.BOARD.ID is 'f' or !Conf['JSON Navigation']
|
||||
return unless Conf['JSON Navigation'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||
|
||||
<% if (type === 'crx') { %>
|
||||
# blink/webkit throw a popstate on page load. Not what we want.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
FappeTyme =
|
||||
init: ->
|
||||
return if !(Conf['Fappe Tyme'] or Conf['Werk Tyme']) or g.BOARD.ID is 'f'
|
||||
return unless (Conf['Fappe Tyme'] or Conf['Werk Tyme']) and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||
|
||||
for type in ["Fappe", "Werk"] when Conf["#{type} Tyme"]
|
||||
lc = type.toLowerCase()
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Gallery =
|
||||
init: ->
|
||||
return if not (g.VIEW in ['index', 'thread'] and Conf['Gallery']) or g.BOARD is 'f'
|
||||
return unless @enabled = Conf['Gallery'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||
|
||||
@delay = Conf['Slide Delay']
|
||||
|
||||
@ -297,7 +297,7 @@ Gallery =
|
||||
|
||||
menu:
|
||||
init: ->
|
||||
return unless g.VIEW in ['index', 'thread'] and Conf['Gallery']
|
||||
return unless Gallery.enabled
|
||||
|
||||
el = $.el 'span',
|
||||
textContent: 'Gallery'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
ImageExpand =
|
||||
init: ->
|
||||
return unless g.VIEW in ['index', 'thread'] and Conf['Image Expansion']
|
||||
return unless @enabled = Conf['Image Expansion'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||
|
||||
@EAI = $.el 'a',
|
||||
id: 'img-controls'
|
||||
@ -280,7 +280,7 @@ ImageExpand =
|
||||
|
||||
menu:
|
||||
init: ->
|
||||
return unless g.VIEW in ['index', 'thread'] and Conf['Image Expansion']
|
||||
return unless ImageExpand.enabled
|
||||
|
||||
el = $.el 'span',
|
||||
textContent: 'Image Expansion'
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
ImageLoader =
|
||||
init: ->
|
||||
return unless g.VIEW in ['index', 'thread']
|
||||
return unless Conf["Image Prefetching"] or
|
||||
Conf["Replace JPG"] or Conf["Replace PNG"] or Conf["Replace GIF"] or Conf["Replace WEBM"]
|
||||
return unless g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||
return unless Conf['Image Prefetching'] or
|
||||
Conf['Replace JPG'] or Conf['Replace PNG'] or Conf['Replace GIF'] or Conf['Replace WEBM']
|
||||
|
||||
Post.callbacks.push
|
||||
name: 'Image Replace'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Labels =
|
||||
init: ->
|
||||
return if !Conf['Menu']
|
||||
return unless Conf['Menu'] and g.VIEW in ['index', 'thread']
|
||||
|
||||
Menu.menu.addEntry
|
||||
el: $.el 'div', textContent: 'Labels'
|
||||
|
||||
@ -93,19 +93,19 @@ Keybinds =
|
||||
ThreadWatcher.toggle thread
|
||||
# Images
|
||||
when Conf['Expand image']
|
||||
return unless threadRoot
|
||||
return unless ImageExpand.enabled and threadRoot
|
||||
Keybinds.img threadRoot
|
||||
when Conf['Expand images']
|
||||
return unless threadRoot
|
||||
return unless ImageExpand.enabled and threadRoot
|
||||
Keybinds.img threadRoot, true
|
||||
when Conf['Open Gallery']
|
||||
return unless g.VIEW in ['index', 'thread']
|
||||
return unless Gallery.enabled
|
||||
Gallery.cb.toggle()
|
||||
when Conf['fappeTyme']
|
||||
return if !Conf['Fappe Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
|
||||
return unless Conf['Fappe Tyme'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||
FappeTyme.cb.toggle.call {name: 'fappe'}
|
||||
when Conf['werkTyme']
|
||||
return if !Conf['Fappe Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
|
||||
return unless Conf['Werk Tyme'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||
FappeTyme.cb.toggle.call {name: 'werk'}
|
||||
# Board Navigation
|
||||
when Conf['Front page']
|
||||
|
||||
@ -5,6 +5,8 @@ Nav =
|
||||
return unless Conf['Index Navigation']
|
||||
when 'thread'
|
||||
return unless Conf['Reply Navigation']
|
||||
else
|
||||
return
|
||||
|
||||
prev = $.el 'a',
|
||||
href: 'javascript:;'
|
||||
|
||||
@ -29,7 +29,7 @@ ThreadWatcher =
|
||||
|
||||
ThreadWatcher.fetchAuto()
|
||||
|
||||
if Conf['JSON Navigation'] and Conf['Menu'] and g.BOARD.ID isnt 'f'
|
||||
if Conf['JSON Navigation'] and Conf['Menu'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||
Menu.menu.addEntry
|
||||
el: $.el 'a', href: 'javascript:;'
|
||||
order: 6
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user