r89959 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89958‎ | r89959 | r89960 >
Date:13:01, 13 June 2011
Author:neilk
Status:ok (Comments)
Tags:
Comment:
100x100 thumbnails (giving up on flex height)
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizard.config.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/UploadWizard.config.php
@@ -181,7 +181,7 @@
182182
183183
184184 // Default thumbnail width
185 - 'thumbnailWidth' => 60,
 185+ 'thumbnailWidth' => 100,
186186
187187 // Max thumbnail height:
188188 'thumbnailMaxHeight' => 100,
Index: trunk/extensions/UploadWizard/resources/uploadWizard.css
@@ -162,11 +162,12 @@
163163
164164 .mwe-upwiz-file-preview {
165165 float: left;
166 - height: 60px;
167 - width: 60px;
 166+ height: 100px;
 167+ width: 100px;
168168 padding: 0.5em;
169169 border: 1px solid #e0e0e0;
170170 margin-right: 1em;
 171+ text-align: center;
171172 /* @embed */
172173 background: url('images/32px-Blank-document.svg.png') no-repeat center center;
173174 }
@@ -353,7 +354,8 @@
354355 border: 1px solid #cccccc;
355356 text-align: center;
356357 background: #ffffff;
357 - width: 60px;
 358+ width: 100px;
 359+ height: 100px;
358360 padding: 8px;
359361 }
360362
@@ -361,7 +363,7 @@
362364 float: left;
363365 margin-bottom: 1em;
364366 margin-right: 1em;
365 - width: 76px; /* see .mwe-upwiz-thumbnail, 60 + 8 + 8 */
 367+ width: 116px; /* see .mwe-upwiz-thumbnail, 100 + 8 + 8 */
366368 }
367369
368370 #mwe-upwiz-deeds-thumbnails {
@@ -702,3 +704,4 @@
703705 .mwe-upwiz-details-texts {
704706 padding: 0.5em;
705707 }
 708+
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -609,16 +609,26 @@
610610 } );
611611
612612 // add the image to the DOM, finally
613 - $j( selector ).html(
614 - $j( '<a class="mwe-upwiz-thumbnail-link"></a>' ).append(
615 - $j( '<img/>' )
616 - .attr( {
617 - width: parseInt( image.width * scaling, 10 ),
618 - height: parseInt( image.height * scaling, 10 ),
619 - src: image.src
620 - } )
621 - )
622 - );
 613+ $j( selector )
 614+ .css( { background: 'none' } )
 615+ .html(
 616+ $j( '<a/></a>' )
 617+ .addClass( "mwe-upwiz-thumbnail-link" )
 618+ .append(
 619+ $j( '<img/>' )
 620+ .attr( {
 621+ width: parseInt( image.width * scaling, 10 ),
 622+ height: parseInt( image.height * scaling, 10 ),
 623+ src: image.src
 624+ } )
 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'
 630+ } )
 631+ )
 632+ );
623633 placed = true;
624634 };
625635
@@ -1465,7 +1475,7 @@
14661476 .html( $j( '<a/>' ).html( upload.title.getMainText() ) );
14671477 var $thumbnailWrapDiv = $j( '<div></div>' ).addClass( 'mwe-upwiz-thumbnail-side' );
14681478 $thumbnailWrapDiv.append( $thumbnailDiv, $thumbnailCaption );
1469 - upload.setThumbnail( $thumbnailDiv );
 1479+ upload.setThumbnail( $thumbnailDiv, mw.UploadWizard.config[ 'thumbnailWidth' ], mw.UploadWizard.config[ 'thumbnailMaxHeight' ] );
14701480
14711481 // Set the thumbnail links so that they point to the image description page
14721482 $thumbnailWrapDiv.find( 'a' ).attr( {

Comments

#Comment by Brion VIBBER (talk | contribs)   18:20, 13 June 2011

Seems ok so far

Status & tagging log