Changeset 40019
- Timestamp:
- 01/27/2017 04:24:58 AM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r39934 r40019 3005 3005 } 3006 3006 3007 3008 3007 if ( ! empty( $no_ssl_support ) || ( is_ssl() && ( preg_match( '%<(iframe|script|embed) [^>]*src="http://%', $parsed ) || 3009 3008 preg_match( '%<link [^>]*href="http://%', $parsed ) ) ) ) { … … 3015 3014 } 3016 3015 3017 wp_send_json_success(array(3016 $return = array( 3018 3017 'body' => $parsed, 3019 3018 'attr' => $wp_embed->last_attr 3020 ) ); 3019 ); 3020 3021 if ( strpos( $parsed, 'class="wp-embedded-content' ) ) { 3022 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { 3023 $script_src = includes_url( 'js/wp-embed.js' ); 3024 } else { 3025 $script_src = includes_url( 'js/wp-embed.min.js' ); 3026 } 3027 3028 $return['head'] = '<script src="' . $script_src . '"></script>'; 3029 $return['sandbox'] = true; 3030 } 3031 3032 wp_send_json_success( $return ); 3021 3033 } 3022 3034 -
trunk/src/wp-includes/class-wp-editor.php
r39678 r40019 418 418 'wptextpattern', 419 419 'wpview', 420 'wpembed',421 420 ); 422 421 -
trunk/src/wp-includes/js/mce-view.js
r39903 r40019 469 469 */ 470 470 setContent: function( content, callback, rendered ) { 471 if ( _.isObject( content ) && content.body.indexOf( '<script' ) !== -1) {471 if ( _.isObject( content ) && ( content.sandbox || content.head || content.body.indexOf( '<script' ) !== -1 ) ) { 472 472 this.setIframes( content.head || '', content.body, callback, rendered ); 473 473 } else if ( _.isString( content ) && content.indexOf( '<script' ) !== -1 ) { … … 585 585 'content: "";' + 586 586 '}' + 587 'iframe {' + 588 'max-width: 100%;' + 589 '}' + 587 590 '</style>' + 588 591 '</head>' + … … 624 627 625 628 function reload() { 626 $( node ).data( 'rendered', null ); 627 628 setTimeout( function() { 629 wp.mce.views.render(); 630 } ); 631 } 632 633 $( iframeWin ).on( 'load', resize ).on( 'unload', reload ); 634 635 MutationObserver = iframeWin.MutationObserver || iframeWin.WebKitMutationObserver || iframeWin.MozMutationObserver; 636 637 if ( MutationObserver ) { 629 if ( ! editor.isHidden() ) { 630 $( node ).data( 'rendered', null ); 631 632 setTimeout( function() { 633 wp.mce.views.render(); 634 } ); 635 } 636 } 637 638 function addObserver() { 638 639 observer = new MutationObserver( _.debounce( resize, 100 ) ); 639 640 … … 643 644 subtree: true 644 645 } ); 646 } 647 648 $( iframeWin ).on( 'load', resize ).on( 'unload', reload ); 649 650 MutationObserver = iframeWin.MutationObserver || iframeWin.WebKitMutationObserver || iframeWin.MozMutationObserver; 651 652 if ( MutationObserver ) { 653 if ( ! iframeDoc.body ) { 654 iframeDoc.addEventListener( 'DOMContentLoaded', addObserver, false ); 655 } else { 656 addObserver(); 657 } 645 658 } else { 646 659 for ( i = 1; i < 6; i++ ) {
Note: See TracChangeset
for help on using the changeset viewer.