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

@@ -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.oldEditor && wp.oldEditor.dfw;
dfw = ( wp = window.wp ) && wp.editor && wp.editor.dfw;
if ( this.id === 'fullscreen' ) {
return '<button type="button"' + id + ' class="ed_button qt-dfw qt-fullscreen"' + title + ariaLabel + '></button>';
@@ -681,11 +681,11 @@ window.edToolbar = function(){};
qt.DFWButton.prototype.callback = function() {
var wp;
if ( ! ( wp = window.wp ) || ! wp.oldEditor || ! wp.oldEditor.dfw ) {
if ( ! ( wp = window.wp ) || ! wp.editor || ! wp.editor.dfw ) {
return;
}
window.wp.oldEditor.dfw.toggle();
window.wp.editor.dfw.toggle();
};
qt.TextDirectionButton = function() {

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
__ = editor.editorManager.i18n.translate,
$ = window.jQuery,
wp = window.wp,
hasWpautop = ( wp && wp.oldEditor && wp.oldEditor.autop && editor.getParam( 'wpautop', true ) ),
hasWpautop = ( wp && wp.editor && wp.editor.autop && editor.getParam( 'wpautop', true ) ),
wpTooltips = false;
if ( $ ) {
@@ -130,7 +130,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
if ( event.load && event.format !== 'raw' ) {
if ( hasWpautop ) {
event.content = wp.oldEditor.autop( event.content );
event.content = wp.editor.autop( event.content );
} else {
// Prevent creation of paragraphs out of multiple HTML comments.
event.content = event.content.replace( /-->\s+<!--/g, '--><!--' );
@@ -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.oldEditor.removep( event.content );
event.content = wp.editor.removep( event.content );
} else {
// Restore formatting of block boundaries.
event.content = event.content.replace( /-->\s*<!-- wp:/g, '-->\n\n<!-- wp:' );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long