Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js |
— | — | @@ -77,10 +77,9 @@ |
78 | 78 | } |
79 | 79 | }, |
80 | 80 | setupForm:function(){ |
81 | | - var _this = this; |
| 81 | + var _this = this; |
82 | 82 | //set up the local pointer to the edit form: |
83 | | - _this.editForm = _this.getEditForm(); |
84 | | - $j(_this.editForm).attr('target', 'f_1'); |
| 83 | + _this.editForm = _this.getEditForm(); |
85 | 84 | if( _this.editForm ){ |
86 | 85 | //set up the org_onsubmit if not set: |
87 | 86 | if( typeof( _this.org_onsubmit ) == 'undefined' && _this.editForm.onsubmit ) |
— | — | @@ -182,15 +181,20 @@ |
183 | 182 | ( $j('#wpSourceTypeFile').length == 0 || $j('#wpSourceTypeFile').get(0).checked ) |
184 | 183 | ){ |
185 | 184 | //@@TODO check for sendAsBinnary to support firefox 3.5 progress |
186 | | - //else remap to iframe target |
187 | | - var id = 'f_' + ($j('iframe').length + 1); |
188 | | - $j("body").append('<iframe src="javascript:false;" id="' + id + '" ' + |
189 | | - 'name="' + id + '" style="display:none;" ></iframe>'); |
| 185 | + |
| 186 | + //set the form target to iframe target: |
| 187 | + _this.iframeId = 'f_' + ($j('iframe').length + 1); |
| 188 | + $j(_this.editForm).attr('target', _this.iframeId); |
| 189 | + |
| 190 | + //add the iframe |
| 191 | + $j("body").append('<iframe src="javascript:false;" id="' + _this.iframeId + '" ' + |
| 192 | + 'name="' + _this.iframeId + '" style="display:none;" ></iframe>'); |
| 193 | + |
190 | 194 | //set up the done binding |
191 | | - $j('#' + id).load(function(){ |
192 | | - var iframe = $j(this).get(0); |
193 | | - _this.proccessIframeResult( iframe ); |
| 195 | + $j('#' + _this.iframeId).load(function(){ |
| 196 | + _this.proccessIframeResult( $j(this).get(0) ); |
194 | 197 | }); |
| 198 | + |
195 | 199 | //set the editForm iframe target |
196 | 200 | //$j(_this.editForm).attr('target', id); |
197 | 201 | |
— | — | @@ -215,17 +219,14 @@ |
216 | 220 | //update the status to 100% progress bar (no status in iframe submit) |
217 | 221 | $j('#up-progressbar' ).progressbar('value', parseInt( 100 ) ); |
218 | 222 | $j('#up-status-container').html( gM('upload-in-progress') ); |
219 | | - |
220 | | - |
221 | | - js_log('do iframe form submit'); |
222 | 223 | |
| 224 | + js_log('do iframe form submit to: ' + $j(_this.editForm).attr('target')); |
223 | 225 | |
224 | 226 | //do post override |
225 | 227 | _this.form_post_override = true; |
226 | 228 | //reset the done with action flag: |
227 | | - _this.action_done = false; |
228 | | - //do the submit : |
229 | | - js_log('do the submit'); |
| 229 | + _this.action_done = false; |
| 230 | + |
230 | 231 | _this.editForm.submit(); |
231 | 232 | |
232 | 233 | return false; |