r76991 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76990‎ | r76991 | r76992 >
Date:01:07, 19 November 2010
Author:neilk
Status:deferred
Tags:
Comment:
various layout fixes in anticipation of other fixes, expanded and moved removeCtrl
Modified paths:
  • /trunk/extensions/UploadWizard/SpecialUploadWizard.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizardHooks.php (modified) (history)
  • /trunk/extensions/UploadWizard/resources/32px-Blank-document.svg.png (added) (history)
  • /trunk/extensions/UploadWizard/resources/32px-Dialog-apply.svg.png (added) (history)
  • /trunk/extensions/UploadWizard/resources/32px-Nuvola_apps_important_orange.svg.png (added) (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/jquery/dir.combined.css (modified) (history)
  • /trunk/extensions/UploadWizard/resources/jquery/dir.combined.min.css (modified) (history)
  • /trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/jquery/jquery.removeCtrl.css (added) (history)
  • /trunk/extensions/UploadWizard/resources/jquery/jquery.removeCtrl.js (added) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/uploadWizard.css (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizardHooks.php
@@ -30,6 +30,7 @@
3131 'resources/jquery/jquery.spinner.js',
3232 'resources/jquery/jquery.autoEllipsis.js',
3333 'resources/jquery/jquery.suggestions.js',
 34+ 'resources/jquery/jquery.removeCtrl.js',
3435
3536 // mediawiki-specific interface helper (relies on mediawiki globals)
3637 'resources/jquery/jquery.mwCoolCats.js',
@@ -121,6 +122,7 @@
122123 'resources/uploadWizard.css',
123124 'resources/jquery/jquery.arrowSteps.css',
124125 'resources/jquery/jquery.mwCoolCats.css',
 126+ 'resources/jquery/jquery.removeCtrl.css',
125127 'resources/jquery.ui/themes/redmond/jquery-ui-1.7.1.custom.css'
126128 ),
127129 'messages' => array(
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php
@@ -42,9 +42,11 @@
4343 'mwe-upwiz-add-file-0' => 'Click here to upload a file',
4444 'mwe-upwiz-browse' => 'Browse...',
4545 'mwe-upwiz-transported' => 'OK',
 46+ 'mwe-upwiz-failed' => 'Failed',
4647 'mwe-upwiz-click-here' => 'Click here to select a file',
4748 'mwe-upwiz-uploading' => 'uploading...',
4849 'mwe-upwiz-editing' => 'editing...',
 50+ 'mwe-upwiz-remove' => 'Remove',
4951 'mwe-upwiz-remove-upload' => 'Remove this file from the list of files to upload',
5052 'mwe-upwiz-remove-description' => 'Remove this description',
5153 'mwe-upwiz-upload' => 'Upload',
Index: trunk/extensions/UploadWizard/resources/jquery/dir.combined.css
@@ -198,3 +198,24 @@
199199 * html .pkg, * html #content-inner { height: 1%; }
200200 .pkg, #content-inner { display: block; }
201201 /* */
 202+.mwe-upwiz-remove-ctrl {
 203+ outline: none;
 204+ cursor: pointer;
 205+}
 206+
 207+.mwe-upwiz-remove-ctrl.hover .mwe-upwiz-remove-ctrl-msg {
 208+ text-decoration: underline;
 209+}
 210+
 211+.mwe-upwiz-remove-ctrl div {
 212+ color: #0645ad;
 213+ font-variant: bold;
 214+ float: left;
 215+}
 216+
 217+/* XXX this is highly specific to our installation
 218+.mwe-upwiz-remove-ctrl.hover {
 219+.ui-icon { background-image: url(/w/extensions/UsabilityInitiative/css/vector/images/ui-icons_cd0a0a_256x240.png) }
 220+}
 221+*/
 222+
Index: trunk/extensions/UploadWizard/resources/jquery/jquery.removeCtrl.css
@@ -0,0 +1,21 @@
 2+.mwe-upwiz-remove-ctrl {
 3+ outline: none;
 4+ cursor: pointer;
 5+}
 6+
 7+.mwe-upwiz-remove-ctrl.hover .mwe-upwiz-remove-ctrl-msg {
 8+ text-decoration: underline;
 9+}
 10+
 11+.mwe-upwiz-remove-ctrl div {
 12+ color: #0645ad;
 13+ font-variant: bold;
 14+ float: left;
 15+}
 16+
 17+/* XXX this is highly specific to our installation
 18+.mwe-upwiz-remove-ctrl.hover {
 19+.ui-icon { background-image: url(/w/extensions/UsabilityInitiative/css/vector/images/ui-icons_cd0a0a_256x240.png) }
 20+}
 21+*/
 22+
Property changes on: trunk/extensions/UploadWizard/resources/jquery/jquery.removeCtrl.css
___________________________________________________________________
Added: svn:eol-style
123 + native
Index: trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js
@@ -77,7 +77,7 @@
7878 var $li = $j( '<li class="cat"></li>' );
7979 $container.find( 'ul' ).append( $li );
8080 $li.append( '<a class="cat" target="_new" href="' + href + '">' + cat +' </a>' );
81 - $li.append( $j.fn.removeCtrl( 'mwe-upwiz-category-remove', function() { $li.remove(); } ) );
 81+ $li.append( $j.fn.removeCtrl( null, 'mwe-upwiz-category-remove', function() { $li.remove(); } ) );
8282 }
8383
8484 function _catLink( cat ) {
Index: trunk/extensions/UploadWizard/resources/jquery/dir.combined.min.css
@@ -40,3 +40,5 @@
4141
4242 * html .pkg,* html #content-inner{height:1%;}
4343 .pkg,#content-inner{display:block;}
 44+
 45+.mwe-upwiz-remove-ctrl{outline:none;cursor:pointer;}.mwe-upwiz-remove-ctrl.hover .mwe-upwiz-remove-ctrl-msg{text-decoration:underline;}.mwe-upwiz-remove-ctrl div{color:#0645ad;font-variant:bold;float:left;}
\ No newline at end of file
Index: trunk/extensions/UploadWizard/resources/jquery/jquery.removeCtrl.js
@@ -0,0 +1,14 @@
 2+/**
 3+ * Create 'remove' control, an X which highlights in some standardized way, with optional tooltips
 4+ */
 5+( function ( $j ) {
 6+ $j.fn.removeCtrl = function( msgKey, tooltipMsgKey, callback ) {
 7+ var msg = (msgKey === null) ? '' : gM( msgKey );
 8+ return $j( '<div class="mwe-upwiz-remove-ctrl ui-corner-all" />' )
 9+ .attr( 'title', gM( tooltipMsgKey ) )
 10+ .click( callback )
 11+ .hover( function() { $j( this ).addClass( 'hover' ); },
 12+ function() { $j( this ).removeClass( 'hover' ); } )
 13+ .append( $j( '<div class="ui-icon ui-icon-close" /><div class="mwe-upwiz-remove-ctrl-msg">' + msg + '</div>' ) );
 14+ };
 15+} )( jQuery );
Property changes on: trunk/extensions/UploadWizard/resources/jquery/jquery.removeCtrl.js
___________________________________________________________________
Added: svn:eol-style
116 + native
Index: trunk/extensions/UploadWizard/resources/dir.combined.css
@@ -49,7 +49,7 @@
5050 }
5151
5252 /* perhaps a general class for links that are actually "buttons" */
53 -#mwe-upwiz-add-file, .mwe-upwiz-remove-ctrl, .mwe-upwiz-more-options {
 53+#mwe-upwiz-add-file, .mwe-upwiz-more-options {
5454 outline: none;
5555 cursor: pointer;
5656 }
@@ -82,22 +82,14 @@
8383 background: #f5f5f5;
8484 }
8585
86 -
87 -
88 -.mwe-upwiz-remove-ctrl {
 86+.mwe-upwiz-file-status-line-item {
 87+ display: inline-block;
 88+ float: left;
 89+ margin-right: .5em;
8990 }
9091
91 -/* XXX this is highly specific to our installation
92 -.mwe-upwiz-remove-ctrl.hover {
93 -.ui-icon { background-image: url(/w/extensions/UsabilityInitiative/css/vector/images/ui-icons_cd0a0a_256x240.png) }
94 -}
95 -*/
96 -
9792 .mwe-upwiz-visible-file .mwe-upwiz-remove-ctrl {
98 - float: right;
9993 visibility: hidden;
100 - margin: 0.25em;
101 - padding: 0.25em;
10294 }
10395
10496 .mwe-upwiz-file-indicator, .mwe-upwiz-count {
@@ -124,10 +116,34 @@
125117 overflow: hidden;
126118 }
127119
 120+.mwe-upwiz-icon {
 121+ float: left;
 122+}
 123+
 124+.mwe-upwiz-filled-filelist {
 125+ border: 1px solid #d8d8d8;
 126+}
 127+
 128+.mwe-upwiz-file-texts {
 129+ margin-left: 46px;
 130+}
 131+
 132+.mwe-upwiz-file-status {
 133+ display: none;
 134+ color: #797979;
 135+}
 136+
128137 .mwe-upwiz-progress-bar-etr-container {
129138 /* needed ? */
130139 }
131140
 141+.mwe-upwiz-file-preview {
 142+ float: left;
 143+ height: 40px;
 144+ width: 40px;
 145+ margin-right: 6px;
 146+ background: url(32px-Blank-document.svg.png) no-repeat center top;
 147+}
132148
133149 .mwe-upwiz-add-files-n {
134150 float: left;
@@ -172,7 +188,8 @@
173189 margin-left: 8em;
174190 }
175191
176 -.mwe-upwiz-file {
 192+.filled + .filled {
 193+ border-top: 1px solid #d8d8d8;
177194 }
178195
179196 #mwe-upwiz-upload-ctrls {
Index: trunk/extensions/UploadWizard/resources/dir.combined.min.css
@@ -2,14 +2,15 @@
33 max-width:900px;
44 }.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;}
6 -#mwe-upwiz-add-file,.mwe-upwiz-remove-ctrl,.mwe-upwiz-more-options{outline:none;cursor:pointer;}
 6+#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-remove-ctrl{}.mwe-upwiz-visible-file .mwe-upwiz-remove-ctrl{float:right;visibility:hidden;margin:0.25em;padding:0.25em;}.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-progress-bar-etr-container{
10 -}.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%;
 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{
 10+}
 11+.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%;
1112 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;}
1213 .helper{color:#cccccc;
13 -font-variant:italic,oblique;text-align:center;}#mwe-upwiz-files{margin-right:8em;margin-left:8em;}.mwe-upwiz-file{}#mwe-upwiz-upload-ctrls{margin-top:1em;}#mwe-upwiz-add-file-container{
 14+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{
1415 }.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;}
1516 .mwe-upwiz-data{float:left;width:46em;}
1617 .busy{
Index: trunk/extensions/UploadWizard/resources/32px-Blank-document.svg.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/UploadWizard/resources/32px-Blank-document.svg.png
___________________________________________________________________
Added: svn:mime-type
1718 + image/png
Index: trunk/extensions/UploadWizard/resources/32px-Nuvola_apps_important_orange.svg.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/UploadWizard/resources/32px-Nuvola_apps_important_orange.svg.png
___________________________________________________________________
Added: svn:mime-type
1819 + image/png
Index: trunk/extensions/UploadWizard/resources/combined.js
@@ -5064,6 +5064,20 @@
50655065 };
50665066
50675067 } )( jQuery );
 5068+/**
 5069+ * Create 'remove' control, an X which highlights in some standardized way, with optional tooltips
 5070+ */
 5071+( function ( $j ) {
 5072+ $j.fn.removeCtrl = function( msgKey, tooltipMsgKey, callback ) {
 5073+ var msg = (msgKey === null) ? '' : gM( msgKey );
 5074+ return $j( '<div class="mwe-upwiz-remove-ctrl ui-corner-all" />' )
 5075+ .attr( 'title', gM( tooltipMsgKey ) )
 5076+ .click( callback )
 5077+ .hover( function() { $j( this ).addClass( 'hover' ); },
 5078+ function() { $j( this ).removeClass( 'hover' ); } )
 5079+ .append( $j( '<div class="ui-icon ui-icon-close" /><div class="mwe-upwiz-remove-ctrl-msg">' + msg + '</div>' ) );
 5080+ };
 5081+} )( jQuery );
50685082 /**
50695083 * Simple predictive typing category adder for Mediawiki.
50705084 * Relies on globals: wgScriptPath, wgNamespaceIds, wgFormattedNamespaces
@@ -5143,7 +5157,7 @@
51445158 var $li = $j( '<li class="cat"></li>' );
51455159 $container.find( 'ul' ).append( $li );
51465160 $li.append( '<a class="cat" target="_new" href="' + href + '">' + cat +' </a>' );
5147 - $li.append( $j.fn.removeCtrl( 'mwe-upwiz-category-remove', function() { $li.remove(); } ) );
 5161+ $li.append( $j.fn.removeCtrl( null, 'mwe-upwiz-category-remove', function() { $li.remove(); } ) );
51485162 }
51495163
51505164 function _catLink( cat ) {
@@ -5211,9 +5225,6 @@
52125226 /**
52135227 * Log a string msg to the console
52145228 *
5215 - * all mw.log statements will be removed on minification so
5216 - * lots of mw.log calls will not impact performance in non debug mode
5217 - *
52185229 * @param {String} string String to output to console
52195230 */
52205231 mw.log = function( s, level ) {
@@ -7902,7 +7913,9 @@
79037914 this.transport = new mw.IframeTransport(
79047915 this.$form,
79057916 function( fraction ){ _this.upload.setTransportProgress( fraction ); },
7906 - function( result ) { _this.upload.setTransported( result ); }
 7917+ function( result ) {
 7918+ _this.upload.setTransported( result );
 7919+ }
79077920 );
79087921
79097922 };
@@ -9098,10 +9111,6 @@
90999112 };
91009113
91019114 } )( jQuery );
9102 -// XXX
9103 -// this is sure starting to look like we should compose of UI, handler.
9104 -
9105 -
91069115 /**
91079116 * Represents the upload -- in its local and remote state. (Possibly those could be separate objects too...)
91089117 * This is our 'model' object if we are thinking MVC. Needs to be better factored, lots of feature envy with the UploadWizard
@@ -9195,16 +9204,15 @@
91969205 /**
91979206 * To be executed when an individual upload finishes. Processes the result and updates step 2's details
91989207 * @param result the API result in parsed JSON form
9199 - * XXX needs refactor --- new api needs error handler instead
92009208 */
92019209 setTransported: function( result ) {
92029210 var _this = this;
9203 - _this.state = 'transported';
9204 - _this.transportProgress = 1;
9205 - $j( _this.ui.div ).trigger( 'transportedEvent' );
92069211
92079212 if ( result.upload && result.upload.imageinfo ) {
92089213 // success
 9214+ _this.state = 'transported';
 9215+ _this.transportProgress = 1;
 9216+ _this.ui.showTransported();
92099217 _this.extractUploadInfo( result );
92109218 _this.deedPreview.setup();
92119219 _this.details.populate();
@@ -9219,11 +9227,11 @@
92209228 // and other errors that result in a stash
92219229 } else {
92229230 // XXX handle errors better
 9231+ _this.state = 'error';
 9232+ _this.ui.showFailed();
92239233 if ( result.error ) {
92249234 alert( "error : " + result.error.code + " : " + result.error.info );
92259235 }
9226 - this.ui.showFailed();
9227 - alert("huh?");
92289236 // TODO now we should tag the upload as failed
92299237 // if can recover, should maybe allow re-uploading.
92309238 }
@@ -9386,19 +9394,26 @@
93879395
93889396
93899397 visibleFilenameDiv = $j('<div class="mwe-upwiz-visible-file"></div>')
9390 - .append(
9391 - $j.fn.removeCtrl( 'mwe-upwiz-remove-upload', function() { _this.upload.remove(); } ),
9392 -
9393 - $j( '<div class="mwe-upwiz-file-indicator"></div>' ),
 9398+ .append( '<div class="mwe-upwiz-file-indicator"></div>'
 9399+ + '<div class="mwe-upwiz-visible-file-filename">'
 9400+ + '<div class="mwe-upwiz-file-preview"/>'
 9401+ + '<div class="mwe-upwiz-file-texts">'
 9402+ + '<div class="mwe-upwiz-visible-file-filename-text"/>'
 9403+ + '<div class="mwe-upwiz-file-status-line">'
 9404+ + '<div class="mwe-upwiz-file-status mwe-upwiz-file-status-line-item"></div>'
 9405+ + '</div>'
 9406+ + '</div>'
 9407+ + '</div>'
 9408+ );
 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+ );
93949416
9395 - $j( '<div class="mwe-upwiz-visible-file-filename">' )
9396 - .append(
9397 - $j( '<span class="ui-icon ui-icon-document" style="display: inline-block;" />' ),
9398 - $j( '<span class="mwe-upwiz-visible-file-filename-text"/>' )
9399 - )
94009417
9401 - );
9402 -
94039418 //_this.errorDiv = $j('<div class="mwe-upwiz-upload-error mwe-upwiz-file-indicator" style="display: none;"></div>').get(0);
94049419
94059420 _this.filenameCtrl = $j('<input type="hidden" name="filename" value=""/>').get(0);
@@ -9433,12 +9448,12 @@
94349449
94359450 // XXX evil hardcoded
94369451 // we don't really need filesdiv if we do it this way?
9437 - $j( _this.div ).insertBefore( '#mwe-upwiz-upload-ctrls' ); // append( _this.div );
 9452+ $j( filesDiv ).append( _this.div );
94389453
94399454 // _this.progressBar = ( no progress bar for individual uploads yet )
94409455 // we bind to the ui div since unbind doesn't work for non-DOM objects
94419456 $j( _this.div ).bind( 'transportProgressEvent', function(e) { _this.showTransportProgress(); } );
9442 - $j( _this.div ).bind( 'transportedEvent', function(e) { _this.showTransported(); } );
 9457+ // $j( _this.div ).bind( 'transportedEvent', function(e) { _this.showTransported(); } );
94439458
94449459 };
94459460
@@ -9468,7 +9483,7 @@
94699484 },
94709485
94719486 /**
9472 - *
 9487+ * change the indicator at the far right
94739488 */
94749489 showIndicatorMessage: function( statusClass, msgKey ) {
94759490 var _this = this;
@@ -9483,13 +9498,31 @@
94849499 $j( _this.div ).find( '.mwe-upwiz-visible-file-filename' )
94859500 .css( 'margin-right', ( $indicator.outerWidth() + 24 ).toString() + 'px' );
94869501 $indicator.css( 'visibility', 'visible' );
 9502+
 9503+ _this.setStatus( msgKey );
94879504 },
94889505
 9506+ // too abstract?
 9507+ setStatus: function( msgKey, args ) {
 9508+ if ( !mw.isDefined( args ) ) {
 9509+ args = [];
 9510+ }
 9511+ this.setStatusStr( gM( msgKey, args ) );
 9512+ },
 9513+
 9514+ setStatusStr: function( str ) {
 9515+ $j( this.div ).find( '.mwe-upwiz-file-status' ).html( str ).show();
 9516+ },
 9517+
 9518+ clearStatus: function() {
 9519+ $j( this.div ).find( '.mwe-upwiz-file-status' ).hide();
 9520+ },
 9521+
94899522 /**
94909523 * Put the visual state of an individual upload ito "progress"
94919524 * @param fraction The fraction of progress. Float between 0 and 1
94929525 */
9493 - showTransportProgress: function() {
 9526+ showTransportProgress: function( fraction ) {
94949527 this.showIndicatorMessage( 'progress', 'mwe-upwiz-uploading' );
94959528 // update individual progress bar with fraction?
94969529 },
@@ -9523,6 +9556,7 @@
95249557 //_this.error( 'bad-filename-extension', ext );
95259558 alert("bad extension");
95269559 }
 9560+ this.clearStatus();
95279561 },
95289562
95299563 /**
@@ -9562,6 +9596,7 @@
95639597 */
95649598 updateFilename: function() {
95659599 var _this = this;
 9600+ // TODO get basename of file; Chrome does this C:\fakepath\something which is highly irritating
95669601 var path = _this.fileInputCtrl.value;
95679602
95689603 // visible filenam.
@@ -9579,7 +9614,7 @@
95809615 // we use the visible-file div because it has the same offsetParent as the file input
95819616 // the second argument offsets the fileinput to the right so there's room for the close icon to get mouse events
95829617 _this.moveFileInputToCover(
9583 - $div.find( '.mwe-upwiz-visible-file-filename' )
 9618+ $div.find( '.mwe-upwiz-visible-file-filename-text' )
95849619 );
95859620
95869621 // Highlight the file on mouseover (and also show controls like the remove control).
@@ -9594,7 +9629,7 @@
95959630 // Consequently we have to bind to "mouseover" and "mouseout" as well even though that's not as efficient.
95969631 $div.bind( 'mouseenter mouseover', function() {
95979632 $div.addClass( 'hover' );
9598 - $j( '#mwe-upwiz-files' )
 9633+ $j( '#mwe-upwiz-filelist' )
95999634 .children()
96009635 .filter( function() { return this !== _this.div; } )
96019636 .removeClass('hover');
@@ -10129,7 +10164,7 @@
1013010165
1013110166 if ( ! required ) {
1013210167 $j( description.div ).append(
10133 - $j.fn.removeCtrl( 'mwe-upwiz-remove-description', function() { _this.removeDescription( description ); } )
 10168+ $j.fn.removeCtrl( null, 'mwe-upwiz-remove-description', function() { _this.removeDescription( description ); } )
1013410169 );
1013510170 }
1013610171
@@ -10779,7 +10814,7 @@
1078010815 return false;
1078110816 }
1078210817
10783 - var upload = new mw.UploadWizardUpload( _this.api, '#mwe-upwiz-files' );
 10818+ var upload = new mw.UploadWizardUpload( _this.api, '#mwe-upwiz-filelist' );
1078410819 _this.uploadToAdd = upload;
1078510820
1078610821 upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
@@ -10969,21 +11004,43 @@
1097011005 var _this = this;
1097111006
1097211007 if ( _this.uploads.length ) {
 11008+ // we have uploads ready to go, so allow us to proceed
1097311009 $j( '#mwe-upwiz-upload-ctrl' ).removeAttr( 'disabled' );
1097411010 $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).show();
 11011+
 11012+ // changes the "click here to add files" to "add another file"
1097511013 $j( '#mwe-upwiz-add-file' ).html( gM( 'mwe-upwiz-add-file-n' ) );
1097611014 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-0');
1097711015 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-n');
10978 - $j( '#mwe-upwiz-files .mwe-upwiz-file.filled:odd' ).addClass( 'odd' );
10979 - $j( '#mwe-upwiz-files .mwe-upwiz-file:filled:even' ).removeClass( 'odd' );
 11016+
 11017+ // add the styling to the filelist, so it has rounded corners and is visible and all.
 11018+ $j( '#mwe-upwiz-filelist' ).addClass( 'mwe-upwiz-filled-filelist' );
 11019+
 11020+ // fix the rounded corners on file elements.
 11021+ // we want them to be rounded only when their edge touched the top or bottom of the filelist.
 11022+ $j( '#mwe-upwiz-filelist .filled .mwe-upwiz-visible-file' ).removeClass( 'ui-corner-top' ).removeClass( 'ui-corner-bottom' );
 11023+ $j( '#mwe-upwiz-filelist .filled .mwe-upwiz-visible-file:first' ).addClass( 'ui-corner-top' );
 11024+ $j( '#mwe-upwiz-filelist .filled .mwe-upwiz-visible-file:last' ).addClass( 'ui-corner-bottom' );
 11025+ $j( '#mwe-upwiz-filelist .filled:odd' ).addClass( 'odd' );
 11026+ $j( '#mwe-upwiz-filelist .filled:even' ).removeClass( 'odd' );
1098011027 } else {
 11028+ // no uploads, so don't allow us to proceed
1098111029 $j( '#mwe-upwiz-upload-ctrl' ).attr( 'disabled', 'disabled' );
 11030+
 11031+ // remove the border from the filelist. We can't hide it or make it invisible since it contains the displaced
 11032+ // file input element that becomes the "click here to add"
 11033+ $j( '#mwe-upwiz-filelist' ).removeClass( 'mwe-upwiz-filled-filelist' );
 11034+
 11035+ // we can't continue
1098211036 $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).hide();
 11037+
 11038+ // change "add another file" into "click here to add a file"
1098311039 $j( '#mwe-upwiz-add-file' ).html( gM( 'mwe-upwiz-add-file-0' ) );
1098411040 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-0');
1098511041 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-n');
1098611042 }
1098711043
 11044+ // allow an "add another upload" button only if we aren't at max
1098811045 if ( _this.uploads.length < _this.maxUploads ) {
1098911046 $j( '#mwe-upwiz-add-file' ).removeAttr( 'disabled' );
1099011047 $j( _this.uploadToAdd.ui.div ).show();
@@ -11135,13 +11192,14 @@
1113611193 /**
1113711194 * Create 'remove' control, an X which highlights in some standardized way.
1113811195 */
11139 - $j.fn.removeCtrl = function( tooltipMsgKey, callback ) {
 11196+ $j.fn.removeCtrl = function( msgKey, tooltipMsgKey, callback ) {
 11197+ var msg = (msgKey === null) ? '' : gM( msgKey );
1114011198 return $j( '<div class="mwe-upwiz-remove-ctrl ui-corner-all" />' )
1114111199 .attr( 'title', gM( tooltipMsgKey ) )
1114211200 .click( callback )
1114311201 .hover( function() { $j( this ).addClass( 'hover' ); },
1114411202 function() { $j( this ).removeClass( 'hover' ); } )
11145 - .append( $j( '<span class="ui-icon ui-icon-close" />' ) );
 11203+ .append( $j( '<div class="ui-icon ui-icon-close" /><div class="mwe-upwiz-remove-ctrl-msg">' + msg + '</div>' ) );
1114611204 };
1114711205
1114811206 /**
Index: trunk/extensions/UploadWizard/resources/uploadWizard.css
@@ -49,7 +49,7 @@
5050 }
5151
5252 /* perhaps a general class for links that are actually "buttons" */
53 -#mwe-upwiz-add-file, .mwe-upwiz-remove-ctrl, .mwe-upwiz-more-options {
 53+#mwe-upwiz-add-file, .mwe-upwiz-more-options {
5454 outline: none;
5555 cursor: pointer;
5656 }
@@ -82,22 +82,14 @@
8383 background: #f5f5f5;
8484 }
8585
86 -
87 -
88 -.mwe-upwiz-remove-ctrl {
 86+.mwe-upwiz-file-status-line-item {
 87+ display: inline-block;
 88+ float: left;
 89+ margin-right: .5em;
8990 }
9091
91 -/* XXX this is highly specific to our installation
92 -.mwe-upwiz-remove-ctrl.hover {
93 -.ui-icon { background-image: url(/w/extensions/UsabilityInitiative/css/vector/images/ui-icons_cd0a0a_256x240.png) }
94 -}
95 -*/
96 -
9792 .mwe-upwiz-visible-file .mwe-upwiz-remove-ctrl {
98 - float: right;
9993 visibility: hidden;
100 - margin: 0.25em;
101 - padding: 0.25em;
10294 }
10395
10496 .mwe-upwiz-file-indicator, .mwe-upwiz-count {
@@ -124,10 +116,34 @@
125117 overflow: hidden;
126118 }
127119
 120+.mwe-upwiz-icon {
 121+ float: left;
 122+}
 123+
 124+.mwe-upwiz-filled-filelist {
 125+ border: 1px solid #d8d8d8;
 126+}
 127+
 128+.mwe-upwiz-file-texts {
 129+ margin-left: 46px;
 130+}
 131+
 132+.mwe-upwiz-file-status {
 133+ display: none;
 134+ color: #797979;
 135+}
 136+
128137 .mwe-upwiz-progress-bar-etr-container {
129138 /* needed ? */
130139 }
131140
 141+.mwe-upwiz-file-preview {
 142+ float: left;
 143+ height: 40px;
 144+ width: 40px;
 145+ margin-right: 6px;
 146+ background: url(32px-Blank-document.svg.png) no-repeat center top;
 147+}
132148
133149 .mwe-upwiz-add-files-n {
134150 float: left;
@@ -172,7 +188,8 @@
173189 margin-left: 8em;
174190 }
175191
176 -.mwe-upwiz-file {
 192+.filled + .filled {
 193+ border-top: 1px solid #d8d8d8;
177194 }
178195
179196 #mwe-upwiz-upload-ctrls {
Index: trunk/extensions/UploadWizard/resources/32px-Dialog-apply.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.svg.png
___________________________________________________________________
Added: svn:mime-type
180197 + image/png
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -1,7 +1,3 @@
2 -// XXX
3 -// this is sure starting to look like we should compose of UI, handler.
4 -
5 -
62 /**
73 * Represents the upload -- in its local and remote state. (Possibly those could be separate objects too...)
84 * This is our 'model' object if we are thinking MVC. Needs to be better factored, lots of feature envy with the UploadWizard
@@ -95,7 +91,6 @@
9692 /**
9793 * To be executed when an individual upload finishes. Processes the result and updates step 2's details
9894 * @param result the API result in parsed JSON form
99 - * XXX needs refactor --- new api needs error handler instead
10095 */
10196 setTransported: function( result ) {
10297 var _this = this;
@@ -286,19 +281,26 @@
287282
288283
289284 visibleFilenameDiv = $j('<div class="mwe-upwiz-visible-file"></div>')
290 - .append(
291 - $j.fn.removeCtrl( 'mwe-upwiz-remove-upload', function() { _this.upload.remove(); } ),
292 -
293 - $j( '<div class="mwe-upwiz-file-indicator"></div>' ),
 285+ .append( '<div class="mwe-upwiz-file-indicator"></div>'
 286+ + '<div class="mwe-upwiz-visible-file-filename">'
 287+ + '<div class="mwe-upwiz-file-preview"/>'
 288+ + '<div class="mwe-upwiz-file-texts">'
 289+ + '<div class="mwe-upwiz-visible-file-filename-text"/>'
 290+ + '<div class="mwe-upwiz-file-status-line">'
 291+ + '<div class="mwe-upwiz-file-status mwe-upwiz-file-status-line-item"></div>'
 292+ + '</div>'
 293+ + '</div>'
 294+ + '</div>'
 295+ );
 296+ visibleFilenameDiv.find( '.mwe-upwiz-file-status-line' ).append(
 297+ $j.fn.removeCtrl(
 298+ 'mwe-upwiz-remove',
 299+ 'mwe-upwiz-remove-upload',
 300+ function() { _this.upload.remove(); }
 301+ ).addClass( "mwe-upwiz-file-status-line-item" )
 302+ );
294303
295 - $j( '<div class="mwe-upwiz-visible-file-filename">' )
296 - .append(
297 - $j( '<span class="ui-icon ui-icon-document" style="display: inline-block;" />' ),
298 - $j( '<span class="mwe-upwiz-visible-file-filename-text"/>' )
299 - )
300304
301 - );
302 -
303305 //_this.errorDiv = $j('<div class="mwe-upwiz-upload-error mwe-upwiz-file-indicator" style="display: none;"></div>').get(0);
304306
305307 _this.filenameCtrl = $j('<input type="hidden" name="filename" value=""/>').get(0);
@@ -333,7 +335,7 @@
334336
335337 // XXX evil hardcoded
336338 // we don't really need filesdiv if we do it this way?
337 - $j( _this.div ).insertBefore( '#mwe-upwiz-upload-ctrls' ); // append( _this.div );
 339+ $j( filesDiv ).append( _this.div );
338340
339341 // _this.progressBar = ( no progress bar for individual uploads yet )
340342 // we bind to the ui div since unbind doesn't work for non-DOM objects
@@ -368,7 +370,7 @@
369371 },
370372
371373 /**
372 - *
 374+ * change the indicator at the far right
373375 */
374376 showIndicatorMessage: function( statusClass, msgKey ) {
375377 var _this = this;
@@ -383,13 +385,31 @@
384386 $j( _this.div ).find( '.mwe-upwiz-visible-file-filename' )
385387 .css( 'margin-right', ( $indicator.outerWidth() + 24 ).toString() + 'px' );
386388 $indicator.css( 'visibility', 'visible' );
 389+
 390+ _this.setStatus( msgKey );
387391 },
388392
 393+ // too abstract?
 394+ setStatus: function( msgKey, args ) {
 395+ if ( !mw.isDefined( args ) ) {
 396+ args = [];
 397+ }
 398+ this.setStatusStr( gM( msgKey, args ) );
 399+ },
 400+
 401+ setStatusStr: function( str ) {
 402+ $j( this.div ).find( '.mwe-upwiz-file-status' ).html( str ).show();
 403+ },
 404+
 405+ clearStatus: function() {
 406+ $j( this.div ).find( '.mwe-upwiz-file-status' ).hide();
 407+ },
 408+
389409 /**
390410 * Put the visual state of an individual upload ito "progress"
391411 * @param fraction The fraction of progress. Float between 0 and 1
392412 */
393 - showTransportProgress: function() {
 413+ showTransportProgress: function( fraction ) {
394414 this.showIndicatorMessage( 'progress', 'mwe-upwiz-uploading' );
395415 // update individual progress bar with fraction?
396416 },
@@ -423,6 +443,7 @@
424444 //_this.error( 'bad-filename-extension', ext );
425445 alert("bad extension");
426446 }
 447+ this.clearStatus();
427448 },
428449
429450 /**
@@ -462,6 +483,7 @@
463484 */
464485 updateFilename: function() {
465486 var _this = this;
 487+ // TODO get basename of file; Chrome does this C:\fakepath\something which is highly irritating
466488 var path = _this.fileInputCtrl.value;
467489
468490 // visible filenam.
@@ -479,7 +501,7 @@
480502 // we use the visible-file div because it has the same offsetParent as the file input
481503 // the second argument offsets the fileinput to the right so there's room for the close icon to get mouse events
482504 _this.moveFileInputToCover(
483 - $div.find( '.mwe-upwiz-visible-file-filename' )
 505+ $div.find( '.mwe-upwiz-visible-file-filename-text' )
484506 );
485507
486508 // Highlight the file on mouseover (and also show controls like the remove control).
@@ -494,7 +516,7 @@
495517 // Consequently we have to bind to "mouseover" and "mouseout" as well even though that's not as efficient.
496518 $div.bind( 'mouseenter mouseover', function() {
497519 $div.addClass( 'hover' );
498 - $j( '#mwe-upwiz-files' )
 520+ $j( '#mwe-upwiz-filelist' )
499521 .children()
500522 .filter( function() { return this !== _this.div; } )
501523 .removeClass('hover');
@@ -1029,7 +1051,7 @@
10301052
10311053 if ( ! required ) {
10321054 $j( description.div ).append(
1033 - $j.fn.removeCtrl( 'mwe-upwiz-remove-description', function() { _this.removeDescription( description ); } )
 1055+ $j.fn.removeCtrl( null, 'mwe-upwiz-remove-description', function() { _this.removeDescription( description ); } )
10341056 );
10351057 }
10361058
@@ -1679,7 +1701,7 @@
16801702 return false;
16811703 }
16821704
1683 - var upload = new mw.UploadWizardUpload( _this.api, '#mwe-upwiz-files' );
 1705+ var upload = new mw.UploadWizardUpload( _this.api, '#mwe-upwiz-filelist' );
16841706 _this.uploadToAdd = upload;
16851707
16861708 upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
@@ -1869,21 +1891,43 @@
18701892 var _this = this;
18711893
18721894 if ( _this.uploads.length ) {
 1895+ // we have uploads ready to go, so allow us to proceed
18731896 $j( '#mwe-upwiz-upload-ctrl' ).removeAttr( 'disabled' );
18741897 $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).show();
 1898+
 1899+ // changes the "click here to add files" to "add another file"
18751900 $j( '#mwe-upwiz-add-file' ).html( gM( 'mwe-upwiz-add-file-n' ) );
18761901 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-0');
18771902 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-n');
1878 - $j( '#mwe-upwiz-files .mwe-upwiz-file.filled:odd' ).addClass( 'odd' );
1879 - $j( '#mwe-upwiz-files .mwe-upwiz-file:filled:even' ).removeClass( 'odd' );
 1903+
 1904+ // add the styling to the filelist, so it has rounded corners and is visible and all.
 1905+ $j( '#mwe-upwiz-filelist' ).addClass( 'mwe-upwiz-filled-filelist' );
 1906+
 1907+ // fix the rounded corners on file elements.
 1908+ // we want them to be rounded only when their edge touched the top or bottom of the filelist.
 1909+ $j( '#mwe-upwiz-filelist .filled .mwe-upwiz-visible-file' ).removeClass( 'ui-corner-top' ).removeClass( 'ui-corner-bottom' );
 1910+ $j( '#mwe-upwiz-filelist .filled .mwe-upwiz-visible-file:first' ).addClass( 'ui-corner-top' );
 1911+ $j( '#mwe-upwiz-filelist .filled .mwe-upwiz-visible-file:last' ).addClass( 'ui-corner-bottom' );
 1912+ $j( '#mwe-upwiz-filelist .filled:odd' ).addClass( 'odd' );
 1913+ $j( '#mwe-upwiz-filelist .filled:even' ).removeClass( 'odd' );
18801914 } else {
 1915+ // no uploads, so don't allow us to proceed
18811916 $j( '#mwe-upwiz-upload-ctrl' ).attr( 'disabled', 'disabled' );
 1917+
 1918+ // remove the border from the filelist. We can't hide it or make it invisible since it contains the displaced
 1919+ // file input element that becomes the "click here to add"
 1920+ $j( '#mwe-upwiz-filelist' ).removeClass( 'mwe-upwiz-filled-filelist' );
 1921+
 1922+ // we can't continue
18821923 $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).hide();
 1924+
 1925+ // change "add another file" into "click here to add a file"
18831926 $j( '#mwe-upwiz-add-file' ).html( gM( 'mwe-upwiz-add-file-0' ) );
18841927 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-0');
18851928 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-n');
18861929 }
18871930
 1931+ // allow an "add another upload" button only if we aren't at max
18881932 if ( _this.uploads.length < _this.maxUploads ) {
18891933 $j( '#mwe-upwiz-add-file' ).removeAttr( 'disabled' );
18901934 $j( _this.uploadToAdd.ui.div ).show();
@@ -2032,18 +2076,10 @@
20332077 _this.upload.setThumbnail( thumbnailDiv, mw.UploadWizard.config[ 'smallThumbnailWidth' ] );
20342078 }
20352079 };
2036 - /**
2037 - * Create 'remove' control, an X which highlights in some standardized way.
2038 - */
2039 - $j.fn.removeCtrl = function( tooltipMsgKey, callback ) {
2040 - return $j( '<div class="mwe-upwiz-remove-ctrl ui-corner-all" />' )
2041 - .attr( 'title', gM( tooltipMsgKey ) )
2042 - .click( callback )
2043 - .hover( function() { $j( this ).addClass( 'hover' ); },
2044 - function() { $j( this ).removeClass( 'hover' ); } )
2045 - .append( $j( '<span class="ui-icon ui-icon-close" />' ) );
2046 - };
20472080
 2081+} )( jQuery );
 2082+
 2083+( function ( $j ) {
20482084 /**
20492085 * Prevent the closing of a window with a confirm message (the onbeforeunload event seems to
20502086 * work in most browsers
Index: trunk/extensions/UploadWizard/resources/combined.min.js
@@ -5067,8 +5067,22 @@
50685068
50695069
50705070
 5071+(function($j){
 5072+$j.fn.removeCtrl=function(msgKey,tooltipMsgKey,callback){
 5073+var msg=(msgKey===null)?'':gM(msgKey);
 5074+return $j('<div class="mwe-upwiz-remove-ctrl ui-corner-all" />')
 5075+.attr('title',gM(tooltipMsgKey))
 5076+.click(callback)
 5077+.hover(function(){$j(this).addClass('hover');},
 5078+function(){$j(this).removeClass('hover');})
 5079+.append($j('<div class="ui-icon ui-icon-close" /><div class="mwe-upwiz-remove-ctrl-msg">'+msg+'</div>'));
 5080+};
 5081+})(jQuery);
50715082
50725083
 5084+
 5085+
 5086+
50735087 (function($j){$j.fn.mwCoolCats=function(options){
50745088
50755089 var defaults={
@@ -5143,7 +5157,7 @@
51445158 var $li=$j('<li class="cat"></li>');
51455159 $container.find('ul').append($li);
51465160 $li.append('<a class="cat" target="_new" href="'+href+'">'+cat+' </a>');
5147 -$li.append($j.fn.removeCtrl('mwe-upwiz-category-remove',function(){$li.remove();}));
 5161+$li.append($j.fn.removeCtrl(null,'mwe-upwiz-category-remove',function(){$li.remove();}));
51485162 }
51495163
51505164 function _catLink(cat){
@@ -5213,9 +5227,6 @@
52145228
52155229
52165230
5217 -
5218 -
5219 -
52205231 mw.log=function(s,level){
52215232
52225233 if(typeof level==='undefined'){
@@ -7902,7 +7913,9 @@
79037914 this.transport=new mw.IframeTransport(
79047915 this.$form,
79057916 function(fraction){_this.upload.setTransportProgress(fraction);},
7906 -function(result){_this.upload.setTransported(result);}
 7917+function(result){
 7918+_this.upload.setTransported(result);
 7919+}
79077920 );
79087921
79097922 };
@@ -9105,10 +9118,6 @@
91069119
91079120
91089121
9109 -
9110 -
9111 -
9112 -
91139122 (function($j){
91149123
91159124 mw.UploadWizardUpload=function(api,filesDiv){
@@ -9196,15 +9205,14 @@
91979206
91989207
91999208
9200 -
92019209 setTransported:function(result){
92029210 var _this=this;
9203 -_this.state='transported';
9204 -_this.transportProgress=1;
9205 -$j(_this.ui.div).trigger('transportedEvent');
92069211
92079212 if(result.upload&&result.upload.imageinfo){
92089213
 9214+_this.state='transported';
 9215+_this.transportProgress=1;
 9216+_this.ui.showTransported();
92099217 _this.extractUploadInfo(result);
92109218 _this.deedPreview.setup();
92119219 _this.details.populate();
@@ -9219,11 +9227,11 @@
92209228
92219229 }else{
92229230
 9231+_this.state='error';
 9232+_this.ui.showFailed();
92239233 if(result.error){
92249234 alert("error : "+result.error.code+" : "+result.error.info);
92259235 }
9226 -this.ui.showFailed();
9227 -alert("huh?");
92289236
92299237
92309238 }
@@ -9386,21 +9394,28 @@
93879395
93889396
93899397 visibleFilenameDiv=$j('<div class="mwe-upwiz-visible-file"></div>')
9390 -.append(
9391 -$j.fn.removeCtrl('mwe-upwiz-remove-upload',function(){_this.upload.remove();}),
 9398+.append('<div class="mwe-upwiz-file-indicator"></div>'
 9399++'<div class="mwe-upwiz-visible-file-filename">'
 9400++'<div class="mwe-upwiz-file-preview"/>'
 9401++'<div class="mwe-upwiz-file-texts">'
 9402++'<div class="mwe-upwiz-visible-file-filename-text"/>'
 9403++'<div class="mwe-upwiz-file-status-line">'
 9404++'<div class="mwe-upwiz-file-status mwe-upwiz-file-status-line-item"></div>'
 9405++'</div>'
 9406++'</div>'
 9407++'</div>'
 9408+);
 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+);
93929416
9393 -$j('<div class="mwe-upwiz-file-indicator"></div>'),
93949417
9395 -$j('<div class="mwe-upwiz-visible-file-filename">')
9396 -.append(
9397 -$j('<span class="ui-icon ui-icon-document" style="display: inline-block;" />'),
9398 -$j('<span class="mwe-upwiz-visible-file-filename-text"/>')
9399 -)
94009418
9401 -);
94029419
9403 -
9404 -
94059420 _this.filenameCtrl=$j('<input type="hidden" name="filename" value=""/>').get(0);
94069421
94079422
@@ -9433,13 +9448,13 @@
94349449
94359450
94369451
9437 -$j(_this.div).insertBefore('#mwe-upwiz-upload-ctrls');
 9452+$j(filesDiv).append(_this.div);
94389453
94399454
94409455
94419456 $j(_this.div).bind('transportProgressEvent',function(e){_this.showTransportProgress();});
9442 -$j(_this.div).bind('transportedEvent',function(e){_this.showTransported();});
94439457
 9458+
94449459 };
94459460
94469461
@@ -9483,13 +9498,31 @@
94849499 $j(_this.div).find('.mwe-upwiz-visible-file-filename')
94859500 .css('margin-right',($indicator.outerWidth()+24).toString()+'px');
94869501 $indicator.css('visibility','visible');
 9502+
 9503+_this.setStatus(msgKey);
94879504 },
94889505
94899506
 9507+setStatus:function(msgKey,args){
 9508+if(!mw.isDefined(args)){
 9509+args=[];
 9510+}
 9511+this.setStatusStr(gM(msgKey,args));
 9512+},
94909513
 9514+setStatusStr:function(str){
 9515+$j(this.div).find('.mwe-upwiz-file-status').html(str).show();
 9516+},
94919517
 9518+clearStatus:function(){
 9519+$j(this.div).find('.mwe-upwiz-file-status').hide();
 9520+},
94929521
9493 -showTransportProgress:function(){
 9522+
 9523+
 9524+
 9525+
 9526+showTransportProgress:function(fraction){
94949527 this.showIndicatorMessage('progress','mwe-upwiz-uploading');
94959528
94969529 },
@@ -9523,6 +9556,7 @@
95249557
95259558 alert("bad extension");
95269559 }
 9560+this.clearStatus();
95279561 },
95289562
95299563
@@ -9562,6 +9596,7 @@
95639597
95649598 updateFilename:function(){
95659599 var _this=this;
 9600+
95669601 var path=_this.fileInputCtrl.value;
95679602
95689603
@@ -9579,7 +9614,7 @@
95809615
95819616
95829617 _this.moveFileInputToCover(
9583 -$div.find('.mwe-upwiz-visible-file-filename')
 9618+$div.find('.mwe-upwiz-visible-file-filename-text')
95849619 );
95859620
95869621
@@ -9594,7 +9629,7 @@
95959630
95969631 $div.bind('mouseenter mouseover',function(){
95979632 $div.addClass('hover');
9598 -$j('#mwe-upwiz-files')
 9633+$j('#mwe-upwiz-filelist')
95999634 .children()
96009635 .filter(function(){return this!==_this.div;})
96019636 .removeClass('hover');
@@ -10129,7 +10164,7 @@
1013010165
1013110166 if(!required){
1013210167 $j(description.div).append(
10133 -$j.fn.removeCtrl('mwe-upwiz-remove-description',function(){_this.removeDescription(description);})
 10168+$j.fn.removeCtrl(null,'mwe-upwiz-remove-description',function(){_this.removeDescription(description);})
1013410169 );
1013510170 }
1013610171
@@ -10779,7 +10814,7 @@
1078010815 return false;
1078110816 }
1078210817
10783 -var upload=new mw.UploadWizardUpload(_this.api,'#mwe-upwiz-files');
 10818+var upload=new mw.UploadWizardUpload(_this.api,'#mwe-upwiz-filelist');
1078410819 _this.uploadToAdd=upload;
1078510820
1078610821 upload.ui.moveFileInputToCover('#mwe-upwiz-add-file');
@@ -10969,21 +11004,43 @@
1097011005 var _this=this;
1097111006
1097211007 if(_this.uploads.length){
 11008+
1097311009 $j('#mwe-upwiz-upload-ctrl').removeAttr('disabled');
1097411010 $j('#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons').show();
 11011+
 11012+
1097511013 $j('#mwe-upwiz-add-file').html(gM('mwe-upwiz-add-file-n'));
1097611014 $j('#mwe-upwiz-add-file-container').removeClass('mwe-upwiz-add-files-0');
1097711015 $j('#mwe-upwiz-add-file-container').addClass('mwe-upwiz-add-files-n');
10978 -$j('#mwe-upwiz-files .mwe-upwiz-file.filled:odd').addClass('odd');
10979 -$j('#mwe-upwiz-files .mwe-upwiz-file:filled:even').removeClass('odd');
 11016+
 11017+
 11018+$j('#mwe-upwiz-filelist').addClass('mwe-upwiz-filled-filelist');
 11019+
 11020+
 11021+
 11022+$j('#mwe-upwiz-filelist .filled .mwe-upwiz-visible-file').removeClass('ui-corner-top').removeClass('ui-corner-bottom');
 11023+$j('#mwe-upwiz-filelist .filled .mwe-upwiz-visible-file:first').addClass('ui-corner-top');
 11024+$j('#mwe-upwiz-filelist .filled .mwe-upwiz-visible-file:last').addClass('ui-corner-bottom');
 11025+$j('#mwe-upwiz-filelist .filled:odd').addClass('odd');
 11026+$j('#mwe-upwiz-filelist .filled:even').removeClass('odd');
1098011027 }else{
 11028+
1098111029 $j('#mwe-upwiz-upload-ctrl').attr('disabled','disabled');
 11030+
 11031+
 11032+
 11033+$j('#mwe-upwiz-filelist').removeClass('mwe-upwiz-filled-filelist');
 11034+
 11035+
1098211036 $j('#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons').hide();
 11037+
 11038+
1098311039 $j('#mwe-upwiz-add-file').html(gM('mwe-upwiz-add-file-0'));
1098411040 $j('#mwe-upwiz-add-file-container').addClass('mwe-upwiz-add-files-0');
1098511041 $j('#mwe-upwiz-add-file-container').removeClass('mwe-upwiz-add-files-n');
1098611042 }
1098711043
 11044+
1098811045 if(_this.uploads.length<_this.maxUploads){
1098911046 $j('#mwe-upwiz-add-file').removeAttr('disabled');
1099011047 $j(_this.uploadToAdd.ui.div).show();
@@ -11135,13 +11192,14 @@
1113611193
1113711194
1113811195
11139 -$j.fn.removeCtrl=function(tooltipMsgKey,callback){
 11196+$j.fn.removeCtrl=function(msgKey,tooltipMsgKey,callback){
 11197+var msg=(msgKey===null)?'':gM(msgKey);
1114011198 return $j('<div class="mwe-upwiz-remove-ctrl ui-corner-all" />')
1114111199 .attr('title',gM(tooltipMsgKey))
1114211200 .click(callback)
1114311201 .hover(function(){$j(this).addClass('hover');},
1114411202 function(){$j(this).removeClass('hover');})
11145 -.append($j('<span class="ui-icon ui-icon-close" />'));
 11203+.append($j('<div class="ui-icon ui-icon-close" /><div class="mwe-upwiz-remove-ctrl-msg">'+msg+'</div>'));
1114611204 };
1114711205
1114811206
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php
@@ -201,6 +201,7 @@
202202 . '<div class="mwe-upwiz-stepdiv ui-helper-clearfix" id="mwe-upwiz-stepdiv-file">'
203203 . '<div id="mwe-upwiz-intro">' . wfMsg('mwe-upwiz-intro') . '</div>'
204204 . '<div id="mwe-upwiz-files">'
 205+ . '<div id="mwe-upwiz-filelist" class="ui-corner-all"></div>'
205206 . '<div id="mwe-upwiz-upload-ctrls" class="mwe-upwiz-file">'
206207 . '<div id="mwe-upwiz-add-file-container" class="mwe-upwiz-add-files-0">'
207208 . '<a id="mwe-upwiz-add-file">' . wfMsg("mwe-upwiz-add-file-0") . '</a>'

Status & tagging log