MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
Replaced content with "→Any JavaScript here will be loaded for all users on every page load.: " Tags: Replaced Manual revert |
No edit summary |
||
| 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. */// Load DataTables library | ||
mw.loader.using( 'jquery' ).done( function () { | |||
$.getScript("https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js", function () { | |||
// Activate DataTables on any table with class="datatable" | |||
$(document).ready(function () { | |||
$("table.datatable").DataTable({ | |||
paging: true, // Adds pagination | |||
searching: true, // Adds search box | |||
ordering: true, // Enables column sorting | |||
info: true // Shows "Showing 1 to 10 of X entries" | |||
}); | |||
}); | |||
}); | |||
}); | |||