diff --git a/4chan_x.user.js b/4chan_x.user.js index c087829e6..fa98213d7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1251,7 +1251,7 @@ } }, message: function(e) { - var data, duration; + var data, duration, file, oldFile; Recaptcha.reload(); $('iframe[name=iframe]').src = 'about:blank'; data = e.data; @@ -1262,8 +1262,13 @@ return; } if (qr.el) { - if (g.REPLY && conf['Persistent QR']) { + file = $('#files input', qr.el); + if (g.REPLY && (conf['Persistent QR'] || file)) { qr.refresh(); + if (file) { + oldFile = $('#qr_form input[type=file]', qr.el); + $.replace(oldFile, file); + } } else { qr.close(); } @@ -1361,7 +1366,7 @@ THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id; spoiler = $('.postarea label') ? '' : ''; challenge = $('input[name=recaptcha_challenge_field]').value; - html = "
Quick Reply X
" + spoiler + "
Upload another file
"; + html = "
Quick Reply X
" + spoiler + "
Upload another file
"; qr.el = ui.dialog('qr', { top: '0px', left: '0px' diff --git a/script.coffee b/script.coffee index 30cfe9346..28814c9c9 100644 --- a/script.coffee +++ b/script.coffee @@ -988,8 +988,12 @@ qr = return if qr.el - if g.REPLY and conf['Persistent QR'] + file = $ '#files input', qr.el + if g.REPLY and (conf['Persistent QR'] or file) qr.refresh() + if file + oldFile = $ '#qr_form input[type=file]', qr.el + $.replace oldFile, file else qr.close() if conf['Cooldown'] @@ -1087,8 +1091,8 @@ qr =
Upload another file
-
+
" qr.el = ui.dialog 'qr', top: '0px', left: '0px', html