]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/editor-expand.js
Wordpress 4.5.3-scripts
[autoinstalls/wordpress.git] / wp-admin / js / editor-expand.js
index db7561e62a843fa7a8233a1c871367da09fbf031..ba5b095203aefa014c8bdc67fcba40f309947e71 100644 (file)
@@ -15,7 +15,7 @@
                        $visualEditor = $(),
                        $textTop = $( '#ed_toolbar' ),
                        $textEditor = $( '#content' ),
-                       $textEditorClone = $( '<div id="content-textarea-clone"></div>' ),
+                       $textEditorClone = $( '<div id="content-textarea-clone" class="wp-exclude-emoji"></div>' ),
                        $bottom = $( '#post-status-info' ),
                        $menuBar = $(),
                        $statusBar = $(),
                }
 
                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;
                        }
                        } );
 
                        editor.addCommand( 'wpToggleDFW', toggle );
-                       editor.addShortcut( 'alt+shift+w', '', 'wpToggleDFW' );
+                       editor.addShortcut( 'access+w', '', 'wpToggleDFW' );
                } );
 
                $document.on( 'tinymce-editor-init.focus', function( event, editor ) {
                                $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();
                                        }