<feed xmlns='http://www.w3.org/2005/Atom'>
<title>GitHub-Apple-Option-P-to-Preview, branch master</title>
<subtitle>A Greasemonkey script that activates Apple-Option-P as a GitHub comment preview shortcut</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/GitHub-Apple-Option-P-to-Preview/'/>
<entry>
<title>Add copyright notice</title>
<updated>2022-07-21T18:53:40+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-07-21T18:53:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/GitHub-Apple-Option-P-to-Preview/commit/?id=60dd527a0454604b6b3acd274e4f66d5b8f116b1'/>
<id>60dd527a0454604b6b3acd274e4f66d5b8f116b1</id>
<content type='text'>
I guess I didn't bother with this when I first wrote the script.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I guess I didn't bother with this when I first wrote the script.
</pre>
</div>
</content>
</entry>
<entry>
<title>Increase version v0.0.1 -&gt; v0.0.2</title>
<updated>2022-07-20T21:10:10+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-07-20T21:04:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/GitHub-Apple-Option-P-to-Preview/commit/?id=c6cc5b84d530b35cc55610ae2bdc26b5c7f6136c'/>
<id>c6cc5b84d530b35cc55610ae2bdc26b5c7f6136c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Attach key event listener to `&lt;html&gt;` instead of `&lt;body&gt;`</title>
<updated>2022-07-20T01:49:28+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-07-20T01:49:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/GitHub-Apple-Option-P-to-Preview/commit/?id=94c30fef65a1beb49e65860c7ed99964e9c162e2'/>
<id>94c30fef65a1beb49e65860c7ed99964e9c162e2</id>
<content type='text'>
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 `&lt;body&gt;` now?
Regardless, attaching the event listener to an element higher in the
tree allows the shortcut to continue working even after navigation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 `&lt;body&gt;` now?
Regardless, attaching the event listener to an element higher in the
tree allows the shortcut to continue working even after navigation.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add README</title>
<updated>2017-09-28T22:56:15+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-28T22:49:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/GitHub-Apple-Option-P-to-Preview/commit/?id=de8013b706108713397158ac0bb0ce8ed32015de'/>
<id>de8013b706108713397158ac0bb0ce8ed32015de</id>
<content type='text'>
Include a description of the problem and script, installation
instructions, and license information.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Include a description of the problem and script, installation
instructions, and license information.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add license (GNU GPLv3+)</title>
<updated>2017-09-28T22:56:15+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-28T22:29:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/GitHub-Apple-Option-P-to-Preview/commit/?id=221c6951a7447b2c588bcb69c150b289efcdefcb'/>
<id>221c6951a7447b2c588bcb69c150b289efcdefcb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Enable listener for all comment fields including future ones</title>
<updated>2017-09-28T22:56:13+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-28T22:22:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/GitHub-Apple-Option-P-to-Preview/commit/?id=6e9040f7ef45ef8262cdbebab719cd961c5b1147'/>
<id>6e9040f7ef45ef8262cdbebab719cd961c5b1147</id>
<content type='text'>
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 `&lt;body&gt;`, 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 `&lt;body&gt;`, 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a key event listener to open Preview pane on GitHub comments</title>
<updated>2017-09-28T22:10:21+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-28T22:10:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/GitHub-Apple-Option-P-to-Preview/commit/?id=a56fc2cdc16929216bea1db71b76641152a9c00b'/>
<id>a56fc2cdc16929216bea1db71b76641152a9c00b</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
