Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js |
— | — | @@ -266,7 +266,7 @@ |
267 | 267 | this.loadEncSettings(); |
268 | 268 | |
269 | 269 | //add base control buttons: |
270 | | - _this.basefogg_doControlHTML(); |
| 270 | + this.basefogg_doControlHTML(); |
271 | 271 | |
272 | 272 | //build the config group outpouts |
273 | 273 | var gdout =''; |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | //add the control container: |
297 | 297 | if(!this.target_control_container){ |
298 | 298 | 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 |
300 | 300 | $j(this.selector).append( '<p><div class="control_container">' + gdout + '</div>' ); |
301 | 301 | }else{ |
302 | 302 | $j(this.target_control_container).html( gdout ); |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | 'fogg-check_for_fogg' : 'Checking for Firefogg <blink>...</blink>', |
11 | 11 | 'fogg-installed' : 'Firefogg is Installed', |
12 | 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>', |
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>', |
14 | 14 | 'fogg-passthrough_mode' : 'Your selected file is already ogg or not a video file', |
15 | 15 | }); |
16 | 16 | |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | 'target_btn_save_local_file': false, |
44 | 44 | |
45 | 45 | |
46 | | - //target install descriptions (visability will be set based ) |
| 46 | + //target install descriptions |
47 | 47 | 'target_check_for_fogg' : false, |
48 | 48 | 'target_installed' : false, |
49 | 49 | 'target_please_install' : false, |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | if( this.form_rewrite ){ |
107 | 107 | this.setupForm(); |
108 | 108 | }else{ |
109 | | - this.doControlHTML(); |
| 109 | + this.doControlHTML(); |
110 | 110 | this.doControlBindings(); |
111 | 111 | } |
112 | 112 | |
— | — | @@ -113,10 +113,10 @@ |
114 | 114 | if(callback) |
115 | 115 | callback(); |
116 | 116 | }, |
117 | | - doControlHTML: function(){ |
| 117 | + doControlHTML: function( ){ |
118 | 118 | var _this = this; |
119 | 119 | var out = ''; |
120 | | - $j.each(default_firefogg_options, function(target, na){ |
| 120 | + $j.each(default_firefogg_options, function(target, na){ |
121 | 121 | if(target.substring(0, 6)=='target'){ |
122 | 122 | //check for the target if missing add to the output: |
123 | 123 | if( _this[target] === false){ |
— | — | @@ -126,17 +126,14 @@ |
127 | 127 | _this[target] = _this.selector + ' .' + target; |
128 | 128 | } |
129 | 129 | }); |
130 | | - //output the html |
131 | | - $j( this.selector ).html( out ).show(); |
| 130 | + $j( this.selector ).append( out ).show(); |
132 | 131 | }, |
133 | | - getTargetHtml:function(target){ |
134 | | - js_log('getTargetHtml:'+ target); |
| 132 | + getTargetHtml:function(target){ |
135 | 133 | if( target.substr(7,3)=='btn'){ |
136 | 134 | return '<input style="" class="' + target + '" type="button" value="' + gM( 'fogg-' + target.substring(11)) + '"/> '; |
137 | 135 | }else if(target.substr(7,5)=='input'){ |
138 | 136 | 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{ |
141 | 138 | return '<div style="" class="' + target + '" >'+ gM('fogg-'+ target.substring(7)) + '</div> '; |
142 | 139 | } |
143 | 140 | }, |
— | — | @@ -151,10 +148,11 @@ |
152 | 149 | hide_target_list+=coma + _this[target]; |
153 | 150 | coma=','; |
154 | 151 | } |
155 | | - }); |
| 152 | + }); |
| 153 | + |
156 | 154 | $j( hide_target_list ).hide(); |
157 | 155 | //if rewriting the form lets keep the text input around: |
158 | | - if(_this.form_rewrite) |
| 156 | + if( _this.form_rewrite ) |
159 | 157 | $j('#target_input_file_name').show(); |
160 | 158 | |
161 | 159 | //hide all but check-for-fogg |
— | — | @@ -171,8 +169,10 @@ |
172 | 170 | }else{ |
173 | 171 | //first check firefox version: |
174 | 172 | 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 ; |
177 | 177 | } |
178 | 178 | //if they have the right version of mozilla provide install link: |
179 | 179 | var os_link = false; |
— | — | @@ -217,11 +217,14 @@ |
218 | 218 | //check if we have firefogg (if not just add a link and stop proccessing) |
219 | 219 | if( !this.firefoggCheck() ){ |
220 | 220 | //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') ); |
224 | 223 | this.target_please_install = this.selector + ' ~ .target_please_install'; |
225 | 224 | } |
| 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 | + } |
226 | 229 | //update download link: |
227 | 230 | this.doControlBindings(); |
228 | 231 | return ; |
— | — | @@ -244,10 +247,9 @@ |
245 | 248 | |
246 | 249 | this.target_input_file_name = this.selector; |
247 | 250 | |
248 | | - $j(this.selector).after( |
249 | | - this.getTargetHtml('target_btn_select_file') + ' ' |
250 | | - ); |
| 251 | + this.doControlHTML(); |
251 | 252 | //check for the other inline status indicator targets: |
| 253 | + |
252 | 254 | //update the bindings: |
253 | 255 | this.doControlBindings(); |
254 | 256 | }, |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -409,7 +409,7 @@ |
410 | 410 | $j(window).bind('resize', function() { |
411 | 411 | var adjustModal = function(){ |
412 | 412 | 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); |
414 | 414 | $j(_this.target_container).dialog('option', 'width', layout.w); |
415 | 415 | $j(_this.target_container).dialog('option', 'height', layout.h); |
416 | 416 | } |
— | — | @@ -421,9 +421,9 @@ |
422 | 422 | getMaxModalLayout:function(border){ |
423 | 423 | if(!border) |
424 | 424 | 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() ); |
426 | 426 | return { |
427 | | - 'h': parseInt( $j(document).height() ) - parseInt(border*2), |
| 427 | + 'h': parseInt( $j(document).height() ) - parseInt(border*4), |
428 | 428 | 'w': parseInt( $j(document).width() ) - parseInt(border*2), |
429 | 429 | 'r': border, |
430 | 430 | 't': border |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | //set up the org_onsubmit if not set: |
68 | 68 | if( typeof( _this.org_onsubmit ) == 'undefined' ) |
69 | 69 | _this.org_onsubmit = _this.editForm.onsubmit; |
70 | | - js_log('should overwite onsubmit here::'); |
| 70 | + |
71 | 71 | //have to define the onsubmit function inline or its hard to pass the "_this" instance |
72 | 72 | _this.editForm.onsubmit = function(){ |
73 | 73 | //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 @@ |
10 | 10 | var mwUploadHelper = { |
11 | 11 | init:function(){ |
12 | 12 | 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) |
14 | 14 | $j('#wpUploadFile').firefogg({ |
15 | 15 | //an api url (we won't submit directly to action of the form) |
16 | 16 | 'api_url' : wgServer + wgScriptPath + '/api.php', |
17 | | - 'form_rewrite': true, |
18 | | - |
| 17 | + 'form_rewrite': true, |
19 | 18 | 'new_source_cb' : function( filename ){ |
20 | | - $j('#wpDestFile').val( filename ); |
21 | | - mwUploadHelper.doDestCheck(); |
22 | | - } |
| 19 | + $j('#wpDestFile').val( filename ); |
| 20 | + mwUploadHelper.doDestCheck(); |
| 21 | + } |
23 | 22 | }); |
24 | 23 | }else{ |
25 | 24 | //Add basic upload profile support ( http status monitoring, progress box for browsers that support it etc.) |