Skip to content

Commit

Permalink
Editor: Replace the remaining references to wp.editor with `wp.oldE…
Browse files Browse the repository at this point in the history
…ditor`.

Props zieladam.
Fixes #53762.
Built from https://develop.svn.wordpress.org/trunk@51649


git-svn-id: http://core.svn.wordpress.org/trunk@51255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
azaozz committed Aug 21, 2021
1 parent 7fc3aae commit 774c804
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions wp-admin/js/editor-expand.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
$sideSortables = $( '#side-sortables' ),
$postboxContainer = $( '#postbox-container-1' ),
$postBody = $('#post-body'),
fullscreen = window.wp.editor && window.wp.editor.fullscreen,
fullscreen = window.wp.oldEditor && window.wp.oldEditor.fullscreen,
mceEditor,
mceBind = function(){},
mceUnbind = function(){},
Expand Down Expand Up @@ -1603,8 +1603,8 @@
}

window.wp = window.wp || {};
window.wp.editor = window.wp.editor || {};
window.wp.editor.dfw = {
window.wp.oldEditor = window.wp.oldEditor || {};
window.wp.oldEditor.dfw = {
activate: activate,
deactivate: deactivate,
isActive: isActive,
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/editor-expand.min.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions wp-admin/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
window.wp = window.wp || {};

( function( $, wp ) {
wp.editor = wp.editor || {};
wp.editor = wp.oldEditor = wp.oldEditor || {};

/**
* Utility functions for the editor.
Expand Down Expand Up @@ -1191,8 +1191,8 @@ window.wp = window.wp || {};
} );
}

wp.editor.autop = wpautop;
wp.editor.removep = pre_wpautop;
wp.oldEditor.autop = wpautop;
wp.oldEditor.removep = pre_wpautop;

exports = {
go: switchEditor,
Expand Down Expand Up @@ -1241,15 +1241,15 @@ window.wp = window.wp || {};
* }
* }
*/
wp.editor.initialize = function( id, settings ) {
wp.oldEditor.initialize = function( id, settings ) {
var init;
var defaults;

if ( ! $ || ! id || ! wp.editor.getDefaultSettings ) {
if ( ! $ || ! id || ! wp.oldEditor.getDefaultSettings ) {
return;
}

defaults = wp.editor.getDefaultSettings();
defaults = wp.oldEditor.getDefaultSettings();

// Initialize TinyMCE by default.
if ( ! settings ) {
Expand Down Expand Up @@ -1349,13 +1349,13 @@ window.wp = window.wp || {};
/**
* Remove one editor instance.
*
* Intended for use with editors that were initialized with wp.editor.initialize().
* Intended for use with editors that were initialized with wp.oldEditor.initialize().
*
* @since 4.8.0
*
* @param {string} id The HTML id of the editor textarea.
*/
wp.editor.remove = function( id ) {
wp.oldEditor.remove = function( id ) {
var mceInstance, qtInstance,
$wrap = $( '#wp-' + id + '-wrap' );

Expand Down Expand Up @@ -1388,14 +1388,14 @@ window.wp = window.wp || {};
/**
* Get the editor content.
*
* Intended for use with editors that were initialized with wp.editor.initialize().
* Intended for use with editors that were initialized with wp.oldEditor.initialize().
*
* @since 4.8.0
*
* @param {string} id The HTML id of the editor textarea.
* @return The editor content.
*/
wp.editor.getContent = function( id ) {
wp.oldEditor.getContent = function( id ) {
var editor;

if ( ! $ || ! id ) {
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/editor.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions wp-includes/class-wp-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,8 @@ public static function print_default_editor_scripts() {
?>
<script type="text/javascript">
window.wp = window.wp || {};
window.wp.editor = window.wp.editor || {};
window.wp.editor.getDefaultSettings = function() {
window.wp.editor = window.wp.oldEditor = window.wp.oldEditor || {};
window.wp.oldEditor.getDefaultSettings = function() {
return {
tinymce: <?php echo $settings; ?>,
quicktags: {
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -3524,7 +3524,7 @@ function wp_editor( $content, $editor_id, $settings = array() ) {
* Outputs the editor scripts, stylesheets, and default settings.
*
* The editor can be initialized when needed after page load.
* See wp.editor.initialize() in wp-admin/js/editor.js for initialization options.
* See wp.oldEditor.initialize() in wp-admin/js/editor.js for initialization options.
*
* @uses _WP_Editors
* @since 4.8.0
Expand Down
6 changes: 3 additions & 3 deletions wp-includes/js/quicktags.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ window.edToolbar = function(){};
ariaLabel = this.attr && this.attr.ariaLabel ? ' aria-label="' + _escape( this.attr.ariaLabel ) + '"' : '',
val = this.display ? ' value="' + _escape( this.display ) + '"' : '',
id = this.id ? ' id="' + _escape( idPrefix + this.id ) + '"' : '',
dfw = ( wp = window.wp ) && wp.editor && wp.editor.dfw;
dfw = ( wp = window.wp ) && wp.oldEditor && wp.oldEditor.dfw;

if ( this.id === 'fullscreen' ) {
return '<button type="button"' + id + ' class="ed_button qt-dfw qt-fullscreen"' + title + ariaLabel + '></button>';
Expand Down Expand Up @@ -681,11 +681,11 @@ window.edToolbar = function(){};
qt.DFWButton.prototype.callback = function() {
var wp;

if ( ! ( wp = window.wp ) || ! wp.editor || ! wp.editor.dfw ) {
if ( ! ( wp = window.wp ) || ! wp.oldEditor || ! wp.oldEditor.dfw ) {
return;
}

window.wp.editor.dfw.toggle();
window.wp.oldEditor.dfw.toggle();
};

qt.TextDirectionButton = function() {
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/quicktags.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions wp-includes/js/tinymce/plugins/wordpress/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
__ = editor.editorManager.i18n.translate,
$ = window.jQuery,
wp = window.wp,
hasWpautop = ( wp && wp.editor && wp.editor.autop && editor.getParam( 'wpautop', true ) ),
hasWpautop = ( wp && wp.oldEditor && wp.oldEditor.autop && editor.getParam( 'wpautop', true ) ),
wpTooltips = false;

if ( $ ) {
Expand Down Expand Up @@ -130,7 +130,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {

if ( event.load && event.format !== 'raw' ) {
if ( hasWpautop ) {
event.content = wp.editor.autop( event.content );
event.content = wp.oldEditor.autop( event.content );
} else {
// Prevent creation of paragraphs out of multiple HTML comments.
event.content = event.content.replace( /-->\s+<!--/g, '--><!--' );
Expand Down Expand Up @@ -601,7 +601,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
event.content = event.content.replace( /<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g, '<p>&nbsp;</p>' );

if ( hasWpautop ) {
event.content = wp.editor.removep( event.content );
event.content = wp.oldEditor.removep( event.content );
} else {
// Restore formatting of block boundaries.
event.content = event.content.replace( /-->\s*<!-- wp:/g, '-->\n\n<!-- wp:' );
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/tinymce/plugins/wordpress/plugin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/js/tinymce/wp-tinymce.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-51648';
$wp_version = '5.9-alpha-51649';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 774c804

Please sign in to comment.