r46064 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46063‎ | r46064 | r46065 >
Date:05:54, 23 January 2009
Author:dale
Status:deferred
Tags:
Comment:
sequencer bugs
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/add_media_wizard.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.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)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php
@@ -28,8 +28,11 @@
2929 /*
3030 * returns the xml output of the sequence with all wiki-text templates/magic words swapped out
3131 * also resolves all image and media locations with absolute paths.
 32+ *@param $partial_node_set 'full' (the full nodeset)
 33+ * 'seq' (just seq elements)
 34+ * 'transition' (just transition elements)
3235 */
33 - function getSequenceSMIL(){
 36+ function getSequenceSMIL( $partial_node_set='full' ){
3437 global $wgParser,$wgOut, $wgUser, $wgEnableParserCache;
3538 //temporally stop cache:
3639 $wgEnableParserCache=false;
@@ -48,7 +51,7 @@
4952 $this->resolveHLRD_to_SMIL();
5053
5154 //@@todo get parser Output Object (maybe cleaner way to do this?
52 - //maybe parser cache is not the right place for this?)
 55+ //maybe parser cache is not the right place to cache the sequence xml? )
5356 $parserOutput = $wgParser->parse('', $this->mTitle, ParserOptions::newFromUser( $wgUser ));
5457 //output header:
5558 $parserOutput->mText.=$this->smilDoc->saveXML();
@@ -136,10 +139,8 @@
137140 if(!is_null($nodeAttr)){
138141 foreach($nodeAttr as $atrr){
139142 if($atrr->nodeName=='uri'){
140 - //pull in node content
141143 $node_uri = $atrr->nodeValue;
142 - }
143 - //print "$attr = ". $atrr->nodeValue . "\n";
 144+ }
144145 }
145146 }
146147
@@ -156,7 +157,13 @@
157158 //top level ref includes of pages in the main namespace not supported
158159 break;
159160 case MV_NS_SEQUENCE:
160 - //type sequence ..@@todo transclude the sequence into present sequence (try to avoid id)
 161+ //type sequence ..@@todo transclude the sequence into present sequence
 162+ //@@todo we should
 163+ //change the node type to "par" to group the sequence under a single element (helpfull for editor representation)
 164+ /*$parElm = $node->ownerDocument->createElement('par');
 165+
 166+ $seqArticle = new MV_SequencePage( $uriTitle );
 167+ $seqArticle->getSequenceSMIL();*/
161168 break;
162169 case MV_NS_STREAM:
163170 global $mvDefaultVideoQualityKey, $mvDefaultFlashQualityKey;
@@ -207,11 +214,11 @@
208215 $templateText = '{{'. $uriTitle->getText();
209216 $addedParamFlag=false;
210217 $paramVars = Array();
211 - while ($node->childNodes->length){
212 - if($node->firstChild->nodeName=='param'){
 218+ while ( $node->childNodes->length ){
 219+ if( $node->firstChild->nodeName=='param' ){
213220 $param = & $node->firstChild;
214221 //make sure we have a name:
215 - if($param->hasAttribute('name')){
 222+ if( $param->hasAttribute('name') ){
216223 //we have parameters:
217224 $templateText.= "|\n";
218225 $templateText .= $param->getAttribute('name') . '=';
Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.js
@@ -8,6 +8,7 @@
99
1010 //if mv_embed is hosted somewhere other than near by the add_media_wizard you can define it here:
1111 var mv_add_media_wizard_path = 'http://mvbox2.cse.ucsc.edu/w/extensions/MetavidWiki/skins/';
 12+var mv_add_media_wizard_path = 'http://localhost/wiki/extensions/MetavidWiki/skins/';
1213
1314
1415 //*code should not have to modify anything below*/
@@ -146,6 +147,8 @@
147148 return s.src.replace('add_media_wizard.js', replace_str);
148149 }
149150 }
 151+ js_log('return default path: ' + mv_add_media_wizard_path + replace_str);
150152 return mv_add_media_wizard_path + replace_str;
151153 }
152154
 155+
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_sequencer.js
@@ -542,14 +542,14 @@
543543 if( e.which == 17)
544544 this_seq.key_ctrl_down = true;
545545
546 - if( e.which == 67 && this_seq.key_ctrl_down && !this_seq.inputFocus)
 546+ if( (e.which == 67 && this_seq.key_ctrl_down) && !this_seq.inputFocus)
547547 this_seq.copySelectedClips();
548548
549 - if( e.which == 88 && this_seq.key_ctrl_down && !this_seq.inputFocus)
 549+ if( (e.which == 88 && this_seq.key_ctrl_down) && !this_seq.inputFocus)
550550 this_seq.cutSelectedClips();
551551
552552 //paste cips on v + ctrl while not focused on a text area:
553 - if( e.which == 86 && this_seq.key_ctrl_down && !this_seq.inputFocus)
 553+ if( (e.which == 86 && this_seq.key_ctrl_down) && !this_seq.inputFocus)
554554 this_seq.pasteClipBoardClips();
555555
556556 });
@@ -563,7 +563,7 @@
564564 this_seq.key_ctrl_down = false;
565565
566566 //backspace or delete key while not focused on a text area:
567 - if( e.which == 8 || e.which == 46 && !this_seq.inputFocus){
 567+ if( (e.which == 8 || e.which == 46) && !this_seq.inputFocus){
568568 this_seq.removeSelectedClips();
569569 }
570570 });
@@ -571,15 +571,17 @@
572572 //check all nodes for focus
573573 //@@todo it would probably be faster to search a given subnode instead of all text
574574 doFocusBindings:function(){
575 - var _this = this;
 575+ var this_seq = this;
576576 //if an input or text area has focus disable delete key binding
577 - $("input,textarea").focus(function () {
578 - _this.inputFocus = true;
 577+ $j("input,textarea").focus(function () {
 578+ js_log("inputFocus:true");
 579+ this_seq.inputFocus = true;
579580 });
580 - $("input,textarea").blur( function () {
581 - _this.inputFocus = false;
 581+ $j("input,textarea").blur( function () {
 582+ js_log("inputFocus:blur");
 583+ this_seq.inputFocus = false;
582584 })
583 - }
 585+ },
584586 update_tl_hook:function(jh_time_ms){
585587 //put into seconds scale:
586588 var jh_time_sec_float = jh_time_ms/1000;
@@ -736,14 +738,17 @@
737739 this.removeSelectedClips();
738740 },
739741 removeSelectedClips:function(){
740 - var remove_clip_ary=new Array();
 742+ var remove_clip_ary=new Array();
741743 //remove selected clips from display
742744 $j('.container_track .mv_selected_clip').each(function(){
743745 //grab the track index from the id (assumes track_#_clip_#
744746 remove_clip_ary.push ( $j(this).parent().attr('id').replace('track_','').replace('clip_','').split('_') );
745747 });
746748 if(remove_clip_ary.length !=0 )
747 - this.removeClips(remove_clip_ary);
 749+ this.removeClips(remove_clip_ary);
 750+
 751+ //doEdit selected clips (updated selecte resource)
 752+ this.doEditSelectedClip();
748753 },
749754 //add a single or set of clips
750755 //to a given position and track_inx
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js
@@ -44,7 +44,7 @@
4545 return this.init(initObj);
4646 };
4747 mvClipEdit.prototype = {
48 -
 48+
4949 selTool:null, //selected tool
5050 crop: null, //the crop values
5151 base_img_src:null,
@@ -216,9 +216,20 @@
217217 'd':0,
218218 'media':['video'],
219219 'doEdit':function( _this ){
 220+ var cat = _this.rObj
 221+ //debugger;
220222 //do clock mouse scroll duration editor
221 - $j('#sub_cliplib_ic').html('cur start: ' + _this.rObj.embed.start_ntp + ' end: ' + _this.rObj.embed.end_ntp );
222 - }
 223+ var end_ntp = ( _this.rObj.embed.end_ntp) ? _this.rObj.embed.end_ntp : _this.rObj.embed.getDuration();
 224+ if(!end_ntp)
 225+ end_ntp = seconds2ntp( _this.rObj.dur );
 226+ $j('#sub_cliplib_ic').html(
 227+ _this.getSetInOut({
 228+ 'start_ntp' : _this.rObj.embed.start_ntp,
 229+ 'end_ntp' : end_ntp
 230+ })
 231+ );
 232+ _this.setInOutBindings();
 233+ }
223234 },
224235 'panzoom':{
225236 'd':0,
@@ -293,17 +304,42 @@
294305 },
295306 setUpVideoCtrl:function(){
296307 js_log('setUpVideoCtrl:f');
 308+ var this_seq = this;
297309 var eb = $j('#embed_vid').get(0);
298310 //turn on preview to avoid onDone actions
299311 eb.preview_mode = true;
300312 $j('#'+this.control_ct).html('<h3>Edit Video Tools:</h3>');
301 - if( eb.supportsURLTimeEncoding() ){
302 - js_log("SUPPORTS supports_url_time_encoding do start end");
303 - $j('#'+this.control_ct).append('<strong>Set in-out points</strong>'+
 313+ if( eb.supportsURLTimeEncoding() ){
 314+ $j('#'+this.control_ct).append(
 315+ this_seq.getSetInOut({
 316+ 'start_ntp' : eb.start_ntp,
 317+ 'end_ntp' : eb.end_ntp
 318+ })
 319+ );
 320+ this_seq.setInOutBindings();
 321+ }
 322+ $j('#'+this.control_ct).append( this.getInsertDesc() );
 323+
 324+ $j('#'+this.control_ct).append( '<b>Metavid clip inserts not yet supported</b>' +
 325+ '<a href="#" class="mv_cancel_img_edit" title="' + getMsg('mv_cancel_image_insert')+'">' + getMsg('mv_cancel_image_insert') + '</a> ');
 326+ //$j('#'+this.control_ct).append( this.getInsertDesc() + this.getInsertAction() );
 327+
 328+ //this.applyInsertControlBindings();
 329+ },
 330+ setInOutBindings:function(){
 331+ //setup bindings for adjust / preview:
 332+ add_adjust_hooks( 'rsd' );
 333+ $j('#mv_preview_clip').click(function(){
 334+ $j('#embed_vid').get(0).stop();
 335+ $j('#embed_vid').get(0).play();
 336+ });
 337+ },
 338+ getSetInOut:function( setInt ){
 339+ return '<strong>Set in-out points</strong>'+
304340 '<table border="0" style="background: transparent; width:94%;height:50px;">'+
305341 '<tr>' +
306342 '<td style="width:50px">'+
307 - '<span style="font-size: small;" id="track_time_start_rsd">' + eb.start_ntp +'</span>'+
 343+ '<span style="font-size: small;" id="track_time_start_rsd">' + setInt.start_ntp +'</span>'+
308344 '</td>' +
309345 '<td>' +
310346 '<div style="border: 1px solid black; width: 100%; height: 5px; background-color: #888;" '+
@@ -320,39 +356,23 @@
321357 '</div>'+
322358 '</td>' +
323359 '<td style="width:50px">'+
324 - '<span style="font-size: small;" id="track_time_end_rsd">'+ eb.end_ntp +'</span>'+
 360+ '<span style="font-size: small;" id="track_time_end_rsd">'+ setInt.end_ntp +'</span>'+
325361 '</td>' +
326362 '</tr>' +
327363 '</table>'+
328364 '<span style="float: left;">'+
329365 '<label class="mv_css_form" for="mv_start_hr_rsd"><i>Start time:</i></label>'+
330 - '<input id="mv_start_hr_rsd" class="mv_adj_hr" name="mv_start_hr_rsd" value="' + eb.start_ntp + '" maxlength="8" size="8"/>'+
 366+ '<input id="mv_start_hr_rsd" class="mv_adj_hr" name="mv_start_hr_rsd" value="' + setInt.start_ntp + '" maxlength="8" size="8"/>'+
331367 '</span>'+
332368 '<span style="float: left;">'+
333369 '<label for="mv_end_hr_rsd" class="mv_css_form"><i>End time:</i></label>'+
334 - '<input name="mv_end_hr_rsd" id="mv_end_hr_rsd" value="' + eb.end_ntp + '" maxlength="8" size="8" class="mv_adj_hr"/>'+
 370+ '<input name="mv_end_hr_rsd" id="mv_end_hr_rsd" value="' + setInt.end_ntp + '" maxlength="8" size="8" class="mv_adj_hr"/>'+
335371 '</span>'+
336372 '<div style="clear: both;"/>'+
337 - '<input id="mv_preview_clip" type="button" value="Preview/Play In-out points">');
338 -
339 - //setup bindings for adjust / preview:
340 - add_adjust_hooks('rsd');
341 - $j('#mv_preview_clip').click(function(){
342 - $j('#embed_vid').get(0).stop();
343 - $j('#embed_vid').get(0).play();
344 - });
345 - }
346 - $j('#'+this.control_ct).append( this.getInsertDesc() );
347 -
348 - $j('#'+this.control_ct).append( '<b>Metavid clip inserts not yet supported</b>' +
349 - '<a href="#" class="mv_cancel_img_edit" title="' + getMsg('mv_cancel_image_insert')+'">' + getMsg('mv_cancel_image_insert') + '</a> ');
350 - //$j('#'+this.control_ct).append( this.getInsertDesc() + this.getInsertAction() );
351 -
352 - //this.applyInsertControlBindings();
 373+ '<input id="mv_preview_clip" type="button" value="Preview/Play In-out points">';
353374 },
354375 getInsertDesc:function(){
355 - return '<h3>Inline Description</h3>' +
356 - '(you can copy and paste from the transcript by clicking on the cc button below the video)<br>'+
 376+ return '<h3>Inline Description</h3><br>'+
357377 '<textarea style="width:300px;" id="mv_inline_img_desc" rows="4" cols="30"></textarea><br>';
358378 },
359379 getInsertAction:function(){
@@ -679,10 +699,12 @@
680700 //update the vid title:
681701 $j('#mv_videoPlayerTime').html( start_time + ' to ' + end_time );
682702 var ebvid = $j('#embed_vid').get(0);
683 - if(ebvid.isPaused())
684 - ebvid.stop();
685 - $j('#embed_vid').get(0).updateVideoTime(start_time, end_time);
686 - js_log('update thumb: '+ start_time);
687 - ebvid.updateThumbTimeNTP( start_time );
 703+ if( ebvid ){
 704+ if(ebvid.isPaused())
 705+ ebvid.stop();
 706+ ebvid.updateVideoTime(start_time, end_time);
 707+ js_log('update thumb: '+ start_time);
 708+ ebvid.updateThumbTimeNTP( start_time );
 709+ }
688710 }
689711 }
\ No newline at end of file
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_playlist.js
@@ -461,12 +461,13 @@
462462 this.getClipCount()+' clips, <i>'+
463463 seconds2ntp( this.getDuration() ) + '</i>');
464464
465 - //only show the inline edit button if mediaWiki write API is enabled:
466 - if(wgEnableWriteAPI)
 465+ //only show the inline edit button if mediaWiki write API is enabled:
 466+ if( typeof wgEnableWriteAPI != 'undefined'){
467467 $j('#ptitle_'+this.id).append(
468468 '<a href="#" onclick="$j(\'#'+this.id+'\').get(0).doEditor();"'+
469469 'style="position:absolute;top:0px;right:0px">edit</a>'
470470 );
 471+ }
471472 //render out the dividers on the timeline:
472473 this.colorPlayHead();
473474 //update status:

Status & tagging log