<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://thelongdark.darksciencelabs.com/index.php?action=history&amp;feed=atom&amp;title=User%3AVelonews%2Fcommon.js</id>
	<title>User:Velonews/common.js - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://thelongdark.darksciencelabs.com/index.php?action=history&amp;feed=atom&amp;title=User%3AVelonews%2Fcommon.js"/>
	<link rel="alternate" type="text/html" href="https://thelongdark.darksciencelabs.com/index.php?title=User:Velonews/common.js&amp;action=history"/>
	<updated>2026-04-22T05:36:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://thelongdark.darksciencelabs.com/index.php?title=User:Velonews/common.js&amp;diff=8567&amp;oldid=prev</id>
		<title>imported&gt;Velonews at 21:15, 1 January 2018</title>
		<link rel="alternate" type="text/html" href="https://thelongdark.darksciencelabs.com/index.php?title=User:Velonews/common.js&amp;diff=8567&amp;oldid=prev"/>
		<updated>2018-01-01T21:15:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/* Switch Infobox -- Allows multiple infoboxes to be seamlessly switched.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// Fixes a weird bug with the MW parser that adds lots of empty parapgraphs&lt;br /&gt;
$( &amp;#039;.switch-infobox &amp;gt; p, .switch-infobox-triggers &amp;gt; p&amp;#039; ).each( function() {&lt;br /&gt;
    if ( $( this ).children( &amp;#039;br&amp;#039; ).length ) {&lt;br /&gt;
        $( this ).remove();&lt;br /&gt;
    } else {&lt;br /&gt;
        $( this ).replaceWith( this.innerHTML );&lt;br /&gt;
    }&lt;br /&gt;
} );&lt;br /&gt;
 &lt;br /&gt;
// Appends the switch triggers to every item&lt;br /&gt;
$( &amp;#039;.switch-infobox&amp;#039; ).each( function() {&lt;br /&gt;
        // The switch triggers&lt;br /&gt;
        var triggers = $( this ).children( &amp;#039;.switch-infobox-triggers&amp;#039; );&lt;br /&gt;
 &lt;br /&gt;
        $( this ).children( &amp;#039;.item&amp;#039; ).find( &amp;#039;caption&amp;#039; ).append( triggers );&lt;br /&gt;
} );&lt;br /&gt;
 &lt;br /&gt;
// Does the actual switching&lt;br /&gt;
$( &amp;#039;.switch-infobox&amp;#039; ).find( &amp;#039;.switch-infobox-triggers&amp;#039; ).children( &amp;#039;.trigger&amp;#039; ).click( function() {&lt;br /&gt;
    // The parent .switch-infobox of the clicked trigger&lt;br /&gt;
    var parentSwitchInfobox = $( this ).parents( &amp;#039;.switch-infobox&amp;#039; );&lt;br /&gt;
    // Hides items showing&lt;br /&gt;
    parentSwitchInfobox.children( &amp;#039;.item.showing&amp;#039; ).removeClass( &amp;#039;showing&amp;#039; );&lt;br /&gt;
    // Show the relevant item&lt;br /&gt;
    parentSwitchInfobox.children( &amp;#039;.item[data-id=&amp;quot;&amp;#039; + this.getAttribute( &amp;#039;data-id&amp;#039; ) + &amp;#039;&amp;quot;]&amp;#039; ).addClass( &amp;#039;showing&amp;#039; );&lt;br /&gt;
} );&lt;br /&gt;
 &lt;br /&gt;
// Finishes loading and makes switch infoboxes functional&lt;br /&gt;
$( &amp;#039;.switch-infobox.loading&amp;#039; ).removeClass( &amp;#039;loading&amp;#039; );&lt;br /&gt;
 &lt;br /&gt;
//Debug&lt;br /&gt;
console.log(&amp;#039;Initialised switch infoboxes&amp;#039;, $( &amp;#039;.switch-infobox&amp;#039; ).length);&lt;/div&gt;</summary>
		<author><name>imported&gt;Velonews</name></author>
	</entry>
</feed>