PageSourceSearch

https://www.alphega.cz/special/m5order/t5special.js?v=1790670845

js alphega.cz collected 2026-10-02 19:07:46 UTC 4,642 bytes, 102 lines download raw bytes

1(function (window) {
2    var post = x(currentExecutingScript());
3    //console.log('[t5special]');
4    var inAction = false;
5    var ajaxRequests = new Array();
6    var popupWrap = '<div class="popup hide" id="paymentConfirmationPopup"><div class="popup_bg popup_close_payment"></div><div class="popup_wrap spacing"><button class="ico ico-close popup_close_payment"><svg class="ico ico-close"><use xlink:href="#ico-close"></use></svg></button></div></div>';
7    var popupBody = '<div><h3>Potvrzení platby kartou</h3><p>Při vyzvednutí Vaší zásilky na lékárně lze platit pouze platební kartou, nikoliv v hotovosti.</p><button class="popup_close_payment more_btn">ZMĚNIT TYP PLATBY</button><button class="paymentConfirmationBtn btn_normal">BERU NAVĚDOMÍ</button></div>';
8    // var popupBody = '<div><h3>Platba kartou v lékárně</h3><p>Tuto možnost platby pro Vás připravujeme.</p><button class="popup_close_payment more_btn">ZMĚNIT TYP PLATBY</button><button class="paymentConfirmationBtn btn_normal">BERU NAVĚDOMÍ</button></div>';
9    var card_payment_id = '5012226840467'; 
10    var online_payment_id = '4299262265376'; 
11
12  
13    $(document).on('click', '.k2fx5shipping [data-id="'+card_payment_id+'"] .radio_wrap,.k2fx5shipping [data-id="4939212391994"] .radio_wrap', function (e) {
14      //e.preventDefault();
15      cardPaymentConfirmation($(this).parent().parent());
16    });
17  
18    function cardPaymentConfirmation(btn) {
19
20        // check if shipping is set to 'personal at pharmacy'
21        if (btn.is('[data-id="'+card_payment_id+'"]') && ! $('.k2fx5shipping .shipping_item.active').is('[data-id~="4939212391994"]') ) {
22            console.log("not OSOD");
23            return;
24        }
25
26        if (btn.is('[data-id="4939212391994"]') && ! $('.k2fx5shipping .shipping_item.active').is('[data-id~="'+card_payment_id+'"]')) {
27            console.log("not Dobirka");
28            return;
29        }
30
31        if (ajaxRequests[ajaxRequests.length - 1]) {
32            ajaxRequests[ajaxRequests.length - 1].abort();
33        }
34        inAction = true;
35    
36        if ($(document).find("#paymentConfirmationPopup")) {
37            $("#paymentConfirmationPopup").remove();
38        }
39        $('body').append(popupWrap);
40        $('.popup').css('opacity', '1');
41        $('.popup').addClass('active');
42        $('.popup_wrap').show().append(popupBody);
43    }
44
45    $(document).on('click', '#paymentConfirmationPopup .paymentConfirmationBtn', function(e) {
46        e.preventDefault();
47        acceptPaymentMethod($(this));
48    });
49
50    function acceptPaymentMethod(btn) {
51        var currentdate = new Date();
52        var datetime =  currentdate.getDate() + "."
53                + (currentdate.getMonth()+1)  + "." 
54                + currentdate.getFullYear() + " "  
55                + currentdate.getHours() + ":"  
56                + currentdate.getMinutes() + ":"
57                + currentdate.getSeconds();
58        $('.k2fx5address [name="k2wdPaymentConfirmation"]').val(datetime);
59
60        console.log("Now:" + $('.k2fx5address [name="k2wdPaymentConfirmation"]').val());
61        hidePaymentConfirmation(true);
62        
63        
64        // var _modul = 'k2fx5shipping';
65        // var _action = 'checkPayment';
66
67        // $(document).trigger('k2trigger', [{modul: _modul, post: 'start', action: _action}]);
68
69        // ajaxRequests[ajaxRequests.length] = $.post(post, {
70        //     l: 1001
71        // }, function (data) {
72        //     console.log('DATA = ' + data);
73        //     var d = tryParseJSON(data);
74        //     if (typeof d === 'object' && d.fail == false) {
75        //         $(document).trigger('k2trigger', [{modul: _modul, post: 'end', action: _action, fail: false, msg: []}]);
76        //         hidePaymentConfirmation(true);
77
78        //     } else {
79        //         $(document).trigger('k2trigger', [{modul: _modul, post: 'end', action: _action, fail: true, msg: d.msg}]);
80        //         hidePaymentConfirmation();
81        //     }
82        //     inAction = false;
83        // }); //endpost       
84    }
85    
86
87    $(document).on('click', '.popup_close_payment', function(e) {
88        e.preventDefault();
89        hidePaymentConfirmation();
90    });
91
92    function hidePaymentConfirmation(confirmed=false) {
93        $("#paymentConfirmationPopup").remove();
94        if (!confirmed) {
95            // $('.k2fx5shipping [data-id="'+online_payment_id+'"]').click();
96            $('.k2fx5shipping [data-id="'+online_payment_id+'"] .k2payment').prop("checked", true);
97            $('.k2fx5shipping [data-id="'+online_payment_id+'"] .k2payment').click();//prop("checked", true);
98        }
99    }
100  
101  })();
102  

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.