JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.1
[ckeditor.git] / _source / plugins / dialogui / plugin.js
index 7875b5b..6446fe4 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -380,7 +380,7 @@ CKEDITOR.plugins.add( 'dialogui' );
                                        if ( elementDefinition[ 'default' ] )\r
                                                attributes.checked = 'checked';\r
 \r
-                                       if (typeof myDefinition.controlStyle != 'undefined')\r
+                                       if ( typeof myDefinition.controlStyle != 'undefined' )\r
                                                myDefinition.style = myDefinition.controlStyle;\r
 \r
                                        _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );\r
@@ -462,7 +462,7 @@ CKEDITOR.plugins.add( 'dialogui' );
                                                cleanInnerDefinition( inputDefinition );\r
                                                cleanInnerDefinition( labelDefinition );\r
 \r
-                                               if (typeof inputDefinition.controlStyle != 'undefined')\r
+                                               if ( typeof inputDefinition.controlStyle != 'undefined' )\r
                                                        inputDefinition.style = inputDefinition.controlStyle;\r
 \r
                                                children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );\r
@@ -622,7 +622,7 @@ CKEDITOR.plugins.add( 'dialogui' );
                                                        CKEDITOR.tools.htmlEncode( item[0] ) );\r
                                        }\r
 \r
-                                       if (typeof myDefinition.controlStyle != 'undefined')\r
+                                       if ( typeof myDefinition.controlStyle != 'undefined' )\r
                                                myDefinition.style = myDefinition.controlStyle;\r
 \r
                                        _.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) );\r
@@ -931,7 +931,7 @@ CKEDITOR.plugins.add( 'dialogui' );
                                {\r
                                        this._.disabled = false;\r
                                        var element = this.getElement();\r
-                                       element && element.removeClass( 'disabled' );\r
+                                       element && element.removeClass( 'cke_disabled' );\r
                                },\r
 \r
                                /**\r
@@ -941,7 +941,7 @@ CKEDITOR.plugins.add( 'dialogui' );
                                disable : function()\r
                                {\r
                                        this._.disabled = true;\r
-                                       this.getElement().addClass( 'disabled' );\r
+                                       this.getElement().addClass( 'cke_disabled' );\r
                                },\r
 \r
                                isVisible : function()\r
@@ -1384,18 +1384,19 @@ CKEDITOR.plugins.add( 'dialogui' );
                                 */\r
                                reset : function()\r
                                {\r
-                                       var frameElement = CKEDITOR.document.getById( this._.frameId ),\r
+                                       var _ = this._,\r
+                                               frameElement = CKEDITOR.document.getById( _.frameId ),\r
                                                frameDocument = frameElement.getFrameDocument(),\r
-                                               elementDefinition = this._.definition,\r
-                                               buttons = this._.buttons,\r
+                                               elementDefinition = _.definition,\r
+                                               buttons = _.buttons,\r
                                                callNumber = this.formLoadedNumber,\r
                                                unloadNumber = this.formUnloadNumber,\r
-                                               langDir = this._.dialog._.editor.lang.dir,\r
-                                               langCode = this._.dialog._.editor.langCode;\r
+                                               langDir = _.dialog._.editor.lang.dir,\r
+                                               langCode = _.dialog._.editor.langCode;\r
 \r
                                        // The callback function for the iframe, but we must call tools.addFunction only once\r
                                        // so we store the function number in this.formLoadedNumber\r
-                                       if (!callNumber)\r
+                                       if ( !callNumber )\r
                                        {\r
                                                callNumber = this.formLoadedNumber = CKEDITOR.tools.addFunction(\r
                                                        function()\r
@@ -1459,7 +1460,7 @@ CKEDITOR.plugins.add( 'dialogui' );
 \r
                                getValue : function()\r
                                {\r
-                                       return this.getInputElement().$.value;\r
+                                       return this.getInputElement().$.value || '';\r
                                },\r
 \r
                                /***\r
@@ -1520,3 +1521,17 @@ CKEDITOR.plugins.add( 'dialogui' );
        CKEDITOR.dialog.addUIElement( 'html', commonBuilder );\r
        CKEDITOR.dialog.addUIElement( 'fieldset', containerBuilder );\r
 })();\r
+\r
+/**\r
+ * Fired when the value of the uiElement is changed\r
+ * @name CKEDITOR.ui.dialog.uiElement#change\r
+ * @event\r
+ */\r
+\r
+/**\r
+ * Fired when the inner frame created by the element is ready.\r
+ * Each time the button is used or the dialog is loaded a new\r
+ * form might be created.\r
+ * @name CKEDITOR.ui.dialog.fileButton#formLoaded\r
+ * @event\r
+ */\r