Jump to content

MediaWiki:Gadget-NewImageThumb.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/*  _____________________________________________________________________________
 * |                                                                             |
 * |                    === WARNING: GLOBAL GADGET FILE ===                      |
 * |                  Changes to this page affect many users.                    |
 * | Please discuss changes on the talk page or on [[WT:Gadget]] before editing. |
 * |_____________________________________________________________________________|
 *
 * New image thumb design
 *
 * @dependencies none
 * @source en.wikipedia.org/wiki/MediaWiki:Gadget-NewImageThumb.js
 * @revision 1
 * @maintainer: Community
 */

mw.hook( 'wikipage.content' ).add( function( $content ) {
    $content.find( '.thumbinner' ).not( '.mp-thumb' ).each( function() {
        $( this ).css( 'width', ( parseInt( $( this ).css( 'width' ) ) - 2 ) + 'px' );
    } );
} );