第3.150课 上课 E购通电子商务平台, 商品管理
3_150

E购通电子商务平台
商品管理
添加商品
添加tiny_mce富文本编辑器
导入 tinymce依赖库 到项目的js目录中
tinymce配置成功后的最终效果如下:

在页面引入tiny_mce.js文件
<!-- 导入tinymce 编辑器 -->
<script type="text/javascript" src="${ctx}/js/tiny_mce/tiny_mce.js"></script>
初始化富文本框
tinyMCE.init({
mode : "exact", // mode:指定附加的模式 textareas : html页面上所有的textarea元素都附加上.
elements : "descTextArea", // exact:精确的模式, 需要指定html元素id属性值
theme : "advanced", // 主题:advanced(高级的) 、simple(简单的)
language : "zh-cn", // 国际化
/** 指定工具按钮资源文件存放的文件夹 */
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
/** 指定工具按钮在上面放四排 */
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
/** 指定工具按钮上下的位置 top、bottom */
theme_advanced_toolbar_location : "top",
/** 指定工具按钮左、中、右显示的位置 left、center、right */
theme_advanced_toolbar_align : "left",
/** 指定状态栏的位置 (top、bottom) */
theme_advanced_statusbar_location : "bottom",
/** 指定编辑器是否可以拖动 */
theme_advanced_resizing : true
});
添加一个多行文本框
<textarea name="description" id="descTextArea" rows="12" cols="200" ></textarea>
浙公网安备 33010602011771号