Ticket #45264: 45264.3.diff
File 45264.3.diff, 4.3 KB (added by , 6 years ago) |
---|
-
src/wp-includes/css/editor.css
361 361 margin: 0; 362 362 } 363 363 364 /* Classic block hide/show toolbars */ 365 .block-library-classic__toolbar .mce-toolbar-grp .mce-toolbar:not(:first-child) { 366 display: none; 367 } 368 369 .block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar { 370 display: block; 371 } 372 364 373 div.mce-statusbar { 365 374 border-top: 1px solid #e5e5e5; 366 375 } -
src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
20 20 21 21 function toggleToolbars( state ) { 22 22 var iframe, initial, toolbars, 23 pixels = 0; 23 pixels = 0, 24 classicBlockToolbar = tinymce.$( '.block-library-classic__toolbar' ); 24 25 25 initial = ( state === 'hide' ); 26 if ( state === 'hide' ) { 27 initial = true; 28 } else if ( classicBlockToolbar.length && ! classicBlockToolbar.hasClass( 'has-advanced-toolbar' ) ) { 29 // Show the second, third, etc. toolbar rows in the Classic block instance. 30 classicBlockToolbar.addClass( 'has-advanced-toolbar' ); 31 state = 'show'; 32 } 26 33 27 34 if ( editor.theme.panel ) { 28 35 toolbars = editor.theme.panel.find('.toolbar:not(.menubar)'); 29 36 } 30 37 31 if ( ! toolbars || toolbars.length < 2 || ( state === 'hide' && ! toolbars[1].visible() ) ) { 32 return; 38 if ( toolbars && toolbars.length > 1 ) { 39 if ( ! state && toolbars[1].visible() ) { 40 state = 'hide'; 41 } 42 43 each( toolbars, function( toolbar, i ) { 44 if ( i > 0 ) { 45 if ( state === 'hide' ) { 46 toolbar.hide(); 47 pixels += 30; 48 } else { 49 toolbar.show(); 50 pixels -= 30; 51 } 52 } 53 }); 33 54 } 34 55 35 if ( ! state && toolbars[1].visible() ) { 36 state = 'hide'; 56 // Resize editor iframe, not needed for iOS and inline instances. 57 if ( pixels && ! tinymce.Env.iOS && editor.iframeElement ) { 58 DOM.setStyle( editor.iframeElement, 'height', editor.iframeElement.clientHeight + pixels ); 37 59 } 38 60 39 each( toolbars, function( toolbar, i ) { 40 if ( i > 0 ) { 41 if ( state === 'hide' ) { 42 toolbar.hide(); 43 pixels += 30; 44 } else { 45 toolbar.show(); 46 pixels -= 30; 47 } 48 } 49 }); 50 51 if ( pixels && ! initial ) { 52 // Resize iframe, not needed in iOS 53 if ( ! tinymce.Env.iOS ) { 54 iframe = editor.getContentAreaContainer().firstChild; 55 DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels ); 56 } 57 61 if ( ! initial ) { 58 62 if ( state === 'hide' ) { 59 setUserSetting( 'hidetb', '0');63 setUserSetting( 'hidetb', '0' ); 60 64 wpAdvButton && wpAdvButton.active( false ); 61 65 } else { 62 setUserSetting( 'hidetb', '1');66 setUserSetting( 'hidetb', '1' ); 63 67 wpAdvButton && wpAdvButton.active( true ); 64 68 } 65 69 } … … 73 77 cmd: 'WP_Adv', 74 78 onPostRender: function() { 75 79 wpAdvButton = this; 76 wpAdvButton.active( getUserSetting( 'hidetb' ) === '1' ? true : false);80 wpAdvButton.active( getUserSetting( 'hidetb' ) === '1' ); 77 81 } 78 82 }); 79 83 … … 81 85 editor.on( 'PostRender', function() { 82 86 if ( editor.getParam( 'wordpress_adv_hidden', true ) && getUserSetting( 'hidetb', '0' ) === '0' ) { 83 87 toggleToolbars( 'hide' ); 88 } else { 89 tinymce.$( '.block-library-classic__toolbar' ).addClass( 'has-advanced-toolbar' ); 84 90 } 85 91 }); 86 92 … … 426 432 stateSelector: 'code' 427 433 }); 428 434 429 // Menubar430 435 // Insert->Add Media 431 436 if ( wp && wp.media && wp.media.editor ) { 437 editor.addButton( 'wp_add_media', { 438 tooltip: 'Add Media', 439 icon: 'dashicon dashicons-admin-media', 440 cmd: 'WP_Medialib', 441 } ); 442 432 443 editor.addMenuItem( 'add_media', { 433 444 text: 'Add Media', 434 445 icon: 'wp-media-library', -
src/wp-includes/script-loader.php
504 504 'wp_more', 505 505 'spellchecker', 506 506 'wp_add_media', 507 ' kitchensink',507 'wp_adv', 508 508 ); 509 509 510 510 /* This filter is documented in wp-includes/class-wp-editor.php */