├── LICENSE ├── README.md └── shortcuts.js /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 John Sandall 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Keyboard shortcuts for Phabricator 2 | 3 | [Phabricator](http://phabricator.org) is a suite of open source tools for peer code review, task management, and project communication. Its keyboard shortcuts are generally pretty terrible, especially when compared to other web apps for task management. 4 | 5 | This project uses the [Shortcut Manager extension](https://chrome.google.com/webstore/detail/shortcut-manager/mgjjeipcdnnjhgodgjpfkffcejoljijf) for Google Chrome. 6 | 7 | ####Instructions 8 | 1. Get the [Shortcut Manager extension](https://chrome.google.com/webstore/detail/shortcut-manager/mgjjeipcdnnjhgodgjpfkffcejoljijf). 9 | 2. Go to the settings page. 10 | 3. Click "Import settings". 11 | 4. Select all, then copy/paste everything from this file into the textbox: `https://raw.githubusercontent.com/john-sandall/phabricator-shortcuts/master/shortcuts.js` 12 | 5. Hit "Done", hopefully it worked! 13 | 14 | ####Examples 15 | **Change status in Maniphest:** 16 | 17 | * Typing `s r` (`s` then `r`) closes task as resolved 18 | * Typing `s w` (`s` then `r`) closes task as wontfix 19 | * Typing `s i` (`s` then `r`) closes task as invalid 20 | * Typing `s s` (`s` then `r`) closes task as spite 21 | * Typing `s o` (`s` then `r`) reopens the task 22 | 23 | ####Caveats 24 | These shortcuts will only work for you if your Phabricator instance is hosted on a subdomain, i.e. URL looks like `https://phabricator.example.com`. If this is not true you will need to change the "URL patterns" field on each shortcut. -------------------------------------------------------------------------------- /shortcuts.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @ShortcutManager 3 | // @name 4 | // @namespace iv4aMErvzrgV 5 | // @key 6 | // @include * 7 | // @execute OpenAPage() 8 | // ==/UserScript== 9 | 10 | // ==UserScript== 11 | // @ShortcutManager 12 | // @name Maniphest - status resolved 13 | // @namespace iv4aMErvzrgV 14 | // @key s r 15 | // @include https://phabricator.* 16 | // ==/UserScript== 17 | javascript: 18 | document.getElementById('transaction-action').value = 'status'; 19 | document.getElementById('resolution').style['display'] = ''; 20 | document.getElementById('UQ0_4').value = 'resolved'; 21 | document.querySelectorAll("[action='/maniphest/transaction/save/']")[0].submit(); 22 | 23 | 24 | 25 | // ==UserScript== 26 | // @ShortcutManager 27 | // @name Maniphest - status wontfix 28 | // @namespace iv4aMErvzrgV 29 | // @key s w 30 | // @include https://phabricator.* 31 | // ==/UserScript== 32 | javascript: 33 | document.getElementById('transaction-action').value = 'status'; 34 | document.getElementById('resolution').style['display'] = ''; 35 | document.getElementById('UQ0_4').value = 'wontfix'; 36 | document.querySelectorAll("[action='/maniphest/transaction/save/']")[0].submit(); 37 | 38 | 39 | 40 | // ==UserScript== 41 | // @ShortcutManager 42 | // @name Maniphest - status invalid 43 | // @namespace iv4aMErvzrgV 44 | // @key s i 45 | // @include https://phabricator.* 46 | // ==/UserScript== 47 | javascript: 48 | document.getElementById('transaction-action').value = 'status'; 49 | document.getElementById('resolution').style['display'] = ''; 50 | document.getElementById('UQ0_4').value = 'invalid'; 51 | document.querySelectorAll("[action='/maniphest/transaction/save/']")[0].submit(); 52 | 53 | 54 | 55 | // ==UserScript== 56 | // @ShortcutManager 57 | // @name Maniphest - status spite 58 | // @namespace iv4aMErvzrgV 59 | // @key s s 60 | // @include https://phabricator.* 61 | // ==/UserScript== 62 | javascript: 63 | document.getElementById('transaction-action').value = 'status'; 64 | document.getElementById('resolution').style['display'] = ''; 65 | document.getElementById('UQ0_4').value = 'spite'; 66 | document.querySelectorAll("[action='/maniphest/transaction/save/']")[0].submit(); 67 | 68 | 69 | 70 | // ==UserScript== 71 | // @ShortcutManager 72 | // @name Maniphest - status open 73 | // @namespace iv4aMErvzrgV 74 | // @key s o 75 | // @include https://phabricator.* 76 | // ==/UserScript== 77 | javascript: 78 | document.getElementById('transaction-action').value = 'status'; 79 | document.getElementById('resolution').style['display'] = ''; 80 | document.getElementById('UQ0_4').value = 'open'; 81 | document.querySelectorAll("[action='/maniphest/transaction/save/']")[0].submit(); 82 | --------------------------------------------------------------------------------