r76123 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76122‎ | r76123 | r76124 >
Date:18:45, 5 November 2010
Author:j
Status:deferred
Tags:
Comment:
update interface values after selecting preset
Modified paths:
  • /branches/MwEmbedStandAlone/modules/AddMedia/mw.FirefoggGUI.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.FirefoggGUI.js
@@ -129,6 +129,7 @@
130130 'webvideo': {
131131 'desc': gM( 'fogg-webvideo-desc' ),
132132 'conf': {
 133+ 'videoCodec' : 'theora',
133134 'maxSize' : 400,
134135 'videoBitrate' : 544,
135136 'audioBitrate' : 96,
@@ -138,6 +139,7 @@
139140 'savebandwidth': {
140141 'desc': gM( 'fogg-savebandwidth-desc' ),
141142 'conf': {
 143+ 'videoCodec' : 'theora',
142144 'maxSize' : 200,
143145 'videoBitrate' : 164,
144146 'audioBitrate' : 32,
@@ -150,6 +152,7 @@
151153 'hqstream': {
152154 'desc': gM( 'fogg-highquality-desc' ),
153155 'conf': {
 156+ 'videoCodec' : 'theora',
154157 'maxSize' : 1080,
155158 'videoQuality' : 6,
156159 'audioQuality' : 3,
@@ -736,6 +739,7 @@
737740 * Update the UI due to a change in preset
738741 */
739742 updatePresetSelection: function( presetKey ) {
 743+ var _this = this;
740744 // Update the local configuration
741745 this.local_settings['default'] = presetKey;
742746 mw.log( 'update preset desc: ' + presetKey );
@@ -748,6 +752,14 @@
749753 if( presetKey != 'custom' ){
750754 // Copy the preset into custom settings
751755 this.local_settings.presets['custom']['conf'] = $j.extend( {}, this.local_settings.presets[presetKey]['conf'] );
 756+
 757+ // Set the actual HTML & widgets based on any local settings values:
 758+ $j.each( _this.local_settings.presets['custom']['conf'], function( inx, val ) {
 759+ if ( $j( _this.selector + ' ._' + inx ).length != 0 ) {
 760+ $j( _this.selector + ' ._' + inx ).val( val );
 761+ }
 762+ } );
 763+
752764 }
753765 // Update the preset title
754766 $j( this.selector + ' .gd_preset' )

Status & tagging log