JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.2
[ckeditor.git] / _source / plugins / dialog / plugin.js
index d24a80f..13ee0ef 100644 (file)
@@ -2356,14 +2356,24 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                                var me = this;\r
                                dialog.on( 'load', function()\r
                                        {\r
-                                               if ( me.getInputElement() )\r
+                                               var input = me.getInputElement();\r
+                                               if ( input )\r
                                                {\r
-                                                       me.getInputElement().on( 'focus', function()\r
+                                                       var focusClass = me.type in { 'checkbox' : 1, 'ratio' : 1 } && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? 'cke_dialog_ui_focused' : '';\r
+                                                       input.on( 'focus', function()\r
                                                                {\r
                                                                        dialog._.tabBarMode = false;\r
                                                                        dialog._.hasFocus = true;\r
                                                                        me.fire( 'focus' );\r
-                                                               }, me );\r
+                                                                       focusClass && this.addClass( focusClass );\r
+\r
+                                                               });\r
+\r
+                                                       input.on( 'blur', function()\r
+                                                               {\r
+                                                                       me.fire( 'blur' );\r
+                                                                       focusClass && this.removeClass( focusClass );\r
+                                                               });\r
                                                }\r
                                        } );\r
 \r
@@ -2923,7 +2933,10 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                /** @ignore */\r
                exec : function( editor )\r
                {\r
-                       editor.openDialog( this.dialogName );\r
+                       // Special treatment for Opera. (#8031)\r
+                       CKEDITOR.env.opera ?\r
+                               CKEDITOR.tools.setTimeout( function() { editor.openDialog( this.dialogName ) }, 0, this )\r
+                               : editor.openDialog( this.dialogName );\r
                },\r
 \r
                // Dialog commands just open a dialog ui, thus require no undo logic,\r
@@ -2939,7 +2952,8 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                        integerRegex = /^\d*$/,\r
                        numberRegex = /^\d*(?:\.\d+)?$/,\r
                        htmlLengthRegex = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,\r
-                       cssLengthRegex = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i;\r
+                       cssLengthRegex = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,\r
+                       inlineStyleRegex = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;\r
 \r
                CKEDITOR.VALIDATE_OR = 1;\r
                CKEDITOR.VALIDATE_AND = 2;\r
@@ -3031,6 +3045,11 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
                                return this.functions( function( val ){ return htmlLengthRegex.test( CKEDITOR.tools.trim( val ) ); }, msg );\r
                        },\r
 \r
+                       'inlineStyle' : function( msg )\r
+                       {\r
+                               return this.functions( function( val ){ return inlineStyleRegex.test( CKEDITOR.tools.trim( val ) ); }, msg );\r
+                       },\r
+\r
                        equals : function( value, msg )\r
                        {\r
                                return this.functions( function( val ){ return val == value; }, msg );\r