<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
	<id>https://wiki.stunts.hu/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="https://wiki.stunts.hu/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3ACommon.js"/>
	<link rel="alternate" type="text/html" href="https://wiki.stunts.hu/index.php?title=MediaWiki:Common.js&amp;action=history"/>
	<updated>2026-04-10T09:28:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://wiki.stunts.hu/index.php?title=MediaWiki:Common.js&amp;diff=1867&amp;oldid=prev</id>
		<title>Duplode at 15:59, 24 February 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.stunts.hu/index.php?title=MediaWiki:Common.js&amp;diff=1867&amp;oldid=prev"/>
		<updated>2010-02-24T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wiki.stunts.hu/index.php?title=MediaWiki:Common.js&amp;amp;diff=1867&amp;amp;oldid=1866&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Duplode</name></author>
	</entry>
	<entry>
		<id>https://wiki.stunts.hu/index.php?title=MediaWiki:Common.js&amp;diff=1866&amp;oldid=prev</id>
		<title>Duplode at 15:55, 24 February 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.stunts.hu/index.php?title=MediaWiki:Common.js&amp;diff=1866&amp;oldid=prev"/>
		<updated>2010-02-24T15:55:40Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-US&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:55, 24 February 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/* Experimental: adding the collapsible tables code from Wikipedia. */&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/* Experimental: adding the collapsible tables code from Wikipedia. */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/* Test if an element has a certain class **************************************&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; *&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; * Description: Uses regular expressions and caching for better performance.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; */&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var hasClass = (function () {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    var reCache = {};&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    return function (element, className) {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp(&quot;(?:\\s|^)&quot; + className + &quot;(?:\\s|$)&quot;))).test(element.className);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    };&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;})();&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/** Collapsible tables *********************************************************&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/** Collapsible tables *********************************************************&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Duplode</name></author>
	</entry>
	<entry>
		<id>https://wiki.stunts.hu/index.php?title=MediaWiki:Common.js&amp;diff=1864&amp;oldid=prev</id>
		<title>Duplode: trying to implement collapsible tables</title>
		<link rel="alternate" type="text/html" href="https://wiki.stunts.hu/index.php?title=MediaWiki:Common.js&amp;diff=1864&amp;oldid=prev"/>
		<updated>2010-02-24T15:47:28Z</updated>

		<summary type="html">&lt;p&gt;trying to implement collapsible tables&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;
/* Experimental: adding the collapsible tables code from Wikipedia. */&lt;br /&gt;
&lt;br /&gt;
/** Collapsible tables *********************************************************&lt;br /&gt;
 *&lt;br /&gt;
 *  Description: Allows tables to be collapsed, showing only the header. See&lt;br /&gt;
 *               [[Wikipedia:NavFrame]].&lt;br /&gt;
 *  Maintainers: [[User:R. Koot]]&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
var autoCollapse = 2;&lt;br /&gt;
var collapseCaption = &amp;quot;hide&amp;quot;;&lt;br /&gt;
var expandCaption = &amp;quot;show&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
function collapseTable( tableIndex )&lt;br /&gt;
{&lt;br /&gt;
    var Button = document.getElementById( &amp;quot;collapseButton&amp;quot; + tableIndex );&lt;br /&gt;
    var Table = document.getElementById( &amp;quot;collapsibleTable&amp;quot; + tableIndex );&lt;br /&gt;
 &lt;br /&gt;
    if ( !Table || !Button ) {&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    var Rows = Table.rows;&lt;br /&gt;
 &lt;br /&gt;
    if ( Button.firstChild.data == collapseCaption ) {&lt;br /&gt;
        for ( var i = 1; i &amp;lt; Rows.length; i++ ) {&lt;br /&gt;
            Rows[i].style.display = &amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        Button.firstChild.data = expandCaption;&lt;br /&gt;
    } else {&lt;br /&gt;
        for ( var i = 1; i &amp;lt; Rows.length; i++ ) {&lt;br /&gt;
            Rows[i].style.display = Rows[0].style.display;&lt;br /&gt;
        }&lt;br /&gt;
        Button.firstChild.data = collapseCaption;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
function createCollapseButtons()&lt;br /&gt;
{&lt;br /&gt;
    var tableIndex = 0;&lt;br /&gt;
    var NavigationBoxes = new Object();&lt;br /&gt;
    var Tables = document.getElementsByTagName( &amp;quot;table&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
    for ( var i = 0; i &amp;lt; Tables.length; i++ ) {&lt;br /&gt;
        if ( hasClass( Tables[i], &amp;quot;collapsible&amp;quot; ) ) {&lt;br /&gt;
 &lt;br /&gt;
            /* only add button and increment count if there is a header row to work with */&lt;br /&gt;
            var HeaderRow = Tables[i].getElementsByTagName( &amp;quot;tr&amp;quot; )[0];&lt;br /&gt;
            if (!HeaderRow) continue;&lt;br /&gt;
            var Header = HeaderRow.getElementsByTagName( &amp;quot;th&amp;quot; )[0];&lt;br /&gt;
            if (!Header) continue;&lt;br /&gt;
 &lt;br /&gt;
            NavigationBoxes[ tableIndex ] = Tables[i];&lt;br /&gt;
            Tables[i].setAttribute( &amp;quot;id&amp;quot;, &amp;quot;collapsibleTable&amp;quot; + tableIndex );&lt;br /&gt;
 &lt;br /&gt;
            var Button     = document.createElement( &amp;quot;span&amp;quot; );&lt;br /&gt;
            var ButtonLink = document.createElement( &amp;quot;a&amp;quot; );&lt;br /&gt;
            var ButtonText = document.createTextNode( collapseCaption );&lt;br /&gt;
 &lt;br /&gt;
            Button.className = &amp;quot;collapseButton&amp;quot;;  //Styles are declared in Common.css&lt;br /&gt;
 &lt;br /&gt;
            ButtonLink.style.color = Header.style.color;&lt;br /&gt;
            ButtonLink.setAttribute( &amp;quot;id&amp;quot;, &amp;quot;collapseButton&amp;quot; + tableIndex );&lt;br /&gt;
            ButtonLink.setAttribute( &amp;quot;href&amp;quot;, &amp;quot;javascript:collapseTable(&amp;quot; + tableIndex + &amp;quot;);&amp;quot; );&lt;br /&gt;
            ButtonLink.appendChild( ButtonText );&lt;br /&gt;
 &lt;br /&gt;
            Button.appendChild( document.createTextNode( &amp;quot;[&amp;quot; ) );&lt;br /&gt;
            Button.appendChild( ButtonLink );&lt;br /&gt;
            Button.appendChild( document.createTextNode( &amp;quot;]&amp;quot; ) );&lt;br /&gt;
 &lt;br /&gt;
            Header.insertBefore( Button, Header.childNodes[0] );&lt;br /&gt;
            tableIndex++;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    for ( var i = 0;  i &amp;lt; tableIndex; i++ ) {&lt;br /&gt;
        if ( hasClass( NavigationBoxes[i], &amp;quot;collapsed&amp;quot; ) || ( tableIndex &amp;gt;= autoCollapse &amp;amp;&amp;amp; hasClass( NavigationBoxes[i], &amp;quot;autocollapse&amp;quot; ) ) ) {&lt;br /&gt;
            collapseTable( i );&lt;br /&gt;
        } &lt;br /&gt;
        else if ( hasClass( NavigationBoxes[i], &amp;quot;innercollapse&amp;quot; ) ) {&lt;br /&gt;
            var element = NavigationBoxes[i];&lt;br /&gt;
            while (element = element.parentNode) {&lt;br /&gt;
                if ( hasClass( element, &amp;quot;outercollapse&amp;quot; ) ) {&lt;br /&gt;
                    collapseTable ( i );&lt;br /&gt;
                    break;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Duplode</name></author>
	</entry>
</feed>