' +
+ '| ' + parseTimeStamp(historyJson[i].dateTimeStamp) + ' | ' +
+ '' + historyJson[i].httpMethod + ' | ' +
+ '' + parseRequestBody(historyJson[i].requestBody, i) + ' | ' +
+ ' | ' +
+ '';
+ }
+ return innerHTML;
+}
+
+function parseRequestBody(requestBody,i){
+ return requestBody.length == 0 ?
+ "No request body" :
+ ''
+}
+
+function parseTimeStamp(timeStamp){
+ return timeStamp.substring(0,19).replace('T',' ');
+}
+
+function parseHeaders(pos){
+ parsedJson = new Map();
+ headers = historyJson[pos].headers
+ Object.keys( headers ).forEach(
+ (jsonKey) => {
+ parsedJson.set( jsonKey , headers[jsonKey] );
+ }
+ )
+ return parsedJson;
+}
+
+function displayHistory(){
+ $('#historyTable tbody').html(historyToHtml());
+}
diff --git a/Backend/mocked-services/src/main/resources/static/js/modal.js b/Frontend/assets/scripts/tools/mock/modal.js
similarity index 58%
rename from Backend/mocked-services/src/main/resources/static/js/modal.js
rename to Frontend/assets/scripts/tools/mock/modal.js
index 3061752..c20804b 100644
--- a/Backend/mocked-services/src/main/resources/static/js/modal.js
+++ b/Frontend/assets/scripts/tools/mock/modal.js
@@ -7,7 +7,6 @@ var methodToCall = {
const overlay = $('#overlay');
const savedModal = $('#modal-confirm');
const dataLossModal = $('#modal-query');
-const uuidChangeModal = $('#modal-uuidChanged')
const dataLossModalYes = dataLossModal.children().eq(2).children().eq(0);
const dataLossModalNo = dataLossModal.children().eq(2).children().eq(1);
const allModals = $('.modal');
@@ -24,36 +23,10 @@ const dataLossModalDisplay = function(){
showModal(dataLossModal);
}
-const uuidChangeModalDisplay = function(addidionalMessage){
-
- switch(addidionalMessage){
- case "success":{
-
- $(".uuid-modal-body").removeClass("active");
- $("#changeUUIDSuccess").addClass("active");
- break;
- }
- case "new":{
-
- $(".uuid-modal-body").removeClass("active");
- $("#newUUID").addClass("active");
- break;
- }
- case "restore":{
-
- $(".uuid-modal-body").removeClass("active");
- $("#restoredUUID").addClass("active");
- break;
- }
- case "noChg":{
-
- $(".uuid-modal-body").removeClass("active");
- $("#noChgUUID").addClass("active");
- break;
- }
- }
- showModal(uuidChangeModal);
-}
+btnModalClose.click(closeModals);
+overlay.click(closeModals);
+dataLossModalNo.click(closeModals);
+dataLossModalYes.click(dropChangesAndClose);
function setMethodToCall(name, id){
methodToCall.name = name;
@@ -74,16 +47,7 @@ function showModal(jmodal){
function hideModal(jmodal){
if(!modalDisplayed) return;
- if ($(uuidChangeModal).hasClass('active')) window.location.reload();
overlay.removeClass('active');
jmodal.removeClass('active');
modalDisplayed = false;
}
-
-btnModalClose.click(closeModals);
-
-overlay.click(closeModals);
-
-dataLossModalNo.click(closeModals);
-dataLossModalYes.click(dropChangesAndClose);
-
diff --git a/Frontend/assets/scripts/tools/mock/popup.js b/Frontend/assets/scripts/tools/mock/popup.js
new file mode 100644
index 0000000..0d2b91f
--- /dev/null
+++ b/Frontend/assets/scripts/tools/mock/popup.js
@@ -0,0 +1,34 @@
+
+function switchPopups (neededPopupOption) {
+ $('.hiddable-popup-option').addClass('hidden-popup-type');
+ $('#'+neededPopupOption).removeClass('hidden-popup-type');
+ }
+
+function showPopup(){
+ $('.popup-flex').removeClass('hiddable-container');
+}
+
+function hidePopup(){
+ $('.popup-flex').addClass('hiddable-container');
+ $('.hiddable-popup-option').addClass('hidden-popup-type');
+}
+
+/*
+* Event listener that's close the popup when user clicks out of a popup.
+*/
+
+window.addEventListener(
+ 'click' ,
+ (clickedElement) => {
+ if(!document.getElementById('popup-body').contains(clickedElement.target) && clickedElement.target.className == 'popup-flex' ) {
+ hidePopup();
+ }
+ }
+);
+
+$('.popup-button-close').click(
+ () => {
+ hidePopup();
+ $('.hiddable-popup-option').addClass('hidden-popup-type')
+ }
+);
\ No newline at end of file
diff --git a/Frontend/assets/scripts/tools/mock/uianimation.js b/Frontend/assets/scripts/tools/mock/uianimation.js
new file mode 100644
index 0000000..1871bdf
--- /dev/null
+++ b/Frontend/assets/scripts/tools/mock/uianimation.js
@@ -0,0 +1,165 @@
+var advancedVisibility = false;
+var focusedField = false;
+/*
+Listeners
+*/
+$("#optional").click(changeAdvancedVisibility);
+
+$('#historyTab').click(showHistory);
+
+$('.tooltipped').on("mouseenter" , (event) => {showTip(event.currentTarget.id+'Tip')})
+ .on( "mouseleave", (event) => {hideTip(event.currentTarget.id+'Tip')});
+
+/*
+Functions
+*/
+
+function changeAdvancedVisibility(){
+ if(advancedVisibility){
+ $("#advanced").removeClass('active');
+ advancedVisibility = false;
+ }
+ else {
+ $('#advanced').addClass('active');
+ advancedVisibility = true;
+ }
+ setCookie();
+}
+
+const tabitem = $('.tabitem');
+function showHistory(){
+ $('#headersTab').click(showHeaders);
+ tabitem.removeClass('active');
+ $('.tabcontent').removeClass('active');
+ $('#history').addClass('active');
+ $('#historyTab').addClass('active');
+ $('#historyTab').off('click');
+ getHistoryData();
+}
+
+function showHeaders(){
+ $('#historyTab').click(showHistory);
+ tabitem.removeClass('active');
+ $('.tabcontent').removeClass('active');
+ $('#headers').addClass('active');
+ $('#headersTab').addClass('active');
+ $('#headersTab').off('click');
+}
+
+function showHeadersHistory(record){
+ historyTable = '';
+ headers = parseHeaders(record.id)
+ headers.forEach(
+ (value,key) => {
+ historyTable +=
+ '' +
+ '' +
+ '' +
+ '
'
+ }
+ );
+ document.getElementById('header-history-table-body').innerHTML = historyTable;
+ switchPopups('history-headers-table');
+ showPopup();
+}
+
+async function formatJSON(json) {
+ const backend = "java";
+ const address = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/json/formatting";
+
+ var init = {
+ body: json,
+ method: "POST"
+ };
+ var request = new Request(address, init);
+
+ var result = await fetch(request).then(response => {
+ return response.text().then(function (text) {
+ var json = JSON.parse(text);
+ json.status = response.status;
+ return json;
+ });
+
+ });
+ return result;
+}
+
+async function formatXML(xml) {
+ const backend = "libxml";
+ const address = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/prettify";
+ var data = {
+ data: xml,
+ process: "",
+ processor: "libxml",
+ version: "1.0"
+ }
+
+ var init = {
+ body: JSON.stringify(data),
+ method: "POST"
+ };
+ var request = new Request(address, init);
+
+ var result = await fetch(request).then(response => {
+ return response.text().then(function (text) {
+ return JSON.parse(text);
+ });
+
+ });
+ return result;
+}
+
+function showRequestBody(element){
+ var historyRequestBody = historyJson[element.id].requestBody;
+ const popupContent = document.getElementById('code-highlight-content')
+
+ document.getElementById('code-highlight-content').innerText = "Loading...";
+ switch(historyJson[element.id].headers["content-type"]){
+ case "application/json":{
+ formatJSON(historyRequestBody).then(function(result) {
+
+ if (result.status == "200") {
+ popupContent.innerText = result.data;
+ highlightSyntax('code-highlight-content');
+ }
+ else {
+ popupContent.innerText = historyRequestBody;
+ }
+ });
+ break;
+ }
+ case "application/xml": {
+ formatXML(historyRequestBody).then(function(result) {
+ if (result.status == "OK") {
+ popupContent.innerText = result.result;
+ highlightSyntax('code-highlight-content');
+ }
+ else {
+ popupContent.innerText = historyRequestBody;
+ }
+
+ });
+
+ break;
+ }
+ default:{
+ popupContent.innerText = historyRequestBody;
+ highlightSyntax('code-highlight-content');
+ }
+ }
+ switchPopups('history-request-body');
+ showPopup();
+}
+
+function refreshHistoryRecords(){
+ getHistoryData();
+}
+
+function hideTip(element){
+ $('#'+element).removeClass('active');
+}
+
+function showTip(element){
+ $('.tip').removeClass('active');
+ $('#'+element).addClass('active');
+}
diff --git a/Frontend/assets/scripts/tools/scripts.js b/Frontend/assets/scripts/tools/scripts.js
index 9c89779..729ee8e 100644
--- a/Frontend/assets/scripts/tools/scripts.js
+++ b/Frontend/assets/scripts/tools/scripts.js
@@ -65,28 +65,6 @@ function clearDataField() {
}
-/**
- * The `escapeHTML` function is used to escape special characters in an HTML element's innerHTML property.
- * This is done to prevent these characters from being interpreted as HTML tags or attributes,
- * which could potentially cause security vulnerabilities or unintended behavior.
- *
- * @function
- * @name escapeHTML
- * @kind function
- * @param {any} element
- * @returns {void}
- */
-function escapeHTML(elementID) {
- document.getElementById(elementID).innerHTML = document.getElementById(elementID).innerHTML
- .replace(/&/g, "&")
- .replace(//g, ">")
- .replace(/"/g, """)
- .replace(/'/g, "'");
-}
-
-
-
/**
* It fills the XML area with a sample XML.
*
@@ -98,7 +76,7 @@ function escapeHTML(elementID) {
*/
function fillDefaultXML(element) {
if (element.classList.contains("active")) {
- const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
+ const serverAddress = window.location.protocol + "//" + window.location.hostname;
clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here");
fetch(serverAddress + "/assets/samples/sampleXml.xml")
.then(response => response.text())
@@ -111,8 +89,18 @@ function fillDefaultXML(element) {
}
}
+
+/**
+* It fills the XSD area with a sample XSD and XML area with matching XML.
+*
+* @function
+* @name fillDefaultXSD
+* @kind function
+* @param {any} element
+* @returns {void}
+*/
function fillDefaultXSD(){
- const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
+ const serverAddress = window.location.protocol + "//" + window.location.hostname;
fetch(serverAddress + "/assets/samples/sampleXSD.xsd")
.then( response => response.text() )
.then( (XSDSchema) => {
@@ -138,7 +126,7 @@ function fillDefaultXSD(){
* @returns {void}
*/
function fillDefaultXSLT() {
- const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
+ const serverAddress = window.location.protocol + "//" + window.location.hostname;
fetch(serverAddress + "/assets/samples/XSLTTemplate.xslt")
.then( response => response.text() )
.then( (XSTLTemplate) => {
@@ -289,9 +277,9 @@ function performRequest(endpoint, checkXML, checkTransform) {
var xmlData = document.getElementById(sourceId).innerText.trim();
var transformData = document.getElementById(transformId).innerText.trim();
- var port = 8081;
+ var backend = "java";
if (getProcessor() == "libxml") {
- port = 8082;
+ backend = "libxml";
}
var empty = false;
@@ -305,7 +293,7 @@ function performRequest(endpoint, checkXML, checkTransform) {
empty = true;
}
if (!empty) {
- restRequest(port, endpoint, xmlData, transformData).then(function (result) {
+ restRequest(backend, endpoint, xmlData, transformData).then(function (result) {
document.getElementById("resultArea").innerText = result.result;
highlightSyntax("resultArea");
document.getElementById("procinfo").innerText = ' Computed using ' + result.processor;
@@ -345,7 +333,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) {
const sourceElement = document.getElementById(sourceId);
const targetElement = document.getElementById(targetId);
const infoElement = document.getElementById("formatinfo");
- const port = 8082;
+ const backend = "libxml";
var xmlData = sourceElement.innerText.trim();
var empty = false;
@@ -356,7 +344,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) {
}
if (!empty) {
- restRequest(port, endpoint, xmlData, "").then(function (result) {
+ restRequest(backend, endpoint, xmlData, "").then(function (result) {
if (result.status == "OK") {
targetElement.innerText = result.result.trim();
highlightSyntax(targetElement.id);
@@ -386,16 +374,15 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) {
* @function
* @name restRequest
* @kind function
-* @param {any} port of target service
+* @param {any} backend target backend
* @param {any} endpoint of target service
* @param {any} xmlData XML that will be sent
* @param {any} transformData data used to transform given XML
* @returns {Promise}
*/
-async function restRequest(port, endpoint, xmlData, transformData) {
- const escapeChar = "specialEscapeChar";
+async function restRequest(backend, endpoint, xmlData, transformData) {
- const addr = window.location.protocol + "//" + window.location.hostname + ":" + port + "/" + endpoint;
+ const addr = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/" + endpoint;
if (defaultStrings.includes(xmlData)) {
xmlData = "";
diff --git a/Frontend/assets/scripts/tools/xmlFormatter.js b/Frontend/assets/scripts/tools/xmlFormatter.js
new file mode 100644
index 0000000..fef7d28
--- /dev/null
+++ b/Frontend/assets/scripts/tools/xmlFormatter.js
@@ -0,0 +1,34 @@
+/**
+ * This function is executed after the page is loaded.
+ *
+ * @function
+ * @name init
+ * @kind function
+ */
+function init() {
+ configurePastingInElement("xmlArea");
+}
+
+/**
+ * Function returns processor that will be used to transform XML.
+ * This solution allows to use one function for sending request from every tool
+ *
+ * @function
+ * @name getProcessor
+ * @kind function
+ */
+function getProcessor() {
+ return "libxml";
+}
+
+/**
+ * Function returns version of XML processor that will be used to transform XML.
+ * This solution allows to use one function for sending request from every tool
+ *
+ * @function
+ * @name getVersion
+ * @kind function
+ */
+function getVersion() {
+ return "1.0"
+}
\ No newline at end of file
diff --git a/Frontend/assets/scripts/tools/xpath.js b/Frontend/assets/scripts/tools/xpath.js
new file mode 100644
index 0000000..ab5bff6
--- /dev/null
+++ b/Frontend/assets/scripts/tools/xpath.js
@@ -0,0 +1,174 @@
+
+/**
+ * The `processVersionSelector()` function is responsible for updating the display of the web page
+ * based on the selected processor and version.
+ *
+ * @function
+ * @name processVersionSelector
+ * @kind function
+ * @returns {void}
+ */
+function processVersionSelector() {
+ var processor = getProcessor();
+ var hideableOptions = document.getElementsByClassName("hideable");
+ for (let i = 0; i < hideableOptions.length; i++) {
+ hideableOptions[i].style = "display: none;";
+ }
+ if (processor == "xalan" || processor == "libxml") {
+ var xalanOptions = document.getElementsByClassName("xalan");
+ for (let i = 0; i < xalanOptions.length; i++) {
+ xalanOptions[i].style = "";
+ }
+ document.getElementById("versions").selectedIndex = 0;
+ }
+ else {
+ var saxonOptions = document.getElementsByClassName("saxon");
+ for (let i = 0; i < saxonOptions.length; i++) {
+ saxonOptions[i].style = "";
+ }
+ document.getElementById("versions").selectedIndex = 3;
+
+ }
+ processTooltip();
+
+}
+
+/**
+ * The `processTooltip()` function is responsible for updating the display of the tooltip based on the selected version of the processor.
+ * It shows or hides different sections of the tooltip based on the selected version.
+ * It also handles the click event on the form and updates the tooltip accordingly.
+ *
+ * @function
+ * @name processTooltip
+ * @kind function
+ */
+function processTooltip() {
+ var filter = "collapse" + getVersion();
+ var collList;
+
+
+ if (filter == "collapse3.0") {
+ document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.0 functions";
+ hideList(document.getElementsByName("collapse10"));
+ hideList(document.getElementsByName("collapse20"));
+ showList(document.getElementsByName("collapse30"));
+ hideList(document.getElementsByName("collapse31"));
+
+ } else if (filter == "collapse3.1") {
+ document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.1 functions";
+ hideList(document.getElementsByName("collapse10"));
+ hideList(document.getElementsByName("collapse20"));
+ hideList(document.getElementsByName("collapse30"));
+ showList(document.getElementsByName("collapse31"));
+ } else if (filter == "collapse2.0") {
+ document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions";
+ hideList(document.getElementsByName("collapse10"));
+ showList(document.getElementsByName("collapse20"));
+ hideList(document.getElementsByName("collapse30"));
+ hideList(document.getElementsByName("collapse31"));
+ } else {
+ document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 functions";
+ showList(document.getElementsByName("collapse10"));
+ hideList(document.getElementsByName("collapse20"));
+ hideList(document.getElementsByName("collapse30"));
+ hideList(document.getElementsByName("collapse31"));
+
+ }
+}
+
+
+
+/**
+ * This function is executed after the page is loaded.
+ *
+ * @function
+ * @name init
+ * @kind function
+ */
+function init() {
+
+ // Make sure that only plain text is pasted
+ configurePastingInElement("xmlArea");
+ configurePastingInElement("transformArea");
+
+ //Handle clicks in whole form and set info in tooltip
+ setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here');
+ setDefaultContent(document.getElementById("transformArea"), 'Insert XPath expression here');
+
+ processVersionSelector();
+ processTooltip();
+ tool.addEventListener('change', event => {
+ //Check if script was called from textarea or selector
+ var targetID = event.target.getAttribute('id');
+ if (targetID == "processors") {
+ processVersionSelector();
+ processTooltip();
+ }
+ else if (targetID == "versions") {
+ processTooltip();
+ }
+
+
+ })
+ tool.addEventListener('click', event => {
+ //Check if script was called from textarea or selector
+ var targetID = event.target.getAttribute('id');
+ if (targetID !== "xmlArea" && targetID !== "transformArea") {
+ return;
+ }
+ processTooltip();
+
+ })
+ tool.addEventListener('change', event => {
+ //Check if script was called from textarea or selector
+ var targetID = event.target.getAttribute('id');
+ if (targetID !== "xmlArea" && targetID !== "transformArea") {
+ return;
+ }
+ processTooltip();
+ })
+
+ var triggerList = document.getElementsByClassName("collapseTrigger");
+ for (i = 0; i < triggerList.length; i++) {
+
+ triggerList[i].addEventListener("click", function () {
+ var collapsible = this.parentElement;
+ if (this.tagName == "A") {
+ var collapsibleData = this.nextElementSibling;
+ } else {
+ var collapsibleData = this.parentElement.nextElementSibling;
+
+ }
+
+
+ if (collapsibleData.style.maxHeight > "0px") {
+ collapsibleData.style.maxHeight = "0px";
+
+ this.classList.toggle("active", false);
+ if (!this.classList.contains("collapsibleMini")) {
+ collapsible.classList.toggle("active", false);
+ }
+
+ var subLists1 = collapsibleData.getElementsByClassName("content");
+ var subLists2 = collapsibleData.getElementsByClassName("active");
+ for (j = 0; j < subLists1.length; j++) {
+ subLists1[j].style.maxHeight = "0px";
+ }
+ for (j = 0; j < subLists2.length; j++) {
+ subLists2[j].classList.toggle("active", false);
+ }
+ } else {
+ collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px";
+
+ this.classList.toggle("active", true);
+ if (!this.classList.contains("collapsibleMini")) {
+ collapsible.classList.toggle("active", true);
+ } else {
+ var parentContent = this.closest(".content");
+ parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px";
+ }
+ }
+ });
+ }
+}
+
diff --git a/Frontend/assets/scripts/tools/xsd.js b/Frontend/assets/scripts/tools/xsd.js
new file mode 100644
index 0000000..62e5612
--- /dev/null
+++ b/Frontend/assets/scripts/tools/xsd.js
@@ -0,0 +1,51 @@
+/**
+ * This function is executed after the page is loaded.
+ *
+ * @function
+ * @name init
+ * @kind function
+ */
+function init() {
+ // Make sure that only plain text is pasted
+ configurePastingInElement("xmlArea");
+ configurePastingInElement("transformArea");
+
+ //Handle clicks in whole form and set info in tooltip
+ setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here');
+ setDefaultContent(document.getElementById("transformArea"), 'Insert XSD here');
+
+ // refreshTooltip();
+ processTooltip();
+ tool.addEventListener('click', event => {
+ //Check if script was called from textarea or selector
+ var targetID = event.target.getAttribute('id');
+ if (targetID !== "processors" && targetID !== "xmlArea" && targetID !== "transformArea" && targetID !== "versions") {
+ return;
+ }
+
+ processTooltip();
+
+ })
+}
+
+/**
+ * The `processTooltip()` function is responsible for updating the display of the tooltip based on the selected version of the processor.
+ * It shows or hides different sections of the tooltip based on the selected version.
+ * It also handles the click event on the form and updates the tooltip accordingly.
+ *
+ * @function
+ * @name processTooltip
+ * @kind function
+ */
+function processTooltip() {
+
+ if (getProcessor() == "xalan") {
+ document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions";
+ document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0";
+ hideList(document.getElementsByName("collapse30"));
+ } else {
+ document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions";
+ document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0";
+ showList(document.getElementsByName("collapse30"));
+ }
+}
\ No newline at end of file
diff --git a/Frontend/assets/scripts/tools/xslt.js b/Frontend/assets/scripts/tools/xslt.js
new file mode 100644
index 0000000..4e61cb1
--- /dev/null
+++ b/Frontend/assets/scripts/tools/xslt.js
@@ -0,0 +1,100 @@
+/**
+ * The `processTooltip()` function is responsible for updating the display of the tooltip based on the selected version of the processor.
+ * It shows or hides different sections of the tooltip based on the selected version.
+ * It also handles the click event on the form and updates the tooltip accordingly.
+ *
+ * @function
+ * @name processTooltip
+ * @kind function
+ */
+function processTooltip() {
+
+ if (getProcessor() == "xalan" || getProcessor() == "libxml") {
+ document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions";
+ document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0";
+ hideList(document.getElementsByName("collapse30"));
+ } else {
+ document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions";
+ document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0";
+ showList(document.getElementsByName("collapse30"));
+ }
+}
+
+
+/**
+ * This function is executed after the page is loaded.
+ *
+ * @function
+ * @name init
+ * @kind function
+ */
+function init() {
+ // Make sure that only plain text is pasted
+ configurePastingInElement("xmlArea");
+ configurePastingInElement("transformArea");
+
+ //Handle clicks in whole form and set info in tooltip
+ setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here');
+ setDefaultContent(document.getElementById("transformArea"), 'Insert XSLT here');
+
+ // refreshTooltip();
+ processTooltip();
+ tool.addEventListener('click', event => {
+ //Check if script was called from textarea or selector
+ var targetID = event.target.getAttribute('id');
+ if (targetID !== "processors" && targetID !== "xmlArea" && targetID !== "transformArea" && targetID !== "versions") {
+ return;
+ }
+
+ processTooltip();
+ })
+
+ tool.addEventListener('change', event => {
+ //Check if script was called from textarea or selector
+ var targetID = event.target.getAttribute('id');
+ if (targetID !== "processors") {
+ return;
+ }
+
+ processTooltip();
+
+ })
+
+ var triggerList = document.getElementsByClassName("collapseTrigger");
+ for (i = 0; i < triggerList.length; i++) {
+
+ triggerList[i].addEventListener("click", function () {
+
+ var collapsible = this.parentElement;
+ var collapsibleData = this.nextElementSibling;
+ if (collapsibleData.style.maxHeight > "0px") {
+ collapsibleData.style.maxHeight = "0px";
+
+ this.classList.toggle("active", false);
+ if (!this.classList.contains("collapsibleMini")) {
+ collapsible.classList.toggle("active", false);
+ }
+
+ var subLists1 = collapsibleData.getElementsByClassName("content");
+ var subLists2 = collapsibleData.getElementsByClassName("active");
+ for (j = 0; j < subLists1.length; j++) {
+ subLists1[j].style.maxHeight = "0px";
+ }
+ for (j = 0; j < subLists2.length; j++) {
+ subLists2[j].classList.toggle("active", false);
+ }
+ } else {
+ collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px";
+
+ this.classList.toggle("active", true);
+ if (!this.classList.contains("collapsibleMini")) {
+ collapsible.classList.toggle("active", true);
+ } else {
+ var parentContent = this.closest(".content");
+ parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px";
+ }
+ }
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/Frontend/index.html b/Frontend/index.html
index abb8dbe..d8aeaa6 100644
--- a/Frontend/index.html
+++ b/Frontend/index.html
@@ -4,9 +4,7 @@
-
-
Release11 Web Tools
@@ -22,9 +20,9 @@
@@ -34,14 +32,12 @@
diff --git a/Frontend/nginx.conf b/Frontend/nginx.conf
index e52fbb2..83c1bac 100644
--- a/Frontend/nginx.conf
+++ b/Frontend/nginx.conf
@@ -12,8 +12,31 @@ server {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
}
+<<<<<<< HEAD
#error_page 404 /404.html;
+=======
+ location /java/ {
+ proxy_pass http://xmltools-backend:8081/;
+ proxy_set_header Host $host;
+ }
+
+ location /libxml/ {
+ proxy_pass http://xmltools-libxml-backend/;
+ proxy_set_header Host $host;
+ }
+
+ location /mock/ {
+ proxy_pass http://xmltools-mocked-services:8097/;
+ proxy_set_header Host $host;
+ proxy_set_header Content-Type $http_content_type;
+ }
+
+ #error_page 404 /404.html;
+
+
+
+>>>>>>> master
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
diff --git a/Frontend/tools/jsonFormatter.html b/Frontend/tools/jsonFormatter.html
index 300ff95..26abb32 100644
--- a/Frontend/tools/jsonFormatter.html
+++ b/Frontend/tools/jsonFormatter.html
@@ -7,10 +7,16 @@
+<<<<<<< HEAD
+=======
+
+
+
+>>>>>>> master
@@ -32,7 +38,7 @@
+ onclick="insertDefaultJson()">Insert default JSON
@@ -61,6 +67,7 @@
+<<<<<<< HEAD
+=======
+>>>>>>> master