diff --git a/CHANGELOG.md b/CHANGELOG.md index df803808f..6466789ec 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ 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.17.10 +*2014-12-26* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.17.10/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.17.10/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- More bugfixes. + +### v1.9.17.9 +*2014-12-26* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.17.9/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.17.9/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Fix some QR showing/hiding bugs. + ### v1.9.17.8 *2014-12-25* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.17.8/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.17.8/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/LICENSE b/LICENSE index de599af46..e7980c435 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.9.17.8 +* 4chan X - Version 1.9.17.10 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index b5caa03ca..52a3daabb 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 739e2a976..1c2a2581b 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.9.17.8 +// @version 1.9.17.10 // @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 0cea42417..b43af4932 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X beta -// @version 1.9.17.8 +// @version 1.9.17.10 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -25,7 +25,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.17.8 +* 4chan X - Version 1.9.17.10 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -218,7 +218,7 @@ 'Thread Stats': [true, 'Display reply and image count.'], 'IP Count in Stats': [true, 'Display the unique IP count in the thread stats.', 1], 'Page Count in Stats': [true, 'Display the page count in the thread stats.', 1], - 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.', 1], + 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], 'Toggleable Thread Watcher': [true, 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.', 1], 'Mark New IPs': [false, 'Label each post from a new IP with the thread\'s current IP count.'] @@ -393,7 +393,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.17.8', + VERSION: '1.9.17.10', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -6550,6 +6550,7 @@ $.on(d, '4chanXInitFinished', this.initReady); window.addEventListener('focus', this.focus, true); window.addEventListener('blur', this.focus, true); + $.on(d, 'click', this.focus); return Post.callbacks.push({ name: 'Quick Reply', cb: this.node @@ -6677,8 +6678,12 @@ if (!QR.nodes) { return; } - focus = d.activeElement && (QR.nodes.el.contains(d.activeElement) || d.activeElement.nodeName === 'IFRAME' && /^https:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src)); - $[focus ? 'addClass' : 'rmClass'](QR.nodes.el, 'focus'); + if (!$$('.goog-bubble-content > iframe').some(function(el) { + return el.getBoundingClientRect().top >= 0; + })) { + focus = d.activeElement && QR.nodes.el.contains(d.activeElement); + $[focus ? 'addClass' : 'rmClass'](QR.nodes.el, 'focus'); + } if (typeof chrome !== "undefined" && chrome !== null) { if (d.activeElement && QR.nodes.el.contains(d.activeElement) && d.activeElement.nodeName === 'IFRAME') { QR.scrollY = window.scrollY; @@ -11318,6 +11323,7 @@ this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', { innerHTML: "
" + statsHTML.innerHTML + "
" }); + $.addClass(doc, 'float'); $.ready((function(_this) { return function() { return $.add(d.body, sc); diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 17b14b48c..7439fa012 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 0f81c8c15..c5f59dda1 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.9.17.8 +// @version 1.9.17.10 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.17.8 +* 4chan X - Version 1.9.17.10 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -217,7 +217,7 @@ 'Thread Stats': [true, 'Display reply and image count.'], 'IP Count in Stats': [true, 'Display the unique IP count in the thread stats.', 1], 'Page Count in Stats': [true, 'Display the page count in the thread stats.', 1], - 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.', 1], + 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], 'Toggleable Thread Watcher': [true, 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.', 1], 'Mark New IPs': [false, 'Label each post from a new IP with the thread\'s current IP count.'] @@ -392,7 +392,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.17.8', + VERSION: '1.9.17.10', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -6549,6 +6549,7 @@ $.on(d, '4chanXInitFinished', this.initReady); window.addEventListener('focus', this.focus, true); window.addEventListener('blur', this.focus, true); + $.on(d, 'click', this.focus); return Post.callbacks.push({ name: 'Quick Reply', cb: this.node @@ -6676,8 +6677,12 @@ if (!QR.nodes) { return; } - focus = d.activeElement && (QR.nodes.el.contains(d.activeElement) || d.activeElement.nodeName === 'IFRAME' && /^https:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src)); - $[focus ? 'addClass' : 'rmClass'](QR.nodes.el, 'focus'); + if (!$$('.goog-bubble-content > iframe').some(function(el) { + return el.getBoundingClientRect().top >= 0; + })) { + focus = d.activeElement && QR.nodes.el.contains(d.activeElement); + $[focus ? 'addClass' : 'rmClass'](QR.nodes.el, 'focus'); + } if (typeof chrome !== "undefined" && chrome !== null) { if (d.activeElement && QR.nodes.el.contains(d.activeElement) && d.activeElement.nodeName === 'IFRAME') { QR.scrollY = window.scrollY; @@ -11317,6 +11322,7 @@ this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', { innerHTML: "
" + statsHTML.innerHTML + "
" }); + $.addClass(doc, 'float'); $.ready((function(_this) { return function() { return $.add(d.body, sc); diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 4be938a51..5e7463b2b 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 2bfdb3b9e..489fc0e29 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.9.17.8 +// @version 1.9.17.10 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 92a78de5f..a5c953d4d 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.9.17.8 +// @version 1.9.17.10 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -25,7 +25,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.17.8 +* 4chan X - Version 1.9.17.10 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -218,7 +218,7 @@ 'Thread Stats': [true, 'Display reply and image count.'], 'IP Count in Stats': [true, 'Display the unique IP count in the thread stats.', 1], 'Page Count in Stats': [true, 'Display the page count in the thread stats.', 1], - 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.', 1], + 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], 'Toggleable Thread Watcher': [true, 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.', 1], 'Mark New IPs': [false, 'Label each post from a new IP with the thread\'s current IP count.'] @@ -393,7 +393,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.17.8', + VERSION: '1.9.17.10', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -6550,6 +6550,7 @@ $.on(d, '4chanXInitFinished', this.initReady); window.addEventListener('focus', this.focus, true); window.addEventListener('blur', this.focus, true); + $.on(d, 'click', this.focus); return Post.callbacks.push({ name: 'Quick Reply', cb: this.node @@ -6677,8 +6678,12 @@ if (!QR.nodes) { return; } - focus = d.activeElement && (QR.nodes.el.contains(d.activeElement) || d.activeElement.nodeName === 'IFRAME' && /^https:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src)); - $[focus ? 'addClass' : 'rmClass'](QR.nodes.el, 'focus'); + if (!$$('.goog-bubble-content > iframe').some(function(el) { + return el.getBoundingClientRect().top >= 0; + })) { + focus = d.activeElement && QR.nodes.el.contains(d.activeElement); + $[focus ? 'addClass' : 'rmClass'](QR.nodes.el, 'focus'); + } if (typeof chrome !== "undefined" && chrome !== null) { if (d.activeElement && QR.nodes.el.contains(d.activeElement) && d.activeElement.nodeName === 'IFRAME') { QR.scrollY = window.scrollY; @@ -11318,6 +11323,7 @@ this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', { innerHTML: "
" + statsHTML.innerHTML + "
" }); + $.addClass(doc, 'float'); $.ready((function(_this) { return function() { return $.add(d.body, sc); diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 9b0e2b5c9..cb4b738dd 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index 9b88c12a4..c2b94530f 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.xml b/builds/updates.xml index 75dd7181e..bf454e20a 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 4ef46171d..fa7f65849 100755 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", - "version": "1.9.17.8", + "version": "1.9.17.10", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/", diff --git a/src/General/Config.coffee b/src/General/Config.coffee index fca13ba3a..2bee72e8a 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -338,7 +338,6 @@ Config = 'Updater and Stats in Header': [ true, 'Places the thread updater and thread stats in the header instead of floating them.' - 1 ] 'Thread Watcher': [ true diff --git a/src/Monitoring/ThreadStats.coffee b/src/Monitoring/ThreadStats.coffee index bc2b7c158..29a77d7de 100755 --- a/src/Monitoring/ThreadStats.coffee +++ b/src/Monitoring/ThreadStats.coffee @@ -21,6 +21,7 @@ ThreadStats = else @dialog = sc = UI.dialog 'thread-stats', 'bottom: 0px; right: 0px;', <%= html('
&{statsHTML}
') %> + $.addClass doc, 'float' $.ready => $.add d.body, sc diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 3f9adda1d..dd81f13d9 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -39,6 +39,8 @@ QR = window.addEventListener 'focus', @focus, true window.addEventListener 'blur', @focus, true + # We don't receive blur events from captcha iframe. + $.on d, 'click', @focus Post.callbacks.push name: 'Quick Reply' @@ -133,11 +135,9 @@ QR = focus: -> $.queueTask -> return unless QR.nodes - focus = d.activeElement and ( - QR.nodes.el.contains(d.activeElement) or - d.activeElement.nodeName is 'IFRAME' and /^https:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src) - ) - $[if focus then 'addClass' else 'rmClass'] QR.nodes.el, 'focus' + unless $$('.goog-bubble-content > iframe').some((el) -> el.getBoundingClientRect().top >= 0) + focus = d.activeElement and QR.nodes.el.contains(d.activeElement) + $[if focus then 'addClass' else 'rmClass'] QR.nodes.el, 'focus' if chrome? # XXX Stop anomalous scrolling on space/tab in captcha iframe. if d.activeElement and QR.nodes.el.contains(d.activeElement) and d.activeElement.nodeName is 'IFRAME'