Release 4chan X v1.9.2.8.
This commit is contained in:
parent
ccf898c72d
commit
0c59246f39
@ -1,3 +1,9 @@
|
|||||||
|
### v1.9.2.8
|
||||||
|
*2014-09-11*
|
||||||
|
|
||||||
|
**ccd0**
|
||||||
|
- Simplify and improve thumbnail replacement / preloading. Remove the download queue (didn't work well). Drop support for non-autoplaying replaced WebM thumbnails.
|
||||||
|
|
||||||
### v1.9.2.7
|
### v1.9.2.7
|
||||||
*2014-09-10*
|
*2014-09-10*
|
||||||
|
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.9.2.7
|
* 4chan X - Version 1.9.2.8
|
||||||
*
|
*
|
||||||
* 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.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.9.2.7
|
// @version 1.9.2.8
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.9.2.7
|
// @version 1.9.2.8
|
||||||
// @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.2.7
|
* 4chan X - Version 1.9.2.8
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -376,7 +376,7 @@
|
|||||||
doc = d.documentElement;
|
doc = d.documentElement;
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.9.2.7',
|
VERSION: '1.9.2.8',
|
||||||
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',
|
||||||
@ -692,15 +692,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$.one = function(el, events, handler) {
|
|
||||||
var handler2;
|
|
||||||
handler2 = function(e) {
|
|
||||||
$.off(el, events, handler2);
|
|
||||||
return handler.call(this, e);
|
|
||||||
};
|
|
||||||
return $.on(el, events, handler2);
|
|
||||||
};
|
|
||||||
|
|
||||||
$.event = function(event, detail, root) {
|
$.event = function(event, detail, root) {
|
||||||
if (root == null) {
|
if (root == null) {
|
||||||
root = d;
|
root = d;
|
||||||
@ -8658,25 +8649,30 @@
|
|||||||
if (g.VIEW === 'catalog') {
|
if (g.VIEW === 'catalog') {
|
||||||
return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
Post.callbacks.push({
|
Post.callbacks.push({
|
||||||
name: 'Image Replace',
|
name: 'Image Replace',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
});
|
});
|
||||||
if (Conf['Replace WEBM'] && Conf['Autoplay']) {
|
$.on(d, 'PostsInserted', function() {
|
||||||
$.on(d, 'scroll visibilitychange', function() {
|
return g.posts.forEach(ImageLoader.prefetch);
|
||||||
|
});
|
||||||
|
if (Conf['Replace WEBM']) {
|
||||||
|
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', function() {
|
||||||
|
var qpClone, _ref;
|
||||||
|
qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
|
||||||
return g.posts.forEach(function(post) {
|
return g.posts.forEach(function(post) {
|
||||||
var thumb, _i, _len, _ref, _ref1;
|
var thumb, _i, _len, _ref1, _ref2;
|
||||||
_ref = [post].concat(__slice.call(post.clones));
|
_ref1 = [post].concat(__slice.call(post.clones));
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||||
post = _ref[_i];
|
post = _ref1[_i];
|
||||||
if (!((_ref1 = post.file) != null ? _ref1.videoThumb : void 0)) {
|
if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
thumb = post.file.thumb;
|
thumb = post.file.thumb;
|
||||||
if (Header.isNodeVisible(thumb)) {
|
if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) {
|
||||||
thumb.play();
|
thumb.play();
|
||||||
} else {
|
} else {
|
||||||
thumb.pause();
|
thumb.pause();
|
||||||
@ -8685,16 +8681,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$.on(d, 'PostsInserted', function() {
|
|
||||||
var thumb, thumbsToPlay, _i, _len;
|
|
||||||
thumbsToPlay = ImageLoader.thumbsToPlay;
|
|
||||||
ImageLoader.thumbsToPlay = [];
|
|
||||||
for (_i = 0, _len = thumbsToPlay.length; _i < _len; _i++) {
|
|
||||||
thumb = thumbsToPlay[_i];
|
|
||||||
ImageLoader.play(thumb);
|
|
||||||
}
|
|
||||||
return g.posts.forEach(ImageLoader.prefetch);
|
|
||||||
});
|
|
||||||
if (!Conf['Image Prefetching']) {
|
if (!Conf['Image Prefetching']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -8713,23 +8699,47 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
var _ref;
|
if (this.isClone || !this.file) {
|
||||||
if (this.isClone) {
|
return;
|
||||||
if ((_ref = this.file) != null ? _ref.videoThumb : void 0) {
|
}
|
||||||
return ImageLoader.play(this.file.thumb);
|
if (Conf['Replace WEBM'] && this.file.isVideo) {
|
||||||
|
ImageLoader.replaceVideo(this);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return ImageLoader.prefetch(this);
|
return ImageLoader.prefetch(this);
|
||||||
|
},
|
||||||
|
replaceVideo: function(post) {
|
||||||
|
var attr, file, thumb, video, _i, _len, _ref;
|
||||||
|
file = post.file;
|
||||||
|
thumb = file.thumb;
|
||||||
|
video = $.el('video', {
|
||||||
|
preload: 'none',
|
||||||
|
loop: true,
|
||||||
|
poster: thumb.src,
|
||||||
|
textContent: thumb.alt,
|
||||||
|
className: thumb.className
|
||||||
|
});
|
||||||
|
video.dataset.md5 = thumb.dataset.md5;
|
||||||
|
_ref = ['height', 'width', 'maxHeight', 'maxWidth'];
|
||||||
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
|
attr = _ref[_i];
|
||||||
|
video.style[attr] = thumb.style[attr];
|
||||||
}
|
}
|
||||||
|
video.src = file.URL;
|
||||||
|
if (Conf['Image Hover']) {
|
||||||
|
$.on(video, 'mouseover', ImageHover.mouseover);
|
||||||
|
}
|
||||||
|
$.replace(thumb, video);
|
||||||
|
file.thumb = video;
|
||||||
|
return file.videoThumb = true;
|
||||||
},
|
},
|
||||||
prefetch: function(post) {
|
prefetch: function(post) {
|
||||||
var URL, el, file, isImage, isVideo, match, replace, thumb, type;
|
var URL, clone, el, file, isImage, isVideo, match, replace, thumb, type, _i, _len, _ref;
|
||||||
file = post.file;
|
file = post.file;
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, URL = file.URL;
|
isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, URL = file.URL;
|
||||||
if (!(isImage || isVideo) || post.isHidden || post.thread.isHidden || file.isPrefetched) {
|
if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
type = (match = URL.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
|
type = (match = URL.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
|
||||||
@ -8743,108 +8753,33 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file.isPrefetched = true;
|
file.isPrefetched = true;
|
||||||
el = $.el(isImage ? 'img' : 'video');
|
if (file.videoThumb) {
|
||||||
if (replace) {
|
|
||||||
if (isImage) {
|
|
||||||
$.on(el, 'load', (function(_this) {
|
|
||||||
return function() {
|
|
||||||
return ImageLoader.replaceImage(post);
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
} else {
|
|
||||||
$.one(el, 'loadeddata', (function(_this) {
|
|
||||||
return function() {
|
|
||||||
return ImageLoader.replaceVideo(post, el);
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ImageLoader.queueDownload(el, URL);
|
|
||||||
},
|
|
||||||
queueDownload: (function() {
|
|
||||||
var busy, items, load;
|
|
||||||
busy = false;
|
|
||||||
items = [];
|
|
||||||
load = function(el, url) {
|
|
||||||
$.one(el, 'load loadedmetadata error', function() {
|
|
||||||
var el2, item, url2;
|
|
||||||
busy = false;
|
|
||||||
if (item = items.shift()) {
|
|
||||||
el2 = item[0], url2 = item[1];
|
|
||||||
return load(el2, url2);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
el.src = url;
|
|
||||||
return busy = true;
|
|
||||||
};
|
|
||||||
return function(el, url) {
|
|
||||||
if (busy) {
|
|
||||||
return items.push([el, url]);
|
|
||||||
} else {
|
|
||||||
return load(el, url);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})(),
|
|
||||||
replaceImage: function(post) {
|
|
||||||
var _i, _len, _ref;
|
|
||||||
_ref = [post].concat(__slice.call(post.clones));
|
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
|
||||||
post = _ref[_i];
|
|
||||||
post.file.thumb.src = post.file.URL;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
replaceVideo: function(post, video) {
|
|
||||||
var clone, file, style, thumb, video2, _i, _len, _ref;
|
|
||||||
file = post.file;
|
|
||||||
thumb = file.thumb;
|
|
||||||
style = thumb.style;
|
|
||||||
if (!post.isClone) {
|
|
||||||
_ref = post.clones;
|
_ref = post.clones;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
clone = _ref[_i];
|
clone = _ref[_i];
|
||||||
video2 = $.el('video');
|
clone.file.thumb.preload = 'auto';
|
||||||
$.one(video2, 'loadeddata', (function(_this) {
|
|
||||||
return function() {
|
|
||||||
return ImageLoader.replaceVideo(clone, video2);
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
video2.src = video.src;
|
|
||||||
}
|
}
|
||||||
|
thumb.preload = 'auto';
|
||||||
|
if (typeof chrome === "undefined" || chrome === null) {
|
||||||
|
$.on(thumb, 'loadeddata', function() {
|
||||||
|
return this.removeAttribute('poster');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (typeof chrome !== "undefined" && chrome !== null) {
|
|
||||||
video.poster = thumb.src;
|
|
||||||
}
|
|
||||||
video.loop = true;
|
|
||||||
video.textContent = thumb.alt;
|
|
||||||
video.dataset.md5 = thumb.dataset.md5;
|
|
||||||
video.style.height = style.height;
|
|
||||||
video.style.width = style.width;
|
|
||||||
video.style.maxHeight = style.maxHeight;
|
|
||||||
video.style.maxWidth = style.maxWidth;
|
|
||||||
video.className = thumb.className;
|
|
||||||
if (Conf['Image Hover']) {
|
|
||||||
$.on(video, 'mouseover', ImageHover.mouseover);
|
|
||||||
}
|
|
||||||
$.replace(thumb, video);
|
|
||||||
file.thumb = video;
|
|
||||||
file.videoThumb = true;
|
|
||||||
if (doc.contains(video) || post.isClone) {
|
|
||||||
return ImageLoader.play(video);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
thumbsToPlay: [],
|
|
||||||
play: function(thumb) {
|
|
||||||
var _ref;
|
|
||||||
if (!Conf['Autoplay']) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (doc.contains(thumb)) {
|
el = $.el(isImage ? 'img' : 'video');
|
||||||
if (Header.isNodeVisible(thumb) || ((_ref = $.id('qp')) != null ? _ref.contains(thumb) : void 0)) {
|
if (replace && isImage) {
|
||||||
return thumb.play();
|
$.on(el, 'load', function() {
|
||||||
|
var _j, _len1, _ref1;
|
||||||
|
_ref1 = post.clones;
|
||||||
|
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
||||||
|
clone = _ref1[_j];
|
||||||
|
clone.file.thumb.src = URL;
|
||||||
}
|
}
|
||||||
} else {
|
return thumb.src = URL;
|
||||||
return ImageLoader.thumbsToPlay.push(thumb);
|
});
|
||||||
}
|
}
|
||||||
|
return el.src = URL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -12961,7 +12896,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> | <a class=import>Import</a> | <a class=reset>Reset Settings</a> | <input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a> | <a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.2.7</a> | <a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a> | <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> | <a class=import>Import</a> | <a class=reset>Reset Settings</a> | <input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a> | <a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.2.8</a> | <a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a> | <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.
@ -1,7 +1,7 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.9.2.7
|
// @version 1.9.2.8
|
||||||
// @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.2.7
|
* 4chan X - Version 1.9.2.8
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -375,7 +375,7 @@
|
|||||||
doc = d.documentElement;
|
doc = d.documentElement;
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.9.2.7',
|
VERSION: '1.9.2.8',
|
||||||
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',
|
||||||
@ -691,15 +691,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$.one = function(el, events, handler) {
|
|
||||||
var handler2;
|
|
||||||
handler2 = function(e) {
|
|
||||||
$.off(el, events, handler2);
|
|
||||||
return handler.call(this, e);
|
|
||||||
};
|
|
||||||
return $.on(el, events, handler2);
|
|
||||||
};
|
|
||||||
|
|
||||||
$.event = function(event, detail, root) {
|
$.event = function(event, detail, root) {
|
||||||
if (root == null) {
|
if (root == null) {
|
||||||
root = d;
|
root = d;
|
||||||
@ -8657,25 +8648,30 @@
|
|||||||
if (g.VIEW === 'catalog') {
|
if (g.VIEW === 'catalog') {
|
||||||
return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
Post.callbacks.push({
|
Post.callbacks.push({
|
||||||
name: 'Image Replace',
|
name: 'Image Replace',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
});
|
});
|
||||||
if (Conf['Replace WEBM'] && Conf['Autoplay']) {
|
$.on(d, 'PostsInserted', function() {
|
||||||
$.on(d, 'scroll visibilitychange', function() {
|
return g.posts.forEach(ImageLoader.prefetch);
|
||||||
|
});
|
||||||
|
if (Conf['Replace WEBM']) {
|
||||||
|
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', function() {
|
||||||
|
var qpClone, _ref;
|
||||||
|
qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
|
||||||
return g.posts.forEach(function(post) {
|
return g.posts.forEach(function(post) {
|
||||||
var thumb, _i, _len, _ref, _ref1;
|
var thumb, _i, _len, _ref1, _ref2;
|
||||||
_ref = [post].concat(__slice.call(post.clones));
|
_ref1 = [post].concat(__slice.call(post.clones));
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||||
post = _ref[_i];
|
post = _ref1[_i];
|
||||||
if (!((_ref1 = post.file) != null ? _ref1.videoThumb : void 0)) {
|
if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
thumb = post.file.thumb;
|
thumb = post.file.thumb;
|
||||||
if (Header.isNodeVisible(thumb)) {
|
if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) {
|
||||||
thumb.play();
|
thumb.play();
|
||||||
} else {
|
} else {
|
||||||
thumb.pause();
|
thumb.pause();
|
||||||
@ -8684,16 +8680,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$.on(d, 'PostsInserted', function() {
|
|
||||||
var thumb, thumbsToPlay, _i, _len;
|
|
||||||
thumbsToPlay = ImageLoader.thumbsToPlay;
|
|
||||||
ImageLoader.thumbsToPlay = [];
|
|
||||||
for (_i = 0, _len = thumbsToPlay.length; _i < _len; _i++) {
|
|
||||||
thumb = thumbsToPlay[_i];
|
|
||||||
ImageLoader.play(thumb);
|
|
||||||
}
|
|
||||||
return g.posts.forEach(ImageLoader.prefetch);
|
|
||||||
});
|
|
||||||
if (!Conf['Image Prefetching']) {
|
if (!Conf['Image Prefetching']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -8712,23 +8698,47 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
var _ref;
|
if (this.isClone || !this.file) {
|
||||||
if (this.isClone) {
|
return;
|
||||||
if ((_ref = this.file) != null ? _ref.videoThumb : void 0) {
|
}
|
||||||
return ImageLoader.play(this.file.thumb);
|
if (Conf['Replace WEBM'] && this.file.isVideo) {
|
||||||
|
ImageLoader.replaceVideo(this);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return ImageLoader.prefetch(this);
|
return ImageLoader.prefetch(this);
|
||||||
|
},
|
||||||
|
replaceVideo: function(post) {
|
||||||
|
var attr, file, thumb, video, _i, _len, _ref;
|
||||||
|
file = post.file;
|
||||||
|
thumb = file.thumb;
|
||||||
|
video = $.el('video', {
|
||||||
|
preload: 'none',
|
||||||
|
loop: true,
|
||||||
|
poster: thumb.src,
|
||||||
|
textContent: thumb.alt,
|
||||||
|
className: thumb.className
|
||||||
|
});
|
||||||
|
video.dataset.md5 = thumb.dataset.md5;
|
||||||
|
_ref = ['height', 'width', 'maxHeight', 'maxWidth'];
|
||||||
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
|
attr = _ref[_i];
|
||||||
|
video.style[attr] = thumb.style[attr];
|
||||||
}
|
}
|
||||||
|
video.src = file.URL;
|
||||||
|
if (Conf['Image Hover']) {
|
||||||
|
$.on(video, 'mouseover', ImageHover.mouseover);
|
||||||
|
}
|
||||||
|
$.replace(thumb, video);
|
||||||
|
file.thumb = video;
|
||||||
|
return file.videoThumb = true;
|
||||||
},
|
},
|
||||||
prefetch: function(post) {
|
prefetch: function(post) {
|
||||||
var URL, el, file, isImage, isVideo, match, replace, thumb, type;
|
var URL, clone, el, file, isImage, isVideo, match, replace, thumb, type, _i, _len, _ref;
|
||||||
file = post.file;
|
file = post.file;
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, URL = file.URL;
|
isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, URL = file.URL;
|
||||||
if (!(isImage || isVideo) || post.isHidden || post.thread.isHidden || file.isPrefetched) {
|
if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
type = (match = URL.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
|
type = (match = URL.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
|
||||||
@ -8742,108 +8752,33 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file.isPrefetched = true;
|
file.isPrefetched = true;
|
||||||
el = $.el(isImage ? 'img' : 'video');
|
if (file.videoThumb) {
|
||||||
if (replace) {
|
|
||||||
if (isImage) {
|
|
||||||
$.on(el, 'load', (function(_this) {
|
|
||||||
return function() {
|
|
||||||
return ImageLoader.replaceImage(post);
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
} else {
|
|
||||||
$.one(el, 'loadeddata', (function(_this) {
|
|
||||||
return function() {
|
|
||||||
return ImageLoader.replaceVideo(post, el);
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ImageLoader.queueDownload(el, URL);
|
|
||||||
},
|
|
||||||
queueDownload: (function() {
|
|
||||||
var busy, items, load;
|
|
||||||
busy = false;
|
|
||||||
items = [];
|
|
||||||
load = function(el, url) {
|
|
||||||
$.one(el, 'load loadedmetadata error', function() {
|
|
||||||
var el2, item, url2;
|
|
||||||
busy = false;
|
|
||||||
if (item = items.shift()) {
|
|
||||||
el2 = item[0], url2 = item[1];
|
|
||||||
return load(el2, url2);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
el.src = url;
|
|
||||||
return busy = true;
|
|
||||||
};
|
|
||||||
return function(el, url) {
|
|
||||||
if (busy) {
|
|
||||||
return items.push([el, url]);
|
|
||||||
} else {
|
|
||||||
return load(el, url);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})(),
|
|
||||||
replaceImage: function(post) {
|
|
||||||
var _i, _len, _ref;
|
|
||||||
_ref = [post].concat(__slice.call(post.clones));
|
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
|
||||||
post = _ref[_i];
|
|
||||||
post.file.thumb.src = post.file.URL;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
replaceVideo: function(post, video) {
|
|
||||||
var clone, file, style, thumb, video2, _i, _len, _ref;
|
|
||||||
file = post.file;
|
|
||||||
thumb = file.thumb;
|
|
||||||
style = thumb.style;
|
|
||||||
if (!post.isClone) {
|
|
||||||
_ref = post.clones;
|
_ref = post.clones;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
clone = _ref[_i];
|
clone = _ref[_i];
|
||||||
video2 = $.el('video');
|
clone.file.thumb.preload = 'auto';
|
||||||
$.one(video2, 'loadeddata', (function(_this) {
|
|
||||||
return function() {
|
|
||||||
return ImageLoader.replaceVideo(clone, video2);
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
video2.src = video.src;
|
|
||||||
}
|
}
|
||||||
|
thumb.preload = 'auto';
|
||||||
|
if (typeof chrome === "undefined" || chrome === null) {
|
||||||
|
$.on(thumb, 'loadeddata', function() {
|
||||||
|
return this.removeAttribute('poster');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (typeof chrome !== "undefined" && chrome !== null) {
|
|
||||||
video.poster = thumb.src;
|
|
||||||
}
|
|
||||||
video.loop = true;
|
|
||||||
video.textContent = thumb.alt;
|
|
||||||
video.dataset.md5 = thumb.dataset.md5;
|
|
||||||
video.style.height = style.height;
|
|
||||||
video.style.width = style.width;
|
|
||||||
video.style.maxHeight = style.maxHeight;
|
|
||||||
video.style.maxWidth = style.maxWidth;
|
|
||||||
video.className = thumb.className;
|
|
||||||
if (Conf['Image Hover']) {
|
|
||||||
$.on(video, 'mouseover', ImageHover.mouseover);
|
|
||||||
}
|
|
||||||
$.replace(thumb, video);
|
|
||||||
file.thumb = video;
|
|
||||||
file.videoThumb = true;
|
|
||||||
if (doc.contains(video) || post.isClone) {
|
|
||||||
return ImageLoader.play(video);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
thumbsToPlay: [],
|
|
||||||
play: function(thumb) {
|
|
||||||
var _ref;
|
|
||||||
if (!Conf['Autoplay']) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (doc.contains(thumb)) {
|
el = $.el(isImage ? 'img' : 'video');
|
||||||
if (Header.isNodeVisible(thumb) || ((_ref = $.id('qp')) != null ? _ref.contains(thumb) : void 0)) {
|
if (replace && isImage) {
|
||||||
return thumb.play();
|
$.on(el, 'load', function() {
|
||||||
|
var _j, _len1, _ref1;
|
||||||
|
_ref1 = post.clones;
|
||||||
|
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
||||||
|
clone = _ref1[_j];
|
||||||
|
clone.file.thumb.src = URL;
|
||||||
}
|
}
|
||||||
} else {
|
return thumb.src = URL;
|
||||||
return ImageLoader.thumbsToPlay.push(thumb);
|
});
|
||||||
}
|
}
|
||||||
|
return el.src = URL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -12960,7 +12895,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> | <a class=import>Import</a> | <a class=reset>Reset Settings</a> | <input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a> | <a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.2.7</a> | <a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a> | <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> | <a class=import>Import</a> | <a class=reset>Reset Settings</a> | <input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a> | <a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.2.8</a> | <a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a> | <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.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.9.2.7
|
// @version 1.9.2.8
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.9.2.7
|
// @version 1.9.2.8
|
||||||
// @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.2.7
|
* 4chan X - Version 1.9.2.8
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -376,7 +376,7 @@
|
|||||||
doc = d.documentElement;
|
doc = d.documentElement;
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.9.2.7',
|
VERSION: '1.9.2.8',
|
||||||
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',
|
||||||
@ -692,15 +692,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$.one = function(el, events, handler) {
|
|
||||||
var handler2;
|
|
||||||
handler2 = function(e) {
|
|
||||||
$.off(el, events, handler2);
|
|
||||||
return handler.call(this, e);
|
|
||||||
};
|
|
||||||
return $.on(el, events, handler2);
|
|
||||||
};
|
|
||||||
|
|
||||||
$.event = function(event, detail, root) {
|
$.event = function(event, detail, root) {
|
||||||
if (root == null) {
|
if (root == null) {
|
||||||
root = d;
|
root = d;
|
||||||
@ -8658,25 +8649,30 @@
|
|||||||
if (g.VIEW === 'catalog') {
|
if (g.VIEW === 'catalog') {
|
||||||
return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
Post.callbacks.push({
|
Post.callbacks.push({
|
||||||
name: 'Image Replace',
|
name: 'Image Replace',
|
||||||
cb: this.node
|
cb: this.node
|
||||||
});
|
});
|
||||||
if (Conf['Replace WEBM'] && Conf['Autoplay']) {
|
$.on(d, 'PostsInserted', function() {
|
||||||
$.on(d, 'scroll visibilitychange', function() {
|
return g.posts.forEach(ImageLoader.prefetch);
|
||||||
|
});
|
||||||
|
if (Conf['Replace WEBM']) {
|
||||||
|
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', function() {
|
||||||
|
var qpClone, _ref;
|
||||||
|
qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
|
||||||
return g.posts.forEach(function(post) {
|
return g.posts.forEach(function(post) {
|
||||||
var thumb, _i, _len, _ref, _ref1;
|
var thumb, _i, _len, _ref1, _ref2;
|
||||||
_ref = [post].concat(__slice.call(post.clones));
|
_ref1 = [post].concat(__slice.call(post.clones));
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||||
post = _ref[_i];
|
post = _ref1[_i];
|
||||||
if (!((_ref1 = post.file) != null ? _ref1.videoThumb : void 0)) {
|
if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
thumb = post.file.thumb;
|
thumb = post.file.thumb;
|
||||||
if (Header.isNodeVisible(thumb)) {
|
if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) {
|
||||||
thumb.play();
|
thumb.play();
|
||||||
} else {
|
} else {
|
||||||
thumb.pause();
|
thumb.pause();
|
||||||
@ -8685,16 +8681,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$.on(d, 'PostsInserted', function() {
|
|
||||||
var thumb, thumbsToPlay, _i, _len;
|
|
||||||
thumbsToPlay = ImageLoader.thumbsToPlay;
|
|
||||||
ImageLoader.thumbsToPlay = [];
|
|
||||||
for (_i = 0, _len = thumbsToPlay.length; _i < _len; _i++) {
|
|
||||||
thumb = thumbsToPlay[_i];
|
|
||||||
ImageLoader.play(thumb);
|
|
||||||
}
|
|
||||||
return g.posts.forEach(ImageLoader.prefetch);
|
|
||||||
});
|
|
||||||
if (!Conf['Image Prefetching']) {
|
if (!Conf['Image Prefetching']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -8713,23 +8699,47 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
var _ref;
|
if (this.isClone || !this.file) {
|
||||||
if (this.isClone) {
|
return;
|
||||||
if ((_ref = this.file) != null ? _ref.videoThumb : void 0) {
|
}
|
||||||
return ImageLoader.play(this.file.thumb);
|
if (Conf['Replace WEBM'] && this.file.isVideo) {
|
||||||
|
ImageLoader.replaceVideo(this);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return ImageLoader.prefetch(this);
|
return ImageLoader.prefetch(this);
|
||||||
|
},
|
||||||
|
replaceVideo: function(post) {
|
||||||
|
var attr, file, thumb, video, _i, _len, _ref;
|
||||||
|
file = post.file;
|
||||||
|
thumb = file.thumb;
|
||||||
|
video = $.el('video', {
|
||||||
|
preload: 'none',
|
||||||
|
loop: true,
|
||||||
|
poster: thumb.src,
|
||||||
|
textContent: thumb.alt,
|
||||||
|
className: thumb.className
|
||||||
|
});
|
||||||
|
video.dataset.md5 = thumb.dataset.md5;
|
||||||
|
_ref = ['height', 'width', 'maxHeight', 'maxWidth'];
|
||||||
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
|
attr = _ref[_i];
|
||||||
|
video.style[attr] = thumb.style[attr];
|
||||||
}
|
}
|
||||||
|
video.src = file.URL;
|
||||||
|
if (Conf['Image Hover']) {
|
||||||
|
$.on(video, 'mouseover', ImageHover.mouseover);
|
||||||
|
}
|
||||||
|
$.replace(thumb, video);
|
||||||
|
file.thumb = video;
|
||||||
|
return file.videoThumb = true;
|
||||||
},
|
},
|
||||||
prefetch: function(post) {
|
prefetch: function(post) {
|
||||||
var URL, el, file, isImage, isVideo, match, replace, thumb, type;
|
var URL, clone, el, file, isImage, isVideo, match, replace, thumb, type, _i, _len, _ref;
|
||||||
file = post.file;
|
file = post.file;
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, URL = file.URL;
|
isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, URL = file.URL;
|
||||||
if (!(isImage || isVideo) || post.isHidden || post.thread.isHidden || file.isPrefetched) {
|
if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
type = (match = URL.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
|
type = (match = URL.match(/\.([^.]+)$/)[1].toUpperCase()) === 'JPEG' ? 'JPG' : match;
|
||||||
@ -8743,108 +8753,33 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file.isPrefetched = true;
|
file.isPrefetched = true;
|
||||||
el = $.el(isImage ? 'img' : 'video');
|
if (file.videoThumb) {
|
||||||
if (replace) {
|
|
||||||
if (isImage) {
|
|
||||||
$.on(el, 'load', (function(_this) {
|
|
||||||
return function() {
|
|
||||||
return ImageLoader.replaceImage(post);
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
} else {
|
|
||||||
$.one(el, 'loadeddata', (function(_this) {
|
|
||||||
return function() {
|
|
||||||
return ImageLoader.replaceVideo(post, el);
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ImageLoader.queueDownload(el, URL);
|
|
||||||
},
|
|
||||||
queueDownload: (function() {
|
|
||||||
var busy, items, load;
|
|
||||||
busy = false;
|
|
||||||
items = [];
|
|
||||||
load = function(el, url) {
|
|
||||||
$.one(el, 'load loadedmetadata error', function() {
|
|
||||||
var el2, item, url2;
|
|
||||||
busy = false;
|
|
||||||
if (item = items.shift()) {
|
|
||||||
el2 = item[0], url2 = item[1];
|
|
||||||
return load(el2, url2);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
el.src = url;
|
|
||||||
return busy = true;
|
|
||||||
};
|
|
||||||
return function(el, url) {
|
|
||||||
if (busy) {
|
|
||||||
return items.push([el, url]);
|
|
||||||
} else {
|
|
||||||
return load(el, url);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})(),
|
|
||||||
replaceImage: function(post) {
|
|
||||||
var _i, _len, _ref;
|
|
||||||
_ref = [post].concat(__slice.call(post.clones));
|
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
|
||||||
post = _ref[_i];
|
|
||||||
post.file.thumb.src = post.file.URL;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
replaceVideo: function(post, video) {
|
|
||||||
var clone, file, style, thumb, video2, _i, _len, _ref;
|
|
||||||
file = post.file;
|
|
||||||
thumb = file.thumb;
|
|
||||||
style = thumb.style;
|
|
||||||
if (!post.isClone) {
|
|
||||||
_ref = post.clones;
|
_ref = post.clones;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
clone = _ref[_i];
|
clone = _ref[_i];
|
||||||
video2 = $.el('video');
|
clone.file.thumb.preload = 'auto';
|
||||||
$.one(video2, 'loadeddata', (function(_this) {
|
|
||||||
return function() {
|
|
||||||
return ImageLoader.replaceVideo(clone, video2);
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
video2.src = video.src;
|
|
||||||
}
|
}
|
||||||
|
thumb.preload = 'auto';
|
||||||
|
if (typeof chrome === "undefined" || chrome === null) {
|
||||||
|
$.on(thumb, 'loadeddata', function() {
|
||||||
|
return this.removeAttribute('poster');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (typeof chrome !== "undefined" && chrome !== null) {
|
|
||||||
video.poster = thumb.src;
|
|
||||||
}
|
|
||||||
video.loop = true;
|
|
||||||
video.textContent = thumb.alt;
|
|
||||||
video.dataset.md5 = thumb.dataset.md5;
|
|
||||||
video.style.height = style.height;
|
|
||||||
video.style.width = style.width;
|
|
||||||
video.style.maxHeight = style.maxHeight;
|
|
||||||
video.style.maxWidth = style.maxWidth;
|
|
||||||
video.className = thumb.className;
|
|
||||||
if (Conf['Image Hover']) {
|
|
||||||
$.on(video, 'mouseover', ImageHover.mouseover);
|
|
||||||
}
|
|
||||||
$.replace(thumb, video);
|
|
||||||
file.thumb = video;
|
|
||||||
file.videoThumb = true;
|
|
||||||
if (doc.contains(video) || post.isClone) {
|
|
||||||
return ImageLoader.play(video);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
thumbsToPlay: [],
|
|
||||||
play: function(thumb) {
|
|
||||||
var _ref;
|
|
||||||
if (!Conf['Autoplay']) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (doc.contains(thumb)) {
|
el = $.el(isImage ? 'img' : 'video');
|
||||||
if (Header.isNodeVisible(thumb) || ((_ref = $.id('qp')) != null ? _ref.contains(thumb) : void 0)) {
|
if (replace && isImage) {
|
||||||
return thumb.play();
|
$.on(el, 'load', function() {
|
||||||
|
var _j, _len1, _ref1;
|
||||||
|
_ref1 = post.clones;
|
||||||
|
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
||||||
|
clone = _ref1[_j];
|
||||||
|
clone.file.thumb.src = URL;
|
||||||
}
|
}
|
||||||
} else {
|
return thumb.src = URL;
|
||||||
return ImageLoader.thumbsToPlay.push(thumb);
|
});
|
||||||
}
|
}
|
||||||
|
return el.src = URL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -12961,7 +12896,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> | <a class=import>Import</a> | <a class=reset>Reset Settings</a> | <input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a> | <a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.2.7</a> | <a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a> | <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> | <a class=import>Import</a> | <a class=reset>Reset Settings</a> | <input type=file hidden><a href='https://github.com/ccd0/4chan-x' target=_blank>4chan X</a> | <a href='https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md' target=_blank>1.9.2.8</a> | <a href='https://github.com/ccd0/4chan-x/issues' target=_blank>Issues</a> | <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.
@ -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.2.7' />
|
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.9.2.8' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -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.2.7' />
|
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.9.2.8' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -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.2.7",
|
"version": "1.9.2.8",
|
||||||
"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/",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user