WordPress.org

Make WordPress Core

Ticket #23630: 23630.diff

File 23630.diff, 16.1 KB (added by lessbloat, 4 months ago)
  • wp-includes/css/editor.css

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    388388.wp_themeSkin .mceSplitButton .mce_spellchecker span.mce_spellchecker, 
    389389.wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor, 
    390390.wp_themeSkin .mceSplitButton span.mce_numlist, 
    391 .wp_themeSkin .mceSplitButton span.mce_bullist { 
     391.wp_themeSkin .mceSplitButton span.mce_bullist, 
     392.fullscreen-mode span.mce_wp_fullscreen { 
    392393        background-image: url('../images/wpicons.png?ver=20120720'); 
    393394} 
    394395 
     
    704705.wp_themeSkin .mce_forecolorpicker {background-position:-320px -20px} 
    705706 
    706707/* Plugins in WP */ 
    707 .wp_themeSkin span.mce_fullscreen {background-position:-240px -20px} 
     708.wp_themeSkin span.mce_fullscreen, {background-position:-240px -20px} 
    708709.wp_themeSkin .mceButtonEnabled:hover span.mce_fullscreen, 
    709710.wp_themeSkin .mceButtonActive span.mce_fullscreen {background-position:-240px 0} 
    710711 
    711 .wp_themeSkin span.mce_wp_fullscreen {background-position:-240px -20px} 
     712.wp_themeSkin span.mce_wp_fullscreen, .fullscreen-mode span.mce_wp_fullscreen {background-position:-240px -20px} 
    712713.wp_themeSkin .mceButtonEnabled:hover span.mce_wp_fullscreen, 
    713 .wp_themeSkin .mceButtonActive span.mce_wp_fullscreen {background-position:-240px 0} 
     714.wp_themeSkin .mceButtonActive span.mce_wp_fullscreen, 
     715.fullscreen-mode span.mce_wp_fullscreen:hover {background-position:-240px 0} 
     716.fullscreen-view .fullscreen-mode span.mce_wp_fullscreen {background-position:-560px -20px} 
    714717 
    715718.wp_themeSkin span.mce_media {background-position:-400px -20px} 
    716719.wp_themeSkin .mceButtonEnabled:hover span.mce_media, 
     
    11681171        background-color: #ccc; 
    11691172} 
    11701173 
     1174.fullscreen-mode { 
     1175        position: absolute; 
     1176        right: 8px; 
     1177        top: 3px; 
     1178        display: block; 
     1179        width: 20px; 
     1180        height: 20px; 
     1181        cursor: default; 
     1182        padding: 1px 2px; 
     1183        margin: 1px; 
     1184        -webkit-border-radius: 2px; 
     1185        border-radius: 2px; 
     1186        border-style: solid; 
     1187        border-width: 1px; 
     1188        border-color: transparent; 
     1189} 
     1190 
     1191.fullscreen-mode:hover { 
     1192        background: #eee; 
     1193        background-image: -webkit-gradient(linear, left bottom, left top, from(#e5e5e5), to(#fff)); 
     1194        background-image: -webkit-linear-gradient(bottom, #e5e5e5, #fff); 
     1195        background-image:    -moz-linear-gradient(bottom, #e5e5e5, #fff); 
     1196        background-image:      -o-linear-gradient(bottom, #e5e5e5, #fff); 
     1197        background-image: linear-gradient(to top, #e5e5e5, #fff); 
     1198        border-color: #bbb; 
     1199} 
     1200 
     1201.fullscreen-mode span.mce_wp_fullscreen { 
     1202        display: block; 
     1203        height: 20px; 
     1204        width: 20px; 
     1205} 
     1206 
     1207.rtl .fullscreen-mode { 
     1208        left: 8px; 
     1209        right: auto; 
     1210} 
     1211 
     1212.no-js .fullscreen-mode { 
     1213        display: none; 
     1214} 
     1215 
    11711216/*------------------------------------------------------------------------------ 
    11721217 wp-link 
    11731218------------------------------------------------------------------------------*/ 
     
    14321477 * 
    14331478 * http://docs.jquery.com/UI/Dialog#theming 
    14341479 */ 
    1435 .wp-dialog { position: absolute; width: 300px; overflow: hidden; } 
     1480.wp-dialog { position: absolute; width: 300px; overflow: hidden; z-index: 150001 } 
    14361481.wp-dialog .ui-dialog-titlebar { position: relative; } 
    14371482.wp-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } 
    14381483.wp-dialog .ui-dialog-content { position: relative; border: 0; padding: 0; background: none; overflow: auto; zoom: 1; } 
     
    20712116        .wp_themeSkin .mceSplitButton .mce_spellchecker span.mce_spellchecker, 
    20722117        .wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor, 
    20732118        .wp_themeSkin .mceSplitButton span.mce_numlist, 
    2074         .wp_themeSkin .mceSplitButton span.mce_bullist { 
     2119        .wp_themeSkin .mceSplitButton span.mce_bullist, 
     2120        .fullscreen-mode span.mce_wp_fullscreen { 
    20752121                background-image: url('../images/wpicons-2x.png?ver=20120720'); 
    2076                 background-size: 560px 40px; 
     2122                background-size: 582px 40px; 
    20772123        } 
    20782124 
    20792125        .wp-media-buttons .add_media span.wp-media-buttons-icon, 
  • wp-includes/class-wp-editor.php

     
    142142                        echo "</div>\n"; 
    143143                } 
    144144 
    145                 $the_editor = apply_filters('the_editor', '<div id="wp-' . $editor_id . '-editor-container" class="wp-editor-container"><textarea' . $editor_class . $height . $tabindex . ' cols="40" name="' . $set['textarea_name'] . '" id="' . $editor_id . '">%s</textarea></div>'); 
     145                $the_editor = apply_filters('the_editor', '<div id="wp-' . $editor_id . '-editor-container" class="wp-editor-container"><a role="button" href="#" class="mceButton mceButtonEnabled fullscreen-mode" aria-labelledby="content_wp_fullscreen_voice" title="Distraction Free Writing mode (Alt + Shift + W)" tabindex="-1"><span  class="mceIcon mce_wp_fullscreen"></span><span class="mceVoiceLabel mceIconOnly" style="display: none;" id="content_wp_fullscreen_voice">Distraction Free Writing mode (Alt + Shift + W)</span></a><textarea' . $editor_class . $height . $tabindex . ' cols="40" name="' . $set['textarea_name'] . '" id="' . $editor_id . '">%s</textarea></div>'); 
    146146                $content = apply_filters('the_editor_content', $content); 
    147147 
    148148                printf($the_editor, $content); 
  • wp-admin/includes/ajax-actions.php

     
    13791379        global $wp_list_table; 
    13801380 
    13811381        check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' ); 
    1382          
     1382 
    13831383        $post_data = wp_unslash( $_POST ); 
    13841384 
    13851385        $taxonomy = sanitize_key( $post_data['taxonomy'] ); 
     
    17621762                $last_edited = sprintf( __('Last edited on %1$s at %2$s'), $last_date, $last_time ); 
    17631763        } 
    17641764 
    1765         echo json_encode( array( 'message' => $message, 'last_edited' => $last_edited ) ); 
     1765        echo json_encode( array( 'id' => $post_id, 'message' => $message, 'last_edited' => $last_edited ) ); 
    17661766        wp_die(); 
    17671767} 
    17681768 
  • wp-admin/js/wp-fullscreen.js

     
     1if ( ! window.WP ) { window.WP = {}; } 
     2WP.Fullscreen = function ( $ ) { 
     3        var fadeOut, 
     4                isRtl = ( $( 'body' ).hasClass( 'rtl' ) ), 
     5                mouseMovePause = false 
     6                oldheight = 0, 
     7                postBodyContent = $( '#wp-content-wrap' ), 
     8                sidePostbox = $( '#postbox-container-1' ), 
     9                textAreaResizePause = false, 
     10                titleBox = $( '#titlediv' ), 
     11                titleBoxHeight = titleBox.height(); 
     12 
     13        function clearFadeOut () { 
     14                clearTimeout(fadeOut); 
     15                fadeOut = 0; 
     16        } 
     17        function editorEventsOff () { 
     18                if ( typeof tinymce != 'undefined' && tinymce.activeEditor ) { 
     19                        tinymce.activeEditor.dom.unbind( tinymce.activeEditor.dom.doc, 'mousemove' ); 
     20                        tinymce.activeEditor.dom.unbind( tinymce.activeEditor.dom.doc, 'mouseleave' ); 
     21                        tinymce.activeEditor.dom.unbind( tinymce.activeEditor.dom.doc, 'click' ); 
     22                        tinymce.activeEditor.dom.unbind( tinymce.activeEditor.dom.doc, 'keypress' ); 
     23                        window.tinyMCE.activeEditor.dom.setStyle(window.tinyMCE.activeEditor.dom.select('body'), 'overflow', 'auto' ); 
     24                        window.tinyMCE.activeEditor.dom.setStyle(window.tinyMCE.activeEditor.dom.select('body'), 'height', '300px' ); 
     25                        $( '#content_ifr' ).css( 'height', '300px' ); 
     26                } 
     27                $( '#content' ).off( 'mousemove mouseleave click' ).css( 'height', '300px' ); 
     28                $( document ).off( 'keydown' ); 
     29        } 
     30        function editorEventsOn () { 
     31                editorEventsOff(); 
     32 
     33                // Give tinymce.activeEditor a chance to set 
     34                setTimeout(function () { 
     35                        if ( typeof tinymce != 'undefined' && tinymce.activeEditor ) { 
     36                                tinymce.activeEditor.dom.bind( tinymce.activeEditor.dom.doc, 'mousemove', function( e ){ 
     37                                        fadeInThrottle(); 
     38                                        fadeOutFullscreen(); 
     39                                }); 
     40                                tinymce.activeEditor.dom.bind( tinymce.activeEditor.dom.doc, 'mouseleave', function( e ){ 
     41                                        clearFadeOut(); 
     42                                }); 
     43                                tinymce.activeEditor.dom.bind( tinymce.activeEditor.dom.doc, 'click', function( e ){ 
     44                                        fadeOutFullscreen(); 
     45                                }); 
     46                                tinymce.activeEditor.dom.bind( tinymce.activeEditor.dom.doc, 'keydown', function( e ){ 
     47                                        if ( 27 === e.keyCode ) { 
     48                                                fadeInFullscreen(); 
     49                                                hideFullscreenMode(); 
     50                                                return; 
     51                                        } 
     52                                        resizeEditor( $( tinymce.activeEditor.dom.doc ).find( 'body' ), 'visual' ); 
     53                                }); 
     54                                window.tinyMCE.activeEditor.dom.setStyle(window.tinyMCE.activeEditor.dom.select('body'), 'overflow', 'hidden' ); 
     55                        } 
     56                        $( '#content' ).on( 'mousemove', function () { 
     57                                fadeInThrottle(); 
     58                                fadeOutFullscreen(); 
     59                        }).on( 'mouseleave', function () { 
     60                                clearFadeOut(); 
     61                        }).on( 'click', function () { 
     62                                fadeOutFullscreen(); 
     63                        }).on( 'keypress paste', function () { 
     64                                setTimeout( function () { resizeEditor( $( '#content' ), 'text' ); }, 30); 
     65                        }).css( 'overflow', 'hidden' ); 
     66                        editorSetFocus(); 
     67                        // Exit with esc key 
     68                        $( document ).on( 'keydown', function ( e ) { 
     69                                if ( 27 !== e.keyCode ) 
     70                                        return; 
     71                                fadeInFullscreen(); 
     72                                hideFullscreenMode(); 
     73                        }); 
     74                }, 300); 
     75        } 
     76        function editorSetFocus () { 
     77                if ( typeof tinymce != 'undefined' && tinymce.activeEditor ) 
     78                        tinymce.activeEditor.focus(); 
     79                else 
     80                        $( '#content' ).focus(); 
     81        } 
     82        function fadeInFullscreen() { 
     83                $( '#wp-content-editor-tools, #edit-slug-box, .mceToolbar, .quicktags-toolbar, .fullscreen-mode, .mceStatusbar, #postbox-container-1, #post-status-info, #content-resize-handle' ).css( { opacity: 100 } ); 
     84                $( '.wp-editor-container' ).css( { borderColor: '#ccc #ccc #dfdfdf' } ); 
     85        } 
     86        function fadeInThrottle () { 
     87                if ( ! mouseMovePause ) { 
     88                        mouseMovePause = true; 
     89                        fadeInFullscreen(); 
     90                        setTimeout( function () { mouseMovePause = false; }, 300 ) 
     91                } 
     92        } 
     93        function fadeOutFullscreen () { 
     94                clearFadeOut(); 
     95                fadeOut = setTimeout(function() { 
     96                        $( '#wp-content-editor-tools, #edit-slug-box, .mceToolbar, .quicktags-toolbar, .fullscreen-mode, .mceStatusbar, #postbox-container-1, #post-status-info, #content-resize-handle' ).animate( { opacity: 0 }, 600 ); 
     97                        $( '.wp-editor-container' ).animate( { borderColor: '#fff' }, 600 ); 
     98                }, 1000); 
     99        } 
     100        function hideFullscreenMode () { 
     101                $( '#hiddenaction' ).val( 'editpost' ); 
     102                $( '#fullscreen-overlay' ).fadeOut( 'slow' ); 
     103                $( 'body' ).removeClass( 'fullscreen-view' ); 
     104                $( 'html' ).animate( { marginTop: 0 }, 500 ); 
     105                titleBox.animate( { maxHeight: titleBoxHeight + 'px', marginBottom: '10px' }, 500 ); 
     106                postBodyContent.css( { 'position': 'relative' } ); 
     107                sidePostbox.css( { 'position': 'relative', 'opacity': 100 } ).off( 'mouseenter mouseleave' ); 
     108                // Has to happen after the HTML margin animation, else the screen jumps 
     109                setTimeout(function() { 
     110                        postBodyContent.css( { 'zIndex': 999 } ); 
     111                        sidePostbox.css( { 'zIndex': 999 } ); 
     112                        $( '#wpbody-content' ).css( 'overflow','hidden' ); 
     113                }, 600); 
     114                $( '#formatdiv, #categorydiv, #tagsdiv-post_tag' ).show(); 
     115                $( '#misc-publishing-actions, #major-publishing-actions' ).slideDown(); 
     116                $( '#minor-publishing' ).css( 'border-bottom-color', '#dfdfdf' ); 
     117                $( '#minor-publishing-actions' ).css( 'marginBottom', '0' ); 
     118                // Use visiblity here vs. display - prevents jump in transition when scrollbars disappear 
     119                $( '#postbox-container-2' ).css( 'visibility', 'visible' ); 
     120                clearFadeOut(); 
     121                $( '.fullscreen-mode .mce_wp_fullscreen' ).css( 'background-position', '-240px -20px' ); 
     122                $( '#wp-content-wrap, #submitdiv' ).off('mouseenter mouseleave'); 
     123                $( '.wp-switch-editor' ).off( 'click' ); 
     124                editorSetFocus(); 
     125                $( '.fullscreen-view #save-post' ).off( 'click' ); 
     126                $( '.fullscreen-view #post' ).off( 'submit' ); 
     127                $( '#content' ).off( 'keypress paste' ); 
     128                editorEventsOff(); 
     129        } 
     130        function resizeEditor ( txt, type ) { 
     131                var newheight, 
     132                        scrollHeight = txt.prop( 'scrollHeight' ), 
     133                        newheight = scrollHeight > 300 ? scrollHeight : 300; 
     134 
     135                if ( ! textAreaResizePause && newheight - 30 != oldheight ) { 
     136                        textAreaResizePause = true 
     137                        var heightVal = newheight + 30 + 'px'; 
     138 
     139                        if ( 'visual' === type ) { 
     140                                $( '#content_ifr' ).css( 'height', heightVal ); 
     141                                window.tinyMCE.activeEditor.dom.setStyle(window.tinyMCE.activeEditor.dom.select('body'), 'height', heightVal ); 
     142                        } else { 
     143                                txt.css( 'height', heightVal ); 
     144                        } 
     145                        oldheight = newheight; 
     146 
     147                        // Throttle resize attempts 
     148                        setTimeout( function () { textAreaResizePause = false; }, 1000 ) 
     149                } 
     150        } 
     151        function saveDraft () { 
     152                $( '#hiddenaction' ).val( 'wp-fullscreen-save-post' ); 
     153                $.post( ajaxurl, $( 'form#post' ).serialize(), function( r ){ 
     154                        $( '#minor-publishing-actions .spinner' ).hide(); 
     155                        $( '#save-post' ).removeClass( 'button-disabled' ); 
     156                        $( '#publish' ).removeClass( 'button-primary-disabled' ); 
     157 
     158                        $( '#last-edit' ).html( r.last_edited ); 
     159 
     160                        if ( window.history ) 
     161                                window.history.replaceState({}, 'Saved Draft', 'post.php?post=' + r.id + '&action=edit'); 
     162                }, 'json' ); 
     163        } 
     164        function showFullscreenMode () { 
     165                $( '#fullscreen-overlay' ).fadeIn( 'fast' ); 
     166                $( 'body' ).addClass( 'fullscreen-view' ); 
     167                $( 'html' ).animate( { marginTop: $( '#post-body' ).offset().top * -1 + 20 + 'px' }, 400 ); 
     168                titleBox.animate( { maxHeight: 0, marginBottom: 0 }, 300 ); 
     169                postBodyContent.css( { 'position': 'absolute', 'zIndex': 150000 } ); 
     170                if ( isRtl ) 
     171                        sidePostbox.css( { 'position': 'absolute', 'zIndex': 150000, 'left': 0 } ); 
     172                else 
     173                        sidePostbox.css( { 'position': 'absolute', 'zIndex': 150000, 'right': 0 } ); 
     174                $( '#wpbody-content' ).css( 'overflow','visible' ); 
     175                $( '#formatdiv, #categorydiv, #tagsdiv-post_tag' ).hide(); 
     176                $( '#misc-publishing-actions, #major-publishing-actions' ).slideUp(); 
     177                $( '#minor-publishing' ).css( 'border-bottom-color', 'transparent' ); 
     178                $( '#minor-publishing-actions' ).css( 'marginBottom', '10px' ); 
     179                // Use visiblity here vs. display - prevents jump in transition when scrollbars disappear 
     180                $( '#postbox-container-2' ).css( 'visibility', 'hidden' ); 
     181                fadeOutFullscreen(); 
     182                $( '.fullscreen-mode .mce_wp_fullscreen' ).css( 'background-position', '-560px -20px' ); 
     183                $( '#wp-content-wrap, #submitdiv' ).on( 'mouseover', function () { 
     184                        clearFadeOut(); 
     185                        fadeInThrottle(); 
     186                }).mouseleave( function () { 
     187                        fadeOutFullscreen(); 
     188                }); 
     189                // Attach events when visual or text tabs are clicked 
     190                $( '.wp-switch-editor' ).on( 'click', function () { 
     191                        editorEventsOn(); 
     192                }); 
     193                // Catch Save Draft click event 
     194                $( '.fullscreen-view #save-post' ).on( 'click', function ( e ) { 
     195                        saveDraft(); 
     196                        e.preventDefault(); 
     197                }); 
     198                editorEventsOn(); 
     199                // Resize text areas 
     200                if ( window.tinymce.activeEditor ) 
     201                        resizeEditor( $( window.tinymce.activeEditor.dom.doc ).find( 'body' ), 'visual' ); 
     202                resizeEditor( $( '#content' ), 'text' ); 
     203        } 
     204        return { 
     205                init: function () { 
     206                        $( '.fullscreen-mode' ).click( function () { 
     207                                if ( $( '#fullscreen-overlay' ).is( ':visible' ) ) 
     208                                        hideFullscreenMode(); 
     209                                else 
     210                                        showFullscreenMode(); 
     211                                return false; 
     212                        }); 
     213                        // Move #post-status-info inside #wp-content-wrap 
     214                        $( '#post-status-info' ).detach().appendTo( '#wp-content-wrap' ); 
     215                } 
     216        } 
     217} (jQuery); 
     218WP.Fullscreen.init(); 
     219 
    1220/** 
    2221 * PubSub 
    3222 * 
  • wp-admin/css/wp-admin.css

     
    20012001 
    20022002#poststuff #post-body { 
    20032003        padding: 0; 
     2004        position: relative; 
    20042005} 
    20052006 
     2007#postdivrich, { 
     2008        position: relative; 
     2009} 
     2010 
     2011#wp-content-wrap { 
     2012        width: 100%; 
     2013} 
     2014 
    20062015#post-body-content { 
    20072016        width: 100%; 
    20082017        float: left; 
     
    29782987 
    29792988#titlediv div.inside { 
    29802989        margin: 0; 
     2990        max-height: 23px; 
    29812991} 
    29822992 
    29832993#poststuff #titlewrap { 
     
    29933003        outline: none; 
    29943004} 
    29953005 
    2996 #titlediv #title-prompt-text, 
    2997 #wp-fullscreen-title-prompt-text { 
     3006#titlediv #title-prompt-text { 
    29983007        color: #bbb; 
    29993008        position: absolute; 
    30003009        font-size: 1.7em; 
     
    33463355        cursor: se-resize; 
    33473356        position: absolute; 
    33483357        right: 2px; 
     3358        bottom: 3px; 
    33493359        height: 19px; 
    33503360} 
    33513361 
     
    79127922        width: 300px; 
    79137923} 
    79147924 
     7925.wp-editor-container { 
     7926        position: relative; 
     7927} 
     7928 
    79157929/* theme-editor */ 
    79167930.alignleft h3 { 
    79177931        margin: 0;