如何从TinyMCE工具栏中删除按钮?
我需要直接编辑tiny_mce.js文件吗?如果是这样,应该在哪里编辑?还是我需要编辑我的主题的editor_template.js文件?
如果有任何指示或提示,将不胜感激。
如何从TinyMCE工具栏中删除按钮?
我需要直接编辑tiny_mce.js文件吗?如果是这样,应该在哪里编辑?还是我需要编辑我的主题的editor_template.js文件?
如果有任何指示或提示,将不胜感激。
如果您需要动态地删除按钮,可以使用以下技术:
tinymce.init({
selector: "textarea",
toolbar: "custom",
formats: {custom: {inline: "span", styles: {color: "red"}}},
setup: function(editor){
editor.addCustomButton = function () {
if(this.customButton){
this.customButton.show();
} else {
this.addButton("custom", {
onpostrender: function() {
editor.customButton = this; //saving button reference
}
});
}
};
editor.removeCustomButton = function () { this.customButton.hide(); };
}
});
addCustomButton
和removeCustomButton
。请注意保留html标签。