var editor = new baidu.editor.ui.Editor(
{
toolbars:[ [ 'FullScreen', 'Source', '|', 'Undo', 'Redo', '|', 'Bold', 'Italic', 'Underline', 'StrikeThrough', 'Superscript', 'Subscript', 'RemoveFormat', 'FormatMatch', '|', 'PastePlain', '|', 'ForeColor', 'BackColor', 'InsertOrderedList', 'InsertUnorderedList', '|', 'CustomStyle', 'Paragraph', 'RowSpacing', 'LineHeight', 'FontFamily', 'FontSize', '|', 'DirectionalityLtr', 'DirectionalityRtl', '|', 'Anchor', 'SearchReplace','|', 'Preview','JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyJustify', '|','Indent', 'Link', 'Unlink', '|', 'ImageNone', 'ImageLeft', 'ImageRight', 'ImageCenter', '|', 'InsertImage', 'Emotion', 'InsertVideo', 'Map', 'GMap', 'InsertFrame', 'HighlightCode', '|', 'Horizontal', 'Date', 'Time', 'Spechars', '|', 'InsertTable', 'DeleteTable', 'InsertParagraphBeforeTable', 'InsertRow', 'DeleteRow', 'InsertCol', 'DeleteCol', 'MergeCells', 'MergeRight', 'MergeDown', 'SplittoCells', 'SplittoRows', 'SplittoCols', '|', 'SelectAll', 'ClearDoc', 'CheckImage', 'Help'] ], //这些代码可以不要 initialContent: '',imagePath:"/qiusuo/admin/", //图片调用路径,和上传路径一样,uditor/editor_config.js里面的图片调用屏蔽,直接在这里实现了,后面会详细讲
textarea:'content' //
content
这里是内容
}
);
editor.render("myEditor");
//这里输出内容
var editor = new baidu.editor.ui.Editor(
{
toolbars:[
[ 'FullScreen', 'Source', '|', 'Undo', 'Redo', '|',
'Bold', 'Italic', 'Underline', 'StrikeThrough', 'Superscript', 'Subscript', 'RemoveFormat', 'FormatMatch', '|',
'PastePlain', '|', 'ForeColor', 'BackColor', 'InsertOrderedList', 'InsertUnorderedList', '|', 'CustomStyle',
'Paragraph', 'RowSpacing', 'LineHeight', 'FontFamily', 'FontSize', '|',
'DirectionalityLtr', 'DirectionalityRtl', '|', 'Anchor', 'SearchReplace','|',
'Preview','JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyJustify', '|','Indent',
'Link', 'Unlink', '|', 'ImageNone', 'ImageLeft', 'ImageRight', 'ImageCenter', '|', 'InsertImage', 'Emotion', 'InsertVideo', 'Map', 'GMap', 'InsertFrame', 'HighlightCode', '|',
'Horizontal', 'Date', 'Time', 'Spechars', '|',
'InsertTable', 'DeleteTable', 'InsertParagraphBeforeTable', 'InsertRow', 'DeleteRow', 'InsertCol', 'DeleteCol', 'MergeCells', 'MergeRight', 'MergeDown', 'SplittoCells', 'SplittoRows', 'SplittoCols', '|',
'SelectAll', 'ClearDoc', 'CheckImage', 'Help']
],
initialContent: '',
imagePath:"/qiusuo/admin/", //图片调用路径
textarea:'content'
}
);
editor.render("myEditor");