fixed infinite loop bug on removing all clips from sequence
authorMichael Dale <dale@users.mediawiki.org>
Fri, 7 Aug 2009 01:32:14 +0000 (01:32 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Fri, 7 Aug 2009 01:32:14 +0000 (01:32 +0000)
js2/editPage.js
js2/mwEmbed/libAddMedia/remoteSearchDriver.js
js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js
js2/mwEmbed/libSequencer/mvPlayList.js
js2/mwEmbed/libSequencer/mvSequencer.js
js2/mwEmbed/mv_embed.js

index b2c6498..13e5552 100644 (file)
@@ -23,7 +23,7 @@ js2AddOnloadHook( function(){
 var mwEditPageHelper = {       
        init:function(){
                var _this = this;
-               //@@todo check for new version of toolbar and add properly:
+               //@@todo check for new version of toolbar and via toolbar api:
                if(typeof $j.fn.toolbar == 'undefined'){                        
                        //add the add-media-wizard button for old toolbar: 
                        $j('#toolbar').append('<img style="cursor:pointer" id="btn-add-media-wiz" src="' + mv_skin_img_path + 'Button_add_media.png">');
index 5ba1e56..f57928d 100644 (file)
@@ -356,9 +356,11 @@ remoteSearchDriver.prototype = {
                if( $j(this.target_invocation).length==0 ){
                        js_log("RemoteSearchDriver:: no target invocation provided (will have to run your own doInitDisplay() )");
                }else{
-                       $j(this.target_invocation).css('cursor','pointer').attr('title', gM('add_media_wizard')).click(function(){
-                               _this.doInitDisplay();
-                       });             
+                       if(this.target_invocation){
+                               $j(this.target_invocation).css('cursor','pointer').attr('title', gM('add_media_wizard')).click(function(){
+                                       _this.doInitDisplay();
+                               });             
+                       }
                }                                                               
        },
        doInitDisplay:function(){       
@@ -445,7 +447,7 @@ remoteSearchDriver.prototype = {
                                        js_log('closed modal');
                                        $j(this).parents('.ui-dialog').fadeOut('slow');
                                }               
-                       }).css({'height':'100%'}).parent('.ui-dialog').css( _this.dmodalCss )
+                       }).parent('.ui-dialog').css( _this.dmodalCss )
                        //@@bind on resize to disable css dialog to update dmodelCss 
                        .bind('resizestart', function(event, ui) {
                                 _this.dmodalCss = {};
@@ -974,7 +976,7 @@ remoteSearchDriver.prototype = {
                var overflow_style = ( mediaType =='video' )?'':'overflow:auto;';
                //append to the top level of model window:
                $j( _this.target_container ).append('<div id="rsd_resource_edit" '+
-                       'style="position:absolute;top:0px;left:0px;bottom:75px;right:4px;background-color:#FFF;">' +                     
+                       'style="position:absolute;top:0px;left:0px;bottom:5px;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') +
index 8563087..9f3dd1e 100644 (file)
@@ -31,13 +31,14 @@ seqRemoteSearchDriver.prototype = {
                if(!this.pSeq.parent_do_refresh_timeline){
                        this.pSeq.parent_do_refresh_timeline = this.pSeq.do_refresh_timeline;
                        this.pSeq.do_refresh_timeline = function(){
-                               js_log("seqRs refresh chain::" + _this.pSeq.disp_menu_item);
+                               js_log("seqRemoteSearchDriver::" + _this.pSeq.disp_menu_item);
                                //call the parent
                                _this.pSeq.parent_do_refresh_timeline();
                                //add our local bindings if our window is 'active'
                                if(_this.pSeq.disp_menu_item == 'cliplib'){
                                        _this.addResultBindings();
                                }
+                               return true;
                        }
                }
        },      
@@ -70,7 +71,7 @@ seqRemoteSearchDriver.prototype = {
                $j(".mv_clip_drag").droppable( 'destroy' ).droppable({
                        accept: '.rsd_res_item',
                        over:function(event, ui){
-                               js_log("over : mv_clip_drag: " + $j(this).attr('id') );
+                               //js_log("over : mv_clip_drag: " + $j(this).attr('id') );
                                $j(this).css('border-right', 'solid thick red');                                
                        },
                        out:function(event, ui){
index cb5ca8c..df9d2fb 100644 (file)
@@ -203,9 +203,11 @@ mvPlayList.prototype = {
                                 }
                }                          
        },
-       doNativeWarningCheck:function(){
+       doNativeWarningCheck:function(){                
                var clip =       this.default_track.clips[0];
-               return clip.embed.doNativeWarningCheck();
+               if(clip){
+                       return clip.embed.doNativeWarningCheck();
+               }
        },
        doWhenParseDone:function(){                             
                js_log('f:doWhenParseDone');
@@ -511,7 +513,7 @@ mvPlayList.prototype = {
        },
        updateBaseStatus:function(){
                var _this = this;
-               js_log('f:updateBaseStatus');
+               js_log('Playlist:updateBaseStatus');
                $j('#ptitle_'+this.id).html(''+
                        '<b>' + this.title + '</b> '+                           
                        this.getClipCount()+' clips, <i>'+
index 384b960..625dff6 100644 (file)
@@ -1418,13 +1418,13 @@ mvSequencer.prototype = {
                }               
        },
        //renders cnt_time
-       render_playheadhead_seeker:function(){           
+       render_playheadhead_seeker:function(){          
+               js_log('render_playheadhead_seeker'); 
                //render out time stamps and time "jump" links 
                //first get total width
                
                //remove the old one if its still there         
-               $j('#'+this.timeline_id +'_pl_control').remove();
-               js_log('output controls to: ' + this.target_sequence_container);
+               $j('#'+this.timeline_id +'_pl_control').remove();               
                //render out a playlist clip wide and all the way to the right (only playhead and play button) (outside of timeline)
                $j(this.target_sequence_container).append('<div id="'+ this.timeline_id +'_pl_control"'+
                        ' style="position:absolute;top:' + (this.plObj.height) +'px;'+
@@ -1479,7 +1479,8 @@ mvSequencer.prototype = {
                this.do_refresh_timeline();
                js_log('zoom out: '+this.timeline_scale);
        },
-       do_refresh_timeline:function( preserve_selection ){
+       do_refresh_timeline:function( preserve_selection ){             
+               js_log('Sequencer:do_refresh_timeline()');
                //@@todo should "lock" interface while refreshing timeline
                var pSelClips = [];
                if(preserve_selection){
index e86cf8a..dc6c974 100644 (file)
@@ -777,7 +777,7 @@ function mv_jqueryBindings(){
                                                '$j.ui.tabs',
                                                '$j.ui.sortable'
                                        ]
-                               ], function(){
+                               ], function(){                                  
                                        iObj['instance_name']= 'rsdMVRS';
                                        _global['rsdMVRS'] = new remoteSearchDriver( iObj );       
                                        if( callback ){