2013-05-15 82 views
3

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

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

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

但是没有办法cutomize帽子文件菜单 任何想法?

+0

哪个版本'tinymce'您使用的? – showdev

回答

0

可能重复:Is it possible to have custom Functions and commands in the TinyMCE4 Menubar?

// 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!!'); 
     } 
     }); 
    } 
});