r51919 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51918‎ | r51919 | r51920 >
Date:19:01, 15 June 2009
Author:dale
Status:deferred
Tags:
Comment:
transition control tabs displayed
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js
@@ -13,7 +13,7 @@
1414 });
1515
1616
17 -var default_timedeffect_values = {
 17+var default_timed_effect_values = {
1818 'rObj': null, // the resource object
1919 'clip_disp_ct':null, //target clip disp
2020 'control_ct':null, //control container
@@ -54,7 +54,7 @@
5555 },
5656 init:function(iObj){
5757 //init object:
58 - for(var i in default_clipedit_values){
 58+ for(var i in default_timed_effect_values){
5959 if( iObj[i] ){
6060 this[i] = iObj[i];
6161 }
@@ -64,41 +64,45 @@
6565 doEditMenu:function(){
6666 var _this = this;
6767 //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+
6977 var o='';
7078 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>';
7381 var inx =0;
74 - $j.each(this.menu_items, function(sInx, na){
 82+ $j.each(this.menu_items, function(sInx, mItem){
7583 //check if the given editType is valid for our given media type
7684 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>'+
7886 '</li>';
7987 tabc += '<div id="te_' + sInx + '" style="overflow:auto;" ></div>';
8088 });
8189 o+= '</ul>' + tabc;
8290 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:
8697 $j('#mv_submenu_timedeffect').tabs({
8798 selected: 0,
8899 select: function(event, ui) {
89100 _this.doDisplayEdit( $j(ui.tab).attr('id').replace('mv_te_', '') );
90101 }
91102 }).addClass('ui-tabs-vertical ui-helper-clearfix');
 103+ js_log('setup tabs #' + this.control_ct);
 104+
92105 //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');
103107 },
104108 doDisplayEdit:function( tab_id ){
105109 if( !this.menu_items[ tab_id ] ){
@@ -109,12 +113,13 @@
110114 }
111115 },
112116 doTransitionDisplayEdit:function(target_item){
 117+ var apendTarget = 'te_' + target_item;
113118 //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 );
116121 return ;
117122 }
118 - cTran = cClip[ this.menu_items[ target_item ].clip_attr ];
 123+ cTran = this.rObj[ this.menu_items[ target_item ].clip_attr ];
119124 var o='<h3>Edit Transition</h3>';
120125 o+='Type: ' +
121126 '<select class="te_select_type">';
@@ -131,6 +136,7 @@
132137 }
133138 o+='</select>'+
134139 '</span>';
 140+ js_log("update: " + apendTarget);
135141 //set up bidings:
136142 $j(apendTarget).append(o).children('.te_select_type')
137143 .change(function(){
@@ -139,5 +145,19 @@
140146 $j(apendTarget + ' .te_select_subtype').html();
141147 });
142148 $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);
143163 }
144164 }
\ No newline at end of file
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js
@@ -373,26 +373,6 @@
374374 this.menu_items[i].js( this );
375375 }
376376 },
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 - },
397377 renderTimeLine:function(){
398378 //empty out the top level html:
399379 $j('#'+this.timeline_id).html('');
@@ -773,8 +753,7 @@
774754 js_log("doEditTransition");
775755 var _this = this;
776756 mv_get_loading_img( '#transitions_ic' );
777 - mvJsLoader.doLoad([
778 - 'mvClipEdit',
 757+ mvJsLoader.doLoad([
779758 'mvTimedEffectsEdit'
780759 ],function(){
781760 js_log("mvTimedEffectsEdit loaded d")
@@ -782,7 +761,7 @@
783762 _this.myEffectEdit = {};
784763 _this.myEffectEdit = new mvTimedEffectsEdit({
785764 'rObj' : cObj,
786 - 'control_ct' : 'transitions_ic',
 765+ 'control_ct' : 'transition_ic',
787766 'p_SeqObj' : _this,
788767 });
789768 })
@@ -802,7 +781,7 @@
803782 _this.myClipEditor = {};
804783 //setup the cliploader
805784 _this.myClipEditor = new mvClipEdit({
806 - 'cClip' : cObj,
 785+ 'rObj' : cObj,
807786 'control_ct' : 'clipedit_ic',
808787 'clip_disp_ct' : cObj.id,
809788 'edit_action' : edit_action,
@@ -1062,12 +1041,13 @@
10631042
10641043 //check if the clip has transitions
10651044 var imgHtml = '';
1066 - var imsrc = '';
 1045+ var imsrc = '';
 1046+ var cat = clip;
10671047 if(clip.transIn || clip.transOut){
1068 - if( clip.transIn )
 1048+ if( clip.transIn && clip.transIn.getIconSrc )
10691049 imsrc = clip.transIn.getIconSrc();
10701050 //@@todo put transOut somewhere else
1071 - if( clip.transOut )
 1051+ if( clip.transOut && clip.transOut.getIconSrc )
10721052 imsrc = clip.transOut.getIconSrc();
10731053 if(imsrc != '')
10741054 imgHtml = '<img style="width:32px;height:32px" src="' + imsrc + '" />';

Status & tagging log