Difference between revisions of "Common.js"
From Titan's Teeth
Dicemonger (talk | contribs) |
Dicemonger (talk | contribs) |
(2 intermediate revisions by the same user not shown) | |
(No difference)
|
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'} ]} ) } ); } );