@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make "/" focus the search input again

Summary:
See D1902, T989, T11263, D15984, T4103 , D15976, https://secure.phabricator.com/w/changelog/2016.22/, T2527, T11231, T8286, T11264 for discussion!

When we get another copy of T989, I will rename it to "Build a complicated keybinding settings page like a cool video game" and leave it open forever.

Test Plan: Pressed "/" in Firefox, had my pristine browsing experience inexplicably hijacked by this horrible application.

Reviewers: avivey, chad

Reviewed By: avivey

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15984

authored by

Aviv Eyal and committed by
epriestley
1a303e7d 444e3537

+31 -13
+10 -10
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => '2fbe65a2', 11 - 'core.pkg.js' => '49f8bdc0', 11 + 'core.pkg.js' => '1bcca0f3', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '3e81ae60', 14 14 'differential.pkg.js' => '634399e9', ··· 491 491 'rsrc/js/core/behavior-history-install.js' => '7ee2b591', 492 492 'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64', 493 493 'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0', 494 - 'rsrc/js/core/behavior-keyboard-shortcuts.js' => '7835f8c9', 494 + 'rsrc/js/core/behavior-keyboard-shortcuts.js' => '01fca1f0', 495 495 'rsrc/js/core/behavior-lightbox-attachments.js' => 'f8ba29d7', 496 496 'rsrc/js/core/behavior-line-linker.js' => '1499a8cb', 497 497 'rsrc/js/core/behavior-more.js' => 'a80d0378', ··· 654 654 'javelin-behavior-phabricator-gesture' => '3ab51e2c', 655 655 'javelin-behavior-phabricator-gesture-example' => '558829c2', 656 656 'javelin-behavior-phabricator-keyboard-pager' => 'a8da01f0', 657 - 'javelin-behavior-phabricator-keyboard-shortcuts' => '7835f8c9', 657 + 'javelin-behavior-phabricator-keyboard-shortcuts' => '01fca1f0', 658 658 'javelin-behavior-phabricator-line-linker' => '1499a8cb', 659 659 'javelin-behavior-phabricator-nav' => '56a1ca03', 660 660 'javelin-behavior-phabricator-notification-example' => '8ce821c5', ··· 921 921 'javelin-workflow', 922 922 'phabricator-draggable-list', 923 923 ), 924 + '01fca1f0' => array( 925 + 'javelin-behavior', 926 + 'javelin-workflow', 927 + 'javelin-json', 928 + 'javelin-dom', 929 + 'phabricator-keyboard-shortcut', 930 + ), 924 931 '031cee25' => array( 925 932 'javelin-behavior', 926 933 'javelin-request', ··· 1498 1505 'phabricator-prefab', 1499 1506 'multirow-row-manager', 1500 1507 'javelin-json', 1501 - ), 1502 - '7835f8c9' => array( 1503 - 'javelin-behavior', 1504 - 'javelin-workflow', 1505 - 'javelin-json', 1506 - 'javelin-dom', 1507 - 'phabricator-keyboard-shortcut', 1508 1508 ), 1509 1509 '7927a7d3' => array( 1510 1510 'javelin-behavior',
+9 -1
src/view/page/menu/PhabricatorMainMenuView.php
··· 186 186 } 187 187 188 188 $result = $search; 189 + $keyboard_config['searchID'] = $search->getID(); 189 190 } 190 191 191 - Javelin::initBehavior('phabricator-keyboard-shortcuts', $keyboard_config); 192 + $keyboard_config['pht'] = array( 193 + '/' => pht('Give keyboard focus to the search box.'), 194 + '?' => pht('Show keyboard shortcut help for the current page.'), 195 + ); 196 + 197 + Javelin::initBehavior( 198 + 'phabricator-keyboard-shortcuts', 199 + $keyboard_config); 192 200 193 201 if ($result) { 194 202 $result = id(new PHUIListItemView())
+12 -2
webroot/rsrc/js/core/behavior-keyboard-shortcuts.js
··· 11 11 * Define global keyboard shortcuts. 12 12 */ 13 13 JX.behavior('phabricator-keyboard-shortcuts', function(config) { 14 + var pht = JX.phtize(config.pht); 14 15 var workflow = null; 15 16 16 - var desc = 'Show keyboard shortcut help for the current page.'; 17 - new JX.KeyboardShortcut('?', desc) 17 + new JX.KeyboardShortcut('?', pht('?')) 18 18 .setHandler(function(manager) { 19 19 if (workflow) { 20 20 // Already showing the dialog. ··· 29 29 workflow.start(); 30 30 }) 31 31 .register(); 32 + 33 + if (config.searchID) { 34 + new JX.KeyboardShortcut('/', pht('/')) 35 + .setHandler(function() { 36 + var search = JX.$(config.searchID); 37 + search.focus(); 38 + search.select(); 39 + }) 40 + .register(); 41 + } 32 42 33 43 });