Release 4chan X v1.14.21.4.
This commit is contained in:
parent
cd68ba1443
commit
14c4df1d9e
@ -4,6 +4,9 @@
|
||||
|
||||
### v1.14.21
|
||||
|
||||
**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.
|
||||
|
||||
**v1.14.21.3** *(2021-05-07)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.3/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.3/builds/4chan-X-noupdate.crx)]
|
||||
- Fix race condition causing unread posts tracking to malfunction.
|
||||
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X beta
|
||||
// @version 1.14.21.3
|
||||
// @version 1.14.21.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X beta
|
||||
// @version 1.14.21.3
|
||||
// @version 1.14.21.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
@ -218,7 +218,7 @@ docSet = function() {
|
||||
};
|
||||
|
||||
g = {
|
||||
VERSION: '1.14.21.3',
|
||||
VERSION: '1.14.21.4',
|
||||
NAMESPACE: '4chan X.',
|
||||
sites: Object.create(null),
|
||||
boards: Object.create(null)
|
||||
@ -23732,6 +23732,98 @@ Captcha = {};
|
||||
|
||||
}).call(this);
|
||||
|
||||
(function() {
|
||||
Captcha.t = {
|
||||
init: function() {
|
||||
var root;
|
||||
if (d.cookie.indexOf('pass_enabled=1') >= 0) {
|
||||
return;
|
||||
}
|
||||
if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) {
|
||||
return;
|
||||
}
|
||||
root = $.el('div', {
|
||||
className: 'captcha-root'
|
||||
});
|
||||
this.nodes = {
|
||||
root: root
|
||||
};
|
||||
$.addClass(QR.nodes.el, 'has-captcha', 'captcha-t');
|
||||
return $.after(QR.nodes.com.parentNode, root);
|
||||
},
|
||||
moreNeeded: function() {},
|
||||
setup: function(focus) {
|
||||
var boardID, threadID;
|
||||
if (!this.isEnabled) {
|
||||
return;
|
||||
}
|
||||
if (!this.nodes.container) {
|
||||
this.nodes.container = $.el('div', {
|
||||
className: 'captcha-container'
|
||||
});
|
||||
$.prepend(this.nodes.root, this.nodes.container);
|
||||
boardID = g.BOARD.ID;
|
||||
threadID = '' + QR.posts[0].thread;
|
||||
$.global(function() {
|
||||
var el;
|
||||
el = document.querySelector('#qr .captcha-container');
|
||||
window.TCaptcha.init(el, this.boardID, +this.threadID);
|
||||
return window.TCaptcha.setErrorCb(function(err) {
|
||||
return window.dispatchEvent(new CustomEvent('CreateNotification', {
|
||||
detail: {
|
||||
type: 'warning',
|
||||
content: '' + err
|
||||
}
|
||||
}));
|
||||
});
|
||||
}, {
|
||||
boardID: boardID,
|
||||
threadID: threadID
|
||||
});
|
||||
}
|
||||
if (focus) {
|
||||
return $('#t-resp').focus();
|
||||
}
|
||||
},
|
||||
destroy: function() {
|
||||
if (!(this.isEnabled && this.nodes.container)) {
|
||||
return;
|
||||
}
|
||||
$.global(function() {
|
||||
return window.TCaptcha.destroy();
|
||||
});
|
||||
$.rm(this.nodes.container);
|
||||
return delete this.nodes.container;
|
||||
},
|
||||
getOne: function() {
|
||||
var i, key, len, ref, response;
|
||||
response = {};
|
||||
if (this.nodes.container) {
|
||||
ref = ['t-response', 't-challenge'];
|
||||
for (i = 0, len = ref.length; i < len; i++) {
|
||||
key = ref[i];
|
||||
response[key] = $("[name='" + key + "']", this.nodes.container).value;
|
||||
}
|
||||
}
|
||||
if (!response['t-response']) {
|
||||
response = null;
|
||||
}
|
||||
return response;
|
||||
},
|
||||
setUsed: function() {
|
||||
if (this.nodes.container) {
|
||||
return $.global(function() {
|
||||
return window.TCaptcha.clearChallenge();
|
||||
});
|
||||
}
|
||||
},
|
||||
occupied: function() {
|
||||
return !!this.nodes.container;
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
(function() {
|
||||
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
@ -24158,7 +24250,6 @@ QR = (function() {
|
||||
return;
|
||||
}
|
||||
this.posts = [];
|
||||
this.captcha = Captcha.v2;
|
||||
$.on(d, '4chanXInitFinished', function() {
|
||||
return BoardConfig.ready(QR.initReady);
|
||||
});
|
||||
@ -24186,7 +24277,9 @@ QR = (function() {
|
||||
return Header.addShortcut('qr', sc, 540);
|
||||
},
|
||||
initReady: function() {
|
||||
var config, link, linkBot, navLinksBot, origToggle, prop;
|
||||
var captchaVersion, config, link, linkBot, navLinksBot, origToggle, prop;
|
||||
captchaVersion = $('#t-root') ? 't' : 'v2';
|
||||
QR.captcha = Captcha[captchaVersion];
|
||||
QR.postingIsEnabled = true;
|
||||
config = g.BOARD.config;
|
||||
prop = function(key, def) {
|
||||
@ -24964,8 +25057,11 @@ QR = (function() {
|
||||
if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
|
||||
err || (err = 'Original comment required.');
|
||||
}
|
||||
if (QR.captcha.isEnabled && !(/\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
||||
captcha = QR.captcha.getOne(!!threadID) || Captcha.cache.request(!!threadID);
|
||||
if (QR.captcha.isEnabled && !(QR.captcha === Captcha.v2 && /\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
||||
captcha = QR.captcha.getOne(!!threadID);
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
captcha || (captcha = Captcha.cache.request(!!threadID));
|
||||
}
|
||||
if (!captcha) {
|
||||
err = 'No valid captcha.';
|
||||
QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
|
||||
@ -25015,13 +25111,21 @@ QR = (function() {
|
||||
};
|
||||
}
|
||||
cb = function(response) {
|
||||
var key, val;
|
||||
if (response != null) {
|
||||
QR.currentCaptcha = response;
|
||||
if (response.challenge != null) {
|
||||
options.form.append('recaptcha_challenge_field', response.challenge);
|
||||
options.form.append('recaptcha_response_field', response.response);
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
if (response.challenge != null) {
|
||||
options.form.append('recaptcha_challenge_field', response.challenge);
|
||||
options.form.append('recaptcha_response_field', response.response);
|
||||
} else {
|
||||
options.form.append('g-recaptcha-response', response.response);
|
||||
}
|
||||
} else {
|
||||
options.form.append('g-recaptcha-response', response.response);
|
||||
for (key in response) {
|
||||
val = response[key];
|
||||
options.form.append(key, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options);
|
||||
@ -25031,12 +25135,14 @@ QR = (function() {
|
||||
QR.req = {
|
||||
progress: '...',
|
||||
abort: function() {
|
||||
Captcha.cache.abort();
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
Captcha.cache.abort();
|
||||
}
|
||||
return cb = null;
|
||||
}
|
||||
};
|
||||
captcha(function(response) {
|
||||
if (Captcha.cache.haveCookie()) {
|
||||
if (QR.captcha === Captcha.v2 && Captcha.cache.haveCookie()) {
|
||||
if (typeof cb === "function") {
|
||||
cb();
|
||||
}
|
||||
@ -25058,7 +25164,7 @@ QR = (function() {
|
||||
return QR.status();
|
||||
},
|
||||
response: function() {
|
||||
var URL, _, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
||||
var URL, _, base, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
||||
if (this !== QR.req) {
|
||||
return;
|
||||
}
|
||||
@ -25071,12 +25177,17 @@ QR = (function() {
|
||||
}
|
||||
} else if ((connErr = !this.response || this.response.title !== 'Post successful!')) {
|
||||
err = QR.connectionError();
|
||||
if (QR.currentCaptcha) {
|
||||
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||
Captcha.cache.save(QR.currentCaptcha);
|
||||
}
|
||||
} else if (this.status !== 200) {
|
||||
err = "Error " + this.statusText + " (" + this.status + ")";
|
||||
}
|
||||
if (!connErr) {
|
||||
if (typeof (base = QR.captcha).setUsed === "function") {
|
||||
base.setUsed();
|
||||
}
|
||||
}
|
||||
delete QR.currentCaptcha;
|
||||
if (err) {
|
||||
QR.errorCount = (QR.errorCount || 0) + 1;
|
||||
@ -25197,7 +25308,7 @@ QR = (function() {
|
||||
if ((oldReq = QR.req) && !QR.req.isUploadFinished) {
|
||||
delete QR.req;
|
||||
oldReq.abort();
|
||||
if (QR.currentCaptcha) {
|
||||
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||
Captcha.cache.save(QR.currentCaptcha);
|
||||
}
|
||||
delete QR.currentCaptcha;
|
||||
@ -26003,7 +26114,9 @@ QR = (function() {
|
||||
}
|
||||
this.nodes.span.textContent = this.com;
|
||||
QR.captcha.moreNeeded();
|
||||
return Captcha.cache.prerequest();
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
return Captcha.cache.prerequest();
|
||||
}
|
||||
};
|
||||
|
||||
_Class.prototype.isOnlyQuotes = function() {
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X
|
||||
// @version 1.14.21.3
|
||||
// @version 1.14.21.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
@ -218,7 +218,7 @@ docSet = function() {
|
||||
};
|
||||
|
||||
g = {
|
||||
VERSION: '1.14.21.3',
|
||||
VERSION: '1.14.21.4',
|
||||
NAMESPACE: '4chan X.',
|
||||
sites: Object.create(null),
|
||||
boards: Object.create(null)
|
||||
@ -23732,6 +23732,98 @@ Captcha = {};
|
||||
|
||||
}).call(this);
|
||||
|
||||
(function() {
|
||||
Captcha.t = {
|
||||
init: function() {
|
||||
var root;
|
||||
if (d.cookie.indexOf('pass_enabled=1') >= 0) {
|
||||
return;
|
||||
}
|
||||
if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) {
|
||||
return;
|
||||
}
|
||||
root = $.el('div', {
|
||||
className: 'captcha-root'
|
||||
});
|
||||
this.nodes = {
|
||||
root: root
|
||||
};
|
||||
$.addClass(QR.nodes.el, 'has-captcha', 'captcha-t');
|
||||
return $.after(QR.nodes.com.parentNode, root);
|
||||
},
|
||||
moreNeeded: function() {},
|
||||
setup: function(focus) {
|
||||
var boardID, threadID;
|
||||
if (!this.isEnabled) {
|
||||
return;
|
||||
}
|
||||
if (!this.nodes.container) {
|
||||
this.nodes.container = $.el('div', {
|
||||
className: 'captcha-container'
|
||||
});
|
||||
$.prepend(this.nodes.root, this.nodes.container);
|
||||
boardID = g.BOARD.ID;
|
||||
threadID = '' + QR.posts[0].thread;
|
||||
$.global(function() {
|
||||
var el;
|
||||
el = document.querySelector('#qr .captcha-container');
|
||||
window.TCaptcha.init(el, this.boardID, +this.threadID);
|
||||
return window.TCaptcha.setErrorCb(function(err) {
|
||||
return window.dispatchEvent(new CustomEvent('CreateNotification', {
|
||||
detail: {
|
||||
type: 'warning',
|
||||
content: '' + err
|
||||
}
|
||||
}));
|
||||
});
|
||||
}, {
|
||||
boardID: boardID,
|
||||
threadID: threadID
|
||||
});
|
||||
}
|
||||
if (focus) {
|
||||
return $('#t-resp').focus();
|
||||
}
|
||||
},
|
||||
destroy: function() {
|
||||
if (!(this.isEnabled && this.nodes.container)) {
|
||||
return;
|
||||
}
|
||||
$.global(function() {
|
||||
return window.TCaptcha.destroy();
|
||||
});
|
||||
$.rm(this.nodes.container);
|
||||
return delete this.nodes.container;
|
||||
},
|
||||
getOne: function() {
|
||||
var i, key, len, ref, response;
|
||||
response = {};
|
||||
if (this.nodes.container) {
|
||||
ref = ['t-response', 't-challenge'];
|
||||
for (i = 0, len = ref.length; i < len; i++) {
|
||||
key = ref[i];
|
||||
response[key] = $("[name='" + key + "']", this.nodes.container).value;
|
||||
}
|
||||
}
|
||||
if (!response['t-response']) {
|
||||
response = null;
|
||||
}
|
||||
return response;
|
||||
},
|
||||
setUsed: function() {
|
||||
if (this.nodes.container) {
|
||||
return $.global(function() {
|
||||
return window.TCaptcha.clearChallenge();
|
||||
});
|
||||
}
|
||||
},
|
||||
occupied: function() {
|
||||
return !!this.nodes.container;
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
(function() {
|
||||
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
@ -24158,7 +24250,6 @@ QR = (function() {
|
||||
return;
|
||||
}
|
||||
this.posts = [];
|
||||
this.captcha = Captcha.v2;
|
||||
$.on(d, '4chanXInitFinished', function() {
|
||||
return BoardConfig.ready(QR.initReady);
|
||||
});
|
||||
@ -24186,7 +24277,9 @@ QR = (function() {
|
||||
return Header.addShortcut('qr', sc, 540);
|
||||
},
|
||||
initReady: function() {
|
||||
var config, link, linkBot, navLinksBot, origToggle, prop;
|
||||
var captchaVersion, config, link, linkBot, navLinksBot, origToggle, prop;
|
||||
captchaVersion = $('#t-root') ? 't' : 'v2';
|
||||
QR.captcha = Captcha[captchaVersion];
|
||||
QR.postingIsEnabled = true;
|
||||
config = g.BOARD.config;
|
||||
prop = function(key, def) {
|
||||
@ -24964,8 +25057,11 @@ QR = (function() {
|
||||
if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
|
||||
err || (err = 'Original comment required.');
|
||||
}
|
||||
if (QR.captcha.isEnabled && !(/\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
||||
captcha = QR.captcha.getOne(!!threadID) || Captcha.cache.request(!!threadID);
|
||||
if (QR.captcha.isEnabled && !(QR.captcha === Captcha.v2 && /\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
||||
captcha = QR.captcha.getOne(!!threadID);
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
captcha || (captcha = Captcha.cache.request(!!threadID));
|
||||
}
|
||||
if (!captcha) {
|
||||
err = 'No valid captcha.';
|
||||
QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
|
||||
@ -25015,13 +25111,21 @@ QR = (function() {
|
||||
};
|
||||
}
|
||||
cb = function(response) {
|
||||
var key, val;
|
||||
if (response != null) {
|
||||
QR.currentCaptcha = response;
|
||||
if (response.challenge != null) {
|
||||
options.form.append('recaptcha_challenge_field', response.challenge);
|
||||
options.form.append('recaptcha_response_field', response.response);
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
if (response.challenge != null) {
|
||||
options.form.append('recaptcha_challenge_field', response.challenge);
|
||||
options.form.append('recaptcha_response_field', response.response);
|
||||
} else {
|
||||
options.form.append('g-recaptcha-response', response.response);
|
||||
}
|
||||
} else {
|
||||
options.form.append('g-recaptcha-response', response.response);
|
||||
for (key in response) {
|
||||
val = response[key];
|
||||
options.form.append(key, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options);
|
||||
@ -25031,12 +25135,14 @@ QR = (function() {
|
||||
QR.req = {
|
||||
progress: '...',
|
||||
abort: function() {
|
||||
Captcha.cache.abort();
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
Captcha.cache.abort();
|
||||
}
|
||||
return cb = null;
|
||||
}
|
||||
};
|
||||
captcha(function(response) {
|
||||
if (Captcha.cache.haveCookie()) {
|
||||
if (QR.captcha === Captcha.v2 && Captcha.cache.haveCookie()) {
|
||||
if (typeof cb === "function") {
|
||||
cb();
|
||||
}
|
||||
@ -25058,7 +25164,7 @@ QR = (function() {
|
||||
return QR.status();
|
||||
},
|
||||
response: function() {
|
||||
var URL, _, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
||||
var URL, _, base, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
||||
if (this !== QR.req) {
|
||||
return;
|
||||
}
|
||||
@ -25071,12 +25177,17 @@ QR = (function() {
|
||||
}
|
||||
} else if ((connErr = !this.response || this.response.title !== 'Post successful!')) {
|
||||
err = QR.connectionError();
|
||||
if (QR.currentCaptcha) {
|
||||
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||
Captcha.cache.save(QR.currentCaptcha);
|
||||
}
|
||||
} else if (this.status !== 200) {
|
||||
err = "Error " + this.statusText + " (" + this.status + ")";
|
||||
}
|
||||
if (!connErr) {
|
||||
if (typeof (base = QR.captcha).setUsed === "function") {
|
||||
base.setUsed();
|
||||
}
|
||||
}
|
||||
delete QR.currentCaptcha;
|
||||
if (err) {
|
||||
QR.errorCount = (QR.errorCount || 0) + 1;
|
||||
@ -25197,7 +25308,7 @@ QR = (function() {
|
||||
if ((oldReq = QR.req) && !QR.req.isUploadFinished) {
|
||||
delete QR.req;
|
||||
oldReq.abort();
|
||||
if (QR.currentCaptcha) {
|
||||
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||
Captcha.cache.save(QR.currentCaptcha);
|
||||
}
|
||||
delete QR.currentCaptcha;
|
||||
@ -26003,7 +26114,9 @@ QR = (function() {
|
||||
}
|
||||
this.nodes.span.textContent = this.com;
|
||||
QR.captcha.moreNeeded();
|
||||
return Captcha.cache.prerequest();
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
return Captcha.cache.prerequest();
|
||||
}
|
||||
};
|
||||
|
||||
_Class.prototype.isOnlyQuotes = function() {
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X
|
||||
// @version 1.14.21.3
|
||||
// @version 1.14.21.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan X
|
||||
// @version 1.14.21.3
|
||||
// @version 1.14.21.4
|
||||
// @minGMVer 1.14
|
||||
// @minFFVer 26
|
||||
// @namespace 4chan-X
|
||||
@ -218,7 +218,7 @@ docSet = function() {
|
||||
};
|
||||
|
||||
g = {
|
||||
VERSION: '1.14.21.3',
|
||||
VERSION: '1.14.21.4',
|
||||
NAMESPACE: '4chan X.',
|
||||
sites: Object.create(null),
|
||||
boards: Object.create(null)
|
||||
@ -23732,6 +23732,98 @@ Captcha = {};
|
||||
|
||||
}).call(this);
|
||||
|
||||
(function() {
|
||||
Captcha.t = {
|
||||
init: function() {
|
||||
var root;
|
||||
if (d.cookie.indexOf('pass_enabled=1') >= 0) {
|
||||
return;
|
||||
}
|
||||
if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) {
|
||||
return;
|
||||
}
|
||||
root = $.el('div', {
|
||||
className: 'captcha-root'
|
||||
});
|
||||
this.nodes = {
|
||||
root: root
|
||||
};
|
||||
$.addClass(QR.nodes.el, 'has-captcha', 'captcha-t');
|
||||
return $.after(QR.nodes.com.parentNode, root);
|
||||
},
|
||||
moreNeeded: function() {},
|
||||
setup: function(focus) {
|
||||
var boardID, threadID;
|
||||
if (!this.isEnabled) {
|
||||
return;
|
||||
}
|
||||
if (!this.nodes.container) {
|
||||
this.nodes.container = $.el('div', {
|
||||
className: 'captcha-container'
|
||||
});
|
||||
$.prepend(this.nodes.root, this.nodes.container);
|
||||
boardID = g.BOARD.ID;
|
||||
threadID = '' + QR.posts[0].thread;
|
||||
$.global(function() {
|
||||
var el;
|
||||
el = document.querySelector('#qr .captcha-container');
|
||||
window.TCaptcha.init(el, this.boardID, +this.threadID);
|
||||
return window.TCaptcha.setErrorCb(function(err) {
|
||||
return window.dispatchEvent(new CustomEvent('CreateNotification', {
|
||||
detail: {
|
||||
type: 'warning',
|
||||
content: '' + err
|
||||
}
|
||||
}));
|
||||
});
|
||||
}, {
|
||||
boardID: boardID,
|
||||
threadID: threadID
|
||||
});
|
||||
}
|
||||
if (focus) {
|
||||
return $('#t-resp').focus();
|
||||
}
|
||||
},
|
||||
destroy: function() {
|
||||
if (!(this.isEnabled && this.nodes.container)) {
|
||||
return;
|
||||
}
|
||||
$.global(function() {
|
||||
return window.TCaptcha.destroy();
|
||||
});
|
||||
$.rm(this.nodes.container);
|
||||
return delete this.nodes.container;
|
||||
},
|
||||
getOne: function() {
|
||||
var i, key, len, ref, response;
|
||||
response = {};
|
||||
if (this.nodes.container) {
|
||||
ref = ['t-response', 't-challenge'];
|
||||
for (i = 0, len = ref.length; i < len; i++) {
|
||||
key = ref[i];
|
||||
response[key] = $("[name='" + key + "']", this.nodes.container).value;
|
||||
}
|
||||
}
|
||||
if (!response['t-response']) {
|
||||
response = null;
|
||||
}
|
||||
return response;
|
||||
},
|
||||
setUsed: function() {
|
||||
if (this.nodes.container) {
|
||||
return $.global(function() {
|
||||
return window.TCaptcha.clearChallenge();
|
||||
});
|
||||
}
|
||||
},
|
||||
occupied: function() {
|
||||
return !!this.nodes.container;
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
(function() {
|
||||
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
@ -24158,7 +24250,6 @@ QR = (function() {
|
||||
return;
|
||||
}
|
||||
this.posts = [];
|
||||
this.captcha = Captcha.v2;
|
||||
$.on(d, '4chanXInitFinished', function() {
|
||||
return BoardConfig.ready(QR.initReady);
|
||||
});
|
||||
@ -24186,7 +24277,9 @@ QR = (function() {
|
||||
return Header.addShortcut('qr', sc, 540);
|
||||
},
|
||||
initReady: function() {
|
||||
var config, link, linkBot, navLinksBot, origToggle, prop;
|
||||
var captchaVersion, config, link, linkBot, navLinksBot, origToggle, prop;
|
||||
captchaVersion = $('#t-root') ? 't' : 'v2';
|
||||
QR.captcha = Captcha[captchaVersion];
|
||||
QR.postingIsEnabled = true;
|
||||
config = g.BOARD.config;
|
||||
prop = function(key, def) {
|
||||
@ -24964,8 +25057,11 @@ QR = (function() {
|
||||
if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
|
||||
err || (err = 'Original comment required.');
|
||||
}
|
||||
if (QR.captcha.isEnabled && !(/\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
||||
captcha = QR.captcha.getOne(!!threadID) || Captcha.cache.request(!!threadID);
|
||||
if (QR.captcha.isEnabled && !(QR.captcha === Captcha.v2 && /\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
||||
captcha = QR.captcha.getOne(!!threadID);
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
captcha || (captcha = Captcha.cache.request(!!threadID));
|
||||
}
|
||||
if (!captcha) {
|
||||
err = 'No valid captcha.';
|
||||
QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
|
||||
@ -25015,13 +25111,21 @@ QR = (function() {
|
||||
};
|
||||
}
|
||||
cb = function(response) {
|
||||
var key, val;
|
||||
if (response != null) {
|
||||
QR.currentCaptcha = response;
|
||||
if (response.challenge != null) {
|
||||
options.form.append('recaptcha_challenge_field', response.challenge);
|
||||
options.form.append('recaptcha_response_field', response.response);
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
if (response.challenge != null) {
|
||||
options.form.append('recaptcha_challenge_field', response.challenge);
|
||||
options.form.append('recaptcha_response_field', response.response);
|
||||
} else {
|
||||
options.form.append('g-recaptcha-response', response.response);
|
||||
}
|
||||
} else {
|
||||
options.form.append('g-recaptcha-response', response.response);
|
||||
for (key in response) {
|
||||
val = response[key];
|
||||
options.form.append(key, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options);
|
||||
@ -25031,12 +25135,14 @@ QR = (function() {
|
||||
QR.req = {
|
||||
progress: '...',
|
||||
abort: function() {
|
||||
Captcha.cache.abort();
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
Captcha.cache.abort();
|
||||
}
|
||||
return cb = null;
|
||||
}
|
||||
};
|
||||
captcha(function(response) {
|
||||
if (Captcha.cache.haveCookie()) {
|
||||
if (QR.captcha === Captcha.v2 && Captcha.cache.haveCookie()) {
|
||||
if (typeof cb === "function") {
|
||||
cb();
|
||||
}
|
||||
@ -25058,7 +25164,7 @@ QR = (function() {
|
||||
return QR.status();
|
||||
},
|
||||
response: function() {
|
||||
var URL, _, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
||||
var URL, _, base, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
||||
if (this !== QR.req) {
|
||||
return;
|
||||
}
|
||||
@ -25071,12 +25177,17 @@ QR = (function() {
|
||||
}
|
||||
} else if ((connErr = !this.response || this.response.title !== 'Post successful!')) {
|
||||
err = QR.connectionError();
|
||||
if (QR.currentCaptcha) {
|
||||
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||
Captcha.cache.save(QR.currentCaptcha);
|
||||
}
|
||||
} else if (this.status !== 200) {
|
||||
err = "Error " + this.statusText + " (" + this.status + ")";
|
||||
}
|
||||
if (!connErr) {
|
||||
if (typeof (base = QR.captcha).setUsed === "function") {
|
||||
base.setUsed();
|
||||
}
|
||||
}
|
||||
delete QR.currentCaptcha;
|
||||
if (err) {
|
||||
QR.errorCount = (QR.errorCount || 0) + 1;
|
||||
@ -25197,7 +25308,7 @@ QR = (function() {
|
||||
if ((oldReq = QR.req) && !QR.req.isUploadFinished) {
|
||||
delete QR.req;
|
||||
oldReq.abort();
|
||||
if (QR.currentCaptcha) {
|
||||
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||
Captcha.cache.save(QR.currentCaptcha);
|
||||
}
|
||||
delete QR.currentCaptcha;
|
||||
@ -26003,7 +26114,9 @@ QR = (function() {
|
||||
}
|
||||
this.nodes.span.textContent = this.com;
|
||||
QR.captcha.moreNeeded();
|
||||
return Captcha.cache.prerequest();
|
||||
if (QR.captcha === Captcha.v2) {
|
||||
return Captcha.cache.prerequest();
|
||||
}
|
||||
};
|
||||
|
||||
_Class.prototype.isOnlyQuotes = function() {
|
||||
|
||||
Binary file not shown.
@ -3,7 +3,7 @@
|
||||
"4chan-x@4chan-x.net": {
|
||||
"updates": [
|
||||
{
|
||||
"version": "1.14.21.3",
|
||||
"version": "1.14.21.4",
|
||||
"update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx"
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.14.21.3' />
|
||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.14.21.4' />
|
||||
</app>
|
||||
</gupdate>
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"4chan-x@4chan-x.net": {
|
||||
"updates": [
|
||||
{
|
||||
"version": "1.14.21.3",
|
||||
"version": "1.14.21.4",
|
||||
"update_link": "https://www.4chan-x.net/builds/4chan-X.crx"
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.14.21.3' />
|
||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.14.21.4' />
|
||||
</app>
|
||||
</gupdate>
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"version": "1.14.21.3",
|
||||
"date": "2021-05-07T07:49:08.122Z"
|
||||
"version": "1.14.21.4",
|
||||
"date": "2021-07-05T20:23:27.050Z"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user