当我在微小的mce编辑器中更改字体大小或字体样式并点击保存并查看我的页面时,它会在表单上显示正确的字体大小和样式。
当我再次打开编辑器时,编辑器不显示正确的字体大小或样式。
(仅限IE9问题).IE9不显示之前选择和保存的fone的样式和大小。 firefox显示正确。
HTML
<textarea class="news-copy"
data-bind="
tinymce: Copy,
tinymceOptions: {
plugins: 'paste,searchreplace',
content_css: 'Styles/ControlCSS/MainPage.css',
toolbar2: 'fontselect,fontsizeselect',
menubar: false,
statusbar: false,
browser_spellcheck: true,
valid_elements: '',
body_class: 'mainpage-container-text'
},
autoActivate: false">
</textarea>
IE9
火狐 似乎有些清理实用程序正在IE中删除带有字体大小的span标记。
<html>
<head xmlns="http://www.w3.org/1999/xhtml">
<meta content="IE=7" http-equiv="X-UA-Compatible">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<link rel="stylesheet" type="text/css" href="http://localhost/myapplication/Scripts/tiny_mce/themes/advanced/skins/o2k7/content.css">
<link rel="stylesheet" type="text/css" href="http://localhost/myapplication/Styles/ControlCSS/MainPage.css">
</head>
<body dir="ltr" id="tinymce" onload="window.parent.tinyMCE.get('mce_0').onLoad.dispatch();" class="mceContentBody mainpage-container-text" contentEditable="true">
<p>Hello Test Test1
</p>
</body>
Firefox- firebug
<html>
<head xmlns="http://www.w3.org/1999/xhtml">
<meta content="IE=7" http-equiv="X-UA-Compatible">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<link href="http://localhost/myapplication/Scripts/tiny_mce/themes/advanced/skins/o2k7/content.css" rel="stylesheet" type="text/css">
<link href="http://localhost/myapplication/Styles/ControlCSS/MainPage.css" rel="stylesheet" type="text/css">
</head>
<body contenteditable="true" onload="window.parent.tinyMCE.get('mce_0').onLoad.dispatch();" class="mceContentBody mainpage-container-text" id="tinymce" spellcheck="false" dir="ltr">
<p>Hello
<span data-mce-style="font-size: 14pt;" style="font-size: 14pt;">Test </span>
<span data-mce-style="font-size: 18pt;" style="font-size: 18pt;">Test1</span>
</p>
</body>
微小的MCE配置
tinymceOptions: {
// Default Theme options:
// "setup" can not be overridden instead use onBeforeTinyMCESetup and onAfterTinyMCESetup
mode: 'none',
theme: 'advanced',
plugins: 'paste,searchreplace,legacyoutput',
skin: 'o2k7',
skin_variant: 'silver',
content_css: '../../Styles/RadEditor_CourierNew.css',
paste_auto_cleanup_on_paste: true,
valid_elements: '@[align],b/strong,i/em,strike/s,u,br,p,div',
theme_advanced_buttons1:
'bold,italic,underline,strikethrough,' +
'|,cut,copy,paste,selectall,' +
'|,undo,redo,' +
'|,justifyleft,justifycenter,justifyright,justifyfull,' +
'|,search,replace,help,spellcheck',
theme_advanced_buttons2: '',
theme_advanced_buttons3: '',
theme_advanced_toolbar_location: 'top',
theme_advanced_toolbar_align: 'left'
},
radSpellCheckID: null,
onBeforeTinyMCESetup: null,
onAfterTinyMCESetup: null,
onTinyMCEBlur: null,
delayEditorDisplay: true,
htmlEncode: true,
displayFontFamily: 'Arial, Helvetica, sans-serif',
displayFontSize: '11px'
};
答案 0 :(得分:0)
value = ko.utils.unwrapObservable(valueAccessor());
ed.onInit.add(function(ed) {
$element.tinymce().setContent(value, { format: 'raw' });
});