2017-07-29 22 views
1

列表如下图所示:在哪里可以找到我的理解,它可能配置中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文档似乎只显示顶层(文件,编辑,插入等),而不是子菜单项列表。有几个例子,但他们只显示子集。我试图看看源代码,但它很相当...

+0

我回答了关于如何找到大部分的问题,但如果有一个如何手动创建功能齐全的TinyMCE编辑器的示例,以便它可以用作参考,并且您可以删除不需要的东西,不想要。 –

回答

1

回想起来,答案非常明显,但是当你最初开始时不是这样。它也没有帮助,代码是在折叠之下,所以你需要向下滚动才能看到代码而不是列表。

您可以在以下位置找到大部分完整列表: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/" 
}); 

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

相关问题