<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://159.13.49.45/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://159.13.49.45/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3ACommon.js"/>
	<link rel="alternate" type="text/html" href="http://159.13.49.45/index.php?title=MediaWiki:Common.js&amp;action=history"/>
	<updated>2026-04-03T23:13:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://159.13.49.45/index.php?title=MediaWiki:Common.js&amp;diff=27&amp;oldid=prev</id>
		<title>Nat: Created page with &quot;/* Any JavaScript here will be loaded for all users on every page load. */ /**  * 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&#039;t a gadget, there is no place to declare its  * dependencies, so...&quot;</title>
		<link rel="alternate" type="text/html" href="http://159.13.49.45/index.php?title=MediaWiki:Common.js&amp;diff=27&amp;oldid=prev"/>
		<updated>2025-04-07T10:34:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;span class=&quot;autocomment&quot;&gt;Any JavaScript here will be loaded for all users on every page load.: &lt;/span&gt; /**  * 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...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/* Any JavaScript here will be loaded for all users on every page load. */&lt;br /&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&amp;#039;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&amp;#039;t arrived yet it&amp;#039;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( [ &amp;#039;mediawiki.util&amp;#039; ] ).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, &amp;#039;addPortletLink&amp;#039;, mw.util.addPortletLink, &amp;#039;Use mw.util.addPortletLink instead&amp;#039; );&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( &amp;#039;withCSS&amp;#039; ),&lt;br /&gt;
		extraJS = mw.util.getParamValue( &amp;#039;withJS&amp;#039; );&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( &amp;#039;/w/index.php?title=&amp;#039; + extraCSS + &amp;#039;&amp;amp;action=raw&amp;amp;ctype=text/css&amp;#039;, &amp;#039;text/css&amp;#039; );&lt;br /&gt;
		} else {&lt;br /&gt;
			mw.notify( &amp;#039;Only pages from the MediaWiki namespace are allowed.&amp;#039;, { title: &amp;#039;Invalid withCSS value&amp;#039; } );&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( &amp;#039;/w/index.php?title=&amp;#039; + extraJS + &amp;#039;&amp;amp;action=raw&amp;amp;ctype=text/javascript&amp;#039; );&lt;br /&gt;
		} else {&lt;br /&gt;
			mw.notify( &amp;#039;Only pages from the MediaWiki namespace are allowed.&amp;#039;, { title: &amp;#039;Invalid withJS value&amp;#039; } );&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( &amp;#039;table.collapsible:not(.mw-collapsible)&amp;#039; )&lt;br /&gt;
			.addClass( &amp;#039;mw-collapsible&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
		$.each( $tables, function ( index, table ) {&lt;br /&gt;
			// mw.log.warn( &amp;#039;This page is using the deprecated class collapsible. Please replace it with mw-collapsible.&amp;#039;);&lt;br /&gt;
			if ( $( table ).hasClass( &amp;#039;collapsed&amp;#039; ) ) {&lt;br /&gt;
				$( table ).addClass( &amp;#039;mw-collapsed&amp;#039; );&lt;br /&gt;
				// mw.log.warn( &amp;#039;This page is using the deprecated class collapsed. Please replace it with mw-collapsed.&amp;#039;);&lt;br /&gt;
			}&lt;br /&gt;
		} );&lt;br /&gt;
		if ( $tables.length &amp;gt; 0 ) {&lt;br /&gt;
			mw.loader.using( &amp;#039;jquery.makeCollapsible&amp;#039; ).then( function () {&lt;br /&gt;
				$tables.makeCollapsible();&lt;br /&gt;
			} );&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	mw.hook( &amp;#039;wikipage.content&amp;#039; ).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( &amp;#039;collapsible&amp;#039; ) ) {&lt;br /&gt;
				$element.find( &amp;#039;tr:first &amp;gt; th:first&amp;#039; ).prepend( $element.find( &amp;#039;tr:first &amp;gt; * &amp;gt; .mw-collapsible-toggle&amp;#039; ) );&lt;br /&gt;
			}&lt;br /&gt;
			if ( $collapsibleContent.length &amp;gt;= autoCollapseThreshold &amp;amp;&amp;amp; $element.hasClass( &amp;#039;autocollapse&amp;#039; ) ) {&lt;br /&gt;
				$element.data( &amp;#039;mw-collapsible&amp;#039; ).collapse();&lt;br /&gt;
			} else if ( $element.hasClass( &amp;#039;innercollapse&amp;#039; ) ) {&lt;br /&gt;
				if ( $element.parents( &amp;#039;.outercollapse&amp;#039; ).length &amp;gt; 0 ) {&lt;br /&gt;
					$element.data( &amp;#039;mw-collapsible&amp;#039; ).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( &amp;#039;.mw-collapsible-toggle&amp;#039; );&lt;br /&gt;
			if ( $toggle.length ) {&lt;br /&gt;
				// Make the toggle inherit text color (Updated for T333357 2023-04-29)&lt;br /&gt;
				if ( $toggle.parent()[ 0 ].style.color ) {&lt;br /&gt;
					$toggle.css( &amp;#039;color&amp;#039;, &amp;#039;inherit&amp;#039; );&lt;br /&gt;
					$toggle.find( &amp;#039;.mw-collapsible-text&amp;#039; ).css( &amp;#039;color&amp;#039;, &amp;#039;inherit&amp;#039; );&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		} );&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	mw.hook( &amp;#039;wikipage.collapsibleContent&amp;#039; ).add( mwCollapsibleSetup );&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>Nat</name></author>
	</entry>
</feed>