r51616 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51615‎ | r51616 | r51617 >
Date:22:40, 8 June 2009
Author:dale
Status:deferred
Tags:
Comment:
fixed upload page rewrite for firefogg
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js
@@ -8,7 +8,8 @@
99 "fogg-save_local_file" : "Save Ogg",
1010 "fogg-check_for_fogg" : "Checking for Firefogg <blink>...</blink>",
1111 "fogg-installed" : "Firefogg is Installed",
12 - "fogg-please_install" : "You don't have firefogg installed, For improved uploads please <a href=\"$1\">install firefogg</a> more <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">about firefogg</a>",
 12+ "fogg-for_improved_uplods" : "For Improved uploads: ",
 13+ "fogg-please_install" : "<a href=\"$1\">Install Firefogg</a>. More <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">about firefogg</a>",
1314 "fogg-use_latest_fox" : "Please first install <a href=\"http://www.mozilla.com/en-US/firefox/all-beta.html\">Firefox 3.5</a>. <i>then revisit this page to install the <b>firefogg</b> extention</i>",
1415 "fogg-passthrough_mode" : "Your selected file is already ogg or not a video file",
1516 "fogg-transcoding" : "Encoding Video to Ogg",
@@ -108,7 +109,7 @@
109110 if( $j(this.selector).length >=0 ){
110111
111112 if( $j(this.selector).get(0).tagName.toLowerCase() == 'input' ){
112 - _this.form_rewrite = true;
 113+ _this.form_rewrite = true;
113114 }
114115 }
115116 //check if we are rewriting an input or a form:
@@ -158,20 +159,20 @@
159160 hide_target_list+=coma + _this[target];
160161 coma=',';
161162 }
162 - });
163 -
164 - $j( hide_target_list ).hide();
165 -
 163+ });
 164+ $j( hide_target_list ).hide();
166165 //now that the proper set of items has been hiiden show:
167166 $j( this.selector ).show();
168 -
169 - //if rewriting the form lets keep the text input around:
170 - if( _this.form_rewrite )
171 - $j(this.target_input_file_name).show();
 167+
172168
173169 //hide all but check-for-fogg
174170 //check for firefogg
175171 if( _this.firefoggCheck() ){
 172+
 173+ //if rewriting the form lets keep the text input around:
 174+ if( _this.form_rewrite )
 175+ $j(this.target_input_file_name).show();
 176+
176177 //show select file:
177178 $j(this.target_btn_select_file).unbind(
178179 ).attr('disabled', false
@@ -188,8 +189,12 @@
189190 //first check firefox version:
190191 if(!($j.browser.mozilla && $j.browser.version >= '1.9.1')) {
191192 js_log('show use latest::' + _this.target_use_latest_fox);
192 - if(_this.target_use_latest_fox)
 193+ if(_this.target_use_latest_fox){
 194+ if(_this.form_rewrite)
 195+ $j(_this.target_use_latest_fox).prepend( gM('fogg-for_improved_uplods') );
 196+
193197 $j(_this.target_use_latest_fox).show();
 198+ }
194199 return ;
195200 }
196201 //if they have the right version of mozilla provide install link:
@@ -201,8 +206,10 @@
202207 os_link = firefogg_install_links['macosx'];
203208 else if(navigator.oscpu.search('Win') >= 0)
204209 os_link = firefogg_install_links['win32'];
205 - }
206 - $j(_this.target_please_install).html( gM('fogg-please_install',os_link )).css('padding', '10px').show();
 210+ }
 211+ //if rewriting form use upload msg text
 212+ var upMsg = (_this.form_rewrite) ? gM('fogg-for_improved_uplods') : '';
 213+ $j(_this.target_please_install).html( upMsg + gM('fogg-please_install',os_link )).css('padding', '10px').show();
207214 }
208215 //setup the target save local file bindins:
209216 $j( _this.target_btn_save_local_file ).unbind().click(function(){
@@ -252,7 +259,8 @@
253260 inTag += attr.name + '="' + val + '" ';
254261 });
255262 if(!$j(this.selector).attr('style'))
256 - inTag += 'style="display:inline" ';
 263+ inTag += 'style="display:inline" ';
 264+
257265 inTag+= '/><span id="' + $j(this.selector).attr('name') + '_fogg-control"></span>';
258266
259267 js_log('set input: ' + inTag);

Status & tagging log