Ticket #31464: 31464.4.patch
| File 31464.4.patch, 2.4 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/js/mce-view.js
461 461 * @param {Boolean} rendered Only set for (un)rendered nodes. Optional. 462 462 */ 463 463 setIframes: function( head, body, callback, rendered ) { 464 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver, 465 importStyles = this.type === 'video' || this.type === 'audio' || this.type === 'playlist'; 464 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 466 465 467 466 this.getNodes( function( editor, node, content ) { 468 467 // Seems Firefox needs a bit of time to insert/set the view nodes, … … 473 472 bodyClasses = editor.getBody().className || '', 474 473 iframe, iframeDoc, observer, i; 475 474 476 if ( importStyles ) { 477 if ( ! wp.mce.views.sandboxStyles ) { 478 tinymce.each( dom.$( 'link[rel="stylesheet"]', editor.getDoc().head ), function( link ) { 479 if ( link.href && link.href.indexOf( 'skins/lightgray/content.min.css' ) === -1 && 480 link.href.indexOf( 'skins/wordpress/wp-content.css' ) === -1 ) { 481 482 styles += dom.getOuterHTML( link ) + '\n'; 483 } 484 }); 485 486 wp.mce.views.sandboxStyles = styles; 487 } else { 488 styles = wp.mce.views.sandboxStyles; 475 tinymce.each( dom.$( 476 'link[rel="stylesheet"]', 477 editor.getDoc().getElementsByTagName( 'head' )[0] 478 ), function( link ) { 479 if ( 480 link.href && 481 link.href.indexOf( 'skins/lightgray/content.min.css' ) >= 0 && 482 link.href.indexOf( 'skins/wordpress/wp-content.css' ) >= 0 483 ) { 484 styles += dom.getOuterHTML( link ); 489 485 } 490 } 486 } ); 491 487 492 488 content.innerHTML = ''; 493 489 … … 580 576 iframeDoc.body.className = editor.getBody().className; 581 577 } 582 578 583 if ( importStyles ) { 584 editor.on( 'wp-body-class-change', classChange ); 579 editor.on( 'wp-body-class-change', classChange ); 585 580 586 $( node ).one( 'wp-mce-view-unbind', function() { 587 editor.off( 'wp-body-class-change', classChange ); 588 } ); 589 } 581 $( node ).one( 'wp-mce-view-unbind', function() { 582 editor.off( 'wp-body-class-change', classChange ); 583 } ); 590 584 591 585 callback && callback.apply( this, arguments ); 592 586 }, 50 );