finally new features! reload captcha on backspace
needs documentation
This commit is contained in:
parent
777fb09f39
commit
ebbc5458c1
@ -458,7 +458,7 @@ iframeLoad = ->
|
|||||||
else
|
else
|
||||||
remove qr
|
remove qr
|
||||||
|
|
||||||
window.location = 'javascript:Recaptcha.reload()'
|
recaptchaReload()
|
||||||
|
|
||||||
|
|
||||||
submit = (e) ->
|
submit = (e) ->
|
||||||
@ -519,6 +519,8 @@ quickReply = (e) ->
|
|||||||
#remove recaptcha scripts
|
#remove recaptcha scripts
|
||||||
for script in $$ 'script', clone
|
for script in $$ 'script', clone
|
||||||
remove script
|
remove script
|
||||||
|
$('input[name=recaptcha_response_field]', clone).
|
||||||
|
addEventListener('keydown', recaptchaListener, true)
|
||||||
clone.addEventListener('submit', submit, true)
|
clone.addEventListener('submit', submit, true)
|
||||||
clone.target = 'iframe'
|
clone.target = 'iframe'
|
||||||
if not REPLY
|
if not REPLY
|
||||||
@ -721,6 +723,12 @@ replyNav = ->
|
|||||||
op = x("#{direction}::span[starts-with(@id, 'nothread')][1]", this).id
|
op = x("#{direction}::span[starts-with(@id, 'nothread')][1]", this).id
|
||||||
window.location = "##{op}"
|
window.location = "##{op}"
|
||||||
|
|
||||||
|
recaptchaReload = ->
|
||||||
|
window.location = 'javascript:Recaptcha.reload()'
|
||||||
|
|
||||||
|
recaptchaListener = (e) ->
|
||||||
|
if e.keyCode is 8 and this.value is ''
|
||||||
|
recaptchaReload()
|
||||||
|
|
||||||
#graceful exit
|
#graceful exit
|
||||||
unless navtopr = $ '#navtopr a'
|
unless navtopr = $ '#navtopr a'
|
||||||
@ -734,9 +742,15 @@ a = n 'a', {
|
|||||||
inBefore text, tn(' / ')
|
inBefore text, tn(' / ')
|
||||||
inBefore text, a
|
inBefore text, a
|
||||||
|
|
||||||
|
#various minor tweaks. TODO - `Minor Tweaks` option
|
||||||
|
|
||||||
#hack to tab from comment straight to recaptcha
|
#hack to tab from comment straight to recaptcha
|
||||||
for el in $$ '#recaptcha_table a'
|
for el in $$ '#recaptcha_table a'
|
||||||
el.tabIndex = 1
|
el.tabIndex = 1
|
||||||
|
recaptcha = $ '#recaptcha_response_field'
|
||||||
|
recaptcha.addEventListener('keydown', recaptchaListener, true)
|
||||||
|
|
||||||
|
#major features
|
||||||
|
|
||||||
if getConfig('Reply Hiding')
|
if getConfig('Reply Hiding')
|
||||||
callbacks.push((root) ->
|
callbacks.push((root) ->
|
||||||
@ -771,7 +785,7 @@ if getConfig('Quick Reply')
|
|||||||
)
|
)
|
||||||
|
|
||||||
#hack - nuke id so it doesn't grab focus when reloading
|
#hack - nuke id so it doesn't grab focus when reloading
|
||||||
$('#recaptcha_response_field').id = ''
|
recaptcha.id = ''
|
||||||
|
|
||||||
|
|
||||||
if getConfig('Quick Report')
|
if getConfig('Quick Report')
|
||||||
|
|||||||
15
4chan_x.js
15
4chan_x.js
@ -1,5 +1,5 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var $, $$, AEOS, BOARD, DAY, PAGENUM, REPLY, _i, _j, _len, _len2, _ref, _ref2, a, addTo, arr, as, autoWatch, autohide, b, board, callback, callbacks, clearHidden, close, config, cutoff, d, delform, down, el, expandComment, expandThread, favEmpty, favNormal, favicon, getConfig, getTime, head, hiddenReplies, hiddenThreads, hide, hideReply, hideThread, href, html, i, i1, id, iframe, iframeLoad, iframeLoop, img, inAfter, inBefore, input, inputs, l, l1, lastChecked, magic, n, navtopr, nodeInserted, nop, now, omitted, onloadComment, onloadThread, options, optionsSave, parseResponse, quickReply, r, remove, replace, replyNav, report, show, showReply, showThread, slice, span, src, stopPropagation, submit, text, textContent, thread, threadF, threads, tn, up, watch, watchX, watched, watcher, watcherUpdate, x, xhrs;
|
var $, $$, AEOS, BOARD, DAY, PAGENUM, REPLY, _i, _j, _len, _len2, _ref, _ref2, a, addTo, arr, as, autoWatch, autohide, b, board, callback, callbacks, clearHidden, close, config, cutoff, d, delform, down, el, expandComment, expandThread, favEmpty, favNormal, favicon, getConfig, getTime, head, hiddenReplies, hiddenThreads, hide, hideReply, hideThread, href, html, i, i1, id, iframe, iframeLoad, iframeLoop, img, inAfter, inBefore, input, inputs, l, l1, lastChecked, magic, n, navtopr, nodeInserted, nop, now, omitted, onloadComment, onloadThread, options, optionsSave, parseResponse, quickReply, r, recaptcha, recaptchaListener, recaptchaReload, remove, replace, replyNav, report, show, showReply, showThread, slice, span, src, stopPropagation, submit, text, textContent, thread, threadF, threads, tn, up, watch, watchX, watched, watcher, watcherUpdate, x, xhrs;
|
||||||
var __slice = Array.prototype.slice, __hasProp = Object.prototype.hasOwnProperty;
|
var __slice = Array.prototype.slice, __hasProp = Object.prototype.hasOwnProperty;
|
||||||
config = {
|
config = {
|
||||||
'Thread Hiding': true,
|
'Thread Hiding': true,
|
||||||
@ -523,7 +523,7 @@
|
|||||||
} else {
|
} else {
|
||||||
remove(qr);
|
remove(qr);
|
||||||
}
|
}
|
||||||
return (window.location = 'javascript:Recaptcha.reload()');
|
return recaptchaReload();
|
||||||
};
|
};
|
||||||
submit = function(e) {
|
submit = function(e) {
|
||||||
var _ref2, _ref3, recaptcha, span;
|
var _ref2, _ref3, recaptcha, span;
|
||||||
@ -585,6 +585,7 @@
|
|||||||
script = _ref2[_i];
|
script = _ref2[_i];
|
||||||
remove(script);
|
remove(script);
|
||||||
}
|
}
|
||||||
|
$('input[name=recaptcha_response_field]', clone).addEventListener('keydown', recaptchaListener, true);
|
||||||
clone.addEventListener('submit', submit, true);
|
clone.addEventListener('submit', submit, true);
|
||||||
clone.target = 'iframe';
|
clone.target = 'iframe';
|
||||||
if (!REPLY) {
|
if (!REPLY) {
|
||||||
@ -816,6 +817,12 @@
|
|||||||
return (window.location = ("#" + (op)));
|
return (window.location = ("#" + (op)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
recaptchaReload = function() {
|
||||||
|
return (window.location = 'javascript:Recaptcha.reload()');
|
||||||
|
};
|
||||||
|
recaptchaListener = function(e) {
|
||||||
|
return e.keyCode === 8 && this.value === '' ? recaptchaReload() : null;
|
||||||
|
};
|
||||||
if (!(navtopr = $('#navtopr a'))) {
|
if (!(navtopr = $('#navtopr a'))) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -832,6 +839,8 @@
|
|||||||
el = _ref[_i];
|
el = _ref[_i];
|
||||||
el.tabIndex = 1;
|
el.tabIndex = 1;
|
||||||
}
|
}
|
||||||
|
recaptcha = $('#recaptcha_response_field');
|
||||||
|
recaptcha.addEventListener('keydown', recaptchaListener, true);
|
||||||
if (getConfig('Reply Hiding')) {
|
if (getConfig('Reply Hiding')) {
|
||||||
callbacks.push(function(root) {
|
callbacks.push(function(root) {
|
||||||
var _j, _k, _len2, _len3, _ref2, _ref3, _result, _result2, next, obj, td, tds;
|
var _j, _k, _len2, _len3, _ref2, _ref3, _result, _result2, next, obj, td, tds;
|
||||||
@ -876,7 +885,7 @@
|
|||||||
}
|
}
|
||||||
return _result;
|
return _result;
|
||||||
});
|
});
|
||||||
$('#recaptcha_response_field').id = '';
|
recaptcha.id = '';
|
||||||
}
|
}
|
||||||
if (getConfig('Quick Report')) {
|
if (getConfig('Quick Report')) {
|
||||||
callbacks.push(function(root) {
|
callbacks.push(function(root) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user