WordPress.org

Ready to get started?Download WordPress

Forums

Adding shortcut key tooltips to the quicktags butt (3 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    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 modified quicktags.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.

  2. bdwelle
    Member
    Posted 10 years ago #

    Great idea, although the tooltops don't seem to work for me in Firefox.
    Btw, the list of quicktags (and some of, but not all, their accel keys) is here:
    http://wordpress.org/docs/reference/post/#quicktags
    One that bugs me is alt-d to insert date/time. It conflicts with my preferred alt-d to access the browser address bar, so I've disabled it.

  3. bdwelle
    Member
    Posted 10 years ago #

    I take it back, it does work in Firefox, I just had to force reload quicktags.js

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.