r39989 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39988‎ | r39989 | r39990 >
Date:00:09, 26 August 2008
Author:dale
Status:old
Tags:
Comment:
improved slider handling
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -1417,8 +1417,15 @@
14181418 */
14191419 selectSource:function(index)
14201420 {
1421 - js_log("selected source " + this.sources[index].getTitle());
1422 - this.selected_source = this.sources[index];
 1421+ var playable_sources = this.getPlayableSources();
 1422+ for(var i in playable_sources){
 1423+ if(i==index){
 1424+ this.selected_source = playable_sources[i];
 1425+ break;
 1426+ }
 1427+ }
 1428+ js_log("selected source " + this.sources[index].getTitle());
 1429+
14231430 },
14241431 /** selects the default source via cookie preference, default marked, or by id order
14251432 * */
@@ -2504,13 +2511,13 @@
25052512 },
25062513 setSliderValue: function(perc){
25072514 var id = (this.pc)?this.pc.pp.id:this.id;
2508 - //this.slider.setValue(perc);
2509 - //var cur_slider = $j('#mv_seeker_'+id).width();
2510 - //var offset_perc = 1-(cur_slider / $j('#mv_seeker_'+id).width());
2511 - //offset_perc*
2512 - var val = Math.round( perc * $j('#mv_seeker_'+id).width() );
2513 - $j('#mv_seeker_slider_'+id).css('marginLeft',val);
2514 - js_log('perc in: ' + perc + ' * ' + $j('#mv_seeker_'+id).width() + ' = set to: '+ val);
 2515+ //alinment offset:
 2516+ if(!this.mv_seeker_width)
 2517+ this.mv_seeker_width = $j('#mv_seeker_slider_'+id).width();
 2518+
 2519+ var val = Math.round( perc * $j('#mv_seeker_'+id).width() - (this.mv_seeker_width*perc));
 2520+ $j('#mv_seeker_slider_'+id).css('marginLeft', val );
 2521+ //js_log('perc in: ' + perc + ' * ' + $j('#mv_seeker_'+id).width() + ' = set to: '+ val + ' - '+ Math.round(this.mv_seeker_width*perc) );
25152522 //js_log('op:' + offset_perc + ' *('+perc+' * ' + $j('#slider_'+id).width() + ')');
25162523 },
25172524 setStatus:function(value){

Status & tagging log