diff --git a/4chan_x.js b/4chan_x.js
index 4f685614a..e28bbf9d0 100644
--- a/4chan_x.js
+++ b/4chan_x.js
@@ -1139,13 +1139,15 @@
}
},
dialog: function(link) {
- var MAX_FILE_SIZE, THREAD_ID, clone, dialog, el, html, mail, name, pass, spoiler;
+ var MAX_FILE_SIZE, THREAD_ID, challenge, dialog, el, html, mail, name, pass, spoiler, src;
MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value;
THREAD_ID = g.THREAD_ID || $.x('preceding::div[@class="op"][1]', link).id;
+ challenge = $('input[name=recaptcha_challenge_field]').value;
+ src = "http://www.google.com/recaptcha/api/image?c=" + challenge;
name = $('input[name=name]').value;
mail = $('input[name=email]').value;
pass = $('input[name=pwd]').value;
- html = "
";
+ html = " ";
dialog = ui.dialog('qr', {
top: '0px',
left: '0px'
@@ -1161,15 +1163,8 @@
});
$.after($('input[name=email]', dialog), spoiler);
}
- clone = $('#recaptcha_widget_div').cloneNode(true);
- $.append($('#qr_captcha', dialog), clone);
- $.extend($('input[name=recaptcha_response_field]', clone), {
- placeholder: 'Verification',
- className: 'inputtext',
- required: true
- });
$.bind($('form', dialog), 'submit', qr.cb.submit);
- $.bind($('input[name=recaptcha_response_field]', clone), 'keydown', Recaptcha.listener);
+ $.bind($('input[name=recaptcha_response_field]', dialog), 'keydown', Recaptcha.listener);
$.append(d.body, dialog);
return dialog;
},
diff --git a/script.coffee b/script.coffee
index 72ece2c43..0f3c3886e 100644
--- a/script.coffee
+++ b/script.coffee
@@ -898,6 +898,8 @@ qr =
#maybe should be global
MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value
THREAD_ID = g.THREAD_ID or $.x('preceding::div[@class="op"][1]', link).id
+ challenge = $('input[name=recaptcha_challenge_field]').value
+ src = "http://www.google.com/recaptcha/api/image?c=#{challenge}"
name = $('input[name=name]').value
mail = $('input[name=email]').value
pass = $('input[name=pwd]').value
@@ -911,10 +913,12 @@ qr =
@@ -931,16 +935,8 @@ qr =
innerHTML: " [Spoiler Image?]"
$.after $('input[name=email]', dialog), spoiler
- # TODO try w/o cloning
- clone = $('#recaptcha_widget_div').cloneNode(true)
- $.append $('#qr_captcha', dialog), clone
- $.extend $('input[name=recaptcha_response_field]', clone),
- placeholder: 'Verification'
- className: 'inputtext'
- required: true
-
$.bind $('form', dialog), 'submit', qr.cb.submit
- $.bind $('input[name=recaptcha_response_field]', clone), 'keydown', Recaptcha.listener
+ $.bind $('input[name=recaptcha_response_field]', dialog), 'keydown', Recaptcha.listener
$.append d.body, dialog