1/* Ammina JS file original /bitrix/js/alexkova.popupad/run_popup.js */ 2;var kzncPopup = { 3 protectTime: 0, 4 delayTime: 1, 5 imagesPath: '', 6 banners: [], 7 showBanners: function () { 8 for (var key in this.banners) { 9 var banner = this.banners[key]; 10 this.showBanner(banner); 11 } 12 }, 13 showBanner: function (banner) { 14 var bannerDelay = banner.INFO.SHOW_TIMER; 15 var delayTimeFinal; 16 if (bannerDelay) 17 delayTimeFinal = parseInt(bannerDelay); 18 else 19 delayTimeFinal = this.delayTime; 20 setTimeout(function () { 21 if (banner.INFO.SHOW_TYPE == 'icon') { 22 kzncPopup.showBannerIcon(banner); 23 } else { 24 kzncPopup.showBannerFancy(banner); 25 } 26 }, 27 delayTimeFinal * 1000 28 ); 29 }, 30 showBannerIcon: function (banner) { 31 var iconParent = jQuery('body'); 32 var bannerStr = "" + 33 "<div " + 34 "class='kznc-popup-icon' " + 35 "id='kznc_popup_icon_" + banner.ID + "' " + 36 "style='" + kzncPopup.getIconStyle(banner) + "'" + 37 ">" 38 + "<div class='kznc-img-container' style='position: relative;'>"; 39 40 if (banner.INFO.ICON_SHOW_IMAGE == "Y") { 41 bannerStr += kzncPopup.getCloseIcon(banner); 42 if (banner.INFO.TARGET) 43 target = " target='" + banner.INFO.TARGET + "' "; 44 if (banner.INFO.TITLE) 45 title = " title='" + banner.INFO.TITLE + "' "; 46 bannerStr += "<img " + 47 "onclick='kzncPopup.openId(" + banner.ID + ");return false;' " + 48 "width='100%' " + 49 "height='100%' " + 50 "style='cursor: pointer;' " + 51 "src='" + banner.INFO.ICON_FILE.SRC + "'" + 52 target + title + 53 " />"; 54 } 55 else { 56 bannerStr += kzncPopup.getCloseIcon(banner); 57 var target = ''; 58 var title = ''; 59 if (banner.INFO.TARGET) 60 target = " target='" + banner.INFO.TARGET + "' "; 61 if (banner.INFO.TITLE) 62 title = " title='" + banner.INFO.TITLE + "' "; 63 if (banner.URL) 64 bannerStr += "<a href='" + banner.URL + "' " + target + title + ">"; 65 66 bannerStr += "" + 67 "<img " + 68 "width='100%' " + 69 "height='100%' " + 70 "style='cursor: pointer;' " + 71 "src='" + banner.INFO.ICON_FILE.SRC + "'" + 72 " />"; 73 if (banner.URL) 74 bannerStr += "</a>"; 75 } 76 77 bannerStr += "</div></div>"; 78 iconParent.append(bannerStr); 79 80 jQuery('#kznc_popup_icon_' + banner.ID).fadeIn(200); 81 var bannerProtectTime = parseInt(banner.INFO.SHOW_PER_TIME); 82 if (bannerProtectTime) 83 kzncPopup.setCookie('KZNC_BANER_ID_SHOWN_' + banner.ID, 84 '1', {expires: bannerProtectTime, path: '/'}); 85 }, 86 showBannerFancy: function (banner) { 87 kzncPopup.open(banner); 88 //protect 89 if (this.protectTime) { 90 kzncPopup.setCookie('KZNC_PROTECT_BANER_SHOW_TIME', '1', {expires: this.protectTime, path: '/'}); 91 } 92 var bannerProtectTime = parseInt(banner.INFO.SHOW_PER_TIME); 93 if (bannerProtectTime) 94 kzncPopup.setCookie('KZNC_BANER_ID_SHOWN_' + banner.ID, 95 '1', {expires: bannerProtectTime, path: '/'}); 96 }, 97 getIconStyle: function (banner) { 98 var place = banner.INFO.ICON_PLACE; 99 var m1 = parseInt(banner.INFO.ICON_MARGIN1); 100 var m1Unit = banner.INFO.ICON_MARGIN1_UNIT; 101 var m2 = parseInt(banner.INFO.ICON_MARGIN2); 102 var m2Unit = banner.INFO.ICON_MARGIN2_UNIT; 103 if (m1Unit == 'pc')m1Unit = '%'; else m1Unit = 'px'; 104 if (m2Unit == 'pc')m2Unit = '%'; else m2Unit = 'px'; 105 if (!m1) m1 = 0; 106 if (!m2) m2 = 0; 107 if (!place) place = 'lt'; 108 109 var position; 110 switch (place) { 111 case 'lt': 112 position = "top:" + m1 + m1Unit + "; left:" + m2 + m2Unit + ";"; 113 break; 114 case 'lb': 115 position = "bottom:" + m1 + m1Unit + "; left:" + m2 + m2Unit + ";"; 116 break; 117 case 'bl': 118 position = "bottom:" + m2 + m2Unit + "; left:" + m1 + m1Unit + ";"; 119 break; 120 case 'br': 121 position = "bottom:" + m2 + m2Unit + "; right:" + m1 + m1Unit + ";"; 122 break; 123 case 'rt': 124 position = "top:" + m1 + m1Unit + "; right:" + m2 + m2Unit + ";"; 125 break; 126 case 'rb': 127 position = "bottom:" + m1 + m1Unit + "; right:" + m2 + m2Unit + ";"; 128 break; 129 } 130 ; 131 var positionType = 'absolute'; 132 if (banner.INFO.ICON_FIXED == 'Y') 133 positionType = 'fixed'; 134 var blockWidth = parseInt(banner.INFO.ICON_WIDTH); 135 var blockHeight = parseInt(banner.INFO.ICON_HEIGHT); 136 var blockZIndex = parseInt(banner.INFO.ICON_Z_INDEX); 137 138 if (!blockZIndex) 139 blockZIndex = '1000'; 140 if (blockWidth) 141 blockWidth = 'width:' + blockWidth + 'px;'; 142 else 143 blockWidth = ''; 144 if (blockHeight) 145 blockHeight = 'height:' + blockHeight + 'px;'; 146 else 147 blockHeight = ''; 148 if (!blockWidth && !blockHeight) { 149 blockWidth = 'width:80px;'; 150 blockHeight = 'height: 80px;'; 151 } 152 153 return "display:none;z-index: " + blockZIndex + "; " + blockWidth + blockHeight + "position:" + positionType + "; " + position; 154 }, 155 getCloseIcon: function (banner) { 156 var showClose = banner.INFO.ICON_SHOW_CLOSE; 157 if (showClose != "Y") 158 return ''; 159 var place = banner.INFO.ICON_PLACE; 160 var closePosition = 'right'; 161 if (place == 'br' || place == 'rt' || place == 'rb') 162 closePosition = 'left'; 163 return "<img class='kznc-close-icon'" +
164 " style='width: 20px;height: 20px;position: absolute;top: -10px;" + closePosition + ": -10px; cursor:pointer;'" + 165 " src='" + this.imagesPath + "/close.png'/>"; 166 }, 167 open: function (banner) { 168 var bannerHtml = this.prepareHtml(banner); 169 if (!bannerHtml) 170 return false; 171 jQuery.fancybox({ 172 content: bannerHtml, 173 padding: 0, 174 scrolling: 'no', 175 wrapCSS: 'kzncfancy', 176 'overlayShow': true, 177 'hideOnOverlayClick': false, 178 'showCloseButton': true 179 }); 180 }, 181 openId: function (id) { 182 kzncPopup.open(kzncPopup.banners[id]); 183 }, 184 getCookie: function (name) { 185 var matches = document.cookie.match(new RegExp( 186 "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" 187 )); 188 return matches ? decodeURIComponent(matches[1]) : undefined; 189 }, 190 setCookie: function (name, value, options) { 191 options = options || {}; 192 193 var expires = options.expires; 194 195 if (typeof expires == "number" && expires) { 196 var d = new Date(); 197 d.setTime(d.getTime() + expires * 1000); 198 expires = options.expires = d; 199 } 200 if (expires && expires.toUTCString) { 201 options.expires = expires.toUTCString(); 202 } 203 204 value = encodeURIComponent(value); 205 206 var updatedCookie = name + "=" + value; 207 208 for (var propName in options) { 209 updatedCookie += "; " + propName; 210 var propValue = options[propName]; 211 if (propValue !== true) { 212 updatedCookie += "=" + propValue; 213 } 214 } 215 216 document.cookie = updatedCookie; 217 }, 218 closeIcon: function (obj) { 219 if (jQuery.type(obj) != 'object') 220 return false; 221 obj.closest('.kznc-popup-icon').fadeOut(200); 222 }, 223 prepareHtml:function(banner){ 224 return "<div class='kznc-popupad-fancybox-banner' id='kznc-popupad-fancybox-banner" + banner.ID +"'>"+banner.HTML+"</div>" 225 } 226}; 227if (window.jQuery) { 228 jQuery(document).ready(function() { 229 jQuery.ajax({ 230 type: 'post', 231 dataType: 'json', 232 url: '/bitrix/tools/alexkova.popupad/run_popup.php', 233 data: { 234 backurl: window.location.pathname 235 }, 236 success: function (data) { 237 if (typeof data != "object") 238 return; 239 kzncPopup.banners = data.BANNERS; 240 kzncPopup.delayTime = +data.OPTIONS.DELAY; 241 kzncPopup.protectTime = +data.OPTIONS.PROTECT_TIME; 242 kzncPopup.imagesPath = data.IMAGES_PATH 243 kzncPopup.showBanners(); 244 } 245 }); 246 jQuery(document).on('click','.kznc-close-icon', function () { 247 kzncPopup.closeIcon(jQuery(this)); 248 }) 249 }); 250} 251else { 252 console.log('alexkova.popupad: jQuery is not defined'); 253};/* Ammina JS file original /bitrix/templates/market2_v1/js/script.js */ 254;(function (window) { 255 256 jQuery.easing['jswing'] = jQuery.easing['swing']; 257 258 jQuery.extend( jQuery.easing, 259 { 260 easeOutBounce: function (x, t, b, c, d) { 261 if ((t/=d) < (1/2.75)) { 262 return c*(7.5625*t*t) + b; 263 } else if (t < (2/2.75)) { 264 return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 265 } else if (t < (2.5/2.75)) { 266 return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 267 } else { 268 return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 269 } 270 }, 271 easeOutElastic: function (x, t, b, c, d) { 272 var s=1.70158;var p=0;var a=c; 273 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 274 if (a < Math.abs(c)) { a=c; var s=p/4; } 275 else var s = p/(2*Math.PI) * Math.asin (c/a); 276 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 277 }, 278 easeOutExpo: function (x, t, b, c, d) { 279 return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 280 } 281 });
282 283 284 window.BXReady = { 285 coreData: {}, 286 rScroll: { 287 b: null, 288 k: null, 289 z: 0, 290 p: 20, 291 n: 0, 292 n2: 20, 293 n3: 30, 294 }, 295 lScroll: { 296 b: null, 297 k: null, 298 z: 0, 299 p: 20, 300 n: 20, 301 n2: 0, 302 n3: 0, 303 }, 304 dScroll: { 305 b: null, //styled div 306 k: null, //scroll to bottom 307 z: 0, //stop top position 308 p: 20, //top stop edge 309 n: 20, //bottom stop edge 310 n2: 0, 311 n3: 0, 312 }, 313 314 showAjaxShadow: function(element, idArea, localeShadow){ 315 316 if (localeShadow == true){ 317 $(element).addClass('ajax-shadow'); 318 $(element).addClass('ajax-shadow-r'); 319 } 320 else{ 321 if ($('div').is('#'+idArea)){ 322 323 } 324 else 325 { 326 $('<div id="'+idArea+'" class="ajax-shadow"><div class=" fa-ajax-shadow"></div></div>').appendTo('body'); 327 } 328 329 $('#'+idArea).show(); 330 $('#'+idArea).width($(element).width()); 331 $('#'+idArea).height($(element).outerHeight()); 332 $('#'+idArea).css('top', $(element).offset().top+'px'); 333 $('#'+idArea).css('left', $(element).offset().left+'px'); 334 } 335 336 }, 337 338 closeAjaxShadow: function(idArea, localShadow){ 339 if (localShadow == true){ 340 $(idArea).removeClass('ajax-shadow-r'); 341 $(idArea).removeClass('ajax-shadow'); 342 } 343 else{ 344 $('#'+idArea).hide(); 345 } 346 }, 347 348 scrollTo: function(targetElement){ 349 350 $("html, body").animate({ 351 scrollTop: $(targetElement).offset().top-20 + "px" 352 }, { 353 duration: 500 354 }); 355 }, 356 357 autosizeVertical: function(){ 358 maxHeight = 0; 359 $('div.bxr-v-autosize').each(function(){ 360 if ($(this).height()> maxHeight){ 361 maxHeight = $(this).height(); 362 }; 363 }); 364 $('div.bxr-v-autosize').each(function(){ 365 366 delta = Math.round((maxHeight - $(this).height())/2); 367 $(this).css({'padding-top': delta+'px', 'padding-bottom': delta+'px'}); 368 }); 369 }, 370 371 setMinPageHeight: function () { 372 minHeight = $(window).height() - $('#panel').height() - $('header').height() - $('footer').height(); 373 $('.bxr-page-content').css('min-height', minHeight+'px'); 374 }, 375 /* 376 * params: 377 * el - object to fix on scroll, e.g. $('#col') 378 * bottomLine - block is bottom line, e.g. '#bottom' 379 * symbol - key of BXReady array with scroll params 380 * clearStyles - if you don't need to fix col on screen width less than 1200 381 * setLeftMargin - set left margin on screen width more than 1239 382 * */ 383 fixColScroll: function (element, bottomLine, symbol, clearStyles, setLeftMargin) { 384 if (element == null || element == 'undefined') return; 385 var a = (typeof(element) == 'string') ? document.querySelector(element) : element; 386 if (a == null || a == 'undefined') return; 387 if ( ((document.body.clientWidth < 1200 && element != '#bxr-left-col') 388 || (document.body.clientWidth < 768 && element == '#bxr-left-col')) 389 && clearStyles) { 390 $(".bxr-sticky-col").removeAttr("style"); 391 $(".bxr-stop-col").removeAttr("style"); 392 $(element).removeAttr("style"); 393 return; 394 } 395 var Ra = a.getBoundingClientRect(), 396 R1bottom = document.querySelector(bottomLine).getBoundingClientRect().bottom; 397 398 if (Ra.bottom < R1bottom) { 399 if (BXReady[symbol]['b'] == null) { 400 var Sa = getComputedStyle(a, ''), s = ''; 401 for (var i = 0; i < Sa.length; i++) { 402 if (Sa[i].indexOf('overflow') == 0 || Sa[i].indexOf('padding') == 0 || Sa[i].indexOf('border') == 0 || Sa[i].indexOf('outline') == 0 || Sa[i].indexOf('box-shadow') == 0 || Sa[i].indexOf('background') == 0) { 403 s += Sa[i] + ': ' +Sa.getPropertyValue(Sa[i]) + '; ' 404 } 405 } 406 BXReady[symbol]['b'] = document.createElement('div'); 407 BXReady[symbol]['b'].className = "bxr-stop-col"; 408 BXReady[symbol]['b'].style.cssText = s + ' box-sizing: border-box; width: ' + a.offsetWidth + 'px;'; 409 if (document.body.clientWidth >
409 1239 && setLeftMargin) 410 BXReady[symbol]['b'].style.cssText += 'margin-left: -10px'; 411 a.insertBefore(BXReady[symbol]['b'], a.firstChild); 412 var l = a.childNodes.length; 413 for (var i = 1; i < l; i++) { 414 BXReady[symbol]['b'].appendChild(a.childNodes[1]); 415 } 416 a.style.height = BXReady[symbol]['b'].getBoundingClientRect().height + 'px'; 417 a.style.padding = '0'; 418 a.style.border = '0'; 419 } 420 var Rb = BXReady[symbol]['b'].getBoundingClientRect(), 421 Rh = Ra.top + Rb.height, 422 W = document.documentElement.clientHeight, 423 R1 = Math.round(Rh - R1bottom), 424 R2 = Math.round(Rh - W); 425 if (Rb.height > W) { 426 if (Ra.top < BXReady[symbol]['k']) { /* scroll down */ 427 if (R2 + BXReady[symbol]['n'] > R1) { /* don't go to the bottom */ 428 if (Rb.bottom - W + BXReady[symbol]['n']-BXReady[symbol]['n2'] <= 0) { // catch 429 BXReady[symbol]['b'].className = 'bxr-sticky-col'; 430 BXReady[symbol]['b'].style.top = W - Rb.height - BXReady[symbol]['n'] + 'px'; 431 BXReady[symbol]['z'] = BXReady[symbol]['n'] + Ra.top + Rb.height - W; 432 } else { 433 BXReady[symbol]['b'].className = 'bxr-stop-col'; 434 BXReady[symbol]['b'].style.top = - BXReady[symbol]['z'] + 'px'; 435 } 436 } else { 437 BXReady[symbol]['b'].className = 'bxr-stop-col'; 438 BXReady[symbol]['b'].style.top = (- R1-BXReady[symbol]['n3']) +'px'; 439 BXReady[symbol]['z'] = R1; 440 } 441 } else { /* scroll up */ 442 if (Ra.top - BXReady[symbol]['p'] < 0) { /* don't go to the top */ 443 if (Rb.top - BXReady[symbol]['p'] >= 0) { /* catch */ 444 BXReady[symbol]['b'].className = 'bxr-sticky-col'; 445 BXReady[symbol]['b'].style.top = BXReady[symbol]['p'] + 'px'; 446 BXReady[symbol]['z'] = Ra.top - BXReady[symbol]['p']; 447 } else { 448 BXReady[symbol]['b'].className = 'bxr-stop-col'; 449 BXReady[symbol]['b'].style.top = - BXReady[symbol]['z'] + 'px'; 450 } 451 } else { 452 BXReady[symbol]['b'].className = ''; 453 BXReady[symbol]['b'].style.top = ''; 454 BXReady[symbol]['z'] = 0; 455 } 456 } 457 BXReady[symbol]['k'] = Ra.top; 458 } else { 459 if ((Ra.top - BXReady[symbol]['p']) <= 0) { 460 if ((Ra.top - BXReady[symbol]['p']) <= R1) { 461 BXReady[symbol]['b'].className = 'bxr-stop-col'; 462 BXReady[symbol]['b'].style.top = - R1 - BXReady[symbol]['p'] +'px'; 463 } else { 464 BXReady[symbol]['b'].className = 'bxr-sticky-col'; 465 BXReady[symbol]['b'].style.top = BXReady[symbol]['p'] + 'px'; 466 } 467 } else { 468 BXReady[symbol]['b'].className = ''; 469 BXReady[symbol]['b'].style.top = ''; 470 } 471 } 472 window.addEventListener('resize', function() { 473 a.children[0].style.width = getComputedStyle(a, '').width 474 }, false); 475 } 476 } 477 }; 478 479 window.BXReady.Market = { 480 loader: [], 481 bestsellersAjaxUrl: '/ajax/bestsellers.php', 482 markersAjaxUrl: '/ajax/markers.php', 483 basketValues: {}, 484 setBasketIds: function(id, addMess, mainWrap) { 485 id = parseInt(id); 486 487 btnWrap = $(mainWrap); 488 bxSubscribe = btnWrap.find('.bxr-subscribe-wrap'); 489 bxrSubscribe = btnWrap.find('.bxr-detail-product-request'); 490 bxrBasket = btnWrap.find('.bxr-currnet-torg'); 491 bxrOneClickBuy = btnWrap.find('.bxr-one-click-buy'); 492 493 if (id <= 0) { 494 bxrSubscribe.hide(); 495 bxSubscribe.hide(); 496 bxrBasket.hide(); 497 if (bxrOneClickBuy.length > 0) 498 bxrOneClickBuy.hide(); 499 500 return; 501 } 502 arElement = BXReady.Market.basketValues[id]; 503 msg = arElement["MSG"] + addMess; 504 505 if (arElement["CATALOG_QUANTITY"] <= 0 && arElement["CATALOG_CAN_BUY_ZERO"] == "N" || arElement["HAS_PRICE"] == "N") { 506 if (arElement["CATALOG_SUBSCRIBE"] == "Y") { 507 bxrSubscribe.hide(); 508 bxSubscribe.show(); 509 bxrBasket.hide(); 510 if (bxrOneClickBuy.length > 0) 511 bxrOneClickBuy.hide(); 512 513 bxSubscribe.find(".bxr-detail-subscribe").attr("data-item", arElement["OFFER_ID"]); 514 bxSubscribe.find(".bxr-detail-subscribe").data("item", arElement["OFFER_ID"]); 515 bxSubscribe.find(".already-subsc").attr("data-item", arElement["OFFER_ID"]); 516 bxSubscribe.find(".already-subsc").data("item", arElement["OFFER_ID"]); 517 jsOb = bxSubscribe.find(".bxr-detail-subscribe").data("js"); 518 jsObA = bxSubscribe.find(".already-subsc").data("js"); 519 if (jsOb != undefined && window[jsOb] != undefined) 520 window[jsOb].checkSubscribe(); 521 if (jsObA != undefined && window[jsOb] != undefined) 522 window[jsObA].checkSubscribe(); 523 } else { 524 bxrSubscribe.show(); 525 bxSubscribe.hide(); 526 bxrBasket.hide(); 527 if (bxrOneClickBuy.length > 0) 528 bxrOneClickBuy.hide(); 529 530 bxrSubscribe.attr("data-oid", arElement["OFFER_ID"]); 531 bxrSubscribe.data("oid", arElement["OFFER_ID"]); 532 } 533 } else { 534 bxrSubscribe.hide(); 535 bxSubscribe.hide(); 536 bxrBasket.show(); 537 if (bxrOneClickBuy.length > 0) 538 bxrOneClickBuy.show(); 539 540 bxrBasket.find(".bxr-quantity-button-minus").attr("data-item", arElement["OFFER_ID"]); 541 bxrBasket.find(".bxr-quantity-text").attr("data-item", arElement["OFFER_ID"]); 542 bxrBasket.find(".bxr-quantity-button-plus").attr("data-item", arElement["OFFER_ID"]); 543 bxrBasket.find(".bxr-basket-item-id").attr("data-item", arElement["OFFER_ID"]); 544 545 bxrBasket.find(".bxr-quantity-button-minus").data("item", arElement["OFFER_ID"]); 546 bxrBasket.find(".bxr-quantity-text").data("item", arElement["OFFER_ID"]); 547 bxrBasket.find(".bxr-quantity-button-plus").data("item", arElement["OFFER_ID"]); 548 bxrBasket.find(".bxr-basket-item-id").data("item", arElement["OFFER_ID"]); 549 550 bxrBasket.find(".bxr-quantity-button-minus").attr("data-ratio", arElement["RATIO"]); 551 bxrBasket.find(".bxr-quantity-button-plus").attr("data-ratio", arElement["RATIO"]); 552 553 bxrBasket.find(".bxr-quantity-button-minus").data("ratio", arElement["RATIO"]); 554 bxrBasket.find(".bxr-quantity-button-plus").data("ratio", arElement["RATIO"]); 555 556 bxrBasket.find(".bxr-quantity-button-plus").attr("data-max", arElement["QTY_MAX"]); 557 bxrBasket.find(".bxr-quantity-button-plus").data("max", arElement["QTY_MAX"]); 558 559 bxrBasket.find(".bxr-quantity-text").val(arElement["START_QTY"]); 560 bxrBasket.find(".bxr-basket-item-id").val(arElement["OFFER_ID"]); 561 562 bxrOneClickBuy.attr("data-oid", arElement["OFFER_ID"]); 563 bxrOneClickBuy.data("oid", arElement["OFFER_ID"]); 564 } 565 }, 566 567 setPriceIds: function(id, show, mainWrap) { 568 wrap = $(mainWrap); 569 wrap.find('.bxr-detail-offers-price-wrap').hide(); 570 if (show) { 571 wrap.find('.bxr-detail-price-wrap').hide(); 572 wrap.find(mainWrap+'_offer_'+id).show(); 573 } else 574 wrap.find('.bxr-detail-price-wrap').show(); 575 }, 576 577 setAvailBlock: function(id, mainWrap) { 578 wrap = $(mainWrap); 579 wrap.find('.bxr-detail-avail-wrap').hide(); 580 wrap.find('.bxr-detail-offer-avail-wrap').hide(); 581 if (id > 0) 582 $(mainWrap+'-'+id).show(); 583 else 584 wrap.find('.bxr-detail-avail-wrap').show(); 585 } 586 }; 587 588 $(document).on('click', '.search-btn', function() { 589 var search = $('#searchline'); 590 if(search.is(":visible")) 591 search.fadeOut(); 592 else 593 search.fadeIn(); 594 });
595 596 $(document).on('click', '.delivery-item-more', function() { 597 if ($(this).prev('.delivery-item-text').css('display') == 'none'){ 598 $(this).prev('.delivery-item-text').slideDown(); 599 $(this).find('.fa-angle-down-js').hide(); 600 $(this).find('.fa-angle-up-js').show(); 601 } else { 602 $(this).prev('.delivery-item-text').slideUp(); 603 $(this).find('.fa-angle-down-js').show(); 604 $(this).find('.fa-angle-up-js').hide(); 605 } 606 return false; 607 }); 608 609 window.onload = function() 610 { 611 if (typeof window.BXReady.Market.loader != 'object') 612 window.BXReady.Market.loader = []; 613 for ( var i in window.BXReady.Market.loader ) 614 { 615 if ( typeof( window.BXReady.Market.loader[i] ) == 'function' ) window.BXReady.Market.loader[i](); 616 } 617 }; 618 619 if (typeof window.BXReady.Market.loader != 'object') 620 window.BXReady.Market.loader = []; 621 window.BXReady.Market.loader.push(BXReady.autosizeVertical); 622 window.BXReady.Market.loader.push(BXReady.setMinPageHeight); 623 624 625 $(window).resize(function() { 626 BXReady.autosizeVertical(); 627 BXReady.setMinPageHeight(); 628 }); 629 630 $(document).ready(function() { 631 BXReady.setMinPageHeight(); 632 633 window.addEventListener('scroll', function() { BXReady.fixColScroll('#bxr-right-col', '#bxr-page-content', 'rScroll', true, true) }, false); 634 document.body.addEventListener('scroll', function() { BXReady.fixColScroll('#bxr-right-col', '#bxr-page-content', 'rScroll', true, true) }, false); 635 636 window.addEventListener('scroll', function() { BXReady.fixColScroll('#bxr-right-col-detail', '#bxr-page-content', 'dScroll', true, true) }, false); 637 document.body.addEventListener('scroll', function() { BXReady.fixColScroll('#bxr-right-col-detail', '#bxr-page-content', 'dScroll', true, true) }, false); 638 window.addEventListener('scroll', function() { BXReady.fixColScroll('#bxr-left-col', '#bxr-page-content', 'lScroll', true, false) }, false); 639 document.body.addEventListener('scroll', function() { BXReady.fixColScroll('#bxr-left-col', '#bxr-page-content', 'lScroll', true, false) }, false); 640 }); 641 642})(window);;/* Ammina JS file original /bitrix/templates/market2_v1/js/rpanel.js */ 643;function setPanelClasses() { 644 rightPanelDefClasses = { 645 first: 'bxr-right-panel-xl-first', 646 second: 'bxr-right-panel-xl-second', 647 third: 'bxr-right-panel-xl-third' 648 }; 649 650 lessXlClasses = { 651 rightColId: 'bxr-right-col-disabled', 652 rightCol: 'bxr-col-panel bxr-right-panel bxr-right-panel-v1 hidden-sm hidden-xs', 653 content: 'bxr-right-panel-content', 654 scroll: 'bxr-content-block bxr-content-scroll', 655 scrollRemove: 'scroll-wrapper', 656 scrollContentRemove: 'scroll-content' 657 }; 658 659 xlClasses = { 660 rightColId: 'bxr-right-col', 661 rightCol: 'col-xl-2 bxr-right-col bxr-right-col-show', 662 cloud: 'bxr-cloud-all bxr-cloud-padding bxr-b20', 663 sticky: 'bxr-sticky-col', 664 scrollRemove: 'bxr-removed-scroll' 665 }; 666 667 if (window.innerWidth > 1919 && BXReady.coreData.xl_mode && BXReady.coreData.right_column == "Y") { 668 xlAttr = $('.bxr-right-panel-xl').attr('style'); 669 $('.bxr-right-panel-xl').data('scroll-style', xlAttr); 670 671 scwAttr = $('.'+lessXlClasses.scrollRemove).attr('style'); 672 $('.bxr-right-panel-xl').data('scroll-wrapper', scwAttr); 673 674 scAttr = $('.'+lessXlClasses.scrollContentRemove).attr('style'); 675 $('.bxr-right-panel-xl').data('scroll-content', scAttr); 676 677 $('.bxr-right-panel-xl').removeAttr('style'); 678 $('.bxr-right-panel-xl').removeClass(lessXlClasses.rightCol); 679 $('.bxr-right-panel-xl').addClass(xlClasses.rightCol); 680 681 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first).removeClass(lessXlClasses.content); 682 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first).addClass(xlClasses.cloud); 683 684 if ($('.bxr-right-panel-xl .'+rightPanelDefClasses.first+'>div').hasClass(lessXlClasses.scrollRemove)) { 685 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first+'>div').removeAttr('class'); 686 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first+'>div').removeAttr('style'); 687 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first+'>div').addClass(xlClasses.scrollRemove); 688 } 689 690 $('.bxr-right-panel-xl .'+rightPanelDefClasses.second).removeClass(lessXlClasses.scroll); 691 $('.bxr-right-panel-xl .'+rightPanelDefClasses.second).removeClass(lessXlClasses.scrollContentRemove); 692 $('.bxr-right-panel-xl .'+rightPanelDefClasses.second).removeAttr('style'); 693 694 if ($('#bxr-right-col').length == 0) { 695 $('.bxr-right-panel-xl').attr('id', xlClasses.rightColId); 696 697 if (!$('.bxr-right-panel-xl>div').hasClass(rightPanelDefClasses.first)) { 698 scrollStyle = $('.bxr-right-panel-xl').data('sticky-style'); 699 if (scrollStyle != "") 700 $('.bxr-right-panel-xl>div').attr('style', scrollStyle); 701 $('.bxr-right-panel-xl>div').addClass(xlClasses.sticky); 702 } 703 704 } 705 if (typeof(BXReadySidebar) === 'object') { 706 BXReadySidebar.showSidebarPanel(); 707 } 708 } else { 709 if (!$('.bxr-right-panel-xl>div').hasClass(rightPanelDefClasses.first)) { 710 scrollStyle = $('.bxr-right-panel-xl>div').attr('style'); 711 $('.bxr-right-panel-xl').data('sticky-style', scrollStyle); 712 $('.bxr-right-panel-xl>div').removeAttr('class'); 713 $('.bxr-right-panel-xl>div').removeAttr('style'); 714 } 715 $('.bxr-right-panel-xl').removeAttr('style'); 716 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first).removeClass(xlClasses.cloud); 717 718 $('.bxr-right-panel-xl').attr('id', lessXlClasses.rightColId); 719 $('.bxr-right-panel-xl').removeClass(xlClasses.rightCol); 720 $('.bxr-right-panel-xl').addClass(lessXlClasses.rightCol); 721 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first).addClass(lessXlClasses.content); 722 $('.bxr-right-panel-xl .'+rightPanelDefClasses.second).addClass(lessXlClasses.scroll); 723 $('.bxr-right-panel-xl .'+rightPanelDefClasses.second).addClass(lessXlClasses.scrollContentRemove); 724 725 xlAttr = $('.bxr-right-panel-xl').data('scroll-style'); 726 if (xlAttr != "") 727 $('.bxr-right-panel-xl').attr('style', xlAttr); 728 729 scwAttr = $('.bxr-right-panel-xl').data('scroll-wrapper'); 730 731 scAttr = $('.bxr-right-panel-xl').data('scroll-content'); 732 if (scAttr != "") 733 $('.'+lessXlClasses.scroll).attr('style', scAttr); 734 735 if ($('.bxr-right-panel-xl .'+rightPanelDefClasses.first+'>div').hasClass(xlClasses.scrollRemove)) { 736 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first+'>div').removeClass(xlClasses.scrollRemove); 737 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first+'>div').removeClass(lessXlClasses.scrollContentRemove); 738 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first+'>div').addClass(lessXlClasses.scrollRemove); 739 $('.bxr-right-panel-xl .'+rightPanelDefClasses.first+'>div').addClass(lessXlClasses.scroll); 740 if (scwAttr != "") 741 $('.'+lessXlClasses.scrollRemove).attr('style', scwAttr); 742 } 743 744 setRightPanelContentMaxHeight(); 745 setLeftMarginRightPanel(); 746 } 747} 748 749var pageContentBlock = ".bxr-page-content"; 750 rightOrigin = -290, 751 rightBlock = ".bxr-right-panel", 752 rightPanelBtn = ".bxr-right-panel-btn-on-top", 753 closeMenu = false, 754 adminPanelHeight = $('#panel').height(); 755 topFixedPanelHeight = $(".bxr-top-fixed-panel").height(), 756 scrollSpeed = 30; 757 758function rightPanelClose() { 759 $(".bxr-right-panel-content").css("right", rightOrigin+"px"); 760} 761 762$(document).on("click", rightPanelBtn, function() { 763 if ($(this).data("state") == "minimized") { 764 var hTop = $('.bxr-header-panel').offset().top; 765 var hHeight = $('.bxr-header-panel').height(); 766 var rTop = hTop + hHeight; 767 $(rightBlock).css("top", rTop + "px"); 768 $(pageContentBlock).addClass('visible-right-panel'); 769 setRightPanelContentMaxHeight(); 770 $(rightBlock).show('50', function() { 771 $(".bxr-right-panel-content").css("right", "-1px"); 772 }); 773 774 if (typeof(BXReadySidebar) === 'object') { 775 BXReadySidebar.showSidebarPanel(); 776 } 777 778 } else if ($(this).data("state") == "maximized") {
779 $(rightBlock).removeClass('bxr-diamond-shadow'); 780 rightPanelClose(); 781 if (typeof(BXReadySidebar) === 'object') { 782 BXReadySidebar.closeSideBarPanel(); 783 } 784 } 785}) 786 787$(document).on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", ".bxr-right-panel-content",function(event){ 788 if (!$(event.target).hasClass("bxr-right-panel-content")) return; 789 if ($(rightPanelBtn).data("state") == "minimized") { 790 $(rightPanelBtn).data("state", "maximized"); 791 $(rightBlock).addClass('bxr-diamond-shadow'); 792 } else if ($(rightPanelBtn).data("state") == "maximized") { 793 $(rightPanelBtn).data("state", "minimized"); 794 $(rightBlock).hide(); 795 $(pageContentBlock).removeClass('visible-right-panel'); 796 } 797}); 798 799function setRightPanelContentMaxHeight() { 800 bottomBlock = $('.bxr-right-panel .bxr-bottom-block'); 801 topBlock = $('.bxr-right-panel .bxr-top-block'); 802 allHeight = $('.bxr-right-panel').height(); 803 bHeight = bottomBlock.height(); 804 tHeight = topBlock.height(); 805 topHeight = $(".bxr-header-panel").height() + $('#panel').height(); 806 807 bottomBlock.css("bottom", topHeight+'px'); 808 809 $('.bxr-right-panel-content .bxr-content-scroll').scrollbar(); 810 sHeight = allHeight - (tHeight + bHeight + topHeight); 811 bodyHeight = $('body').height(); 812 sHeight = (bodyHeight < sHeight) ? bodyHeight : sHeight; 813 814 sHeight = bodyHeight - topHeight; 815 816 $('.bxr-right-panel-content .scroll-content').closest('.scroll-wrapper').find('.scroll-content').css('height', sHeight+'px'); 817 $('.bxr-right-panel-content .scroll-content').closest('.scroll-wrapper').find('.scroll-content').css('max-height', sHeight+'px'); 818 $('.bxr-right-panel-content .scroll-content').closest('.scroll-wrapper').css('height', sHeight+'px'); 819 $('.bxr-right-panel-content .scroll-content').closest('.scroll-wrapper').css('max-height', sHeight+'px'); 820 $('.bxr-right-panel').css('height', sHeight+'px'); 821 822 $('.scroll-bar').addClass('bxr-color'); 823} 824 825function setLeftMarginRightPanel() { 826 if (rightBlock && $('.bxr-page-content') && $('.bxr-page-content').offset() != undefined) { 827 offset = $('.bxr-page-content').offset().left; 828 offset = Math.ceil(offset); 829 rWidth = parseInt($('.bxr-page-content').css('width')); 830 rMargin = parseInt($('.bxr-page-content').css('margin-left')); 831 newLeft = offset + rWidth + rightOrigin + rMargin; 832 rWidth = parseInt($(rightBlock).css('left', newLeft + 'px')); 833 } 834} 835 836$(window).on("load", function() { 837 setPanelClasses(); 838}) 839 840$(window).on ('resize', function() { 841 setPanelClasses(); 842}); 843 844var inScrollContent = false, scrollContent = false; 845 846$(document).on("click", "body", function(event) { 847 if ($(event.target).closest(rightBlock).length) 848 return; 849 if ($(rightPanelBtn).data("state") == "maximized") 850 rightPanelClose(); 851});;/* Ammina JS file original /bitrix/templates/market2_v1/library/bootstrap/js/bootstrap.min.js */ 852; 853/*! 854 * Bootstrap v3.3.5 (http://getbootstrap.com) 855 * Copyright 2011-2016 Twitter, Inc. 856 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 857 */ 858/*! 859 * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=3823d6e109e842e853162b56c19c9122) 860 * Config saved to config.json and https://gist.github.com/3823d6e109e842e853162b56c19c9122 861 */ 862if(typeof jQuery==="undefined"){throw new Error("Bootstrap's JavaScript requires jQuery")}+function(b){var a=b.fn.jquery.split(" ")[0].split(".");if((a[0]<2&&a[1]<9)||(a[0]==1&&a[1]==9&&a[2]<1)||(a[0]>2)){throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}}(jQuery);+function(d){var b=function(f,e){this.options=e;this.$body=d(document.body);this.$element=d(f);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=false;
862if(this.options.remote){this.$element.find(".modal-content").load(this.options.remote,d.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))}};b.VERSION="3.3.6";b.TRANSITION_DURATION=300;b.BACKDROP_TRANSITION_DURATION=150;b.DEFAULTS={backdrop:true,keyboard:true,show:true};b.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)};b.prototype.show=function(h){var f=this;var g=d.Event("show.bs.modal",{relatedTarget:h});this.$element.trigger(g);if(this.isShown||g.isDefaultPrevented()){return}this.isShown=true;this.checkScrollbar();this.setScrollbar();this.$body.addClass("modal-open");this.escape();this.resize();this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',d.proxy(this.hide,this));this.$dialog.on("mousedown.dismiss.bs.modal",function(){f.$element.one("mouseup.dismiss.bs.modal",function(i){if(d(i.target).is(f.$element)){f.ignoreBackdropClick=true}})});this.backdrop(function(){var j=d.support.transition&&f.$element.hasClass("fade");if(!f.$element.parent().length){f.$element.appendTo(f.$body)}f.$element.show().scrollTop(0);f.adjustDialog();if(j){f.$element[0].offsetWidth}f.$element.addClass("in");f.enforceFocus();var i=d.Event("shown.bs.modal",{relatedTarget:h});j?f.$dialog.one("bsTransitionEnd",function(){f.$element.trigger("focus").trigger(i)}).emulateTransitionEnd(b.TRANSITION_DURATION):f.$element.trigger("focus").trigger(i)})};b.prototype.hide=function(f){if(f){f.preventDefault()}f=d.Event("hide.bs.modal");this.$element.trigger(f);if(!this.isShown||f.isDefaultPrevented()){return}this.isShown=false;this.escape();this.resize();d(document).off("focusin.bs.modal");this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal");this.$dialog.off("mousedown.dismiss.bs.modal");d.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",d.proxy(this.hideModal,this)).emulateTransitionEnd(b.TRANSITION_DURATION):this.hideModal()};b.prototype.enforceFocus=function(){d(document).off("focusin.bs.modal").on("focusin.bs.modal",d.proxy(function(f){if(this.$element[0]!==f.target&&!this.$element.has(f.target).length){this.$element.trigger("focus")}},this))};b.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on("keydown.dismiss.bs.modal",d.proxy(function(f){f.which==27&&this.hide()},this))}else{if(!this.isShown){this.$element.off("keydown.dismiss.bs.modal")}}};b.prototype.resize=function(){if(this.isShown){d(window).on("resize.bs.modal",d.proxy(this.handleUpdate,this))}else{d(window).off("resize.bs.modal")}};b.prototype.hideModal=function(){var e=this;this.$element.hide();this.backdrop(function(){e.$body.removeClass("modal-open");e.resetAdjustments();e.resetScrollbar();e.$element.trigger("hidden.bs.modal")})};b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};b.prototype.backdrop=function(i){var h=this;var f=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=d.support.transition&&f;this.$backdrop=d(document.createElement("div")).addClass("modal-backdrop "+f).appendTo(this.$body);this.$element.on("click.dismiss.bs.modal",d.proxy(function(j){if(this.ignoreBackdropClick){this.ignoreBackdropClick=false;return}if(j.target!==j.currentTarget){return}this.options.backdrop=="static"?this.$element[0].focus():this.hide()},this));if(e){this.$backdrop[0].offsetWidth}this.$backdrop.addClass("in");if(!i){return}e?this.$backdrop.one("bsTransitionEnd",i).emulateTransitionEnd(b.BACKDROP_TRANSITION_DURATION):i()}else{if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){h.removeBackdrop();i&&i()};d.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(b.BACKDROP_TRANSITION_DURATION):g()}else{if(i){i()}}}};b.prototype.handleUpdate=function(){this.adjustDialog()};b.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})};b.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};b.prototype.checkScrollbar=function(){var f=window.innerWidth;if(!f){var e=document.documentElement.getBoundingClientRect();f=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<f;this.scrollbarWidth=this.measureScrollbar()};b.prototype.setScrollbar=function(){var e=parseInt((this.$body.css("padding-right")||0),10);this.originalBodyPad=document.body.style.paddingRight||"";if(this.bodyIsOverflowing){this.$body.css("padding-right",e+this.scrollbarWidth)}};b.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)};b.prototype.measureScrollbar=function(){var f=document.createElement("div");f.className="modal-scrollbar-measure";this.$body.append(f);var e=f.offsetWidth-f.clientWidth;this.$body[0].removeChild(f);return e};function c(e,f){return this.each(function(){var i=d(this);var h=i.data("bs.modal");var g=d.extend({},b.DEFAULTS,i.data(),typeof e=="object"&&e);
862if(!h){i.data("bs.modal",(h=new b(this,g)))}if(typeof e=="string"){h[e](f)}else{if(g.show){h.show(f)}}})}var a=d.fn.modal;d.fn.modal=c;d.fn.modal.Constructor=b;d.fn.modal.noConflict=function(){d.fn.modal=a;return this};d(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(j){var i=d(this);var g=i.attr("href");var f=d(i.attr("data-target")||(g&&g.replace(/.*(?=#[^\s]+$)/,"")));var h=f.data("bs.modal")?"toggle":d.extend({remote:!/#/.test(g)&&g},f.data(),i.data());if(i.is("a")){j.preventDefault()}f.one("show.bs.modal",function(e){if(e.isDefaultPrevented()){return}f.one("hidden.bs.modal",function(){i.is(":visible")&&i.trigger("focus")})});c.call(f,h,this)})}(jQuery);;/* Ammina JS file original /bitrix/components/bxready2/abmanager/templates/full-static/script.js */ 863;if (window){ 864 function bxrResizeRK_fs(){ 865 $('.rk-fullwidth-static').each(function(){ 866 rkWidth = $(this).children('.rk-fullwidth-canvas').find("img").width(); 867 if (rkWidth>0 && rkWidth>$(this).width()){ 868 rkWidth = Math.round((rkWidth-$(this).width())/2); 869 $(this).children('.rk-fullwidth-canvas').css('margin-left', '-'+rkWidth+'px'); 870 } 871 $(this).children('.rk-fullwidth-canvas').animate({'opacity':'1'}, 500); 872 }); 873 }; 874 $(document).ready(function(){ 875 bxrResizeRK_fs(); 876 }); 877};/* Ammina JS file original /bitrix/templates/market2_v1/components/bxready.market2/menu/bxr_mobile_v1/script.js */ 878;(function(){ 879 880 jQuery.extend( jQuery.easing, 881 { 882 easeOutBounce: function (x, t, b, c, d) { 883 if ((t/=d) < (1/2.75)) { 884 return c*(7.5625*t*t) + b; 885 } else if (t < (2/2.75)) { 886 return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 887 } else if (t < (2.5/2.75)) { 888 return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 889 } else { 890 return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 891 } 892 }, 893 easeOutElastic: function (x, t, b, c, d) { 894 var s=1.70158;var p=0;var a=c; 895 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 896 if (a < Math.abs(c)) { a=c; var s=p/4; } 897 else var s = p/(2*Math.PI) * Math.asin (c/a); 898 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 899 }, 900 easeOutExpo: function (x, t, b, c, d) { 901 return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 902 } 903 }); 904 905 BXReadyMenu = { 906 907 menuWidth: 240, 908 menuLeft: "100%", 909 state: 'close', 910 911 resize: function(){ 912 BXReadyMenu.menuLeft = "100%"; 913 $('#bxr-multilevel-menu').width(BXReadyMenu.menuLeft); 914 $('.bxr-mobile-push-menu-content').width(BXReadyMenu.menuLeft); 915 $('.bxr-mobile-push-menu #bxr-mobile-menu-body').width(BXReadyMenu.menuLeft); 916 917 }, 918 919 init: function(){ 920 921 BXReadyMenu.resize(); 922 923 924 $('.bxr-mobile-push-menu-content').height($(document).height()); 925 926 $('.bxr-mobile-push-menu ul').height($(document).height()).width(BXReadyMenu.menuLeft); 927 $('.bxr-mobile-push-menu-content').css('margin-left', '-954px'); 928 }, 929 930 showChildren: function (parentId){ 931 932 menuItem = $('li.content-child[data-parent='+parentId+']'); 933 //menuItem.css({'position':'absolute','left':'100%','top':'0', 'display': 'block', 'z-index':5}); 934 menuItem.css({'position':'absolute','left':'100%','top':'0', 'display': 'block', 'z-index':5}); 935 menuItem.animate({'left':'0'}, 200, 'easeOutExpo'); 936 $('html, body').animate({scrollTop:0}, 'slow'); 937 }, 938 939 closeChildren: function (parentId){ 940 menuItem = $('li.content-child[data-parent='+parentId+']'); 941 //menuItem.css.css({'z-index':0, 'left':'100%'}); 942 menuItem.css({'left':'0'}); 943 menuItem.animate({'left':'100%'}, 200, function(){ 944 menuItem.css({'display': 'none'}); 945 }); 946 }, 947 948 openMenu: function(){ 949 950 BXReadyMenu.init(); 951 952 $('.bxr-mobile-push-menu-content').animate({'margin-left': '0px'}, 300, 'easeOutExpo'); 953 c = $('.bxr-mobile-push-menu-v2'); 954 c.find('.bxr-mobile-menu-button-menu').addClass(c.attr('data-hoverClass')).data("show", "Y");; 955 956 BXReadyMenu.state = 'open'; 957 BXReadyMenu.closeSlides('pull'); 958 }, 959 960 closeMenu: function(){ 961 962 $('.bxr-mobile-push-menu-content').animate({'margin-left':'-954px'}, 300, 'easeOutExpo', function(){ 963 $('html').removeClass('bxr-mobile-menu-content'); 964 $('html').css({'width':'auto'}); 965 c = $('.bxr-mobile-push-menu-v2'); 966 c.find('.bxr-mobile-menu-button-menu').removeClass(c.attr('data-hoverClass')).data("show", "N");; 967 }); 968 969 BXReadyMenu.state = 'close'; 970 971 }, 972 973 closeSlides: function(elementID){ 974 $('.bxr-mobile-slide').each(function(){ 975 if ($(this).attr('id') != elementID){ 976 $(this).slideUp(100); 977 } 978 }); 979 980 if (elementID != 'pull'){ 981 BXReadyMenu.closeMenu(); 982 } 983 984 }, 985 986 activateButton: function(button){ 987 988 target = $(button).data('target'); 989 c = $('.bxr-mobile-push-menu-v2'); 990 c.find('.bxr-mobile-push-menu-button > li').each(function(){ 991 if ($(this).data('target') != target){ 992 $(this).removeClass('bxr-mobile-menu-button-active'); 993 if (!$(this).hasClass('bxr-mobile-menu-button-close')) 994 $(this).removeClass(c.attr('data-hoverClass')); 995 } 996 }); 997 998 if ($(button).hasClass('bxr-mobile-menu-button-active')){ 999 $(button).removeClass('bxr-mobile-menu-button-active'); 1000 $(button).removeClass(c.attr('data-hoverClass')); 1001 }else{ 1002 $(button).addClass('bxr-mobile-menu-button-active'); 1003 $(button).addClass(c.attr('data-hoverClass')); 1004 } 1005 } 1006 } 1007 1008 $(document).ready(function(){ 1009 1010 $(document).on( 1011 'refreshBasket', 1012 function(e, data) { 1013 1014 if (!$('.bxr-mobile-menu-button-basket').is('.bxr-mobile-basket-indicator')) { 1015 $('.bxr-mobile-menu-button-basket').append('<div class="bxr-mobile-basket-indicator basket-items-cnt bxr-color"></div>') 1016 }; 1017 $('.bxr-mobile-menu-button-basket .bxr-mobile-basket-indicator').html(data.basket); 1018 if (data.basket < 1 ) { 1019 $('.bxr-mobile-menu-button-basket .bxr-mobile-basket-indicator').css('display', 'none'); 1020 } else { 1021 $('.bxr-mobile-menu-button-basket .bxr-mobile-basket-indicator').css('display', 'block'); 1022 } 1023 1024 if (!$('.bxr-mobile-menu-button-heart').is('.bxr-mobile-favor-indicator')) { 1025 $('.bxr-mobile-menu-button-heart').append('<div class="bxr-mobile-favor-indicator basket-items-cnt bxr-color"></div>') 1026 }; 1027 $('.bxr-mobile-menu-button-heart .bxr-mobile-favor-indicator').html(data.favor); 1028 if (data.favor < 1 ) { 1029 $('.bxr-mobile-menu-button-heart .bxr-mobile-favor-indicator').css('display', 'none'); 1030 } else { 1031 $('.bxr-mobile-menu-button-heart .bxr-mobile-favor-indicator').css('display', 'block'); 1032 } 1033 } 1034 ); 1035 1036 $(document).on( 1037 'refreshCompare', 1038 function(e, data) { 1039 if (typeof(data) == 'object') { 1040 var cntCompare = parseInt(Object.keys(data).length); 1041 if (!$('.bxr-mobile-menu-button-chart').is('.bxr-mobile-compare-indicator')) { 1042 $('.bxr-mobile-menu-button-chart').append('<div class="bxr-mobile-compare-indicator basket-items-cnt bxr-color"></div>') 1043 }; 1044 $('.bxr-mobile-menu-button-chart .bxr-mobile-compare-indicator').html(cntCompare); 1045 if (data.favor < 1 ) { 1046 $('.bxr-mobile-menu-button-chart .bxr-mobile-compare-indicator').css('display', 'none'); 1047 } else { 1048 $('.bxr-mobile-menu-button-chart .bxr-mobile-compare-indicator').css('display', 'block'); 1049 } 1050 } 1051 } 1052 ); 1053 1054 $(document).on( 1055 'click', 1056 '.bxr-mobile-push-menu-v2 .bxr-mobile-push-menu-button>li', 1057 function(){ 1058 if($(this).data("target")=="menu"){ 1059 if($(this).data("show")=="N") { 1060 BXReadyMenu.openMenu(); 1061 $(this).data("show", "Y"); 1062 } 1063 else { 1064 BXReadyMenu.closeMenu(); 1065 $(this).data("show", "N"); 1066 } 1067 BXReadyMenu.activateButton(this); 1068 } 1069 else { 1070 1071 if($(this).data("target")=="region"){
1072 $('#myModalRegion').modal('toggle'); 1073 1074 if($('.btn-t').length) { 1075 $('.btn-t').trigger('click'); 1076 } 1077 1078 if($('.btn-t .other-selector-js').length) { 1079 $('.btn-t .other-selector-js').trigger('click'); 1080 } 1081 1082 } 1083 else { 1084 id = 'bxr-mobile-'+$(this).data("target"); 1085 BXReadyMenu.closeSlides(id); 1086 $('#'+id).slideToggle(400); 1087 1088 BXReadyMenu.activateButton(this); 1089 } 1090 } 1091 } 1092 ); 1093 1094 $(document).on( 1095 'click', 1096 '.bxr-mobile-push-menu #bxr-multilevel-menu li.parent', 1097 function(){ 1098 state = $(this).attr('menu-state'); 1099 parentId = $(this).data('parent'); 1100 BXReadyMenu.showChildren(parentId); 1101 } 1102 ); 1103 1104 $(document).on( 1105 'click', 1106 '.bxr-mobile-push-menu #bxr-multilevel-menu li.child', 1107 function(){ 1108 state = $(this).attr('menu-state'); 1109 parentId = $(this).data('parent'); 1110 BXReadyMenu.closeChildren(parentId); 1111 } 1112 ); 1113 1114 $(window).resize( 1115 function(){ 1116 if (BXReadyMenu.state == 'open') BXReadyMenu.resize(); 1117 } 1118 ); 1119 }); 1120})( jQuery );;/* Ammina JS file original /bitrix/components/bxready.market2/search.title/script.js */ 1121;function JCTitleSearch(arParams) 1122{ 1123 var _this = this; 1124 1125 this.arParams = {
1126 'AJAX_PAGE': arParams.AJAX_PAGE, 1127 'CONTAINER_ID': arParams.CONTAINER_ID, 1128 'INPUT_ID': arParams.INPUT_ID, 1129 'MIN_QUERY_LEN': parseInt(arParams.MIN_QUERY_LEN), 1130 'STRICT_CHECK': arParams.STRICT_CHECK 1131 }; 1132 if(arParams.WAIT_IMAGE) 1133 this.arParams.WAIT_IMAGE = arParams.WAIT_IMAGE; 1134 if(arParams.MIN_QUERY_LEN <= 0) 1135 arParams.MIN_QUERY_LEN = 1; 1136 1137 this.cache = []; 1138 this.cache_key = null; 1139 1140 this.startText = ''; 1141 this.running = false; 1142 this.currentRow = -1; 1143 this.RESULT = null; 1144 this.CONTAINER = null; 1145 this.INPUT = null; 1146 this.WAIT = null; 1147 1148 this.ShowResult = function(result) 1149 { 1150 if(BX.type.isString(result)) 1151 { 1152 _this.RESULT.innerHTML = result; 1153 } 1154 1155 _this.RESULT.style.display = _this.RESULT.innerHTML !== '' ? 'block' : 'none'; 1156 var pos = _this.adjustResultNode(); 1157 1158 //adjust left column to be an outline 1159 var res_pos; 1160 var th; 1161 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 1162 if(tbl) 1163 { 1164 th = BX.findChild(tbl, {'tag':'th'}, true); 1165 } 1166 1167 if(th) 1168 { 1169 var tbl_pos = BX.pos(tbl); 1170 tbl_pos.width = tbl_pos.right - tbl_pos.left; 1171 1172 var th_pos = BX.pos(th); 1173 th_pos.width = th_pos.right - th_pos.left; 1174 th.style.width = th_pos.width + 'px'; 1175 1176 _this.RESULT.style.width = (pos.width + th_pos.width) + 'px'; 1177 1178 //Move table to left by width of the first column 1179 _this.RESULT.style.left = (pos.left - th_pos.width - 1)+ 'px'; 1180 1181 //Shrink table when it's too wide 1182 if((tbl_pos.width - th_pos.width) > pos.width) 1183 _this.RESULT.style.width = (pos.width + th_pos.width -1) + 'px'; 1184 1185 //Check if table is too wide and shrink result div to it's width 1186 tbl_pos = BX.pos(tbl); 1187 res_pos = BX.pos(_this.RESULT); 1188 if(res_pos.right > tbl_pos.right) 1189 { 1190 _this.RESULT.style.width = (tbl_pos.right - tbl_pos.left) + 'px'; 1191 } 1192 } 1193 1194 var fade; 1195 if(tbl) fade = BX.findChild(_this.RESULT, {'class':'title-search-fader'}, true); 1196 if(fade && th) 1197 { 1198 res_pos = BX.pos(_this.RESULT); 1199 fade.style.left = (res_pos.right - res_pos.left - 18) + 'px'; 1200 fade.style.width = 18 + 'px'; 1201 fade.style.top = 0 + 'px'; 1202 fade.style.height = (res_pos.bottom - res_pos.top) + 'px'; 1203 fade.style.display = 'block'; 1204 } 1205 }; 1206 1207 this.onKeyPress = function(keyCode) 1208 { 1209 var tbl = BX.findChild(_this.RESULT, {'tag':'div','class':'bxr-title-search-result'}, true); 1210 1211 if(!tbl) 1212 return false; 1213 1214 var i; 1215 var tblDiv = $(tbl).find(">div.bx_item_block_el"); 1216 var cnt = tblDiv.length; 1217 1218 switch (keyCode) 1219 { 1220 case 27: // escape key - close search div 1221 _this.RESULT.style.display = 'none'; 1222 _this.currentRow = -1; 1223 _this.UnSelectAll(); 1224 return true; 1225 1226 case 40: // down key - navigate down on search results 1227 if(_this.RESULT.style.display == 'none') 1228 _this.RESULT.style.display = 'block'; 1229 1230 var first = -1; 1231 for(i = 0; i < cnt; i++) 1232 { 1233 if(first == -1) 1234 first = i; 1235 1236 if(_this.currentRow < i) 1237 { 1238 _this.currentRow = i; 1239 break; 1240 } 1241 else if( $($(tblDiv)[i]).is(".title-search-selected")) 1242 { 1243 $($(tblDiv)[i]).removeClass("title-search-selected"); 1244 } 1245 } 1246 1247 if(i == cnt && _this.currentRow != i) 1248 _this.currentRow = first; 1249 1250 1251 $($(tblDiv)[_this.currentRow]).addClass("title-search-selected"); 1252 1253 return true; 1254 1255 case 38: // up key - navigate up on search results 1256 if(_this.RESULT.style.display == 'none') 1257 _this.RESULT.style.display = 'block'; 1258 1259 var last = -1; 1260 for(i = cnt-1; i >= 0; i--) 1261 { 1262 1263 if(last == -1) 1264 last = i; 1265 1266 if(_this.currentRow > i) 1267 { 1268 _this.currentRow = i; 1269 break; 1270 } 1271 else if($($(tblDiv)[i]).is(".title-search-selected")) 1272 { 1273 $($(tblDiv)[i]).removeClass("title-search-selected"); 1274 } 1275 1276 } 1277 1278 if(i < 0 && _this.currentRow != i) 1279 _this.currentRow = last; 1280 1281 $($(tblDiv)[_this.currentRow]).addClass("title-search-selected"); 1282 1283 return true; 1284 1285 case 13: // enter key - choose current search result 1286 if(_this.RESULT.style.display == 'block') 1287 { 1288 1289 for(i = 0; i < cnt; i++) 1290 { 1291 if(_this.currentRow == i) 1292 { 1293 var a = BX.findChild(($(tblDiv)[i]), {'tag':'a'}, true); 1294 if(a) 1295 { 1296 window.location = a.href; 1297 return true; 1298 } 1299 } 1300 } 1301 1302 if(_this.arParams.STRICT_CHECK=="Y") { 1303 for(i = 0; i < cnt; i++) 1304 { 1305 var a = BX.findChild(($(tblDiv)[i]), {'tag':'a'}, true); 1306 if(_this.oldValue.toUpperCase() != "" && _this.oldValue.toUpperCase() === $(a).text().toUpperCase()) { 1307 window.location = a.href; 1308 return true; 1309 } 1310 } 1311 } 1312 1313 } 1314 1315 if(_this.arParams.STRICT_CHECK=="Y") 1316 return "enter"; 1317 1318 return false; 1319 } 1320 1321 return false; 1322 }; 1323 1324 this.onTimeout = function() 1325 { 1326 _this.onChange(function(){ 1327 setTimeout(_this.onTimeout, 500); 1328 }); 1329 }; 1330 1331 this.onChange = function(callback) 1332 { 1333 if (_this.running) 1334 return; 1335 _this.running = true; 1336 1337 if(_this.INPUT.value != _this.oldValue && _this.INPUT.value != _this.startText) 1338 { 1339 _this.oldValue = _this.INPUT.value; 1340 if(_this.INPUT.value.length >= _this.arParams.MIN_QUERY_LEN) 1341 { 1342 _this.cache_key = _this.arParams.INPUT_ID + '|' + _this.INPUT.value; 1343 if(_this.cache[_this.cache_key] == null) 1344 { 1345 if(_this.WAIT) 1346 { 1347 var pos = BX.pos(_this.INPUT); 1348 var height = (pos.bottom - pos.top)-2; 1349 _this.WAIT.style.top = (pos.top+1) + 'px'; 1350 _this.WAIT.style.height = height + 'px'; 1351 _this.WAIT.style.width = height + 'px'; 1352 _this.WAIT.style.left = (pos.right - height + 2) + 'px'; 1353 _this.WAIT.style.display = 'block'; 1354 } 1355 1356 BX.ajax.post( 1357 _this.arParams.AJAX_PAGE, 1358 { 1359 'ajax_call':'y', 1360 'INPUT_ID':_this.arParams.INPUT_ID, 1361 'q':_this.INPUT.value, 1362 'l':_this.arParams.MIN_QUERY_LEN 1363 }, 1364 function(result) 1365 { 1366 _this.cache[_this.cache_key] = result; 1367 _this.ShowResult(result); 1368 _this.currentRow = -1; 1369 _this.EnableMouseEvents(); 1370 if(_this.WAIT) 1371 _this.WAIT.style.display = 'none'; 1372 if (!!callback) 1373 callback(); 1374 _this.running = false; 1375 } 1376 ); 1377 return; 1378 } 1379 else 1380 { 1381 _this.ShowResult(_this.cache[_this.cache_key]); 1382 _this.currentRow = -1; 1383 _this.EnableMouseEvents(); 1384 } 1385 } 1386 else 1387 { 1388 _this.RESULT.style.display = 'none'; 1389 _this.currentRow = -1; 1390 _this.UnSelectAll(); 1391 } 1392 } 1393 if (!!callback) 1394 callback(); 1395 _this.running = false; 1396 }; 1397 1398 this.UnSelectAll = function() 1399 { 1400 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 1401 if(tbl) 1402 { 1403 var cnt = tbl.rows.length; 1404 for(var i = 0; i < cnt; i++) 1405 tbl.rows[i].className = ''; 1406 } 1407 }; 1408 1409 this.EnableMouseEvents = function() 1410 { 1411 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 1412 if(tbl) 1413 { 1414 var cnt = tbl.rows.length; 1415 for(var i = 0; i < cnt; i++) 1416 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 1417 { 1418 tbl.rows[i].id = 'row_' + i; 1419 tbl.rows[i].onmouseover = function (e) { 1420 if(_this.currentRow != this.id.substr(4)) 1421 { 1422 _this.UnSelectAll(); 1423 this.className = 'title-search-selected'; 1424 _this.currentRow = this.id.substr(4); 1425 } 1426 }; 1427 tbl.rows[i].onmouseout = function (e) { 1428 this.className = ''; 1429 _this.currentRow = -1; 1430 }; 1431 } 1432 } 1433 }; 1434 1435 this.onFocusLost = function(hide) 1436 { 1437 setTimeout(function(){_this.RESULT.style.display = 'none';}, 250); 1438 }; 1439 1440 this.onFocusGain = function() 1441 { 1442 if(_this.RESULT.innerHTML.length) 1443 _this.ShowResult(); 1444 }; 1445 1446 this.onKeyDown = function(e) 1447 { 1448 if(!e) 1449 e = window.event; 1450 1451 if (_this.RESULT.style.display == 'block') 1452 { 1453 if(_this.arParams.STRICT_CHECK=="Y") { 1454 if(e.keyCode==13 && _this.onKeyPress(e.keyCode)=="enter" ) 1455 return false; 1456 } 1457 1458 if(_this.onKeyPress(e.keyCode) ) 1459 return BX.PreventDefault(e); 1460 } 1461 else { 1462 if(_this.arParams.STRICT_CHECK=="Y") { 1463 if(e.keyCode==13) { 1464 return false; 1465 } 1466 } 1467 } 1468 }; 1469 1470 this.adjustResultNode = function() 1471 { 1472 var pos; 1473 var fixedParent = BX.findParent(_this.CONTAINER, BX.is_fixed); 1474 if(!!fixedParent) 1475 { 1476 //_this.RESULT.style.position = 'fixed'; 1477 _this.RESULT.style.position = 'absolute'; 1478 _this.RESULT.style.zIndex = BX.style(fixedParent, 'z-index') + 2; 1479 pos = BX.pos(_this.CONTAINER, true); 1480 } 1481 else 1482 { 1483 _this.RESULT.style.position = 'absolute'; 1484 pos = BX.pos(_this.CONTAINER); 1485 } 1486 1487 1488 pos = BX.pos(_this.CONTAINER, true); 1489 1490 pos.width = pos.right - pos.left; 1491 _this.RESULT.style.top = (pos.bottom + 2) + 'px'; 1492 _this.RESULT.style.left = pos.left + 'px'; 1493 _this.RESULT.style.width = pos.width + 'px'; 1494 return pos; 1495 }; 1496 1497 this._onContainerLayoutChange = function() 1498 { 1499 if(_this.RESULT.style.display !== "none" && _this.RESULT.innerHTML !== '') 1500 { 1501 _this.adjustResultNode(); 1502 } 1503 }; 1504 this.Init = function() 1505 { 1506 this.CONTAINER = document.getElementById(this.arParams.CONTAINER_ID); 1507 BX.addCustomEvent(this.CONTAINER, "OnNodeLayoutChange", this._onContainerLayoutChange); 1508 1509 1510 //this.RESULT = document.body.appendChild(document.createElement("DIV")); 1511 this.RESULT = this.CONTAINER.appendChild(document.createElement("DIV")); 1512 1513 this.RESULT.className = 'title-search-result'; 1514 this.INPUT = document.getElementById(this.arParams.INPUT_ID); 1515 this.startText = this.oldValue = this.INPUT.value; 1516 1517 //BX.bind(this.INPUT, 'focus', function() {_this.onFocusGain()}); 1518 BX.bind(this.INPUT, 'blur', function() {_this.onFocusLost()}); 1519 1520 //if(BX.browser.IsSafari() || BX.browser.IsIE()) 1521 this.INPUT.onkeydown = this.onKeyDown; 1522 //else 1523 //this.INPUT.onkeypress = this.onKeyDown; 1524 1525 if(this.arParams.WAIT_IMAGE) 1526 { 1527 this.WAIT = document.body.appendChild(document.createElement("DIV")); 1528 this.WAIT.style.backgroundImage = "url('" + this.arParams.WAIT_IMAGE + "')"; 1529 if(!BX.browser.IsIE()) 1530 this.WAIT.style.backgroundRepeat = 'none'; 1531 this.WAIT.style.display = 'none'; 1532 this.WAIT.style.position = 'absolute'; 1533 this.WAIT.style.zIndex = '1100'; 1534 } 1535 1536 BX.bind(this.INPUT, 'bxchange', function() {_this.onChange()}); 1537 }; 1538 BX.ready(function (){_this.Init(arParams)}); 1539} 1540;/* Ammina JS file original /bitrix/templates/market2_v1/components/
1540ammina/regions.selector/.default/script.js */ 1541;(function ($) { 1542 1543 var methods = { 1544 init: function (arResultInfo, arParamsInfo) { 1545 methods.self = this; 1546 methods.arResultInfo = arResultInfo; 1547 methods.arParamsInfo = arParamsInfo; 1548 $("body").append($(".bam-regions-confirm")); 1549 $("body").append($(".bam-regions-popup")); 1550 $("body").append($(".bam-regions-popupbg")); 1551 methods.divMain = $(this); 1552 methods.divConfirm = $(".bam-regions-confirm"); 1553 methods.divPopup = $(".bam-regions-popup"); 1554 methods.divPopupBg = $(".bam-regions-popupbg"); 1555 if (methods.arParamsInfo['CHANGE_CITY_MANUAL'] != "Y") { 1556 return; 1557 } 1558 if (methods.arParamsInfo['CITY_VERIFYCATION'] == "Y" && methods.arResultInfo['CONFIRM_REQUEST_SHOW']) { 1559 methods._showConfirmCityWindow(); 1560 $(methods.divConfirm).on("click", ".bam-regions-confirm-button-yes", function () { 1561 methods._clickConfirmButtonYes(this); 1562 return false; 1563 }); 1564 $(methods.divConfirm).on("click", ".bam-regions-confirm-button-no", function () { 1565 methods._clickConfirmButtonNo(this); 1566 return false; 1567 }); 1568 } 1569 $(methods.divMain).on("click", ".bam-regions-link", function () { 1570 methods._clickShowPopupForm(this); 1571 return false; 1572 }); 1573 $(".bxr-mobile-push-menu-bottom").on("click", ".bam-regions-link-mobile", function () { 1574 methods._clickShowPopupForm(this); 1575 return false; 1576 }); 1577 $(methods.divPopup).on("change", ".bam-regions-popup-content-search", function () { 1578 methods._changeSearchCity(this); 1579 return false; 1580 }); 1581 $(methods.divPopup).on("keyup", ".bam-regions-popup-content-search", function () { 1582 methods._changeSearchCity(this); 1583 return false; 1584 }); 1585 $(methods.divPopup).on("click", ".bam-regions-popup-content-item-link", function () { 1586 methods._selectCityFromPopup(this); 1587 return false; 1588 }); 1589 $(methods.divPopup).on("click", ".bam-regions-popup-close", function () { 1590 methods._clickHidePopupForm(this); 1591 return false; 1592 }); 1593 $(window).resize(function () { 1594 methods._doResizeContent(); 1595 }); 1596 return this; 1597 1598 }, 1599 destroy: function () { 1600 //$(this).off("change", "[data-sets-selector='Y']"); 1601 return this; 1602 1603 }, 1604 _showConfirmCityWindow: function () { 1605 methods.divConfirm.css("visibility", "hidden"); 1606 methods.divConfirm.show(); 1607 var confirmWidth = methods.divConfirm.outerWidth(); 1608 methods.divConfirm.hide(); 1609 methods.divConfirm.css("visibility", "visible"); 1610 var offset = $(methods.self).find(".bam-regions-link").offset(); 1611 methods.divConfirm.css("top", offset.top + $(methods.self).find(".bam-regions-link").outerHeight()); 1612 methods.divConfirm.css("left", offset.left + ($(methods.self).find(".bam-regions-link").outerWidth() - confirmWidth) / 2); 1613 methods.divConfirm.fadeIn(); 1614 }, 1615 _clickConfirmButtonYes: function (element) { 1616 var sendData = {}; 1617 sendData['PREVENT_CITY'] = methods.arParamsInfo['PREVENT_CITY']; 1618 sendData['sid'] = methods.arParamsInfo['SITE_ID']; 1619 sendData['AJAX'] = "Y"; 1620 sendData['action'] = "setPreventCity"; 1621 $.ajax(methods.urlAjax, { 1622 cache: false, 1623 context: $(element), 1624 data: sendData, 1625 dataType: "json", 1626 method: "POST", 1627 type: "POST", 1628 success: function (dataResult) { 1629 if (dataResult.STATUS == "SUCCESS") { 1630 methods.divConfirm.fadeOut(400, function () { 1631 methods.divConfirm.remove(); 1632 methods.divConfirm = null; 1633 }); 1634 if (dataResult.LOCATION != undefined && dataResult.LOCATION.length > 0) { 1635 window.location = dataResult.LOCATION; 1636 } 1637 } 1638 } 1639 }); 1640 }, 1641 _clickConfirmButtonNo: function (element) { 1642 methods.divConfirm.hide(1, function () { 1643 methods.divConfirm.remove(); 1644 methods.divConfirm = null; 1645 }); 1646 methods._clickShowPopupForm(element); 1647 }, 1648 _clickShowPopupForm: function (element) { 1649 if (methods.divConfirm) { 1650 methods.divConfirm.hide(1, function () { 1651 methods.divConfirm.remove(); 1652 methods.divConfirm = null; 1653 }); 1654 } 1655 methods.doShowPopupForm(); 1656 }, 1657 _clickHidePopupForm: function (element) { 1658 methods.divPopup.hide(); 1659 methods.divPopupBg.hide(); 1660 }, 1661 doShowPopupForm: function () { 1662 if (this.arParamsInfo['USE_GPS'] == "Y" && navigator.geolocation && methods.gpsPosition == false) { 1663 methods.gpsWait = true; 1664 methods.divPopupBg.fadeIn(400); 1665 navigator.geolocation.getCurrentPosition(methods.navigatorPosition, methods.navigatorError); 1666 var waitInterval = setInterval(function () { 1667 if (!methods.gpsWait) { 1668 clearInterval(waitInterval); 1669 methods._doShowPopupForm(); 1670 } 1671 }, 20); 1672 } else { 1673 methods._doShowPopupForm(); 1674 } 1675 }, 1676 _doShowPopupForm: function () { 1677 methods.divPopup.html(""); 1678 methods.divPopup.append($(methods.popupTemplate)); 1679 var sendData = methods.arParamsInfo; 1680 sendData['GPS'] = methods.gpsPosition; 1681 sendData['AJAX'] = "Y"; 1682 sendData['action'] = "getCityForm"; 1683 $.ajax(methods.urlAjax, { 1684 cache: false, 1685 context: methods.divPopup,
1686 data: sendData, 1687 dataType: "json", 1688 method: "POST", 1689 type: "POST", 1690 success: function (dataResult) { 1691 if (dataResult.RESULT['IS_OK']) { 1692 methods.divPopup.find(".bam-regions-popup-title h3").html(dataResult.RESULT['TITLE']); 1693 methods.divPopup.find(".bam-regions-popup-content-search").attr("placeholder", dataResult.RESULT['INPUT_PLACEHOLDER']); 1694 methods._doShowListCity(dataResult.RESULT['ITEMS']); 1695 } 1696 } 1697 }); 1698 methods.divPopupBg.fadeIn(400); 1699 methods.divPopup.fadeIn(400, function () { 1700 methods._doResizeContent(); 1701 }); 1702 }, 1703 _changeSearchCity: function (element) { 1704 var sendData = methods.arParamsInfo; 1705 sendData['GPS'] = methods.gpsPosition; 1706 sendData['AJAX'] = "Y"; 1707 sendData['action'] = "getCityForm"; 1708 sendData['qcity'] = $(element).val(); 1709 $.ajax(methods.urlAjax, { 1710 cache: true, 1711 context: methods.divPopup, 1712 data: sendData, 1713 dataType: "json", 1714 method: "POST", 1715 type: "POST", 1716 success: function (dataResult) { 1717 if (dataResult.RESULT['IS_OK']) { 1718 methods._doShowListCity(dataResult.RESULT['ITEMS']); 1719 } 1720 } 1721 }); 1722 }, 1723 navigatorPosition: function (position) { 1724 methods.gpsPosition = position; 1725 methods.gpsWait = false; 1726 }, 1727 navigatorError: function () { 1728 methods.gpsPosition = false; 1729 methods.gpsWait = false; 1730 }, 1731 _doShowListCity: function (arItems) { 1732 var listContent = methods.divPopup.find(".bam-regions-popup-content-list"); 1733 var tmpTemplateCode = ""; 1734 listContent.html(""); 1735 $.each(arItems, function (k, item) { 1736 if (item['IS_CURRENT'] == "Y") { 1737 tmpTemplateCode = methods.popupListContentItemCurrentTemplate; 1738 } else { 1739 tmpTemplateCode = methods.popupListContentItemTemplate; 1740 } 1741 if (item.DOMAIN_NAME != undefined) { 1742 tmpTemplateCode = tmpTemplateCode.replace("#CITY_NAME#", item.DOMAIN_NAME); 1743 tmpTemplateCode = tmpTemplateCode.replace("#CITY_ID#", item.CITY_ID); 1744 tmpTemplateCode = tmpTemplateCode.replace("#CITY_TITLE#", item.FULL_NAME); 1745 } else { 1746 tmpTemplateCode = tmpTemplateCode.replace("#CITY_NAME#", item.CITY_NAME + " <span>(" + item.FULL_NAME_NO_CITY + ")</span>"); 1747 tmpTemplateCode = tmpTemplateCode.replace("#CITY_ID#", item.CITY_ID); 1748 tmpTemplateCode = tmpTemplateCode.replace("#CITY_TITLE#", item.FULL_NAME_NO_CITY); 1749 } 1750 listContent.append($(tmpTemplateCode)); 1751 }); 1752 }, 1753 _selectCityFromPopup: function (element) { 1754 var sendData = {}; 1755 sendData['PREVENT_CITY'] = $(element).data("id"); 1756 sendData['sid'] = methods.arParamsInfo['SITE_ID']; 1757 sendData['AJAX'] = "Y"; 1758 sendData['action'] = "setPreventCity"; 1759 $.ajax(methods.urlAjax, { 1760 cache: false, 1761 context: $(element), 1762 data: sendData, 1763 dataType: "json", 1764 method: "POST", 1765 type: "POST", 1766 success: function (dataResult) { 1767 if (dataResult.STATUS == "SUCCESS") { 1768 methods._clickHidePopupForm(element); 1769 if (dataResult.LOCATION != undefined && dataResult.LOCATION.length > 0) { 1770 window.location = dataResult.LOCATION; 1771 } else { 1772 window.location.reload(); 1773 } 1774 } 1775 } 1776 }); 1777 }, 1778 _doResizeContent: function () { 1779 if (methods.divPopup.find(".bam-regions-popup-content-list").length > 0) { 1780 methods.divPopup.find(".bam-regions-popup-content-list").height(methods.divPopup.find(".bam-regions-popup-window").height() - 100); 1781 } 1782 }, 1783 arResultInfo: {}, 1784 arParamsInfo: {}, 1785 self: null, 1786 divConfirm: null, 1787 divPopup: null, 1788 divPopupBg: null, 1789 urlAjax: "/bitrix/components/ammina/regions.selector/ajax.php", 1790 popupTemplate: '<div class="bam-regions-popup-window"><div class="bam-regions-popup-title"><h3></h3><a href="javascript:void(0)" class="bam-regions-popup-close"></a></div><div class="bam-regions-popup-content"><input type="text" value="" class="bam-regions-popup-content-search" placeholder=""/><div class="bam-regions-popup-content-list"></div></div></div>', 1791 popupListContentItemTemplate: '<div class="bam-regions-popup-content-item"><a href="javascript:void(0)" class="bam-regions-popup-content-item-link" data-id="#CITY_ID#" title="#CITY_TITLE#">#CITY_NAME#</a></div>', 1792 popupListContentItemCurrentTemplate: '<div class="bam-regions-popup-content-item"><a href="javascript:void(0)" class="bam-regions-popup-content-item-link bam-regions-popup-content-item-link-current" data-id="#CITY_ID#" title="#CITY_TITLE#">#CITY_NAME#</a></div>', 1793 gpsWait: false, 1794 gpsPosition: false 1795 }; 1796 1797 $.fn.amminaRegions = function (method) { 1798 if (methods[method]) { 1799 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 1800 } else if (typeof method === 'object' || !method) { 1801 return methods.init.apply(this, arguments); 1802 } else { 1803 $.error('Not exists method ' + method); 1804 } 1805 }; 1806})(jQuery);;/* Ammina JS file original /bitrix/components/bxready.market2/panel.top.fixed.ajax/templates/.default/script.js */ 1807;(function() { 1808 1809 var BXRFixedPanelCreate = false, 1810 BXRFixedPanelTop = 99999999; 1811 1812 if (!!window.JCTopFixedPanelAjax) 1813 return; 1814 1815 window.JCTopFixedPanelAjax = function(params) { 1816 this.params = params; 1817 1818 var BXRFixedPanel = this; 1819 1820 1821 $(document).scroll(function(){ 1822 1823 if ($(window).width() < BXRFixedPanel.params.mWidth){ 1824 BXRFixedPanel.hide(); 1825 return; 1826 } 1827 1828 if ($(document).scrollTop() > BXRFixedPanelTop){ 1829 BXRFixedPanel.show(); 1830 }else{ 1831 BXRFixedPanel.hide(); 1832 } 1833 1834 }); 1835 1836 $(window).resize(function(){ 1837 if ($(window).width() < BXRFixedPanel.params.mWidth){ 1838 BXRFixedPanel.hide(); 1839 return; 1840 } 1841 }); 1842 1843 BXRFixedPanel.init(); 1844 1845 }; 1846 1847 window.JCTopFixedPanelAjax.prototype = 1848 { 1849 isTouchDevice: function() { 1850 try { 1851 document.createEvent('TouchEvent'); 1852 return true; 1853 } 1854 catch(e) { 1855 return false; 1856 } 1857 }, 1858 1859 init: function(){ 1860 1861 1862 1863 if (!BXRFixedPanelCreate){ 1864 1865 params ={ 1866 'siteId' : this.params.siteId, 1867 'template' : this.params.templateID, 1868 'parameters' : this.params.parameters, 1869 'bxmarket' : this.params.bxmarket, 1870 'rg': Math.random() 1871 } 1872 1873 request = $.ajax({
1874 url: this.params.ajaxUrl, 1875 data: params, 1876 type: 'POST', 1877 success: function(data){ 1878 $('#bxr-top-fixed-panel').html(data); 1879 BXRFixedPanelTop = $('#bxr-top-fixed-panel-anker').position().top; 1880 $('#bxr-top-fixed-panel').trigger('onCreateFixedPanel'); 1881 BXRFixedPanelCreate = true; 1882 } 1883 }); 1884 1885 1886 }; 1887 1888 }, 1889 1890 show: function(){ 1891 if ($('#bxr-top-fixed-panel').data('show') != '1'){ 1892 1893 $('#bxr-top-fixed-panel').fadeIn(200); 1894 $('#bxr-top-fixed-panel').data('show', '1'); 1895 $('#bxr-top-fixed-panel').trigger('onShowFixedPanel'); 1896 } 1897 }, 1898 1899 hide: function(){ 1900 if ($('#bxr-top-fixed-panel').data('show') != '0'){ 1901 $('#bxr-top-fixed-panel').fadeOut(200); 1902 $('#bxr-top-fixed-panel').data('show', '0'); 1903 $('#bxr-top-fixed-panel').trigger('onHideFixedPanel'); 1904 } 1905 } 1906 } 1907})();;/* Ammina JS file original /bitrix/components/bxready.market2/menu/templates/left_hover/script.js */ 1908;(function() { 1909 if (!!window.JCLeftMenu) 1910 return; 1911 1912 window.JCLeftMenu = function() { 1913 this.init(); 1914 }; 1915 1916 window.JCLeftMenu.prototype = { 1917 hLi: 48, 1918 boolMaxHeight: false, 1919 init: function() { 1920 var _this = this; 1921 if($(".bxr-left-column-js").hasClass("isHidden")) { 1922 $('.bar-menu-rotate').show(); 1923 $(document).on("mouseenter", '.bxr-show-left-menu, .bxr-left-column-js', function(){ 1924 $(".bxr-left-column-js").show(); 1925 if(!_this.boolMaxHeight) { 1926 _this.hLi = $('.bxr-left-menu-hover li').outerHeight(); 1927 _this.setLeftMenuMaxH(); 1928 $(window).resize(function() { 1929 _this.setLeftMenuMaxH(); 1930 }); 1931 _this.boolMaxHeight = true; 1932 } 1933 $(".bxr-logo-top-panel .bar-menu-rotate .fa").addClass("rotate180"); 1934 }); 1935 $(document).on("mouseleave", '.bxr-show-left-menu, .bxr-left-column-js', function(){ 1936 $(".bxr-left-column-js").hide(); 1937 $(".bxr-logo-top-panel .bar-menu-rotate .fa").removeClass("rotate180"); 1938 }); 1939 } 1940 else { 1941 this.hLi = $('.bxr-left-menu-hover li').outerHeight(); 1942 } 1943 1944 if($(".bxr-left-menu-hover").hasClass("isModalBackdrop")) { 1945 $('.bxr-left-menu-hover').hover( 1946 function(){ 1947 $(".modal-backdrop.in").show(); 1948 }, 1949 function(){ 1950 $(".modal-backdrop.in").hide(); 1951 } 1952 ); 1953 } 1954 1955 this.initScroll(); 1956 1957 $('ul.bxr-left-menu-hover > li.top-element-js li').on('mouseenter', function() { 1958 _this.autoPosition($(this), $('> ul', $(this))); 1959 }); 1960 1961 $('.bxr-left-menu-hover > li.top-element-js').on('mouseenter', function() { 1962 _this.autoPosition($(this), $('> div', $(this))); 1963 }); 1964 1965 this.initTouchEvents(); 1966 1967 }, 1968 1969 autoPosition: function($menuItem, $submenuWrapper) { 1970 if(!$submenuWrapper.length>0) 1971 return false; 1972 1973 $menuItem.attr('style', ''); 1974 $submenuWrapper.attr('style', ''); 1975
1976 var menuItemPos = $menuItem.position(); 1977 var eTop = menuItemPos.top; 1978 var inaccuracy = 10; 1979 1980 var wHeight = $(window).height(); 1981 1982 var ofsetTop = $submenuWrapper.offset().top-$(window).scrollTop(); 1983 /*if(ofsetTop < 0) 1984 ofsetTop = 0;*/ 1985 1986 var availableHeight = wHeight-ofsetTop-eTop+inaccuracy; 1987 var eHeight = $submenuWrapper.height(); 1988 1989 while(eHeight>availableHeight) { 1990 eTop = eTop - this.hLi; 1991 availableHeight = wHeight-ofsetTop-eTop+inaccuracy; 1992 } 1993 if(eTop<0) 1994 eTop = 0; 1995 1996 $submenuWrapper.css({top: eTop}); 1997 }, 1998 1999 initScroll: function() { 2000 $('.bxr-left-column-js nav > ul').scrollbar(); 2001 $('.scroll-bar').addClass('bxr-color'); 2002 }, 2003 2004 setLeftMenuMaxH: function() { 2005 var menuContaine = $("#button_menu_container"); 2006 2007 if($(window).width()<975 && menuContaine.data("resizeHeight")!=undefined) 2008 return true; 2009 2010 var wHeight = $(window).height(); 2011 2012 if(menuContaine.data("resizeHeight")!=undefined && menuContaine.data("resizeHeight")==wHeight) 2013 return true; 2014 2015 menuContaine.data("resizeHeight", wHeight); 2016 2017 var eHeight = menuContaine.parent("div").parent("div").height(); 2018 var tP = menuContaine.parent("div").parent("div").offset()['top']; 2019 var bbHeight = wHeight - eHeight - tP; 2020 2021 bbHeight = (~~((bbHeight)/this.hLi))*this.hLi; 2022 2023 $(".bxr-left-menu-hover").css('max-height', bbHeight+'px'); 2024 }, 2025 2026 initTouchEvents: function() { 2027 var touchItems = $('nav ul.bxr-left-menu-hover li.bxr-c-touch > a'); 2028 var _this = this; 2029 touchItems.on( 2030 'touchend', 2031 function(e){ 2032 if ($(this).data('stop-href') == 'stop') { 2033 location.href = $(this).data('src'); 2034 } else { 2035 $(this).data('stop-href', 'stop'); 2036 $(this).data('src', $(this).attr('href')); 2037 $(this).attr('href', '#'); 2038 _this.autoPosition($(this), $('> ul', $(this))); 2039 _this.autoPosition($(this), $('> div', $(this))); 2040 } 2041 } 2042 ); 2043 } 2044 }; 2045})();;/* Ammina JS file original /bitrix/components/bxready2/abmanager/templates/full-responsive/script.js */ 2046;if (window){ 2047 function bxrResizeRK(){ 2048 $('.rk-fullwidth').each(function(){ 2049 rkWidth = $(this).children('.rk-fullwidth-canvas').children('img').width(); 2050 if (rkWidth>0 && rkWidth>$(this).width()){ 2051 rkWidth = Math.round((rkWidth-$(this).width())/2); 2052 $(this).children('.rk-fullwidth-canvas').css('margin-left', '-'+rkWidth+'px'); 2053 } 2054 }); 2055 }; 2056 $(document).ready(function(){ 2057 bxrResizeRK(); 2058 }); 2059} 2060;/* Ammina JS file original /bitrix/templates/market2_v1/bxready2/area/footer/v1/script.js */ 2061;$(document).on('click', '.mobile-footer-menu-tumbl', function() { 2062 $(this).next().toggle(); 2063 var Item = $(this).children("i"); 2064 if (Item.hasClass("fa-chevron-down")) { 2065 Item.removeClass("fa-chevron-down").addClass("fa-chevron-up"); 2066 }else{ 2067 Item.removeClass("fa-chevron-up").addClass("fa-chevron-down"); 2068 } 2069}); 2070;/* Ammina JS file original /bitrix/components/bxready.market2/buttonUp/templates/.default/script.js */ 2071;$(document).ready(function(){ 2072 2073 window.BXReady.Market.buttonUp = { 2074 2075 init: function(top_show, delay, button_up){ 2076 2077 buttonUp = $('.bxr-button-up'); 2078 2079 $(window).scroll(function () { 2080 2081 if ($(this).scrollTop() > top_show) 2082 buttonUp.fadeIn(); 2083 else 2084 buttonUp.fadeOut(); 2085 }); 2086 2087 2088 buttonUp.click(function () { 2089 $('body, html').animate({ 2090 scrollTop: 0 2091 }, delay); 2092 }); 2093 }, 2094 }; 2095});;/* Ammina JS file original /bitrix/components/bxready.market2/basket.small/templates/.default/script.js */ 2096;(function(){ 2097 function setBasketMaxH(bcontainer) { 2098 2099 if(!$(bcontainer).is(":visible")) 2100 return true; 2101 2102 $(bcontainer+' .bxr-content-scroll').scrollbar(); 2103 $('.scroll-bar').addClass('bxr-color'); 2104 $(bcontainer+' .scroll-content').closest('.scroll-wrapper').css('max-height', '0px'); 2105 2106 wHeight = $(window).height(); 2107 bHeight = parseInt($(bcontainer).css('height')) 2108 2109 if(!$(bcontainer).parents("#bxr-basket-row").parent("div").is(".bxr-basket-fixed")) { 2110 pHeight = parseInt($('.bxr-header-panel').css('height')); 2111 ePosition = $("header").position().top; 2112 2113 ePosition = ePosition - $(document).scrollTop(); 2114 2115 if(ePosition<0) 2116 ePosition = 0; 2117 2118 bbHeight = wHeight - pHeight - bHeight - ePosition; 2119 } 2120 else { 2121 bbHeight = wHeight - parseInt($("#bxr-basket-row").css("top")) - bHeight; 2122 } 2123 2124 $(bcontainer+' .scroll-content').closest('.scroll-wrapper').css('max-height', bbHeight+'px'); 2125 } 2126 2127 window.BXReady.Market.Basket = { 2128 2129 objInit: false, 2130 delayWindow: false, 2131 precisionFactor: Math.pow(10, 6), 2132 list: {}, 2133 2134 newQty: function(item, qty) { 2135 basket = this; 2136 2137 if (this.params.ajaxUrl.length <= 0) return; 2138 2139 $.ajax({
2140 url: this.params.ajaxUrl, 2141 data: { 2142 ajaxbuy: 'yes', 2143 action: 'newqty', 2144 quantity: qty, 2145 item: item, 2146 rg: Math.random(), 2147 siteId: this.params.postData.siteId, 2148 template: this.params.postData.template, 2149 parameters: this.params.postData.parameters 2150 }, 2151 type: 'POST', 2152 success: function(data) { 2153 basket.refresh(true, data); 2154 BXReady.closeAjaxShadow('bxr-basket-body-shadow'); 2155 } 2156 }); 2157 }, 2158 2159 changeQtyValue: function(qty, coef, maxQty, type) { 2160 if(type!=="inc" && type!=="dec" && type!=="arb") return false; 2161 if(isNaN(coef)) coef = 1; 2162 coef = Math.round(coef * basket.precisionFactor) / basket.precisionFactor; 2163 if(isNaN(qty) || qty<0) qty = coef; 2164 2165 if(type==="inc") { 2166 newQty = qty + coef; 2167 newQty = Math.round(newQty * basket.precisionFactor) / basket.precisionFactor; 2168 } else if (type==="dec") { 2169 newQty = qty - coef; 2170 newQty = Math.round(newQty * basket.precisionFactor) / basket.precisionFactor; 2171 } else if (type==="arb") { 2172 newQty = (Math.ceil(qty/coef)) * coef; 2173 newQty = Math.round(newQty * basket.precisionFactor) / basket.precisionFactor; 2174 } 2175 2176 if (maxQty>0 && newQty > maxQty) 2177 newQty = maxQty; 2178 if ((newQty < coef && coef<=maxQty) || newQty === 0) 2179 newQty = coef; 2180 if (newQty < coef && coef>maxQty) 2181 newQty = maxQty; 2182 2183 return newQty; 2184 }, 2185 2186 addItem: function(form, delay, favor) { 2187 basket = this; 2188 2189 if (this.params.ajaxUrl.length <= 0) return; 2190 2191 2192 data = { 2193 ajaxbuy: 'yes', 2194 rg: Math.random(), 2195 siteId: this.params.postData.siteId, 2196 template: this.params.postData.template, 2197 parameters: this.params.postData.parameters 2198 }; 2199 2200 $.each(form.serializeArray(), function(i, v) { 2201 data[v.name] = v.value; 2202 }); 2203 2204 itemId = form.children('input[name=item]').val(); 2205 if (delay) { 2206 valueDelay = form.children('input[name=delay]').val(); 2207 2208 if (valueDelay == 'yes') { 2209 data.delay = valueDelay; 2210 form.children('input[name=delay]').val('no'); 2211 }else{ 2212 form.children('input[name=delay]').val('yes'); 2213 } 2214 } 2215 2216 if (favor) { 2217 valueFavor = form.children('input[name=favor]').val(); 2218 2219 if (valueFavor == 'yes') { 2220 data.favor = valueFavor; 2221 form.children('input[name=favor]').val('no'); 2222 } else { 2223 form.children('input[name=favor]').val('yes'); 2224 } 2225 } 2226 2227 notAllProp = false; 2228 bProp = { 2229 BASKET_PROPS: {} 2230 }; 2231 if (!delay && !favor) { 2232 if ($('.bxr-bprop-required').length && $('#bxr-bprop-table-'+itemId).length) { 2233 $('.bxr-bprop-required').each(function() { 2234 prop = $(this); 2235 container = prop.closest('.bxr-bprop-value'); 2236 pVal = prop.val(); 2237 pCode = prop.data("code"); 2238 pName = prop.data("name"); 2239 pSort = prop.data("sort"); 2240 if (pVal == "false") { 2241 container.addClass('wrong-bprop'); 2242 BXReady.closeAjaxShadow('body-shadow'); 2243 notAllProp = true; 2244 }; 2245 bProp["BASKET_PROPS"][pCode] = { 2246 NAME: encodeURIComponent(pName), 2247 CODE: pCode, 2248 SORT: pSort, 2249 VALUE: encodeURIComponent(pVal), 2250 }; 2251 }) 2252 }; 2253 2254 $('.bxr-bprop-optional').each(function() { 2255 prop = $(this); 2256 pVal = prop.val();
2257 pCode = prop.data("code"); 2258 pName = prop.data("name"); 2259 pSort = prop.data("sort"); 2260 bProp["BASKET_PROPS"][pCode] = { 2261 NAME: encodeURIComponent(pName), 2262 CODE: pCode, 2263 SORT: pSort, 2264 VALUE: encodeURIComponent(pVal), 2265 }; 2266 }) 2267 } 2268 2269 if(window.bUserProp === undefined) { 2270 bUserProp = { 2271 BASKET_PROPS: {} 2272 }; 2273 } 2274 2275 var getFolder = this.params.getFolder; 2276 2277 var showPopup = true; 2278 if(this.params.showPopup == "false") 2279 showPopup = false; 2280 2281 if(!showPopup) 2282 BXReady.closeAjaxShadow('body-shadow'); 2283 2284 if (!notAllProp) { 2285 $.ajax({ 2286 url: this.params.ajaxUrl, 2287 data: jQuery.extend(true, {}, data, bProp, bUserProp), 2288 type: 'POST', 2289 success: function(data) { 2290 basket.refresh(true, data); 2291 2292 if (basket.delayWindow != true && delay || favor){} 2293 else { 2294 BXReady.closeAjaxShadow('body-shadow'); 2295 2296 if(showPopup) { 2297 BXReady.basketPopup = BX.PopupWindowManager.create("basketPopup", null, { 2298 autoHide: true, 2299 offsetLeft: 0, 2300 offsetTop: 0, 2301 overlay : true, 2302 draggable: {restrict:true}, 2303 closeByEsc: true, 2304 closeIcon: { }, 2305 titleBar: {content: BX.create("span", {html: "<div class='bxr-color bxr-basket-popup bxr-border-bottom-color'>"+BX.message('setItemAdded2BasketTitle')+"</div>"})}, 2306 content: '<div style="width:366px;height:400px; text-align: center;"><span style="position:absolute;left:50%; top:50%"><img src="'+getFolder+'/images/wait.gif"/></span></div>', 2307 events: { 2308 onAfterPopupShow: function() 2309 { 2310 this.setContent(BX("bxr-basket-popup")); 2311 $(document).on( 2312 'click', 2313 '#continue-buy', 2314 function(){ 2315 BXReady.basketPopup.close(); 2316 } 2317 ); 2318 } 2319 } 2320 }); 2321 2322 BXReady.basketPopup.show(); 2323 2324 $('#basketPopup').css({ 2325 'top':Math.abs(((window.innerHeight - $('#basketPopup').outerHeight()) / 2)+ $(window).scrollTop()), 2326 'left':Math.abs(((window.innerWidth - $('#basketPopup').outerWidth()) / 2)) 2327 }); 2328 $('#basket-popup-product-image > img ').css({ 2329 'width':'auto', 2330 'height':'auto' 2331 }); 2332 } 2333 } 2334 } 2335 }); 2336 } 2337 }, 2338 2339 deleteItem: function(item) { 2340 basket = this; 2341 if (this.params.ajaxUrl.length <= 0) return; 2342 2343 $.ajax({
2344 url: this.params.ajaxUrl, 2345 data: { 2346 ajaxbuy: 'yes', 2347 action: 'delete', 2348 item: item, 2349 rg: Math.random(), 2350 siteId: this.params.postData.siteId, 2351 template: this.params.postData.template, 2352 parameters: this.params.postData.parameters 2353 }, 2354 type: 'POST', 2355 success: function() { 2356 basket.refresh(); 2357 BXReady.closeAjaxShadow('bxr-basket-body-shadow'); 2358 } 2359 }); 2360 }, 2361 2362 deleteAll: function() { 2363 basket = this; 2364 if (this.params.ajaxUrl.length <= 0) return; 2365 2366 $.ajax({ 2367 url: this.params.ajaxUrl, 2368 data: { 2369 ajaxbuy: 'yes', 2370 action: 'deleteAll', 2371 rg: Math.random(), 2372 siteId: this.params.postData.siteId, 2373 template: this.params.postData.template, 2374 parameters: this.params.postData.parameters 2375 }, 2376 type: 'POST', 2377 success: function() { 2378 basket.refresh(); 2379 BXReady.closeAjaxShadow('bxr-basket-body-shadow'); 2380 } 2381 }); 2382 }, 2383 2384 delayItem: function(item) { 2385 basket = this; 2386 if (this.params.ajaxUrl.length <= 0) return; 2387 2388 $.ajax({
2389 url: this.params.ajaxUrl, 2390 data: { 2391 ajaxbuy: 'yes', 2392 action: 'delay', 2393 item: item, 2394 rg: Math.random(), 2395 siteId: this.params.postData.siteId, 2396 template: this.params.postData.template, 2397 parameters: this.params.postData.parameters 2398 }, 2399 type: 'POST', 2400 success: function() { 2401 BXReady.closeAjaxShadow('bxr-basket-body-shadow'); 2402 basket.refresh(); 2403 } 2404 }); 2405 }, 2406 2407 delayToCart: function(item) { 2408 basket = this; 2409 if (this.params.ajaxUrl.length <= 0) return; 2410 2411 $.ajax({ 2412 url: this.params.ajaxUrl, 2413 data: { 2414 ajaxbuy: 'yes', 2415 action: 'back', 2416 item: item, 2417 rg: Math.random(), 2418 siteId: this.params.postData.siteId, 2419 template: this.params.postData.template, 2420 parameters: this.params.postData.parameters 2421 }, 2422 type: 'POST', 2423 success: function() { 2424 basket.refresh(); 2425 BXReady.closeAjaxShadow('bxr-basket-body-shadow'); 2426 } 2427 }); 2428 }, 2429 2430 animateShowIndicator: function(element,sClass) { 2431 element.css('opacity', '0').addClass(sClass+'-active').animate({'opacity': '1'}, 1000, "easeOutExpo"); 2432 }, 2433 2434 animateHideIndicator: function(sClass) { 2435 this.css('opacity', '0'); 2436 this.addClass('sClass'); 2437 }, 2438 2439 refreshData: function() { 2440 if (delayClick) 2441 $('.tab-delay').click(); 2442 else 2443 $('.tab-basket').click(); 2444 2445 basket = this; 2446 2447 $('#bxr-basket-body').html($('#basket-body-content').html()); 2448 $('#bxr-delay-body').html($('#delay-body-content').html()); 2449 $('#bxr-favor-body').html($('#favor-body-content').html()); 2450 2451 basket.redraw(JSON.parse($('#bxr-basket-data').html())) 2452 2453 var panels = ['basket', 'delay', 'favor']; 2454 2455 for (i=0; i<panels.length; i++) { 2456 $('#bxr-basket-row .bxr-indicator-'+panels[i] + ", #bxr-basket-small-row .bxr-indicator-" + panels[i]).html($('#bxr-basket-content #bxr-indicator-'+panels[i]+'-new').html()); 2457 } 2458 }, 2459 2460 refresh: function(notRequest, dataRefresh) { 2461 basket = this; 2462 2463 if (notRequest === true){ 2464 if (dataRefresh !== undefined) { 2465 $('#bxr-basket-content').html(dataRefresh); 2466 basket.refreshData(); 2467 } else { 2468 if (basket.params.startBasketData !== undefined) { 2469 basket.redraw(); 2470 } 2471 } 2472 }else{ 2473 if (this.params.ajaxUrl.length <= 0) return; 2474 2475 $.ajax({
2476 url: this.params.ajaxUrl, 2477 data: { 2478 ajaxbuy: 'yes', 2479 rg: Math.random(), 2480 siteId: this.params.postData.siteId, 2481 template: this.params.postData.template, 2482 parameters: this.params.postData.parameters 2483 }, 2484 type: 'POST', 2485 success: function(data) { 2486 $('#bxr-basket-content').html(data); 2487 basket.refreshData(); 2488 } 2489 }); 2490 } 2491 2492 }, 2493 2494 basketButtonsInit: function() { 2495 basket = this; 2496 $('form.bxr-basket-action').submit(function() { 2497 window.BXReady.showAjaxShadow('body','body-shadow'); 2498 basket.addItem($(this)); 2499 return false; 2500 }); 2501 2502 $(document).on( 2503 'click', 2504 'form.bxr-basket-action .bxr-basket-add', 2505 function() { 2506 window.BXReady.showAjaxShadow('body','body-shadow'); 2507 basket.addItem($(this).parent('form')); 2508 return false; 2509 } 2510 ); 2511 2512 $(document).on( 2513 'click', 2514 'form.bxr-basket-action .bxr-basket-delay', 2515 function() { 2516 basket.addItem($(this).parent('form'), true); 2517 return false; 2518 } 2519 ); 2520 2521 $(document).on( 2522 'click', 2523 'form.bxr-basket-action .bxr-basket-favor', 2524 function() { 2525 $(this).addClass('spinner-wrap'); 2526 $(this).find(".fa").attr('class', 'fa spinner wheel'); 2527 if (!$(this).hasClass('bxr-indicator-item-active')) 2528 $(this).addClass('bxr-indicator-item-active'); 2529 basket.addItem($(this).parent('form'), false, true); 2530 return false; 2531 } 2532 ); 2533 2534 $(document).on( 2535 'click', 2536 'form.bxr-basket-action .bxr-basket-favor-delete', 2537 function() { 2538 basket.addItem($(this).parent('form'), false, true); 2539 return false; 2540 } 2541 ); 2542 2543 $(document).on( 2544 'click', 2545 '#bxr-basket-body .icon-button-delete', 2546 function() { 2547 itemID = $(this).data('item'); 2548 BXReady.showAjaxShadow('#bxr-basket-body','bxr-basket-body-shadow'); 2549 basket.deleteItem(itemID); 2550 } 2551 ); 2552 2553 /*$(document).on( 2554 'click', 2555 '#bxr-basket-body .icon-button-delete', 2556 function() { 2557 itemID = $(this).data('item'); 2558 BXReady.showAjaxShadow('#bxr-delay-body','bxr-basket-body-shadow'); 2559 basket.deleteItem(itemID); 2560 } 2561 );*/ 2562 2563 $(document).on( 2564 'click', 2565 '#bxr-basket-body .icon-button-delay', 2566 function() { 2567 itemID = $(this).data('item'); 2568 BXReady.showAjaxShadow('#bxr-basket-body','bxr-basket-body-shadow'); 2569 basket.delayItem(itemID); 2570 } 2571 ); 2572 2573 $(document).on( 2574 'click', 2575 '#bxr-basket-body .icon-button-cart', 2576 function() { 2577 itemID = $(this).data('item'); 2578 BXReady.showAjaxShadow('#bxr-basket-body','bxr-basket-body-shadow'); 2579 basket.delayToCart(itemID); 2580 } 2581 ); 2582 2583 $(document).on( 2584 'click', 2585 '.bxr-basket-indicator', 2586 function() { 2587 var panels = ['bxr-basket-body', 'bxr-delay-body', 'bxr-compare-body', 'bxr-favor-body']; 2588 itemID = $(this).data('child'); 2589 2590 if($("div").is(".bxr-basket-fixed")) { 2591 $("#bxr-basket-row div").removeClass("bxr-color-flat"); 2592 } 2593 2594 for (i=0; i<panels.length; i++) { 2595 if (panels[i] != itemID) 2596 $('#'+panels[i]).hide(); 2597 } 2598 2599 if($("div").is(".bxr-basket-dinamic")) { 2600 if($('#'+itemID).is(":visible")) { 2601 $('#bxr-basket-row').animate({'right': '0px'}, 300, '', function(){ 2602 setBasketMaxH('#'+itemID); 2603 $('#'+itemID).hide(); 2604 }); 2605 } 2606 else { 2607 $('#'+itemID).show(); 2608 $(this).parent("div").addClass("bxr-color-flat"); 2609 $('#bxr-basket-row').animate({'right': '810px'}, 300, '', function(){ 2610 setBasketMaxH('#'+itemID); 2611 }); 2612 } 2613 } 2614 else { 2615 if($("div").is(".bxr-basket-fixed")) { 2616 if(!$('#'+itemID).is(":visible")) 2617 $(this).parent("div").addClass("bxr-color-flat"); 2618 } 2619 2620 $('#'+itemID).fadeToggle(200, function() { 2621 setBasketMaxH('#'+itemID); 2622 }); 2623 } 2624 } 2625 ); 2626 2627 $(document).on( 2628 'click', 2629 '.bxr-basket-tab', 2630 function() { 2631 var tabCode = $(this).data('tab'); 2632 delayClick = (tabCode == 'delay') ? true : false; 2633 2634 $('.bxr-basket-tab').removeClass('active bxr-font-color');
2635 $('.bxr-basket-tab[data-tab='+tabCode+']').addClass('active bxr-font-color'); 2636 $('.bxr-basket-tab-content').removeClass('active'); 2637 $('.bxr-basket-tab-content[data-tab="'+tabCode+'"]').addClass('active'); 2638 } 2639 ); 2640 2641 $(document).on( 2642 'click', 2643 '.tab-basket-clear', 2644 function() { 2645 BXReady.showAjaxShadow('#bxr-basket-body','bxr-basket-body-shadow'); 2646 basket.deleteAll(); 2647 } 2648 ); 2649 2650 $(document).on( 2651 'click', 2652 '.bxr-quantity-button-minus', 2653 function() { 2654 itemID = parseInt($(this).data('item')); 2655 operation = $(this).data('operation'); 2656 coef = parseFloat($(this).data('ratio')); 2657 2658 if (isNaN(coef)) coef = 1; 2659 maxQty = coef; 2660 2661 startQtyValue = parseFloat($(this).closest('.bxr-basket-group').find('.bxr-quantity-text[data-item='+itemID+']').val()); 2662 newQty = basket.changeQtyValue(startQtyValue, coef, 0, "dec"); 2663 2664 if (operation === 'auto_save') { 2665 BXReady.showAjaxShadow('#bxr-basket-body','bxr-basket-body-shadow'); 2666 basket.newQty(itemID, newQty) 2667 } 2668 2669 $('.bxr-quantity-text[data-item='+itemID+']').val(newQty); 2670 } 2671 ); 2672 2673 $(document).on( 2674 'click', 2675 '.bxr-quantity-button-plus', 2676 function() { 2677 itemID = parseInt($(this).data('item')); 2678 operation= $(this).data('operation'); 2679 coef = parseFloat($(this).data('ratio')); 2680 if (isNaN(coef)) coef = 1; 2681 2682 maxQty = parseInt($(this).data('max')); 2683 if (isNaN(maxQty)) maxQty = 0; 2684 2685 startQtyValue = parseFloat($(this).closest('.bxr-basket-group').find('.bxr-quantity-text[data-item='+itemID+']').val()); 2686 newQty = basket.changeQtyValue(startQtyValue, coef, maxQty, "inc"); 2687 2688 if (operation === 'auto_save') { 2689 BXReady.showAjaxShadow('#bxr-basket-body','bxr-basket-body-shadow'); 2690 basket.newQty(itemID, newQty); 2691 } 2692 2693 $('.bxr-quantity-text[data-item='+itemID+']').val(newQty); 2694 } 2695 ); 2696 2697 $(document).on( 2698 'focusout', 2699 '.bxr-quantity-text', 2700 function() { 2701 itemID = parseInt($(this).data('item')); 2702 operation= $(this).closest('.bxr-basket-group').find('.bxr-quantity-button-plus[data-item='+itemID+']').data('operation'); 2703 coef = parseFloat($(this).closest('.bxr-basket-group').find('.bxr-quantity-button-plus[data-item='+itemID+']').data('ratio')); 2704 maxQty = parseInt($(this).closest('.bxr-basket-group').find('.bxr-quantity-button-plus[data-item='+itemID+']').data('max')); 2705 2706 if (isNaN(coef)) coef = 1; 2707 if (isNaN(maxQty)) maxQty = 0; 2708 2709 startQtyValue = parseFloat($(this).val()); 2710 newQty = basket.changeQtyValue(startQtyValue, coef, maxQty, "arb"); 2711 2712 if (operation === 'auto_save') 2713 basket.newQty(itemID, newQty); 2714 2715 $('.bxr-quantity-text[data-item='+itemID+']').val(newQty); 2716 } 2717 ); 2718 2719 $(document).mouseup(function(e) { 2720 var container = 'div.bxr-header-panel #basket_container'; 2721 var container2 = 'div.top_fixed_panel #fixed_basket'; 2722 var other = '#bxr-basket-body-shadow'; 2723 var hideContainer = $('div[data-group=basket-group]'); 2724 2725 if ($(e.target).parents(container).length === 0 && $(e.target).parents(container2).length === 0 && $(other).has(e.target).length === 0) { 2726 $("#bxr-basket-row div").removeClass("bxr-color-flat"); 2727 2728 if($("div").is(".bxr-basket-dinamic")) { 2729 $('#bxr-basket-row').animate({'right': '0px'}, 300, '', function(){ 2730 var panels = ['bxr-basket-body', 'bxr-delay-body', 'bxr-compare-body', 'bxr-favor-body']; 2731 for (i=0; i<panels.length; i++) { 2732 $('#'+panels[i]).hide(); 2733 } 2734 }); 2735 } 2736 else { 2737 hideContainer.hide(); 2738 } 2739 2740 } 2741 }); 2742 2743 }, 2744 2745 autoSetVertical: function(){ 2746 }, 2747 2748 redraw: function(data) { 2749 basket = this; 2750 2751 if (data !== undefined) { 2752 2753 basket.list = data; 2754 basket.params.startBasketData = data; 2755 2756 } else { 2757 basket.list = basket.params.startBasketData; 2758 } 2759 2760 $('.bxr-indicator-item-favor').data("favor", 0); 2761 2762 if (basket.list.FAVOR.length > 0) { 2763 a = basket.list.FAVOR; 2764 2765 $('.bxr-counter-favor').html(basket.list.FAVOR.length); 2766 basket.animateShowIndicator($('.bxr-counter-favor'),'bxr-counter'); 2767 2768 for (var i = 0; i < a.length; i++) { 2769 value = basket.list.FAVOR[a[i]]; 2770 $('.bxr-indicator-item-favor[data-item='+a[i]+']').each(function() { 2771 if (!$(this).hasClass('bxr-indicator-item-active')) 2772 basket.animateShowIndicator($(this),'bxr-indicator-item'); 2773 $(this).find(".spinner").attr('class', 'fa fa-heart-o'); 2774 $(this).removeClass('spinner-wrap'); 2775 }); 2776 $('.bxr-indicator-item-favor[data-item='+a[i]+']').data("favor", 1); 2777 } 2778 } else { 2779 $('.bxr-counter-favor').removeClass('bxr-counter-active'); 2780 $('.bxr-indicator-item-favor').removeClass('bxr-indicator-item-active'); 2781 } 2782 2783 $('.bxr-indicator-item-favor').each(function() { 2784 if ($(this).data('favor') == 0) { 2785 $(this).removeClass('bxr-indicator-item-active'); 2786 $(this).find(".spinner").attr('class', 'fa fa-heart-o'); 2787 $(this).removeClass('spinner-wrap'); 2788 } 2789 }); 2790 2791 $('.bxr-indicator-item').data("basket", 0); 2792 2793 if (basket.list.ITEMS.length > 0) { 2794 a = basket.list.ITEMS; 2795 2796 for (var i = 0; i < a.length; i++) { 2797 value = basket.list.ALL[a[i]]; 2798 2799 $('.bxr-indicator-item-basket[data-item='+a[i]+']').each(function() { 2800 if (!$(this).hasClass('bxr-indicator-item-active')) 2801 basket.animateShowIndicator($(this),'bxr-indicator-item'); 2802 }); 2803 $('.bxr-counter-item-basket[data-item='+a[i]+']').html(value); 2804 $('.bxr-indicator-item-basket[data-item='+a[i]+']').data("basket", 1); 2805 } 2806 } else 2807 $('.bxr-counter-item-basket').removeClass('bxr-indicator-item-active'); 2808 2809 $('.bxr-indicator-item-basket').each(function() { 2810 if ($(this).data('basket') == 0) 2811 $(this).removeClass('bxr-indicator-item-active'); 2812 }); 2813 2814 if (Object.keys(basket.list.ALL).length > 0) { 2815 $('.bxr-counter-basket').html(Object.keys(basket.list.ALL).length); 2816 basket.animateShowIndicator($('.bxr-counter-basket'),'bxr-counter'); 2817 } else { 2818 $('.bxr-counter-basket').html(0); 2819 $('.bxr-counter-basket').removeClass('bxr-counter-active'); 2820 } 2821 2822 this.startEvents(); 2823 2824 }, 2825 2826 startEvents: function() { 2827 basket = this; 2828 2829 $(document).trigger('refreshBasket', { 2830 'basket': basket.params.startBasketData.ITEMS.length + basket.params.startBasketData.DELAY.length, 2831 'delay': basket.params.startBasketData.DELAY.length, 2832 'favor': basket.params.startBasketData.FAVOR.length 2833 }); 2834 }, 2835 2836 init: function(params){ 2837 2838 basket = this; 2839 basket.params = params; 2840 2841 if(window.BXReady.Market.Basket.objInit) { 2842 return true; 2843 } 2844 2845 window.BXReady.Market.Basket.objInit = true; 2846 2847 this.params = params; 2848 this.basketButtonsInit(); 2849 this.refresh(true); 2850 $(document).ready(function(){ 2851 basket.startEvents(); 2852 }); 2853 } 2854 }; 2855 2856})(jQuery);;/* Ammina JS file original /bitrix/components/bxready.market2/catalog.compare.list/templates/.default/script.js */ 2857;(function() { 2858 2859 window.BXReady.Market.Compare = { 2860 2861 compareUrl: '/ajax/bxr_compare.php', 2862 messList: '', 2863 mess: '', 2864 iblockID: 0, 2865 scrollUp: false, 2866 list: '', 2867 2868 animateShowIndicator: function (element, sClass) { 2869 element.css('opacity', '0').addClass(sClass + '-active').animate({'opacity': '1'}, 1000, "easeOutExpo"); 2870 }, 2871 2872 reload: function (notReload) { 2873 2874 compare = this; 2875 2876 if (notReload === true) { 2877 compare.setIndicators(); 2878 } else { 2879 url = compare.ajaxURL + '?ajaxbuy=yes&rg=' + Math.random(); 2880 2881 $.ajax({
2882 url: url, 2883 success: function (data) { 2884 compare.refresh(data); 2885 } 2886 }); 2887 } 2888 }, 2889 2890 setIndicators: function() { 2891 compare = this; 2892 compare.list = this.startDataCompare; 2893 2894 $('.bxr-indicator-item-compare').data("compare", 0); 2895 if (compare.list != null && Object.keys(compare.list).length > 0) { 2896 $.each(compare.list, function (index, elem) { 2897 $('.bxr-indicator-item-compare[data-item=' + index + ']').each(function () { 2898 if (!$(this).hasClass('bxr-counter-compare-active')) 2899 compare.animateShowIndicator($(this), 'bxr-counter-compare'); 2900 $(this).removeClass('spinner-wrap'); 2901 $(this).find(".spinner").attr('class', 'fa fa-bar-chart'); 2902 $(this).addClass('bxr-counter-compare-active bxr-indicator-item-active'); 2903 }); 2904 $('.bxr-indicator-item-compare[data-item=' + index + ']').data("compare", 1); 2905 }); 2906 } else 2907 $('.bxr-indicator-item-compare').removeClass('bxr-counter-compare-active bxr-indicator-item-active'); 2908 2909 $('.bxr-indicator-item-compare').each(function () { 2910 if ($(this).data('compare') == 0) { 2911 $(this).removeClass('bxr-counter-compare-active bxr-indicator-item-active'); 2912 $(this).removeClass('spinner-wrap'); 2913 $(this).find(".spinner").attr('class', 'fa fa-bar-chart'); 2914 } 2915 }); 2916 2917 $(document).trigger('refreshCompare', compare.list); 2918 }, 2919 2920 refresh: function (data) { 2921 2922 compare = this; 2923 2924 $('#bxr-compare-body').html(data); 2925 $('#bxr-counter-compare').html($('#bxr-counter-compare-new').html()); 2926 2927 compare.list = JSON.parse($('#bxr-compare-jdata').html()); 2928 compare.startDataCompare = compare.list; 2929 2930 this.setIndicators(); 2931 2932 BXReady.Market.Basket.autoSetVertical(); 2933 }, 2934 2935 add: function (itemID) { 2936 compare = window.BXReady.Market.Compare; 2937 if ( 2938 compare.ajaxURL.length <= 0 2939 || compare.iblockID <= 0) 2940 return; 2941 2942 url = compare.ajaxURL + '?action=ADD_TO_COMPARE_LIST&bid=' + compare.iblockID + '&id=' + itemID + '&ajaxbuy=yes&rg=' + Math.random(); 2943 2944 $.ajax({
2945 url: url, 2946 success: function (data) { 2947 2948 compare.refresh(data); 2949 } 2950 }); 2951 2952 return false; 2953 }, 2954 2955 delete: function (itemID) { 2956 2957 var compare = this; 2958 2959 if ( 2960 compare.ajaxURL.length <= 0 2961 || compare.iblockID <= 0) 2962 return; 2963 2964 var url = compare.ajaxURL + '?action=DELETE_FROM_COMPARE_LIST&bid=' + compare.iblockID + '&id=' + itemID + '&ajaxbuy=yes&rg=' + Math.random(); 2965 2966 $.ajax({ 2967 url: url, 2968 success: function (data) { 2969 2970 compare.refresh(data); 2971 BXReady.closeAjaxShadow('basket-body-shadow'); 2972 } 2973 }); 2974 2975 return false; 2976 }, 2977 2978 init: function () { 2979 var compare = window.BXReady.Market.Compare; 2980 compare.reload(true); 2981 2982 $(document).on( 2983 'click', 2984 '.bxr-compare-button', 2985 function () { 2986 2987 var itemID = $(this).data('item'); 2988 2989 n = 0; 2990 2991 if (compare.list == null) { 2992 } else { 2993 value = parseInt(compare.list[itemID]); 2994 if (!isNaN(value) && value > 0) 2995 n = 1; 2996 } 2997 2998 $(this).addClass('spinner-wrap'); 2999 $(this).find(".fa").attr('class', 'fa spinner wheel'); 3000 if (!$(this).hasClass('bxr-counter-compare-active')) 3001 $(this).addClass('bxr-counter-compare-active bxr-indicator-item-active'); 3002 3003 if (n == 0) { 3004 compare.add(itemID); 3005 } else { 3006 compare.delete(itemID); 3007 } 3008 3009 return false; 3010 } 3011 ); 3012 $(document).on( 3013 'click', 3014 '.compare-button-delete', 3015 function () { 3016 compare = window.BXReady.Market.Compare; 3017 itemID = $(this).data('item'); 3018 3019 BXReady.showAjaxShadow('#bxr-compare-body', 'basket-body-shadow'); 3020 compare.delete(itemID); 3021 return false; 3022 } 3023 ); 3024 } 3025 }; 3026})(jQuery); 3027;/* Ammina JS file original /bitrix/components/bxready.market2/catalog.fast.view/templates/.default/script.js */ 3028;(function() { 3029 3030 if (!!window.JCCatalogFastView) 3031 return; 3032 3033 window.JCCatalogFastView = function(params) { 3034 this.params = params; 3035 3036 var current = this; 3037 3038 this.init(); 3039 3040 $(document).on("click", ".bxr-fast-view-btn", function(event){ 3041 current.load(event.target)} 3042 ); 3043 3044 $(document).on("show.bs.modal", "#fv_fastview", function(){ 3045 current.clearData(); 3046 } 3047 ); 3048 3049 3050 }; 3051 3052 window.JCCatalogFastView.prototype = 3053 { 3054 isTouchDevice: function() { 3055 try { 3056 document.createEvent('TouchEvent'); 3057 return true; 3058 } 3059 catch(e) { 3060 return false; 3061 } 3062 }, 3063 3064 init: function(){ 3065 3066 }, 3067 3068 load: function(e){ 3069 3070 this.clearData(); 3071 3072 var id = $(e).data("uid"); 3073 //var formBodyId = $(e).data("form-id"); 3074 var formBodyId = 'ajaxFormContainer_fastview'; 3075 var elementId = $(e).data("element-id"); 3076 var offerId = $(e).data("offer-id"); 3077 var sectionId = $(e).data("section-id"); 3078 var elementUrl = $(e).data("element-url"); 3079 3080 //$('body').append($('#fv_'+id)); 3081 if (this.params.ajaxUrl.length > 0) { 3082 if ($('#bxr-fast-view-btn-'+id).data('state') != 'load') { 3083 $('#bxr-fast-view-btn-'+id).data('state', 'load'); 3084 targetUrl = this.params.ajaxUrl; 3085 3086 $.ajax({ 3087 url: targetUrl, 3088 data: { 3089 ajax_mode: 'yes', 3090 ID: id, 3091 siteId: this.params.postData.siteId, 3092 rmT: Math.random(), 3093 template: this.params.postData.template, 3094 parameters: this.params.postData.parameters, 3095 elementId : elementId, 3096 offerId : offerId, 3097 sectionId : sectionId, 3098 elementUrl : elementUrl 3099 }, 3100 type: 'POST', 3101 success: function(data) { 3102 $('#'+formBodyId).html(data); 3103 var productName = $('#'+formBodyId).find('.bxr-name-wrap'); 3104 $('#'+formBodyId).closest('.fast-view-modal').find('.modal
3104-title').html(productName); 3105 } 3106 }); 3107 } else { 3108 3109 } 3110 } 3111 }, 3112 3113 clearData: function(){ 3114 clearHtml = '<div class="bxr-modal-loading"><i class="fa fa-circle-o-notch fa-spin bxr-font-color" aria-hidden="true"></i></div>'; 3115 $('#ajaxFormContainer_fastview').html(clearHtml); 3116 $('#fv_fastview .modal-title').html('Fast View loaded....'); 3117 3118 } 3119 } 3120})();;/* Ammina JS file original /bitrix/components/bxready.market2/catalog.fast.view/templates/element/script.js */ 3121;(function() { 3122 'use strict'; 3123 3124 if (!!window.JCIblockVoteStars) 3125 return; 3126 3127 window.JCIblockVoteStars = function (params) 3128 { 3129 this.progressId = params.progressId; 3130 this.ratingId = params.ratingId; 3131 this.starsId = params.starsId; 3132 this.ajaxUrl = params.ajaxUrl; 3133 this.voteId = params.voteId; 3134 this.starsObj = null; 3135 this.votedValue = null; 3136 this.preVotedValue = null; 3137 }; 3138 3139 window.JCIblockVoteStars.prototype.setValue = function(value) 3140 { 3141 value = parseInt(value); 3142 if (isNaN(value)) 3143 value = 0; 3144 else if(value > 100) 3145 value = 100; 3146 else if(value < 0) 3147 value = 0; 3148 3149 var progressObj = BX(this.progressId); 3150
3151 if(!!progressObj) 3152 { 3153 progressObj.style.width = parseInt(value)+"%"; 3154 this.votedValue = value; 3155 } 3156 }; 3157 3158 window.JCIblockVoteStars.prototype.setVotes = function(value) 3159 { 3160 var ratingObj = BX(this.ratingId); 3161 3162 if(!!ratingObj) 3163 ratingObj.innerHTML = "( "+value+" )"; 3164 }; 3165 3166 window.JCIblockVoteStars.prototype.getStarsObj = function() 3167 { 3168 if(!this.starsObj) 3169 this.starsObj = BX(this.starsId); 3170 3171 return this.starsObj; 3172 }; 3173 3174 /*todo: IE 8 has no pageX, pageY.*/ 3175 window.JCIblockVoteStars.prototype.onMouseMove = function(event) 3176 { 3177 var starsPos = BX.pos(this.getStarsObj()); 3178 3179 var voteValue = (event.pageX - starsPos.left)/starsPos.width*5; 3180 3181 for (var i = 1; i <= 5; i++) 3182 { 3183 if(voteValue < i) 3184 { 3185 voteValue = i; 3186 break; 3187 } 3188 } 3189 3190 this.setValue(voteValue*20); 3191 }; 3192 3193 window.JCIblockVoteStars.prototype.onMouseOver = function(event) 3194 { 3195 BX.bind(this.getStarsObj(), 'click', BX.proxy(this.onVote, this)); 3196 this.preVotedValue = this.votedValue; 3197 }; 3198 3199 window.JCIblockVoteStars.prototype.onMouseOut = function(event) 3200 { 3201 BX.unbind(this.getStarsObj(), 'click', BX.proxy(this.onVote, this)); 3202 this.votedValue = this.preVotedValue; 3203 this.setValue(this.votedValue); 3204 }; 3205 3206 window.JCIblockVoteStars.prototype.onVote = function(event) 3207 { 3208 this.unBindEvents(); 3209 3210 this.ajaxParams.rating = parseInt(this.votedValue/20)-1; 3211 this.ajaxParams.vote = "Y"; 3212 this.ajaxParams.vote_id = this.voteId; 3213 3214 BX.ajax({ 3215 timeout: 30, 3216 method: 'POST', 3217 dataType: 'json', 3218 url: this.ajaxUrl, 3219 data: this.ajaxParams, 3220 onsuccess: BX.delegate(this.SetResult, this) 3221 }); 3222 }; 3223 3224 window.JCIblockVoteStars.prototype.SetResult = function(result) 3225 { 3226 if (!!result && !result.ERROR) 3227 { 3228 this.setValue((result.value)*20); 3229 this.setVotes(result.votes); 3230 } 3231 }; 3232 3233 window.JCIblockVoteStars.prototype.bindEvents = function() 3234 { 3235 var starsObj = this.getStarsObj(); 3236 BX.bind(starsObj, 'mousemove', BX.proxy(this.onMouseMove, this)); 3237 BX.bind(starsObj, 'mouseover', BX.proxy(this.onMouseOver, this)); 3238 BX.bind(starsObj, 'mouseout', BX.proxy(this.onMouseOut, this)); 3239 }; 3240 3241 window.JCIblockVoteStars.prototype.unBindEvents = function() 3242 { 3243 var starsObj = this.getStarsObj(); 3244 BX.unbind(starsObj, 'mousemove', BX.proxy(this.onMouseMove, this)); 3245 BX.unbind(starsObj, 'mouseover', BX.proxy(this.onMouseOver, this)); 3246 BX.unbind(starsObj, 'mouseout', BX.proxy(this.onMouseOut, this)); 3247 BX.unbind(this.getStarsObj(), 'click', BX.proxy(this.onVote, this)); 3248 }; 3249})(); 3250 3251(function (window) { 3252 3253 if (!!window.JCShareButtons) 3254 { 3255 return; 3256 } 3257 3258 window.JCShareButtons = function (containerId) 3259 { 3260 if (containerId) 3261 { 3262 var container = BX(containerId); 3263 if (container) 3264 { 3265 this.shareButtons = BX.findChildren(container, {tagName: 'LI'}, true); 3266 if (this.shareButtons && this.shareButtons.length >= 1) 3267 { 3268 BX.bind(this.shareButtons[this.shareButtons.length-1], 'click', BX.delegate(this.alterVisibility, this)); 3269 } 3270 } 3271 } 3272 }; 3273 3274 window.JCShareButtons.prototype.alterVisibility = function() 3275 { 3276 if (this.shareButtons && this.shareButtons.length >= 1) 3277 { 3278 for (var i = 0; i < this.shareButtons.length-1; i++) 3279 { 3280 var li = this.shareButtons[i]; 3281 li.style.display = li.style.display == "none"? "": "none"; 3282 } 3283 } 3284 }; 3285})(window); 3286 3287$(document).on('click', '.bxr-share-group', function() { 3288 $('.bxr-share-icon-wrap').toggle(); 3289}); 3290 3291$(document).on("change", ".bxr-bprop-required", function() { 3292 $(this).closest('.bxr-bprop-value').removeClass("wrong-bprop"); 3293});;/* Ammina JS file original /bitrix/components/bxready.market2/catalog.product.subscribe/templates/.default/script.js */ 3294;(function (window) { 3295 3296 if (!!window.JCCatalogProductSubscribe) 3297 { 3298 return; 3299 } 3300 3301 var subscribeButton = function(params) 3302 { 3303 subscribeButton.superclass.constructor.apply(this, arguments); 3304 this.nameNode = BX.create('span', { 3305 props : { id : this.id }, 3306 style: typeof(params.style) === 'object' ? params.style : {}, 3307 text: params.text 3308 }); 3309 this.buttonNode = BX.create('span', { 3310 attrs: { className: params.className }, 3311 style: { marginBottom: '0', borderBottom: '0 none transparent' }, 3312 children: [this.nameNode], 3313 events : this.contextEvents 3314 }); 3315 if (BX.browser.IsIE()) 3316 { 3317 this.buttonNode.setAttribute("hideFocus", "hidefocus"); 3318 } 3319 }; 3320 BX.extend(subscribeButton, BX.PopupWindowButton); 3321 3322 window.JCCatalogProductSubscribe = function(params) 3323 { 3324 this.buttonId = params.buttonId; 3325 this.buttonClass = params.buttonClass; 3326 this.jsObject = params.jsObject; 3327 this.ajaxUrl = '/bitrix/components/bitrix/catalog.product.subscribe/ajax.php'; 3328 this.alreadySubscribed = params.alreadySubscribed; 3329 this.urlListSubscriptions = params.urlListSubscriptions; 3330 this.listOldItemId = {}; 3331 3332 this.elemButtonSubscribe = null; 3333 this.elemPopupWin = null; 3334 this.defaultButtonClass = 'bx-catalog-subscribe-button'; 3335 3336 this._elemButtonSubscribeClickHandler = BX.delegate(this.subscribe, this); 3337 this._elemHiddenClickHandler = BX.delegate(this.checkSubscribe, this); 3338 3339 BX.ready(BX.delegate(this.init,this)); 3340 }; 3341 3342 window.JCCatalogProductSubscribe.prototype.init = function() 3343 { 3344 if (!!this.buttonId) 3345 { 3346 this.elemButtonSubscribe = BX(this.buttonId); 3347 this.elemHiddenSubscribe = BX(this.buttonId+'_hidden'); 3348 } 3349 3350 if (!!this.elemButtonSubscribe) 3351 { 3352 BX.bind(this.elemButtonSubscribe, 'click', this._elemButtonSubscribeClickHandler); 3353 } 3354 3355 if (!!this.elemHiddenSubscribe) 3356 { 3357 BX.bind(this.elemHiddenSubscribe, 'click', this._elemHiddenClickHandler); 3358 } 3359 3360 this.setButton(this.alreadySubscribed); 3361 }; 3362 3363 window.JCCatalogProductSubscribe.prototype.checkSubscribe = function() 3364 { 3365 if(!this.elemHiddenSubscribe || !this.elemButtonSubscribe) return; 3366 3367 if(this.listOldItemId.hasOwnProperty(this.elemButtonSubscribe.dataset.item)) 3368 { 3369 this.setButton(true); 3370 } 3371 else 3372 { 3373 BX.ajax({ 3374 method: 'POST', 3375 dataType: 'json', 3376 url: this.ajaxUrl, 3377 data: { 3378 sessid: BX.bitrix_sessid(), 3379 checkSubscribe: 'Y', 3380 itemId: this.elemButtonSubscribe.dataset.item 3381 }, 3382 onsuccess: BX.delegate(function (result) { 3383 if(result.subscribe) 3384 { 3385 this.setButton(true); 3386 this.listOldItemId[this.elemButtonSubscribe.dataset.item] = true; 3387 } 3388 else 3389 { 3390 this.setButton(false); 3391 } 3392 }, this) 3393 }); 3394 } 3395 }; 3396 3397 window.JCCatalogProductSubscribe.prototype.subscribe = function() 3398 { 3399 this.elemButtonSubscribe = BX.proxy_context; 3400 if(!this.elemButtonSubscribe) return false;
3401 3402 BX.ajax({ 3403 method: 'POST', 3404 dataType: 'json', 3405 url: this.ajaxUrl, 3406 data: { 3407 sessid: BX.bitrix_sessid(), 3408 subscribe: 'Y', 3409 itemId: this.elemButtonSubscribe.dataset.item, 3410 siteId: BX.message('SITE_ID') 3411 }, 3412 onsuccess: BX.delegate(function (result) { 3413 if(result.success) 3414 { 3415 this.createSuccessPopup(result); 3416 this.setButton(true); 3417 this.listOldItemId[this.elemButtonSubscribe.dataset.item] = true; 3418 } 3419 else if(result.contactFormSubmit) 3420 { 3421 this.initPopupWindow(); 3422// this.elemPopupWin.setTitleBar(BX.message('CPST_SUBSCRIBE_POPUP_TITLE')); 3423 var form = this.createContentForPopup(result); 3424 this.elemPopupWin.setContent(form); 3425 this.elemPopupWin.setButtons([ 3426 new subscribeButton({ 3427 text: BX.message('CPST_SUBSCRIBE_BUTTON_NAME'), 3428 className : 'btn btn-primary', 3429 events: { 3430 click : BX.delegate(function() { 3431 if(!this.validateContactField(result.contactTypeData)) 3432 { 3433 return false; 3434 } 3435 BX.ajax.submitAjax(form, { 3436 method : 'POST', 3437 url: this.ajaxUrl, 3438 processData : true, 3439 onsuccess: BX.delegate(function (resultForm) { 3440 resultForm = BX.parseJSON(resultForm, {}); 3441 if(resultForm.success) 3442 { 3443 this.createSuccessPopup(resultForm); 3444 this.setButton(true); 3445 this.listOldItemId[this.elemButtonSubscribe.dataset.item] = true; 3446 } 3447 else if(resultForm.error) 3448 { 3449 if(resultForm.hasOwnProperty('setButton')) 3450 { 3451 this.listOldItemId[this.elemButtonSubscribe.dataset.item] = true; 3452 this.setButton(true); 3453 } 3454 var errorMessage = resultForm.message; 3455 if(resultForm.hasOwnProperty('typeName')) 3456 { 3457 errorMessage = resultForm.message.replace('USER_CONTACT', 3458 resultForm.typeName); 3459 } 3460 BX('bx-catalog-subscribe-form-notify').style.color = 'red'; 3461 BX('bx-catalog-subscribe-form-notify').innerHTML = errorMessage; 3462 } 3463 }, this) 3464 }); 3465 }, this) 3466 } 3467 }), 3468// new subscribeButton({ 3469// text : BX.message('CPST_SUBSCRIBE_BUTTON_CLOSE'), 3470// className : 'btn', 3471// events : { 3472// click : BX.delegate(function() { 3473// this.elemPopupWin.close(); 3474// }, this) 3475// } 3476// }) 3477 ]); 3478 this.elemPopupWin.show(); 3479 } 3480 else if(result.error) 3481 { 3482 if(result.hasOwnProperty('setButton')) 3483 { 3484 this.listOldItemId[this.elemButtonSubscribe.dataset.item] = true; 3485 this.setButton(true); 3486 } 3487 this.showWindowWithAnswer({status: 'error', message: result.message}); 3488 } 3489 }, this) 3490 }); 3491 }; 3492 3493 window.JCCatalogProductSubscribe.prototype.validateContactField = function(contactTypeData) 3494 { 3495 var inputFields = BX.findChildren(BX('bx-catalog-subscribe-form'), 3496 {'tag': 'input', 'attribute': {id: 'userContact'}}, true); 3497 if(!inputFields.length || typeof contactTypeData !== 'object') 3498 { 3499 BX('bx-catalog-subscribe-form-notify').style.color = 'red'; 3500 BX('bx-catalog-subscribe-form-notify').innerHTML = BX.message('CPST_SUBSCRIBE_VALIDATE_UNKNOW_ERROR'); 3501 return false;
3502 } 3503 3504 var contactTypeId, contactValue, useContact, errors = [], useContactErrors = []; 3505 for(var k = 0; k < inputFields.length; k++) 3506 { 3507 contactTypeId = inputFields[k].getAttribute('data-id'); 3508 contactValue = inputFields[k].value; 3509 useContact = BX('bx-contact-use-'+contactTypeId); 3510 if(useContact && useContact.value == 'N') 3511 { 3512 useContactErrors.push(true); 3513 continue; 3514 } 3515 if(!contactValue.length) 3516 { 3517 errors.push(BX.message('CPST_SUBSCRIBE_VALIDATE_ERROR_EMPTY_FIELD').replace( 3518 '#FIELD#', contactTypeData[contactTypeId].contactLable)); 3519 } 3520 } 3521 3522 if(inputFields.length == useContactErrors.length) 3523 { 3524 BX('bx-catalog-subscribe-form-notify').style.color = 'red'; 3525 BX('bx-catalog-subscribe-form-notify').innerHTML = BX.message('CPST_SUBSCRIBE_VALIDATE_ERROR'); 3526 return false; 3527 } 3528 3529 if(errors.length) 3530 { 3531 BX('bx-catalog-subscribe-form-notify').style.color = 'red'; 3532 for(var i = 0; i < errors.length; i++) 3533 { 3534 BX('bx-catalog-subscribe-form-notify').innerHTML = errors[i]; 3535 } 3536 return false; 3537 } 3538 3539 return true; 3540 }; 3541 3542 window.JCCatalogProductSubscribe.prototype.reloadCaptcha = function() 3543 { 3544 BX.ajax.get(this.ajaxUrl+'?reloadCaptcha=Y', '', function(captchaCode) { 3545 BX('captcha_sid').value = captchaCode; 3546 BX('captcha_img').src = '/bitrix/tools/captcha.php?captcha_sid='+captchaCode+''; 3547 }); 3548 }; 3549 3550 window.JCCatalogProductSubscribe.prototype.createContentForPopup = function(responseData) 3551 { 3552 if(!responseData.hasOwnProperty('contactTypeData')) 3553 { 3554 return null; 3555 } 3556 3557 var contactTypeData = responseData.contactTypeData, contactCount = Object.keys(contactTypeData).length, 3558 styleInputForm = '', manyContact = 'N', content = document.createDocumentFragment(); 3559 3560 if(contactCount > 1) 3561 { 3562 manyContact = 'Y'; 3563 styleInputForm = 'display:none;'; 3564 content.appendChild(BX.create('p', { 3565 text: BX.message('CPST_SUBSCRIBE_MANY_CONTACT_NOTIFY') 3566 })); 3567 } 3568 3569 content.appendChild(BX.create('p', { 3570 props: {id: 'bx-catalog-subscribe-form-notify'} 3571 })); 3572 3573 for(var k in contactTypeData) 3574 { 3575 if(contactCount > 1) 3576 { 3577 content.appendChild(BX.create('div', { 3578 props: { 3579 className: 'bx-catalog-subscribe-form-container' 3580 }, 3581 children: [ 3582 BX.create('div', { 3583 props: { 3584 className: 'checkbox' 3585 }, 3586 children: [ 3587 BX.create('lable', { 3588 props: { 3589 className: 'bx-filter-param-label' 3590 }, 3591 attrs: { 3592 onclick: this.jsObject+'.selectContactType('+k+', event);' 3593 }, 3594 children: [ 3595 BX.create('input', { 3596 props: { 3597 type: 'hidden', 3598 id: 'bx-contact-use-'+k, 3599 name: 'contact['+k+'][use]', 3600 value: 'N' 3601 } 3602 }), 3603 BX.create('input', { 3604 props: { 3605 id: 'bx-contact-checkbox-'+k, 3606 type: 'checkbox' 3607 } 3608 }), 3609 BX.create('span', { 3610 props: { 3611 className: 'bx-filter-param-text' 3612 }, 3613 text: contactTypeData[k].c
3613ontactLable 3614 }) 3615 ] 3616 }) 3617 ] 3618 }) 3619 ] 3620 })); 3621 } 3622 content.appendChild(BX.create('div', { 3623 props: { 3624 id: 'bx-catalog-subscribe-form-container-'+k, 3625 className: 'bx-catalog-subscribe-form-container', 3626 style: styleInputForm 3627 }, 3628 children: [ 3629 BX.create('div', { 3630 props: { 3631 className: 'bx-catalog-subscribe-form-container-label' 3632 }, 3633 text: BX.message('CPST_SUBSCRIBE_LABLE_CONTACT_INPUT').replace( 3634 '#CONTACT#', contactTypeData[k].contactLable) 3635 }), 3636 BX.create('div', { 3637 props: { 3638 className: 'bx-catalog-subscribe-form-container-input' 3639 }, 3640 children: [ 3641 BX.create('input', { 3642 props: { 3643 id: 'userContact', 3644 className: '', 3645 type: 'text', 3646 name: 'contact['+k+'][user]' 3647 }, 3648 attrs: {'data-id': k} 3649 }) 3650 ] 3651 }) 3652 ] 3653 })); 3654 } 3655 if(responseData.hasOwnProperty('captchaCode')) 3656 { 3657 content.appendChild(BX.create('div', { 3658 props: { 3659 className: 'bx-catalog-subscribe-form-container' 3660 }, 3661 children: [ 3662 BX.create('span', {props: {className: 'bx-catalog-subscribe-form-star-required'}, text: '*'}), 3663 BX.message('CPST_ENTER_WORD_PICTURE'), 3664 BX.create('div', { 3665 props: {className: 'bx-captcha'}, 3666 children: [ 3667 BX.create('input', { 3668 props: { 3669 type: 'hidden', 3670 id: 'captcha_sid', 3671 name: 'captcha_sid', 3672 value: responseData.captchaCode 3673 } 3674 }), 3675 BX.create('img', { 3676 props: { 3677 id: 'captcha_img', 3678 src: '/bitrix/tools/captcha.php?captcha_sid='+responseData.captchaCode+'' 3679 }, 3680 attrs: { 3681 width: '180', 3682 height: '40', 3683 alt: 'captcha', 3684 onclick: this.jsObject+'.reloadCaptcha();' 3685 } 3686 }) 3687 ] 3688 }), 3689 BX.create('div', { 3690 props: {className: 'bx-catalog-subscribe-form-container-input'}, 3691 children: [ 3692 BX.create('input', { 3693 props: { 3694 id: 'captcha_word', 3695 className: '', 3696 type: 'text', 3697 name: 'captcha_word' 3698 }, 3699 attrs: {maxlength: '50'} 3700 }) 3701 ] 3702 }) 3703 ] 3704 })); 3705 } 3706 var form = BX.create('form', { 3707 props: { 3708 id: 'bx-catalog-subscribe-form' 3709 }, 3710 children: [ 3711 BX.create('input', { 3712 props: { 3713 type: 'hidden', 3714 name: 'manyContact', 3715 value: manyContact 3716 } 3717 }), 3718 BX.create('input', { 3719 props: { 3720 type: 'hidden', 3721 name: 'sessid', 3722 value: BX.bitrix_sessid() 3723 } 3724 }), 3725 BX.create('input', { 3726 props: { 3727 type: 'hidden', 3728 name: 'itemId', 3729 value: this.elemButtonSubscribe.dataset.item 3730 } 3731 }), 3732 BX.create('input', { 3733 props: { 3734 type: 'hidden', 3735 name: 'siteId', 3736 value: BX.message('SITE_ID') 3737 } 3738 }), 3739 BX.create('input', { 3740 props: { 3741 type: 'hidden', 3742 name: 'contactFormSubmit', 3743 value: 'Y' 3744 } 3745 }) 3746 ] 3747 }); 3748 3749 form.appendChild(content); 3750 3751 return form; 3752 }; 3753 3754 window.JCCatalogProductSubscribe.prototype.selectContactType = function(contactTypeId, event) 3755 { 3756 var contactInput = BX('bx-catalog-subscribe-form-container-'+contactTypeId), visibility = '', 3757 checkboxInput = BX('bx-contact-checkbox-'+contactTypeId); 3758 if(!contactInput) 3759 { 3760 return false;
3761 } 3762 3763 if(checkboxInput != event.target) 3764 { 3765 if(checkboxInput.checked) 3766 { 3767 checkboxInput.checked = false; 3768 } 3769 else 3770 { 3771 checkboxInput.checked = true; 3772 } 3773 } 3774 3775 if (contactInput.currentStyle) 3776 { 3777 visibility = contactInput.currentStyle.display; 3778 } 3779 else if (window.getComputedStyle) 3780 { 3781 var computedStyle = window.getComputedStyle(contactInput, null); 3782 visibility = computedStyle.getPropertyValue('display'); 3783 } 3784 3785 if(visibility === 'none') 3786 { 3787 BX('bx-contact-use-'+contactTypeId).value = 'Y'; 3788 BX.style(contactInput, 'display', ''); 3789 } 3790 else 3791 { 3792 BX('bx-contact-use-'+contactTypeId).value = 'N'; 3793 BX.style(contactInput, 'display', 'none'); 3794 } 3795 }; 3796 3797 window.JCCatalogProductSubscribe.prototype.createSuccessPopup = function(result) 3798 { 3799 this.initPopupWindow(); 3800// this.elemPopupWin.setTitleBar(BX.message('CPST_SUBSCRIBE_POPUP_TITLE')); 3801 var content = BX.create('div', { 3802 props:{ 3803 className: 'bx-catalog-popup-content' 3804 }, 3805 children: [ 3806 BX.create('p', { 3807 props: { 3808 className: 'bx-catalog-popup-message' 3809 }, 3810 text: result.message 3811 }) 3812 ] 3813 }); 3814 this.elemPopupWin.setContent(content); 3815// this.elemPopupWin.setButtons([ 3816// new subscribeButton({ 3817// text : BX.message('CPST_SUBSCRIBE_BUTTON_CLOSE'), 3818// className : 'btn btn-primary', 3819// events : { 3820// click : BX.delegate(function() { 3821// this.elemPopupWin.close(); 3822// }, this) 3823// } 3824// }) 3825// ]); 3826 this.elemPopupWin.show(); 3827 }; 3828 3829 window.JCCatalogProductSubscribe.prototype.initPopupWindow = function() 3830 { 3831 if (!!this.elemPopupWin) 3832 { 3833 return; 3834 } 3835 this.elemPopupWin = BX.PopupWindowManager.create('CatalogSubscribe_'+this.buttonId, null, { 3836 autoHide: false, 3837 offsetLeft: 0, 3838 offsetTop: 0, 3839 overlay : true, 3840 closeByEsc: true, 3841 titleBar: false, 3842 closeIcon: true, 3843 contentColor: 'white' 3844 }); 3845 }; 3846 3847 window.JCCatalogProductSubscribe.prototype.setButton = function(statusSubscription) 3848 { 3849 pid = this.elemButtonSubscribe.dataset.item; 3850 js = this.elemButtonSubscribe.dataset.js; 3851 ob = this; 3852 this.alreadySubscribed = Boolean(statusSubscription); 3853 if(this.alreadySubscribed) 3854 { 3855 this.elemButtonSubscribe.className = this.defaultButtonClass+' already-subsc'; 3856 this.elemButtonSubscribe.innerHTML = BX.message('CPST_POPUP_SUBSCRIBED_TITLE'); 3857 html = $(this.elemButtonSubscribe).html(); 3858 id = $(this.elemButtonSubscribe).attr('id'); 3859 $(this.elemButtonSubscribe).replaceWith("<a id='"+id+"' href='/personal/subscribe/' class='"+this.defaultButtonClass+" already-subsc' data-item='"+pid+"' data-js='"+js+"'>"+html+"</a>"); 3860 $('.bxr-detail-subscribe[data-item='+pid+']').each(function() { 3861 self = this; 3862 $(self).removeClass('bxr-color-button bxr-detail-subscribe'); 3863 $(self).addClass(this.defaultButtonClass+' already-subsc'); 3864 $(self).html(BX.message('CPST_POPUP_SUBSCRIBED_TITLE')); 3865 id = $(self).attr('id'); 3866 $(self).replaceWith("<a id='"+id+"' href='/personal/subscribe/' class='"+this.defaultButtonClass+" already-subsc' data-item='"+pid+"' data-js='"+js+"'>"+$(self).html()+"</a>"); 3867 }); 3868 $('.already-subsc').each(function() { 3869 $(this).html(BX.message('CPST_POPUP_SUBSCRIBED_TITLE')); 3870 }); 3871 BX.unbind(this.elemButtonSubscribe, 'click', this._elemButtonSubscribeClickHandler); 3872 } 3873 else 3874 { 3875 this.elemButtonSubscribe.className = this.buttonClass+' '+this.defaultButtonClass; 3876// if ($(this.elemButtonSubscribe).closest('.bxr-ecommerce-v4-effect').length == 0) 3877// this.elemButtonSubscribe.innerHTML = BX.message('CPST_SUBSCRIBE_BUTTON_NAME'); 3878 BX.bind(this.elemButtonSubscribe, 'click', this._elemButtonSubscribeClickHandler); 3879 } 3880 }; 3881 3882 window.JCCatalogProductSubscribe.prototype.showWindowWithAnswer = function(answer) 3883 { 3884 answer = answer || {}; 3885 if (!answer.message) { 3886 if (answer.status == 'success') { 3887 answer.message = BX.message('CPST_STATUS_SUCCESS'); 3888 } else { 3889 answer.message = BX.message('CPST_STATUS_ERROR'); 3890 } 3891 } 3892 var messageBox = BX.create('div', { 3893 props: { 3894 className: 'bx-catalog-subscribe-alert' 3895 }, 3896 children: [ 3897 BX.create('span', { 3898 props: { 3899 className: 'bx-catalog-subscribe-aligner' 3900 } 3901 }), 3902 BX.create('span', { 3903 props: { 3904 className: 'bx-catalog-subscribe-alert-text' 3905 }, 3906 text: answer.message 3907 }), 3908 BX.create('div', { 3909 props: { 3910 className: 'bx-catalog-subscribe-alert-footer' 3911 } 3912 }) 3913 ] 3914 }); 3915 var currentPopup = BX.PopupWindowManager.getCurrentPopup(); 3916 if(currentPopup) { 3917 currentPopup.destroy(); 3918 } 3919 var idTimeout = setTimeout(function () { 3920 var w = BX.PopupWindowManager.getCurrentPopup(); 3921 if (!w || w.uniquePopupId != 'bx-catalog-subscribe-status-action') { 3922 return; 3923 } 3924 w.close(); 3925 w.destroy(); 3926 }, 3500); 3927 var popupConfirm = BX.PopupWindowManager.create('bx-catalog-subscribe-status-action', null, { 3928 content: messageBox, 3929 onPopupClose: function () { 3930 this.destroy(); 3931 clearTimeout(idTimeout); 3932 }, 3933 autoHide: true, 3934 zIndex: 2000,
3935 className: 'bx-catalog-subscribe-alert-popup' 3936 }); 3937 popupConfirm.show(); 3938 BX('bx-catalog-subscribe-status-action').onmouseover = function (e) { 3939 clearTimeout(idTimeout); 3940 }; 3941 BX('bx-catalog-subscribe-status-action').onmouseout = function (e) { 3942 idTimeout = setTimeout(function () { 3943 var w = BX.PopupWindowManager.getCurrentPopup(); 3944 if (!w || w.uniquePopupId != 'bx-catalog-subscribe-status-action') { 3945 return; 3946 } 3947 w.close(); 3948 w.destroy(); 3949 }, 3500); 3950 }; 3951 }; 3952 3953})(window); 3954;
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.