');\r\n });\r\n }\r\n\r\n run++;\r\n }\r\n },\r\n error: function error(errorMsg) {\r\n $('#results').show();\r\n $('.export-results').hide();\r\n $('.scroll-container').hide();\r\n $('.export-results').hide();\r\n\r\n return (errorMsg.status === 500) ? errorServer.html(errorMsg.responseJSON.Message).show() : errorServer.html(errorMsg.statusText);\r\n }\r\n });\r\n });\r\n });\r\n\r\n function coloredCell(data) {\r\n switch (data) {\r\n case 'CE Reference size':\r\n case 'CE U-value':\r\n case 'CE Ug value':\r\n case 'CE Roof inclination':\r\n case 'Installation area':\r\n case 'Installation perimeter':\r\n case 'Linear heat loss built in':\r\n case 'U-value total Dormer':\r\n case 'Product type':\r\n return colorBlue;\r\n case 'Pane variant code':\r\n case 'Window type':\r\n case 'Window size':\r\n case 'Window variant':\r\n return colorRed;\r\n case 'Tube length':\r\n case 'Insulation':\r\n case 'Roof insulated':\r\n case 'Ceiling insulated':\r\n case 'Product configuration':\r\n case 'Roof inclination':\r\n case 'Accessory':\r\n case 'Accessory2':\r\n return colorYellow;\r\n default:\r\n return '';\r\n }\r\n }\r\n\r\n function filterTable(productType, data, productTypeCounter) {\r\n var productByNumber,\r\n outputFields,\r\n dataObj,\r\n object = {};\r\n\r\n productByNumber = dataStore.Data.Products.find(findProductByNumber);\r\n\r\n outputFields = productByNumber.OutputFields;\r\n\r\n dataObj = data[0] || [];\r\n\r\n if (dataObj && dataObj.length > 0) {\r\n isResultsHidden(true);\r\n\r\n return null;\r\n } else {\r\n $.each(outputFields, function (i, v) {\r\n $.each(dataObj, function (key, value) {\r\n if (key === v.ParameterKey) {\r\n var name = findName(outputFields, key);\r\n if (name) {\r\n if (productType === 'Window') {\r\n productType = 'Roof window';\r\n }\r\n object[\"Product type\"] = productType + ' ' + productTypeCounter;\r\n object[name] = dataObj[key];\r\n\r\n }\r\n }\r\n });\r\n });\r\n }\r\n return object;\r\n }\r\n\r\n function findProductByNumber(el, index, arr) {\r\n var arrNumber;\r\n if (el.ProductKey === productType) {\r\n arrNumber = index;\r\n return el;\r\n }\r\n }\r\n\r\n function findName(dataArr, propKey) {\r\n var nameObj = dataArr.find(function (el) {\r\n return el.ParameterKey === propKey;\r\n });\r\n\r\n if (nameObj !== \"undefined\") {\r\n return nameObj.ParameterName;\r\n }\r\n } // Get the modal\r\n\r\n\r\n var modal = document.getElementById('exampleModal');\r\n // Get the button that opens the modal\r\n\r\n var btn = document.getElementsByClassName(\"button-info\")[0]; // Get the element that closes the modal\r\n\r\n var span = document.getElementsByClassName(\"close\")[0]; // When the user clicks on the button, open the modal \r\n\r\n btn.onclick = function (e) {\r\n e.preventDefault();\r\n modal.style.display = \"block\";\r\n }; // When the user clicks on (x), close the modal\r\n\r\n\r\n span.onclick = function () {\r\n modal.style.display = \"none\";\r\n }; // When the user clicks anywhere outside of the modal, close it\r\n\r\n\r\n window.onclick = function (event) {\r\n if (event.target == modal) {\r\n modal.style.display = \"none\";\r\n }\r\n };\r\n})(jQuery);"],"sourceRoot":""}