Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -417,21 +417,23 @@ |
418 | 418 | $j( selector ).addClass( 'mwe-upwiz-file-preview-broken' ); |
419 | 419 | _this.ui.setStatus( 'mwe-upwiz-thumbnail-failed' ); |
420 | 420 | } else { |
421 | | - $j( selector ).html( |
422 | | - $j( '<a class="mwe-upwiz-thumbnail-link"></a>' ) |
| 421 | + var $thumbnailLink = $j( '<a class="mwe-upwiz-thumbnail-link"></a>' ); |
| 422 | + if ( _this.state != 'complete' ) { // don't use lightbox for thank you page thumbnail |
| 423 | + $thumbnailLink |
423 | 424 | .attr( { |
424 | 425 | 'href': '#', |
425 | 426 | 'target' : '_new' |
426 | 427 | } ) |
| 428 | + // set up lightbox behavior for thumbnail |
427 | 429 | .click( function() { |
428 | 430 | // get large preview image |
429 | 431 | _this.getThumbnail( |
430 | 432 | // open large preview in modal dialog box |
431 | 433 | function( image ) { |
432 | | - if ( image.width > 250 ) { |
| 434 | + if ( image.width > 200 ) { |
433 | 435 | var dialogWidth = image.width; |
434 | 436 | } else { |
435 | | - var dialogWidth = 250; |
| 437 | + var dialogWidth = 200; |
436 | 438 | } |
437 | 439 | $( '<div class="mwe-upwiz-lightbox"></div>' ) |
438 | 440 | .append( image ) |
— | — | @@ -448,17 +450,20 @@ |
449 | 451 | ); |
450 | 452 | return false; |
451 | 453 | } ) // close thumbnail click function |
452 | | - // insert the thumbnail into the anchor |
453 | | - .append( |
454 | | - $j( '<img/>' ) |
455 | | - .attr( { |
456 | | - 'width': image.width, |
457 | | - 'height': image.height, |
458 | | - 'src': image.src |
459 | | - } ) |
460 | | - ) |
461 | | - ); |
462 | | - } |
| 454 | + } // close if |
| 455 | + |
| 456 | + $j( selector ).html( |
| 457 | + // insert the thumbnail into the anchor |
| 458 | + $thumbnailLink.append( |
| 459 | + $j( '<img/>' ) |
| 460 | + .attr( { |
| 461 | + 'width': image.width, |
| 462 | + 'height': image.height, |
| 463 | + 'src': image.src |
| 464 | + } ) |
| 465 | + ) // close append |
| 466 | + ); // close html |
| 467 | + } // close image !== null else condition |
463 | 468 | }; |
464 | 469 | |
465 | 470 | _this.getThumbnail( callback, width, height ); |
— | — | @@ -1195,8 +1200,11 @@ |
1196 | 1201 | upload.setThumbnail( $thumbnailDiv ); |
1197 | 1202 | //upload.setThumbnail( '#' + id + ' .mwe-upwiz-thumbnail' ); |
1198 | 1203 | |
1199 | | - // Switch the thumbnail link so that it points to the image description page |
1200 | | - $thumbnailDiv.find( 'a' ).attr( 'href', upload.imageinfo.descriptionurl ); |
| 1204 | + // Set the thumbnail link so that it points to the image description page |
| 1205 | + $thumbnailDiv.find( 'a' ).attr( { |
| 1206 | + 'href': upload.imageinfo.descriptionurl, |
| 1207 | + 'target' : '_new' |
| 1208 | + } ); |
1201 | 1209 | |
1202 | 1210 | var thumbTitle = String(upload.title); |
1203 | 1211 | var thumbWikiText = "[[" + thumbTitle.replace('_', ' ') + "|thumb|" + gM( 'mwe-upwiz-thanks-caption' ) + "]]"; |