Ticket #53762: 53762.4.diff
File 53762.4.diff, 6.8 KB (added by , 3 years ago) |
---|
-
src/js/_enqueues/lib/quicktags.js
435 435 ariaLabel = this.attr && this.attr.ariaLabel ? ' aria-label="' + _escape( this.attr.ariaLabel ) + '"' : '', 436 436 val = this.display ? ' value="' + _escape( this.display ) + '"' : '', 437 437 id = this.id ? ' id="' + _escape( idPrefix + this.id ) + '"' : '', 438 dfw = ( wp = window.wp ) && wp. oldEditor && wp.oldEditor.dfw;438 dfw = ( wp = window.wp ) && wp.editor && wp.editor.dfw; 439 439 440 440 if ( this.id === 'fullscreen' ) { 441 441 return '<button type="button"' + id + ' class="ed_button qt-dfw qt-fullscreen"' + title + ariaLabel + '></button>'; … … 681 681 qt.DFWButton.prototype.callback = function() { 682 682 var wp; 683 683 684 if ( ! ( wp = window.wp ) || ! wp. oldEditor || ! wp.oldEditor.dfw ) {684 if ( ! ( wp = window.wp ) || ! wp.editor || ! wp.editor.dfw ) { 685 685 return; 686 686 } 687 687 688 window.wp. oldEditor.dfw.toggle();688 window.wp.editor.dfw.toggle(); 689 689 }; 690 690 691 691 qt.TextDirectionButton = function() { -
src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js
12 12 __ = editor.editorManager.i18n.translate, 13 13 $ = window.jQuery, 14 14 wp = window.wp, 15 hasWpautop = ( wp && wp. oldEditor && wp.oldEditor.autop && editor.getParam( 'wpautop', true ) ),15 hasWpautop = ( wp && wp.editor && wp.editor.autop && editor.getParam( 'wpautop', true ) ), 16 16 wpTooltips = false; 17 17 18 18 if ( $ ) { … … 130 130 131 131 if ( event.load && event.format !== 'raw' ) { 132 132 if ( hasWpautop ) { 133 event.content = wp. oldEditor.autop( event.content );133 event.content = wp.editor.autop( event.content ); 134 134 } else { 135 135 // Prevent creation of paragraphs out of multiple HTML comments. 136 136 event.content = event.content.replace( /-->\s+<!--/g, '--><!--' ); … … 601 601 event.content = event.content.replace( /<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g, '<p> </p>' ); 602 602 603 603 if ( hasWpautop ) { 604 event.content = wp. oldEditor.removep( event.content );604 event.content = wp.editor.removep( event.content ); 605 605 } else { 606 606 // Restore formatting of block boundaries. 607 607 event.content = event.content.replace( /-->\s*<!-- wp:/g, '-->\n\n<!-- wp:' ); -
src/js/_enqueues/wp/editor/base.js
5 5 window.wp = window.wp || {}; 6 6 7 7 ( function( $, wp ) { 8 wp.editor = wp. oldEditor = wp.oldEditor || {};8 wp.editor = wp.editor || {}; 9 9 10 10 /** 11 11 * Utility functions for the editor. … … 1191 1191 } ); 1192 1192 } 1193 1193 1194 wp. oldEditor.autop = wpautop;1195 wp. oldEditor.removep = pre_wpautop;1194 wp.editor.autop = wpautop; 1195 wp.editor.removep = pre_wpautop; 1196 1196 1197 1197 exports = { 1198 1198 go: switchEditor, … … 1241 1241 * } 1242 1242 * } 1243 1243 */ 1244 wp. oldEditor.initialize = function( id, settings ) {1244 wp.editor.initialize = function( id, settings ) { 1245 1245 var init; 1246 1246 var defaults; 1247 1247 1248 if ( ! $ || ! id || ! wp. oldEditor.getDefaultSettings ) {1248 if ( ! $ || ! id || ! wp.editor.getDefaultSettings ) { 1249 1249 return; 1250 1250 } 1251 1251 1252 defaults = wp. oldEditor.getDefaultSettings();1252 defaults = wp.editor.getDefaultSettings(); 1253 1253 1254 1254 // Initialize TinyMCE by default. 1255 1255 if ( ! settings ) { … … 1349 1349 /** 1350 1350 * Remove one editor instance. 1351 1351 * 1352 * Intended for use with editors that were initialized with wp. oldEditor.initialize().1352 * Intended for use with editors that were initialized with wp.editor.initialize(). 1353 1353 * 1354 1354 * @since 4.8.0 1355 1355 * 1356 1356 * @param {string} id The HTML id of the editor textarea. 1357 1357 */ 1358 wp. oldEditor.remove = function( id ) {1358 wp.editor.remove = function( id ) { 1359 1359 var mceInstance, qtInstance, 1360 1360 $wrap = $( '#wp-' + id + '-wrap' ); 1361 1361 … … 1388 1388 /** 1389 1389 * Get the editor content. 1390 1390 * 1391 * Intended for use with editors that were initialized with wp. oldEditor.initialize().1391 * Intended for use with editors that were initialized with wp.editor.initialize(). 1392 1392 * 1393 1393 * @since 4.8.0 1394 1394 * … … 1395 1395 * @param {string} id The HTML id of the editor textarea. 1396 1396 * @return The editor content. 1397 1397 */ 1398 wp. oldEditor.getContent = function( id ) {1398 wp.editor.getContent = function( id ) { 1399 1399 var editor; 1400 1400 1401 1401 if ( ! $ || ! id ) { -
src/js/_enqueues/wp/editor/dfw.js
33 33 $sideSortables = $( '#side-sortables' ), 34 34 $postboxContainer = $( '#postbox-container-1' ), 35 35 $postBody = $('#post-body'), 36 fullscreen = window.wp. oldEditor && window.wp.oldEditor.fullscreen,36 fullscreen = window.wp.editor && window.wp.editor.fullscreen, 37 37 mceEditor, 38 38 mceBind = function(){}, 39 39 mceUnbind = function(){}, … … 1603 1603 } 1604 1604 1605 1605 window.wp = window.wp || {}; 1606 window.wp. oldEditor = window.wp.oldEditor || {};1607 window.wp. oldEditor.dfw = {1606 window.wp.editor = window.wp.editor || {}; 1607 window.wp.editor.dfw = { 1608 1608 activate: activate, 1609 1609 deactivate: deactivate, 1610 1610 isActive: isActive, -
src/wp-includes/class-wp-editor.php
970 970 <script type="text/javascript"> 971 971 window.wp = window.wp || {}; 972 972 window.wp.editor = window.wp.editor || {}; 973 window.wp.oldEditor = window.wp.oldEditor || {}; 974 975 // Add getDefaultSettings() to both wp.editor and wp.oldEditor for back compat. 976 // Use of wp.editor for "old editor" functionality should be deprecated. 977 window.wp.editor.getDefaultSettings = window.wp.oldEditor.getDefaultSettings = function() { 973 window.wp.editor.getDefaultSettings = function() { 978 974 return { 979 975 tinymce: <?php echo $settings; ?>, 980 976 quicktags: { -
src/wp-includes/general-template.php
3524 3524 * Outputs the editor scripts, stylesheets, and default settings. 3525 3525 * 3526 3526 * The editor can be initialized when needed after page load. 3527 * See wp. oldEditor.initialize() in wp-admin/js/editor.js for initialization options.3527 * See wp.editor.initialize() in wp-admin/js/editor.js for initialization options. 3528 3528 * 3529 3529 * @uses _WP_Editors 3530 3530 * @since 4.8.0