Editor: Revert [51748] and [51649]. They intorduced a bug where wp.editor may be replaced with wp.oldEditor in certain cases.

Props desrosj, davidbinda, azaozz.
Fixes #53762.
Built from https://develop.svn.wordpress.org/trunk@51768


git-svn-id: http://core.svn.wordpress.org/trunk@51375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz
2021-09-08 23:29:58 +00:00
parent 03bbf916a9
commit 0fcde6de17
12 changed files with 27 additions and 31 deletions

View File

@@ -33,7 +33,7 @@
$sideSortables = $( '#side-sortables' ),
$postboxContainer = $( '#postbox-container-1' ),
$postBody = $('#post-body'),
fullscreen = window.wp.oldEditor && window.wp.oldEditor.fullscreen,
fullscreen = window.wp.editor && window.wp.editor.fullscreen,
mceEditor,
mceBind = function(){},
mceUnbind = function(){},
@@ -1603,8 +1603,8 @@
}
window.wp = window.wp || {};
window.wp.oldEditor = window.wp.oldEditor || {};
window.wp.oldEditor.dfw = {
window.wp.editor = window.wp.editor || {};
window.wp.editor.dfw = {
activate: activate,
deactivate: deactivate,
isActive: isActive,

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,7 @@
window.wp = window.wp || {};
( function( $, wp ) {
wp.editor = wp.oldEditor = wp.oldEditor || {};
wp.editor = wp.editor || {};
/**
* Utility functions for the editor.
@@ -1191,8 +1191,8 @@ window.wp = window.wp || {};
} );
}
wp.oldEditor.autop = wpautop;
wp.oldEditor.removep = pre_wpautop;
wp.editor.autop = wpautop;
wp.editor.removep = pre_wpautop;
exports = {
go: switchEditor,
@@ -1241,15 +1241,15 @@ window.wp = window.wp || {};
* }
* }
*/
wp.oldEditor.initialize = function( id, settings ) {
wp.editor.initialize = function( id, settings ) {
var init;
var defaults;
if ( ! $ || ! id || ! wp.oldEditor.getDefaultSettings ) {
if ( ! $ || ! id || ! wp.editor.getDefaultSettings ) {
return;
}
defaults = wp.oldEditor.getDefaultSettings();
defaults = wp.editor.getDefaultSettings();
// Initialize TinyMCE by default.
if ( ! settings ) {
@@ -1349,13 +1349,13 @@ window.wp = window.wp || {};
/**
* Remove one editor instance.
*
* Intended for use with editors that were initialized with wp.oldEditor.initialize().
* Intended for use with editors that were initialized with wp.editor.initialize().
*
* @since 4.8.0
*
* @param {string} id The HTML id of the editor textarea.
*/
wp.oldEditor.remove = function( id ) {
wp.editor.remove = function( id ) {
var mceInstance, qtInstance,
$wrap = $( '#wp-' + id + '-wrap' );
@@ -1388,14 +1388,14 @@ window.wp = window.wp || {};
/**
* Get the editor content.
*
* Intended for use with editors that were initialized with wp.oldEditor.initialize().
* Intended for use with editors that were initialized with wp.editor.initialize().
*
* @since 4.8.0
*
* @param {string} id The HTML id of the editor textarea.
* @return The editor content.
*/
wp.oldEditor.getContent = function( id ) {
wp.editor.getContent = function( id ) {
var editor;
if ( ! $ || ! id ) {

File diff suppressed because one or more lines are too long