Press This is a little tool that lets you grab bits of the web and create new posts with ease. It will even allow you to choose from images or videos included on the page and use them in your post. Use Press This as a quick and lightweight way to highlight another page on the web.
49
stars
22
forks
source link
It would be cool that upon displaying the Press-This Window, the cursor would either focus on `title-container` or `tinymce` #49
From an #a11y perspective, it is important to support users that mainly depend on keyboard input.
Currently when running the Press-This bookmarklet (I use it from https://wiert.wordpress.com with the latest Chrome browser) it is very unclear where the keyboard focus is: no cursor blinks, nothing is highlighted with "focus" indication.
When the Press-This Window shows, it takes two tab-key presses to get to the title-container and 3 more tab-key presses to get to tinymce (which itself is inside pressthis_ifr).
My own main usage workflow is that I always start in tinymce, so have to switch to a pointing device, then click there to get started or have to remember to press the tab-key exactly 5 times.
I think it would be really cool that when the Press-This Window shows, the keyboard focus would either be on the title-container or the tinymce.
I wish I would be more well-versed in JavaScript/PHP and having a local WordPress installation playground to be able to submit a pull request myself.
For now, I fiddled around a bit in the dev-console of Chrome and can leave only some notes for implementing this.
document.getElementById('title-container').focus(); gets the focus to title-container.
document.getElementById('tinymce').focus(); fails to get the focus to tinymce.
document.getElementById("pressthis_ifr").contentWindow.document.getElementById("tinymce").focus(); fails to get the focus to tinymce.
From an #a11y perspective, it is important to support users that mainly depend on keyboard input.
Currently when running the Press-This bookmarklet (I use it from https://wiert.wordpress.com with the latest Chrome browser) it is very unclear where the keyboard focus is: no cursor blinks, nothing is highlighted with "focus" indication.
When the Press-This Window shows, it takes two tab-key presses to get to the
title-container
and 3 more tab-key presses to get totinymce
(which itself is insidepressthis_ifr
).My own main usage workflow is that I always start in
tinymce
, so have to switch to a pointing device, then click there to get started or have to remember to press the tab-key exactly 5 times.I think it would be really cool that when the Press-This Window shows, the keyboard focus would either be on the
title-container
or thetinymce
.I wish I would be more well-versed in JavaScript/PHP and having a local WordPress installation playground to be able to submit a pull request myself.
For now, I fiddled around a bit in the dev-console of Chrome and can leave only some notes for implementing this.
document.getElementById('title-container').focus();
gets the focus totitle-container
.document.getElementById('tinymce').focus();
fails to get the focus totinymce
.document.getElementById("pressthis_ifr").contentWindow.document.getElementById("tinymce").focus();
fails to get the focus totinymce
.<script>
block needs to be added to https://github.com/WordPress/press-this/blob/trunk/class-wp-press-this-plugin.php which only fires a focus mechanism when the complete document and<iframe>
containingpressthis_ifr
are loaded.Hopefully these give a more seasoned WordPress developer enough information to implement something like this.