PageSourceSearch

https://fractal-mirror.ru/local/templates/prymery/components/bitri…/.default/script.js?17799276469186

js fractal-mirror.ru collected 2026-10-07 00:37:10 UTC 9,186 bytes, 221 lines download raw bytes

1$(document).ready(function () {
2    $(".gallery-top a").fancybox();
3    $('.option-group__item').each(function () {
4        $(this).find('input').prop('checked', false);
5    })
6    var count = 4;
7    $('.load_more').on('click', function () {
8        for(i=0;i<10;i++){
9            count = count + 1;
10            $('.review_'+count).show();
11        }
12        var hidden_count = 0;
13        $('.reviewItem').each(function () {
14            if($(this).is(":hidden")){
15                hidden_count++;
16            }
17        });
18        if(hidden_count==0){
19            $(this).hide();
20        }
21    })
22    $('.add-favorites2').on('click', function (event) {
23        if($(this).hasClass('active')){
24            $(this).removeClass('active');
25            $(this).find('span').html('Добавить в избранное');
26        }else{
27            $(this).addClass('active');
28            $(this).find('span').html('Убрать из избранного');
29        }
30        var offer_id = $('select[name=SIZES]').val(); //id ????
31        var product_id = $('select[name=SIZES] option:selected').attr('data-id'); //id ????.?????
32        var options = [];
33        var i = 0;
34        $('.option-group__item').each(function () {
35            if($(this).find('input[type=checkbox]').prop( "checked" )){
36                options[i] = $(this).find('input[type=checkbox]').attr('data-val');
37                i++;
38            }
39        })
40        $.getJSON('/ajax/delay_basket.php',
41            {
42                ACTION: 'DELAY',
43                ID: offer_id,
44                PRODUCT_ID: product_id,
45                OPTIONS: options,
46            },
47            function (data) {
48            }
49        );
50    });
51
52    $('.add-basket:not(.init)').on('click',function () {
53        if(!$(this).hasClass('added')){
54            $(this).addClass('added');
55            var offer_id = $('.tmp-catalogdetail__sizes-item.active').data('price-id');
56            var offer_id_catalog = $('.tmp-catalogdetail__sizes-item.active').data('id');
57            var product_id = $('.tmp-catalogdetail__sizes-item.active').data('id');
58            var options = [];
59            var options2 = [];
60            var i = 0;
61            $('.tmp-catalogdetail__adds-label').each(function () {
62                if($(this).find('input[type=checkbox]').prop( "checked" )){
63                    options[i] = $(this).find('input[type=checkbox]').attr('data-val');
64                    options2[i] = $(this).attr('data-id');
65                    i++;
66                }
67            })
68
69            $('#successBasket .size').html($('.tmp-catalogdetail__sizes-item.active').attr('data-val'));
70            $.getJSON('/local/ajax/to_basket.php',
71                {
72                    ID: offer_id,
73                    OFFER_ID: offer_id_catalog,
74                    DIFF_BASKET: 'Y',
75                    PRODUCT_ID: product_id,
76                    OPTIONS: options,
77                    OPTIONS2: options2,
78                },
79                function (data) {
80                    // $.fancybox.open({
81                    //     src  : '#successBasket',
82                    //     type : 'inline',}
83                    // );
84                    $('.tmp-header__basket').html(data.BASKET_HTML);
85                    $('.add-basket').html('Перейти в корзину');
86                    $('.add-basket').attr('href','/order/');
87                    $('.add-basket').removeClass('add-basket');
88                }
89            );
90        }
91    });
92    $('.add-basket').addClass('init');
93    $('.buy_credit').on('click',function () {
94        var offer_id = $('select[name=SIZES]').val();
95        var offer_id_catalog = $('select[name=SIZES] option:selected').attr('data-id');
96        var product_id = $('select[name=SIZES] option:selected').attr('data-id');
97        var options = [];
98        var options2 = [];
99        var i = 0;
100        $('.option-group__item').each(function () {
101            if($(this).find('input[type=checkbox]').prop( "checked" )){
102                options[i] = $(this).find('input[type=checkbox]').attr('data-val');
103                options2[i] = $(this).attr('data-id');
104                i++;
105            }
106        })
107
108        $.getJSON('/ajax/buy_credit.php',
109            {
110                ID: offer_id,
111                OFFER_ID: offer_id_catalog,
112                DIFF_BASKET: 'Y',
113                PRODUCT_ID: product_id,
114                OPTIONS: options,
115                OPTIONS2: options2,
116            },
117            function (data) {
118                $.fancybox.open({
119                    src  : '#successBasket',
120                    type : 'inline',}
121                );
122                $('.buy_credit').html('Добавлено в корзин
122у');
123            }
124        );
125    });
126    $('.invividual_request').on('click',function () {
127        var individual_id = $('input[name=individual_id]').val();
128        var individual_height = $('input[name=individual_height]').val();
129        var individual_width = $('input[name=individual_width]').val();
130        var product_id = $('select[name=SIZES] option:selected').attr('data-id');
131        var options = [];
132        var i = 0;
133        $('.option-group__item').each(function () {
134            if($(this).find('input[type=checkbox]').prop( "checked" )){
135                options[i] = $(this).attr('data-id');
136                i++;
137            }
138        })
139
140        $.getJSON('/ajax/invividual_request.php',
141            {
142                ID: individual_id,
143                HEIGHT: individual_height,
144                WIDTH: individual_width,
145                OPTIONS: options,
146            },
147            function (data) {
148                window.location.replace("/individual-request/");
149                // $('.invividual_request').html('??????? ? ??????????');
150                // $('.invividual_request').attr('href','/individual-request/');
151                // $('.invividual_request').removeClass('invividual_request');
152            }
153        );
154    });
155    $('.option-group__item').on('click',function () {
156        if($(this).find('input[type=checkbox]').prop("checked")){
157            $(this).parent().parent().find('input[type=checkbox]').prop("checked",false);
158        }else{
159            $(this).parent().parent().find('input[type=checkbox]').prop("checked",false);
160            $(this).find('input[type=checkbox]').prop("checked",true);
161        }
162
163        var id = $('select[name=SIZES]').find('option:selected').attr('data-id');
164        var option_price = 0;
165        $('.product-detail__item').each(function () {
166            $(this).find('input[type=checkbox]').each(function () {
167                if($(this).prop("checked")){
168                    if(option[$('select[name=SIZES]').find('option:selected').attr('data-size-id')][$(this).parent().attr('data-id')]){
169                        option_price = Number(option_price) + Number(option[$('select[name=SIZES]').find('option:selected').attr('data-size-id')][$(this).parent().attr('data-id')]);
170                    }
171                }
172            })
173        })
174
175        var price = Number(size[id]) + Number(option_price);
176        $('.oldPrice span').html(price.toLocaleString('ru'));
177        $('.curPrice').html(price.toLocaleString('ru'));
178        $('.curPricePlan').html(Math.round(price/6));
179    })
180
181    $('select[name=SIZES]').change(function () {
182        var option_price = 0;
183        var id = $('select[name=SIZES]').find('option:selected').attr('data-id');
184        var size_id = $('select[name=SIZES]').find('option:selected').attr('data-size-id');
185
186        $('.product-detail__item').each(function () {
187            $(this).find('.option-group__item').each(function () {
188                if(option_id[size_id][$(this).attr('data-id')]){
189					if(option_id[size_id][$(this).attr('data-id')]['PRICE']['ID']){
190						$(this).find('input').attr('data-val', option_id[size_id][$(this).attr('data-id')]['PRICE']['ID']);
191					}	
192				}
193            })
194
195            $(this).find('input[type=checkbox]').each(function () {
196                if($(this).prop("checked")){
197                    if(option[$('select[name=SIZES]').find('option:selected').attr('data-size-id')][$(this).parent().attr('data-id')]){
198                        option_price = Number(option_price) + Number(option[$('select[name=SIZES]').find('option:selected').attr('data-size-id')][$(this).parent().attr('data-id')]);
199                    }
200                }
201            });
202
203            $(this).find('label').each(function () {
204                if(option[size_id][$(this).attr('data-id')]>0){
205					$(this).attr({'style':'display: inline-flex!important'});
206                    $(this).next('span').html('+'+Math.round(option[size_id][$(this).attr('data-id')]).toLocaleString('ru')+' руб.');
207                }else{
208					if(!option[size_id][$(this).attr('data-id')]){
209						$(this).attr({'style':'display: none!important'});
210					}
211                    $(this).next('span').html('');
212                }
213            })
214        });
215
216        var price = Number(size[id]) + Number(option_price);
217        $('.oldPrice span').html(price.toLocaleString('ru'));
218        $('.curPrice').html(price.toLocaleString('ru'));
219        $('.curPricePlan').html(Math.round(price/6));
220    })
221})

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.