Index: trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | </head> |
9 | 9 | <script type="text/javascript"> |
10 | 10 | </script> |
11 | | -<body bgcolor="#FFF"> |
| 11 | +<body> |
12 | 12 | <h3> Sample Themable Player:</h3> |
13 | 13 | To play with dynamic Themes install <a href="http://jqueryui.com/themeroller/developertool/">Themeroller</a><p><p> |
14 | 14 | |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js |
— | — | @@ -188,10 +188,9 @@ |
189 | 189 | // or better improve the wiki-text parsing and use above |
190 | 190 | var desc = rObj.desc.match(/\|\s*description\s*=\s*(([^\n]*\n)*)\|\s*source=/i); |
191 | 191 | if( desc && desc[1] ){ |
192 | | - rObj.desc = $j.trim( desc[1] ); |
193 | | - var cat = wgUserLanguage; |
| 192 | + rObj.desc = $j.trim( desc[1] ); |
194 | 193 | //attempt to get the user language if set: |
195 | | - if( wgUserLanguage ){ |
| 194 | + if( typeof wgUserLanguage != 'undefined' && wgUserLanguage ){ |
196 | 195 | //for some reason the RegExp object is not happy: |
197 | 196 | var reg = new RegExp( '\{\{\s*' + wgUserLanguage + '([^=]*)=([^\}]*)\}\}', 'gim' ); |
198 | 197 | var langMatch = reg.exec( rObj.desc ); |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -1557,7 +1557,7 @@ |
1558 | 1558 | } |
1559 | 1559 | }, |
1560 | 1560 | checkForFile:function( fName, callback){ |
1561 | | - js_log("checkForFile::"); |
| 1561 | + js_log("checkForFile::" + fName ); |
1562 | 1562 | var _this = this; |
1563 | 1563 | reqObj={ |
1564 | 1564 | 'action':'query', |
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvPlayList.js |
— | — | @@ -154,7 +154,8 @@ |
155 | 155 | * this_plObj_Clone.sequencer=true; |
156 | 156 | * this_plObj_Clone.id= 'seq_plobj'; |
157 | 157 | * debugger; |
158 | | - */ |
| 158 | + */ |
| 159 | + |
159 | 160 | //load sequencer: |
160 | 161 | $j("#sequencer_target").sequencer({ |
161 | 162 | "mv_pl_src" : this.src |
— | — | @@ -412,36 +413,31 @@ |
413 | 414 | } |
414 | 415 | }, |
415 | 416 | renderDisplay:function(){ |
416 | | - js_log('mvPlaylist:renderDisplay:: track length: ' +this.default_track.getClipCount() );'' |
417 | | - |
418 | | - var _this=this; |
419 | | - //setup layout for title and dc_ clip container |
420 | | - |
421 | | - |
422 | | - //add the playlist controls: |
| 417 | + js_log('mvPlaylist:renderDisplay:: track length: ' +this.default_track.getClipCount() ); |
| 418 | + var _this=this; |
423 | 419 | |
424 | 420 | //append container and videoPlayer; |
425 | 421 | $j(this).html('<div id="dc_'+this.id+'" style="width:'+this.width+'px;' + |
426 | | - 'height:'+(this.height+this.pl_layout.title_bar_height + this.pl_layout.control_height)+'px;position:relative;">' + |
| 422 | + 'height:'+ ( this.height + this.pl_layout.title_bar_height + |
| 423 | + this.pl_layout.control_height ) + 'px;position:relative;">' + |
427 | 424 | '</div>'); |
428 | | - if(this.controls==true){ |
| 425 | + if(this.controls == true){ |
| 426 | + var cpos = _this.height + _this.pl_layout.title_bar_height; |
| 427 | + //give more space if not in sequence: |
| 428 | + cpos+= (this.sequencer)?2:5; |
429 | 429 | //append title: |
430 | 430 | $j('#dc_'+_this.id).append( |
431 | 431 | '<div style="font-size:13px;border:solid thin;width:'+this.width+'px;" id="ptitle_'+this.id+'"></div>' + |
432 | | - '<div class="' + this.ctrlBuilder.pClass + '" style="position:absolute;top:'+(_this.height+_this.pl_layout.title_bar_height+4)+'px">' + |
| 432 | + '<div class="' + this.ctrlBuilder.pClass + '" style="position:absolute;top:'+cpos+'px">' + |
433 | 433 | '<div class="ui-widget-header ui-helper-clearfix control-bar" '+ |
434 | 434 | 'style="width:' + _this.width + 'px" >' + |
435 | 435 | _this.getControlsHTML() + |
436 | 436 | '</div>'+ |
437 | 437 | '</div>' |
438 | 438 | ); |
439 | | - |
440 | | - //add the play button: |
441 | | - $j('#dc_'+_this.id).append( |
442 | | - this.cur_clip.embed.getPlayButton() |
443 | | - ); |
444 | | - //once the controls are in the DOM add hooks: |
445 | | - this.ctrlBuilder.addControlHooks(this); |
| 439 | + |
| 440 | + //once the controls are in the DOM add hooks: |
| 441 | + this.ctrlBuilder.addControlHooks( ); |
446 | 442 | }else{ |
447 | 443 | //just append the video: |
448 | 444 | $j('#dc_'+_this.id).append( |
— | — | @@ -467,9 +463,10 @@ |
468 | 464 | cout+='"></div>'; |
469 | 465 | $j('#dc_'+_this.id).append( cout ); |
470 | 466 | //update the embed html: |
471 | | - clip.embed.height=_this.height; |
472 | | - clip.embed.width=_this.width; |
473 | | - clip.embed.play_button=false; |
| 467 | + clip.embed.height = _this.height; |
| 468 | + clip.embed.width = _this.width; |
| 469 | + clip.embed.play_button = false; |
| 470 | + clip.embed.controls = false; |
474 | 471 | |
475 | 472 | clip.embed.getHTML();//get the thubnails for everything |
476 | 473 | |
— | — | @@ -524,15 +521,14 @@ |
525 | 522 | updateBaseStatus:function(){ |
526 | 523 | var _this = this; |
527 | 524 | js_log('Playlist:updateBaseStatus'); |
| 525 | + |
528 | 526 | $j('#ptitle_'+this.id).html(''+ |
529 | 527 | '<b>' + this.title + '</b> '+ |
530 | 528 | this.getClipCount()+' clips, <i>'+ |
531 | | - seconds2npt( this.getDuration() ) + '</i>'); |
532 | | - |
533 | | - //only show the inline edit button if mediaWiki write API is enabled: |
| 529 | + seconds2npt( this.getDuration() ) + '</i>'); |
534 | 530 | |
535 | 531 | //should probably be based on if we have a provider api url |
536 | | - if( typeof wgEnableWriteAPI != 'undefined'){ |
| 532 | + if( typeof wgEnableWriteAPI != 'undefined' && !this.sequencer ){ |
537 | 533 | $j( $j.btnHtml('edit', 'editBtn_'+this.id, 'pencil', |
538 | 534 | {'style':'position:absolute;right:0;;font-size:x-small;height:10px;margin-bottom:0;padding-bottom:7px;padding-top:0;'} ) |
539 | 535 | ).click(function(){ |
— | — | @@ -549,17 +545,18 @@ |
550 | 546 | }, |
551 | 547 | /*setStatus override (could call the jquery directly) */ |
552 | 548 | setStatus:function(value){ |
553 | | - $j('#mv_time_'+this.id).html( value ); |
| 549 | + $j('#'+this.id + ' .time-disp' ).text( value ); |
554 | 550 | }, |
555 | 551 | setSliderValue:function(value){ |
556 | 552 | //slider is on 1000 scale: |
557 | | - var val = parseInt( value *1000 ); |
| 553 | + var val = parseInt( value *1000 ); |
| 554 | + js_log('update slider: #' + this.id + ' .play_head to ' + val ); |
558 | 555 | $j('#' + this.id + ' .play_head').slider('value', val); |
559 | 556 | }, |
560 | 557 | getPlayHeadPos: function(prec_done){ |
561 | 558 | var _this = this; |
562 | 559 | if($j('#mv_seeker_'+this.id).length==0){ |
563 | | - //js_log('no playhead so we can\'t get playhead pos' ); |
| 560 | + js_log('no playhead so we can\'t get playhead pos' ); |
564 | 561 | return 0; |
565 | 562 | } |
566 | 563 | var track_len = $j('#mv_seeker_'+this.id).css('width').replace(/px/, ''); |
— | — | @@ -714,7 +711,7 @@ |
715 | 712 | //playlist play |
716 | 713 | play: function(){ |
717 | 714 | var _this=this; |
718 | | - //js_log('pl play'); |
| 715 | + js_log('pl play'); |
719 | 716 | //hide the playlist play button: |
720 | 717 | $j(this.id + ' .play-btn-large').hide(); |
721 | 718 | |
— | — | @@ -1125,10 +1122,11 @@ |
1126 | 1123 | |
1127 | 1124 | //if in sequence mode hide controls / embed links |
1128 | 1125 | // init_pl_embed.play_button=false; |
1129 | | - init_pl_embed.controls=false; |
| 1126 | + //init_pl_embed.controls=true; |
1130 | 1127 | //if(this.pp.sequencer=='true'){ |
1131 | 1128 | init_pl_embed.embed_link=null; |
1132 | | - init_pl_embed.linkback=null; |
| 1129 | + init_pl_embed.linkback=null; |
| 1130 | + |
1133 | 1131 | |
1134 | 1132 | if(this.poster)init_pl_embed['thumbnail']=this.poster; |
1135 | 1133 | |
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | /* |
3 | 3 | * handles driving the firefogg render system |
4 | 4 | */ |
5 | | - |
6 | 5 | var mvFirefoggRender = function( iObj ) { |
7 | 6 | return this.init( iObj ); |
8 | 7 | }; |
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvSequencer.js |
— | — | @@ -114,8 +114,8 @@ |
115 | 115 | //trackObj used to payload playlist Track Object (when inline not present) |
116 | 116 | tracks:{} |
117 | 117 | } |
118 | | -var mvSequencer = function(iObj) { |
119 | | - return this.init(iObj); |
| 118 | +var mvSequencer = function( iObj ) { |
| 119 | + return this.init( iObj ); |
120 | 120 | }; |
121 | 121 | //set up the mvSequencer object |
122 | 122 | mvSequencer.prototype = { |
— | — | @@ -215,9 +215,9 @@ |
216 | 216 | //add the container divs (with basic layout ~universal~ |
217 | 217 | $j(this.target_sequence_container).html(''+ |
218 | 218 | '<div id="' + this.video_container_id + '" style="position:absolute;right:0px;top:0px;' + |
219 | | - 'width:' + this.video_width + 'px;height:'+this.video_height+'px;border:solid thin blue;background:#FFF;font-color:black;"/>'+ |
| 219 | + 'width:' + this.video_width + 'px;height:' + (this.video_height+54) + 'px;"/>'+ |
220 | 220 | '<div id="' + this.timeline_id + '" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;' + |
221 | | - 'left:0px;right:0px;top:'+(this.video_height+34)+'px;bottom:35px;overflow:auto;">'+ |
| 221 | + 'left:0px;right:0px;top:'+(this.video_height+60)+'px;bottom:35px;overflow:auto;">'+ |
222 | 222 | gM('mwe-loading_timeline')+ '</div>'+ |
223 | 223 | '<div class="seq_status" style="position:absolute;left:0px;width:300px;"></div>'+ |
224 | 224 | '<div class="seq_save_cancel" style="position:absolute;'+ |
— | — | @@ -228,7 +228,7 @@ |
229 | 229 | gM('mwe-sequencer_credit_line') + |
230 | 230 | '</div>'+ |
231 | 231 | '<div id="'+this.sequence_tools_id+'" style="position:absolute;' + |
232 | | - 'left:0px;right:'+(this.video_width+15)+'px;top:0px;height:'+(this.video_height+23)+'px;"/>' |
| 232 | + 'left:0px;right:'+(this.video_width+10)+'px;top:0px;height:'+(this.video_height+47)+'px;"/>' |
233 | 233 | ).css({ |
234 | 234 | 'min-width':'850px' |
235 | 235 | }); |
— | — | @@ -236,9 +236,9 @@ |
237 | 237 | /*js_log('set: '+this.target_sequence_container + ' html to:'+ "\n"+ |
238 | 238 | $j(this.target_sequence_container).html() |
239 | 239 | );*/ |
| 240 | + |
240 | 241 | //first check if we got a cloned PL object: |
241 | 242 | //(when the editor is invoked with the plalylist already on the page) |
242 | | - //@@NOT WORKING... (need a better "clone" function) |
243 | 243 | /*if( this.plObj != 'null' ){ |
244 | 244 | js_log('found plObj clone'); |
245 | 245 | //extend with mvSeqPlayList object: |
— | — | @@ -260,7 +260,7 @@ |
261 | 261 | } |
262 | 262 | $j('#'+this.video_container_id).html('<playlist ' + src_attr + |
263 | 263 | ' style="width:' + this.video_width + 'px;height:' + this.video_height + 'px;" '+ |
264 | | - ' controls="false" id="' + this.plObj_id + '" />'); |
| 264 | + ' sequencer="true" id="' + this.plObj_id + '" />'); |
265 | 265 | rewrite_by_id( this.plObj_id ); |
266 | 266 | setTimeout(this.instance_name +'.checkReadyPlObj()', 25); |
267 | 267 | }, |
— | — | @@ -297,7 +297,7 @@ |
298 | 298 | bConf[ gM('mwe-cancel') ] = function(){ |
299 | 299 | $j(this).dialog('close'); |
300 | 300 | }; |
301 | | - bConf[ gm('mwe-edit_save') ] = function(){ |
| 301 | + bConf[ gM('mwe-edit_save') ] = function(){ |
302 | 302 | var saveReq = { |
303 | 303 | 'action' : 'edit', |
304 | 304 | 'title' : _this.plObj.mTitle, |
— | — | @@ -1435,7 +1435,7 @@ |
1436 | 1436 | $j(this.target_sequence_container).append('<div id="'+ this.timeline_id +'_pl_control"'+ |
1437 | 1437 | ' style="position:absolute;top:' + (this.plObj.height) +'px;'+ |
1438 | 1438 | 'right:1px;width:'+this.plObj.width+'px;height:'+this.plObj.org_control_height+'" '+ |
1439 | | - 'class="' + this.plObj.ctrlBuilder.pClass + '"><div class="ui-widget ui-corner-bottom ui-state-default controls">'+ |
| 1439 | + 'class="' + this.plObj.ctrlBuilder.pClass + '"><div class="ui-widget ui-corner-bottom ui-state-default control-bar">'+ |
1440 | 1440 | this.plObj.getControlsHTML() + |
1441 | 1441 | '</div>'+ |
1442 | 1442 | '</div>'); |
— | — | @@ -1443,7 +1443,7 @@ |
1444 | 1444 | this.plObj.updateBaseStatus(); |
1445 | 1445 | |
1446 | 1446 | //once the controls are in the DOM add hooks: |
1447 | | - this.plObj.ctrlBuilder.addControlHooks(this.plObj); |
| 1447 | + this.plObj.ctrlBuilder.addControlHooks( $j('#' + this.timeline_id + '_pl_control' ) ); |
1448 | 1448 | |
1449 | 1449 | //render out the "jump" div |
1450 | 1450 | if(this.timeline_mode=='time'){ |
— | — | @@ -1499,7 +1499,7 @@ |
1500 | 1500 | //refresh player: |
1501 | 1501 | this.plObj.getHTML(); |
1502 | 1502 | |
1503 | | - this.render_playheadhead_seeker(); |
| 1503 | + //this.render_playheadhead_seeker(); |
1504 | 1504 | this.render_tracks(); |
1505 | 1505 | this.jt(this.playline_time); |
1506 | 1506 | |
Index: trunk/phase3/js2/mwEmbed/tests/testLang.html |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | } |
10 | 10 | </style> |
11 | 11 | <script type="text/javascript" > |
12 | | -var scriptLoaderURID = 't10'; |
| 12 | +var scriptLoaderURID = 't11'; |
13 | 13 | //for just setting one or two to test at a time for debug |
14 | 14 | var langKeyDebug = ['fr']; |
15 | 15 | |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | 'zero' => 0, |
27 | 27 | 'one' => 1, |
28 | 28 | 'two' => 2, |
29 | | - //n mod 100 in 3..10 |
| 29 | + //n mod 100 in 3..10 |
30 | 30 | 'few' => array( 'mod' => 100, 'is'=>'3-10' ), |
31 | 31 | //n mod 100 in 11..99 |
32 | 32 | 'many' => array( 'mod' => 100, 'is'=>'11-99') |
Index: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js |
— | — | @@ -30,7 +30,8 @@ |
31 | 31 | "mwe-preview_inout" : "Preview in-out points", |
32 | 32 | "mwe-edit-tools" : "Edit tools", |
33 | 33 | "mwe-inline-description" : "Inline description", |
34 | | - "mwe-edit-video-tools" : "Edit video tools:" |
| 34 | + "mwe-edit-video-tools" : "Edit video tools:", |
| 35 | + "mwe-duration" : "Duration:" |
35 | 36 | }); |
36 | 37 | |
37 | 38 | var default_clipedit_values = { |
— | — | @@ -102,22 +103,25 @@ |
103 | 104 | 'duration':{ |
104 | 105 | 'media':['image','template'], |
105 | 106 | 'doEdit':function( _this, target ){ |
106 | | - //(_this is a smilClip instance) |
107 | | - //do clock mouse scroll duration editor |
| 107 | + function doUpdateDur( inputElm ){ |
| 108 | + js_log("update duration:" + $j( inputElm ).val() ); |
| 109 | + //update the parent sequence object: |
| 110 | + _this.rObj.dur = smilParseTime( $j( inputElm ).val() ); |
| 111 | + //update the playlist: |
| 112 | + _this.p_seqObj.do_refresh_timeline( true ); |
| 113 | + } |
| 114 | + |
108 | 115 | $j(target).html( |
109 | | - '<label for="ce_dur">Duration: </label>' + |
| 116 | + '<label for="ce_dur">' + gM('mwe-duration') + '</label>' + |
110 | 117 | '<input name="ce_dur" tabindex="1" maxlength="11" value="'+ |
111 | 118 | seconds2npt( _this.rObj.getDuration() )+ |
112 | 119 | '" size="10"/>'+ |
113 | 120 | '</div>' |
114 | 121 | ).children("input[name='ce_dur']").change(function(){ |
115 | | - js_log("update duration:" + $j(this).val() ); |
116 | | - //update the parent sequence object: |
117 | | - _this.rObj.dur = smilParseTime( $j(this).val() ); |
118 | | - //update the playlist: |
119 | | - _this.p_seqObj.do_refresh_timeline( true ); |
| 122 | + doUpdateDur(this); |
120 | 123 | }); |
121 | | - |
| 124 | + //Strange can't chain this binding for some reason... |
| 125 | + $j(target).find("input[name='ce_dur']").upDownTimeInputBind( doUpdateDur ); |
122 | 126 | } |
123 | 127 | }, |
124 | 128 | 'inoutpoints':{ |
— | — | @@ -144,7 +148,7 @@ |
145 | 149 | 'fileopts':{ |
146 | 150 | 'media':['image','video','template'], |
147 | 151 | 'doEdit':function(_this, target ){ |
148 | | - //if media type is template we have to query to get its URI to get its paramaters |
| 152 | + //if media type is template we have to query to get its URI to get its parameters |
149 | 153 | if(_this.media_type == 'template' && !_this.rObj.tVars){ |
150 | 154 | mv_set_loading('#sub_cliplib_ic'); |
151 | 155 | var reqObj ={ 'action':'query', |
— | — | @@ -391,9 +395,11 @@ |
392 | 396 | }, |
393 | 397 | setInOutBindings:function(){ |
394 | 398 | var _this = this; |
| 399 | + //setup a top level shortcut: |
| 400 | + var $tp = $j('#'+this.control_ct); |
395 | 401 | |
396 | | - var start_sec = npt2seconds($j('#'+this.control_ct + ' .startInOut').val() ); |
397 | | - var end_sec = npt2seconds($j('#'+this.control_ct + ' .endInOut').val() ); |
| 402 | + var start_sec = npt2seconds( $tp.find('.startInOut').val() ); |
| 403 | + var end_sec = npt2seconds( $tp.find('.endInOut').val() ); |
398 | 404 | |
399 | 405 | //if we don't have 0 as start then assume we are in a range request and give some buffer area: |
400 | 406 | var min_slider = (start_sec - 60 < 0 ) ? 0 : start_sec - 60; |
— | — | @@ -403,23 +409,49 @@ |
404 | 410 | max_slider = end_sec; |
405 | 411 | } |
406 | 412 | |
407 | | - $j('#'+this.control_ct + ' .inOutSlider').slider({ |
| 413 | + $tp.find('.inOutSlider').slider({ |
408 | 414 | range: true, |
409 | 415 | min: min_slider, |
410 | 416 | max: max_slider, |
| 417 | + animate: true, |
411 | 418 | values: [start_sec, end_sec], |
412 | 419 | slide: function(event, ui) { |
413 | 420 | //js_log(" vals:"+ seconds2npt( ui.values[0] ) + ' : ' + seconds2npt( ui.values[1]) ); |
414 | | - $j('#'+_this.control_ct + ' .startInOut').val( seconds2npt( ui.values[0] ) ); |
415 | | - $j('#'+_this.control_ct + ' .endInOut').val( seconds2npt( ui.values[1] ) ); |
| 421 | + $tp.find('.startInOut').val( seconds2npt( ui.values[0] ) ); |
| 422 | + $tp.find('.endInOut').val( seconds2npt( ui.values[1] ) ); |
416 | 423 | }, |
417 | 424 | change:function(event, ui){ |
418 | 425 | do_video_time_update( seconds2npt( ui.values[0]), seconds2npt( ui.values[1] ) ); |
419 | 426 | } |
| 427 | + }); |
| 428 | + |
| 429 | + //bind up and down press when focus on start or end |
| 430 | + $tp.find('.startInOut').upDownTimeInputBind( function( inputElm ){ |
| 431 | + var s_sec = npt2seconds( $j( inputElm ).val() ); |
| 432 | + var e_sec = npt2seconds( $tp.find('.endInOut').val() ) |
| 433 | + if( s_sec > e_sec ) |
| 434 | + $j( inputElm ).val( seconds2npt( e_sec - 1 ) ); |
| 435 | + //update the slider: |
| 436 | + var values = $tp.find('.inOutSlider').slider('option', 'values'); |
| 437 | + js_log('in slider len: ' + $tp.find('.inOutSlider').length); |
| 438 | + //set to 5 |
| 439 | + $tp.find('.inOutSlider').slider('value', 10 ); |
| 440 | + debugger; |
| 441 | + $tp.find('.inOutSlider').slider('option', 'values', [s_sec, e_sec] ); |
| 442 | + var values = $tp.find('.inOutSlider').slider('option', 'values'); |
| 443 | + js_log('values (after update):' + values ); |
420 | 444 | }); |
421 | | - |
| 445 | + $tp.find('.endInOut').upDownTimeInputBind( function( inputElm ){ |
| 446 | + var s_sec = npt2seconds( $tp.find('.startInOut').val() ); |
| 447 | + var e_sec = npt2seconds( $j( inputElm ).val() ); |
| 448 | + if( e_sec < s_sec ) |
| 449 | + $j( inputElm ).val( seconds2npt( s_sec + 1 ) ); |
| 450 | + //update the slider: |
| 451 | + $tp.find('.inOutSlider').slider('option', 'values', [ s_sec, e_sec ]); |
| 452 | + }); |
| 453 | + |
422 | 454 | //preview button: |
423 | | - $j('#'+this.control_ct + ' .inOutPreviewClip').btnBind().click(function(){ |
| 455 | + $j('#'+this.control_ct + ' .inOutPreviewClip').btnBind().click(function(){ |
424 | 456 | $j('#embed_vid').get(0).stop(); |
425 | 457 | $j('#embed_vid').get(0).play(); |
426 | 458 | }); |
— | — | @@ -429,14 +461,14 @@ |
430 | 462 | return '<strong>' + gM('mwe-set_in_out_points') + '</strong>'+ |
431 | 463 | '<table border="0" style="background: transparent; width:94%;height:50px;">'+ |
432 | 464 | '<tr>' + |
433 | | - '<td style="width:55px">'+ |
| 465 | + '<td style="width:90px">'+ |
434 | 466 | gM('mwe-start_time') + |
435 | 467 | '<input class="ui-widget-content ui-corner-all startInOut" size="9" value="' + setInt.start_ntp +'">'+ |
436 | 468 | '</td>' + |
437 | 469 | '<td>' + |
438 | 470 | '<div class="inOutSlider"></div>'+ |
439 | 471 | '</td>' + |
440 | | - '<td style="width:55px">'+ |
| 472 | + '<td style="width:90px;text-align:right;">'+ |
441 | 473 | gM('mwe-end_time') + |
442 | 474 | '<input class="ui-widget-content ui-corner-all endInOut" size="9" value="'+ setInt.end_ntp +'">'+ |
443 | 475 | '</td>' + |
— | — | @@ -599,14 +631,14 @@ |
600 | 632 | }, |
601 | 633 | applyVideoAdj:function(){ |
602 | 634 | js_log('applyVideoAdj::'); |
| 635 | + $tp = $j('#'+this.control_ct ); |
603 | 636 | |
604 | 637 | //be sure to "stop the video (some plugins can't have DOM elements on top of them) |
605 | 638 | $j('#embed_vid').get(0).stop(); |
606 | 639 | |
607 | | - //update video related keys: |
608 | | - ; |
609 | | - this.rObj['start_time'] = $j('#'+this.control_ct + ' .startInOut').val(); |
610 | | - this.rObj['end_time'] = $j('#'+this.control_ct + ' .endInOut').val() ; |
| 640 | + //update video related keys |
| 641 | + this.rObj['start_time'] = $tp.find('.startInOut').val(); |
| 642 | + this.rObj['end_time'] = $tp.find('.endInOut').val() ; |
611 | 643 | |
612 | 644 | //do the local video adjust |
613 | 645 | if(typeof this.rObj.pSobj['applyVideoAdj'] != 'undefined'){ |
— | — | @@ -621,7 +653,7 @@ |
622 | 654 | js_log( 'click:turn off' ); |
623 | 655 | var cat = _this.rObj; |
624 | 656 | if(_this.rObj.crop){ |
625 | | - //empty out and display croped: |
| 657 | + //empty out and display cropped: |
626 | 658 | $j('#'+_this.clip_disp_ct ).empty().html( |
627 | 659 | '<div id="mv_cropcotainer" style="overflow:hidden;position:absolute;'+ |
628 | 660 | 'width:' + _this.rObj.crop.w + 'px;'+ |
— | — | @@ -674,16 +706,6 @@ |
675 | 707 | mv_lock_vid_updates= false; |
676 | 708 | |
677 | 709 | function add_adjust_hooks(mvd_id, adj_callback){ |
678 | | - /*myClipEdit = new mvClipEdit({ |
679 | | - 'control_ct': '#mvd_form_'+mvd_id |
680 | | - }); |
681 | | - $j('#mvd_form_'+mvd_id).html( |
682 | | - mvClipEdit.getSetInOutHtml({ |
683 | | - 'start_ntp' : $j('#mv_start_hr_' + mvd_id).val(), |
684 | | - 'end_ntp' : $j('#mv_end_hr_' + mvd_id).val() |
685 | | - }) |
686 | | - ); |
687 | | - mvClipEdit.setInOutBindings();*/ |
688 | 710 | |
689 | 711 | var start_sec = npt2seconds($j('#mv_start_hr_' + mvd_id).val() ); |
690 | 712 | var end_sec = npt2seconds($j('#mv_end_hr_' + mvd_id).val() ); |
— | — | @@ -709,7 +731,7 @@ |
710 | 732 | change:function(event, ui){ |
711 | 733 | do_video_time_update( seconds2npt( ui.values[0]), seconds2npt( ui.values[1] ) ); |
712 | 734 | } |
713 | | - }); |
| 735 | + }); |
714 | 736 | $j('.mv_adj_hr').change(function(){ |
715 | 737 | //preserve track duration for nav and seq: |
716 | 738 | //ie seems to crash so no interface updates for IE for the time being |
— | — | @@ -727,8 +749,7 @@ |
728 | 750 | |
729 | 751 | function do_video_time_update(start_time, end_time, mvd_id) { |
730 | 752 | js_log('do_video_time_update: ' +start_time +' '+ end_time); |
731 | | - |
732 | | - if(mv_lock_vid_updates==false){ |
| 753 | + if( mv_lock_vid_updates == false ){ |
733 | 754 | //update the vid title: |
734 | 755 | $j('#mv_videoPlayerTime').html( start_time + ' to ' + end_time ); |
735 | 756 | var ebvid = $j('#embed_vid').get(0); |
— | — | @@ -740,4 +761,38 @@ |
741 | 762 | ebvid.updateThumbTimeNTP( start_time ); |
742 | 763 | } |
743 | 764 | } |
744 | | -} |
\ No newline at end of file |
| 765 | +} |
| 766 | + |
| 767 | +//some custom jquery bindings: |
| 768 | +(function( $ ) { |
| 769 | + $.fn.upDownTimeInputBind = function( inputCB ){ |
| 770 | + $( this.selector ).unbind('focus').focus(function(){ |
| 771 | + var doDelayCall = true; |
| 772 | + $(this).addClass('ui-state-focus'); |
| 773 | + //bind up down keys |
| 774 | + $(this).unbind('keydown').keydown(function (e) { |
| 775 | + var sec = npt2seconds( $j(this).val() ); |
| 776 | + var k = e.which; |
| 777 | + if(k == 38 ){//up |
| 778 | + $(this).val( seconds2npt( sec + 1 ) ); |
| 779 | + }else if( k == 40 ){ //down |
| 780 | + var sval = ( (sec - 1) < 0 ) ? 0 : (sec - 1) |
| 781 | + $(this).val( seconds2npt( sval ) ); |
| 782 | + } |
| 783 | + //set the delay updates: |
| 784 | + if(k == 38 || k == 40){ |
| 785 | + var _inputElm = this; |
| 786 | + if(doDelayCall){ |
| 787 | + setTimeout(function(){ |
| 788 | + inputCB( _inputElm ); |
| 789 | + doDelayCall = true; |
| 790 | + },500); |
| 791 | + doDelayCall = false; |
| 792 | + } |
| 793 | + } |
| 794 | + }); |
| 795 | + }).unbind('blur').blur(function(){ |
| 796 | + $(this).removeClass('ui-state-focus'); |
| 797 | + }); |
| 798 | + } |
| 799 | +})(jQuery); |
Index: trunk/phase3/js2/mwEmbed/skins/kskin/playerSkin.css |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | font: 11px arial, sans-serif; |
96 | 96 | line-height: 20px; |
97 | 97 | overflow: hidden; |
98 | | - width: 36px; |
| 98 | + width: 39px; |
99 | 99 | float: right; |
100 | 100 | } |
101 | 101 | |
Index: trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js |
— | — | @@ -93,18 +93,16 @@ |
94 | 94 | * addControlHooks |
95 | 95 | * to be run once controls are attached to the dom |
96 | 96 | */ |
97 | | - addControlHooks:function(){ |
| 97 | + addControlHooks:function( $tp ){ |
98 | 98 | //set up local pointer to the embedObj |
99 | 99 | var embedObj = this.embedObj; |
100 | | - var _this = this; |
101 | | - //add in drag/seek hooks: |
102 | | - if(!embedObj.base_seeker_slider_offset && $j('#mv_seeker_slider_'+embedObj.id).get(0)) |
103 | | - embedObj.base_seeker_slider_offset = $j('#mv_seeker_slider_'+embedObj.id).get(0).offsetLeft; |
104 | | - |
105 | | - //js_log('looking for: #mv_seeker_slider_'+embedObj.id + "\n " + |
106 | | - // 'start sec: '+embedObj.start_time_sec + ' base offset: '+embedObj.base_seeker_slider_offset); |
107 | | - var $tp=$j('#' + embedObj.id); |
| 100 | + var _this = this; |
| 101 | + //var embed_id = (embedObj.pc!=null)?embedObj.pc.pp.id:embedObj.id; |
| 102 | + |
| 103 | + if( !$tp ) |
| 104 | + $tp = $j( '#' + embedObj.id ); |
108 | 105 | |
| 106 | + |
109 | 107 | //add play hook: |
110 | 108 | $tp.find('.play-btn').unbind().btnBind().click(function(){ |
111 | 109 | $j('#' + embedObj.id).get(0).play(); |
— | — | @@ -171,7 +169,7 @@ |
172 | 170 | $j('#' +embedObj.id).get(0).fullscreen(); |
173 | 171 | }); |
174 | 172 | |
175 | | - js_log(" should add slider binding: " + $j('#'+embedObj.id + ' .play_head').length) ; |
| 173 | + js_log(" should add slider binding: " + $tp.find('.play_head').length) ; |
176 | 174 | $tp.find('.play_head').slider({ |
177 | 175 | range: "min", |
178 | 176 | value: 0, |
Index: trunk/phase3/js2/mwEmbed/skins/mvpcf/playerSkin.css |
— | — | @@ -109,7 +109,7 @@ |
110 | 110 | .mv-player .vol_container_top{ |
111 | 111 | top:-77px; |
112 | 112 | } |
113 | | -.mv-player .vol_container .volume-slider{ |
| 113 | +. ayer .vol_container .volume-slider{ |
114 | 114 | margin-top:5px; |
115 | 115 | height:65px; |
116 | 116 | width:10px; |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | height: 29px; |
131 | 131 | overflow: visible; |
132 | 132 | font-size: 10.2px; |
133 | | - width: 80px; |
| 133 | + width: 85px; |
134 | 134 | float: right; |
135 | 135 | display: inline; |
136 | 136 | border:none; |
— | — | @@ -140,7 +140,8 @@ |
141 | 141 | display: inline; |
142 | 142 | height: 10px; |
143 | 143 | margin-left:10px; |
144 | | - margin-top:10px; |
| 144 | + margin-top:10px; |
| 145 | + position:relative; |
145 | 146 | } |
146 | 147 | |
147 | 148 | .mv-player .play_head .ui-slider-handle{ |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -1679,7 +1679,7 @@ |
1680 | 1680 | return js_error( 'Error: request paramaters must be an object' ); |
1681 | 1681 | } |
1682 | 1682 | // Generate the URL if it's missing |
1683 | | - if( typeof options.url == 'undefined' || options.url === false ) { |
| 1683 | + if( typeof options.url == 'undefined' || !options.url ) { |
1684 | 1684 | if( !wgServer || ! wgScriptPath ) { |
1685 | 1685 | return js_error('Error: no api url for api request'); |
1686 | 1686 | } |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -1416,7 +1416,7 @@ |
1417 | 1417 | this.paused = true; |
1418 | 1418 | this.thumbnail_disp = true; |
1419 | 1419 | //make sure the ctrlBuilder remain active: |
1420 | | - this.ctrlBuilder.addControlHooks(this); |
| 1420 | + this.ctrlBuilder.addControlHooks(); |
1421 | 1421 | }, |
1422 | 1422 | refreshControlsHTML:function(){ |
1423 | 1423 | js_log('refreshControlsHTML::'); |
— | — | @@ -1426,7 +1426,7 @@ |
1427 | 1427 | return ; |
1428 | 1428 | }else{ |
1429 | 1429 | $j('#' + this.id + ' .control-bar').html( this.getControlsHTML() ); |
1430 | | - this.ctrlBuilder.addControlHooks(this); |
| 1430 | + this.ctrlBuilder.addControlHooks(); |
1431 | 1431 | } |
1432 | 1432 | }, |
1433 | 1433 | getControlsHTML:function() |
— | — | @@ -1462,7 +1462,7 @@ |
1463 | 1463 | //js_log('should set: '+this.id); |
1464 | 1464 | $j(this).html( html_code ); |
1465 | 1465 | //add hooks once Controls are in DOM |
1466 | | - this.ctrlBuilder.addControlHooks(this); |
| 1466 | + this.ctrlBuilder.addControlHooks(); |
1467 | 1467 | |
1468 | 1468 | //js_log('set this to: ' + $j(this).html() ); |
1469 | 1469 | //alert('stop'); |
— | — | @@ -2334,12 +2334,9 @@ |
2335 | 2335 | }, |
2336 | 2336 | addPlayer : function(player, mime_type) |
2337 | 2337 | { |
2338 | | - //js_log('Adding ' + player.id + ' with mime_type ' + mime_type); |
2339 | 2338 | for (var i =0; i < this.players.length; i++){ |
2340 | | - if (this.players[i].id == player.id) |
2341 | | - { |
2342 | | - if(mime_type!=null) |
2343 | | - { |
| 2339 | + if (this.players[i].id == player.id){ |
| 2340 | + if(mime_type!=null){ |
2344 | 2341 | //make sure the mime_type is not already there: |
2345 | 2342 | var add_mime = true; |
2346 | 2343 | for(var j=0; j < this.players[i].supported_types.length; j++ ){ |
— | — | @@ -2347,15 +2344,16 @@ |
2348 | 2345 | add_mime=false; |
2349 | 2346 | } |
2350 | 2347 | if(add_mime) |
2351 | | - this.players[i].supported_types.push(mime_type); |
| 2348 | + this.players[i].supported_types.push( mime_type ); |
2352 | 2349 | } |
2353 | | - return; |
| 2350 | + return ; |
2354 | 2351 | } |
2355 | 2352 | } |
2356 | 2353 | //player not found: |
2357 | | - if(mime_type!=null) |
2358 | | - player.supported_types.push(mime_type); |
2359 | | - |
| 2354 | + if( mime_type != null ) |
| 2355 | + player.supported_types.push(mime_type); |
| 2356 | + |
| 2357 | + js_log('Adding ' + player.id + ' with mime_type ' + mime_type); |
2360 | 2358 | this.players.push( player ); |
2361 | 2359 | }, |
2362 | 2360 | getMIMETypePlayers : function(mime_type) |
— | — | @@ -2483,15 +2481,13 @@ |
2484 | 2482 | this.players.addPlayer( htmlPlayer ); |
2485 | 2483 | // In Mozilla, navigator.javaEnabled() only tells us about preferences, we need to |
2486 | 2484 | // search navigator.mimeTypes to see if it's installed |
2487 | | - var javaEnabled = navigator.javaEnabled(); |
2488 | | - // In Opera, navigator.javaEnabled() is all there is |
2489 | | - var invisibleJava = $j.browser.opera; |
| 2485 | + var javaEnabled = navigator.javaEnabled(); |
2490 | 2486 | // Some browsers filter out duplicate mime types, hiding some plugins |
2491 | | - var uniqueMimesOnly = $j.browser.opera || $j.browser.safari; |
| 2487 | + var uniqueMimesOnly = $j.browser.opera || $j.browser.safari; |
2492 | 2488 | // Opera will switch off javaEnabled in preferences if java can't be found. |
2493 | 2489 | // And it doesn't register an application/x-java-applet mime type like Mozilla does. |
2494 | | - if ( invisibleJava && javaEnabled ) |
2495 | | - this.players.addPlayer( cortadoPlayer ); |
| 2490 | + if ( javaEnabled ) |
| 2491 | + this.players.addPlayer( cortadoPlayer ); |
2496 | 2492 | |
2497 | 2493 | // ActiveX plugins |
2498 | 2494 | if($j.browser.msie){ |
— | — | @@ -2518,10 +2514,11 @@ |
2519 | 2515 | // VLC |
2520 | 2516 | if ( this.testActiveX( 'VideoLAN.VLCPlugin.2' ) ) |
2521 | 2517 | this.players.addPlayer(vlcActiveXPlayer); |
2522 | | - // Java |
2523 | | - if ( javaEnabled && this.testActiveX( 'JavaWebStart.isInstalled' ) ) |
2524 | | - this.players.addPlayer(cortadoPlayer); |
2525 | | - // quicktime |
| 2518 | + |
| 2519 | + // Java ActiveX |
| 2520 | + if ( this.testActiveX( 'JavaWebStart.isInstalled' ) ) |
| 2521 | + this.players.addPlayer( cortadoPlayer ); |
| 2522 | + // quicktime (currently off) |
2526 | 2523 | //if ( this.testActiveX( 'QuickTimeCheckObject.QuickTimeCheck.1' ) ) |
2527 | 2524 | // this.players.addPlayer(quicktimeActiveXPlayer); |
2528 | 2525 | } |
— | — | @@ -2551,7 +2548,7 @@ |
2552 | 2549 | } |
2553 | 2550 | } |
2554 | 2551 | |
2555 | | - // Mozilla plugins |
| 2552 | + // "navigator" plugins |
2556 | 2553 | if( navigator.mimeTypes && navigator.mimeTypes.length > 0) { |
2557 | 2554 | for ( var i = 0; i < navigator.mimeTypes.length; i++ ) { |
2558 | 2555 | var type = navigator.mimeTypes[i].type; |
— | — | @@ -2570,8 +2567,8 @@ |
2571 | 2568 | continue; |
2572 | 2569 | } |
2573 | 2570 | |
2574 | | - if ( javaEnabled || type == 'application/x-java-applet' ) { |
2575 | | - this.players.addPlayer(cortadoPlayer); |
| 2571 | + if ( type == 'application/x-java-applet' ) { |
| 2572 | + this.players.addPlayer( cortadoPlayer ); |
2576 | 2573 | continue; |
2577 | 2574 | } |
2578 | 2575 | |