Warn when inserting tags on a board that doesn't support them.

This commit is contained in:
ccd0 2014-10-16 23:52:06 -07:00
parent a0e9c832fb
commit 5bf0c9ede3

View File

@ -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