mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Add "jump to table of content" keyboard shortcut
Summary: Many times when I'm reading a big diff, I want to go to the TOC. Add it. Test Plan: can navigate with 't'. It also shows up in '?' Revert Plan: Reviewers: epriestley, vrana Reviewed By: epriestley CC: nh, aran, Koolvin Differential Revision: https://secure.phabricator.com/D2335
This commit is contained in:
parent
160ec660b0
commit
6a9ef778fc
2 changed files with 29 additions and 21 deletions
|
@ -942,7 +942,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-behavior-differential-keyboard-navigation' =>
|
||||
array(
|
||||
'uri' => '/res/a3f05d5b/rsrc/js/application/differential/behavior-keyboard-nav.js',
|
||||
'uri' => '/res/93cdc365/rsrc/js/application/differential/behavior-keyboard-nav.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -2506,7 +2506,7 @@ celerity_register_resource_map(array(
|
|||
'uri' => '/res/pkg/a841d960/differential.pkg.css',
|
||||
'type' => 'css',
|
||||
),
|
||||
'e4ddcab5' =>
|
||||
70509835 =>
|
||||
array(
|
||||
'name' => 'differential.pkg.js',
|
||||
'symbols' =>
|
||||
|
@ -2530,7 +2530,7 @@ celerity_register_resource_map(array(
|
|||
16 => 'javelin-behavior-differential-dropdown-menus',
|
||||
17 => 'javelin-behavior-buoyant',
|
||||
),
|
||||
'uri' => '/res/pkg/e4ddcab5/differential.pkg.js',
|
||||
'uri' => '/res/pkg/70509835/differential.pkg.js',
|
||||
'type' => 'js',
|
||||
),
|
||||
'c8ce2d88' =>
|
||||
|
@ -2638,7 +2638,7 @@ celerity_register_resource_map(array(
|
|||
'aphront-typeahead-control-css' => '9c4e265b',
|
||||
'differential-changeset-view-css' => 'a841d960',
|
||||
'differential-core-view-css' => 'a841d960',
|
||||
'differential-inline-comment-editor' => 'e4ddcab5',
|
||||
'differential-inline-comment-editor' => '70509835',
|
||||
'differential-local-commits-view-css' => 'a841d960',
|
||||
'differential-revision-add-comment-css' => 'a841d960',
|
||||
'differential-revision-comment-css' => 'a841d960',
|
||||
|
@ -2651,21 +2651,21 @@ celerity_register_resource_map(array(
|
|||
'inline-comment-summary-css' => 'a841d960',
|
||||
'javelin-behavior' => '8a5de8a3',
|
||||
'javelin-behavior-aphront-basic-tokenizer' => '97f65640',
|
||||
'javelin-behavior-aphront-drag-and-drop' => 'e4ddcab5',
|
||||
'javelin-behavior-aphront-drag-and-drop-textarea' => 'e4ddcab5',
|
||||
'javelin-behavior-aphront-drag-and-drop' => '70509835',
|
||||
'javelin-behavior-aphront-drag-and-drop-textarea' => '70509835',
|
||||
'javelin-behavior-aphront-form-disable-on-submit' => '0c96375e',
|
||||
'javelin-behavior-audit-preview' => '5e68be89',
|
||||
'javelin-behavior-buoyant' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-accept-with-errors' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-add-reviewers-and-ccs' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-comment-jump' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-diff-radios' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-dropdown-menus' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-edit-inline-comments' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-feedback-preview' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-keyboard-navigation' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-populate' => 'e4ddcab5',
|
||||
'javelin-behavior-differential-show-more' => 'e4ddcab5',
|
||||
'javelin-behavior-buoyant' => '70509835',
|
||||
'javelin-behavior-differential-accept-with-errors' => '70509835',
|
||||
'javelin-behavior-differential-add-reviewers-and-ccs' => '70509835',
|
||||
'javelin-behavior-differential-comment-jump' => '70509835',
|
||||
'javelin-behavior-differential-diff-radios' => '70509835',
|
||||
'javelin-behavior-differential-dropdown-menus' => '70509835',
|
||||
'javelin-behavior-differential-edit-inline-comments' => '70509835',
|
||||
'javelin-behavior-differential-feedback-preview' => '70509835',
|
||||
'javelin-behavior-differential-keyboard-navigation' => '70509835',
|
||||
'javelin-behavior-differential-populate' => '70509835',
|
||||
'javelin-behavior-differential-show-more' => '70509835',
|
||||
'javelin-behavior-diffusion-commit-graph' => '5e68be89',
|
||||
'javelin-behavior-diffusion-pull-lastmodified' => '5e68be89',
|
||||
'javelin-behavior-maniphest-batch-selector' => '7707de41',
|
||||
|
@ -2675,12 +2675,12 @@ celerity_register_resource_map(array(
|
|||
'javelin-behavior-maniphest-transaction-preview' => '7707de41',
|
||||
'javelin-behavior-phabricator-autofocus' => '0c96375e',
|
||||
'javelin-behavior-phabricator-keyboard-shortcuts' => '0c96375e',
|
||||
'javelin-behavior-phabricator-object-selector' => 'e4ddcab5',
|
||||
'javelin-behavior-phabricator-object-selector' => '70509835',
|
||||
'javelin-behavior-phabricator-oncopy' => '0c96375e',
|
||||
'javelin-behavior-phabricator-tooltips' => '0c96375e',
|
||||
'javelin-behavior-phabricator-watch-anchor' => '0c96375e',
|
||||
'javelin-behavior-refresh-csrf' => '0c96375e',
|
||||
'javelin-behavior-repository-crossreference' => 'e4ddcab5',
|
||||
'javelin-behavior-repository-crossreference' => '70509835',
|
||||
'javelin-behavior-workflow' => '0c96375e',
|
||||
'javelin-dom' => '8a5de8a3',
|
||||
'javelin-event' => '8a5de8a3',
|
||||
|
@ -2706,7 +2706,7 @@ celerity_register_resource_map(array(
|
|||
'phabricator-core-buttons-css' => '9c4e265b',
|
||||
'phabricator-core-css' => '9c4e265b',
|
||||
'phabricator-directory-css' => '9c4e265b',
|
||||
'phabricator-drag-and-drop-file-upload' => 'e4ddcab5',
|
||||
'phabricator-drag-and-drop-file-upload' => '70509835',
|
||||
'phabricator-dropdown-menu' => '0c96375e',
|
||||
'phabricator-flag-css' => '9c4e265b',
|
||||
'phabricator-jump-nav' => '9c4e265b',
|
||||
|
@ -2718,7 +2718,7 @@ celerity_register_resource_map(array(
|
|||
'phabricator-prefab' => '0c96375e',
|
||||
'phabricator-project-tag-css' => '7839ae2d',
|
||||
'phabricator-remarkup-css' => '9c4e265b',
|
||||
'phabricator-shaped-request' => 'e4ddcab5',
|
||||
'phabricator-shaped-request' => '70509835',
|
||||
'phabricator-standard-page-view' => '9c4e265b',
|
||||
'phabricator-tooltip' => '0c96375e',
|
||||
'phabricator-transaction-view-css' => '9c4e265b',
|
||||
|
|
|
@ -197,6 +197,14 @@ JX.behavior('differential-keyboard-navigation', function(config) {
|
|||
.register();
|
||||
|
||||
|
||||
new JX.KeyboardShortcut('t', 'Jump to the table of contents.')
|
||||
.setHandler(function(manager) {
|
||||
var toc = JX.$('differential-review-toc');
|
||||
manager.scrollTo(toc);
|
||||
})
|
||||
.register();
|
||||
|
||||
|
||||
function inline_op(node, op) {
|
||||
if (!JX.DOM.scry(node, 'a', 'differential-inline-' + op)) {
|
||||
// No link for this operation, e.g. editing a comment you can't edit.
|
||||
|
|
Loading…
Reference in a new issue