Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js |
— | — | @@ -93,9 +93,9 @@ |
94 | 94 | _this.upload.setThumbnail( |
95 | 95 | $preview, |
96 | 96 | mw.UploadWizard.config[ 'thumbnailWidth' ], |
97 | | - mw.UploadWizard.config[ 'thumbnailMaxHeight' ] |
| 97 | + mw.UploadWizard.config[ 'thumbnailMaxHeight' ], |
| 98 | + true |
98 | 99 | ); |
99 | | - _this.upload.setLightBox( $preview ); |
100 | 100 | |
101 | 101 | }; |
102 | 102 | |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -573,8 +573,9 @@ |
574 | 574 | * @param selector |
575 | 575 | * @param width Width constraint |
576 | 576 | * @param height Height constraint (optional) |
| 577 | + * @param boolean add lightbox large preview when ready |
577 | 578 | */ |
578 | | - setThumbnail: function( selector, width, height ) { |
| 579 | + setThumbnail: function( selector, width, height, isLightBox ) { |
579 | 580 | var _this = this; |
580 | 581 | if ( typeof width === 'undefined' || width === null || width <= 0 ) { |
581 | 582 | width = mw.UploadWizard.config['thumbnailWidth']; |
— | — | @@ -625,7 +626,7 @@ |
626 | 627 | 'margin-top': ( parseInt( ( height - image.height * scaling ) / 2, 10 ) ).toString() + 'px' |
627 | 628 | } ) |
628 | 629 | ) |
629 | | - ); |
| 630 | + ); |
630 | 631 | placed = true; |
631 | 632 | }; |
632 | 633 | |
— | — | @@ -635,6 +636,9 @@ |
636 | 637 | $.subscribeReady( |
637 | 638 | 'thumbnails.' + _this.index, |
638 | 639 | function ( x ) { |
| 640 | + if ( isLightBox ) { |
| 641 | + _this.setLightBox( selector ); |
| 642 | + } |
639 | 643 | if ( !placed ) { |
640 | 644 | if ( x === 'api' ) { |
641 | 645 | // get the thumbnail via API. This also works with an async pub/sub model; if this thumbnail was already |
— | — | @@ -680,7 +684,8 @@ |
681 | 685 | _this.setThumbnail( |
682 | 686 | $imgDiv, |
683 | 687 | mw.UploadWizard.config[ 'largeThumbnailWidth' ], |
684 | | - mw.UploadWizard.config[ 'largeThumbnailMaxHeight' ] |
| 688 | + mw.UploadWizard.config[ 'largeThumbnailMaxHeight' ], |
| 689 | + false /* obviously the largeThumbnail doesn't have a lightbox itself! */ |
685 | 690 | ); |
686 | 691 | return false; |
687 | 692 | } ); // close thumbnail click function |
— | — | @@ -1503,7 +1508,12 @@ |
1504 | 1509 | .html( $j( '<a/>' ).html( upload.title.getMainText() ) ); |
1505 | 1510 | var $thumbnailWrapDiv = $j( '<div></div>' ).addClass( 'mwe-upwiz-thumbnail-side' ); |
1506 | 1511 | $thumbnailWrapDiv.append( $thumbnailDiv, $thumbnailCaption ); |
1507 | | - upload.setThumbnail( $thumbnailDiv, mw.UploadWizard.config[ 'thumbnailWidth' ], mw.UploadWizard.config[ 'thumbnailMaxHeight' ] ); |
| 1512 | + upload.setThumbnail( |
| 1513 | + $thumbnailDiv, |
| 1514 | + mw.UploadWizard.config[ 'thumbnailWidth' ], |
| 1515 | + mw.UploadWizard.config[ 'thumbnailMaxHeight' ], |
| 1516 | + false |
| 1517 | + ); |
1508 | 1518 | |
1509 | 1519 | // Set the thumbnail links so that they point to the image description page |
1510 | 1520 | $thumbnailWrapDiv.find( 'a' ).attr( { |
— | — | @@ -1616,8 +1626,12 @@ |
1617 | 1627 | // add a preview on the deeds page |
1618 | 1628 | var thumbnailDiv = $j( '<div></div>' ).addClass( 'mwe-upwiz-thumbnail' ); |
1619 | 1629 | $j( '#mwe-upwiz-deeds-thumbnails' ).append( thumbnailDiv ); |
1620 | | - _this.upload.setThumbnail( thumbnailDiv, mw.UploadWizard.config[ 'thumbnailWidth' ], mw.UploadWizard.config[ 'thumbnailMaxHeight' ] ); |
1621 | | - _this.upload.setLightBox( thumbnailDiv ); |
| 1630 | + _this.upload.setThumbnail( |
| 1631 | + thumbnailDiv, |
| 1632 | + mw.UploadWizard.config['thumbnailWidth'], |
| 1633 | + mw.UploadWizard.config['thumbnailMaxHeight'], |
| 1634 | + true |
| 1635 | + ); |
1622 | 1636 | } |
1623 | 1637 | }; |
1624 | 1638 | |
Index: trunk/extensions/UploadWizard/resources/mw.fileApi.js |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | * @return boolean |
23 | 23 | */ |
24 | 24 | isPreviewableFile: function( file ) { |
25 | | - var known = [ 'image/png', 'image/gif', 'image/jpeg', 'image/svg+xml'], |
| 25 | + var known = [ /* 'image/png' */, 'image/gif', 'image/jpeg', 'image/svg+xml'], |
26 | 26 | tooHuge = 10 * 1024 * 1024; |
27 | 27 | return ( $.inArray( file.type, known ) !== -1 ) && file.size > 0 && file.size < tooHuge; |
28 | 28 | } |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js |
— | — | @@ -452,8 +452,12 @@ |
453 | 453 | */ |
454 | 454 | populate: function() { |
455 | 455 | var _this = this; |
456 | | - _this.upload.setThumbnail( _this.thumbnailDiv, mw.UploadWizard.config['thumbnailWidth'], mw.UploadWizard.config['thumbnailMaxHeight'] ); |
457 | | - _this.upload.setLightBox( _this.thumbnailDiv ); |
| 456 | + _this.upload.setThumbnail( |
| 457 | + _this.thumbnailDiv, |
| 458 | + mw.UploadWizard.config['thumbnailWidth'], |
| 459 | + mw.UploadWizard.config['thumbnailMaxHeight'], |
| 460 | + true |
| 461 | + ); |
458 | 462 | _this.prefillDate(); |
459 | 463 | _this.prefillSource(); |
460 | 464 | _this.prefillAuthor(); |