TinyMCE wpView sandbox iframes:

- Make them transparent.
- Don't load tons of unrelated styles that can break them. This could result in minimal styling mismatch to the front-end, but keeps the views working well and looking good.
Props avryl, fixes #29048.
Built from https://develop.svn.wordpress.org/trunk@29543


git-svn-id: http://core.svn.wordpress.org/trunk@29319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-08-19 21:53:15 +00:00
parent cee3560f49
commit afdb25bd56
3 changed files with 15 additions and 14 deletions

View File

@ -156,8 +156,18 @@ window.wp = window.wp || {};
'<html>' +
'<head>' +
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' +
'<style>' +
'html, body#wpview-iframe-sandbox {' +
'background: transparent;' +
'padding: 0;' +
'margin: 0;' +
'}' +
'body#wpview-iframe-sandbox {' +
'padding: 1px 0;' +
'}' +
'</style>' +
'</head>' +
'<body data-context="iframe-sandbox" style="padding: 0; margin: 0;" class="' + editor.getBody().className + '">' +
'<body id="wpview-iframe-sandbox">' +
html +
'</body>' +
'</html>'
@ -166,7 +176,7 @@ window.wp = window.wp || {};
resize = function() {
// Make sure the iframe still exists.
iframe.contentWindow && $( iframe ).height( $( iframeDoc.body ).height() );
iframe.contentWindow && $( iframe ).height( $( iframeDoc.body ).outerHeight() );
};
if ( MutationObserver ) {

File diff suppressed because one or more lines are too long

View File

@ -3310,18 +3310,9 @@ function attachment_url_to_postid( $url ) {
*/
function wp_media_mce_styles() {
$version = 'ver=' . $GLOBALS['wp_version'];
$tinymce = includes_url( "js/tinymce/skins/lightgray/content.min.css?$version" );
$dashicons = includes_url( "css/dashicons.css?$version" );
$skin = includes_url( "js/tinymce/skins/wordpress/wp-content.css?$version" );
$mediaelement = includes_url( "js/mediaelement/mediaelementplayer.min.css?$version" );
$wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" );
$mce_styles = array( $tinymce, $dashicons, $skin, $mediaelement, $wpmediaelement );
$editor_styles = get_editor_stylesheets();
if ( ! empty( $editor_styles ) ) {
foreach ( $editor_styles as $style ) {
$mce_styles[] = $style;
}
}
return $mce_styles;
}
return array( $dashicons, $mediaelement, $wpmediaelement );
}