1$(function(){ 2 selectLocation(0); 3 $('input.lang-modal__field.js-search-aviable').keydown(function(e) { 4 if(e.keyCode === 13) { 5 selectLocation($(this).val(), 3); 6 } 7 }); 8 9 setInterval(function() { 10 var changebasket = $('#changebasket').val(); 11 if (changebasket == 1) { 12 //$('#cart-summary').html('<div class="cart__summary-wrap"><img src="/assets/images/loading.gif" style="margin: 0 auto -35px; padding: 30px;"></div>'); 13 14 $.ajax({ 15 url: "/ajax/ajax_changebasket.php", 16 type: "GET", 17 dataType: "html", 18 data: "STATUS=AJAX", 19 success: function(data){ 20 $('#cart-summary').html(data); 21 } 22 }); 23 $("#changebasket").val(''); 24 } 25 },300); 26 27 $(".js-spoiler-open.filter-js-open").click(function(t) { 28 $("form.js-spoiler-content").toggleClass("active").stop().slideToggle(200),$(this).toggleClass("active"),t.preventDefault() 29 }); 30 31 $('#select-sort').on('change', function() { 32 var sort = 'NAME'; 33 var sort_order = 'ASC'; 34 switch (this.value) { 35 case 'NAME': 36 sort = "NAME"; 37 sort_order = "ASC"; 38 break; 39 40 case 'COST_1': 41 //sort = "catalog_PRICE_7"; 42 sort = "PROPERTY_MINIMUM_PRICE"; 43 sort_order = "ASC"; 44 break; 45 46 case 'COST_2': 47 //sort = "catalog_PRICE_7"; 48 sort = "PROPERTY_MINIMUM_PRICE"; 49 sort_order = "DESC"; 50 break; 51 52 case 'POPULAR': 53 sort = "PROPERTY_POPULAR"; 54 sort_order = "DESC"; 55 break; 56 } 57 58 window.location.href = '?SORT='+sort+'&SORT_ORDER='+sort_order; 59 }); 60 61 $( ".search-click" ).focus(function() { 62 if($(this).val().length >= 3){ 63 var send = 0; 64 var block = $(this).data('block'); 65 input_initial_value = $(this).val(); 66 if (send == 0) { 67 send = 1; 68 $.get("/ajax/ajax_search.php", { "q":$(this).val(), "ACTION": "SEARCH" },function(data){ 69 $('#searchFast-'+block+'-result').html(data); 70 $('#searchFast-'+block+'-result').show(); 71 }, 'html'); 72 } 73 } 74 }); 75 76 $('input[name="typeuser"]').click(function(){ 77 var val = $(this).val(); 78 if (val == 2) { 79 $('.fullcell-type2').show(); 80 } 81 else { 82 $('.fullcell-type2').hide(); 83 } 84 }); 85}); 86 87function orderSMSViewer() { 88 setInterval(function() { 89 var phone = $('input[name="phone"]').val(); 90 var phone_print = $('input[name="phone_print"]').val(); 91 if (phone_print != phone) { 92 $('#order_phone_btn').show(); 93 $('#order_sms_status_check').hide(); 94 $('input[name="phone_print"]').val(phone); 95 $('#order_phone_sms').hide(); 96 $('#order_phone_btn_code').hide(); 97 } 98 }, 1000); 99} 100 101function orderSMS() { 102 var phone = $('input[name="phone"]').val(); 103 104 $.ajax({ 105 url: "/ajax/ajax_ordersms.php", 106 type: "POST", 107 dataType: "html", 108 data: "ACTION=GETSMS&PHONE="+phone, 109 success: function(data){ 110 if(data != 1) { 111 $('#order_sms_status').hide(); 112 $('#order_phone_sms').show(); 113 $('#order_phone_btn_code').show(); 114 $('#order_phone_btn').hide(); 115 } 116 else { 117 $('#order_sms_status').html('<span style="color:red; padding-bottom:8px; font-size: 12px;">ÐÐ¾Ð¼ÐµÑ ÑелеÑона введен не веÑно</span>'); 118 } 119 } 120 }); 121 122 return false; 123} 124 125function setVoucher() { 126 var voucher = $('#voucher').val(); 127 128 $.ajax({ 129 url: "/ajax/ajax_voucher.php", 130 type: "GET", 131 dataType: "html", 132 data: "STATUS=ADD&VOUCHER="+voucher, 133 success: function(data){ 134 if (data == 1) { 135 window.location.replace('/personal/cart/'); 136 } 137 else { 138 $('#voucher-status').html('<div class="promocode__complete"><span class="text-red promocode__caption"><i class="i i-cross"></i><span>'+data+'</span></span></div>'); 139 } 140 } 141 }); 142} 143 144function orderSMScode() { 145 var phone = $('input[name="phone"]').val(); 146 var code = $('#order_phone_code').val(); 147 148 $.ajax({ 149 url: "/ajax/ajax_ordersms.php", 150 type: "POST", 151 dataType: "html", 152 data: "ACTION=SETCODE&PHONE="+phone+"&CODE="+code, 153 success: function(data){ 154 if(data != 1) { 155 $('#order_phone_sms').hide(); 156 $('#order_phone_btn_code').hide(); 157 $('#order_sms_status_check').show(); 158 } 159 else { 160 $('#order_code_status').html('<span style="color:red; padding-bottom:8px; font-size: 12px;">ÐевеÑнÑй код</span>'); 161 } 162 } 163 }); 164 165 return false;
166} 167 168function addBasket(id, style = '', t) { 169//alert(t); 170 $('a.noclick').on('click', false); 171 var quantity = $('#quantity-'+id).val(); 172 173 var classprint = ''; 174 if(style == '') { 175 var classes = $('.basket-id-'+id).attr("class").split(" "); 176 177 for (var i = 0; i < classes.length; i++){ 178 classprint = classprint+' '+classes[i]; 179 } 180 } 181 else { 182 classprint = style; 183 } 184 185 $.ajax({ 186 url: "/ajax/ajax_addbasket.php", 187 type: "POST", 188 dataType: "html", 189 data: "ID="+id+"&QUANTITY="+quantity+"&PRID=" + t, 190 success: function(data){ 191 if ($('.basket-id-'+id+'-container a.btn_upper').hasClass('btn_full')) $('.basket-id-'+id+'-container').html('<a href="/personal/cart/" class="'+classprint+'" style="width: 100%;"><i class="i i-basket"></i><span>ÐÐÐÐÐÐÐÐÐ</span></a>'); 192 $('#basket-line').html(data); 193 if ($('.btn.btn_upper.btn_miw').hasClass('btn_smart2')) { 194 $('.basket-id-'+id+'-container-smart').html('<a href="/personal/cart/" class="btn btn_upper btn_miw btn_smart2 noclick"><i class="i i-basket"></i><span>ÐÐÐÐÐÐÐÐÐ</span></a>'); 195 } 196 } 197 }); 198 199 return false; 200} 201 202function addSetBasket(id) { 203 $('a.noclick').on('click', false); 204 205 $.ajax({ 206 url: "/ajax/ajax_addsetbasket.php", 207 type: "POST", 208 dataType: "html", 209 data: "ID="+id+"&QUANTITY=1", 210 success: function(data){ 211 $('.set-id-'+id).html('<a href="/personal/cart/"><i class="i i-basket"></i><span>ÐÐÐÐÐÐÐÐÐ</span></a>'); 212 $('#basket-line').html(data); 213 } 214 }); 215 216 return false; 217} 218 219function changeBasket(id) { 220 var count = $('#count_'+id).val(); 221 var price = $('#item-tr_'+id+' .js-price').val(); 222 223 if (count <= 0) { 224 deletebasket(id); 225 $('#item-mob-tr_'+id).hide(); 226 } 227 228 $("#changebasket").val('1'); 229 230 $.ajax({ 231 url: "/ajax/ajax_changebasket.php", 232 type: "GET", 233 dataType: "html", 234 data: "ID="+id+"&PRICE="+price+"&COUNT="+count, 235 success: function(data){ 236 $("#summ_"+id).html(data); 237 location.reload(); 238 } 239 }); 240} 241 242function deleteBasket(id) { 243 $('#item-tr_'+id).hide(); 244 $("#changebasket").val('1'); 245 246 $.ajax({ 247 url: "/ajax/ajax_deletebasket.php", 248 type: "GET", 249 dataType: "html", 250 data: "ID="+id, 251 success: function(data){ 252 location.reload(); 253 /* $('#main').html(data); 254 initJS($('#main')); 255 $.ajax({ 256 url: "/ajax/ajax_basket_count.php", 257 type: "GET", 258 dataType: "html", 259 data: "", 260 success: function(data){ 261 $('#count-basket').html(data); 262 } 263 }); */ 264 } 265 }); 266} 267 268function deliverySelect(summ) { 269 $('#order-summ').html('<img src="/loading-big.gif">'); 270 271 $.ajax({ 272 url: "/include/order-summary.php", 273 type: "GET", 274 dataType: "html", 275 data: "PRICE="+summ+"&STATUS=AJAX", 276 success: function(data){ 277 $('#order-summ').html(data); 278 } 279 }); 280} 281 282function deductPoints(id) { 283 $("#changebasket").val('1'); 284 $('#tb__points-'+id).html('<img src="/loading.gif">'); 285 286 $.ajax({ 287 url: "/ajax/ajax_points.php", 288 type: "GET", 289 dataType: "html", 290 data: "ID="+id, 291 success: function(data){ 292 location.reload(); 293 } 294 }); 295} 296 297function selectLocation(location, type = 0) { 298 document.cookie = "GRECHKA_LOCATION_CHECK=1; max-age=604800"; 299 if (type == 0) $('#lang-modal').html('<div style="margin: 20px auto;"><img src="/loading-big.gif"></div>'); 300 else if (type == 1 || type == 3) $('#lang-modal__right').html('<div style="margin: 20px auto;"><img src="/loading-big.gif"></div>'); 301 302 $.ajax({ 303 url: "/ajax/ajax_location.php", 304 type: "GET", 305 dataType: "html", 306 data: "LOCATION="+location+"&TYPE="+type, 307 success: function(data){ 308 if (type == 0) $('#lang-modal').html(data); 309 else if (type == 1 || type == 3) $('#lang-modal__right').html(data); 310 else if (type == 2) { 311 $('span.select-city__in').html(data); 312 closemodal(); 313 var server = $('#langmodal_server').val(); 314 315 if (data == 'ÐоÑква' && server != 'msk.shop-therm.ru') { 316 window.location.replace('https://msk.shop-therm.ru'+document.location.pathname); 317 } 318 else if (data == 'СанкÑ-ÐеÑеÑбÑÑг' && server != 'spb.shop-therm.ru') { 319 window.location.replace('https://spb.shop-therm.ru'+document.location.pathname); 320 } 321 else if (data != 'ÐоÑква' && data != 'СанкÑ-ÐеÑеÑбÑÑг' && (server == 'msk.shop-therm.ru' || server == 'spb.shop-therm.ru')) { 322 window.location.replace('https://shop-therm.ru'+document.location.pathname); 323 } 324 } 325 } 326 }); 327} 328 329function searchFast(block) { 330 var send = 0; 331 $('#searchFast-'+block).keyup(function(I){ 332 switch(I.keyCode) { 333 case 13: // enter 334 case 27: // escape 335 case 38: // ÑÑÑелка ввеÑÑ 336 case 40: // ÑÑÑелка вниз 337 break; 338 default: 339 if($(this).val().length >= 2){ 340 input_initial_value = $(this).val(); 341 if (send == 0) { 342 send = 1; 343 $.get("/ajax/ajax_search.php", { "q":$(this).val(), "ACTION": "SEARCH" },function(data){ 344 345 $('#searchFast-'+block+'-result').html(data).show(); 346 347 /* var list = eval("("+data+")"); 348 suggest_count = list.length; 349 if(suggest_count > 0){ 350 $('#searchFast-'+block+'-result').html("").show(); 351 for(var i in list){ 352 if(list[i] != ''){ 353 // добавлÑем ÑÐ»Ð¾Ñ Ð¿Ð¾Ð·Ð¸Ñии 354 $('#searchFast-'+block+'-result').append('<div class="advice_variant" onclick="searchFastSelected(\''+list[i]+'\');">
354'+list[i]+'</div>'); 355 } 356 } 357 } */ 358 }, 'html'); 359 } 360 } 361 break; 362 } 363 }); 364 365 $('#searchFast-'+block).keydown(function(I){ 366 switch(I.keyCode) { 367 case 13: // enter 368 return true; 369 case 27: // escape 370 $('#searchFast-'+block+'-result').hide(); 371 return false; 372 break; 373 case 38: // ÑÑÑелка ввеÑÑ 374 case 40: // ÑÑÑелка вниз 375 I.preventDefault(); 376 if(suggest_count){ 377 searchFast_activate( I.keyCode-39); 378 } 379 break; 380 } 381 }); 382 383 $('html').click(function(){ 384 $('#searchFast-'+block+'-result').hide(); 385 }); 386 $('#searchFast-'+block).click(function(event){ 387 if (send == 1) $('#searchFast-'+block+'-result').show(); 388 event.stopPropagation(); 389 }); 390} 391 392function searchFast_activate(n){ 393 $('#searchFast-'+block+'-result div').eq(suggest_selected-1).removeClass('active'); 394 395 if(n == 1 && suggest_selected < suggest_count){ 396 suggest_selected++; 397 } 398 else if(n == -1 && suggest_selected > 0){ 399 suggest_selected--; 400 } 401 402 if( suggest_selected > 0){ 403 $('#searchFast-'+block+'-result div').eq(suggest_selected-1).addClass('active'); 404 $('#searchFast-'+block).val( $('#searchFast-'+block+'-result div').eq(suggest_selected-1).text() ); 405 } else { 406 $('#searchFast-'+block).val( input_initial_value ); 407 } 408} 409 410function feedbackForms(type) { 411 if ($('#'+type+'_politics').is(':checked')) { 412 413 var error = 0; 414 415 //ФÐÐ 416 var name = $('#'+type+'_name').val(); 417 if (name.length == 0) { 418 $('#'+type+'_name').addClass("error"); 419 error = 1; 420 } 421 else $('#'+type+'_name').removeClass('error'); 422 423 //Тип обоÑÑÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ 424 /* if (type != 'helpfeed') { 425 var equipment = $('#'+type+'_equipment').val(); 426 if (equipment.length == 0) { 427 $('#'+type+'_equipment').addClass("error"); 428 error = 1; 429 } 430 else $('#'+type+'_equipment').removeClass('error'); 431 } */ 432 433 //ТелеÑон 434 var phone = $('#'+type+'_phone').val(); 435 if (phone.length == 0) { 436 $('#'+type+'_phone').addClass("error"); 437 error = 1; 438 } 439 else $('#'+type+'_phone').removeClass('error'); 440 441 //ТекÑÑ 442 /* if (type != 'calc' && type != 'helpfeed') { 443 var text = $('#'+type+'_text').val(); 444 if (text.length == 0) { 445 $('#'+type+'_text').addClass("error"); 446 error = 1; 447 } 448 else $('#'+type+'_text').removeClass('error'); 449 } */ 450 451 if (error == 0) { 452 $('#'+type+'_form').on('submit', function(t){ 453 t.preventDefault(); 454 var form = $(this); 455 var data = new FormData(); 456 457 form.find(':input[name]').not('[type="file"]').each(function() { 458 var field = $(this); 459 data.append(field.attr('name'), field.val()); 460 }); 461 462 if (type == 'calc') { 463 for (let i = 0; i < calc_files.files.length; i++) { 464 data.append('files[]', calc_files.files[i]); 465 } 466 } 467 468 $.ajax({ 469 url: "/ajax/ajax_feedback.php", 470 type: 'POST', 471 contentType: false, 472 processData: false, 473 data: data, 474 success: function(data){ 475 if(data != 1) { 476 $('#'+type+'_status').html(data); 477 } 478 else { 479 $('#'+type+'_form_thanks').show(); 480 $('#'+type+'_form_div').hide(); 481 } 482 } 483 }); 484 485 return false; 486 }); 487 } 488 else { 489 490 } 491 } 492 else { 493 $('#'+type+'_status').html('ÐÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð¾ ÑоглаÑиÑÑÑÑ Ð½Ð° обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ '); 494 } 495} 496 497function registrationForm() { 498 var error = 0; 499 500 if (error == 0) { 501 $('#regform').on('submit', function(t){ 502 t.preventDefault(); 503 var form = $(this); 504 var data = new FormData(); 505 506 form.find(':input[name]').not('[type="file"]').each(function() { 507 var field = $(this); 508 if(field.attr('type')!="checkbox" || field.is(':checked')){ 509 data.append(field.attr('name'), field.val()); 510 } 511 }); 512 513 $.ajax({ 514 url: "/ajax/ajax_registration.php", 515 type: 'POST', 516 contentType: false, 517 processData: false, 518 data: data, 519 success: function(data){ 520 if(data != 1) { 521 $('#regform-status').html(data); 522 } 523 else { 524 $('#regform-status').html('<div class="regform-status"><span style="color:green">УÑпеÑно! ÐеÑеадÑеÑовÑваем...</span></div>'); 525 window.location.replace('/personal/'); 526 } 527 } 528 }); 529 530 return false;
531 }); 532 } 533} 534 535function authSMS() { 536 var phone = $('#auth_phone').val(); 537 538 $.ajax({ 539 url: "/ajax/ajax_authsms.php", 540 type: "POST", 541 dataType: "html", 542 data: "ACTION=GETSMS&PHONE="+phone, 543 success: function(data){ 544 if(data != 1) { 545 $('#auth_sms_status').hide(); 546 $('#auth_phone_sms').show(); 547 $('#auth_phone_btn_code').show(); 548 $('#auth_phone_btn').html(data); 549 } 550 else { 551 $('#auth_sms_status').html('<span style="color:red; padding-bottom:5px;">ÐÐ¾Ð¼ÐµÑ ÑелеÑона не найден<br><br></span>'); 552 } 553 } 554 }); 555 556 return false; 557} 558 559function authSMScode() { 560 var phone = $('#auth_phone').val(); 561 var code = $('#auth_phone_code').val(); 562 563 $.ajax({ 564 url: "/ajax/ajax_authsms.php", 565 type: "POST", 566 dataType: "html", 567 data: "ACTION=SETCODE&PHONE="+phone+"&CODE="+code, 568 success: function(data){ 569 if(data != 1) { 570 window.location.replace('/personal/'); 571 } 572 else { 573 $('#auth_code_status').html('<span style="color:red; padding-bottom:5px;">ÐевеÑнÑй код<br><br></span>'); 574 } 575 } 576 }); 577 578 return false; 579} 580 581
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.