diff --git a/4chan_x.user.js b/4chan_x.user.js index 822cfdf33..06ffe3de3 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1367,11 +1367,12 @@ QR.qr = qr = ui.dialog('qr', { top: '0', left: '0' - }, " X
Quick Reply
" + QR.spoiler + "
" + ($.get('captchas', []).length) + " captchas
attach another file
"); + }, " X
Quick Reply
" + QR.spoiler + "
" + ($.get('captchas', []).length) + " captchas
attach another file
"); 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]) : ''; $('[name=pwd]', qr).value = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value; + $('textarea', qr).value = text; if (conf['Cooldown']) { QR.cooldown; } @@ -1420,6 +1421,7 @@ }, receive: function(e) { var data, tc, _ref; + $('iframe[name=iframe]').src = 'about:blank'; data = e.data; if (data) { data = JSON.parse(data); @@ -1503,8 +1505,7 @@ href: href }); } - parent.postMessage(data, '*'); - return window.location = 'about:blank'; + return parent.postMessage(data, '*'); }); } }; diff --git a/script.coffee b/script.coffee index 914397a27..fbc705b0a 100644 --- a/script.coffee +++ b/script.coffee @@ -962,6 +962,9 @@ cooldown = QR = #FIXME DRY + #index reply + #create new thread + #sys normal post form fallback init: -> g.callbacks.push (root) -> quote = $ 'a.quotejs + a', root @@ -1065,7 +1068,7 @@ QR =
#{QR.spoiler}
-
+
#{$.get('captchas', []).length} captchas
@@ -1079,6 +1082,7 @@ QR = $('[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 QR.cooldown if conf['Cooldown'] $.bind $('.close', qr), 'click', QR.close $.bind $('form', qr), 'submit', QR.submit @@ -1115,6 +1119,7 @@ QR = ta.setSelectionRange i, i ta.focus() receive: (e) -> + $('iframe[name=iframe]').src = 'about:blank' {data} = e if data data = JSON.parse data @@ -1170,7 +1175,6 @@ QR = {textContent, href} = node data = JSON.stringify {textContent, href} parent.postMessage data, '*' - window.location = 'about:blank' qr = # TODO