From: Bartosz DziewoƄski Date: Mon, 24 Aug 2015 15:39:03 +0000 (+0200) Subject: mediawiki.special.upload: Use jquery.spinner properly, instead of only its CSS classes X-Git-Tag: 1.31.0-rc.0~10176^2 X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=commitdiff_plain;h=3d58a9543c720d0c3374f52533fd5db99ff9217d;p=lhc%2Fweb%2Fwiklou.git mediawiki.special.upload: Use jquery.spinner properly, instead of only its CSS classes Change-Id: I9dae724f4d8c1998ace84d1bcb753313d7581046 --- diff --git a/resources/src/mediawiki.special/mediawiki.special.upload.js b/resources/src/mediawiki.special/mediawiki.special.upload.js index 7dd0369eb5..8f72d632b6 100644 --- a/resources/src/mediawiki.special/mediawiki.special.upload.js +++ b/resources/src/mediawiki.special/mediawiki.special.upload.js @@ -291,12 +291,16 @@ ctx, meta, previewSize = 180, + $spinner = $.createSpinner( { size: 'small', type: 'block' } ) + .css( { width: previewSize, height: previewSize } ), thumb = mw.template.get( 'mediawiki.special.upload', 'thumbnail.html' ).render(); - thumb.find( '.filename' ).text( file.name ).end() - .find( '.fileinfo' ).text( prettySize( file.size ) ).end(); + thumb + .find( '.filename' ).text( file.name ).end() + .find( '.fileinfo' ).text( prettySize( file.size ) ).end() + .find( '.thumbinner' ).prepend( $spinner ).end(); - $canvas = $( '' ); + $canvas = $( '' ).attr( { width: previewSize, height: previewSize } ); ctx = $canvas[0].getContext( '2d' ); $( '#mw-htmlform-source' ).parent().prepend( thumb ); @@ -369,7 +373,7 @@ ctx.clearRect( 0, 0, 180, 180 ); ctx.rotate( rotation / 180 * Math.PI ); ctx.drawImage( img, x, y, width, height ); - thumb.find( '.mw-spinner-small' ).replaceWith( $canvas ); + $spinner.replaceWith( $canvas ); // Image size info = mw.msg( 'widthheight', logicalWidth, logicalHeight ) + diff --git a/resources/src/mediawiki.special/templates/thumbnail.html b/resources/src/mediawiki.special/templates/thumbnail.html index 305f20c6ea..bf0e7014db 100644 --- a/resources/src/mediawiki.special/templates/thumbnail.html +++ b/resources/src/mediawiki.special/templates/thumbnail.html @@ -1,7 +1,5 @@
- -