Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -297,6 +297,7 @@ |
298 | 298 | 'mwe-upwiz-help-popup-title', |
299 | 299 | 'mwe-upwiz-thumbnail-failed', |
300 | 300 | 'mwe-upwiz-unparseable-filename', |
| 301 | + 'mwe-upwiz-image-preview', |
301 | 302 | 'mwe-upwiz-feedback-note', |
302 | 303 | 'mwe-upwiz-feedback-subject', |
303 | 304 | 'mwe-upwiz-feedback-message', |
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -247,6 +247,7 @@ |
248 | 248 | 'mwe-upwiz-help-popup-title' => 'Title', |
249 | 249 | 'mwe-upwiz-thumbnail-failed' => 'The upload succeeded, but the server could not get a preview thumbnail', |
250 | 250 | 'mwe-upwiz-unparseable-filename' => 'Could not understand the file name "$1"', |
| 251 | + 'mwe-upwiz-image-preview' => 'Image preview', |
251 | 252 | |
252 | 253 | /* Feedback interface */ |
253 | 254 | 'mwe-upwiz-feedback-note' => 'Your feedback will be posted to $1.', |
Index: trunk/extensions/UploadWizard/resources/uploadWizard.css |
— | — | @@ -696,3 +696,7 @@ |
697 | 697 | margin-top: 0em; |
698 | 698 | margin-bottom: 0em; |
699 | 699 | } |
| 700 | + |
| 701 | +.ui-dialog .mwe-upwiz-lightbox { |
| 702 | + padding: 0; |
| 703 | +} |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -211,6 +211,12 @@ |
212 | 212 | mw.UploadWizard.config[ 'iconThumbnailWidth' ], |
213 | 213 | mw.UploadWizard.config[ 'iconThumbnailMaxHeight' ] |
214 | 214 | ); |
| 215 | + // create the large thumbnail that the other thumbnails link to |
| 216 | + _this.getThumbnail( |
| 217 | + function( image ) {}, |
| 218 | + mw.UploadWizard.config[ 'largeThumbnailWidth' ], |
| 219 | + mw.UploadWizard.config[ 'largeThumbnailMaxHeight' ] |
| 220 | + ); |
215 | 221 | _this.deedPreview.setup(); |
216 | 222 | _this.details.populate(); |
217 | 223 | _this.state = 'stashed'; |
— | — | @@ -413,13 +419,43 @@ |
414 | 420 | } else { |
415 | 421 | $j( selector ).html( |
416 | 422 | $j( '<a class="mwe-upwiz-thumbnail-link"></a>' ) |
417 | | - .attr( { 'href': '#', |
418 | | - 'target' : '_new' } ) |
| 423 | + .attr( { |
| 424 | + 'href': '#', |
| 425 | + 'target' : '_new' |
| 426 | + } ) |
| 427 | + .click( function() { |
| 428 | + // get large preview image |
| 429 | + _this.getThumbnail( |
| 430 | + // open large preview in modal dialog box |
| 431 | + function( image ) { |
| 432 | + if ( image.width > 250 ) { |
| 433 | + var dialogWidth = image.width; |
| 434 | + } else { |
| 435 | + var dialogWidth = 250; |
| 436 | + } |
| 437 | + $( '<div class="mwe-upwiz-lightbox"></div>' ) |
| 438 | + .append( image ) |
| 439 | + .dialog( { |
| 440 | + 'width': dialogWidth, |
| 441 | + 'autoOpen': true, |
| 442 | + 'title': gM( 'mwe-upwiz-image-preview' ), |
| 443 | + 'modal': true, |
| 444 | + 'resizable': false |
| 445 | + } ) |
| 446 | + }, |
| 447 | + mw.UploadWizard.config[ 'largeThumbnailWidth' ], |
| 448 | + mw.UploadWizard.config[ 'largeThumbnailMaxHeight' ] |
| 449 | + ); |
| 450 | + return false; |
| 451 | + } ) // close thumbnail click function |
| 452 | + // insert the thumbnail into the anchor |
419 | 453 | .append( |
420 | 454 | $j( '<img/>' ) |
421 | | - .attr( { 'width': image.width, |
422 | | - 'height': image.height, |
423 | | - 'src': image.src } ) |
| 455 | + .attr( { |
| 456 | + 'width': image.width, |
| 457 | + 'height': image.height, |
| 458 | + 'src': image.src |
| 459 | + } ) |
424 | 460 | ) |
425 | 461 | ); |
426 | 462 | } |