r51671 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51670‎ | r51671 | r51672 >
Date:00:49, 10 June 2009
Author:dale
Status:deferred
Tags:
Comment:
sequencer style updates and small fixes
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/htmlEmbed.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/skins/mvpcf/mv_sequence.css (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -684,9 +684,7 @@
685685 });
686686 },
687687 /* check for all the results to finish */
688 - checkResultsDone: function(){
689 - js_log( "checkResultsDone:entry: " + rsdMVRS.disp_item + ' not: ' + this.disp_item);
690 -
 688+ checkResultsDone: function(){
691689 var _this = this;
692690 var loading_done = true;
693691
@@ -699,10 +697,9 @@
700698 }
701699 if( loading_done ){
702700 this.drawOutputResults();
703 - }else{
704 - js_log("before setTimeout: " + rsdMVRS.disp_item);
 701+ }else{
705702 //make sure the instance name is up-to-date refrence to _this;
706 - eval( _this.instance_name + ' = _this');
 703+ eval( _this.instance_name + ' = _this');
707704 setTimeout( _this.instance_name + '.checkResultsDone()', 30);
708705 }
709706 },
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvPlayList.js
@@ -736,11 +736,13 @@
737737 }
738738 });
739739 //set the current clip to the first clip:
740 - this.cur_clip = this.start_clip;
741 - //display the first clip thumb:
742 - this.cur_clip.embed.stop();
743 - //make sure the current clip is vissable:
744 - $j('#clipDesc_'+this.cur_clip.id).show();
 740+ if(this.start_clip){
 741+ this.cur_clip = this.start_clip;
 742+ //display the first clip thumb:
 743+ this.cur_clip.embed.stop();
 744+ //make sure the current clip is vissable:
 745+ $j('#clipDesc_'+this.cur_clip.id).show();
 746+ }
745747 //reset the currentTime:
746748 this.currentTime = 0;
747749 //FIXME still some issues with "stoping" and reseting the playlist
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvSequencer.js
@@ -221,8 +221,8 @@
222222 'width:'+this.video_width+'px;height:'+this.video_height+'px;border:solid thin blue;background:#FFF;font-color:black;"/>'+
223223 '<div id="'+this.sequence_tools_id+'" style="position:absolute;' +
224224 'left:0px;right:'+(this.video_width+15)+'px;top:0px;height:'+(this.video_height+23)+'px;"/>'+
225 - '<div id="'+this.timeline_id+'" style="position:absolute;' +
226 - 'left:0px;right:0px;top:'+(this.video_height+10)+'px;bottom:25px;overflow:auto;">'+
 225+ '<div id="'+this.timeline_id+'" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;' +
 226+ 'left:0px;right:0px;top:'+(this.video_height+34)+'px;bottom:25px;overflow:auto;">'+
227227 gM('loading_timeline')+ '</div>'+
228228 '<div id="' + this.target_sequence_container + '_status" style="position:absolute;left:0px;width:300px;"></div>'+
229229 '<div id="' + this.target_sequence_container + '_save_cancel" style="position:absolute;'+
@@ -402,7 +402,7 @@
403403 $j('#'+this.timeline_id+'_tracks').append(
404404 '<div id="container_track_'+i+'" style="top:'+top_pos+'px;height:'+(track_height+2)+'px;left:0px;right:0px;" class="container_track" />'
405405 );
406 - top_pos+=track_height+20;
 406+ top_pos+=track_height+20;
407407 }
408408 }
409409 if( this.timeline_mode=='storyboard'){
@@ -541,7 +541,7 @@
542542 selected_tab=inx;
543543
544544 o+='<li>' +
545 - '<a id="mv_menu_item_'+tab_id+'" href="#' + tab_id + '_ic">'+gM('menu_' + tab_id )+
 545+ '<a id="mv_menu_item_'+tab_id+'" href="#' + tab_id + '_ic">'+gM('menu_' + tab_id ) + '</a>' +
546546 '</li>';
547547
548548 tabc += '<div id="' + tab_id + '_ic" style="overflow:auto;height:272px;" >';
@@ -957,8 +957,8 @@
958958 'height:' + (this.track_clipThumb_height+30) + 'px;' +
959959 'width:'+(container_width)+'px;" >';
960960 track_html+=clip.embed.renderTimelineThumbnail({
961 - 'width':frame_width,
962 - 'thumb_class':'mv_clip_thumb',
 961+ 'width' : frame_width,
 962+ 'thumb_class' : 'mv_clip_thumb',
963963 'height':this.track_clipThumb_height,
964964 'time':0
965965 });
@@ -1254,7 +1254,7 @@
12551255 //js_log("pinit: "+ pint+ ' < '+clip.width_px+' ++'+frame_width);
12561256 for(var p=pint;p<clip.width_px;p+=frame_width){
12571257 var clip_time = (p==0)?0:Math.round(p*this.timeline_scale);
1258 - js_log('rendering clip frames: p:' +p+' '+ (p*this.timeline_scale)+' ' + clip_time);
 1258+ js_log('rendering clip frames: p:' +p+' pts:'+ (p*this.timeline_scale)+' time:' + clip_time + ' height:'+this.track_thumb_height);
12591259 clip_frames_html+=clip.embed.renderTimelineThumbnail({
12601260 'width': frame_width,
12611261 'thumb_class':'mv_tl_thumb',
@@ -1323,12 +1323,27 @@
13241324 render_playheadhead_seeker:function(){
13251325 //render out time stamps and time "jump" links
13261326 //first get total width
1327 - if(this.timeline_mode=='time'){
1328 - //hide the old control if present
1329 - $j('#'+this.timeline_id + '_pl_control').remove();
1330 - //set width based on pixle to time and current length:
1331 - pixle_length = Math.round( this.timeline_duration / this.timeline_scale);
1332 - $j('#'+this.timeline_id+'_head_jump').width(pixle_length);
 1327+
 1328+ //remove the old one if its still there
 1329+ $j('#'+this.timeline_id +'_pl_control').remove();
 1330+ js_log('output controls to: ' + this.target_sequence_container);
 1331+ //render out a playlist clip wide and all the way to the right (only playhead and play button) (outside of timeline)
 1332+ $j(this.target_sequence_container).append('<div id="'+ this.timeline_id +'_pl_control"'+
 1333+ ' style="position:absolute;top:' + (this.plObj.height) +'px;'+
 1334+ 'right:1px;width:'+this.plObj.width+'px;height:'+this.plObj.org_control_height+'" '+
 1335+ 'class="videoPlayer"><div class="ui-widget ui-corner-bottom ui-state-default controls">'+
 1336+ this.plObj.getControlsHTML() +
 1337+ '</div>'+
 1338+ '</div>');
 1339+ //update time and render out clip dividers .. should be used to show load progress
 1340+ this.plObj.updateBaseStatus();
 1341+
 1342+ //once the controls are in the DOM add hooks:
 1343+ ctrlBuilder.addControlHooks(this.plObj);
 1344+
 1345+ //render out the "jump" div
 1346+ if(this.timeline_mode=='time'){
 1347+ /*$j('#'+this.timeline_id+'_head_jump').width(pixle_length);
13331348 //output times every 50pixles
13341349 var out='';
13351350 //output time-desc every 50pixles and jump links every 10 pixles
@@ -1340,26 +1355,9 @@
13411356 out+='<span style="position:absolute;left:'+i+'px;">|'+seconds2npt(Math.round(i*this.timeline_scale))+'</span>';
13421357 n++;
13431358 if(n==10)n=0;
1344 - }
1345 - $j('#'+this.timeline_id+'_head_jump').html(out);
1346 - }
1347 - if(this.timeline_mode=='storyboard'){
1348 - //remove the old one if its still there
1349 - $j('#'+this.timeline_id +'_pl_control').remove();
1350 - //render out a playlist clip wide and all the way to the right (only playhead and play button) (outside of timeline)
1351 - $j(this.target_sequence_container).append('<div id="'+ this.timeline_id +'_pl_control"'+
1352 - ' style="position:absolute;top:' + (this.plObj.height) +'px;'+
1353 - 'right:1px;width:'+this.plObj.width+'px;height:'+this.plObj.org_control_height+'" '+
1354 - 'class="videoPlayer"><div class="ui-widget ui-corner-bottom ui-state-default controls">'+
1355 - this.plObj.getControlsHTML() +
1356 - '</div>'+
1357 - '</div>');
1358 - //update time and render out clip dividers .. should be used to show load progress
1359 - this.plObj.updateBaseStatus();
 1359+ }*/
13601360
1361 - //once the controls are in the DOM add hooks:
1362 - ctrlBuilder.addControlHooks(this.plObj);
1363 - }
 1361+ }
13641362 },
13651363 jt:function( jh_time ){
13661364 js_log('jt:' + jh_time);
Index: branches/new-upload/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
@@ -98,15 +98,15 @@
9999 'duration':{
100100 d:1,
101101 'media':['image','template'],
102 - 'doEdit':function( _this ){
 102+ 'doEdit':function(target, _this ){
103103 //do clock mouse scroll duration editor
104 - $j('#sub_cliplib_ic').html('cur dur: ' + _this.rObj.dur );
 104+ $j(target).html('cur dur: ' + _this.rObj.dur );
105105 }
106106 },
107107 'inoutpoints':{
108108 'd':1,
109109 'media':['video'],
110 - 'doEdit':function( _this ){
 110+ 'doEdit':function(target, _this ){
111111 //do clock mouse scroll duration editor
112112 var end_ntp = ( _this.rObj.embed.end_ntp) ? _this.rObj.embed.end_ntp : _this.rObj.embed.getDuration();
113113 if(!end_ntp)
@@ -116,7 +116,7 @@
117117 if(!start_ntp)
118118 seconds2npt( 0 );
119119
120 - $j('#sub_cliplib_ic').html(
 120+ $j(target).html(
121121 _this.getSetInOutHtml({
122122 'start_ntp' : start_ntp,
123123 'end_ntp' : end_ntp
@@ -128,7 +128,7 @@
129129 'fileopts':{
130130 'd':0,
131131 'media':['image','video','template'],
132 - 'doEdit':function( _this ){
 132+ 'doEdit':function(target, _this ){
133133 var doEditHtml = function(){
134134 //add html for rObj resource:
135135 var o= '<table>' +
@@ -173,14 +173,14 @@
174174 '<td>' +
175175 gM('mv_resource_page') +
176176 '</td>' +
177 - '<td><a href="' + wgArticlePath.replace(/\$1/, _this.rObj.uri ) +
 177+ '<td><a href="' + wgArticlePath.replace(/\$1/, _this.rObj.uri ) +'" '+
178178 ' target="new">'+
179179 _this.rObj.uri + '</a>'+
180180 '</td>'+
181181 '</tr>';
182182 o+='</table>';
183183
184 - $j('#sub_cliplib_ic').html ( o );
 184+ $j(target).html ( o );
185185 //add update bindings
186186
187187 //update doFocusBindings
@@ -247,25 +247,25 @@
248248 'panzoom':{
249249 'd':0,
250250 'media':['image','video'],
251 - 'doEdit':function( _this ){
 251+ 'doEdit':function(target, _this ){
252252 //do clock mouse scroll duration editor
253 - $j('#sub_cliplib_ic').html('<h3>Set Position</h3><h3>Set Zoom</h3><h3>Set Crop</h3><h3>Set Aspect</h3>');
 253+ $j(target).html('<h3>Set Position</h3><h3>Set Zoom</h3><h3>Set Crop</h3><h3>Set Aspect</h3>');
254254 }
255255 },
256256 'overlays':{
257257 'd':0,
258258 'media':['image','video'],
259 - 'doEdit':function( _this ){
 259+ 'doEdit':function(target, _this ){
260260 //do clock mouse scroll duration editor
261 - $j('#sub_cliplib_ic').html('<h3>Current Overlays:</h3>Add,Remove,Modify');
 261+ $j(target).html('<h3>Current Overlays:</h3>Add,Remove,Modify');
262262 }
263263 },
264264 'audio':{
265265 'd':0,
266266 'media':['image','video', 'template'],
267 - 'doEdit':function( _this ){
 267+ 'doEdit':function(target, _this ){
268268 //do clock mouse scroll duration editor
269 - $j('#sub_cliplib_ic').html('<h3>Audio Volume:</h3>');
 269+ $j(target).html('<h3>Audio Volume:</h3>');
270270 }
271271 }
272272 },
@@ -273,8 +273,11 @@
274274 var _this = this;
275275 //add in subMenus if set
276276 //check for submenu and add to item container
277 - var o='';
278 - o+= '<ul id="mv_submenu_clipedit" class="mv_submenu">';
 277+ var o='';
 278+ var tabc ='';
 279+ o+= '<div id="mv_submenu_clipedit">';
 280+ o+='<ul>';
 281+ var selected_tab = 0;
279282 $j.each(this.edit_types, function(sInx, editType){
280283 //check if the given editType is valid for our given media type
281284 var include = false;
@@ -282,22 +285,28 @@
283286 if( editType.media[i] == _this.media_type)
284287 include = true;
285288 }
286 - if(include){
287 - var sub_sel_class = (editType.d == 1)?'class="mv_sub_selected"':'';
288 - o+= '<li ' + sub_sel_class + ' id="mv_smi_' + sInx + '">' +
289 - gM('sc_' + sInx ) + '</li>';
 289+ if(include){
 290+ o+= '<li>'+
 291+ '<a id="mv_smi_'+sInx+'" href="#sc_' + sInx + '">' + gM('sc_' + sInx ) + '</a>'+
 292+ '</li>';
 293+ tabc += '<div id="sc_' + sInx + '" style="overflow:auto;" ></div>';
290294 }
291295 });
292 - o+= '</ul>';
293 - //add sub menu container with menu html:
294 - o+= '<div id="sub_cliplib_ic" class="submenu_container"></div>';
295 - $j('#'+this.control_ct).html( o ) ;
 296+ o+= '</ul>' + tabc;
 297+ o+= '</div>';
 298+ //add sub menu container with menu html:
 299+ $j('#'+this.control_ct).html( o ) ;
296300 //set up bindings:
297 - for( var i in this.edit_types){
298 - $j('#mv_smi_'+ i).click( function(){
299 - _this.doDisplayEdit( $j(this).attr("id").replace('mv_smi_','') );
300 - });
301 - }
 301+ $j('#mv_submenu_clipedit').tabs({
 302+ select: function(event, ui) {
 303+ _this.doDisplayEdit( $j(ui.tab).attr('id').replace('mv_smi_', '') );
 304+ }
 305+ //add sorting
 306+ }).addClass('ui-tabs-vertical ui-helper-clearfix');
 307+ //close left:
 308+ $j("#mv_submenu_clipedit li").removeClass('ui-corner-top').addClass('ui-corner-left');
 309+ //update the default edit display:
 310+ _this.doDisplayEdit();
302311 },
303312 doDisplayEdit:function( edit_type ){
304313 if(!edit_type)
@@ -305,15 +314,11 @@
306315 if(this.edit_types[i].d == 1)
307316 edit_type = i;
308317 }
309 - js_log('doDisplayEdit: ' + edit_type );
310 - //remove from all
311 - $j('#mv_submenu_clipedit li').removeClass('mv_sub_selected');
312 - //add selected class:
313 - $j('#mv_smi_' + edit_type).addClass('mv_sub_selected');
 318+ js_log('doDisplayEdit: ' + edit_type );
314319
315320 //do edit interface for that edit type:
316321 if( this.edit_types[ edit_type ].doEdit )
317 - this.edit_types[ edit_type ].doEdit( this );
 322+ this.edit_types[ edit_type ].doEdit( '#sc_'+edit_type, this );
318323 },
319324 setUpVideoCtrl:function(){
320325 js_log('setUpVideoCtrl:f');
Index: branches/new-upload/phase3/js2/mwEmbed/skins/mvpcf/mv_sequence.css
@@ -171,22 +171,23 @@
172172 right:0px;
173173 }
174174 .submenu_container{
175 - top:25px;
 175+/* top:25px;
176176 left:10px;
177177 right:0px;
178178 overflow:auto;
179179 position:absolute;
180180 broder: solid thin gray;
 181+*/
181182 }
182183 .mv_submenu{
183184 /*position:absolute;*/
184 - left:0px;
 185+ /*left:0px;
185186 top:0px;
186187 margin:2px;
187188 list-style-type:none;
188189 bottom:0px;
189190 border:none;
190 - padding:0px;
 191+ padding:0px;*/
191192 }
192193 .mv_submenu li{
193194 border:solid thin gray;
Index: branches/new-upload/phase3/js2/mwEmbed/skins/mvpcf/styles.css
@@ -684,4 +684,14 @@
685685
686686 .ui-progressbar-value{
687687 background-image: url('images/pbar-ani.gif');
688 -}
\ No newline at end of file
 688+}
 689+
 690+/* Vertical Tabs
 691+----------------------------------*/
 692+.ui-tabs-vertical { width: 55em; }
 693+.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; }
 694+.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
 695+.ui-tabs-vertical .ui-tabs-nav li a { display:block; }
 696+.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }
 697+.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 40em;}
 698+
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/htmlEmbed.js
@@ -80,6 +80,7 @@
8181 return true;
8282 },
8383 renderTimelineThumbnail:function( options ){
 84+ js_log("HTMLembed req w, height: " + options.width + ' ' + options.height);
8485 //generate a scaled down version _that_ we can clone if nessisary
8586 //add a not vissiable container to the body:
8687 var do_refresh = (typeof options['refresh'] != 'undefined')?true:false;
@@ -88,16 +89,18 @@
8990 if( $j('#' + thumb_render_id ).length == 0 || do_refresh ){
9091 //set the font scale down percentage: (kind of arbitrary)
9192 var scale_perc = options.width / this.pc.pp.width;
92 - //js_log('scale_perc:'+options.width + ' / '+ $j(this).width()+ ' = '+scale_perc );
 93+ js_log('scale_perc:'+options.width + ' / '+ $j(this).width()+ ' = '+scale_perc );
9394 //min scale font percent of 70 (overflow is hidden)
94 - var font_perc = ( Math.round( scale_perc*100 ) < 80 )?80:Math.round( scale_perc*100 );
95 - var thumb_class = (typeof options['thumb_class'] !='undefined')? options['thumb_class'] : '';
96 -
 95+ var font_perc = ( Math.round( scale_perc*100 ) < 80 ) ? 80 : Math.round( scale_perc*100 );
 96+ var thumb_class = (typeof options['thumb_class'] !='undefined')? options['thumb_class'] : '';
9797 $j('body').append( '<div id="' + thumb_render_id + '" style="display:none">'+
9898 '<div class="' + thumb_class + '" '+
9999 'style="width:'+options.width+'px;height:'+options.height+'px;" >'+
100 - this.getThumbnailHTML() +
101 - '</div>'+
 100+ this.getThumbnailHTML({
 101+ 'width': options.width,
 102+ 'height': options.height
 103+ }) +
 104+ '</div>' +
102105 '</div>'
103106 );
104107 //scale down the fonts:
@@ -112,7 +115,7 @@
113116 $j('#' + thumb_render_id + ' img').filter('[width]').each(function(){
114117 $j(this).attr({
115118 'width': Math.round( $j(this).attr('width') * scale_perc ),
116 - 'height': Math.round( $j(this).attr('height') * scale_perc )
 119+ 'height': Math.round( $j(this).attr('height') * scale_perc )
117120 }
118121 );
119122 });
@@ -133,11 +136,16 @@
134137 //wrap output in videoPlayer_ div:
135138 $j(this).html('<div id="videoPlayer_'+ this.id+'">'+this.getThumbnailHTML()+'</div>');
136139 },
137 - getThumbnailHTML:function(){
 140+ getThumbnailHTML:function( opt ){
138141 var out='';
 142+ if(!opt)
 143+ opt = {};
 144+ var height = (opt.height)?opt.height:this.pc.pp.height;
 145+ var width = (opt.width)?opt.width: this.pc.pp.width;
 146+ js_log('1req '+ opt.height + ' but got: ' + height);
139147 if( this.pc.type =='image/jpeg'){
140148 js_log('should put src: '+this.pc.src);
141 - out = '<img width="'+this.pc.pp.width+'" height="'+this.pc.pp.height+'" src="'+this.pc.src+'">';
 149+ out = '<img style="width:'+width+'px;height:'+height+'px" src="'+this.pc.src+'">';
142150 }else{
143151 out = this.pc.wholeText;
144152 }
@@ -167,8 +175,7 @@
168176 //@@todo we can "start loading images" if we want
169177 on_dom_swap:function(){
170178 this.loading_external_data=false
171 - this.ready_to_play=true;
172 - debugger;
 179+ this.ready_to_play=true;
173180 return ;
174181 }
175182 };
\ No newline at end of file
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -1579,13 +1579,13 @@
15801580 //@@todo overwite by embed library if we can render frames natavily
15811581 renderTimelineThumbnail:function( options ){
15821582 var my_thumb_src = this.media_element.getThumbnailURL();
1583 -
 1583+ //check if our thumbnail has a time attribute:
15841584 if( my_thumb_src.indexOf('t=') !== -1){
15851585 var time_ntp = seconds2npt ( options.time + parseInt(this.start_offset) );
15861586 my_thumb_src = getURLParamReplace( my_thumb_src, { 't':time_ntp, 'size': options.size } );
15871587 }
1588 - var thumb_class = (typeof options['thumb_class'] !='undefined')? options['thumb_class'] : '';
1589 - return '<div class="' + thumb_class + '" src="' + my_thumb_src +'" '+
 1588+ var thumb_class = (typeof options['thumb_class'] != 'undefined' ) ? options['thumb_class'] : '';
 1589+ return '<div class="ui-corner-all ' + thumb_class + '" src="' + my_thumb_src + '" '+
15901590 'style="height:' + options.height + 'px;' +
15911591 'width:' + options.width + 'px" >' +
15921592 '<img src="' + my_thumb_src +'" '+

Status & tagging log