2017-07-29 28 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來手動添加它。