使用UEditor
在http://ueditor.baidu.com/website/上下载官方文件
文本编辑器的配置文件在ueditor.config.js
需要注意一下几点
首先
var URL = window.UEDITOR_HOME_URL || getUEBasePath();
这里是获取文件的基本安装目录,如果将代码放在服务器上时,发现无法加载下来,可以直接将替换这个地址
替换如下
window.UEDITOR_HOME_URL = "/xxxx/xxxx/";
还有修改工具栏的功能选项
, toolbars:[
['fullscreen', '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', '|',
'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', 'preview', 'searchreplace', 'help', 'drafts']
]
这里的功能繁多,可以根据自己的需要修改
有时候我们根据不同的页面,需要的功能不一样,也可以在页面初始化的时候,对这个进行修改
var editor = new baidu.editor.ui.Editor({initialFrameHeight:320,toolbars:[
['fullscreen', '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', '|',
'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', 'preview', 'searchreplace', 'help', 'drafts']
]});
editor.render('editor');
工具栏的配置向对应的功能
分组 |
全屏 FullScreen
源代码 Source
撤销 Undo
重做
Redo
加粗 Bold
斜体 Italic
Border
上标 Superscript
下标 Subscript
清除格式
RemoveFormat
引用 BlockQuote
纯文本粘贴模式 PastePlain
文字颜色 ForeColor
背景颜**ackColor
有序列表 InsertOrderedList
无序列表 InsertUnorderedList
下划线
Underline
格式 Paragraph
字体 FontFamily
字体大小 FontSize
从左读
DirectionalityLtr
从右读 DirectionalityRtl
左对齐 JustifyLeft
居中对齐
JustifyCenter
右对齐 JustifyRight
两端对齐 JustifyJustify
添加外连 Link
清除外连
Unlink
添加图片 Image
特殊字符 Spechars
添加表情 Emoticon
添加视频 Video
添加地图
Map
分割线 Horizontal
添加日期 Date
添加时间 Time
删除表格 InsertTable
删除表格
DeleteTable
向表格前插入行 InsertParagraphBeforeTable
向前插入行 InsertRow
删除行
DeleteRow
向前插入列 InsertCol
删除列 DeleteCol
合并多个单元格 MergeCells
向右合并单元格
MergeRight
向下合并单元格 MergeDown
完全拆分单元格 SplittoCells
拆分成行
SplittoRows
拆分成列 SplittoCols
全选 SelectAll
清空文档 ClearDoc
替换查询
SearchReplace
打印 Print
预览 Preview
帮助 Help
使用UEditor的更多相关文章
- 在ASP.NET Core中使用百度在线编辑器UEditor
在ASP.NET Core中使用百度在线编辑器UEditor 0x00 起因 最近需要一个在线编辑器,之前听人说过百度的UEditor不错,去官网下了一个.不过服务端只有ASP.NET版的,如果是为了 ...
- 对百度的UEditor多图片上传的一些补充
我已经写了一篇文章关于百度的UEditor提取多图片上传模块.如果还没有看过,请点击以下链接查看 http://www.cnblogs.com/luke1006/p/3719029.html 出差了两 ...
- 关于百度编辑器UEditor的一点说明
大家在使用的时候要特别注意editor_config.js中的“URL”这个参数 我的理解:1.这个参数是editor整个结构的总路径 2.首先要把这个路径配置好了.才能正常的显示, ...
- UEditor编辑器使用示例
1. UEditor下载 UEditor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码. 下载链接:http ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统(57)-插件---ueditor使用
系列目录 目录: 前言 开发环境 知识点 初始使用 自定义工具栏 设置和读取编辑器内容 文件上传 ueditor加水印 ---------------------------------------- ...
- UEditor百度富文本编辑器--让编辑器自适应宽度的解决方案
UEditor百度富文本编辑器的initialFrameWidth属性,默认值是1000. 不能够自适应屏幕宽度.如图1: 刚开始的时候,我是直接设置initialFrameWidth=null的.效 ...
- UEditor百度富文本编辑器--preview在线预览时头部被挡住的解决方案
问题截图: 正常情况应该是如下显示: 解决方案: 1.打开ueditor/dialogs/preview/preview.html 2.找到body节点下面这一句 document.getElemen ...
- 百度编辑器UEditor与UEditor 公式插件完整Demo
1.下载UEditor(我的是.net项目) 2.下载UEditor公式插件 3.新建解决方案和项目 4.在浏览器中预览index.html页面 结果: 5.index.html源码 <!DOC ...
- Ueditor上传图片后自定义样式类名
Ueditor是百度的一个富文本插件,如果使用者会前端语言的话,那适用性就很好,特别是现在移动端纵横的情况.但往往使用者并不懂编程,要让他们使用前端语言的话是不可能的,这就需要我们在开发时就定义好整个 ...
- easyui与ueditor合用问题
在联合使用easyui与ueditor的时候,当在dialog中通过href打开一个页面,页面中含有ueditor,如果使用dialog的close方法,可以理解为只是将dialog给隐藏了,再将点击 ...
随机推荐
- linux系统时间和硬件时钟问题(date和hwclock)
http://blog.chinaunix.net/uid-182041-id-3464524.html http://blog.csdn.net/duyiwuer2009/article/detai ...
- LeetCode_Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2 ...
- IC卡接口芯片TDA8007的读写器设计
摘要:阐述T=0传输协议,给出IC卡读写器中使用的IC卡APDU指令流程和原理框图:重点介绍其中的IC卡接口芯片Philips的TDA8007,给出通过TDA8007对CPU IC卡上下电过程.具体程 ...
- NSIS操作系统环境变量
手头有个项目需要修改PATH变量 需要!include "EnvVarUpdate.nsh" 以下是NSIS脚本代码 ; Script generated by the HM NI ...
- Linux sleep命令 和 wait命令
man sleep: SLEEP(1) User Commands SLEEP(1) NAME sleep - delay for a specified amount of time SYNOPSI ...
- 【转】在ubuntu12.04中安装wine和sourceinsight
PS: 用wine其实还可以在Linux下运行其他Windows软件,比如BeyondCompare,过程是一样的 原文网址:http://www.2cto.com/os/201408/322370. ...
- libeXosip2(2-3) -- eXosip2 event API
eXosip2 event API General purpose API. Data Structures struct eXosip_event Enumerations enum eXo ...
- 最快速的“高斯”模糊算法(附Android源码)
这是一个外国人的算法,本人是搬运工.参考:http://blog.ivank.net/fastest-gaussian-blur.html 1:高斯模糊算法(参考:http://www.rua ...
- python删除指定位置 2个元素
# -*- coding: utf-8 -*-__author__ = 'Administrator'import bisect#排序说明:http://en.wikipedia.org/wiki/i ...
- Three Families
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...