2011-04-21 110 views

回答

0

我最終會做這樣的:

<div id='stuff'> 
    <ul class="editorlist"> 
     <li>hi</li> 
     <li>how are you</li> 
     <li>good</li> 
    </ul> 
</div> 

<script type='text/javascript'> 
    function myfunc() { 
     $('<a href="#" id="stuffadd">add some text</a>') 
     .click(function() { $('#stuff').dialog('open'); }).appendTo('.cke_button:last'); 
    } 
</script> 
2

爲此首先添加插件。代碼中加入插件低於:

CKEDITOR.plugins.add('language', { 
    requires: 'selection', 
    init: function(editor) { 
     var pluginName = 'language'; 
     CKEDITOR.dialog.add(pluginName, this.path + 'dialogs/language.js'); 
     editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName)); 
     editor.ui.addButton('language', { 
      label: 'language', 
      command: pluginName 

     }); 
    } 
}); 

然後添加插件安裝到工具欄中config.js

extraPlugins: 'language'; 
相關問題