Merge branch 'master' into catalog

This commit is contained in:
ccd0 2014-09-16 22:00:50 -07:00
commit e1808aef23
16 changed files with 123 additions and 71 deletions

View File

@ -3,6 +3,13 @@ The attributions below are for work that has been incorporated into the script a
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.3.x --> <!-- v1.9.3.x -->
### v1.9.3.2
*2014-09-16* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.3.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.3.2/builds/4chan-X-noupdate.crx "Chromium version")]
**ccd0**
- Bug fixes.
- Tweaks to quote/image preview positioning.
### v1.9.3.1 ### v1.9.3.1
*2014-09-16* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.3.1/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.3.1/builds/4chan-X-noupdate.crx "Chromium version")] *2014-09-16* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.3.1/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.3.1/builds/4chan-X-noupdate.crx "Chromium version")]

View File

@ -1,5 +1,5 @@
/* /*
* 4chan X - Version 1.9.3.1 * 4chan X - Version 1.9.3.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.3.1 // @version 1.9.3.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.3.1 // @version 1.9.3.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.3.1 * 4chan X - Version 1.9.3.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
@ -183,9 +183,9 @@
'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'], 'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'],
'Replace PNG': [false, 'Replace png thumbnails with the actual image.'], 'Replace PNG': [false, 'Replace png thumbnails with the actual image.'],
'Replace WEBM': [false, 'Replace webm thumbnails with the actual webm video. Probably will degrade browser performance ;)'], 'Replace WEBM': [false, 'Replace webm thumbnails with the actual webm video. Probably will degrade browser performance ;)'],
'Image Prefetching': [false, 'Preload images'], 'Image Prefetching': [false, 'Add link in header menu to turn on image preloading.'],
'Fappe Tyme': [false, 'Hide posts without images. *hint* *hint*'], 'Fappe Tyme': [false, 'Hide posts without images when header menu item is checked. *hint* *hint*'],
'Werk Tyme': [false, 'Hide all post images.'], 'Werk Tyme': [false, 'Hide all post images when header menu item is checked.'],
'Autoplay': [true, 'Videos begin playing immediately when opened.'], 'Autoplay': [true, 'Videos begin playing immediately when opened.'],
'Show Controls': [true, 'Show controls on videos expanded inline. Turn this off if you want to contract videos by clicking on them.'], 'Show Controls': [true, 'Show controls on videos expanded inline. Turn this off if you want to contract videos by clicking on them.'],
'Loop in New Tab': [true, 'Loop videos opened in their own tabs.'] 'Loop in New Tab': [true, 'Loop videos opened in their own tabs.']
@ -330,17 +330,17 @@
'Toggle sage': ['Alt+s', 'Toggle sage in options field.'], 'Toggle sage': ['Alt+s', 'Toggle sage in options field.'],
'Submit QR': ['Ctrl+Enter', 'Submit post.'], 'Submit QR': ['Ctrl+Enter', 'Submit post.'],
'Watch': ['w', 'Watch thread.'], 'Watch': ['w', 'Watch thread.'],
'Update': ['r', 'Update the thread now.'], 'Update': ['r', 'Update the thread / refresh the index.'],
'Expand image': ['Shift+e', 'Expand selected image.'], 'Expand image': ['Shift+e', 'Expand selected image.'],
'Expand images': ['e', 'Expand all images.'], 'Expand images': ['e', 'Expand all images.'],
'Open Gallery': ['g', 'Opens the gallery.'], 'Open Gallery': ['g', 'Opens the gallery.'],
'fappeTyme': ['f', 'Fappe Tyme.'], 'fappeTyme': ['f', 'Toggle Fappe Tyme.'],
'werkTyme': ['Shift+w', 'Werk Tyme'], 'werkTyme': ['Shift+w', 'Toggle Werk Tyme.'],
'Front page': ['1', 'Jump to front page.'], 'Front page': ['1', 'Jump to front page.'],
'Open front page': ['Shift+1', 'Open front page in a new tab.'], 'Open front page': ['Shift+1', 'Open front page in a new tab.'],
'Next page': ['Ctrl+Right', 'Jump to the next page.'], 'Next page': ['Ctrl+Right', 'Jump to the next page.'],
'Previous page': ['Ctrl+Left', 'Jump to the previous page.'], 'Previous page': ['Ctrl+Left', 'Jump to the previous page.'],
'Open catalog': ['Shift+c', 'Open the catalog of the current board'], 'Open catalog': ['Shift+c', 'Open the catalog of the current board.'],
'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'], 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'],
'Next thread': ['Ctrl+Down', 'See next thread.'], 'Next thread': ['Ctrl+Down', 'See next thread.'],
'Previous thread': ['Ctrl+Up', 'See previous thread.'], 'Previous thread': ['Ctrl+Up', 'See previous thread.'],
@ -376,7 +376,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.9.3.1', VERSION: '1.9.3.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',
@ -4036,14 +4036,16 @@
return $.set("" + this.id + ".position", this.style.cssText); return $.set("" + this.id + ".position", this.style.cssText);
}; };
hoverstart = function(_arg) { hoverstart = function(_arg) {
var asapTest, cb, el, endEvents, latestEvent, noRemove, o, root; var asapTest, cb, el, endEvents, latestEvent, noRemove, o, root, _ref;
root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb, noRemove = _arg.noRemove; root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb, noRemove = _arg.noRemove;
o = { o = {
root: root, root: root,
el: el, el: el,
style: el.style, style: el.style,
isImage: (_ref = el.nodeName) === 'IMG' || _ref === 'VIDEO',
cb: cb, cb: cb,
endEvents: endEvents, endEvents: endEvents,
ready: false,
latestEvent: latestEvent, latestEvent: latestEvent,
clientHeight: doc.clientHeight, clientHeight: doc.clientHeight,
clientWidth: doc.clientWidth, clientWidth: doc.clientWidth,
@ -4054,6 +4056,7 @@
$.asap(function() { $.asap(function() {
return !el.parentNode || asapTest(); return !el.parentNode || asapTest();
}, function() { }, function() {
o.ready = true;
if (el.parentNode) { if (el.parentNode) {
return o.hover(o.latestEvent); return o.hover(o.latestEvent);
} }
@ -4071,13 +4074,19 @@
return $.on(doc, 'mousemove', o.workaround); return $.on(doc, 'mousemove', o.workaround);
}; };
hover = function(e) { hover = function(e) {
var clientX, clientY, height, left, right, style, top, _ref; var clientX, clientY, height, left, right, style, threshold, top, _ref;
this.latestEvent = e; this.latestEvent = e;
if (!this.ready) {
return;
}
height = this.el.offsetHeight; height = this.el.offsetHeight;
clientX = e.clientX, clientY = e.clientY; clientX = e.clientX, clientY = e.clientY;
top = clientY - 120; top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120));
top = this.clientHeight <= height || top <= 0 ? 0 : top + height >= this.clientHeight ? this.clientHeight - height : top; threshold = this.clientWidth / 2;
_ref = clientX <= this.clientWidth / 2 ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = _ref[0], right = _ref[1]; if (!this.isImage) {
threshold = Math.max(threshold, this.clientWidth - 400);
}
_ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = _ref[0], right = _ref[1];
style = this.style; style = this.style;
style.top = top + 'px'; style.top = top + 'px';
style.left = left; style.left = left;
@ -5745,7 +5754,7 @@
} else { } else {
QuoteYou.lastRead = post; QuoteYou.lastRead = post;
window.location = "#" + post.id; window.location = "#" + post.id;
Header.scrollToPost(post); Header.scrollTo(post);
$.addClass($('.post', post), 'highlight'); $.addClass($('.post', post), 'highlight');
return true; return true;
} }
@ -7661,7 +7670,7 @@
} }
}, },
build: function(image) { build: function(image) {
var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, value, _i, _j, _len, _len1, _ref, _ref1, _ref2; var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, thumb, value, _i, _j, _len, _len1, _ref, _ref1, _ref2;
Gallery.images = []; Gallery.images = [];
nodes = Gallery.nodes = {}; nodes = Gallery.nodes = {};
Gallery.fullIDs = {}; Gallery.fullIDs = {};
@ -7725,7 +7734,13 @@
$.add(d.body, dialog); $.add(d.body, dialog);
nodes.thumbs.scrollTop = 0; nodes.thumbs.scrollTop = 0;
nodes.current.parentElement.scrollTop = 0; nodes.current.parentElement.scrollTop = 0;
Gallery.open(image ? $("[href='" + image.href + "']", nodes.thumbs) || Gallery.images[0] : Gallery.images[0]); if (image) {
thumb = $("[href='" + image.href + "']", nodes.thumbs);
}
thumb || (thumb = Gallery.images[Gallery.images.length - 1]);
if (thumb) {
Gallery.open(thumb);
}
doc.style.overflow = 'hidden'; doc.style.overflow = 'hidden';
return nodes.total.textContent = Gallery.images.length; return nodes.total.textContent = Gallery.images.length;
}, },
@ -12869,7 +12884,7 @@
className: 'dialog' className: 'dialog'
}); });
$.extend(dialog, { $.extend(dialog, {
innerHTML: "<nav><div class=sections-list></div><p class='imp-exp-result warning'></p><div class=credits><a class=export>Export</a>&nbsp|&nbsp<a class=import>Import</a>&nbsp|&nbsp<a class=reset>Reset Settings</a>&nbsp|&nbsp<input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.3.1</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a>&nbsp|&nbsp<a href=javascript:; class='close fa fa-times' title=Close></a></div></nav><div class=section-container><section></section></div>" innerHTML: "<nav><div class=sections-list></div><p class='imp-exp-result warning'></p><div class=credits><a class=export>Export</a>&nbsp|&nbsp<a class=import>Import</a>&nbsp|&nbsp<a class=reset>Reset Settings</a>&nbsp|&nbsp<input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.3.2</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a>&nbsp|&nbsp<a href=javascript:; class='close fa fa-times' title=Close></a></div></nav><div class=section-container><section></section></div>"
}); });
$.on($('.export', Settings.dialog), 'click', Settings["export"]); $.on($('.export', Settings.dialog), 'click', Settings["export"]);
$.on($('.import', Settings.dialog), 'click', Settings["import"]); $.on($('.import', Settings.dialog), 'click', Settings["import"]);

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.3.1 // @version 1.9.3.2
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -23,7 +23,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.9.3.1 * 4chan X - Version 1.9.3.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
@ -182,9 +182,9 @@
'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'], 'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'],
'Replace PNG': [false, 'Replace png thumbnails with the actual image.'], 'Replace PNG': [false, 'Replace png thumbnails with the actual image.'],
'Replace WEBM': [false, 'Replace webm thumbnails with the actual webm video. Probably will degrade browser performance ;)'], 'Replace WEBM': [false, 'Replace webm thumbnails with the actual webm video. Probably will degrade browser performance ;)'],
'Image Prefetching': [false, 'Preload images'], 'Image Prefetching': [false, 'Add link in header menu to turn on image preloading.'],
'Fappe Tyme': [false, 'Hide posts without images. *hint* *hint*'], 'Fappe Tyme': [false, 'Hide posts without images when header menu item is checked. *hint* *hint*'],
'Werk Tyme': [false, 'Hide all post images.'], 'Werk Tyme': [false, 'Hide all post images when header menu item is checked.'],
'Autoplay': [true, 'Videos begin playing immediately when opened.'], 'Autoplay': [true, 'Videos begin playing immediately when opened.'],
'Show Controls': [true, 'Show controls on videos expanded inline. Turn this off if you want to contract videos by clicking on them.'], 'Show Controls': [true, 'Show controls on videos expanded inline. Turn this off if you want to contract videos by clicking on them.'],
'Loop in New Tab': [true, 'Loop videos opened in their own tabs.'] 'Loop in New Tab': [true, 'Loop videos opened in their own tabs.']
@ -329,17 +329,17 @@
'Toggle sage': ['Alt+s', 'Toggle sage in options field.'], 'Toggle sage': ['Alt+s', 'Toggle sage in options field.'],
'Submit QR': ['Ctrl+Enter', 'Submit post.'], 'Submit QR': ['Ctrl+Enter', 'Submit post.'],
'Watch': ['w', 'Watch thread.'], 'Watch': ['w', 'Watch thread.'],
'Update': ['r', 'Update the thread now.'], 'Update': ['r', 'Update the thread / refresh the index.'],
'Expand image': ['Shift+e', 'Expand selected image.'], 'Expand image': ['Shift+e', 'Expand selected image.'],
'Expand images': ['e', 'Expand all images.'], 'Expand images': ['e', 'Expand all images.'],
'Open Gallery': ['g', 'Opens the gallery.'], 'Open Gallery': ['g', 'Opens the gallery.'],
'fappeTyme': ['f', 'Fappe Tyme.'], 'fappeTyme': ['f', 'Toggle Fappe Tyme.'],
'werkTyme': ['Shift+w', 'Werk Tyme'], 'werkTyme': ['Shift+w', 'Toggle Werk Tyme.'],
'Front page': ['1', 'Jump to front page.'], 'Front page': ['1', 'Jump to front page.'],
'Open front page': ['Shift+1', 'Open front page in a new tab.'], 'Open front page': ['Shift+1', 'Open front page in a new tab.'],
'Next page': ['Ctrl+Right', 'Jump to the next page.'], 'Next page': ['Ctrl+Right', 'Jump to the next page.'],
'Previous page': ['Ctrl+Left', 'Jump to the previous page.'], 'Previous page': ['Ctrl+Left', 'Jump to the previous page.'],
'Open catalog': ['Shift+c', 'Open the catalog of the current board'], 'Open catalog': ['Shift+c', 'Open the catalog of the current board.'],
'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'], 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'],
'Next thread': ['Ctrl+Down', 'See next thread.'], 'Next thread': ['Ctrl+Down', 'See next thread.'],
'Previous thread': ['Ctrl+Up', 'See previous thread.'], 'Previous thread': ['Ctrl+Up', 'See previous thread.'],
@ -375,7 +375,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.9.3.1', VERSION: '1.9.3.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',
@ -4035,14 +4035,16 @@
return $.set("" + this.id + ".position", this.style.cssText); return $.set("" + this.id + ".position", this.style.cssText);
}; };
hoverstart = function(_arg) { hoverstart = function(_arg) {
var asapTest, cb, el, endEvents, latestEvent, noRemove, o, root; var asapTest, cb, el, endEvents, latestEvent, noRemove, o, root, _ref;
root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb, noRemove = _arg.noRemove; root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb, noRemove = _arg.noRemove;
o = { o = {
root: root, root: root,
el: el, el: el,
style: el.style, style: el.style,
isImage: (_ref = el.nodeName) === 'IMG' || _ref === 'VIDEO',
cb: cb, cb: cb,
endEvents: endEvents, endEvents: endEvents,
ready: false,
latestEvent: latestEvent, latestEvent: latestEvent,
clientHeight: doc.clientHeight, clientHeight: doc.clientHeight,
clientWidth: doc.clientWidth, clientWidth: doc.clientWidth,
@ -4053,6 +4055,7 @@
$.asap(function() { $.asap(function() {
return !el.parentNode || asapTest(); return !el.parentNode || asapTest();
}, function() { }, function() {
o.ready = true;
if (el.parentNode) { if (el.parentNode) {
return o.hover(o.latestEvent); return o.hover(o.latestEvent);
} }
@ -4070,13 +4073,19 @@
return $.on(doc, 'mousemove', o.workaround); return $.on(doc, 'mousemove', o.workaround);
}; };
hover = function(e) { hover = function(e) {
var clientX, clientY, height, left, right, style, top, _ref; var clientX, clientY, height, left, right, style, threshold, top, _ref;
this.latestEvent = e; this.latestEvent = e;
if (!this.ready) {
return;
}
height = this.el.offsetHeight; height = this.el.offsetHeight;
clientX = e.clientX, clientY = e.clientY; clientX = e.clientX, clientY = e.clientY;
top = clientY - 120; top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120));
top = this.clientHeight <= height || top <= 0 ? 0 : top + height >= this.clientHeight ? this.clientHeight - height : top; threshold = this.clientWidth / 2;
_ref = clientX <= this.clientWidth / 2 ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = _ref[0], right = _ref[1]; if (!this.isImage) {
threshold = Math.max(threshold, this.clientWidth - 400);
}
_ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = _ref[0], right = _ref[1];
style = this.style; style = this.style;
style.top = top + 'px'; style.top = top + 'px';
style.left = left; style.left = left;
@ -5744,7 +5753,7 @@
} else { } else {
QuoteYou.lastRead = post; QuoteYou.lastRead = post;
window.location = "#" + post.id; window.location = "#" + post.id;
Header.scrollToPost(post); Header.scrollTo(post);
$.addClass($('.post', post), 'highlight'); $.addClass($('.post', post), 'highlight');
return true; return true;
} }
@ -7660,7 +7669,7 @@
} }
}, },
build: function(image) { build: function(image) {
var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, value, _i, _j, _len, _len1, _ref, _ref1, _ref2; var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, thumb, value, _i, _j, _len, _len1, _ref, _ref1, _ref2;
Gallery.images = []; Gallery.images = [];
nodes = Gallery.nodes = {}; nodes = Gallery.nodes = {};
Gallery.fullIDs = {}; Gallery.fullIDs = {};
@ -7724,7 +7733,13 @@
$.add(d.body, dialog); $.add(d.body, dialog);
nodes.thumbs.scrollTop = 0; nodes.thumbs.scrollTop = 0;
nodes.current.parentElement.scrollTop = 0; nodes.current.parentElement.scrollTop = 0;
Gallery.open(image ? $("[href='" + image.href + "']", nodes.thumbs) || Gallery.images[0] : Gallery.images[0]); if (image) {
thumb = $("[href='" + image.href + "']", nodes.thumbs);
}
thumb || (thumb = Gallery.images[Gallery.images.length - 1]);
if (thumb) {
Gallery.open(thumb);
}
doc.style.overflow = 'hidden'; doc.style.overflow = 'hidden';
return nodes.total.textContent = Gallery.images.length; return nodes.total.textContent = Gallery.images.length;
}, },
@ -12868,7 +12883,7 @@
className: 'dialog' className: 'dialog'
}); });
$.extend(dialog, { $.extend(dialog, {
innerHTML: "<nav><div class=sections-list></div><p class='imp-exp-result warning'></p><div class=credits><a class=export>Export</a>&nbsp|&nbsp<a class=import>Import</a>&nbsp|&nbsp<a class=reset>Reset Settings</a>&nbsp|&nbsp<input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.3.1</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a>&nbsp|&nbsp<a href=javascript:; class='close fa fa-times' title=Close></a></div></nav><div class=section-container><section></section></div>" innerHTML: "<nav><div class=sections-list></div><p class='imp-exp-result warning'></p><div class=credits><a class=export>Export</a>&nbsp|&nbsp<a class=import>Import</a>&nbsp|&nbsp<a class=reset>Reset Settings</a>&nbsp|&nbsp<input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.3.2</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a>&nbsp|&nbsp<a href=javascript:; class='close fa fa-times' title=Close></a></div></nav><div class=section-container><section></section></div>"
}); });
$.on($('.export', Settings.dialog), 'click', Settings["export"]); $.on($('.export', Settings.dialog), 'click', Settings["export"]);
$.on($('.import', Settings.dialog), 'click', Settings["import"]); $.on($('.import', Settings.dialog), 'click', Settings["import"]);

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.9.3.1 // @version 1.9.3.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.3.1 // @version 1.9.3.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.3.1 * 4chan X - Version 1.9.3.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
@ -183,9 +183,9 @@
'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'], 'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'],
'Replace PNG': [false, 'Replace png thumbnails with the actual image.'], 'Replace PNG': [false, 'Replace png thumbnails with the actual image.'],
'Replace WEBM': [false, 'Replace webm thumbnails with the actual webm video. Probably will degrade browser performance ;)'], 'Replace WEBM': [false, 'Replace webm thumbnails with the actual webm video. Probably will degrade browser performance ;)'],
'Image Prefetching': [false, 'Preload images'], 'Image Prefetching': [false, 'Add link in header menu to turn on image preloading.'],
'Fappe Tyme': [false, 'Hide posts without images. *hint* *hint*'], 'Fappe Tyme': [false, 'Hide posts without images when header menu item is checked. *hint* *hint*'],
'Werk Tyme': [false, 'Hide all post images.'], 'Werk Tyme': [false, 'Hide all post images when header menu item is checked.'],
'Autoplay': [true, 'Videos begin playing immediately when opened.'], 'Autoplay': [true, 'Videos begin playing immediately when opened.'],
'Show Controls': [true, 'Show controls on videos expanded inline. Turn this off if you want to contract videos by clicking on them.'], 'Show Controls': [true, 'Show controls on videos expanded inline. Turn this off if you want to contract videos by clicking on them.'],
'Loop in New Tab': [true, 'Loop videos opened in their own tabs.'] 'Loop in New Tab': [true, 'Loop videos opened in their own tabs.']
@ -330,17 +330,17 @@
'Toggle sage': ['Alt+s', 'Toggle sage in options field.'], 'Toggle sage': ['Alt+s', 'Toggle sage in options field.'],
'Submit QR': ['Ctrl+Enter', 'Submit post.'], 'Submit QR': ['Ctrl+Enter', 'Submit post.'],
'Watch': ['w', 'Watch thread.'], 'Watch': ['w', 'Watch thread.'],
'Update': ['r', 'Update the thread now.'], 'Update': ['r', 'Update the thread / refresh the index.'],
'Expand image': ['Shift+e', 'Expand selected image.'], 'Expand image': ['Shift+e', 'Expand selected image.'],
'Expand images': ['e', 'Expand all images.'], 'Expand images': ['e', 'Expand all images.'],
'Open Gallery': ['g', 'Opens the gallery.'], 'Open Gallery': ['g', 'Opens the gallery.'],
'fappeTyme': ['f', 'Fappe Tyme.'], 'fappeTyme': ['f', 'Toggle Fappe Tyme.'],
'werkTyme': ['Shift+w', 'Werk Tyme'], 'werkTyme': ['Shift+w', 'Toggle Werk Tyme.'],
'Front page': ['1', 'Jump to front page.'], 'Front page': ['1', 'Jump to front page.'],
'Open front page': ['Shift+1', 'Open front page in a new tab.'], 'Open front page': ['Shift+1', 'Open front page in a new tab.'],
'Next page': ['Ctrl+Right', 'Jump to the next page.'], 'Next page': ['Ctrl+Right', 'Jump to the next page.'],
'Previous page': ['Ctrl+Left', 'Jump to the previous page.'], 'Previous page': ['Ctrl+Left', 'Jump to the previous page.'],
'Open catalog': ['Shift+c', 'Open the catalog of the current board'], 'Open catalog': ['Shift+c', 'Open the catalog of the current board.'],
'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'], 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'],
'Next thread': ['Ctrl+Down', 'See next thread.'], 'Next thread': ['Ctrl+Down', 'See next thread.'],
'Previous thread': ['Ctrl+Up', 'See previous thread.'], 'Previous thread': ['Ctrl+Up', 'See previous thread.'],
@ -376,7 +376,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.9.3.1', VERSION: '1.9.3.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',
@ -4036,14 +4036,16 @@
return $.set("" + this.id + ".position", this.style.cssText); return $.set("" + this.id + ".position", this.style.cssText);
}; };
hoverstart = function(_arg) { hoverstart = function(_arg) {
var asapTest, cb, el, endEvents, latestEvent, noRemove, o, root; var asapTest, cb, el, endEvents, latestEvent, noRemove, o, root, _ref;
root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb, noRemove = _arg.noRemove; root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb, noRemove = _arg.noRemove;
o = { o = {
root: root, root: root,
el: el, el: el,
style: el.style, style: el.style,
isImage: (_ref = el.nodeName) === 'IMG' || _ref === 'VIDEO',
cb: cb, cb: cb,
endEvents: endEvents, endEvents: endEvents,
ready: false,
latestEvent: latestEvent, latestEvent: latestEvent,
clientHeight: doc.clientHeight, clientHeight: doc.clientHeight,
clientWidth: doc.clientWidth, clientWidth: doc.clientWidth,
@ -4054,6 +4056,7 @@
$.asap(function() { $.asap(function() {
return !el.parentNode || asapTest(); return !el.parentNode || asapTest();
}, function() { }, function() {
o.ready = true;
if (el.parentNode) { if (el.parentNode) {
return o.hover(o.latestEvent); return o.hover(o.latestEvent);
} }
@ -4071,13 +4074,19 @@
return $.on(doc, 'mousemove', o.workaround); return $.on(doc, 'mousemove', o.workaround);
}; };
hover = function(e) { hover = function(e) {
var clientX, clientY, height, left, right, style, top, _ref; var clientX, clientY, height, left, right, style, threshold, top, _ref;
this.latestEvent = e; this.latestEvent = e;
if (!this.ready) {
return;
}
height = this.el.offsetHeight; height = this.el.offsetHeight;
clientX = e.clientX, clientY = e.clientY; clientX = e.clientX, clientY = e.clientY;
top = clientY - 120; top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120));
top = this.clientHeight <= height || top <= 0 ? 0 : top + height >= this.clientHeight ? this.clientHeight - height : top; threshold = this.clientWidth / 2;
_ref = clientX <= this.clientWidth / 2 ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = _ref[0], right = _ref[1]; if (!this.isImage) {
threshold = Math.max(threshold, this.clientWidth - 400);
}
_ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = _ref[0], right = _ref[1];
style = this.style; style = this.style;
style.top = top + 'px'; style.top = top + 'px';
style.left = left; style.left = left;
@ -5745,7 +5754,7 @@
} else { } else {
QuoteYou.lastRead = post; QuoteYou.lastRead = post;
window.location = "#" + post.id; window.location = "#" + post.id;
Header.scrollToPost(post); Header.scrollTo(post);
$.addClass($('.post', post), 'highlight'); $.addClass($('.post', post), 'highlight');
return true; return true;
} }
@ -7661,7 +7670,7 @@
} }
}, },
build: function(image) { build: function(image) {
var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, value, _i, _j, _len, _len1, _ref, _ref1, _ref2; var candidate, cb, dialog, entry, file, key, menuButton, nodes, post, thumb, value, _i, _j, _len, _len1, _ref, _ref1, _ref2;
Gallery.images = []; Gallery.images = [];
nodes = Gallery.nodes = {}; nodes = Gallery.nodes = {};
Gallery.fullIDs = {}; Gallery.fullIDs = {};
@ -7725,7 +7734,13 @@
$.add(d.body, dialog); $.add(d.body, dialog);
nodes.thumbs.scrollTop = 0; nodes.thumbs.scrollTop = 0;
nodes.current.parentElement.scrollTop = 0; nodes.current.parentElement.scrollTop = 0;
Gallery.open(image ? $("[href='" + image.href + "']", nodes.thumbs) || Gallery.images[0] : Gallery.images[0]); if (image) {
thumb = $("[href='" + image.href + "']", nodes.thumbs);
}
thumb || (thumb = Gallery.images[Gallery.images.length - 1]);
if (thumb) {
Gallery.open(thumb);
}
doc.style.overflow = 'hidden'; doc.style.overflow = 'hidden';
return nodes.total.textContent = Gallery.images.length; return nodes.total.textContent = Gallery.images.length;
}, },
@ -12869,7 +12884,7 @@
className: 'dialog' className: 'dialog'
}); });
$.extend(dialog, { $.extend(dialog, {
innerHTML: "<nav><div class=sections-list></div><p class='imp-exp-result warning'></p><div class=credits><a class=export>Export</a>&nbsp|&nbsp<a class=import>Import</a>&nbsp|&nbsp<a class=reset>Reset Settings</a>&nbsp|&nbsp<input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.3.1</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a>&nbsp|&nbsp<a href=javascript:; class='close fa fa-times' title=Close></a></div></nav><div class=section-container><section></section></div>" innerHTML: "<nav><div class=sections-list></div><p class='imp-exp-result warning'></p><div class=credits><a class=export>Export</a>&nbsp|&nbsp<a class=import>Import</a>&nbsp|&nbsp<a class=reset>Reset Settings</a>&nbsp|&nbsp<input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.3.2</a>&nbsp|&nbsp<a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a>&nbsp|&nbsp<a href=javascript:; class='close fa fa-times' title=Close></a></div></nav><div class=section-container><section></section></div>"
}); });
$.on($('.export', Settings.dialog), 'click', Settings["export"]); $.on($('.export', Settings.dialog), 'click', Settings["export"]);
$.on($('.import', Settings.dialog), 'click', Settings["import"]); $.on($('.import', Settings.dialog), 'click', Settings["import"]);

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.3.1' /> <updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.9.3.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.3.1' /> <updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.9.3.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.3.1", "version": "1.9.3.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

@ -189,15 +189,15 @@ Config =
] ]
'Image Prefetching': [ 'Image Prefetching': [
false false
'Preload images' 'Add link in header menu to turn on image preloading.'
] ]
'Fappe Tyme': [ 'Fappe Tyme': [
false false
'Hide posts without images. *hint* *hint*' 'Hide posts without images when header menu item is checked. *hint* *hint*'
] ]
'Werk Tyme': [ 'Werk Tyme': [
false false
'Hide all post images.' 'Hide all post images when header menu item is checked.'
] ]
'Autoplay': [ 'Autoplay': [
true true
@ -661,7 +661,7 @@ vp-replace
] ]
'Update': [ 'Update': [
'r' 'r'
'Update the thread now.' 'Update the thread / refresh the index.'
] ]
# Images # Images
'Expand image': [ 'Expand image': [
@ -678,11 +678,11 @@ vp-replace
] ]
'fappeTyme': [ 'fappeTyme': [
'f' 'f'
'Fappe Tyme.' 'Toggle Fappe Tyme.'
] ]
'werkTyme': [ 'werkTyme': [
'Shift+w' 'Shift+w'
'Werk Tyme' 'Toggle Werk Tyme.'
] ]
# Board Navigation # Board Navigation
'Front page': [ 'Front page': [
@ -703,7 +703,7 @@ vp-replace
] ]
'Open catalog': [ 'Open catalog': [
'Shift+c' 'Shift+c'
'Open the catalog of the current board' 'Open the catalog of the current board.'
] ]
'Search form': [ 'Search form': [
'Ctrl+Alt+s' 'Ctrl+Alt+s'

View File

@ -59,6 +59,6 @@ QuoteYou =
else else
QuoteYou.lastRead = post QuoteYou.lastRead = post
window.location = "##{post.id}" window.location = "##{post.id}"
Header.scrollToPost post Header.scrollTo post
$.addClass $('.post', post), 'highlight' $.addClass $('.post', post), 'highlight'
return true return true