error notifications
This commit is contained in:
parent
170e1e35fb
commit
a8273b3a9d
@ -1225,6 +1225,7 @@
|
||||
QR = {
|
||||
init: function() {
|
||||
var holder;
|
||||
g.callbacks.push(QR.node);
|
||||
$.append(d.body, $.el('iframe', {
|
||||
name: 'iframe'
|
||||
}));
|
||||
@ -1233,7 +1234,7 @@
|
||||
QR.challengeNode({
|
||||
target: holder.firstChild
|
||||
});
|
||||
return g.callbacks.push(QR.node);
|
||||
return $.bind(window, 'message', QR.receive);
|
||||
},
|
||||
challengeNode: function(e) {
|
||||
return QR.captcha = {
|
||||
@ -1258,7 +1259,7 @@
|
||||
qr.el = ui.dialog('qr', {
|
||||
top: '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 src=http://www.google.com/recaptcha/api/image?c=" + QR.captcha.challenge + "></div> <div><input placeholder=Verification autocomplete=off id=recaptcha_response_field ></div> <div><input name=upfile type=file></div> <div><input placeholder=Password name=pwd type=password></div> </form> ");
|
||||
}, " <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 src=http://www.google.com/recaptcha/api/image?c=" + QR.captcha.challenge + "></div> <div><input placeholder=Verification autocomplete=off id=recaptcha_response_field ></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);
|
||||
$.append(d.body, qr.el);
|
||||
ta = $('textarea', qr.el);
|
||||
@ -1269,6 +1270,30 @@
|
||||
submit: function(e) {
|
||||
$('#challenge', qr.el).value = QR.captcha.challenge;
|
||||
return $('#response', qr.el).value = $('#recaptcha_response_field', qr.el).value;
|
||||
},
|
||||
sys: function() {
|
||||
return $.globalEval(function() {
|
||||
var data, href, location, node, textContent, _ref;
|
||||
if (node = (_ref = document.querySelector('table font b')) != null ? _ref.firstChild : void 0) {
|
||||
textContent = node.textContent, href = node.href;
|
||||
data = JSON.stringify({
|
||||
textContent: textContent,
|
||||
href: href
|
||||
});
|
||||
}
|
||||
parent.postMessage(data, '*');
|
||||
return location = 'about:blank';
|
||||
});
|
||||
},
|
||||
receive: function(e) {
|
||||
var data;
|
||||
data = e.data;
|
||||
if (data) {
|
||||
return $.extend($('a.error', qr.el), JSON.parse(data));
|
||||
} else {
|
||||
$.rm(qr.el);
|
||||
return qr.el = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
qr = {
|
||||
|
||||
@ -963,12 +963,13 @@ cooldown =
|
||||
|
||||
QR =
|
||||
init: ->
|
||||
g.callbacks.push QR.node
|
||||
$.append d.body, $.el 'iframe',
|
||||
name: 'iframe'
|
||||
holder = $ '#recaptcha_challenge_field_holder'
|
||||
$.bind holder, 'DOMNodeInserted', QR.challengeNode
|
||||
QR.challengeNode target: holder.firstChild
|
||||
g.callbacks.push QR.node
|
||||
$.bind window, 'message', QR.receive
|
||||
challengeNode: (e) ->
|
||||
QR.captcha =
|
||||
challenge: e.target.value
|
||||
@ -996,6 +997,7 @@ QR =
|
||||
<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
|
||||
$.append d.body, qr.el
|
||||
@ -1006,6 +1008,21 @@ QR =
|
||||
submit: (e) ->
|
||||
$('#challenge', qr.el).value = QR.captcha.challenge
|
||||
$('#response', qr.el).value = $('#recaptcha_response_field', qr.el).value
|
||||
sys: ->
|
||||
$.globalEval ->
|
||||
if node = document.querySelector('table font b')?.firstChild
|
||||
{textContent, href} = node
|
||||
data = JSON.stringify {textContent, href}
|
||||
parent.postMessage data, '*'
|
||||
location = 'about:blank'
|
||||
|
||||
receive: (e) ->
|
||||
{data} = e
|
||||
if data
|
||||
$.extend $('a.error', qr.el), JSON.parse data
|
||||
else
|
||||
$.rm qr.el
|
||||
qr.el = null
|
||||
|
||||
qr =
|
||||
# TODO
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user