frontend: Add hotkey information to title/inline text.

This should make many Zulip hotkeys significantly more discoverable.
This commit is contained in:
Vaida Plankyte 2017-08-16 18:25:53 +01:00 committed by Tim Abbott
parent fc1d1f7379
commit b2c0ff68c2
15 changed files with 31 additions and 31 deletions

View File

@ -720,7 +720,7 @@ function render(template_name, args) {
assert.equal(first_message_text, "This is message one.");
var starred_title = first_message.find(".star").attr("title");
assert.equal(starred_title, "Unstar this message");
assert.equal(starred_title, "Unstar this message (*)");
}());
(function message_edit_form() {
@ -1238,7 +1238,7 @@ function render(template_name, args) {
global.write_handlebars_output("user_info_popover_content", html);
var a = $(html).find("a.compose_private_message");
assert.equal(a.text().trim(), 'Send private message');
assert.equal(a.text().trim(), 'Send private message (R)');
}());
(function user_info_popover_title() {

View File

@ -203,7 +203,7 @@ exports.render_emoji_popover = function (elt, id) {
trigger: "manual",
});
elt.popover("show");
elt.prop('title', 'Add reaction...');
elt.prop('title', 'Add reaction (:)');
$('.emoji-popover-filter').focus();
add_scrollbar($(".emoji-popover-emoji-map"));
add_scrollbar($(".emoji-search-results-container"));

View File

@ -16,7 +16,7 @@
<li>
<a href="#" class="popover_toggle_collapse" data-message-id="{{message.id}}">
<i class="{{#if message.collapsed}}fa fa-plus{{else}}fa fa-minus{{/if}}" aria-hidden="true"></i>
{{#if message.collapsed}}{{t "Un-collapse" }}{{else}}{{t "Collapse" }}{{/if}}
{{#if message.collapsed}}{{t "Un-collapse" }}{{else}}{{t "Collapse" }}{{/if}} (-)
</a>
</li>
@ -40,7 +40,7 @@
<li>
<a href="#" class="popover_mute_topic" data-msg-stream="{{message.stream}}" data-msg-topic="{{message.subject}}">
<i class="fa fa-eye-slash" aria-hidden="true"></i>
{{#tr message}}Mute the topic <b>__subject__</b>{{/tr}}
{{#tr message}}Mute the topic <b>__subject__</b>{{/tr}} (M)
</a>
</li>
{{/if}}

View File

@ -30,11 +30,11 @@
<div class="messagebox-content">
<div class="message_top_line">
<div class="draft_controls">
<i class="icon-vector-large icon-vector-pencil restore-draft" data-toggle="tooltip" title="{{t 'Restore draft' }}"></i>
<i class="icon-vector-large icon-vector-trash delete-draft" data-toggle="tooltip" title="{{t 'Delete draft' }}"></i>
<i class="icon-vector-large icon-vector-pencil restore-draft" data-toggle="tooltip" title="{{t 'Restore draft' }} (Enter)"></i>
<i class="icon-vector-large icon-vector-trash delete-draft" data-toggle="tooltip" title="{{t 'Delete draft' }} (Backspace)"></i>
</div>
</div>
<div class="message_content restore-draft" data-toggle="tooltip" title="{{t 'Restore draft' }}">{{{content}}}</div>
<div class="message_content restore-draft" data-toggle="tooltip" title="{{t 'Restore draft' }} (Enter)">{{{content}}}</div>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
{{#each this/msg/message_reactions}}
{{partial "message_reaction"}}
{{/each}}
<div class="reaction_button" title="{{t 'Add reaction...' }}">
<div class="reaction_button" title="{{t 'Add reaction' }} (:)">
<i class="fa fa-smile-o" aria-hidden="true"></i>
<div class="message_reaction_count">+</div>
</div>

View File

@ -53,7 +53,7 @@
<span class="topic_edit_form" id="{{id}}"></span>
</span>
<i class="icon-vector-eye-close on_hover_topic_mute" data-stream-id="{{stream_id}}" data-topic-name="{{subject}}"></i>
<i class="icon-vector-eye-close on_hover_topic_mute" data-stream-id="{{stream_id}}" data-topic-name="{{subject}}" title="{{t 'Mute topic' }} (M)"></i>
<span class="recipient_row_date {{#if show_date}}{{else}}hide-date{{/if}}">{{{date}}}</span>
</div>
</div>

View File

@ -45,17 +45,17 @@
<div class="edit_content"></div>
{{else}}
<div class="reactions_hover">
<i class="icon-vector-smile reaction_button" title="{{#tr this}}Add emoji reaction{{/tr}}"></i>
<i class="icon-vector-smile reaction_button" title="{{#tr this}}Add emoji reaction{{/tr}} (:)"></i>
</div>
{{/if}}
<div class="info actions_hover">
<i class="icon-vector-chevron-down" title="{{#tr this}}Message actions{{/tr}}"></i>
<i class="icon-vector-chevron-down" title="{{#tr this}}Message actions{{/tr}} (i)"></i>
</div>
<div class="message_failed {{#unless msg.failed_request}}notvisible{{/unless}}">
<i class="icon-vector-refresh refresh-failed-message" data-toggle="tooltip" title="{{t 'Retry' }}"></i>
<i class="icon-vector-remove-sign remove-failed-message" data-toggle="tooltip" title="{{t 'Cancel' }}"></i>
</div>
<div class="star {{#if msg/starred}}icon-vector-star{{else}}icon-vector-star-empty{{/if}} {{#if msg/starred}}{{else}}empty-star{{/if}}" title="{{#tr this.msg}}__starred_status__ this message{{/tr}}">
<div class="star {{#if msg/starred}}icon-vector-star{{else}}icon-vector-star-empty{{/if}} {{#if msg/starred}}{{else}}empty-star{{/if}}" title="{{#tr this.msg}}__starred_status__ this message{{/tr}} (*)">
</div>
</div>
</div>

View File

@ -16,9 +16,9 @@
<span class="checkmark" data-finish-editing=".stream-name-editable">✓</span>
{{/if}}
</div>
<button class="button small rounded subscribe-button sub_unsub_button {{#unless subscribed }}unsubscribed{{/unless}}" type="button" name="button">
<button class="button small rounded subscribe-button sub_unsub_button {{#unless subscribed }}unsubscribed{{/unless}}" type="button" name="button" title="{{t 'Toggle subscription'}} (S)">
{{#if subscribed }}{{#tr oneself }}Unsubscribe{{/tr}}{{else}}{{#tr oneself }}Subscribe{{/tr}}{{/if}}</button>
<a href="{{preview_url}}" class="button small rounded" id="preview-stream-button" role="button">{{t "View stream"}}</a>
<a href="{{preview_url}}" class="button small rounded" id="preview-stream-button" role="button" title="{{t 'View stream'}} (V)">{{t "View stream"}}</a>
</div>
<div class="stream-description" data-no-description="{{t 'No description.' }}">
<span class="stream-description-editable editable-section">{{{rendered_description}}}</span>

View File

@ -15,7 +15,7 @@
placeholder="{{t 'Filter streams' }}" value="" autocomplete="off" />
{{#if can_create_streams}}
<input type="submit" class=""
id="create_stream_button" value="+" />
id="create_stream_button" value="+" title="{{t 'Create new stream' }} (n)"/>
{{/if}}
<div class="float-clear"></div>
</form>

View File

@ -7,7 +7,7 @@
{{! Most tabs are links, but some are not since we don't have a narrow for them (e.g. Search) }}
{{#if hash}}
{{#if home}}
<a href="{{hash}}"><i class="icon-vector-home"></i></a>
<a href="{{hash}}" title="{{t 'Home' }} (Esc)"><i class="icon-vector-home"></i></a>
{{else}}
<a href="{{hash}}">{{title}}</a>
{{/if}}

View File

@ -15,12 +15,12 @@
<hr />
<li>
<a href="#" class="{{ private_message_class }}">
<i class="fa fa-envelope" aria-hidden="true"></i> {{#tr this}}Send private message{{/tr}}
<i class="fa fa-envelope" aria-hidden="true"></i> {{#tr this}}Send private message{{/tr}} (R)
</a>
</li>
<li>
<a class="mention_user">
<i class="fa fa-at" aria-hidden="true"></i> {{#tr this}}Reply mentioning user{{/tr}}
<i class="fa fa-at" aria-hidden="true"></i> {{#tr this}}Reply mentioning user{{/tr}} (@)
</a>
</li>
<hr />

View File

@ -5,7 +5,7 @@
<div id="compose_controls" class="compose-content new-style">
<div id="compose_buttons">
<span class="new_message_button">
<a class="drafts-link no-style" href="#drafts">
<a class="drafts-link no-style" href="#drafts" title="{{ _('Drafts') }} (d)">
<button type="button" class="button small rounded compose_drafts_button">
<span>{{ _('Drafts') }}</span>
</button>
@ -38,7 +38,7 @@
<div id="compose-all-everyone" class="alert home-error-bar"></div>
<div id="out-of-view-notification" class="notification-alert"></div>
<div class="composition-area">
<button type="button" class="close" id='compose_close'>&times;</button>
<button type="button" class="close" id='compose_close' title="{{ _('Cancel compose') }} (Esc)">&times;</button>
<form id="send_message_form" action="/json/messages" method="post">
{{ csrf_input }}
<table class="compose_table">
@ -95,12 +95,12 @@
<a class="message-control-button icon-vector-font" title="{{ _('Formatting') }}" data-overlay-trigger="markdown-help"></a>
<a id="undo_markdown_preview" class="message-control-button icon-vector-edit" style="display:none;" title="{{ _('Write') }}"></a>
<a id="markdown_preview" class="message-control-button icon-vector-eye-open" title="{{ _('Preview') }}"></a>
<a class="drafts-link" href="#drafts">{{ _('Drafts') }}</a>
<a class="drafts-link" href="#drafts" title="{{ _('Drafts') }} (d)">{{ _('Drafts') }}</a>
<span id="sending-indicator">{{ _('Sending...') }}</span>
<div id="send_controls" class="new-style">
<label id="enter-sends-label" class="compose_checkbox_label" for="enter_sends">{{ _('Press Enter to send') }}&nbsp;</label>
<input type="checkbox" id="enter_sends" name="enter_sends" value="enter_sends" />
<button type="submit" id="compose-send-button" class="button small send_message" tabindex="150">{{ _('Send') }}</button>
<button type="submit" id="compose-send-button" class="button small send_message" tabindex="150" title="{{ _('Send') }} (Ctrl + Enter)">{{ _('Send') }}</button>
</div>
</div>
</td>

View File

@ -2,7 +2,7 @@
<div class="bottom_sidebar">
<ul id="global_filters" class="filters">
{# Special-case this link so we don't actually go to page top. #}
<li data-name="home" class="global-filter active-filter home-link">
<li data-name="home" class="global-filter active-filter home-link" title="{{ _('Home') }} (Esc)">
<a href="#">
<span class="filter-icon">
<i class="icon-vector-home"></i>
@ -13,7 +13,7 @@
</span>
</a>
</li>
<li data-name="private" class="global-filter">
<li data-name="private" class="global-filter" title="{{ _('Private messages') }} (P)">
<a href="#narrow/is/private">
<span class="filter-icon">
<i class="icon-vector-envelope"></i>
@ -49,7 +49,7 @@
<a href="#streams">
<i id="streams_inline_cog" class='icon-vector-cog' data-toggle="tooltip" title="{{ _('Subscribe, add, or configure streams') }}"></i>
</a>
<a href=""><i id='streams_filter_icon' class='icon-vector-search' data-toggle="tooltip" title="{{ _('Filter streams list') }}"></i></a>
<a href=""><i id='streams_filter_icon' class='icon-vector-search' data-toggle="tooltip" title="{{ _('Filter streams') }} (w)"></i></a>
<a href="" id="join_unsub_stream">
<i class="icon-vector-plus" title="{{ _('Join stream')}}" data-toggle="tooltip"></i>
</a>

View File

@ -20,9 +20,9 @@
</div>
<form id="searchbox_form" class="form-search navbar-search">
<div id="search_arrows" class="input-append">
<a class="search_icon" href="#search-operators" data-overlay-trigger="search-operators"><i class="icon-vector-search"></i></a>
<a class="search_icon" href="#search-operators" data-overlay-trigger="search-operators" title="{{ _('Search help') }}"><i class="icon-vector-search"></i></a>
<input class="search-query input-block-level" id="search_query" type="text" placeholder="{{ _('Search') }}"
autocomplete="off" aria-label="{{ _('Search') }}"/>
autocomplete="off" aria-label="{{ _('Search') }}" title="{{ _('Search') }} (/)"/>
{# Start the button off disabled since there is no active search #}
<button class="btn search_button" type="button" id="search_exit" disabled="disabled" aria-label="{{ _('Exit search') }}"><i class="icon-vector-remove"></i></button>
</div>
@ -39,7 +39,7 @@
<div id="navbar-buttons" {%if embedded %} style="visibility: hidden"{% endif %}>
<ul class="nav" role="navigation">
<li class="dropdown actual-dropdown-menu" id="gear-menu">
<a id="settings-dropdown" href="#" role="button" class="dropdown-toggle" data-target="nada" data-toggle="dropdown">
<a id="settings-dropdown" href="#" role="button" class="dropdown-toggle" data-target="nada" data-toggle="dropdown" title="{{ _('Menu') }} (g)">
<i class="icon-vector-cog"></i><i class="icon-vector-caret-down settings-dropdown-caret"></i>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="settings-dropdown">
@ -73,7 +73,7 @@
</li>
<li role="presentation">
<a tabindex="0" role="menuitem" data-overlay-trigger="keyboard-shortcuts">
<i class="icon-vector-keyboard"></i> {{ _('Keyboard shortcuts') }}
<i class="icon-vector-keyboard"></i> {{ _('Keyboard shortcuts') }} (?)
</a>
</li>
<li role="presentation">

View File

@ -12,7 +12,7 @@
<h4 class='sidebar-title' id='userlist-title'>{{ _('USERS') }}</h4>
</div>
<div class="input-append">
<input class="user-list-filter" type="text" placeholder="{{ _('Search people') }}" aria-label="{{ _('Search people') }}"/>
<input class="user-list-filter" type="text" placeholder="{{ _('Search people') }}" aria-label="{{ _('Search people') }}" title="{{ _('Search people') }} (q)"/>
<button type="button" class="btn clear_search_button" id="clear_search_people_button" disabled="disabled">
<i class="icon-vector-remove"></i>
</button>