关于百度编辑器的一些心得
2017-03-15 13:35
429 查看
下载地址:百度编辑器
1.首先要把下载的包导入到你的项目里,然后在界面里添加引用:utf8-net/lang/zh-cn/zh-cn.js;utf8-net/ueditor.all.min.js;utf8-net/ueditor.config.js
2. js中加载:
var purchaseeditor_a;
var purchaseeditorOption = {
//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
toolbars: [[
'source', '|', 'undo', 'redo', '|',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor',
'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
'directionalityltr', 'directionalityrtl', 'indent', '|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
'print', 'searchreplace', 'help', 'drafts'
]],
//'preview',
//focus时自动清空初始化时的内容
// autoClearinitialContent: true,
//关闭elementPath
elementPathEnabled: false,
scaleEnabled: true,
//不自动保存
enableAutoSave:false
};
purchaseeditor_a = new baidu.editor.ui.Editor(purchaseeditorOption);
purchaseeditor_a.render('contents');
purchaseeditor_a.ready(function () {
});
3.关于弹出界面被遮盖:
$('.window-mask').css('z-index', '999');
$('.window-shadow').css('z-index', '1000');
$('.panel').css('z-index', '1001');
4.关于图片不显示:
找到config.json中配置
"imageUrlPrefix": "/--路径--/", /* 图片访问路径前缀 */
5.关于HTML标签存数据库中MVC报危险的值存不进去:
--web.config中加入
<system.web>
<httpRuntime requestValidationMode="2.0"/>
</system.web>
<pages validateRequest="false">
</pages>
--controller里添加
[ValidateInput(false)]
[HttpPost]
--界面添加
<%@ Page Language="C#" validateRequest="false"%>
1.首先要把下载的包导入到你的项目里,然后在界面里添加引用:utf8-net/lang/zh-cn/zh-cn.js;utf8-net/ueditor.all.min.js;utf8-net/ueditor.config.js
2. js中加载:
var purchaseeditor_a;
var purchaseeditorOption = {
//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
toolbars: [[
'source', '|', 'undo', 'redo', '|',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor',
'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
'directionalityltr', 'directionalityrtl', 'indent', '|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
'print', 'searchreplace', 'help', 'drafts'
]],
//'preview',
//focus时自动清空初始化时的内容
// autoClearinitialContent: true,
//关闭elementPath
elementPathEnabled: false,
scaleEnabled: true,
//不自动保存
enableAutoSave:false
};
purchaseeditor_a = new baidu.editor.ui.Editor(purchaseeditorOption);
purchaseeditor_a.render('contents');
purchaseeditor_a.ready(function () {
});
3.关于弹出界面被遮盖:
$('.window-mask').css('z-index', '999');
$('.window-shadow').css('z-index', '1000');
$('.panel').css('z-index', '1001');
4.关于图片不显示:
找到config.json中配置
"imageUrlPrefix": "/--路径--/", /* 图片访问路径前缀 */
5.关于HTML标签存数据库中MVC报危险的值存不进去:
--web.config中加入
<system.web>
<httpRuntime requestValidationMode="2.0"/>
</system.web>
<pages validateRequest="false">
</pages>
--controller里添加
[ValidateInput(false)]
[HttpPost]
--界面添加
<%@ Page Language="C#" validateRequest="false"%>
相关文章推荐
- 关于用百度提升网站流量的一些心得
- 关于使用Java开发工具的一些心得
- 关于Google Maps的地图类型(MapType)的一些心得
- 关于Discuz论坛架构的一些研究心得
- 关于GRIDVIEW与DETAILSVIEW的一些心得(包含DROPDOWNLIST的配合)
- 关于存储过程的ADO调用的一些心得(输出参数,返回值)
- 关于自定义客户端验证脚本同时和服务器控件关联的一些心得
- 关于GRIDVIEW与DETAILSVIEW的一些心得(包含DROPDOWNLIST的配合)
- 关于颜色格式的一些心得
- 关于AIX下机器中用到的一些心得
- 关于windows编程的一些心得 选择自 forpku 的 Blog
- 关于在非托管应用中访问托管代码一些心得
- 关于地形编辑器的一些想法
- 原创:关于一些Java开发工具的使用心得(不断更新)
- 关于c语言的数据转换的一些心得!
- 关于一些activex的心得
- 关于无aspx文件部署,我的一些探索心得
- 关于.Net Remoting以IIS发布的一些心得体会
- 关于一些Java开发工具的使用心得(不断更新)