* Fixed some AMW issues
authorMichael Dale <dale@users.mediawiki.org>
Sat, 22 Aug 2009 06:49:47 +0000 (06:49 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Sat, 22 Aug 2009 06:49:47 +0000 (06:49 +0000)
js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
js2/mwEmbed/libAddMedia/remoteSearchDriver.js
js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js

index 1618e3f..438b563 100644 (file)
@@ -576,6 +576,7 @@ mvBaseUploadInterface.prototype = {
                                var url = apiRes.upload.imageinfo.descriptionurl;
                                //check done action:
                                if( _this.done_upload_cb && typeof _this.done_upload_cb == 'function'){
+                                       js_log("call done_upload_cb");
                                        //close up shop:
                                        $j('#upProgressDialog').dialog('close');
                                        //call the callback:
index 63fdb64..5ef8d1a 100644 (file)
@@ -1064,9 +1064,7 @@ remoteSearchDriver.prototype = {
        addResourceEditLoader:function(maxWidth, overflow_style){
                var _this = this;
                if(!maxWidth)maxWidth=400;
-               if(!overflow_style)overflow_style='overflow:auto;';
-               //hide the results container
-               $j('#rsd_results_container').hide();                    
+               if(!overflow_style)overflow_style='overflow:auto;';                                     
                //remove any old instance: 
                $j( _this.target_container ).find('#rsd_resource_edit').remove();
                //add the edit layout window with loading place holders 
@@ -1123,7 +1121,7 @@ remoteSearchDriver.prototype = {
 
 
                //try and keep aspect ratio for the thumbnail that we clicked:
-               var tRatio =   $j('#rsd_edit_img').height() / $j('#rsd_edit_img').width();
+               var tRatio =    $j('#rsd_edit_img').width() / $j('#rsd_edit_img').height() ;
                if(     ! tRatio )
                        var tRatio = 1; //set ratio to 1 if the width of the thumbnail can't be found for some reason
 
@@ -1162,16 +1160,14 @@ remoteSearchDriver.prototype = {
                        rObj['width'] = imObj.width;
                        rObj['height'] = imObj.height;
 
-                       //see if we need to animate some transition
-                       var newSize = false;
+                       //see if we need to animate some transition                     
                        if( size.width != imObj.width ){
                                js_log('loadHQImg:size mismatch: ' + size.width + ' != ' + imObj.width );
-                               newSize={
+                               //set the target id to the new size:
+                               $j('#'+target_img_id).animate( {
                                        'width':imObj.width + 'px',
                                        'height':imObj.height + 'px'
-                               }
-                               //set the target id to the new size:
-                               $j('#'+target_img_id).animate( newSize );
+                               });
                        }else{
                                js_log('using req size: ' + imObj.width + 'x' + imObj.height);
                                $j('#'+target_img_id).animate( {'width':imObj.width+'px', 'height' : imObj.height + 'px'});
@@ -1679,7 +1675,7 @@ remoteSearchDriver.prototype = {
                                 //update if its video or audio:
                                 if( rObj.mime.indexOf('audio')!=-1 ||
                                         rObj.mime.indexOf('video')!=-1 ||
-                                        rObj.mime.indexOf('/ogg') !=-1){
+                                        rObj.mime.indexOf('/ogg') !=-1){                                       
                                         mvJsLoader.embedVideoCheck(function(){
                                                mv_video_embed();
                                         });
index 896e8c1..b7223ff 100644 (file)
@@ -296,11 +296,11 @@ mediaWikiSearch.prototype = {
                        if( rObj.crop == null)
                                return imgHtml
                        //else do crop output:  
-                       return '<div style="width:' + rObj.crop.wpx +'">' +                             
-                               '<div style="width:'+rObj.crop.w +'px;height: ' + rObj.crop.h +'px;overflow:hidden;position:relative">' +
-                               '<div style="position:relative;top:-' + rObj.crop.y +'px;left:-' + rObj.crop.x +'px">'+
-                                       imgHtml + 
-                               '</div>';                       
+                               return '<div style="width:'+rObj.crop.w +'px;height: ' + rObj.crop.h +'px;overflow:hidden;position:relative">' +
+                                                       '<div style="position:relative;top:-' + rObj.crop.y +'px;left:-' + rObj.crop.x +'px">'+
+                                                               imgHtml + 
+                                                       '</div>'+
+                                               '</div>';                       
                }
                var ahtml='';
                if(rObj.mime == 'application/ogg' || rObj.mime == 'audio/ogg'){