WTF? Fix normal captcha automatic focus prevention.
Chrome only issue? This happened since I injected the messaging code using the window.location too.
This commit is contained in:
parent
b854eb4d00
commit
9b482ddc96
@ -1205,7 +1205,6 @@
|
|||||||
qr = {
|
qr = {
|
||||||
init: function() {
|
init: function() {
|
||||||
if (!$('form[name=post]')) return;
|
if (!$('form[name=post]')) return;
|
||||||
qr.spoiler = !!$('#com_submit + label');
|
|
||||||
g.callbacks.push(function(root) {
|
g.callbacks.push(function(root) {
|
||||||
return $.on($('.quotejs + .quotejs', root), 'click', qr.quote);
|
return $.on($('.quotejs + .quotejs', root), 'click', qr.quote);
|
||||||
});
|
});
|
||||||
@ -1219,7 +1218,8 @@
|
|||||||
if (conf['Auto Hide QR']) $.id('autohide').click();
|
if (conf['Auto Hide QR']) $.id('autohide').click();
|
||||||
}
|
}
|
||||||
$.on(d, 'dragover', qr.fileDrop);
|
$.on(d, 'dragover', qr.fileDrop);
|
||||||
return $.on(d, 'drop', qr.fileDrop);
|
$.on(d, 'drop', qr.fileDrop);
|
||||||
|
return window.location = 'javascript:void(Recaptcha.focus_response_field=function(){})';
|
||||||
},
|
},
|
||||||
open: function() {
|
open: function() {
|
||||||
if (qr.el) {
|
if (qr.el) {
|
||||||
@ -1438,8 +1438,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.count($.get('captchas', []).length);
|
this.count($.get('captchas', []).length);
|
||||||
this.load();
|
return this.load();
|
||||||
return window.location = 'javascript:(function(){Recaptcha.focus_response_field=function(){}})()';
|
|
||||||
},
|
},
|
||||||
save: function() {
|
save: function() {
|
||||||
var captcha, captchas, response;
|
var captcha, captchas, response;
|
||||||
@ -1507,6 +1506,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
qr.mimeTypes = mimeTypes.split(', ');
|
qr.mimeTypes = mimeTypes.split(', ');
|
||||||
|
qr.spoiler = !!$('#com_submit + label');
|
||||||
qr.el = ui.dialog('qr', 'top:0;right:0;', "<div class=move> Quick Reply <input type=checkbox name=autohide id=autohide title=Auto-hide> <span>" + (g.REPLY ? '' : threads) + " <a class=close>x</a></span></div><form> <div><input id=dump class=field type=button title='Dump mode' value=+><input name=name title=Name placeholder=Name class=field size=1><input name=email title=E-mail placeholder=E-mail class=field size=1><input name=sub title=Subject placeholder=Subject class=field size=1></div> <output id=replies><div><a id=addReply href=javascript:;>+</a></div></output> <div><textarea name=com title=Comment placeholder=Comment class=field></textarea></div> <div class=captcha title=Reload><img></div> <div><input name=captcha title=Verification class=field autocomplete=off size=1></div> <div><input type=file name=upfile max=" + ($('[name=MAX_FILE_SIZE]').value) + " accept='" + mimeTypes + "' multiple><input type=submit value=" + (g.dead ? '404 disabled' : 'Submit') + "></div> <label" + (qr.spoiler ? '' : ' hidden') + "><input type=checkbox id=spoiler> Spoiler Image?</label> <div class=error></div></form>");
|
qr.el = ui.dialog('qr', 'top:0;right:0;', "<div class=move> Quick Reply <input type=checkbox name=autohide id=autohide title=Auto-hide> <span>" + (g.REPLY ? '' : threads) + " <a class=close>x</a></span></div><form> <div><input id=dump class=field type=button title='Dump mode' value=+><input name=name title=Name placeholder=Name class=field size=1><input name=email title=E-mail placeholder=E-mail class=field size=1><input name=sub title=Subject placeholder=Subject class=field size=1></div> <output id=replies><div><a id=addReply href=javascript:;>+</a></div></output> <div><textarea name=com title=Comment placeholder=Comment class=field></textarea></div> <div class=captcha title=Reload><img></div> <div><input name=captcha title=Verification class=field autocomplete=off size=1></div> <div><input type=file name=upfile max=" + ($('[name=MAX_FILE_SIZE]').value) + " accept='" + mimeTypes + "' multiple><input type=submit value=" + (g.dead ? '404 disabled' : 'Submit') + "></div> <label" + (qr.spoiler ? '' : ' hidden') + "><input type=checkbox id=spoiler> Spoiler Image?</label> <div class=error></div></form>");
|
||||||
if (!g.REPLY) {
|
if (!g.REPLY) {
|
||||||
$.on($('select', qr.el), 'mousedown', function(e) {
|
$.on($('select', qr.el), 'mousedown', function(e) {
|
||||||
|
|||||||
@ -875,7 +875,6 @@ nav =
|
|||||||
qr =
|
qr =
|
||||||
init: ->
|
init: ->
|
||||||
return unless $ 'form[name=post]'
|
return unless $ 'form[name=post]'
|
||||||
qr.spoiler = !!$ '#com_submit + label'
|
|
||||||
g.callbacks.push (root) ->
|
g.callbacks.push (root) ->
|
||||||
$.on $('.quotejs + .quotejs', root), 'click', qr.quote
|
$.on $('.quotejs + .quotejs', root), 'click', qr.quote
|
||||||
$.add d.body, $.el 'iframe',
|
$.add d.body, $.el 'iframe',
|
||||||
@ -887,6 +886,8 @@ qr =
|
|||||||
$.id('autohide').click() if conf['Auto Hide QR']
|
$.id('autohide').click() if conf['Auto Hide QR']
|
||||||
$.on d, 'dragover', qr.fileDrop
|
$.on d, 'dragover', qr.fileDrop
|
||||||
$.on d, 'drop', qr.fileDrop
|
$.on d, 'drop', qr.fileDrop
|
||||||
|
# prevent original captcha input from being focused on reload
|
||||||
|
window.location = 'javascript:void(Recaptcha.focus_response_field=function(){})'
|
||||||
|
|
||||||
open: ->
|
open: ->
|
||||||
if qr.el
|
if qr.el
|
||||||
@ -1065,8 +1066,6 @@ qr =
|
|||||||
$.on window, 'storage', (e) => @count JSON.parse(e.newValue).length if e.key is "#{NAMESPACE}captchas"
|
$.on window, 'storage', (e) => @count JSON.parse(e.newValue).length if e.key is "#{NAMESPACE}captchas"
|
||||||
@count $.get('captchas', []).length
|
@count $.get('captchas', []).length
|
||||||
@load()
|
@load()
|
||||||
# prevent original captcha input from being focused on reload
|
|
||||||
window.location = 'javascript:(function(){Recaptcha.focus_response_field=function(){}})()'
|
|
||||||
save: ->
|
save: ->
|
||||||
return unless response = @input.value
|
return unless response = @input.value
|
||||||
captchas = $.get 'captchas', []
|
captchas = $.get 'captchas', []
|
||||||
@ -1118,6 +1117,7 @@ qr =
|
|||||||
else
|
else
|
||||||
'image/' + type
|
'image/' + type
|
||||||
qr.mimeTypes = mimeTypes.split ', '
|
qr.mimeTypes = mimeTypes.split ', '
|
||||||
|
qr.spoiler = !!$ '#com_submit + label'
|
||||||
qr.el = ui.dialog 'qr', 'top:0;right:0;', "
|
qr.el = ui.dialog 'qr', 'top:0;right:0;', "
|
||||||
<div class=move>
|
<div class=move>
|
||||||
Quick Reply <input type=checkbox name=autohide id=autohide title=Auto-hide>
|
Quick Reply <input type=checkbox name=autohide id=autohide title=Auto-hide>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user