From: Michael Dale Date: Sun, 8 Nov 2009 15:18:09 +0000 (+0000) Subject: * timed text hide show languages support X-Git-Tag: 1.31.0-rc.0~38883 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=80bd4a4b84d4ea486018f5fab642fc5ba87ffa67;p=lhc%2Fweb%2Fwiklou.git * timed text hide show languages support --- diff --git a/js2/mwEmbed/libTimedText/mvTextInterface.js b/js2/mwEmbed/libTimedText/mvTextInterface.js index 41e9ae19fc..fb5c521931 100644 --- a/js2/mwEmbed/libTimedText/mvTextInterface.js +++ b/js2/mwEmbed/libTimedText/mvTextInterface.js @@ -178,7 +178,7 @@ mvTextInterface.prototype = { } $j.each( this.pe.media_element.sources, function(inx, source){ if( typeof source.id == 'undefined' || source.id == null ){ - source.id = 'tt_' + inx; + source.id = 'text_' + inx; } var tObj = new timedTextObj( source ); //make sure its a valid timed text format (we have not loaded or parsed yet) : ( @@ -226,7 +226,7 @@ mvTextInterface.prototype = { _this.availableTracks[ track_id ].display=true; //setup the layout: this.setup_layout(); - js_log("SHOULD ADD: "+ track_id + ' count:' + _this.availableTracks[ track_id ].textNodes.length); + js_log("SHOULD ADD: track:"+ track_id + ' count:' + _this.availableTracks[ track_id ].textNodes.length); //a flag to avoid checking all clips if we know we are adding to the end: _this.add_to_end_on_this_pass = false; @@ -236,7 +236,7 @@ mvTextInterface.prototype = { var track_id = track_id; var addNextClip = function(){ var text_clip = _this.availableTracks[ track_id ].textNodes[i]; - _this.add_merge_text_clip(text_clip); + _this.add_merge_text_clip(text_clip, track_id); i++; if(i < _this.availableTracks[ track_id ].textNodes.length){ setTimeout(addNextClip, 1); @@ -244,7 +244,7 @@ mvTextInterface.prototype = { } addNextClip(); }, - add_merge_text_clip: function( text_clip ){ + add_merge_text_clip: function( text_clip, track_id ){ var _this = this; //make sure the clip does not already exist: if($j('#tc_'+text_clip.id).length==0){ @@ -253,17 +253,16 @@ mvTextInterface.prototype = { var insertHTML = '
' + + 'start="'+text_clip.start+'" end="'+text_clip.end + '" ' + + 'class="mvtt track_' + track_id + '">' + '
'+ text_clip.start + ' to ' +text_clip.end+ '
'+ text_clip.body + '
'; - //js_log("ADDING CLIP: " + text_clip_start_time + ' html: ' + insertHTML); if(!_this.add_to_end_on_this_pass){ $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ if(!inserted){ - //js_log( npt2seconds($j(this).attr('start')) + ' > ' + text_clip_start_time); if( $j(this).attr('start_sec') > text_clip_start_time){ inserted=true; $j(this).before(insertHTML); @@ -372,14 +371,13 @@ mvTextInterface.prototype = { }else{ _this.availableTracks[track_id].display=true; //display the named class: - $j('#mmbody_'+_this.pe.id +' .tt_'+track_id ).fadeIn("fast"); + $j('#mmbody_'+_this.pe.id +' .track_'+track_id ).show(); } }else{ if(_this.availableTracks[track_id].display){ _this.availableTracks[track_id].display=false; - //hide unchecked - alert('hide: ' + '#mmbody_'+_this.pe.id +' .tt_'+track_id + ' len: ' + $j('#mmbody_'+_this.pe.id +' .tt_'+track_id ).length ); - $j('#mmbody_'+_this.pe.id +' .tt_'+track_id ).fadeOut("fast"); + //hide unchecked + $j('#mmbody_'+_this.pe.id +' .track_'+track_id ).hide(); } } });