From 5bf0c9ede38b5b638b52bd5f733d6b7b2fcf9a0e Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 16 Oct 2014 23:52:06 -0700 Subject: [PATCH] Warn when inserting tags on a board that doesn't support them. --- src/Miscellaneous/Keybinds.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 01c442c2f..6439e6501 100755 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -222,6 +222,12 @@ Keybinds = $.rmClass $('.qr-shortcut'), 'disabled' tags: (tag, ta) -> + supported = switch tag + when 'spoiler' then !!$ '.postForm input[name=spoiler]' + when 'code' then g.BOARD.ID is 'g' + when 'math', 'eqn' then g.BOARD.ID is 'sci' + new Notice 'warning', "[#{tag}] tags are not supported on /#{g.BOARD}/.", 20 unless supported + value = ta.value selStart = ta.selectionStart selEnd = ta.selectionEnd