JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2
[ckeditor.git] / _source / plugins / image / dialogs / image.js
index 9c4ceec..cc18936 100644 (file)
@@ -147,6 +147,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                else\r
                        ratioButton.addClass( 'cke_btn_unlocked' );\r
 \r
+               var lang = dialog._.editor.lang.image,\r
+                       label =  lang[  dialog.lockRatio ? 'unlockRatio' : 'lockRatio' ];\r
+\r
+               ratioButton.setAttribute( 'title', label );\r
+               ratioButton.getFirst().setText( label );\r
+\r
                return dialog.lockRatio;\r
        };\r
 \r
@@ -460,10 +466,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                        children :\r
                                                        [\r
                                                                {\r
-                                                                       type : 'html',\r
-                                                                       html : '<span>' + CKEDITOR.tools.htmlEncode( editor.lang.image.url ) + '</span>'\r
-                                                               },\r
-                                                               {\r
                                                                        type : 'hbox',\r
                                                                        widths : [ '280px', '110px' ],\r
                                                                        align : 'right',\r
@@ -472,7 +474,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                {\r
                                                                                        id : 'txtUrl',\r
                                                                                        type : 'text',\r
-                                                                                       label : '',\r
+                                                                                       label : editor.lang.common.url,\r
+                                                                                       required: true,\r
                                                                                        onChange : function()\r
                                                                                        {\r
                                                                                                var dialog = this.getDialog(),\r
@@ -542,6 +545,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                {\r
                                                                                        type : 'button',\r
                                                                                        id : 'browse',\r
+                                                                                       // v-align with the 'txtUrl' field.\r
+                                                                                       // TODO: We need something better than a fixed size here.\r
+                                                                                       style : 'display:inline-block;margin-top:10px;',\r
                                                                                        align : 'center',\r
                                                                                        label : editor.lang.common.browseServer,\r
                                                                                        hidden : true,\r
@@ -614,11 +620,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                                        {\r
                                                                                                                                commitInternally.call( this, 'advanced:txtdlgGenStyle' );\r
                                                                                                                        },\r
-                                                                                                                       validate: function()\r
+                                                                                                                       validate : function()\r
                                                                                                                        {\r
                                                                                                                                var aMatch  =  this.getValue().match( regexGetSizeOrEmpty );\r
                                                                                                                                if ( !aMatch )\r
-                                                                                                                                       alert( editor.lang.common.validateNumberFailed );\r
+                                                                                                                                       alert( editor.lang.image.validateWidth );\r
                                                                                                                                return !!aMatch;\r
                                                                                                                        },\r
                                                                                                                        setup : setupDimension,\r
@@ -664,11 +670,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                                        {\r
                                                                                                                                commitInternally.call( this, 'advanced:txtdlgGenStyle' );\r
                                                                                                                        },\r
-                                                                                                                       validate: function()\r
+                                                                                                                       validate : function()\r
                                                                                                                        {\r
                                                                                                                                var aMatch = this.getValue().match( regexGetSizeOrEmpty );\r
                                                                                                                                if ( !aMatch )\r
-                                                                                                                                       alert( editor.lang.common.validateNumberFailed );\r
+                                                                                                                                       alert( editor.lang.image.validateHeight );\r
                                                                                                                                return !!aMatch;\r
                                                                                                                        },\r
                                                                                                                        setup : setupDimension,\r
@@ -761,10 +767,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                                }\r
                                                                                                        },\r
                                                                                                        html : '<div>'+\r
-                                                                                                               '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.lockRatio +\r
-                                                                                                               '" class="cke_btn_locked" id="btnLockSizes"></a>' +\r
+                                                                                                               '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.unlockRatio +\r
+                                                                                                               '" class="cke_btn_locked" id="btnLockSizes" role="button"><span class="cke_label">' + editor.lang.image.unlockRatio + '</span></a>' +\r
                                                                                                                '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.resetSize +\r
-                                                                                                               '" class="cke_btn_reset" id="btnResetSize"></a>'+\r
+                                                                                                               '" class="cke_btn_reset" id="btnResetSize" role="button"><span class="cke_label">' + editor.lang.image.resetSize + '</span></a>'+\r
                                                                                                                '</div>'\r
                                                                                                }\r
                                                                                        ]\r
@@ -789,11 +795,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                        {\r
                                                                                                                commitInternally.call( this, 'advanced:txtdlgGenStyle' );\r
                                                                                                        },\r
-                                                                                                       validate: function()\r
-                                                                                                       {\r
-                                                                                                               var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );\r
-                                                                                                               return func.apply( this );\r
-                                                                                                       },\r
+                                                                                                       validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateBorder ),\r
                                                                                                        setup : function( type, element )\r
                                                                                                        {\r
                                                                                                                if ( type == IMAGE )\r
@@ -850,11 +852,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                        {\r
                                                                                                                commitInternally.call( this, 'advanced:txtdlgGenStyle' );\r
                                                                                                        },\r
-                                                                                                       validate: function()\r
-                                                                                                       {\r
-                                                                                                               var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );\r
-                                                                                                               return func.apply( this );\r
-                                                                                                       },\r
+                                                                                                       validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateHSpace ),\r
                                                                                                        setup : function( type, element )\r
                                                                                                        {\r
                                                                                                                if ( type == IMAGE )\r
@@ -918,11 +916,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                        {\r
                                                                                                                commitInternally.call( this, 'advanced:txtdlgGenStyle' );\r
                                                                                                        },\r
-                                                                                                       validate: function()\r
-                                                                                                       {\r
-                                                                                                               var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );\r
-                                                                                                               return func.apply( this );\r
-                                                                                                       },\r
+                                                                                                       validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateVSpace ),\r
                                                                                                        setup : function( type, element )\r
                                                                                                        {\r
                                                                                                                if ( type == IMAGE )\r
@@ -1055,7 +1049,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                {\r
                                                                                        type : 'html',\r
                                                                                        style : 'width:95%;',\r
-                                                                                       html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.image.preview ) +'<br>'+\r
+                                                                                       html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'<br>'+\r
                                                                                        '<div id="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>'+\r
                                                                                        '<div id="ImagePreviewBox">'+\r
                                                                                        '<a href="javascript:void(0)" target="_blank" onclick="return false;" id="previewLink">'+\r
@@ -1079,7 +1073,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                {\r
                                                        id : 'txtUrl',\r
                                                        type : 'text',\r
-                                                       label : editor.lang.image.url,\r
+                                                       label : editor.lang.common.url,\r
                                                        style : 'width: 100%',\r
                                                        'default' : '',\r
                                                        setup : function( type, element )\r
@@ -1124,15 +1118,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                {\r
                                                        id : 'cmbTarget',\r
                                                        type : 'select',\r
-                                                       label : editor.lang.link.target,\r
+                                                       label : editor.lang.common.target,\r
                                                        'default' : '',\r
                                                        items :\r
                                                        [\r
-                                                               [ editor.lang.link.targetNotSet , ''],\r
-                                                               [ editor.lang.link.targetNew , '_blank'],\r
-                                                               [ editor.lang.link.targetTop , '_top'],\r
-                                                               [ editor.lang.link.targetSelf , '_self'],\r
-                                                               [ editor.lang.link.targetParent , '_parent']\r
+                                                               [ editor.lang.common.notSet , ''],\r
+                                                               [ editor.lang.common.targetNew , '_blank'],\r
+                                                               [ editor.lang.common.targetTop , '_top'],\r
+                                                               [ editor.lang.common.targetSelf , '_self'],\r
+                                                               [ editor.lang.common.targetParent , '_parent']\r
                                                        ],\r
                                                        setup : function( type, element )\r
                                                        {\r