diff --git a/CHANGELOG.md b/CHANGELOG.md index c78ea3750..3c6926a04 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,59 @@ 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.15.17 +*2014-12-11* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.17/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.17/builds/4chan-X-noupdate.crx "Chromium version")] + +Merged from v1.9.14.13: + +**talichan** +- Update archive list: Remove /jp/ and /sp/ from imcute.yt. + +**ccd0** +- Increase height of report popup to accomodate new captcha. + +### v1.9.15.16 +*2014-12-11* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.16/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.16/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Merged from v1.9.14.12: Fix more captcha setup bugs. + +### v1.9.15.15 +*2014-12-11* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.15/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.15/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Merged from v1.9.14.11: Fix `Close` keybind (default: `Esc`) in persistent QR with captcha. + +### v1.9.15.14 +*2014-12-10* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.14/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.14/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Remove `Use Recaptcha v1` option. It was just a glitch that has been fixed. +- Fix some bugs from the `Post on Captcha Completion` option. + +Merged from v1.9.14.10: +**ccd0** +- Possible fix for copy+paste version of captcha not working. +- Disable 4chan's reported post hiding code. (#219) + +### v1.9.15.13 +*2014-12-10* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.13/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.13/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +Remove captcha doubling from `Use Recaptcha v1` captcha. Only change now made is from an empty captcha to "al pacino". + +### v1.9.15.12 +*2014-12-10* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.12/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.12/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- On closer examination, the `Use Recaptcha v1` captcha is accepting more or less arbitrary input. In this version, you can leave the response field blank (for now). Enjoy your free pass while it lasts. + +### v1.9.15.11 +*2014-12-10* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.11/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.11/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Add `Use Recaptcha v1` option (default: off) to use the method found by Floens to post with the old version of Recaptcha. + ### v1.9.15.10 *2014-12-09* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.10/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.15.10/builds/4chan-X-noupdate.crx "Chromium version")] @@ -85,6 +138,35 @@ Based on v1.9.14.2. - Bug fixes. +### v1.9.14.13 +*2014-12-11* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.13/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.13/builds/4chan-X-noupdate.crx "Chromium version")] + +**talichan** +- Update archive list: Remove /jp/ and /sp/ from imcute.yt. + +**ccd0** +- Increase height of report popup to accomodate new captcha. + +### v1.9.14.12 +*2014-12-11* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.12/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.12/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Fix more captcha setup bugs. + +### v1.9.14.11 +*2014-12-11* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.11/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.11/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Fix `Close` keybind (default: `Esc`) in persistent QR with captcha. + +### v1.9.14.10 +*2014-12-10* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.10/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.10/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Possible fix for copy+paste version of captcha not working. +- Disable 4chan's reported post hiding code. (#219) +- Turn `Catalog Links` off by default in stable version also. + ### v1.9.14.9 *2014-12-09* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.9/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.14.9/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/LICENSE b/LICENSE index b8017e99f..ce5239341 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.9.15.10 +* 4chan X - Version 1.9.15.17 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE diff --git a/README.md b/README.md index 8e4a0f926..818ae6149 100755 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ Alternatively, you can downgrade to [Greasemonkey 1.15](https://addons.mozilla.o Download the file from the link above and add drag it to your `chrome://extensions` page. This should also work for non-Windows/dev/canary Chrome and Chromium-based versions of Opera. +**The above will not work in Chrome (stable or beta) users on Windows; you must install from the [Chrome store](https://chrome.google.com/webstore/detail/4chan-x/ohnjgmpcibpbafdlkimncjhflgedgpam).** + ## Chromium version (Chrome store): [Click to Install](https://chrome.google.com/webstore/detail/4chan-x/ohnjgmpcibpbafdlkimncjhflgedgpam) The stable and beta releases of Chrome on Windows will disable extensions not installed from the Chrome store, so users will need to install 4chan X from the link above. Only the latest stable version of 4chan X is available. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index dbee8310f..5120d36a2 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 6fa4c60f9..57233ffb1 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.15.10 +// @version 1.9.15.17 // @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 2b1d47d01..ccf4a06c4 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.15.10 +// @version 1.9.15.17 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.15.10 +* 4chan X - Version 1.9.15.17 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -391,7 +391,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.15.10', + VERSION: '1.9.15.17', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -6610,6 +6610,9 @@ return QR.captcha.destroy(); }, focusin: function() { + if ($.hasClass(QR.nodes.el, 'autohide') && !$.hasClass(QR.nodes.el, 'focus')) { + QR.captcha.setup(); + } return $.addClass(QR.nodes.el, 'focus'); }, focusout: function() { @@ -7461,7 +7464,10 @@ }, onPostChange: function() { if (this.postsCount === 0) { - return this.setup(); + this.setup(); + } + if (QR.posts.length === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) { + return this.postsCount = 0; } }, toggle: function() { @@ -7498,17 +7504,17 @@ return $.globalEval('(function() {\n function render() {\n var container = document.querySelector("#qr .captcha-container");\n container.dataset.widgetID = window.grecaptcha.render(container, {\n sitekey: \'6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc\',\n theme: document.documentElement.classList.contains(\'tomorrow\') ? \'dark\' : \'light\',\n callback: function(response) {\n window.dispatchEvent(new CustomEvent("captcha:success", {detail: response}));\n }\n });\n }\n if (window.grecaptcha) {\n render();\n } else {\n var cbNative = window.onRecaptchaLoaded;\n window.onRecaptchaLoaded = function() {\n render();\n cbNative();\n }\n }\n})();'); }, afterSetup: function(mutations) { - var mutation, node, _i, _j, _len, _len1, _ref; + var iframe, mutation, node, textarea, _i, _j, _len, _len1, _ref; for (_i = 0, _len = mutations.length; _i < _len; _i++) { mutation = mutations[_i]; _ref = mutation.addedNodes; for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { node = _ref[_j]; - if (node.nodeName === 'IFRAME') { - this.setupIFrame(node); + if (iframe = $.x('./descendant-or-self::iframe', node)) { + this.setupIFrame(iframe); } - if (node.nodeName === 'TEXTAREA') { - this.setupTextArea(node); + if (textarea = $.x('./descendant-or-self::textarea', node)) { + this.setupTextArea(textarea); } } } @@ -7563,8 +7569,8 @@ }, save: function(pasted) { var reload, _base; - reload = QR.cooldown.auto && this.needed(); $.forceSync('captchas'); + reload = (QR.cooldown.auto || Conf['Post on Captcha Completion']) && this.needed(); this.captchas.push({ response: $('textarea', this.nodes.container).value, timeout: (pasted ? this.setupTime : Date.now()) + 2 * $.MINUTE @@ -7573,17 +7579,18 @@ $.set('captchas', this.captchas); if (reload) { this.shouldFocus = true; - return this.reload(); - } - if (pasted) { - this.destroy(); + this.reload(); } else { - if ((_base = this.timeouts).destroy == null) { - _base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND); + if (pasted) { + this.destroy(); + } else { + if ((_base = this.timeouts).destroy == null) { + _base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND); + } } + QR.nodes.status.focus(); } - QR.nodes.status.focus(); - if (Conf['Post on Captcha Completion']) { + if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) { return QR.submit(); } }, @@ -7592,6 +7599,7 @@ if (!this.captchas.length) { return; } + $.forceSync('captchas'); now = Date.now(); _ref = this.captchas; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { @@ -10671,7 +10679,7 @@ post = ReportLink.post; url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; id = Date.now(); - set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"; + set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=285"; return window.open(url, id, set); } }; @@ -12303,7 +12311,7 @@ } return Redirect.data = o; }, - archives: [{"uid":0,"name":"Moe","domain":"archive.moe","http":false,"https":true,"software":"foolfuuka","boards":["a","biz","c","co","diy","gd","h","i","int","jp","k","m","mlp","out","po","r9k","s4s","sci","sp","tg","tv","u","v","vg","vp","vr","wsg"],"files":["a","biz","c","co","diy","gd","h","i","jp","m","mlp","po","s4s","sci","tg","u","v","vg","vp","vr","wsg"]},{"uid":3,"name":"4plebs Archive","domain":"archive.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["adv","f","hr","o","pol","s4s","tg","trv","tv","x"],"files":["adv","f","hr","o","pol","s4s","tg","trv","tv","x"]},{"uid":5,"name":"Love is Over","domain":"archive.loveisover.me","http":true,"https":true,"software":"foolfuuka","boards":["c","d","e","i","lgbt","t","u","w","wg"],"files":["c","d","e","i","lgbt","t","u","w","wg"]},{"uid":8,"name":"Rebecca Black Tech","domain":"rbt.asia","http":false,"https":true,"software":"fuuka","boards":["cgl","g","mu","w"],"files":["cgl","g","mu","w"]},{"uid":10,"name":"warosu","domain":"warosu.org","http":false,"https":true,"software":"fuuka","boards":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"],"files":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"]},{"uid":15,"name":"fgts","domain":"fgts.jp","http":true,"https":true,"software":"foolfuuka","boards":["asp","cm","h","hc","hm","n","p","r","s","soc","y"],"files":["asp","cm","h","hc","hm","n","p","r","s","soc","y"]},{"uid":21,"name":"imcute","domain":"imcute.yt","http":true,"https":false,"software":"foolfuuka","boards":["an","fit","gif","int","jp","mlp","out","r9k","sp","toy"],"files":["an","gif","fit","int","jp","mlp","out","r9k","sp","toy"],"imagehosts":["http://imcute.yt/"]}], + archives: [{"uid":0,"name":"Moe","domain":"archive.moe","http":false,"https":true,"software":"foolfuuka","boards":["a","biz","c","co","diy","gd","h","i","int","jp","k","m","mlp","out","po","r9k","s4s","sci","sp","tg","tv","u","v","vg","vp","vr","wsg"],"files":["a","biz","c","co","diy","gd","h","i","jp","m","mlp","po","s4s","sci","tg","u","v","vg","vp","vr","wsg"]},{"uid":3,"name":"4plebs Archive","domain":"archive.4plebs.org","http":true,"https":true,"software":"foolfuuka","boards":["adv","f","hr","o","pol","s4s","tg","trv","tv","x"],"files":["adv","f","hr","o","pol","s4s","tg","trv","tv","x"]},{"uid":5,"name":"Love is Over","domain":"archive.loveisover.me","http":true,"https":true,"software":"foolfuuka","boards":["c","d","e","i","lgbt","t","u","w","wg"],"files":["c","d","e","i","lgbt","t","u","w","wg"]},{"uid":8,"name":"Rebecca Black Tech","domain":"rbt.asia","http":false,"https":true,"software":"fuuka","boards":["cgl","g","mu","w"],"files":["cgl","g","mu","w"]},{"uid":10,"name":"warosu","domain":"warosu.org","http":false,"https":true,"software":"fuuka","boards":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"],"files":["3","biz","cgl","ck","diy","fa","g","ic","jp","lit","sci","tg","vr"]},{"uid":15,"name":"fgts","domain":"fgts.jp","http":true,"https":true,"software":"foolfuuka","boards":["asp","cm","h","hc","hm","n","p","r","s","soc","y"],"files":["asp","cm","h","hc","hm","n","p","r","s","soc","y"]},{"uid":21,"name":"imcute","domain":"imcute.yt","http":true,"https":false,"software":"foolfuuka","boards":["an","fit","gif","int","mlp","out","r9k","toy"],"files":["an","fit","gif","int","mlp","out","r9k","toy"],"imagehosts":["http://imcute.yt/"]}], to: function(dest, data) { var archive; archive = (dest === 'search' || dest === 'board' ? Redirect.data.thread : Redirect.data[dest])[data.boardID]; @@ -13117,7 +13125,7 @@ }); } return $.ready(function() { - return $.globalEval('(function() {\n clickable_ids = false;\n var nodes = document.querySelectorAll(\'.posteruid, .capcode\');\n for (var i = 0; i < nodes.length; i++) {\n nodes[i].removeEventListener("click", idClick, false);\n }\n})();'); + return $.globalEval('(function() {\n clickable_ids = false;\n var nodes = document.querySelectorAll(\'.posteruid, .capcode\');\n for (var i = 0; i < nodes.length; i++) {\n nodes[i].removeEventListener("click", idClick, false);\n }\n window.removeEventListener("message", Report.onMessage, false);\n})();'); }); }, code: function() { @@ -13311,6 +13319,7 @@ } } else if (QR.nodes && !QR.nodes.el.hidden) { if (Conf['Persistent QR']) { + QR.captcha.destroy(); QR.hide(); } else { QR.close(); @@ -13467,7 +13476,7 @@ window.location = CatalogLinks.catalog(); break; case Conf['Cycle sort type']: - if (!Conf['JSON Navigation']) { + if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD !== 'f')) { return; } Index.cycleSortType(); @@ -14060,7 +14069,7 @@ className: 'dialog' }); $.extend(dialog, { - innerHTML: "
Download the file from the link above and add drag it to your chrome://extensions page.
This should also work for non-Windows/dev/canary Chrome and Chromium-based versions of Opera.
The above will not work in Chrome (stable or beta) users on Windows; you must install from the Chrome store.
The stable and beta releases of Chrome on Windows will disable extensions not installed from the Chrome store, so users will need to install 4chan X from the link above. Only the latest stable version of 4chan X is available.
diff --git a/package.json b/package.json index 9cf733119..895e16237 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.15.10", + "version": "1.9.15.17", "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/Archive/archives.json b/src/Archive/archives.json index ee985dbae..ce1eed43d 100644 --- a/src/Archive/archives.json +++ b/src/Archive/archives.json @@ -59,7 +59,7 @@ "http": true, "https": false, "software": "foolfuuka", - "boards": ["an", "fit", "gif", "int", "jp", "mlp", "out", "r9k", "sp", "toy"], - "files": ["an", "gif", "fit", "int", "jp", "mlp", "out", "r9k", "sp", "toy"], + "boards": ["an", "fit", "gif", "int", "mlp", "out", "r9k", "toy"], + "files": ["an", "fit", "gif", "int", "mlp", "out", "r9k", "toy"], "imagehosts": ["http://imcute.yt/"] }] diff --git a/src/Menu/ReportLink.coffee b/src/Menu/ReportLink.coffee index f1b359ada..7cb21cb7e 100755 --- a/src/Menu/ReportLink.coffee +++ b/src/Menu/ReportLink.coffee @@ -17,5 +17,5 @@ ReportLink = {post} = ReportLink url = "//sys.4chan.org/#{post.board}/imgboard.php?mode=report&no=#{post}" id = Date.now() - set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200" + set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=285" window.open url, id, set diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index f190290f4..d05886b6d 100755 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -36,7 +36,7 @@ Fourchan = name: 'Parse /sci/ math' cb: @math - # Disable 4chan's ID highlighting (replaced by IDHighlight). + # Disable 4chan's ID highlighting (replaced by IDHighlight) and reported post hiding. $.ready -> $.globalEval ''' (function() { @@ -45,6 +45,7 @@ Fourchan = for (var i = 0; i < nodes.length; i++) { nodes[i].removeEventListener("click", idClick, false); } + window.removeEventListener("message", Report.onMessage, false); })(); ''' diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 72a7e5e7d..a4c541bab 100755 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -47,6 +47,7 @@ Keybinds = $('.close', notification).click() else if QR.nodes and !QR.nodes.el.hidden if Conf['Persistent QR'] + QR.captcha.destroy() QR.hide() else QR.close() diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index acb6a9a2c..17ad68365 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -272,11 +272,12 @@ ThreadWatcher = {threads} = g.BOARD for threadID in threads.keys thread = threads[threadID] - toggler = $ '.watch-thread-link', thread.OP.nodes.post helper = if ThreadWatcher.isWatched thread then ['addClass', 'Unwatch'] else ['rmClass', 'Watch'] - $[helper[0]] toggler, 'watched' + if thread.OP + toggler = $ '.watch-thread-link', thread.OP.nodes.post + $[helper[0]] toggler, 'watched' + toggler.title = "#{helper[1]} Thread" $[helper[0]] thread.catalogView.nodes.root, 'watched' if thread.catalogView - toggler.title = "#{helper[1]} Thread" for refresher in ThreadWatcher.menu.refreshers refresher() diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee index b63fe8b5f..56ea98183 100644 --- a/src/Posting/Captcha.v2.coffee +++ b/src/Posting/Captcha.v2.coffee @@ -34,6 +34,7 @@ Captcha.v2 = onPostChange: -> @setup() if @postsCount is 0 + @postsCount = 0 if QR.posts.length is 1 and !Conf['Auto-load captcha'] and !QR.posts[0].com and !QR.posts[0].file toggle: -> if @nodes.container and !@timeouts.destroy @@ -85,8 +86,8 @@ Captcha.v2 = afterSetup: (mutations) -> for mutation in mutations for node in mutation.addedNodes - @setupIFrame node if node.nodeName is 'IFRAME' - @setupTextArea node if node.nodeName is 'TEXTAREA' + @setupIFrame iframe if iframe = $.x './descendant-or-self::iframe', node + @setupTextArea textarea if textarea = $.x './descendant-or-self::textarea', node return setupIFrame: (iframe) -> @@ -122,8 +123,8 @@ Captcha.v2 = null save: (pasted) -> - reload = QR.cooldown.auto and @needed() $.forceSync 'captchas' + reload = (QR.cooldown.auto or Conf['Post on Captcha Completion']) and @needed() @captchas.push response: $('textarea', @nodes.container).value timeout: (if pasted then @setupTime else Date.now()) + 2 * $.MINUTE @@ -132,17 +133,19 @@ Captcha.v2 = if reload @shouldFocus = true - return @reload() - - if pasted - @destroy() + @reload() else - @timeouts.destroy ?= setTimeout @destroy.bind(@), 3 * $.SECOND - QR.nodes.status.focus() - QR.submit() if Conf['Post on Captcha Completion'] + if pasted + @destroy() + else + @timeouts.destroy ?= setTimeout @destroy.bind(@), 3 * $.SECOND + QR.nodes.status.focus() + + QR.submit() if Conf['Post on Captcha Completion'] and !QR.cooldown.auto clear: -> return unless @captchas.length + $.forceSync 'captchas' now = Date.now() for captcha, i in @captchas break if captcha.timeout > now diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 4d1a06846..00c761864 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -126,6 +126,7 @@ QR = if QR.captcha isnt Captcha.noscript or (QR.captcha.isEnabled and not Conf['Auto-load captcha']) QR.captcha.destroy() focusin: -> + QR.captcha.setup() if $.hasClass(QR.nodes.el, 'autohide') and !$.hasClass(QR.nodes.el, 'focus') $.addClass QR.nodes.el, 'focus' focusout: -> $.rmClass QR.nodes.el, 'focus'