r79133 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79132‎ | r79133 | r79134 >
Date:21:03, 28 December 2010
Author:neilk
Status:deferred
Tags:
Comment:
move form attributes to form creation -- fix for bug 26469
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.ApiUploadHandler.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.Log.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -356,7 +356,8 @@
357357 // which works as a file input. It will be set to opacity:0 and then we can do whatever we want with
358358 // interface "below".
359359 // XXX caution -- if the add file input changes size we won't match, unless we add some sort of event to catch this.
360 - _this.form = $j('<form class="mwe-upwiz-form"></form>')
 360+ _this.form = $j( '<form method="POST" encType="multipart/form-data" class="mwe-upwiz-form"></form>' )
 361+ .attr( { action: _this.upload.api.url } )
361362 .append( visibleFilenameDiv )
362363 .append( _this.fileCtrlContainer
363364 .append( _this.$fileInputCtrl )
Index: trunk/extensions/UploadWizard/resources/mw.ApiUploadHandler.js
@@ -41,20 +41,6 @@
4242 var _this = this;
4343 mw.log( "configuring form for Upload API" );
4444
45 - // Set the form action
46 - try {
47 - this.$form.attr( {
48 - action: _this.api.url,
49 - method: 'POST',
50 - encType: 'multipart/form-data'
51 - } );
52 - } catch ( e ) {
53 - alert( "oops, form modification didn't work in ApiUploadHandler" );
54 - mw.log( "IE for some reason error's out when you change the action" );
55 - // well, if IE fucks this up perhaps we should do something to make sure it writes correctly
56 - // from the outset?
57 - }
58 -
5945 _this.addFormInputIfMissing( 'action', 'upload' );
6046
6147 // force stash
Index: trunk/extensions/UploadWizard/resources/mw.Log.js
@@ -25,6 +25,7 @@
2626 if ( typeof window.console !== 'undefined' && typeof window.console.log === 'function' ) {
2727 window.console.log( s );
2828 } else {
 29+/*
2930 // Show a log box for console-less browsers
3031 var $log = $( '#mw-log-console' );
3132 if ( !$log.length ) {
@@ -53,6 +54,7 @@
5455 } )
5556 .text( s )
5657 );
 58+*/
5759 }
5860 };
5961

Status & tagging log