2017-09-01 126 views

回答

0

創建自定義插件的文檔頁面顯示如何使菜單項:

https://www.tinymce.com/docs/advanced/creating-a-plugin/

具體https://www.tinymce.com/docs/advanced/creating-a-plugin/#exampleplugin包括代碼,演示瞭如何做到這一點...看看代碼開始:

// Adds a menu item to the tools menu 
editor.addMenuItem('example', { 

編輯:若y您想在Insert菜單中添加一些內容,查看任何已經在執行該操作的插件的源代碼(例如,鏈接)。從這個插件,你會看到這樣的代碼:

editor.addMenuItem('link', { 
    icon: 'link', 
    text: 'Link', 
    shortcut: 'Meta+K', 
    onclick: Actions.openDialog(editor), 
    stateSelector: 'a[href]', 
    context: 'insert', 
    prependToContext: true 
    }); 

注意context設置 - 這是什麼地方具體的菜單上的項目。

+0

Hi @Michael, 感謝您的回覆。但實際上我知道如何將自定義插件添加到工具欄。 但我需要的是我想添加加(+)下拉下的自定義插件。 看到我的主屏幕截圖。 –

+0

@TejasHapani - 查看上面的修改... –