aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2022-07-21Add copyright noticeHEADv0.0.2masterTeddy Wing
I guess I didn't bother with this when I first wrote the script.
2022-07-20Increase version v0.0.1 -> v0.0.2Teddy Wing
2022-07-20Attach key event listener to `<html>` instead of `<body>`Teddy Wing
Recently I noticed that sometimes the shortcut didn't work. The CSS classes and HTML structure didn't change. The shortcut stopped working after a navigation action. Maybe Turbolinks replaces `<body>` now? Regardless, attaching the event listener to an element higher in the tree allows the shortcut to continue working even after navigation.
2017-09-29Add READMEv0.0.1Teddy Wing
Include a description of the problem and script, installation instructions, and license information.
2017-09-29Add license (GNU GPLv3+)Teddy Wing
2017-09-29Enable listener for all comment fields including future onesTeddy Wing
The keyboard shortcut now works on all comment fields, including those that are created after page load. Thanks to this Stack Overflow answer from 'adeneo' and Suraj Jain: https://stackoverflow.com/questions/20330945/how-to-addeventlistener-to-future-dom-elements/20331016#20331016 It takes advantage of the fact that JavaScript events bubble. We attach an event to `<body>`, which we can be sure will always be there (even across GitHub's Turbolinks), and in the keydown event listener check to see whether we were called on the right element.
2017-09-29Add a key event listener to open Preview pane on GitHub commentsTeddy Wing
Use Apple-Option-P to open the preview pane and toggle it closed. GitHub uses Apple-Shift-P by default to toggle the Preview pane. I need this new shortcut because Firefox uses Apple-Shift-P to open new private browsing windows, shadowing it from GitHub. This is the initial working version of this script. It doesn't currently support comment fields that are added to the page after page load.