wonder-image 1.7.2 → 1.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/body-end.js +1 -1
- package/dist/backend/body-end.js.map +1 -1
- package/dist/backend/head.css +1 -1
- package/dist/backend/head.css.map +1 -1
- package/dist/backend/head.js +1 -1
- package/dist/backend/head.js.map +1 -1
- package/dist/frontend/body-end.js +1 -1
- package/dist/frontend/body-end.js.map +1 -1
- package/package.json +1 -1
- package/src/build/backend/css/lib/select2.css +4 -0
- package/src/build/backend/js/form/input.js +1 -38
- package/src/build/backend/js/form/inputRow.js +57 -26
- package/src/build/backend/js/form/set.js +56 -18
- package/src/build/backend/js/pageSetUp.js +0 -1
- package/src/build/frontend/js/pageSetUp.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see body-end.js.LICENSE.txt */
|
|
2
|
-
(()=>{var n={6867:n=>{n.exports="function alertContainer() {\n\n if (document.querySelector('.alert-container')) {\n\n var container = document.querySelector('.alert-container');\n\n } else {\n\n var container = document.createElement('div');\n container.classList.add('alert-container');\n container.classList.add('p-f');\n container.classList.add('top');\n container.classList.add('start');\n container.classList.add('w-100');\n container.classList.add('h-100');\n container.classList.add('no-interaction');\n container.style.zIndex = \"1000\";\n\n document.body.insertBefore(container, document.body.firstChild);\n\n }\n\n return container;\n\n}\n\nfunction alertToast(alert) {\n\n var container = alertContainer();\n\n if (alert == 801) {\n\n container.innerHTML += NO_INTERNET_ALERT;\n\n } else {\n\n $.ajax({\n type: \"POST\",\n url: pathApp+'/api/alert.php',\n data: { \n post: 'true',\n frontend: 'true',\n alert: alert\n }, \n success: function (data) {\n\n container.innerHTML += data;\n \n var url = new URL(window.location.href);\n url.searchParams.delete('alert');\n window.history.replaceState(null, null, url);\n\n }\n });\n\n }\n\n setTimeout(() => {\n document.querySelectorAll('.wi-alert.wi-show').forEach(element => {\n element.classList.remove('wi-show');\n });\n }, 4000);\n\n}"},5068:n=>{n.exports="function setAos() {\n\n if (isMobile() && (typeof MOBILE_REMOVE_AOS == 'undefined' || MOBILE_REMOVE_AOS == true)) {\n AOS.init({\n disable: 'mobile'\n });\n } else {\n AOS.init();\n }\n\n}"},7244:n=>{n.exports="function toggleDropdown(container) {\n\n if (container.classList.contains('wi-show')) {\n closeDropdown(container);\n } else {\n openDropdown(container);\n }\n \n}\n\nfunction openDropdown(container) {\n\n container.classList.add('wi-show'); \n\n if (container.querySelector('i.bi-chevron-down')) {\n container.querySelector('i.bi-chevron-down').classList.add('bi-chevron-up');\n container.querySelector('i.bi-chevron-down').classList.remove('bi-chevron-down');\n }\n\n if (container.querySelector('i.bi-plus')) {\n container.querySelector('i.bi-plus').classList.add('bi-dash');\n container.querySelector('i.bi-plus').classList.remove('bi-plus');\n }\n\n if (container.querySelector('i.bi-plus-lg')) {\n container.querySelector('i.bi-plus-lg').classList.add('bi-dash-lg');\n container.querySelector('i.bi-plus-lg').classList.remove('bi-plus-lg');\n }\n \n}\n\nfunction closeDropdown(container) {\n\n container.classList.remove('wi-show'); \n\n if (container.querySelector('i.bi-chevron-up')) {\n container.querySelector('i.bi-chevron-up').classList.add('bi-chevron-down');\n container.querySelector('i.bi-chevron-up').classList.remove('bi-chevron-up');\n }\n\n if (container.querySelector('i.bi-dash')) {\n container.querySelector('i.bi-dash').classList.add('bi-plus');\n container.querySelector('i.bi-dash').classList.remove('bi-dash');\n }\n\n if (container.querySelector('i.bi-dash-lg')) {\n container.querySelector('i.bi-dash-lg').classList.add('bi-plus-lg');\n container.querySelector('i.bi-dash-lg').classList.remove('bi-dash-lg');\n }\n \n}\n\nfunction setDropdown() {\n \n document.querySelectorAll(\".wi-dropdown-btn .wi-switcher\").forEach(element => {\n\n element.onclick = function() { toggleDropdown(element.parentElement); };\n \n element.parentElement.onmouseleave = function() { closeDropdown(element.parentElement); };\n \n });\n\n document.querySelectorAll(\".wi-dropdown-box .wi-switcher\").forEach(element => {\n\n if (element.parentElement.classList.contains('wi-show')) {\n openDropdown(element.parentElement);\n }\n\n element.onclick = function() { toggleDropdown(element.parentElement); };\n \n });\n\n}"},2787:n=>{n.exports='/**\n * \n * GOOGLE MAPS API\n * \n */\n\nfunction placeNeedCheck(input) {\n\n inputError(input, \'Indirizzo non valido, è necessario selezionare un indirizzo dall\\\'elenco!\');\n\n}\n\nfunction checkInputPlace(input, autocomplete) {\n \n var inputContainer = input.parentElement;\n\n var country = inputContainer.querySelector(\'[data-wi-spi="country"]\');\n var province = inputContainer.querySelector(\'[data-wi-spi="province"]\');\n var cap = inputContainer.querySelector(\'[data-wi-spi="cap"]\');\n var city = inputContainer.querySelector(\'[data-wi-spi="city"]\');\n var street = inputContainer.querySelector(\'[data-wi-spi="street"]\');\n var number = inputContainer.querySelector(\'[data-wi-spi="number"]\');\n\n country.value = "";\n province.value = "";\n cap.value = "";\n city.value = "";\n street.value = "";\n number.value = "";\n\n removeInputError(input);\n\n if (autocomplete.getPlace()) {\n\n var place = autocomplete.getPlace();\n\n if (place.address_components) {\n\n for (const component of place.address_components) {\n \n const componentType = component.types;\n\n if (componentType.includes(\'street_number\')) { number.value = component.long_name; }\n if (componentType.includes(\'route\')) { street.value = component.short_name; }\n if (componentType.includes(\'administrative_area_level_3\') || componentType.includes(\'postal_town\')) { city.value = component.short_name; }\n if (componentType.includes(\'postal_code\') || componentType.includes(\'postal_code_prefix\')) { cap.value = component.short_name; }\n if (componentType.includes(\'administrative_area_level_2\')) { province.value = component.short_name; }\n if (componentType.includes(\'country\')) { country.value = component.short_name; }\n\n }\n\n if (country.value == "" || province.value == "" || cap.value == "" || city.value == "" || street.value == "" || number.value == "") {\n \n var error = "Indirizzo non valido";\n\n if (country.value == "") {\n error += ", manca il paese";\n } else if (province.value == "") {\n error += ", manca la provincia";\n } else if (cap.value == "") {\n error += ", manca il cap";\n } else if (city.value == "") {\n error += ", manca la città";\n } else if (street.value == "") {\n error += ", manca la via";\n } else if (number.value == "") {\n error += ", manca il numero civico";\n }\n\n inputError(input, error);\n \n }\n\n } else {\n\n inputError(input, \'Indirizzo non valido\');\n\n }\n\n } else {\n\n inputError(input, \'Indirizzo non valido\');\n\n }\n\n check();\n\n}\n\nfunction setPlace(input, country = null, province = null, cap = null, city = null, street = null, number = null) {\n\n var inputContainer = input.parentElement;\n\n var countryInput = inputContainer.querySelector(\'[data-wi-spi="country"]\');\n var provinceInput = inputContainer.querySelector(\'[data-wi-spi="province"]\');\n var capInput = inputContainer.querySelector(\'[data-wi-spi="cap"]\');\n var cityInput = inputContainer.querySelector(\'[data-wi-spi="city"]\');\n var streetInput = inputContainer.querySelector(\'[data-wi-spi="street"]\');\n var numberInput = inputContainer.querySelector(\'[data-wi-spi="number"]\');\n\n if (country == null) {\n\n country = countryInput.value;\n province = provinceInput.value;\n cap = capInput.value;\n city = cityInput.value;\n street = streetInput.value;\n number = numberInput.value;\n\n } else {\n\n countryInput.value = country;\n provinceInput.value = province;\n capInput.value = cap;\n cityInput.value = city;\n streetInput.value = street;\n numberInput.value = number;\n \n }\n\n if (country != "" || province != "" || cap != "" || city != "" || street != "" || number != "") {\n \n var address = street+\', \'+number+\', \'+city+\', \'+province+\', \'+country;\n input.value = address;\n\n checkLabel();\n check();\n\n }\n\n}\n\nfunction setGoogleMapsPlace() {\n\n document.querySelectorAll("[data-wi-search-place=\'true\']").forEach(input => {\n\n input.disabled = false;\n \n var options = {};\n\n if (input.dataset.wiRestriction != \'[]\') { \n\n var restrictions = JSON.parse(input.dataset.wiRestriction);\n options.componentRestrictions = restrictions; \n \n }\n\n options.fields = [ "address_components" ];\n options.types = [ "address" ];\n \n var googlePlace = new google.maps.places.Autocomplete(input, options);\n\n input.addEventListener("change", () => { placeNeedCheck(input); });\n googlePlace.addListener("place_changed", () => { checkInputPlace(input, googlePlace); });\n\n });\n\n}\n\nfunction setGoogleMapsApi() {\n\n if (document.querySelector("[data-wi-search-place]")) {\n\n var GOOGLE_API_KEY = "AIzaSyAhBslKzmgy6pRrLGyhlN34pN1yQYE1hvI";\n\n /**\n * \n * Se ci sono degli input Place chiama le API di Google Place\n * Documentazione: https://developers.google.com/maps/documentation/javascript/place-autocomplete?hl=it\n * \n */\n\n var script = document.createElement(\'script\');\n script.type = \'text/javascript\';\n script.async = true;\n script.src = \'https://maps.googleapis.com/maps/api/js?key=\'+GOOGLE_API_KEY+\'&loading=async&libraries=places&callback=setGoogleMapsPlace\'; \n\n document.head.appendChild(script);\n \n }\n\n}\n\n/**\n * \n * inputCountry() - inputStates()\n * \n */\n\nfunction setInputCountry() {\n\n document.querySelectorAll("[data-wi-input-country=\'true\']").forEach(element => {\n element.addEventListener("change", searchStates);\n element.addEventListener("focusout", searchStates);\n });\n\n}\n\nfunction setCountryState(input, country, state) {\n\n textListValue(input, country);\n searchStates(input, state);\n \n}\n\nfunction searchStates(event, stateValue = null) {\n\n if (typeof event.target !== "undefined") {\n var inputCountry = event.target;\n } else {\n var inputCountry = event;\n }\n \n var form = inputCountry.form;\n var inputCountryName = inputCountry.dataset.wiName.replace(\'-text\', \'\');\n var inputStateName = inputCountry.dataset.wiInputState;\n\n var inputState = form.querySelector(\'input[data-wi-name="\'+inputStateName+\'-text"]\');\n\n inputState.disabled = true;\n inputState.value = "";\n\n delay(100).then(() => {\n\n if (form.querySelector(\'input[name="\'+inputCountryName+\'"]:checked\') != null) {\n\n var country = form.querySelector(\'input[name="\'+inputCountryName+\'"]:checked\').value;\n \n if (inputState.dataset.wiListStates != country) {\n \n inputState.dataset.wiListStates = country;\n\n loadingSpinner();\n\n $.ajax({\n type: "POST",\n url: pathApp+\'/api/states.php\',\n data: { \n post: \'true\',\n country: country\n }, \n success: function (data) {\n\n const response = JSON.parse(data);\n\n textListOptions( inputState, response );\n\n inputState.disabled = false;\n\n if (stateValue != null && stateValue != "") { textListValue(inputState, stateValue); }\n\n loadingSpinner();\n\n },\n error: function (XMLHttpRequest) {\n\n ajaxRequestError(XMLHttpRequest);\n loadingSpinner();\n\n }\n });\n\n } else {\n\n inputState.disabled = false;\n \n }\n\n }\n\n });\n\n}'},7350:n=>{n.exports='var x, i, j, l, ll, selElmnt, a, b, c;\n\n// Look for any elements with the class "custom-select":\nx = document.querySelectorAll("[data-wi-select=\'true\']");\nl = x.length;\n\nfor (i = 0; i < l; i++) {\n\n selElmnt = x[i].getElementsByTagName("select")[0];\n ll = selElmnt.length;\n\n // For each element, create a new DIV that will act as the selected item:\n a = document.createElement("DIV");\n a.setAttribute("class", "select-selected wi-input");\n a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;\n x[i].appendChild(a);\n\n // For each element, create a new DIV that will contain the option list:\n b = document.createElement("DIV");\n b.setAttribute("class", "select-items wi-input-list no-scrollbar");\n\n for (j = 0; j < ll; j++) {\n\n // For each option in the original select element, create a new DIV that will act as an option item:\n c = document.createElement("DIV");\n c.id = selElmnt.options[j].value;\n c.setAttribute("class", "wi-input-list-value");\n c.innerHTML = selElmnt.options[j].innerHTML;\n\n // Se è impostato un valore di default selezionalo\n if (selElmnt.value != undefined) { if (c.id == selElmnt.value) { c.classList.add("same-as-selected"); } }\n\n c.addEventListener("click", function(e) {\n\n // When an item is clicked, update the original select box, and the selected item:\n var y, i, k, s, h, sl, yl;\n s = this.parentNode.parentNode.getElementsByTagName("select")[0];\n sl = s.length;\n selElmnt.value = this.id;\n h = this.parentNode.previousSibling;\n\n for (i = 0; i < sl; i++) {\n if (s.options[i].innerHTML == this.innerHTML) {\n s.selectedIndex = i;\n h.innerHTML = this.innerHTML;\n y = this.parentNode.getElementsByClassName("same-as-selected");\n yl = y.length;\n for (k = 0; k < yl; k++) {\n y[k].classList.remove("same-as-selected");\n }\n this.setAttribute("class", "wi-input-list-value same-as-selected");\n break;\n }\n }\n\n h.click();\n\n });\n\n // Passa le funzioni onchange dal select alle nuove opzioni\n c.onclick = selElmnt.onchange;\n c.mousedown = selElmnt.onchange;\n\n b.appendChild(c);\n\n }\n\n x[i].appendChild(b);\n\n a.addEventListener("click", function(e) {\n\n // When the select box is clicked, close any other select boxes, and open/close the current select box\n e.stopPropagation();\n closeAllSelect(this);\n this.classList.toggle("select-arrow-active");\n this.parentNode.classList.toggle("wi-list-active");\n check();\n\n });\n\n}\n\nfunction closeAllSelect(elmnt) {\n\n // A function that will close all select boxes in the document, except the current select box:\n var x, y, i, xl, yl, arrNo = [];\n x = document.getElementsByClassName("select-items");\n y = document.getElementsByClassName("select-selected");\n var container = document.querySelector(".wi-input-container.wi-list-active");\n xl = x.length;\n yl = y.length;\n\n for (i = 0; i < yl; i++) {\n if (elmnt == y[i]) {\n arrNo.push(i)\n }else{\n y[i].classList.remove("select-arrow-active");\n }\n }\n\n if (container != null) {\n container.classList.remove("wi-list-active");\n }\n\n}\n\n// If the user clicks anywhere outside the select box, then close all select boxes:\ndocument.addEventListener("click", closeAllSelect);'},4428:n=>{n.exports='function formToArray(formElements) {\n\n const ARRAY = {};\n\n for (let i = 0; i < formElements.length; i++) {\n\n var add = false;\n\n var input = formElements[i];\n\n if (input.type == \'checkbox\' || input.type == \'radio\') {\n if (input.checked == true) { var add = true; }\n } else {\n if (input.value != "") { var add = true;}\n }\n\n if (add) {\n\n var inputName = input.name;\n var inputValue = input.value;\n\n if (inputName.includes("[]")) {\n\n inputName = inputName.replace("[]", "");\n\n if (inputName in ARRAY) {\n inputName = inputName.replace("[]", "");\n ARRAY[inputName].push(inputValue);\n } else {\n inputName = inputName.replace("[]", "");\n ARRAY[inputName] = [];\n ARRAY[inputName].push(inputValue);\n }\n \n } else {\n\n if (inputName in ARRAY) {\n\n } else {\n ARRAY[inputName] = inputValue;\n }\n\n }\n\n }\n\n }\n\n return ARRAY;\n \n}\n\nfunction prettyFormResponse(data) {\n\n if (data != \'\') {\n \n console.log(\'ERRORE FORM: \'+data);\n\n var container = document.querySelector("#loading-spinner .center");\n container.classList.add("w-80");\n container.innerHTML = \'<div class="title-big a-c"><i class="bi bi-x-circle tx-danger"></i></div><div class="subtitle mt-8 a-c">C\\\'è stato un problema con l\\\'invio della tua richiesta</div><div class="c-w mt-10"><a onclick="location.reload();" class="btn btn-primary c-w">Riprova</a></div>\';\n\n } else {\n \n var container = document.querySelector("#loading-spinner .center");\n container.classList.add("w-80");\n container.innerHTML = \'<div class="title-big a-c"><i class="bi bi-check2-circle tx-success"></i></div><div class="subtitle mt-8 a-c">La tua richiesta è stata inviata con successo!</div><div class="c-w mt-10"><a onclick="location.reload(); " class="btn btn-primary c-w">Torna al sito</a></div>\';\n\n }\n \n}\n\nfunction sendForm(button, url, responseFunction = prettyFormResponse) {\n\n loadingSpinner();\n\n const VALUES = formToArray(button.form.elements);\n var form = JSON.stringify(VALUES);\n\n $.ajax({\n type: "POST",\n url: url,\n data: { \n post: \'true\',\n form: form\n }, \n success: function (data) {\n\n if (responseFunction != null) {\n if (typeof responseFunction === \'function\') {\n responseFunction(data);\n } else {\n loadingSpinner();\n }\n }\n\n },\n error: function (XMLHttpRequest) {\n ajaxRequestError(XMLHttpRequest);\n loadingSpinner();\n }\n });\n\n}\n\nfunction formUpload(form, url, responseFunction = prettyFormResponse) {\n\n loadingSpinner();\n \n var formData = new FormData(form);\n formData.append(\'post\', \'true\');\n \n $.ajax({\n type: "POST",\n url: url,\n data: formData,\n contentType: false,\n cache: false,\n processData:false, \n success: function (data) {\n\n if (responseFunction != null) {\n if (typeof responseFunction === \'function\') {\n responseFunction(data);\n } else {\n loadingSpinner();\n }\n }\n\n },\n error: function (XMLHttpRequest) {\n ajaxRequestError(XMLHttpRequest);\n loadingSpinner();\n }\n });\n\n}'},8516:n=>{n.exports='function menuMobile(hamburger = "#hamburger", navMobile = "#nav-mobile") { \n \n if (hamburger != null) { document.querySelector(hamburger).classList.toggle("click"); }\n if (navMobile != null) { document.querySelector(navMobile).classList.toggle("show"); }\n\n if (document.querySelector(hamburger).classList.contains("click")) {\n disableScroll();\n } else {\n enableScroll();\n }\n\n}'},148:n=>{n.exports="function modal(selector) {\n\n setUpModal(selector);\n\n var modal = document.querySelector(selector);\n\n modal.classList.toggle('wi-show');\n modal.classList.toggle('no-interaction');\n\n if (modal.classList.contains('wi-show')) {\n disableScroll();\n } else {\n enableScroll();\n }\n\n}\n\nfunction setUpModal(selector) {\n \n document.querySelectorAll(selector + ' .wi-close-modal').forEach(element => {\n if (element.onclick == null) {\n element.onclick = function() { modal(selector) };\n }\n });\n\n}"},225:n=>{n.exports="function setUpPage() {\n \n $.ajax({\n type: \"POST\",\n url: pathApp+'/api/alert.php',\n data: { \n post: 'true',\n frontend: 'true',\n alert: 801\n }, \n success: function (data) {\n NO_INTERNET_ALERT = data;\n }\n });\n\n var PAGE_URL = new URL(window.location.href);\n\n if (PAGE_URL.searchParams.get('scroll')) {\n \n var idScroll = PAGE_URL.searchParams.get('scroll');\n scrolla('#'+idScroll);\n\n }\n\n // L'alert non viene passato solo tramite GET ma anche tramite variabile php\n // if (PAGE_URL.searchParams.get('alert')) {\n // var alertCode = PAGE_URL.searchParams.get('alert'); alertToast(alertCode);\n // }\n\n setAos();\n setInput();\n setDropdown();\n setVideoJS();\n \n window.dispatchEvent(new Event('loaded'));\n \n};"},4642:n=>{n.exports=function(n){function e(n){"undefined"!=typeof console&&(console.error||console.log)("[Script Loader]",n)}try{"undefined"!=typeof execScript&&"undefined"!=typeof attachEvent&&"undefined"==typeof addEventListener?execScript(n):"undefined"!=typeof eval?eval.call(null,n):e("EvalError: No eval function available")}catch(n){e(n)}}},1120:(n,e,t)=>{t(4642)(t(6867))},2051:(n,e,t)=>{t(4642)(t(5068))},1809:(n,e,t)=>{t(4642)(t(7244))},7154:(n,e,t)=>{t(4642)(t(2787))},8865:(n,e,t)=>{t(4642)(t(7350))},1123:(n,e,t)=>{t(4642)(t(4428))},5329:(n,e,t)=>{t(4642)(t(8516))},871:(n,e,t)=>{t(4642)(t(148))},7186:(n,e,t)=>{t(4642)(t(225))}},e={};function t(a){var i=e[a];if(void 0!==i)return i.exports;var o=e[a]={exports:{}};return n[a](o,o.exports,t),o.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var a in e)t.o(e,a)&&!t.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:e[a]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),t.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var a={};(()=>{"use strict";t.r(a);t(2051),t(5329),t(1120),t(1809),t(871),t(7154),t(8865),t(1123),t(7186)})(),window.wonder=a})();
|
|
2
|
+
(()=>{var n={6867:n=>{n.exports="function alertContainer() {\n\n if (document.querySelector('.alert-container')) {\n\n var container = document.querySelector('.alert-container');\n\n } else {\n\n var container = document.createElement('div');\n container.classList.add('alert-container');\n container.classList.add('p-f');\n container.classList.add('top');\n container.classList.add('start');\n container.classList.add('w-100');\n container.classList.add('h-100');\n container.classList.add('no-interaction');\n container.style.zIndex = \"1000\";\n\n document.body.insertBefore(container, document.body.firstChild);\n\n }\n\n return container;\n\n}\n\nfunction alertToast(alert) {\n\n var container = alertContainer();\n\n if (alert == 801) {\n\n container.innerHTML += NO_INTERNET_ALERT;\n\n } else {\n\n $.ajax({\n type: \"POST\",\n url: pathApp+'/api/alert.php',\n data: { \n post: 'true',\n frontend: 'true',\n alert: alert\n }, \n success: function (data) {\n\n container.innerHTML += data;\n \n var url = new URL(window.location.href);\n url.searchParams.delete('alert');\n window.history.replaceState(null, null, url);\n\n }\n });\n\n }\n\n setTimeout(() => {\n document.querySelectorAll('.wi-alert.wi-show').forEach(element => {\n element.classList.remove('wi-show');\n });\n }, 4000);\n\n}"},5068:n=>{n.exports="function setAos() {\n\n if (isMobile() && (typeof MOBILE_REMOVE_AOS == 'undefined' || MOBILE_REMOVE_AOS == true)) {\n AOS.init({\n disable: 'mobile'\n });\n } else {\n AOS.init();\n }\n\n}"},7244:n=>{n.exports="function toggleDropdown(container) {\n\n if (container.classList.contains('wi-show')) {\n closeDropdown(container);\n } else {\n openDropdown(container);\n }\n \n}\n\nfunction openDropdown(container) {\n\n container.classList.add('wi-show'); \n\n if (container.querySelector('i.bi-chevron-down')) {\n container.querySelector('i.bi-chevron-down').classList.add('bi-chevron-up');\n container.querySelector('i.bi-chevron-down').classList.remove('bi-chevron-down');\n }\n\n if (container.querySelector('i.bi-plus')) {\n container.querySelector('i.bi-plus').classList.add('bi-dash');\n container.querySelector('i.bi-plus').classList.remove('bi-plus');\n }\n\n if (container.querySelector('i.bi-plus-lg')) {\n container.querySelector('i.bi-plus-lg').classList.add('bi-dash-lg');\n container.querySelector('i.bi-plus-lg').classList.remove('bi-plus-lg');\n }\n \n}\n\nfunction closeDropdown(container) {\n\n container.classList.remove('wi-show'); \n\n if (container.querySelector('i.bi-chevron-up')) {\n container.querySelector('i.bi-chevron-up').classList.add('bi-chevron-down');\n container.querySelector('i.bi-chevron-up').classList.remove('bi-chevron-up');\n }\n\n if (container.querySelector('i.bi-dash')) {\n container.querySelector('i.bi-dash').classList.add('bi-plus');\n container.querySelector('i.bi-dash').classList.remove('bi-dash');\n }\n\n if (container.querySelector('i.bi-dash-lg')) {\n container.querySelector('i.bi-dash-lg').classList.add('bi-plus-lg');\n container.querySelector('i.bi-dash-lg').classList.remove('bi-dash-lg');\n }\n \n}\n\nfunction setDropdown() {\n \n document.querySelectorAll(\".wi-dropdown-btn .wi-switcher\").forEach(element => {\n\n element.onclick = function() { toggleDropdown(element.parentElement); };\n \n element.parentElement.onmouseleave = function() { closeDropdown(element.parentElement); };\n \n });\n\n document.querySelectorAll(\".wi-dropdown-box .wi-switcher\").forEach(element => {\n\n if (element.parentElement.classList.contains('wi-show')) {\n openDropdown(element.parentElement);\n }\n\n element.onclick = function() { toggleDropdown(element.parentElement); };\n \n });\n\n}"},2787:n=>{n.exports='/**\n * \n * GOOGLE MAPS API\n * \n */\n\nfunction placeNeedCheck(input) {\n\n inputError(input, \'Indirizzo non valido, è necessario selezionare un indirizzo dall\\\'elenco!\');\n\n}\n\nfunction checkInputPlace(input, autocomplete) {\n \n var inputContainer = input.parentElement;\n\n var country = inputContainer.querySelector(\'[data-wi-spi="country"]\');\n var province = inputContainer.querySelector(\'[data-wi-spi="province"]\');\n var cap = inputContainer.querySelector(\'[data-wi-spi="cap"]\');\n var city = inputContainer.querySelector(\'[data-wi-spi="city"]\');\n var street = inputContainer.querySelector(\'[data-wi-spi="street"]\');\n var number = inputContainer.querySelector(\'[data-wi-spi="number"]\');\n\n country.value = "";\n province.value = "";\n cap.value = "";\n city.value = "";\n street.value = "";\n number.value = "";\n\n removeInputError(input);\n\n if (autocomplete.getPlace()) {\n\n var place = autocomplete.getPlace();\n\n if (place.address_components) {\n\n for (const component of place.address_components) {\n \n const componentType = component.types;\n\n if (componentType.includes(\'street_number\')) { number.value = component.long_name; }\n if (componentType.includes(\'route\')) { street.value = component.short_name; }\n if (componentType.includes(\'administrative_area_level_3\') || componentType.includes(\'postal_town\')) { city.value = component.short_name; }\n if (componentType.includes(\'postal_code\') || componentType.includes(\'postal_code_prefix\')) { cap.value = component.short_name; }\n if (componentType.includes(\'administrative_area_level_2\')) { province.value = component.short_name; }\n if (componentType.includes(\'country\')) { country.value = component.short_name; }\n\n }\n\n if (country.value == "" || province.value == "" || cap.value == "" || city.value == "" || street.value == "" || number.value == "") {\n \n var error = "Indirizzo non valido";\n\n if (country.value == "") {\n error += ", manca il paese";\n } else if (province.value == "") {\n error += ", manca la provincia";\n } else if (cap.value == "") {\n error += ", manca il cap";\n } else if (city.value == "") {\n error += ", manca la città";\n } else if (street.value == "") {\n error += ", manca la via";\n } else if (number.value == "") {\n error += ", manca il numero civico";\n }\n\n inputError(input, error);\n \n }\n\n } else {\n\n inputError(input, \'Indirizzo non valido\');\n\n }\n\n } else {\n\n inputError(input, \'Indirizzo non valido\');\n\n }\n\n check();\n\n}\n\nfunction setPlace(input, country = null, province = null, cap = null, city = null, street = null, number = null) {\n\n var inputContainer = input.parentElement;\n\n var countryInput = inputContainer.querySelector(\'[data-wi-spi="country"]\');\n var provinceInput = inputContainer.querySelector(\'[data-wi-spi="province"]\');\n var capInput = inputContainer.querySelector(\'[data-wi-spi="cap"]\');\n var cityInput = inputContainer.querySelector(\'[data-wi-spi="city"]\');\n var streetInput = inputContainer.querySelector(\'[data-wi-spi="street"]\');\n var numberInput = inputContainer.querySelector(\'[data-wi-spi="number"]\');\n\n if (country == null) {\n\n country = countryInput.value;\n province = provinceInput.value;\n cap = capInput.value;\n city = cityInput.value;\n street = streetInput.value;\n number = numberInput.value;\n\n } else {\n\n countryInput.value = country;\n provinceInput.value = province;\n capInput.value = cap;\n cityInput.value = city;\n streetInput.value = street;\n numberInput.value = number;\n \n }\n\n if (country != "" || province != "" || cap != "" || city != "" || street != "" || number != "") {\n \n var address = street+\', \'+number+\', \'+city+\', \'+province+\', \'+country;\n input.value = address;\n\n checkLabel();\n check();\n\n }\n\n}\n\nfunction setGoogleMapsPlace() {\n\n document.querySelectorAll("[data-wi-search-place=\'true\']").forEach(input => {\n\n input.disabled = false;\n \n var options = {};\n\n if (input.dataset.wiRestriction != \'[]\') { \n\n var restrictions = JSON.parse(input.dataset.wiRestriction);\n options.componentRestrictions = restrictions; \n \n }\n\n options.fields = [ "address_components" ];\n options.types = [ "address" ];\n \n var googlePlace = new google.maps.places.Autocomplete(input, options);\n\n input.addEventListener("change", () => { placeNeedCheck(input); });\n googlePlace.addListener("place_changed", () => { checkInputPlace(input, googlePlace); });\n\n });\n\n}\n\nfunction setGoogleMapsApi() {\n\n if (document.querySelector("[data-wi-search-place]")) {\n\n var GOOGLE_API_KEY = "AIzaSyAhBslKzmgy6pRrLGyhlN34pN1yQYE1hvI";\n\n /**\n * \n * Se ci sono degli input Place chiama le API di Google Place\n * Documentazione: https://developers.google.com/maps/documentation/javascript/place-autocomplete?hl=it\n * \n */\n\n var script = document.createElement(\'script\');\n script.type = \'text/javascript\';\n script.async = true;\n script.src = \'https://maps.googleapis.com/maps/api/js?key=\'+GOOGLE_API_KEY+\'&loading=async&libraries=places&callback=setGoogleMapsPlace\'; \n\n document.head.appendChild(script);\n \n }\n\n}\n\n/**\n * \n * inputCountry() - inputStates()\n * \n */\n\nfunction setInputCountry() {\n\n document.querySelectorAll("[data-wi-input-country=\'true\']").forEach(element => {\n element.addEventListener("change", searchStates);\n element.addEventListener("focusout", searchStates);\n });\n\n}\n\nfunction setCountryState(input, country, state) {\n\n textListValue(input, country);\n searchStates(input, state);\n \n}\n\nfunction searchStates(event, stateValue = null) {\n\n if (typeof event.target !== "undefined") {\n var inputCountry = event.target;\n } else {\n var inputCountry = event;\n }\n \n var form = inputCountry.form;\n var inputCountryName = inputCountry.dataset.wiName.replace(\'-text\', \'\');\n var inputStateName = inputCountry.dataset.wiInputState;\n\n var inputState = form.querySelector(\'input[data-wi-name="\'+inputStateName+\'-text"]\');\n\n inputState.disabled = true;\n inputState.value = "";\n\n delay(100).then(() => {\n\n if (form.querySelector(\'input[name="\'+inputCountryName+\'"]:checked\') != null) {\n\n var country = form.querySelector(\'input[name="\'+inputCountryName+\'"]:checked\').value;\n \n if (inputState.dataset.wiListStates != country) {\n \n inputState.dataset.wiListStates = country;\n\n loadingSpinner();\n\n $.ajax({\n type: "POST",\n url: pathApp+\'/api/states.php\',\n data: { \n post: \'true\',\n country: country\n }, \n success: function (data) {\n\n const response = JSON.parse(data);\n\n textListOptions( inputState, response );\n\n inputState.disabled = false;\n\n if (stateValue != null && stateValue != "") { textListValue(inputState, stateValue); }\n\n loadingSpinner();\n\n },\n error: function (XMLHttpRequest) {\n\n ajaxRequestError(XMLHttpRequest);\n loadingSpinner();\n\n }\n });\n\n } else {\n\n inputState.disabled = false;\n \n }\n\n }\n\n });\n\n}'},7350:n=>{n.exports='var x, i, j, l, ll, selElmnt, a, b, c;\n\n// Look for any elements with the class "custom-select":\nx = document.querySelectorAll("[data-wi-select=\'true\']");\nl = x.length;\n\nfor (i = 0; i < l; i++) {\n\n selElmnt = x[i].getElementsByTagName("select")[0];\n ll = selElmnt.length;\n\n // For each element, create a new DIV that will act as the selected item:\n a = document.createElement("DIV");\n a.setAttribute("class", "select-selected wi-input");\n a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;\n x[i].appendChild(a);\n\n // For each element, create a new DIV that will contain the option list:\n b = document.createElement("DIV");\n b.setAttribute("class", "select-items wi-input-list no-scrollbar");\n\n for (j = 0; j < ll; j++) {\n\n // For each option in the original select element, create a new DIV that will act as an option item:\n c = document.createElement("DIV");\n c.id = selElmnt.options[j].value;\n c.setAttribute("class", "wi-input-list-value");\n c.innerHTML = selElmnt.options[j].innerHTML;\n\n // Se è impostato un valore di default selezionalo\n if (selElmnt.value != undefined) { if (c.id == selElmnt.value) { c.classList.add("same-as-selected"); } }\n\n c.addEventListener("click", function(e) {\n\n // When an item is clicked, update the original select box, and the selected item:\n var y, i, k, s, h, sl, yl;\n s = this.parentNode.parentNode.getElementsByTagName("select")[0];\n sl = s.length;\n selElmnt.value = this.id;\n h = this.parentNode.previousSibling;\n\n for (i = 0; i < sl; i++) {\n if (s.options[i].innerHTML == this.innerHTML) {\n s.selectedIndex = i;\n h.innerHTML = this.innerHTML;\n y = this.parentNode.getElementsByClassName("same-as-selected");\n yl = y.length;\n for (k = 0; k < yl; k++) {\n y[k].classList.remove("same-as-selected");\n }\n this.setAttribute("class", "wi-input-list-value same-as-selected");\n break;\n }\n }\n\n h.click();\n\n });\n\n // Passa le funzioni onchange dal select alle nuove opzioni\n c.onclick = selElmnt.onchange;\n c.mousedown = selElmnt.onchange;\n\n b.appendChild(c);\n\n }\n\n x[i].appendChild(b);\n\n a.addEventListener("click", function(e) {\n\n // When the select box is clicked, close any other select boxes, and open/close the current select box\n e.stopPropagation();\n closeAllSelect(this);\n this.classList.toggle("select-arrow-active");\n this.parentNode.classList.toggle("wi-list-active");\n check();\n\n });\n\n}\n\nfunction closeAllSelect(elmnt) {\n\n // A function that will close all select boxes in the document, except the current select box:\n var x, y, i, xl, yl, arrNo = [];\n x = document.getElementsByClassName("select-items");\n y = document.getElementsByClassName("select-selected");\n var container = document.querySelector(".wi-input-container.wi-list-active");\n xl = x.length;\n yl = y.length;\n\n for (i = 0; i < yl; i++) {\n if (elmnt == y[i]) {\n arrNo.push(i)\n }else{\n y[i].classList.remove("select-arrow-active");\n }\n }\n\n if (container != null) {\n container.classList.remove("wi-list-active");\n }\n\n}\n\n// If the user clicks anywhere outside the select box, then close all select boxes:\ndocument.addEventListener("click", closeAllSelect);'},4428:n=>{n.exports='function formToArray(formElements) {\n\n const ARRAY = {};\n\n for (let i = 0; i < formElements.length; i++) {\n\n var add = false;\n\n var input = formElements[i];\n\n if (input.type == \'checkbox\' || input.type == \'radio\') {\n if (input.checked == true) { var add = true; }\n } else {\n if (input.value != "") { var add = true;}\n }\n\n if (add) {\n\n var inputName = input.name;\n var inputValue = input.value;\n\n if (inputName.includes("[]")) {\n\n inputName = inputName.replace("[]", "");\n\n if (inputName in ARRAY) {\n inputName = inputName.replace("[]", "");\n ARRAY[inputName].push(inputValue);\n } else {\n inputName = inputName.replace("[]", "");\n ARRAY[inputName] = [];\n ARRAY[inputName].push(inputValue);\n }\n \n } else {\n\n if (inputName in ARRAY) {\n\n } else {\n ARRAY[inputName] = inputValue;\n }\n\n }\n\n }\n\n }\n\n return ARRAY;\n \n}\n\nfunction prettyFormResponse(data) {\n\n if (data != \'\') {\n \n console.log(\'ERRORE FORM: \'+data);\n\n var container = document.querySelector("#loading-spinner .center");\n container.classList.add("w-80");\n container.innerHTML = \'<div class="title-big a-c"><i class="bi bi-x-circle tx-danger"></i></div><div class="subtitle mt-8 a-c">C\\\'è stato un problema con l\\\'invio della tua richiesta</div><div class="c-w mt-10"><a onclick="location.reload();" class="btn btn-primary c-w">Riprova</a></div>\';\n\n } else {\n \n var container = document.querySelector("#loading-spinner .center");\n container.classList.add("w-80");\n container.innerHTML = \'<div class="title-big a-c"><i class="bi bi-check2-circle tx-success"></i></div><div class="subtitle mt-8 a-c">La tua richiesta è stata inviata con successo!</div><div class="c-w mt-10"><a onclick="location.reload(); " class="btn btn-primary c-w">Torna al sito</a></div>\';\n\n }\n \n}\n\nfunction sendForm(button, url, responseFunction = prettyFormResponse) {\n\n loadingSpinner();\n\n const VALUES = formToArray(button.form.elements);\n var form = JSON.stringify(VALUES);\n\n $.ajax({\n type: "POST",\n url: url,\n data: { \n post: \'true\',\n form: form\n }, \n success: function (data) {\n\n if (responseFunction != null) {\n if (typeof responseFunction === \'function\') {\n responseFunction(data);\n } else {\n loadingSpinner();\n }\n }\n\n },\n error: function (XMLHttpRequest) {\n ajaxRequestError(XMLHttpRequest);\n loadingSpinner();\n }\n });\n\n}\n\nfunction formUpload(form, url, responseFunction = prettyFormResponse) {\n\n loadingSpinner();\n \n var formData = new FormData(form);\n formData.append(\'post\', \'true\');\n \n $.ajax({\n type: "POST",\n url: url,\n data: formData,\n contentType: false,\n cache: false,\n processData:false, \n success: function (data) {\n\n if (responseFunction != null) {\n if (typeof responseFunction === \'function\') {\n responseFunction(data);\n } else {\n loadingSpinner();\n }\n }\n\n },\n error: function (XMLHttpRequest) {\n ajaxRequestError(XMLHttpRequest);\n loadingSpinner();\n }\n });\n\n}'},8516:n=>{n.exports='function menuMobile(hamburger = "#hamburger", navMobile = "#nav-mobile") { \n \n if (hamburger != null) { document.querySelector(hamburger).classList.toggle("click"); }\n if (navMobile != null) { document.querySelector(navMobile).classList.toggle("show"); }\n\n if (document.querySelector(hamburger).classList.contains("click")) {\n disableScroll();\n } else {\n enableScroll();\n }\n\n}'},148:n=>{n.exports="function modal(selector) {\n\n setUpModal(selector);\n\n var modal = document.querySelector(selector);\n\n modal.classList.toggle('wi-show');\n modal.classList.toggle('no-interaction');\n\n if (modal.classList.contains('wi-show')) {\n disableScroll();\n } else {\n enableScroll();\n }\n\n}\n\nfunction setUpModal(selector) {\n \n document.querySelectorAll(selector + ' .wi-close-modal').forEach(element => {\n if (element.onclick == null) {\n element.onclick = function() { modal(selector) };\n }\n });\n\n}"},225:n=>{n.exports="function setUpPage() {\n \n $.ajax({\n type: \"POST\",\n url: pathApp+'/api/alert.php',\n data: { \n post: 'true',\n frontend: 'true',\n alert: 801\n }, \n success: function (data) {\n NO_INTERNET_ALERT = data;\n }\n });\n\n var PAGE_URL = new URL(window.location.href);\n\n if (PAGE_URL.searchParams.get('scroll')) {\n \n var idScroll = PAGE_URL.searchParams.get('scroll');\n scrolla('#'+idScroll);\n\n }\n\n // L'alert non viene passato solo tramite GET ma anche tramite variabile php\n // if (PAGE_URL.searchParams.get('alert')) {\n // var alertCode = PAGE_URL.searchParams.get('alert'); alertToast(alertCode);\n // }\n\n setInput();\n setDropdown();\n setVideoJS();\n \n window.dispatchEvent(new Event('loaded'));\n \n};"},4642:n=>{n.exports=function(n){function e(n){"undefined"!=typeof console&&(console.error||console.log)("[Script Loader]",n)}try{"undefined"!=typeof execScript&&"undefined"!=typeof attachEvent&&"undefined"==typeof addEventListener?execScript(n):"undefined"!=typeof eval?eval.call(null,n):e("EvalError: No eval function available")}catch(n){e(n)}}},1120:(n,e,t)=>{t(4642)(t(6867))},2051:(n,e,t)=>{t(4642)(t(5068))},1809:(n,e,t)=>{t(4642)(t(7244))},7154:(n,e,t)=>{t(4642)(t(2787))},8865:(n,e,t)=>{t(4642)(t(7350))},1123:(n,e,t)=>{t(4642)(t(4428))},5329:(n,e,t)=>{t(4642)(t(8516))},871:(n,e,t)=>{t(4642)(t(148))},7186:(n,e,t)=>{t(4642)(t(225))}},e={};function t(a){var i=e[a];if(void 0!==i)return i.exports;var o=e[a]={exports:{}};return n[a](o,o.exports,t),o.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var a in e)t.o(e,a)&&!t.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:e[a]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),t.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var a={};(()=>{"use strict";t.r(a);t(2051),t(5329),t(1120),t(1809),t(871),t(7154),t(8865),t(1123),t(7186)})(),window.wonder=a})();
|
|
3
3
|
//# sourceMappingURL=body-end.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend/body-end.js","mappings":";sBAAAA,EAAOC,QAAU,ilDCAjBD,EAAOC,QAAU,kPCAjBD,EAAOC,QAAU,g0ECAjBD,EAAOC,QAAU,qyQCAjBD,EAAOC,QAAU,orHCAjBD,EAAOC,QAAU,8xHCAjBD,EAAOC,QAAU,ubCAjBD,EAAOC,QAAU,4kBCAjBD,EAAOC,QAAU,m5BCIjBD,EAAOC,QAAU,SAASC,GACzB,SAASC,EAAIC,GACQ,oBAAZC,UACJA,QAAQD,OAASC,QAAQF,KAAK,kBAAmBC,EACtD,CAOA,IAC2B,oBAAfE,YAJmB,oBAAhBC,aAA2D,oBAArBC,iBAKnDF,WAAWJ,GACe,oBAATO,KACjBA,KAAKC,KAAK,KAAMR,GAEhBC,EAAI,wCAEN,CAAE,MAAOC,GACRD,EAAIC,EACL,CACD,kBC1BA,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,sBCAjH,EAAQ,KAAR,CAAyG,EAAQ,sBCAjH,EAAQ,KAAR,CAAyG,EAAQ,QCC7GO,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAab,QAGrB,IAAID,EAASW,EAAyBE,GAAY,CAGjDZ,QAAS,CAAC,GAOX,OAHAe,EAAoBH,GAAUb,EAAQA,EAAOC,QAASW,GAG/CZ,EAAOC,OACf,CCrBAW,EAAoBK,EAAKjB,IACxB,IAAIkB,EAASlB,GAAUA,EAAOmB,WAC7B,IAAOnB,EAAiB,QACxB,IAAM,EAEP,OADAY,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACnB,EAASqB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEvB,EAASsB,IAC5EE,OAAOC,eAAezB,EAASsB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAetB,KAAKmB,EAAKC,GCClFlB,EAAoBqB,EAAKhC,IACH,oBAAXiC,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAezB,EAASiC,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAezB,EAAS,aAAc,CAAEmC,OAAO,GAAO","sources":["webpack://wonder/./src/build/frontend/js/alert.js","webpack://wonder/./src/build/frontend/js/aos.js","webpack://wonder/./src/build/frontend/js/dropdown.js","webpack://wonder/./src/build/frontend/js/form/place.js","webpack://wonder/./src/build/frontend/js/form/select.js","webpack://wonder/./src/build/frontend/js/form/send.js","webpack://wonder/./src/build/frontend/js/header.js","webpack://wonder/./src/build/frontend/js/modal.js","webpack://wonder/./src/build/frontend/js/pageSetUp.js","webpack://wonder/./node_modules/script-loader/addScript.js","webpack://wonder/./src/build/frontend/js/alert.js?37ef","webpack://wonder/./src/build/frontend/js/aos.js?68ca","webpack://wonder/./src/build/frontend/js/dropdown.js?51db","webpack://wonder/./src/build/frontend/js/form/place.js?6f16","webpack://wonder/./src/build/frontend/js/form/select.js?c3d3","webpack://wonder/./src/build/frontend/js/form/send.js?2a0e","webpack://wonder/./src/build/frontend/js/header.js?c891","webpack://wonder/./src/build/frontend/js/modal.js?9265","webpack://wonder/./src/build/frontend/js/pageSetUp.js?f423","webpack://wonder/webpack/bootstrap","webpack://wonder/webpack/runtime/compat get default export","webpack://wonder/webpack/runtime/define property getters","webpack://wonder/webpack/runtime/hasOwnProperty shorthand","webpack://wonder/webpack/runtime/make namespace object"],"sourcesContent":["module.exports = \"function alertContainer() {\\n\\n if (document.querySelector('.alert-container')) {\\n\\n var container = document.querySelector('.alert-container');\\n\\n } else {\\n\\n var container = document.createElement('div');\\n container.classList.add('alert-container');\\n container.classList.add('p-f');\\n container.classList.add('top');\\n container.classList.add('start');\\n container.classList.add('w-100');\\n container.classList.add('h-100');\\n container.classList.add('no-interaction');\\n container.style.zIndex = \\\"1000\\\";\\n\\n document.body.insertBefore(container, document.body.firstChild);\\n\\n }\\n\\n return container;\\n\\n}\\n\\nfunction alertToast(alert) {\\n\\n var container = alertContainer();\\n\\n if (alert == 801) {\\n\\n container.innerHTML += NO_INTERNET_ALERT;\\n\\n } else {\\n\\n $.ajax({\\n type: \\\"POST\\\",\\n url: pathApp+'/api/alert.php',\\n data: { \\n post: 'true',\\n frontend: 'true',\\n alert: alert\\n }, \\n success: function (data) {\\n\\n container.innerHTML += data;\\n \\n var url = new URL(window.location.href);\\n url.searchParams.delete('alert');\\n window.history.replaceState(null, null, url);\\n\\n }\\n });\\n\\n }\\n\\n setTimeout(() => {\\n document.querySelectorAll('.wi-alert.wi-show').forEach(element => {\\n element.classList.remove('wi-show');\\n });\\n }, 4000);\\n\\n}\"","module.exports = \"function setAos() {\\n\\n if (isMobile() && (typeof MOBILE_REMOVE_AOS == 'undefined' || MOBILE_REMOVE_AOS == true)) {\\n AOS.init({\\n disable: 'mobile'\\n });\\n } else {\\n AOS.init();\\n }\\n\\n}\"","module.exports = \"function toggleDropdown(container) {\\n\\n if (container.classList.contains('wi-show')) {\\n closeDropdown(container);\\n } else {\\n openDropdown(container);\\n }\\n \\n}\\n\\nfunction openDropdown(container) {\\n\\n container.classList.add('wi-show'); \\n\\n if (container.querySelector('i.bi-chevron-down')) {\\n container.querySelector('i.bi-chevron-down').classList.add('bi-chevron-up');\\n container.querySelector('i.bi-chevron-down').classList.remove('bi-chevron-down');\\n }\\n\\n if (container.querySelector('i.bi-plus')) {\\n container.querySelector('i.bi-plus').classList.add('bi-dash');\\n container.querySelector('i.bi-plus').classList.remove('bi-plus');\\n }\\n\\n if (container.querySelector('i.bi-plus-lg')) {\\n container.querySelector('i.bi-plus-lg').classList.add('bi-dash-lg');\\n container.querySelector('i.bi-plus-lg').classList.remove('bi-plus-lg');\\n }\\n \\n}\\n\\nfunction closeDropdown(container) {\\n\\n container.classList.remove('wi-show'); \\n\\n if (container.querySelector('i.bi-chevron-up')) {\\n container.querySelector('i.bi-chevron-up').classList.add('bi-chevron-down');\\n container.querySelector('i.bi-chevron-up').classList.remove('bi-chevron-up');\\n }\\n\\n if (container.querySelector('i.bi-dash')) {\\n container.querySelector('i.bi-dash').classList.add('bi-plus');\\n container.querySelector('i.bi-dash').classList.remove('bi-dash');\\n }\\n\\n if (container.querySelector('i.bi-dash-lg')) {\\n container.querySelector('i.bi-dash-lg').classList.add('bi-plus-lg');\\n container.querySelector('i.bi-dash-lg').classList.remove('bi-dash-lg');\\n }\\n \\n}\\n\\nfunction setDropdown() {\\n \\n document.querySelectorAll(\\\".wi-dropdown-btn .wi-switcher\\\").forEach(element => {\\n\\n element.onclick = function() { toggleDropdown(element.parentElement); };\\n \\n element.parentElement.onmouseleave = function() { closeDropdown(element.parentElement); };\\n \\n });\\n\\n document.querySelectorAll(\\\".wi-dropdown-box .wi-switcher\\\").forEach(element => {\\n\\n if (element.parentElement.classList.contains('wi-show')) {\\n openDropdown(element.parentElement);\\n }\\n\\n element.onclick = function() { toggleDropdown(element.parentElement); };\\n \\n });\\n\\n}\"","module.exports = \"/**\\n * \\n * GOOGLE MAPS API\\n * \\n */\\n\\nfunction placeNeedCheck(input) {\\n\\n inputError(input, 'Indirizzo non valido, è necessario selezionare un indirizzo dall\\\\'elenco!');\\n\\n}\\n\\nfunction checkInputPlace(input, autocomplete) {\\n \\n var inputContainer = input.parentElement;\\n\\n var country = inputContainer.querySelector('[data-wi-spi=\\\"country\\\"]');\\n var province = inputContainer.querySelector('[data-wi-spi=\\\"province\\\"]');\\n var cap = inputContainer.querySelector('[data-wi-spi=\\\"cap\\\"]');\\n var city = inputContainer.querySelector('[data-wi-spi=\\\"city\\\"]');\\n var street = inputContainer.querySelector('[data-wi-spi=\\\"street\\\"]');\\n var number = inputContainer.querySelector('[data-wi-spi=\\\"number\\\"]');\\n\\n country.value = \\\"\\\";\\n province.value = \\\"\\\";\\n cap.value = \\\"\\\";\\n city.value = \\\"\\\";\\n street.value = \\\"\\\";\\n number.value = \\\"\\\";\\n\\n removeInputError(input);\\n\\n if (autocomplete.getPlace()) {\\n\\n var place = autocomplete.getPlace();\\n\\n if (place.address_components) {\\n\\n for (const component of place.address_components) {\\n \\n const componentType = component.types;\\n\\n if (componentType.includes('street_number')) { number.value = component.long_name; }\\n if (componentType.includes('route')) { street.value = component.short_name; }\\n if (componentType.includes('administrative_area_level_3') || componentType.includes('postal_town')) { city.value = component.short_name; }\\n if (componentType.includes('postal_code') || componentType.includes('postal_code_prefix')) { cap.value = component.short_name; }\\n if (componentType.includes('administrative_area_level_2')) { province.value = component.short_name; }\\n if (componentType.includes('country')) { country.value = component.short_name; }\\n\\n }\\n\\n if (country.value == \\\"\\\" || province.value == \\\"\\\" || cap.value == \\\"\\\" || city.value == \\\"\\\" || street.value == \\\"\\\" || number.value == \\\"\\\") {\\n \\n var error = \\\"Indirizzo non valido\\\";\\n\\n if (country.value == \\\"\\\") {\\n error += \\\", manca il paese\\\";\\n } else if (province.value == \\\"\\\") {\\n error += \\\", manca la provincia\\\";\\n } else if (cap.value == \\\"\\\") {\\n error += \\\", manca il cap\\\";\\n } else if (city.value == \\\"\\\") {\\n error += \\\", manca la città\\\";\\n } else if (street.value == \\\"\\\") {\\n error += \\\", manca la via\\\";\\n } else if (number.value == \\\"\\\") {\\n error += \\\", manca il numero civico\\\";\\n }\\n\\n inputError(input, error);\\n \\n }\\n\\n } else {\\n\\n inputError(input, 'Indirizzo non valido');\\n\\n }\\n\\n } else {\\n\\n inputError(input, 'Indirizzo non valido');\\n\\n }\\n\\n check();\\n\\n}\\n\\nfunction setPlace(input, country = null, province = null, cap = null, city = null, street = null, number = null) {\\n\\n var inputContainer = input.parentElement;\\n\\n var countryInput = inputContainer.querySelector('[data-wi-spi=\\\"country\\\"]');\\n var provinceInput = inputContainer.querySelector('[data-wi-spi=\\\"province\\\"]');\\n var capInput = inputContainer.querySelector('[data-wi-spi=\\\"cap\\\"]');\\n var cityInput = inputContainer.querySelector('[data-wi-spi=\\\"city\\\"]');\\n var streetInput = inputContainer.querySelector('[data-wi-spi=\\\"street\\\"]');\\n var numberInput = inputContainer.querySelector('[data-wi-spi=\\\"number\\\"]');\\n\\n if (country == null) {\\n\\n country = countryInput.value;\\n province = provinceInput.value;\\n cap = capInput.value;\\n city = cityInput.value;\\n street = streetInput.value;\\n number = numberInput.value;\\n\\n } else {\\n\\n countryInput.value = country;\\n provinceInput.value = province;\\n capInput.value = cap;\\n cityInput.value = city;\\n streetInput.value = street;\\n numberInput.value = number;\\n \\n }\\n\\n if (country != \\\"\\\" || province != \\\"\\\" || cap != \\\"\\\" || city != \\\"\\\" || street != \\\"\\\" || number != \\\"\\\") {\\n \\n var address = street+', '+number+', '+city+', '+province+', '+country;\\n input.value = address;\\n\\n checkLabel();\\n check();\\n\\n }\\n\\n}\\n\\nfunction setGoogleMapsPlace() {\\n\\n document.querySelectorAll(\\\"[data-wi-search-place='true']\\\").forEach(input => {\\n\\n input.disabled = false;\\n \\n var options = {};\\n\\n if (input.dataset.wiRestriction != '[]') { \\n\\n var restrictions = JSON.parse(input.dataset.wiRestriction);\\n options.componentRestrictions = restrictions; \\n \\n }\\n\\n options.fields = [ \\\"address_components\\\" ];\\n options.types = [ \\\"address\\\" ];\\n \\n var googlePlace = new google.maps.places.Autocomplete(input, options);\\n\\n input.addEventListener(\\\"change\\\", () => { placeNeedCheck(input); });\\n googlePlace.addListener(\\\"place_changed\\\", () => { checkInputPlace(input, googlePlace); });\\n\\n });\\n\\n}\\n\\nfunction setGoogleMapsApi() {\\n\\n if (document.querySelector(\\\"[data-wi-search-place]\\\")) {\\n\\n var GOOGLE_API_KEY = \\\"AIzaSyAhBslKzmgy6pRrLGyhlN34pN1yQYE1hvI\\\";\\n\\n /**\\n * \\n * Se ci sono degli input Place chiama le API di Google Place\\n * Documentazione: https://developers.google.com/maps/documentation/javascript/place-autocomplete?hl=it\\n * \\n */\\n\\n var script = document.createElement('script');\\n script.type = 'text/javascript';\\n script.async = true;\\n script.src = 'https://maps.googleapis.com/maps/api/js?key='+GOOGLE_API_KEY+'&loading=async&libraries=places&callback=setGoogleMapsPlace'; \\n\\n document.head.appendChild(script);\\n \\n }\\n\\n}\\n\\n/**\\n * \\n * inputCountry() - inputStates()\\n * \\n */\\n\\nfunction setInputCountry() {\\n\\n document.querySelectorAll(\\\"[data-wi-input-country='true']\\\").forEach(element => {\\n element.addEventListener(\\\"change\\\", searchStates);\\n element.addEventListener(\\\"focusout\\\", searchStates);\\n });\\n\\n}\\n\\nfunction setCountryState(input, country, state) {\\n\\n textListValue(input, country);\\n searchStates(input, state);\\n \\n}\\n\\nfunction searchStates(event, stateValue = null) {\\n\\n if (typeof event.target !== \\\"undefined\\\") {\\n var inputCountry = event.target;\\n } else {\\n var inputCountry = event;\\n }\\n \\n var form = inputCountry.form;\\n var inputCountryName = inputCountry.dataset.wiName.replace('-text', '');\\n var inputStateName = inputCountry.dataset.wiInputState;\\n\\n var inputState = form.querySelector('input[data-wi-name=\\\"'+inputStateName+'-text\\\"]');\\n\\n inputState.disabled = true;\\n inputState.value = \\\"\\\";\\n\\n delay(100).then(() => {\\n\\n if (form.querySelector('input[name=\\\"'+inputCountryName+'\\\"]:checked') != null) {\\n\\n var country = form.querySelector('input[name=\\\"'+inputCountryName+'\\\"]:checked').value;\\n \\n if (inputState.dataset.wiListStates != country) {\\n \\n inputState.dataset.wiListStates = country;\\n\\n loadingSpinner();\\n\\n $.ajax({\\n type: \\\"POST\\\",\\n url: pathApp+'/api/states.php',\\n data: { \\n post: 'true',\\n country: country\\n }, \\n success: function (data) {\\n\\n const response = JSON.parse(data);\\n\\n textListOptions( inputState, response );\\n\\n inputState.disabled = false;\\n\\n if (stateValue != null && stateValue != \\\"\\\") { textListValue(inputState, stateValue); }\\n\\n loadingSpinner();\\n\\n },\\n error: function (XMLHttpRequest) {\\n\\n ajaxRequestError(XMLHttpRequest);\\n loadingSpinner();\\n\\n }\\n });\\n\\n } else {\\n\\n inputState.disabled = false;\\n \\n }\\n\\n }\\n\\n });\\n\\n}\"","module.exports = \"var x, i, j, l, ll, selElmnt, a, b, c;\\n\\n// Look for any elements with the class \\\"custom-select\\\":\\nx = document.querySelectorAll(\\\"[data-wi-select='true']\\\");\\nl = x.length;\\n\\nfor (i = 0; i < l; i++) {\\n\\n selElmnt = x[i].getElementsByTagName(\\\"select\\\")[0];\\n ll = selElmnt.length;\\n\\n // For each element, create a new DIV that will act as the selected item:\\n a = document.createElement(\\\"DIV\\\");\\n a.setAttribute(\\\"class\\\", \\\"select-selected wi-input\\\");\\n a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;\\n x[i].appendChild(a);\\n\\n // For each element, create a new DIV that will contain the option list:\\n b = document.createElement(\\\"DIV\\\");\\n b.setAttribute(\\\"class\\\", \\\"select-items wi-input-list no-scrollbar\\\");\\n\\n for (j = 0; j < ll; j++) {\\n\\n // For each option in the original select element, create a new DIV that will act as an option item:\\n c = document.createElement(\\\"DIV\\\");\\n c.id = selElmnt.options[j].value;\\n c.setAttribute(\\\"class\\\", \\\"wi-input-list-value\\\");\\n c.innerHTML = selElmnt.options[j].innerHTML;\\n\\n // Se è impostato un valore di default selezionalo\\n if (selElmnt.value != undefined) { if (c.id == selElmnt.value) { c.classList.add(\\\"same-as-selected\\\"); } }\\n\\n c.addEventListener(\\\"click\\\", function(e) {\\n\\n // When an item is clicked, update the original select box, and the selected item:\\n var y, i, k, s, h, sl, yl;\\n s = this.parentNode.parentNode.getElementsByTagName(\\\"select\\\")[0];\\n sl = s.length;\\n selElmnt.value = this.id;\\n h = this.parentNode.previousSibling;\\n\\n for (i = 0; i < sl; i++) {\\n if (s.options[i].innerHTML == this.innerHTML) {\\n s.selectedIndex = i;\\n h.innerHTML = this.innerHTML;\\n y = this.parentNode.getElementsByClassName(\\\"same-as-selected\\\");\\n yl = y.length;\\n for (k = 0; k < yl; k++) {\\n y[k].classList.remove(\\\"same-as-selected\\\");\\n }\\n this.setAttribute(\\\"class\\\", \\\"wi-input-list-value same-as-selected\\\");\\n break;\\n }\\n }\\n\\n h.click();\\n\\n });\\n\\n // Passa le funzioni onchange dal select alle nuove opzioni\\n c.onclick = selElmnt.onchange;\\n c.mousedown = selElmnt.onchange;\\n\\n b.appendChild(c);\\n\\n }\\n\\n x[i].appendChild(b);\\n\\n a.addEventListener(\\\"click\\\", function(e) {\\n\\n // When the select box is clicked, close any other select boxes, and open/close the current select box\\n e.stopPropagation();\\n closeAllSelect(this);\\n this.classList.toggle(\\\"select-arrow-active\\\");\\n this.parentNode.classList.toggle(\\\"wi-list-active\\\");\\n check();\\n\\n });\\n\\n}\\n\\nfunction closeAllSelect(elmnt) {\\n\\n // A function that will close all select boxes in the document, except the current select box:\\n var x, y, i, xl, yl, arrNo = [];\\n x = document.getElementsByClassName(\\\"select-items\\\");\\n y = document.getElementsByClassName(\\\"select-selected\\\");\\n var container = document.querySelector(\\\".wi-input-container.wi-list-active\\\");\\n xl = x.length;\\n yl = y.length;\\n\\n for (i = 0; i < yl; i++) {\\n if (elmnt == y[i]) {\\n arrNo.push(i)\\n }else{\\n y[i].classList.remove(\\\"select-arrow-active\\\");\\n }\\n }\\n\\n if (container != null) {\\n container.classList.remove(\\\"wi-list-active\\\");\\n }\\n\\n}\\n\\n// If the user clicks anywhere outside the select box, then close all select boxes:\\ndocument.addEventListener(\\\"click\\\", closeAllSelect);\"","module.exports = \"function formToArray(formElements) {\\n\\n const ARRAY = {};\\n\\n for (let i = 0; i < formElements.length; i++) {\\n\\n var add = false;\\n\\n var input = formElements[i];\\n\\n if (input.type == 'checkbox' || input.type == 'radio') {\\n if (input.checked == true) { var add = true; }\\n } else {\\n if (input.value != \\\"\\\") { var add = true;}\\n }\\n\\n if (add) {\\n\\n var inputName = input.name;\\n var inputValue = input.value;\\n\\n if (inputName.includes(\\\"[]\\\")) {\\n\\n inputName = inputName.replace(\\\"[]\\\", \\\"\\\");\\n\\n if (inputName in ARRAY) {\\n inputName = inputName.replace(\\\"[]\\\", \\\"\\\");\\n ARRAY[inputName].push(inputValue);\\n } else {\\n inputName = inputName.replace(\\\"[]\\\", \\\"\\\");\\n ARRAY[inputName] = [];\\n ARRAY[inputName].push(inputValue);\\n }\\n \\n } else {\\n\\n if (inputName in ARRAY) {\\n\\n } else {\\n ARRAY[inputName] = inputValue;\\n }\\n\\n }\\n\\n }\\n\\n }\\n\\n return ARRAY;\\n \\n}\\n\\nfunction prettyFormResponse(data) {\\n\\n if (data != '') {\\n \\n console.log('ERRORE FORM: '+data);\\n\\n var container = document.querySelector(\\\"#loading-spinner .center\\\");\\n container.classList.add(\\\"w-80\\\");\\n container.innerHTML = '<div class=\\\"title-big a-c\\\"><i class=\\\"bi bi-x-circle tx-danger\\\"></i></div><div class=\\\"subtitle mt-8 a-c\\\">C\\\\'è stato un problema con l\\\\'invio della tua richiesta</div><div class=\\\"c-w mt-10\\\"><a onclick=\\\"location.reload();\\\" class=\\\"btn btn-primary c-w\\\">Riprova</a></div>';\\n\\n } else {\\n \\n var container = document.querySelector(\\\"#loading-spinner .center\\\");\\n container.classList.add(\\\"w-80\\\");\\n container.innerHTML = '<div class=\\\"title-big a-c\\\"><i class=\\\"bi bi-check2-circle tx-success\\\"></i></div><div class=\\\"subtitle mt-8 a-c\\\">La tua richiesta è stata inviata con successo!</div><div class=\\\"c-w mt-10\\\"><a onclick=\\\"location.reload(); \\\" class=\\\"btn btn-primary c-w\\\">Torna al sito</a></div>';\\n\\n }\\n \\n}\\n\\nfunction sendForm(button, url, responseFunction = prettyFormResponse) {\\n\\n loadingSpinner();\\n\\n const VALUES = formToArray(button.form.elements);\\n var form = JSON.stringify(VALUES);\\n\\n $.ajax({\\n type: \\\"POST\\\",\\n url: url,\\n data: { \\n post: 'true',\\n form: form\\n }, \\n success: function (data) {\\n\\n if (responseFunction != null) {\\n if (typeof responseFunction === 'function') {\\n responseFunction(data);\\n } else {\\n loadingSpinner();\\n }\\n }\\n\\n },\\n error: function (XMLHttpRequest) {\\n ajaxRequestError(XMLHttpRequest);\\n loadingSpinner();\\n }\\n });\\n\\n}\\n\\nfunction formUpload(form, url, responseFunction = prettyFormResponse) {\\n\\n loadingSpinner();\\n \\n var formData = new FormData(form);\\n formData.append('post', 'true');\\n \\n $.ajax({\\n type: \\\"POST\\\",\\n url: url,\\n data: formData,\\n contentType: false,\\n cache: false,\\n processData:false, \\n success: function (data) {\\n\\n if (responseFunction != null) {\\n if (typeof responseFunction === 'function') {\\n responseFunction(data);\\n } else {\\n loadingSpinner();\\n }\\n }\\n\\n },\\n error: function (XMLHttpRequest) {\\n ajaxRequestError(XMLHttpRequest);\\n loadingSpinner();\\n }\\n });\\n\\n}\"","module.exports = \"function menuMobile(hamburger = \\\"#hamburger\\\", navMobile = \\\"#nav-mobile\\\") { \\n \\n if (hamburger != null) { document.querySelector(hamburger).classList.toggle(\\\"click\\\"); }\\n if (navMobile != null) { document.querySelector(navMobile).classList.toggle(\\\"show\\\"); }\\n\\n if (document.querySelector(hamburger).classList.contains(\\\"click\\\")) {\\n disableScroll();\\n } else {\\n enableScroll();\\n }\\n\\n}\"","module.exports = \"function modal(selector) {\\n\\n setUpModal(selector);\\n\\n var modal = document.querySelector(selector);\\n\\n modal.classList.toggle('wi-show');\\n modal.classList.toggle('no-interaction');\\n\\n if (modal.classList.contains('wi-show')) {\\n disableScroll();\\n } else {\\n enableScroll();\\n }\\n\\n}\\n\\nfunction setUpModal(selector) {\\n \\n document.querySelectorAll(selector + ' .wi-close-modal').forEach(element => {\\n if (element.onclick == null) {\\n element.onclick = function() { modal(selector) };\\n }\\n });\\n\\n}\"","module.exports = \"function setUpPage() {\\n \\n $.ajax({\\n type: \\\"POST\\\",\\n url: pathApp+'/api/alert.php',\\n data: { \\n post: 'true',\\n frontend: 'true',\\n alert: 801\\n }, \\n success: function (data) {\\n NO_INTERNET_ALERT = data;\\n }\\n });\\n\\n var PAGE_URL = new URL(window.location.href);\\n\\n if (PAGE_URL.searchParams.get('scroll')) {\\n \\n var idScroll = PAGE_URL.searchParams.get('scroll');\\n scrolla('#'+idScroll);\\n\\n }\\n\\n // L'alert non viene passato solo tramite GET ma anche tramite variabile php\\n // if (PAGE_URL.searchParams.get('alert')) {\\n // var alertCode = PAGE_URL.searchParams.get('alert'); alertToast(alertCode);\\n // }\\n\\n setAos();\\n setInput();\\n setDropdown();\\n setVideoJS();\\n \\n window.dispatchEvent(new Event('loaded'));\\n \\n};\"","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\nmodule.exports = function(src) {\n\tfunction log(error) {\n\t\t(typeof console !== \"undefined\")\n\t\t&& (console.error || console.log)(\"[Script Loader]\", error);\n\t}\n\n\t// Check for IE =< 8\n\tfunction isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}\n\n\ttry {\n\t\tif (typeof execScript !== \"undefined\" && isIE()) {\n\t\t\texecScript(src);\n\t\t} else if (typeof eval !== \"undefined\") {\n\t\t\teval.call(null, src);\n\t\t} else {\n\t\t\tlog(\"EvalError: No eval function available\");\n\t\t}\n\t} catch (error) {\n\t\tlog(error);\n\t}\n}\n","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/alert.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/aos.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/dropdown.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/form/place.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/form/select.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/form/send.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/header.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/modal.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/pageSetUp.js\"))","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["module","exports","src","log","error","console","execScript","attachEvent","addEventListener","eval","call","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"frontend/body-end.js","mappings":";sBAAAA,EAAOC,QAAU,ilDCAjBD,EAAOC,QAAU,kPCAjBD,EAAOC,QAAU,g0ECAjBD,EAAOC,QAAU,qyQCAjBD,EAAOC,QAAU,orHCAjBD,EAAOC,QAAU,8xHCAjBD,EAAOC,QAAU,ubCAjBD,EAAOC,QAAU,4kBCAjBD,EAAOC,QAAU,o4BCIjBD,EAAOC,QAAU,SAASC,GACzB,SAASC,EAAIC,GACQ,oBAAZC,UACJA,QAAQD,OAASC,QAAQF,KAAK,kBAAmBC,EACtD,CAOA,IAC2B,oBAAfE,YAJmB,oBAAhBC,aAA2D,oBAArBC,iBAKnDF,WAAWJ,GACe,oBAATO,KACjBA,KAAKC,KAAK,KAAMR,GAEhBC,EAAI,wCAEN,CAAE,MAAOC,GACRD,EAAIC,EACL,CACD,kBC1BA,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,uBCAjH,EAAQ,KAAR,CAAyG,EAAQ,sBCAjH,EAAQ,KAAR,CAAyG,EAAQ,sBCAjH,EAAQ,KAAR,CAAyG,EAAQ,QCC7GO,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAab,QAGrB,IAAID,EAASW,EAAyBE,GAAY,CAGjDZ,QAAS,CAAC,GAOX,OAHAe,EAAoBH,GAAUb,EAAQA,EAAOC,QAASW,GAG/CZ,EAAOC,OACf,CCrBAW,EAAoBK,EAAKjB,IACxB,IAAIkB,EAASlB,GAAUA,EAAOmB,WAC7B,IAAOnB,EAAiB,QACxB,IAAM,EAEP,OADAY,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACnB,EAASqB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEvB,EAASsB,IAC5EE,OAAOC,eAAezB,EAASsB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAetB,KAAKmB,EAAKC,GCClFlB,EAAoBqB,EAAKhC,IACH,oBAAXiC,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAezB,EAASiC,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAezB,EAAS,aAAc,CAAEmC,OAAO,GAAO","sources":["webpack://wonder/./src/build/frontend/js/alert.js","webpack://wonder/./src/build/frontend/js/aos.js","webpack://wonder/./src/build/frontend/js/dropdown.js","webpack://wonder/./src/build/frontend/js/form/place.js","webpack://wonder/./src/build/frontend/js/form/select.js","webpack://wonder/./src/build/frontend/js/form/send.js","webpack://wonder/./src/build/frontend/js/header.js","webpack://wonder/./src/build/frontend/js/modal.js","webpack://wonder/./src/build/frontend/js/pageSetUp.js","webpack://wonder/./node_modules/script-loader/addScript.js","webpack://wonder/./src/build/frontend/js/alert.js?37ef","webpack://wonder/./src/build/frontend/js/aos.js?68ca","webpack://wonder/./src/build/frontend/js/dropdown.js?51db","webpack://wonder/./src/build/frontend/js/form/place.js?6f16","webpack://wonder/./src/build/frontend/js/form/select.js?c3d3","webpack://wonder/./src/build/frontend/js/form/send.js?2a0e","webpack://wonder/./src/build/frontend/js/header.js?c891","webpack://wonder/./src/build/frontend/js/modal.js?9265","webpack://wonder/./src/build/frontend/js/pageSetUp.js?f423","webpack://wonder/webpack/bootstrap","webpack://wonder/webpack/runtime/compat get default export","webpack://wonder/webpack/runtime/define property getters","webpack://wonder/webpack/runtime/hasOwnProperty shorthand","webpack://wonder/webpack/runtime/make namespace object"],"sourcesContent":["module.exports = \"function alertContainer() {\\n\\n if (document.querySelector('.alert-container')) {\\n\\n var container = document.querySelector('.alert-container');\\n\\n } else {\\n\\n var container = document.createElement('div');\\n container.classList.add('alert-container');\\n container.classList.add('p-f');\\n container.classList.add('top');\\n container.classList.add('start');\\n container.classList.add('w-100');\\n container.classList.add('h-100');\\n container.classList.add('no-interaction');\\n container.style.zIndex = \\\"1000\\\";\\n\\n document.body.insertBefore(container, document.body.firstChild);\\n\\n }\\n\\n return container;\\n\\n}\\n\\nfunction alertToast(alert) {\\n\\n var container = alertContainer();\\n\\n if (alert == 801) {\\n\\n container.innerHTML += NO_INTERNET_ALERT;\\n\\n } else {\\n\\n $.ajax({\\n type: \\\"POST\\\",\\n url: pathApp+'/api/alert.php',\\n data: { \\n post: 'true',\\n frontend: 'true',\\n alert: alert\\n }, \\n success: function (data) {\\n\\n container.innerHTML += data;\\n \\n var url = new URL(window.location.href);\\n url.searchParams.delete('alert');\\n window.history.replaceState(null, null, url);\\n\\n }\\n });\\n\\n }\\n\\n setTimeout(() => {\\n document.querySelectorAll('.wi-alert.wi-show').forEach(element => {\\n element.classList.remove('wi-show');\\n });\\n }, 4000);\\n\\n}\"","module.exports = \"function setAos() {\\n\\n if (isMobile() && (typeof MOBILE_REMOVE_AOS == 'undefined' || MOBILE_REMOVE_AOS == true)) {\\n AOS.init({\\n disable: 'mobile'\\n });\\n } else {\\n AOS.init();\\n }\\n\\n}\"","module.exports = \"function toggleDropdown(container) {\\n\\n if (container.classList.contains('wi-show')) {\\n closeDropdown(container);\\n } else {\\n openDropdown(container);\\n }\\n \\n}\\n\\nfunction openDropdown(container) {\\n\\n container.classList.add('wi-show'); \\n\\n if (container.querySelector('i.bi-chevron-down')) {\\n container.querySelector('i.bi-chevron-down').classList.add('bi-chevron-up');\\n container.querySelector('i.bi-chevron-down').classList.remove('bi-chevron-down');\\n }\\n\\n if (container.querySelector('i.bi-plus')) {\\n container.querySelector('i.bi-plus').classList.add('bi-dash');\\n container.querySelector('i.bi-plus').classList.remove('bi-plus');\\n }\\n\\n if (container.querySelector('i.bi-plus-lg')) {\\n container.querySelector('i.bi-plus-lg').classList.add('bi-dash-lg');\\n container.querySelector('i.bi-plus-lg').classList.remove('bi-plus-lg');\\n }\\n \\n}\\n\\nfunction closeDropdown(container) {\\n\\n container.classList.remove('wi-show'); \\n\\n if (container.querySelector('i.bi-chevron-up')) {\\n container.querySelector('i.bi-chevron-up').classList.add('bi-chevron-down');\\n container.querySelector('i.bi-chevron-up').classList.remove('bi-chevron-up');\\n }\\n\\n if (container.querySelector('i.bi-dash')) {\\n container.querySelector('i.bi-dash').classList.add('bi-plus');\\n container.querySelector('i.bi-dash').classList.remove('bi-dash');\\n }\\n\\n if (container.querySelector('i.bi-dash-lg')) {\\n container.querySelector('i.bi-dash-lg').classList.add('bi-plus-lg');\\n container.querySelector('i.bi-dash-lg').classList.remove('bi-dash-lg');\\n }\\n \\n}\\n\\nfunction setDropdown() {\\n \\n document.querySelectorAll(\\\".wi-dropdown-btn .wi-switcher\\\").forEach(element => {\\n\\n element.onclick = function() { toggleDropdown(element.parentElement); };\\n \\n element.parentElement.onmouseleave = function() { closeDropdown(element.parentElement); };\\n \\n });\\n\\n document.querySelectorAll(\\\".wi-dropdown-box .wi-switcher\\\").forEach(element => {\\n\\n if (element.parentElement.classList.contains('wi-show')) {\\n openDropdown(element.parentElement);\\n }\\n\\n element.onclick = function() { toggleDropdown(element.parentElement); };\\n \\n });\\n\\n}\"","module.exports = \"/**\\n * \\n * GOOGLE MAPS API\\n * \\n */\\n\\nfunction placeNeedCheck(input) {\\n\\n inputError(input, 'Indirizzo non valido, è necessario selezionare un indirizzo dall\\\\'elenco!');\\n\\n}\\n\\nfunction checkInputPlace(input, autocomplete) {\\n \\n var inputContainer = input.parentElement;\\n\\n var country = inputContainer.querySelector('[data-wi-spi=\\\"country\\\"]');\\n var province = inputContainer.querySelector('[data-wi-spi=\\\"province\\\"]');\\n var cap = inputContainer.querySelector('[data-wi-spi=\\\"cap\\\"]');\\n var city = inputContainer.querySelector('[data-wi-spi=\\\"city\\\"]');\\n var street = inputContainer.querySelector('[data-wi-spi=\\\"street\\\"]');\\n var number = inputContainer.querySelector('[data-wi-spi=\\\"number\\\"]');\\n\\n country.value = \\\"\\\";\\n province.value = \\\"\\\";\\n cap.value = \\\"\\\";\\n city.value = \\\"\\\";\\n street.value = \\\"\\\";\\n number.value = \\\"\\\";\\n\\n removeInputError(input);\\n\\n if (autocomplete.getPlace()) {\\n\\n var place = autocomplete.getPlace();\\n\\n if (place.address_components) {\\n\\n for (const component of place.address_components) {\\n \\n const componentType = component.types;\\n\\n if (componentType.includes('street_number')) { number.value = component.long_name; }\\n if (componentType.includes('route')) { street.value = component.short_name; }\\n if (componentType.includes('administrative_area_level_3') || componentType.includes('postal_town')) { city.value = component.short_name; }\\n if (componentType.includes('postal_code') || componentType.includes('postal_code_prefix')) { cap.value = component.short_name; }\\n if (componentType.includes('administrative_area_level_2')) { province.value = component.short_name; }\\n if (componentType.includes('country')) { country.value = component.short_name; }\\n\\n }\\n\\n if (country.value == \\\"\\\" || province.value == \\\"\\\" || cap.value == \\\"\\\" || city.value == \\\"\\\" || street.value == \\\"\\\" || number.value == \\\"\\\") {\\n \\n var error = \\\"Indirizzo non valido\\\";\\n\\n if (country.value == \\\"\\\") {\\n error += \\\", manca il paese\\\";\\n } else if (province.value == \\\"\\\") {\\n error += \\\", manca la provincia\\\";\\n } else if (cap.value == \\\"\\\") {\\n error += \\\", manca il cap\\\";\\n } else if (city.value == \\\"\\\") {\\n error += \\\", manca la città\\\";\\n } else if (street.value == \\\"\\\") {\\n error += \\\", manca la via\\\";\\n } else if (number.value == \\\"\\\") {\\n error += \\\", manca il numero civico\\\";\\n }\\n\\n inputError(input, error);\\n \\n }\\n\\n } else {\\n\\n inputError(input, 'Indirizzo non valido');\\n\\n }\\n\\n } else {\\n\\n inputError(input, 'Indirizzo non valido');\\n\\n }\\n\\n check();\\n\\n}\\n\\nfunction setPlace(input, country = null, province = null, cap = null, city = null, street = null, number = null) {\\n\\n var inputContainer = input.parentElement;\\n\\n var countryInput = inputContainer.querySelector('[data-wi-spi=\\\"country\\\"]');\\n var provinceInput = inputContainer.querySelector('[data-wi-spi=\\\"province\\\"]');\\n var capInput = inputContainer.querySelector('[data-wi-spi=\\\"cap\\\"]');\\n var cityInput = inputContainer.querySelector('[data-wi-spi=\\\"city\\\"]');\\n var streetInput = inputContainer.querySelector('[data-wi-spi=\\\"street\\\"]');\\n var numberInput = inputContainer.querySelector('[data-wi-spi=\\\"number\\\"]');\\n\\n if (country == null) {\\n\\n country = countryInput.value;\\n province = provinceInput.value;\\n cap = capInput.value;\\n city = cityInput.value;\\n street = streetInput.value;\\n number = numberInput.value;\\n\\n } else {\\n\\n countryInput.value = country;\\n provinceInput.value = province;\\n capInput.value = cap;\\n cityInput.value = city;\\n streetInput.value = street;\\n numberInput.value = number;\\n \\n }\\n\\n if (country != \\\"\\\" || province != \\\"\\\" || cap != \\\"\\\" || city != \\\"\\\" || street != \\\"\\\" || number != \\\"\\\") {\\n \\n var address = street+', '+number+', '+city+', '+province+', '+country;\\n input.value = address;\\n\\n checkLabel();\\n check();\\n\\n }\\n\\n}\\n\\nfunction setGoogleMapsPlace() {\\n\\n document.querySelectorAll(\\\"[data-wi-search-place='true']\\\").forEach(input => {\\n\\n input.disabled = false;\\n \\n var options = {};\\n\\n if (input.dataset.wiRestriction != '[]') { \\n\\n var restrictions = JSON.parse(input.dataset.wiRestriction);\\n options.componentRestrictions = restrictions; \\n \\n }\\n\\n options.fields = [ \\\"address_components\\\" ];\\n options.types = [ \\\"address\\\" ];\\n \\n var googlePlace = new google.maps.places.Autocomplete(input, options);\\n\\n input.addEventListener(\\\"change\\\", () => { placeNeedCheck(input); });\\n googlePlace.addListener(\\\"place_changed\\\", () => { checkInputPlace(input, googlePlace); });\\n\\n });\\n\\n}\\n\\nfunction setGoogleMapsApi() {\\n\\n if (document.querySelector(\\\"[data-wi-search-place]\\\")) {\\n\\n var GOOGLE_API_KEY = \\\"AIzaSyAhBslKzmgy6pRrLGyhlN34pN1yQYE1hvI\\\";\\n\\n /**\\n * \\n * Se ci sono degli input Place chiama le API di Google Place\\n * Documentazione: https://developers.google.com/maps/documentation/javascript/place-autocomplete?hl=it\\n * \\n */\\n\\n var script = document.createElement('script');\\n script.type = 'text/javascript';\\n script.async = true;\\n script.src = 'https://maps.googleapis.com/maps/api/js?key='+GOOGLE_API_KEY+'&loading=async&libraries=places&callback=setGoogleMapsPlace'; \\n\\n document.head.appendChild(script);\\n \\n }\\n\\n}\\n\\n/**\\n * \\n * inputCountry() - inputStates()\\n * \\n */\\n\\nfunction setInputCountry() {\\n\\n document.querySelectorAll(\\\"[data-wi-input-country='true']\\\").forEach(element => {\\n element.addEventListener(\\\"change\\\", searchStates);\\n element.addEventListener(\\\"focusout\\\", searchStates);\\n });\\n\\n}\\n\\nfunction setCountryState(input, country, state) {\\n\\n textListValue(input, country);\\n searchStates(input, state);\\n \\n}\\n\\nfunction searchStates(event, stateValue = null) {\\n\\n if (typeof event.target !== \\\"undefined\\\") {\\n var inputCountry = event.target;\\n } else {\\n var inputCountry = event;\\n }\\n \\n var form = inputCountry.form;\\n var inputCountryName = inputCountry.dataset.wiName.replace('-text', '');\\n var inputStateName = inputCountry.dataset.wiInputState;\\n\\n var inputState = form.querySelector('input[data-wi-name=\\\"'+inputStateName+'-text\\\"]');\\n\\n inputState.disabled = true;\\n inputState.value = \\\"\\\";\\n\\n delay(100).then(() => {\\n\\n if (form.querySelector('input[name=\\\"'+inputCountryName+'\\\"]:checked') != null) {\\n\\n var country = form.querySelector('input[name=\\\"'+inputCountryName+'\\\"]:checked').value;\\n \\n if (inputState.dataset.wiListStates != country) {\\n \\n inputState.dataset.wiListStates = country;\\n\\n loadingSpinner();\\n\\n $.ajax({\\n type: \\\"POST\\\",\\n url: pathApp+'/api/states.php',\\n data: { \\n post: 'true',\\n country: country\\n }, \\n success: function (data) {\\n\\n const response = JSON.parse(data);\\n\\n textListOptions( inputState, response );\\n\\n inputState.disabled = false;\\n\\n if (stateValue != null && stateValue != \\\"\\\") { textListValue(inputState, stateValue); }\\n\\n loadingSpinner();\\n\\n },\\n error: function (XMLHttpRequest) {\\n\\n ajaxRequestError(XMLHttpRequest);\\n loadingSpinner();\\n\\n }\\n });\\n\\n } else {\\n\\n inputState.disabled = false;\\n \\n }\\n\\n }\\n\\n });\\n\\n}\"","module.exports = \"var x, i, j, l, ll, selElmnt, a, b, c;\\n\\n// Look for any elements with the class \\\"custom-select\\\":\\nx = document.querySelectorAll(\\\"[data-wi-select='true']\\\");\\nl = x.length;\\n\\nfor (i = 0; i < l; i++) {\\n\\n selElmnt = x[i].getElementsByTagName(\\\"select\\\")[0];\\n ll = selElmnt.length;\\n\\n // For each element, create a new DIV that will act as the selected item:\\n a = document.createElement(\\\"DIV\\\");\\n a.setAttribute(\\\"class\\\", \\\"select-selected wi-input\\\");\\n a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;\\n x[i].appendChild(a);\\n\\n // For each element, create a new DIV that will contain the option list:\\n b = document.createElement(\\\"DIV\\\");\\n b.setAttribute(\\\"class\\\", \\\"select-items wi-input-list no-scrollbar\\\");\\n\\n for (j = 0; j < ll; j++) {\\n\\n // For each option in the original select element, create a new DIV that will act as an option item:\\n c = document.createElement(\\\"DIV\\\");\\n c.id = selElmnt.options[j].value;\\n c.setAttribute(\\\"class\\\", \\\"wi-input-list-value\\\");\\n c.innerHTML = selElmnt.options[j].innerHTML;\\n\\n // Se è impostato un valore di default selezionalo\\n if (selElmnt.value != undefined) { if (c.id == selElmnt.value) { c.classList.add(\\\"same-as-selected\\\"); } }\\n\\n c.addEventListener(\\\"click\\\", function(e) {\\n\\n // When an item is clicked, update the original select box, and the selected item:\\n var y, i, k, s, h, sl, yl;\\n s = this.parentNode.parentNode.getElementsByTagName(\\\"select\\\")[0];\\n sl = s.length;\\n selElmnt.value = this.id;\\n h = this.parentNode.previousSibling;\\n\\n for (i = 0; i < sl; i++) {\\n if (s.options[i].innerHTML == this.innerHTML) {\\n s.selectedIndex = i;\\n h.innerHTML = this.innerHTML;\\n y = this.parentNode.getElementsByClassName(\\\"same-as-selected\\\");\\n yl = y.length;\\n for (k = 0; k < yl; k++) {\\n y[k].classList.remove(\\\"same-as-selected\\\");\\n }\\n this.setAttribute(\\\"class\\\", \\\"wi-input-list-value same-as-selected\\\");\\n break;\\n }\\n }\\n\\n h.click();\\n\\n });\\n\\n // Passa le funzioni onchange dal select alle nuove opzioni\\n c.onclick = selElmnt.onchange;\\n c.mousedown = selElmnt.onchange;\\n\\n b.appendChild(c);\\n\\n }\\n\\n x[i].appendChild(b);\\n\\n a.addEventListener(\\\"click\\\", function(e) {\\n\\n // When the select box is clicked, close any other select boxes, and open/close the current select box\\n e.stopPropagation();\\n closeAllSelect(this);\\n this.classList.toggle(\\\"select-arrow-active\\\");\\n this.parentNode.classList.toggle(\\\"wi-list-active\\\");\\n check();\\n\\n });\\n\\n}\\n\\nfunction closeAllSelect(elmnt) {\\n\\n // A function that will close all select boxes in the document, except the current select box:\\n var x, y, i, xl, yl, arrNo = [];\\n x = document.getElementsByClassName(\\\"select-items\\\");\\n y = document.getElementsByClassName(\\\"select-selected\\\");\\n var container = document.querySelector(\\\".wi-input-container.wi-list-active\\\");\\n xl = x.length;\\n yl = y.length;\\n\\n for (i = 0; i < yl; i++) {\\n if (elmnt == y[i]) {\\n arrNo.push(i)\\n }else{\\n y[i].classList.remove(\\\"select-arrow-active\\\");\\n }\\n }\\n\\n if (container != null) {\\n container.classList.remove(\\\"wi-list-active\\\");\\n }\\n\\n}\\n\\n// If the user clicks anywhere outside the select box, then close all select boxes:\\ndocument.addEventListener(\\\"click\\\", closeAllSelect);\"","module.exports = \"function formToArray(formElements) {\\n\\n const ARRAY = {};\\n\\n for (let i = 0; i < formElements.length; i++) {\\n\\n var add = false;\\n\\n var input = formElements[i];\\n\\n if (input.type == 'checkbox' || input.type == 'radio') {\\n if (input.checked == true) { var add = true; }\\n } else {\\n if (input.value != \\\"\\\") { var add = true;}\\n }\\n\\n if (add) {\\n\\n var inputName = input.name;\\n var inputValue = input.value;\\n\\n if (inputName.includes(\\\"[]\\\")) {\\n\\n inputName = inputName.replace(\\\"[]\\\", \\\"\\\");\\n\\n if (inputName in ARRAY) {\\n inputName = inputName.replace(\\\"[]\\\", \\\"\\\");\\n ARRAY[inputName].push(inputValue);\\n } else {\\n inputName = inputName.replace(\\\"[]\\\", \\\"\\\");\\n ARRAY[inputName] = [];\\n ARRAY[inputName].push(inputValue);\\n }\\n \\n } else {\\n\\n if (inputName in ARRAY) {\\n\\n } else {\\n ARRAY[inputName] = inputValue;\\n }\\n\\n }\\n\\n }\\n\\n }\\n\\n return ARRAY;\\n \\n}\\n\\nfunction prettyFormResponse(data) {\\n\\n if (data != '') {\\n \\n console.log('ERRORE FORM: '+data);\\n\\n var container = document.querySelector(\\\"#loading-spinner .center\\\");\\n container.classList.add(\\\"w-80\\\");\\n container.innerHTML = '<div class=\\\"title-big a-c\\\"><i class=\\\"bi bi-x-circle tx-danger\\\"></i></div><div class=\\\"subtitle mt-8 a-c\\\">C\\\\'è stato un problema con l\\\\'invio della tua richiesta</div><div class=\\\"c-w mt-10\\\"><a onclick=\\\"location.reload();\\\" class=\\\"btn btn-primary c-w\\\">Riprova</a></div>';\\n\\n } else {\\n \\n var container = document.querySelector(\\\"#loading-spinner .center\\\");\\n container.classList.add(\\\"w-80\\\");\\n container.innerHTML = '<div class=\\\"title-big a-c\\\"><i class=\\\"bi bi-check2-circle tx-success\\\"></i></div><div class=\\\"subtitle mt-8 a-c\\\">La tua richiesta è stata inviata con successo!</div><div class=\\\"c-w mt-10\\\"><a onclick=\\\"location.reload(); \\\" class=\\\"btn btn-primary c-w\\\">Torna al sito</a></div>';\\n\\n }\\n \\n}\\n\\nfunction sendForm(button, url, responseFunction = prettyFormResponse) {\\n\\n loadingSpinner();\\n\\n const VALUES = formToArray(button.form.elements);\\n var form = JSON.stringify(VALUES);\\n\\n $.ajax({\\n type: \\\"POST\\\",\\n url: url,\\n data: { \\n post: 'true',\\n form: form\\n }, \\n success: function (data) {\\n\\n if (responseFunction != null) {\\n if (typeof responseFunction === 'function') {\\n responseFunction(data);\\n } else {\\n loadingSpinner();\\n }\\n }\\n\\n },\\n error: function (XMLHttpRequest) {\\n ajaxRequestError(XMLHttpRequest);\\n loadingSpinner();\\n }\\n });\\n\\n}\\n\\nfunction formUpload(form, url, responseFunction = prettyFormResponse) {\\n\\n loadingSpinner();\\n \\n var formData = new FormData(form);\\n formData.append('post', 'true');\\n \\n $.ajax({\\n type: \\\"POST\\\",\\n url: url,\\n data: formData,\\n contentType: false,\\n cache: false,\\n processData:false, \\n success: function (data) {\\n\\n if (responseFunction != null) {\\n if (typeof responseFunction === 'function') {\\n responseFunction(data);\\n } else {\\n loadingSpinner();\\n }\\n }\\n\\n },\\n error: function (XMLHttpRequest) {\\n ajaxRequestError(XMLHttpRequest);\\n loadingSpinner();\\n }\\n });\\n\\n}\"","module.exports = \"function menuMobile(hamburger = \\\"#hamburger\\\", navMobile = \\\"#nav-mobile\\\") { \\n \\n if (hamburger != null) { document.querySelector(hamburger).classList.toggle(\\\"click\\\"); }\\n if (navMobile != null) { document.querySelector(navMobile).classList.toggle(\\\"show\\\"); }\\n\\n if (document.querySelector(hamburger).classList.contains(\\\"click\\\")) {\\n disableScroll();\\n } else {\\n enableScroll();\\n }\\n\\n}\"","module.exports = \"function modal(selector) {\\n\\n setUpModal(selector);\\n\\n var modal = document.querySelector(selector);\\n\\n modal.classList.toggle('wi-show');\\n modal.classList.toggle('no-interaction');\\n\\n if (modal.classList.contains('wi-show')) {\\n disableScroll();\\n } else {\\n enableScroll();\\n }\\n\\n}\\n\\nfunction setUpModal(selector) {\\n \\n document.querySelectorAll(selector + ' .wi-close-modal').forEach(element => {\\n if (element.onclick == null) {\\n element.onclick = function() { modal(selector) };\\n }\\n });\\n\\n}\"","module.exports = \"function setUpPage() {\\n \\n $.ajax({\\n type: \\\"POST\\\",\\n url: pathApp+'/api/alert.php',\\n data: { \\n post: 'true',\\n frontend: 'true',\\n alert: 801\\n }, \\n success: function (data) {\\n NO_INTERNET_ALERT = data;\\n }\\n });\\n\\n var PAGE_URL = new URL(window.location.href);\\n\\n if (PAGE_URL.searchParams.get('scroll')) {\\n \\n var idScroll = PAGE_URL.searchParams.get('scroll');\\n scrolla('#'+idScroll);\\n\\n }\\n\\n // L'alert non viene passato solo tramite GET ma anche tramite variabile php\\n // if (PAGE_URL.searchParams.get('alert')) {\\n // var alertCode = PAGE_URL.searchParams.get('alert'); alertToast(alertCode);\\n // }\\n\\n setInput();\\n setDropdown();\\n setVideoJS();\\n \\n window.dispatchEvent(new Event('loaded'));\\n \\n};\"","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\nmodule.exports = function(src) {\n\tfunction log(error) {\n\t\t(typeof console !== \"undefined\")\n\t\t&& (console.error || console.log)(\"[Script Loader]\", error);\n\t}\n\n\t// Check for IE =< 8\n\tfunction isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}\n\n\ttry {\n\t\tif (typeof execScript !== \"undefined\" && isIE()) {\n\t\t\texecScript(src);\n\t\t} else if (typeof eval !== \"undefined\") {\n\t\t\teval.call(null, src);\n\t\t} else {\n\t\t\tlog(\"EvalError: No eval function available\");\n\t\t}\n\t} catch (error) {\n\t\tlog(error);\n\t}\n}\n","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/alert.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/aos.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/dropdown.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/form/place.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/form/select.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/form/send.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/header.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/modal.js\"))","require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/script-loader/addScript.js\")(require(\"!!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/node_modules/raw-loader/index.js!/Users/andreamarinoni/Desktop/PROGETTI/template/lib/src/build/frontend/js/pageSetUp.js\"))","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["module","exports","src","log","error","console","execScript","attachEvent","addEventListener","eval","call","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -68,6 +68,10 @@
|
|
|
68
68
|
padding: var(--bs-dropdown-item-padding-x) var(--bs-dropdown-item-padding-y);
|
|
69
69
|
border-radius: var(--bs-dropdown-item-border-radius);
|
|
70
70
|
}
|
|
71
|
+
.select2-results__option--disabled {
|
|
72
|
+
background: #6c757d;
|
|
73
|
+
opacity: .5;
|
|
74
|
+
}
|
|
71
75
|
|
|
72
76
|
/* Multiple */
|
|
73
77
|
.select2-selection__rendered {
|
|
@@ -51,7 +51,7 @@ function checkColor(event) {
|
|
|
51
51
|
if (val.includes('#')) {
|
|
52
52
|
container.querySelector('.wi-show-color').style.color = val;
|
|
53
53
|
} else {
|
|
54
|
-
container.querySelector('.wi-show-color').
|
|
54
|
+
container.querySelector('.wi-show-color').style.color = 'rgba('+val+')';
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
}
|
|
@@ -115,43 +115,6 @@ function enabledInput(type) {
|
|
|
115
115
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
function setDynamicSearch(element) {
|
|
119
|
-
|
|
120
|
-
var dataValue = element.dataset.wiValue;
|
|
121
|
-
var containerMaster = element.parentElement;
|
|
122
|
-
var container = containerMaster.querySelector('.card .card-body');
|
|
123
|
-
var footer = containerMaster.querySelector('.card .card-footer');
|
|
124
|
-
|
|
125
|
-
container.innerHTML = "";
|
|
126
|
-
|
|
127
|
-
if (dataValue != '') {
|
|
128
|
-
|
|
129
|
-
var value = dataValue;
|
|
130
|
-
var url = element.dataset.wiSearchUrl;
|
|
131
|
-
|
|
132
|
-
$.ajax({
|
|
133
|
-
type: "POST",
|
|
134
|
-
url: url,
|
|
135
|
-
data: {
|
|
136
|
-
post: 'true',
|
|
137
|
-
id: value
|
|
138
|
-
},
|
|
139
|
-
success: function (data) {
|
|
140
|
-
createCheckbox(data, element, container, true);
|
|
141
|
-
checkInput();
|
|
142
|
-
},
|
|
143
|
-
error: function (XMLHttpRequest) {
|
|
144
|
-
|
|
145
|
-
ajaxRequestError(XMLHttpRequest);
|
|
146
|
-
footer.innerHTML = 'Errore!';
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
118
|
function createCheckbox(array, element, container, checked = false) {
|
|
156
119
|
|
|
157
120
|
var name = element.dataset.wiName;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
function copyRow(container, element) {
|
|
1
|
+
function copyRow(container, element, callback) {
|
|
2
2
|
|
|
3
3
|
var copy = element.cloneNode(true);
|
|
4
4
|
var position = container.childElementCount;
|
|
5
|
+
var lineId = container.id+'_row_'+code(10);
|
|
5
6
|
|
|
6
|
-
copy.id =
|
|
7
|
+
copy.id = lineId;
|
|
7
8
|
copy.classList.remove('visually-hidden');
|
|
8
9
|
copy.classList.add('wi-copy-row');
|
|
9
10
|
copy.classList.add('order-'+position);
|
|
@@ -30,15 +31,36 @@ function copyRow(container, element) {
|
|
|
30
31
|
|
|
31
32
|
});
|
|
32
33
|
|
|
34
|
+
// Inserisco la linea
|
|
33
35
|
container.appendChild(copy);
|
|
34
36
|
|
|
37
|
+
// Cambio gli Id degli input e li resetto
|
|
38
|
+
var line = document.getElementById(lineId);
|
|
39
|
+
line.querySelectorAll('input, select, textarea').forEach(element => {
|
|
40
|
+
|
|
41
|
+
if (element.hasAttribute('data-select2-id')) {
|
|
42
|
+
|
|
43
|
+
var c = element.parentElement;
|
|
44
|
+
c.querySelector('span.select2').remove();
|
|
45
|
+
|
|
46
|
+
$(element).select2('destroy');
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
element.id = 'input_'+code(10);
|
|
51
|
+
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
setInput(copy);
|
|
35
55
|
checkInput();
|
|
36
56
|
rowSetArrow(container);
|
|
37
57
|
bootstrapTooltip();
|
|
38
58
|
|
|
59
|
+
if (typeof callback === 'function') { callback(); }
|
|
60
|
+
|
|
39
61
|
}
|
|
40
62
|
|
|
41
|
-
function rowOrder(el1, action) {
|
|
63
|
+
function rowOrder(el1, action, callback) {
|
|
42
64
|
|
|
43
65
|
var container = el1.parentElement;
|
|
44
66
|
|
|
@@ -66,6 +88,8 @@ function rowOrder(el1, action) {
|
|
|
66
88
|
|
|
67
89
|
}
|
|
68
90
|
|
|
91
|
+
if (typeof callback === 'function') { callback(); }
|
|
92
|
+
|
|
69
93
|
}
|
|
70
94
|
|
|
71
95
|
function rowChangePos(element, oldPosition, newPosition) {
|
|
@@ -81,7 +105,7 @@ function rowChangePos(element, oldPosition, newPosition) {
|
|
|
81
105
|
|
|
82
106
|
}
|
|
83
107
|
|
|
84
|
-
function rowRemoveModal(element) {
|
|
108
|
+
function rowRemoveModal(element, callback) {
|
|
85
109
|
|
|
86
110
|
var container = element.parentElement;
|
|
87
111
|
|
|
@@ -99,9 +123,12 @@ function rowRemoveModal(element) {
|
|
|
99
123
|
}
|
|
100
124
|
|
|
101
125
|
var selector = '#'+container.id+' .'+elementClass;
|
|
102
|
-
|
|
126
|
+
|
|
127
|
+
var onclick = 'rowRemove("'+selector+'", "'+orderN+'")';
|
|
128
|
+
if (typeof callback === 'function') { onclick += ';'+callback.name+'()'; }
|
|
129
|
+
|
|
103
130
|
var sendBtn = document.querySelector('#modal button.send');
|
|
104
|
-
sendBtn.setAttribute("onclick",
|
|
131
|
+
sendBtn.setAttribute("onclick", onclick);
|
|
105
132
|
|
|
106
133
|
}
|
|
107
134
|
|
|
@@ -137,35 +164,39 @@ function rowSetArrow(container) {
|
|
|
137
164
|
|
|
138
165
|
var nRow = document.querySelectorAll('#'+container.id+' .wi-copy-row').length;
|
|
139
166
|
|
|
140
|
-
if (
|
|
167
|
+
if (document.querySelector('#'+container.id+' .wi-copy-row.order-1 .wi-arrow-up') || document.querySelector('#'+container.id+' .wi-copy-row.order-1 .wi-arrow-down')) {
|
|
141
168
|
|
|
142
|
-
|
|
169
|
+
if (nRow > 1) {
|
|
143
170
|
|
|
144
|
-
|
|
145
|
-
var arrowDown = document.querySelector('#'+container.id+' .wi-copy-row.order-'+i+' .wi-arrow-down');
|
|
171
|
+
for (let i = 1; i <= nRow; i++) {
|
|
146
172
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
173
|
+
var arrowUp = document.querySelector('#'+container.id+' .wi-copy-row.order-'+i+' .wi-arrow-up');
|
|
174
|
+
var arrowDown = document.querySelector('#'+container.id+' .wi-copy-row.order-'+i+' .wi-arrow-down');
|
|
150
175
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
176
|
+
if (arrowUp.classList.contains('visually-hidden')) {
|
|
177
|
+
arrowUp.classList.remove('visually-hidden');
|
|
178
|
+
}
|
|
154
179
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
180
|
+
if (arrowDown.classList.contains('visually-hidden')) {
|
|
181
|
+
arrowDown.classList.remove('visually-hidden');
|
|
182
|
+
}
|
|
158
183
|
|
|
159
|
-
|
|
160
|
-
|
|
184
|
+
if (i == 1) {
|
|
185
|
+
arrowUp.classList.add('visually-hidden');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (i == nRow) {
|
|
189
|
+
arrowDown.classList.add('visually-hidden');
|
|
190
|
+
}
|
|
191
|
+
|
|
161
192
|
}
|
|
162
|
-
|
|
163
|
-
}
|
|
164
193
|
|
|
165
|
-
|
|
194
|
+
} else if (nRow == 1) {
|
|
166
195
|
|
|
167
|
-
|
|
168
|
-
|
|
196
|
+
document.querySelector('#'+container.id+' .wi-copy-row.order-1 .wi-arrow-up').classList.add('visually-hidden');
|
|
197
|
+
document.querySelector('#'+container.id+' .wi-copy-row.order-1 .wi-arrow-down').classList.add('visually-hidden');
|
|
198
|
+
|
|
199
|
+
}
|
|
169
200
|
|
|
170
201
|
}
|
|
171
202
|
|