derp, qr -> QR
This commit is contained in:
parent
2058834720
commit
4225a7dfdf
@ -1241,7 +1241,7 @@
|
|||||||
challengeNode: function(e) {
|
challengeNode: function(e) {
|
||||||
var c;
|
var c;
|
||||||
c = e.target.value;
|
c = e.target.value;
|
||||||
$('img', qr.el).src = "http://www.google.com/recaptcha/api/image?c=" + c;
|
$('img', QR.el).src = "http://www.google.com/recaptcha/api/image?c=" + c;
|
||||||
return QR.captcha = {
|
return QR.captcha = {
|
||||||
challenge: c,
|
challenge: c,
|
||||||
time: Date.now()
|
time: Date.now()
|
||||||
@ -1261,14 +1261,14 @@
|
|||||||
if (text == null) {
|
if (text == null) {
|
||||||
text = '';
|
text = '';
|
||||||
}
|
}
|
||||||
qr.el = ui.dialog('qr', {
|
QR.el = ui.dialog('qr', {
|
||||||
top: '0',
|
top: '0',
|
||||||
left: '0'
|
left: '0'
|
||||||
}, " <a class=close title=close>X</a><input type=checkbox id=autohide title=autohide> <div class=move><input placeholder=Name name=name form=qr_form>Quick Reply</div> <form enctype=multipart/form-data method=post action=http://sys.4chan.org/" + g.BOARD + "/post target=iframe id=qr_form> <input type=hidden name=resto value=" + g.THREAD_ID + "> <input type=hidden name=mode value=regist> <input type=hidden name=recaptcha_challenge_field id=challenge> <input type=hidden name=recaptcha_response_field id=response> <div><input placeholder=Email name=email></div> <div><input placeholder=Subject name=sub><button>Submit</button></div> <div><textarea placeholder=Comment name=com>" + text + "</textarea></div> <div><img></div> <div><input placeholder=Verification autocomplete=off id=recaptcha_response_field><span id=cl>" + ($.get('captchas', []).length) + " captchas</span></div> <div><input name=upfile type=file></div> <div><input placeholder=Password name=pwd type=password></div> </form> <a class=error></a> ");
|
}, " <a class=close title=close>X</a><input type=checkbox id=autohide title=autohide> <div class=move><input placeholder=Name name=name form=qr_form>Quick Reply</div> <form enctype=multipart/form-data method=post action=http://sys.4chan.org/" + g.BOARD + "/post target=iframe id=qr_form> <input type=hidden name=resto value=" + g.THREAD_ID + "> <input type=hidden name=mode value=regist> <input type=hidden name=recaptcha_challenge_field id=challenge> <input type=hidden name=recaptcha_response_field id=response> <div><input placeholder=Email name=email></div> <div><input placeholder=Subject name=sub><button>Submit</button></div> <div><textarea placeholder=Comment name=com>" + text + "</textarea></div> <div><img></div> <div><input placeholder=Verification autocomplete=off id=recaptcha_response_field><span id=cl>" + ($.get('captchas', []).length) + " captchas</span></div> <div><input name=upfile type=file></div> <div><input placeholder=Password name=pwd type=password></div> </form> <a class=error></a> ");
|
||||||
$.bind($('form', qr.el), 'submit', QR.submit);
|
$.bind($('form', QR.el), 'submit', QR.submit);
|
||||||
$.bind($('#recaptcha_response_field', qr.el), 'keydown', QR.keydown);
|
$.bind($('#recaptcha_response_field', QR.el), 'keydown', QR.keydown);
|
||||||
$.append(d.body, qr.el);
|
$.append(d.body, QR.el);
|
||||||
ta = $('textarea', qr.el);
|
ta = $('textarea', QR.el);
|
||||||
l = text.length;
|
l = text.length;
|
||||||
ta.setSelectionRange(l, l);
|
ta.setSelectionRange(l, l);
|
||||||
return ta.focus();
|
return ta.focus();
|
||||||
@ -1278,7 +1278,7 @@
|
|||||||
if (!(e.keyCode === 13 && this.value)) {
|
if (!(e.keyCode === 13 && this.value)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($('textarea', qr.el).value || $('[type=file]', qr.el).files.length) {
|
if ($('textarea', QR.el).value || $('[type=file]', QR.el).files.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -1292,8 +1292,8 @@
|
|||||||
return this.nextSibling.textContent = captchas.length + ' captchas';
|
return this.nextSibling.textContent = captchas.length + ' captchas';
|
||||||
},
|
},
|
||||||
submit: function(e) {
|
submit: function(e) {
|
||||||
$('#challenge', qr.el).value = QR.captcha.challenge;
|
$('#challenge', QR.el).value = QR.captcha.challenge;
|
||||||
return $('#response', qr.el).value = $('#recaptcha_response_field', qr.el).value;
|
return $('#response', QR.el).value = $('#recaptcha_response_field', QR.el).value;
|
||||||
},
|
},
|
||||||
sys: function() {
|
sys: function() {
|
||||||
return $.globalEval(function() {
|
return $.globalEval(function() {
|
||||||
@ -1313,10 +1313,10 @@
|
|||||||
var data;
|
var data;
|
||||||
data = e.data;
|
data = e.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
return $.extend($('a.error', qr.el), JSON.parse(data));
|
return $.extend($('a.error', QR.el), JSON.parse(data));
|
||||||
} else {
|
} else {
|
||||||
$.rm(qr.el);
|
$.rm(QR.el);
|
||||||
return qr.el = null;
|
return QR.el = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -975,7 +975,7 @@ QR =
|
|||||||
QR.challengeNode target: holder.firstChild
|
QR.challengeNode target: holder.firstChild
|
||||||
challengeNode: (e) ->
|
challengeNode: (e) ->
|
||||||
c = e.target.value
|
c = e.target.value
|
||||||
$('img', qr.el).src = "http://www.google.com/recaptcha/api/image?c=#{c}"
|
$('img', QR.el).src = "http://www.google.com/recaptcha/api/image?c=#{c}"
|
||||||
QR.captcha =
|
QR.captcha =
|
||||||
challenge: c
|
challenge: c
|
||||||
time: Date.now()
|
time: Date.now()
|
||||||
@ -986,7 +986,7 @@ QR =
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
QR.dialog ">>#{@textContent}\n"
|
QR.dialog ">>#{@textContent}\n"
|
||||||
dialog: (text='') ->
|
dialog: (text='') ->
|
||||||
qr.el = ui.dialog 'qr', top: '0', left: '0', "
|
QR.el = ui.dialog 'qr', top: '0', left: '0', "
|
||||||
<a class=close title=close>X</a><input type=checkbox id=autohide title=autohide>
|
<a class=close title=close>X</a><input type=checkbox id=autohide title=autohide>
|
||||||
<div class=move><input placeholder=Name name=name form=qr_form>Quick Reply</div>
|
<div class=move><input placeholder=Name name=name form=qr_form>Quick Reply</div>
|
||||||
<form enctype=multipart/form-data method=post action=http://sys.4chan.org/#{g.BOARD}/post target=iframe id=qr_form>
|
<form enctype=multipart/form-data method=post action=http://sys.4chan.org/#{g.BOARD}/post target=iframe id=qr_form>
|
||||||
@ -1004,16 +1004,16 @@ QR =
|
|||||||
</form>
|
</form>
|
||||||
<a class=error></a>
|
<a class=error></a>
|
||||||
"
|
"
|
||||||
$.bind $('form', qr.el), 'submit', QR.submit
|
$.bind $('form', QR.el), 'submit', QR.submit
|
||||||
$.bind $('#recaptcha_response_field', qr.el), 'keydown', QR.keydown
|
$.bind $('#recaptcha_response_field', QR.el), 'keydown', QR.keydown
|
||||||
$.append d.body, qr.el
|
$.append d.body, QR.el
|
||||||
ta = $ 'textarea', qr.el
|
ta = $ 'textarea', QR.el
|
||||||
l = text.length
|
l = text.length
|
||||||
ta.setSelectionRange l, l
|
ta.setSelectionRange l, l
|
||||||
ta.focus()
|
ta.focus()
|
||||||
keydown: (e) ->
|
keydown: (e) ->
|
||||||
return unless e.keyCode is 13 and @value #enter, captcha filled
|
return unless e.keyCode is 13 and @value #enter, captcha filled
|
||||||
return if $('textarea', qr.el).value or $('[type=file]', qr.el).files.length #not blank
|
return if $('textarea', QR.el).value or $('[type=file]', QR.el).files.length #not blank
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
{captcha} = QR
|
{captcha} = QR
|
||||||
captcha.response = @value
|
captcha.response = @value
|
||||||
@ -1024,8 +1024,8 @@ QR =
|
|||||||
Recaptcha.reload()
|
Recaptcha.reload()
|
||||||
@nextSibling.textContent = captchas.length + ' captchas'
|
@nextSibling.textContent = captchas.length + ' captchas'
|
||||||
submit: (e) ->
|
submit: (e) ->
|
||||||
$('#challenge', qr.el).value = QR.captcha.challenge
|
$('#challenge', QR.el).value = QR.captcha.challenge
|
||||||
$('#response', qr.el).value = $('#recaptcha_response_field', qr.el).value
|
$('#response', QR.el).value = $('#recaptcha_response_field', QR.el).value
|
||||||
sys: ->
|
sys: ->
|
||||||
$.globalEval ->
|
$.globalEval ->
|
||||||
if node = document.querySelector('table font b')?.firstChild
|
if node = document.querySelector('table font b')?.firstChild
|
||||||
@ -1036,10 +1036,10 @@ QR =
|
|||||||
receive: (e) ->
|
receive: (e) ->
|
||||||
{data} = e
|
{data} = e
|
||||||
if data
|
if data
|
||||||
$.extend $('a.error', qr.el), JSON.parse data
|
$.extend $('a.error', QR.el), JSON.parse data
|
||||||
else
|
else
|
||||||
$.rm qr.el
|
$.rm QR.el
|
||||||
qr.el = null
|
QR.el = null
|
||||||
|
|
||||||
qr =
|
qr =
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user