diff --git a/4chan_x.user.js b/4chan_x.user.js index fbc37f97b..a03bd363d 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1297,21 +1297,21 @@ return qr.el = null; }, dialog: function(link) { - var THREAD_ID, c, challenge, html, m, spoiler, submitDisabled, submitValue; + var THREAD_ID, c, challenge, email, html, m, name, pwd, spoiler, submitDisabled, submitValue; + c = d.cookie; + name = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; + email = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; + pwd = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value; submitValue = $('#com_submit').value; submitDisabled = $('#com_submit').disabled ? 'disabled' : ''; THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id; spoiler = $('.postarea label') ? '' : ''; challenge = $('#recaptcha_challenge_field').value; - html = " X
Quick Reply
" + spoiler + "
" + ($.get('captchas', []).length) + " captchas
attach another file
"; + html = " X
Quick Reply
" + spoiler + "
" + ($.get('captchas', []).length) + " captchas
attach another file
"; qr.el = ui.dialog('qr', { top: '0px', left: '0px' }, html); - c = d.cookie; - $('input[name=name]', qr.el).value = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; - $('input[name=email]', qr.el).value = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; - $('input[name=pwd]', qr.el).value = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value; $.bind($('input[name=name]', qr.el), 'mousedown', function(e) { return e.stopPropagation(); }); diff --git a/script.coffee b/script.coffee index a6fdf2866..13c35d55d 100644 --- a/script.coffee +++ b/script.coffee @@ -1029,17 +1029,22 @@ qr = qr.el = null dialog: (link) -> + c = d.cookie + name = if m = c.match(/4chan_name=([^;]+)/) then decodeURIComponent m[1] else '' + email = if m = c.match(/4chan_email=([^;]+)/) then decodeURIComponent m[1] else '' + pwd = if m = c.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value submitValue = $('#com_submit').value submitDisabled = if $('#com_submit').disabled then 'disabled' else '' #FIXME inlined cross-thread quotes THREAD_ID = g.THREAD_ID or $.x('ancestor::div[@class="thread"]/div', link).id spoiler = if $('.postarea label') then '' else '' challenge = $('#recaptcha_challenge_field').value + html = " X
- + Quick Reply
@@ -1047,7 +1052,7 @@ qr = -
#{spoiler}
+
#{spoiler}
@@ -1055,17 +1060,12 @@ qr =
-
attach another file
+
attach another file
" qr.el = ui.dialog 'qr', top: '0px', left: '0px', html - c = d.cookie - $('input[name=name]', qr.el).value = if m = c.match(/4chan_name=([^;]+)/) then decodeURIComponent m[1] else '' - $('input[name=email]', qr.el).value = if m = c.match(/4chan_email=([^;]+)/) then decodeURIComponent m[1] else '' - $('input[name=pwd]', qr.el).value = if m = c.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value - $.bind $('input[name=name]', qr.el), 'mousedown', (e) -> e.stopPropagation() $.bind $('input[name=upfile]', qr.el), 'change', qr.validateFileSize $.bind $('#close', qr.el), 'click', qr.close