Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php |
— | — | @@ -28,8 +28,11 @@ |
29 | 29 | /* |
30 | 30 | * returns the xml output of the sequence with all wiki-text templates/magic words swapped out |
31 | 31 | * 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) |
32 | 35 | */ |
33 | | - function getSequenceSMIL(){ |
| 36 | + function getSequenceSMIL( $partial_node_set='full' ){ |
34 | 37 | global $wgParser,$wgOut, $wgUser, $wgEnableParserCache; |
35 | 38 | //temporally stop cache: |
36 | 39 | $wgEnableParserCache=false; |
— | — | @@ -48,7 +51,7 @@ |
49 | 52 | $this->resolveHLRD_to_SMIL(); |
50 | 53 | |
51 | 54 | //@@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? ) |
53 | 56 | $parserOutput = $wgParser->parse('', $this->mTitle, ParserOptions::newFromUser( $wgUser )); |
54 | 57 | //output header: |
55 | 58 | $parserOutput->mText.=$this->smilDoc->saveXML(); |
— | — | @@ -136,10 +139,8 @@ |
137 | 140 | if(!is_null($nodeAttr)){ |
138 | 141 | foreach($nodeAttr as $atrr){ |
139 | 142 | if($atrr->nodeName=='uri'){ |
140 | | - //pull in node content |
141 | 143 | $node_uri = $atrr->nodeValue; |
142 | | - } |
143 | | - //print "$attr = ". $atrr->nodeValue . "\n"; |
| 144 | + } |
144 | 145 | } |
145 | 146 | } |
146 | 147 | |
— | — | @@ -156,7 +157,13 @@ |
157 | 158 | //top level ref includes of pages in the main namespace not supported |
158 | 159 | break; |
159 | 160 | 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();*/ |
161 | 168 | break; |
162 | 169 | case MV_NS_STREAM: |
163 | 170 | global $mvDefaultVideoQualityKey, $mvDefaultFlashQualityKey; |
— | — | @@ -207,11 +214,11 @@ |
208 | 215 | $templateText = '{{'. $uriTitle->getText(); |
209 | 216 | $addedParamFlag=false; |
210 | 217 | $paramVars = Array(); |
211 | | - while ($node->childNodes->length){ |
212 | | - if($node->firstChild->nodeName=='param'){ |
| 218 | + while ( $node->childNodes->length ){ |
| 219 | + if( $node->firstChild->nodeName=='param' ){ |
213 | 220 | $param = & $node->firstChild; |
214 | 221 | //make sure we have a name: |
215 | | - if($param->hasAttribute('name')){ |
| 222 | + if( $param->hasAttribute('name') ){ |
216 | 223 | //we have parameters: |
217 | 224 | $templateText.= "|\n"; |
218 | 225 | $templateText .= $param->getAttribute('name') . '='; |
Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.js |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | |
10 | 10 | //if mv_embed is hosted somewhere other than near by the add_media_wizard you can define it here: |
11 | 11 | 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/'; |
12 | 13 | |
13 | 14 | |
14 | 15 | //*code should not have to modify anything below*/ |
— | — | @@ -146,6 +147,8 @@ |
147 | 148 | return s.src.replace('add_media_wizard.js', replace_str); |
148 | 149 | } |
149 | 150 | } |
| 151 | + js_log('return default path: ' + mv_add_media_wizard_path + replace_str); |
150 | 152 | return mv_add_media_wizard_path + replace_str; |
151 | 153 | } |
152 | 154 | |
| 155 | + |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_sequencer.js |
— | — | @@ -542,14 +542,14 @@ |
543 | 543 | if( e.which == 17) |
544 | 544 | this_seq.key_ctrl_down = true; |
545 | 545 | |
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) |
547 | 547 | this_seq.copySelectedClips(); |
548 | 548 | |
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) |
550 | 550 | this_seq.cutSelectedClips(); |
551 | 551 | |
552 | 552 | //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) |
554 | 554 | this_seq.pasteClipBoardClips(); |
555 | 555 | |
556 | 556 | }); |
— | — | @@ -563,7 +563,7 @@ |
564 | 564 | this_seq.key_ctrl_down = false; |
565 | 565 | |
566 | 566 | //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){ |
568 | 568 | this_seq.removeSelectedClips(); |
569 | 569 | } |
570 | 570 | }); |
— | — | @@ -571,15 +571,17 @@ |
572 | 572 | //check all nodes for focus |
573 | 573 | //@@todo it would probably be faster to search a given subnode instead of all text |
574 | 574 | doFocusBindings:function(){ |
575 | | - var _this = this; |
| 575 | + var this_seq = this; |
576 | 576 | //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; |
579 | 580 | }); |
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; |
582 | 584 | }) |
583 | | - } |
| 585 | + }, |
584 | 586 | update_tl_hook:function(jh_time_ms){ |
585 | 587 | //put into seconds scale: |
586 | 588 | var jh_time_sec_float = jh_time_ms/1000; |
— | — | @@ -736,14 +738,17 @@ |
737 | 739 | this.removeSelectedClips(); |
738 | 740 | }, |
739 | 741 | removeSelectedClips:function(){ |
740 | | - var remove_clip_ary=new Array(); |
| 742 | + var remove_clip_ary=new Array(); |
741 | 743 | //remove selected clips from display |
742 | 744 | $j('.container_track .mv_selected_clip').each(function(){ |
743 | 745 | //grab the track index from the id (assumes track_#_clip_# |
744 | 746 | remove_clip_ary.push ( $j(this).parent().attr('id').replace('track_','').replace('clip_','').split('_') ); |
745 | 747 | }); |
746 | 748 | 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(); |
748 | 753 | }, |
749 | 754 | //add a single or set of clips |
750 | 755 | //to a given position and track_inx |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_clipedit.js |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | return this.init(initObj); |
46 | 46 | }; |
47 | 47 | mvClipEdit.prototype = { |
48 | | - |
| 48 | + |
49 | 49 | selTool:null, //selected tool |
50 | 50 | crop: null, //the crop values |
51 | 51 | base_img_src:null, |
— | — | @@ -216,9 +216,20 @@ |
217 | 217 | 'd':0, |
218 | 218 | 'media':['video'], |
219 | 219 | 'doEdit':function( _this ){ |
| 220 | + var cat = _this.rObj |
| 221 | + //debugger; |
220 | 222 | //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 | + } |
223 | 234 | }, |
224 | 235 | 'panzoom':{ |
225 | 236 | 'd':0, |
— | — | @@ -293,17 +304,42 @@ |
294 | 305 | }, |
295 | 306 | setUpVideoCtrl:function(){ |
296 | 307 | js_log('setUpVideoCtrl:f'); |
| 308 | + var this_seq = this; |
297 | 309 | var eb = $j('#embed_vid').get(0); |
298 | 310 | //turn on preview to avoid onDone actions |
299 | 311 | eb.preview_mode = true; |
300 | 312 | $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>'+ |
304 | 340 | '<table border="0" style="background: transparent; width:94%;height:50px;">'+ |
305 | 341 | '<tr>' + |
306 | 342 | '<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>'+ |
308 | 344 | '</td>' + |
309 | 345 | '<td>' + |
310 | 346 | '<div style="border: 1px solid black; width: 100%; height: 5px; background-color: #888;" '+ |
— | — | @@ -320,39 +356,23 @@ |
321 | 357 | '</div>'+ |
322 | 358 | '</td>' + |
323 | 359 | '<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>'+ |
325 | 361 | '</td>' + |
326 | 362 | '</tr>' + |
327 | 363 | '</table>'+ |
328 | 364 | '<span style="float: left;">'+ |
329 | 365 | '<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"/>'+ |
331 | 367 | '</span>'+ |
332 | 368 | '<span style="float: left;">'+ |
333 | 369 | '<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"/>'+ |
335 | 371 | '</span>'+ |
336 | 372 | '<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">'; |
353 | 374 | }, |
354 | 375 | 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>'+ |
357 | 377 | '<textarea style="width:300px;" id="mv_inline_img_desc" rows="4" cols="30"></textarea><br>'; |
358 | 378 | }, |
359 | 379 | getInsertAction:function(){ |
— | — | @@ -679,10 +699,12 @@ |
680 | 700 | //update the vid title: |
681 | 701 | $j('#mv_videoPlayerTime').html( start_time + ' to ' + end_time ); |
682 | 702 | 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 | + } |
688 | 710 | } |
689 | 711 | } |
\ No newline at end of file |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mv_playlist.js |
— | — | @@ -461,12 +461,13 @@ |
462 | 462 | this.getClipCount()+' clips, <i>'+ |
463 | 463 | seconds2ntp( this.getDuration() ) + '</i>'); |
464 | 464 | |
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'){ |
467 | 467 | $j('#ptitle_'+this.id).append( |
468 | 468 | '<a href="#" onclick="$j(\'#'+this.id+'\').get(0).doEditor();"'+ |
469 | 469 | 'style="position:absolute;top:0px;right:0px">edit</a>' |
470 | 470 | ); |
| 471 | + } |
471 | 472 | //render out the dividers on the timeline: |
472 | 473 | this.colorPlayHead(); |
473 | 474 | //update status: |