return function(){ this.foreach( fn ); return this; };\r
})(),\r
\r
+\r
+ /**\r
+ * Calls the {@link CKEDITOR.dialog.definition.uiElement#setup} method of each of the UI elements, with the arguments passed through it.\r
+ * It is usually being called when the dialog is opened, to put the initial value inside the field.\r
+ * @example\r
+ * dialogObj.setupContent();\r
+ * @example\r
+ * var timestamp = ( new Date() ).valueOf();\r
+ * dialogObj.setupContent( timestamp );\r
+ */\r
setupContent : function()\r
{\r
var args = arguments;\r
});\r
},\r
\r
+ /**\r
+ * Calls the {@link CKEDITOR.dialog.definition.uiElement#commit} method of each of the UI elements, with the arguments passed through it.\r
+ * It is usually being called when the user confirms the dialog, to process the values.\r
+ * @example\r
+ * dialogObj.commitContent();\r
+ * @example\r
+ * var timestamp = ( new Date() ).valueOf();\r
+ * dialogObj.commitContent( timestamp );\r
+ */\r
commitContent : function()\r
{\r
var args = arguments;\r
* @param {String} pageId id of dialog page.\r
* @param {String} elementId id of UI element.\r
* @example\r
+ * dialogObj.getContentElement( 'tabId', 'elementId' ).setValue( 'Example' );\r
* @returns {CKEDITOR.ui.dialog.uiElement} The dialog UI element.\r
*/\r
getContentElement : function( pageId, elementId )\r
* @param {String} pageId id of dialog page.\r
* @param {String} elementId id of UI element.\r
* @example\r
+ * alert( dialogObj.getValueOf( 'tabId', 'elementId' ) );\r
* @returns {Object} The value of the UI element.\r
*/\r
getValueOf : function( pageId, elementId )\r
* @param {String} elementId id of the UI element.\r
* @param {Object} value The new value of the UI element.\r
* @example\r
+ * dialogObj.setValueOf( 'tabId', 'elementId', 'Example' );\r
*/\r
setValueOf : function( pageId, elementId, value )\r
{\r
var covers = {},\r
currentCover;\r
\r
+ function cancelEvent( ev )\r
+ {\r
+ ev.data.preventDefault(1);\r
+ }\r
+\r
function showCover( editor )\r
{\r
var win = CKEDITOR.document.getWindow();\r
coverElement = CKEDITOR.dom.element.createFromHtml( html.join( '' ) );\r
coverElement.setOpacity( backgroundCoverOpacity != undefined ? backgroundCoverOpacity : 0.5 );\r
\r
+ coverElement.on( 'keydown', cancelEvent );\r
+ coverElement.on( 'keypress', cancelEvent );\r
+ coverElement.on( 'keyup', cancelEvent );\r
+\r
coverElement.appendTo( CKEDITOR.document.getBody() );\r
covers[ coverKey ] = coverElement;\r
}\r
classes[ 'cke_dialog_ui_' + elementDefinition.type ] = 1;\r
if ( elementDefinition.className )\r
classes[ elementDefinition.className ] = 1;\r
+ if ( elementDefinition.disabled )\r
+ classes[ 'cke_disabled' ] = 1;\r
+\r
var attributeClasses = ( attributes['class'] && attributes['class'].split ) ? attributes['class'].split( ' ' ) : [];\r
for ( i = 0 ; i < attributeClasses.length ; i++ )\r
{\r
*/\r
disable : function()\r
{\r
- var element = this.getInputElement();\r
+ var element = this.getElement();\r
element.setAttribute( 'disabled', 'true' );\r
element.addClass( 'cke_disabled' );\r
},\r
*/\r
enable : function()\r
{\r
- var element = this.getInputElement();\r
+ var element = this.getElement();\r
element.removeAttribute( 'disabled' );\r
element.removeClass( 'cke_disabled' );\r
},\r