From 9b3f26faa43f9c24f7e95c6192bd33505d1290ca Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 12 May 2011 01:53:51 +0000 Subject: [PATCH] Improve code for DFW buttons, fix colors in some rare TinyMCE popups, see #17136 git-svn-id: https://develop.svn.wordpress.org/trunk@17880 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/post.php | 111 +++++------------- .../inlinepopups/skins/clearlooks2/window.css | 2 +- wp-includes/js/tinymce/wp-mce-help.php | 2 - 3 files changed, 33 insertions(+), 82 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 239aba20a9..3ef281243b 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1712,12 +1712,7 @@ function wp_preload_dialogs($init) { // Distraction Free Writing mode if ( in_array( 'wpfullscreen', $plugins, true ) ) { - $enable = array(); - - if ( in_array( 'AtD', $plugins, true ) ) - $enable[] = 'AtD'; - - wp_fullscreen_html($enable); + wp_fullscreen_html(); wp_print_scripts('wp-fullscreen'); } @@ -1739,7 +1734,7 @@ function wp_print_editor_js() { wp_print_scripts('editor'); } -function wp_fullscreen_html( $extra = array() ) { +function wp_fullscreen_html() { global $content_width, $post; $width = isset($content_width) && 800 > $content_width ? $content_width : 800; @@ -1759,83 +1754,41 @@ function wp_fullscreen_html( $extra = array() ) {
-
- - - -
+ - - - -
+ $buttons = array( + // format: title, onclick, show in both editors + 'bold' => array( 'title' => __('Bold (Ctrl + B)'), 'onclick' => 'fullscreen.b();', 'both' => false ), + 'italic' => array( 'title' => __('Italic (Ctrl + I)'), 'onclick' => 'fullscreen.i();', 'both' => false ), + '0' => 'separator', + 'bullist' => array( 'title' => __('Unordered list (Alt + Shift + U)'), 'onclick' => 'fullscreen.ul();', 'both' => false ), + 'numlist' => array( 'title' => __('Ordered list (Alt + Shift + O)'), 'onclick' => 'fullscreen.ol();', 'both' => false ), + '1' => 'separator', + 'blockquote' => array( 'title' => __('Blockquote (Alt+Shift+Q)'), 'onclick' => 'fullscreen.blockquote();', 'both' => false ), + 'image' => array( 'title' => __('Insert/edit image (Alt + Shift + M)'), 'onclick' => "jQuery('#add_image').click();", 'both' => true ), + '2' => 'separator', + 'link' => array( 'title' => __('Insert/edit link (Alt + Shift + A)'), 'onclick' => 'fullscreen.link();', 'both' => true ), + 'unlink' => array( 'title' => __('Unlink (Alt + Shift + S)'), 'onclick' => 'fullscreen.unlink();', 'both' => false ), + '3' => 'separator', + 'help' => array( 'title' => __('Help (Alt + Shift + H)'), 'onclick' => 'fullscreen.help();', 'both' => false ) + ); -
- -
+ $buttons = apply_filters( 'wp_fullscreen_buttons', $buttons ); -
- - - -
+ foreach ( $buttons as $button => $args ) { + if ( 'separator' == $args ) { ?> +
+ -
- - - -
+ class="wp-fullscreen-both"> + + + +
+ -
- -
- -
- - - -
- -
- - - -
- -
- -
- -
- - - -
- -
- - - -
- -
- -
- - -
- - - -
- - -
- - - -
diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css b/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css index 9b9fddaebf..1001789461 100644 --- a/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +++ b/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css @@ -118,7 +118,7 @@ color:#FFF .clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} .clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} .clearlooks2 a:hover {font-weight:bold;} -.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#E4F2FD} +.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#F9F9F9} .clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} .clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} .clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} diff --git a/wp-includes/js/tinymce/wp-mce-help.php b/wp-includes/js/tinymce/wp-mce-help.php index ca26610779..56abcb0146 100644 --- a/wp-includes/js/tinymce/wp-mce-help.php +++ b/wp-includes/js/tinymce/wp-mce-help.php @@ -168,8 +168,6 @@ wp_admin_css( 'wp-admin', true ); - -