diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f5f8173b..3a7b3b904 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ ### v1.14.21 +**v1.14.21.5** *(2021-07-07)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.5/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.5/builds/4chan-X-noupdate.crx)] +- Fix bug causing captcha to sometimes not work when replying from index. + **v1.14.21.4** *(2021-07-05)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.4/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.4/builds/4chan-X-noupdate.crx)] - Preliminary support for new first-party captcha on 4chan. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index cddc2ac36..a102e1fd3 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 b165acc9b..3c135b8e3 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.14.21.4 +// @version 1.14.21.5 // @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 8a832848f..ffbd1011d 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.14.21.4 +// @version 1.14.21.5 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -218,7 +218,7 @@ docSet = function() { }; g = { - VERSION: '1.14.21.4', + VERSION: '1.14.21.5', NAMESPACE: '4chan X.', sites: Object.create(null), boards: Object.create(null) @@ -23752,8 +23752,20 @@ Captcha = {}; return $.after(QR.nodes.com.parentNode, root); }, moreNeeded: function() {}, - setup: function(focus) { + getThread: function() { var boardID, threadID; + boardID = g.BOARD.ID; + if (QR.posts[0].thread === 'new') { + threadID = '0'; + } else { + threadID = '' + QR.posts[0].thread; + } + return { + boardID: boardID, + threadID: threadID + }; + }, + setup: function(focus) { if (!this.isEnabled) { return; } @@ -23762,8 +23774,7 @@ Captcha = {}; className: 'captcha-container' }); $.prepend(this.nodes.root, this.nodes.container); - boardID = g.BOARD.ID; - threadID = '' + QR.posts[0].thread; + Captcha.t.currentThread = Captcha.t.getThread(); $.global(function() { var el; el = document.querySelector('#qr .captcha-container'); @@ -23776,10 +23787,7 @@ Captcha = {}; } })); }); - }, { - boardID: boardID, - threadID: threadID - }); + }, Captcha.t.currentThread); } if (focus) { return $('#t-resp').focus(); @@ -23795,6 +23803,15 @@ Captcha = {}; $.rm(this.nodes.container); return delete this.nodes.container; }, + updateThread: function() { + var boardID, newThread, ref, threadID; + ref = Captcha.t.currentThread, boardID = ref.boardID, threadID = ref.threadID; + newThread = Captcha.t.getThread(); + if (!(newThread.boardID === boardID && newThread.threadID === threadID)) { + Captcha.t.destroy(); + return Captcha.t.setup(); + } + }, getOne: function() { var i, key, len, ref, response; response = {}; @@ -25964,7 +25981,7 @@ QR = (function() { } _Class.prototype.rm = function() { - var index; + var base, index; this["delete"](); index = QR.posts.indexOf(this); if (QR.posts.length === 1) { @@ -25974,7 +25991,8 @@ QR = (function() { (QR.posts[index - 1] || QR.posts[index + 1]).select(); } QR.posts.splice(index, 1); - return QR.status(); + QR.status(); + return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; }; _Class.prototype["delete"] = function() { @@ -26039,7 +26057,7 @@ QR = (function() { }; _Class.prototype.save = function(input, forced) { - var name, prev; + var base, name, prev; if (input.type === 'checkbox') { this.spoiler = input.checked; return; @@ -26054,6 +26072,9 @@ QR = (function() { case 'thread': (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); QR.status(); + if (typeof (base = QR.captcha).updateThread === "function") { + base.updateThread(); + } break; case 'com': this.updateComment(); @@ -26448,7 +26469,7 @@ QR = (function() { }; _Class.prototype.drop = function() { - var el, index, newIndex, oldIndex, post; + var base, el, index, newIndex, oldIndex, post; $.rmClass(this, 'over'); if (!this.draggable) { return; @@ -26465,7 +26486,8 @@ QR = (function() { (oldIndex < newIndex ? $.after : $.before)(this, el); post = QR.posts.splice(oldIndex, 1)[0]; QR.posts.splice(newIndex, 0, post); - return QR.status(); + QR.status(); + return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; }; return _Class; diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 281072ab7..5e06564da 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 04b334f97..f3a1df160 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.21.4 +// @version 1.14.21.5 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -218,7 +218,7 @@ docSet = function() { }; g = { - VERSION: '1.14.21.4', + VERSION: '1.14.21.5', NAMESPACE: '4chan X.', sites: Object.create(null), boards: Object.create(null) @@ -23752,8 +23752,20 @@ Captcha = {}; return $.after(QR.nodes.com.parentNode, root); }, moreNeeded: function() {}, - setup: function(focus) { + getThread: function() { var boardID, threadID; + boardID = g.BOARD.ID; + if (QR.posts[0].thread === 'new') { + threadID = '0'; + } else { + threadID = '' + QR.posts[0].thread; + } + return { + boardID: boardID, + threadID: threadID + }; + }, + setup: function(focus) { if (!this.isEnabled) { return; } @@ -23762,8 +23774,7 @@ Captcha = {}; className: 'captcha-container' }); $.prepend(this.nodes.root, this.nodes.container); - boardID = g.BOARD.ID; - threadID = '' + QR.posts[0].thread; + Captcha.t.currentThread = Captcha.t.getThread(); $.global(function() { var el; el = document.querySelector('#qr .captcha-container'); @@ -23776,10 +23787,7 @@ Captcha = {}; } })); }); - }, { - boardID: boardID, - threadID: threadID - }); + }, Captcha.t.currentThread); } if (focus) { return $('#t-resp').focus(); @@ -23795,6 +23803,15 @@ Captcha = {}; $.rm(this.nodes.container); return delete this.nodes.container; }, + updateThread: function() { + var boardID, newThread, ref, threadID; + ref = Captcha.t.currentThread, boardID = ref.boardID, threadID = ref.threadID; + newThread = Captcha.t.getThread(); + if (!(newThread.boardID === boardID && newThread.threadID === threadID)) { + Captcha.t.destroy(); + return Captcha.t.setup(); + } + }, getOne: function() { var i, key, len, ref, response; response = {}; @@ -25964,7 +25981,7 @@ QR = (function() { } _Class.prototype.rm = function() { - var index; + var base, index; this["delete"](); index = QR.posts.indexOf(this); if (QR.posts.length === 1) { @@ -25974,7 +25991,8 @@ QR = (function() { (QR.posts[index - 1] || QR.posts[index + 1]).select(); } QR.posts.splice(index, 1); - return QR.status(); + QR.status(); + return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; }; _Class.prototype["delete"] = function() { @@ -26039,7 +26057,7 @@ QR = (function() { }; _Class.prototype.save = function(input, forced) { - var name, prev; + var base, name, prev; if (input.type === 'checkbox') { this.spoiler = input.checked; return; @@ -26054,6 +26072,9 @@ QR = (function() { case 'thread': (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); QR.status(); + if (typeof (base = QR.captcha).updateThread === "function") { + base.updateThread(); + } break; case 'com': this.updateComment(); @@ -26448,7 +26469,7 @@ QR = (function() { }; _Class.prototype.drop = function() { - var el, index, newIndex, oldIndex, post; + var base, el, index, newIndex, oldIndex, post; $.rmClass(this, 'over'); if (!this.draggable) { return; @@ -26465,7 +26486,8 @@ QR = (function() { (oldIndex < newIndex ? $.after : $.before)(this, el); post = QR.posts.splice(oldIndex, 1)[0]; QR.posts.splice(newIndex, 0, post); - return QR.status(); + QR.status(); + return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; }; return _Class; diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index f63117a4c..e363c3fa9 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 6b041566c..1294f04f6 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.21.4 +// @version 1.14.21.5 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 48513f751..28f27b257 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.21.4 +// @version 1.14.21.5 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -218,7 +218,7 @@ docSet = function() { }; g = { - VERSION: '1.14.21.4', + VERSION: '1.14.21.5', NAMESPACE: '4chan X.', sites: Object.create(null), boards: Object.create(null) @@ -23752,8 +23752,20 @@ Captcha = {}; return $.after(QR.nodes.com.parentNode, root); }, moreNeeded: function() {}, - setup: function(focus) { + getThread: function() { var boardID, threadID; + boardID = g.BOARD.ID; + if (QR.posts[0].thread === 'new') { + threadID = '0'; + } else { + threadID = '' + QR.posts[0].thread; + } + return { + boardID: boardID, + threadID: threadID + }; + }, + setup: function(focus) { if (!this.isEnabled) { return; } @@ -23762,8 +23774,7 @@ Captcha = {}; className: 'captcha-container' }); $.prepend(this.nodes.root, this.nodes.container); - boardID = g.BOARD.ID; - threadID = '' + QR.posts[0].thread; + Captcha.t.currentThread = Captcha.t.getThread(); $.global(function() { var el; el = document.querySelector('#qr .captcha-container'); @@ -23776,10 +23787,7 @@ Captcha = {}; } })); }); - }, { - boardID: boardID, - threadID: threadID - }); + }, Captcha.t.currentThread); } if (focus) { return $('#t-resp').focus(); @@ -23795,6 +23803,15 @@ Captcha = {}; $.rm(this.nodes.container); return delete this.nodes.container; }, + updateThread: function() { + var boardID, newThread, ref, threadID; + ref = Captcha.t.currentThread, boardID = ref.boardID, threadID = ref.threadID; + newThread = Captcha.t.getThread(); + if (!(newThread.boardID === boardID && newThread.threadID === threadID)) { + Captcha.t.destroy(); + return Captcha.t.setup(); + } + }, getOne: function() { var i, key, len, ref, response; response = {}; @@ -25964,7 +25981,7 @@ QR = (function() { } _Class.prototype.rm = function() { - var index; + var base, index; this["delete"](); index = QR.posts.indexOf(this); if (QR.posts.length === 1) { @@ -25974,7 +25991,8 @@ QR = (function() { (QR.posts[index - 1] || QR.posts[index + 1]).select(); } QR.posts.splice(index, 1); - return QR.status(); + QR.status(); + return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; }; _Class.prototype["delete"] = function() { @@ -26039,7 +26057,7 @@ QR = (function() { }; _Class.prototype.save = function(input, forced) { - var name, prev; + var base, name, prev; if (input.type === 'checkbox') { this.spoiler = input.checked; return; @@ -26054,6 +26072,9 @@ QR = (function() { case 'thread': (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); QR.status(); + if (typeof (base = QR.captcha).updateThread === "function") { + base.updateThread(); + } break; case 'com': this.updateComment(); @@ -26448,7 +26469,7 @@ QR = (function() { }; _Class.prototype.drop = function() { - var el, index, newIndex, oldIndex, post; + var base, el, index, newIndex, oldIndex, post; $.rmClass(this, 'over'); if (!this.draggable) { return; @@ -26465,7 +26486,8 @@ QR = (function() { (oldIndex < newIndex ? $.after : $.before)(this, el); post = QR.posts.splice(oldIndex, 1)[0]; QR.posts.splice(newIndex, 0, post); - return QR.status(); + QR.status(); + return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; }; return _Class; diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 3690dbff3..ecf1fed6f 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.json b/builds/updates-beta.json index f41210366..a89702610 100644 --- a/builds/updates-beta.json +++ b/builds/updates-beta.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.21.4", + "version": "1.14.21.5", "update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx" } ] diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index cd4cabbc5..3c1389d81 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.json b/builds/updates.json index b45351391..44c6733e6 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.21.4", + "version": "1.14.21.5", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index a64532dc9..d54173130 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index 14d51d78b..0a7374711 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.14.21.4", - "date": "2021-07-05T20:23:27.050Z" + "version": "1.14.21.5", + "date": "2021-07-07T06:16:45.892Z" } \ No newline at end of file