Make WordPress Core

Ticket #30450: 30450.patch

File 30450.patch, 1.9 KB (added by afercia, 10 years ago)
  • src/wp-admin/js/editor-expand.js

     
    858858                function fadeOut( event ) {
    859859                        var key = event && event.keyCode;
    860860
    861                         if ( key === 27 ) {
     861                        // fadeIn and return on Escape and keyboard shortcut Alt+Shift+F.
     862                        if ( key === 27 || ( event && ( event.altKey && event.shiftKey && 70 === key ) ) ) {
    862863                                fadeIn();
    863864                                return;
    864865                        }
     
    10171018                                        return $.contains( $el.get( 0 ), document.activeElement );
    10181019                                }
    10191020
    1020                                 // The focussed node is before or behind the editor area, and not ouside the wrap.
     1021                                // The focused node is before or behind the editor area, and not outside the wrap.
    10211022                                if ( ( position === 2 || position === 4 ) && ( hasFocus( $menuWrap ) || hasFocus( $wrap ) || hasFocus( $footer ) ) ) {
    10221023                                        fadeIn();
    10231024                                }
     
    10891090                                                button.active( false );
    10901091                                        } );
    10911092                                },
    1092                                 tooltip: 'Distraction Free Writing'
     1093                                tooltip: 'Distraction Free Writing',
     1094                                shortcut: 'Alt+Shift+F'
    10931095                        } );
     1096
     1097                        editor.addCommand( 'toggleFocusV2', toggle );
     1098                        editor.addShortcut( 'alt+shift+f', '', 'toggleFocusV2' );
    10941099                } );
    10951100
     1101                $document.on( 'keydown.focus', toggleViaKeyboard );
     1102
     1103                function toggleViaKeyboard( event ) {
     1104                        var key = event && event.keyCode;
     1105
     1106                        if ( event.altKey && event.shiftKey && 70 === key ) {
     1107                                toggle();
     1108                        }
     1109                }
     1110
    10961111                $document.on( 'tinymce-editor-init.focus', function( event, editor ) {
    10971112                        var mceBind, mceUnbind;
    10981113
     
    11281143
    11291144                                $document.on( 'dfw-on.focus', mceBind ).on( 'dfw-off.focus', mceUnbind );
    11301145
    1131                                 // Make sure the body focusses when clicking outside it.
     1146                                // Make sure the body focuses when clicking outside it.
    11321147                                editor.on( 'click', function( event ) {
    11331148                                        if ( event.target === editor.getDoc().documentElement ) {
    11341149                                                editor.focus();