Merge branch 'bstable'

Conflicts:
	src/Images/ImageExpand.coffee
This commit is contained in:
ccd0 2015-01-31 12:22:42 -08:00
commit 8a02642d01
17 changed files with 62 additions and 31 deletions

View File

@ -3,6 +3,11 @@ 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).
<!-- v1.9.21.x -->
### v1.9.21.8
*2015-01-31* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.21.8/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.21.8/builds/4chan-X-noupdate.crx "Chromium version")]
- Expanded WebMs with audio are no longer paused when offscreen.
### v1.9.21.7
*2015-01-31* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.21.7/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.21.7/builds/4chan-X-noupdate.crx "Chromium version")]

View File

@ -1,5 +1,5 @@
/*
* 4chan X - Version 1.9.21.7
* 4chan X - Version 1.9.21.8
*
* Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
// @version 1.9.21.7
// @version 1.9.21.8
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X beta
// @version 1.9.21.7
// @version 1.9.21.8
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -25,7 +25,7 @@
// ==/UserScript==
/*
* 4chan X - Version 1.9.21.7
* 4chan X - Version 1.9.21.8
*
* Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
@ -397,7 +397,7 @@
doc = d.documentElement;
g = {
VERSION: '1.9.21.7',
VERSION: '1.9.21.8',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@ -831,6 +831,10 @@
return (value < min ? min : value > max ? max : value);
};
$.hasAudio = function(video) {
return video.mozHasAudio || !!video.webkitAudioDecodedByteCount;
};
$.item = function(key, val) {
var item;
item = {};
@ -6627,7 +6631,7 @@
noscript = Conf['Force Noscript Captcha'] || !doc.dataset.jsEnabled;
this.captcha = Captcha[noscript ? 'noscript' : 'v2'];
if (Conf['QR Shortcut']) {
sc = $.el('a', {
this.shortcut = sc = $.el('a', {
className: 'qr-shortcut fa fa-comment-o disabled',
textContent: 'QR',
title: 'Quick Reply',
@ -6747,7 +6751,7 @@
}
}
if (Conf['QR Shortcut']) {
return $.rmClass($('.qr-shortcut'), 'disabled');
return $.rmClass(QR.shortcut, 'disabled');
}
},
close: function() {
@ -6761,7 +6765,7 @@
d.activeElement.blur();
$.rmClass(QR.nodes.el, 'dump');
if (Conf['QR Shortcut']) {
$.addClass($('.qr-shortcut'), 'disabled');
$.addClass(QR.shortcut, 'disabled');
}
new QR.post(true);
_ref = QR.posts.splice(0, QR.posts.length - 1);
@ -7135,7 +7139,7 @@
QR.error("" + file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
pass = false;
}
if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && (video.mozHasAudio || video.webkitAudioDecodedByteCount)) {
if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && $.hasAudio(video)) {
QR.error("" + file.name + ": Audio not allowed");
pass = false;
}
@ -9519,6 +9523,9 @@
continue;
}
video = post.file.fullImage;
if ($.hasAudio(video)) {
continue;
}
visible = Header.isNodeVisible(video);
if (visible && post.file.wasPlaying) {
delete post.file.wasPlaying;

Binary file not shown.

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
// @version 1.9.21.7
// @version 1.9.21.8
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -24,7 +24,7 @@
// ==/UserScript==
/*
* 4chan X - Version 1.9.21.7
* 4chan X - Version 1.9.21.8
*
* Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
@ -396,7 +396,7 @@
doc = d.documentElement;
g = {
VERSION: '1.9.21.7',
VERSION: '1.9.21.8',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@ -830,6 +830,10 @@
return (value < min ? min : value > max ? max : value);
};
$.hasAudio = function(video) {
return video.mozHasAudio || !!video.webkitAudioDecodedByteCount;
};
$.item = function(key, val) {
var item;
item = {};
@ -6626,7 +6630,7 @@
noscript = Conf['Force Noscript Captcha'] || !doc.dataset.jsEnabled;
this.captcha = Captcha[noscript ? 'noscript' : 'v2'];
if (Conf['QR Shortcut']) {
sc = $.el('a', {
this.shortcut = sc = $.el('a', {
className: 'qr-shortcut fa fa-comment-o disabled',
textContent: 'QR',
title: 'Quick Reply',
@ -6746,7 +6750,7 @@
}
}
if (Conf['QR Shortcut']) {
return $.rmClass($('.qr-shortcut'), 'disabled');
return $.rmClass(QR.shortcut, 'disabled');
}
},
close: function() {
@ -6760,7 +6764,7 @@
d.activeElement.blur();
$.rmClass(QR.nodes.el, 'dump');
if (Conf['QR Shortcut']) {
$.addClass($('.qr-shortcut'), 'disabled');
$.addClass(QR.shortcut, 'disabled');
}
new QR.post(true);
_ref = QR.posts.splice(0, QR.posts.length - 1);
@ -7134,7 +7138,7 @@
QR.error("" + file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
pass = false;
}
if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && (video.mozHasAudio || video.webkitAudioDecodedByteCount)) {
if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && $.hasAudio(video)) {
QR.error("" + file.name + ": Audio not allowed");
pass = false;
}
@ -9518,6 +9522,9 @@
continue;
}
video = post.file.fullImage;
if ($.hasAudio(video)) {
continue;
}
visible = Header.isNodeVisible(video);
if (visible && post.file.wasPlaying) {
delete post.file.wasPlaying;

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
// @version 1.9.21.7
// @version 1.9.21.8
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
// @version 1.9.21.7
// @version 1.9.21.8
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -25,7 +25,7 @@
// ==/UserScript==
/*
* 4chan X - Version 1.9.21.7
* 4chan X - Version 1.9.21.8
*
* Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE
@ -397,7 +397,7 @@
doc = d.documentElement;
g = {
VERSION: '1.9.21.7',
VERSION: '1.9.21.8',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@ -831,6 +831,10 @@
return (value < min ? min : value > max ? max : value);
};
$.hasAudio = function(video) {
return video.mozHasAudio || !!video.webkitAudioDecodedByteCount;
};
$.item = function(key, val) {
var item;
item = {};
@ -6627,7 +6631,7 @@
noscript = Conf['Force Noscript Captcha'] || !doc.dataset.jsEnabled;
this.captcha = Captcha[noscript ? 'noscript' : 'v2'];
if (Conf['QR Shortcut']) {
sc = $.el('a', {
this.shortcut = sc = $.el('a', {
className: 'qr-shortcut fa fa-comment-o disabled',
textContent: 'QR',
title: 'Quick Reply',
@ -6747,7 +6751,7 @@
}
}
if (Conf['QR Shortcut']) {
return $.rmClass($('.qr-shortcut'), 'disabled');
return $.rmClass(QR.shortcut, 'disabled');
}
},
close: function() {
@ -6761,7 +6765,7 @@
d.activeElement.blur();
$.rmClass(QR.nodes.el, 'dump');
if (Conf['QR Shortcut']) {
$.addClass($('.qr-shortcut'), 'disabled');
$.addClass(QR.shortcut, 'disabled');
}
new QR.post(true);
_ref = QR.posts.splice(0, QR.posts.length - 1);
@ -7135,7 +7139,7 @@
QR.error("" + file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)");
pass = false;
}
if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && (video.mozHasAudio || video.webkitAudioDecodedByteCount)) {
if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && $.hasAudio(video)) {
QR.error("" + file.name + ": Audio not allowed");
pass = false;
}
@ -9519,6 +9523,9 @@
continue;
}
video = post.file.fullImage;
if ($.hasAudio(video)) {
continue;
}
visible = Header.isNodeVisible(video);
if (visible && post.file.wasPlaying) {
delete post.file.wasPlaying;

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.9.21.7' />
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.9.21.8' />
</app>
</gupdate>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.9.21.7' />
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.9.21.8' />
</app>
</gupdate>

View File

@ -3,7 +3,7 @@
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": {
"name": "4chan X",
"version": "1.9.21.7",
"version": "1.9.21.8",
"repo": "https://github.com/ccd0/4chan-x/",
"page": "https://github.com/ccd0/4chan-x",
"downloads": "https://ccd0.github.io/4chan-x/builds/",

View File

@ -296,6 +296,9 @@ $.minmax = (value, min, max) ->
value
)
$.hasAudio = (video) ->
video.mozHasAudio or !!video.webkitAudioDecodedByteCount
$.item = (key, val) ->
item = {}
item[key] = val

View File

@ -79,6 +79,8 @@ ImageExpand =
continue unless file and file.isVideo and file.isExpanded
video = file.fullImage
continue if $.hasAudio video
visible = Header.isNodeVisible video
if visible and file.wasPlaying
delete file.wasPlaying

View File

@ -14,7 +14,7 @@ QR =
@captcha = Captcha[if noscript then 'noscript' else 'v2']
if Conf['QR Shortcut']
sc = $.el 'a',
@shortcut = sc = $.el 'a',
className: 'qr-shortcut fa fa-comment-o disabled'
textContent: 'QR'
title: 'Quick Reply'
@ -112,7 +112,7 @@ QR =
error: err
return
if Conf['QR Shortcut']
$.rmClass $('.qr-shortcut'), 'disabled'
$.rmClass QR.shortcut, 'disabled'
close: ->
if QR.req
@ -123,7 +123,7 @@ QR =
d.activeElement.blur()
$.rmClass QR.nodes.el, 'dump'
if Conf['QR Shortcut']
$.addClass $('.qr-shortcut'), 'disabled'
$.addClass QR.shortcut, 'disabled'
new QR.post true
for post in QR.posts.splice 0, QR.posts.length - 1
post.delete()
@ -404,7 +404,7 @@ QR =
else if duration > QR.max_duration_video
QR.error "#{file.name}: Video too long (video: #{duration}s, max: #{QR.max_duration_video}s)"
pass = false
if g.BOARD.ID not in ['gif', 'wsg'] and (video.mozHasAudio or video.webkitAudioDecodedByteCount)
if g.BOARD.ID not in ['gif', 'wsg'] and $.hasAudio video
QR.error "#{file.name}: Audio not allowed"
pass = false
cb pass, video