From d3c02e164f0459b2b48304a8a67b31a1fba6fcec Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 22 Feb 2023 12:16:01 +0100 Subject: [PATCH] Fixed various shenanigans with tips filtering depenting on selected XPath --- Frontend/tools/xpath.html | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 457ff1e..cf21fe5 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -1245,7 +1245,9 @@
- + + +
@@ -1699,7 +1701,9 @@
- + + +
@@ -2603,7 +2607,9 @@
+ +
@@ -2670,7 +2676,9 @@
- + + +
@@ -2991,7 +2999,8 @@
-
+ +
@@ -3101,18 +3110,28 @@ if (filter == "collapse3.0") { - showList(document.getElementsByName("collapse30")); document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0, 2.0 & 3.0 functions"; - // hideList(document.getElementsByName("collapse31")); + showList(document.getElementsByName("collapse20")); + showList(document.getElementsByName("collapse30")); + hideList(document.getElementsByName("collapse31")); console.log("collapsed 3.0"); } else if (filter == "collapse3.1") { - showList(document.getElementsByName("collapse31")); document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0, 2.0, 3.0 & 3.1 functions"; + showList(document.getElementsByName("collapse20")); + showList(document.getElementsByName("collapse30")); + showList(document.getElementsByName("collapse31")); console.log("collapsed 3.1"); - } else { + } else if (filter == "collapse2.0"){ document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 & 2.0 functions"; + showList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); + } else { + document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 functions"; + hideList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); + hideList(document.getElementsByName("collapse31")); + } @@ -3194,14 +3213,14 @@ setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); setDefaultContent(document.getElementById("transformArea"), 'Insert XPath expression here'); console.log("init"); - processTooltip(); processVersionSelector(); + processTooltip(); tool.addEventListener('change', event => { //Check if script was called from textarea or selector var targetID = event.target.getAttribute('id'); if (targetID == "processors") { - processTooltip(); processVersionSelector(); + processTooltip(); } else if (targetID == "versions") { processTooltip();