Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | }); |
15 | 15 | |
16 | 16 | |
17 | | -var default_timedeffect_values = { |
| 17 | +var default_timed_effect_values = { |
18 | 18 | 'rObj': null, // the resource object |
19 | 19 | 'clip_disp_ct':null, //target clip disp |
20 | 20 | 'control_ct':null, //control container |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | }, |
56 | 56 | init:function(iObj){ |
57 | 57 | //init object: |
58 | | - for(var i in default_clipedit_values){ |
| 58 | + for(var i in default_timed_effect_values){ |
59 | 59 | if( iObj[i] ){ |
60 | 60 | this[i] = iObj[i]; |
61 | 61 | } |
— | — | @@ -64,41 +64,45 @@ |
65 | 65 | doEditMenu:function(){ |
66 | 66 | var _this = this; |
67 | 67 | //add in subMenus if set |
68 | | - //check for submenu and add to item container |
| 68 | + //check for submenu and add to item container |
| 69 | + |
| 70 | + //update the default edit display (if we have a target) |
| 71 | + var tTarget = 'transin'; |
| 72 | + if(this.rObj.transOut) |
| 73 | + tTarget = 'transout'; |
| 74 | + if(this.rObj.effects) |
| 75 | + tTarget = 'effects'; |
| 76 | + |
69 | 77 | var o=''; |
70 | 78 | var tabc =''; |
71 | | - o+= '<div id="mv_submenu_timedeffect">'; |
72 | | - o+='<ul>'; |
| 79 | + o+= '<div id="mv_submenu_timedeffect" style="width:90%">'; |
| 80 | + o+='<ul>'; |
73 | 81 | var inx =0; |
74 | | - $j.each(this.menu_items, function(sInx, na){ |
| 82 | + $j.each(this.menu_items, function(sInx, mItem){ |
75 | 83 | //check if the given editType is valid for our given media type |
76 | 84 | o+= '<li>'+ |
77 | | - '<a id="mv_te_'+sInx+'" href="#te_' + sInx + '">' + gM('te_' + sInx ) + '</a>'+ |
| 85 | + '<a id="mv_te_'+sInx+'" href="#te_' + sInx + '">' + mItem.title + '</a>'+ |
78 | 86 | '</li>'; |
79 | 87 | tabc += '<div id="te_' + sInx + '" style="overflow:auto;" ></div>'; |
80 | 88 | }); |
81 | 89 | o+= '</ul>' + tabc; |
82 | 90 | o+= '</div>'; |
83 | | - //add sub menu container with menu html: |
84 | | - $j('#'+this.control_ct).html( o ) ; |
85 | | - //set up bindings: |
| 91 | + //add sub menu container with menu html: |
| 92 | + $j('#'+this.control_ct).html( o ) ; |
| 93 | + js_log('should have set: #'+this.control_ct + ' to: ' + o); |
| 94 | + |
| 95 | + |
| 96 | + //set up bindins: |
86 | 97 | $j('#mv_submenu_timedeffect').tabs({ |
87 | 98 | selected: 0, |
88 | 99 | select: function(event, ui) { |
89 | 100 | _this.doDisplayEdit( $j(ui.tab).attr('id').replace('mv_te_', '') ); |
90 | 101 | } |
91 | 102 | }).addClass('ui-tabs-vertical ui-helper-clearfix'); |
| 103 | + js_log('setup tabs #' + this.control_ct); |
| 104 | + |
92 | 105 | //close left: |
93 | | - $j("#mv_submenu_clipedit li").removeClass('ui-corner-top').addClass('ui-corner-left'); |
94 | | - |
95 | | - //update the default edit display (if we have a target) |
96 | | - var tTarget = 'transin'; |
97 | | - if(cClip.transOut) |
98 | | - tTarget = 'transout'; |
99 | | - if(cClip.effects) |
100 | | - tTarget = 'effects'; |
101 | | - |
102 | | - _this.doDisplayEdit( 'transin' ); |
| 106 | + $j("#mv_submenu_clipedit li").removeClass('ui-corner-top').addClass('ui-corner-left'); |
103 | 107 | }, |
104 | 108 | doDisplayEdit:function( tab_id ){ |
105 | 109 | if( !this.menu_items[ tab_id ] ){ |
— | — | @@ -109,12 +113,13 @@ |
110 | 114 | } |
111 | 115 | }, |
112 | 116 | doTransitionDisplayEdit:function(target_item){ |
| 117 | + var apendTarget = 'te_' + target_item; |
113 | 118 | //check if we have a transition |
114 | | - if(!cClip[ this.menu_items[ target_item ].clip_attr ]){ |
115 | | - this.getTransitionList(); |
| 119 | + if(!this.rObj[ this.menu_items[ target_item ].clip_attr ]){ |
| 120 | + this.getTransitionList( apendTarget ); |
116 | 121 | return ; |
117 | 122 | } |
118 | | - cTran = cClip[ this.menu_items[ target_item ].clip_attr ]; |
| 123 | + cTran = this.rObj[ this.menu_items[ target_item ].clip_attr ]; |
119 | 124 | var o='<h3>Edit Transition</h3>'; |
120 | 125 | o+='Type: ' + |
121 | 126 | '<select class="te_select_type">'; |
— | — | @@ -131,6 +136,7 @@ |
132 | 137 | } |
133 | 138 | o+='</select>'+ |
134 | 139 | '</span>'; |
| 140 | + js_log("update: " + apendTarget); |
135 | 141 | //set up bidings: |
136 | 142 | $j(apendTarget).append(o).children('.te_select_type') |
137 | 143 | .change(function(){ |
— | — | @@ -139,5 +145,19 @@ |
140 | 146 | $j(apendTarget + ' .te_select_subtype').html(); |
141 | 147 | }); |
142 | 148 | $j('te_' + target_item).html(o); |
| 149 | + }, |
| 150 | + getTransitionList:function(target_out){ |
| 151 | + js_log("getTransitionList"); |
| 152 | + var o= ''; |
| 153 | + for(var type in mvTransLib['type']){ |
| 154 | + js_log('on tran type: ' + i); |
| 155 | + var base_trans_name = i; |
| 156 | + var tLibSet = mvTransLib['type'][ type ]; |
| 157 | + for(var subtype in tLibSet){ |
| 158 | + o+='<img style="float:left;padding:10px;" '+ |
| 159 | + 'src="' + mvTransLib.getTransitionIcon(type, subtype)+ '">'; |
| 160 | + } |
| 161 | + } |
| 162 | + $j(target_out).html(o); |
143 | 163 | } |
144 | 164 | } |
\ No newline at end of file |
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js |
— | — | @@ -373,26 +373,6 @@ |
374 | 374 | this.menu_items[i].js( this ); |
375 | 375 | } |
376 | 376 | }, |
377 | | - //renders out the transitions effects set |
378 | | - renderTransitionsSet:function(target_id){ |
379 | | - js_log('f:renderTransitionsSet:' + target_id); |
380 | | - var o = ''; |
381 | | - if(typeof mvTransLib == 'undefined'){ |
382 | | - js_error('Error: missing mvTransLib'); |
383 | | - return false; |
384 | | - } |
385 | | - for(var type in mvTransLib['type']){ |
386 | | - js_log('on tran type: ' + i); |
387 | | - var base_trans_name = i; |
388 | | - var tLibSet = mvTransLib['type'][ type ]; |
389 | | - for(var subtype in tLibSet){ |
390 | | - o+='<img style="float:left;padding:10px;" '+ |
391 | | - 'src="' + mvTransLib.getTransitionIcon(type, subtype)+ '">'; |
392 | | - } |
393 | | - } |
394 | | - js_log('should set: ' + target_id + ' to: ' + o); |
395 | | - $j('#'+target_id).append(o); |
396 | | - }, |
397 | 377 | renderTimeLine:function(){ |
398 | 378 | //empty out the top level html: |
399 | 379 | $j('#'+this.timeline_id).html(''); |
— | — | @@ -773,8 +753,7 @@ |
774 | 754 | js_log("doEditTransition"); |
775 | 755 | var _this = this; |
776 | 756 | mv_get_loading_img( '#transitions_ic' ); |
777 | | - mvJsLoader.doLoad([ |
778 | | - 'mvClipEdit', |
| 757 | + mvJsLoader.doLoad([ |
779 | 758 | 'mvTimedEffectsEdit' |
780 | 759 | ],function(){ |
781 | 760 | js_log("mvTimedEffectsEdit loaded d") |
— | — | @@ -782,7 +761,7 @@ |
783 | 762 | _this.myEffectEdit = {}; |
784 | 763 | _this.myEffectEdit = new mvTimedEffectsEdit({ |
785 | 764 | 'rObj' : cObj, |
786 | | - 'control_ct' : 'transitions_ic', |
| 765 | + 'control_ct' : 'transition_ic', |
787 | 766 | 'p_SeqObj' : _this, |
788 | 767 | }); |
789 | 768 | }) |
— | — | @@ -802,7 +781,7 @@ |
803 | 782 | _this.myClipEditor = {}; |
804 | 783 | //setup the cliploader |
805 | 784 | _this.myClipEditor = new mvClipEdit({ |
806 | | - 'cClip' : cObj, |
| 785 | + 'rObj' : cObj, |
807 | 786 | 'control_ct' : 'clipedit_ic', |
808 | 787 | 'clip_disp_ct' : cObj.id, |
809 | 788 | 'edit_action' : edit_action, |
— | — | @@ -1062,12 +1041,13 @@ |
1063 | 1042 | |
1064 | 1043 | //check if the clip has transitions |
1065 | 1044 | var imgHtml = ''; |
1066 | | - var imsrc = ''; |
| 1045 | + var imsrc = ''; |
| 1046 | + var cat = clip; |
1067 | 1047 | if(clip.transIn || clip.transOut){ |
1068 | | - if( clip.transIn ) |
| 1048 | + if( clip.transIn && clip.transIn.getIconSrc ) |
1069 | 1049 | imsrc = clip.transIn.getIconSrc(); |
1070 | 1050 | //@@todo put transOut somewhere else |
1071 | | - if( clip.transOut ) |
| 1051 | + if( clip.transOut && clip.transOut.getIconSrc ) |
1072 | 1052 | imsrc = clip.transOut.getIconSrc(); |
1073 | 1053 | if(imsrc != '') |
1074 | 1054 | imgHtml = '<img style="width:32px;height:32px" src="' + imsrc + '" />'; |