diff --git a/4chan_x.js b/4chan_x.js
index 761528791..d0ad53521 100644
--- a/4chan_x.js
+++ b/4chan_x.js
@@ -1141,48 +1141,32 @@
}
},
dialog: function(link) {
- var clone, dialog, el, html, resto, script, spoiler, xpath, _i, _len, _ref;
- html = "
";
+ var MAX_FILE_SIZE, THREAD_ID, clone, dialog, el, form, html, spoiler;
+ MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value;
+ THREAD_ID = g.THREAD_ID || link.pathname.split('/').pop();
+ html = " ";
dialog = ui.dialog('qr', {
top: '0px',
left: '0px'
}, html);
el = $('#autohide', dialog);
$.bind(el, 'click', qr.cb.autohide);
- $('input[name="MAX_FILE_SIZE"]', dialog).value = $('.postarea input[name="MAX_FILE_SIZE"]').value;
if ($('.postarea label')) {
spoiler = $.el('label', {
innerHTML: " [Spoiler Image?]"
});
- $.append($('div:nth-of-type(2)', dialog), spoiler);
+ $.after($('input[name=email]', dialog), spoiler);
}
clone = $('#recaptcha_widget_div').cloneNode(true);
$.append($('#qr_captcha', dialog), clone);
- $('input[name=recaptcha_response_field]', clone).placeholder = 'Verification';
- $('input[name=recaptcha_response_field]', clone).className = 'inputtext';
- $.append(d.body, dialog);
- return;
- clone = $('form[name=post]').cloneNode(true);
- _ref = $$('script', clone);
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- script = _ref[_i];
- $.remove(script);
- }
- clone.target = 'iframe';
- $.bind(clone, 'submit', qr.cb.submit);
+ $.extend($('input[name=recaptcha_response_field]', clone), {
+ placeholder: 'Verification',
+ className: 'inputtext'
+ });
+ form = dialog.lastChild;
+ $.bind(form, 'submit', qr.cb.submit);
$.bind($('input[name=recaptcha_response_field]', clone), 'keydown', Recaptcha.listener);
- if (!g.REPLY) {
- xpath = 'preceding::span[@class="postername"][1]/preceding::input[1]';
- resto = $.el('input', {
- type: 'hidden',
- name: 'resto',
- value: $.x(xpath, link).name
- });
- $.before(clone.lastChild, resto);
- }
- $.append(dialog, clone);
$.append(d.body, dialog);
- dialog.style.width = dialog.offsetWidth;
return dialog;
},
persist: function() {
diff --git a/script.coffee b/script.coffee
index ead516f75..b97a7fb5a 100644
--- a/script.coffee
+++ b/script.coffee
@@ -875,10 +875,14 @@ qr =
clearInterval qr.cooldownIntervalID
dialog: (link) ->
+ #maybe should be global
+ MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value
+ THREAD_ID = g.THREAD_ID or link.pathname.split('/').pop()
html = "
-
-