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:
parent
cee3560f49
commit
afdb25bd56
|
@ -156,8 +156,18 @@ window.wp = window.wp || {};
|
||||||
'<html>' +
|
'<html>' +
|
||||||
'<head>' +
|
'<head>' +
|
||||||
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' +
|
'<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>' +
|
'</head>' +
|
||||||
'<body data-context="iframe-sandbox" style="padding: 0; margin: 0;" class="' + editor.getBody().className + '">' +
|
'<body id="wpview-iframe-sandbox">' +
|
||||||
html +
|
html +
|
||||||
'</body>' +
|
'</body>' +
|
||||||
'</html>'
|
'</html>'
|
||||||
|
@ -166,7 +176,7 @@ window.wp = window.wp || {};
|
||||||
|
|
||||||
resize = function() {
|
resize = function() {
|
||||||
// Make sure the iframe still exists.
|
// Make sure the iframe still exists.
|
||||||
iframe.contentWindow && $( iframe ).height( $( iframeDoc.body ).height() );
|
iframe.contentWindow && $( iframe ).height( $( iframeDoc.body ).outerHeight() );
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( MutationObserver ) {
|
if ( MutationObserver ) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3310,18 +3310,9 @@ function attachment_url_to_postid( $url ) {
|
||||||
*/
|
*/
|
||||||
function wp_media_mce_styles() {
|
function wp_media_mce_styles() {
|
||||||
$version = 'ver=' . $GLOBALS['wp_version'];
|
$version = 'ver=' . $GLOBALS['wp_version'];
|
||||||
$tinymce = includes_url( "js/tinymce/skins/lightgray/content.min.css?$version" );
|
|
||||||
$dashicons = includes_url( "css/dashicons.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" );
|
$mediaelement = includes_url( "js/mediaelement/mediaelementplayer.min.css?$version" );
|
||||||
$wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" );
|
$wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" );
|
||||||
|
|
||||||
$mce_styles = array( $tinymce, $dashicons, $skin, $mediaelement, $wpmediaelement );
|
return array( $dashicons, $mediaelement, $wpmediaelement );
|
||||||
$editor_styles = get_editor_stylesheets();
|
}
|
||||||
if ( ! empty( $editor_styles ) ) {
|
|
||||||
foreach ( $editor_styles as $style ) {
|
|
||||||
$mce_styles[] = $style;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $mce_styles;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue