TinyMCE customize “file” menubar

前端 未结 3 1051
慢半拍i
慢半拍i 2020-12-28 16:47

Is there a way to customize (add and remove options, e.t.c..) the menubar in TinyMCE 4.0? I am unable to find any documentation on that specific part of the editor. The imag

3条回答
  •  粉色の甜心
    2020-12-28 17:36

    I ended up customizing both the menu bar and the tool bar by tweaking the menu and toolbar properties in the settings object passed to tinymce.init():

    // ...
      menu : {
        edit: { title: 'Edit', items: 'undo redo  | cut copy paste selectall | searchreplace' },
        insert: { title: 'Insert', items: 'link charmap' },
        format: { title: 'Format', items: 'bold italic underline strikethrough superscript subscript | removeformat' },
        table: { title: 'Table', items: 'inserttable tableprops deletetable | cell row column' }
      },
      toolbar: 'undo redo | bold italic underline | link hr | alignleft aligncenter alignright | blockquote bullist numlist outdent indent | code',
    // ...
    

    I found the terms for each menu/button by digging around in the source code looking for .addMenuItem( and .addButton(.

提交回复
热议问题