Created
May 20, 2021 16:47
-
-
Save jacekkopecky/f4110f8ac22d98a1e08e39f53a55be23 to your computer and use it in GitHub Desktop.
Custom javascript for github.com projects: In GitHub project boards, double click on a card, or select a card and press 'e' to edit it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// double click on a card, or select a card and press e, to edit it | |
document.addEventListener('keyup', (e) => { | |
if (e.key === 'e' && document.activeElement?.classList.contains('project-card')) { | |
const buttons = document.activeElement.querySelectorAll('details button[role=menuitem]'); | |
for (const btn of buttons) { | |
if (btn.textContent === 'Edit note') btn.click(); | |
} | |
} | |
}); | |
document.addEventListener('dblclick', (e) => { | |
if (document.activeElement?.classList.contains('project-card')) { | |
const buttons = document.activeElement.querySelectorAll('details button[role=menuitem]'); | |
for (const btn of buttons) { | |
if (btn.textContent === 'Edit note') btn.click(); | |
} | |
} | |
}); |
Thanks!
Works nicely, I've used Tampermonkey extension.
+1 Thanks! nice add-on shortcut 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Btw, I use this Chrome extension for inserting custom JS.