mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
Editor:
- Add CSS reset for the TinyMCE fullscreen mode when used on the Edit Post screen. - Fix loading of the old and new DFW buttons, use another arg. passed to WP_Editors. - Reset editor-expand when exiting TinyMCE fullscreen mode. Fixes #30453. git-svn-id: https://develop.svn.wordpress.org/trunk@30573 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -435,6 +435,26 @@ td.plugin-title p {
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
/* TinyMCE native fullscreen mode override */
|
||||
.mce-fullscreen #wp-content-wrap .mce-menubar,
|
||||
.mce-fullscreen #wp-content-wrap .mce-toolbar-grp,
|
||||
.mce-fullscreen #wp-content-wrap .mce-edit-area,
|
||||
.mce-fullscreen #wp-content-wrap .mce-statusbar {
|
||||
position: static !important;
|
||||
width: auto !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.mce-fullscreen #wp-content-wrap .mce-statusbar {
|
||||
visibility: visible !important;
|
||||
}
|
||||
|
||||
.post-php.mce-fullscreen #wpadminbar,
|
||||
.mce-fullscreen #wp-content-wrap .mce-wp-dfw {
|
||||
display: none;
|
||||
}
|
||||
/* End TinyMCE native fullscreen mode override */
|
||||
|
||||
#wp-content-editor-tools {
|
||||
background-color: #f1f1f1;
|
||||
padding-top: 20px;
|
||||
|
||||
@@ -11,7 +11,7 @@ if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
wp_enqueue_script('post');
|
||||
$_wp_editor_expand = false;
|
||||
$_wp_editor_expand = $_content_editor_dfw = false;
|
||||
|
||||
/**
|
||||
* Filter whether to enable the 'expand' functionality in the post editor.
|
||||
@@ -25,6 +25,7 @@ if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() &&
|
||||
apply_filters( 'wp_editor_expand', true ) ) {
|
||||
|
||||
wp_enqueue_script('editor-expand');
|
||||
$_content_editor_dfw = true;
|
||||
$_wp_editor_expand = ( get_user_setting( 'editor_expand', 'on' ) === 'on' );
|
||||
}
|
||||
|
||||
@@ -512,6 +513,7 @@ if ( post_type_supports($post_type, 'editor') ) {
|
||||
<div id="postdivrich" class="postarea<?php if ( $_wp_editor_expand ) { echo ' wp-editor-expand'; } ?>">
|
||||
|
||||
<?php wp_editor( $post->post_content, 'content', array(
|
||||
'_content_editor_dfw' => $_content_editor_dfw,
|
||||
'drag_drop_upload' => true,
|
||||
'tabfocus_elements' => 'content-html,save-post',
|
||||
'editor_height' => 300,
|
||||
|
||||
@@ -242,6 +242,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
function mceFullscreenToggled( event ) {
|
||||
if ( ! event.state ) {
|
||||
adjust();
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust when switching editor modes.
|
||||
function mceShow() {
|
||||
$window.on( 'scroll.mce-float-panels', hideFloatPanels );
|
||||
@@ -280,8 +286,10 @@
|
||||
editor.on( 'wp-toolbar-toggle', toggleAdvanced );
|
||||
// Adjust when the editor resizes.
|
||||
editor.on( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
|
||||
// Don't hide the caret after undo/redo
|
||||
// Don't hide the caret after undo/redo.
|
||||
editor.on( 'undo redo', mceScroll );
|
||||
// Adjust when exiting TinyMCE's fullscreen mode.
|
||||
editor.on( 'FullscreenStateChanged', mceFullscreenToggled );
|
||||
|
||||
$window.off( 'scroll.mce-float-panels' ).on( 'scroll.mce-float-panels', hideFloatPanels );
|
||||
};
|
||||
@@ -293,6 +301,7 @@
|
||||
editor.off( 'wp-toolbar-toggle', toggleAdvanced );
|
||||
editor.off( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
|
||||
editor.off( 'undo redo', mceScroll );
|
||||
editor.off( 'FullscreenStateChanged', mceFullscreenToggled );
|
||||
|
||||
$window.off( 'scroll.mce-float-panels' );
|
||||
};
|
||||
@@ -765,7 +774,7 @@
|
||||
$editorWindow = $(),
|
||||
$editorIframe = $(),
|
||||
_isActive = window.getUserSetting( 'editor_expand', 'on' ) === 'on',
|
||||
_isOn = _isActive ? !! parseInt( window.getUserSetting( 'dfw', '1' ), 10 ) : false,
|
||||
_isOn = _isActive ? window.getUserSetting( 'post_dfw' ) === 'on' : false,
|
||||
traveledX = 0,
|
||||
traveledY = 0,
|
||||
buffer = 20,
|
||||
@@ -825,7 +834,7 @@
|
||||
|
||||
fadeOut();
|
||||
|
||||
window.setUserSetting( 'dfw', '1' );
|
||||
window.setUserSetting( 'post_dfw', 'on' );
|
||||
|
||||
$document.trigger( 'dfw-on' );
|
||||
}
|
||||
@@ -841,7 +850,7 @@
|
||||
|
||||
$editor.off( '.focus' );
|
||||
|
||||
window.setUserSetting( 'dfw', '0' );
|
||||
window.setUserSetting( 'post_dfw', 'off' );
|
||||
|
||||
$document.trigger( 'dfw-off' );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user