MediaWiki:Gadget-autosort.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Tag: Reverted
Line 10:
rs.autosort = function () {
mw.loader.using('jquery.tablesorter', function () {
$sortables.eachon("tablesorter-initialized", function () {
var $thissortables.each(function = $(this), {
var matched$this = (' ' + $(this).attr('class') + ' ').match(/autosort=(\d+)[,-]{1}(a|d)/),
$sortColmatched = (' ' + $(this).findattr('>class') thead+ th:nth-child(' ').match(/autosort=(\d+ matched)[1,-] + '{1}(a|d)'/);,
if $sortCol = $this.find('> thead th:nth-child(' + matched[21] ===+ 'd)') {;
if (matched[2] //=== descending'd') {
$sortCol.click().click();// descending
} else {$sortCol.click().click();
} else // ascending{
$sortCol.click();// ascending
} $sortCol.click();
});
});
mw.hook('gadget.autosort.sorted').fire($sortables);
});
});
};
mw.hook('wikipage.content').add(function init() {
if ($('.jquery-tablesorter').length) {
setTimeout(rs.autosort, 100();
} else {
// tablesorter plugin has not run yet; observe the first

Navigation menu