文本编辑器引用方法和取值方式
在添加页面引入相关 js文件
在html页面中添加一行代码
在添加或者修改页面时初始化文本编辑器方法
(function(){
load_navigation();
(function(){ load_navigation();
(“#platform”).val(version);
ue = UE.getEditor(‘editor’,{toolbars:[[
‘toggletool’,’fullscreen’, ‘source’, ‘|’, ‘undo’, ‘redo’, ‘|’,
‘bold’, ‘italic’, ‘underline’, ‘fontborder’, ‘strikethrough’, ‘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’, ‘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’
]]});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action) {
if (action == 'uploadimage') {
return '/news/newController/upload.do';
}else if(action == 'uploadfile'){
return '/news/newController/upload1.do';
}else {
return this._bkGetActionUrl.call(this, action);
}
};
})
获取文本编辑器里面的值方法
var content=UE.getEditor(‘editor’).getContent();
修改方法将数据放回文本编辑器的方法
ue.ready(function() {
ue.setContent(data.content);
});