Removed unneeded console.logs (#131)
Co-authored-by: mikolaj widla <mikolaj.widla@gmail.com> Co-authored-by: Adam Bem <adam.bem@zoho.eu> Reviewed-on: #131
This commit is contained in:
		| @@ -38,8 +38,8 @@ function getData(){ | ||||
|     $.getJSON(host + '/api/mock/'+clientUUID, function(data) { | ||||
|         json = data; | ||||
|         checkUuid(); | ||||
|         console.log(JSON.stringify(json)); | ||||
|         console.log("Json received"); | ||||
|          | ||||
|          | ||||
|         refreshData(); | ||||
|     }); | ||||
| } | ||||
| @@ -104,11 +104,11 @@ const idToDisplay = function(){ | ||||
| function refreshData(){ | ||||
|     $("#uuid-input").val(clientUUID); | ||||
|     fillMessageList(); | ||||
|     console.log("List initiated"); | ||||
|      | ||||
|     let id = idToDisplay(); | ||||
|     console.log('Loading message of id: ' + id); | ||||
|      | ||||
|     loadMessage(id); | ||||
|     console.log("Message loaded"); | ||||
|      | ||||
| } | ||||
|  | ||||
| function setCookie(){ | ||||
| @@ -262,7 +262,7 @@ async function fetchUUIDCheck(givenUUID , strategy){ | ||||
|                 .then ( response => response.text() ) | ||||
|                 .then ( data => { | ||||
|                     newUUID = data; | ||||
|                     console.log("newUUID: "+newUUID); | ||||
|                      | ||||
|                 } ) | ||||
|             break; | ||||
|         } | ||||
| @@ -271,7 +271,7 @@ async function fetchUUIDCheck(givenUUID , strategy){ | ||||
|                 .then (response => response.text() ) | ||||
|                 .then (data => { | ||||
|                     newUUID = data; | ||||
|                     console.log("restoreUUID: "+newUUID); | ||||
|                      | ||||
|                 } ) | ||||
|             break; | ||||
|         } | ||||
| @@ -281,9 +281,6 @@ async function fetchUUIDCheck(givenUUID , strategy){ | ||||
|  | ||||
| function checkUUIDChars(uuid) { | ||||
|     uuid.replace(/ /g,'') | ||||
|     if (uuid.length > 128) | ||||
|         return "invalid"; | ||||
|     console.log("UUID in check: " + uuid); | ||||
|     const regex = new RegExp("^[A-z0-9-]+$"); | ||||
|      | ||||
|     if(regex.test(uuid) && uuid != ""){ | ||||
| @@ -409,14 +406,14 @@ function fillMessageList(){ | ||||
|     $('.tile').click(function(e) { | ||||
|         var element = $(this); | ||||
|         var button = element.find('.btn-tile').children().get(0); | ||||
|         console.log(button == e.target); | ||||
|          | ||||
|         if(!(button == e.target)){ | ||||
|             console.log("Button is not a target. Loading message.") | ||||
|              | ||||
|             callLoadMessage(parseInt($(this).attr('tileid'))); | ||||
|         } | ||||
|     }); | ||||
|     $('.btn-tile').click(function(){ | ||||
|         // console.log(this); | ||||
|         //  | ||||
|         callRemoveMessage($(this).closest('.tile').attr('tileId')); | ||||
|     }) | ||||
| } | ||||
| @@ -442,35 +439,35 @@ function callLoadMessage(id){ | ||||
|  | ||||
| function loadMessage(id){ | ||||
|     if(id == null || id == undefined){ | ||||
|         console.log('id is null'); | ||||
|          | ||||
|         return; | ||||
|     } | ||||
|     lastId = id; | ||||
|     setCookie(); | ||||
|     setDataOrigin(); | ||||
|     for(let i=0; i<json.length; i++){ | ||||
|         console.log('id == ' + id + ' mockedId == ' + json[i].mockedResponseId); | ||||
|          | ||||
|         if(id == json[i].mockedResponseId){ | ||||
|             jsonIndex = i; | ||||
|             console.log("Message found"); | ||||
|              | ||||
|             initializeMock(jsonIndex); | ||||
|             console.log("Fields initialized"); | ||||
|              | ||||
|             selectMessage(id); | ||||
|             console.log("Selection complete"); | ||||
|              | ||||
|             return; | ||||
|         } | ||||
|     } | ||||
|     console.log("Message not found"); | ||||
|      | ||||
| } | ||||
|  | ||||
|  | ||||
| function selectMessage(id){ | ||||
|     const tiles = $('.tile'); | ||||
|     console.log("Selecting message..."); | ||||
|      | ||||
|     tiles.removeClass("active"); | ||||
|     console.log("Selected message deselected"); | ||||
|      | ||||
|     $('.tile[tileid="'+id+'"]').addClass("active"); | ||||
|     console.log("Selected message selected"); | ||||
|      | ||||
|     initializeHistory(); | ||||
|     refreshHeaderTable(innerHTML); | ||||
| } | ||||
| @@ -524,7 +521,7 @@ function generateJson(){ | ||||
|             httpHeaders: {}, | ||||
|         }; | ||||
|     newJson['httpHeaders'] = convertTableToJson(); | ||||
|     console.log(JSON.stringify(newJson, null, 2)); | ||||
|      | ||||
|     json[jsonIndex] = newJson; | ||||
|     return newJson; | ||||
| } | ||||
| @@ -532,7 +529,7 @@ function generateJson(){ | ||||
|  | ||||
| function convertTableToJson(){ | ||||
|     const rows = $('#headerMapTable').children(); | ||||
|     console.log("Rows: "+rows.length); | ||||
|      | ||||
|     var obj = {}; | ||||
|     var key; | ||||
|     for(let i=0; i<rows.length; i++){ | ||||
|   | ||||
| @@ -3,27 +3,8 @@ const maxIterations = 200; | ||||
|  | ||||
| function filterHistory(){ | ||||
|     var dateFrom = new Date($('#historyFrom').val() + 'T' + $('#historyTimeFrom').val()); | ||||
|     console.log(dateFrom); | ||||
|      | ||||
|     var dateTo = new Date($('#historyTo').val() + 'T' + $('#historyTimeTo').val()); | ||||
|     console.log(dateTo); | ||||
|  | ||||
|     // var dateFrom = new Date(); | ||||
|     // var dateTo = new Date(); | ||||
|     // var timeFrom = new Date(); | ||||
|     // var timeTo = new Date(); | ||||
|  | ||||
|     // dateFrom = Date.parse($('#historyFrom').val()); | ||||
|     // console.log(dateFrom); | ||||
|     // dateTo = Date.parse($('#historyTo').val()); | ||||
|     // console.log(dateTo); | ||||
|     // timeFrom = Date.parse($('#historyTimeFrom').val()); | ||||
|     // console.log(timeFrom); | ||||
|     // timeTo = Date.parse($('#historyToFrom').val()); | ||||
|     // console.log(timeTo); | ||||
|     // dateFrom.setTime(timeFrom); | ||||
|     // console.log(dateFrom); | ||||
|     // dateTo.setTime(timeTo); | ||||
|     // console.log(dateTo); | ||||
|          | ||||
|     loadHistory(dateFrom, dateTo); | ||||
| } | ||||
| @@ -34,7 +15,7 @@ const startSearch = function(){ | ||||
| $('#btn-searchHistory').click(startSearch); | ||||
|  | ||||
| function loadHistory(dateFrom, dateTo){ | ||||
|     console.log('Request send for history data') | ||||
|      | ||||
|     var eventRequest = { | ||||
|         clientUUID : json[jsonIndex].clientUUID, | ||||
|         localDateTimeFrom : dateFrom, | ||||
|   | ||||
| @@ -16,7 +16,7 @@ const closeModals = function() { | ||||
|     hideModal(allModals); | ||||
| } | ||||
| const savedModalDisplay = function() { | ||||
|     console.log('SavedModal displayed'); | ||||
|      | ||||
|     showModal(savedModal); | ||||
|     setTimeout(closeModals, 2000); | ||||
| } | ||||
| @@ -28,25 +28,25 @@ const uuidChangeModalDisplay = function(addidionalMessage){ | ||||
|  | ||||
|     switch(addidionalMessage){ | ||||
|         case "success":{ | ||||
|             console.log("success"); | ||||
|              | ||||
|             $(".uuid-modal-body").removeClass("active"); | ||||
|             $("#changeUUIDSuccess").addClass("active"); | ||||
|             break; | ||||
|         } | ||||
|         case "new":{ | ||||
|             console.log("new UUID"); | ||||
|              | ||||
|             $(".uuid-modal-body").removeClass("active"); | ||||
|             $("#newUUID").addClass("active"); | ||||
|             break; | ||||
|         } | ||||
|         case "restore":{ | ||||
|             console.log("restoredUUID"); | ||||
|              | ||||
|             $(".uuid-modal-body").removeClass("active"); | ||||
|             $("#restoredUUID").addClass("active"); | ||||
|             break; | ||||
|         } | ||||
|         case "noChg":{ | ||||
|             console.log("No changes"); | ||||
|              | ||||
|             $(".uuid-modal-body").removeClass("active"); | ||||
|             $("#noChgUUID").addClass("active"); | ||||
|             break; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| $(document).ready( function() { | ||||
|     document.getElementById("rest-mock").href = | ||||
|         window.location.protocol + "//" + window.location.hostname + ":8097"; | ||||
|     console.log("DONE") | ||||
|      | ||||
| }); | ||||
|          | ||||
| @@ -203,7 +203,6 @@ function smoothFoldElement(element, toogleState, toggleParrent) { | ||||
| */ | ||||
| function refreshTooltip() { | ||||
|     var resizeList = document.getElementsByClassName("collapsibleData"); | ||||
|     console.log("collDataList: " + resizeList.length) | ||||
|     document.getElementById("processorTooltipInfo").innerText = procInfo; | ||||
|     document.getElementById("xsltelementsheader").innerText = XSLTheader; | ||||
| } | ||||
| @@ -288,7 +287,6 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { | ||||
|      | ||||
|     if (!empty) { | ||||
|         restRequest(port, endpoint, xmlData, "").then(function (result) { | ||||
|             console.log(result); | ||||
|             if (result.status == "OK") { | ||||
|                 targetElement.value = result.result; | ||||
|                 targetElement.style.backgroundColor = null; | ||||
| @@ -329,17 +327,12 @@ async function restRequest(port, endpoint, xmlData, transformData) { | ||||
|         xmlData = "<empty/>"; | ||||
|     } | ||||
|      | ||||
|     // var data = xmlData.concat(escapeChar, transformData); | ||||
|      | ||||
|     // const url = addr.concat("?escapechar=", escapeChar, "&processor=", getProcInfo()); | ||||
|      | ||||
|     var jsonData = JSON.stringify({ | ||||
|         "data": xmlData, | ||||
|         "process": transformData, | ||||
|         "processor": getProcessor(), | ||||
|         "version": getVersion() | ||||
|     }); | ||||
|     // console.log(jsonData); | ||||
|     var init = { | ||||
|         headers: new Headers({ | ||||
|         }), | ||||
|   | ||||
| @@ -3411,7 +3411,6 @@ | ||||
|         function processTooltip() { | ||||
|             var filter = "collapse" + getVersion(); | ||||
|             var collList; | ||||
|             console.log("filter: ", filter); | ||||
|  | ||||
|  | ||||
|             if (filter == "collapse3.0") { | ||||
| @@ -3419,13 +3418,13 @@ | ||||
|                 showList(document.getElementsByName("collapse20")); | ||||
|                 showList(document.getElementsByName("collapse30")); | ||||
|                 hideList(document.getElementsByName("collapse31")); | ||||
|                 console.log("collapsed 3.0"); | ||||
|                  | ||||
|             } else if (filter == "collapse3.1") { | ||||
|                 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 if (filter == "collapse2.0") { | ||||
|                 document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 & 2.0 functions"; | ||||
|                 showList(document.getElementsByName("collapse20")); | ||||
| @@ -3442,7 +3441,7 @@ | ||||
|  | ||||
|         var triggerList = document.getElementsByClassName("collapseTrigger"); | ||||
|         for (i = 0; i < triggerList.length; i++) { | ||||
|             console.log("trigger connected"); | ||||
|              | ||||
|             triggerList[i].addEventListener("click", function () { | ||||
|                 var collapsible = this.parentElement; | ||||
|                 if (this.tagName == "A") { | ||||
| @@ -3452,7 +3451,7 @@ | ||||
|  | ||||
|                 } | ||||
|  | ||||
|                 console.log(collapsibleData); | ||||
|                  | ||||
|                 if (collapsibleData.style.maxHeight > "0px") { | ||||
|                     collapsibleData.style.maxHeight = "0px"; | ||||
|  | ||||
| @@ -3487,7 +3486,7 @@ | ||||
|             //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'); | ||||
|             console.log("init"); | ||||
|              | ||||
|             processVersionSelector(); | ||||
|             processTooltip(); | ||||
|             tool.addEventListener('change', event => { | ||||
|   | ||||
| @@ -81,7 +81,7 @@ | ||||
|             //Handle clicks in whole form and set info in tooltip | ||||
|             setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); | ||||
|             setDefaultContent(document.getElementById("transformArea"), 'Insert XSD here'); | ||||
|             console.log("init"); | ||||
|              | ||||
|             // refreshTooltip(); | ||||
|             processTooltip(); | ||||
|             tool.addEventListener('click', event => { | ||||
| @@ -92,13 +92,11 @@ | ||||
|                 } | ||||
|  | ||||
|                 processTooltip(); | ||||
|                 // console.log("clock"); | ||||
|                 //  | ||||
|             }) | ||||
|         } | ||||
|  | ||||
|         function processTooltip() { | ||||
|             console.log("processTooltip"); | ||||
|  | ||||
|  | ||||
|             if (getProcessor() == "xalan") { | ||||
|                 document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions"; | ||||
|   | ||||
| @@ -1138,7 +1138,7 @@ | ||||
|  | ||||
|     <script> | ||||
|         function processTooltip() { | ||||
|             console.log("processTooltip"); | ||||
|              | ||||
|             if (getProcessor() == "xalan" || getProcessor() == "libxml") { | ||||
|                 document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions"; | ||||
|                 document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0"; | ||||
| @@ -1152,9 +1152,9 @@ | ||||
|  | ||||
|         var triggerList = document.getElementsByClassName("collapseTrigger"); | ||||
|         for (i = 0; i < triggerList.length; i++) { | ||||
|             console.log("trigger connected"); | ||||
|              | ||||
|             triggerList[i].addEventListener("click", function () { | ||||
|                 console.log("click"); | ||||
|                  | ||||
|                 var collapsible = this.parentElement; | ||||
|                 var collapsibleData = this.nextElementSibling; | ||||
|                 if (collapsibleData.style.maxHeight > "0px") { | ||||
| @@ -1191,7 +1191,7 @@ | ||||
|             //Handle clicks in whole form and set info in tooltip | ||||
|             setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); | ||||
|             setDefaultContent(document.getElementById("transformArea"), 'Insert XSLT here'); | ||||
|             console.log("init"); | ||||
|              | ||||
|             // refreshTooltip(); | ||||
|             processTooltip(); | ||||
|             tool.addEventListener('click', event => { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user