diff --git a/CHANGELOG.md b/CHANGELOG.md
index bed2bc603..8c4a774fc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,9 @@
### v1.14.12
+**v1.14.12.4** *(2019-08-11)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.12.4/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.12.4/builds/4chan-X-noupdate.crx)]
+- Move prefetch toggle from header menu to shortcut icons and make the option show up by default.
+
**v1.14.12.3** *(2019-08-09)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.12.3/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.12.3/builds/4chan-X-noupdate.crx)]
- Merge v1.14.11.4: Assume Chrome is broken by default. #2378
diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx
index 959fd972c..b8566b31e 100644
Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ
diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js
index d684e9d9f..d68f22c5d 100644
--- a/builds/4chan-X-beta.meta.js
+++ b/builds/4chan-X-beta.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
-// @version 1.14.12.3
+// @version 1.14.12.4
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js
index c22bbd80f..a1a0381c8 100644
--- a/builds/4chan-X-beta.user.js
+++ b/builds/4chan-X-beta.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
-// @version 1.14.12.3
+// @version 1.14.12.4
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -199,7 +199,7 @@ docSet = function() {
};
g = {
- VERSION: '1.14.12.3',
+ VERSION: '1.14.12.4',
NAMESPACE: '4chan X.',
sites: Object.create(null),
boards: Object.create(null)
@@ -307,7 +307,7 @@ Config = (function() {
'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'],
'Replace PNG': [false, 'Replace png thumbnails with the actual image.'],
'Replace WEBM': [false, 'Replace webm and mp4 thumbnails with the actual video. Probably will degrade browser performance ;)'],
- 'Image Prefetching': [false, 'Add link in header menu to turn on image preloading.'],
+ 'Image Prefetching': [true, 'Add a shortcut icon to the header to turn on image preloading.'],
'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'],
'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'],
'Autoplay': [true, 'Videos begin playing immediately when opened.'],
@@ -15611,11 +15611,11 @@ ImageLoader = (function() {
ImageLoader = {
init: function() {
- var prefetch, ref, ref1;
+ var el, ref, ref1, replace;
if ((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') {
return;
}
- if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
+ if (!(Conf['Image Prefetching'] || (replace = Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM']))) {
return;
}
Callbacks.Post.push({
@@ -15623,7 +15623,9 @@ ImageLoader = (function() {
cb: this.node
});
$.on(d, 'PostsInserted', function() {
- return g.posts.forEach(ImageLoader.prefetchAll);
+ if (ImageLoader.prefetchEnabled || replace) {
+ return g.posts.forEach(ImageLoader.prefetchAll);
+ }
});
if (Conf['Replace WEBM']) {
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
@@ -15631,13 +15633,14 @@ ImageLoader = (function() {
if (!(Conf['Image Prefetching'] && ((ref1 = g.VIEW) === 'index' || ref1 === 'thread'))) {
return;
}
- prefetch = $.el('label', {innerHTML: " Prefetch Images"});
- this.el = prefetch.firstElementChild;
- $.on(this.el, 'change', this.toggle);
- return Header.menu.addEntry({
- el: prefetch,
- order: 98
+ el = $.el('a', {
+ href: 'javascript:;',
+ title: 'Prefetch Images',
+ className: 'fa fa-bolt disabled',
+ textContent: 'Prefetch'
});
+ $.on(el, 'click', this.toggle);
+ return Header.addShortcut('gallery', el, 525);
},
node: function() {
var file, i, len, ref;
@@ -15691,7 +15694,7 @@ ImageLoader = (function() {
}
}
replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src);
- if (!(replace || Conf['prefetch'])) {
+ if (!(replace || ImageLoader.prefetchEnabled)) {
return;
}
if ($.hasClass(doc, 'catalog-mode')) {
@@ -15740,7 +15743,9 @@ ImageLoader = (function() {
}
},
toggle: function() {
- if (Conf['prefetch'] = this.checked) {
+ ImageLoader.prefetchEnabled = !ImageLoader.prefetchEnabled;
+ this.classList.toggle('disabled', !ImageLoader.prefetchEnabled);
+ if (ImageLoader.prefetchEnabled) {
g.posts.forEach(ImageLoader.prefetchAll);
}
},
diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx
index 9f9d67deb..88a9c8bcf 100644
Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ
diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js
index aaf0bc7e7..6f796091f 100644
--- a/builds/4chan-X-noupdate.user.js
+++ b/builds/4chan-X-noupdate.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.14.12.3
+// @version 1.14.12.4
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -199,7 +199,7 @@ docSet = function() {
};
g = {
- VERSION: '1.14.12.3',
+ VERSION: '1.14.12.4',
NAMESPACE: '4chan X.',
sites: Object.create(null),
boards: Object.create(null)
@@ -307,7 +307,7 @@ Config = (function() {
'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'],
'Replace PNG': [false, 'Replace png thumbnails with the actual image.'],
'Replace WEBM': [false, 'Replace webm and mp4 thumbnails with the actual video. Probably will degrade browser performance ;)'],
- 'Image Prefetching': [false, 'Add link in header menu to turn on image preloading.'],
+ 'Image Prefetching': [true, 'Add a shortcut icon to the header to turn on image preloading.'],
'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'],
'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'],
'Autoplay': [true, 'Videos begin playing immediately when opened.'],
@@ -15611,11 +15611,11 @@ ImageLoader = (function() {
ImageLoader = {
init: function() {
- var prefetch, ref, ref1;
+ var el, ref, ref1, replace;
if ((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') {
return;
}
- if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
+ if (!(Conf['Image Prefetching'] || (replace = Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM']))) {
return;
}
Callbacks.Post.push({
@@ -15623,7 +15623,9 @@ ImageLoader = (function() {
cb: this.node
});
$.on(d, 'PostsInserted', function() {
- return g.posts.forEach(ImageLoader.prefetchAll);
+ if (ImageLoader.prefetchEnabled || replace) {
+ return g.posts.forEach(ImageLoader.prefetchAll);
+ }
});
if (Conf['Replace WEBM']) {
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
@@ -15631,13 +15633,14 @@ ImageLoader = (function() {
if (!(Conf['Image Prefetching'] && ((ref1 = g.VIEW) === 'index' || ref1 === 'thread'))) {
return;
}
- prefetch = $.el('label', {innerHTML: " Prefetch Images"});
- this.el = prefetch.firstElementChild;
- $.on(this.el, 'change', this.toggle);
- return Header.menu.addEntry({
- el: prefetch,
- order: 98
+ el = $.el('a', {
+ href: 'javascript:;',
+ title: 'Prefetch Images',
+ className: 'fa fa-bolt disabled',
+ textContent: 'Prefetch'
});
+ $.on(el, 'click', this.toggle);
+ return Header.addShortcut('gallery', el, 525);
},
node: function() {
var file, i, len, ref;
@@ -15691,7 +15694,7 @@ ImageLoader = (function() {
}
}
replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src);
- if (!(replace || Conf['prefetch'])) {
+ if (!(replace || ImageLoader.prefetchEnabled)) {
return;
}
if ($.hasClass(doc, 'catalog-mode')) {
@@ -15740,7 +15743,9 @@ ImageLoader = (function() {
}
},
toggle: function() {
- if (Conf['prefetch'] = this.checked) {
+ ImageLoader.prefetchEnabled = !ImageLoader.prefetchEnabled;
+ this.classList.toggle('disabled', !ImageLoader.prefetchEnabled);
+ if (ImageLoader.prefetchEnabled) {
g.posts.forEach(ImageLoader.prefetchAll);
}
},
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index f2895bfda..77c3ee104 100644
Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ
diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js
index 4f8fe8fef..1ea8c2fd2 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.14.12.3
+// @version 1.14.12.4
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 095a2d58d..e12205a8f 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.14.12.3
+// @version 1.14.12.4
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -199,7 +199,7 @@ docSet = function() {
};
g = {
- VERSION: '1.14.12.3',
+ VERSION: '1.14.12.4',
NAMESPACE: '4chan X.',
sites: Object.create(null),
boards: Object.create(null)
@@ -307,7 +307,7 @@ Config = (function() {
'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'],
'Replace PNG': [false, 'Replace png thumbnails with the actual image.'],
'Replace WEBM': [false, 'Replace webm and mp4 thumbnails with the actual video. Probably will degrade browser performance ;)'],
- 'Image Prefetching': [false, 'Add link in header menu to turn on image preloading.'],
+ 'Image Prefetching': [true, 'Add a shortcut icon to the header to turn on image preloading.'],
'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'],
'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'],
'Autoplay': [true, 'Videos begin playing immediately when opened.'],
@@ -15611,11 +15611,11 @@ ImageLoader = (function() {
ImageLoader = {
init: function() {
- var prefetch, ref, ref1;
+ var el, ref, ref1, replace;
if ((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') {
return;
}
- if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) {
+ if (!(Conf['Image Prefetching'] || (replace = Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM']))) {
return;
}
Callbacks.Post.push({
@@ -15623,7 +15623,9 @@ ImageLoader = (function() {
cb: this.node
});
$.on(d, 'PostsInserted', function() {
- return g.posts.forEach(ImageLoader.prefetchAll);
+ if (ImageLoader.prefetchEnabled || replace) {
+ return g.posts.forEach(ImageLoader.prefetchAll);
+ }
});
if (Conf['Replace WEBM']) {
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
@@ -15631,13 +15633,14 @@ ImageLoader = (function() {
if (!(Conf['Image Prefetching'] && ((ref1 = g.VIEW) === 'index' || ref1 === 'thread'))) {
return;
}
- prefetch = $.el('label', {innerHTML: " Prefetch Images"});
- this.el = prefetch.firstElementChild;
- $.on(this.el, 'change', this.toggle);
- return Header.menu.addEntry({
- el: prefetch,
- order: 98
+ el = $.el('a', {
+ href: 'javascript:;',
+ title: 'Prefetch Images',
+ className: 'fa fa-bolt disabled',
+ textContent: 'Prefetch'
});
+ $.on(el, 'click', this.toggle);
+ return Header.addShortcut('gallery', el, 525);
},
node: function() {
var file, i, len, ref;
@@ -15691,7 +15694,7 @@ ImageLoader = (function() {
}
}
replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src);
- if (!(replace || Conf['prefetch'])) {
+ if (!(replace || ImageLoader.prefetchEnabled)) {
return;
}
if ($.hasClass(doc, 'catalog-mode')) {
@@ -15740,7 +15743,9 @@ ImageLoader = (function() {
}
},
toggle: function() {
- if (Conf['prefetch'] = this.checked) {
+ ImageLoader.prefetchEnabled = !ImageLoader.prefetchEnabled;
+ this.classList.toggle('disabled', !ImageLoader.prefetchEnabled);
+ if (ImageLoader.prefetchEnabled) {
g.posts.forEach(ImageLoader.prefetchAll);
}
},
diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip
index a9ddb8624..0cfebff68 100644
Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ
diff --git a/builds/updates-beta.json b/builds/updates-beta.json
index 4f9cb041b..9dbddf956 100644
--- a/builds/updates-beta.json
+++ b/builds/updates-beta.json
@@ -3,7 +3,7 @@
"4chan-x@4chan-x.net": {
"updates": [
{
- "version": "1.14.12.3",
+ "version": "1.14.12.4",
"update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx"
}
]
diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml
index 9aa4b26b7..59f5dc9e5 100644
--- a/builds/updates-beta.xml
+++ b/builds/updates-beta.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/builds/updates.json b/builds/updates.json
index 6b09b688d..5e5758fc9 100644
--- a/builds/updates.json
+++ b/builds/updates.json
@@ -3,7 +3,7 @@
"4chan-x@4chan-x.net": {
"updates": [
{
- "version": "1.14.12.3",
+ "version": "1.14.12.4",
"update_link": "https://www.4chan-x.net/builds/4chan-X.crx"
}
]
diff --git a/builds/updates.xml b/builds/updates.xml
index b2329998a..0d2a2ea2c 100644
--- a/builds/updates.xml
+++ b/builds/updates.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/version.json b/version.json
index 07bd6b939..c25f3f8e7 100644
--- a/version.json
+++ b/version.json
@@ -1,4 +1,4 @@
{
- "version": "1.14.12.3",
- "date": "2019-08-09T15:12:38.410Z"
+ "version": "1.14.12.4",
+ "date": "2019-08-11T19:37:18.650Z"
}
\ No newline at end of file