Ticket #30619: 30619.6.patch
File 30619.6.patch, 2.7 KB (added by , 6 years ago) |
---|
-
src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
1 1 /* global tinymce */ 2 2 tinymce.PluginManager.add( 'wpeditimage', function( editor ) { 3 var floatingToolbar, serializer,3 var toolbar, serializer, 4 4 each = tinymce.each, 5 5 iOS = tinymce.Env.iOS; 6 6 … … 59 59 } ); 60 60 } ); 61 61 62 editor.once( 'preinit', function() { 63 toolbar = editor.wp._createToolbar( [ 64 'wp_img_alignleft', 65 'wp_img_aligncenter', 66 'wp_img_alignright', 67 'wp_img_alignnone', 68 'wp_img_edit', 69 'wp_img_remove' 70 ] ); 71 } ); 72 62 73 editor.on( 'wptoolbar', function( event ) { 63 74 if ( event.element.nodeName === 'IMG' && ! isPlaceholder( event.element ) ) { 64 event.toolbar = floatingToolbar;75 event.toolbar = toolbar; 65 76 } 66 77 } ); 67 78 … … 77 88 editor.nodeChanged(); 78 89 }, 200 ); 79 90 } else { 80 floatingToolbar.hide();91 toolbar.hide(); 81 92 } 82 93 } ); 83 94 } … … 544 555 545 556 dom.addClass( editor.getBody(), captionClass ); 546 557 547 if ( editor.wp._createToolbar ) {548 floatingToolbar = editor.wp._createToolbar( [549 'wp_img_alignleft',550 'wp_img_aligncenter',551 'wp_img_alignright',552 'wp_img_alignnone',553 'wp_img_edit',554 'wp_img_remove'555 ] );556 }557 558 558 // Add caption field to the default image dialog 559 559 editor.on( 'wpLoadImageForm', function( event ) { 560 560 if ( editor.getParam( 'wpeditimage_disable_captions' ) ) { … … 867 867 editor.nodeChanged(); 868 868 event.preventDefault(); 869 869 870 if ( floatingToolbar ) {871 floatingToolbar.reposition();870 if ( toolbar ) { 871 toolbar.reposition(); 872 872 } 873 873 874 874 editor.fire( 'ExecCommand', { -
src/wp-includes/js/tinymce/plugins/wpview/plugin.js
240 240 selection = editor.selection, 241 241 MutationObserver = window.MutationObserver || window.WebKitMutationObserver; 242 242 243 toolbar = editor.wp._createToolbar( [244 'wp_view_edit',245 'wp_view_remove'246 ] );247 248 243 // When a view is selected, ensure content that is being pasted 249 244 // or inserted is added to a text node (instead of the view). 250 245 editor.on( 'BeforeSetContent', function() { … … 673 668 } 674 669 } ); 675 670 671 editor.once( 'preinit', function() { 672 toolbar = editor.wp._createToolbar( [ 673 'wp_view_edit', 674 'wp_view_remove' 675 ] ); 676 } ); 677 676 678 editor.on( 'wptoolbar', function( event ) { 677 679 if ( selected ) { 678 680 event.element = selected;