From 9eed6ee89e65279964b22aa6657f326b1f770e12 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 4 Aug 2019 14:41:32 -0700 Subject: [PATCH] Shift+click on the Quick Reply submit button will now attempt to post regardless of cooldowns or other errors. --- src/Posting/QR.coffee | 13 +++++++++---- src/Posting/QR.cooldown.coffee | 7 +++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 495848df2..e3881e4f1 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -546,6 +546,7 @@ QR = $.on nodes.autohide, 'change', QR.toggleHide $.on nodes.close, 'click', QR.close + $.on nodes.status, 'click', QR.submit $.on nodes.form, 'submit', QR.submit $.on nodes.sjisToggle, 'click', QR.toggleSJIS $.on nodes.texButton, 'mousedown', QR.texPreviewShow @@ -637,6 +638,7 @@ QR = submit: (e) -> e?.preventDefault() + force = e?.shiftKey if QR.req QR.abort() @@ -644,9 +646,12 @@ QR = $.forceSync 'cooldowns' if QR.cooldown.seconds - QR.cooldown.auto = !QR.cooldown.auto - QR.status() - return + if force + QR.cooldown.clear() + else + QR.cooldown.auto = !QR.cooldown.auto + QR.status() + return post = QR.posts[0] post.forceSave() @@ -679,7 +684,7 @@ QR = QR.captcha.setup(!QR.cooldown.auto or d.activeElement is QR.nodes.status) QR.cleanNotifications() - if err + if err and !force # stop auto-posting QR.cooldown.auto = false QR.status() diff --git a/src/Posting/QR.cooldown.coffee b/src/Posting/QR.cooldown.coffee index d53db866e..df5ea55fb 100644 --- a/src/Posting/QR.cooldown.coffee +++ b/src/Posting/QR.cooldown.coffee @@ -107,6 +107,13 @@ QR.cooldown = $.set 'cooldowns', cooldowns, -> QR.cooldown.changes = $.dict() + clear: -> + QR.cooldown.data = $.dict() + QR.cooldown.changes = $.dict() + QR.cooldown.auto = false + QR.cooldown.update() + $.queueTask $.delete, 'cooldowns' + update: -> return unless QR.cooldown.isCounting