我可以使用下面的代码将tinyMCE编辑器应用到我表单上的两个textareas中。但是,我想要一个高100,另一个高200。我可以复制init代码并指定每个textarea的id。但有没有办法可以消除重复设置并调用一次?然后只需为每个textarea指定元素id和高度?
tinyMCE.init({
mode: "textareas",
plugins: "paste",
width: "650",
height: "200",
theme: "advanced",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_buttons1: "bold,italic,underline,|,forecolor,|,cut,copy,paste,pastetext,pasteword,|,undo,redo,|,bullist,numlist,|,link,unlink,|,code",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
valid_elements: "+a[id|style|rel|rev|dir|lang|tabindex|accesskey|type|name|href|target|title|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[style],-em/-i[style],-strike[style],-u[style],#p[id|style|dir|align],-ol[style],-ul[style],-li[style],br,-sub[style],-sup[style],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|align|summary|style|dir|id|bordercolor],-tr[id|dir|rowspan|width|height|align|valign|style|bordercolor],tbody[id],thead[id],tfoot[id],-td[id|dir|colspan|rowspan|width|height|align|valign|style|bordercolor],-th[id|dir|colspan|rowspan|width|height|align|valign|style],-div[id|dir|align|style],-span[!style],address[align|style],-h3[id|dir|align],-h4[id|dir|align],-h5[id|dir|align],-h6[id|style|dir|align],hr[style],dd[id|title|style|dir],dl[id|title|style|dir],dt[id|title|style|dir]",
invalidElements: "h1,h2,font,img",
valid_styles: { '*': 'color,font-weight,font-style' },
entity_encoding: "named",
cleanup_on_startup: true,
paste_auto_cleanup_on_paste: true,
paste_remove_styles: true,
paste_remove_styles_if_webkit: true,
paste_strip_class_attributes: true,
onchange_callback: function (ed) {
ed.save();
}
});