Index: CKEditor/releases/stable/_source/plugins/image/dialogs/image.js
===================================================================
--- CKEditor/releases/stable/_source/plugins/image/dialogs/image.js	(revision 4887)
+++ CKEditor/releases/stable/_source/plugins/image/dialogs/image.js	(revision 5194)
@@ -86,5 +86,5 @@
 	function commitInternally( targetFields )
 	{
-		if( incommit )
+		if ( incommit )
 			return;
 
@@ -93,5 +93,5 @@
 		var dialog = this.getDialog(),
 			element = dialog.imageElement;
-		if( element )
+		if ( element )
 		{
 			// Commit this field and broadcast to target fields.
@@ -147,4 +147,10 @@
 		else
 			ratioButton.addClass( 'cke_btn_unlocked' );
+
+		var lang = dialog._.editor.lang.image,
+			label =  lang[  dialog.lockRatio ? 'unlockRatio' : 'lockRatio' ];
+
+		ratioButton.setAttribute( 'title', label );
+		ratioButton.getFirst().setText( label );
 
 		return dialog.lockRatio;
@@ -386,5 +392,5 @@
 
 				// Remove empty style attribute.
-				if( !this.imageElement.getAttribute( 'style' ) )
+				if ( !this.imageElement.getAttribute( 'style' ) )
 					this.imageElement.removeAttribute( 'style' );
 
@@ -461,8 +467,4 @@
 							[
 								{
-									type : 'html',
-									html : '<span>' + CKEDITOR.tools.htmlEncode( editor.lang.image.url ) + '</span>'
-								},
-								{
 									type : 'hbox',
 									widths : [ '280px', '110px' ],
@@ -473,5 +475,6 @@
 											id : 'txtUrl',
 											type : 'text',
-											label : '',
+											label : editor.lang.common.url,
+											required: true,
 											onChange : function()
 											{
@@ -543,4 +546,7 @@
 											type : 'button',
 											id : 'browse',
+											// v-align with the 'txtUrl' field.
+											// TODO: We need something better than a fixed size here.
+											style : 'display:inline-block;margin-top:10px;',
 											align : 'center',
 											label : editor.lang.common.browseServer,
@@ -615,9 +621,9 @@
 																commitInternally.call( this, 'advanced:txtdlgGenStyle' );
 															},
-															validate: function()
+															validate : function()
 															{
 																var aMatch  =  this.getValue().match( regexGetSizeOrEmpty );
 																if ( !aMatch )
-																	alert( editor.lang.common.validateNumberFailed );
+																	alert( editor.lang.image.validateWidth );
 																return !!aMatch;
 															},
@@ -665,9 +671,9 @@
 																commitInternally.call( this, 'advanced:txtdlgGenStyle' );
 															},
-															validate: function()
+															validate : function()
 															{
 																var aMatch = this.getValue().match( regexGetSizeOrEmpty );
 																if ( !aMatch )
-																	alert( editor.lang.common.validateNumberFailed );
+																	alert( editor.lang.image.validateHeight );
 																return !!aMatch;
 															},
@@ -683,5 +689,5 @@
 																		element.removeStyle( 'height' );
 
-																	if( !internalCommit && type == IMAGE )
+																	if ( !internalCommit && type == IMAGE )
 																		element.removeAttribute( 'height' );
 																}
@@ -717,7 +723,8 @@
 														if ( resetButton )
 														{
-															resetButton.on( 'click', function()
+															resetButton.on( 'click', function(evt)
 																{
 																	resetSize( this );
+																	evt.data.preventDefault();
 																}, this.getDialog() );
 															resetButton.on( 'mouseover', function()
@@ -733,5 +740,5 @@
 														if ( ratioButton )
 														{
-															ratioButton.on( 'click', function()
+															ratioButton.on( 'click', function(evt)
 																{
 																	var locked = switchLockRatio( this ),
@@ -748,4 +755,5 @@
 																		}
 																	}
+																	evt.data.preventDefault();
 																}, this.getDialog() );
 															ratioButton.on( 'mouseover', function()
@@ -760,8 +768,8 @@
 													},
 													html : '<div>'+
-														'<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.lockRatio +
-														'" class="cke_btn_locked" id="btnLockSizes"></a>' +
+														'<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.unlockRatio +
+														'" class="cke_btn_locked" id="btnLockSizes" role="button"><span class="cke_label">' + editor.lang.image.unlockRatio + '</span></a>' +
 														'<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.resetSize +
-														'" class="cke_btn_reset" id="btnResetSize"></a>'+
+														'" class="cke_btn_reset" id="btnResetSize" role="button"><span class="cke_label">' + editor.lang.image.resetSize + '</span></a>'+
 														'</div>'
 												}
@@ -788,9 +796,5 @@
 														commitInternally.call( this, 'advanced:txtdlgGenStyle' );
 													},
-													validate: function()
-													{
-														var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );
-														return func.apply( this );
-													},
+													validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateBorder ),
 													setup : function( type, element )
 													{
@@ -799,9 +803,7 @@
 															var value,
 																borderStyle = element.getStyle( 'border-width' );
-
 															borderStyle = borderStyle && borderStyle.match( /^(\d+px)(?: \1 \1 \1)?$/ );
 															value = borderStyle && parseInt( borderStyle[ 1 ], 10 );
-															!value && ( value = element.getAttribute( 'border' ) );
-
+															isNaN ( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'border' ) );
 															this.setValue( value );
 														}
@@ -812,5 +814,5 @@
 														if ( type == IMAGE || type == PREVIEW )
 														{
-															if ( value )
+															if ( !isNaN( value ) )
 															{
 																element.setStyle( 'border-width', CKEDITOR.tools.cssLength( value ) );
@@ -824,5 +826,5 @@
 															}
 
-															if( !internalCommit && type == IMAGE )
+															if ( !internalCommit && type == IMAGE )
 																element.removeAttribute( 'border' );
 														}
@@ -851,9 +853,5 @@
 														commitInternally.call( this, 'advanced:txtdlgGenStyle' );
 													},
-													validate: function()
-													{
-														var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );
-														return func.apply( this );
-													},
+													validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateHSpace ),
 													setup : function( type, element )
 													{
@@ -872,5 +870,5 @@
 
 															value = ( marginLeftPx == marginRightPx ) && marginLeftPx;
-															!value && ( value = element.getAttribute( 'hspace' ) );
+															isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'hspace' ) );
 
 															this.setValue( value );
@@ -882,5 +880,5 @@
 														if ( type == IMAGE || type == PREVIEW )
 														{
-															if ( value )
+															if ( !isNaN( value ) )
 															{
 																element.setStyle( 'margin-left', CKEDITOR.tools.cssLength( value ) );
@@ -893,5 +891,5 @@
 															}
 
-															if( !internalCommit && type == IMAGE )
+															if ( !internalCommit && type == IMAGE )
 																element.removeAttribute( 'hspace' );
 														}
@@ -919,9 +917,5 @@
 														commitInternally.call( this, 'advanced:txtdlgGenStyle' );
 													},
-													validate: function()
-													{
-														var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );
-														return func.apply( this );
-													},
+													validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateVSpace ),
 													setup : function( type, element )
 													{
@@ -940,5 +934,5 @@
 
 															value = ( marginTopPx == marginBottomPx ) && marginTopPx;
-															!value && ( value = element.getAttribute( 'vspace' ) );
+															isNaN ( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'vspace' ) );
 															this.setValue( value );
 														}
@@ -949,5 +943,5 @@
 														if ( type == IMAGE || type == PREVIEW )
 														{
-															if ( value )
+															if ( !isNaN( value ) )
 															{
 																element.setStyle( 'margin-top', CKEDITOR.tools.cssLength( value ) );
@@ -960,5 +954,5 @@
 															}
 
-															if( !internalCommit && type == IMAGE )
+															if ( !internalCommit && type == IMAGE )
 																element.removeAttribute( 'vspace' );
 														}
@@ -1023,8 +1017,8 @@
 															if ( value )
 																element.setStyle( 'float', value );
-															else if ( !value && this.isChanged( ) )
+															else
 																element.removeStyle( 'float' );
 
-															if( !internalCommit && type == IMAGE )
+															if ( !internalCommit && type == IMAGE )
 															{
 																value = ( element.getAttribute( 'align' ) || '' ).toLowerCase();
@@ -1056,5 +1050,5 @@
 											type : 'html',
 											style : 'width:95%;',
-											html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.image.preview ) +'<br>'+
+											html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'<br>'+
 											'<div id="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>'+
 											'<div id="ImagePreviewBox">'+
@@ -1080,5 +1074,5 @@
 							id : 'txtUrl',
 							type : 'text',
-							label : editor.lang.image.url,
+							label : editor.lang.common.url,
 							style : 'width: 100%',
 							'default' : '',
@@ -1112,5 +1106,10 @@
 							type : 'button',
 							id : 'browse',
-							filebrowser : 'Link:txtUrl',
+							filebrowser :
+							{
+								action : 'Browse',
+								target: 'Link:txtUrl',
+								url: editor.config.filebrowserImageBrowseLinkUrl || editor.config.filebrowserBrowseUrl
+							},
 							style : 'float:right',
 							hidden : true,
@@ -1120,13 +1119,13 @@
 							id : 'cmbTarget',
 							type : 'select',
-							label : editor.lang.link.target,
+							label : editor.lang.common.target,
 							'default' : '',
 							items :
 							[
-								[ editor.lang.link.targetNotSet , ''],
-								[ editor.lang.link.targetNew , '_blank'],
-								[ editor.lang.link.targetTop , '_top'],
-								[ editor.lang.link.targetSelf , '_self'],
-								[ editor.lang.link.targetParent , '_parent']
+								[ editor.lang.common.notSet , ''],
+								[ editor.lang.common.targetNew , '_blank'],
+								[ editor.lang.common.targetTop , '_top'],
+								[ editor.lang.common.targetSelf , '_self'],
+								[ editor.lang.common.targetParent , '_parent']
 							],
 							setup : function( type, element )
