r98845 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98844‎ | r98845 | r98846 >
Date:02:09, 4 October 2011
Author:neilk
Status:ok
Tags:
Comment:
add comments, remove one commented out line, remove spurious return that causes linting errs (it should use callbacks, returns nothing)
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardUpload.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUpload.js
@@ -7,6 +7,23 @@
88 */
99 ( function( $j ) {
1010
 11+/**
 12+ * Constructor for objects representing uploads. The workhorse of this entire extension.
 13+ *
 14+ * The upload knows nothing of other uploads. It manages its own interface, and transporting its own data, to
 15+ * the server.
 16+ *
 17+ * Upload objects are usually created without a file, they are just associated with a form.
 18+ * There is an "empty" fileInput which is invisibly floating above certain buttons in the interface, like "Add a file". When
 19+ * this fileInput gets a file, this upload becomes 'filled'.
 20+ *
 21+ * On some browsers, the user may select multiple files. So upon such a 'filled' event, we add the first File to this Upload, and
 22+ * then create other UploadWizardUpload objects from the individual Files, using the optional providedFile parameter.
 23+ *
 24+ * @param {UploadWizard} wizard
 25+ * @param {HTMLDivElement} filesDiv - where we will dump our the interfaces for uploads
 26+ * @param {File} providedFile - optional; only used on browsers which support FileAPI.
 27+ */
1128 mw.UploadWizardUpload = function( wizard, filesDiv, providedFile ) {
1229
1330 this.index = mw.UploadWizardUpload.prototype.count;
@@ -261,7 +278,7 @@
262279 * Error out if filename or its contents are determined to be unacceptable
263280 * Proceed to thumbnail extraction and image info if acceptable
264281 * @param {string} the filename
265 - * @param {Array} the list of files. usually one, can be more for multi-file select.
 282+ * @param {Array} of Files. usually one, can be more for multi-file select.
266283 * @param {Function()} callback when ok, and upload object is ready
267284 * @param {Function(String, Mixed)} callback when filename or contents in error. Signature of string code, mixed info
268285 */
@@ -286,7 +303,6 @@
287304
288305 if( duplicate ) {
289306 fileNameErr( 'dup', basename );
290 - return false;
291307 }
292308
293309 try {
@@ -312,7 +328,6 @@
313329 //
314330 // don't process the very first file, since that's this instance's job.
315331 $j.each( files.slice(1), function( i, file ) {
316 - //_this.wizard.setUploadFilled( _this.wizard.newUpload( file ) );
317332 _this.wizard.newUpload( file );
318333 } );
319334 _this.wizard.updateFileCounts();

Status & tagging log