aboutsummaryrefslogtreecommitdiff
path: root/config/qutebrowser/greasemonkey/#gh-pr.js#
blob: 26d444a2d7fc80d4796c022806153709fd652d95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ==UserScript==
// @name               Github PR helper
// @namespace          phenax.github.io
// @version            0.0.0
// @description        Github PR helper
// @author             Akshay Nair
// @match              *://github.com/*/pull/*/files
// ==/UserScript==

const keys = {
  n: () => document.querySelector('.js-reviewed-toggle:not(.js-reviewed-file)').click(),
  N: () => Array.from(document.querySelectorAll('.js-reviewed-file')).slice(-1)[0].click(),
  //j: () => {
    //const $el = document.querySelector('.js-reviewed-toggle:not(.js-reviewed-file)');
    //if ($el) {
      
    //}
  //},
};
w
document.addEventListener('keydown', (e) => {
  console.log(e.key, e.ctrlKey);
  if (keys[e.key] && e.ctrlKey) {
    keys[e.key]();
  }
});