Index: /MediaWiki/trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/image.html
===================================================================
--- /MediaWiki/trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/image.html	(revision 946)
+++ /MediaWiki/trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/image.html	(revision 947)
@@ -45,5 +45,5 @@
 
 if ( oImage && oImage.tagName != 'IMG' )
-        oImage = null ;
+	oImage = null ;
 
 window.onload = function()
@@ -55,5 +55,5 @@
 	LoadSelection() ;
 
-//	UpdateOriginal() ;
+	//	UpdateOriginal() ;
 
 	window.parent.SetAutoSize( true ) ;
@@ -63,17 +63,19 @@
 function LoadSelection()
 {
-        if ( ! oImage ) return ;
-
-        var sUrl = GetAttribute( oImage, '_fcksavedurl', '' ) ;
-        if ( sUrl.length == 0 )
-                sUrl = GetAttribute( oImage, 'src', '' ) ;
-
-        GetE('txtUrl').value    = GetAttribute( oImage, '_fck_mw_filename', '' ) ;
-        GetE('txtAlt').value    = GetAttribute( oImage, 'alt', '' ) ;
-        GetE('xType').value		= GetAttribute( oImage, '_fck_mw_type', '' ) ;
-        GetE('cmbAlign').value  = GetAttribute( oImage, '_fck_mw_location', '' ) ;
-
-        GetE('txtWidth').value  = GetAttribute( oImage, '_fck_mw_width', '' ) ;
-        GetE('txtHeight').value = GetAttribute( oImage, '_fck_mw_height', '' ) ;
+	if ( ! oImage ) return ;
+
+	var sUrl = GetAttribute( oImage, '_fcksavedurl', '' ) ;
+	if ( sUrl.length == 0 )
+		sUrl = GetAttribute( oImage, 'src', '' ) ;
+
+	GetE('txtUrl').value    = GetAttribute( oImage, '_fck_mw_filename', '' ) ;
+	GetE('txtAlt').value    = GetAttribute( oImage, 'alt', '' ) ;
+	GetE('xType').value		= GetAttribute( oImage, '_fck_mw_type', '' ) ;
+	GetE('cmbAlign').value  = GetAttribute( oImage, '_fck_mw_location', '' ) ;
+
+	GetE('txtWidth').value  = GetAttribute( oImage, '_fck_mw_width', '' ) ;
+	GetE('txtHeight').value = GetAttribute( oImage, '_fck_mw_height', '' ) ;
+
+	UpdatePreview();
 }
 
@@ -86,5 +88,5 @@
 		return false ;
 	}
-	
+
 	window.parent.document.getElementById( 'btnOk' ).disabled = true ;
 	window.parent.document.getElementById( 'btnCancel' ).disabled = true ;
@@ -151,6 +153,6 @@
 	SetAttribute( e, "_fck_mw_height", GetE('txtHeight').value ) ;
 
-	SetAttribute( e, "width" , '' ) ;
-	SetAttribute( e, "height", '' ) ;
+	SetAttribute( e, "width" , GetE('txtWidth').value ) ;
+	SetAttribute( e, "height", GetE('txtHeight').value ) ;
 
 	if ( imgType == 'thumb' || imgType == 'frame' )
@@ -170,5 +172,5 @@
 		realUrl = 'about:blank' ;
 	}
-	
+
 	e.src = realUrl ;
 	SetAttribute( e, "_fcksavedurl", realUrl ) ;
@@ -256,10 +258,18 @@
 }
 
+function UpdatePreviewFromAjax( response )
+{
+	var eImgPreview = window.document.getElementById('prevImg');
+	eImgPreview.src = response.responseText ;
+	SetAttribute(eImgPreview, "width" , '180px' ) ;
+	SetAttribute(eImgPreview, "height", '130px' ) ;
+	//UpdateImage( eImgPreview, response.responseText ) ;
+}
+
 function UpdatePreview()
 {
-//        if ( !eImgPreview )
-//                return ;
-
-//		UpdateImage( eImgPreview, true ) ;
+	var ajaxArg = GetE('txtUrl').value + '|180x130px';
+	oEditor.window.parent.sajax_request_type = 'GET' ;
+	oEditor.window.parent.sajax_do_call( 'wfSajaxGetImageUrl', [ajaxArg], UpdatePreviewFromAjax ) ;
 }
 
@@ -269,16 +279,19 @@
 	<div id="divInfo">
 		<table cellspacing="1" cellpadding="1" border="0" width="100%">
-			<tr>
+			<tr valign="center">
 				<td>
 					<span>Image file name</span><br />
-					<input id="txtUrl" style="width: 100%" type="text" onkeyup="OnUrlChange();" onblur="UpdatePreview();" />
+					<input id="txtUrl" style="width: 100%" type="text" onkeyup="OnUrlChange();" />
 					<br />
 					Automatic search results (<span id="xWikiSearchStatus">start typing in the above field</span>)<br />
-					<select id="xWikiResults" size="5" style="width: 100%; height: 70px" onclick="SetUrl( this.value );">
+					<select id="xWikiResults" size="5" style="width: 100%; height: 70px" onclick="SetUrl( this.value );UpdatePreview();">
 					</select>
+				</td>
+				<td width="180px" height="130px"><div style="width:180; height:130; border:solid 1px black;" valign="center" align="center">
+					<img id="prevImg" width="180px" height="130px" alt="Preview"></div>
 				</td>
 			</tr>
 			<tr>
-				<td>
+				<td colspan="2">
 					<span>Caption</span><br />
 					<input id="txtAlt" style="width: 100%" type="text"><br />
@@ -286,5 +299,5 @@
 			</tr>
 			<tr>
-				<td valign="top">
+				<td valign="top" colspan="2">
 					<table cellspacing="0" cellpadding="0" border="0">
 						<tr>
