<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.geministation.com/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-autosort.js</id>
	<title>MediaWiki:Gadget-autosort.js - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.geministation.com/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-autosort.js"/>
	<link rel="alternate" type="text/html" href="https://wiki.geministation.com/index.php?title=MediaWiki:Gadget-autosort.js&amp;action=history"/>
	<updated>2026-06-04T06:17:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.geministation.com/index.php?title=MediaWiki:Gadget-autosort.js&amp;diff=6774&amp;oldid=prev</id>
		<title>Banri: Created page with &quot;/**  * For autosorting sortable tables  * @example &lt;&gt;  */ (function($,mw,gs){ 	if (!$(&#039;.sortable&#039;).length) return; 	gs.autosort = function () {         mw.loader.using(&#039;jquery...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.geministation.com/index.php?title=MediaWiki:Gadget-autosort.js&amp;diff=6774&amp;oldid=prev"/>
		<updated>2020-08-14T13:27:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;span class=&quot;autocomment&quot;&gt;*  * For autosorting sortable tables  * @example &amp;lt;&amp;gt;: &lt;/span&gt; (function($,mw,gs){ 	if (!$(&amp;#039;.sortable&amp;#039;).length) return; 	gs.autosort = function () {         mw.loader.using(&amp;#039;jquery...&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;
 * For autosorting sortable tables&lt;br /&gt;
 * @example &amp;lt;&amp;gt;&lt;br /&gt;
 */&lt;br /&gt;
(function($,mw,gs){&lt;br /&gt;
	if (!$(&amp;#039;.sortable&amp;#039;).length) return;&lt;br /&gt;
	gs.autosort = function () {&lt;br /&gt;
        mw.loader.using(&amp;#039;jquery.tablesorter&amp;#039;, function () {&lt;br /&gt;
        	$(&amp;#039;.sortable[class*=&amp;quot;autosort=&amp;quot;]&amp;#039;).each(function () {&lt;br /&gt;
                var $this = $(this),&lt;br /&gt;
                    matched = (&amp;#039; &amp;#039; + $(this).attr( &amp;#039;class&amp;#039;) + &amp;#039; &amp;#039;)&lt;br /&gt;
                        .match(/autosort=(\d+)[,-]{1}(a|d)/),&lt;br /&gt;
                    $sortCol = $this&lt;br /&gt;
                        .find(&amp;#039;&amp;gt; thead th:nth-child(&amp;#039; + matched[1] + &amp;#039;)&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
                if (matched[2] === &amp;#039;d&amp;#039;) {&lt;br /&gt;
                    // descending&lt;br /&gt;
                    $sortCol.click().click();&lt;br /&gt;
                } else {&lt;br /&gt;
                    // ascending&lt;br /&gt;
                    $sortCol.click();&lt;br /&gt;
                }&lt;br /&gt;
            });&lt;br /&gt;
        });&lt;br /&gt;
    };&lt;br /&gt;
    $(gs.autosort);&lt;br /&gt;
}(jQuery, mediaWiki, gswiki));&lt;/div&gt;</summary>
		<author><name>Banri</name></author>
	</entry>
</feed>