百度编辑器UEditor常用设置函数大全
在线文档对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 //是否焦点
eag:
UE.getEditor('A', {
"initialFrameWidth" : "100%",
"initialFrameHeight" : 50,
"maximumWords" : 1000,
"toolbars":[['FullScreen', 'Source', 'Undo', 'Redo','bold','fontsize','touppercase','underline','justifyleft','touppercase','tolowercase','redo']],
"catchRemoteImageEnable":false,
});