Adding shortcut key tooltips to the quicktags butt
-
I have a hard time remembering what some of the shortcut keys are to the quicktags buttons in the post editor.
Sure, there’s a link to a help document, but it’s so inconvenient that you might as well just press the button. (Plus, the help file is quite wrong for 1.0.1. Alt+u is unordered list, not underline; alt+p is next page, not paragraph; link is alt+a, not alt+h; strikeout is not alt+s; close all tags is not alt+c.)
I modifiedquicktags.js
to display the keyboard shortcuts as button tooltips. Might something like this be added to future versions of WordPress?
<pre>
function edShowButton(button, i) {
var buttonTitle = (typeof(button.access) == “undefined” || button.access == ”)
? ”
: (‘title=”Alt+’ + button.access + ‘”‘);
if (button.id == ‘ed_img’) {
document.write(‘<input type=”button” id=”‘ + button.id + ‘” accesskey=”‘ + button.access + ‘” class=”ed_button” onclick=”edInsertImage(edCanvas);” value=”‘ + button.display + ‘” ‘ + buttonTitle + ‘ />’);
}
else if (button.id == ‘ed_link’) {
document.write(‘<input type=”button” id=”‘ + button.id + ‘” accesskey=”‘ + button.access + ‘” class=”ed_button” onclick=”edInsertLink(edCanvas, ‘ + i + ‘);” value=”‘ + button.display + ‘” ‘ + buttonTitle + ‘ />’);
}
else {
document.write(‘<input type=”button” id=”‘ + button.id + ‘” accesskey=”‘ + button.access + ‘” class=”ed_button” onclick=”edInsertTag(edCanvas, ‘ + i + ‘);” value=”‘ + button.display + ‘” ‘ + buttonTitle + ‘ />’);
}
}
</pre>
Also, I noticed that the “insert” and “delete” tags are assigned the same keyboard shortcut in WP 1.0.1.
- The topic ‘Adding shortcut key tooltips to the quicktags butt’ is closed to new replies.