jsp整合ueditor文本编辑器,并整合kityformula-plugin公式插件

1、jsp中引入ueditor和kityformula脚本

<script type="text/javascript" src="${path}/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="${path}/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="${path}/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="${path}/js/ueditor/kityformula-plugin/addKityFormulaDialog.js"></script>
<script type="text/javascript" src="${path}/js/ueditor/kityformula-plugin/getKfContent.js"></script>
<script type="text/javascript" src="${path}/js/ueditor/kityformula-plugin/defaultFilterFix.js"></script>

jsp中实例化ueditor

<script type="text/javascript">
var stemEditor = UE.getEditor('stemEditor', {
	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', '|',
		'simpleupload', 'insertframe', 'insertcode', 'pagebreak', '|',
		'horizontal', 'date', 'time', 'spechars', '|',
		'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
		'print', 'preview', 'searchreplace', 'kityformula'
	   ]],
	   autoHeightEnabled: true,
       autoFloatEnabled: false
   });
stemEditor.ready(function() {
    //设置编辑器的内容
//     if(isEdit=="true"){
    	stemEditor.execCommand("insertHtml",$("#stemContent").val());
//     }
});
</script>
<div>
	<script id="stemEditor" type="text/plain" style="width:100%;height:400px;"></script>
	<textarea id="stemContent" name="stemContent" style="display: none;">数据回显承载元素</textarea>
</div>

2、整合kityformula-plugin公式插件

修改对应配置

kityFormulaDialog.html文件改写成jsp文件,并对其中对应的js css引用路径进行修改

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值