r85655 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85654‎ | r85655 | r85656 >
Date:00:45, 8 April 2011
Author:kaldari
Status:deferred (Comments)
Tags:
Comment:
fix for Bug 28316
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizardHooks.php (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/uploadWizard.css (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizardHooks.php
@@ -297,6 +297,7 @@
298298 'mwe-upwiz-help-popup-title',
299299 'mwe-upwiz-thumbnail-failed',
300300 'mwe-upwiz-unparseable-filename',
 301+ 'mwe-upwiz-image-preview',
301302 'mwe-upwiz-feedback-note',
302303 'mwe-upwiz-feedback-subject',
303304 'mwe-upwiz-feedback-message',
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php
@@ -247,6 +247,7 @@
248248 'mwe-upwiz-help-popup-title' => 'Title',
249249 'mwe-upwiz-thumbnail-failed' => 'The upload succeeded, but the server could not get a preview thumbnail',
250250 'mwe-upwiz-unparseable-filename' => 'Could not understand the file name "$1"',
 251+ 'mwe-upwiz-image-preview' => 'Image preview',
251252
252253 /* Feedback interface */
253254 'mwe-upwiz-feedback-note' => 'Your feedback will be posted to $1.',
Index: trunk/extensions/UploadWizard/resources/uploadWizard.css
@@ -696,3 +696,7 @@
697697 margin-top: 0em;
698698 margin-bottom: 0em;
699699 }
 700+
 701+.ui-dialog .mwe-upwiz-lightbox {
 702+ padding: 0;
 703+}
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -211,6 +211,12 @@
212212 mw.UploadWizard.config[ 'iconThumbnailWidth' ],
213213 mw.UploadWizard.config[ 'iconThumbnailMaxHeight' ]
214214 );
 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+ );
215221 _this.deedPreview.setup();
216222 _this.details.populate();
217223 _this.state = 'stashed';
@@ -413,13 +419,43 @@
414420 } else {
415421 $j( selector ).html(
416422 $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
419453 .append(
420454 $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+ } )
424460 )
425461 );
426462 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r85656follow up to r85655 - dont use lightboxing for thank you page thumbnailskaldari02:35, 8 April 2011
r85938misc linting and cleanupneilk04:46, 13 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85648preparing for new thumbnail linking systemkaldari22:04, 7 April 2011

Comments

#Comment by Kaldari (talk | contribs)   17:52, 13 April 2011

This code (along with r85606 and r85648) sets up basic lightboxing behavior for the image thumbnails. Instead of the thumbnails linking to the full-size image, they will now open a modal dialog box containing a large thumbnail image instead.

Status & tagging log