From 184818c5262d4d258d181145d10e1e51b367c07d Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 8 Oct 2016 10:29:00 -0700 Subject: [PATCH] Add 'Post from URL' keybind. #730 --- src/Miscellaneous/Keybinds.coffee | 3 +++ src/Posting/QR.coffee | 1 + src/config/Config.coffee | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 11c95c5d7..20ddb6a76 100644 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -80,6 +80,9 @@ Keybinds = when Conf['Toggle Cooldown'] return unless QR.nodes and !QR.nodes.el.hidden and $.hasClass(QR.nodes.fileSubmit, 'custom-cooldown') QR.toggleCustomCooldown() + when Conf['Post from URL'] + return unless QR.postingIsEnabled + QR.handleUrl '' 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 898c6917e..c2392a53f 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -389,6 +389,7 @@ QR = return handleUrl: (urlDefault) -> + QR.open() url = prompt 'Enter a URL:', urlDefault return if url is null QR.nodes.fileButton.focus() diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 77ebf8002..b25850bc8 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -863,6 +863,10 @@ Config = 'Alt+Comma' 'Toggle custom cooldown timer.' ] + 'Post from URL': [ + 'Alt+l' + 'Post from URL.' + ] 'Submit QR': [ 'Ctrl+Enter' 'Submit post.'