Release 4chan X v1.9.23.6.

This commit is contained in:
ccd0 2015-02-04 01:45:40 -08:00
parent b74cf487f6
commit 928955021f
14 changed files with 131 additions and 150 deletions

View File

@ -3,6 +3,11 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor
The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x). The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x).
<!-- v1.9.23.x --> <!-- v1.9.23.x -->
### v1.9.23.6
*2015-02-04* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.6/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.6/builds/4chan-X-noupdate.crx "Chromium version")]
- Mute videos when removing them to work around a bug where the sound kept playing for some videos.
### v1.9.23.5 ### v1.9.23.5
*2015-02-03* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.5/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.5/builds/4chan-X-noupdate.crx "Chromium version")] *2015-02-03* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.5/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.23.5/builds/4chan-X-noupdate.crx "Chromium version")]

View File

@ -1,5 +1,5 @@
/* /*
* 4chan X - Version 1.9.23.5 * 4chan X - Version 1.9.23.6
* *
* 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.23.5 // @version 1.9.23.6
// @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.23.5 // @version 1.9.23.6
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -25,7 +25,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.9.23.5 * 4chan X - Version 1.9.23.6
* *
* 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
@ -402,7 +402,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.9.23.5', VERSION: '1.9.23.6',
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',
@ -9066,7 +9066,7 @@
return $.add(Gallery.nodes.thumbs, thumb); return $.add(Gallery.nodes.thumbs, thumb);
}, },
open: function(thumb) { open: function(thumb) {
var el, elType, file, name, newID, nodes, oldID, post, slideshow, _base, _ref; var el, elType, file, name, newID, nodes, oldID, post, slideshow, _ref;
nodes = Gallery.nodes; nodes = Gallery.nodes;
name = nodes.name; name = nodes.name;
oldID = +nodes.current.dataset.id; oldID = +nodes.current.dataset.id;
@ -9081,18 +9081,11 @@
file = $.el(elType, { file = $.el(elType, {
title: name.download = name.textContent = thumb.title title: name.download = name.textContent = thumb.title
}); });
$.on(file, 'error', (function(_this) {
return function() {
return Gallery.error(file, thumb);
};
})(this));
file.src = name.href = thumb.href;
$.extend(file.dataset, thumb.dataset); $.extend(file.dataset, thumb.dataset);
if (!nodes.current.error) { $.on(file, 'error', Gallery.error);
if (typeof (_base = nodes.current).pause === "function") { file.src = name.href = thumb.href;
_base.pause(); $.off(nodes.current, 'error', Gallery.error);
} ImageCommon.pause(nodes.current);
}
$.replace(nodes.current, file); $.replace(nodes.current, file);
if (elType === 'video') { if (elType === 'video') {
file.loop = true; file.loop = true;
@ -9118,23 +9111,25 @@
} }
return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2; return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
}, },
error: function(file, thumb) { error: function() {
var _ref; var _ref;
if (((_ref = file.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) { if (((_ref = this.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
return new Notice('error', 'Corrupt or unplayable video', 30); return new Notice('error', 'Corrupt or unplayable video', 30);
} }
if (file.src.split('/')[2] !== 'i.4cdn.org') { if (this.src.split('/')[2] !== 'i.4cdn.org') {
return; return;
} }
return ImageCommon.error(file, g.posts[file.dataset.post], null, function(URL) { return ImageCommon.error(this, g.posts[this.dataset.post], null, (function(_this) {
if (!URL) { return function(url) {
return; if (!url) {
} return;
thumb.href = URL; }
if (Gallery.nodes.current === file) { Gallery.images[_this.dataset.id].href = url;
return file.src = URL; if (Gallery.nodes.current === _this) {
} return _this.src = url;
}); }
};
})(this));
}, },
cleanupTimer: function() { cleanupTimer: function() {
var current; var current;
@ -9272,10 +9267,8 @@
return Gallery.slideshow = false; return Gallery.slideshow = false;
}, },
close: function() { close: function() {
var _base; $.off(Gallery.nodes.current, 'error', Gallery.error);
if (typeof (_base = Gallery.nodes.current).pause === "function") { ImageCommon.pause(Gallery.nodes.current);
_base.pause();
}
$.rm(Gallery.nodes.el); $.rm(Gallery.nodes.el);
$.rmClass(doc, 'gallery-open'); $.rmClass(doc, 'gallery-open');
if (Conf['Fullscreen Gallery']) { if (Conf['Fullscreen Gallery']) {
@ -9360,6 +9353,14 @@
}; };
ImageCommon = { ImageCommon = {
pause: function(video) {
if (video.nodeName !== 'VIDEO') {
return;
}
video.pause();
$.off(video, 'volumechange', Volume.change);
return video.muted = true;
},
rewind: function(el) { rewind: function(el) {
if (el.nodeName === 'VIDEO') { if (el.nodeName === 'VIDEO') {
if (el.readyState >= el.HAVE_METADATA) { if (el.readyState >= el.HAVE_METADATA) {
@ -9671,7 +9672,7 @@
$.off(el, 'error', ImageExpand.error); $.off(el, 'error', ImageExpand.error);
ImageCommon.pushCache(el); ImageCommon.pushCache(el);
if (file.isVideo) { if (file.isVideo) {
el.pause(); ImageCommon.pause(el);
_ref1 = ImageExpand.videoCB; _ref1 = ImageExpand.videoCB;
for (eventName in _ref1) { for (eventName in _ref1) {
cb = _ref1[eventName]; cb = _ref1[eventName];
@ -9694,7 +9695,7 @@
}); });
}, },
expand: function(post, src) { expand: function(post, src) {
var el, file, isNew, isVideo, thumb, _ref; var el, file, isVideo, thumb, _ref;
file = post.file; file = post.file;
thumb = file.thumb, isVideo = file.isVideo; thumb = file.thumb, isVideo = file.isVideo;
if (post.isHidden || file.isExpanding || file.isExpanded) { if (post.isHidden || file.isExpanding || file.isExpanded) {
@ -9712,7 +9713,6 @@
} }
el.removeAttribute('id'); el.removeAttribute('id');
} else { } else {
isNew = true;
el = file.fullImage = $.el((isVideo ? 'video' : 'img')); el = file.fullImage = $.el((isVideo ? 'video' : 'img'));
el.dataset.fullID = post.fullID; el.dataset.fullID = post.fullID;
$.on(el, 'error', ImageExpand.error); $.on(el, 'error', ImageExpand.error);
@ -9728,7 +9728,7 @@
thumb.parentNode.removeAttribute('href'); thumb.parentNode.removeAttribute('href');
thumb.parentNode.removeAttribute('target'); thumb.parentNode.removeAttribute('target');
el.loop = true; el.loop = true;
Volume.setup(el, isNew); Volume.setup(el);
ImageExpand.setupVideoCB(post); ImageExpand.setupVideoCB(post);
} }
if (!isVideo) { if (!isVideo) {
@ -9934,7 +9934,7 @@
}, },
mouseover: function(post) { mouseover: function(post) {
return function(e) { return function(e) {
var el, error, file, height, isNew, isVideo, left, maxHeight, maxWidth, padding, right, scale, width, x, _ref, _ref1, _ref2; var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, right, scale, width, x, _ref, _ref1, _ref2;
if (!doc.contains(this)) { if (!doc.contains(this)) {
return; return;
} }
@ -9948,7 +9948,6 @@
el = ImageCommon.popCache(); el = ImageCommon.popCache();
$.on(el, 'error', error); $.on(el, 'error', error);
} else { } else {
isNew = true;
el = $.el((isVideo ? 'video' : 'img')); el = $.el((isVideo ? 'video' : 'img'));
el.dataset.fullID = post.fullID; el.dataset.fullID = post.fullID;
$.on(el, 'error', error); $.on(el, 'error', error);
@ -9963,7 +9962,7 @@
if (isVideo) { if (isVideo) {
el.loop = true; el.loop = true;
el.controls = false; el.controls = false;
Volume.setup(el, isNew); Volume.setup(el);
if (Conf['Autoplay']) { if (Conf['Autoplay']) {
el.play(); el.play();
} }
@ -9998,9 +9997,7 @@
cb: function() { cb: function() {
$.off(el, 'error', error); $.off(el, 'error', error);
ImageCommon.pushCache(el); ImageCommon.pushCache(el);
if (isVideo) { ImageCommon.pause(el);
el.pause();
}
$.rm(el); $.rm(el);
return el.removeAttribute('style'); return el.removeAttribute('style');
} }
@ -10440,15 +10437,10 @@
order: 201 order: 201
}); });
}, },
setup: function(video, isNew) { setup: function(video) {
if (isNew == null) {
isNew = true;
}
video.muted = !Conf['Allow Sound']; video.muted = !Conf['Allow Sound'];
video.volume = Conf['Default Volume']; video.volume = Conf['Default Volume'];
if (isNew) { return $.on(video, 'volumechange', Volume.change);
return $.on(video, 'volumechange', Volume.change);
}
}, },
change: function() { change: function() {
var items, muted, volume; var items, muted, volume;

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.23.5 // @version 1.9.23.6
// @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.23.5 * 4chan X - Version 1.9.23.6
* *
* 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
@ -401,7 +401,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.9.23.5', VERSION: '1.9.23.6',
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',
@ -9065,7 +9065,7 @@
return $.add(Gallery.nodes.thumbs, thumb); return $.add(Gallery.nodes.thumbs, thumb);
}, },
open: function(thumb) { open: function(thumb) {
var el, elType, file, name, newID, nodes, oldID, post, slideshow, _base, _ref; var el, elType, file, name, newID, nodes, oldID, post, slideshow, _ref;
nodes = Gallery.nodes; nodes = Gallery.nodes;
name = nodes.name; name = nodes.name;
oldID = +nodes.current.dataset.id; oldID = +nodes.current.dataset.id;
@ -9080,18 +9080,11 @@
file = $.el(elType, { file = $.el(elType, {
title: name.download = name.textContent = thumb.title title: name.download = name.textContent = thumb.title
}); });
$.on(file, 'error', (function(_this) {
return function() {
return Gallery.error(file, thumb);
};
})(this));
file.src = name.href = thumb.href;
$.extend(file.dataset, thumb.dataset); $.extend(file.dataset, thumb.dataset);
if (!nodes.current.error) { $.on(file, 'error', Gallery.error);
if (typeof (_base = nodes.current).pause === "function") { file.src = name.href = thumb.href;
_base.pause(); $.off(nodes.current, 'error', Gallery.error);
} ImageCommon.pause(nodes.current);
}
$.replace(nodes.current, file); $.replace(nodes.current, file);
if (elType === 'video') { if (elType === 'video') {
file.loop = true; file.loop = true;
@ -9117,23 +9110,25 @@
} }
return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2; return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
}, },
error: function(file, thumb) { error: function() {
var _ref; var _ref;
if (((_ref = file.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) { if (((_ref = this.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
return new Notice('error', 'Corrupt or unplayable video', 30); return new Notice('error', 'Corrupt or unplayable video', 30);
} }
if (file.src.split('/')[2] !== 'i.4cdn.org') { if (this.src.split('/')[2] !== 'i.4cdn.org') {
return; return;
} }
return ImageCommon.error(file, g.posts[file.dataset.post], null, function(URL) { return ImageCommon.error(this, g.posts[this.dataset.post], null, (function(_this) {
if (!URL) { return function(url) {
return; if (!url) {
} return;
thumb.href = URL; }
if (Gallery.nodes.current === file) { Gallery.images[_this.dataset.id].href = url;
return file.src = URL; if (Gallery.nodes.current === _this) {
} return _this.src = url;
}); }
};
})(this));
}, },
cleanupTimer: function() { cleanupTimer: function() {
var current; var current;
@ -9271,10 +9266,8 @@
return Gallery.slideshow = false; return Gallery.slideshow = false;
}, },
close: function() { close: function() {
var _base; $.off(Gallery.nodes.current, 'error', Gallery.error);
if (typeof (_base = Gallery.nodes.current).pause === "function") { ImageCommon.pause(Gallery.nodes.current);
_base.pause();
}
$.rm(Gallery.nodes.el); $.rm(Gallery.nodes.el);
$.rmClass(doc, 'gallery-open'); $.rmClass(doc, 'gallery-open');
if (Conf['Fullscreen Gallery']) { if (Conf['Fullscreen Gallery']) {
@ -9359,6 +9352,14 @@
}; };
ImageCommon = { ImageCommon = {
pause: function(video) {
if (video.nodeName !== 'VIDEO') {
return;
}
video.pause();
$.off(video, 'volumechange', Volume.change);
return video.muted = true;
},
rewind: function(el) { rewind: function(el) {
if (el.nodeName === 'VIDEO') { if (el.nodeName === 'VIDEO') {
if (el.readyState >= el.HAVE_METADATA) { if (el.readyState >= el.HAVE_METADATA) {
@ -9670,7 +9671,7 @@
$.off(el, 'error', ImageExpand.error); $.off(el, 'error', ImageExpand.error);
ImageCommon.pushCache(el); ImageCommon.pushCache(el);
if (file.isVideo) { if (file.isVideo) {
el.pause(); ImageCommon.pause(el);
_ref1 = ImageExpand.videoCB; _ref1 = ImageExpand.videoCB;
for (eventName in _ref1) { for (eventName in _ref1) {
cb = _ref1[eventName]; cb = _ref1[eventName];
@ -9693,7 +9694,7 @@
}); });
}, },
expand: function(post, src) { expand: function(post, src) {
var el, file, isNew, isVideo, thumb, _ref; var el, file, isVideo, thumb, _ref;
file = post.file; file = post.file;
thumb = file.thumb, isVideo = file.isVideo; thumb = file.thumb, isVideo = file.isVideo;
if (post.isHidden || file.isExpanding || file.isExpanded) { if (post.isHidden || file.isExpanding || file.isExpanded) {
@ -9711,7 +9712,6 @@
} }
el.removeAttribute('id'); el.removeAttribute('id');
} else { } else {
isNew = true;
el = file.fullImage = $.el((isVideo ? 'video' : 'img')); el = file.fullImage = $.el((isVideo ? 'video' : 'img'));
el.dataset.fullID = post.fullID; el.dataset.fullID = post.fullID;
$.on(el, 'error', ImageExpand.error); $.on(el, 'error', ImageExpand.error);
@ -9727,7 +9727,7 @@
thumb.parentNode.removeAttribute('href'); thumb.parentNode.removeAttribute('href');
thumb.parentNode.removeAttribute('target'); thumb.parentNode.removeAttribute('target');
el.loop = true; el.loop = true;
Volume.setup(el, isNew); Volume.setup(el);
ImageExpand.setupVideoCB(post); ImageExpand.setupVideoCB(post);
} }
if (!isVideo) { if (!isVideo) {
@ -9933,7 +9933,7 @@
}, },
mouseover: function(post) { mouseover: function(post) {
return function(e) { return function(e) {
var el, error, file, height, isNew, isVideo, left, maxHeight, maxWidth, padding, right, scale, width, x, _ref, _ref1, _ref2; var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, right, scale, width, x, _ref, _ref1, _ref2;
if (!doc.contains(this)) { if (!doc.contains(this)) {
return; return;
} }
@ -9947,7 +9947,6 @@
el = ImageCommon.popCache(); el = ImageCommon.popCache();
$.on(el, 'error', error); $.on(el, 'error', error);
} else { } else {
isNew = true;
el = $.el((isVideo ? 'video' : 'img')); el = $.el((isVideo ? 'video' : 'img'));
el.dataset.fullID = post.fullID; el.dataset.fullID = post.fullID;
$.on(el, 'error', error); $.on(el, 'error', error);
@ -9962,7 +9961,7 @@
if (isVideo) { if (isVideo) {
el.loop = true; el.loop = true;
el.controls = false; el.controls = false;
Volume.setup(el, isNew); Volume.setup(el);
if (Conf['Autoplay']) { if (Conf['Autoplay']) {
el.play(); el.play();
} }
@ -9997,9 +9996,7 @@
cb: function() { cb: function() {
$.off(el, 'error', error); $.off(el, 'error', error);
ImageCommon.pushCache(el); ImageCommon.pushCache(el);
if (isVideo) { ImageCommon.pause(el);
el.pause();
}
$.rm(el); $.rm(el);
return el.removeAttribute('style'); return el.removeAttribute('style');
} }
@ -10439,15 +10436,10 @@
order: 201 order: 201
}); });
}, },
setup: function(video, isNew) { setup: function(video) {
if (isNew == null) {
isNew = true;
}
video.muted = !Conf['Allow Sound']; video.muted = !Conf['Allow Sound'];
video.volume = Conf['Default Volume']; video.volume = Conf['Default Volume'];
if (isNew) { return $.on(video, 'volumechange', Volume.change);
return $.on(video, 'volumechange', Volume.change);
}
}, },
change: function() { change: function() {
var items, muted, volume; var items, muted, volume;

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.9.23.5 // @version 1.9.23.6
// @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.23.5 // @version 1.9.23.6
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -25,7 +25,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.9.23.5 * 4chan X - Version 1.9.23.6
* *
* 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
@ -402,7 +402,7 @@
doc = d.documentElement; doc = d.documentElement;
g = { g = {
VERSION: '1.9.23.5', VERSION: '1.9.23.6',
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',
@ -9066,7 +9066,7 @@
return $.add(Gallery.nodes.thumbs, thumb); return $.add(Gallery.nodes.thumbs, thumb);
}, },
open: function(thumb) { open: function(thumb) {
var el, elType, file, name, newID, nodes, oldID, post, slideshow, _base, _ref; var el, elType, file, name, newID, nodes, oldID, post, slideshow, _ref;
nodes = Gallery.nodes; nodes = Gallery.nodes;
name = nodes.name; name = nodes.name;
oldID = +nodes.current.dataset.id; oldID = +nodes.current.dataset.id;
@ -9081,18 +9081,11 @@
file = $.el(elType, { file = $.el(elType, {
title: name.download = name.textContent = thumb.title title: name.download = name.textContent = thumb.title
}); });
$.on(file, 'error', (function(_this) {
return function() {
return Gallery.error(file, thumb);
};
})(this));
file.src = name.href = thumb.href;
$.extend(file.dataset, thumb.dataset); $.extend(file.dataset, thumb.dataset);
if (!nodes.current.error) { $.on(file, 'error', Gallery.error);
if (typeof (_base = nodes.current).pause === "function") { file.src = name.href = thumb.href;
_base.pause(); $.off(nodes.current, 'error', Gallery.error);
} ImageCommon.pause(nodes.current);
}
$.replace(nodes.current, file); $.replace(nodes.current, file);
if (elType === 'video') { if (elType === 'video') {
file.loop = true; file.loop = true;
@ -9118,23 +9111,25 @@
} }
return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2; return nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2;
}, },
error: function(file, thumb) { error: function() {
var _ref; var _ref;
if (((_ref = file.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) { if (((_ref = this.error) != null ? _ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) {
return new Notice('error', 'Corrupt or unplayable video', 30); return new Notice('error', 'Corrupt or unplayable video', 30);
} }
if (file.src.split('/')[2] !== 'i.4cdn.org') { if (this.src.split('/')[2] !== 'i.4cdn.org') {
return; return;
} }
return ImageCommon.error(file, g.posts[file.dataset.post], null, function(URL) { return ImageCommon.error(this, g.posts[this.dataset.post], null, (function(_this) {
if (!URL) { return function(url) {
return; if (!url) {
} return;
thumb.href = URL; }
if (Gallery.nodes.current === file) { Gallery.images[_this.dataset.id].href = url;
return file.src = URL; if (Gallery.nodes.current === _this) {
} return _this.src = url;
}); }
};
})(this));
}, },
cleanupTimer: function() { cleanupTimer: function() {
var current; var current;
@ -9272,10 +9267,8 @@
return Gallery.slideshow = false; return Gallery.slideshow = false;
}, },
close: function() { close: function() {
var _base; $.off(Gallery.nodes.current, 'error', Gallery.error);
if (typeof (_base = Gallery.nodes.current).pause === "function") { ImageCommon.pause(Gallery.nodes.current);
_base.pause();
}
$.rm(Gallery.nodes.el); $.rm(Gallery.nodes.el);
$.rmClass(doc, 'gallery-open'); $.rmClass(doc, 'gallery-open');
if (Conf['Fullscreen Gallery']) { if (Conf['Fullscreen Gallery']) {
@ -9360,6 +9353,14 @@
}; };
ImageCommon = { ImageCommon = {
pause: function(video) {
if (video.nodeName !== 'VIDEO') {
return;
}
video.pause();
$.off(video, 'volumechange', Volume.change);
return video.muted = true;
},
rewind: function(el) { rewind: function(el) {
if (el.nodeName === 'VIDEO') { if (el.nodeName === 'VIDEO') {
if (el.readyState >= el.HAVE_METADATA) { if (el.readyState >= el.HAVE_METADATA) {
@ -9671,7 +9672,7 @@
$.off(el, 'error', ImageExpand.error); $.off(el, 'error', ImageExpand.error);
ImageCommon.pushCache(el); ImageCommon.pushCache(el);
if (file.isVideo) { if (file.isVideo) {
el.pause(); ImageCommon.pause(el);
_ref1 = ImageExpand.videoCB; _ref1 = ImageExpand.videoCB;
for (eventName in _ref1) { for (eventName in _ref1) {
cb = _ref1[eventName]; cb = _ref1[eventName];
@ -9694,7 +9695,7 @@
}); });
}, },
expand: function(post, src) { expand: function(post, src) {
var el, file, isNew, isVideo, thumb, _ref; var el, file, isVideo, thumb, _ref;
file = post.file; file = post.file;
thumb = file.thumb, isVideo = file.isVideo; thumb = file.thumb, isVideo = file.isVideo;
if (post.isHidden || file.isExpanding || file.isExpanded) { if (post.isHidden || file.isExpanding || file.isExpanded) {
@ -9712,7 +9713,6 @@
} }
el.removeAttribute('id'); el.removeAttribute('id');
} else { } else {
isNew = true;
el = file.fullImage = $.el((isVideo ? 'video' : 'img')); el = file.fullImage = $.el((isVideo ? 'video' : 'img'));
el.dataset.fullID = post.fullID; el.dataset.fullID = post.fullID;
$.on(el, 'error', ImageExpand.error); $.on(el, 'error', ImageExpand.error);
@ -9728,7 +9728,7 @@
thumb.parentNode.removeAttribute('href'); thumb.parentNode.removeAttribute('href');
thumb.parentNode.removeAttribute('target'); thumb.parentNode.removeAttribute('target');
el.loop = true; el.loop = true;
Volume.setup(el, isNew); Volume.setup(el);
ImageExpand.setupVideoCB(post); ImageExpand.setupVideoCB(post);
} }
if (!isVideo) { if (!isVideo) {
@ -9934,7 +9934,7 @@
}, },
mouseover: function(post) { mouseover: function(post) {
return function(e) { return function(e) {
var el, error, file, height, isNew, isVideo, left, maxHeight, maxWidth, padding, right, scale, width, x, _ref, _ref1, _ref2; var el, error, file, height, isVideo, left, maxHeight, maxWidth, padding, right, scale, width, x, _ref, _ref1, _ref2;
if (!doc.contains(this)) { if (!doc.contains(this)) {
return; return;
} }
@ -9948,7 +9948,6 @@
el = ImageCommon.popCache(); el = ImageCommon.popCache();
$.on(el, 'error', error); $.on(el, 'error', error);
} else { } else {
isNew = true;
el = $.el((isVideo ? 'video' : 'img')); el = $.el((isVideo ? 'video' : 'img'));
el.dataset.fullID = post.fullID; el.dataset.fullID = post.fullID;
$.on(el, 'error', error); $.on(el, 'error', error);
@ -9963,7 +9962,7 @@
if (isVideo) { if (isVideo) {
el.loop = true; el.loop = true;
el.controls = false; el.controls = false;
Volume.setup(el, isNew); Volume.setup(el);
if (Conf['Autoplay']) { if (Conf['Autoplay']) {
el.play(); el.play();
} }
@ -9998,9 +9997,7 @@
cb: function() { cb: function() {
$.off(el, 'error', error); $.off(el, 'error', error);
ImageCommon.pushCache(el); ImageCommon.pushCache(el);
if (isVideo) { ImageCommon.pause(el);
el.pause();
}
$.rm(el); $.rm(el);
return el.removeAttribute('style'); return el.removeAttribute('style');
} }
@ -10440,15 +10437,10 @@
order: 201 order: 201
}); });
}, },
setup: function(video, isNew) { setup: function(video) {
if (isNew == null) {
isNew = true;
}
video.muted = !Conf['Allow Sound']; video.muted = !Conf['Allow Sound'];
video.volume = Conf['Default Volume']; video.volume = Conf['Default Volume'];
if (isNew) { return $.on(video, 'volumechange', Volume.change);
return $.on(video, 'volumechange', Volume.change);
}
}, },
change: function() { change: function() {
var items, muted, volume; var items, muted, volume;

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