r77092 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77091‎ | r77092 | r77093 >
Date:02:30, 22 November 2010
Author:neilk
Status:deferred
Tags:
Comment:
- Changed spinner icons to neutral colors (orange is for errors)
- Changed checkmark icon to a known free image (couldn't find source of checkmark.gif)
- Added triangle icon for errors
- First pass at making a layout with continuously updating "status" line as upload progresses
- Blocking on getting image metadata & previews, to verify if upload succeeded before going to next step
- Removed obsolete intro text on File step
Modified paths:
  • /trunk/extensions/UploadWizard/SpecialUploadWizard.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizardPage.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/24px-spinner-0645ad.gif (added) (history)
  • /trunk/extensions/UploadWizard/resources/24px-spinner-black.gif (added) (history)
  • /trunk/extensions/UploadWizard/resources/32px-Dialog-apply-009900.svg.png (added) (history)
  • /trunk/extensions/UploadWizard/resources/checkmark.gif (deleted) (history)
  • /trunk/extensions/UploadWizard/resources/combined.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/combined.min.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/dir.combined.css (modified) (history)
  • /trunk/extensions/UploadWizard/resources/dir.combined.min.css (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.ApiUploadHandler.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.IframeTransport.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadApiProcessor.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/spinner-orange.gif (deleted) (history)
  • /trunk/extensions/UploadWizard/resources/uploadWizard.css (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php
@@ -36,15 +36,16 @@
3737 'mwe-upwiz-tutorial-error-file-missing' => 'Sorry, we could not find any files for the tutorial that is supposed to go here. Please contact the system administrators.',
3838 'mwe-upwiz-tutorial-error-cannot-transform' => 'Sorry, we could not get a scaled image of the tutorial to fit this screen. This may be a temporary problem with Wikimedia Commons; try again later.',
3939 'mwe-upwiz-help-desk' => 'Help Desk',
40 - 'mwe-upwiz-intro' => "Welcome to Wikimedia Commons, a repository of images, sounds and movies that anyone can freely download and use.
41 -Add to humanity's knowledge by uploading files that could be used for an educational purpose.",
4240 'mwe-upwiz-add-file-n' => 'Add another file',
4341 'mwe-upwiz-add-file-0' => 'Click here to upload a file',
4442 'mwe-upwiz-browse' => 'Browse...',
45 - 'mwe-upwiz-transported' => 'OK',
46 - 'mwe-upwiz-failed' => 'Failed',
 43+ 'mwe-upwiz-transport-started' => 'Starting...',
 44+ 'mwe-upwiz-uploading' => 'Uploading...',
 45+ 'mwe-upwiz-transported' => 'Finished uploading...',
 46+ 'mwe-upwiz-stashed-upload' => 'OK',
 47+ 'mwe-upwiz-getting-metadata' => 'Getting file information and previews...',
 48+ 'mwe-upwiz-failed' => 'Failed.',
4749 'mwe-upwiz-click-here' => 'Click here to select a file',
48 - 'mwe-upwiz-uploading' => 'uploading...',
4950 'mwe-upwiz-editing' => 'editing...',
5051 'mwe-upwiz-remove' => 'Remove',
5152 'mwe-upwiz-remove-upload' => 'Remove this file from the list of files to upload',
Index: trunk/extensions/UploadWizard/resources/spinner-orange.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/UploadWizard/resources/checkmark.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/extensions/UploadWizard/resources/dir.combined.css
@@ -19,13 +19,25 @@
2020 }
2121 */
2222
 23+#mwe-upwiz-steps {
 24+ background-color: white;
 25+ background-image: none;
 26+ border: solid 1px #a7d7f9;
 27+}
2328
 29+#mwe-upwiz-steps li {
 30+ color: #666666;
 31+}
 32+
 33+#mwe-upwiz-steps li.head {
 34+ color: #000000;
 35+}
 36+
2437 .mwe-upwiz-clearing {
2538 clear: left;
2639 width: 100%;
2740 }
2841
29 -
3042 #mwe-upwiz-content {
3143 padding: 1em;
3244 }
@@ -95,7 +107,7 @@
96108 .mwe-upwiz-file-indicator, .mwe-upwiz-count {
97109 float: right;
98110 margin-left: 0.5em;
99 - padding: 0.5em 0.5em 0.5em 20px; /* 20px for the icon */
 111+ padding: 0.5em;
100112 }
101113
102114 .mwe-upwiz-visible-file .mwe-upwiz-file-indicator {
@@ -215,20 +227,21 @@
216228 text-decoration: none;
217229 }
218230
 231+.mwe-upwiz-file-indicator {
 232+ height: 40px;
 233+ width: 40px;
 234+}
 235+
219236 .mwe-upwiz-status-progress {
220 - background: url(spinner-orange.gif) no-repeat left center;
221 - font-weight: bold;
222 - color: #ff9900;
 237+ background: url(24px-spinner-0645ad.gif) no-repeat center center;
223238 }
224239
225 -.mwe-upwiz-status-completed {
226 - background: url(checkmark.gif) no-repeat left center;
227 - font-weight: bold;
228 - color: #009900;
 240+.mwe-upwiz-status-stashed {
 241+ background: url(32px-Dialog-apply-009900.svg.png) no-repeat center center;
229242 }
230243
231 -.mwe-upwiz-status-failed {
232 - background: url(16px-Gnome-process-stop.svg.png) no-repeat left center;
 244+.mwe-upwiz-status-error {
 245+ background: url(32px-Nuvola_apps_important_orange.svg.png) no-repeat left center;
233246 font-weight: bold;
234247 color: #CC0000;
235248 }
Index: trunk/extensions/UploadWizard/resources/32px-Dialog-apply-009900.svg.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/UploadWizard/resources/32px-Dialog-apply-009900.svg.png
___________________________________________________________________
Added: svn:mime-type
236249 + image/png
Index: trunk/extensions/UploadWizard/resources/dir.combined.min.css
@@ -1,17 +1,16 @@
22 form.mwe-upwiz-form{display:inline;}#upload-wizard{margin-top:18px;min-width:750px;
33 max-width:900px;
4 -}.mwe-upwiz-clearing{clear:left;width:100%;}#mwe-upwiz-content{padding:1em;}.mwe-upwiz-add-files-0,#mwe-upwiz-files{margin-top:3em;margin-bottom:3em;}.mwe-upwiz-add-files-0{text-align:center;font-size:large;}#mwe-upwiz-add-file{}
 4+}#mwe-upwiz-steps{background-color:white;background-image:none;border:solid 1px #a7d7f9;}#mwe-upwiz-steps li{color:#666666;}#mwe-upwiz-steps li.head{color:#000000;}.mwe-upwiz-clearing{clear:left;width:100%;}#mwe-upwiz-content{padding:1em;}.mwe-upwiz-add-files-0,#mwe-upwiz-files{margin-top:3em;margin-bottom:3em;}.mwe-upwiz-add-files-0{text-align:center;font-size:large;}#mwe-upwiz-add-file{}
55 #mwe-upwiz-add-file.hover{text-decoration:underline;}
66 #mwe-upwiz-add-file,.mwe-upwiz-more-options{outline:none;cursor:pointer;}
77 .mwe-upwiz-file-ctrl-container{position:absolute;overflow:hidden;}.mwe-upwiz-file-input,.mwe-upwiz-visible-file{cursor:pointer;}
8 -.mwe-upwiz-file-input,.disabler{font-size:100px;-moz-opacity:0.3;filter:alpha(opacity:0);opacity:0;z-index:2;}.mwe-upwiz-file.filled{position:relative;}.mwe-upwiz-file.odd .mwe-upwiz-visible-file{background:#f5f5f5;}.mwe-upwiz-file-status-line-item{display:inline-block;float:left;margin-right:.5em;}.mwe-upwiz-visible-file .mwe-upwiz-remove-ctrl{visibility:hidden;}.mwe-upwiz-file-indicator,.mwe-upwiz-count{float:right;margin-left:0.5em;padding:0.5em 0.5em 0.5em 20px;
9 -}.mwe-upwiz-visible-file .mwe-upwiz-file-indicator{visibility:hidden;}.mwe-upwiz-visible-file{display:none;}.mwe-upwiz-file.filled .mwe-upwiz-visible-file{display:block;}.mwe-upwiz-visible-file-filename{padding:0.5em;margin-right:40px;overflow:hidden;}.mwe-upwiz-icon{float:left;}.mwe-upwiz-filled-filelist{border:1px solid #d8d8d8;}.mwe-upwiz-file-texts{margin-left:46px;}.mwe-upwiz-file-status{display:none;color:#797979;}.mwe-upwiz-progress-bar-etr-container{
 8+.mwe-upwiz-file-input,.disabler{font-size:100px;-moz-opacity:0.3;filter:alpha(opacity:0);opacity:0;z-index:2;}.mwe-upwiz-file.filled{position:relative;}.mwe-upwiz-file.odd .mwe-upwiz-visible-file{background:#f5f5f5;}.mwe-upwiz-file-status-line-item{display:inline-block;float:left;margin-right:.5em;}.mwe-upwiz-visible-file .mwe-upwiz-remove-ctrl{visibility:hidden;}.mwe-upwiz-file-indicator,.mwe-upwiz-count{float:right;margin-left:0.5em;padding:0.5em;}.mwe-upwiz-visible-file .mwe-upwiz-file-indicator{visibility:hidden;}.mwe-upwiz-visible-file{display:none;}.mwe-upwiz-file.filled .mwe-upwiz-visible-file{display:block;}.mwe-upwiz-visible-file-filename{padding:0.5em;margin-right:40px;overflow:hidden;}.mwe-upwiz-icon{float:left;}.mwe-upwiz-filled-filelist{border:1px solid #d8d8d8;}.mwe-upwiz-file-texts{margin-left:46px;}.mwe-upwiz-file-status{display:none;color:#797979;}.mwe-upwiz-progress-bar-etr-container{
109 }
1110 .mwe-upwiz-file-preview{float:left;height:40px;width:40px;margin-right:6px;background:url(32px-Blank-document.svg.png) no-repeat center top;}.mwe-upwiz-add-files-n{float:left;margin-top:5px;margin-left:4px;}#mwe-upwiz-add-file-container.mwe-upwiz-add-files-n,.mwe-upwiz-progress-bar-etr{width:300px;padding-left:5px;}#mwe-upwiz-add-file-container.mwe-upwiz-add-files-n{float:left;}.mwe-upwiz-visible-file{width:100%;
1211 white-space:nowrap;overflow:hidden;}.mwe-upwiz-file.hover .mwe-upwiz-visible-file{background:#e0f0ff !important;}.mwe-upwiz-file.hover .mwe-upwiz-remove-ctrl{visibility:visible;}
1312 .helper{color:#cccccc;
1413 font-variant:italic,oblique;text-align:center;}#mwe-upwiz-files{margin-right:8em;margin-left:8em;}.filled + .filled{border-top:1px solid #d8d8d8;}#mwe-upwiz-upload-ctrls{margin-top:1em;}#mwe-upwiz-add-file-container{
15 -}.mwe-upwiz-details-descriptions .mwe-upwiz-remove-ctrl{vertical-align:top;display:inline-block;}a[disabled=true]{color:#999999;text-decoration:none;cursor:default;}a[disabled=true]:hover{text-decoration:none;}.mwe-upwiz-status-progress{background:url(spinner-orange.gif) no-repeat left center;font-weight:bold;color:#ff9900;}.mwe-upwiz-status-completed{background:url(checkmark.gif) no-repeat left center;font-weight:bold;color:#009900;}.mwe-upwiz-status-failed{background:url(16px-Gnome-process-stop.svg.png) no-repeat left center;font-weight:bold;color:#CC0000;}.mwe-upwiz-progress{margin-top:15px;}.mwe-upwiz-progress-bar-etr{float:left;}.mwe-upwiz-etr{text-align:center;}.mwe-upwiz-upload-warning{background:#ffffe0;}.mwe-upwiz-details-error{display:none;background:#ffffe0;}.mwe-upwiz-thumbnail,.mwe-upwiz-thumbnail-small{border:1px solid #cccccc;text-align:center;background:#ffffff;}.mwe-upwiz-thumbnail{padding:0.5em;width:120px;}.mwe-upwiz-thumbnail-side{float:left;margin-bottom:1em;margin-right:1em;}.mwe-upwiz-thumbnail-small{padding:0.25em;width:60px;}#mwe-upwiz-deeds-thumbnails{text-align:center;margin:1em 0;background:#f0f0f0;}#mwe-upwiz-deeds-thumbnails .mwe-upwiz-thumbnail-small{display:inline-block;margin:1em;vertical-align:middle;}
 14+}.mwe-upwiz-details-descriptions .mwe-upwiz-remove-ctrl{vertical-align:top;display:inline-block;}a[disabled=true]{color:#999999;text-decoration:none;cursor:default;}a[disabled=true]:hover{text-decoration:none;}.mwe-upwiz-file-indicator{height:40px;width:40px;}.mwe-upwiz-status-progress{background:url(24px-spinner-0645ad.gif) no-repeat center center;}.mwe-upwiz-status-stashed{background:url(32px-Dialog-apply-009900.svg.png) no-repeat center center;}.mwe-upwiz-status-error{background:url(32px-Nuvola_apps_important_orange.svg.png) no-repeat left center;font-weight:bold;color:#CC0000;}.mwe-upwiz-progress{margin-top:15px;}.mwe-upwiz-progress-bar-etr{float:left;}.mwe-upwiz-etr{text-align:center;}.mwe-upwiz-upload-warning{background:#ffffe0;}.mwe-upwiz-details-error{display:none;background:#ffffe0;}.mwe-upwiz-thumbnail,.mwe-upwiz-thumbnail-small{border:1px solid #cccccc;text-align:center;background:#ffffff;}.mwe-upwiz-thumbnail{padding:0.5em;width:120px;}.mwe-upwiz-thumbnail-side{float:left;margin-bottom:1em;margin-right:1em;}.mwe-upwiz-thumbnail-small{padding:0.25em;width:60px;}#mwe-upwiz-deeds-thumbnails{text-align:center;margin:1em 0;background:#f0f0f0;}#mwe-upwiz-deeds-thumbnails .mwe-upwiz-thumbnail-small{display:inline-block;margin:1em;vertical-align:middle;}
1615 .mwe-upwiz-data{float:left;width:46em;}
1716 .busy{
1817 }.mwe-upwiz-stepdiv{height:0px;overflow:hidden;}#mwe-upwiz-tutorial{text-align:center;}.shim{float:right;width:1px;}.clearShim{clear:both;height:1px;overflow:hidden;}.mwe-checkbox-hang-indent{float:left;width:24px;margin-top:6px;}.mwe-checkbox-hang-indent-text{margin-left:24px;}.mwe-small-print{font-size:x-small;}.mwe-upwiz-deed{margin-left:24px;}.mwe-upwiz-deed.selected .mwe-upwiz-deed-name{font-weight:bold;}.mwe-more-options,.mwe-upwiz-macro-deeds-return,.mwe-upwiz-deed-header-link{cursor:pointer;}.mwe-more-options{padding-bottom:4px;}.mwe-upwiz-deed-license{margin-left:24px;}#mwe-upwiz-macro-deeds{margin-top:12px;margin-bottom:24px;}#mwe-upwiz-macro-files{margin-top:12px;}.mwe-upwiz-info-file{margin-bottom:1em;}.mwe-upwiz-details-input{width:33em;float:left;}.mwe-upwiz-details-fieldname{width:10em;padding-top:0.5em;float:left;}.mwe-upwiz-details-input-error{padding-left:10em;
Index: trunk/extensions/UploadWizard/resources/24px-spinner-0645ad.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/UploadWizard/resources/24px-spinner-0645ad.gif
___________________________________________________________________
Added: svn:mime-type
1918 + application/octet-stream
Index: trunk/extensions/UploadWizard/resources/24px-spinner-black.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/UploadWizard/resources/24px-spinner-black.gif
___________________________________________________________________
Added: svn:mime-type
2019 + application/octet-stream
Index: trunk/extensions/UploadWizard/resources/combined.js
@@ -5854,7 +5854,7 @@
58555855
58565856 $j.ajax( ajaxOptions );
58575857
5858 - },
 5858+ }
58595859
58605860 }
58615861
@@ -7912,7 +7912,9 @@
79137913 var _this = this;
79147914 this.transport = new mw.IframeTransport(
79157915 this.$form,
7916 - function( fraction ){ _this.upload.setTransportProgress( fraction ); },
 7916+ function( fraction ) {
 7917+ _this.upload.setTransportProgress( fraction );
 7918+ },
79177919 function( result ) {
79187920 _this.upload.setTransported( result );
79197921 }
@@ -7998,7 +8000,8 @@
79998001 var ok = function() {
80008002 mw.log( "api: upload start!" );
80018003 _this.beginTime = ( new Date() ).getTime();
8002 - _this.upload.ui.busy();
 8004+ _this.upload.ui.setStatus( 'mwe-upwiz-transport-started' );
 8005+ _this.upload.ui.showTransportProgress();
80038006 _this.$form.submit();
80048007 };
80058008 var err = function( code, info ) {
@@ -8349,7 +8352,7 @@
83508353 /**
83518354 * this is a progress bar for monitoring multiple objects, giving summary view
83528355 */
8353 -mw.GroupProgressBar = function( selector, text, uploads, endState, progressProperty, weightProperty ) {
 8356+mw.GroupProgressBar = function( selector, text, uploads, endStates, progressProperty, weightProperty ) {
83548357 var _this = this;
83558358
83568359 // XXX need to figure out a way to put text inside bar
@@ -8369,7 +8372,7 @@
83708373 _this.$selector.find( '.mwe-upwiz-progress-bar' ).progressbar( { value : 0 } );
83718374
83728375 _this.uploads = uploads;
8373 - _this.endState = endState;
 8376+ _this.endStates = endStates;
83748377 _this.progressProperty = progressProperty;
83758378 _this.weightProperty = weightProperty;
83768379 _this.beginTime = undefined;
@@ -8404,7 +8407,7 @@
84058408 var endStateCount = 0;
84068409 var hasData = false;
84078410 $j.each( _this.uploads, function( i, upload ) {
8408 - if ( upload.state == _this.endState ) {
 8411+ if ( $j.inArray( upload.state, _this.endStates ) !== -1 ) {
84098412 endStateCount++;
84108413 }
84118414 if (upload[_this.progressProperty] !== undefined) {
@@ -9115,7 +9118,7 @@
91169119 * Represents the upload -- in its local and remote state. (Possibly those could be separate objects too...)
91179120 * This is our 'model' object if we are thinking MVC. Needs to be better factored, lots of feature envy with the UploadWizard
91189121 * states:
9119 - * 'new' 'transporting' 'transported' 'details' 'submitting-details' 'complete' 'failed'
 9122+ * 'new' 'transporting' 'transported' 'metadata' 'stashed' 'details' 'submitting-details' 'complete' 'error'
91209123 * should fork this into two -- local and remote, e.g. filename
91219124 */
91229125 ( function( $j ) {
@@ -9194,11 +9197,11 @@
91959198 /**
91969199 * Stop the upload -- we have failed for some reason
91979200 */
9198 - setFailed: function( code ) {
 9201+ setError: function( code, info ) {
91999202 /* stop the upload progress */
9200 - this.state = 'failed';
 9203+ this.state = 'error';
92019204 this.transportProgress = 0;
9202 - this.ui.showFailed( code );
 9205+ this.ui.showError( code, info );
92039206 },
92049207
92059208 /**
@@ -9212,10 +9215,24 @@
92139216 // success
92149217 _this.state = 'transported';
92159218 _this.transportProgress = 1;
9216 - _this.ui.showTransported();
9217 - _this.extractUploadInfo( result );
9218 - _this.deedPreview.setup();
9219 - _this.details.populate();
 9219+ _this.ui.setStatus( 'mwe-upwiz-getting-metadata' );
 9220+ _this.extractUploadInfo( result );
 9221+ var setupDeedsAndShowComplete = function() {
 9222+ _this.ui.setPreview( $img );
 9223+ _this.deedPreview.setup();
 9224+ _this.details.populate();
 9225+ _this.state = 'stashed';
 9226+ _this.ui.showStashed();
 9227+ };
 9228+ var $img = $j( '<img/>' ).load( setupDeedsAndShowComplete );
 9229+ // blocking preload for thumbnail
 9230+ _this.getThumbnail(
 9231+ function( thumbnailAttrs ) {
 9232+ $img.attr( thumbnailAttrs );
 9233+ },
 9234+ mw.UploadWizard.config[ 'iconThumbnailWidth' ],
 9235+ mw.UploadWizard.config[ 'iconThumbnailMaxHeight' ]
 9236+ );
92209237
92219238 } else if ( result.upload && result.upload.sessionkey ) {
92229239 // there was a warning - type error which prevented it from adding the result to the db
@@ -9226,14 +9243,14 @@
92279244
92289245 // and other errors that result in a stash
92299246 } else {
9230 - // XXX handle errors better
9231 - _this.state = 'error';
9232 - _this.ui.showFailed();
 9247+ // XXX handle errors better -- get code and pass to showError
 9248+ var code = 'unknown';
 9249+ var info = 'unknown';
92339250 if ( result.error ) {
9234 - alert( "error : " + result.error.code + " : " + result.error.info );
 9251+ code = result.error.code;
 9252+ info = result.error.info;
92359253 }
9236 - // TODO now we should tag the upload as failed
9237 - // if can recover, should maybe allow re-uploading.
 9254+ _this.setError( code, info );
92389255 }
92399256
92409257 },
@@ -9300,15 +9317,19 @@
93019318 },
93029319
93039320 /**
9304 - * Fetch a thumbnail for this upload of the desired width.
 9321+ * Fetch a thumbnail for a stashed upload of the desired width.
93059322 * It is assumed you don't call this until it's been transported.
93069323 *
 9324+ * @param callback - callback to execute once thumbnail has been obtained -- must accept Image object
93079325 * @param width - desired width of thumbnail (height will scale to match)
9308 - * @param callback - callback to execute once thumbnail has been obtained -- must accept Image object
 9326+ * @param height - (optional) maximum height of thumbnail
93099327 */
9310 - getThumbnail: function( width, callback ) {
 9328+ getThumbnail: function( callback, width, height ) {
93119329 var _this = this;
9312 - var key = "width" + width;
 9330+ if ( mw.isEmpty( height ) ) {
 9331+ height = -1;
 9332+ }
 9333+ var key = "width" + width + ',height' + height;
93139334 if ( mw.isDefined( _this.thumbnails[key] ) ) {
93149335 callback( _this.thumbnails[key] );
93159336 } else {
@@ -9316,6 +9337,7 @@
93179338 'prop': 'stashimageinfo',
93189339 'siisessionkey': _this.sessionKey,
93199340 'siiurlwidth': width,
 9341+ 'siiurlheight': height,
93209342 'siiprop': 'url'
93219343 };
93229344
@@ -9345,13 +9367,18 @@
93469368 *
93479369 * @param selector
93489370 * @param width
 9371+ * @param height (optional)
93499372 */
9350 - setThumbnail: function( selector, width ) {
 9373+ setThumbnail: function( selector, width, height ) {
93519374 var _this = this;
93529375 if ( typeof width === 'undefined' || width === null || width <= 0 ) {
93539376 width = mw.UploadWizard.config[ 'thumbnailWidth' ];
93549377 }
93559378 width = parseInt( width, 10 );
 9379+ height = null;
 9380+ if ( !mw.isEmpty( height ) ) {
 9381+ height = parseInt( height, 10 );
 9382+ }
93569383
93579384 var callback = function( thumbnail ) {
93589385 // side effect: will replace thumbnail's loadingSpinner
@@ -9367,7 +9394,7 @@
93689395 };
93699396
93709397 $j( selector ).loadingSpinner();
9371 - _this.getThumbnail( width, callback );
 9398+ _this.getThumbnail( callback, width, height );
93729399 }
93739400
93749401 };
@@ -9388,9 +9415,8 @@
93899416 _this.div = $j('<div class="mwe-upwiz-file"></div>').get(0);
93909417 _this.isFilled = false;
93919418
9392 - _this.fileInputCtrl = $j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>')
9393 - .change( function() { _this.fileChanged(); } )
9394 - .get(0);
 9419+ _this.$fileInputCtrl = $j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>')
 9420+ .change( function() { _this.fileChanged(); } );
93959421
93969422
93979423 visibleFilenameDiv = $j('<div class="mwe-upwiz-visible-file"></div>')
@@ -9405,15 +9431,16 @@
94069432 + '</div>'
94079433 + '</div>'
94089434 );
9409 - visibleFilenameDiv.find( '.mwe-upwiz-file-status-line' ).append(
9410 - $j.fn.removeCtrl(
9411 - 'mwe-upwiz-remove',
9412 - 'mwe-upwiz-remove-upload',
9413 - function() { _this.upload.remove(); }
9414 - ).addClass( "mwe-upwiz-file-status-line-item" )
9415 - );
94169435
 9436+ _this.$removeCtrl = $j.fn.removeCtrl(
 9437+ 'mwe-upwiz-remove',
 9438+ 'mwe-upwiz-remove-upload',
 9439+ function() { _this.upload.remove(); }
 9440+ ).addClass( "mwe-upwiz-file-status-line-item" );
94179441
 9442+ visibleFilenameDiv.find( '.mwe-upwiz-file-status-line' )
 9443+ .append( _this.$removeCtrl );
 9444+
94189445 //_this.errorDiv = $j('<div class="mwe-upwiz-upload-error mwe-upwiz-file-indicator" style="display: none;"></div>').get(0);
94199446
94209447 _this.filenameCtrl = $j('<input type="hidden" name="filename" value=""/>').get(0);
@@ -9437,7 +9464,7 @@
94389465 _this.form = $j('<form class="mwe-upwiz-form"></form>')
94399466 .append( visibleFilenameDiv )
94409467 .append( _this.fileCtrlContainer
9441 - .append( _this.fileInputCtrl )
 9468+ .append( _this.$fileInputCtrl )
94429469 )
94439470 .append( _this.filenameCtrl )
94449471 .append( _this.thumbnailParam )
@@ -9453,7 +9480,7 @@
94549481 // _this.progressBar = ( no progress bar for individual uploads yet )
94559482 // we bind to the ui div since unbind doesn't work for non-DOM objects
94569483 $j( _this.div ).bind( 'transportProgressEvent', function(e) { _this.showTransportProgress(); } );
9457 - // $j( _this.div ).bind( 'transportedEvent', function(e) { _this.showTransported(); } );
 9484+ // $j( _this.div ).bind( 'transportedEvent', function(e) { _this.showStashed(); } );
94589485
94599486 };
94609487
@@ -9475,17 +9502,10 @@
94769503 .remove();
94779504 },
94789505
9479 - busy: function() {
9480 - var _this = this;
9481 - // for now we implement this as looking like "100% progress"
9482 - // e.g. an animated bar that takes up all the space
9483 - // _this.showTransportProgress();
9484 - },
9485 -
94869506 /**
94879507 * change the indicator at the far right
94889508 */
9489 - showIndicatorMessage: function( statusClass, msgKey ) {
 9509+ showIndicator: function( statusClass ) {
94909510 var _this = this;
94919511 var $indicator = $j( _this.div ).find( '.mwe-upwiz-file-indicator' );
94929512 $j.each( $indicator.attr( 'class' ).split( /\s+/ ), function( i, className ) {
@@ -9493,13 +9513,16 @@
94949514 $indicator.removeClass( className );
94959515 }
94969516 } );
9497 - $indicator.addClass( 'mwe-upwiz-status-' + statusClass )
9498 - .html( gM( msgKey ) );
 9517+ $indicator.addClass( 'mwe-upwiz-status-' + statusClass );
 9518+ // is this causing dancing when we switch from spinner to checkmark?
94999519 $j( _this.div ).find( '.mwe-upwiz-visible-file-filename' )
95009520 .css( 'margin-right', ( $indicator.outerWidth() + 24 ).toString() + 'px' );
95019521 $indicator.css( 'visibility', 'visible' );
 9522+ },
95029523
9503 - _this.setStatus( msgKey );
 9524+ setPreview: function( $img ) {
 9525+ // encoding for url here?
 9526+ $j( this.div ).find( '.mwe-upwiz-file-preview' ).css( 'background-image', 'url(' + $img.attr( 'src' ) + ')' );
95049527 },
95059528
95069529 // too abstract?
@@ -9523,23 +9546,28 @@
95249547 * @param fraction The fraction of progress. Float between 0 and 1
95259548 */
95269549 showTransportProgress: function( fraction ) {
9527 - this.showIndicatorMessage( 'progress', 'mwe-upwiz-uploading' );
9528 - // update individual progress bar with fraction?
 9550+ // if fraction available, update individual progress bar / estimates, etc.
 9551+ this.showIndicator( 'progress' );
 9552+ this.setStatus( 'mwe-upwiz-uploading' );
95299553 },
95309554
95319555 /**
95329556 * Show that upload is transported
95339557 */
9534 - showTransported: function() {
9535 - this.showIndicatorMessage( 'completed', 'mwe-upwiz-transported' );
 9558+ showStashed: function() {
 9559+ this.$removeCtrl.detach();
 9560+ this.$fileInputCtrl.detach();
 9561+ this.showIndicator( 'stashed' );
 9562+ this.setStatus( 'mwe-upwiz-stashed-upload' ); // this is just "OK", say something more.
95369563 },
95379564
95389565 /**
95399566 * Show that transport has failed
95409567 */
9541 - showFailed: function( code ) {
9542 - this.showIndicatorMessage( 'failed', 'mwe-upwiz-failed' );
9543 - //add a "retry" button, too?
 9568+ showError: function( code, info ) {
 9569+ // XXX TODO use code
 9570+ this.showIndicator( 'error' );
 9571+ // create a status message for the error
95449572 },
95459573
95469574 /**
@@ -9549,7 +9577,7 @@
95509578 fileChanged: function() {
95519579 var _this = this;
95529580 _this.clearErrors();
9553 - _this.upload.extractLocalFileInfo( $j( _this.fileInputCtrl ).val() );
 9581+ _this.upload.extractLocalFileInfo( _this.$fileInputCtrl.val() );
95549582 if ( _this.isGoodExtension( _this.upload.title.getExtension() ) ) {
95559583 _this.updateFilename();
95569584 } else {
@@ -9578,9 +9606,9 @@
95799607 // shift the file input over with negative margins,
95809608 // internal to the overflow-containing div, so the div shows all button
95819609 // and none of the textfield-like input
9582 - $j( this.fileInputCtrl ).css( {
9583 - 'margin-left': '-' + ~~( $j( this.fileInputCtrl ).width() - $covered.outerWidth() - 10 ) + 'px',
9584 - 'margin-top' : '-' + ~~( $j( this.fileInputCtrl ).height() - $covered.outerHeight() - 10 ) + 'px'
 9610+ this.$fileInputCtrl.css( {
 9611+ 'margin-left': '-' + ~~( this.$fileInputCtrl.width() - $covered.outerWidth() - 10 ) + 'px',
 9612+ 'margin-top' : '-' + ~~( this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px'
95859613 } );
95869614
95879615
@@ -9597,7 +9625,7 @@
95989626 updateFilename: function() {
95999627 var _this = this;
96009628 // TODO get basename of file; Chrome does this C:\fakepath\something which is highly irritating
9601 - var path = _this.fileInputCtrl.value;
 9629+ var path = _this.$fileInputCtrl.val();
96029630
96039631 // visible filenam.
96049632 $j( _this.form ).find( '.mwe-upwiz-visible-file-filename-text' ).html( path );
@@ -10211,7 +10239,7 @@
1021210240 populate: function() {
1021310241 var _this = this;
1021410242 mw.log( "populating details from upload" );
10215 - _this.upload.setThumbnail( _this.thumbnailDiv );
 10243+ _this.upload.setThumbnail( _this.thumbnailDiv, mw.UploadWizard.config['thumbnailWidth'], mw.UploadWizard.config['thumbnailMaxHeight'] );
1021610244 _this.prefillDate();
1021710245 _this.prefillSource();
1021810246 _this.prefillAuthor();
@@ -10642,56 +10670,21 @@
1064310671 $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-button-next')
1064410672 .append( gM( 'mwe-upwiz-next-file' ) )
1064510673 .click( function() {
10646 - // check if there is an upload at all
10647 - if ( _this.uploads.length === 0 ) {
10648 - // XXX use standard error message
10649 - alert( gM( 'mwe-upwiz-file-need-file' ) );
10650 - return;
10651 - }
10652 -
10653 - _this.removeEmptyUploads();
10654 - _this.startUploads( function() {
10655 -
10656 - // okay all uploads are done, we're ready to go to the next step
10657 -
10658 - // do some last minute prep before advancing to the DEEDS page
10659 -
10660 - // these deeds are standard
10661 - var deeds = [
10662 - new mw.UploadWizardDeedOwnWork( _this.uploads.length ),
10663 - new mw.UploadWizardDeedThirdParty( _this.uploads.length )
10664 - ];
10665 -
10666 - // if we have multiple uploads, also give them the option to set
10667 - // licenses individually
10668 - if ( _this.uploads.length > 1 ) {
10669 - var customDeed = $j.extend( new mw.UploadWizardDeed(), {
10670 - valid: function() { return true; },
10671 - name: 'custom'
10672 - } );
10673 - deeds.push( customDeed );
 10674+ // check if there is an upload at all (should never happen)
 10675+ if ( _this.uploads.length === 0 ) {
 10676+ // XXX use standard error message
 10677+ alert( gM( 'mwe-upwiz-file-need-file' ) );
 10678+ return;
1067410679 }
1067510680
10676 - _this.deedChooser = new mw.UploadWizardDeedChooser(
10677 - '#mwe-upwiz-deeds',
10678 - deeds,
10679 - _this.uploads.length );
10680 -
10681 - $j( '<div>' ).html( gM( 'mwe-upwiz-deeds-macro-prompt', _this.uploads.length ) )
10682 - .insertBefore ( _this.deedChooser.$selector.find( '.mwe-upwiz-deed-ownwork' ) );
 10681+ _this.removeEmptyUploads();
 10682+ _this.startUploads( function() {
 10683+ // okay all uploads are done, we may be ready to go to the next step
 10684+ alert( "hey, uploads are done");
1068310685
10684 - if ( _this.uploads.length > 1 ) {
10685 - $j( '<div style="margin-top: 1em">' ).html( gM( 'mwe-upwiz-deeds-custom-prompt' ) )
10686 - .insertBefore( _this.deedChooser.$selector.find( '.mwe-upwiz-deed-custom' ) );
10687 - }
 10686+ } );
 10687+ } );
1068810688
10689 -
10690 - _this.moveToStep( 'deeds' );
10691 -
10692 - } );
10693 - } );
10694 -
10695 -
1069610689 // DEEDS div
1069710690
1069810691 $j( '#mwe-upwiz-deeds-intro' ).html( gM( 'mwe-upwiz-deeds-intro' ) );
@@ -10752,6 +10745,43 @@
1075310746
1075410747 },
1075510748
 10749+
 10750+ // do some last minute prep before advancing to the DEEDS page
 10751+ prepareAndMoveToDeeds: function() {
 10752+
 10753+ // these deeds are standard
 10754+ var deeds = [
 10755+ new mw.UploadWizardDeedOwnWork( _this.uploads.length ),
 10756+ new mw.UploadWizardDeedThirdParty( _this.uploads.length )
 10757+ ];
 10758+
 10759+ // if we have multiple uploads, also give them the option to set
 10760+ // licenses individually
 10761+ if ( _this.uploads.length > 1 ) {
 10762+ var customDeed = $j.extend( new mw.UploadWizardDeed(), {
 10763+ valid: function() { return true; },
 10764+ name: 'custom'
 10765+ } );
 10766+ deeds.push( customDeed );
 10767+ }
 10768+
 10769+ _this.deedChooser = new mw.UploadWizardDeedChooser(
 10770+ '#mwe-upwiz-deeds',
 10771+ deeds,
 10772+ _this.uploads.length );
 10773+
 10774+ $j( '<div>' ).html( gM( 'mwe-upwiz-deeds-macro-prompt', _this.uploads.length ) )
 10775+ .insertBefore ( _this.deedChooser.$selector.find( '.mwe-upwiz-deed-ownwork' ) );
 10776+
 10777+ if ( _this.uploads.length > 1 ) {
 10778+ $j( '<div style="margin-top: 1em">' ).html( gM( 'mwe-upwiz-deeds-custom-prompt' ) )
 10779+ .insertBefore( _this.deedChooser.$selector.find( '.mwe-upwiz-deed-custom' ) );
 10780+ }
 10781+
 10782+ _this.moveToStep( 'deeds' );
 10783+
 10784+ },
 10785+
1075610786 /**
1075710787 * Advance one "step" in the wizard interface.
1075810788 * It is assumed that the previous step to the current one was selected.
@@ -10896,7 +10926,7 @@
1089710927 var toRemove = [];
1089810928
1089910929 for ( var i = 0; i < _this.uploads.length; i++ ) {
10900 - if ( mw.isEmpty( _this.uploads[i].ui.fileInputCtrl.value ) ) {
 10930+ if ( mw.isEmpty( _this.uploads[i].ui.$fileInputCtrl.val() ) ) {
1090110931 toRemove.push( _this.uploads[i] );
1090210932 }
1090310933 }
@@ -10911,11 +10941,11 @@
1091210942 *
1091310943 * @param beginState what state the upload should be in before starting.
1091410944 * @param progressState the state to set the upload to while it's doing whatever
10915 - * @param endState the state to set the upload to after it's done whatever
 10945+ * @param endState the state (or array of states) that signify we're done with this process
1091610946 * @param starter function, taking single argument (upload) which starts the process we're interested in
1091710947 * @param endCallback function to call when all uploads are in the end state.
1091810948 */
10919 - makeTransitioner: function( beginState, progressState, endState, starter, endCallback ) {
 10949+ makeTransitioner: function( beginState, progressStates, endStates, starter, endCallback ) {
1092010950
1092110951 var _this = this;
1092210952
@@ -10923,9 +10953,9 @@
1092410954 var uploadsToStart = _this.maxSimultaneousConnections;
1092510955 var endStateCount = 0;
1092610956 $j.each( _this.uploads, function(i, upload) {
10927 - if ( upload.state == endState ) {
 10957+ if ( $j.inArray( upload.state, endStates ) !== -1 ) {
1092810958 endStateCount++;
10929 - } else if ( upload.state == progressState ) {
 10959+ } else if ( $j.inArray( upload.state, progressStates ) !== -1 ) {
1093010960 uploadsToStart--;
1093110961 } else if ( ( upload.state == beginState ) && ( uploadsToStart > 0 ) ) {
1093210962 starter( upload );
@@ -10965,7 +10995,7 @@
1096610996 var progressBar = new mw.GroupProgressBar( '#mwe-upwiz-progress',
1096710997 gM( 'mwe-upwiz-uploading' ),
1096810998 _this.uploads,
10969 - 'transported',
 10999+ [ 'stashed' ],
1097011000 'transportProgress',
1097111001 'transportWeight' );
1097211002 progressBar.start();
@@ -10979,8 +11009,8 @@
1098011010 // the progress bar and elapsed time
1098111011 _this.makeTransitioner(
1098211012 'new',
10983 - 'transporting',
10984 - 'transported',
 11013+ [ 'transporting', 'transported', 'metadata' ],
 11014+ [ 'error', 'verified' ],
1098511015 function( upload ) {
1098611016 upload.start();
1098711017 },
@@ -11088,8 +11118,8 @@
1108911119 // add in the upload count
1109011120 _this.makeTransitioner(
1109111121 'details',
11092 - 'submitting-details',
11093 - 'complete',
 11122+ [ 'submitting-details' ],
 11123+ [ 'complete' ],
1109411124 function( upload ) {
1109511125 upload.details.submit( function() {
1109611126 upload.details.div.data( 'mask' ).html();
@@ -11186,22 +11216,13 @@
1118711217 // add a preview on the deeds page
1118811218 var thumbnailDiv = $j( '<div class="mwe-upwiz-thumbnail-small"></div>' );
1118911219 $j( '#mwe-upwiz-deeds-thumbnails' ).append( thumbnailDiv );
11190 - _this.upload.setThumbnail( thumbnailDiv, mw.UploadWizard.config[ 'smallThumbnailWidth' ] );
 11220+ _this.upload.setThumbnail( thumbnailDiv, mw.UploadWizard.config[ 'smallThumbnailWidth' ], mw.UploadWizard.config[ 'smallThumbnailMaxHeight' ] );
1119111221 }
1119211222 };
11193 - /**
11194 - * Create 'remove' control, an X which highlights in some standardized way.
11195 - */
11196 - $j.fn.removeCtrl = function( msgKey, tooltipMsgKey, callback ) {
11197 - var msg = (msgKey === null) ? '' : gM( msgKey );
11198 - return $j( '<div class="mwe-upwiz-remove-ctrl ui-corner-all" />' )
11199 - .attr( 'title', gM( tooltipMsgKey ) )
11200 - .click( callback )
11201 - .hover( function() { $j( this ).addClass( 'hover' ); },
11202 - function() { $j( this ).removeClass( 'hover' ); } )
11203 - .append( $j( '<div class="ui-icon ui-icon-close" /><div class="mwe-upwiz-remove-ctrl-msg">' + msg + '</div>' ) );
11204 - };
1120511223
 11224+} )( jQuery );
 11225+
 11226+( function ( $j ) {
1120611227 /**
1120711228 * Prevent the closing of a window with a confirm message (the onbeforeunload event seems to
1120811229 * work in most browsers
@@ -11420,7 +11441,11 @@
1142111442 apiUrl: apiUrl,
1142211443
1142311444 thumbnailWidth: 120,
 11445+ thumbnailMaxHeight: 200,
1142411446 smallThumbnailWidth: 60,
 11447+ smallThumbnailMaxHeight: 100,
 11448+ iconThumbnailWidth: 32,
 11449+ iconThumbnailMaxHeight: 32,
1142511450 maxAuthorLength: 50,
1142611451 minAuthorLength: 2,
1142711452 maxSourceLength: 200,
Index: trunk/extensions/UploadWizard/resources/uploadWizard.css
@@ -107,7 +107,7 @@
108108 .mwe-upwiz-file-indicator, .mwe-upwiz-count {
109109 float: right;
110110 margin-left: 0.5em;
111 - padding: 0.5em 0.5em 0.5em 20px; /* 20px for the icon */
 111+ padding: 0.5em;
112112 }
113113
114114 .mwe-upwiz-visible-file .mwe-upwiz-file-indicator {
@@ -227,16 +227,17 @@
228228 text-decoration: none;
229229 }
230230
 231+.mwe-upwiz-file-indicator {
 232+ height: 40px;
 233+ width: 40px;
 234+}
 235+
231236 .mwe-upwiz-status-progress {
232 - background: url(spinner-orange.gif) no-repeat left center;
233 - font-weight: bold;
234 - color: #ff9900;
 237+ background: url(24px-spinner-0645ad.gif) no-repeat center center;
235238 }
236239
237 -.mwe-upwiz-status-completed {
238 - background: url(32px-Dialog-apply.svg.png) no-repeat left center;
239 - font-weight: bold;
240 - color: #009900;
 240+.mwe-upwiz-status-stashed {
 241+ background: url(32px-Dialog-apply-009900.svg.png) no-repeat center center;
241242 }
242243
243244 .mwe-upwiz-status-error {
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -2,7 +2,7 @@
33 * Represents the upload -- in its local and remote state. (Possibly those could be separate objects too...)
44 * This is our 'model' object if we are thinking MVC. Needs to be better factored, lots of feature envy with the UploadWizard
55 * states:
6 - * 'new' 'transporting' 'transported' 'metadata' 'thumbnailed' 'details' 'submitting-details' 'complete' 'error'
 6+ * 'new' 'transporting' 'transported' 'metadata' 'stashed' 'details' 'submitting-details' 'complete' 'error'
77 * should fork this into two -- local and remote, e.g. filename
88 */
99 ( function( $j ) {
@@ -99,10 +99,24 @@
100100 // success
101101 _this.state = 'transported';
102102 _this.transportProgress = 1;
103 - _this.ui.showTransported();
104 - _this.extractUploadInfo( result );
105 - _this.deedPreview.setup();
106 - _this.details.populate();
 103+ _this.ui.setStatus( 'mwe-upwiz-getting-metadata' );
 104+ _this.extractUploadInfo( result );
 105+ var setupDeedsAndShowComplete = function() {
 106+ _this.ui.setPreview( $img );
 107+ _this.deedPreview.setup();
 108+ _this.details.populate();
 109+ _this.state = 'stashed';
 110+ _this.ui.showStashed();
 111+ };
 112+ var $img = $j( '<img/>' ).load( setupDeedsAndShowComplete );
 113+ // blocking preload for thumbnail
 114+ _this.getThumbnail(
 115+ function( thumbnailAttrs ) {
 116+ $img.attr( thumbnailAttrs );
 117+ },
 118+ mw.UploadWizard.config[ 'iconThumbnailWidth' ],
 119+ mw.UploadWizard.config[ 'iconThumbnailMaxHeight' ]
 120+ );
107121
108122 } else if ( result.upload && result.upload.sessionkey ) {
109123 // there was a warning - type error which prevented it from adding the result to the db
@@ -187,15 +201,19 @@
188202 },
189203
190204 /**
191 - * Fetch a thumbnail for this upload of the desired width.
 205+ * Fetch a thumbnail for a stashed upload of the desired width.
192206 * It is assumed you don't call this until it's been transported.
193207 *
 208+ * @param callback - callback to execute once thumbnail has been obtained -- must accept Image object
194209 * @param width - desired width of thumbnail (height will scale to match)
195 - * @param callback - callback to execute once thumbnail has been obtained -- must accept Image object
 210+ * @param height - (optional) maximum height of thumbnail
196211 */
197 - getThumbnail: function( width, callback ) {
 212+ getThumbnail: function( callback, width, height ) {
198213 var _this = this;
199 - var key = "width" + width;
 214+ if ( mw.isEmpty( height ) ) {
 215+ height = -1;
 216+ }
 217+ var key = "width" + width + ',height' + height;
200218 if ( mw.isDefined( _this.thumbnails[key] ) ) {
201219 callback( _this.thumbnails[key] );
202220 } else {
@@ -203,6 +221,7 @@
204222 'prop': 'stashimageinfo',
205223 'siisessionkey': _this.sessionKey,
206224 'siiurlwidth': width,
 225+ 'siiurlheight': height,
207226 'siiprop': 'url'
208227 };
209228
@@ -232,13 +251,18 @@
233252 *
234253 * @param selector
235254 * @param width
 255+ * @param height (optional)
236256 */
237 - setThumbnail: function( selector, width ) {
 257+ setThumbnail: function( selector, width, height ) {
238258 var _this = this;
239259 if ( typeof width === 'undefined' || width === null || width <= 0 ) {
240260 width = mw.UploadWizard.config[ 'thumbnailWidth' ];
241261 }
242262 width = parseInt( width, 10 );
 263+ height = null;
 264+ if ( !mw.isEmpty( height ) ) {
 265+ height = parseInt( height, 10 );
 266+ }
243267
244268 var callback = function( thumbnail ) {
245269 // side effect: will replace thumbnail's loadingSpinner
@@ -254,7 +278,7 @@
255279 };
256280
257281 $j( selector ).loadingSpinner();
258 - _this.getThumbnail( width, callback );
 282+ _this.getThumbnail( callback, width, height );
259283 }
260284
261285 };
@@ -291,16 +315,16 @@
292316 + '</div>'
293317 + '</div>'
294318 );
 319+
295320 _this.$removeCtrl = $j.fn.removeCtrl(
296321 'mwe-upwiz-remove',
297322 'mwe-upwiz-remove-upload',
298323 function() { _this.upload.remove(); }
299 - );
 324+ ).addClass( "mwe-upwiz-file-status-line-item" );
 325+
300326 visibleFilenameDiv.find( '.mwe-upwiz-file-status-line' )
301 - .append( _this.$removeCtrl )
302 - .addClass( "mwe-upwiz-file-status-line-item" );
 327+ .append( _this.$removeCtrl );
303328
304 -
305329 //_this.errorDiv = $j('<div class="mwe-upwiz-upload-error mwe-upwiz-file-indicator" style="display: none;"></div>').get(0);
306330
307331 _this.filenameCtrl = $j('<input type="hidden" name="filename" value=""/>').get(0);
@@ -340,7 +364,7 @@
341365 // _this.progressBar = ( no progress bar for individual uploads yet )
342366 // we bind to the ui div since unbind doesn't work for non-DOM objects
343367 $j( _this.div ).bind( 'transportProgressEvent', function(e) { _this.showTransportProgress(); } );
344 - // $j( _this.div ).bind( 'transportedEvent', function(e) { _this.showTransported(); } );
 368+ // $j( _this.div ).bind( 'transportedEvent', function(e) { _this.showStashed(); } );
345369
346370 };
347371
@@ -365,8 +389,7 @@
366390 /**
367391 * change the indicator at the far right
368392 */
369 - showIndicatorMessage: function( statusClass, msgKey ) {
370 - debugger;
 393+ showIndicator: function( statusClass ) {
371394 var _this = this;
372395 var $indicator = $j( _this.div ).find( '.mwe-upwiz-file-indicator' );
373396 $j.each( $indicator.attr( 'class' ).split( /\s+/ ), function( i, className ) {
@@ -374,13 +397,16 @@
375398 $indicator.removeClass( className );
376399 }
377400 } );
378 - $indicator.addClass( 'mwe-upwiz-status-' + statusClass )
379 - .html( gM( msgKey ) );
 401+ $indicator.addClass( 'mwe-upwiz-status-' + statusClass );
 402+ // is this causing dancing when we switch from spinner to checkmark?
380403 $j( _this.div ).find( '.mwe-upwiz-visible-file-filename' )
381404 .css( 'margin-right', ( $indicator.outerWidth() + 24 ).toString() + 'px' );
382405 $indicator.css( 'visibility', 'visible' );
 406+ },
383407
384 - _this.setStatus( msgKey );
 408+ setPreview: function( $img ) {
 409+ // encoding for url here?
 410+ $j( this.div ).find( '.mwe-upwiz-file-preview' ).css( 'background-image', 'url(' + $img.attr( 'src' ) + ')' );
385411 },
386412
387413 // too abstract?
@@ -405,17 +431,18 @@
406432 */
407433 showTransportProgress: function( fraction ) {
408434 // if fraction available, update individual progress bar / estimates, etc.
409 - this.showIndicatorMessage( 'progress' );
 435+ this.showIndicator( 'progress' );
410436 this.setStatus( 'mwe-upwiz-uploading' );
411437 },
412438
413439 /**
414440 * Show that upload is transported
415441 */
416 - showTransported: function() {
 442+ showStashed: function() {
417443 this.$removeCtrl.detach();
418444 this.$fileInputCtrl.detach();
419 - this.showIndicatorMessage( 'completed', 'mwe-upwiz-transported' );
 445+ this.showIndicator( 'stashed' );
 446+ this.setStatus( 'mwe-upwiz-stashed-upload' ); // this is just "OK", say something more.
420447 },
421448
422449 /**
@@ -423,8 +450,8 @@
424451 */
425452 showError: function( code, info ) {
426453 // XXX TODO use code
427 - this.showIndicatorMessage( 'error', 'mwe-upwiz-error' );
428 - //add a "retry" button, too?
 454+ this.showIndicator( 'error' );
 455+ // create a status message for the error
429456 },
430457
431458 /**
@@ -1096,7 +1123,7 @@
10971124 populate: function() {
10981125 var _this = this;
10991126 mw.log( "populating details from upload" );
1100 - _this.upload.setThumbnail( _this.thumbnailDiv );
 1127+ _this.upload.setThumbnail( _this.thumbnailDiv, mw.UploadWizard.config['thumbnailWidth'], mw.UploadWizard.config['thumbnailMaxHeight'] );
11011128 _this.prefillDate();
11021129 _this.prefillSource();
11031130 _this.prefillAuthor();
@@ -1852,7 +1879,7 @@
18531880 var progressBar = new mw.GroupProgressBar( '#mwe-upwiz-progress',
18541881 gM( 'mwe-upwiz-uploading' ),
18551882 _this.uploads,
1856 - [ 'error', 'thumbnailed' ],
 1883+ [ 'stashed' ],
18571884 'transportProgress',
18581885 'transportWeight' );
18591886 progressBar.start();
@@ -1867,7 +1894,7 @@
18681895 _this.makeTransitioner(
18691896 'new',
18701897 [ 'transporting', 'transported', 'metadata' ],
1871 - [ 'error', 'thumbnailed' ],
 1898+ [ 'error', 'verified' ],
18721899 function( upload ) {
18731900 upload.start();
18741901 },
@@ -2073,7 +2100,7 @@
20742101 // add a preview on the deeds page
20752102 var thumbnailDiv = $j( '<div class="mwe-upwiz-thumbnail-small"></div>' );
20762103 $j( '#mwe-upwiz-deeds-thumbnails' ).append( thumbnailDiv );
2077 - _this.upload.setThumbnail( thumbnailDiv, mw.UploadWizard.config[ 'smallThumbnailWidth' ] );
 2104+ _this.upload.setThumbnail( thumbnailDiv, mw.UploadWizard.config[ 'smallThumbnailWidth' ], mw.UploadWizard.config[ 'smallThumbnailMaxHeight' ] );
20782105 }
20792106 };
20802107
Index: trunk/extensions/UploadWizard/resources/mw.ApiUploadHandler.js
@@ -22,11 +22,9 @@
2323 this.transport = new mw.IframeTransport(
2424 this.$form,
2525 function( fraction ) {
26 - debugger;
2726 _this.upload.setTransportProgress( fraction );
2827 },
2928 function( result ) {
30 - debugger;
3129 _this.upload.setTransported( result );
3230 }
3331 );
Index: trunk/extensions/UploadWizard/resources/mw.UploadApiProcessor.js
@@ -75,7 +75,6 @@
7676 var _this = this;
7777 mw.log( 'processResult::' );
7878
79 - // debugger;
8079
8180 var parsedResult = _this.parseResult(result);
8281
Index: trunk/extensions/UploadWizard/resources/mw.IframeTransport.js
@@ -56,7 +56,6 @@
5757 // Set up the completion callback
5858 var _this = this;
5959 $j( '#' + this.iframeId ).load( function() {
60 - debugger;
6160 mw.log( "received result in iframe" );
6261 _this.progressCb( 1.0 );
6362 _this.processIframeResult( $j( this ).get( 0 ) );
Index: trunk/extensions/UploadWizard/resources/combined.min.js
@@ -5854,7 +5854,7 @@
58555855
58565856 $j.ajax(ajaxOptions);
58575857
5858 -},
 5858+}
58595859
58605860 }
58615861
@@ -7912,7 +7912,9 @@
79137913 var _this=this;
79147914 this.transport=new mw.IframeTransport(
79157915 this.$form,
7916 -function(fraction){_this.upload.setTransportProgress(fraction);},
 7916+function(fraction){
 7917+_this.upload.setTransportProgress(fraction);
 7918+},
79177919 function(result){
79187920 _this.upload.setTransported(result);
79197921 }
@@ -7998,7 +8000,8 @@
79998001 var ok=function(){
80008002 mw.log("api: upload start!");
80018003 _this.beginTime=(new Date()).getTime();
8002 -_this.upload.ui.busy();
 8004+_this.upload.ui.setStatus('mwe-upwiz-transport-started');
 8005+_this.upload.ui.showTransportProgress();
80038006 _this.$form.submit();
80048007 };
80058008 var err=function(code,info){
@@ -8349,7 +8352,7 @@
83508353
83518354
83528355
8353 -mw.GroupProgressBar=function(selector,text,uploads,endState,progressProperty,weightProperty){
 8356+mw.GroupProgressBar=function(selector,text,uploads,endStates,progressProperty,weightProperty){
83548357 var _this=this;
83558358
83568359
@@ -8369,7 +8372,7 @@
83708373 _this.$selector.find('.mwe-upwiz-progress-bar').progressbar({value:0});
83718374
83728375 _this.uploads=uploads;
8373 -_this.endState=endState;
 8376+_this.endStates=endStates;
83748377 _this.progressProperty=progressProperty;
83758378 _this.weightProperty=weightProperty;
83768379 _this.beginTime=undefined;
@@ -8404,7 +8407,7 @@
84058408 var endStateCount=0;
84068409 var hasData=false;
84078410 $j.each(_this.uploads,function(i,upload){
8408 -if(upload.state==_this.endState){
 8411+if($j.inArray(upload.state,_this.endStates)!==-1){
84098412 endStateCount++;
84108413 }
84118414 if(upload[_this.progressProperty]!==undefined){
@@ -9194,11 +9197,11 @@
91959198
91969199
91979200
9198 -setFailed:function(code){
 9201+setError:function(code,info){
91999202
9200 -this.state='failed';
 9203+this.state='error';
92019204 this.transportProgress=0;
9202 -this.ui.showFailed(code);
 9205+this.ui.showError(code,info);
92039206 },
92049207
92059208
@@ -9212,11 +9215,25 @@
92139216
92149217 _this.state='transported';
92159218 _this.transportProgress=1;
9216 -_this.ui.showTransported();
 9219+_this.ui.setStatus('mwe-upwiz-getting-metadata');
92179220 _this.extractUploadInfo(result);
 9221+var setupDeedsAndShowComplete=function(){
 9222+_this.ui.setPreview($img);
92189223 _this.deedPreview.setup();
92199224 _this.details.populate();
 9225+_this.state='stashed';
 9226+_this.ui.showStashed();
 9227+};
 9228+var $img=$j('<img/>').load(setupDeedsAndShowComplete);
92209229
 9230+_this.getThumbnail(
 9231+function(thumbnailAttrs){
 9232+$img.attr(thumbnailAttrs);
 9233+},
 9234+mw.UploadWizard.config['iconThumbnailWidth'],
 9235+mw.UploadWizard.config['iconThumbnailMaxHeight']
 9236+);
 9237+
92219238 }else if(result.upload&&result.upload.sessionkey){
92229239
92239240 if(result.upload.warnings.duplicate){
@@ -9227,13 +9244,13 @@
92289245
92299246 }else{
92309247
9231 -_this.state='error';
9232 -_this.ui.showFailed();
 9248+var code='unknown';
 9249+var info='unknown';
92339250 if(result.error){
9234 -alert("error : "+result.error.code+" : "+result.error.info);
 9251+code=result.error.code;
 9252+info=result.error.info;
92359253 }
9236 -
9237 -
 9254+_this.setError(code,info);
92389255 }
92399256
92409257 },
@@ -9306,9 +9323,13 @@
93079324
93089325
93099326
9310 -getThumbnail:function(width,callback){
 9327+
 9328+getThumbnail:function(callback,width,height){
93119329 var _this=this;
9312 -var key="width"+width;
 9330+if(mw.isEmpty(height)){
 9331+height=-1;
 9332+}
 9333+var key="width"+width+',height'+height;
93139334 if(mw.isDefined(_this.thumbnails[key])){
93149335 callback(_this.thumbnails[key]);
93159336 }else{
@@ -9316,6 +9337,7 @@
93179338 'prop':'stashimageinfo',
93189339 'siisessionkey':_this.sessionKey,
93199340 'siiurlwidth':width,
 9341+'siiurlheight':height,
93209342 'siiprop':'url'
93219343 };
93229344
@@ -9346,12 +9368,17 @@
93479369
93489370
93499371
9350 -setThumbnail:function(selector,width){
 9372+
 9373+setThumbnail:function(selector,width,height){
93519374 var _this=this;
93529375 if(typeof width==='undefined'||width===null||width<=0){
93539376 width=mw.UploadWizard.config['thumbnailWidth'];
93549377 }
93559378 width=parseInt(width,10);
 9379+height=null;
 9380+if(!mw.isEmpty(height)){
 9381+height=parseInt(height,10);
 9382+}
93569383
93579384 var callback=function(thumbnail){
93589385
@@ -9367,7 +9394,7 @@
93689395 };
93699396
93709397 $j(selector).loadingSpinner();
9371 -_this.getThumbnail(width,callback);
 9398+_this.getThumbnail(callback,width,height);
93729399 }
93739400
93749401 };
@@ -9388,9 +9415,8 @@
93899416 _this.div=$j('<div class="mwe-upwiz-file"></div>').get(0);
93909417 _this.isFilled=false;
93919418
9392 -_this.fileInputCtrl=$j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>')
9393 -.change(function(){_this.fileChanged();})
9394 -.get(0);
 9419+_this.$fileInputCtrl=$j('<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>')
 9420+.change(function(){_this.fileChanged();});
93959421
93969422
93979423 visibleFilenameDiv=$j('<div class="mwe-upwiz-visible-file"></div>')
@@ -9405,14 +9431,15 @@
94069432 +'</div>'
94079433 +'</div>'
94089434 );
9409 -visibleFilenameDiv.find('.mwe-upwiz-file-status-line').append(
9410 -$j.fn.removeCtrl(
 9435+
 9436+_this.$removeCtrl=$j.fn.removeCtrl(
94119437 'mwe-upwiz-remove',
94129438 'mwe-upwiz-remove-upload',
94139439 function(){_this.upload.remove();}
9414 -).addClass("mwe-upwiz-file-status-line-item")
9415 -);
 9440+).addClass("mwe-upwiz-file-status-line-item");
94169441
 9442+visibleFilenameDiv.find('.mwe-upwiz-file-status-line')
 9443+.append(_this.$removeCtrl);
94179444
94189445
94199446
@@ -9437,7 +9464,7 @@
94389465 _this.form=$j('<form class="mwe-upwiz-form"></form>')
94399466 .append(visibleFilenameDiv)
94409467 .append(_this.fileCtrlContainer
9441 -.append(_this.fileInputCtrl)
 9468+.append(_this.$fileInputCtrl)
94429469 )
94439470 .append(_this.filenameCtrl)
94449471 .append(_this.thumbnailParam)
@@ -9475,17 +9502,10 @@
94769503 .remove();
94779504 },
94789505
9479 -busy:function(){
9480 -var _this=this;
94819506
94829507
94839508
9484 -},
9485 -
9486 -
9487 -
9488 -
9489 -showIndicatorMessage:function(statusClass,msgKey){
 9509+showIndicator:function(statusClass){
94909510 var _this=this;
94919511 var $indicator=$j(_this.div).find('.mwe-upwiz-file-indicator');
94929512 $j.each($indicator.attr('class').split(/\s+/),function(i,className){
@@ -9493,13 +9513,16 @@
94949514 $indicator.removeClass(className);
94959515 }
94969516 });
9497 -$indicator.addClass('mwe-upwiz-status-'+statusClass)
9498 -.html(gM(msgKey));
 9517+$indicator.addClass('mwe-upwiz-status-'+statusClass);
 9518+
94999519 $j(_this.div).find('.mwe-upwiz-visible-file-filename')
95009520 .css('margin-right',($indicator.outerWidth()+24).toString()+'px');
95019521 $indicator.css('visibility','visible');
 9522+},
95029523
9503 -_this.setStatus(msgKey);
 9524+setPreview:function($img){
 9525+
 9526+$j(this.div).find('.mwe-upwiz-file-preview').css('background-image','url('+$img.attr('src')+')');
95049527 },
95059528
95069529
@@ -9523,23 +9546,28 @@
95249547
95259548
95269549 showTransportProgress:function(fraction){
9527 -this.showIndicatorMessage('progress','mwe-upwiz-uploading');
95289550
 9551+this.showIndicator('progress');
 9552+this.setStatus('mwe-upwiz-uploading');
95299553 },
95309554
95319555
95329556
95339557
9534 -showTransported:function(){
9535 -this.showIndicatorMessage('completed','mwe-upwiz-transported');
 9558+showStashed:function(){
 9559+this.$removeCtrl.detach();
 9560+this.$fileInputCtrl.detach();
 9561+this.showIndicator('stashed');
 9562+this.setStatus('mwe-upwiz-stashed-upload');
95369563 },
95379564
95389565
95399566
95409567
9541 -showFailed:function(code){
9542 -this.showIndicatorMessage('failed','mwe-upwiz-failed');
 9568+showError:function(code,info){
95439569
 9570+this.showIndicator('error');
 9571+
95449572 },
95459573
95469574
@@ -9549,7 +9577,7 @@
95509578 fileChanged:function(){
95519579 var _this=this;
95529580 _this.clearErrors();
9553 -_this.upload.extractLocalFileInfo($j(_this.fileInputCtrl).val());
 9581+_this.upload.extractLocalFileInfo(_this.$fileInputCtrl.val());
95549582 if(_this.isGoodExtension(_this.upload.title.getExtension())){
95559583 _this.updateFilename();
95569584 }else{
@@ -9578,9 +9606,9 @@
95799607
95809608
95819609
9582 -$j(this.fileInputCtrl).css({
9583 -'margin-left':'-'+~~($j(this.fileInputCtrl).width()-$covered.outerWidth()-10)+'px',
9584 -'margin-top':'-'+~~($j(this.fileInputCtrl).height()-$covered.outerHeight()-10)+'px'
 9610+this.$fileInputCtrl.css({
 9611+'margin-left':'-'+~~(this.$fileInputCtrl.width()-$covered.outerWidth()-10)+'px',
 9612+'margin-top':'-'+~~(this.$fileInputCtrl.height()-$covered.outerHeight()-10)+'px'
95859613 });
95869614
95879615
@@ -9597,7 +9625,7 @@
95989626 updateFilename:function(){
95999627 var _this=this;
96009628
9601 -var path=_this.fileInputCtrl.value;
 9629+var path=_this.$fileInputCtrl.val();
96029630
96039631
96049632 $j(_this.form).find('.mwe-upwiz-visible-file-filename-text').html(path);
@@ -10211,7 +10239,7 @@
1021210240 populate:function(){
1021310241 var _this=this;
1021410242 mw.log("populating details from upload");
10215 -_this.upload.setThumbnail(_this.thumbnailDiv);
 10243+_this.upload.setThumbnail(_this.thumbnailDiv,mw.UploadWizard.config['thumbnailWidth'],mw.UploadWizard.config['thumbnailMaxHeight']);
1021610244 _this.prefillDate();
1021710245 _this.prefillSource();
1021810246 _this.prefillAuthor();
@@ -10652,48 +10680,13 @@
1065310681 _this.removeEmptyUploads();
1065410682 _this.startUploads(function(){
1065510683
 10684+alert("hey, uploads are done");
1065610685
10657 -
10658 -
10659 -
10660 -
10661 -var deeds=[
10662 -new mw.UploadWizardDeedOwnWork(_this.uploads.length),
10663 -new mw.UploadWizardDeedThirdParty(_this.uploads.length)
10664 -];
10665 -
10666 -
10667 -
10668 -if(_this.uploads.length>1){
10669 -var customDeed=$j.extend(new mw.UploadWizardDeed(),{
10670 -valid:function(){return true;},
10671 -name:'custom'
1067210686 });
10673 -deeds.push(customDeed);
10674 -}
10675 -
10676 -_this.deedChooser=new mw.UploadWizardDeedChooser(
10677 -'#mwe-upwiz-deeds',
10678 -deeds,
10679 -_this.uploads.length);
10680 -
10681 -$j('<div>').html(gM('mwe-upwiz-deeds-macro-prompt',_this.uploads.length))
10682 -.insertBefore(_this.deedChooser.$selector.find('.mwe-upwiz-deed-ownwork'));
10683 -
10684 -if(_this.uploads.length>1){
10685 -$j('<div style="margin-top: 1em">').html(gM('mwe-upwiz-deeds-custom-prompt'))
10686 -.insertBefore(_this.deedChooser.$selector.find('.mwe-upwiz-deed-custom'));
10687 -}
10688 -
10689 -
10690 -_this.moveToStep('deeds');
10691 -
1069210687 });
10693 -});
1069410688
1069510689
1069610690
10697 -
1069810691 $j('#mwe-upwiz-deeds-intro').html(gM('mwe-upwiz-deeds-intro'));
1069910692
1070010693 $j('#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next')
@@ -10754,12 +10747,49 @@
1075510748
1075610749
1075710750
 10751+prepareAndMoveToDeeds:function(){
1075810752
1075910753
 10754+var deeds=[
 10755+new mw.UploadWizardDeedOwnWork(_this.uploads.length),
 10756+new mw.UploadWizardDeedThirdParty(_this.uploads.length)
 10757+];
1076010758
1076110759
1076210760
 10761+if(_this.uploads.length>1){
 10762+var customDeed=$j.extend(new mw.UploadWizardDeed(),{
 10763+valid:function(){return true;},
 10764+name:'custom'
 10765+});
 10766+deeds.push(customDeed);
 10767+}
1076310768
 10769+_this.deedChooser=new mw.UploadWizardDeedChooser(
 10770+'#mwe-upwiz-deeds',
 10771+deeds,
 10772+_this.uploads.length);
 10773+
 10774+$j('<div>').html(gM('mwe-upwiz-deeds-macro-prompt',_this.uploads.length))
 10775+.insertBefore(_this.deedChooser.$selector.find('.mwe-upwiz-deed-ownwork'));
 10776+
 10777+if(_this.uploads.length>1){
 10778+$j('<div style="margin-top: 1em">').html(gM('mwe-upwiz-deeds-custom-prompt'))
 10779+.insertBefore(_this.deedChooser.$selector.find('.mwe-upwiz-deed-custom'));
 10780+}
 10781+
 10782+_this.moveToStep('deeds');
 10783+
 10784+},
 10785+
 10786+
 10787+
 10788+
 10789+
 10790+
 10791+
 10792+
 10793+
1076410794 moveToStep:function(selectedStepName,callback){
1076510795 var _this=this;
1076610796
@@ -10896,7 +10926,7 @@
1089710927 var toRemove=[];
1089810928
1089910929 for(var i=0;i<_this.uploads.length;i++){
10900 -if(mw.isEmpty(_this.uploads[i].ui.fileInputCtrl.value)){
 10930+if(mw.isEmpty(_this.uploads[i].ui.$fileInputCtrl.val())){
1090110931 toRemove.push(_this.uploads[i]);
1090210932 }
1090310933 }
@@ -10915,7 +10945,7 @@
1091610946
1091710947
1091810948
10919 -makeTransitioner:function(beginState,progressState,endState,starter,endCallback){
 10949+makeTransitioner:function(beginState,progressStates,endStates,starter,endCallback){
1092010950
1092110951 var _this=this;
1092210952
@@ -10923,9 +10953,9 @@
1092410954 var uploadsToStart=_this.maxSimultaneousConnections;
1092510955 var endStateCount=0;
1092610956 $j.each(_this.uploads,function(i,upload){
10927 -if(upload.state==endState){
 10957+if($j.inArray(upload.state,endStates)!==-1){
1092810958 endStateCount++;
10929 -}else if(upload.state==progressState){
 10959+}else if($j.inArray(upload.state,progressStates)!==-1){
1093010960 uploadsToStart--;
1093110961 }else if((upload.state==beginState)&&(uploadsToStart>0)){
1093210962 starter(upload);
@@ -10965,7 +10995,7 @@
1096610996 var progressBar=new mw.GroupProgressBar('#mwe-upwiz-progress',
1096710997 gM('mwe-upwiz-uploading'),
1096810998 _this.uploads,
10969 -'transported',
 10999+['stashed'],
1097011000 'transportProgress',
1097111001 'transportWeight');
1097211002 progressBar.start();
@@ -10979,8 +11009,8 @@
1098011010
1098111011 _this.makeTransitioner(
1098211012 'new',
10983 -'transporting',
10984 -'transported',
 11013+['transporting','transported','metadata'],
 11014+['error','verified'],
1098511015 function(upload){
1098611016 upload.start();
1098711017 },
@@ -11088,8 +11118,8 @@
1108911119
1109011120 _this.makeTransitioner(
1109111121 'details',
11092 -'submitting-details',
11093 -'complete',
 11122+['submitting-details'],
 11123+['complete'],
1109411124 function(upload){
1109511125 upload.details.submit(function(){
1109611126 upload.details.div.data('mask').html();
@@ -11186,21 +11216,14 @@
1118711217
1118811218 var thumbnailDiv=$j('<div class="mwe-upwiz-thumbnail-small"></div>');
1118911219 $j('#mwe-upwiz-deeds-thumbnails').append(thumbnailDiv);
11190 -_this.upload.setThumbnail(thumbnailDiv,mw.UploadWizard.config['smallThumbnailWidth']);
 11220+_this.upload.setThumbnail(thumbnailDiv,mw.UploadWizard.config['smallThumbnailWidth'],mw.UploadWizard.config['smallThumbnailMaxHeight']);
1119111221 }
1119211222 };
1119311223
 11224+})(jQuery);
1119411225
 11226+(function($j){
1119511227
11196 -$j.fn.removeCtrl=function(msgKey,tooltipMsgKey,callback){
11197 -var msg=(msgKey===null)?'':gM(msgKey);
11198 -return $j('<div class="mwe-upwiz-remove-ctrl ui-corner-all" />')
11199 -.attr('title',gM(tooltipMsgKey))
11200 -.click(callback)
11201 -.hover(function(){$j(this).addClass('hover');},
11202 -function(){$j(this).removeClass('hover');})
11203 -.append($j('<div class="ui-icon ui-icon-close" /><div class="mwe-upwiz-remove-ctrl-msg">'+msg+'</div>'));
11204 -};
1120511228
1120611229
1120711230
@@ -11211,8 +11234,6 @@
1121211235
1121311236
1121411237
11215 -
11216 -
1121711238 $j.fn.preventCloseWindow=function(options){
1121811239 if(typeof options==='undefined'){
1121911240 options={};
@@ -11420,7 +11441,11 @@
1142111442 apiUrl:apiUrl,
1142211443
1142311444 thumbnailWidth:120,
 11445+thumbnailMaxHeight:200,
1142411446 smallThumbnailWidth:60,
 11447+smallThumbnailMaxHeight:100,
 11448+iconThumbnailWidth:32,
 11449+iconThumbnailMaxHeight:32,
1142511450 maxAuthorLength:50,
1142611451 minAuthorLength:2,
1142711452 maxSourceLength:200,
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php
@@ -199,7 +199,6 @@
200200 . '</div>'
201201
202202 . '<div class="mwe-upwiz-stepdiv ui-helper-clearfix" id="mwe-upwiz-stepdiv-file">'
203 - . '<div id="mwe-upwiz-intro">' . wfMsg('mwe-upwiz-intro') . '</div>'
204203 . '<div id="mwe-upwiz-files">'
205204 . '<div id="mwe-upwiz-filelist" class="ui-corner-all"></div>'
206205 . '<div id="mwe-upwiz-upload-ctrls" class="mwe-upwiz-file">'
Index: trunk/extensions/UploadWizard/UploadWizardPage.js
@@ -19,7 +19,11 @@
2020 apiUrl: apiUrl,
2121
2222 thumbnailWidth: 120,
 23+ thumbnailMaxHeight: 200,
2324 smallThumbnailWidth: 60,
 25+ smallThumbnailMaxHeight: 100,
 26+ iconThumbnailWidth: 32,
 27+ iconThumbnailMaxHeight: 32,
2428 maxAuthorLength: 50,
2529 minAuthorLength: 2,
2630 maxSourceLength: 200,

Status & tagging log