fix popup infos

This commit is contained in:
Tykayn 2025-06-06 15:48:03 +02:00 committed by tykayn
parent ef42dba9dd
commit abdd59e8c8
3 changed files with 192 additions and 118 deletions

View file

@ -21,6 +21,9 @@
function sortTable(Table, col, dir) {
var sortClass, i;
if (!Table) {
return;
}
// get previous sort column
sortTable.sortCol = -1;
sortClass = Table.className.match(/js-sort-\d+/);
@ -94,7 +97,7 @@ function sortTable(Table, col, dir) {
* @param RowB A TR DOM object
* @returns {number} 1 if RowA is greater, -1 if RowB, 0 if equal
*/
sortTable.compareRow = function(RowA, RowB) {
sortTable.compareRow = function (RowA, RowB) {
var valA, valB;
if ('function' != typeof sortTable[sortTable.sortFunc]) {
sortTable.sortFunc = 'string';
@ -110,7 +113,7 @@ sortTable.compareRow = function(RowA, RowB) {
* @param html
* @returns {string}
*/
sortTable.stripTags = function(html) {
sortTable.stripTags = function (html) {
return html.replace(/<\/?[a-z][a-z0-9]*\b[^>]*>/gi, '');
};
@ -121,7 +124,7 @@ sortTable.stripTags = function(html) {
* @param Cell A TD DOM object
* @returns {Date}
*/
sortTable.date = function(Cell) {
sortTable.date = function (Cell) {
return new Date(sortTable.stripTags(Cell.innerHTML));
};
@ -132,7 +135,7 @@ sortTable.date = function(Cell) {
* @param Cell A TD DOM object
* @returns {Number}
*/
sortTable.number = function(Cell) {
sortTable.number = function (Cell) {
return Number(sortTable.stripTags(Cell.innerHTML).replace(/[^-\d.]/g, ''));
};
@ -143,7 +146,7 @@ sortTable.number = function(Cell) {
* @param Cell A TD DOM object
* @returns {String}
*/
sortTable.string = function(Cell) {
sortTable.string = function (Cell) {
return sortTable.stripTags(Cell.innerHTML).toLowerCase();
};
@ -154,7 +157,7 @@ sortTable.string = function(Cell) {
* @param Cell A TD DOM object
* @returns {String}
*/
sortTable.last = function(Cell) {
sortTable.last = function (Cell) {
return sortTable.stripTags(Cell.innerHTML).split(' ').pop().toLowerCase();
};
@ -165,7 +168,7 @@ sortTable.last = function(Cell) {
* @param Cell A TD DOM object
* @returns {String}
*/
sortTable.input = function(Cell) {
sortTable.input = function (Cell) {
for (var i = 0; i < Cell.children.length; i++) {
if ('object' == typeof Cell.children[i]
&& 'undefined' != typeof Cell.children[i].value
@ -184,8 +187,8 @@ sortTable.input = function(Cell) {
* @param col Column to sort by
* @returns {Function} Click Handler
*/
sortTable.getClickHandler = function(Table, col) {
return function() {
sortTable.getClickHandler = function (Table, col) {
return function () {
sortTable(Table, col);
};
};
@ -195,7 +198,7 @@ sortTable.getClickHandler = function(Table, col) {
* If the table(s) do not have a THead node, one will be created around the
* first row
*/
sortTable.init = function() {
sortTable.init = function () {
var THead, Tables, Handler;
if (document.querySelectorAll) {
Tables = document.querySelectorAll('table.js-sort-table');