<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.bdfserver.com/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3ACommon.js</id>
	<title>MediaWiki:Common.js - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.bdfserver.com/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3ACommon.js"/>
	<link rel="alternate" type="text/html" href="http://wiki.bdfserver.com/index.php?title=MediaWiki:Common.js&amp;action=history"/>
	<updated>2026-04-18T22:58:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://wiki.bdfserver.com/index.php?title=MediaWiki:Common.js&amp;diff=3783&amp;oldid=prev</id>
		<title>Bferrell: Created page with &quot;/**  * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally  * loaded for all users on every wiki page. If possible create a gadget that is  * enabled by default instead of adding it here (since gadgets are fully  * optimized ResourceLoader modules with possibility to add dependencies etc.)  *  * Since Common.js isn't a gadget, there is no place to declare its  * dependencies, so we have to lazy load them with mw.loader.using on demand and  * then execu...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.bdfserver.com/index.php?title=MediaWiki:Common.js&amp;diff=3783&amp;oldid=prev"/>
		<updated>2023-03-05T02:22:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;/**  * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally  * loaded for all users on every wiki page. If possible create a gadget that is  * enabled by default instead of adding it here (since gadgets are fully  * optimized ResourceLoader modules with possibility to add dependencies etc.)  *  * Since Common.js isn&amp;#039;t a gadget, there is no place to declare its  * dependencies, so we have to lazy load them with mw.loader.using on demand and  * then execu...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/**&lt;br /&gt;
 * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally&lt;br /&gt;
 * loaded for all users on every wiki page. If possible create a gadget that is&lt;br /&gt;
 * enabled by default instead of adding it here (since gadgets are fully&lt;br /&gt;
 * optimized ResourceLoader modules with possibility to add dependencies etc.)&lt;br /&gt;
 *&lt;br /&gt;
 * Since Common.js isn't a gadget, there is no place to declare its&lt;br /&gt;
 * dependencies, so we have to lazy load them with mw.loader.using on demand and&lt;br /&gt;
 * then execute the rest in the callback. In most cases these dependencies will&lt;br /&gt;
 * be loaded (or loading) already and the callback will not be delayed. In case a&lt;br /&gt;
 * dependency hasn't arrived yet it'll make sure those are loaded before this.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* global mw, $ */&lt;br /&gt;
/* jshint strict:false, browser:true */&lt;br /&gt;
&lt;br /&gt;
mw.loader.using( [ 'mediawiki.util' ] ).done( function () {&lt;br /&gt;
	/* Begin of mw.loader.using callback */&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Map addPortletLink to mw.util&lt;br /&gt;
	 * @deprecated: Use mw.util.addPortletLink instead.&lt;br /&gt;
	 */&lt;br /&gt;
	mw.log.deprecate( window, 'addPortletLink', mw.util.addPortletLink, 'Use mw.util.addPortletLink instead' );&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Test if an element has a certain class&lt;br /&gt;
	 * @deprecated:  Use $(element).hasClass() instead.&lt;br /&gt;
	 */&lt;br /&gt;
	mw.log.deprecate( window, 'hasClass', function ( element, className ) {&lt;br /&gt;
		return $( element ).hasClass( className );&lt;br /&gt;
	}, 'Use jQuery.hasClass() instead' );&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * @source www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL&lt;br /&gt;
	 * @rev 6&lt;br /&gt;
	 */&lt;br /&gt;
	var extraCSS = mw.util.getParamValue( 'withCSS' ),&lt;br /&gt;
		extraJS = mw.util.getParamValue( 'withJS' );&lt;br /&gt;
&lt;br /&gt;
	if ( extraCSS ) {&lt;br /&gt;
		if ( extraCSS.match( /^MediaWiki:[^&amp;amp;&amp;lt;&amp;gt;=%#]*\.css$/ ) ) {&lt;br /&gt;
			mw.loader.load( '/w/index.php?title=' + extraCSS + '&amp;amp;action=raw&amp;amp;ctype=text/css', 'text/css' );&lt;br /&gt;
		} else {&lt;br /&gt;
			mw.notify( 'Only pages from the MediaWiki namespace are allowed.', { title: 'Invalid withCSS value' } );&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ( extraJS ) {&lt;br /&gt;
		if ( extraJS.match( /^MediaWiki:[^&amp;amp;&amp;lt;&amp;gt;=%#]*\.js$/ ) ) {&lt;br /&gt;
			mw.loader.load( '/w/index.php?title=' + extraJS + '&amp;amp;action=raw&amp;amp;ctype=text/javascript' );&lt;br /&gt;
		} else {&lt;br /&gt;
			mw.notify( 'Only pages from the MediaWiki namespace are allowed.', { title: 'Invalid withJS value' } );&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * WikiMiniAtlas&lt;br /&gt;
	 *&lt;br /&gt;
	 * Description: WikiMiniAtlas is a popup click and drag world map.&lt;br /&gt;
	 *              This script causes all of our coordinate links to display the WikiMiniAtlas popup button.&lt;br /&gt;
	 *              The script itself is located on the Meta-Wiki because it is used by many projects.&lt;br /&gt;
	 *              See [[Meta:WikiMiniAtlas]] for more information.&lt;br /&gt;
	 * Note - use of this service is recommended to be replaced with mw:Help:Extension:Kartographer&lt;br /&gt;
	 */&lt;br /&gt;
	$( function () {&lt;br /&gt;
		var requireWikiminiatlas = $( 'a.external.text[href*=&amp;quot;geohack&amp;quot;]' ).length || $( 'div.kmldata' ).length;&lt;br /&gt;
		if ( requireWikiminiatlas ) {&lt;br /&gt;
			mw.loader.load( '//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&amp;amp;action=raw&amp;amp;ctype=text/javascript' );&lt;br /&gt;
		}&lt;br /&gt;
	} );&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Collapsible tables; reimplemented with mw-collapsible&lt;br /&gt;
	 * Styling is also in place to avoid FOUC&lt;br /&gt;
	 *&lt;br /&gt;
	 * Allows tables to be collapsed, showing only the header. See [[Help:Collapsing]].&lt;br /&gt;
	 * @version 3.0.0 (2018-05-20)&lt;br /&gt;
	 * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-collapsibleTables.js&lt;br /&gt;
	 * @author [[User:R. Koot]]&lt;br /&gt;
	 * @author [[User:Krinkle]]&lt;br /&gt;
	 * @author [[User:TheDJ]]&lt;br /&gt;
	 * @deprecated Since MediaWiki 1.20: Use class=&amp;quot;mw-collapsible&amp;quot; instead which&lt;br /&gt;
	 * is supported in MediaWiki core. Shimmable since MediaWiki 1.32&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param {jQuery} $content&lt;br /&gt;
	 */&lt;br /&gt;
	function makeCollapsibleMwCollapsible( $content ) {&lt;br /&gt;
		var $tables = $content&lt;br /&gt;
			.find( 'table.collapsible:not(.mw-collapsible)' )&lt;br /&gt;
			.addClass( 'mw-collapsible' );&lt;br /&gt;
&lt;br /&gt;
		$.each( $tables, function ( index, table ) {&lt;br /&gt;
			// mw.log.warn( 'This page is using the deprecated class collapsible. Please replace it with mw-collapsible.');&lt;br /&gt;
			if ( $( table ).hasClass( 'collapsed' ) ) {&lt;br /&gt;
				$( table ).addClass( 'mw-collapsed' );&lt;br /&gt;
				// mw.log.warn( 'This page is using the deprecated class collapsed. Please replace it with mw-collapsed.');&lt;br /&gt;
			}&lt;br /&gt;
		} );&lt;br /&gt;
		if ( $tables.length &amp;gt; 0 ) {&lt;br /&gt;
			mw.loader.using( 'jquery.makeCollapsible' ).then( function () {&lt;br /&gt;
				$tables.makeCollapsible();&lt;br /&gt;
			} );&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	mw.hook( 'wikipage.content' ).add( makeCollapsibleMwCollapsible );&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add support to mw-collapsible for autocollapse, innercollapse and outercollapse&lt;br /&gt;
	 *&lt;br /&gt;
	 * Maintainers: TheDJ&lt;br /&gt;
	 */&lt;br /&gt;
	function mwCollapsibleSetup( $collapsibleContent ) {&lt;br /&gt;
		var $element,&lt;br /&gt;
			$toggle,&lt;br /&gt;
			autoCollapseThreshold = 2;&lt;br /&gt;
		$.each( $collapsibleContent, function ( index, element ) {&lt;br /&gt;
			$element = $( element );&lt;br /&gt;
			if ( $element.hasClass( 'collapsible' ) ) {&lt;br /&gt;
				$element.find( 'tr:first &amp;gt; th:first' ).prepend( $element.find( 'tr:first &amp;gt; * &amp;gt; .mw-collapsible-toggle' ) );&lt;br /&gt;
			}&lt;br /&gt;
			if ( $collapsibleContent.length &amp;gt;= autoCollapseThreshold &amp;amp;&amp;amp; $element.hasClass( 'autocollapse' ) ) {&lt;br /&gt;
				$element.data( 'mw-collapsible' ).collapse();&lt;br /&gt;
			} else if ( $element.hasClass( 'innercollapse' ) ) {&lt;br /&gt;
				if ( $element.parents( '.outercollapse' ).length &amp;gt; 0 ) {&lt;br /&gt;
					$element.data( 'mw-collapsible' ).collapse();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			// because of colored backgrounds, style the link in the text color&lt;br /&gt;
			// to ensure accessible contrast&lt;br /&gt;
			$toggle = $element.find( '.mw-collapsible-toggle' );&lt;br /&gt;
			if ( $toggle.length ) {&lt;br /&gt;
				// Make the toggle inherit text color&lt;br /&gt;
				if ( $toggle.parent()[ 0 ].style.color ) {&lt;br /&gt;
					$toggle.find( 'a' ).css( 'color', 'inherit' );&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		} );&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	mw.hook( 'wikipage.collapsibleContent' ).add( mwCollapsibleSetup );&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Magic editintros ****************************************************&lt;br /&gt;
	 *&lt;br /&gt;
	 * Description: Adds editintros on disambiguation pages and BLP pages.&lt;br /&gt;
	 * Maintainers: [[User:RockMFR]]&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param {string} name&lt;br /&gt;
	 */&lt;br /&gt;
	function addEditIntro( name ) {&lt;br /&gt;
		$( '.mw-editsection, #ca-edit, #ca-ve-edit' ).find( 'a' ).each( function ( i, el ) {&lt;br /&gt;
			el.href = $( this ).attr( 'href' ) + '&amp;amp;editintro=' + name;&lt;br /&gt;
		} );&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ( mw.config.get( 'wgNamespaceNumber' ) === 0 ) {&lt;br /&gt;
		$( function () {&lt;br /&gt;
			if ( document.getElementById( 'disambigbox' ) ) {&lt;br /&gt;
				addEditIntro( 'Template:Disambig_editintro' );&lt;br /&gt;
			}&lt;br /&gt;
		} );&lt;br /&gt;
&lt;br /&gt;
		$( function () {&lt;br /&gt;
			var cats = mw.config.get( 'wgCategories' );&lt;br /&gt;
			if ( !cats ) {&lt;br /&gt;
				return;&lt;br /&gt;
			}&lt;br /&gt;
			if ( $.inArray( 'Living people', cats ) !== -1 || $.inArray( 'Possibly living people', cats ) !== -1 ) {&lt;br /&gt;
				addEditIntro( 'Template:BLP_editintro' );&lt;br /&gt;
			}&lt;br /&gt;
		} );&lt;br /&gt;
	}&lt;br /&gt;
	/* End of mw.loader.using callback */&lt;br /&gt;
} );&lt;br /&gt;
/* DO NOT ADD CODE BELOW THIS LINE */&lt;/div&gt;</summary>
		<author><name>Bferrell</name></author>
	</entry>
</feed>