Revert "actually work in chrome"

This reverts commit 9b3a1191585427a002358acf612810c4334ee5a5.
This commit is contained in:
James Campos 2011-08-15 22:13:33 -07:00
parent 9b57b62ed7
commit d6bed73c32
2 changed files with 7 additions and 22 deletions

View File

@ -1218,21 +1218,17 @@
}; };
qr = { qr = {
init: function() { init: function() {
var data, iframe; var iframe;
g.callbacks.push(qr.node); g.callbacks.push(qr.node);
$.bind(window, 'message', qr.message); $.bind(window, 'message', qr.message);
$.bind($('#recaptcha_challenge_field_holder'), 'DOMNodeInserted', qr.captchaNode); $.bind($('#recaptcha_challenge_field_holder'), 'DOMNodeInserted', qr.captchaNode);
qr.captchaTime = Date.now(); qr.captchaTime = Date.now();
iframe = $.el('iframe', { iframe = $.el('iframe', {
name: 'iframe',
hidden: true, hidden: true,
id: 'iframe',
src: 'http://sys.4chan.org/post' src: 'http://sys.4chan.org/post'
}); });
data = $.el('span', { $.append(d.body, iframe);
hidden: true,
id: 'data'
});
$.append(d.body, iframe, data);
return $('#recaptcha_response_field').id = ''; return $('#recaptcha_response_field').id = '';
}, },
attach: function() { attach: function() {
@ -1453,11 +1449,7 @@
data[el.name] = el.value; data[el.name] = el.value;
} }
} }
$('#data').textContent = JSON.stringify(data); return $('iframe').contentWindow.postMessage(JSON.stringify(data), '*');
return $.globalEval(function() {
data = document.getElementById('data').textContent;
return document.getElementById('iframe').contentWindow.postMessage(data, '*');
});
}, },
foo: function() { foo: function() {
var body, data, href, node, textContent, _ref; var body, data, href, node, textContent, _ref;

View File

@ -972,13 +972,10 @@ qr =
qr.captchaTime = Date.now() qr.captchaTime = Date.now()
iframe = $.el 'iframe', iframe = $.el 'iframe',
name: 'iframe'
hidden: true hidden: true
id: 'iframe'
src: 'http://sys.4chan.org/post' src: 'http://sys.4chan.org/post'
data = $.el 'span', $.append d.body, iframe
hidden: true
id: 'data'
$.append d.body, iframe, data
#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_response_field').id = ''
@ -1191,11 +1188,7 @@ qr =
for el in $$ '[name]', qr.el when el.value for el in $$ '[name]', qr.el when el.value
data[el.name] = el.value data[el.name] = el.value
$('#data').textContent = JSON.stringify data $('iframe').contentWindow.postMessage JSON.stringify(data), '*'
$.globalEval ->
data = document.getElementById('data').textContent
document.getElementById('iframe').contentWindow.postMessage data, '*'
foo: -> foo: ->
body = $.el 'body', body = $.el 'body',