diff --git a/app/helpers/hotkeys_helper.rb b/app/helpers/hotkeys_helper.rb index 810a0f83e..062f6ca2d 100644 --- a/app/helpers/hotkeys_helper.rb +++ b/app/helpers/hotkeys_helper.rb @@ -6,8 +6,6 @@ module HotkeysHelper "⌘" elsif key == "enter" platform.mac? ? "return" : "enter" - elsif key == "shift" - "⇧" else key end.capitalize diff --git a/app/views/boards/edit/_publication.html.erb b/app/views/boards/edit/_publication.html.erb index 8ff98d87e..7cfc10ca6 100644 --- a/app/views/boards/edit/_publication.html.erb +++ b/app/views/boards/edit/_publication.html.erb @@ -34,7 +34,7 @@ placeholder: "Add a public note about this board…", data: { action: "keydown.ctrl+enter->form#submit:prevent keydown.meta+enter->form#submit:prevent keydown.esc->form#cancel:stop" }, readonly: !Current.user.can_administer_board?(@board) %> - <%= form.button "Save changes", type: :submit, class: "btn txt-small" %> + <%= form.button "Save changes", type: :submit, class: "btn txt-small", title: "Save changes (#{ hotkey_label(["ctrl", "enter"]) })" %> <% end %> diff --git a/app/views/cards/comments/_new.html.erb b/app/views/cards/comments/_new.html.erb index 32e9ab3bb..115f30ebe 100644 --- a/app/views/cards/comments/_new.html.erb +++ b/app/views/cards/comments/_new.html.erb @@ -16,6 +16,7 @@ <%= form.button class: "comment__submit btn btn--reversed", + title: "Post this comment (#{ hotkey_label(["ctrl", "enter"]) })", data: { form_target: "submit" }, disabled: true do %> Post <% end %> diff --git a/app/views/cards/comments/edit.html.erb b/app/views/cards/comments/edit.html.erb index 2eafce124..ca23b331f 100644 --- a/app/views/cards/comments/edit.html.erb +++ b/app/views/cards/comments/edit.html.erb @@ -12,10 +12,10 @@ <%= general_prompts(@card.board) %> <% end %>
- <%= form.button class: "btn btn--reversed", type: :submit do %> + <%= form.button class: "btn btn--reversed", type: :submit, title: "Save changes (#{ hotkey_label(["ctrl", "enter"]) })" do %> Save <% end %> - <%= link_to card_comment_path(@card, @comment), class: "btn", data: { form_target: "cancel" } do %> + <%= link_to card_comment_path(@card, @comment), class: "btn", data: { form_target: "cancel" },title: "Cancel (#{ hotkey_label(["esc"]) })" do %> Cancel <% end %> diff --git a/app/views/cards/container/_gild.html.erb b/app/views/cards/container/_gild.html.erb index c8e337267..e3152eb9a 100644 --- a/app/views/cards/container/_gild.html.erb +++ b/app/views/cards/container/_gild.html.erb @@ -1,11 +1,11 @@ <% if card.golden? %> - <%= button_to card_goldness_path(card), method: :delete, class: "btn btn--reversed", data: { controller: "tooltip" } do %> + <%= button_to card_goldness_path(card), method: :delete, class: "btn btn--reversed", data: { controller: "tooltip hotkey", action: "keydown.shift+g@document->hotkey#click" } do %> <%= icon_tag "golden-ticket" %> - Demote to normal + Demote to normal (shift+g) <% end %> <% else %> - <%= button_to card_goldness_path(card), class: "btn", data: { controller: "tooltip" } do %> + <%= button_to card_goldness_path(card), class: "btn", data: { controller: "tooltip hotkey", action: "keydown.shift+g@document->hotkey#click" } do %> <%= icon_tag "golden-ticket" %> - Promote to golden + Promote to golden (shift+g) <% end %> <% end %> diff --git a/app/views/cards/container/_save_button.html.erb b/app/views/cards/container/_save_button.html.erb index 5ad2a5a64..ec213740b 100644 --- a/app/views/cards/container/_save_button.html.erb +++ b/app/views/cards/container/_save_button.html.erb @@ -1,7 +1,7 @@
<%= button_tag type: :submit, form: dom_id(card, :edit_form), class: "btn borderless", + title: "Save changes (#{ hotkey_label(["ctrl", "enter"]) })", data: { controller: "hotkey", action: "keydown.ctrl+enter@document->hotkey#click keydown.meta+enter@document->hotkey#click" } do %> Save changes - <%= hotkey_label(["ctrl", "enter"]) %> <% end %>
diff --git a/app/views/cards/container/footer/_draft.html.erb b/app/views/cards/container/footer/_draft.html.erb index 2516a3e21..0dc6061a5 100644 --- a/app/views/cards/container/footer/_draft.html.erb +++ b/app/views/cards/container/footer/_draft.html.erb @@ -1,14 +1,14 @@
<%= button_to card_publish_path(card), name: "creation_type", value: "add", class: "btn", + title: "Create card (#{ hotkey_label(["ctrl", "enter"]) })", form: { data: { controller: "form" } }, data: { form_target: "submit", controller: "clicker", action: "keydown.ctrl+enter@document->clicker#click keydown.meta+enter@document->clicker#click" } do %> Create card <% end %> <%= button_to card_publish_path(card), method: :post, class: "btn btn--reversed", name: "creation_type", value: "add_another", - title: "Create and add another (ctrl+shift+enter)", form: { data: { controller: "form" } }, + title: "Create and add another (#{ hotkey_label(["ctrl", "shift", "enter"]) })", form: { data: { controller: "form" } }, data: { form_target: "submit", controller: "clicker", action: "keydown.ctrl+shift+enter@document->clicker#click keydown.meta+shift+enter@document->clicker#click" } do %> Create and add another - <%= hotkey_label([ "ctrl", "shift", "enter" ]) %> <% end %>
diff --git a/app/views/cards/pins/_pin_button.html.erb b/app/views/cards/pins/_pin_button.html.erb index f49fbe5f3..9e26872a4 100644 --- a/app/views/cards/pins/_pin_button.html.erb +++ b/app/views/cards/pins/_pin_button.html.erb @@ -1,11 +1,11 @@
<% if card.pinned_by? Current.user %> - <%= button_to card_pin_path(card), method: :delete, class: "btn btn--reversed", data: { controller: "tooltip" } do %> - <%= icon_tag "pinned" %> Un-pin this card + <%= button_to card_pin_path(card), method: :delete, class: "btn btn--reversed", data: { controller: "tooltip hotkey", action: "keydown.shift+p@document->hotkey#click" } do %> + <%= icon_tag "pinned" %> Un-pin this card (shift+p) <% end %> <% else %> - <%= button_to card_pin_path(card), class: "btn", data: { controller: "tooltip" } do %> - <%= icon_tag "unpinned" %> Pin this card + <%= button_to card_pin_path(card), class: "btn", data: { controller: "tooltip hotkey", action: "keydown.shift+p@document->hotkey#click" } do %> + <%= icon_tag "unpinned" %> Pin this card (shift+p) <% end %> <% end %>
diff --git a/app/views/cards/watches/_watch_button.html.erb b/app/views/cards/watches/_watch_button.html.erb index 3344d9c31..3e1618ca3 100644 --- a/app/views/cards/watches/_watch_button.html.erb +++ b/app/views/cards/watches/_watch_button.html.erb @@ -1,13 +1,13 @@
<% if card.watched_by? Current.user %> - <%= button_to card_watch_path(card), method: :delete, class: "btn btn--reversed", data: { controller: "tooltip" } do %> + <%= button_to card_watch_path(card), method: :delete, class: "btn btn--reversed", data: { controller: "tooltip hotkey", action: "keydown.shift+n@document->hotkey#click" } do %> <%= icon_tag "bell" %> - Stop watching + Stop watching (shift+n) <% end %> <% else %> - <%= button_to card_watch_path(card), class: "btn", data: { controller: "tooltip" } do %> + <%= button_to card_watch_path(card), class: "btn", data: { controller: "tooltip hotkey", action: "keydown.shift+n@document->hotkey#click" } do %> <%= icon_tag "bell-off" %> - Watch this + Watch this (shift+n) <% end %> <% end %>