diff --git a/CHANGELOG.md b/CHANGELOG.md index bbc0b934e..07aa38077 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor ### v1.11.13 +**v1.11.13.11** *(2015-10-30)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.11/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.11/builds/4chan-X-noupdate.crx "Chromium version")] +- Work around captcha bug causing captcha to go offscreen to the right. + **v1.11.13.10** *(2015-10-25)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.10/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.10/builds/4chan-X-noupdate.crx "Chromium version")] - (MayhemYDG) Update archive list: Update fireden.net and remove poweredby.moe. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 9e60a06ff..dd5034203 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 c580342b0..71d88c712 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.11.13.10 +// @version 1.11.13.11 // @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 12c674428..c8bff72df 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.11.13.10 +// @version 1.11.13.11 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -413,7 +413,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.13.10', + VERSION: '1.11.13.11', NAMESPACE: '4chan X.', boards: {} }; @@ -8420,13 +8420,16 @@ return e.stopPropagation(); }; })(this)); - return $.on(window, 'captcha:success', (function(_this) { + $.on(window, 'captcha:success', (function(_this) { return function() { return $.queueTask(function() { return _this.save(false); }); }; })(this)); + return new MutationObserver(this.watchBubbles.bind(this)).observe(d.body, { + childList: true + }); }, initFrame: function() { var conn, ref, token; @@ -8669,6 +8672,39 @@ } else { return $.globalEval('(function() {\n var container = document.querySelector("#qr .captcha-container");\n window.grecaptcha.reset(container.dataset.widgetID);\n})();'); } + }, + watchBubbles: function(mutations) { + var k, len1, mutation, node, results; + results = []; + for (k = 0, len1 = mutations.length; k < len1; k++) { + mutation = mutations[k]; + results.push((function() { + var len2, q, ref, results1; + ref = mutation.addedNodes; + results1 = []; + for (q = 0, len2 = ref.length; q < len2; q++) { + node = ref[q]; + if ($('iframe[src^="https://www.google.com/recaptcha/api2/frame"]', node)) { + results1.push(new MutationObserver(this.fixBubble.bind(this, node)).observe(node, { + attributes: true + })); + } else { + results1.push(void 0); + } + } + return results1; + }).call(this)); + } + return results; + }, + fixBubble: function(node) { + var bottom, newLeft, qrLeft, ref, right, width; + ref = node.getBoundingClientRect(), bottom = ref.bottom, right = ref.right, width = ref.width; + if (bottom > 0 && right > doc.clientWidth) { + qrLeft = QR.nodes.el.getBoundingClientRect().left; + newLeft = Math.max(0, qrLeft - width); + return node.style.left = newLeft + "px"; + } } }; diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 7858f4d6b..6d86db8ea 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 686477cc7..c28c5f74d 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.11.13.10 +// @version 1.11.13.11 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -413,7 +413,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.13.10', + VERSION: '1.11.13.11', NAMESPACE: '4chan X.', boards: {} }; @@ -8420,13 +8420,16 @@ return e.stopPropagation(); }; })(this)); - return $.on(window, 'captcha:success', (function(_this) { + $.on(window, 'captcha:success', (function(_this) { return function() { return $.queueTask(function() { return _this.save(false); }); }; })(this)); + return new MutationObserver(this.watchBubbles.bind(this)).observe(d.body, { + childList: true + }); }, initFrame: function() { var conn, ref, token; @@ -8669,6 +8672,39 @@ } else { return $.globalEval('(function() {\n var container = document.querySelector("#qr .captcha-container");\n window.grecaptcha.reset(container.dataset.widgetID);\n})();'); } + }, + watchBubbles: function(mutations) { + var k, len1, mutation, node, results; + results = []; + for (k = 0, len1 = mutations.length; k < len1; k++) { + mutation = mutations[k]; + results.push((function() { + var len2, q, ref, results1; + ref = mutation.addedNodes; + results1 = []; + for (q = 0, len2 = ref.length; q < len2; q++) { + node = ref[q]; + if ($('iframe[src^="https://www.google.com/recaptcha/api2/frame"]', node)) { + results1.push(new MutationObserver(this.fixBubble.bind(this, node)).observe(node, { + attributes: true + })); + } else { + results1.push(void 0); + } + } + return results1; + }).call(this)); + } + return results; + }, + fixBubble: function(node) { + var bottom, newLeft, qrLeft, ref, right, width; + ref = node.getBoundingClientRect(), bottom = ref.bottom, right = ref.right, width = ref.width; + if (bottom > 0 && right > doc.clientWidth) { + qrLeft = QR.nodes.el.getBoundingClientRect().left; + newLeft = Math.max(0, qrLeft - width); + return node.style.left = newLeft + "px"; + } } }; diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 848efc7e8..a2fe6d0d7 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 05544ae75..b35645edd 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.11.13.10 +// @version 1.11.13.11 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 42af56b59..e7f185b0e 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.11.13.10 +// @version 1.11.13.11 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -413,7 +413,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.13.10', + VERSION: '1.11.13.11', NAMESPACE: '4chan X.', boards: {} }; @@ -8420,13 +8420,16 @@ return e.stopPropagation(); }; })(this)); - return $.on(window, 'captcha:success', (function(_this) { + $.on(window, 'captcha:success', (function(_this) { return function() { return $.queueTask(function() { return _this.save(false); }); }; })(this)); + return new MutationObserver(this.watchBubbles.bind(this)).observe(d.body, { + childList: true + }); }, initFrame: function() { var conn, ref, token; @@ -8669,6 +8672,39 @@ } else { return $.globalEval('(function() {\n var container = document.querySelector("#qr .captcha-container");\n window.grecaptcha.reset(container.dataset.widgetID);\n})();'); } + }, + watchBubbles: function(mutations) { + var k, len1, mutation, node, results; + results = []; + for (k = 0, len1 = mutations.length; k < len1; k++) { + mutation = mutations[k]; + results.push((function() { + var len2, q, ref, results1; + ref = mutation.addedNodes; + results1 = []; + for (q = 0, len2 = ref.length; q < len2; q++) { + node = ref[q]; + if ($('iframe[src^="https://www.google.com/recaptcha/api2/frame"]', node)) { + results1.push(new MutationObserver(this.fixBubble.bind(this, node)).observe(node, { + attributes: true + })); + } else { + results1.push(void 0); + } + } + return results1; + }).call(this)); + } + return results; + }, + fixBubble: function(node) { + var bottom, newLeft, qrLeft, ref, right, width; + ref = node.getBoundingClientRect(), bottom = ref.bottom, right = ref.right, width = ref.width; + if (bottom > 0 && right > doc.clientWidth) { + qrLeft = QR.nodes.el.getBoundingClientRect().left; + newLeft = Math.max(0, qrLeft - width); + return node.style.left = newLeft + "px"; + } } }; diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 2ea65f3e1..c62cbe37c 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 521b78aad..0f7c5d075 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 d47e99083..00c680919 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index a9803029c..cc596119f 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "meta": { "name": "4chan X", "fork": "ccd0", - "version": "1.11.13.10", - "date": "2015-10-25T20:16:10.250Z", + "version": "1.11.13.11", + "date": "2015-10-30T16:26:36.467Z", "page": "https://www.4chan-x.net/", "downloads": "https://www.4chan-x.net/builds/", "oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/",