Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js |
— | — | @@ -95,6 +95,7 @@ |
96 | 96 | mw.UploadWizard.config[ 'thumbnailWidth' ], |
97 | 97 | mw.UploadWizard.config[ 'thumbnailMaxHeight' ] |
98 | 98 | ); |
| 99 | + _this.upload.setLightBox( $preview ); |
99 | 100 | |
100 | 101 | }; |
101 | 102 | |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -622,10 +622,7 @@ |
623 | 623 | src: image.src |
624 | 624 | } ) |
625 | 625 | .css( { |
626 | | - //'position': 'absolute', |
627 | | - //'top': '50%', |
628 | | - //'height': height.toString() + 'px', |
629 | | - 'margin-top': ( parseInt( ( 100 - image.height * scaling ) / 2, 10 ) ).toString() + 'px' |
| 626 | + 'margin-top': ( parseInt( ( height - image.height * scaling ) / 2, 10 ) ).toString() + 'px' |
630 | 627 | } ) |
631 | 628 | ) |
632 | 629 | ); |
— | — | @@ -658,7 +655,38 @@ |
659 | 656 | |
660 | 657 | }, |
661 | 658 | |
| 659 | + /** |
| 660 | + * set up lightbox behavior for non-complete thumbnails |
| 661 | + * TODO center this |
| 662 | + * @param selector |
| 663 | + */ |
| 664 | + setLightBox: function( selector ) { |
| 665 | + var _this = this; |
| 666 | + var $imgDiv = $j( '<div></div>' ).css( 'text-align', 'center' ); |
| 667 | + $j( selector ) |
| 668 | + .click( function() { |
| 669 | + // get large preview image |
| 670 | + // open large preview in modal dialog box |
| 671 | + $j( '<div class="mwe-upwiz-lightbox"></div>' ) |
| 672 | + .append( $imgDiv ) |
| 673 | + .dialog( { |
| 674 | + 'width': mw.UploadWizard.config[ 'largeThumbnailWidth' ], |
| 675 | + 'height': mw.UploadWizard.config[ 'largeThumbnailMaxHeight' ], |
| 676 | + 'autoOpen': true, |
| 677 | + 'title': gM( 'mwe-upwiz-image-preview' ), |
| 678 | + 'modal': true, |
| 679 | + 'resizable': false |
| 680 | + } ); |
| 681 | + _this.setThumbnail( |
| 682 | + $imgDiv, |
| 683 | + mw.UploadWizard.config[ 'largeThumbnailWidth' ], |
| 684 | + mw.UploadWizard.config[ 'largeThumbnailMaxHeight' ] |
| 685 | + ); |
| 686 | + return false; |
| 687 | + } ); // close thumbnail click function |
| 688 | + }, |
662 | 689 | |
| 690 | + |
663 | 691 | /** |
664 | 692 | * Given a filename like "Foo.jpg", get the URL to that filename, assuming the browser is on the same wiki. |
665 | 693 | * Candidate for a utility function... |
— | — | @@ -678,8 +706,8 @@ |
679 | 707 | |
680 | 708 | |
681 | 709 | /** |
682 | | - * Object that reperesents the entire multi-step Upload Wizard |
683 | | - */ |
| 710 | +* Object that reperesents the entire multi-step Upload Wizard |
| 711 | +*/ |
684 | 712 | mw.UploadWizard = function( config ) { |
685 | 713 | |
686 | 714 | this.uploads = []; |
— | — | @@ -1589,7 +1617,7 @@ |
1590 | 1618 | var thumbnailDiv = $j( '<div></div>' ).addClass( 'mwe-upwiz-thumbnail' ); |
1591 | 1619 | $j( '#mwe-upwiz-deeds-thumbnails' ).append( thumbnailDiv ); |
1592 | 1620 | _this.upload.setThumbnail( thumbnailDiv, mw.UploadWizard.config[ 'thumbnailWidth' ], mw.UploadWizard.config[ 'thumbnailMaxHeight' ] ); |
1593 | | - _this.upload.deedThumbnailDiv = thumbnailDiv; |
| 1621 | + _this.upload.setLightBox( thumbnailDiv ); |
1594 | 1622 | } |
1595 | 1623 | }; |
1596 | 1624 | |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js |
— | — | @@ -453,6 +453,7 @@ |
454 | 454 | populate: function() { |
455 | 455 | var _this = this; |
456 | 456 | _this.upload.setThumbnail( _this.thumbnailDiv, mw.UploadWizard.config['thumbnailWidth'], mw.UploadWizard.config['thumbnailMaxHeight'] ); |
| 457 | + _this.upload.setLightBox( _this.thumbnailDiv ); |
457 | 458 | _this.prefillDate(); |
458 | 459 | _this.prefillSource(); |
459 | 460 | _this.prefillAuthor(); |