Index: trunk/phase3/js2/mwEmbed/libTimedText/mvTextInterface.js |
— | — | @@ -281,33 +281,32 @@ |
282 | 282 | //debugger; |
283 | 283 | for(var i in _this.availableTracks){ //for in loop ok on object |
284 | 284 | 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;">'+ |
286 | 286 | _this.availableTracks[i].getTitle() + '</li>'; |
287 | 287 | } |
288 | 288 | selHTML+='</ul>' + |
289 | | - '<a href="#" onClick="document.getElementById(\'' + this.pe.id + '\').textInterface.applyTsSelect();return false;">'+gM('mwe-close')+'</a>'+ |
290 | | - '</div>'; |
| 289 | + '</div>'; |
291 | 290 | $j('#metaBox_'+_this.pe.id).append( selHTML ); |
292 | 291 | }, |
293 | 292 | applyTsSelect:function(){ |
294 | 293 | var _this = this; |
295 | 294 | //update availableTracks |
296 | 295 | $j('#mvtsel_' + this.pe.id + ' .mvTsSelect').each(function(){ |
| 296 | + var track_id = $j(this).val(); |
297 | 297 | if(this.checked){ |
298 | | - var track_id = this.name; |
299 | 298 | //if not yet loaded now would be a good time |
300 | 299 | if(! _this.availableTracks[ track_id ].loaded ){ |
301 | 300 | _this.loadAndDisplay( track_id); |
302 | 301 | }else{ |
303 | | - _this.availableTracks[this.name].display=true; |
| 302 | + _this.availableTracks[track_id].display=true; |
304 | 303 | //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"); |
306 | 305 | } |
307 | 306 | }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; |
310 | 309 | //hide unchecked |
311 | | - $j('#mmbody_'+_this.pe.id +' .tt_'+this.name ).fadeOut("fast"); |
| 310 | + $j('#mmbody_'+_this.pe.id +' .tt_'+track_id ).fadeOut("fast"); |
312 | 311 | } |
313 | 312 | } |
314 | 313 | }); |