Difference between revisions of "MediaWiki:Common.js"

From Legallypedia
Jump to navigation Jump to search
m
m (sorting)
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
  
//
+
jQuery( document ).ready( function( $ ) {
 +
    mw.loader.using( 'jquery.tablesorter', function() {
 +
  //$('table.sortable').tablesorter( {sortList: [ { 2: 'desc'} ]} )
 +
        // or look for tables with an ID attribute of "sortMe" on any page
 +
        $( '.wikitable.sortable .sortme' ).click();
 +
        $( '.wikitable.sortable .sortme.desc' ).click();
 +
    } );
 +
} );

Revision as of 01:15, 17 December 2016

/* Any JavaScript here will be loaded for all users on every page load. */

jQuery( document ).ready( function( $ ) {
    mw.loader.using( 'jquery.tablesorter', function() {
   //$('table.sortable').tablesorter( {sortList: [ { 2: 'desc'} ]} )
        // or look for tables with an ID attribute of "sortMe" on any page
        $( '.wikitable.sortable .sortme' ).click();
        $( '.wikitable.sortable .sortme.desc' ).click();
    } );
} );