在哪里可以找到 TinyMCE 的所有菜单子项的列表

Where to find the list of all the menu subitems for TinyMCE

我知道可以在 TinyMCE 中配置子菜单项,如下所示:

tinymce.init({
    selector: "textarea",
    menu : { // this is the complete default configuration
        file   : {title : 'File'  , items : 'newdocument'},
        edit   : {title : 'Edit'  , items : 'undo redo | cut copy paste pastetext | selectall'},
        insert : {title : 'Insert', items : 'link media | template hr'},
        view   : {title : 'View'  , items : 'visualaid'},
        format : {title : 'Format', items : 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
        table  : {title : 'Table' , items : 'inserttable deletetable | cell row column'},
        tools  : {title : 'Tools' , items : 'spellchecker code'}
    },    
    plugins: [
        "advlist autolink lists link image charmap print preview anchor",
        "searchreplace visualblocks code fullscreen",
        "insertdatetime media table contextmenu paste"
    ],
    toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
});

但是有没有包含所有子菜单项的列表的地方? TinyMCE 文档似乎只显示顶级(文件、编辑、插入等),但不显示子菜单项列表。有几个例子,但它们只显示了子集。我试图查看源代码,但它非常复杂...

回想起来,答案是显而易见的,但当您开始时却并非如此。代码远低于首屏也无济于事,因此您需要向下滚动才能看到代码,而不仅仅是列表。

您可以在以下位置找到几乎完整的列表:https://www.tinymce.com/docs/plugins您需要做的是添加插件,然后添加项目。

例如这里是link for the image(记得滚动到底部):

tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "image",
  menubar: "insert",
  toolbar: "image",
  image_prepend_url: "http://www.tinymce.com/images/"
});

在这种情况下,您需要将 image 添加到 plugins。默认情况下会将其添加到菜单栏 insert。但是,您可以通过输入 image.

来手动添加它