Release 4chan X v1.11.13.5.

This commit is contained in:
ccd0 2015-10-21 10:58:15 -07:00
parent db54fed59a
commit 86496ee9fa
13 changed files with 153 additions and 1153 deletions

View File

@ -4,6 +4,12 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor
### v1.11.13
**v1.11.13.5** *(2015-10-21)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.5/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.5/builds/4chan-X-noupdate.crx "Chromium version")]
- Merge v1.11.12.9: Workarounds for Google's latest captcha bugs.
- Merge v1.11.12.9: Ignore `Force Noscript Captcha` if Recaptcha v1 is selected.
- Show spoiler checkbox as an "S" unless hovered, checked, or focused.
- Minor bugfixes.
**v1.11.13.4** *(2015-10-20)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.4/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.13.4/builds/4chan-X-noupdate.crx "Chromium version")]
- Add TeX preview button to Quick Reply on /sci/.

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
// @version 1.11.13.4
// @version 1.11.13.5
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -22,8 +22,6 @@
// @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X beta
// @version 1.11.13.4
// @version 1.11.13.5
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -23,8 +23,6 @@
// @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
@ -244,7 +242,7 @@
'Hide Original Post Form': [true, 'Hide the normal post form.', 1],
'Cooldown': [true, 'Indicate the remaining time before posting again.', 1],
'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.', 1],
'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha in the QR even if Javascript is enabled.', 1],
'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha in the QR even if Javascript is enabled (Recaptcha v2 only).', 1],
'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.', 1],
'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.', 1],
'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1],
@ -415,7 +413,7 @@
doc = d.documentElement;
g = {
VERSION: '1.11.13.4',
VERSION: '1.11.13.5',
NAMESPACE: '4chan X.',
boards: {}
};
@ -6866,7 +6864,7 @@
'webm': 'video/webm'
},
init: function() {
var noscript, sc, version;
var sc, version;
if (!Conf['Quick Reply']) {
return;
}
@ -6875,7 +6873,7 @@
if (g.VIEW === 'archive') {
return;
}
version = Conf['Use Recaptcha v1'] ? (noscript = Conf['Force Noscript Captcha'] || !$.hasClass(doc, 'js-enabled'), noscript ? 'noscript' : 'v1') : 'v2';
version = Conf['Use Recaptcha v1'] ? 'v1' : 'v2';
this.captcha = Captcha[version];
$.on(d, '4chanXInitFinished', this.initReady);
Post.callbacks.push({
@ -7424,7 +7422,7 @@
var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, scriptData, setNode;
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
innerHTML: "<div class=\"move\"><label><input type=\"checkbox\" id=\"autohide\" title=\"Auto-hide\">Quick Reply</label><a href=\"javascript:;\" class=\"close\" title=\"Close\">×</a><select data-name=\"thread\" title=\"Create a new thread / Reply\"><option value=\"new\">New thread</option></select></div><form><div class=\"persona\"><button type=\"button\" id=\"sjis-toggle\" title=\"Toggle Mona font\">∀</button><button type=\"button\" id=\"tex-preview-button\" title=\"Preview TeX\">T<sub>E</sub>X</button><input name=\"name\" data-name=\"name\" list=\"list-name\" placeholder=\"Name\" class=\"field\" size=\"1\"><input name=\"email\" data-name=\"email\" list=\"list-email\" placeholder=\"Options\" class=\"field\" size=\"1\"><input name=\"sub\" data-name=\"sub\" list=\"list-sub\" placeholder=\"Subject\" class=\"field\" size=\"1\"></div><div class=\"textarea\"><textarea data-name=\"com\" placeholder=\"Comment\" class=\"field\"></textarea><span id=\"char-count\"></span><div id=\"tex-preview\"></div></div><div id=\"dump-list-container\"><div id=\"dump-list\"></div><a id=\"add-post\" href=\"javascript:;\" title=\"Add a post\">+</a></div><div class=\"oekaki\"><input type=\"button\" id=\"qr-draw-button\" value=\"Draw\"><label><span>Width:</span><input name=\"oekaki-width\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label><label><span>Height:</span><input name=\"oekaki-height\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label></div><div id=\"file-n-submit\"><input type=\"button\" id=\"qr-file-button\" value=\"Files\"><span id=\"qr-filename-container\" class=\"field\"><span id=\"qr-no-file\">No selected file</span><input id=\"qr-filename\" data-name=\"filename\" spellcheck=\"false\"><label id=\"qr-spoiler-label\"><input type=\"checkbox\" id=\"qr-file-spoiler\" title=\"Spoiler image\"><span class=\"checkbox-letter\">S</span></label><a href=\"javascript:;\" id=\"qr-filerm\" title=\"Remove file\"><i class=\"fa fa-times-circle\"></i></a><a id=\"url-button\" title=\"Post from url\"><i class=\"fa fa-link\"></i></a><a hidden id=\"paste-area\" title=\"Select to paste images\" class=\"fa fa-clipboard\" tabindex=\"-1\" contentEditable=\"true\"></a><a id=\"custom-cooldown-button\" title=\"Toggle custom cooldown\" class=\"disabled\"><i class=\"fa fa-clock-o\"></i></a><a id=\"dump-button\" title=\"Dump list\"><i class=\"fa fa-plus-square\"></i></a></span><input type=\"submit\"></div><select data-default=\"4\" name=\"filetag\"><option value=\"0\">Hentai</option><option value=\"6\">Porn</option><option value=\"1\">Japanese</option><option value=\"2\">Anime</option><option value=\"3\">Game</option><option value=\"5\">Loop</option><option value=\"4\" selected>Other</option></select><input type=\"file\" multiple></form><datalist id=\"list-name\"></datalist><datalist id=\"list-email\"></datalist><datalist id=\"list-sub\"></datalist> "
innerHTML: "<div class=\"move\"><label><input type=\"checkbox\" id=\"autohide\" title=\"Auto-hide\">Quick Reply</label><a href=\"javascript:;\" class=\"close\" title=\"Close\">×</a><select data-name=\"thread\" title=\"Create a new thread / Reply\"><option value=\"new\">New thread</option></select></div><form><div class=\"persona\"><button type=\"button\" id=\"sjis-toggle\" title=\"Toggle Mona font\">∀</button><button type=\"button\" id=\"tex-preview-button\" title=\"Preview TeX\">T<sub>E</sub>X</button><input name=\"name\" data-name=\"name\" list=\"list-name\" placeholder=\"Name\" class=\"field\" size=\"1\"><input name=\"email\" data-name=\"email\" list=\"list-email\" placeholder=\"Options\" class=\"field\" size=\"1\"><input name=\"sub\" data-name=\"sub\" list=\"list-sub\" placeholder=\"Subject\" class=\"field\" size=\"1\"></div><div class=\"textarea\"><textarea data-name=\"com\" placeholder=\"Comment\" class=\"field\"></textarea><span id=\"char-count\"></span><div id=\"tex-preview\"></div></div><div id=\"dump-list-container\"><div id=\"dump-list\"></div><a id=\"add-post\" href=\"javascript:;\" title=\"Add a post\">+</a></div><div class=\"oekaki\"><input type=\"button\" id=\"qr-draw-button\" value=\"Draw\"><label><span>Width:</span><input name=\"oekaki-width\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label><label><span>Height:</span><input name=\"oekaki-height\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label></div><div id=\"file-n-submit\"><input type=\"button\" id=\"qr-file-button\" value=\"Files\"><span id=\"qr-filename-container\" class=\"field\"><span id=\"qr-no-file\">No selected file</span><input id=\"qr-filename\" data-name=\"filename\" spellcheck=\"false\"><label id=\"qr-spoiler-label\"><input type=\"checkbox\" id=\"qr-file-spoiler\" title=\"Spoiler image\"><a class=\"checkbox-letter\">S</a></label><a href=\"javascript:;\" id=\"qr-filerm\" title=\"Remove file\"><i class=\"fa fa-times-circle\"></i></a><a id=\"url-button\" title=\"Post from url\"><i class=\"fa fa-link\"></i></a><a hidden id=\"paste-area\" title=\"Select to paste images\" class=\"fa fa-clipboard\" tabindex=\"-1\" contentEditable=\"true\"></a><a id=\"custom-cooldown-button\" title=\"Toggle custom cooldown\" class=\"disabled\"><i class=\"fa fa-clock-o\"></i></a><a id=\"dump-button\" title=\"Dump list\"><i class=\"fa fa-plus-square\"></i></a></span><input type=\"submit\"></div><select data-default=\"4\" name=\"filetag\"><option value=\"0\">Hentai</option><option value=\"6\">Porn</option><option value=\"1\">Japanese</option><option value=\"2\">Anime</option><option value=\"3\">Game</option><option value=\"5\">Loop</option><option value=\"4\" selected>Other</option></select><input type=\"file\" multiple></form><datalist id=\"list-name\"></datalist><datalist id=\"list-email\"></datalist><datalist id=\"list-sub\"></datalist> "
})
};
setNode = function(name, query) {
@ -7489,8 +7487,6 @@
QR.spoiler = !!$('.postForm input[name=spoiler]');
if (QR.spoiler) {
$.addClass(QR.nodes.el, 'has-spoiler');
} else {
nodes.spoiler.parentElement.hidden = true;
}
if (g.BOARD.ID === 'jp' && Conf['sjisPreview']) {
$.addClass(QR.nodes.el, 'sjis-preview');
@ -7884,7 +7880,8 @@
childList: true,
subtree: true
});
return $.on(d, 'keydown', this.keybinds.bind(this));
$.on(d, 'keydown', this.keybinds.bind(this));
return window.focus();
},
initNoscript: function() {
this.noscript = true;
@ -8007,334 +8004,6 @@
}
};
Captcha.noscript = {
lifetime: 30 * $.MINUTE,
init: function() {
var container, input;
if (d.cookie.indexOf('pass_enabled=1') >= 0) {
return;
}
if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt'))) {
return;
}
container = $.el('div', {
className: 'captcha-img',
title: 'Reload reCAPTCHA'
});
input = $.el('input', {
className: 'captcha-input field',
title: 'Verification',
autocomplete: 'off',
spellcheck: false
});
this.nodes = {
container: container,
input: input
};
$.on(input, 'keydown', this.keydown.bind(this));
$.on(this.nodes.container, 'click', (function(_this) {
return function() {
_this.reload();
return _this.nodes.input.focus();
};
})(this));
this.conn = new Connection(null, location.protocol + "//www.google.com", {
challenge: this.load.bind(this),
token: this.save.bind(this),
error: this.error.bind(this)
});
$.addClass(QR.nodes.el, 'has-captcha', 'captcha-v1', 'noscript-captcha');
$.after(QR.nodes.com.parentNode, [container, input]);
this.captchas = [];
$.get('captchas', [], function(arg) {
var captchas;
captchas = arg.captchas;
QR.captcha.sync(captchas);
return QR.captcha.clear();
});
$.sync('captchas', this.sync);
this.beforeSetup();
return this.setup();
},
initFrame: function() {
var cb, conn, img, ref, ref1;
conn = new Connection(window.parent, location.protocol + "//boards.4chan.org", {
response: function(response) {
$.id('recaptcha_response_field').value = response;
return HTMLFormElement.prototype.submit.call($('form'));
}
});
if (location.hash === '#response') {
conn.send({
token: (ref = $('textarea')) != null ? ref.value : void 0,
error: (ref1 = $('.recaptcha_input_area')) != null ? ref1.textContent.replace(/:$/, '') : void 0
});
}
if (!(img = $('img'))) {
return;
}
$('form').action = '#response';
cb = function() {
var canvas;
canvas = $.el('canvas');
canvas.width = img.width;
canvas.height = img.height;
canvas.getContext('2d').drawImage(img, 0, 0);
return conn.send({
challenge: canvas.toDataURL()
});
};
if (img.complete) {
return cb();
} else {
return $.on(img, 'load', cb);
}
},
timers: {},
iframeURL: function() {
var lang, url;
url = '//www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc';
if (lang = Conf['captchaLanguage'].trim()) {
url += "&hl=" + (encodeURIComponent(lang));
}
return url;
},
cb: {
focus: function() {
return QR.captcha.setup(false, true);
}
},
beforeSetup: function() {
var container, input, ref;
ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = true;
input.value = '';
input.placeholder = 'Focus to load reCAPTCHA';
this.count();
return $.on(input, 'focus click', this.cb.focus);
},
needed: function() {
var captchaCount, postsCount;
captchaCount = this.captchas.length;
if (QR.req) {
captchaCount++;
}
postsCount = QR.posts.length;
if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
postsCount = 0;
}
return captchaCount < postsCount;
},
onNewPost: function() {},
onPostChange: function() {},
setup: function(focus, force) {
if (!(this.isEnabled && (this.needed() || force))) {
return;
}
if (!this.nodes.iframe) {
this.nodes.iframe = $.el('iframe', {
id: 'qr-captcha-iframe',
src: this.iframeURL()
});
$.add(QR.nodes.el, this.nodes.iframe);
this.conn.target = this.nodes.iframe;
} else if (!this.occupied || force) {
this.nodes.iframe.src = this.iframeURL();
}
this.occupied = true;
if (focus) {
return this.nodes.input.focus();
}
},
afterSetup: function() {
var container, input, ref;
ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = false;
input.placeholder = 'Verification';
this.count();
$.off(input, 'focus click', this.cb.focus);
if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
QR.nodes.el.style.top = '';
return QR.nodes.el.style.bottom = '0px';
}
},
destroy: function() {
if (!this.isEnabled) {
return;
}
$.rm(this.nodes.img);
delete this.nodes.img;
$.rm(this.nodes.iframe);
delete this.nodes.iframe;
delete this.occupied;
return this.beforeSetup();
},
sync: function(captchas) {
if (captchas == null) {
captchas = [];
}
QR.captcha.captchas = captchas;
return QR.captcha.count();
},
getOne: function() {
var captcha;
this.clear();
if (captcha = this.captchas.shift()) {
this.count();
$.set('captchas', this.captchas);
return captcha;
} else if (/\S/.test(this.nodes.input.value)) {
return (function(_this) {
return function(cb) {
_this.submitCB = cb;
return _this.sendResponse();
};
})(this);
} else {
return null;
}
},
sendResponse: function() {
var response;
response = this.nodes.input.value;
if (/\S/.test(response)) {
return this.conn.send({
response: response
});
}
},
save: function(token) {
var captcha;
delete this.occupied;
this.nodes.input.value = '';
captcha = {
challenge: token,
response: 'manual_challenge',
timeout: this.timeout
};
if (this.submitCB) {
this.submitCB(captcha);
delete this.submitCB;
if (this.needed()) {
return this.reload();
} else {
return this.destroy();
}
} else {
$.forceSync('captchas');
this.captchas.push(captcha);
this.count();
$.set('captchas', this.captchas);
return this.reload();
}
},
error: function(message) {
this.occupied = true;
this.nodes.input.value = '';
if (this.submitCB) {
this.submitCB();
delete this.submitCB;
}
return QR.error("Captcha Error: " + message);
},
clear: function() {
var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
return;
}
$.forceSync('captchas');
now = Date.now();
ref = this.captchas;
for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
captcha = ref[i];
if (captcha.timeout > now) {
break;
}
}
if (!i) {
return;
}
this.captchas = this.captchas.slice(i);
this.count();
return $.set('captchas', this.captchas);
},
load: function(src) {
var container, img, input, ref;
ref = this.nodes, container = ref.container, input = ref.input, img = ref.img;
this.occupied = true;
this.timeout = Date.now() + this.lifetime;
if (!img) {
img = this.nodes.img = new Image();
$.one(img, 'load', this.afterSetup.bind(this));
$.on(img, 'load', function() {
return this.hidden = false;
});
$.add(container, img);
}
img.src = src;
input.value = '';
this.clear();
clearTimeout(this.timers.expire);
return this.timers.expire = setTimeout(this.expire.bind(this), this.lifetime);
},
count: function() {
var count, placeholder;
count = this.captchas ? this.captchas.length : 0;
placeholder = this.nodes.input.placeholder.replace(/\ \(.*\)$/, '');
placeholder += (function() {
switch (count) {
case 0:
if (placeholder === 'Verification') {
return ' (Shift + Enter to cache)';
} else {
return '';
}
break;
case 1:
return ' (1 cached captcha)';
default:
return " (" + count + " cached captchas)";
}
})();
this.nodes.input.placeholder = placeholder;
this.nodes.input.alt = count;
clearTimeout(this.timers.clear);
if (this.captchas.length) {
return this.timers.clear = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
}
},
expire: function() {
if (!this.nodes.iframe) {
return;
}
if (!d.hidden && (this.needed() || d.activeElement === this.nodes.input)) {
return this.reload();
} else {
return this.destroy();
}
},
reload: function() {
var ref;
this.nodes.iframe.src = this.iframeURL();
this.occupied = true;
return (ref = this.nodes.img) != null ? ref.hidden = true : void 0;
},
keydown: function(e) {
if (e.keyCode === 8 && !this.nodes.input.value) {
if (this.nodes.iframe) {
this.reload();
} else {
this.setup();
}
} else if (e.keyCode === 13 && e.shiftKey) {
this.sendResponse();
} else {
return;
}
return e.preventDefault();
}
};
Captcha.replace = {
init: function() {
var jsEnabled;
@ -9322,20 +8991,19 @@
QR.post = (function() {
function _Class(select) {
this.select = bind(this.select, this);
var el, event, k, len1, prev, ref;
var el, event, k, label, len1, len2, prev, q, ref, ref1;
el = $.el('a', {
className: 'qr-preview',
draggable: true,
href: 'javascript:;'
});
$.extend(el, {
innerHTML: "<a class=\"remove fa fa-times-circle\" title=\"Remove\"></a><label hidden><input type=\"checkbox\"> Spoiler</label><span></span>"
innerHTML: "<a class=\"remove fa fa-times-circle\" title=\"Remove\"></a><label class=\"qr-preview-spoiler\"><input type=\"checkbox\"> Spoiler</label><span></span>"
});
this.nodes = {
el: el,
rm: el.firstChild,
label: $('label', el),
spoiler: $('input', el),
spoiler: $('.qr-preview-spoiler input', el),
span: el.lastChild
};
$.on(el, 'click', this.select);
@ -9345,9 +9013,6 @@
return _this.rm();
};
})(this));
$.on(this.nodes.label, 'click', function(e) {
return e.stopPropagation();
});
$.on(this.nodes.spoiler, 'change', (function(_this) {
return function(e) {
_this.spoiler = e.target.checked;
@ -9356,10 +9021,17 @@
}
};
})(this));
$.add(QR.nodes.dumpList, el);
ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
ref = $$('label', el);
for (k = 0, len1 = ref.length; k < len1; k++) {
event = ref[k];
label = ref[k];
$.on(label, 'click', function(e) {
return e.stopPropagation();
});
}
$.add(QR.nodes.dumpList, el);
ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
for (q = 0, len2 = ref1.length; q < len2; q++) {
event = ref1[q];
$.on(el, event.toLowerCase(), this[event]);
}
this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
@ -9433,7 +9105,7 @@
_Class.prototype.select = function() {
var rectEl, rectList;
if (QR.selected) {
QR.selected.nodes.el.id = null;
QR.selected.nodes.el.removeAttribute('id');
QR.selected.forceSave();
}
QR.selected = this;
@ -9591,9 +9263,7 @@
}
this.filesize = $.bytesToString(this.file.size);
this.checkSize();
if (QR.spoiler) {
this.nodes.label.hidden = false;
}
$.addClass(this.nodes.el, 'has-file');
QR.captcha.onPostChange();
URL.revokeObjectURL(this.URL);
this.saveFilename();
@ -9727,12 +9397,10 @@
delete this.file;
delete this.filename;
delete this.filesize;
this.nodes.el.title = null;
QR.nodes.filename.title = '';
this.nodes.el.removeAttribute('title');
QR.nodes.filename.removeAttribute('title');
this.nodes.el.style.backgroundImage = null;
if (QR.spoiler) {
this.nodes.label.hidden = true;
}
$.rmClass(this.nodes.el, 'has-file');
this.showFileData();
this.updateFlashURL();
URL.revokeObjectURL(this.URL);
@ -9762,11 +9430,11 @@
if (this.file) {
this.updateFilename();
QR.nodes.filename.value = this.filename;
QR.nodes.spoiler.checked = this.spoiler;
return $.addClass(QR.nodes.fileSubmit, 'has-file');
$.addClass(QR.nodes.fileSubmit, 'has-file');
} else {
return $.rmClass(QR.nodes.fileSubmit, 'has-file');
$.rmClass(QR.nodes.fileSubmit, 'has-file');
}
return QR.nodes.spoiler.checked = this.spoiler;
};
_Class.prototype.updateFlashURL = function() {
@ -16311,9 +15979,6 @@
Report = {
css: ":root:not(.js-enabled) #captchaContainerAlt {\n" +
" height: auto;\n" +
"}\n" +
"noscript > iframe, #recaptcha_challenge_field {\n" +
" width: 500px;\n" +
"}",
init: function() {
var match;
@ -17256,12 +16921,6 @@
}
window['4chan X antidup'] = true;
if (location.hostname === 'www.google.com') {
if (location.pathname === '/recaptcha/api/noscript') {
$.ready(function() {
return Captcha.noscript.initFrame();
});
return;
}
if (location.pathname === '/recaptcha/api/fallback') {
$.ready(function() {
return Captcha.v2.initFrame();
@ -18477,6 +18136,10 @@
"#captchaContainerAlt td:nth-child(2) {\n" +
" display: table-cell !important;\n" +
"}\n" +
"/* Disable obnoxious captcha fade-in. */\n" +
"body > div:last-of-type {\n" +
" transition: none !important;\n" +
"}\n" +
"/* Anti-autoplay */\n" +
"audio.controls-added {\n" +
" display: block;\n" +
@ -19785,7 +19448,8 @@
" margin: 0;\n" +
" margin-right: 3px;\n" +
"}\n" +
"#qr.has-spoiler #file-n-submit:not(.has-file) #qr-spoiler-label,\n" +
"#qr:not(.has-spoiler) #qr-spoiler-label,\n" +
"#file-n-submit:not(.has-file) #qr-spoiler-label,\n" +
".has-file #paste-area,\n" +
".has-file #url-button,\n" +
"#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {\n" +
@ -19798,20 +19462,18 @@
" margin: 0;\n" +
"}\n" +
".checkbox-letter {\n" +
" pointer-events: none;\n" +
" position: absolute;\n" +
" top: 2px;\n" +
" left: 0;\n" +
" right: 0;\n" +
" text-align: center;\n" +
" font-size: 11px;\n" +
" font-weight: bold;\n" +
" color: rgba(0,0,0,.6);\n" +
"}\n" +
"#qr-filename-container label:not(:hover) > input[type=\"checkbox\"]:not(:focus):not(:checked),\n" +
"#qr-filename-container label:hover > .checkbox-letter,\n" +
"input[type=\"checkbox\"]:focus ~ .checkbox-letter,\n" +
"input[type=\"checkbox\"]:checked ~ .checkbox-letter {\n" +
" display: none;\n" +
" /* not displayed but still focusable */\n" +
" position: absolute;\n" +
" opacity: 0;\n" +
" pointer-events: none;\n" +
"}\n" +
"#paste-area, #url-button, #custom-cooldown-button, #dump-button {\n" +
".checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button {\n" +
" opacity: 0.6;\n" +
"}\n" +
"#paste-area {\n" +
@ -19906,6 +19568,10 @@
".remove:hover::after {\n" +
" content: \" Remove\";\n" +
"}\n" +
".qr-preview:not(.has-file) label,\n" +
"#qr:not(.has-spoiler) .qr-preview-spoiler {\n" +
" display: none;\n" +
"}\n" +
".qr-preview > label {\n" +
" background: rgba(0,0,0,.5);\n" +
" color: #fff;\n" +

Binary file not shown.

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
// @version 1.11.13.4
// @version 1.11.13.5
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -23,8 +23,6 @@
// @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
@ -244,7 +242,7 @@
'Hide Original Post Form': [true, 'Hide the normal post form.', 1],
'Cooldown': [true, 'Indicate the remaining time before posting again.', 1],
'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.', 1],
'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha in the QR even if Javascript is enabled.', 1],
'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha in the QR even if Javascript is enabled (Recaptcha v2 only).', 1],
'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.', 1],
'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.', 1],
'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1],
@ -415,7 +413,7 @@
doc = d.documentElement;
g = {
VERSION: '1.11.13.4',
VERSION: '1.11.13.5',
NAMESPACE: '4chan X.',
boards: {}
};
@ -6866,7 +6864,7 @@
'webm': 'video/webm'
},
init: function() {
var noscript, sc, version;
var sc, version;
if (!Conf['Quick Reply']) {
return;
}
@ -6875,7 +6873,7 @@
if (g.VIEW === 'archive') {
return;
}
version = Conf['Use Recaptcha v1'] ? (noscript = Conf['Force Noscript Captcha'] || !$.hasClass(doc, 'js-enabled'), noscript ? 'noscript' : 'v1') : 'v2';
version = Conf['Use Recaptcha v1'] ? 'v1' : 'v2';
this.captcha = Captcha[version];
$.on(d, '4chanXInitFinished', this.initReady);
Post.callbacks.push({
@ -7424,7 +7422,7 @@
var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, scriptData, setNode;
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
innerHTML: "<div class=\"move\"><label><input type=\"checkbox\" id=\"autohide\" title=\"Auto-hide\">Quick Reply</label><a href=\"javascript:;\" class=\"close\" title=\"Close\">×</a><select data-name=\"thread\" title=\"Create a new thread / Reply\"><option value=\"new\">New thread</option></select></div><form><div class=\"persona\"><button type=\"button\" id=\"sjis-toggle\" title=\"Toggle Mona font\">∀</button><button type=\"button\" id=\"tex-preview-button\" title=\"Preview TeX\">T<sub>E</sub>X</button><input name=\"name\" data-name=\"name\" list=\"list-name\" placeholder=\"Name\" class=\"field\" size=\"1\"><input name=\"email\" data-name=\"email\" list=\"list-email\" placeholder=\"Options\" class=\"field\" size=\"1\"><input name=\"sub\" data-name=\"sub\" list=\"list-sub\" placeholder=\"Subject\" class=\"field\" size=\"1\"></div><div class=\"textarea\"><textarea data-name=\"com\" placeholder=\"Comment\" class=\"field\"></textarea><span id=\"char-count\"></span><div id=\"tex-preview\"></div></div><div id=\"dump-list-container\"><div id=\"dump-list\"></div><a id=\"add-post\" href=\"javascript:;\" title=\"Add a post\">+</a></div><div class=\"oekaki\"><input type=\"button\" id=\"qr-draw-button\" value=\"Draw\"><label><span>Width:</span><input name=\"oekaki-width\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label><label><span>Height:</span><input name=\"oekaki-height\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label></div><div id=\"file-n-submit\"><input type=\"button\" id=\"qr-file-button\" value=\"Files\"><span id=\"qr-filename-container\" class=\"field\"><span id=\"qr-no-file\">No selected file</span><input id=\"qr-filename\" data-name=\"filename\" spellcheck=\"false\"><label id=\"qr-spoiler-label\"><input type=\"checkbox\" id=\"qr-file-spoiler\" title=\"Spoiler image\"><span class=\"checkbox-letter\">S</span></label><a href=\"javascript:;\" id=\"qr-filerm\" title=\"Remove file\"><i class=\"fa fa-times-circle\"></i></a><a id=\"url-button\" title=\"Post from url\"><i class=\"fa fa-link\"></i></a><a hidden id=\"paste-area\" title=\"Select to paste images\" class=\"fa fa-clipboard\" tabindex=\"-1\" contentEditable=\"true\"></a><a id=\"custom-cooldown-button\" title=\"Toggle custom cooldown\" class=\"disabled\"><i class=\"fa fa-clock-o\"></i></a><a id=\"dump-button\" title=\"Dump list\"><i class=\"fa fa-plus-square\"></i></a></span><input type=\"submit\"></div><select data-default=\"4\" name=\"filetag\"><option value=\"0\">Hentai</option><option value=\"6\">Porn</option><option value=\"1\">Japanese</option><option value=\"2\">Anime</option><option value=\"3\">Game</option><option value=\"5\">Loop</option><option value=\"4\" selected>Other</option></select><input type=\"file\" multiple></form><datalist id=\"list-name\"></datalist><datalist id=\"list-email\"></datalist><datalist id=\"list-sub\"></datalist> "
innerHTML: "<div class=\"move\"><label><input type=\"checkbox\" id=\"autohide\" title=\"Auto-hide\">Quick Reply</label><a href=\"javascript:;\" class=\"close\" title=\"Close\">×</a><select data-name=\"thread\" title=\"Create a new thread / Reply\"><option value=\"new\">New thread</option></select></div><form><div class=\"persona\"><button type=\"button\" id=\"sjis-toggle\" title=\"Toggle Mona font\">∀</button><button type=\"button\" id=\"tex-preview-button\" title=\"Preview TeX\">T<sub>E</sub>X</button><input name=\"name\" data-name=\"name\" list=\"list-name\" placeholder=\"Name\" class=\"field\" size=\"1\"><input name=\"email\" data-name=\"email\" list=\"list-email\" placeholder=\"Options\" class=\"field\" size=\"1\"><input name=\"sub\" data-name=\"sub\" list=\"list-sub\" placeholder=\"Subject\" class=\"field\" size=\"1\"></div><div class=\"textarea\"><textarea data-name=\"com\" placeholder=\"Comment\" class=\"field\"></textarea><span id=\"char-count\"></span><div id=\"tex-preview\"></div></div><div id=\"dump-list-container\"><div id=\"dump-list\"></div><a id=\"add-post\" href=\"javascript:;\" title=\"Add a post\">+</a></div><div class=\"oekaki\"><input type=\"button\" id=\"qr-draw-button\" value=\"Draw\"><label><span>Width:</span><input name=\"oekaki-width\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label><label><span>Height:</span><input name=\"oekaki-height\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label></div><div id=\"file-n-submit\"><input type=\"button\" id=\"qr-file-button\" value=\"Files\"><span id=\"qr-filename-container\" class=\"field\"><span id=\"qr-no-file\">No selected file</span><input id=\"qr-filename\" data-name=\"filename\" spellcheck=\"false\"><label id=\"qr-spoiler-label\"><input type=\"checkbox\" id=\"qr-file-spoiler\" title=\"Spoiler image\"><a class=\"checkbox-letter\">S</a></label><a href=\"javascript:;\" id=\"qr-filerm\" title=\"Remove file\"><i class=\"fa fa-times-circle\"></i></a><a id=\"url-button\" title=\"Post from url\"><i class=\"fa fa-link\"></i></a><a hidden id=\"paste-area\" title=\"Select to paste images\" class=\"fa fa-clipboard\" tabindex=\"-1\" contentEditable=\"true\"></a><a id=\"custom-cooldown-button\" title=\"Toggle custom cooldown\" class=\"disabled\"><i class=\"fa fa-clock-o\"></i></a><a id=\"dump-button\" title=\"Dump list\"><i class=\"fa fa-plus-square\"></i></a></span><input type=\"submit\"></div><select data-default=\"4\" name=\"filetag\"><option value=\"0\">Hentai</option><option value=\"6\">Porn</option><option value=\"1\">Japanese</option><option value=\"2\">Anime</option><option value=\"3\">Game</option><option value=\"5\">Loop</option><option value=\"4\" selected>Other</option></select><input type=\"file\" multiple></form><datalist id=\"list-name\"></datalist><datalist id=\"list-email\"></datalist><datalist id=\"list-sub\"></datalist> "
})
};
setNode = function(name, query) {
@ -7489,8 +7487,6 @@
QR.spoiler = !!$('.postForm input[name=spoiler]');
if (QR.spoiler) {
$.addClass(QR.nodes.el, 'has-spoiler');
} else {
nodes.spoiler.parentElement.hidden = true;
}
if (g.BOARD.ID === 'jp' && Conf['sjisPreview']) {
$.addClass(QR.nodes.el, 'sjis-preview');
@ -7884,7 +7880,8 @@
childList: true,
subtree: true
});
return $.on(d, 'keydown', this.keybinds.bind(this));
$.on(d, 'keydown', this.keybinds.bind(this));
return window.focus();
},
initNoscript: function() {
this.noscript = true;
@ -8007,334 +8004,6 @@
}
};
Captcha.noscript = {
lifetime: 30 * $.MINUTE,
init: function() {
var container, input;
if (d.cookie.indexOf('pass_enabled=1') >= 0) {
return;
}
if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt'))) {
return;
}
container = $.el('div', {
className: 'captcha-img',
title: 'Reload reCAPTCHA'
});
input = $.el('input', {
className: 'captcha-input field',
title: 'Verification',
autocomplete: 'off',
spellcheck: false
});
this.nodes = {
container: container,
input: input
};
$.on(input, 'keydown', this.keydown.bind(this));
$.on(this.nodes.container, 'click', (function(_this) {
return function() {
_this.reload();
return _this.nodes.input.focus();
};
})(this));
this.conn = new Connection(null, location.protocol + "//www.google.com", {
challenge: this.load.bind(this),
token: this.save.bind(this),
error: this.error.bind(this)
});
$.addClass(QR.nodes.el, 'has-captcha', 'captcha-v1', 'noscript-captcha');
$.after(QR.nodes.com.parentNode, [container, input]);
this.captchas = [];
$.get('captchas', [], function(arg) {
var captchas;
captchas = arg.captchas;
QR.captcha.sync(captchas);
return QR.captcha.clear();
});
$.sync('captchas', this.sync);
this.beforeSetup();
return this.setup();
},
initFrame: function() {
var cb, conn, img, ref, ref1;
conn = new Connection(window.parent, location.protocol + "//boards.4chan.org", {
response: function(response) {
$.id('recaptcha_response_field').value = response;
return HTMLFormElement.prototype.submit.call($('form'));
}
});
if (location.hash === '#response') {
conn.send({
token: (ref = $('textarea')) != null ? ref.value : void 0,
error: (ref1 = $('.recaptcha_input_area')) != null ? ref1.textContent.replace(/:$/, '') : void 0
});
}
if (!(img = $('img'))) {
return;
}
$('form').action = '#response';
cb = function() {
var canvas;
canvas = $.el('canvas');
canvas.width = img.width;
canvas.height = img.height;
canvas.getContext('2d').drawImage(img, 0, 0);
return conn.send({
challenge: canvas.toDataURL()
});
};
if (img.complete) {
return cb();
} else {
return $.on(img, 'load', cb);
}
},
timers: {},
iframeURL: function() {
var lang, url;
url = '//www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc';
if (lang = Conf['captchaLanguage'].trim()) {
url += "&hl=" + (encodeURIComponent(lang));
}
return url;
},
cb: {
focus: function() {
return QR.captcha.setup(false, true);
}
},
beforeSetup: function() {
var container, input, ref;
ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = true;
input.value = '';
input.placeholder = 'Focus to load reCAPTCHA';
this.count();
return $.on(input, 'focus click', this.cb.focus);
},
needed: function() {
var captchaCount, postsCount;
captchaCount = this.captchas.length;
if (QR.req) {
captchaCount++;
}
postsCount = QR.posts.length;
if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
postsCount = 0;
}
return captchaCount < postsCount;
},
onNewPost: function() {},
onPostChange: function() {},
setup: function(focus, force) {
if (!(this.isEnabled && (this.needed() || force))) {
return;
}
if (!this.nodes.iframe) {
this.nodes.iframe = $.el('iframe', {
id: 'qr-captcha-iframe',
src: this.iframeURL()
});
$.add(QR.nodes.el, this.nodes.iframe);
this.conn.target = this.nodes.iframe;
} else if (!this.occupied || force) {
this.nodes.iframe.src = this.iframeURL();
}
this.occupied = true;
if (focus) {
return this.nodes.input.focus();
}
},
afterSetup: function() {
var container, input, ref;
ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = false;
input.placeholder = 'Verification';
this.count();
$.off(input, 'focus click', this.cb.focus);
if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
QR.nodes.el.style.top = '';
return QR.nodes.el.style.bottom = '0px';
}
},
destroy: function() {
if (!this.isEnabled) {
return;
}
$.rm(this.nodes.img);
delete this.nodes.img;
$.rm(this.nodes.iframe);
delete this.nodes.iframe;
delete this.occupied;
return this.beforeSetup();
},
sync: function(captchas) {
if (captchas == null) {
captchas = [];
}
QR.captcha.captchas = captchas;
return QR.captcha.count();
},
getOne: function() {
var captcha;
this.clear();
if (captcha = this.captchas.shift()) {
this.count();
$.set('captchas', this.captchas);
return captcha;
} else if (/\S/.test(this.nodes.input.value)) {
return (function(_this) {
return function(cb) {
_this.submitCB = cb;
return _this.sendResponse();
};
})(this);
} else {
return null;
}
},
sendResponse: function() {
var response;
response = this.nodes.input.value;
if (/\S/.test(response)) {
return this.conn.send({
response: response
});
}
},
save: function(token) {
var captcha;
delete this.occupied;
this.nodes.input.value = '';
captcha = {
challenge: token,
response: 'manual_challenge',
timeout: this.timeout
};
if (this.submitCB) {
this.submitCB(captcha);
delete this.submitCB;
if (this.needed()) {
return this.reload();
} else {
return this.destroy();
}
} else {
$.forceSync('captchas');
this.captchas.push(captcha);
this.count();
$.set('captchas', this.captchas);
return this.reload();
}
},
error: function(message) {
this.occupied = true;
this.nodes.input.value = '';
if (this.submitCB) {
this.submitCB();
delete this.submitCB;
}
return QR.error("Captcha Error: " + message);
},
clear: function() {
var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
return;
}
$.forceSync('captchas');
now = Date.now();
ref = this.captchas;
for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
captcha = ref[i];
if (captcha.timeout > now) {
break;
}
}
if (!i) {
return;
}
this.captchas = this.captchas.slice(i);
this.count();
return $.set('captchas', this.captchas);
},
load: function(src) {
var container, img, input, ref;
ref = this.nodes, container = ref.container, input = ref.input, img = ref.img;
this.occupied = true;
this.timeout = Date.now() + this.lifetime;
if (!img) {
img = this.nodes.img = new Image();
$.one(img, 'load', this.afterSetup.bind(this));
$.on(img, 'load', function() {
return this.hidden = false;
});
$.add(container, img);
}
img.src = src;
input.value = '';
this.clear();
clearTimeout(this.timers.expire);
return this.timers.expire = setTimeout(this.expire.bind(this), this.lifetime);
},
count: function() {
var count, placeholder;
count = this.captchas ? this.captchas.length : 0;
placeholder = this.nodes.input.placeholder.replace(/\ \(.*\)$/, '');
placeholder += (function() {
switch (count) {
case 0:
if (placeholder === 'Verification') {
return ' (Shift + Enter to cache)';
} else {
return '';
}
break;
case 1:
return ' (1 cached captcha)';
default:
return " (" + count + " cached captchas)";
}
})();
this.nodes.input.placeholder = placeholder;
this.nodes.input.alt = count;
clearTimeout(this.timers.clear);
if (this.captchas.length) {
return this.timers.clear = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
}
},
expire: function() {
if (!this.nodes.iframe) {
return;
}
if (!d.hidden && (this.needed() || d.activeElement === this.nodes.input)) {
return this.reload();
} else {
return this.destroy();
}
},
reload: function() {
var ref;
this.nodes.iframe.src = this.iframeURL();
this.occupied = true;
return (ref = this.nodes.img) != null ? ref.hidden = true : void 0;
},
keydown: function(e) {
if (e.keyCode === 8 && !this.nodes.input.value) {
if (this.nodes.iframe) {
this.reload();
} else {
this.setup();
}
} else if (e.keyCode === 13 && e.shiftKey) {
this.sendResponse();
} else {
return;
}
return e.preventDefault();
}
};
Captcha.replace = {
init: function() {
var jsEnabled;
@ -9322,20 +8991,19 @@
QR.post = (function() {
function _Class(select) {
this.select = bind(this.select, this);
var el, event, k, len1, prev, ref;
var el, event, k, label, len1, len2, prev, q, ref, ref1;
el = $.el('a', {
className: 'qr-preview',
draggable: true,
href: 'javascript:;'
});
$.extend(el, {
innerHTML: "<a class=\"remove fa fa-times-circle\" title=\"Remove\"></a><label hidden><input type=\"checkbox\"> Spoiler</label><span></span>"
innerHTML: "<a class=\"remove fa fa-times-circle\" title=\"Remove\"></a><label class=\"qr-preview-spoiler\"><input type=\"checkbox\"> Spoiler</label><span></span>"
});
this.nodes = {
el: el,
rm: el.firstChild,
label: $('label', el),
spoiler: $('input', el),
spoiler: $('.qr-preview-spoiler input', el),
span: el.lastChild
};
$.on(el, 'click', this.select);
@ -9345,9 +9013,6 @@
return _this.rm();
};
})(this));
$.on(this.nodes.label, 'click', function(e) {
return e.stopPropagation();
});
$.on(this.nodes.spoiler, 'change', (function(_this) {
return function(e) {
_this.spoiler = e.target.checked;
@ -9356,10 +9021,17 @@
}
};
})(this));
$.add(QR.nodes.dumpList, el);
ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
ref = $$('label', el);
for (k = 0, len1 = ref.length; k < len1; k++) {
event = ref[k];
label = ref[k];
$.on(label, 'click', function(e) {
return e.stopPropagation();
});
}
$.add(QR.nodes.dumpList, el);
ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
for (q = 0, len2 = ref1.length; q < len2; q++) {
event = ref1[q];
$.on(el, event.toLowerCase(), this[event]);
}
this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
@ -9433,7 +9105,7 @@
_Class.prototype.select = function() {
var rectEl, rectList;
if (QR.selected) {
QR.selected.nodes.el.id = null;
QR.selected.nodes.el.removeAttribute('id');
QR.selected.forceSave();
}
QR.selected = this;
@ -9591,9 +9263,7 @@
}
this.filesize = $.bytesToString(this.file.size);
this.checkSize();
if (QR.spoiler) {
this.nodes.label.hidden = false;
}
$.addClass(this.nodes.el, 'has-file');
QR.captcha.onPostChange();
URL.revokeObjectURL(this.URL);
this.saveFilename();
@ -9727,12 +9397,10 @@
delete this.file;
delete this.filename;
delete this.filesize;
this.nodes.el.title = null;
QR.nodes.filename.title = '';
this.nodes.el.removeAttribute('title');
QR.nodes.filename.removeAttribute('title');
this.nodes.el.style.backgroundImage = null;
if (QR.spoiler) {
this.nodes.label.hidden = true;
}
$.rmClass(this.nodes.el, 'has-file');
this.showFileData();
this.updateFlashURL();
URL.revokeObjectURL(this.URL);
@ -9762,11 +9430,11 @@
if (this.file) {
this.updateFilename();
QR.nodes.filename.value = this.filename;
QR.nodes.spoiler.checked = this.spoiler;
return $.addClass(QR.nodes.fileSubmit, 'has-file');
$.addClass(QR.nodes.fileSubmit, 'has-file');
} else {
return $.rmClass(QR.nodes.fileSubmit, 'has-file');
$.rmClass(QR.nodes.fileSubmit, 'has-file');
}
return QR.nodes.spoiler.checked = this.spoiler;
};
_Class.prototype.updateFlashURL = function() {
@ -16311,9 +15979,6 @@
Report = {
css: ":root:not(.js-enabled) #captchaContainerAlt {\n" +
" height: auto;\n" +
"}\n" +
"noscript > iframe, #recaptcha_challenge_field {\n" +
" width: 500px;\n" +
"}",
init: function() {
var match;
@ -17256,12 +16921,6 @@
}
window['4chan X antidup'] = true;
if (location.hostname === 'www.google.com') {
if (location.pathname === '/recaptcha/api/noscript') {
$.ready(function() {
return Captcha.noscript.initFrame();
});
return;
}
if (location.pathname === '/recaptcha/api/fallback') {
$.ready(function() {
return Captcha.v2.initFrame();
@ -18477,6 +18136,10 @@
"#captchaContainerAlt td:nth-child(2) {\n" +
" display: table-cell !important;\n" +
"}\n" +
"/* Disable obnoxious captcha fade-in. */\n" +
"body > div:last-of-type {\n" +
" transition: none !important;\n" +
"}\n" +
"/* Anti-autoplay */\n" +
"audio.controls-added {\n" +
" display: block;\n" +
@ -19785,7 +19448,8 @@
" margin: 0;\n" +
" margin-right: 3px;\n" +
"}\n" +
"#qr.has-spoiler #file-n-submit:not(.has-file) #qr-spoiler-label,\n" +
"#qr:not(.has-spoiler) #qr-spoiler-label,\n" +
"#file-n-submit:not(.has-file) #qr-spoiler-label,\n" +
".has-file #paste-area,\n" +
".has-file #url-button,\n" +
"#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {\n" +
@ -19798,20 +19462,18 @@
" margin: 0;\n" +
"}\n" +
".checkbox-letter {\n" +
" pointer-events: none;\n" +
" position: absolute;\n" +
" top: 2px;\n" +
" left: 0;\n" +
" right: 0;\n" +
" text-align: center;\n" +
" font-size: 11px;\n" +
" font-weight: bold;\n" +
" color: rgba(0,0,0,.6);\n" +
"}\n" +
"#qr-filename-container label:not(:hover) > input[type=\"checkbox\"]:not(:focus):not(:checked),\n" +
"#qr-filename-container label:hover > .checkbox-letter,\n" +
"input[type=\"checkbox\"]:focus ~ .checkbox-letter,\n" +
"input[type=\"checkbox\"]:checked ~ .checkbox-letter {\n" +
" display: none;\n" +
" /* not displayed but still focusable */\n" +
" position: absolute;\n" +
" opacity: 0;\n" +
" pointer-events: none;\n" +
"}\n" +
"#paste-area, #url-button, #custom-cooldown-button, #dump-button {\n" +
".checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button {\n" +
" opacity: 0.6;\n" +
"}\n" +
"#paste-area {\n" +
@ -19906,6 +19568,10 @@
".remove:hover::after {\n" +
" content: \" Remove\";\n" +
"}\n" +
".qr-preview:not(.has-file) label,\n" +
"#qr:not(.has-spoiler) .qr-preview-spoiler {\n" +
" display: none;\n" +
"}\n" +
".qr-preview > label {\n" +
" background: rgba(0,0,0,.5);\n" +
" color: #fff;\n" +

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
// @version 1.11.13.4
// @version 1.11.13.5
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -22,8 +22,6 @@
// @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
// @version 1.11.13.4
// @version 1.11.13.5
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -23,8 +23,6 @@
// @include https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include http://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @include https://www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
@ -244,7 +242,7 @@
'Hide Original Post Form': [true, 'Hide the normal post form.', 1],
'Cooldown': [true, 'Indicate the remaining time before posting again.', 1],
'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.', 1],
'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha in the QR even if Javascript is enabled.', 1],
'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha in the QR even if Javascript is enabled (Recaptcha v2 only).', 1],
'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.', 1],
'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.', 1],
'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1],
@ -415,7 +413,7 @@
doc = d.documentElement;
g = {
VERSION: '1.11.13.4',
VERSION: '1.11.13.5',
NAMESPACE: '4chan X.',
boards: {}
};
@ -6866,7 +6864,7 @@
'webm': 'video/webm'
},
init: function() {
var noscript, sc, version;
var sc, version;
if (!Conf['Quick Reply']) {
return;
}
@ -6875,7 +6873,7 @@
if (g.VIEW === 'archive') {
return;
}
version = Conf['Use Recaptcha v1'] ? (noscript = Conf['Force Noscript Captcha'] || !$.hasClass(doc, 'js-enabled'), noscript ? 'noscript' : 'v1') : 'v2';
version = Conf['Use Recaptcha v1'] ? 'v1' : 'v2';
this.captcha = Captcha[version];
$.on(d, '4chanXInitFinished', this.initReady);
Post.callbacks.push({
@ -7424,7 +7422,7 @@
var dialog, event, i, items, m, match_max, match_min, name, node, nodes, ref, rules, save, scriptData, setNode;
QR.nodes = nodes = {
el: dialog = UI.dialog('qr', 'top: 50px; right: 0px;', {
innerHTML: "<div class=\"move\"><label><input type=\"checkbox\" id=\"autohide\" title=\"Auto-hide\">Quick Reply</label><a href=\"javascript:;\" class=\"close\" title=\"Close\">×</a><select data-name=\"thread\" title=\"Create a new thread / Reply\"><option value=\"new\">New thread</option></select></div><form><div class=\"persona\"><button type=\"button\" id=\"sjis-toggle\" title=\"Toggle Mona font\">∀</button><button type=\"button\" id=\"tex-preview-button\" title=\"Preview TeX\">T<sub>E</sub>X</button><input name=\"name\" data-name=\"name\" list=\"list-name\" placeholder=\"Name\" class=\"field\" size=\"1\"><input name=\"email\" data-name=\"email\" list=\"list-email\" placeholder=\"Options\" class=\"field\" size=\"1\"><input name=\"sub\" data-name=\"sub\" list=\"list-sub\" placeholder=\"Subject\" class=\"field\" size=\"1\"></div><div class=\"textarea\"><textarea data-name=\"com\" placeholder=\"Comment\" class=\"field\"></textarea><span id=\"char-count\"></span><div id=\"tex-preview\"></div></div><div id=\"dump-list-container\"><div id=\"dump-list\"></div><a id=\"add-post\" href=\"javascript:;\" title=\"Add a post\">+</a></div><div class=\"oekaki\"><input type=\"button\" id=\"qr-draw-button\" value=\"Draw\"><label><span>Width:</span><input name=\"oekaki-width\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label><label><span>Height:</span><input name=\"oekaki-height\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label></div><div id=\"file-n-submit\"><input type=\"button\" id=\"qr-file-button\" value=\"Files\"><span id=\"qr-filename-container\" class=\"field\"><span id=\"qr-no-file\">No selected file</span><input id=\"qr-filename\" data-name=\"filename\" spellcheck=\"false\"><label id=\"qr-spoiler-label\"><input type=\"checkbox\" id=\"qr-file-spoiler\" title=\"Spoiler image\"><span class=\"checkbox-letter\">S</span></label><a href=\"javascript:;\" id=\"qr-filerm\" title=\"Remove file\"><i class=\"fa fa-times-circle\"></i></a><a id=\"url-button\" title=\"Post from url\"><i class=\"fa fa-link\"></i></a><a hidden id=\"paste-area\" title=\"Select to paste images\" class=\"fa fa-clipboard\" tabindex=\"-1\" contentEditable=\"true\"></a><a id=\"custom-cooldown-button\" title=\"Toggle custom cooldown\" class=\"disabled\"><i class=\"fa fa-clock-o\"></i></a><a id=\"dump-button\" title=\"Dump list\"><i class=\"fa fa-plus-square\"></i></a></span><input type=\"submit\"></div><select data-default=\"4\" name=\"filetag\"><option value=\"0\">Hentai</option><option value=\"6\">Porn</option><option value=\"1\">Japanese</option><option value=\"2\">Anime</option><option value=\"3\">Game</option><option value=\"5\">Loop</option><option value=\"4\" selected>Other</option></select><input type=\"file\" multiple></form><datalist id=\"list-name\"></datalist><datalist id=\"list-email\"></datalist><datalist id=\"list-sub\"></datalist> "
innerHTML: "<div class=\"move\"><label><input type=\"checkbox\" id=\"autohide\" title=\"Auto-hide\">Quick Reply</label><a href=\"javascript:;\" class=\"close\" title=\"Close\">×</a><select data-name=\"thread\" title=\"Create a new thread / Reply\"><option value=\"new\">New thread</option></select></div><form><div class=\"persona\"><button type=\"button\" id=\"sjis-toggle\" title=\"Toggle Mona font\">∀</button><button type=\"button\" id=\"tex-preview-button\" title=\"Preview TeX\">T<sub>E</sub>X</button><input name=\"name\" data-name=\"name\" list=\"list-name\" placeholder=\"Name\" class=\"field\" size=\"1\"><input name=\"email\" data-name=\"email\" list=\"list-email\" placeholder=\"Options\" class=\"field\" size=\"1\"><input name=\"sub\" data-name=\"sub\" list=\"list-sub\" placeholder=\"Subject\" class=\"field\" size=\"1\"></div><div class=\"textarea\"><textarea data-name=\"com\" placeholder=\"Comment\" class=\"field\"></textarea><span id=\"char-count\"></span><div id=\"tex-preview\"></div></div><div id=\"dump-list-container\"><div id=\"dump-list\"></div><a id=\"add-post\" href=\"javascript:;\" title=\"Add a post\">+</a></div><div class=\"oekaki\"><input type=\"button\" id=\"qr-draw-button\" value=\"Draw\"><label><span>Width:</span><input name=\"oekaki-width\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label><label><span>Height:</span><input name=\"oekaki-height\" value=\"400\" type=\"number\" class=\"field\" size=\"1\"></label></div><div id=\"file-n-submit\"><input type=\"button\" id=\"qr-file-button\" value=\"Files\"><span id=\"qr-filename-container\" class=\"field\"><span id=\"qr-no-file\">No selected file</span><input id=\"qr-filename\" data-name=\"filename\" spellcheck=\"false\"><label id=\"qr-spoiler-label\"><input type=\"checkbox\" id=\"qr-file-spoiler\" title=\"Spoiler image\"><a class=\"checkbox-letter\">S</a></label><a href=\"javascript:;\" id=\"qr-filerm\" title=\"Remove file\"><i class=\"fa fa-times-circle\"></i></a><a id=\"url-button\" title=\"Post from url\"><i class=\"fa fa-link\"></i></a><a hidden id=\"paste-area\" title=\"Select to paste images\" class=\"fa fa-clipboard\" tabindex=\"-1\" contentEditable=\"true\"></a><a id=\"custom-cooldown-button\" title=\"Toggle custom cooldown\" class=\"disabled\"><i class=\"fa fa-clock-o\"></i></a><a id=\"dump-button\" title=\"Dump list\"><i class=\"fa fa-plus-square\"></i></a></span><input type=\"submit\"></div><select data-default=\"4\" name=\"filetag\"><option value=\"0\">Hentai</option><option value=\"6\">Porn</option><option value=\"1\">Japanese</option><option value=\"2\">Anime</option><option value=\"3\">Game</option><option value=\"5\">Loop</option><option value=\"4\" selected>Other</option></select><input type=\"file\" multiple></form><datalist id=\"list-name\"></datalist><datalist id=\"list-email\"></datalist><datalist id=\"list-sub\"></datalist> "
})
};
setNode = function(name, query) {
@ -7489,8 +7487,6 @@
QR.spoiler = !!$('.postForm input[name=spoiler]');
if (QR.spoiler) {
$.addClass(QR.nodes.el, 'has-spoiler');
} else {
nodes.spoiler.parentElement.hidden = true;
}
if (g.BOARD.ID === 'jp' && Conf['sjisPreview']) {
$.addClass(QR.nodes.el, 'sjis-preview');
@ -7884,7 +7880,8 @@
childList: true,
subtree: true
});
return $.on(d, 'keydown', this.keybinds.bind(this));
$.on(d, 'keydown', this.keybinds.bind(this));
return window.focus();
},
initNoscript: function() {
this.noscript = true;
@ -8007,334 +8004,6 @@
}
};
Captcha.noscript = {
lifetime: 30 * $.MINUTE,
init: function() {
var container, input;
if (d.cookie.indexOf('pass_enabled=1') >= 0) {
return;
}
if (!(this.isEnabled = !!$('#g-recaptcha, #captchaContainerAlt'))) {
return;
}
container = $.el('div', {
className: 'captcha-img',
title: 'Reload reCAPTCHA'
});
input = $.el('input', {
className: 'captcha-input field',
title: 'Verification',
autocomplete: 'off',
spellcheck: false
});
this.nodes = {
container: container,
input: input
};
$.on(input, 'keydown', this.keydown.bind(this));
$.on(this.nodes.container, 'click', (function(_this) {
return function() {
_this.reload();
return _this.nodes.input.focus();
};
})(this));
this.conn = new Connection(null, location.protocol + "//www.google.com", {
challenge: this.load.bind(this),
token: this.save.bind(this),
error: this.error.bind(this)
});
$.addClass(QR.nodes.el, 'has-captcha', 'captcha-v1', 'noscript-captcha');
$.after(QR.nodes.com.parentNode, [container, input]);
this.captchas = [];
$.get('captchas', [], function(arg) {
var captchas;
captchas = arg.captchas;
QR.captcha.sync(captchas);
return QR.captcha.clear();
});
$.sync('captchas', this.sync);
this.beforeSetup();
return this.setup();
},
initFrame: function() {
var cb, conn, img, ref, ref1;
conn = new Connection(window.parent, location.protocol + "//boards.4chan.org", {
response: function(response) {
$.id('recaptcha_response_field').value = response;
return HTMLFormElement.prototype.submit.call($('form'));
}
});
if (location.hash === '#response') {
conn.send({
token: (ref = $('textarea')) != null ? ref.value : void 0,
error: (ref1 = $('.recaptcha_input_area')) != null ? ref1.textContent.replace(/:$/, '') : void 0
});
}
if (!(img = $('img'))) {
return;
}
$('form').action = '#response';
cb = function() {
var canvas;
canvas = $.el('canvas');
canvas.width = img.width;
canvas.height = img.height;
canvas.getContext('2d').drawImage(img, 0, 0);
return conn.send({
challenge: canvas.toDataURL()
});
};
if (img.complete) {
return cb();
} else {
return $.on(img, 'load', cb);
}
},
timers: {},
iframeURL: function() {
var lang, url;
url = '//www.google.com/recaptcha/api/noscript?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc';
if (lang = Conf['captchaLanguage'].trim()) {
url += "&hl=" + (encodeURIComponent(lang));
}
return url;
},
cb: {
focus: function() {
return QR.captcha.setup(false, true);
}
},
beforeSetup: function() {
var container, input, ref;
ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = true;
input.value = '';
input.placeholder = 'Focus to load reCAPTCHA';
this.count();
return $.on(input, 'focus click', this.cb.focus);
},
needed: function() {
var captchaCount, postsCount;
captchaCount = this.captchas.length;
if (QR.req) {
captchaCount++;
}
postsCount = QR.posts.length;
if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) {
postsCount = 0;
}
return captchaCount < postsCount;
},
onNewPost: function() {},
onPostChange: function() {},
setup: function(focus, force) {
if (!(this.isEnabled && (this.needed() || force))) {
return;
}
if (!this.nodes.iframe) {
this.nodes.iframe = $.el('iframe', {
id: 'qr-captcha-iframe',
src: this.iframeURL()
});
$.add(QR.nodes.el, this.nodes.iframe);
this.conn.target = this.nodes.iframe;
} else if (!this.occupied || force) {
this.nodes.iframe.src = this.iframeURL();
}
this.occupied = true;
if (focus) {
return this.nodes.input.focus();
}
},
afterSetup: function() {
var container, input, ref;
ref = this.nodes, container = ref.container, input = ref.input;
container.hidden = false;
input.placeholder = 'Verification';
this.count();
$.off(input, 'focus click', this.cb.focus);
if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
QR.nodes.el.style.top = '';
return QR.nodes.el.style.bottom = '0px';
}
},
destroy: function() {
if (!this.isEnabled) {
return;
}
$.rm(this.nodes.img);
delete this.nodes.img;
$.rm(this.nodes.iframe);
delete this.nodes.iframe;
delete this.occupied;
return this.beforeSetup();
},
sync: function(captchas) {
if (captchas == null) {
captchas = [];
}
QR.captcha.captchas = captchas;
return QR.captcha.count();
},
getOne: function() {
var captcha;
this.clear();
if (captcha = this.captchas.shift()) {
this.count();
$.set('captchas', this.captchas);
return captcha;
} else if (/\S/.test(this.nodes.input.value)) {
return (function(_this) {
return function(cb) {
_this.submitCB = cb;
return _this.sendResponse();
};
})(this);
} else {
return null;
}
},
sendResponse: function() {
var response;
response = this.nodes.input.value;
if (/\S/.test(response)) {
return this.conn.send({
response: response
});
}
},
save: function(token) {
var captcha;
delete this.occupied;
this.nodes.input.value = '';
captcha = {
challenge: token,
response: 'manual_challenge',
timeout: this.timeout
};
if (this.submitCB) {
this.submitCB(captcha);
delete this.submitCB;
if (this.needed()) {
return this.reload();
} else {
return this.destroy();
}
} else {
$.forceSync('captchas');
this.captchas.push(captcha);
this.count();
$.set('captchas', this.captchas);
return this.reload();
}
},
error: function(message) {
this.occupied = true;
this.nodes.input.value = '';
if (this.submitCB) {
this.submitCB();
delete this.submitCB;
}
return QR.error("Captcha Error: " + message);
},
clear: function() {
var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
return;
}
$.forceSync('captchas');
now = Date.now();
ref = this.captchas;
for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
captcha = ref[i];
if (captcha.timeout > now) {
break;
}
}
if (!i) {
return;
}
this.captchas = this.captchas.slice(i);
this.count();
return $.set('captchas', this.captchas);
},
load: function(src) {
var container, img, input, ref;
ref = this.nodes, container = ref.container, input = ref.input, img = ref.img;
this.occupied = true;
this.timeout = Date.now() + this.lifetime;
if (!img) {
img = this.nodes.img = new Image();
$.one(img, 'load', this.afterSetup.bind(this));
$.on(img, 'load', function() {
return this.hidden = false;
});
$.add(container, img);
}
img.src = src;
input.value = '';
this.clear();
clearTimeout(this.timers.expire);
return this.timers.expire = setTimeout(this.expire.bind(this), this.lifetime);
},
count: function() {
var count, placeholder;
count = this.captchas ? this.captchas.length : 0;
placeholder = this.nodes.input.placeholder.replace(/\ \(.*\)$/, '');
placeholder += (function() {
switch (count) {
case 0:
if (placeholder === 'Verification') {
return ' (Shift + Enter to cache)';
} else {
return '';
}
break;
case 1:
return ' (1 cached captcha)';
default:
return " (" + count + " cached captchas)";
}
})();
this.nodes.input.placeholder = placeholder;
this.nodes.input.alt = count;
clearTimeout(this.timers.clear);
if (this.captchas.length) {
return this.timers.clear = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());
}
},
expire: function() {
if (!this.nodes.iframe) {
return;
}
if (!d.hidden && (this.needed() || d.activeElement === this.nodes.input)) {
return this.reload();
} else {
return this.destroy();
}
},
reload: function() {
var ref;
this.nodes.iframe.src = this.iframeURL();
this.occupied = true;
return (ref = this.nodes.img) != null ? ref.hidden = true : void 0;
},
keydown: function(e) {
if (e.keyCode === 8 && !this.nodes.input.value) {
if (this.nodes.iframe) {
this.reload();
} else {
this.setup();
}
} else if (e.keyCode === 13 && e.shiftKey) {
this.sendResponse();
} else {
return;
}
return e.preventDefault();
}
};
Captcha.replace = {
init: function() {
var jsEnabled;
@ -9322,20 +8991,19 @@
QR.post = (function() {
function _Class(select) {
this.select = bind(this.select, this);
var el, event, k, len1, prev, ref;
var el, event, k, label, len1, len2, prev, q, ref, ref1;
el = $.el('a', {
className: 'qr-preview',
draggable: true,
href: 'javascript:;'
});
$.extend(el, {
innerHTML: "<a class=\"remove fa fa-times-circle\" title=\"Remove\"></a><label hidden><input type=\"checkbox\"> Spoiler</label><span></span>"
innerHTML: "<a class=\"remove fa fa-times-circle\" title=\"Remove\"></a><label class=\"qr-preview-spoiler\"><input type=\"checkbox\"> Spoiler</label><span></span>"
});
this.nodes = {
el: el,
rm: el.firstChild,
label: $('label', el),
spoiler: $('input', el),
spoiler: $('.qr-preview-spoiler input', el),
span: el.lastChild
};
$.on(el, 'click', this.select);
@ -9345,9 +9013,6 @@
return _this.rm();
};
})(this));
$.on(this.nodes.label, 'click', function(e) {
return e.stopPropagation();
});
$.on(this.nodes.spoiler, 'change', (function(_this) {
return function(e) {
_this.spoiler = e.target.checked;
@ -9356,10 +9021,17 @@
}
};
})(this));
$.add(QR.nodes.dumpList, el);
ref = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
ref = $$('label', el);
for (k = 0, len1 = ref.length; k < len1; k++) {
event = ref[k];
label = ref[k];
$.on(label, 'click', function(e) {
return e.stopPropagation();
});
}
$.add(QR.nodes.dumpList, el);
ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop'];
for (q = 0, len2 = ref1.length; q < len2; q++) {
event = ref1[q];
$.on(el, event.toLowerCase(), this[event]);
}
this.thread = g.VIEW === 'thread' ? g.THREADID : 'new';
@ -9433,7 +9105,7 @@
_Class.prototype.select = function() {
var rectEl, rectList;
if (QR.selected) {
QR.selected.nodes.el.id = null;
QR.selected.nodes.el.removeAttribute('id');
QR.selected.forceSave();
}
QR.selected = this;
@ -9591,9 +9263,7 @@
}
this.filesize = $.bytesToString(this.file.size);
this.checkSize();
if (QR.spoiler) {
this.nodes.label.hidden = false;
}
$.addClass(this.nodes.el, 'has-file');
QR.captcha.onPostChange();
URL.revokeObjectURL(this.URL);
this.saveFilename();
@ -9727,12 +9397,10 @@
delete this.file;
delete this.filename;
delete this.filesize;
this.nodes.el.title = null;
QR.nodes.filename.title = '';
this.nodes.el.removeAttribute('title');
QR.nodes.filename.removeAttribute('title');
this.nodes.el.style.backgroundImage = null;
if (QR.spoiler) {
this.nodes.label.hidden = true;
}
$.rmClass(this.nodes.el, 'has-file');
this.showFileData();
this.updateFlashURL();
URL.revokeObjectURL(this.URL);
@ -9762,11 +9430,11 @@
if (this.file) {
this.updateFilename();
QR.nodes.filename.value = this.filename;
QR.nodes.spoiler.checked = this.spoiler;
return $.addClass(QR.nodes.fileSubmit, 'has-file');
$.addClass(QR.nodes.fileSubmit, 'has-file');
} else {
return $.rmClass(QR.nodes.fileSubmit, 'has-file');
$.rmClass(QR.nodes.fileSubmit, 'has-file');
}
return QR.nodes.spoiler.checked = this.spoiler;
};
_Class.prototype.updateFlashURL = function() {
@ -16311,9 +15979,6 @@
Report = {
css: ":root:not(.js-enabled) #captchaContainerAlt {\n" +
" height: auto;\n" +
"}\n" +
"noscript > iframe, #recaptcha_challenge_field {\n" +
" width: 500px;\n" +
"}",
init: function() {
var match;
@ -17256,12 +16921,6 @@
}
window['4chan X antidup'] = true;
if (location.hostname === 'www.google.com') {
if (location.pathname === '/recaptcha/api/noscript') {
$.ready(function() {
return Captcha.noscript.initFrame();
});
return;
}
if (location.pathname === '/recaptcha/api/fallback') {
$.ready(function() {
return Captcha.v2.initFrame();
@ -18477,6 +18136,10 @@
"#captchaContainerAlt td:nth-child(2) {\n" +
" display: table-cell !important;\n" +
"}\n" +
"/* Disable obnoxious captcha fade-in. */\n" +
"body > div:last-of-type {\n" +
" transition: none !important;\n" +
"}\n" +
"/* Anti-autoplay */\n" +
"audio.controls-added {\n" +
" display: block;\n" +
@ -19785,7 +19448,8 @@
" margin: 0;\n" +
" margin-right: 3px;\n" +
"}\n" +
"#qr.has-spoiler #file-n-submit:not(.has-file) #qr-spoiler-label,\n" +
"#qr:not(.has-spoiler) #qr-spoiler-label,\n" +
"#file-n-submit:not(.has-file) #qr-spoiler-label,\n" +
".has-file #paste-area,\n" +
".has-file #url-button,\n" +
"#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {\n" +
@ -19798,20 +19462,18 @@
" margin: 0;\n" +
"}\n" +
".checkbox-letter {\n" +
" pointer-events: none;\n" +
" position: absolute;\n" +
" top: 2px;\n" +
" left: 0;\n" +
" right: 0;\n" +
" text-align: center;\n" +
" font-size: 11px;\n" +
" font-weight: bold;\n" +
" color: rgba(0,0,0,.6);\n" +
"}\n" +
"#qr-filename-container label:not(:hover) > input[type=\"checkbox\"]:not(:focus):not(:checked),\n" +
"#qr-filename-container label:hover > .checkbox-letter,\n" +
"input[type=\"checkbox\"]:focus ~ .checkbox-letter,\n" +
"input[type=\"checkbox\"]:checked ~ .checkbox-letter {\n" +
" display: none;\n" +
" /* not displayed but still focusable */\n" +
" position: absolute;\n" +
" opacity: 0;\n" +
" pointer-events: none;\n" +
"}\n" +
"#paste-area, #url-button, #custom-cooldown-button, #dump-button {\n" +
".checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button {\n" +
" opacity: 0.6;\n" +
"}\n" +
"#paste-area {\n" +
@ -19906,6 +19568,10 @@
".remove:hover::after {\n" +
" content: \" Remove\";\n" +
"}\n" +
".qr-preview:not(.has-file) label,\n" +
"#qr:not(.has-spoiler) .qr-preview-spoiler {\n" +
" display: none;\n" +
"}\n" +
".qr-preview > label {\n" +
" background: rgba(0,0,0,.5);\n" +
" color: #fff;\n" +

Binary file not shown.

View File

@ -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.11.13.4' />
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.11.13.5' />
</app>
</gupdate>

View File

@ -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.11.13.4' />
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.11.13.5' />
</app>
</gupdate>

View File

@ -4,8 +4,8 @@
"meta": {
"name": "4chan X",
"fork": "ccd0",
"version": "1.11.13.4",
"date": "2015-10-20T21:20:57.322Z",
"version": "1.11.13.5",
"date": "2015-10-21T17:57:30.119Z",
"page": "https://www.4chan-x.net/",
"downloads": "https://www.4chan-x.net/builds/",
"oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/",