From 6af516dc94d6b09d079a4c7f54f103191d1eac96 Mon Sep 17 00:00:00 2001 From: WoodenMaiden Date: Fri, 31 May 2024 17:22:24 +0200 Subject: [PATCH] feat: implement history of queries Signed-off-by: WoodenMaiden --- .../src/main/webapp/localStoreConsent.html | 71 +- .../src/main/webapp/scripts/localStorage.js | 54 -- .../src/main/webapp/sparqleditor.jsp | 906 ++++++++++-------- 3 files changed, 550 insertions(+), 481 deletions(-) diff --git a/agrold-javaweb/src/main/webapp/localStoreConsent.html b/agrold-javaweb/src/main/webapp/localStoreConsent.html index 30d798cc..c92760e4 100644 --- a/agrold-javaweb/src/main/webapp/localStoreConsent.html +++ b/agrold-javaweb/src/main/webapp/localStoreConsent.html @@ -7,9 +7,9 @@ we treat your data with the utmost care and are transparent about how we handle it. You can add accept the treatment of your data by clicking on the Accept button, reject it or learn more about it.

- - - + + + - + diff --git a/agrold-javaweb/src/main/webapp/scripts/localStorage.js b/agrold-javaweb/src/main/webapp/scripts/localStorage.js index 54274002..9c593c16 100644 --- a/agrold-javaweb/src/main/webapp/scripts/localStorage.js +++ b/agrold-javaweb/src/main/webapp/scripts/localStorage.js @@ -58,57 +58,3 @@ const acceptAllData = () => { acceptData(defaultLocalStorageData) } -const acceptFromSelection = (e) => { - e.preventDefault() - - acceptData( - Object.entries( - Object.fromEntries(new FormData(e.target)) // retireve the form data - ).filter(([_, value]) => value === "on").map(([key, _]) => key) // only keep ticked checkboxes - ) - - // ugly but hey that works! - // we cannot acutally close the modal from the form in bootstrap - document.getElementById("close-storage-modal")?.click() - return false -} - -/// popup setup -const popup = document.getElementById("localStorage-ask") -document.getElementById("labelstore-form")?.addEventListener("submit", acceptFromSelection) - -// v question unanswered -if(isLocalStorageAvailable() && sessionStorage.getItem("acceptLocalStorage") === null){ - if (popup) popup.style.visibility = "visible"; - - const consentList = document.getElementById('consent-inputs') - - Object.entries(LocalStorageDataConsent).forEach(([key, value]) => { - consentList.appendChild( - document.createElement("hr") - ) - const input = document.createElement("input"); - Object.entries({ - class: "form-check-input", - type: "checkbox", - role: "switch", - style: "margin: 5px;", - id: key, - name: key, - checked: "true", - }).forEach(([key, value]) => input.setAttribute(key, value)) - - consentList.appendChild(input) - - const label = document.createElement("label") - Object.entries({ - class: "form-check-label", - for: key, - }).forEach(([key, value]) => input.setAttribute(key, value)) - - label.textContent = value - consentList.appendChild(label) - }) -} else { - if (popup) popup.style.display = "none"; -} \ No newline at end of file diff --git a/agrold-javaweb/src/main/webapp/sparqleditor.jsp b/agrold-javaweb/src/main/webapp/sparqleditor.jsp index 7fcb9877..84744e63 100755 --- a/agrold-javaweb/src/main/webapp/sparqleditor.jsp +++ b/agrold-javaweb/src/main/webapp/sparqleditor.jsp @@ -1,15 +1,12 @@ -<%-- - Document : sparqleditor - Created on : Jul 15, 2015, 3:18:01 PM - Author : tagny ---%> - -<%@page contentType="text/html" pageEncoding="UTF-8"%> - - - - - + - - - + + gtag('config', 'UA-70148286-1'); + - - - - - AgroLD: SPARQL Query Editor - + + + + + AgroLD: SPARQL Query Editor + - - - + + + + - +
Search > SPARQL Query Editor
- +
+ + Select a sample query and run it. The sample query could be used to modify the parameters + accordingly. + Alternatively, enter SPARQL code in the query box below. + + +
+
-
- Select a sample query and run it. The sample query could be used to modify the parameters accordingly. Alternatively, enter SPARQL code in the query box below. -
-
-
- KEYBOARD COMMANDS - -
-
-
-
-
- -
- - - -
- - milliseconds - (values less than 1000 are ignored) - - - - -
-
-
- - - - -
Filename to Save As: - - - - - - -
+ +
+ + + + + +
+ + milliseconds + (values less than 1000 are ignored) + + + + +
+ +
+ + + + + + + +
Filename to Save As: + + + + + + +
+ +
+
+
+
+ Query Patterns
-
- Query Patterns -
-
-
-
-
Results
- +
+
+
Results
+ +
+
-
-
-
-
- -
-
- - - - - - - - - + + + + + + + +
+ + -
- - - - -