diff --git a/4chan_x.user.js b/4chan_x.user.js index 839c523c4..de201c79a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1231,6 +1231,7 @@ $.bind(window, 'message', qr.message); $.bind($('#recaptcha_challenge_field_holder'), 'DOMNodeInserted', qr.captchaNode); qr.captchaTime = Date.now(); + qr.spoiler = $('.postarea label') ? '' : ''; qr.acceptFiles = $('.rules').textContent.match(/:(.+)/)[1].replace(/[A-Z]{3}/g, function(type) { switch (type) { case 'JPG': @@ -1304,7 +1305,7 @@ return qr.el = null; }, dialog: function(link) { - var THREAD_ID, c, email, html, m, name, pwd, spoiler, submitDisabled, submitValue; + var THREAD_ID, c, email, html, m, name, pwd, submitDisabled, submitValue; c = d.cookie; name = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; email = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; @@ -1312,9 +1313,8 @@ 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') ? '' : ''; qr.challenge = $('#recaptcha_challenge_field').value; - html = " X
Quick Reply
" + spoiler + "
" + ($.get('captchas', []).length) + " captchas
attach another file
"; + html = " X
Quick Reply
" + qr.spoiler + "
" + ($.get('captchas', []).length) + " captchas
attach another file
"; qr.el = ui.dialog('qr', { top: '0px', left: '0px' diff --git a/script.coffee b/script.coffee index 26c6682f9..2991460c3 100644 --- a/script.coffee +++ b/script.coffee @@ -975,6 +975,7 @@ qr = $.bind $('#recaptcha_challenge_field_holder'), 'DOMNodeInserted', qr.captchaNode qr.captchaTime = Date.now() + qr.spoiler = if $('.postarea label') then '' else '' qr.acceptFiles = $('.rules').textContent.match(/:(.+)/)[1].replace /[A-Z]{3}/g, (type) -> switch type when 'JPG' @@ -1044,7 +1045,6 @@ qr = 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 '' qr.challenge = $('#recaptcha_challenge_field').value html = " @@ -1059,7 +1059,7 @@ qr = -
#{spoiler}
+
#{qr.spoiler}