From 64886c1a5ca3ce80ce30a03926678ea4834204a8 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 8 Oct 2016 11:57:41 -0700 Subject: [PATCH] Add keybind for adding new post to QR dump list. #619 --- src/Miscellaneous/Keybinds.coffee | 3 +++ src/Posting/QR.coffee | 8 ++++++++ src/config/Config.coffee | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 20ddb6a76..fe9c9abbb 100644 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -83,6 +83,9 @@ Keybinds = when Conf['Post from URL'] return unless QR.postingIsEnabled QR.handleUrl '' + when Conf['Add new post'] + return unless QR.postingIsEnabled + QR.addPost() when Conf['Submit QR'] return unless QR.nodes and !QR.nodes.el.hidden QR.submit() if !QR.status() diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index c2392a53f..56aa2d283 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -197,6 +197,14 @@ QR = texPreviewHide: -> $.rmClass QR.nodes.el, 'tex-preview' + addPost: -> + wasOpen = (QR.nodes and !QR.nodes.el.hidden) + QR.open() + if wasOpen + $.addClass QR.nodes.el, 'dump' + new QR.post true + QR.nodes.com.focus() + setCustomCooldown: (enabled) -> Conf['customCooldownEnabled'] = enabled QR.cooldown.customCooldown = enabled diff --git a/src/config/Config.coffee b/src/config/Config.coffee index b25850bc8..3a38e5985 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -867,6 +867,10 @@ Config = 'Alt+l' 'Post from URL.' ] + 'Add new post': [ + 'Alt+n' + 'Add new post to the QR dump list.' + ] 'Submit QR': [ 'Ctrl+Enter' 'Submit post.'