User:Ainz Ooal Gown/mobileshortdescription.js

// Adds a page description just below the page name /* Load only in Wikis where "wgMFDisplayWikibaseDescriptions['tagline'] = true" config is disabled. Action should be view and the skin should be Minerva. Load also in main page. */ if ( mw.config.get('wgAction') === 'view' && mw.config.get( 'skin' ) === 'minerva' && (mw.config.get('wgMFDisplayWikibaseDescriptions[tagline]') == false || mw.config.get('wgIsMainPage') == true || mw.config.get('wgNamespaceNumber') !== '0') ) { mw.loader.using( 'mediawiki.api' ).then( function { // Api variables				var api = new mw.Api,			callPromise = api.get({ action: 'query', titles: mw.config.get( 'wgPageName' ), prop: 'description', formatversion: 2 });		$.when( callPromise, $.ready ).then( function ( results ) { var pageDescription, $description, response = results[ 0 ]; if (				response.query &&				response.query.pages &&				response.query.pages[ 0 ].description			) { pageDescription = response.query.pages[ 0 ].description; $description = $( ' ' ) .addClass( 'mw-page-description' ) .text( pageDescription ); }			if ( $description ) { $( '.tagline' ).prepend( $description ); }		});	}); }