http://www.mediawiki.org/wiki/Special:Code/MediaWiki/68397

Revision: 68397
Author:   neilk
Date:     2010-06-22 10:28:24 +0000 (Tue, 22 Jun 2010)

Log Message:
-----------
improved thumbnail appearance on deeds & thanks page, made textareas on thanks 
page readonly

Modified Paths:
--------------
    trunk/extensions/UploadWizard/UploadWizard.i18n.php
    trunk/extensions/UploadWizard/js/mw.UploadWizard.js
    trunk/extensions/UploadWizard/styles/uploadWizard.css

Modified: trunk/extensions/UploadWizard/UploadWizard.i18n.php
===================================================================
--- trunk/extensions/UploadWizard/UploadWizard.i18n.php 2010-06-22 09:41:37 UTC 
(rev 68396)
+++ trunk/extensions/UploadWizard/UploadWizard.i18n.php 2010-06-22 10:28:24 UTC 
(rev 68397)
@@ -78,7 +78,8 @@
        'mwe-upwiz-source' => 'Source',
        'mwe-upwiz-macro-edit-intro' => 'Choose a license first above, then you 
can add some descriptions and other information to your uploads.',
        'mwe-upwiz-macro-edit' => 'Update descriptions',
-       'mwe-upwiz-thanks-intro' => 'Thanks for uploading your works! You can 
now use your files on sites like Wikipedia, or link to them from elsewhere on 
the web.',
+       'mwe-upwiz-thanks-intro' => 'Thanks for uploading your works!',
+       'mwe-upwiz-thanks-explain' => 'You can now use your files on sites like 
Wikipedia, or link to them from elsewhere on the web.',
        'mwe-upwiz-thanks-link' => 'This file is now available at 
<b><tt>$1</tt></b>.',
        'mwe-upwiz-thanks-wikitext' => '<b>To use the file on Wikipedia</b>, 
copy this text into a page:',
        'mwe-upwiz-thanks-url' => '<b>To link to it in HTML</b>, copy this HTML 
code:',

Modified: trunk/extensions/UploadWizard/js/mw.UploadWizard.js
===================================================================
--- trunk/extensions/UploadWizard/js/mw.UploadWizard.js 2010-06-22 09:41:37 UTC 
(rev 68396)
+++ trunk/extensions/UploadWizard/js/mw.UploadWizard.js 2010-06-22 10:28:24 UTC 
(rev 68397)
@@ -599,17 +599,13 @@
         * @param selector
         * @param width
         */
-       setThumbnail: function( selector, width, imgClass ) {
+       setThumbnail: function( selector, width ) {
                var _this = this;
                if ( typeof width === 'undefined' || width === null || width <= 
0 )  {  
                        width = mw.getConfig( 'thumbnailWidth' );
                }
                width = parseInt( width, 10 );
-
-               if ( typeof imgClass === 'undefined' || imgClass === null ) {
-                       imgClass = 'mwe-upwiz-thumbnail';
-               }
-               
+                               
                var callback = function( thumbnail ) {
                        // side effect: will replace thumbnail's loadingSpinner
                        $j( selector ).html(
@@ -618,7 +614,6 @@
                                                 'target' : '_new' } )
                                        .append(
                                                $j( '<img/>' )
-                                                       .addClass( imgClass )
                                                        .attr( 'width',  
thumbnail.width )
                                                        .attr( 'height', 
thumbnail.height )
                                                        .attr( 'src',    
thumbnail.url ) ) );
@@ -1024,7 +1019,7 @@
 
        _this.div = $j( '<div class="mwe-upwiz-info-file"></div>' );
 
-       _this.thumbnailDiv = $j( '<div class="mwe-upwiz-thumbnail"></div>' );
+       _this.thumbnailDiv = $j( '<div class="mwe-upwiz-thumbnail 
mwe-upwiz-thumbnail-side"></div>' );
        
        _this.errorDiv = $j( '<div class="mwe-upwiz-details-error"></div>' );
 
@@ -2343,36 +2338,36 @@
        prefillThanksPage: function() {
                var _this = this;
                
-               $j( '#mwe-upwiz-thanks' ).append( $j( '<p>' ).append( gM( 
'mwe-upwiz-thanks-intro' ) ) );
-               var width = mw.getConfig( 'thumbnailWidth' );
-
+               $j( '#mwe-upwiz-thanks' )
+                       .append( $j( '<h3>' ).append( gM( 
'mwe-upwiz-thanks-intro' ) ),
+                                $j( '<p>' ).append( gM( 
'mwe-upwiz-thanks-explain' ) ) );
+               
                $j.each( _this.uploads, function(i, upload) {
                        var thanksDiv = $j( '<div class="mwe-upwiz-thanks 
ui-helper-clearfix" />' );
                        _this.thanksDiv = thanksDiv;
                        
-                       var thumbnailDiv = $j( '<div></div>' ).addClass( 
'mwe-upwiz-thumbnail' );
-                       thanksDiv.append( thumbnailDiv );
+                       var thumbnailDiv = $j( '<div class="mwe-upwiz-thumbnail 
mwe-upwiz-thumbnail-side"></div>' )
                        upload.setThumbnail( thumbnailDiv );
+                       thumbnailDiv.append( $j('<p/>').append( 
+                                               $j( '<a />' )
+                                                       .attr( { target: 
'_new', 
+                                                                href: 
upload.imageinfo.descriptionurl } )
+                                                       .text( upload.title ) 
+                                       ) );
 
-                       //var thumbTitle = upload.title.replace(/^File/, 
'Image'); // XXX is this really necessary?
+                       thanksDiv.append( thumbnailDiv );
+
                        var thumbWikiText = "[[" + upload.title + "|thumb]]";
 
                        thanksDiv.append(
                                $j( '<div class="mwe-upwiz-data"></div>' )
                                        .append( 
                                                $j('<p/>').append( 
-                                                       gM( 
'mwe-upwiz-thanks-link',
-                                                               $j( '<a />' )
-                                                                       .attr( 
{ target: '_new', 
-                                                                               
 href: upload.imageinfo.descriptionurl } )
-                                                                       .text( 
upload.title ) 
-                                                       ) 
-                                               ), 
-                                               $j('<p/>').append( 
                                                        gM( 
'mwe-upwiz-thanks-wikitext' ),
                                                        $j( '<br />' ),
                                                        $j( '<textarea 
class="mwe-long-textarea" rows="2"/>' )
                                                                .growTextArea()
+                                                               .readonly()
                                                                .append( 
thumbWikiText ) 
                                                                
.trigger('resizeEvent')
                                                ),
@@ -2381,6 +2376,7 @@
                                                        $j( '<br />' ),
                                                        $j( '<textarea 
class="mwe-long-textarea" rows="2"/>' )
                                                                .growTextArea()
+                                                               .readonly()
                                                                .append( 
upload.imageinfo.descriptionurl ) 
                                                                
.trigger('resizeEvent')
                                                )
@@ -2415,9 +2411,9 @@
        setup: function() {
                var _this = this;
                // add a preview on the deeds page
-               var thumbnailDiv = $j( '<div></div>' ).addClass( 
'mwe-upwiz-thumbnail' );
+               var thumbnailDiv = $j( '<div 
class="mwe-upwiz-thumbnail-small"></div>' );
                $j( '#mwe-upwiz-deeds-thumbnails' ).append( thumbnailDiv );
-               _this.upload.setThumbnail( thumbnailDiv, mw.getConfig( 
'smallThumbnailWidth' ), 'mwe-upwiz-smallthumbnail' );
+               _this.upload.setThumbnail( thumbnailDiv, mw.getConfig( 
'smallThumbnailWidth' ) );
        }
 };
 
@@ -3212,14 +3208,18 @@
        };
 
        $j.fn.enableNextButton = function() {
-               this.find( '.mwe-upwiz-button-next' )
+               return this.find( '.mwe-upwiz-button-next' )
                        .removeAttr( 'disabled' );
                //      .effect( 'pulsate', { times: 3 }, 1000 );
        };
 
        $j.fn.disableNextButton = function() {
-               this.find( '.mwe-upwiz-button-next' )
+               return this.find( '.mwe-upwiz-button-next' )
                        .attr( 'disabled', true );
        };
 
+       $j.fn.readonly = function() {
+               return this.css( 'background', '#ffffff' ).attr( 'readonly', 
'readonly' );
+       };
+
 } )( jQuery );

Modified: trunk/extensions/UploadWizard/styles/uploadWizard.css
===================================================================
--- trunk/extensions/UploadWizard/styles/uploadWizard.css       2010-06-22 
09:41:37 UTC (rev 68396)
+++ trunk/extensions/UploadWizard/styles/uploadWizard.css       2010-06-22 
10:28:24 UTC (rev 68397)
@@ -238,21 +238,38 @@
        background: #ffffe0;
 }
 
+.mwe-upwiz-thumbnail, .mwe-upwiz-thumbnail-small {
+       border: 1px solid #cccccc;
+       text-align: center;
+       background: #ffffff;
+}
+
 .mwe-upwiz-thumbnail {
-       width: 120px;  /* XXX should be same as configured thumbnail width in 
uploadWizard.js */
+       padding: 0.5em;
+       width: 120px;
+}
+
+.mwe-upwiz-thumbnail-side {
        float: left;
-       margin-bottom: 12px;
-       margin-right: 12px;
+       margin-bottom: 1em;
+       margin-right: 1em;
 }
 
+.mwe-upwiz-thumbnail-small {
+       padding: 0.25em;
+       width: 60px;
+}
+
 #mwe-upwiz-deeds-thumbnails {
        text-align: center;
-       vertical-align: middle;
+       margin: 1em 0;
+       background: #f0f0f0;
 }
 
-.mwe-upwiz-smallthumbnail {
-       width: 60px;  /* XXX should be same as configured small thumbnail width 
in uploadWizard.js */
-       margin: 6px;
+#mwe-upwiz-deeds-thumbnails .mwe-upwiz-thumbnail-small {
+       display: inline-block;
+       margin: 1em;
+       vertical-align: middle;
 }
 
 .mwe-upwiz-data {



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to