diff --git a/4chan_x.user.js b/4chan_x.user.js index 31a87b407..f7f0cbd4f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2354,7 +2354,7 @@ })); }, submit: function(e) { - var callbacks, captcha, captchas, challenge, err, m, opts, post, reply, response, threadID, _ref; + var callbacks, captcha, captchas, challenge, err, m, opts, post, reply, response, textOnly, threadID, _ref; if (e != null) { e.preventDefault(); } @@ -2369,7 +2369,7 @@ if (threadID === 'new') { if (((_ref = g.BOARD) === 'vg' || _ref === 'q') && !reply.sub) { err = 'New threads require a subject.'; - } else if (!reply.file) { + } else if (!(reply.file || (textOnly = !!$('input[name=textonly]', $.id('postForm'))))) { err = 'No file selected.'; } } else { @@ -2422,6 +2422,7 @@ com: reply.com, upfile: reply.file, spoiler: reply.spoiler, + textonly: textOnly, mode: 'regist', pwd: (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value, recaptcha_challenge_field: challenge, diff --git a/changelog b/changelog index 7a06abbea..1eb3236b8 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - Mayhem Fix cooldown on /q/. + Fix thread creation with no file on /q/. Add /mlp/ archive redirection. 2.34.4 diff --git a/script.coffee b/script.coffee index 8b3973982..0eba6f5e5 100644 --- a/script.coffee +++ b/script.coffee @@ -1832,8 +1832,8 @@ QR = if threadID is 'new' if g.BOARD in ['vg', 'q'] and !reply.sub err = 'New threads require a subject.' - else unless reply.file - err = 'No file selected.' + else unless reply.file or textOnly = !!$ 'input[name=textonly]', $.id 'postForm' + err = 'No file selected.' else unless reply.com or reply.file err = 'No file selected.' @@ -1876,14 +1876,15 @@ QR = QR.status progress: '...' post = - resto: threadID - name: reply.name - email: reply.email - sub: reply.sub - com: reply.com - upfile: reply.file - spoiler: reply.spoiler - mode: 'regist' + resto: threadID + name: reply.name + email: reply.email + sub: reply.sub + com: reply.com + upfile: reply.file + spoiler: reply.spoiler + textonly: textOnly + mode: 'regist' pwd: if m = d.cookie.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value recaptcha_challenge_field: challenge recaptcha_response_field: response + ' '