From 53c2c2e7e3077bc59fae0dacf8662fef9412780d Mon Sep 17 00:00:00 2001 From: samuel Date: Wed, 3 Dec 2025 23:05:38 +0100 Subject: [PATCH] Fix bug on attack calculator --- CHANGELOG.md | 4 ++++ manifest.json | 2 +- metadata.json | 4 ++-- src/kaplus.js | 12 +++++++++--- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87b1d86..6d313b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.11.4 (2026-12-03) + +- correction du bug sur le calculateur + ## 1.11.3 (2026-11-21) - ajout du calculateur de trajet vers un nouvel onglet diff --git a/manifest.json b/manifest.json index e9a5f88..61b56f6 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "KAplus", - "version": "1.11.3", + "version": "1.11.4", "developer": { "name": "Samuel Campos", diff --git a/metadata.json b/metadata.json index 523a12c..bb6b108 100644 --- a/metadata.json +++ b/metadata.json @@ -5,8 +5,8 @@ "firefox" ], "release_notes": { - "fr": "- ajout du calculateur de trajet vers un nouvel onglet", - "en-US": "- add travel calculator in new tab" + "fr": "- correction du bug sur le calculateur", + "en-US": "- fix bug on attack calculator" } } } \ No newline at end of file diff --git a/src/kaplus.js b/src/kaplus.js index bd4d8a8..9907aaa 100644 --- a/src/kaplus.js +++ b/src/kaplus.js @@ -463,10 +463,16 @@ function showSecondsAndCalculator() { let table = contentPane.getElementsByClassName("borderlist")[0]; let rows = table.getElementsByTagName("tr"); - let headCell = createCustomElement("th", null, "Calcul"); - rows[0].appendChild(headCell); + let titleRowIndex = 0; + if (rows[titleRowIndex].getElementsByTagName("th").length === 0) { + titleRowIndex = 1; + } + console.log(titleRowIndex) - for (let i = 1; i < rows.length; i ++) { + let headCell = createCustomElement("th", null, "Calcul", {"width": "45px"}); + rows[titleRowIndex].appendChild(headCell); + + for (let i = titleRowIndex + 1; i < rows.length; i ++) { let cells = rows[i].getElementsByTagName("td"); let arrivalDateCell = cells[3] let arrivalTimeCell = cells[4];