r58524 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58523‎ | r58524 | r58525 >
Date:11:24, 4 November 2009
Author:dale
Status:deferred
Tags:
Comment:
* sequencer updates / other small fixes
Modified paths:
  • /trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libSequencer/mvPlayList.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libSequencer/mvSequencer.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/mv_embed.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/kskin/playerSkin.css (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/mvpcf/playerSkin.css (modified) (history)
  • /trunk/phase3/js2/mwEmbed/tests/testLang.html (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/example_usage/Player_Themable.html
@@ -7,7 +7,7 @@
88 </head>
99 <script type="text/javascript">
1010 </script>
11 -<body bgcolor="#FFF">
 11+<body>
1212 <h3> Sample Themable Player:</h3>
1313 To play with dynamic Themes install <a href="http://jqueryui.com/themeroller/developertool/">Themeroller</a><p><p>
1414
Index: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js
@@ -188,10 +188,9 @@
189189 // or better improve the wiki-text parsing and use above
190190 var desc = rObj.desc.match(/\|\s*description\s*=\s*(([^\n]*\n)*)\|\s*source=/i);
191191 if( desc && desc[1] ){
192 - rObj.desc = $j.trim( desc[1] );
193 - var cat = wgUserLanguage;
 192+ rObj.desc = $j.trim( desc[1] );
194193 //attempt to get the user language if set:
195 - if( wgUserLanguage ){
 194+ if( typeof wgUserLanguage != 'undefined' && wgUserLanguage ){
196195 //for some reason the RegExp object is not happy:
197196 var reg = new RegExp( '\{\{\s*' + wgUserLanguage + '([^=]*)=([^\}]*)\}\}', 'gim' );
198197 var langMatch = reg.exec( rObj.desc );
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -1557,7 +1557,7 @@
15581558 }
15591559 },
15601560 checkForFile:function( fName, callback){
1561 - js_log("checkForFile::");
 1561+ js_log("checkForFile::" + fName );
15621562 var _this = this;
15631563 reqObj={
15641564 'action':'query',
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvPlayList.js
@@ -154,7 +154,8 @@
155155 * this_plObj_Clone.sequencer=true;
156156 * this_plObj_Clone.id= 'seq_plobj';
157157 * debugger;
158 - */
 158+ */
 159+
159160 //load sequencer:
160161 $j("#sequencer_target").sequencer({
161162 "mv_pl_src" : this.src
@@ -412,36 +413,31 @@
413414 }
414415 },
415416 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;
423419
424420 //append container and videoPlayer;
425421 $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;">' +
427424 '</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;
429429 //append title:
430430 $j('#dc_'+_this.id).append(
431431 '<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">' +
433433 '<div class="ui-widget-header ui-helper-clearfix control-bar" '+
434434 'style="width:' + _this.width + 'px" >' +
435435 _this.getControlsHTML() +
436436 '</div>'+
437437 '</div>'
438438 );
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( );
446442 }else{
447443 //just append the video:
448444 $j('#dc_'+_this.id).append(
@@ -467,9 +463,10 @@
468464 cout+='"></div>';
469465 $j('#dc_'+_this.id).append( cout );
470466 //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;
474471
475472 clip.embed.getHTML();//get the thubnails for everything
476473
@@ -524,15 +521,14 @@
525522 updateBaseStatus:function(){
526523 var _this = this;
527524 js_log('Playlist:updateBaseStatus');
 525+
528526 $j('#ptitle_'+this.id).html(''+
529527 '<b>' + this.title + '</b> '+
530528 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>');
534530
535531 //should probably be based on if we have a provider api url
536 - if( typeof wgEnableWriteAPI != 'undefined'){
 532+ if( typeof wgEnableWriteAPI != 'undefined' && !this.sequencer ){
537533 $j( $j.btnHtml('edit', 'editBtn_'+this.id, 'pencil',
538534 {'style':'position:absolute;right:0;;font-size:x-small;height:10px;margin-bottom:0;padding-bottom:7px;padding-top:0;'} )
539535 ).click(function(){
@@ -549,17 +545,18 @@
550546 },
551547 /*setStatus override (could call the jquery directly) */
552548 setStatus:function(value){
553 - $j('#mv_time_'+this.id).html( value );
 549+ $j('#'+this.id + ' .time-disp' ).text( value );
554550 },
555551 setSliderValue:function(value){
556552 //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 );
558555 $j('#' + this.id + ' .play_head').slider('value', val);
559556 },
560557 getPlayHeadPos: function(prec_done){
561558 var _this = this;
562559 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' );
564561 return 0;
565562 }
566563 var track_len = $j('#mv_seeker_'+this.id).css('width').replace(/px/, '');
@@ -714,7 +711,7 @@
715712 //playlist play
716713 play: function(){
717714 var _this=this;
718 - //js_log('pl play');
 715+ js_log('pl play');
719716 //hide the playlist play button:
720717 $j(this.id + ' .play-btn-large').hide();
721718
@@ -1125,10 +1122,11 @@
11261123
11271124 //if in sequence mode hide controls / embed links
11281125 // init_pl_embed.play_button=false;
1129 - init_pl_embed.controls=false;
 1126+ //init_pl_embed.controls=true;
11301127 //if(this.pp.sequencer=='true'){
11311128 init_pl_embed.embed_link=null;
1132 - init_pl_embed.linkback=null;
 1129+ init_pl_embed.linkback=null;
 1130+
11331131
11341132 if(this.poster)init_pl_embed['thumbnail']=this.poster;
11351133
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js
@@ -1,7 +1,6 @@
22 /*
33 * handles driving the firefogg render system
44 */
5 -
65 var mvFirefoggRender = function( iObj ) {
76 return this.init( iObj );
87 };
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvSequencer.js
@@ -114,8 +114,8 @@
115115 //trackObj used to payload playlist Track Object (when inline not present)
116116 tracks:{}
117117 }
118 -var mvSequencer = function(iObj) {
119 - return this.init(iObj);
 118+var mvSequencer = function( iObj ) {
 119+ return this.init( iObj );
120120 };
121121 //set up the mvSequencer object
122122 mvSequencer.prototype = {
@@ -215,9 +215,9 @@
216216 //add the container divs (with basic layout ~universal~
217217 $j(this.target_sequence_container).html(''+
218218 '<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;"/>'+
220220 '<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;">'+
222222 gM('mwe-loading_timeline')+ '</div>'+
223223 '<div class="seq_status" style="position:absolute;left:0px;width:300px;"></div>'+
224224 '<div class="seq_save_cancel" style="position:absolute;'+
@@ -228,7 +228,7 @@
229229 gM('mwe-sequencer_credit_line') +
230230 '</div>'+
231231 '<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;"/>'
233233 ).css({
234234 'min-width':'850px'
235235 });
@@ -236,9 +236,9 @@
237237 /*js_log('set: '+this.target_sequence_container + ' html to:'+ "\n"+
238238 $j(this.target_sequence_container).html()
239239 );*/
 240+
240241 //first check if we got a cloned PL object:
241242 //(when the editor is invoked with the plalylist already on the page)
242 - //@@NOT WORKING... (need a better "clone" function)
243243 /*if( this.plObj != 'null' ){
244244 js_log('found plObj clone');
245245 //extend with mvSeqPlayList object:
@@ -260,7 +260,7 @@
261261 }
262262 $j('#'+this.video_container_id).html('<playlist ' + src_attr +
263263 ' 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 + '" />');
265265 rewrite_by_id( this.plObj_id );
266266 setTimeout(this.instance_name +'.checkReadyPlObj()', 25);
267267 },
@@ -297,7 +297,7 @@
298298 bConf[ gM('mwe-cancel') ] = function(){
299299 $j(this).dialog('close');
300300 };
301 - bConf[ gm('mwe-edit_save') ] = function(){
 301+ bConf[ gM('mwe-edit_save') ] = function(){
302302 var saveReq = {
303303 'action' : 'edit',
304304 'title' : _this.plObj.mTitle,
@@ -1435,7 +1435,7 @@
14361436 $j(this.target_sequence_container).append('<div id="'+ this.timeline_id +'_pl_control"'+
14371437 ' style="position:absolute;top:' + (this.plObj.height) +'px;'+
14381438 '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">'+
14401440 this.plObj.getControlsHTML() +
14411441 '</div>'+
14421442 '</div>');
@@ -1443,7 +1443,7 @@
14441444 this.plObj.updateBaseStatus();
14451445
14461446 //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' ) );
14481448
14491449 //render out the "jump" div
14501450 if(this.timeline_mode=='time'){
@@ -1499,7 +1499,7 @@
15001500 //refresh player:
15011501 this.plObj.getHTML();
15021502
1503 - this.render_playheadhead_seeker();
 1503+ //this.render_playheadhead_seeker();
15041504 this.render_tracks();
15051505 this.jt(this.playline_time);
15061506
Index: trunk/phase3/js2/mwEmbed/tests/testLang.html
@@ -8,7 +8,7 @@
99 }
1010 </style>
1111 <script type="text/javascript" >
12 -var scriptLoaderURID = 't10';
 12+var scriptLoaderURID = 't11';
1313 //for just setting one or two to test at a time for debug
1414 var langKeyDebug = ['fr'];
1515
@@ -25,7 +25,7 @@
2626 'zero' => 0,
2727 'one' => 1,
2828 'two' => 2,
29 - //n mod 100 in 3..10
 29+ //n mod 100 in 3..10
3030 'few' => array( 'mod' => 100, 'is'=>'3-10' ),
3131 //n mod 100 in 11..99
3232 'many' => array( 'mod' => 100, 'is'=>'11-99')
Index: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
@@ -30,7 +30,8 @@
3131 "mwe-preview_inout" : "Preview in-out points",
3232 "mwe-edit-tools" : "Edit tools",
3333 "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:"
3536 });
3637
3738 var default_clipedit_values = {
@@ -102,22 +103,25 @@
103104 'duration':{
104105 'media':['image','template'],
105106 '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+
108115 $j(target).html(
109 - '<label for="ce_dur">Duration: </label>' +
 116+ '<label for="ce_dur">' + gM('mwe-duration') + '</label>' +
110117 '<input name="ce_dur" tabindex="1" maxlength="11" value="'+
111118 seconds2npt( _this.rObj.getDuration() )+
112119 '" size="10"/>'+
113120 '</div>'
114121 ).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);
120123 });
121 -
 124+ //Strange can't chain this binding for some reason...
 125+ $j(target).find("input[name='ce_dur']").upDownTimeInputBind( doUpdateDur );
122126 }
123127 },
124128 'inoutpoints':{
@@ -144,7 +148,7 @@
145149 'fileopts':{
146150 'media':['image','video','template'],
147151 '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
149153 if(_this.media_type == 'template' && !_this.rObj.tVars){
150154 mv_set_loading('#sub_cliplib_ic');
151155 var reqObj ={ 'action':'query',
@@ -391,9 +395,11 @@
392396 },
393397 setInOutBindings:function(){
394398 var _this = this;
 399+ //setup a top level shortcut:
 400+ var $tp = $j('#'+this.control_ct);
395401
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() );
398404
399405 //if we don't have 0 as start then assume we are in a range request and give some buffer area:
400406 var min_slider = (start_sec - 60 < 0 ) ? 0 : start_sec - 60;
@@ -403,23 +409,49 @@
404410 max_slider = end_sec;
405411 }
406412
407 - $j('#'+this.control_ct + ' .inOutSlider').slider({
 413+ $tp.find('.inOutSlider').slider({
408414 range: true,
409415 min: min_slider,
410416 max: max_slider,
 417+ animate: true,
411418 values: [start_sec, end_sec],
412419 slide: function(event, ui) {
413420 //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] ) );
416423 },
417424 change:function(event, ui){
418425 do_video_time_update( seconds2npt( ui.values[0]), seconds2npt( ui.values[1] ) );
419426 }
 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 );
420444 });
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+
422454 //preview button:
423 - $j('#'+this.control_ct + ' .inOutPreviewClip').btnBind().click(function(){
 455+ $j('#'+this.control_ct + ' .inOutPreviewClip').btnBind().click(function(){
424456 $j('#embed_vid').get(0).stop();
425457 $j('#embed_vid').get(0).play();
426458 });
@@ -429,14 +461,14 @@
430462 return '<strong>' + gM('mwe-set_in_out_points') + '</strong>'+
431463 '<table border="0" style="background: transparent; width:94%;height:50px;">'+
432464 '<tr>' +
433 - '<td style="width:55px">'+
 465+ '<td style="width:90px">'+
434466 gM('mwe-start_time') +
435467 '<input class="ui-widget-content ui-corner-all startInOut" size="9" value="' + setInt.start_ntp +'">'+
436468 '</td>' +
437469 '<td>' +
438470 '<div class="inOutSlider"></div>'+
439471 '</td>' +
440 - '<td style="width:55px">'+
 472+ '<td style="width:90px;text-align:right;">'+
441473 gM('mwe-end_time') +
442474 '<input class="ui-widget-content ui-corner-all endInOut" size="9" value="'+ setInt.end_ntp +'">'+
443475 '</td>' +
@@ -599,14 +631,14 @@
600632 },
601633 applyVideoAdj:function(){
602634 js_log('applyVideoAdj::');
 635+ $tp = $j('#'+this.control_ct );
603636
604637 //be sure to "stop the video (some plugins can't have DOM elements on top of them)
605638 $j('#embed_vid').get(0).stop();
606639
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() ;
611643
612644 //do the local video adjust
613645 if(typeof this.rObj.pSobj['applyVideoAdj'] != 'undefined'){
@@ -621,7 +653,7 @@
622654 js_log( 'click:turn off' );
623655 var cat = _this.rObj;
624656 if(_this.rObj.crop){
625 - //empty out and display croped:
 657+ //empty out and display cropped:
626658 $j('#'+_this.clip_disp_ct ).empty().html(
627659 '<div id="mv_cropcotainer" style="overflow:hidden;position:absolute;'+
628660 'width:' + _this.rObj.crop.w + 'px;'+
@@ -674,16 +706,6 @@
675707 mv_lock_vid_updates= false;
676708
677709 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();*/
688710
689711 var start_sec = npt2seconds($j('#mv_start_hr_' + mvd_id).val() );
690712 var end_sec = npt2seconds($j('#mv_end_hr_' + mvd_id).val() );
@@ -709,7 +731,7 @@
710732 change:function(event, ui){
711733 do_video_time_update( seconds2npt( ui.values[0]), seconds2npt( ui.values[1] ) );
712734 }
713 - });
 735+ });
714736 $j('.mv_adj_hr').change(function(){
715737 //preserve track duration for nav and seq:
716738 //ie seems to crash so no interface updates for IE for the time being
@@ -727,8 +749,7 @@
728750
729751 function do_video_time_update(start_time, end_time, mvd_id) {
730752 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 ){
733754 //update the vid title:
734755 $j('#mv_videoPlayerTime').html( start_time + ' to ' + end_time );
735756 var ebvid = $j('#embed_vid').get(0);
@@ -740,4 +761,38 @@
741762 ebvid.updateThumbTimeNTP( start_time );
742763 }
743764 }
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 @@
9595 font: 11px arial, sans-serif;
9696 line-height: 20px;
9797 overflow: hidden;
98 - width: 36px;
 98+ width: 39px;
9999 float: right;
100100 }
101101
Index: trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js
@@ -93,18 +93,16 @@
9494 * addControlHooks
9595 * to be run once controls are attached to the dom
9696 */
97 - addControlHooks:function(){
 97+ addControlHooks:function( $tp ){
9898 //set up local pointer to the embedObj
9999 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 );
108105
 106+
109107 //add play hook:
110108 $tp.find('.play-btn').unbind().btnBind().click(function(){
111109 $j('#' + embedObj.id).get(0).play();
@@ -171,7 +169,7 @@
172170 $j('#' +embedObj.id).get(0).fullscreen();
173171 });
174172
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) ;
176174 $tp.find('.play_head').slider({
177175 range: "min",
178176 value: 0,
Index: trunk/phase3/js2/mwEmbed/skins/mvpcf/playerSkin.css
@@ -109,7 +109,7 @@
110110 .mv-player .vol_container_top{
111111 top:-77px;
112112 }
113 -.mv-player .vol_container .volume-slider{
 113+. ayer .vol_container .volume-slider{
114114 margin-top:5px;
115115 height:65px;
116116 width:10px;
@@ -129,7 +129,7 @@
130130 height: 29px;
131131 overflow: visible;
132132 font-size: 10.2px;
133 - width: 80px;
 133+ width: 85px;
134134 float: right;
135135 display: inline;
136136 border:none;
@@ -140,7 +140,8 @@
141141 display: inline;
142142 height: 10px;
143143 margin-left:10px;
144 - margin-top:10px;
 144+ margin-top:10px;
 145+ position:relative;
145146 }
146147
147148 .mv-player .play_head .ui-slider-handle{
Index: trunk/phase3/js2/mwEmbed/mv_embed.js
@@ -1679,7 +1679,7 @@
16801680 return js_error( 'Error: request paramaters must be an object' );
16811681 }
16821682 // Generate the URL if it's missing
1683 - if( typeof options.url == 'undefined' || options.url === false ) {
 1683+ if( typeof options.url == 'undefined' || !options.url ) {
16841684 if( !wgServer || ! wgScriptPath ) {
16851685 return js_error('Error: no api url for api request');
16861686 }
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -1416,7 +1416,7 @@
14171417 this.paused = true;
14181418 this.thumbnail_disp = true;
14191419 //make sure the ctrlBuilder remain active:
1420 - this.ctrlBuilder.addControlHooks(this);
 1420+ this.ctrlBuilder.addControlHooks();
14211421 },
14221422 refreshControlsHTML:function(){
14231423 js_log('refreshControlsHTML::');
@@ -1426,7 +1426,7 @@
14271427 return ;
14281428 }else{
14291429 $j('#' + this.id + ' .control-bar').html( this.getControlsHTML() );
1430 - this.ctrlBuilder.addControlHooks(this);
 1430+ this.ctrlBuilder.addControlHooks();
14311431 }
14321432 },
14331433 getControlsHTML:function()
@@ -1462,7 +1462,7 @@
14631463 //js_log('should set: '+this.id);
14641464 $j(this).html( html_code );
14651465 //add hooks once Controls are in DOM
1466 - this.ctrlBuilder.addControlHooks(this);
 1466+ this.ctrlBuilder.addControlHooks();
14671467
14681468 //js_log('set this to: ' + $j(this).html() );
14691469 //alert('stop');
@@ -2334,12 +2334,9 @@
23352335 },
23362336 addPlayer : function(player, mime_type)
23372337 {
2338 - //js_log('Adding ' + player.id + ' with mime_type ' + mime_type);
23392338 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){
23442341 //make sure the mime_type is not already there:
23452342 var add_mime = true;
23462343 for(var j=0; j < this.players[i].supported_types.length; j++ ){
@@ -2347,15 +2344,16 @@
23482345 add_mime=false;
23492346 }
23502347 if(add_mime)
2351 - this.players[i].supported_types.push(mime_type);
 2348+ this.players[i].supported_types.push( mime_type );
23522349 }
2353 - return;
 2350+ return ;
23542351 }
23552352 }
23562353 //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);
23602358 this.players.push( player );
23612359 },
23622360 getMIMETypePlayers : function(mime_type)
@@ -2483,15 +2481,13 @@
24842482 this.players.addPlayer( htmlPlayer );
24852483 // In Mozilla, navigator.javaEnabled() only tells us about preferences, we need to
24862484 // 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();
24902486 // 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;
24922488 // Opera will switch off javaEnabled in preferences if java can't be found.
24932489 // 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 );
24962492
24972493 // ActiveX plugins
24982494 if($j.browser.msie){
@@ -2518,10 +2514,11 @@
25192515 // VLC
25202516 if ( this.testActiveX( 'VideoLAN.VLCPlugin.2' ) )
25212517 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)
25262523 //if ( this.testActiveX( 'QuickTimeCheckObject.QuickTimeCheck.1' ) )
25272524 // this.players.addPlayer(quicktimeActiveXPlayer);
25282525 }
@@ -2551,7 +2548,7 @@
25522549 }
25532550 }
25542551
2555 - // Mozilla plugins
 2552+ // "navigator" plugins
25562553 if( navigator.mimeTypes && navigator.mimeTypes.length > 0) {
25572554 for ( var i = 0; i < navigator.mimeTypes.length; i++ ) {
25582555 var type = navigator.mimeTypes[i].type;
@@ -2570,8 +2567,8 @@
25712568 continue;
25722569 }
25732570
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 );
25762573 continue;
25772574 }
25782575

Follow-up revisions

RevisionCommit summaryAuthorDate
r58540usability branch: Create acaifix (wmf-deployment version of UsabilityInitiati...catrope14:04, 4 November 2009

Status & tagging log