aboutsummaryrefslogtreecommitdiff
path: root/config/qutebrowser/greasemonkey/gh-pr.js
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-12-21 18:52:51 +0530
committerAkshay Nair <phenax5@gmail.com>2020-12-21 18:52:51 +0530
commitf1cf59ce2df9204f818cfd038538a2a31a5c2262 (patch)
tree35b0a21501615b7551514262b96e9d8113375cbc /config/qutebrowser/greasemonkey/gh-pr.js
parent6ff5a17adcf1ed72cd2f1c7bff606bdd3352b3bb (diff)
downloadnixos-config-f1cf59ce2df9204f818cfd038538a2a31a5c2262.tar.gz
nixos-config-f1cf59ce2df9204f818cfd038538a2a31a5c2262.zip
Adds qutebrowser config
Diffstat (limited to 'config/qutebrowser/greasemonkey/gh-pr.js')
-rw-r--r--config/qutebrowser/greasemonkey/gh-pr.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/config/qutebrowser/greasemonkey/gh-pr.js b/config/qutebrowser/greasemonkey/gh-pr.js
new file mode 100644
index 0000000..5803022
--- /dev/null
+++ b/config/qutebrowser/greasemonkey/gh-pr.js
@@ -0,0 +1,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) {
+
+ //}
+ //},
+};
+
+document.addEventListener('keydown', (e) => {
+ console.log(e.key, e.ctrlKey);
+ if (keys[e.key] && e.ctrlKey) {
+ keys[e.key]();
+ }
+});
+