Ticket #29048: 29048.4.patch
| File 29048.4.patch, 3.6 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/js/mce-view.js
124 124 }, 125 125 /* jshint scripturl: true */ 126 126 setIframes: function ( html ) { 127 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 127 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver, 128 importStyles = this.type === 'video' || this.type === 'audio' || this.type === 'playlist'; 128 129 129 130 if ( html.indexOf( '<script' ) !== -1 ) { 130 131 this.getNodes( function ( editor, node, content ) { 131 132 var dom = editor.dom, 133 styles = '', 134 bodyClasses = editor.getBody().className || '', 132 135 iframe, iframeDoc, i, resize; 133 136 134 137 content.innerHTML = ''; 135 138 139 if ( importStyles ) { 140 if ( ! wp.mce.views.sandboxStyles ) { 141 tinymce.each( dom.$( 'link[rel="stylesheet"]', editor.getDoc().head ), function( link ) { 142 if ( link.href && link.href.indexOf( 'skins/lightgray/content.min.css' ) === -1 && 143 link.href.indexOf( 'skins/wordpress/wp-content.css' ) === -1 ) { 144 145 styles += dom.getOuterHTML( link ) + '\n'; 146 } 147 }); 148 149 wp.mce.views.sandboxStyles = styles; 150 } else { 151 styles = wp.mce.views.sandboxStyles; 152 } 153 } 154 136 155 // Seems Firefox needs a bit of time to insert/set the view nodes, or the iframe will fail 137 156 // especially when switching Text => Visual. 138 157 setTimeout( function() { … … 156 175 '<html>' + 157 176 '<head>' + 158 177 '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' + 178 styles + 159 179 '<style>' + 160 180 'html {' + 161 181 'background: transparent;' + … … 164 184 '}' + 165 185 'body#wpview-iframe-sandbox {' + 166 186 'background: transparent;' + 167 'padding: 1px 0 ;' +168 'margin: -1px 0 0 ;' +187 'padding: 1px 0 !important;' + 188 'margin: -1px 0 0 !important;;' + 169 189 '}' + 170 190 '</style>' + 171 191 '</head>' + 172 '<body id="wpview-iframe-sandbox" >' +192 '<body id="wpview-iframe-sandbox" class="' + bodyClasses + '">' + 173 193 html + 174 194 '</body>' + 175 195 '</html>' -
src/wp-includes/media.php
3310 3310 */ 3311 3311 function wpview_media_sandbox_styles() { 3312 3312 $version = 'ver=' . $GLOBALS['wp_version']; 3313 $open_sans = "//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=$version";3314 $dashicons = includes_url( "css/dashicons.css?$version" );3315 3313 $mediaelement = includes_url( "js/mediaelement/mediaelementplayer.min.css?$version" ); 3316 3314 $wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" ); 3317 3315 3318 /** 3319 * For use by themes that need to override the styling of MediaElement based previews in the Visual editor. 3320 * Not intended for adding editor-style.css. Ideally these styles will be applied by using 3321 * the 'seamless' iframe attribute in the future. 3322 * 3323 * @since 4.0 3324 * 3325 * @param array The URLs to the stylesheets that will be loaded in the sandbox iframe. 3326 */ 3327 return apply_filters( 'wpview_media_sandbox_styles', array( $open_sans, $dashicons, $mediaelement, $wpmediaelement ) ); 3316 return array( $mediaelement, $wpmediaelement ); 3328 3317 }