
| Current Path : /var/www/html/rocksensor1/web/modules/contrib/simple_sitemap/xsl/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor1/web/modules/contrib/simple_sitemap/xsl/simple_sitemap.xsl.js |
/**
* @file
* Alters jquery.tablesorter behavior.
*/
(($) => {
$.tablesorter.addParser({
// Set a unique id.
id: 'changefreq',
is() {
return false;
},
format(s) {
switch (s) {
case 'always':
return 0;
case 'hourly':
return 1;
case 'daily':
return 2;
case 'weekly':
return 3;
case 'monthly':
return 4;
case 'yearly':
return 5;
default:
return 6;
}
},
type: 'numeric',
});
document.addEventListener('DOMContentLoaded', () => {
// Set some location variables.
const h1 = document.querySelector('h1');
h1.textContent = `${h1.textContent}: ${window.location}`;
document.title = h1.textContent;
const $table = $('table');
const options = { widgets: ['zebra'] };
if ($table.hasClass('index')) {
// Options for sitemap index table.
options.sortList = [[0, 0]];
} else {
// Options for sitemap table.
options.sortList = [[3, 1]];
options.headers = {
2: { sorter: 'changefreq' },
4: { sorter: false },
5: { sorter: false },
};
}
$table.tablesorter(options);
});
})(jQuery);