Skip to content

Commit

Permalink
Merge pull request #5902 from cnash/develop
Browse files Browse the repository at this point in the history
[NEW] Adds a Keyboard Shortcut option to the flextab
  • Loading branch information
rodrigok authored Aug 22, 2017
2 parents 3bc2048 + ef48083 commit 78087a8
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,19 @@
"Katex_Enabled_Description": "Allow using <a target=\"_blank\" href=\"http://khan.github.io/KaTeX/\">katex</a> for math typesetting in messages",
"Katex_Parenthesis_Syntax": "Allow Parenthesis Syntax",
"Katex_Parenthesis_Syntax_Description": "Allow using \\[katex block\\] and \\(inline katex\\) syntaxes",
"Keyboard_Shortcuts_Edit_Previous_Message": "Edit previous message",
"Keyboard_Shortcuts_Keys_1": "<kbd>Ctrl</kbd> + <kbd>p</kbd>",
"Keyboard_Shortcuts_Keys_2": "<kbd>Up Arrow</kbd>",
"Keyboard_Shortcuts_Keys_3": "<kbd>Command</kbd> (or <kbd>Alt</kbd>) + <kbd>Left Arrow</kbd>",
"Keyboard_Shortcuts_Keys_4": "<kbd>Command</kbd> (or <kbd>Alt</kbd>) + <kbd>Up Arrow</kbd>",
"Keyboard_Shortcuts_Keys_5": "<kbd>Command</kbd> (or <kbd>Alt</kbd>) + <kbd>Right Arrow</kbd>",
"Keyboard_Shortcuts_Keys_6": "<kbd>Command</kbd> (or <kbd>Alt</kbd>) + <kbd>Down Arrow</kbd>",
"Keyboard_Shortcuts_Keys_7": "<kbd>Shift</kbd> + <kbd>Enter</kbd>",
"Keyboard_Shortcuts_Move_To_Beginning_Of_Message": "Move to the beginning of the message",
"Keyboard_Shortcuts_Move_To_End_Of_Message": "Move to the end of the message",
"Keyboard_Shortcuts_Open_Channel_Slash_User_Search": "Open Channel / User search",
"Keyboard_Shortcuts_New_Line_In_Message": "New line in message compose input",
"Keyboard_Shortcuts_Title": "Keyboard Shortcuts",
"Knowledge_Base": "Knowledge Base",
"Label": "Label",
"Language": "Language",
Expand Down
10 changes: 10 additions & 0 deletions packages/rocketchat-lib/client/defaultTabBars.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ RocketChat.TabBar.addButton({
template: 'uploadedFilesList',
order: 3
});

RocketChat.TabBar.addButton({
groups: ['channel', 'privategroup', 'directmessage'],
id: 'keyboard-shortcut-list',
i18nTitle: 'Keyboard_Shortcuts_Title',
icon: 'keyboard',
template: 'keyboardShortcuts',
order: 4
});

8 changes: 8 additions & 0 deletions packages/rocketchat-theme/client/imports/general/base_old.css
Original file line number Diff line number Diff line change
Expand Up @@ -3495,6 +3495,14 @@ body:not(.is-cordova) {
opacity: 0;
}

& .section {
border: 1px solid #dddddd;
border-radius: 4px;
background-color: #ffffff;
padding: 20px;
margin: 20px;
}

& > .animated {
position: absolute;
top: 0;
Expand Down
48 changes: 48 additions & 0 deletions packages/rocketchat-ui-flextab/client/tabs/keyboardShortcuts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<template name="keyboardShortcuts">
<div class="content">
<div class="title"><h2>{{_ "Keyboard_Shortcuts_Title"}}</h2></div>

<div class="section">
<h2>{{_ "Keyboard_Shortcuts_Open_Channel_Slash_User_Search"}}</h2>
<hr />
<div>{{{_ "Keyboard_Shortcuts_Keys_1"}}}</div>
</div>

<div class="section">
<h2>{{_ "Keyboard_Shortcuts_Edit_Previous_Message"}}</h2>
<hr />
<div>{{{_ "Keyboard_Shortcuts_Keys_2"}}}</div>
</div>

<div class="section">
<h2>{{_ "Keyboard_Shortcuts_Move_To_Beginning_Of_Message"}}</h2>
<hr />
<div>{{{_ "Keyboard_Shortcuts_Keys_3"}}}</div>
</div>

<div class="section">
<h2>{{_ "Keyboard_Shortcuts_Move_To_Beginning_Of_Message"}}</h2>
<hr />
<div>{{{_ "Keyboard_Shortcuts_Keys_4"}}}</div>
</div>

<div class="section">
<h2>{{_ "Keyboard_Shortcuts_Move_To_End_Of_Message"}}</h2>
<hr />
<div>{{{_ "Keyboard_Shortcuts_Keys_5"}}}</div>
</div>

<div class="section">
<h2>{{_ "Keyboard_Shortcuts_Move_To_End_Of_Message"}}</h2>
<hr />
<div>{{{_ "Keyboard_Shortcuts_Keys_6"}}}</div>
</div>

<div class="section">
<h2>{{_ "Keyboard_Shortcuts_New_Line_In_Message"}}</h2>
<hr />
<div>{{{_ "Keyboard_Shortcuts_Keys_7"}}}</div>
</div>

</div> <!-- content -->
</template>
1 change: 1 addition & 0 deletions packages/rocketchat-ui-flextab/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ Package.onUse(function(api) {
api.addFiles('client/tabs/uploadedFilesList.js', 'client');
api.addFiles('client/tabs/userEdit.js', 'client');
api.addFiles('client/tabs/userInfo.js', 'client');
api.addFiles('client/tabs/keyboardShortcuts.html', 'client');
});
3 changes: 2 additions & 1 deletion packages/rocketchat-ui-master/public/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 78087a8

Please sign in to comment.