diff --git a/wp-includes/js/mce-view.js b/wp-includes/js/mce-view.js index 9217b30373..56a858307a 100644 --- a/wp-includes/js/mce-view.js +++ b/wp-includes/js/mce-view.js @@ -132,6 +132,7 @@ window.wp = window.wp || {}; frameBorder: '0', allowTransparency: 'true', scrolling: 'no', + 'class': 'wpview-sandbox', style: { width: '100%', display: 'block' @@ -554,9 +555,10 @@ window.wp = window.wp || {}; pausePlayers: function() { this.getNodes( function( editor, node, content ) { - var p, win = $( 'iframe', content ).get(0).contentWindow; + var p, win, + iframe = $( 'iframe.wpview-sandbox', content ).get(0); - if ( win && win.mejs ) { + if ( iframe && ( win = iframe.contentWindow ) && win.mejs ) { for ( p in win.mejs.players ) { win.mejs.players[p].pause(); } @@ -566,9 +568,10 @@ window.wp = window.wp || {}; unsetPlayers: function() { this.getNodes( function( editor, node, content ) { - var p, win = $( 'iframe', content ).get(0).contentWindow; + var p, win, + iframe = $( 'iframe.wpview-sandbox', content ).get(0); - if ( win && win.mejs ) { + if ( iframe && ( win = iframe.contentWindow ) && win.mejs ) { for ( p in win.mejs.players ) { win.mejs.players[p].remove(); } diff --git a/wp-includes/js/mce-view.min.js b/wp-includes/js/mce-view.min.js index 63aee624d8..ff1c753e31 100644 --- a/wp-includes/js/mce-view.min.js +++ b/wp-includes/js/mce-view.min.js @@ -1 +1 @@ -window.wp=window.wp||{},function(a){"use strict";var b={},c={},d=wp.media,e=["encodedText"];wp.mce=wp.mce||{},wp.mce.View=function(a){a=a||{},this.type=a.type,_.extend(this,_.pick(a,e)),this.initialize.apply(this,arguments)},_.extend(wp.mce.View.prototype,{initialize:function(){},getHtml:function(){return""},loadingPlaceholder:function(){return'
',"wrap"),a(this).trigger("ready")},unbind:function(){},getEditors:function(a){var b=[];return _.each(tinymce.editors,function(c){c.plugins.wpview&&(a&&a(c),b.push(c))},this),b},getNodes:function(b){var c=[],d=this;return this.getEditors(function(e){a(e.getBody()).find('[data-wpview-text="'+d.encodedText+'"]').each(function(d,f){b&&b(e,f,a(f).find(".wpview-content").get(0)),c.push(f)})}),c},setContent:function(a,b){this.getNodes(function(c,d,e){var f="wrap"===b||"replace"===b?d:e,g=a;_.isString(g)&&(g=c.dom.createFragment(g)),"replace"===b?c.dom.replace(g,f):(f.innerHTML="",f.appendChild(g))})},setIframes:function(b){var c=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;-1!==b.indexOf("