1/* 2 * Copyright 2024 DPD Polska Sp. z o.o. 3 * 4 * NOTICE OF LICENSE 5 * 6 * Licensed under the EUPL-1.2 or later. 7 * You may not use this work except in compliance with the Licence. 8 * 9 * You may obtain a copy of the Licence at: 10 * https://joinup.ec.europa.eu/software/page/eupl 11 * It is also bundled with this package in the file LICENSE.txt 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the Licence is distributed on an AS IS basis, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the Licence for the specific language governing permissions 17 * and limitations under the Licence. 18 * 19 * @author DPD Polska Sp. z o.o. 20 * @copyright 2024 DPD Polska Sp. z o.o. 21 * @license https://joinup.ec.europa.eu/software/page/eupl 22 */ 23 24// noinspection JSUnresolvedReference 25 26if (typeof dpsShippingCodEventCreated == 'undefined') { 27 var dpsShippingCodEventCreated = false; 28} 29 30var dpsShippingCod_iframe = document.createElement("iframe"); 31dpsShippingCod_iframe.setAttribute("id", "dpdshipping-widget-pudo-cod-iframe"); 32dpsShippingCod_iframe.setAttribute("allow", "geolocation"); 33dpsShippingCod_iframe.src = dpdshipping_iframe_cod_url; 34dpsShippingCod_iframe.style.width = "100%"; 35dpsShippingCod_iframe.style.border = "none"; 36dpsShippingCod_iframe.style.minHeight = "400px"; 37dpsShippingCod_iframe.style.height = "768px"; 38 39var dpsShippingCod_script = document.getElementById("dpdshipping-widget-pudo-cod"); 40if (dpsShippingCod_script) 41 dpsShippingCod_script.parentNode.insertBefore(dpsShippingCod_iframe, dpsShippingCod_script); 42 43if (!dpsShippingCodEventCreated) { 44 var dpsShippingCod_eventListener = window[window.addEventListener ? "addEventListener" : "attachEvent"]; 45 var dpsShippingCod_messageEvent = ("attachEvent" === dpsShippingCod_eventListener) ? "onmessage" : "message"; 46 dpsShippingCod_eventListener(dpsShippingCod_messageEvent, function (a) { 47 if (getDpdshippingIdPudoCodCarrier() === getDpdshippingSelectedCarrier()) { 48 if (a.data.height && !isNaN(a.data.height)) { 49 dpsShippingCod_iframe.style.height = a.data.height + "px" 50 } else if (a.data.point_id) 51 dpdShippingCodPointSelected(a.data.point_id); 52 } 53 }, !1); 54 dpsShippingCodEventCreated = true 55} 56 57function dpdShippingCodPointSelected(pudoCode) { 58 $('.container_dpdshipping_pudo_cod_error').css("display", "none"); 59 $('.dpdshipping-pudo-cod-new-point').css("display", "none"); 60 $('.dpdshipping-pudo-cod-selected-point').css("display", "block"); 61 62 dpdshippingSavePudoCode(pudoCode, $('#dpdshippingPudoCodModal')); 63 dpdshippingGetPudoAddress(pudoCode, $('.dpdshipping-cod-selected-point')) 64 dpdshippingIsPointWithCod(pudoCode) 65} 66 67 68function dpdshippingIsPointWithCod(pudoCode) { 69 $.ajax({ 70 url: dpdshipping_pickup_is_point_with_cod_ajax_url, 71 type: 'GET', 72 data: { 73 dpdshipping_token: dpdshipping_token, 74 dpdshipping_csrf: dpdshipping_csrf, 75 dpdshipping_pudo_code: pudoCode 76 }, 77 success: function (response) { 78 const resultJson = JSON.parse(response) 79 if (resultJson.success && resultJson.data && Number(resultJson.data) === 1) { 80 $('.container_dpdshipping_pudo_cod_warning').css("display", "none"); 81 } else { 82 $('.container_dpdshipping_pudo_cod_warning').css("display", "block"); 83 dpdshippingDisableOrderProcessBtn(); 84 } 85 }, 86 error: function (error) { 87 console.log('Error:', error); 88 } 89 }); 90}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.