Index: /CKEditor/branches/prototype/_source/plugins/image/dialogs/image.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/image/dialogs/image.js	(revision 2692)
+++ /CKEditor/branches/prototype/_source/plugins/image/dialogs/image.js	(revision 2693)
@@ -25,70 +25,14 @@
 	var imageDialog = ( dialogType == 'image' );
 
-	var linkTab = 
-	{
-		id : 'Link',
-		label : editor.lang.linkTitle,
-		padding : 0,
-		elements : 
-		[
-			{
-				id : 'txtUrl',
-				type : 'text',
-				label : editor.lang.dlgImgURL,
-				style : 'width: 385px',
-				validate: function( data ) {
-					return true;
-				}
-			},
-			{
-				type : 'button',
-				id : 'browse',
-				style : 'float:right',
-				label : editor.lang.browseServer,
-			},
-			{
-				id : 'cmbTarget',
-				type : 'select',
-				label : editor.lang.linkTarget,
-				style : 'width : 90px',
-				items :
-				[
-					[ editor.lang.linkTargetNotSet , ''],
-					[ editor.lang.linkTargetNew , '_blank'],
-					[ editor.lang.linkTargetTop , '_top'],
-					[ editor.lang.linkTargetSelf , '_self'],
-					[ editor.lang.linkTargetParent , '_parent'],
-				]
-			},
-		]
-	};
-	
-	var uploadTab = 
-	{
-		id : 'Upload',
-		label : editor.lang.dlgImgUpload,
-		elements : 
-		[
-			{
-				type : 'file',
-				id : 'upload',
-				label : editor.lang.dlgImgBtnUpload,
-				action : uploadAction,
-				size : 38
-			},
-			{
-				type : 'fileButton',
-				id : 'uploadButton',
-				label : editor.lang.dlgImgBtnUpload,
-				'for' : [ 'Upload', 'upload' ]
-			}
-		]
-	};
-
-	dialogElements = 
-	{
+	return {
 		title : ( imageDialog ) ? editor.lang.dlgImgTitle : editor.lang.imageButtonProp,
 		minWidth : 450,
 		minHeight : 400,
+		onShow : function( )
+		{
+		},
+		onOk : function( )
+		{
+		},
 		contents : [
 			{
@@ -110,5 +54,6 @@
 							{
 								type : 'hbox',
-								widths : [ '290px', '120px' ],
+								widths : [ '280px', '110px' ],
+								align : 'right',
 								children : 
 								[
@@ -116,5 +61,4 @@
 										id : 'txtUrl',
 										type : 'text',
-										labelLayout : 'horizontal',
 										label : '',
 										style : 'width: 280px',
@@ -126,27 +70,97 @@
 										type : 'button',
 										id : 'browse',
+										style : 'width:100%',
+										align : 'center',
 										label : editor.lang.browseServer,
-									},
+										onClick : function()
+										{
+										}
+									}
 								]
-							},
-						]
+							}
+						]
+					},
+					{
+						id : 'txtAlt',
+						type : 'text',
+						label : editor.lang.dlgImgAlt,
+						accessKey : 'A',
+						style : 'width:385px',
+						validate: function( data ) {
+							return true;
+						}
 					},
 					{
 						type : 'hbox',
-						widths : [ '100px', '250px' ],
-						align : 'top',
+						widths : [ '140px', '240px' ],
 						children : 
 						[
 							{
 								type : 'vbox',
-								padding : 0,
-								style : 'width:100px',
 								children : 
 								[
 									{
+										type : 'hbox',
+										widths : [ '70%', '30%' ],
+										children : 
+										[
+											{
+												type : 'vbox',
+												children : 
+												[
+													{
+														type : 'text',
+														id : 'txtWidth',
+														labelLayout : 'horizontal',	
+														style : 'width:100%',
+														label : editor.lang.dlgImgWidth,
+														validate: function( data ) {
+															if ( this.getValue() != '' )
+															{
+																if ( isNaN( parseInt( this.getValue(), 10 ) ) )
+																{
+																	this.select();
+																	return false;
+																}
+															}
+															return true;
+														}
+													},
+													{
+														type : 'text',
+														id : 'txtHeight',
+														labelLayout : 'horizontal',	
+														style : 'width:100%',
+														label : editor.lang.dlgImgHeight,
+														validate: function( data ) {
+															if ( this.getValue() != '' )
+															{
+																if ( isNaN( parseInt( this.getValue(), 10 ) ) )
+																{
+																	this.select();
+																	return false;
+																}
+															}
+															return true;
+														}
+													}
+												]
+											},
+											{
+												type : 'html',
+												style : 'position:relative; top:-20px;width:35px;height:20px',		//valign = top
+												html : '<div>'+ 
+													'<div onclick="" title="' + editor.lang.dlgImgLockRatio + '" onmouseout="this.className = (true ? \'BtnLocked\' : \'BtnUnlocked\' );" '+ 'onmouseover="this.className = (true ? \'BtnLocked\' : \'BtnUnlocked\' ) + \' BtnOver\';" class="BtnLocked" id="btnLockSizes"></div>' + 
+													'<div onclick="" title="' + editor.lang.dlgBtnResetSize + '" onmouseout="this.className=\'BtnReset\';" onmouseover="this.className=\'BtnReset BtnOver\';" class="BtnReset" id="btnResetSize"></div>'+
+													'</div>'
+											}
+										]
+									},
+									{
 										type : 'text',
-										id : 'txtWidth',
-										style : 'width:50px',
-										label : editor.lang.dlgImgWidth,
+										id : 'txtBorder',
+										labelLayout : 'horizontal',	
+										style : 'width:100%',
+										label : editor.lang.dlgImgBorder,
 										validate: function( data ) {
 											if ( this.getValue() != '' )
@@ -163,7 +177,8 @@
 									{
 										type : 'text',
-										id : 'txtHeight',
-										style : 'width:50px',
-										label : editor.lang.dlgImgHeight,
+										id : 'txtHSpace',
+										labelLayout : 'horizontal',	
+										style : 'width:100%',
+										label : editor.lang.dlgImgHSpace,
 										validate: function( data ) {
 											if ( this.getValue() != '' )
@@ -179,8 +194,9 @@
 									},
 									{
-										id : 'txtBorder',
 										type : 'text',
-										style : 'width:50px',
-										label : editor.lang.dlgImgBorder,
+										id : 'txtVSpace',
+										labelLayout : 'horizontal',	
+										label : editor.lang.dlgImgVSpace,
+										style : 'width:100%',
 										validate: function( data ) {
 											if ( this.getValue() != '' )
@@ -196,42 +212,10 @@
 									},
 									{
-										id : 'txtHSpace',
-										type : 'text',
-										style : 'width:50px',
-										label : editor.lang.dlgImgHSpace,
-										validate: function( data ) {
-											if ( this.getValue() != '' )
-											{
-												if ( isNaN( parseInt( this.getValue(), 10 ) ) )
-												{
-													this.select();
-													return false;
-												}
-											}
-											return true;
-										}
-									},
-									{
-										id : 'txtVSpace',
-										type : 'text',
-										label : editor.lang.dlgImgVSpace,
-										style : 'width:50px',
-										validate: function( data ) {
-											if ( this.getValue() != '' )
-											{
-												if ( isNaN( parseInt( this.getValue(), 10 ) ) )
-												{
-													this.select();
-													return false;
-												}
-											}
-											return true;
-										}
-									},
-									{
 										id : 'cmbAlign',
 										type : 'select',
+										labelLayout : 'horizontal',	
+										widths : [ '30%','70%' ],
 										label : editor.lang.dlgImgAlign,
-										style : 'width : 90px',
+										style : 'width:100%',
 										items :
 										[
@@ -245,35 +229,82 @@
 											[ editor.lang.dlgImgAlignRight , 'right'],
 											[ editor.lang.dlgImgAlignTextTop , 'textTop'],
-											[ editor.lang.dlgImgAlignTop , 'top'],
+											[ editor.lang.dlgImgAlignTop , 'top']
 										]
-									},
+									}
 								]
 							},
 							{
 								type : 'vbox',
-								height : '100%',
+								height : '180px',
 								children : 
 								[
 									{
 										type : 'html',
-										style : 'width:260px; height:180px; margin:0px 0px 0px 10px;',
+										style : 'width:95%;',
 										html: '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.dlgImgPreview ) +
-												'<div id="ImagePreviewBox" style="border: 1px solid black;height:100%"></div>'+
-												'</div>'
+											'<div id="ImagePreviewBox" style="border: 1px solid black;height:160px"></div>'+
+											'</div>'
 									}
 								]
 							}
 						]
-					},
-					{
-						id : 'txtAlt',
+					}
+				]
+			},
+			{
+				id : 'Link',
+				label : editor.lang.linkTitle,
+				padding : 0,
+				elements : 
+				[
+					{
+						id : 'txtUrl',
 						type : 'text',
-						label : editor.lang.dlgImgAlt,
-						accessKey : 'A',
-						style : 'width:385px',
+						label : editor.lang.dlgImgURL,
+						style : 'width: 385px',
 						validate: function( data ) {
 							return true;
 						}
 					},
+					{
+						type : 'button',
+						id : 'browse',
+						style : 'float:right',
+						label : editor.lang.browseServer
+					},
+					{
+						id : 'cmbTarget',
+						type : 'select',
+						label : editor.lang.linkTarget,
+						style : 'width : 90px',
+						items :
+						[
+							[ editor.lang.linkTargetNotSet , ''],
+							[ editor.lang.linkTargetNew , '_blank'],
+							[ editor.lang.linkTargetTop , '_top'],
+							[ editor.lang.linkTargetSelf , '_self'],
+							[ editor.lang.linkTargetParent , '_parent']
+						]
+					}
+				]
+			},
+			{
+				id : 'Upload',
+				label : editor.lang.dlgImgUpload,
+				elements : 
+				[
+					{
+						type : 'file',
+						id : 'upload',
+						label : editor.lang.dlgImgBtnUpload,
+						action : uploadAction,
+						size : 38
+					},
+					{
+						type : 'fileButton',
+						id : 'uploadButton',
+						label : editor.lang.dlgImgBtnUpload,
+						'for' : [ 'Upload', 'upload' ]
+					}
 				]
 			},
@@ -285,5 +316,5 @@
 					{
 						type : 'hbox',
-						widths : [ '40%', '30%', '30%' ],
+						widths : [ '50%', '25%', '25%' ],
 						children :
 						[
@@ -309,5 +340,5 @@
 								id : 'txtLangCode',
 								label : editor.lang.dlgGenLangCode
-							},
+							}
 						]
 					},
@@ -338,23 +369,9 @@
 						id : 'txtdlgGenStyle',
 						label : editor.lang.dlgGenStyle
-					},
+					}
 				]
 			}
 		]
 	};
-
-	if ( imageDialog || editor.config.imageUpload )
-	{
-	var advancedTab = dialogElements.contents.pop();
-		if ( imageDialog )
-			dialogElements.contents.push( linkTab );		//Add the Link tab.
-
-		if ( editor.config.imageUpload )
-			dialogElements.contents.push( uploadTab );		//Add upload tab.
-
-		dialogElements.contents.push( advancedTab );
-	}
-
-	return dialogElements;
 };
 
