r51867 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51866‎ | r51867 | r51868 >
Date:07:57, 15 June 2009
Author:dale
Status:deferred
Tags:
Comment:
* more stubs for transition editor
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvPlayList.js (modified) (history)
  • /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/mvPlayList.js
@@ -2107,7 +2107,6 @@
21082108 /* utility functions
21092109 * (could be combined with other stuff)
21102110 */
2111 -
21122111 function getAbsolutePos(objectId) {
21132112 // Get an object left position from the upper left viewport corner
21142113 o = document.getElementById(objectId);
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js
@@ -5,13 +5,20 @@
66 *
77 */
88
 9+//add our local msgs
 10+loadGM({
 11+ "transition_in" : "Transition In",
 12+ "transition_out" : "Transition Out",
 13+ "effects" : "Effects Stack"
 14+});
 15+
 16+
917 var default_timedeffect_values = {
1018 'rObj': null, // the resource object
11 - 'clip_disp_ct':null,//target clip disp
 19+ 'clip_disp_ct':null, //target clip disp
1220 'control_ct':null, //control container
1321
1422 'parent_ct': null, //parent container
15 -
1623 'p_seqObj': null, //parent sequence Object
1724
1825 'edit_action': null, //the requested edit action
@@ -24,13 +31,25 @@
2532 //the menu_items Object contains: default html, js setup/loader functions
2633 menu_items : {
2734 'transin':{
28 -
 35+ 'title':gM('transition_in'),
 36+ 'clip_attr':'transIn',
 37+ 'doEdit':function(_this){
 38+ _this.doTransitionDisplayEdit('transin');
 39+ }
2940 },
3041 'transout':{
31 -
 42+ 'title':gM('transition_out'),
 43+ 'clip_attr':'transOut',
 44+ 'doEdit':function(_this){
 45+ _this.doTransitionDisplayEdit('transout');
 46+ }
3247 },
3348 'effects':{
34 -
 49+ 'title':gM('effects'),
 50+ 'clip_attr':'Effects',
 51+ 'doEdit':function(_this){
 52+ //display
 53+ }
3554 }
3655 },
3756 init:function(iObj){
@@ -39,6 +58,86 @@
4059 if( iObj[i] ){
4160 this[i] = iObj[i];
4261 }
 62+ }
 63+ this.doEditMenu();
 64+ },
 65+ doEditMenu:function(){
 66+ var _this = this;
 67+ //add in subMenus if set
 68+ //check for submenu and add to item container
 69+ var o='';
 70+ var tabc ='';
 71+ o+= '<div id="mv_submenu_timedeffect">';
 72+ o+='<ul>';
 73+ var inx =0;
 74+ $j.each(this.menu_items, function(sInx, na){
 75+ //check if the given editType is valid for our given media type
 76+ o+= '<li>'+
 77+ '<a id="mv_te_'+sInx+'" href="#te_' + sInx + '">' + gM('te_' + sInx ) + '</a>'+
 78+ '</li>';
 79+ tabc += '<div id="te_' + sInx + '" style="overflow:auto;" ></div>';
 80+ });
 81+ o+= '</ul>' + tabc;
 82+ o+= '</div>';
 83+ //add sub menu container with menu html:
 84+ $j('#'+this.control_ct).html( o ) ;
 85+ //set up bindings:
 86+ $j('#mv_submenu_timedeffect').tabs({
 87+ selected: 0,
 88+ select: function(event, ui) {
 89+ _this.doDisplayEdit( $j(ui.tab).attr('id').replace('mv_te_', '') );
 90+ }
 91+ }).addClass('ui-tabs-vertical ui-helper-clearfix');
 92+ //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' );
 103+ },
 104+ doDisplayEdit:function( tab_id ){
 105+ if( !this.menu_items[ tab_id ] ){
 106+ js_log('error: doDisplayEdit missing item:' + tab_id);
 107+ }else{
 108+ //use the menu_item config to map to function display
 109+ this.menu_items[tab_id].doEdit(this);
 110+ }
 111+ },
 112+ doTransitionDisplayEdit:function(target_item){
 113+ //check if we have a transition
 114+ if(!cClip[ this.menu_items[ target_item ].clip_attr ]){
 115+ this.getTransitionList();
 116+ return ;
43117 }
44 - }
 118+ cTran = cClip[ this.menu_items[ target_item ].clip_attr ];
 119+ var o='<h3>Edit Transition</h3>';
 120+ o+='Type: ' +
 121+ '<select class="te_select_type">';
 122+ for(var typeKey in mvTransLib.type){
 123+ var selAttr = (cTran.type == typeKey)?' selected':'';
 124+ o+='<option value="'+typeKey+'"'+ selAttr +'>'+typeKey+'</option>';
 125+ }
 126+ o+='</select>';
 127+ o+='<span class="te_select_subtype">Sub Type:'+
 128+ '<select class="te_select_subtype">';
 129+ for(var subTypeKey in mvTransLib.type[ cTran.type ]){
 130+ var selAttr = (cTran.subtype == typeKey)?' selected':'';
 131+ o+='<option value="'+subTypeKey+'"'+ selAttr +'>'+typeKey+'</option>';
 132+ }
 133+ o+='</select>'+
 134+ '</span>';
 135+ //set up bidings:
 136+ $j(apendTarget).append(o).children('.te_select_type')
 137+ .change(function(){
 138+ //update subtype listing:
 139+ var o = '';
 140+ $j(apendTarget + ' .te_select_subtype').html();
 141+ });
 142+ $j('te_' + target_item).html(o);
 143+ }
45144 }
\ No newline at end of file
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js
@@ -611,7 +611,7 @@
612612 o+=tabc;
613613 $j('#'+this.sequence_tools_id).html( o );
614614
615 -
 615+
616616 $j("#seq_menu").tabs({
617617 selected:selected_tab,
618618 select: function(event, ui) {
@@ -770,18 +770,20 @@
771771 }
772772 },
773773 doEditTransition:function( cObj ){
774 - var _this = this;
775 - mv_get_loading_img( '#clipedit_ic' );
 774+ js_log("doEditTransition");
 775+ var _this = this;
 776+ mv_get_loading_img( '#transitions_ic' );
776777 mvJsLoader.doLoad([
777778 'mvClipEdit',
778779 'mvTimedEffectsEdit'
779780 ],function(){
 781+ js_log("mvTimedEffectsEdit loaded d")
780782 //if mvClipEditor not preset init
781783 _this.myEffectEdit = {};
782784 _this.myEffectEdit = new mvTimedEffectsEdit({
783 - 'rObj' : cObj,
784 - 'control_ct':'transitions_ic',
785 - 'p_SeqObj': _this,
 785+ 'rObj' : cObj,
 786+ 'control_ct' : 'transitions_ic',
 787+ 'p_SeqObj' : _this,
786788 });
787789 })
788790 },
@@ -800,12 +802,12 @@
801803 _this.myClipEditor = {};
802804 //setup the cliploader
803805 _this.myClipEditor = new mvClipEdit({
804 - 'rObj' : cObj,
805 - 'control_ct':'clipedit_ic',
806 - 'clip_disp_ct': cObj.id,
807 - 'edit_action':edit_action,
808 - 'p_seqObj': _this,
809 - 'profile':'sequence'
 806+ 'cClip' : cObj,
 807+ 'control_ct' : 'clipedit_ic',
 808+ 'clip_disp_ct' : cObj.id,
 809+ 'edit_action' : edit_action,
 810+ 'p_seqObj' : _this,
 811+ 'profile' : 'sequence'
810812 });
811813 });
812814 },
@@ -1136,9 +1138,7 @@
11371139 //jump to the current clip
11381140 this_seq.plObj.updateCurrentClip( sClipObj );
11391141 //display the transition edit tab:
1140 - this_seq.disp( 'transition' );
1141 - //display edit dialog:
1142 - this_seq.doEditTransition( sClipObj );
 1142+ this_seq.disp( 'transition' );
11431143 }
11441144 });
11451145
Index: branches/new-upload/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
@@ -75,7 +75,8 @@
7676 }else if( this.rObj.type.indexOf("text/") === 0){
7777 this.media_type = 'template';
7878 }
79 - }
 79+ }
 80+
8081 //display control:
8182 if(this.profile == 'sequence'){
8283 this.doEditTypesMenu();
@@ -98,7 +99,7 @@
99100 edit_types:{
100101 'duration':{
101102 'media':['image','template'],
102 - 'doEdit':function(target, _this ){
 103+ 'doEdit':function( _this, target ){
103104 //(_this is a smilClip instance)
104105 //do clock mouse scroll duration editor
105106 $j(target).html(
@@ -119,7 +120,7 @@
120121 },
121122 'inoutpoints':{
122123 'media':['video'],
123 - 'doEdit':function(target, _this ){
 124+ 'doEdit':function( _this, target ){
124125 //do clock mouse scroll duration editor
125126 var end_ntp = ( _this.rObj.embed.end_ntp) ? _this.rObj.embed.end_ntp : _this.rObj.embed.getDuration();
126127 if(!end_ntp)
@@ -140,7 +141,7 @@
141142 },
142143 'fileopts':{
143144 'media':['image','video','template'],
144 - 'doEdit':function(target, _this ){
 145+ 'doEdit':function(_this, target ){
145146 var doEditHtml = function(){
146147 //add html for rObj resource:
147148 var o= '<table>' +
@@ -273,14 +274,14 @@
274275 },
275276 'overlays':{
276277 'media':['image','video'],
277 - 'doEdit':function(target, _this ){
 278+ 'doEdit':function(_this, target){
278279 //do clock mouse scroll duration editor
279280 $j(target).html('<h3>Current Overlays:</h3>Add,Remove,Modify');
280281 }
281282 },
282283 'audio':{
283284 'media':['image','video', 'template'],
284 - 'doEdit':function(target, _this ){
 285+ 'doEdit':function(_this, target){
285286 //do clock mouse scroll duration editor
286287 $j(target).html('<h3>Audio Volume:</h3>');
287288 }
@@ -335,7 +336,7 @@
336337
337338 //do edit interface for that edit type:
338339 if( this.edit_types[ edit_type ].doEdit )
339 - this.edit_types[ edit_type ].doEdit( '#sc_'+edit_type, this );
 340+ this.edit_types[ edit_type ].doEdit(this, '#sc_'+edit_type );
340341 },
341342 setUpVideoCtrl:function(){
342343 js_log('setUpVideoCtrl:f');

Status & tagging log