From 04c09dc767c33afeab8d4e280638f141d3539f3d Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 4 Jun 2011 02:18:55 +0200 Subject: [PATCH 1/3] Auto post. --- 4chan_x.user.js | 6 +++++- script.coffee | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 5e6f3d422..9450a103c 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1052,6 +1052,9 @@ } else { submit.disabled = false; submit.value = 'Submit'; + if ($('#auto').checked) { + $('#qr_form').submit(); + } } } if (!cooldown.duration) { @@ -1186,7 +1189,7 @@ name = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; mail = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; pass = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value; - html = "
Quick Reply X
"; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' @@ -1195,6 +1198,7 @@ return e.stopPropagation(); }); $.bind($('#autohide', dialog), 'click', qr.cb.autohide); + $.bind($('#auto', dialog), 'click', qr.autohide.set); $.bind($('img', dialog), 'click', Recaptcha.reload); if ($('.postarea label')) { spoiler = $.el('label', { diff --git a/script.coffee b/script.coffee index 9aed4c739..aef38839b 100644 --- a/script.coffee +++ b/script.coffee @@ -799,6 +799,7 @@ cooldown = else submit.disabled = false submit.value = 'Submit' + $('#qr_form').submit() if $('#auto').checked window.clearInterval cooldown.interval unless cooldown.duration @@ -926,7 +927,7 @@ qr =
-
+
@@ -939,6 +940,7 @@ qr = $.bind $('input[name=name]', dialog), 'mousedown', (e) -> e.stopPropagation() $.bind $('#autohide', dialog), 'click', qr.cb.autohide + $.bind $('#auto', dialog), 'click', qr.autohide.set $.bind $('img', dialog), 'click', Recaptcha.reload if $ '.postarea label' From 47f45d3c6e1f32901db8ee3bf676535e35bfb96e Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 4 Jun 2011 02:38:58 +0200 Subject: [PATCH 2/3] Fix persistent QR, uncheck the auto checkbox. --- 4chan_x.user.js | 3 ++- script.coffee | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 9450a103c..35da0294d 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1053,6 +1053,7 @@ submit.disabled = false; submit.value = 'Submit'; if ($('#auto').checked) { + $('#auto').checked = false; $('#qr_form').submit(); } } @@ -1102,7 +1103,7 @@ qr.autohide.unset(); } else { if (dialog) { - if ($.config('Persistent QR' && g.REPLY)) { + if ($.config('Persistent QR') && g.REPLY) { qr.refresh(dialog); } else { $.rm(dialog); diff --git a/script.coffee b/script.coffee index aef38839b..c63daa351 100644 --- a/script.coffee +++ b/script.coffee @@ -799,7 +799,9 @@ cooldown = else submit.disabled = false submit.value = 'Submit' - $('#qr_form').submit() if $('#auto').checked + if $('#auto').checked + $('#auto').checked = false + $('#qr_form').submit() window.clearInterval cooldown.interval unless cooldown.duration @@ -836,7 +838,7 @@ qr = qr.autohide.unset() else # success if dialog - if $.config 'Persistent QR' and g.REPLY + if $.config('Persistent QR') and g.REPLY qr.refresh dialog else $.rm dialog From 1e08a8c451211248a6e70d72fb2171f2802ebf67 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 4 Jun 2011 03:34:05 +0200 Subject: [PATCH 3/3] Don't bug if the QR is closed --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 35da0294d..291d19f1e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1052,7 +1052,7 @@ } else { submit.disabled = false; submit.value = 'Submit'; - if ($('#auto').checked) { + if ($('#auto') && $('#auto').checked) { $('#auto').checked = false; $('#qr_form').submit(); } diff --git a/script.coffee b/script.coffee index c63daa351..791782769 100644 --- a/script.coffee +++ b/script.coffee @@ -799,7 +799,7 @@ cooldown = else submit.disabled = false submit.value = 'Submit' - if $('#auto').checked + if $('#auto') and $('#auto').checked $('#auto').checked = false $('#qr_form').submit()