/* * Copyright 2024 DPD Polska Sp. z o.o. * * NOTICE OF LICENSE * * Licensed under the EUPL-1.2 or later. * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/software/page/eupl * It is also bundled with this package in the file LICENSE.txt * * Unless required by applicable law or agreed to in writing, * software distributed under the Licence is distributed on an AS IS basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions * and limitations under the Licence. * * @author DPD Polska Sp. z o.o. * @copyright 2024 DPD Polska Sp. z o.o. * @license https://joinup.ec.europa.eu/software/page/eupl */ // noinspection JSUnresolvedReference if (typeof dpdpolandEventCreated == 'undefined') { var dpdpolandEventCreated = false; } var dpdpoland_iframe = document.createElement("iframe"); dpdpoland_iframe.setAttribute("id", "dpdpoland-widget-pudo-iframe"); dpdpoland_iframe.setAttribute("allow", "geolocation"); dpdpoland_iframe.src = dpdpoland_iframe_url; dpdpoland_iframe.style.width = "100%"; dpdpoland_iframe.style.border = "none"; dpdpoland_iframe.style.minHeight = "400px"; dpdpoland_iframe.style.height = "768px"; var dpdpoland_script = document.getElementById("dpdpoland-widget-pudo"); if (dpdpoland_script) dpdpoland_script.parentNode.insertBefore(dpdpoland_iframe, dpdpoland_script); if (!dpdpolandEventCreated) { var dpdpoland_eventListener = window[window.addEventListener ? "addEventListener" : "attachEvent"]; var dpdpoland_messageEvent = ("attachEvent" === dpdpoland_eventListener) ? "onmessage" : "message"; dpdpoland_eventListener(dpdpoland_messageEvent, function (a) { if (getDpdPolandIdPudoCarrier() === getDpdPolandSelectedCarrier()) { if (a.data.height && !isNaN(a.data.height)) { dpdpoland_iframe.style.height = a.data.height + "px" } else if (a.data.point_id) dpdPolandPointSelected(a.data.point_id); } }, !1); dpdpolandEventCreated = true } function dpdPolandPointSelected(pudoCode) { $('.container_dpdpoland_pudo_error').css("display", "none"); $('.dpdpoland-pudo-new-point').css("display", "none"); $('.dpdpoland-pudo-selected-point').css("display", "block"); dpdPolandSavePudoCode(pudoCode, $('#dpdpolandPudoModal')); dpdPolandGetPudoAddress(pudoCode, $('.dpdpoland-selected-point')) }