PageSourceSearch

https://www.sportvision.sk/nb-public/themes/nbshop5_v5_8/blocks/pr…/script_v7.js?ver=1005_4.1

js sportvision.sk collected 2026-10-06 16:59:05 UTC 5,190 bytes, 148 lines download raw bytes

1function loadQuickBuyItems(btn, product){
2    if(btn.parent().find('.sizes-selector-quick-buy').hasClass('active')){
3        btn.parent().find('.sizes-selector-quick-buy').html('').removeClass('active');
4        return false;
5    }
6
7    var sizesTextWrapper = btn.parents('.text-wrapper');
8    var sizesSelectorWrapper = sizesTextWrapper.find('.sizes-selector-quick-buy');
9    $('.sizes-selector-quick-buy').each(function (){
10        $(this).html('').removeClass('active');
11    });
12
13    $.ajax({
14        type: "POST",
15        url: nb_active_page_url,
16        dataType: 'json',
17        data: {
18            nbAjax:1,
19            task: "quickBuyColorSize",
20            block: "product/product_list/product_list_color_size_ajax",
21            productId: product
22        },
23        cache: false,
24        contentType: "application/x-www-form-urlencoded;charset=UTF-8",
25        success: function(ret) {
26            if(ret.flag){
27                sizesSelectorWrapper.html(ret.productsHtml);
28                sizesTextWrapper.toggleClass('quick-buy-active');
29                sizesSelectorWrapper.toggleClass('active');
30                if(typeof window.app === 'object'){
31                    app.productQuantityParentClass('body');
32                }else{
33                    nbProduct.productQuantityParentClass('body');
34                }
35
36                nbshopJS.CustomEventTrigger('quickBuyColorSizeLoaded', { element: sizesSelectorWrapper });
37
38            }
39        }
40    });
41
42}
43
44function toggleSizes(element){
45    event.preventDefault();
46    var prodcutId = element.data('product-id');
47    $('.product-colors-wrapper .product-sizes-wrapper,.product-colors-wrapper .product-color-item').each(function (){
48        $(this).removeClass('active');
49    });
50    element.addClass('active');
51    element.parent().find('.product-sizes-wrapper[data-product-id="'+prodcutId+'"]').addClass('active');
52}
53
54function addToCartActiveBtn(element){
55    $('.product-sizes-wrapper .size-item.btn-sizes').each(function (){
56        $(this).removeClass('active');
57    });
58
59    element.addClass('active');
60    element.closest('.product-sizes-wrapper').find('.product-quantity-input').val('1');
61
62}
63
64function addToCartQuantityBtn(element){
65    amount = element.parent().find('.product-quantity-input').val();
66    if($('.product-sizes-wrapper .size-item.btn-sizes.active').length && amount > 0) {
67        var newElement = element.closest('.product-sizes-wrapper').find('.size-item.btn-sizes.active');
68        addToCartBtn(newElement, amount);
69    }
70    $('.sizes-selector-quick-buy').removeClass('active');
71}
72
73function addToCartBtn(element, amount){
74
75    if(element.hasClass('disabled')){
76        // addAsWantedOnProductListing(element.parents('.product-item').data('productid'), $atribute.data('productsize-combid'));
77        // return;
78    };
79
80
81    var productId = element.closest('.product-sizes-wrapper').data('product-id');
82    var productCombId = element.data('productsize-combid');
83
84    let addToCartButton = $(element).closest(".quick-buy-color-size").find(".quick-buy-color-size-btn");
85
86    var size = element.data('productsize-name');
87
88    addToCartButton.addClass("active");
89
90    //&& size - ivaj deo je izbacen iz uslova jer mona nije radila kako treba
91    if(productId > 0 && productCombId > 0){
92        console.log('a');
93        $.ajax({
94            type: "POST",
95            url: getCartPageUrl(),
96            data: {
97                ajax: 'yes',
98                task: 'cartInsert',
99                id: productId,
100                combId: productCombId,
101                amount: amount,
102                size: size
103            },
104            contentType: "application/x-www-form-urlencoded;charset=UTF-8",
105            dataType: 'json',
106            success: function(ret) {
107
108                if(nb_cart_page_url == nb_cart_page_url && typeof reloadCartOnePage === "function"){
109                    reloadCartOnePage();
110                }
111                let sendObj = {};
112                sendObj.id = productId;
113                sendObj.combId = productCombId;
114                sendObj.amount = amount;
115                sendObj.size = size;
116
117                if (ret.flag){
118                    if($('.product-added-to-cart-on').length > 0){
119                        //return false;
120                        console.log('nema poruke');
121                    }else{
122                        toastr.success(ret.info);
123                    }
124                    nbshopJS.CustomEventTrigger('cartButtonClick', {
125                        ...sendObj,
126                        event_id: generateEventId()
127                    });
128                    window.localStorage.setItem("addedToCartProduct", JSON.stringify(sendObj));
129                    setTimeout(function () {
130                        addToCartButton.removeClass("active");
131                    }, 1500)
132                    refreshMinCartToggle();
133                    //nbshopJS.modalAfterAddToCartProducts(productId);
134                }else{
135                    toastr.error(ret.info);
136                    setTimeout(function () {
137                        addToCartButton.removeClass("active");
138                    }, 1500)
139                }
140            }
141        });
142    }
143
144
145
146
147
148}

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.