TinyMCE: update the keyboard shortcuts: Alt + letter for Firefox and WebKit, Alt + Shift + letter for IE and Opera, add shortcut for DFW (Alt + W), see #21214, fixes #21197, fixes #17992

git-svn-id: http://core.svn.wordpress.org/trunk@21266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz
2012-07-13 00:26:49 +00:00
parent ff55b09c92
commit 544b4a1a25
6 changed files with 133 additions and 133 deletions

View File

@@ -9,7 +9,7 @@
mceTout : 0,
init : function(ed, url) {
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick;
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key;
moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
@@ -74,7 +74,6 @@
return;
tb_show('', link.href);
tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
});
// Register buttons
@@ -250,30 +249,32 @@
t._handleMoreBreak(ed, url);
// Add custom shortcuts
ed.addShortcut('alt+shift+c', ed.getLang('justifycenter_desc'), 'JustifyCenter');
ed.addShortcut('alt+shift+r', ed.getLang('justifyright_desc'), 'JustifyRight');
ed.addShortcut('alt+shift+l', ed.getLang('justifyleft_desc'), 'JustifyLeft');
ed.addShortcut('alt+shift+j', ed.getLang('justifyfull_desc'), 'JustifyFull');
ed.addShortcut('alt+shift+q', ed.getLang('blockquote_desc'), 'mceBlockQuote');
ed.addShortcut('alt+shift+u', ed.getLang('bullist_desc'), 'InsertUnorderedList');
ed.addShortcut('alt+shift+o', ed.getLang('numlist_desc'), 'InsertOrderedList');
ed.addShortcut('alt+shift+d', ed.getLang('striketrough_desc'), 'Strikethrough');
ed.addShortcut('alt+shift+n', ed.getLang('spellchecker.desc'), 'mceSpellCheck');
ed.addShortcut('alt+shift+a', ed.getLang('link_desc'), 'mceLink');
ed.addShortcut('alt+shift+s', ed.getLang('unlink_desc'), 'unlink');
ed.addShortcut('alt+shift+m', ed.getLang('image_desc'), 'WP_Medialib');
ed.addShortcut('alt+shift+g', ed.getLang('fullscreen.desc'), 'mceFullScreen');
ed.addShortcut('alt+shift+z', ed.getLang('wp_adv_desc'), 'WP_Adv');
ed.addShortcut('alt+shift+h', ed.getLang('help_desc'), 'WP_Help');
ed.addShortcut('alt+shift+t', ed.getLang('wp_more_desc'), 'WP_More');
ed.addShortcut('alt+shift+p', ed.getLang('wp_page_desc'), 'WP_Page');
ed.addShortcut('ctrl+s', ed.getLang('save_desc'), function(){if('function'==typeof autosave)autosave();});
mod_key = 'alt';
if ( tinymce.isWebKit ) {
ed.addShortcut('alt+shift+b', ed.getLang('bold_desc'), 'Bold');
ed.addShortcut('alt+shift+i', ed.getLang('italic_desc'), 'Italic');
}
if ( tinymce.isIE || tinymce.isOpera )
mod_key = 'shift+alt';
ed.addShortcut(mod_key + '+c', 'justifycenter_desc', 'JustifyCenter');
ed.addShortcut(mod_key + '+r', 'justifyright_desc', 'JustifyRight');
ed.addShortcut(mod_key + '+l', 'justifyleft_desc', 'JustifyLeft');
ed.addShortcut(mod_key + '+j', 'justifyfull_desc', 'JustifyFull');
ed.addShortcut(mod_key + '+q', 'blockquote_desc', 'mceBlockQuote');
ed.addShortcut(mod_key + '+u', 'bullist_desc', 'InsertUnorderedList');
ed.addShortcut(mod_key + '+o', 'numlist_desc', 'InsertOrderedList');
ed.addShortcut(mod_key + '+n', 'spellchecker.desc', 'mceSpellCheck');
ed.addShortcut(mod_key + '+a', 'link_desc', 'WP_Link');
ed.addShortcut(mod_key + '+s', 'unlink_desc', 'unlink');
ed.addShortcut(mod_key + '+m', 'image_desc', 'WP_Medialib');
ed.addShortcut(mod_key + '+z', 'wordpress.wp_adv_desc', 'WP_Adv');
ed.addShortcut(mod_key + '+t', 'wordpress.wp_more_desc', 'WP_More');
ed.addShortcut(mod_key + '+d', 'striketrough_desc', 'Strikethrough');
ed.addShortcut(mod_key + '+h', 'help_desc', 'WP_Help');
ed.addShortcut(mod_key + '+p', 'wordpress.wp_page_desc', 'WP_Page');
ed.addShortcut(mod_key + '+w', 'wordpress.wp_fullscreen_desc', 'wpFullScreen');
ed.addShortcut(mod_key + '+g', 'fullscreen.desc', 'mceFullScreen');
ed.addShortcut('ctrl+s', 'save_desc', function(){if('function'==typeof autosave)autosave();});
// popup buttons for images and the gallery
ed.onInit.add(function(ed) {
tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) {
ed.plugins.wordpress._hideButtons();