1$(function() { 2 $i = 0; 3 setInterval(function() { 4 $i++; 5 $('.sl').fadeOut('fast'); 6 $('.slide' + $i + '').fadeIn('fast'); 7 if ($i == 4) { 8 $i = 1; 9 } 10 }, 6000); 11 $(function() { 12 if (typeof localStorage['city'] == 'undefined' || localStorage['city'] == 'undefined') { 13 $.ajax({ 14 url: 'https://kladr.insales.ru/current_location.json', 15 type: 'get', 16 dataType: 'jsonp', 17 success: function(data) { 18 localStorage['city'] = data.city; 19 $('.header_city span').text(data.city); 20 if (($('.header_city span').text() == "ÐÑкÑÑÑк") || ($('.header_city span').text() == "ÐнгÑаÑк") || ($('.header_city span').text() == "Ð¨ÐµÐ»ÐµÑ Ð¾Ð²") || ($('.header_city span').text() == "УÑолÑе-СибиÑÑкое") || ($('.header_city span').text() == "Улан-УдÑ") || ($('.header_city span').text() == "ЧиÑа") || ($('.header_city span').text() == "ХабаÑовÑк") || ($('.header_city span').text() == "ÐлаговеÑенÑк") || ($('.header_city span').text() == "ÐладивоÑÑок")) { 21 $(".p_banner2").hide(); 22 $(".p_banner1").text("+7 (3952) 38-17-66"); 23 $(".header_phones div").html('<a style="margin-top:11px;" href="tel:+7 (3952) 38-17-66">+7 (3952) 38-17-66</a>'); 24 $(".footer_address").html("г. ÐÑкÑÑÑк, ÑлиÑа 2-Ð°Ñ ÐелезнодоÑожнаÑ,<br> дом 66 «Ð», оÑÐ¸Ñ 308"); 25 } else { 26 $(".p_banner2").show(); 27 $(".p_banner1").text("+7 (495) 150 70 06"); 28 $(".header_phones div").html('<a href="tel:+7 (495) 150 70 06">+7 (495) 150 70 06</a><a href="tel:+7 (499) 181 00 94">+7 (499) 181 00 94</a>'); 29 $(".footer_address").html("ÐоÑква, м. ÐоÑаниÑеÑкий Ñад,<br>Ñл. СелÑÑÐºÐ¾Ñ Ð¾Ð·ÑйÑÑвеннаÑ, 30/1,<br> оÑ. 2"); 30 } 31 shippingDate(); 32 } 33 }); 34 } else { 35 $('.header_city span').text(localStorage['city']); 36 if (($('.header_city span').text() == "ÐÑкÑÑÑк") || ($('.header_city span').text() == "ÐнгÑаÑк") || ($('.header_city span').text() == "Ð¨ÐµÐ»ÐµÑ Ð¾Ð²") || ($('.header_city span').text() == "УÑолÑе-СибиÑÑкое") || ($('.header_city span').text() == "Улан-УдÑ") || ($('.header_city span').text() == "ЧиÑа") || ($('.header_city span').text() == "ХабаÑовÑк") || ($('.header_city span').text() == "ÐлаговеÑенÑк") || ($('.header_city span').text() == "ÐладивоÑÑок")) { 37 $(".p_banner2").hide(); 38 $(".p_banner1").text("+7 (3952) 38-17-66"); 39 $(".header_phones div").html('<a style="margin-top:11px;" href="tel:+7 (3952) 38-17-66">+7 (3952) 38-17-66</a>'); 40 $(".footer_address").html("г. ÐÑкÑÑÑк, ÑлиÑа 2-Ð°Ñ ÐелезнодоÑожнаÑ,<br> дом 66 «Ð», оÑÐ¸Ñ 308"); 41 } else { 42 $(".p_banner2").show(); 43 $(".p_banner1").text("+7 (495) 150 70 06"); 44 $(".header_phones div").html('<a href="tel:+7 (495) 150 70 06">+7 (495) 150 70 06</a><a href="tel:+7 (499) 181 00 94">+7 (499) 181 00 94</a>'); 45 $(".footer_address").html("ÐоÑква, м. ÐоÑаниÑеÑкий Ñад,<br>Ñл. СелÑÑÐºÐ¾Ñ Ð¾Ð·ÑйÑÑвеннаÑ, 30/1,<br> оÑ. 2"); 46 } 47 shippingDate(); 48 } 49 }); 50 $('#favorite-clear').on('click', function() { 51 $.cookie('shop_favorite', null, { 52 path: '/' 53 }); 54 location.href = location.href.replace(/compare\/.*/, 'favorite/'); 55 }); 56 compare_count = $.cookie('shop_compare'); 57 if (compare_count) { 58 compare_count = compare_count.split(','); 59 if (compare_count.length > 0) { 60 $(".header_compare span").show(); 61 $(".header_compare span").text(compare_count.length); 62 } 63 } 64 favorite_count = $.cookie('shop_favorite'); 65 if (favorite_count) { 66 favorite_count = favorite_count.split(','); 67 if (favorite_count.length > 0) { 68 $(".header_fav span").show(); 69 $(".header_fav span").text(favorite_count.length); 70 } 71 } 72 $('#cityInp').keyup(function(e) { 73 var s = $(this).val(); 74 var c = s.charAt(0).toUpperCase() + s.substr(1); 75 if (e.keyCode == 13) { 76 $('#popCity').modal('toggle'); 77 $('.header_city span').text(c); 78 localStorage['city'] = c; 79 } else 80 $.ajax({ 81 dataType: "json", 82 url: 'https://kladr.insales.ru/fulltext_search.json?callback=?', 83 data: { 84 'country': 'RU', 85 'q': c 86 }, 87 success: function(data) {
88 var newOp = ''; 89 for (key in data) { 90 newOp += '<option>' + data[key]['city'] + '</option>'; 91 } 92 $('#dataCity').html(newOp); 93 } 94 }); 95 }).on('input', function() { 96 var txt = $(this).val(); 97 $("#dataCity").find("option").each(function() { 98 var c = $(this).val(); 99 if (c == txt) { 100 $('#popCity').modal('hide'); 101 $('.header_city span').text(c); 102 localStorage['city'] = c; 103 shippingDate(); 104 } 105 }) 106 if (($('.header_city span').text() == "ÐÑкÑÑÑк") || ($('.header_city span').text() == "ÐнгÑаÑк") || ($('.header_city span').text() == "Ð¨ÐµÐ»ÐµÑ Ð¾Ð²") || ($('.header_city span').text() == "УÑолÑе-СибиÑÑкое") || ($('.header_city span').text() == "Улан-УдÑ") || ($('.header_city span').text() == "ЧиÑа") || ($('.header_city span').text() == "ХабаÑовÑк") || ($('.header_city span').text() == "ÐлаговеÑенÑк") || ($('.header_city span').text() == "ÐладивоÑÑок")) { 107 $(".p_banner2").hide(); 108 $(".p_banner1").text("+7 (3952) 38-17-66"); 109 $(".header_phones div").html('<a style="margin-top:11px;" href="tel:+7 (3952) 38-17-66">+7 (3952) 38-17-66</a>'); 110 $(".footer_address").html("г. ÐÑкÑÑÑк, ÑлиÑа 2-Ð°Ñ ÐелезнодоÑожнаÑ,<br> дом 66 «Ð», оÑÐ¸Ñ 308"); 111 } else { 112 $(".p_banner2").show(); 113 $(".p_banner1").text("+7 (495) 150 70 06"); 114 $(".header_phones div").html('<a href="tel:+7 (495) 150 70 06">+7 (495) 150 70 06</a><a href="tel:+7 (499) 181 00 94">+7 (499) 181 00 94</a>'); 115 $(".footer_address").html("ÐоÑква, м. ÐоÑаниÑеÑкий Ñад,<br>Ñл. СелÑÑÐºÐ¾Ñ Ð¾Ð·ÑйÑÑвеннаÑ, 30/1,<br> оÑ. 2"); 116 } 117 shippingDate(); 118 }); 119 $('#checkCity li').click(function() { 120 $('#popCity').modal('toggle'); 121 var c = $(this).text(); 122 $('.header_city span').text(c); 123 localStorage['city'] = c; 124 shippingDate(); 125 if ((c == "ÐÑкÑÑÑк") || (c == "ÐнгÑаÑк") || (c == "Ð¨ÐµÐ»ÐµÑ Ð¾Ð²") || (c == "УÑолÑе-СибиÑÑкое") || (c == "Улан-УдÑ") || (c == "ЧиÑа") || (c == "ХабаÑовÑк") || (c == "ÐлаговеÑенÑк") || (c == "ÐладивоÑÑок")) { 126 $(".p_banner2").hide(); 127 $(".p_banner1").text("+7 (3952) 38-17-66"); 128 $(".header_phones div").html('<a style="margin-top:11px;" href="tel:+7 (3952) 38-17-66">+7 (3952) 38-17-66</a>'); 129 $(".footer_address").html("г. ÐÑкÑÑÑк, ÑлиÑа 2-Ð°Ñ ÐелезнодоÑожнаÑ,<br> дом 66 «Ð», оÑÐ¸Ñ 308"); 130 } else { 131 $(".p_banner2").show(); 132 $(".p_banner1").text("+7 (495) 150 70 06"); 133 $(".header_phones div").html('<a href="tel:+7 (495) 150 70 06">+7 (495) 150 70 06</a><a href="tel:+7 (499) 181 00 94">+7 (499) 181 00 94</a>'); 134 $(".footer_address").html("ÐоÑква, м. ÐоÑаниÑеÑкий Ñад,<br>Ñл. СелÑÑÐºÐ¾Ñ Ð¾Ð·ÑйÑÑвеннаÑ, 30/1,<br> оÑ. 2"); 135 } 136 shippingDate(); 137 }) 138 $('.pc_show').click(function() { 139 if ($(this).parents('.product_col').length) { 140 if ($(this).hasClass('active')) { 141 $(".pc_show").removeClass('active'); 142 $(".pc_show").find('span').text("+"); 143 $(".pu_show").removeClass('active'); 144 $(".pu_show").find('span').text("+");
145 $(".cross_row").slideUp(); 146 } else { 147 $(".pc_show").removeClass('active'); 148 $(".pc_show").find('span').text("+"); 149 $(".pu_show").removeClass('active'); 150 $(".pu_show").find('span').text("+"); 151 $(".cross_row").slideUp(); 152 $(this).toggleClass("active"); 153 if ($(this).find('span').text() == "+") { 154 $(this).find('span').text("-"); 155 } else { 156 $(this).find('span').text("+"); 157 } 158 html = $(this).closest('.product_block').find('.pc').html(); 159 $(this).closest(".product_block").nextAll(".cross_row:first").html(html); 160 $(this).closest(".product_block").nextAll(".cross_row:first").slideToggle(); 161 } 162 } else { 163 $(this).closest(".product_block").find('.pu').hide(); 164 $(".pu_show").removeClass('active'); 165 $(".pu_show").find('span').text("+"); 166 $(this).closest(".product_block").find('.pc').slideToggle(); 167 $(this).toggleClass("active"); 168 if ($(this).find('span').text() == "+") { 169 $(this).find('span').text("-"); 170 } else { 171 $(this).find('span').text("+"); 172 } 173 } 174 }); 175 $('.pu_show').click(function() { 176 if ($(this).parents('.product_col').length) { 177 if ($(this).hasClass('active')) { 178 $(".pc_show").removeClass('active'); 179 $(".pc_show").find('span').text("+"); 180 $(".pu_show").removeClass('active'); 181 $(".pu_show").find('span').text("+");
182 $(".cross_row").slideUp(); 183 } else { 184 $(".pc_show").removeClass('active'); 185 $(".pc_show").find('span').text("+"); 186 $(".pu_show").removeClass('active'); 187 $(".pu_show").find('span').text("+"); 188 $(".cross_row").slideUp(); 189 $(this).toggleClass("active"); 190 if ($(this).find('span').text() == "+") { 191 $(this).find('span').text("-"); 192 } else { 193 $(this).find('span').text("+"); 194 } 195 html = $(this).closest('.product_block').find('.pu').html(); 196 $(this).closest(".product_block").nextAll(".cross_row:first").html(html); 197 $(this).closest(".product_block").nextAll(".cross_row:first").slideToggle(); 198 } 199 } else { 200 $(this).closest(".product_block").find('.pc').hide(); 201 $(".pc_show").removeClass('active'); 202 $(".pc_show").find('span').text("+"); 203 $(this).closest(".product_block").find('.pu').slideToggle(); 204 $(this).toggleClass("active"); 205 if ($(this).find('span').text() == "+") { 206 $(this).find('span').text("-"); 207 } else { 208 $(this).find('span').text("+"); 209 } 210 } 211 }); 212 $('.thumbs img').click(function() { 213 $(".main_photo img").attr("src", $(this).attr("data-medium-img")); 214 $(".main_photo a").attr("href", $(this).attr("data-full-img")); 215 }); 216 $('.thumbs a').click(function() { 217 return false; 218 }); 219 $(document).on('click', '.compare', function() { 220 var compare = $.cookie('shop_compare'); 221 $.cookie('shop_compare', compare, { 222 expires: 30, 223 path: '/' 224 }); 225 if (!$(this).hasClass('active')) { 226 if (compare) { 227 compare += ',' + $(this).data('product'); 228 } else { 229 compare = '' + $(this).data('product'); 230 } 231 if (compare.split(',').length > 0) { 232 if (!$('#compare-leash').is(":visible")) { 233 $('#compare-leash').css('height', 0).show().animate({ 234 height: 39 235 }, function() { 236 var _blinked = 0; 237 setInterval(function() { 238 if (_blinked < 4) $("#compare-leash a").toggleClass("just-added"); 239 _blinked++; 240 }, 500); 241 }); 242 } 243 } else { 244 $('#compare-leash').hide(); 245 } 246 $.cookie('shop_compare', compare, { 247 expires: 30, 248 path: '/' 249 }); 250 } else { 251 if (compare) { 252 compare = compare.split(','); 253 } else { 254 compare = []; 255 } 256 var i = $.inArray($(this).data('product') + '', compare); 257 if (i != -1) { 258 compare.splice(i, 1) 259 } 260 if (compare.length > 0) { 261 $.cookie('shop_compare', compare.join(','), { 262 expires: 30, 263 path: '/' 264 }); 265 } else { 266 $('#compare-leash').hide(); 267 $.cookie('shop_compare', null, { 268 path: '/' 269 }); 270 } 271 } 272 $(this).toggleClass('active'); 273 compare_count = $.cookie('shop_compare'); 274 compare_count = compare_count.split(','); 275 if (compare_count.length > 0) { 276 $(".header_compare span").show(); 277 $(".header_compare span").text(compare_count.length); 278 } 279 return false; 280 }); 281 $(document).on('click', '.favorite', function() { 282 var favorite = $.cookie('shop_favorite'); 283 $.cookie('shop_favorite', favorite, { 284 expires: 30, 285 path: '/' 286 }); 287 if (!$(this).hasClass('active')) { 288 if (favorite) { 289 favorite += ',' + $(this).data('product'); 290 } else { 291 favorite = '' + $(this).data('product'); 292 } 293 if (favorite.split(',').length > 0) { 294 if (!$('#favorite-leash').is(":visible")) { 295 $('#favorite-leash').css('height', 0).show().animate({ 296 height: 39 297 }, function() { 298 var _blinked = 0; 299 setInterval(function() { 300 if (_blinked < 4) $("#favorite-leash a").toggleClass("just-added"); 301 _blinked++; 302 }, 500); 303 }); 304 } 305 } else { 306 $('#favorite-leash').hide(); 307 } 308 $.cookie('shop_favorite', favorite, { 309 expires: 30, 310 path: '/' 311 }); 312 } else { 313 if (favorite) { 314 favorite = favorite.split(','); 315 } else { 316 favorite = []; 317 } 318 var i = $.inArray($(this).data('product') + '', favorite); 319 if (i != -1) { 320 favorite.splice(i, 1) 321 } 322 if (favorite.length > 0) { 323 $.cookie('shop_favorite', favorite.join(','), { 324 expires: 30, 325 path: '/' 326 }); 327 } else { 328 $('#favorite-leash').hide(); 329 $.cookie('shop_favorite', null, { 330 path: '/' 331 }); 332 } 333 } 334 $(this).toggleClass('active'); 335 favorite_count = $.cookie('shop_favorite'); 336 favorite_count = favorite_count.split(','); 337 if (favorite_count.length > 0) { 338 $(".header_fav span").show(); 339 $(".header_fav span").text(favorite_count.length); 340 } 341 return false;
342 }); 343 $('.cart_del').click(function() { 344 $(this).closest('.cart_product').slideUp(); 345 $(this).closest('.cart_product').find('.number').removeClass('number').val(0); 346 $('#cartform').change(); 347 $.ajax({ 348 url: '/cart/', 349 type: 'GET', 350 success: function(data) { 351 if ($(data).find('.cart_product').length != 0) { 352 total_item = data.data.count; 353 $(".cart_count").html(total_item); 354 } else { 355 $(".cart_count").html('0'); 356 } 357 } 358 }); 359 }) 360 $('.product_tab_title').click(function() { 361 $(this).addClass('active'); 362 $(this).siblings('.product_tab_inner').slideToggle(); 363 $(this).find('i').toggleClass('fa-angle-down'); 364 }); 365 $('.sidebar_toggle span').click(function() { 366 selected_tab = $(this).attr('data-tab'); 367 $(this).addClass('active'); 368 $(this).siblings('span').removeClass('active'); 369 $('.' + selected_tab).addClass('active'); 370 $('.' + selected_tab).siblings('div').removeClass('active'); 371 }); 372 $('.sm_title i').click(function() { 373 $(this).closest('.sm_title').toggleClass('active'); 374 if ($(this).closest('.sm_title').is('.active')) { 375 $(this).closest('.sm_title').animate({ 376 height: "53px", 377 'line-height': "53px", 378 'background-color': "#656565", 379 color: "#fff", 380 }, 300, function() {}); 381 $(this).closest('.sm_title').find('i').animate({ 382 margin: "19px 0", 383 }, 300, function() {}); 384 } else { 385 $(this).closest('.sm_title').animate({ 386 height: "44px", 387 'line-height': "44px", 388 'background-color': "#FFF", 389 color: "#000", 390 }, 300, function() {}); 391 $(this).closest('.sm_title').find('i').animate({ 392 margin: "14px 0", 393 }, 300, function() {}); 394 } 395 $(this).closest('.sm_title').find('i').toggleClass('fa-angle-down'); 396 $(this).closest('.sm_title').siblings('div').slideToggle(); 397 }); 398 $('.sf_title').click(function() { 399 $(this).toggleClass('active'); 400 if ($(this).is('.active')) { 401 $(this).animate({ 402 height: "53px", 403 'line-height': "53px", 404 'background-color': "#656565", 405 color: "#fff", 406 }, 300, function() {}); 407 $(this).find('i').animate({ 408 margin: "19px 0", 409 }, 300, function() {}); 410 } else { 411 $(this).animate({ 412 height: "44px", 413 'line-height': "44px", 414 'background-color': "#FFF", 415 color: "#000", 416 }, 300, function() {}); 417 $(this).find('i').animate({ 418 margin: "14px 0", 419 }, 300, function() {}); 420 } 421 $(this).find('i').toggleClass('fa-angle-down'); 422 $(this).siblings('div').slideToggle(); 423 }); 424 $('.sm_level1 i').click(function() { 425 $(this).closest('.sm_level1').find('.sm_level2').toggleClass('active'); 426 $(this).closest('.sm_level1').find('.sm_level2').slideToggle(); 427 return false; 428 }); 429 $('.sorting_wrap span').click(function() { 430 $(this).siblings('ul').toggleClass('active'); 431 $(this).siblings('ul').slideToggle('active'); 432 return false; 433 }); 434 $('.sorting_wrap a').click(function() { 435 $.cookie('current_sorting', $(this).text()); 436 }); 437 $('.products_list, .products_list_mini').on('click', '.product_row .cs', function() { 438 var tar = $(this).parent('.product_row'); 439 this_sku = $(this).attr('data-f-sku'); 440 this_href = $(this).closest('.product_row').find('a').attr('href'); 441 this_href = this_href.split('?')[0]; 442 this_href = this_href + "?select_sku=" + this_sku; 443 $(this).closest('.product_row').find('a').attr('href', this_href); 444 $(this).addClass('active').siblings('div').removeClass('active'); 445 $(this).closest('.product_row').find('.product_sku span').html($(this).attr('data-f-sku')); 446 $(this).closest('.product_row').find('.product_opt span').html($(this).attr('data-opt')); 447 $(this).closest('.product_row').find('.product_info .product_price').html($(this).attr('data-price')); 448 $(this).closest('.product_row').find('.sku_id').val($(this).attr('data-sku')); 449 tar.siblings('.group').find('span').text($(this).attr('data-f-sku')); 450 tar.find('.title').attr('href', $(this).attr('data-url')); 451 tar.find('.img').attr('onclick', "document.location='" + $(this).attr('data-url') + "'"); 452 var q = parseInt($(this).attr('data-q')); 453 var ed = " " + $(this).attr('data-ed') + '.'; 454 console.log(ed); 455 if (q >= 1000) { 456 q = ">1000" + ed 457 } else if (q <= 5) { 458 q = "<a href='#callback'>ÑÑоÑниÑÑ</a>" 459 } else { 460 q += ed; 461 } 462 $(this).closest('.product_row').find('.product_stock span').html(q); 463 tar.siblings('.bt').find('div').attr('dataid', $(this).attr('data-id')).text('Ð â Ð ÑÐ ÑÐ Ð âÐ ÂÐ ÑÐ Ð').addClass('buy').removeClass('inBas'); 464 }); 465 $('.products_list, .products_list_mini').on('click', '.product_col .cs', function() { 466 var tar = $(this).parent('.product_col'); 467 this_sku = $(this).attr('data-f-sku'); 468 this_href = $(this).closest('.product_col').find('a').attr('href'); 469 this_href = this_href.split('?')[0]; 470 this_href = this_href + "?select_sku=" + this_sku; 471 $(this).closest('.product_col').find('a').attr('href', this_href); 472 $(this).addClass('active').siblings('div').removeClass('active'); 473 $(this).closest('.product_col').find('.product_sku span').html($(this).attr('data-f-sku')); 474 $(this).closest('.product_col').find('.product_info .pc_right .product_opt span').html($(this).attr('data-opt')); 475 $(this).closest('.product_col').find('.product_price').html($(this).attr('data-price')); 476 $(this).closest('.product_col').find('.sku_id').val($(this).attr('data-sku')); 477 tar.siblings('.group').find('span').text($(this).attr('data-f-sku')); 478 tar.find('.title').attr('href', $(this).attr('data-url')); 479 tar.find('.img').attr('onclick', "document.location='" + $(this).attr('data-url') + "'"); 480 var q = parseInt($(this).attr('data-q')); 481 var ed = " " + $(this).attr('data-ed') + '.'; 482 console.log(ed); 483 if (q >= 1000) { 484 q = ">1000" + ed 485 } else if (q <= 5) { 486 q = "<a href='#callback'>ÑÑоÑниÑÑ</a>" 487 } else { 488 q += ed; 489 } 490 $(this).closest('.product_col').find('.product_stock span').html(q); 491 tar.siblings('.bt').find('div').attr('dataid', $(this).attr('data-id')).text('Ð â Ð ÑÐ ÑÐ Ð âÐ ÂÐ ÑÐ Ð').addClass('buy').removeClass('inBas'); 492 }); 493 $(document).on('change', 'input.number', function() { 494 console.log('test'); 495 var n = $(this); 496 var sh = parseFloat(n.attr('cr')); 497 var nowN = parseFloat(n.val()); 498 if (nowN % sh == 0 && nowN != 0) {} else { 499 nowN = (nowN - nowN % sh + sh); 500 } 501 if (nowN < sh) { 502 nowN = sh 503 }; 504 n.val(nowN); 505 $($(this).attr('data-tar')).attr('datacount', nowN); 506 }); 507 $('input.number').on('input change paste', function() { 508 var n = this.value.replace(/[^0-9\-\.]/, ''); 509 var cr = $(this).attr('cr') 510 if (n == '' || n < 1) n = cr; 511 $(this).val(n); 512 }).siblings('.mm').on('click', function() { 513 var inp = $(this).siblings('input'); 514 var n = parseFloat(inp.val()); 515 var sh = parseFloat(inp.attr('cr')); 516 var nn = parseInt(inp.attr('ready')) 517 if (isNaN(nn)) { 518 nn = 1; 519 } else { 520 nn++; 521 } 522 inp.attr('ready', nn).addClass('ready'); 523 if ($(this).hasClass('plus')) { 524 n += sh 525 } else { 526 n -= sh 527 } 528 if (n < sh) n = sh; 529 inp.val(n); 530 setTimeout(function() { 531 var tar = $('input.number.ready'); 532 var tarCl = parseInt(tar.attr('ready')) - 1; 533 if (tarCl == 0) {} 534 tar.attr('ready', tarCl) 535 }, 300) 536 }); 537 $('.product_wrap .cs_select>div').click(function() { 538 $('.mod span').text($(this).find('span').text()); 539 $(this).addClass('active').siblings('div').removeClass('active'); 540 $('.bt.v').attr('dataid', $(this).attr('dataid')); 541 $('.product_wrap .art span').text($(this).attr('data-f-sku')); 542 $('.product_wrap .sku_id').val($(this).attr('data-sku')); 543 $('.product_wrap .rrc span').html($(this).attr('dataprice')); 544 $('.product_wrap .red_price span').text($(this).attr('dataopt')); 545 $('.product_wrap .w2 b').last().text($(this).attr('dataza')); 546 console.log($(this).attr('dataza')); 547 $('.product_count span').html($(this).attr('dataq')); 548 $('.product .c3 .bt').text('Ð ÐÐÐ ÐÐÐУ').addClass('buy').removeClass('inBas'); 549 }); 550 551 552 // $.ajax({ 553 // url: '/cart/', 554 // type: 'GET', 555 // success: function(data) { 556 // console.log(data); 557 // if ($(data).find('.cart_product').length != 0) { 558 // total_item = $(data).find('.cart_product').length; 559 // $(".cart_count").html(total_item); 560 // } else { 561 // $(".cart_count").html('0'); 562 // } 563 // } 564 // }); 565}); 566$(document).on('click', '.addtocart', function(response) { 567 var f = $(this).closest('form'); 568 var fly = $(this).closest('.product_fly'); 569 $.post(f.attr('action') + '?html=1', f.serialize(), function(response) { 570 console.log(response); 571 if (response.status == 'ok') { 572 var itemImg = fly.find('img').eq(0); 573 flyToElement($(itemImg), $('.header_cart')); 574 $.ajax({ 575 url: '/cart/', 576 type: 'GET', 577 success: function(data) { 578 total_item = response.data.count; 579 console.log(total_item); 580 $(".cart_count").html(total_item); 581 } 582 }); 583 } else if (response.status == 'fail') { 584 alert(response.errors); 585 } 586 }, "json"); 587 return false;
588}); 589 590function flyToElement(flyer, flyingTo) { 591 var $func = $(this); 592 var divider = 3; 593 var flyerClone = $(flyer).clone(); 594 $(flyerClone).css({ 595 position: 'absolute', 596 top: $(flyer).offset().top + "px", 597 left: $(flyer).offset().left + "px", 598 opacity: 1, 599 'z-index': 1000 600 }); 601 $('body').append($(flyerClone)); 602 var gotoX = $(flyingTo).offset().left + ($(flyingTo).width() / 2) - ($(flyer).width() / divider) / 2; 603 var gotoY = $(flyingTo).offset().top + ($(flyingTo).height() / 2) - ($(flyer).height() / divider) / 2; 604 $(flyerClone).animate({ 605 opacity: 0.4, 606 left: gotoX, 607 top: gotoY, 608 width: $(flyer).width() / divider, 609 height: $(flyer).height() / divider 610 }, 700, function() { 611 $(flyingTo).fadeOut('fast', function() { 612 $(flyingTo).fadeIn('fast', function() { 613 $(flyerClone).fadeOut('fast', function() { 614 $(flyerClone).remove(); 615 }); 616 }); 617 }); 618 }); 619} 620$(document).ready(function() { 621 $('.range-submit').hide(); 622 $(".min_range,.max_range").on('change', function() { 623 $('.range-range-submit').show(); 624 var min_price_range = parseInt($(".range_price").val()); 625 var max_price_range = parseInt($(".range_price").val()); 626 if (min_price_range > max_price_range) { 627 $('.range_price').val(min_price_range); 628 } 629 $(".slider-range").slider({ 630 values: [min_price_range, max_price_range] 631 }); 632 }); 633 $(".min_range,.max_range").on("paste keyup", function() { 634 $('.range-range-submit').show(); 635 var min_price_range = parseInt($(".min_range").val()); 636 var max_price_range = parseInt($(".max_range").val()); 637 if (min_price_range == max_price_range) { 638 max_price_range = min_price_range + 100; 639 $(".min_range").val(min_price_range); 640 $(".max_range").val(max_price_range); 641 } 642 $(".slider-range").slider({ 643 values: [min_price_range, max_price_range] 644 }); 645 }); 646 $(function() { 647 min_price = $('.min_range').attr('min'); 648 max_price = $('.max_range').attr('max'); 649 $(".slider-range").slider({ 650 range: true, 651 orientation: "horizontal", 652 min: 0, 653 max: max_price, 654 values: [min_price, max_price], 655 step: 1, 656 slide: function(event, ui) { 657 if (ui.values[0] == ui.values[1]) { 658 return false; 659 } 660 $(".min_range").val($(".slider-range").slider("values", 0)); 661 $(".max_range").val($(".slider-range").slider("values", 1)); 662 } 663 }); 664 }); 665 $(".slider-range,.range-range-submit").click(function() { 666 var min_price = $('.min_range').val(); 667 var max_price = $('.max_range').val(); 668 $(".searchResults").text("Here List of products will be shown which are cost between " + min_price + " " + "and" + " " + max_price + "."); 669 }); 670 $('.des .control div').click(function() { 671 $(this).addClass('active').siblings('div').removeClass('active'); 672 var tar = $(this).attr('data-tar'); 673 $('.des').find('.l').slideUp(200); 674 $('.' + tar).slideDown(200); 675 console.log(tar); 676 }) 677 $('.panel-group .panel-title').click(function() { 678 console.log('panel'); 679 $(this).parent('.panel-heading').parent('.panel').siblings('.active').removeClass('active'); 680 if ($(this).find('a').attr('aria-expanded') != 'true') { 681 $(this).parent('.panel-heading').parent('.panel').addClass('active'); 682 } else { 683 $(this).parent('.panel-heading').parent('.panel').removeClass('active'); 684 } 685 }) 686 $(document).on('click', '.btMyPop', function() { 687 if ($(this).hasClass('map')) { 688 var map = $(this).attr('data-ymap'); 689 $('#myPop .modal-dialog .cont').html(map); 690 } else { 691 var scr = $(this).attr('data-src'); 692 $('#myPop .modal-dialog .cont').html('<img src="' + scr + '"/>'); 693 } 694 $('#myPop').modal('show'); 695 }) 696 $('.metro_sub_wrap span').click(function() { 697 var metro_id = $(this).closest(".metro_sub_wrap").attr('data-metro'); 698 var this_html = $(this).siblings('div').html(); 699 $('.metro' + metro_id + 'lastsub').html(this_html); 700 $(".mls").hide(); 701 $('.metro' + metro_id + 'lastsub').slideToggle(); 702 $(".metro_icon").text('+'); 703 $(this).text("-"); 704 }); 705}); 706 707function shippingDate() { 708 if (localStorage['city'] == "ÐоÑква") { 709 var date = new Date(); 710 date.setDate(date.getDate() + 1); 711 var dayTomorrow = date.getDate(); 712 var monthTomorrow = date.getMonth() + 1; 713 var yearTomorrow = date.getFullYear(); 714 shipping_date = dayTomorrow + "." + monthTomorrow + "." + yearTomorrow; 715 $('.shipping_date').html(shipping_date); 716 } else { 717 var date = new Date(); 718 date.setDate(date.getDate() + 2); 719 var dayTomorrow = date.getDate(); 720 var monthTomorrow = date.getMonth() + 1; 721 var yearTomorrow = date.getFullYear(); 722 shipping_date = dayTomorrow + "." + monthTomorrow + "." + yearTomorrow; 723 $('.shipping_date').html(shipping_date); 724 } 725}
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.