Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -404,7 +404,16 @@ |
405 | 405 | if ( !mw.isEmpty( height ) ) { |
406 | 406 | height = parseInt( height, 10 ); |
407 | 407 | } |
408 | | - |
| 408 | + |
| 409 | + var href = '#'; |
| 410 | + $j.each( [ 'descriptionurl', 'url' ], function( i, propName ) { |
| 411 | + var prop = _this.imageinfo[ propName ]; |
| 412 | + if ( prop ) { |
| 413 | + href = prop; |
| 414 | + return false; |
| 415 | + } |
| 416 | + } ); |
| 417 | + |
409 | 418 | var callback = function( image ) { |
410 | 419 | if ( image === null ) { |
411 | 420 | $j( selector ).addClass( 'mwe-upwiz-file-preview-broken' ); |
— | — | @@ -412,7 +421,7 @@ |
413 | 422 | } else { |
414 | 423 | $j( selector ).html( |
415 | 424 | $j( '<a/>' ) |
416 | | - .attr( { 'href': _this.imageinfo.url, |
| 425 | + .attr( { 'href': href, |
417 | 426 | 'target' : '_new' } ) |
418 | 427 | .append( |
419 | 428 | $j( '<img/>' ) |
— | — | @@ -1137,18 +1146,22 @@ |
1138 | 1147 | .msg( 'mwe-upwiz-thanks-explain', _this.uploads.length ) ); |
1139 | 1148 | |
1140 | 1149 | $j.each( _this.uploads, function(i, upload) { |
1141 | | - var thanksDiv = $j( '<div class="mwe-upwiz-thanks ui-helper-clearfix"></div>' ); |
1142 | | - _this.thanksDiv = thanksDiv; |
| 1150 | + var id = 'thanksDiv' + i; |
| 1151 | + var $thanksDiv = $j( '<div></div>' ).attr( 'id', id ).addClass( "mwe-upwiz-thanks ui-helper-clearfix" ); |
| 1152 | + _this.thanksDiv = $thanksDiv; |
1143 | 1153 | |
1144 | | - var thumbnailDiv = $j( '<div class="mwe-upwiz-thumbnail mwe-upwiz-thumbnail-side" id="thanks-thumbnail"></div>' ); |
1145 | | - upload.setThumbnail( thumbnailDiv ); |
| 1154 | + var $thumbnailDiv = $j( '<div class="mwe-upwiz-thumbnail mwe-upwiz-thumbnail-side"></div>' ); |
| 1155 | + $thanksDiv.append( $thumbnailDiv ); |
| 1156 | + upload.setThumbnail( $thumbnailDiv ); |
| 1157 | + //upload.setThumbnail( '#' + id + ' .mwe-upwiz-thumbnail' ); |
1146 | 1158 | |
1147 | | - thanksDiv.append( thumbnailDiv ); |
| 1159 | + // Switch the thumbnail link so that it points to the image description page |
| 1160 | + $thumbnailDiv.find( 'a' ).attr( 'href', upload.imageinfo.descriptionurl ); |
1148 | 1161 | |
1149 | 1162 | var thumbTitle = String(upload.title); |
1150 | 1163 | var thumbWikiText = "[[" + thumbTitle.replace('_', ' ') + "|thumb|" + gM( 'mwe-upwiz-thanks-caption' ) + "]]"; |
1151 | 1164 | |
1152 | | - thanksDiv.append( |
| 1165 | + $thanksDiv.append( |
1153 | 1166 | $j( '<div class="mwe-upwiz-data"></div>' ) |
1154 | 1167 | .append( |
1155 | 1168 | $j('<p/>').append( |
— | — | @@ -1172,9 +1185,7 @@ |
1173 | 1186 | ) |
1174 | 1187 | ); |
1175 | 1188 | |
1176 | | - $j( '#mwe-upwiz-thanks' ).append( thanksDiv ); |
1177 | | - // Switch the thumbnail link so that it points to the image description page |
1178 | | - $j( '#thanks-thumbnail a' ).attr( 'href', upload.imageinfo.descriptionurl ); |
| 1189 | + $j( '#mwe-upwiz-thanks' ).append( $thanksDiv ); |
1179 | 1190 | } ); |
1180 | 1191 | }, |
1181 | 1192 | |