有没有办法将自定义按钮添加到 TinyMCE 工具栏,上面只有文本(没有图像)?尝试删除设置图像路径部分,现在它有一个空白按钮。这是我现有的代码:
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode: "textareas",
theme: "advanced",
theme_advanced_buttons1: "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
theme_advanced_buttons2: "mybutton",
theme_advanced_buttons3: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
setup: function (ed) {
// Add a custom button
ed.addButton('mybutton', {
title: 'My button',
onclick: function () {
ed.focus();
ed.selection.setContent('SampleText');
}
});
}
});
</script>
如何在没有图像的按钮上设置文本?