百度ueditor一些使用技巧

在网站项目中新建一个目录ueditor1,把editor_all.js、editor_all_min.js、editor_config.js文件和net、dialogs、themes、third-party、_src目录放到ueditor1目录中。

注:最开始用的目录名是ueditor,在上传图片时出现问题,所以目录命名时要注意。

修改editor_config.js文件,

URL = "/ueditor1/"; //就是自己建的目录名称;

 

<textarea id="myEditor" cols="20" rows="2" style="width:800px;" runat="server">
<p>ueditor Demo</p>
</textarea>
<script type="text/javascript">
// 自定义的编辑器配置项,此处定义的配置项将覆盖editor_config.js中的同名配置
var editorOption = {
//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
//toolbars: [['FullScreen', 'Source', 'Undo', 'Redo', 'Bold']],
//focus时自动清空初始化时的内容
//autoClearinitialContent: true,
//关闭字数统计
wordCount: true,
//关闭elementPath
elementPathEnabled: false
//更多其他参数,请参考editor_config.js中的配置项
};
var editor_a = new baidu.editor.ui.Editor(editorOption);
editor_a.render('myEditor');
</script>

 

 下载的代码中net目录中的web.config被我删除掉了,要不然项目编译不能通过

toolbars:可以自定义ueditor的按钮和功能。
可以在editor_config.js文件中看到每个按钮的功能说明,其实就是鼠标指向按钮的说明文字。
            'anchor': '锚点', 'undo': '撤销', 'redo': '重做', 'bold': '加粗', 'indent': '首行缩进', 'snapscreen': '截图',
            'italic': '斜体', 'underline': '下划线', 'strikethrough': '删除线', 'subscript': '下标',
            'superscript': '上标', 'formatmatch': '格式刷', 'source': '源代码', 'blockquote': '引用',
            'pasteplain': '纯文本粘贴模式', 'selectall': '全选', 'print': '打印', 'preview': '预览',
            'horizontal': '分隔线', 'removeformat': '清除格式', 'time': '时间', 'date': '日期',
            'unlink': '取消链接', 'insertrow': '前插入行', 'insertcol': '前插入列', 'mergeright': '右合并单元格', 'mergedown': '下合并单元格',
            'deleterow': '删除行', 'deletecol': '删除列', 'splittorows': '拆分成行', 'splittocols': '拆分成列', 'splittocells': '完全拆分单元格',
            'mergecells': '合并多个单元格', 'deletetable': '删除表格', 'insertparagraphbeforetable': '表格前插行', 'cleardoc': '清空文档',
            'fontfamily': '字体', 'fontsize': '字号', 'paragraph': '段落格式', 'insertimage': '图片', 'inserttable': '表格', 'link': '超链接',
            'emotion': '表情', 'spechars': '特殊字符', 'searchreplace': '查询替换', 'map': 'Baidu地图', 'gmap': 'Google地图',
            'insertvideo': '视频', 'help': '帮助', 'justifyleft': '居左对齐', 'justifyright': '居右对齐', 'justifycenter': '居中对齐',
            'justifyjustify': '两端对齐', 'forecolor': '字体颜色', 'backcolor': '背景色', 'insertorderedlist': '有序列表',
            'insertunorderedlist': '无序列表', 'fullscreen': '全屏', 'directionalityltr': '从左向右输入', 'directionalityrtl': '从右向左输入',
            'RowSpacingTop': '段前距', 'RowSpacingBottom': '段后距', 'highlightcode': '插入代码', 'pagebreak': '分页', 'insertframe': '插入Iframe', 'imagenone': '默认',
            'imageleft': '左浮动', 'imageright': '右浮动', 'attachment': '附件', 'imagecenter': '居中', 'wordimage': '图片转存',
            'lineheight': '行间距', 'customstyle': '自定义标题', 'autotypeset': '自动排版', 'webapp': '百度应用'

 

相关文章:百度文本编辑器ueditor v1.2.3.0使用方法及配置

 
posted @ 2012-06-13 14:58  寂静之秋  阅读(7777)  评论(0编辑  收藏  举报
哈尔滨八零网