r66641 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66640‎ | r66641 | r66642 >
Date:11:19, 19 May 2010
Author:j
Status:deferred
Tags:
Comment:
FirefoggGUI fixes
- fix slider slide and change function, configKey needs to be parsed from current element.
- use newWidth instead of undefined variable as default in aspect raio check
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.FirefoggGUI.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.FirefoggGUI.js
@@ -661,7 +661,6 @@
662662 });
663663 break;
664664 case 'slider':
665 - //var sliderId = _this.getClassId( this, 'slider_' );
666665 $j( this.selector + ' .slider_' + configKey ).slider({
667666 range: "min",
668667 animate: true,
@@ -670,10 +669,13 @@
671670 min: this.default_encoder_config[ configKey ].range.min,
672671 max: this.default_encoder_config[ configKey ].range.max,
673672 slide: function( event, ui ) {
674 - $j( _this.selector + ' ._' + sliderId ).val( ui.value );
 673+ //cut of slider_
 674+ var configKey = _this.getClassId( this ).substr(7);
675675
 676+ $j( _this.selector + ' ._' + configKey ).val( ui.value );
 677+
676678 // Maintain source video aspect ratio
677 - if ( sliderId == 'width' ) {
 679+ if ( configKey == 'width' ) {
678680 var sourceHeight = _this.sourceFileInfo.video[0]['height'];
679681 var sourceWidth = _this.sourceFileInfo.video[0]['width'];
680682 var newHeight = parseInt( sourceHeight / sourceWidth * ui.value );
@@ -681,17 +683,19 @@
682684 if ( newHeight > _this.updateInterfaceValue( 'height', newHeight ) )
683685 return false;
684686 }
685 - if ( sliderId == 'height' ) {
 687+ if ( configKey == 'height' ) {
686688 var sourceHeight = _this.sourceFileInfo.video[0]['height'];
687689 var sourceWidth = _this.sourceFileInfo.video[0]['width'];
688690 var newWidth = parseInt( sourceWidth / sourceHeight * ui.value );
689691 // Reject the update if the new width is above the maximum
690 - if ( newWidth > _this.updateInterfaceValue( 'width', wv ) )
 692+ if ( newWidth > _this.updateInterfaceValue( 'width', newWidth ) )
691693 return false;
692694 }
693695 },
694696 change: function( event, ui ) {
695 - _this.updateLocalValue( sliderId, ui.value );
 697+ //cut of slider_
 698+ var configKey = _this.getClassId( this ).substr(7);
 699+ _this.updateLocalValue( configKey, ui.value );
696700 _this.updatePresetSelection( 'custom' );
697701 }
698702 });

Status & tagging log