work around FF forever-loading bug, other tweaks
Conflicts: CHANGELOG.md builds/4chan-X.user.js builds/crx/script.js
This commit is contained in:
parent
49d76b4177
commit
81f1dbf0fb
@ -1,3 +1,10 @@
|
||||
**Zixaphir**
|
||||
- Reload captcha if there are posts in the queue.
|
||||
|
||||
**ccd0**
|
||||
- In v1.5.1, image/video hover was changed to hide and re-use the images/videos to avoid crashes.
|
||||
Fixing bugs caused by this change.
|
||||
|
||||
### v1.5.2
|
||||
*2014-04-04*
|
||||
|
||||
|
||||
@ -7713,10 +7713,7 @@
|
||||
$.on(el, 'error', ImageExpand.error);
|
||||
el.src = src || post.file.URL;
|
||||
}
|
||||
if (isVideo) {
|
||||
el.controls = Conf['Show Controls'];
|
||||
}
|
||||
position = el.controls ? thumb.parentNode : thumb;
|
||||
position = isVideo && Conf['Show Controls'] ? thumb.parentNode : thumb;
|
||||
if (el !== position.nextSibling) {
|
||||
$.after(position, el);
|
||||
}
|
||||
@ -7777,7 +7774,8 @@
|
||||
video = file.fullImage;
|
||||
file.videoControls = [];
|
||||
video.muted = !Conf['Allow Sound'];
|
||||
if (video.controls) {
|
||||
video.controls = Conf['Show Controls'];
|
||||
if (Conf['Show Controls']) {
|
||||
contract = $.el('a', {
|
||||
textContent: 'contract',
|
||||
href: 'javascript:;',
|
||||
@ -7795,8 +7793,18 @@
|
||||
}
|
||||
}
|
||||
if (Conf['Autoplay']) {
|
||||
video.controls = false;
|
||||
video.play();
|
||||
} else if (!video.controls) {
|
||||
if (Conf['Show Controls']) {
|
||||
$.asap((function() {
|
||||
return (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || !file.isExpanded;
|
||||
}), function() {
|
||||
if (file.isExpanded) {
|
||||
return video.controls = true;
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
} else if (!Conf['Show Controls']) {
|
||||
play = $.el('a', {
|
||||
textContent: 'play',
|
||||
href: 'javascript:;'
|
||||
@ -7918,7 +7926,7 @@
|
||||
return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover);
|
||||
},
|
||||
mouseover: function(e) {
|
||||
var el, isVideo, naturalHeight, position, post, thumb;
|
||||
var el, isVideo, position, post, thumb;
|
||||
post = Get.postFromNode(this);
|
||||
isVideo = post.file.isVideo;
|
||||
if (post.file.fullImage) {
|
||||
@ -7952,14 +7960,13 @@
|
||||
el.play();
|
||||
}
|
||||
}
|
||||
naturalHeight = post.file.isVideo ? 'videoHeight' : 'naturalHeight';
|
||||
UI.hover({
|
||||
root: this,
|
||||
el: el,
|
||||
latestEvent: e,
|
||||
endEvents: 'mouseout click',
|
||||
asapTest: function() {
|
||||
return el[naturalHeight];
|
||||
return isVideo || el.naturalHeight;
|
||||
},
|
||||
noRemove: true,
|
||||
cb: function() {
|
||||
|
||||
@ -7732,10 +7732,7 @@
|
||||
$.on(el, 'error', ImageExpand.error);
|
||||
el.src = src || post.file.URL;
|
||||
}
|
||||
if (isVideo) {
|
||||
el.controls = Conf['Show Controls'];
|
||||
}
|
||||
position = el.controls ? thumb.parentNode : thumb;
|
||||
position = isVideo && Conf['Show Controls'] ? thumb.parentNode : thumb;
|
||||
if (el !== position.nextSibling) {
|
||||
$.after(position, el);
|
||||
}
|
||||
@ -7796,7 +7793,8 @@
|
||||
video = file.fullImage;
|
||||
file.videoControls = [];
|
||||
video.muted = !Conf['Allow Sound'];
|
||||
if (video.controls) {
|
||||
video.controls = Conf['Show Controls'];
|
||||
if (Conf['Show Controls']) {
|
||||
contract = $.el('a', {
|
||||
textContent: 'contract',
|
||||
href: 'javascript:;',
|
||||
@ -7814,8 +7812,18 @@
|
||||
}
|
||||
}
|
||||
if (Conf['Autoplay']) {
|
||||
video.controls = false;
|
||||
video.play();
|
||||
} else if (!video.controls) {
|
||||
if (Conf['Show Controls']) {
|
||||
$.asap((function() {
|
||||
return (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || !file.isExpanded;
|
||||
}), function() {
|
||||
if (file.isExpanded) {
|
||||
return video.controls = true;
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
} else if (!Conf['Show Controls']) {
|
||||
play = $.el('a', {
|
||||
textContent: 'play',
|
||||
href: 'javascript:;'
|
||||
@ -7926,7 +7934,7 @@
|
||||
return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover);
|
||||
},
|
||||
mouseover: function(e) {
|
||||
var el, isVideo, naturalHeight, position, post, thumb;
|
||||
var el, isVideo, position, post, thumb;
|
||||
post = Get.postFromNode(this);
|
||||
isVideo = post.file.isVideo;
|
||||
if (post.file.fullImage) {
|
||||
@ -7960,14 +7968,13 @@
|
||||
el.play();
|
||||
}
|
||||
}
|
||||
naturalHeight = post.file.isVideo ? 'videoHeight' : 'naturalHeight';
|
||||
UI.hover({
|
||||
root: this,
|
||||
el: el,
|
||||
latestEvent: e,
|
||||
endEvents: 'mouseout click',
|
||||
asapTest: function() {
|
||||
return el[naturalHeight];
|
||||
return isVideo || el.naturalHeight;
|
||||
},
|
||||
noRemove: true,
|
||||
cb: function() {
|
||||
|
||||
@ -115,8 +115,7 @@ ImageExpand =
|
||||
el.loop = true if isVideo
|
||||
$.on el, 'error', ImageExpand.error
|
||||
el.src = src or post.file.URL
|
||||
el.controls = Conf['Show Controls'] if isVideo
|
||||
position = if el.controls then thumb.parentNode else thumb
|
||||
position = if isVideo and Conf['Show Controls'] then thumb.parentNode else thumb
|
||||
$.after position, el unless el is position.nextSibling
|
||||
$.asap (-> isVideo or el.naturalHeight), ->
|
||||
ImageExpand.completeExpand post
|
||||
@ -151,8 +150,9 @@ ImageExpand =
|
||||
{file} = post
|
||||
video = file.fullImage
|
||||
file.videoControls = []
|
||||
video.muted = not Conf['Allow Sound']
|
||||
if video.controls
|
||||
video.muted = !Conf['Allow Sound']
|
||||
video.controls = Conf['Show Controls']
|
||||
if Conf['Show Controls']
|
||||
# contract link in file info
|
||||
contract = $.el 'a',
|
||||
textContent: 'contract'
|
||||
@ -165,8 +165,14 @@ ImageExpand =
|
||||
for eventName, cb of ImageExpand.videoCB
|
||||
$.on video, eventName, cb
|
||||
if Conf['Autoplay']
|
||||
video.controls = false
|
||||
video.play()
|
||||
else unless video.controls
|
||||
# Hacky workaround for Firefox forever-loading bug
|
||||
if Conf['Show Controls']
|
||||
$.asap (-> (video.readyState >= 3 and video.currentTime <= Math.max 0.1, (video.duration - 0.5)) or !file.isExpanded), ->
|
||||
video.controls = true if file.isExpanded
|
||||
, 500
|
||||
else unless Conf['Show Controls']
|
||||
play = $.el 'a',
|
||||
textContent: 'play'
|
||||
href: 'javascript:;'
|
||||
|
||||
@ -32,13 +32,12 @@ ImageHover =
|
||||
el.controls = false
|
||||
el.muted = not Conf['Allow Sound']
|
||||
el.play() if Conf['Autoplay']
|
||||
naturalHeight = if post.file.isVideo then 'videoHeight' else 'naturalHeight'
|
||||
UI.hover
|
||||
root: @
|
||||
el: el
|
||||
latestEvent: e
|
||||
endEvents: 'mouseout click'
|
||||
asapTest: -> el[naturalHeight]
|
||||
asapTest: -> (isVideo or el.naturalHeight)
|
||||
noRemove: true
|
||||
cb: ->
|
||||
if isVideo
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user