2010-10-21 32 views

回答

14

是的。當你在頁面上創建編輯器,可以覆蓋

CKEDITOR.replace(editorName, { 
      height: 448, 
      width: 448, 
      customConfig: '/path/to/yourconfig.js' 
}); 

其實作爲performance recommendation可以分別把所有的配置選項,這裏保存配置文件的加載。您可以在您自己的共享JavaScript文件中執行此操作,以便參數化以覆蓋頁面的特定值。

UPDATE迴應置評

一個單獨的配置文件可以像任何其他環境中使用(與customConfig看上面。如果你不希望任何custom configs加載使用

customConfig: '' 
+0

感謝德芙!真的很感激它! – Trip 2010-10-21 13:35:45

+0

迴應性能建議,我試過了,但我的語法錯了,我猜? CKEDITOR.replace(editorName,config)其中config是一個名爲otherConfig.js的config.js文件。 – Trip 2010-10-21 13:40:33

+0

@Trip我已經更新了答案,如果有幫助 – dove 2010-10-21 14:05:00

1

你可以instanceReady事件調整編輯:

CKEDITOR.on 'instanceReady', (evt) -> 
    setCustomHeight(evt.editor) 

setCustomHeight = (editor) -> 
    height = $(editor.element.$).attr('height') 
    return unless height 

    editor.resize('100%', height) 

現在你必須SPECI對要定製的高度textarea的FY height屬性:

<textarea id="my-editor" height="250"></textrarea>

相關問題