r85656 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85655‎ | r85656 | r85657 >
Date:02:35, 8 April 2011
Author:kaldari
Status:deferred
Tags:
Comment:
follow up to r85655 - dont use lightboxing for thank you page thumbnails
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -417,21 +417,23 @@
418418 $j( selector ).addClass( 'mwe-upwiz-file-preview-broken' );
419419 _this.ui.setStatus( 'mwe-upwiz-thumbnail-failed' );
420420 } 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
423424 .attr( {
424425 'href': '#',
425426 'target' : '_new'
426427 } )
 428+ // set up lightbox behavior for thumbnail
427429 .click( function() {
428430 // get large preview image
429431 _this.getThumbnail(
430432 // open large preview in modal dialog box
431433 function( image ) {
432 - if ( image.width > 250 ) {
 434+ if ( image.width > 200 ) {
433435 var dialogWidth = image.width;
434436 } else {
435 - var dialogWidth = 250;
 437+ var dialogWidth = 200;
436438 }
437439 $( '<div class="mwe-upwiz-lightbox"></div>' )
438440 .append( image )
@@ -448,17 +450,20 @@
449451 );
450452 return false;
451453 } ) // 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
463468 };
464469
465470 _this.getThumbnail( callback, width, height );
@@ -1195,8 +1200,11 @@
11961201 upload.setThumbnail( $thumbnailDiv );
11971202 //upload.setThumbnail( '#' + id + ' .mwe-upwiz-thumbnail' );
11981203
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+ } );
12011209
12021210 var thumbTitle = String(upload.title);
12031211 var thumbWikiText = "[[" + thumbTitle.replace('_', ' ') + "|thumb|" + gM( 'mwe-upwiz-thanks-caption' ) + "]]";

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85655fix for Bug 28316kaldari00:45, 8 April 2011

Status & tagging log