1$(function() { 2 3 (function(){ 4 var str = document.location.href; 5 var docOrigin = document.location.origin; 6 var docPathname = document.location.pathname; 7 var docSearch = document.location.search; 8 var inVal; 9 var maxInpValue = parseInt($('.shop2-pagelist li.active-select input').attr('max')); 10 var minInpValue = parseInt($('.shop2-pagelist li.active-select input').attr('min')); 11 var isMobile = /webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || /[\?&]panel_fake_mobile=1(&|$)/.test(document.location.search); 12 13 /*if (str.search(/p\/\d+/) == -1) { 14 if (shop2.mode == 'folder') document.location.href = docOrigin + docPathname + '/p/0' + docSearch; 15 } */ 16 17 if(str.search(/p\=\d+/) == -1){ 18 if (shop2.mode == 'search') document.location.href = str.replace('search?','search?p=0&'); 19 } 20 21 $('.shop2-pagelist li.active-select input').on('keyup change', function() { 22 inVal = $('.shop2-pagelist li.active-select input').val()-1; 23 inValTwo = $('.shop2-pagelist li.active-select input').val(); 24 parseInt(inValTwo); 25 inVal.toString(); 26 27 if (inValTwo > maxInpValue) { 28 inVal = maxInpValue - 1; 29 } 30 if (inValTwo < minInpValue) { 31 inVal = minInpValue - 1; 32 } 33 }); 34 35 resizeController(1024, function() { 36 $('.shop2-pagelist li.active-select form').submit(function() { 37 if(str.match(/p\=\d+/)) { 38 document.location.href = str.replace( /p\=\d+/ ,'p' + '=' + inVal); 39 } else { 40 document.location.href = str.replace(/p\/\d+/, 'p' + '/' + inVal); 41 } 42 return false; 43 }); 44 }, function() { 45 $('.shop2-pagelist li.active-select form').submit(function() { 46 if(str.match(/p\=\d+/)) { 47 document.location.href = str.replace( /p\=\d+/ ,'p' + '=' + inVal); 48 } else { 49 document.location.href = str.replace(/p\/\d+/, 'p' + '/' + inVal); 50 } 51 return false; 52 }); 53 }); 54 })(); 55 56 if(/iPod|iPad|iPhone/i.test(navigator.userAgent)){ 57 $(".gr-form").submit(function(e) { 58 var ref = $(this).find("[required]"); 59 $('input, textarea').each(function(){ 60 if ( $(this).val() == '' ) { 61 alert("ÐаполниÑе поле"); 62 e.preventDefault(); 63 return false; 64 } 65 }); return true; 66 }); 67 $(document.documentElement).addClass('ios'); 68 } 69 70 var stiky_panel = function() { 71 var to_top = $(document).scrollTop(); 72 var fixed_panel = $('.header_top_panel').outerHeight(); 73 74 $(window).scroll(function() { 75 var pew_pew = $(document).scrollTop(); 76 77 if (pew_pew > fixed_panel){ 78 $('.header_top_panel').addClass('un_slick');} 79 else { 80 $('.header_top_panel').removeClass('un_slick'); 81 } 82 83 if (pew_pew > to_top){$('.header_top_panel').removeClass('slick');} 84 else {$('.header_top_panel').addClass('slick');} 85 86 87 to_top = $(document).scrollTop(); 88 }); 89 } 90 91 stiky_panel(); 92 93 $('.question').on('tap click', function(){ 94 $(this).next('.shop2-product-discount-desc').toggleClass('active'); 95 }); 96 97 $('.product-amount button').on('touchstart click', function(){ 98 $('div.shop2-cart-update').toggleClass('active'); 99 }); 100 101 $(document).on('touchstart click', function(event) { 102 if ($(event.target).closest('.question, .shop2-product-discount-desc, .tpl-anketa').length) return; 103 $('.shop2-product-discount-desc').removeClass('active'); 104 }); 105 106 (function(){ 107 if(!$('.buy-one-click-wrap').length) return; 108 $('.buy-one-click-wrap > a').on('touchstart click', function(e){ 109 e.preventDefault(); 110 $('.product-includeForm').addClass('active'); 111 112 var productName = $(this).find('.productName').val()+(' ÐолиÑеÑÑво:' + $(this).closest('.product-side-r').find('.shop2-product-amount input[type="text"]').val()), 113 productLink = $(this).find('.productLink').val(); 114 console.log(productName); 115 $('.product-includeForm').addClass('active'); 116 $('.product-includeForm').addClass('active'); 117 setTimeout(function() { 118 $('.product-includeForm input.productName').val(productName); 119 $('.product-includeForm input.productLink').val(productLink); 120 }, 800); 121 }) 122 $(document).on("keydown", function (e) { 123 if (e.keyCode===27) { 124 $('.product-includeForm').removeClass('active'); 125 $('html, body').removeClass('overflowHidden'); 126 127 }; 128 }); 129 })(); 130 131 $(document).on('touchstart click', function(event) { 132 $('.closeBtnForm').click(function(event) { 133 $('.product-includeForm').removeClass('active'); 134 135 if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) { 136 $('html, body').removeClass('overflowHidden'); 137 } else { 138 $(document.documentElement).removeClass('overflowHidden'); 139 } 140 }); 141 if ($('.product-includeForm').hasClass('active')) { 142 if ($(event.target).closest('.tpl-anketa, .buy-one-click-wrap > a').length) return; 143 $('.product-includeForm').removeClass('active'); 144 } 145 146 if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) { 147 $('html, body').removeClass('overflowHidden'); 148 } else { 149 $(document.documentElement).removeClass('overflowHidden'); 150 } 151 }); 152 153 154 $('table').wrap('<div class="table-wrapper"></div>'); 155 156 $(".slider_wrap .owl-carousel").each(function(index, el) { 157 $(el).owlCarousel({ 158 loop: true, 159 autoplay: true, 160 nav: true, 161 items: 1, 162 dots: true 163 }); 164 }); 165 166 $(document).ready(function(){ 167 168 $('.main_blocks_wrapper ul.tabs li:first-child').addClass('current'); 169 $('.main_blocks_wrapper .tab-content').first().addClass('current'); 170 171 $('ul.tabs li').click(function(){ 172 var tab_id = $(this).attr('data-tab'); 173 174 $('ul.tabs li').removeClass('current'); 175 $('.tab-content').removeClass('current'); 176 177 $(this).addClass('current'); 178 $("#"+tab_id).addClass('current'); 179 }) 180 181 }) 182 183 equalheight = function(container){ 184 185 var currentTallest = 0, 186 currentRowStart = 0, 187 rowDivs = new Array(), 188 $el, 189 topPosition = 0; 190 $(container).each(function() { 191 192 $el = $(this); 193 $($el).height('auto') 194 topPostion = $el.position().top; 195 196 if (currentRowStart != topPostion) { 197 for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 198 rowDivs[currentDiv].height(currentTallest); 199 } 200 rowDivs.length = 0; // empty the array 201 currentRowStart = topPostion; 202 currentTallest = $el.height(); 203 rowDivs.push($el); 204 } else { 205 rowDivs.push($el); 206 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 207 } 208 for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 209 rowDivs[currentDiv].height(currentTallest); 210 } 211 }); 212 } 213 214 $(window).load(function() { 215 equalheight('.my-product .product-name'); 216 }); 217 218 219 $(window).resize(function(){ 220 equalheight('.my-product .product-name'); 221 }); 222 223 224 var $owl2 = $('.owl-slider_wrapper .owl-slider-tab'); 225 226 function tabSlider() { 227 228 $owl2.owlCarousel ({ 229 loop: true, 230 autoplay: true, 231 dots: true, 232 nav: true, 233 responsive: { 234 0: { 235 items: 2 236 }, 237 580: { 238 items: 3 239 }, 240 760: { 241 items: 4 242 }, 243 1000: { 244 items: 5 245 } 246 } 247 }); 248 } 249 tabSlider(); 250 251 $('.open_coupon').click(function(){ 252 $('.shop-coupon').addClass('active'); 253 }); 254 $('.close_coupon').click(function(){ 255 $('.shop-coupon').removeClass('active'); 256 }); 257 $(document).on('touchstart click', function(event) { 258 if ($(event.target).closest('.shop-coupon, .open_coupon').length) return; 259 $('.shop-coupon').removeClass('active'); 260 }); 261 262 $('.coupon-field #coupon').on('touchstart click', function(){ 263 $(this).focus(); 264 }); 265 266 var $tabs = $('#horizontalTab'); 267 $tabs.responsiveTabs({ 268 rotate: false, 269 startCollapsed: 'accordion', 270 collapsible: 'accordion', 271 setHash: true, 272 animation: 'slide', 273 scrollToAccordion: true, 274 scrollToAccordionOffset: 85 275 }); 276 277 $('.push_to_menu').click(function() { 278 $('.mobile_navigation').addClass('active'); 279 if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) { 280 $('body').addClass('m_active'); 281 } else { 282 $(document.documentElement).addClass('m_active'); 283 } 284 }); 285 $('.close_button').click(function() { 286 $('.mobile_navigation').removeClass('active'); 287 $('html').removeClass('m_active'); 288 $('body').removeClass('m_active'); 289 }); 290 291 $('.shop-sorting-panel .sorting .sort-title').click(function() { 292 $('.shop-sorting-panel .sorting').toggleClass('active'); 293 }); 294 295 $(document).on('touchstart click', function(event) { 296 if ($(event.target).closest('.shop-sorting-panel .sorting').length) return; 297 $('.shop-sorting-panel .sorting').removeClass('active'); 298 }); 299 300 $(document).on('touchstart click', function(event) { 301 if ($(event.target).closest('.mobile_navigation, .push_to_menu').length) return; 302 $('.mobile_navigation').removeClass('active'); 303 $('html').removeClass('m_active'); 304 $('body').removeClass('m_active'); 305 }); 306 307 priceCalculate(); 308 309 productPicHeight(); 310 $(window).resize(function(){ 311 productPicHeight(); 312 }) 313 314 function productPicHeight() { 315 var thumbPicWidth = $('.product-thumb .product-image').width(); 316 317 $('.product-thumb .product-image').css({ 318 height : thumbPicWidth, 319 lineHeight : thumbPicWidth + "px" 320 }); 321 }; 322 323 resizeController([700, 960], function() { 324 $('.product-thumb:nth-child(4n)').addClass('mr4') 325 $('.product-thumb:nth-child(3n)').removeClass('mr3'); 326 }); 327 resizeController([490, 700], function() { 328 $('.product-thumb:nth-child(4n)').removeClass('mr4'); 329 $('.product-thumb:nth-child(3n)').addClass('mr3') 330 }); 331 resizeController([0, 490], function() { 332 $('.product-thumb:nth-child(4n)').removeClass('mr4'); 333 $('.product-thumb:nth-child(3n)').removeClass('mr3'); 334 $('.product-thumb:nth-child(2n)').addClass('mr2') 335 }); 336 337 (function(){ 338 var $productItem = $('.product-simple'); 339 340 resizeController(560, function() { 341 342 $productItem.each(function() { 343 var $this = $(this), 344 productLeftSimple = $this.find('.product-side-l'), 345 productNameSimple = $this.find('.product-name'), 346 productAnonceSimple = $this.find('.product-anonce');
347 productCompareSimple = $this.find('.product-compare'); 348 productRatingSimple = $this.find('.tpl-stars'); 349 productLeftSimple.append(productNameSimple, productAnonceSimple, productCompareSimple, productRatingSimple); 350 }); 351 352 }, function() { 353 $productItem.each(function() { 354 var $this = $(this), 355 productLeftSimple = $this.find('.product-side-l'), 356 productMiddleSimple = $this.find('.product-side-c'), 357 productLNameSimple = productLeftSimple.find('.product-name'), 358 productLAnonceSimple = productLeftSimple.find('.product-anonce'); 359 productCompareSimple = $this.find('.product-compare'); 360 productRatingSimple = $this.find('.tpl-stars'); 361 productMiddleSimple.prepend(productLNameSimple, productLAnonceSimple, productCompareSimple, productRatingSimple); 362 }); 363 }); 364 })(); 365 366 $('.type-select select').styler({ 367 selectPlaceholder: 'ÐÑе', 368 }); 369 370 $('.form-item input, .option-type input').styler({ 371 }); 372 373 374 resizeController([0, 460], function() { 375 $('.view-shop').on('click', function() { 376 $(this).addClass('show_view'); 377 }); 378 379 $(document).on('touchstart click', function(event) { 380 if ($(event.target).closest('.view-shop').length) return; 381 $('.view-shop').removeClass('show_view'); 382 }); 383 }); 384 385 $('.tpl-title.remember_me input[type="checkbox"]').on('click', function() { 386 if($(this).is(':checked')) { 387 $('.remember_me').addClass('checked'); 388 } else { 389 $('.remember_me').removeClass('checked'); 390 } 391 }); 392 393 if ($(window).width() <= 1024) { 394 395 // $('.menu li').each(function(){ 396 // var elem = '<span></span>'; 397 // if ($(this).children('ul').length > 0) { 398 // console.log('eeeeee') 399 // $(this).html(elem); 400 // $(this).appendTo($(elem)) 401 // } 402 // }); 403 404 405 if ($('.menu li').find('.s1').length == 0){ 406 407 $('.menu li').each(function(){ 408 var $this = $(this), 409 $spanS1 = $('<span class="s1"></span>'); 410 411 if ($this.find('> ul').get(0)) { 412 $this.append($spanS1); 413 } 414 }); 415 } 416 $('.menu').on('click', '.s1', function() { 417 var $this = $(this); 418 var $li = $this.closest('li'); 419 var $ul = $li.find('>ul'); 420 421 if ($li.hasClass('opened')) { 422 $ul.stop().slideUp(200, function(){ 423 424 $li.removeClass('opened'); 425 }); 426 } else { 427 $ul.stop().slideDown(200, function(){ 428 429 $li.addClass('opened'); 430 }); 431 $li.siblings().filter(':has(">ul")').each(function(){ 432 var $this = $(this); 433 $this.find('>ul').stop().slideUp(200, function(){ 434 435 $this.removeClass('opened'); 436 }); 437 }); 438 } 439 }); 440 441 442 } else if ($(window).width() > 1024) { 443 //$('.menu-top-wrapper').prependTo('.table_1 .d-tr'); 444 445 $('.top-menu').s3MenuAllIn({ 446 type: 'bottom', 447 debug: false 448 }); 449 } 450 451 $('.top-menu').oneLineMenu({ 452 minWidth : 940 453 }); 454 455 456}); 457 458 459 460var priceCalculate = function(){ 461 var inputVal = $('.shop-product .product-amount input').val(), 462 currentPrice = $('.shop-product .product-price .price-current strong').text(), 463 oldPrice = $('.shop-product .product-price .price-old strong').text(); 464 465 var currentResult = currentPrice * inputVal; 466 var oldResult = oldPrice * inputVal; 467 468 $('.shop-product .calc_result .current strong').text(currentResult); 469 $('.shop-product .calc_result .old strong').text(oldResult); 470}; 471 472shop2.queue.amount = function() { 473 474 var $document = $(document); 475 476 function validate(input) { 477 var kind = input.data('kind'), 478 max = input.data('max'), 479 val = Number(input.val()), 480 amount = 0, 481 available; 482 483 if (kind && max > 0) { 484 $('input[data-kind=' + kind + ']').each(function() { 485 amount += Number(this.value); 486 }); 487 488 if (amount > max) { 489 available = max - amount + val; 490 input.val(available); 491 shop2.msg(_s3Lang.JS_AVAILABLE_ONLY + ' ' + available, input); 492 } 493 } 494 } 495 496 $document.on('click', '.amount-minus', function() { 497 var $this = $(this), 498 text = $this.siblings('input:text'), 499 value = text.getVal(); 500 501 if (value) { 502 value = value[0]; 503 } 504 value -= shop2.options.amountDefaultInc; 505 value = value.toFixed(5) - 0; 506 507 if (value <= shop2.options.amountDefaultValue) { 508 value = shop2.options.amountDefaultValue; 509 } 510 511 text.val(value); 512 text.trigger('keyup'); 513 514 priceCalculate(); 515 }); 516 517 $document.on('click', '.amount-plus', function() { 518 519 var $this = $(this),
520 text = $this.siblings('input:text'), 521 value = text.getVal(); 522 523 if (value) { 524 value = value[0]; 525 } 526 527 value += shop2.options.amountDefaultInc; 528 value = value.toFixed(5) - 0; 529 530 text.val(value); 531 text.trigger('keyup'); 532 533 priceCalculate(); 534 }); 535 536 $document.on('keyup', '.shop2-product-amount input:text', function() { 537 var $this = $(this); 538 validate($this); 539 540 priceCalculate(); 541 }); 542 543 $document.keyFilter('.shop2-product-amount input:text', { 544 type: shop2.options.amountType 545 }); 546} 547 548shop2.queue.addToCart = function() { 549 550 $(document).on('click', '.shop-product-btn', function(e) { 551 552 var $this = $(this), 553 $form = $this.closest('form'), 554 form = $form.get(0), 555 adds = $form.find('.additional-cart-params'), 556 len = adds.length, 557 i, el, 558 a4 = form.amount.value, 559 kind_id = form.kind_id.value; 560 561 e.preventDefault(); 562 563 if (len) { 564 a4 = { 565 amount: a4 566 }; 567 568 for (i = 0; i < len; i += 1) { 569 el = adds[i]; 570 if (el.value) { 571 a4[el.name] = el.value; 572 } 573 } 574 } 575 576 shop2.cart.add(kind_id, a4, function(d) { 577 578 $('#shop2-cart-preview').replaceWith(d.data); 579 580 if (d.errstr) { 581 shop2.msg(d.errstr, $this); 582 } else { 583 var $text = window._s3Lang.JS_SHOP2_ADD_CART_WITH_LINK; 584 shop2.msg($text.replace('%s', shop2.uri + '/cart'), $this); 585 //shop2.msg(window._s3Lang.JS_ADDED, $this); 586 } 587 588 if (d.panel) { 589 $('#shop2-panel').replaceWith(d.panel); 590 } 591 }); 592 593 }); 594} 595shop2.queue.filter = function() { 596 597 var wrap = $('.shop-filter'), 598 result = $('.result'); 599 600 shop2.filter.init(); 601 602 shop2.on('afterGetSearchMatches', function (d, status) { 603 604 if (d.data.total_found === 0) { 605 606 result.addClass('no-result'); 607 } else { 608 result.removeClass('no-result'); 609 } 610 611 $('#filter-result').html(d.data.total_found); 612 613 result.removeClass('hide'); 614 }); 615 616 wrap.find('.param-val').on('click', function(e) { 617 var $this = $(this), 618 name = $this.data('name'), 619 value = $this.data('value'); 620 621 e.preventDefault(); 622 623 $this.toggleClass('active-val'); 624 shop2.filter.toggle(name, value); 625 shop2.filter.count(); 626 }); 627 628 wrap.find('select').on('change', function() { 629 var $this = $(this), 630 name = this.name, 631 value = $this.val(); 632 633 shop2.filter.remove(name); 634 shop2.filter.add(name, value); 635 shop2.filter.count(); 636 }); 637 638 wrap.find('input:text').keyup(function() { 639 var $this = $(this), 640 name = $this.attr('name'); 641 642 $.s3throttle('filter: ' + name, function() { 643 var value = $this.val(); 644 645 shop2.filter.remove(name); 646 shop2.filter.add(name, value); 647 shop2.filter.count(); 648 }, 500); 649 }); 650 wrap.find('.input_range_slider').on('slide', function(e){ 651 var $this = $(this), 652 $parent = $this.closest('.range_slider_wrapper'), 653 $input = $parent.find('input:text'); 654 655 $.each($input, function(i, elem) { 656 var name = $(elem).attr('name'); 657 658 $.s3throttle('filter: ' + name, function() { 659 var value = $(elem).val(); 660 661 shop2.filter.remove(name); 662 shop2.filter.add(name, value); 663 shop2.filter.count(); 664 }, 500); 665 }); 666 }); 667 668 wrap.find('.shop2-filter-go').on('click', function(e) { 669 e.preventDefault(); 670 shop2.filter.go(); 671 }); 672 673 $('.filter-button.close').on("tap click", function (){ 674 $(this).hide(); 675 $('.filter_wrapper').addClass('opened'); 676 $('.filter-button.open').show() 677 $('.fields_area').css({"display":"block"}); 678 }); 679 680 $('.filter-button.open').on("tap click", function (){ 681 $(this).hide(); 682 $('.filter-button.close').show(); 683 $('.filter_wrapper').removeClass('opened'); 684 $('.fields_area').css({"display":"none"}); 685 }); 686 687} 688shop2.filter.sort = function(name, elem) { 689 var re = new RegExp(this.escape('s[sort_by]') + '=([^&]*)'), 690 params = this.str.match(re), 691 desc = name + ' desc', 692 asc = name + ' asc', 693 isDesc = (elem.is('.sort-param-desc')); 694 695 696 params = (params && params.length > 1) ? params[1] : ''; 697 698 params = (isDesc) ? desc : asc; 699 700 // if (params.indexOf(desc) !== -1) { 701 // params = params.replace(desc, asc); 702 // } else if (params.indexOf(asc) !== -1) { 703 // params = params.replace(asc, desc); 704 // } else if (params !== '') { 705 // params += ',' + desc; 706 // } else { 707 // params = asc; 708 // } 709 710 this.remove('s[sort_by]'); 711 this.add('s[sort_by]', params); 712 return this; 713} 714shop2.queue.sort = function() { 715 var wrap = $('.sorting'); 716 717 wrap.find('.sort-param').on('click', function(e) { 718 var $this = $(this), 719 name = $this.data('name'); 720 721 e.preventDefault(); 722 shop2.filter.sort(name, $this); 723 shop2.filter.go(); 724 }); 725 726 wrap.find('.sort-reset').on('click', function(e) { 727 e.preventDefault(); 728 shop2.filter.remove('s[sort_by]'); 729 shop2.filter.go(); 730 }); 731} 732shop2.queue.cart = function() { 733 734 var updateBtn = $('.shop2-cart-update'), 735 cartTable = $('.shop-cart-table'), 736 form = $('#shop2-cart'); 737 738 shop2.on('afterCartRemoveItem, afterCartUpdate', function() { 739 document.location.reload(); 740 }); 741 742 function updateBtnShow() { 743 updateBtn.show(); 744 } 745
746 cartTable.find('input:text').on('keypress', function(e) { 747 if (e.keyCode == 13) { 748 shop2.cart.update(form); 749 } else { 750 updateBtnShow(); 751 } 752 }); 753 754 cartTable.find('.amount-minus, .amount-plus').on('click', updateBtnShow); 755 756 updateBtn.on('click', function(e) { 757 e.preventDefault(); 758 shop2.cart.update(form); 759 return false; 760 }); 761 762 763 $('.cart-delete a').on('click', function(e) { 764 var $this = $(this), 765 id = $this.data('id'); 766 767 e.preventDefault(); 768 769 shop2.cart.remove(id); 770 771 }); 772 773 }, 774 775 776shop2.queue.search = function() { 777 var custom = $('#shop2_search_custom_fields'), 778 global = $('#shop2_search_global_fields'); 779 780 781 782 shop2.on('afterGetFolderCustomFields', function(d, status) { 783 custom.html(d.data); 784 global.find('input, select').prop('disabled', true); 785 global.hide(); 786 $('.type-select select').styler({ 787 selectPlaceholder: 'ÐÑе', 788 }); 789 790 (function(){ 791 var $tbrow = $('.filter_wrapper .search-form .table-filter-param .table_row'); 792 793 resizeController([940, Infinity], function() { 794 $tbrow.eq(3).addClass('clear_margin'); 795 $tbrow.eq(7).addClass('clear_margin'); 796 $tbrow.eq(11).addClass('clear_margin'); 797 $tbrow.eq(15).addClass('clear_margin'); 798 $tbrow.eq(19).addClass('clear_margin'); 799 $tbrow.eq(23).addClass('clear_margin'); 800 }); 801 resizeController([730, 940], function() { 802 $tbrow.removeClass('clear_margin'); 803 $tbrow.eq(2).addClass('clear_margin'); 804 $tbrow.eq(5).addClass('clear_margin'); 805 $tbrow.eq(8).addClass('clear_margin'); 806 $tbrow.eq(11).addClass('clear_margin'); 807 $tbrow.eq(14).addClass('clear_margin'); 808 $tbrow.eq(17).addClass('clear_margin'); 809 $tbrow.eq(20).addClass('clear_margin'); 810 $tbrow.eq(23).addClass('clear_margin'); 811 $tbrow.eq(26).addClass('clear_margin'); 812 }); 813 resizeController([0, 730], function() { 814 $tbrow.eq(1).addClass('clear_margin'); 815 $tbrow.eq(3).addClass('clear_margin'); 816 $tbrow.eq(5).addClass('clear_margin'); 817 $tbrow.eq(7).addClass('clear_margin'); 818 $tbrow.eq(9).addClass('clear_margin'); 819 $tbrow.eq(11).addClass('clear_margin'); 820 $tbrow.eq(13).addClass('clear_margin'); 821 $tbrow.eq(15).addClass('clear_margin'); 822 $tbrow.eq(17).addClass('clear_margin'); 823 $tbrow.eq(19).addClass('clear_margin'); 824 $tbrow.eq(21).addClass('clear_margin'); 825 $tbrow.eq(23).addClass('clear_margin'); 826 $tbrow.eq(25).addClass('clear_margin'); 827 }); 828 829 })(); 830 831 832 833 }); 834 835 $('#s\\[folder_id\\]').on('change', function() { 836 var $this = $(this), 837 folder_id = $this.val(); 838 839 $('.search_folder_id').attr('action', shop2.uri + '/folder/' + folder_id); 840 841 if (folder_id) { 842 shop2.search.getParams(folder_id); 843 844 resizeController([940, Infinity], function() { 845 $('.filter_wrapper .search-form .table-filter-param .table_row').removeClass('clear_margin'); 846 }); 847 resizeController([0, 730], function() { 848 $('.filter_wrapper .search-form .table-filter-param .table_row').removeClass('clear_margin'); 849 }); 850 851 } else { 852 custom.html(''); 853 global.find('input, select').prop('disabled', false); 854 global.show(); 855 } 856 857 }).trigger('change'); 858 859} 860 861shop2.queue.compare = function() { 862 863 var $document = $(document); 864 865 function update(el, res) { 866 867 // el.closest('.product-compare').replaceWith(res.data); 868 $('input[type=checkbox][value=' + el.val() + ']').closest('.product-compare').replaceWith(res.data); 869 $('input[type=checkbox][value=' + el.val() + ']').find('.amount').replaceWith(res.data); 870 $('.product-compare-added a span').html('(' + res.count + ')'); 871 $('.compare_block .amount').html(res.count); 872 873 if (res.panel) { 874 $('#shop2-panel').replaceWith(res.panel); 875 } 876 877 } 878 879 $document.on('click', '.product-compare input:checkbox', function() { 880 var $this = $(this), 881 action = $this.attr('checked') ? 'del' : 'add'; 882 883 shop2.compare.action(action, $this.val(), function(res, status) { 884 if (status == 'success') { 885 886 if (res.errstr) { 887 shop2.alert(res.errstr); 888 $this.prop('checked', false); 889 } else { 890 update($this, res); 891 } 892 } 893 }); 894 }); 895 $('.compare_block').on('tap click', function(e){ 896 if ($('.compare_block .amount').html() == 0) { 897 return false 898 } else { 899 return true 900 } 901 }); 902 903 }, 904 905 906 $(window).load(function() { 907 $('.row_body').each(function(){ 908 if($(this).children('.jq-selectbox').length != 0) { 909 $(this).parent().addClass('type-select'); 910 }else if($(this).children('.jq-selectbox').length == 0) { 911 $(this).parent().removeClass('type-select'); 912 } 913 }); 914 });
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.