r45586 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45585‎ | r45586 | r45587 >
Date:23:08, 8 January 2009
Author:dale
Status:deferred
Tags:
Comment:
* sequence editor playhead scrubber updates
* style updates for playlist embed
* fixed list layout results for external media search
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_EditSequencePage.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/external_media_wizard.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_allpages.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_vlcEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libRemoteMediaSearch/mv_remote_media_search.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_playlist.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_sequencer.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_EditSequencePage.php
@@ -19,11 +19,11 @@
2020 mvAddGlobalJSVariables( array( 'mvSeqExportUrl' => $seqPlayer->getExportUrl() ) );
2121 //add the "switch" link to the top of the page
2222 $wgOut->addHTML('<span id="swich_seq_links">
23 - <a id="swich_seq_text"
 23+ <a id="swich_seq_text" style="display:none"
2424 href="javascript:mv_do_sequence_edit_swap(\'text\')">'.
2525 wfMsg('mv_sequence_edit_text') .
2626 '</a>' .
27 - '<a id="switch_seq_wysiwyg" style="display:none"
 27+ '<a id="switch_seq_wysiwyg"
2828 href="javascript:mv_do_sequence_edit_swap(\'seq_update\')">' .
2929 wfMsg('mv_sequence_edit_visual_editor') .
3030 '</a>' .
Index: trunk/extensions/MetavidWiki/skins/external_media_wizard.js
@@ -20,7 +20,7 @@
2121 imE.src = 'http://upload.wikimedia.org/wikipedia/commons/8/86/Button_add_media.png';
2222 toolbar.appendChild(imE);
2323 imE.setAttribute('onClick', 'mv_do_load_wiz()');
24 - //addHandler only works once
 24+ //addHandler only works once cuz of dom manipluations
2525 /*addHandler( imE, 'click', function() {
2626 mv_do_load_wiz();
2727 });*/
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_playlist.js
@@ -372,10 +372,10 @@
373373
374374 //add the playlist controls:
375375 $j('#dc_'+plObj.id).append(
376 - '<div class="videoPlayer" style="position:absolute;top:'+(plObj.height+plObj.pl_layout.title_bar_height)+'px">' +
 376+ '<div class="videoPlayer" style="position:absolute;top:'+(plObj.height+plObj.pl_layout.title_bar_height+4)+'px">' +
377377 '<div id="mv_embedded_controls_'+plObj.id+'" ' +
378378 'style="postion:relative;top:'+(plObj.height+plObj.pl_layout.title_bar_height)+'px;' +
379 - 'width:'+plObj.width+'px" ' +
 379+ 'width:' + ( plObj.width + 2 ) + 'px" ' +
380380 'class="controls">' +
381381 plObj.getControlsHTML() +
382382 '</div>'+
@@ -460,8 +460,14 @@
461461 $j('#ptitle_'+this.id).html(''+
462462 '<b>' + this.title + '</b> '+
463463 this.getClipCount()+' clips, <i>'+
464 - seconds2ntp( this.getDuration() ) + '</i>' +
465 - '<a href="#" onclick="$j(\'#'+this.id+'\').get(0).doEditor();" style="position:absolute;top:0px;right:0px">edit</a>');
 464+ seconds2ntp( this.getDuration() ) + '</i>');
 465+
 466+ //only show the inline edit button if mediaWiki write API is enabled:
 467+ if(wgEnableWriteAPI==true)
 468+ $j('#ptitle_'+this.id).append(
 469+ '<a href="#" onclick="$j(\'#'+this.id+'\').get(0).doEditor();"'+
 470+ 'style="position:absolute;top:0px;right:0px">edit</a>'
 471+ );
466472 //render out the dividers on the timeline:
467473 this.colorPlayHead();
468474 //update status:
@@ -584,11 +590,7 @@
585591 //navtive support:
586592 // * pre-loads clips
587593 // * mv_playlist smil extension, manages transitions animations overlays etc.
588 - js_log('clip obj supports playlist swap_loader (ie playlist controlled playback)');
589 - //update cur clip based if sequence playhead set:
590 - var d = new Date();
591 - this.clockStartTime = d.getTime();
592 - this.monitor();
 594+ js_log('clip obj supports playlist swap_loader (ie playlist controlled playback)');
593595 //@@todo pre-load each clip:
594596 this.cur_clip.embed.play();
595597 }else if(this.cur_clip.embed.supports['playlist_driver']){
@@ -601,6 +603,8 @@
602604 //play cur_clip
603605 this.cur_clip.embed.play();
604606 }
 607+ //start up the playlist monitor
 608+ this.monitor();
605609 },
606610 toggleMute:function(){
607611 this.cur_clip.embed.toggleMute();
@@ -1244,8 +1248,7 @@
12451249 *****************************/
12461250 /*playlist driver extensions to the playlist object*/
12471251 mvPlayList.prototype.monitor = function(){
1248 - //js_log('pl:monitor');
1249 - //js_log('mvPlayList:monitor trueTime: '+ ( (ct.getTime() - this.clockStartTime )/1000));
 1252+ //js_log('pl:monitor');
12501253 //if paused stop updates
12511254 if( this.paused ){
12521255 //clearInterval( this.smil_monitorTimerId );
@@ -1258,6 +1261,7 @@
12591262
12601263 //update the playlist current time:
12611264 this.currentTime = this.cur_clip.dur_offset + this.cur_clip.embed.currentTime;
 1265+
12621266 //update slider:
12631267 if(!this.userSlide){
12641268 this.setStatus(seconds2ntp(this.currentTime) + '/' + seconds2ntp(this.getDuration()) );
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_sequencer.js
@@ -414,7 +414,11 @@
415415 },
416416 //once playlist is ready continue
417417 checkReadyPlObj:function(){
 418+ //set up pointers from sequencer to pl obj
418419 this.plObj = $j('#'+ this.plObj_id ).get(0);
 420+ //& from seq obj to sequencer
 421+ this.plObj.pSeq = this;
 422+
419423 if( this.plObj )
420424 if( ! this.plObj.loading )
421425 this.plReadyInit();
@@ -437,7 +441,7 @@
438442 //give the playlist a pointer to its parent seq:
439443 this.plObj['seqObj'] = this;
440444
441 - //update playlist (since if its empty right now)
 445+ //update playlist (if its empty right now)
442446 if(this.plObj.getClipCount()==0){
443447 $j('#'+this.plObj_id).html('empty playlist');
444448 }
@@ -546,7 +550,7 @@
547551
548552 //set up key bidnings
549553 $j().keydown(function(e){
550 - js_log('pushed down on:' + e.which);
 554+ js_log('pushed down on:' + e.which);
551555 if( e.which == 16 )
552556 this_seq.key_shift_down = true;
553557
@@ -563,8 +567,8 @@
564568 this_seq.pasteClipBoardClips();
565569
566570 });
567 - $j().keyup(function(e){
568 - js_log('key up on ' + e.which);
 571+ $j().keyup(function(e){
 572+ js_log('key up on ' + e.which);
569573 //user let go of "shift" turn off multi-select
570574 if( e.which == 16 )
571575 this_seq.key_shift_down = false;
@@ -573,7 +577,7 @@
574578 this_seq.key_ctrl_down = false;
575579
576580 //backspace or delete key:
577 - if( e.which == 8 || e.which == 46 ){
 581+ if( e.which == 8 || e.which == 46 ){
578582 this_seq.removeSelectedClips();
579583 }
580584 });
@@ -737,7 +741,8 @@
738742 //grab the track index from the id (assumes track_#_clip_#
739743 remove_clip_ary.push ( $j(this).parent().attr('id').replace('track_','').replace('clip_','').split('_') );
740744 });
741 - this.removeClips(remove_clip_ary);
 745+ if(remove_clip_ary.length !=0 )
 746+ this.removeClips(remove_clip_ary);
742747 },
743748 //add a single or set of clips
744749 //to a given position and track_inx
@@ -1334,11 +1339,22 @@
13351340 //do specific mods:(controls and title are managed by the sequencer)
13361341 this.pl_layout.title_bar_height=0;
13371342 this.pl_layout.control_height=0;
1338 - },
1339 - //update the timeline playhead and passalong to parent
 1343+ },
13401344 setSliderValue:function( perc ){
1341 - js_log("set " + perc + ' of cur_clip: ' + this.cur_clip.order );
1342 - //$j('#'+ this.seqObj.timeline_id + '_playline').css('left')
 1345+ //get the track_clipThumb_height from parent mvSequencer
 1346+ var frame_width = Math.round( this.pSeq.track_clipThumb_height * 1.3333333 );
 1347+ var container_width = frame_width+60;
 1348+
 1349+ var perc_clip = this.cur_clip.embed.currentTime / this.cur_clip.getDuration();
 1350+
 1351+ var left_px = parseInt( (this.cur_clip.order * container_width) + (frame_width*perc_clip) ) + 'px';
 1352+ js_log("set " + perc + ' of cur_clip: ' + this.cur_clip.order + ' lp:'+left_px);
 1353+
 1354+
 1355+ //update the timeline playhead and
 1356+ $j('#'+ this.seqObj.timeline_id + '_playline').css('left', left_px);
 1357+
 1358+ //pass update request to parent:
13431359 this.parent_setSliderValue( perc );
13441360 },
13451361 getControlsHTML:function(){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css
@@ -526,7 +526,7 @@
527527 right:2px;
528528 top:100px;
529529 bottom:2px;
530 - z-index:-1;
 530+ z-index:200;
531531 overflow:auto;
532532 }
533533 #rsd_results {
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -2222,7 +2222,7 @@
22232223 if(this.controls)
22242224 {
22252225 js_log("f:getHTML:AddControls");
2226 - html_code +='<div id="mv_embedded_controls_'+this.id+'" class="controls" style="width:'+this.width+'px">';
 2226+ html_code +='<div id="mv_embedded_controls_' + this.id + '" class="controls" style="width:' + this.width + 'px">';
22272227 html_code += this.getControlsHTML();
22282228 html_code +='</div>';
22292229 //block out some space by encapulating the top level div
@@ -2716,6 +2716,8 @@
27172717 }else{
27182718 this.pause();
27192719 }
 2720+ //reset the currentTime:
 2721+ this.currentTime=0;
27202722 //check if thumbnail is being displayed in which case do nothing
27212723 if(this.thumbnail_disp){
27222724 //already in stooped state
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_vlcEmbed.js
@@ -217,7 +217,8 @@
218218 //js_log('set buffer: ' + flash_state.bufferEnd + ' at time: ' + flash_state.time +' of total dur: ' + this.getDuration());
219219 }else{
220220 this.currentTime = (this.vlc.input.time/1000) + this.media_element.selected_source.start_offset;
221 - }
 221+ }
 222+ //js_log('cur vlc:time: ' + this.currentTime);
222223 if( this.duration > 0 || this.vlc.input.time > 0){
223224 this.start_offset=this.media_element.selected_source.start_offset;
224225
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libRemoteMediaSearch/mv_remote_media_search.js
@@ -367,9 +367,9 @@
368368 }else if(_this.result_display_mode == 'list'){
369369 o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result" style="' + disp + 'width:90%">';
370370 o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + rInx +'" style="float:left;width:' + _this.thumb_width + 'px; padding:5px;" src="' + rItem.poster + '">';
371 - o+= rItem.desc ;
372 - o+='</div>';
373 - o+='<div style="clear:both" />';
 371+ o+= rItem.desc ;
 372+ o+='<div style="clear:both" />';
 373+ o+='</div>';
374374 }
375375 });
376376 }
Index: trunk/extensions/MetavidWiki/skins/mv_allpages.js
@@ -21,15 +21,8 @@
2222 //make sure we have jQuery and any base required libs:
2323 mvJsLoader.doLoad(mvEmbed.lib_jquery, function(){
2424 _global['$j'] = jQuery.noConflict();
25 - js_log('allpage_ did jquery check');
 25+ js_log('allpage_ did jquery check');
2626
27 - if(typeof wgCanonicalNamespace != 'undefined'){
28 - //(@@todo genneralize to a script action taken by the php so its not language specifc)
29 - if(wgCanonicalNamespace=='Sequence' && $j('#ca-edit').hasClass("selected")){
30 - mv_do_sequence_edit_swap('seq');
31 - }
32 - }
33 -
3427 var reqLibs = {'$j.fn.autocomplete':'jquery/plugins/jquery.autocomplete.js',
3528 '$j.fn.hoverIntent':'jquery/plugins/jquery.hoverIntent.js'};
3629 mvJsLoader.doLoad(

Status & tagging log