2016-03-22 27 views

回答

0

正如該文章所述,您可以將自己的自定義工具欄按鈕添加到TinyMCE。不用在TinyMCE中使用WindowManager,你可以調用任何你喜歡的JavaScript。

您需要像這樣在您的init:

setup: function (editor) { 
    editor.addButton('customButton', { 
     text: 'Custom Button', 
     icon: false, //you can use an image instead of text 
     onclick: function() { 
      // JavaScript code to open your Bootstrap modal 
      // The modal would use TinyMCE APIs to write data back into the editor 
     } 
    }); 
} 

除此之外代碼,你將還需要以下內容添加到您的init的按鈕添加到工具欄:

toolbar2: "... customButton ...", 
相關問題