百度编辑器UEditor常用设置函数

来源:互联网 发布:淘宝到家是干嘛的 编辑:程序博客网 时间:2024/05/17 03:54

最近在研究UEditor的使用,下面是附上传送门:

  • 这是API文档http://ueditor.baidu.com/doc/
  • 这是下载地址http://ueditor.baidu.com/website/download.html
  • 这是java后台配置JSP的使用说明 http://fex.baidu.com/ueditor/#server-jsp

在线文档对UEditor说明不够全面,收集了一些常用的方法和基本设置,以供参考。

1、创建编辑器
UE.getEditor(‘editor’, {
initialFrameWidth:”100%” //初始化选项
})
精简版
UE.getEditor(‘editor’)


2、删除编辑器
UE.getEditor(‘editor’).destroy();


3、设置焦点
UE.getEditor(‘editor’).focus();


4、获取编辑器内容
UE.getEditor(‘editor’).getContent()


5、编辑器是否有内容
UE.getEditor(‘editor’).hasContents()


6、获取编辑器内容纯文本格式
UE.getEditor(‘editor’).getContentTxt()


7、获取带格式的纯文本
UE.getEditor(‘editor’).getPlainTxt()


8、启用编辑器
UE.getEditor(‘editor’).setEnabled();


9、禁止编辑
UE.getEditor(‘editor’).setDisabled(‘fullscreen’);


10、获取整个html内容
UE.getEditor(‘editor’).getAllHtml()


11、常用设置
imageUrl:UEDITOR_HOME_URL + “../yunserver/yunImageUp.php”, //图片上传接口
imagePath:”http://”,


scrawlUrl:UEDITOR_HOME_URL + “../yunserver/yunScrawlUp.php”,//涂鸦接口
scrawlPath:”http://”,


fileUrl:UEDITOR_HOME_URL + “../yunserver/yunFileUp.php”,//文件上传接口
filePath:”http://”,


catcherUrl:UEDITOR_HOME_URL + “php/getRemoteImage.php”,//获取远程图片接口
catcherPath:UEDITOR_HOME_URL + “php/”,


imageManagerUrl:UEDITOR_HOME_URL + “../yunserver/yunImgManage.php”,//图片管理接口
imageManagerPath:”http://”,


snapscreenHost:’ueditor.baidu.com’,
snapscreenServerUrl:UEDITOR_HOME_URL + “../yunserver/yunSnapImgUp.php”,//截图接口
snapscreenPath:”http://”,


wordImageUrl:UEDITOR_HOME_URL + “../yunserver/yunImageUp.php”,//word图片转存接口
wordImagePath:”http://”, //


getMovieUrl:UEDITOR_HOME_URL + “../yunserver/getMovie.php”,//获取视频接口


lang:/^zh/.test(navigator.language || navigator.browserLanguage || navigator.userLanguage) ? ‘zh-cn’ : ‘en’,
langPath:UEDITOR_HOME_URL + “lang/”,


webAppKey:”9HrmGf2ul4mlyK8ktO2Ziayd”,
initialFrameWidth:860, //初始化宽度
initialFrameHeight:420, //初始化高度
focus:true //是否焦点


【正在看本人博客的这位童鞋,我看你气度不凡,谈吐间隐隐有王者之气,日后必有一番作为!下面有个“顶”字,你就顺手把它点了吧(要先登录CSDN账号哦 )】


—–乐于分享,共同进步!
—–更多文章请看:http://blog.csdn.net/duruiqi_fx


1 0
原创粉丝点击