Revision: 51919
Author:   dale
Date:     2009-06-15 19:01:05 +0000 (Mon, 15 Jun 2009)

Log Message:
-----------
transition control tabs displayed 

Modified Paths:
--------------
    branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js
    branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js

Modified: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js
===================================================================
--- branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js  
2009-06-15 18:39:41 UTC (rev 51918)
+++ branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js  
2009-06-15 19:01:05 UTC (rev 51919)
@@ -373,26 +373,6 @@
                                this.menu_items[i].js( this );
                }                                                               
                
        },
-       //renders out the transitions effects set                       
-       renderTransitionsSet:function(target_id){
-               js_log('f:renderTransitionsSet:' + target_id);
-               var o = '';
-               if(typeof mvTransLib == 'undefined'){
-                       js_error('Error: missing mvTransLib');
-                       return false;
-               }               
-               for(var type in mvTransLib['type']){
-                       js_log('on tran type: ' + i);                   
-                       var base_trans_name = i;
-                       var tLibSet = mvTransLib['type'][ type ];
-                       for(var subtype in tLibSet){                    
-                               o+='<img style="float:left;padding:10px;" '+
-                                       'src="' + 
mvTransLib.getTransitionIcon(type, subtype)+ '">';            
-                       }
-               }
-               js_log('should set: ' + target_id + ' to: ' + o);
-               $j('#'+target_id).append(o);
-       },
        renderTimeLine:function(){
                //empty out the top level html: 
                $j('#'+this.timeline_id).html('');
@@ -773,8 +753,7 @@
                js_log("doEditTransition");
                var _this = this;               
                mv_get_loading_img( '#transitions_ic' );
-               mvJsLoader.doLoad([
-                       'mvClipEdit',
+               mvJsLoader.doLoad([                     
                        'mvTimedEffectsEdit'
                ],function(){
                        js_log("mvTimedEffectsEdit loaded d")
@@ -782,7 +761,7 @@
                        _this.myEffectEdit = {};                
                        _this.myEffectEdit = new mvTimedEffectsEdit({
                                'rObj'           : cObj,
-                               'control_ct' : 'transitions_ic',
+                               'control_ct' : 'transition_ic',
                                'p_SeqObj'       : _this,
                        });
                })
@@ -802,7 +781,7 @@
                        _this.myClipEditor = {};
                        //setup the cliploader
                        _this.myClipEditor = new mvClipEdit({
-                               'cClip'                 : cObj,
+                               'rObj'                  : cObj,
                                'control_ct'    : 'clipedit_ic',
                                'clip_disp_ct'  : cObj.id,      
                                'edit_action'   : edit_action,
@@ -1062,12 +1041,13 @@
                                                
                                                //check if the clip has 
transitions                                             
                                                var imgHtml = '';               
                        
-                                               var imsrc = ''; 
+                                               var imsrc = '';
+                                               var cat = clip;                 
                                
                                                if(clip.transIn || 
clip.transOut){
-                                                       if( clip.transIn )
+                                                       if( clip.transIn && 
clip.transIn.getIconSrc )
                                                                imsrc = 
clip.transIn.getIconSrc();
                                                        //@@todo put transOut 
somewhere else
-                                                       if( clip.transOut )
+                                                       if( clip.transOut && 
clip.transOut.getIconSrc )
                                                                imsrc = 
clip.transOut.getIconSrc();                             
                                                        if(imsrc != '')
                                                                imgHtml = '<img 
style="width:32px;height:32px" src="' + imsrc + '" />';                         
                        

Modified: 
branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js
===================================================================
--- branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js   
2009-06-15 18:39:41 UTC (rev 51918)
+++ branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js   
2009-06-15 19:01:05 UTC (rev 51919)
@@ -13,7 +13,7 @@
 });
 
 
-var default_timedeffect_values = {
+var default_timed_effect_values = {
        'rObj': null,            // the resource object
        'clip_disp_ct':null, //target clip disp
        'control_ct':null,       //control container
@@ -54,7 +54,7 @@
        },
        init:function(iObj){
                //init object: 
-               for(var i in default_clipedit_values){
+               for(var i in default_timed_effect_values){
                        if( iObj[i] ){   
                                this[i] = iObj[i];
                        }
@@ -64,41 +64,45 @@
        doEditMenu:function(){
                var _this = this;
                //add in subMenus if set
-               //check for submenu and add to item container           
+               //check for submenu and add to item container
+               
+               //update the default edit display (if we have a target)
+               var tTarget = 'transin';
+               if(this.rObj.transOut)
+                       tTarget = 'transout';
+               if(this.rObj.effects)
+                       tTarget = 'effects';            
+                       
                var o='';               
                var tabc ='';                                   
-               o+= '<div id="mv_submenu_timedeffect">';
-               o+='<ul>';               
+               o+= '<div id="mv_submenu_timedeffect" style="width:90%">';
+               o+='<ul>';                
                var inx =0;             
-               $j.each(this.menu_items, function(sInx, na){                    
                
+               $j.each(this.menu_items, function(sInx, mItem){                 
                
                        //check if the given editType is valid for our given 
media type         
                        o+=     '<li>'+ 
-                                       '<a id="mv_te_'+sInx+'" href="#te_' + 
sInx + '">' + gM('te_' + sInx ) + '</a>'+
+                                       '<a id="mv_te_'+sInx+'" href="#te_' + 
sInx + '">' + mItem.title + '</a>'+
                                '</li>';                                        
                                                                                
                        tabc += '<div id="te_' + sInx + '" 
style="overflow:auto;" ></div>';                                                
                                                                                
                                                                     
                });
                o+= '</ul>' + tabc;
                o+= '</div>';
-               //add sub menu container with menu html:                
-               $j('#'+this.control_ct).html( o ) ;                     
-               //set up bindings:       
+               //add sub menu container with menu html:                        
+               $j('#'+this.control_ct).html( o ) ;             
+               js_log('should have set: #'+this.control_ct + ' to: ' + o);     
        
+               
+                               
+               //set up bindins:        
                $j('#mv_submenu_timedeffect').tabs({
                        selected: 0,
                        select: function(event, ui) {                           
                                        
                                _this.doDisplayEdit( 
$j(ui.tab).attr('id').replace('mv_te_', '') );
                        }                               
                }).addClass('ui-tabs-vertical ui-helper-clearfix');
+               js_log('setup tabs #' + this.control_ct);
+               
                //close left: 
-               $j("#mv_submenu_clipedit 
li").removeClass('ui-corner-top').addClass('ui-corner-left');          
-               
-               //update the default edit display (if we have a target)
-               var tTarget = 'transin';
-               if(cClip.transOut)
-                       tTarget = 'transout';
-               if(cClip.effects)
-                       tTarget = 'effects';
-               
-               _this.doDisplayEdit( 'transin' );
+               $j("#mv_submenu_clipedit 
li").removeClass('ui-corner-top').addClass('ui-corner-left');                   
                                       
        },
        doDisplayEdit:function( tab_id ){               
                if( !this.menu_items[ tab_id ] ){
@@ -109,12 +113,13 @@
                }                                       
        },
        doTransitionDisplayEdit:function(target_item){
+               var apendTarget = 'te_' + target_item;
                //check if we have a transition
-               if(!cClip[ this.menu_items[ target_item ].clip_attr ]){
-                       this.getTransitionList();
+               if(!this.rObj[ this.menu_items[ target_item ].clip_attr ]){
+                       this.getTransitionList( apendTarget );
                        return ;
                }
-               cTran = cClip[ this.menu_items[ target_item ].clip_attr ];
+               cTran = this.rObj[ this.menu_items[ target_item ].clip_attr ];
                var o='<h3>Edit Transition</h3>';
                o+='Type: ' +
                        '<select class="te_select_type">';
@@ -131,6 +136,7 @@
                }
                o+='</select>'+         
                   '</span>';
+               js_log("update: " + apendTarget);
                //set up bidings: 
                $j(apendTarget).append(o).children('.te_select_type')
                        .change(function(){
@@ -139,5 +145,19 @@
                                $j(apendTarget + ' .te_select_subtype').html();
                        });
                $j('te_' + target_item).html(o);
+       },
+       getTransitionList:function(target_out){
+               js_log("getTransitionList");
+               var o= '';
+               for(var type in mvTransLib['type']){
+                       js_log('on tran type: ' + i);                   
+                       var base_trans_name = i;
+                       var tLibSet = mvTransLib['type'][ type ];
+                       for(var subtype in tLibSet){                    
+                               o+='<img style="float:left;padding:10px;" '+
+                                       'src="' + 
mvTransLib.getTransitionIcon(type, subtype)+ '">';            
+                       }
+               }       
+               $j(target_out).html(o);
        }               
 }
\ No newline at end of file



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to