r51080 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51079‎ | r51080 | r51081 >
Date:17:41, 27 May 2009
Author:dale
Status:deferred
Tags:
Comment:
some firefogg fixes
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /branches/new-upload/phase3/js2/uploadPage.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js
@@ -266,7 +266,7 @@
267267 this.loadEncSettings();
268268
269269 //add base control buttons:
270 - _this.basefogg_doControlHTML();
 270+ this.basefogg_doControlHTML();
271271
272272 //build the config group outpouts
273273 var gdout ='';
@@ -295,7 +295,7 @@
296296 //add the control container:
297297 if(!this.target_control_container){
298298 this.target_control_container = this.selector + ' .control_container';
299 - //set the target contorl container to height -50
 299+ //set the target contorl container to height
300300 $j(this.selector).append( '<p><div class="control_container">' + gdout + '</div>' );
301301 }else{
302302 $j(this.target_control_container).html( gdout );
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js
@@ -9,7 +9,7 @@
1010 'fogg-check_for_fogg' : 'Checking for Firefogg <blink>...</blink>',
1111 'fogg-installed' : 'Firefogg is Installed',
1212 '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>',
13 - 'fogg-use_latest_fox' : 'You need a <a href="http://www.mozilla.com/en-US/firefox/all-beta.html">Firefox 3.5</a> to use Firefogg',
 13+ 'fogg-use_latest_fox' : 'For improved uploads 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>',
1414 'fogg-passthrough_mode' : 'Your selected file is already ogg or not a video file',
1515 });
1616
@@ -42,7 +42,7 @@
4343 'target_btn_save_local_file': false,
4444
4545
46 - //target install descriptions (visability will be set based )
 46+ //target install descriptions
4747 'target_check_for_fogg' : false,
4848 'target_installed' : false,
4949 'target_please_install' : false,
@@ -105,7 +105,7 @@
106106 if( this.form_rewrite ){
107107 this.setupForm();
108108 }else{
109 - this.doControlHTML();
 109+ this.doControlHTML();
110110 this.doControlBindings();
111111 }
112112
@@ -113,10 +113,10 @@
114114 if(callback)
115115 callback();
116116 },
117 - doControlHTML: function(){
 117+ doControlHTML: function( ){
118118 var _this = this;
119119 var out = '';
120 - $j.each(default_firefogg_options, function(target, na){
 120+ $j.each(default_firefogg_options, function(target, na){
121121 if(target.substring(0, 6)=='target'){
122122 //check for the target if missing add to the output:
123123 if( _this[target] === false){
@@ -126,17 +126,14 @@
127127 _this[target] = _this.selector + ' .' + target;
128128 }
129129 });
130 - //output the html
131 - $j( this.selector ).html( out ).show();
 130+ $j( this.selector ).append( out ).show();
132131 },
133 - getTargetHtml:function(target){
134 - js_log('getTargetHtml:'+ target);
 132+ getTargetHtml:function(target){
135133 if( target.substr(7,3)=='btn'){
136134 return '<input style="" class="' + target + '" type="button" value="' + gM( 'fogg-' + target.substring(11)) + '"/> ';
137135 }else if(target.substr(7,5)=='input'){
138136 return '<input style="" class="' + target + '" type="text" value="' + gM( 'fogg-' + target.substring(11)) + '"/> ';
139 - }else{
140 - js_log(" get target: " + target.substring(7));
 137+ }else{
141138 return '<div style="" class="' + target + '" >'+ gM('fogg-'+ target.substring(7)) + '</div> ';
142139 }
143140 },
@@ -151,10 +148,11 @@
152149 hide_target_list+=coma + _this[target];
153150 coma=',';
154151 }
155 - });
 152+ });
 153+
156154 $j( hide_target_list ).hide();
157155 //if rewriting the form lets keep the text input around:
158 - if(_this.form_rewrite)
 156+ if( _this.form_rewrite )
159157 $j('#target_input_file_name').show();
160158
161159 //hide all but check-for-fogg
@@ -171,8 +169,10 @@
172170 }else{
173171 //first check firefox version:
174172 if(!($j.browser.mozilla && $j.browser.version >= '1.9.1')) {
175 - $j(_this.target_use_latest_fox).show();
176 - return ;
 173+ js_log('show use latest::' + _this.target_use_latest_fox);
 174+ if(_this.target_use_latest_fox)
 175+ $j(_this.target_use_latest_fox).show();
 176+ return ;
177177 }
178178 //if they have the right version of mozilla provide install link:
179179 var os_link = false;
@@ -217,11 +217,14 @@
218218 //check if we have firefogg (if not just add a link and stop proccessing)
219219 if( !this.firefoggCheck() ){
220220 //add some status indicators if not provided:
221 - if(!this.target_please_install){
222 - $j(this.selector).after ( this.getTargetHtml('target_please_install') );
223 - //match the first sibling of our input type selector:
 221+ if(!this.target_please_install){
 222+ $j(this.selector).after ( this.getTargetHtml('target_please_install') );
224223 this.target_please_install = this.selector + ' ~ .target_please_install';
225224 }
 225+ if(!this.target_use_latest_fox){
 226+ $j(this.selector).after ( this.getTargetHtml('target_use_latest_fox') );
 227+ this.target_use_latest_fox = this.selector + ' ~ .target_use_latest_fox';
 228+ }
226229 //update download link:
227230 this.doControlBindings();
228231 return ;
@@ -244,10 +247,9 @@
245248
246249 this.target_input_file_name = this.selector;
247250
248 - $j(this.selector).after(
249 - this.getTargetHtml('target_btn_select_file') + ' '
250 - );
 251+ this.doControlHTML();
251252 //check for the other inline status indicator targets:
 253+
252254 //update the bindings:
253255 this.doControlBindings();
254256 },
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -409,7 +409,7 @@
410410 $j(window).bind('resize', function() {
411411 var adjustModal = function(){
412412 var layout = _this.getMaxModalLayout();
413 - js_log("should adjust: h " + layout.h + ' width:' + layout.w);
 413+ //js_log("should adjust: h " + layout.h + ' width:' + layout.w);
414414 $j(_this.target_container).dialog('option', 'width', layout.w);
415415 $j(_this.target_container).dialog('option', 'height', layout.h);
416416 }
@@ -421,9 +421,9 @@
422422 getMaxModalLayout:function(border){
423423 if(!border)
424424 border = 50;
425 - js_log('setting h:' + (parseInt( $j(document).height() ) - parseInt(border*2)) + ' from:' + $j(document).height() );
 425+ //js_log('setting h:' + (parseInt( $j(document).height() ) - parseInt(border*2)) + ' from:' + $j(document).height() );
426426 return {
427 - 'h': parseInt( $j(document).height() ) - parseInt(border*2),
 427+ 'h': parseInt( $j(document).height() ) - parseInt(border*4),
428428 'w': parseInt( $j(document).width() ) - parseInt(border*2),
429429 'r': border,
430430 't': border
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
@@ -66,7 +66,7 @@
6767 //set up the org_onsubmit if not set:
6868 if( typeof( _this.org_onsubmit ) == 'undefined' )
6969 _this.org_onsubmit = _this.editForm.onsubmit;
70 - js_log('should overwite onsubmit here::');
 70+
7171 //have to define the onsubmit function inline or its hard to pass the "_this" instance
7272 _this.editForm.onsubmit = function(){
7373 //run the original onsubmit (if not run yet set flag to avoid excessive chaining )
Index: branches/new-upload/phase3/js2/uploadPage.js
@@ -9,16 +9,15 @@
1010 var mwUploadHelper = {
1111 init:function(){
1212 if( wgEnableFirefogg ){
13 - //setup the upload handler to firefogg (supports our upload proccess) (will auto-magically work with the http uploads too)
 13+ //setup the upload handler to firefogg (supports our upload proccess) (should work with the http uploads too)
1414 $j('#wpUploadFile').firefogg({
1515 //an api url (we won't submit directly to action of the form)
1616 'api_url' : wgServer + wgScriptPath + '/api.php',
17 - 'form_rewrite': true,
18 -
 17+ 'form_rewrite': true,
1918 'new_source_cb' : function( filename ){
20 - $j('#wpDestFile').val( filename );
21 - mwUploadHelper.doDestCheck();
22 - }
 19+ $j('#wpDestFile').val( filename );
 20+ mwUploadHelper.doDestCheck();
 21+ }
2322 });
2423 }else{
2524 //Add basic upload profile support ( http status monitoring, progress box for browsers that support it etc.)

Status & tagging log