diff --git a/4chan_x.user.js b/4chan_x.user.js index 0a2e51955..7d84451ae 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1371,7 +1371,7 @@ } }, dialog: function(text, tid) { - var l, qr, ta; + var c, l, m, qr, ta; if (text == null) { text = ''; } @@ -1399,11 +1399,7 @@ " #XXX use dom methods to set values instead of injecting raw user input into your html -_-; - c = d.cookie - $('[name=name]', qr).value = if m = c.match(/4chan_name=([^;]+)/) then decodeURIComponent m[1] else '' - $('[name=email]', qr).value = if m = c.match(/4chan_email=([^;]+)/) then decodeURIComponent m[1] else '' $('[name=pwd]', qr).value = if m = c.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value - $('textarea', qr).value = text $.bind $('[type=file]', qr), 'change', QR.change $.bind $('#attach', qr), 'click', QR.attach */ @@ -1411,6 +1407,10 @@ top: '0', left: '0' }, " X
Subject Name Email
120 Captchas
Derp
"); + c = d.cookie; + $('[name=name]', qr).value = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; + $('[name=email]', qr).value = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; + $('textarea', qr).value = text; if (conf['Cooldown']) { QR.cooldown(); } diff --git a/script.coffee b/script.coffee index 0e5862b80..8b417634b 100644 --- a/script.coffee +++ b/script.coffee @@ -1088,11 +1088,7 @@ QR =
" #XXX use dom methods to set values instead of injecting raw user input into your html -_-; - c = d.cookie - $('[name=name]', qr).value = if m = c.match(/4chan_name=([^;]+)/) then decodeURIComponent m[1] else '' - $('[name=email]', qr).value = if m = c.match(/4chan_email=([^;]+)/) then decodeURIComponent m[1] else '' $('[name=pwd]', qr).value = if m = c.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value - $('textarea', qr).value = text $.bind $('[type=file]', qr), 'change', QR.change $.bind $('#attach', qr), 'click', QR.attach ### @@ -1125,6 +1121,10 @@ QR = " + c = d.cookie + $('[name=name]', qr).value = if m = c.match(/4chan_name=([^;]+)/) then decodeURIComponent m[1] else '' + $('[name=email]', qr).value = if m = c.match(/4chan_email=([^;]+)/) then decodeURIComponent m[1] else '' + $('textarea', qr).value = text QR.cooldown() if conf['Cooldown'] $.bind $('.close', qr), 'click', QR.close $.bind $('.click', qr), 'mousedown', (e) -> e.stopPropagation()