d17134cb5c
Yes, Platform Agent is overkill for just this but there isn't a one-size JS solution for updating both input placeholders and other HTML text and we're likely to need it later for other things like displaying platform-specific PWA prompts.
20 lines
398 B
Ruby
20 lines
398 B
Ruby
module HotkeysHelper
|
|
def hotkey_label(hotkey)
|
|
hotkey.split(",").first if hotkey
|
|
case hotkey
|
|
when Array
|
|
hotkey.map { |key|
|
|
if key == "ctrl" && platform.mac?
|
|
"⌘"
|
|
elsif key == "enter"
|
|
platform.mac? ? "return" : "enter"
|
|
else
|
|
key
|
|
end
|
|
}.join("+")
|
|
else
|
|
hotkey.split(",").first if hotkey
|
|
end
|
|
end
|
|
end
|