Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Adds a Keyboard Shortcut option to the flextab #5902

Merged
merged 11 commits into from
Aug 22, 2017
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 @@ -797,6 +797,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: 'icon-keyboard',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karlprieb Please fix this icon on new design

template: 'keyboardShortcuts',
order: 4
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep adding newlines to this file, and @codacy-bot keeps complaining.


8 changes: 8 additions & 0 deletions packages/rocketchat-theme/client/imports/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -3262,6 +3262,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');
});