Bureaucrats, editor, Interface administrators, Administrators (Semantic MediaWiki), Curators (Semantic MediaWiki), Editors (Semantic MediaWiki), Administrators
47,327
edits
No edit summary |
No edit summary |
||
Line 7:
(function ($, mw, rs) {
var $sortables = $('.sortable[class*="autosort="]');
if (!$sortables.length) return;
rs.autosort = function () {
Line 15 ⟶ 14:
matched = (' ' + $(this).attr('class') + ' ').match(/autosort=(\d+)[,-]{1}(a|d)/),
$sortCol = $this.find('> thead th:nth-child(' + matched[1] + ')');
if (matched[2] === 'd') {
// descending
Line 29 ⟶ 27:
mw.hook('wikipage.content').add(function init() {
if ($('.jquery-tablesorter').length) {
setTimeout(rs.autosort
} else {
// tablesorter plugin has not run yet; observe the first
|