* some upload from remote api improvements
authorMichael Dale <dale@users.mediawiki.org>
Fri, 9 Oct 2009 21:12:41 +0000 (21:12 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Fri, 9 Oct 2009 21:12:41 +0000 (21:12 +0000)
* some playback fixes for native embed
* loading dialog helpers in core

js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
js2/mwEmbed/libAddMedia/remoteSearchDriver.js
js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js
js2/mwEmbed/libAddMedia/searchLibs/metavidSearch.js
js2/mwEmbed/libEmbedVideo/embedVideo.js
js2/mwEmbed/libEmbedVideo/nativeEmbed.js
js2/mwEmbed/mv_embed.js
js2/mwEmbed/skins/ctrlBuilder.js

index 8b37466..758f836 100644 (file)
@@ -303,10 +303,12 @@ mvBaseUploadInterface.prototype = {
        },
        doHttpUpload:function( opt ){
                var _this = this;
+               //make sure to display the progress win:
+               _this.dispProgressOverlay();            
                //set the http box to loading (in case we don't get an update for some time)
                $j('#dlbox-centered').html( '<h5>' + _this.getProgressTitle() + '</h5>' +
                        mv_get_loading_img( 'left:40%;top:20%')
-               );
+               );              
                //setup request:
                var req = {
                        'action'                : 'upload',
index 37bfe8d..8b18a69 100644 (file)
@@ -44,7 +44,9 @@ loadGM({
        "mwe-update_preview" : "Update preview",
        "mwe-cancel_import" : "Cancel import",
        "mwe-importing_asset" : "Importing asset",
-       "mwe-preview_insert_resource" : "Preview insert of resource: $1"
+       "mwe-preview_insert_resource" : "Preview insert of resource: $1",
+       "mwe-checking-resource": "Checking for resource",
+       "mwe-resource-needs-import": "Resource $1 needs to be imported"
 });
 
 var default_remote_search_options = {
@@ -154,6 +156,9 @@ remoteSearchDriver.prototype = {
                        'api_url':'http://commons.wikimedia.org/w/api.php',
                        'lib'   :'mediaWiki',
                        'resource_prefix': 'WC_', //prefix on imported resources (not applicable if the repository is local)
+                       
+                       //if we should check for shared repository asset ( generally only applicable to commons )
+                       'check_shared':true,
 
                        //list all the domains where commons is local?
                        // probably should set this some other way by doing an api query
@@ -949,7 +954,7 @@ remoteSearchDriver.prototype = {
                                                //get a thumb with proper resolution transform if possible:
                                                o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + cp_id + '__' + rInx +
                                                                '" style="width:' + _this.thumb_width + 'px;" src="' +
-                                                               cp.sObj.getImageTransform( rItem, {'width':_this.thumb_width } )
+                                                               cp.sObj.getImageTransform( rItem, { 'width' : _this.thumb_width } )
                                                                + '">';
                                                //add a linkback to resource page in upper right:
                                                if( rItem.link )
@@ -994,7 +999,7 @@ remoteSearchDriver.prototype = {
                var _this = this;
                $j('.mv_clip_'+_this.result_display_mode+'_result').hover(function(){
                        $j(this).addClass('mv_clip_'+_this.result_display_mode+'_result_over');
-                       //also set the animated image if avaliable
+                       //also set the animated image if available
                        var res_id = $j(this).children('.rsd_res_item').attr('id');
                        var rObj = _this.getResourceFromId( res_id );
                        if( rObj.poster_ani )
@@ -1022,14 +1027,14 @@ remoteSearchDriver.prototype = {
                //add the edit layout window with loading place holders
                $j( _this.target_container ).append('<div id="rsd_resource_edit" '+
                        'style="position:absolute;top:0px;left:0px;bottom:0px;right:4px;background-color:#FFF;">' +
-                               '<div id="clip_edit_disp" style="position:absolute;' + overflow_style + 'width:100%;height:100%;padding:5px;'+
-                                       'width:' + (maxWidth) + 'px;" >' +
-                                               mv_get_loading_img('position:absolute;top:30px;left:30px') +
-                               '</div>'+
                                '<div id="clip_edit_ctrl" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;'+
-                                       'left:' + ( maxWidth + 10 ) +'px;top:5px;bottom:10px;right:0px;overflow:auto;padding:5px;">'+
+                                       'left:2px;top:5px;bottom:10px;width:' + ( maxWidth + 5 ) + 'px;overflow:auto;padding:5px;">'+
                                                mv_get_loading_img() +
                                '</div>'+
+                               '<div id="clip_edit_disp" class="ui-widget ui-widget-content ui-corner-all"' +  
+                                       'style="position:absolute;' + overflow_style + ';left:'+ ( maxWidth + 20 ) +'px;right:0px;top:5px;bottom:10px;padding:5px;>' +
+                                               mv_get_loading_img('position:absolute;top:30px;left:30px') +
+                               '</div>'+                       
                '</div>');
        },
        resourceEdit:function( rObj, rsdElement){
@@ -1071,13 +1076,13 @@ remoteSearchDriver.prototype = {
                        'opacity':0
                });
                
-               //try and keep aspect ratio for the thumbnail that we clicked:                          
-               var tRatio = rObj.orgheight / rObj.orgwidth;
+               //try and keep aspect ratio for the thumbnail that we clicked:          
+               var tRatio = $j(rsdElement).height() / $j(rsdElement).width();
 
                if(     ! tRatio )
                        var tRatio = 1; //set ratio to 1 if tRatio did not work. 
 
-               //js_log('set from ' +  tRatio + ' to init thumbimage to ' + maxWidth + ' x ' + parseInt( tRatio * maxWidth) );
+               js_log('Set from ' +  tRatio + ' to init thumbimage to ' + maxWidth + ' x ' + parseInt( tRatio * maxWidth) );
                //scale up image and to swap with high res version
                $j('#rsd_edit_img').animate({
                        'opacity':1,
@@ -1196,24 +1201,36 @@ remoteSearchDriver.prototype = {
                                //run the image clip tools
                                _this.cEdit = new mvClipEdit( mvClipInit );
                        });
-               }
-               if( mediaType == 'video' || mediaType == 'audio'){
-                       //get any additonal embedding helper meta data prior to doing the acutal embed
-                       // normally this meta should be provided in the search result (but archive.org has a seperate query for more meida meta)
+               }else if( mediaType == 'video' || mediaType == 'audio'){
+                       js_log('media type:: ' + mediaType);
+                       //get any additional embedding helper meta data prior to doing the actual embed
+                       // normally this meta should be provided in the search result (but archive.org has another query for more media meta)
                        rObj.pSobj.getEmbedTimeMeta( rObj, function(){
                                //make sure we have the embedVideo libs:
+                               var runFlag = false;
                                mvJsLoader.embedVideoCheck( function(){
+                                       //strange concurency issue with callbacks 
+                                       //@@todo try and figure out why this callback is fired twice
+                                       if(!runFlag){
+                                               runFlag = true;
+                                       }else{
+                                               js_log('only run embed vid once');
+                                               return false;
+                                       }
                                        js_log('append html: ' + rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'}) );
                                        $j('#clip_edit_disp').html(
-                                               rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'})
+                                               rObj.pSobj.getEmbedHTML( rObj, {
+                                                       id : 'embed_vid'
+                                               })
                                        );
+                                       js_log("about to call rewrite_by_id::embed_vid");                                       
                                        //rewrite by id
-                                       rewrite_by_id('embed_vid',function(){
+                                       rewrite_by_id('embed_vid', function(){
                                                //grab any information that we got from the ROE xml or parsed from the media file
                                                rObj.pSobj.getEmbedObjParsedInfo( rObj, 'embed_vid' );
                                                //add the re-sizable to the doLoad request:
                                                clibs.push( '$j.ui.resizable');
-                                               clibs.push( '$j.fn.hoverIntent');
+                                               clibs.push( '$j.fn.hoverIntent');                                               
                                                mvJsLoader.doLoad(clibs, function(){
                                                        //make sure the rsd_edit_img is hidden:
                                                        $j('#rsd_edit_img').remove();
@@ -1242,6 +1259,18 @@ remoteSearchDriver.prototype = {
                }
        },
        checkImportResource:function( rObj, cir_callback){
+               var _this = this;               
+               //add a loader ontop:
+               $j.addLoaderDialog( gM('mwe-checking-resource') );              
+               //extend the callback with close dialog
+               var org_cir_callback = cir_callback;
+               cir_callback = function( rObj ){
+                       var cat = org_cir_callback;                     
+                       $j.closeLoaderDialog();                         
+                       if( org_cir_callback && typeof org_cir_callback == 'function'){
+                               org_cir_callback( rObj );
+                       }
+               }                       
                //@@todo get the localized File/Image namespace name or do a general {NS}:Title
                var cp = rObj.pSobj.cp;
                var _this = this;
@@ -1252,39 +1281,49 @@ remoteSearchDriver.prototype = {
                //check if local repository
                //or if import mode if just "linking" (we should already have the 'url'
 
-               if( this.checkRepoLocal( cp ) || this.import_url_mode == 'remote_link'){
+               if( this.checkRepoLocal( cp ) || this.import_url_mode == 'remote_link'){                
                        //local repo jump directly to check Import Resource callback:
                         cir_callback( rObj );
-               }else{                  
-                       js_log('check for: ' + rObj.target_resource_title);
+               }else{                                          
                        //check if the file is local (can be shared repo)  
-                       _this.checkForFile(rObj.target_resource_title, function(imagePage){
-                               if( imagePage ){
-                                       cir_callback( rObj );
-                               }else{
-                                       //update target_resource_title with resource repository prefix:
-                                       rObj.target_resource_title = cp.resource_prefix + rObj.target_resource_title;
-                                       reqObj['titles'] = _this.cFileNS + ':' + rObj.target_resource_title,                                            
-                                       //check if the file exists: 
-                                       _this.checkForFile( rObj.target_resource_title, function( imagePage ){
-                                               if( imagePage ){
-                                                       //update to local src
-                                                       rObj.local_src = imagePage['imageinfo'][0].url;
-                                                       //@@todo maybe  update poster too?
-                                                       rObj.local_poster = imagePage['imageinfo'][0].thumburl;
-                                                       
-                                                       //resource is already present (or resource with same name is already present)
-                                                       rObj.target_resource_title = found_title.replace(/File:|Image:/,'');
-                                                       cir_callback( rObj );
-                                               }else{
-                                                       _this.doImportInterface(rObj, callback);
-                                               }
-                                       });
-                               }
-                       });                     
+                       if( cp.check_shared ){                  
+                               _this.checkForFile(rObj.target_resource_title, function(imagePage){                             
+                                       if( imagePage && imagePage['imagerepository'] == 'shared' ){                                            
+                                               cir_callback( rObj );
+                                       }else{
+                                               _this.checkPrefixNameImport( rObj, cir_callback );
+                                       }
+                               });
+                       }else{
+                               _this.checkPrefixNameImport(rObj, cir_callback);
+                       }
                }
+       },
+       checkPrefixNameImport: function(rObj, cir_callback){
+               js_log('::checkPrefixNameImport:: ');
+               var cp = rObj.pSobj.cp;
+               var _this = this;               
+               //update target_resource_title with resource repository prefix:
+               rObj.target_resource_title = cp.resource_prefix + rObj.target_resource_title;                                                   
+               //check if the file exists: 
+               _this.checkForFile( rObj.target_resource_title, function( imagePage ){          
+                       if( imagePage ){
+                               //update to local src
+                               rObj.local_src = imagePage['imageinfo'][0].url;
+                               //@@todo maybe  update poster too?
+                               rObj.local_poster = imagePage['imageinfo'][0].thumburl;                         
+                               //update the title: 
+                               rObj.target_resource_title = imagePage.title.replace(/File:|Image:/,'');
+                               cir_callback( rObj );
+                       }else{
+                               //close the dialog and display the import interface: 
+                               $j.closeLoaderDialog();
+                               _this.doImportInterface(rObj, cir_callback);
+                       }
+               });                                             
        },      
-       doImportInterface : function( rObj, callback){                                                  
+       doImportInterface : function( rObj, callback){          
+               var _this = this;                                       
                js_log("doImportInterface:: update:"+ _this.cFileNS + ':' + rObj.target_resource_title);
                //update the rObj with import info
                rObj.pSobj.updateDataForImport( rObj );
@@ -1325,9 +1364,13 @@ remoteSearchDriver.prototype = {
                $j( _this.target_container ).append('<div id="rsd_resource_import" '+
                'class="ui-state-highlight ui-widget-content ui-state-error" ' +
                'style="position:absolute;top:50px;left:50px;right:50px;bottom:50px;z-index:5">' +
-                       '<h3 style="color:red">Resource: <span style="color:black">' + rObj.title + '</span> needs to be imported</h3>'+
+                       '<h3 style="color:red">' + gM('mwe-resource-needs-import', rObj.title) + '</h3>' +
                                '<div id="rsd_preview_import_container" style="position:absolute;width:50%;bottom:0px;left:0px;overflow:auto;top:30px;">' +
-                                       rObj.pSobj.getEmbedHTML( rObj, {'id': _this.target_container + '_rsd_pv_vid', 'max_height':'200','only_poster':true} )+ //get embedHTML with small thumb:
+                                       rObj.pSobj.getEmbedHTML( rObj, {
+                                               'id': _this.target_container + '_rsd_pv_vid', 
+                                               'max_height':'220',
+                                               'only_poster':true
+                                       }) + //get embedHTML with small thumb:
                                        '<br style="clear both">'+
                                        '<strong>'+gM('mwe-resource_page_desc') +'</strong>'+
                                        '<div id="rsd_import_desc" syle="display:inline;">'+
@@ -1352,20 +1395,20 @@ remoteSearchDriver.prototype = {
                                        $j.btnHtml(gM('mwe-cancel_import'), 'rsd_import_acancel', 'close' ) + ' ' +
 
                                '</div>'+
-                               //output the rendered and non-renderd version of description for easy swiching:
+                               //output the rendered and non-rendered version of description for easy switching:
                '</div>');
                //add hover:
-               //update video tag
-               rewrite_by_id(_this.target_container + '_rsd_pv_vid');
+               
+               //update video tag (if a video) 
+               rewrite_by_id( _this.target_container + '_rsd_pv_vid');
+               
                //load the preview text:
                _this.getParsedWikiText( wt, _this.cFileNS +':'+ rObj.target_resource_title, function( o ){
                        $j('#rsd_import_desc').html(o);
                });
                //add bindings:
                $j( _this.target_container + ' .rsd_import_apreview').btnBind().click(function(){
-                       /*$j('#rsd_import_desc').show().html(
-                               mv_get_loading_img()
-                       );*/
+                       js_log("do preview asset");                     
                        //load the preview text:
                        _this.getParsedWikiText( $j('#rsd_import_ta').val(), _this.cFileNS +':'+ rObj.target_resource_title, function( o ){
                                js_log('got updated preivew: ');
@@ -1373,9 +1416,10 @@ remoteSearchDriver.prototype = {
                        });
                });
                $j(_this.target_container + ' .rsd_import_doimport').btnBind().click(function(){
-                       //check import mode:                                                    
-                       if( _this.import_url_mode=='api'){
-                               _this.doImportAPI( rObj , cir_callback);
+                       js_log("do import asset:" + _this.import_url_mode);
+                       //check import mode:                                    
+                       if( _this.import_url_mode == 'api' ){
+                               _this.doImportAPI( rObj , callback);
                        }else{
                                js_log("Error: import mode is not form or API (can not copy asset)");
                        }
@@ -1387,6 +1431,7 @@ remoteSearchDriver.prototype = {
                });                                                                     
        },                                              
        checkForFile:function( fName, callback){
+               js_log("checkForFile::");
                var _this = this;        
                reqObj={
                                'action':'query',
@@ -1400,27 +1445,34 @@ remoteSearchDriver.prototype = {
                        'data':reqObj,
                        'url':this.local_wiki_api_url
                        },function(data){
-                               var found_title = false;                                
-                               for(var i in data.query.pages){                         
-                                       js_log('found title: ' + i + ':' +  data.query.pages[i]['title']);                                      
-                                       found_title = data.query.pages[i]['title'];                                     
-                               }
-                               if( found_title ){                                      
-                                       callback( data.query.pages[i] );
-                               }else{
-                                       callback( false );
+                               if( data.query.pages ){                         
+                                       for(var i in data.query.pages){         
+                                               for(var j in data.query.pages[i]){
+                                                       if(j == 'missing' && data.query.pages[i].imagerepository != 'shared'){
+                                                               js_log(fName + " not found");
+                                                               callback( false );
+                                                               return ;
+                                                       }                                                               
+                                               }               
+                                               //else page is found: 
+                                               js_log(fName + "  found");
+                                               callback( data.query.pages[i] );                                                
+                                       }
                                }
                        }
                );
        },
        doImportAPI:function(rObj, cir_callback){
                var _this = this;
+               js_log(":doImportAPI:");
+               $j.addLoaderDialog( gM('mwe-importing_asset') );                
                //baseUploadInterface
                mvJsLoader.doLoad([
                        'mvBaseUploadInterface',
                        '$j.ui.progressbar'
                ],function(){
-                       //initiate a download similar to url copy:
+                       js_log('mvBaseUploadInterface ready');
+                       //initiate a upload object ( similar to url copy ):
                        myUp = new mvBaseUploadInterface({
                                'api_url' : _this.local_wiki_api_url,
                                'done_upload_cb':function(){
@@ -1433,9 +1485,13 @@ remoteSearchDriver.prototype = {
                                        return cir_callback();                                  
                                }
                        });
-                       //set the edit token if we have it handy
+                       //get the edit token if we have it handy
                        _this.getEditToken(function( token ){
                                myUp.etoken = token;
+                               
+                               //close the loader now that we are ready to present the progress dialog::
+                               $j.closeLoaderDialog();
+                               
                                myUp.doHttpUpload({
                                        'url'       : rObj.src,
                                        'filename'  : rObj.target_resource_title,
@@ -1468,7 +1524,7 @@ remoteSearchDriver.prototype = {
                this.checkImportResource( rObj, function(){
                        //put another window ontop:
                        $j( _this.target_container ).append('<div id="rsd_preview_display"' +
-                                       'style="position:absolute;overflow:hidden;z-index:4;top:0px;bottom:75px;right:0px;left:0px;background-color:#FFF;">' +
+                                       'style="position:absolute;overflow:hidden;z-index:4;top:0px;bottom:0px;right:0px;left:0px;background-color:#FFF;">' +
                                                mv_get_loading_img('top:30px;left:30px') +
                                        '</div>');
 
@@ -1553,7 +1609,8 @@ remoteSearchDriver.prototype = {
                        if(_this.target_render_area && _this.cur_embed_code){
                                 //output with some padding:
                                 $j(_this.target_render_area).append( _this.cur_embed_code + '<div style="clear:both;height:10px">')
-                                //update if its video or audio:
+                                
+                                //update the player if video or audio:
                                 if( rObj.mime.indexOf('audio')!=-1 ||
                                         rObj.mime.indexOf('video')!=-1 ||
                                         rObj.mime.indexOf('/ogg') !=-1){
index 2829c55..02bbaa7 100644 (file)
@@ -57,7 +57,7 @@ archiveOrgSearch.prototype = {
                        //set result info: 
                        this.num_results = data.response.numFound;
                
-                       for(var resource_id in data.response.docs){
+                       for(var resource_id in data.response.docs){                             
                                var resource = data.response.docs[resource_id];                         
                                var rObj = {
                                        //@@todo we should add .ogv or oga if video or audio:
@@ -89,13 +89,15 @@ archiveOrgSearch.prototype = {
                        }
                }               
        },
+       //getTitleKey:function(rObj){
+       //      return rObj['stream_name'] + '__' + rObj['start_time'].replace(/:/g,'.') + '_to_' + rObj['end_time'].replace(/:/g,'.') + '.ogg';;
+       //}
        getEmbedTimeMeta:function(rObj, callback){
                var _this = this;
                do_api_req( {
                        'data':{'avinfo':1},
-                       'url':_this.dnUrl + rObj.resourceKey + '/format=Ogg+video'
-               },function(data){                       
-                       var cat = data;
+                       'url':_this.dnUrl + rObj.resourceKey + '/format=Ogg+video'                      
+               },function(data){                                                               
                        if(data['length'])
                                rObj.duration = data['length'];
                        if(data['width'])
index a8c8d39..43862e9 100644 (file)
@@ -64,14 +64,14 @@ metavidSearch.prototype = {
                                rObj['titleKey'] =       _this.getTitleKey( rObj );
 
                                //default width of metavid clips:
-                               rObj['target_width'] = 400;
+                               rObj['target_width'] = 400;                                     
                        }
                        //done loading:
                        _this.loading=0;
                });
        },
        getTitleKey:function( rObj ){
-               return rObj['stream_name'] + '_start-' + rObj['start_time'].replace(/:/g,'.') + '_end-' + rObj['end_time'].replace(/:/g,'.') + '.ogg';
+               return rObj['stream_name'] + '_part_' + rObj['start_time'].replace(/:/g,'.') + '_to_' + rObj['end_time'].replace(/:/g,'.') + '.ogv';
        },
        getTitle:function( rObj ){
                var sn = rObj['stream_name'].replace(/_/g, ' ');
index bddf73b..641d256 100644 (file)
@@ -119,18 +119,18 @@ _global['dismissNativeWarn'] = false;
 * Converts all occurrences of <video> tag into video object
 */
 function mv_video_embed(swap_done_callback, force_id){
+       //check call stack
        mvEmbed.init( swap_done_callback, force_id );
 }
 mvEmbed = {    
        //flist stores the set of functions to run after the video has been swapped in. 
        flist:new Array(),
-       init:function( swap_done_callback, force_id ){
-               
+       init:function( swap_done_callback, force_id ){          
                if(swap_done_callback)
                        mvEmbed.flist.push( swap_done_callback );
                        
                //get mv_embed location if it has not been set
-               js_log('mv_embed ' + MV_EMBED_VERSION);                                         
+               js_log('mv_video_embed:: ' + MV_EMBED_VERSION);                                         
                
                var loadPlaylistLib=false;                                              
                
@@ -157,13 +157,14 @@ mvEmbed = {
                                   loadPlaylistLib=true;
                           break;
                   }            
-               }
-               
+               }               
                if( force_id == null && force_id != '' ){
                        var j_selector = 'video,audio,playlist';                                
-               }else{
+               }else{          
                        var j_selector = '#' + force_id;
                }
+               
+               js_log('j_selector:: ' + j_selector);
                //process selected elements: 
                //ie8 does not play well with the jQuery video,audio,playlist selector use native: 
                if($j.browser.msie && $j.browser.version >= 8){
@@ -2087,11 +2088,6 @@ embedVideo.prototype = {
                //update buffer information 
                this.updateBufferStatus();
                
-               //check if we passed duration
-               if( this.duration && (this.currentTime > this.duration) ){
-                       this.onClipDone();
-               }
-               
                //update monitorTimerId to call child monitor
                if( ! this.monitorTimerId ){
                        //make sure an instance of this.id exists: 
index ba0a5dd..2936508 100644 (file)
@@ -49,26 +49,22 @@ var nativeEmbed = {
                var _this = this;               
                js_log("f:native:postEmbedJS:");                
                this.getVID();
-               var doActualPlay= function(){
-                       js_log("doActualPlay ");
-                       _this.vid.play();
-               }
                if(typeof this.vid != 'undefined'){                     
                        //always load the media:
                        if( this.onlyLoadFlag ){ 
                                this.vid.load();
                        }else{  
-                               this.vid.load();
-                               setTimeout(doActualPlay, 500);                                                          
+                               //issue play request                            
+                               this.vid.play();
                        }                                                       
                        setTimeout('$j(\'#'+this.id+'\').get(0).monitor()',100);                
                }else{
                        js_log('could not grab vid obj trying again:' + typeof this.vid);
                        this.grab_try_count++;
-                       if(     this.grab_count == 10 ){
+                       if(     this.grab_count == 20 ){
                                js_log(' could not get vid object after 10 tries re-run: getEmbedObj()' ) ;                                             
                        }else{
-                               setTimeout('$j(\'#'+this.id+'\').get(0).postEmbedJS()',100);
+                               setTimeout('$j(\'#'+this.id+'\').get(0).postEmbedJS()', 200);
                        }                       
                }
        },      
@@ -184,7 +180,7 @@ var nativeEmbed = {
                this.getVID();
                js_log('f:onloadedmetadata metadata ready (update duration)');  
                //update duration if not set (for now trust the getDuration more than this.vid.duration         
-               if( this.getDuration()==0  &&  !isNaN( this.vid.duration )){
+               if( this.getDuration() == 0  &&  ! isNaN( this.vid.duration ) ){
                        js_log('updaed duration via native video duration: '+ this.vid.duration)
                        this.duration = this.vid.duration;
                }
@@ -207,6 +203,7 @@ var nativeEmbed = {
                        }
                        setTimeout(doRetry, 100);                       
                }else{
+                       js_log('native onClipDone done call');
                        this.onClipDone();
                }
        },      
index da06905..fd2af28 100644 (file)
@@ -987,7 +987,7 @@ var mvJsLoader = {
                                _global['mv_default_thumb_url'] = mv_skin_img_path + 'vid_default_thumb.jpg';
                                
                                //setup skin dependent dependencies 
-                               lcCssPath({'embedVideo'         : 'skins/' + mwConfig['skin_name'] + '/playerSkin.css'});                               
+                               lcCssPath({'embedVideo' : 'skins/' + mwConfig['skin_name'] + '/playerSkin.css'});                               
                                
                                // Make sure the skin/style sheets are always available:
                                loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
@@ -1037,6 +1037,7 @@ var mvJsLoader = {
                        if( $j.browser.msie || $j.browser.version < 7 )
                                depReq[0].push( '$j.fn.pngFix' );
                        
+                       //load the video libs: 
                        _this.doLoadDepMode( depReq, function() {
                                embedTypes.init();
                                callback();
@@ -1387,6 +1388,40 @@ function mv_jqueryBindings() {
                        )
                        return this;
                }
+               /**
+               * addLoaderDialog
+               *  small helper for putting a loading dialog box on top of everything 
+               * (helps block for request that
+               * 
+               * @param msg text text of the loader msg
+               */
+               $.addLoaderDialog = function( msg_txt ){                        
+                       if( $('#mwe_tmp_loader').length != 0 )
+                               $('#mwe_tmp_loader').remove();
+                       
+                       $('body').append('<div id="mwe_tmp_loader" title="' + msg_txt + '" >' +                         
+                                       gM('mwe-checking-resource') + '<br>' + 
+                                       mv_get_loading_img() +
+                       '</div>');
+                       
+                       mvJsLoader.doLoadDepMode([
+                               [                                       
+                                       '$j.ui'
+                               ],
+                               [
+                                       '$j.ui.dialog'
+                               ]
+                       ], function() {                         
+                               $('#mwe_tmp_loader').dialog({
+                                       bgiframe: true,
+                                       height: 140,
+                                       modal: true
+                               });
+                       });
+               }
+               $.closeLoaderDialog = function(){
+                       $('#mwe_tmp_loader').dialog('close');
+               }
 
        })(jQuery);
 }
index 77cd0da..f4b2744 100644 (file)
@@ -2,7 +2,7 @@
 _global['dismissNativeWarn'] = false;
 
 /**
-* Msg text is inhereited from embedVideo (we should move it here (although can't load ctrlBuilder without parent EmbedVideo obj)
+* Msg text is inherited from embedVideo (we should move it here (although can't load ctrlBuilder without parent EmbedVideo obj)
 /
 
 /**