自定义TinyMCE中的文件菜单

3

是否可以在TinyMCE的文件菜单中添加新的菜单项来进行自定义? 我已经找到了编辑或禁用文件菜单的解决方案。即

tinymce.init({
    selector: "textarea",
    menubar: "edit format"
});
Disable menubar:

tinymce.init({
    selector: "textarea",
    menubar: false
});

但是没有办法自定义帽子文件菜单,有什么想法吗?

你正在使用哪个版本的 tinymce - showdev
1个回答

0

可能是重复问题:在TinyMCE4菜单栏中是否可以拥有自定义函数和命令?

// Adds a custom menu item to the editor that inserts contents when clicked
// The context option allows you to add the menu item to an existing default menu
tinymce.init({
   ...

   setup: function(ed) {
      ed.addMenuItem('example', {
         title: 'My menu item',
         context: 'tools',
         onclick: function() {
            ed.insertContent('Hello world!!');
         }
      });
   }
});

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接