1if (typeof window.WBAL_Pickup === 'undefined') { 2 window.WBAL_Pickup = {}; 3} 4 5if (typeof window.WBAL_Pickup.methods === 'undefined') { 6 window.WBAL_Pickup.methods = {}; 7} 8 9if (!window.WBAL_Pickup.methods.gls_initialized) { 10 11 window.WBAL_Pickup.methods.gls_initialized = true; 12 13 const GLS_POPUP_ID = 'wbal-gls-map-popup'; 14 15 function getPopupContent(country, extra_data) { 16 let title = wbal_pickup_selection.select_branch; 17 18 country = country || 'CZ'; 19 20 let lng = wbal_pickup_selection.language || 'en'; 21 if (!['cs', 'sk', 'en'].includes(lng)) { 22 lng = 'en'; 23 } 24 25 let noBoxes = ""; 26 if (extra_data) { 27 if (extra_data.no_box) { 28 noBoxes = "&nogroup[]=17&nogroup[]=18"; 29 } 30 } 31 32 const iframeSrc = `https://maps.gls-czech.cz/?find=1&closeBtn=1&ctrcode=${country}&lng=${lng}${noBoxes}`; 33 const contentHTML = ` 34 <div style="width: 100%; height: 80vh; position: relative;"> 35 <iframe 36 allow="geolocation" 37 style="width:100%; height:100%; border:none;" 38 src="${iframeSrc}" 39 title="${title}"> 40 </iframe> 41 </div> 42 `; 43 return {title, contentHTML}; 44 } 45 46 window.WBAL_Pickup.methods.gls = { 47 openDialog: function (country, extra_data) { 48 if (typeof window.ToretPopup === 'undefined' || typeof window.ToretPopup.open !== 'function') { 49 console.error('ToretPopup or ToretPopup.open is not defined. Make sure popup handler is loaded.'); 50 alert('Služba pro zobrazenà mapy nenà dostupná.'); 51 return; 52 } 53 54 const {title, contentHTML} = getPopupContent(country, extra_data); 55 window.ToretPopup.open( 56 GLS_POPUP_ID, 57 title, 58 contentHTML, 59 [], 60 { 61 showHeader: false, 62 showExternalCloseButton: true, 63 size: 'fullscreen', 64 } 65 ); 66 }, 67 68 createMessageListener: function (order_id) { 69 return function iframeListener(event) { 70 if (event.data.event_id === "ps_data_handover") { 71 const data = event.data.parcelshop.detail; 72 const id = data.pclshopid; 73 const name = data.name; 74 const city = data.city; 75 const fullAddress = (data.address && data.zipcode && data.city && data.address.includes(data.zipcode) && data.address.includes(data.city)) 76 ? data.address 77 : `${data.address || ''}, ${data.zipcode || ''} ${data.city || ''}`.replace(/^,|, $/, '').trim(); 78 const street = data.street || data.address; 79 const country = data.ctrcode; 80 const zip = data.zipcode; 81 82 const branchDataObject = { 83 id: String(id), 84 name: name, 85 city: city, 86 street: street, 87 zipcode: zip, 88 fullAddress: fullAddress, 89 country: country, 90 carrier: 'gls', 91 order_id: order_id 92 }; 93 94 if (typeof window.WBAL_Pickup.saveSelectedPickupData === 'function') { 95 window.WBAL_Pickup.saveSelectedPickupData(branchDataObject); 96 } else { 97 console.error("GLS: saveSelectedPickupData function is not available on WBAL_Pickup."); 98 alert('DoÅ¡lo k chybÄ pÅi zpracovánà výbÄru výdejnÃho mÃsta.'); 99 } 100 101 } else if (event.data.event_id === 'closeWidget') { 102 if (window.ToretPopup && typeof window.ToretPopup.close === 'function') { 103 window.ToretPopup.close(GLS_POPUP_ID); 104 } 105 } 106 }; 107 } 108 }; 109}
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.