X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..b925718b4bf2dd47a8429f844d0a255ca6e35bd1:/wp-admin/js/editor-expand.js diff --git a/wp-admin/js/editor-expand.js b/wp-admin/js/editor-expand.js index db7561e6..ba5b0952 100644 --- a/wp-admin/js/editor-expand.js +++ b/wp-admin/js/editor-expand.js @@ -15,7 +15,7 @@ $visualEditor = $(), $textTop = $( '#ed_toolbar' ), $textEditor = $( '#content' ), - $textEditorClone = $( '
' ), + $textEditorClone = $( '
' ), $bottom = $( '#post-status-info' ), $menuBar = $(), $statusBar = $(), @@ -887,10 +887,15 @@ } function fadeOut( event ) { - var key = event && event.keyCode; + var isMac, + key = event && event.keyCode; - // fadeIn and return on Escape and keyboard shortcut Alt+Shift+W. - if ( key === 27 || ( key === 87 && event.altKey && event.shiftKey ) ) { + if ( window.navigator.platform ) { + isMac = ( window.navigator.platform.indexOf( 'Mac' ) > -1 ); + } + + // fadeIn and return on Escape and keyboard shortcut Alt+Shift+W and Ctrl+Opt+W. + if ( key === 27 || ( key === 87 && event.altKey && ( ( ! isMac && event.shiftKey ) || ( isMac && event.ctrlKey ) ) ) ) { fadeIn( event ); return; } @@ -1143,7 +1148,7 @@ } ); editor.addCommand( 'wpToggleDFW', toggle ); - editor.addShortcut( 'alt+shift+w', '', 'wpToggleDFW' ); + editor.addShortcut( 'access+w', '', 'wpToggleDFW' ); } ); $document.on( 'tinymce-editor-init.focus', function( event, editor ) { @@ -1184,7 +1189,7 @@ $document.on( 'dfw-on.focus', mceBind ).on( 'dfw-off.focus', mceUnbind ); // Make sure the body focuses when clicking outside it. - editor.on( 'click', function( event ) { + editor.on( 'click', function( event ) { if ( event.target === editor.getDoc().documentElement ) { editor.focus(); }