From 706daca6a38fbe6e8e124a5a10a26ed159c2fb44 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 2 Feb 2020 04:13:25 +0000 Subject: [PATCH] Editor: Remove back-compat stub for Classic Editor's old distraction-free writing mode. The original script was deprecated in [30338] and removed in [32677]. Props Presskopp, ketuchetan. Fixes #39448. git-svn-id: https://develop.svn.wordpress.org/trunk@47164 602fd350-edb4-49c9-b593-d223f7449a82 --- .../_enqueues/deprecated/fullscreen-stub.js | 40 ------------------- src/js/_enqueues/deprecated/media-gallery.js | 2 +- src/wp-admin/includes/update-core.php | 3 ++ src/wp-includes/class-wp-editor.php | 13 +----- src/wp-includes/script-loader.php | 3 -- 5 files changed, 5 insertions(+), 56 deletions(-) delete mode 100644 src/js/_enqueues/deprecated/fullscreen-stub.js diff --git a/src/js/_enqueues/deprecated/fullscreen-stub.js b/src/js/_enqueues/deprecated/fullscreen-stub.js deleted file mode 100644 index 490d18d073..0000000000 --- a/src/js/_enqueues/deprecated/fullscreen-stub.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Distraction-Free Writing (wp-fullscreen) backward compatibility stub. - * - * @deprecated 4.1 - * @removed 4.3. - * @output wp-admin/js/wp-fullscreen-stub.js - */ -( function() { - var noop = function(){}; - - window.wp = window.wp || {}; - window.wp.editor = window.wp.editor || {}; - window.wp.editor.fullscreen = { - bind_resize: noop, - dfwWidth: noop, - off: noop, - on: noop, - refreshButtons: noop, - resizeTextarea: noop, - save: noop, - switchmode: noop, - toggleUI: noop, - - settings: {}, - pubsub: { - publish: noop, - subscribe: noop, - unsubscribe: noop, - topics: {} - }, - fade: { - In: noop, - Out: noop - }, - ui: { - fade: noop, - init: noop - } - }; -}()); diff --git a/src/js/_enqueues/deprecated/media-gallery.js b/src/js/_enqueues/deprecated/media-gallery.js index 725d2beb7c..805a6f9260 100644 --- a/src/js/_enqueues/deprecated/media-gallery.js +++ b/src/js/_enqueues/deprecated/media-gallery.js @@ -1,7 +1,7 @@ /** * This file is used on media-upload.php which has been replaced by media-new.php and upload.php * - * @deprecated 3.5.0 + * @deprecated 3.5.0 * @output wp-admin/js/media-gallery.js */ diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index 7811a73ba2..9a5906a2bd 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -789,6 +789,9 @@ $_old_files = array( // 5.3 'wp-includes/js/wp-a11y.js', // Moved to: wp-includes/js/dist/a11y.js 'wp-includes/js/wp-a11y.min.js', // Moved to: wp-includes/js/dist/a11y.min.js + // 5.4 + 'wp-admin/js/wp-fullscreen-stub.js', + 'wp-admin/js/wp-fullscreen-stub.min.js', ); /** diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index eece5f812f..d61a459473 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -25,7 +25,6 @@ final class _WP_Editors { private static $has_medialib = false; private static $editor_buttons_css = true; private static $drag_drop_upload = false; - private static $old_dfw_compat = false; private static $translation; private static $tinymce_scripts_printed = false; private static $link_dialog_printed = false; @@ -58,8 +57,7 @@ final class _WP_Editors { * @type string $editor_class Extra classes to add to the editor textarea element. Default empty. * @type bool $teeny Whether to output the minimal editor config. Examples include * Press This and the Comment editor. Default false. - * @type bool $dfw Deprecated in 4.1. Since 4.3 used only to enqueue wp-fullscreen-stub.js - * for backward compatibility. + * @type bool $dfw Deprecated in 4.1. Unused. * @type bool|array $tinymce Whether to load TinyMCE. Can be used to pass settings directly to * TinyMCE using an array. Default true. * @type bool|array $quicktags Whether to load Quicktags. Can be used to pass settings directly to @@ -97,7 +95,6 @@ final class _WP_Editors { 'editor_css' => '', 'editor_class' => '', 'teeny' => false, - 'dfw' => false, '_content_editor_dfw' => false, 'tinymce' => true, 'quicktags' => true, @@ -123,10 +120,6 @@ final class _WP_Editors { self::$has_quicktags = true; } - if ( $set['dfw'] ) { - self::$old_dfw_compat = true; - } - if ( empty( $set['editor_height'] ) ) { return $set; } @@ -872,10 +865,6 @@ final class _WP_Editors { wp_enqueue_script( 'jquery-ui-autocomplete' ); } - if ( self::$old_dfw_compat ) { - wp_enqueue_script( 'wp-fullscreen-stub' ); - } - if ( self::$has_medialib ) { add_thickbox(); wp_enqueue_script( 'media-upload' ); diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index f45471d7e1..668ffee456 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -716,9 +716,6 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'clipboard', "/wp-includes/js/clipboard$suffix.js", array(), false, 1 ); - // Back-compat for old DFW. To-do: remove at the end of 2016. - $scripts->add( 'wp-fullscreen-stub', "/wp-admin/js/wp-fullscreen-stub$suffix.js", array(), false, 1 ); - $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array( 'jquery' ), false, 1 ); did_action( 'init' ) && $scripts->localize( 'wp-ajax-response',