From ef625d86142aabb14a4382dd4dea8d456fd801c5 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Fri, 7 Aug 2009 01:32:14 +0000 Subject: [PATCH] fixed infinite loop bug on removing all clips from sequence --- js2/editPage.js | 2 +- js2/mwEmbed/libAddMedia/remoteSearchDriver.js | 12 +++++++----- js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js | 5 +++-- js2/mwEmbed/libSequencer/mvPlayList.js | 8 +++++--- js2/mwEmbed/libSequencer/mvSequencer.js | 9 +++++---- js2/mwEmbed/mv_embed.js | 2 +- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/js2/editPage.js b/js2/editPage.js index b2c6498ebb..13e5552732 100644 --- a/js2/editPage.js +++ b/js2/editPage.js @@ -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(''); diff --git a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js index 5ba1e56a03..f57928d785 100644 --- a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js @@ -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('
' + + 'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' + '
' + mv_get_loading_img('position:absolute;top:30px;left:30px') + diff --git a/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js b/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js index 8563087cd7..9f3dd1e44d 100644 --- a/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js @@ -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){ diff --git a/js2/mwEmbed/libSequencer/mvPlayList.js b/js2/mwEmbed/libSequencer/mvPlayList.js index cb5ca8cbd3..df9d2fbb39 100644 --- a/js2/mwEmbed/libSequencer/mvPlayList.js +++ b/js2/mwEmbed/libSequencer/mvPlayList.js @@ -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(''+ '' + this.title + ' '+ this.getClipCount()+' clips, '+ diff --git a/js2/mwEmbed/libSequencer/mvSequencer.js b/js2/mwEmbed/libSequencer/mvSequencer.js index 384b960a3c..625dff6736 100644 --- a/js2/mwEmbed/libSequencer/mvSequencer.js +++ b/js2/mwEmbed/libSequencer/mvSequencer.js @@ -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('