diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bba7e7dc..31301ddaf 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ The links to individual versions below are to copies of the script with the upda ### v1.10.12 +**v1.10.12.9** *(2015-06-03)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.9/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.9/builds/4chan-X-noupdate.crx "Chromium version")] +- Update for captcha changes. +- Work around issue where the captcha causes scrolling to the top of the page. + **v1.10.12.8** *(2015-05-22)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.8/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.8/builds/4chan-X-noupdate.crx "Chromium version")] - Remove guard against dropping files into captcha due to continued reports of disabled captchas. diff --git a/src/Posting/Captcha.fixes.coffee b/src/Posting/Captcha.fixes.coffee index a2deda7d6..9b609e61b 100644 --- a/src/Posting/Captcha.fixes.coffee +++ b/src/Posting/Captcha.fixes.coffee @@ -1,6 +1,6 @@ Captcha.fixes = css: ''' - .rc-imageselect-target > .rc-imageselect-tile > img:focus { + .rc-imageselect-target > div:focus { outline: 2px solid #4a90e2; } .rc-button-default:focus { @@ -29,7 +29,7 @@ Captcha.fixes = $.on d, 'keydown', @keybinds.bind(@) fixImages: -> - return unless (@images = $$ '.rc-imageselect-target > .rc-imageselect-tile > img').length + return unless (@images = $$ '.rc-imageselect-target > div').length focus = @images[0].tabIndex isnt 0 for img in @images img.tabIndex = 0 diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee index 07f7893b7..94eeb8fde 100644 --- a/src/Posting/Captcha.v2.coffee +++ b/src/Posting/Captcha.v2.coffee @@ -60,6 +60,7 @@ Captcha.v2 = if @nodes.container if @shouldFocus and iframe = $ 'iframe', @nodes.container iframe.focus() + QR.focus() # Event handler not fired in Firefox delete @shouldFocus return diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 960d9fab1..5ce2a6e9b 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -141,7 +141,7 @@ QR = $.off d, 'scroll', QR.scrollLock inBubble: -> - $$('.goog-bubble-content > iframe').some((el) -> el.getBoundingClientRect().bottom > 0) + d.activeElement in $$('.goog-bubble-content > iframe') inCaptcha: -> (d.activeElement?.nodeName is 'IFRAME' and QR.nodes.el.contains(d.activeElement)) or (QR.hasFocus and QR.inBubble())