我的對話框使用基於樣本代碼工作/老/對話框的文件,縮減版本,:
var field = {id: "html1"};
CKEDITOR.on('instanceCreated', function(ev){
var editor = ev.editor;
// Listen for the "pluginsLoaded" event, so we are sure that the
// "dialog" plugin has been loaded and we are able to do our
// customizations.
editor.on('pluginsLoaded', function() {
// If our custom dialog has not been registered, do that now.
if (!CKEDITOR.dialog.exists('myDialog')) {
CKEDITOR.dialog.add('myDialog', function(){
return {title: 'My Dialog',
minWidth: 400,
minHeight: 200,
contents:[
{
id: 'tabA',
label: 'TabA',
title: 'TabA',
elements: [
{
id: 'button1',
type: 'button',
label: 'Button Field'
}
]
}
]
};
});
}
// Register the command used to open the dialog.
editor.addCommand('myDialogCmd', new CKEDITOR.dialogCommand('myDialog'));
// Add the a custom toolbar buttons, which fires the above
// command..
editor.ui.add('MyButton', CKEDITOR.UI_BUTTON, {
label: 'My Dialog',
command: 'myDialogCmd'
});
});
});
var editor = CKEDITOR.replace(field.id);