Difference between revisions of "Common.js"
From Titan's Teeth
Dicemonger (talk | contribs) |
Dicemonger (talk | contribs) |
||
Line 1: | Line 1: | ||
function isSortedTablePage() { | function isSortedTablePage() { | ||
− | return ( wgPageName == "Feats" || wgPageName == "Weapons" ); | + | return ( wgPageName == "Feats" || wgPageName == "Equipment/Weapons" ); |
} | } | ||
Latest revision as of 19:57, 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'} ]} ) } ); } );