Actions

MediaWiki

Difference between revisions of "Common.js"

From Titan's Teeth

(Created page with "function isSortedTablePage() { return ( wgPageName == "Feats" || wgPageName == "Other_Page_To_Sort" ); } jQuery( document ).ready( function( $ ) { // wrapped in "mw....")
 
Line 1: Line 1:
 
function isSortedTablePage() {
 
function isSortedTablePage() {
     return ( wgPageName == "Feats"  || wgPageName == "Other_Page_To_Sort" );
+
     return ( wgPageName == "Feats"  || wgPageName == "Equipment/Weapons" );
 
}
 
}
  

Revision as of 19:52, 2 September 2019

function isSortedTablePage() {
    return ( wgPageName == "Feats"  || wgPageName == "Equipment/Weapons" );
}

jQuery( document ).ready( function( $ ) {
    // wrapped in "mw.loader.using" so this doesn't execute until Tablesorter has loaded
    mw.loader.using( 'jquery.tablesorter', function() {
        if( isSortedTablePage() ) $('table.sortable').tablesorter( {sortList: [ { 0: 'asc'} ]} )
        // or look for tables with an ID attribute of "sortMe" on any page
        // $( '#sortMe' ).tablesorter( {sortList: [ { 0: 'asc'} ]} )
    } );
} );