CKEDITOR.dialog.definition
The definition of a dialog window.
This class is not really part of the API. It just illustrates the properties that developers can use to define and create dialogs.
// There is no constructor for this class, the user just has to define an
// object with the appropriate properties.
CKEDITOR.dialog.add( 'testOnly', function( editor ) {
return {
title: 'Test Dialog',
resizable: CKEDITOR.DIALOG_RESIZE_BOTH,
minWidth: 500,
minHeight: 400,
contents: [
{
id: 'tab1',
label: 'First Tab',
title: 'First Tab Title',
accessKey: 'Q',
elements: [
{
type: 'text',
label: 'Test Text 1',
id: 'testText1',
'default': 'hello world!'
}
]
}
]
};
} );
Filtering
Properties
-
buttons : Array
CKEDITOR.dialog.definition#buttons
The buttons in the dialog, defined as an array of CKEDITOR.dialog.definition.button objects.
Defaults to
[ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]
-
contents : Array
CKEDITOR.dialog.definition#contents
The contents in the dialog, defined as an array of CKEDITOR.dialog.definition.content objects. Required.
-
The initial height of the dialog, in pixels.
Defaults to
CKEDITOR.dialog.definition.minHeight
-
minHeight : Number
CKEDITOR.dialog.definition#minHeight
-
minWidth : Number
CKEDITOR.dialog.definition#minWidth
-
onCancel : Function
CKEDITOR.dialog.definition#onCancel
The function to execute when the "Cancel" button is pressed.
-
onHide : Function
CKEDITOR.dialog.definition#onHide
The function executed every time the dialog is closed.
-
onLoad : Function
CKEDITOR.dialog.definition#onLoad
The function to execute when the dialog is displayed for the first time.
-
onOk : Function
CKEDITOR.dialog.definition#onOk
The function to execute when the "OK" button is pressed.
-
onShow : Function
CKEDITOR.dialog.definition#onShow
The function to execute when the dialog is loaded (executed every time the dialog is opened).
-
resizable : Number
CKEDITOR.dialog.definition#resizable
How the dialog can be resized, must be one of the four contents defined below.
- CKEDITOR.DIALOG_RESIZE_NONE
- CKEDITOR.DIALOG_RESIZE_WIDTH
- CKEDITOR.DIALOG_RESIZE_HEIGHT
- CKEDITOR.DIALOG_RESIZE_BOTH
Defaults to
CKEDITOR.DIALOG_RESIZE_NONE
-
title : String
CKEDITOR.dialog.definition#title
The dialog title, displayed in the dialog's header. Required.
-
The initial width of the dialog, in pixels.
Defaults to
CKEDITOR.dialog.definition#minWidth
Methods
-
Returns the current dialog mode based on the state of the feature used with this dialog.
See CKEDITOR.dialog.EDITING_MODE and CKEDITOR.dialog.CREATION_MODE.
Parameters
editor : editor
Returns
Number
Dialog mode.
-
since 4.13.0
getModel( editor ) → element | widget | Object | null
CKEDITOR.dialog.definition#getModel
Returns the subject of the dialog.
For most plugins, like the
table
orlink
plugin, it should return a DOM element instance if there is an element related to the dialog. For widget plugins (image2
,placeholder
) it should return a CKEDITOR.plugins.widget instance that is the subject of this dialog.Parameters
editor : editor
Returns
element | widget | Object | null
Returns
null
if the dialog does not use the model.