PageSourceSearch

https://www.dgdoggear.com/wp-content/plugins/woocommerce-balikobot…/scripts/pickup-selection/cp.js?ver=3.5.1

js dgdoggear.com collected 2026-10-07 02:33:10 UTC 3,951 bytes, 98 lines download raw bytes

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.cp_initialized) {
10
11    window.WBAL_Pickup.methods.cp_initialized = true;
12
13    const CP_POPUP_ID = 'wbal-cp-map-popup';
14
15    function getPopupContent(country, extra_data) {
16        let title = wbal_pickup_selection.select_branch;
17
18        const iframeSrc = `https://b2c.cpost.cz/locations/?skipLocation=true`;
19        const contentHTML = `
20            <div style="width: 100%; height: 80vh; position: relative;">
21                <iframe
22                    allow="geolocation"
23                    style="width:100%; height:100%; border:none;"
24                    src="${iframeSrc}"
25                    title="${title}">
26                </iframe>
27            </div>
28            <input type="hidden" name="tcp_selected_shipping_method_info" id="tcp_selected_shipping_method_info" value="${jQuery("form.checkout input[type=radio][name^='shipping_method']:checked").val()}"/>
29        `;
30        return {title, contentHTML};
31    }
32
33    window.WBAL_Pickup.methods.cp = {
34        openDialog: function (country, extra_data) {
35            if (typeof window.ToretPopup === 'undefined' || typeof window.ToretPopup.open !== 'function') {
36                console.error('ToretPopup or ToretPopup.open is not defined. Make sure popup handler is loaded.');
37                alert('Služba pro zobrazení mapy není dostupná.');
38                return;
39            }
40
41            const {title, contentHTML} = getPopupContent(country, extra_data);
42            window.ToretPopup.open(
43                CP_POPUP_ID,
44                title,
45                contentHTML,
46                [],
47                {
48                    showHeader: false,
49                    showExternalCloseButton: true,
50                    size: 'fullscreen',
51                }
52            );
53        },
54
55        createMessageListener: function (order_id) {
56            return function iframeListener(event) {
57                if (event.data.message === 'pickerResult') {
58                    const data = event.data.point;
59                    const id = data.id;
60                    const name = data.name;
61                    const city = data.municipality_name;
62                    const fullAddress = data.address;
63                    const type = data.type;
64                    const subtype = data.subtype;
65                    const street = data.street;
66                    const country = 'CZ';
67                    const zip = data.zip;
68
69                    const branchDataObject = {
70                        id: String(id),
71                        name: name,
72                        city: city,
73                        street: street,
74                        zipcode: zip,
75                        fullAddress: fullAddress,
76                        country: country,
77                        carrier: 'cp',
78                        order_id: order_id,
79                        type: type,
80                        subtype: subtype,
81                    };
82
83                    if (typeof window.WBAL_Pickup.saveSelectedPickupData === 'function') {
84                        window.WBAL_Pickup.saveSelectedPickupData(branchDataObject);
85                    } else {
86                        console.error("CP: saveSelectedPickupData function is not available on WBAL_Pickup.");
87                        alert('Došlo k chybě při zpracování výběru výdejního místa.');
88                    }
89
90                } else if (event.data.event_id === 'closeWidget') {
91                    if (window.ToretPopup && typeof window.ToretPopup.close === 'function') {
92                        window.ToretPopup.close(CP_POPUP_ID);
93                    }
94                }
95            }
96        }
97    };
98}

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.