diff options
author | Marcel Amirault <mamirault@gitlab.com> | 2019-09-06 23:43:20 +0300 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2019-09-06 23:43:20 +0300 |
commit | 4361c89130fc2350be6ff79aaaf4bb3a55f83022 (patch) | |
tree | f854cd1978f9f2e046eb10a25b640daf8feec7da /app | |
parent | 14fe47cec7a82299b88fd9b7e61e99c1a90bbc17 (diff) |
Update keyboard shortcuts modal and doc
Add missing shortcuts, remove shortcuts that don't exist,
and reorder as needed
Diffstat (limited to 'app')
7 files changed, 159 insertions, 213 deletions
diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js index 7e3515b1f4b..66cb9fd7672 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js @@ -46,7 +46,6 @@ export default class Shortcuts { $(document).on('click.more_help', '.js-more-help-button', function clickMoreHelp(e) { $(this).remove(); - $('.hidden-shortcut').show(); e.preventDefault(); }); } @@ -104,7 +103,6 @@ export default class Shortcuts { return results; } - $('.hidden-shortcut').show(); return $('.js-more-help-button').remove(); }); } diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js index c8eb96a625c..f7b327b2af1 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js @@ -6,7 +6,7 @@ import { CopyAsGFM } from '../markdown/copy_as_gfm'; import { getSelectedFragment } from '~/lib/utils/common_utils'; export default class ShortcutsIssuable extends Shortcuts { - constructor(isMergeRequest) { + constructor() { super(); Mousetrap.bind('a', () => ShortcutsIssuable.openSidebarDropdown('assignee')); @@ -14,12 +14,6 @@ export default class ShortcutsIssuable extends Shortcuts { Mousetrap.bind('l', () => ShortcutsIssuable.openSidebarDropdown('labels')); Mousetrap.bind('r', ShortcutsIssuable.replyWithSelectedText); Mousetrap.bind('e', ShortcutsIssuable.editIssue); - - if (isMergeRequest) { - this.enabledHelp.push('.hidden-shortcut.merge_requests'); - } else { - this.enabledHelp.push('.hidden-shortcut.issues'); - } } static replyWithSelectedText() { diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts_navigation.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts_navigation.js index bef1553703b..b46b4132ba8 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts_navigation.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts_navigation.js @@ -23,7 +23,5 @@ export default class ShortcutsNavigation extends Shortcuts { Mousetrap.bind('g e', () => findAndFollowLink('.shortcuts-environments')); Mousetrap.bind('g l', () => findAndFollowLink('.shortcuts-metrics')); Mousetrap.bind('i', () => findAndFollowLink('.shortcuts-new-issue')); - - this.enabledHelp.push('.hidden-shortcut.project'); } } diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js index a88c280fa3b..3e791e4673a 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js @@ -11,7 +11,5 @@ export default class ShortcutsNetwork extends ShortcutsNavigation { Mousetrap.bind(['down', 'j'], graph.scrollDown); Mousetrap.bind(['shift+up', 'shift+k'], graph.scrollTop); Mousetrap.bind(['shift+down', 'shift+j'], graph.scrollBottom); - - this.enabledHelp.push('.hidden-shortcut.network'); } } diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts_wiki.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts_wiki.js index 208c91a1f08..8b7e6a56d25 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts_wiki.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts_wiki.js @@ -6,8 +6,6 @@ export default class ShortcutsWiki extends ShortcutsNavigation { constructor() { super(); Mousetrap.bind('e', ShortcutsWiki.editWiki); - - this.enabledHelp.push('.hidden-shortcut.wiki'); } static editWiki() { diff --git a/app/assets/stylesheets/framework/modal.scss b/app/assets/stylesheets/framework/modal.scss index fd9a75bc5b6..9c924559135 100644 --- a/app/assets/stylesheets/framework/modal.scss +++ b/app/assets/stylesheets/framework/modal.scss @@ -2,6 +2,12 @@ max-width: 98%; } +.modal-1040 { + @include media-breakpoint-up(xl) { + max-width: 1040px; + } +} + .modal-header { background-color: $modal-body-bg; diff --git a/app/views/help/_shortcuts.html.haml b/app/views/help/_shortcuts.html.haml index a996c86a256..f1ba804f920 100644 --- a/app/views/help/_shortcuts.html.haml +++ b/app/views/help/_shortcuts.html.haml @@ -1,5 +1,5 @@ #modal-shortcuts.modal{ tabindex: -1 } - .modal-dialog.modal-lg + .modal-dialog.modal-lg.modal-1040 .modal-content .modal-header %h4.modal-title @@ -11,104 +11,100 @@ .modal-body .row .col-lg-4 - %table.shortcut-mappings + %table.shortcut-mappings.text-2 %tbody %tr %th %th= _('Global Shortcuts') %tr %td.shortcut - %kbd s - %td= _('Focus Search') + %kbd ? + %td= _('Toggle this dialog') %tr %td.shortcut - %kbd f - %td= _('Focus Filter') + %kbd shift p + %td= _('Go to your projects') %tr %td.shortcut - %kbd p - %kbd b - %td= _('Toggle the Performance Bar') + %kbd shift g + %td= _('Go to your groups') %tr %td.shortcut - %kbd ? - %td= _('Show/hide this dialog') + %kbd shift a + %td= _('Go to the activity feed') %tr %td.shortcut - - if browser.platform.mac? - %kbd ⌘ shift p - - else - %kbd ctrl shift p - %td= _('Toggle Markdown preview') + %kbd shift l + %td= _('Go to the milestone list') %tr %td.shortcut - %kbd - %i.fa.fa-arrow-up - %td= _('Edit last comment (when focused on an empty textarea)') + %kbd shift s + %td= _('Go to your snippets') %tr %td.shortcut - %kbd shift t - %td - = _('Go to todos') + %kbd s + %td= _('Start search') %tr %td.shortcut - %kbd shift a - %td - = _('Go to the activity feed') + %kbd shift i + %td= _('Go to your issues') %tr %td.shortcut - %kbd shift p - %td - = _('Go to projects') + %kbd shift m + %td= _('Go to your merge requests') %tr %td.shortcut - %kbd shift i - %td - = _('Go to issues') + %kbd shift t + %td= _('Go to your To-Do list') %tr %td.shortcut - %kbd shift m - %td - = _('Go to merge requests') + %kbd p + %kbd b + %td= _('Toggle the Performance Bar') + %tbody %tr - %td.shortcut - %kbd shift g - %td - = _('Go to groups') + %th + %th= _('Web IDE') %tr %td.shortcut - %kbd shift l - %td - = _('Go to milestones') + - if browser.platform.mac? + %kbd ⌘ p + - else + %kbd ctrl p + %td= _('Go to file') %tr %td.shortcut - %kbd shift s - %td - = _('Go to snippets') + - if browser.platform.mac? + %kbd ⌘ enter + - else + %kbd ctrl enter + %td= _('Commit (when editing commit message)') %tbody %tr %th - %th= _('Finding Project File') + %th= _('Wiki pages') %tr %td.shortcut - %kbd - %i.fa.fa-arrow-up - %td= _('Move selection up') + %kbd e + %td= _('Edit wiki page') + %tbody %tr - %td.shortcut - %kbd - %i.fa.fa-arrow-down - %td= _('Move selection down') + %th + %th= _('Editing') %tr %td.shortcut - %kbd enter - %td= _('Open Selection') + - if browser.platform.mac? + %kbd ⌘ shift p + - else + %kbd ctrl shift p + %td= _('Toggle Markdown preview') %tr %td.shortcut - %kbd esc - %td= _('Go back') + %kbd + %i.fa.fa-arrow-up + %td= _('Edit your most recent comment in a thread (from an empty textarea)') .col-lg-4 - %table.shortcut-mappings + %table.shortcut-mappings.text-2 %tbody %tr %th @@ -117,105 +113,94 @@ %td.shortcut %kbd g %kbd p - %td - = _('Go to the project\'s overview page') + %td= _('Go to the project\'s overview page') %tr %td.shortcut %kbd g %kbd v - %td - = _('Go to the project\'s activity feed') + %td= _('Go to the project\'s activity feed') %tr %td.shortcut %kbd g - %kbd f - %td - = _('Go to files') + %kbd r + %td= _('Go to releases') %tr %td.shortcut %kbd g - %kbd c - %td - = _('Go to commits') + %kbd f + %td= _('Go to files') + %tr + %td.shortcut + %kbd t + %td= _('Go to find file') %tr %td.shortcut %kbd g - %kbd j - %td - = _('Go to jobs') + %kbd c + %td= _('Go to commits') %tr %td.shortcut %kbd g %kbd n - %td - = _('Go to network graph') + %td= _('Go to repository graph') %tr %td.shortcut %kbd g %kbd d - %td - = _('Go to repository charts') + %td= _('Go to repository charts') %tr %td.shortcut %kbd g %kbd i - %td - = _('Go to issues') + %td= _('Go to issues') + %tr + %td.shortcut + %kbd i + %td= _('New issue') %tr %td.shortcut %kbd g %kbd b - %td - = _('Go to issue boards') + %td= _('Go to issue boards') %tr %td.shortcut %kbd g %kbd m - %td - = _('Go to merge requests') + %td= _('Go to merge requests') %tr %td.shortcut %kbd g - %kbd e - %td - = _('Go to environments') + %kbd j + %td= _('Go to jobs') %tr %td.shortcut %kbd g %kbd l - %td - = _('Go to metrics') + %td= _('Go to metrics') + %tr + %td.shortcut + %kbd g + %kbd e + %td= _('Go to environments') %tr %td.shortcut %kbd g %kbd k - %td - = _('Go to kubernetes') + %td= _('Go to kubernetes') %tr %td.shortcut %kbd g %kbd s - %td - = _('Go to snippets') + %td= _('Go to snippets') %tr %td.shortcut %kbd g %kbd w - %td - = _('Go to wiki') - %tr - %td.shortcut - %kbd t - %td= _('Go to finding file') - %tr - %td.shortcut - %kbd i - %td= _('New issue') - + %td= _('Go to wiki') %tbody %tr %th - %th= _('Project Files browsing') + %th= _('Project Files') %tr %td.shortcut %kbd @@ -230,38 +215,87 @@ %td.shortcut %kbd enter %td= _('Open Selection') - %tbody %tr - %th - %th= _('Project File') + %td.shortcut + %kbd esc + %td= _('Go back (while searching for files') %tr %td.shortcut %kbd y - %td= _('Go to file permalink') + %td= _('Go to file permalink (while viewing a file)') + .col-lg-4 + %table.shortcut-mappings.text-2 %tbody %tr %th - %th= _('Web IDE') + %th= _('Issues / Merge Requests') + %tr + %td.shortcut + %kbd a + %td= _('Change assignee') + %tr + %td.shortcut + %kbd m + %td= _('Change milestone') + %tr + %td.shortcut + %kbd r + %td= _('Comment/Reply (quoting selected text)') + %tr + %td.shortcut + %kbd e + %td= _('Edit description') + %tr + %td.shortcut + %kbd l + %td= _('Change label') + %tr + %td.shortcut + %kbd ] + \/ + %kbd j + %td= _('Next file in diff (MRs only)') + %tr + %td.shortcut + %kbd [ + \/ + %kbd k + %td= _('Previous file in diff (MRs only)') %tr %td.shortcut - if browser.platform.mac? %kbd ⌘ p - else %kbd ctrl p - %td= _('Go to file') + %td= _('Go to file (MRs only)') %tr %td.shortcut - - if browser.platform.mac? - %kbd ⌘ enter - - else - %kbd ctrl enter - %td= _('Commit (when editing commit message)') - .col-lg-4 - %table.shortcut-mappings - %tbody.hidden-shortcut.network{ style: 'display:none' } + %kbd n + %td= _('Next unresolved discussion (MRs only)') + %tr + %td.shortcut + %kbd p + %td= _('Previous unresolved discussion (MRs only)') + %tbody %tr %th - %th= _('Network Graph') + %th= _('Epics (Ultimate / Gold license only)') + %tr + %td.shortcut + %kbd r + %td= _('Comment/Reply (quoting selected text)') + %tr + %td.shortcut + %kbd e + %td= _('Edit epic description') + %tr + %td.shortcut + %kbd l + %td= _('Change label') + %tbody + %tr + %th + %th= _('Repository Graph') %tr %td.shortcut %kbd @@ -295,92 +329,12 @@ %kbd shift %i.fa.fa-arrow-up - \/ - %kbd - shift k + \/ k %td= _('Scroll to top') %tr %td.shortcut %kbd shift %i.fa.fa-arrow-down - \/ - %kbd - shift j + \/ j %td= _('Scroll to bottom') - %tbody.hidden-shortcut.issues{ style: 'display:none' } - %tr - %th - %th= _('Issues') - %tr - %td.shortcut - %kbd a - %td= _('Change assignee') - %tr - %td.shortcut - %kbd m - %td= _('Change milestone') - %tr - %td.shortcut - %kbd r - %td= _('Reply (quoting selected text)') - %tr - %td.shortcut - %kbd e - %td= _('Edit issue') - %tr - %td.shortcut - %kbd l - %td= _('Change Label') - %tbody.hidden-shortcut.merge_requests{ style: 'display:none' } - %tr - %th - %th= _('Merge Requests') - %tr - %td.shortcut - %kbd a - %td= _('Change assignee') - %tr - %td.shortcut - %kbd m - %td= _('Change milestone') - %tr - %td.shortcut - %kbd r - %td= _('Reply (quoting selected text)') - %tr - %td.shortcut - %kbd e - %td= _('Edit merge request') - %tr - %td.shortcut - %kbd l - %td= _('Change Label') - %tr - %td.shortcut - %kbd ] - \/ - %kbd j - %td= _('Move to next file') - %tr - %td.shortcut - %kbd [ - \/ - %kbd k - %td= _('Move to previous file') - %tr - %td.shortcut - %kbd n - %td= _('Move to next unresolved discussion') - %tr - %td.shortcut - %kbd p - %td= _('Move to previous unresolved discussion') - %tbody.hidden-shortcut.wiki{ style: 'display:none' } - %tr - %th - %th= _('Wiki pages') - %tr - %td.shortcut - %kbd e - %td= _('Edit wiki page') |