JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.4
[ckeditor.git] / _source / plugins / dialog / plugin.js
index ce28799..b0b125c 100644 (file)
@@ -859,6 +859,16 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                        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
@@ -869,6 +879,15 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                                });\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
@@ -1139,6 +1158,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                 * @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
@@ -1152,6 +1172,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                 * @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
@@ -1165,6 +1186,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                 * @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
@@ -1905,6 +1927,11 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
        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
@@ -1965,6 +1992,10 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                        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