diff --git a/CHANGELOG.md b/CHANGELOG.md index b9b12e660..f418a6c9d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,13 @@ Based on v1.9.15.19. - Add option `Force Noscript Captcha` to use the non-Javascript version of Recaptcha and an interface similar to the old Recaptcha. Also use this version of the captcha if Javascript is disabled on the page (4chan X can be used this way in Greasemonkey 2.x). +### v1.9.15.21 +*2014-12-15* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.21/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.21/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Flags on /pol/ are now country flags. +- Update `Disable Autoplaying Sounds` to stop Youtube videos and ``. + ### v1.9.15.20 *2014-12-14* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.20/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.20/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 25f5642ec..4039c2e13 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -127,7 +127,7 @@ Build = flag = unless flagCode <%= html('') %> - else if boardID is 'pol' + else if false <%= html('${flagCode}') %> else <%= html('') %> diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 7afb8a434..49f300078 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -103,7 +103,7 @@ Config = ] 'Disable Autoplaying Sounds': [ false - 'Prevent sounds on the page from autoplaying.' + 'Stop autoplaying sounds and other annoyances.' ] 'Linkification': diff --git a/src/General/css/style.css b/src/General/css/style.css index 21b7351b6..eef9c68df 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -109,6 +109,15 @@ audio.controls-added { display: block; margin: auto; } +:root.anti-autoplay div.embed { + position: static; + width: auto; + height: auto; + text-align: center; +} +:root.anti-autoplay marquee { + visibility: hidden; +} /* fixed, z-index */ #overlay, diff --git a/src/Miscellaneous/AntiAutoplay.coffee b/src/Miscellaneous/AntiAutoplay.coffee index 873aaf4f1..5ecf6aadf 100644 --- a/src/Miscellaneous/AntiAutoplay.coffee +++ b/src/Miscellaneous/AntiAutoplay.coffee @@ -1,8 +1,16 @@ AntiAutoplay = init: -> return if !Conf['Disable Autoplaying Sounds'] + $.addClass doc, 'anti-autoplay' @stop audio for audio in $$ 'audio[autoplay]', doc window.addEventListener 'loadstart', ((e) => @stop e.target), true + Post.callbacks.push + name: 'Disable Autoplaying Sounds' + cb: @node + CatalogThread.callbacks.push + name: 'Disable Autoplaying Sounds' + cb: @node + $.ready => @process d.body stop: (audio) -> return unless audio.autoplay @@ -11,3 +19,14 @@ AntiAutoplay = return if audio.controls audio.controls = true $.addClass audio, 'controls-added' + + node: -> + AntiAutoplay.process @nodes.root + + process: (root) -> + for iframe in $$ 'iframe[src*="youtube"][src*="autoplay=1"]', root + iframe.src = iframe.src.replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', '') + for marquee in $$ 'marquee', root + span = $.el 'span', className: 'removed-marquee' + $.replace marquee, span + $.add span, [marquee.childNodes...] diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 6c9db8b36..b9b123aa3 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -607,7 +607,7 @@ QR = $.rm nodes.flag delete nodes.flag - if g.BOARD.ID is 'pol' + if false flag = QR.flags() flag.dataset.name = 'flag' flag.dataset.default = '0'