r58742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58741‎ | r58742 | r58743 >
Date:09:30, 8 November 2009
Author:j
Status:deferred
Tags:
Comment:
make language selection a radio button, switch back to subtitles onchange
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libTimedText/mvTextInterface.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libTimedText/mvTextInterface.js
@@ -281,33 +281,32 @@
282282 //debugger;
283283 for(var i in _this.availableTracks){ //for in loop ok on object
284284 var checked = ( _this.availableTracks[i].display ) ? 'checked' : '';
285 - selHTML+='<li><input name="'+i+'" class="mvTsSelect" type="checkbox" ' + checked + '>'+
 285+ selHTML+='<li><input name="language" value="'+i+'" class="mvTsSelect" type="radio" ' + checked + ' onChange="document.getElementById(\'' + this.pe.id + '\').textInterface.applyTsSelect();return false;">'+
286286 _this.availableTracks[i].getTitle() + '</li>';
287287 }
288288 selHTML+='</ul>' +
289 - '<a href="#" onClick="document.getElementById(\'' + this.pe.id + '\').textInterface.applyTsSelect();return false;">'+gM('mwe-close')+'</a>'+
290 - '</div>';
 289+ '</div>';
291290 $j('#metaBox_'+_this.pe.id).append( selHTML );
292291 },
293292 applyTsSelect:function(){
294293 var _this = this;
295294 //update availableTracks
296295 $j('#mvtsel_' + this.pe.id + ' .mvTsSelect').each(function(){
 296+ var track_id = $j(this).val();
297297 if(this.checked){
298 - var track_id = this.name;
299298 //if not yet loaded now would be a good time
300299 if(! _this.availableTracks[ track_id ].loaded ){
301300 _this.loadAndDisplay( track_id);
302301 }else{
303 - _this.availableTracks[this.name].display=true;
 302+ _this.availableTracks[track_id].display=true;
304303 //display the named class:
305 - $j('#mmbody_'+_this.pe.id +' .tt_'+this.name ).fadeIn("fast");
 304+ $j('#mmbody_'+_this.pe.id +' .tt_'+track_id ).fadeIn("fast");
306305 }
307306 }else{
308 - if(_this.availableTracks[this.name].display){
309 - _this.availableTracks[this.name].display=false;
 307+ if(_this.availableTracks[track_id].display){
 308+ _this.availableTracks[track_id].display=false;
310309 //hide unchecked
311 - $j('#mmbody_'+_this.pe.id +' .tt_'+this.name ).fadeOut("fast");
 310+ $j('#mmbody_'+_this.pe.id +' .tt_'+track_id ).fadeOut("fast");
312311 }
313312 }
314313 });

Status & tagging log