diff --git a/CHANGELOG.md b/CHANGELOG.md index cb63010da..5aa72dcdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ ### v1.13.15 +**v1.13.15.2** *(2017-12-28)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.15.2/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.15.2/builds/4chan-X-noupdate.crx)] +- Fix scroll wheel volume adjustment on /r/ and /wsr/. Also read list of boards allowing audio from 4chan's boards.json. +- Minor Fixes to `Disable Autoplaying Sounds`. +- Use HTTPS for catalog.neet.tv if on HTTPS 4chan page. +- (pentargency) Prevent filtering of own posts. + **v1.13.15.1** *(2017-12-18)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.15.1/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.15.1/builds/4chan-X-noupdate.crx)] - Merge v1.13.14.13: Quick workaround for new ad breaking 4chan. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 31b0d6ea2..5996a9bff 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 caa37a7ea..ee9e746ae 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.13.15.1 +// @version 1.13.15.2 // @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 515966f37..bc89f26da 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.13.15.1 +// @version 1.13.15.2 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -159,7 +159,7 @@ docSet = function() { }; g = { - VERSION: '1.13.15.1', + VERSION: '1.13.15.2', NAMESPACE: '4chan X.', boards: {} }; @@ -1375,10 +1375,9 @@ audio.controls-added {\n\ text-align: center;\n\ }\n\ :root.anti-autoplay .autoplay-removed {\n\ - display: block !important;\n\ visibility: visible !important;\n\ min-width: 640px;\n\ - min-height: 390px;\n\ + min-height: 360px;\n\ }\n\ /* fixed, z-index */\n\ #overlay,\n\ @@ -7593,6 +7592,9 @@ Filter = (function() { stub = true; hl = void 0; top = false; + if (QuoteYou.isYou(post)) { + hideable = false; + } for (key in Filter.filters) { if (((value = Filter[key](post)) != null)) { ref = Filter.filters[key]; @@ -8565,6 +8567,11 @@ BoardConfig = (function() { } } return results; + }, + noAudio: function(boardID) { + var boards; + boards = this.boards || Conf['boardConfig'].boards; + return boards && !boards[boardID].webm_audio; } }; @@ -14373,7 +14380,7 @@ Volume = (function() { Volume = { init: function() { - var ref, ref1, unmuteEntry, volumeEntry; + var ref, unmuteEntry, volumeEntry; if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) { return; } @@ -14393,7 +14400,7 @@ Volume = (function() { cb: this.node }); } - if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg' && ref1 !== 'r' && ref1 !== 'wsr') { + if (BoardConfig.noAudio(g.BOARD.ID)) { return; } if (Conf['Mouse Wheel Volume']) { @@ -14451,8 +14458,8 @@ Volume = (function() { } }, node: function() { - var ref, ref1; - if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) { + var ref; + if (!(!BoardConfig.noAudio(this.board.ID) && ((ref = this.file) != null ? ref.isVideo : void 0))) { return; } $.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover)); @@ -15924,15 +15931,20 @@ AntiAutoplay = (function() { ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root); for (i = 0, len = ref.length; i < len; i++) { iframe = ref[i]; - iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); - $.addClass(iframe, 'autoplay-removed'); + AntiAutoplay.processVideo(iframe, 'src'); } ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root); for (j = 0, len1 = ref1.length; j < len1; j++) { object = ref1[j]; - object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); - $.addClass(object, 'autoplay-removed'); + AntiAutoplay.processVideo(object, 'data'); } + }, + processVideo: function(el, attr) { + el[attr] = el[attr].replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); + if (window.getComputedStyle(el).display === 'hidden') { + el.style.display = 'block'; + } + return $.addClass(el, 'autoplay-removed'); } }; @@ -16193,7 +16205,7 @@ CatalogLinks = (function() { board = g.BOARD.ID; } if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) { - return "http://catalog.neet.tv/" + board + "/"; + return "//catalog.neet.tv/" + board + "/"; } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) { if (g.BOARD.ID === board && g.VIEW === 'index') { return '#catalog'; @@ -23468,7 +23480,7 @@ QR = (function() { }; _Class.prototype.checkDimensions = function(el) { - var duration, height, max_height, max_width, ref, videoHeight, videoWidth, width; + var duration, height, max_height, max_width, videoHeight, videoWidth, width; if (el.tagName === 'IMG') { height = el.height, width = el.width; if (height > QR.max_height || width > QR.max_width) { @@ -23492,7 +23504,7 @@ QR = (function() { } else if (duration > QR.max_duration_video) { this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)"); } - if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg' && ref !== 'r' && ref !== 'wsr') && $.hasAudio(el)) { + if (BoardConfig.noAudio(g.BOARD.ID) && $.hasAudio(el)) { return this.fileError('Audio not allowed'); } } @@ -24391,8 +24403,8 @@ QuoteYou = (function() { isYou: function(post) { var ref; return !!((ref = QuoteYou.db) != null ? ref.get({ - boardID: post.board.ID, - threadID: post.thread.ID, + boardID: post.boardID, + threadID: post.threadID, postID: post.ID }) : void 0); }, diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 514f4f021..e56b1072c 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 ebc0b4e48..bd54a6c60 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.13.15.1 +// @version 1.13.15.2 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -159,7 +159,7 @@ docSet = function() { }; g = { - VERSION: '1.13.15.1', + VERSION: '1.13.15.2', NAMESPACE: '4chan X.', boards: {} }; @@ -1375,10 +1375,9 @@ audio.controls-added {\n\ text-align: center;\n\ }\n\ :root.anti-autoplay .autoplay-removed {\n\ - display: block !important;\n\ visibility: visible !important;\n\ min-width: 640px;\n\ - min-height: 390px;\n\ + min-height: 360px;\n\ }\n\ /* fixed, z-index */\n\ #overlay,\n\ @@ -7593,6 +7592,9 @@ Filter = (function() { stub = true; hl = void 0; top = false; + if (QuoteYou.isYou(post)) { + hideable = false; + } for (key in Filter.filters) { if (((value = Filter[key](post)) != null)) { ref = Filter.filters[key]; @@ -8565,6 +8567,11 @@ BoardConfig = (function() { } } return results; + }, + noAudio: function(boardID) { + var boards; + boards = this.boards || Conf['boardConfig'].boards; + return boards && !boards[boardID].webm_audio; } }; @@ -14373,7 +14380,7 @@ Volume = (function() { Volume = { init: function() { - var ref, ref1, unmuteEntry, volumeEntry; + var ref, unmuteEntry, volumeEntry; if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) { return; } @@ -14393,7 +14400,7 @@ Volume = (function() { cb: this.node }); } - if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg' && ref1 !== 'r' && ref1 !== 'wsr') { + if (BoardConfig.noAudio(g.BOARD.ID)) { return; } if (Conf['Mouse Wheel Volume']) { @@ -14451,8 +14458,8 @@ Volume = (function() { } }, node: function() { - var ref, ref1; - if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) { + var ref; + if (!(!BoardConfig.noAudio(this.board.ID) && ((ref = this.file) != null ? ref.isVideo : void 0))) { return; } $.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover)); @@ -15924,15 +15931,20 @@ AntiAutoplay = (function() { ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root); for (i = 0, len = ref.length; i < len; i++) { iframe = ref[i]; - iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); - $.addClass(iframe, 'autoplay-removed'); + AntiAutoplay.processVideo(iframe, 'src'); } ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root); for (j = 0, len1 = ref1.length; j < len1; j++) { object = ref1[j]; - object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); - $.addClass(object, 'autoplay-removed'); + AntiAutoplay.processVideo(object, 'data'); } + }, + processVideo: function(el, attr) { + el[attr] = el[attr].replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); + if (window.getComputedStyle(el).display === 'hidden') { + el.style.display = 'block'; + } + return $.addClass(el, 'autoplay-removed'); } }; @@ -16193,7 +16205,7 @@ CatalogLinks = (function() { board = g.BOARD.ID; } if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) { - return "http://catalog.neet.tv/" + board + "/"; + return "//catalog.neet.tv/" + board + "/"; } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) { if (g.BOARD.ID === board && g.VIEW === 'index') { return '#catalog'; @@ -23468,7 +23480,7 @@ QR = (function() { }; _Class.prototype.checkDimensions = function(el) { - var duration, height, max_height, max_width, ref, videoHeight, videoWidth, width; + var duration, height, max_height, max_width, videoHeight, videoWidth, width; if (el.tagName === 'IMG') { height = el.height, width = el.width; if (height > QR.max_height || width > QR.max_width) { @@ -23492,7 +23504,7 @@ QR = (function() { } else if (duration > QR.max_duration_video) { this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)"); } - if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg' && ref !== 'r' && ref !== 'wsr') && $.hasAudio(el)) { + if (BoardConfig.noAudio(g.BOARD.ID) && $.hasAudio(el)) { return this.fileError('Audio not allowed'); } } @@ -24391,8 +24403,8 @@ QuoteYou = (function() { isYou: function(post) { var ref; return !!((ref = QuoteYou.db) != null ? ref.get({ - boardID: post.board.ID, - threadID: post.thread.ID, + boardID: post.boardID, + threadID: post.threadID, postID: post.ID }) : void 0); }, diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index f84971982..2ed6a77ba 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 9c26b3254..72e19b693 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.13.15.1 +// @version 1.13.15.2 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 3df18939d..a77ff8b19 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.13.15.1 +// @version 1.13.15.2 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -159,7 +159,7 @@ docSet = function() { }; g = { - VERSION: '1.13.15.1', + VERSION: '1.13.15.2', NAMESPACE: '4chan X.', boards: {} }; @@ -1375,10 +1375,9 @@ audio.controls-added {\n\ text-align: center;\n\ }\n\ :root.anti-autoplay .autoplay-removed {\n\ - display: block !important;\n\ visibility: visible !important;\n\ min-width: 640px;\n\ - min-height: 390px;\n\ + min-height: 360px;\n\ }\n\ /* fixed, z-index */\n\ #overlay,\n\ @@ -7593,6 +7592,9 @@ Filter = (function() { stub = true; hl = void 0; top = false; + if (QuoteYou.isYou(post)) { + hideable = false; + } for (key in Filter.filters) { if (((value = Filter[key](post)) != null)) { ref = Filter.filters[key]; @@ -8565,6 +8567,11 @@ BoardConfig = (function() { } } return results; + }, + noAudio: function(boardID) { + var boards; + boards = this.boards || Conf['boardConfig'].boards; + return boards && !boards[boardID].webm_audio; } }; @@ -14373,7 +14380,7 @@ Volume = (function() { Volume = { init: function() { - var ref, ref1, unmuteEntry, volumeEntry; + var ref, unmuteEntry, volumeEntry; if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) { return; } @@ -14393,7 +14400,7 @@ Volume = (function() { cb: this.node }); } - if ((ref1 = g.BOARD.ID) !== 'gif' && ref1 !== 'wsg' && ref1 !== 'r' && ref1 !== 'wsr') { + if (BoardConfig.noAudio(g.BOARD.ID)) { return; } if (Conf['Mouse Wheel Volume']) { @@ -14451,8 +14458,8 @@ Volume = (function() { } }, node: function() { - var ref, ref1; - if (!(((ref = this.board.ID) === 'gif' || ref === 'wsg') && ((ref1 = this.file) != null ? ref1.isVideo : void 0))) { + var ref; + if (!(!BoardConfig.noAudio(this.board.ID) && ((ref = this.file) != null ? ref.isVideo : void 0))) { return; } $.on(this.file.thumb, 'wheel', Volume.wheel.bind(Header.hover)); @@ -15924,15 +15931,20 @@ AntiAutoplay = (function() { ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root); for (i = 0, len = ref.length; i < len; i++) { iframe = ref[i]; - iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); - $.addClass(iframe, 'autoplay-removed'); + AntiAutoplay.processVideo(iframe, 'src'); } ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root); for (j = 0, len1 = ref1.length; j < len1; j++) { object = ref1[j]; - object.data = object.data.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); - $.addClass(object, 'autoplay-removed'); + AntiAutoplay.processVideo(object, 'data'); } + }, + processVideo: function(el, attr) { + el[attr] = el[attr].replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); + if (window.getComputedStyle(el).display === 'hidden') { + el.style.display = 'block'; + } + return $.addClass(el, 'autoplay-removed'); } }; @@ -16193,7 +16205,7 @@ CatalogLinks = (function() { board = g.BOARD.ID; } if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) { - return "http://catalog.neet.tv/" + board + "/"; + return "//catalog.neet.tv/" + board + "/"; } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) { if (g.BOARD.ID === board && g.VIEW === 'index') { return '#catalog'; @@ -23468,7 +23480,7 @@ QR = (function() { }; _Class.prototype.checkDimensions = function(el) { - var duration, height, max_height, max_width, ref, videoHeight, videoWidth, width; + var duration, height, max_height, max_width, videoHeight, videoWidth, width; if (el.tagName === 'IMG') { height = el.height, width = el.width; if (height > QR.max_height || width > QR.max_width) { @@ -23492,7 +23504,7 @@ QR = (function() { } else if (duration > QR.max_duration_video) { this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)"); } - if (((ref = g.BOARD.ID) !== 'gif' && ref !== 'wsg' && ref !== 'r' && ref !== 'wsr') && $.hasAudio(el)) { + if (BoardConfig.noAudio(g.BOARD.ID) && $.hasAudio(el)) { return this.fileError('Audio not allowed'); } } @@ -24391,8 +24403,8 @@ QuoteYou = (function() { isYou: function(post) { var ref; return !!((ref = QuoteYou.db) != null ? ref.get({ - boardID: post.board.ID, - threadID: post.thread.ID, + boardID: post.boardID, + threadID: post.threadID, postID: post.ID }) : void 0); }, diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index a827947e8..d86d4d599 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 dc11a4660..c6c7ef907 100644 --- a/builds/updates-beta.json +++ b/builds/updates-beta.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.13.15.1", + "version": "1.13.15.2", "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 c4e716ec4..fb590c837 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 e2b275f19..64232cfc1 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.13.15.1", + "version": "1.13.15.2", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index ab98e1ab5..723c07412 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index e5143870d..641a0e69c 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.13.15.1", - "date": "2017-12-18T18:33:55.431Z" + "version": "1.13.15.2", + "date": "2017-12-28T10:48:18.365Z" } \ No newline at end of file