Code Index | File Index

Namespaces

Classes


Class CKEDITOR.dialog


Defined in: plugins/dialog/plugin.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
CKEDITOR.dialog(editor, dialogName)
This is the base class for runtime dialog objects.
Field Summary
Field Attributes Field Name and Description
<static>  
CKEDITOR.dialog.cancelButton
The default cancel button for dialogs.
<static>  
CKEDITOR.dialog.okButton
The default OK button for dialogs.
 
An associative map of elements in the dialog.
 
Pops the current default values of all inputs in the dialog.
 
Pushes the current values of all inputs in the dialog into the default stack.
 
Resets all input values in the dialog.
Method Summary
Method Attributes Method Name and Description
<static>  
CKEDITOR.dialog.add(name, dialogDefinition)
Registers a dialog.
<static>  
CKEDITOR.dialog.addUIElement(typeName, builder)
Registers a dialog UI element.
<static>  
CKEDITOR.dialog.exists(name)
<static>  
CKEDITOR.dialog.setMargins(top, right, bottom, left)
Sets the width of margins of dialogs, which is used for the dialog moving and resizing logic.
<inner>  
 
addPage(contents)
Adds a tabbed page into the dialog.
 
Clears the saved selection in the dialog object.
 
click(id)
Simulates a click to a dialog button in the dialog's button row.
 
 
Disables a dialog button.
 
Enables a dialog button.
 
foreach(fn)
Executes a function for each UI element.
 
Gets the UI element of a button in the dialog's button row.
 
getContentElement(pageId, elementId)
Gets a dialog UI element object from a dialog page.
 
Gets the root DOM element of the dialog.
 
Gets the number of pages in the dialog.
 
Gets the editor instance which opened this dialog.
 
Gets the dialog's position in the window.
 
Gets the current size of the dialog in pixels.
 
getValueOf(pageId, elementId)
Gets the value of a dialog UI element.
 
hide()
Hides the dialog box.
 
Hides a page's tab away from the dialog.
 
move(x, y)
Moves the dialog to an (x, y) coordinate relative to the window.
 
resize(width, height)
Resizes the dialog.
 
Restores the editor's selection from the previously saved position in this dialog.
 
Saves the current selection position in the editor.
 
Activates a tab page in the dialog by its id.
 
 
setValueOf(pageId, elementId, value)
Sets the value of a dialog UI element.
 
show()
Shows the dialog box.
 
Unhides a page's tab.
Class Detail
CKEDITOR.dialog(editor, dialogName)
Since: 3.0
This is the base class for runtime dialog objects. An instance of this class represents a single named dialog for a single editor instance.
var dialogObj = new CKEDITOR.dialog( editor, 'smiley' );
Parameters:
{Object} editor
The editor which created the dialog.
{String} dialogName
The dialog's registered name.
Field Detail
<static> {Function} CKEDITOR.dialog.cancelButton
Since: 3.0
The default cancel button for dialogs. Fires the "cancel" event and closes the dialog if no UI element value changed.

<static> {Function} CKEDITOR.dialog.okButton
Since: 3.0
The default OK button for dialogs. Fires the "ok" event and closes the dialog if the event succeeds.

{Object} parts
Since: 3.0
An associative map of elements in the dialog. It has the following members:
NO EXAMPLE AVAILABLE

{CKEDITOR.dialog} popDefault
Since: 3.0
Pops the current default values of all inputs in the dialog.
dialogObj.popDefault();

{CKEDITOR.dialog} pushDefault
Since: 3.0
Pushes the current values of all inputs in the dialog into the default stack.
dialogObj.pushDefault();

{CKEDITOR.dialog} reset
Since: 3.0
Resets all input values in the dialog.
dialogObj.reset();
Method Detail
<static> {Undefined} CKEDITOR.dialog.add(name, dialogDefinition)
Since: 3.0
Registers a dialog.
Parameters:
{String} name
The dialog's name.
{Function|String} dialogDefinition
A function returning the dialog's definition, or the URL to the .js file holding the function. The function should accept an argument "editor" which is the current editor instance, and return an object conforming to CKEDITOR.dialog.dialogDefinition.
See:
CKEDITOR.dialog.dialogDefinition

<static> {Undefined} CKEDITOR.dialog.addUIElement(typeName, builder)
Since: 3.0
Registers a dialog UI element.
Parameters:
{String} typeName
The name of the UI element.
{Function} builder
The function to build the UI element.

<static> {Undefined} CKEDITOR.dialog.exists(name)
Since: 3.0
NO EXAMPLE AVAILABLE
Parameters:
{Undefined} name

<static> {Undefined} CKEDITOR.dialog.setMargins(top, right, bottom, left)
Since: 3.0
Sets the width of margins of dialogs, which is used for the dialog moving and resizing logic. The margin here means the area between the dialog's container
and the visual boundary of the dialog. Typically this area is used for dialog shadows. This function is typically called in a skin's JavaScript files.
Parameters:
{Number} top
The top margin in pixels.
{Number} right
The right margin in pixels.
{Number} bottom
The bottom margin in pixels.
{Number} left
The left margin in pixels.

<inner> {Undefined} iterContents(func)
Since: 3.0
NO EXAMPLE AVAILABLE
Parameters:
{Undefined} func

{Undefined} addPage(contents)
Since: 3.0
Adds a tabbed page into the dialog.
Parameters:
{Object} contents
Content definition.

{Undefined} clearSavedSelection()
Since: 3.0
Clears the saved selection in the dialog object. This function should be called if the dialog's code has already changed the current selection position because the dialog closed. (e.g. at onOk())

{Undefined} click(id)
Since: 3.0
Simulates a click to a dialog button in the dialog's button row.
Parameters:
{String} id
The id of the button.
Returns:
{Undefined} The return value of the dialog's "click" event.

{Undefined} commitContent()
Since: 3.0
NO EXAMPLE AVAILABLE

{Undefined} disableButton(id)
Since: 3.0
Disables a dialog button.
Parameters:
{String} id
The id of the button.

{Undefined} enableButton(id)
Since: 3.0
Enables a dialog button.
Parameters:
{String} id
The id of the button.

{CKEDITOR.dialog} foreach(fn)
Since: 3.0
Executes a function for each UI element.
NO EXAMPLE AVAILABLE
Parameters:
{Function} fn
Function to execute for each UI element.
Returns:
{CKEDITOR.dialog} The current dialog object.

{CKEDITOR.ui.dialog.button} getButton(id)
Since: 3.0
Gets the UI element of a button in the dialog's button row.
Parameters:
{String} id
The id of the button.
Returns:
{CKEDITOR.ui.dialog.button} The button object.

{CKEDITOR.ui.dialog.uiElement} getContentElement(pageId, elementId)
Since: 3.0
Gets a dialog UI element object from a dialog page.
Parameters:
{String} pageId
id of dialog page.
{String} elementId
id of UI element.
Returns:
{CKEDITOR.ui.dialog.uiElement} The dialog UI element.

{CKEDITOR.dom.element} getElement()
Since: 3.0
Gets the root DOM element of the dialog.
var dialogElement = dialogObj.getElement().getFirst();
dialogElement.setStyle( 'padding', '5px' );
Returns:
{CKEDITOR.dom.element} The <span> element containing this dialog.

{Number} getPageCount()
Since: 3.0
Gets the number of pages in the dialog.
NO EXAMPLE AVAILABLE
Returns:
{Number} Page count.

{CKEDITOR.editor} getParentEditor()
Since: 3.0
Gets the editor instance which opened this dialog.
NO EXAMPLE AVAILABLE
Returns:
{CKEDITOR.editor} Parent editor instances.

{Object} getPosition()
Since: 3.0
Gets the dialog's position in the window.
var dialogX = dialogObj.getPosition().x;
Returns:
{Object} An object with "x" and "y" properties.

{Object} getSize()
Since: 3.0
Gets the current size of the dialog in pixels.
var width = dialogObj.getSize().width;
Returns:
{Object} An object with "width" and "height" properties.

{Object} getValueOf(pageId, elementId)
Since: 3.0
Gets the value of a dialog UI element.
Parameters:
{String} pageId
id of dialog page.
{String} elementId
id of UI element.
Returns:
{Object} The value of the UI element.

{Undefined} hide()
Since: 3.0
Hides the dialog box.
dialogObj.hide();

{Undefined} hidePage(id)
Since: 3.0
Hides a page's tab away from the dialog.
dialog.hidePage( 'tab_3' );
Parameters:
{String} id
The page's Id.

{Undefined} move(x, y)
Since: 3.0
Moves the dialog to an (x, y) coordinate relative to the window.
dialogObj.move( 10, 40 );
Parameters:
{Number} x
The target x-coordinate.
{Number} y
The target y-coordinate.

{Undefined} resize(width, height)
Since: 3.0
Resizes the dialog.
dialogObj.resize( 800, 640 );
Parameters:
{Number} width
The width of the dialog in pixels.
{Number} height
The height of the dialog in pixels.

{Undefined} restoreSelection()
Since: 3.0
Restores the editor's selection from the previously saved position in this dialog. This function is automatically called when a non-nested dialog is closed, but it may also be called by event handlers in dialog definition.

{Undefined} saveSelection()
Since: 3.0
Saves the current selection position in the editor. This function is automatically called when a non-nested dialog is opened, but it may also be called by event handlers in dialog definition.

{Undefined} selectPage(id)
Since: 3.0
Activates a tab page in the dialog by its id.
dialogObj.selectPage( 'tab_1' );
Parameters:
{String} id
The id of the dialog tab to be activated.

{Undefined} setupContent()
Since: 3.0
NO EXAMPLE AVAILABLE

{Undefined} setValueOf(pageId, elementId, value)
Since: 3.0
Sets the value of a dialog UI element.
Parameters:
{String} pageId
id of the dialog page.
{String} elementId
id of the UI element.
{Object} value
The new value of the UI element.

{Undefined} show()
Since: 3.0
Shows the dialog box.
dialogObj.show();

{Undefined} showPage(id)
Since: 3.0
Unhides a page's tab.
dialog.showPage( 'tab_2' );
Parameters:
{String} id
The page's Id.

Copyright © 2003-2009, CKSource - Frederico Knabben. All rights reserved.