1 2; /* Start:"a:4:{s:4:"full";s:59:"/assets/components/banner/plus-main/script.js?1770795955491";s:6:"source";s:45:"/assets/components/banner/plus-main/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 3document.addEventListener('DOMContentLoaded', function() { 4 5 document.querySelectorAll('.js-banner-plus-main').forEach(bannerElem => { 6 bannerElem.addEventListener('click', event => { 7 bannerElem.dispatchEvent(new CustomEvent('ab.analytics.event', { 8 bubbles: true, 9 cancelable: true, 10 detail: { 11 eventCode: 'bannerSubscriptionMainPageClick', 12 } 13 })); 14 }); 15 }); 16}); 17 18/* End */ 19; 20; /* Start:"a:4:{s:4:"full";s:58:"/assets/components/product/preview/script.js?1770795955376";s:6:"source";s:44:"/assets/components/product/preview/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 21// СкÑипÑÑ ÐºÐ¾Ð¼Ð¿Ð¾Ð½ÐµÐ½Ñа пÑевÑÑ ÑоваÑа в каÑалоге 22 23document.addEventListener('DOMContentLoaded', function() { 24 25 document.addEventListener('ab.product.preview.children.init', event => { 26 // ÐÐ½Ð¸Ñ Ð±Ð¾Ð½ÑÑов пÑи обновлении айÑемов 27 $(event.target).trigger('bonus-children-refresh'); 28 }); 29}); 30 31/* End */ 32; 33; /* Start:"a:4:{s:4:"full";s:67:"/assets/components/product/preview/lecture/script.js?17707959552099";s:6:"source";s:52:"/assets/components/product/preview/lecture/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 34// СкÑипÑÑ ÐºÐ¾Ð¼Ð¿Ð¾Ð½ÐµÐ½Ñа пÑевÑÑ Ð»ÐµÐºÑии в каÑалоге 35 36document.addEventListener('DOMContentLoaded', function() { 37 38 const previewItems = document.querySelectorAll('.js-product-preview-lecture'); 39 const previewImgs = document.querySelectorAll('.js-product-preview-lecture__img'); 40 41 const itemsLazyload = function(elements) { 42 const options = { 43 unobserve_entered: true, 44 unobserve_completed: true, 45 }; 46 new LazyLoad(options, elements); 47 }; 48 49 const init = function(previewsToInit) { 50 previewsToInit.forEach(function(elem) { 51 52 // ÐеÑÐµÑ Ð¾Ð´ по ÑÑÑлке на деÑалÑнÑÑ ÐºÐ°ÑÑоÑÐºÑ 53 const detailLinks = elem.querySelectorAll('.js-product-preview-lecture__detail-link'); 54 detailLinks.forEach(function(link) { 55 link.addEventListener('click', function(event) { 56 const wrap = event.target.closest('[data-slider-type="bookDetailLectures"]'); 57 58 if (wrap) { 59 elem.dispatchEvent(new CustomEvent('ab.analytics.event', { 60 bubbles: true, 61 cancelable: true, 62 detail: { 63 eventCode: 'lecturePreviewDetailLinkClick', 64 type: wrap.dataset.sliderType, 65 } 66 })); 67 } 68 }); 69 }); 70 }); 71 }; 72 73 document.addEventListener('ab.product.preview.children.init', event => { 74 // ÐÐ½Ð¸Ñ Ð°Ð¹Ñемов 75 const itemsToInit = event.target.querySelectorAll('.js-product-preview-lecture'); 76 init(itemsToInit); 77 // ÐÐ½Ð¸Ñ Ð»ÐµÐ¹Ð·Ð¸Ð»Ð¾Ð°Ð´ пÑи обновлении айÑемов 78 const imgsToInit = event.target.querySelectorAll('.js-product-preview-lecture__img'); 79 itemsLazyload(imgsToInit); 80 }); 81 82 init(previewItems); 83 itemsLazyload(previewImgs); 84}); 85 86/* End */ 87; 88; /* Start:"a:4:{s:4:"full";s:84:"/local/components/ab/collections.slider/templates/.default/script.js?177079595615891";s:6:"source";s:68:"/local/components/ab/collections.slider/templates/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 89document.addEventListener('DOMContentLoaded', function() { 90 91 // ÑÑонÑовÑй ÐºÐ¾Ð¼Ð¿Ð¾Ð½ÐµÐ½Ñ public/local/markup/src/component/carousel-compilations-rows2/ 92 93 $ (".js-compltns-rows").each (function () { 94 const $carousel = $ (this); 95 const $wrap = $carousel.parents ('[data-role="wrap"]'); 96 const $prev = $wrap.find ('[data-role="prev"]'); 97 const $next = $wrap.find ('[data-role="next"]'); 98 99 const $items = $carousel.find (".js-compltns-rows__item"); 100 101 const ignoreDeferred = true; // оÑбÑаÑÑваÑÑ Ð»Ð¸Ñние ÑÐ»Ð°Ð¹Ð´Ñ 102 103 // еÑли Ð½ÐµÑ Ð°Ð¹Ñемов, ниÑего не делаем 104 if ($items.length === 0) return false;
105 106 107 // ÐÐÐÐÐТÐÐÐÐ 108 109 // нÑжнÑе набоÑÑ Ð°Ð¹Ñемов 110 111 let arItemsAll = []; 112 let arItemsBig = []; 113 let arItemsSmall = []; 114 115 $items.each (function (i, item) { 116 const type = $ (item).data ("item-type"); 117 const index = $ (item).data ("item-index"); 118 let itemObj = {index: index, type: type}; 119 120 arItemsAll.push (JSON.parse (JSON.stringify (itemObj))); 121 122 if (type === "big") { 123 arItemsBig.push (JSON.parse (JSON.stringify (itemObj))); 124 125 } else { 126 arItemsSmall.push (JSON.parse (JSON.stringify (itemObj))); 127 } 128 }); 129 130 // кÑÑиÑÑемÑÑ 131 132 const desktopSets = combineDesktopSets (JSON.parse (JSON.stringify (arItemsSmall)), JSON.parse (JSON.stringify (arItemsBig))); 133 const cacheItemsAll = JSON.parse (JSON.stringify (arItemsAll)); 134 const cacheItemsBig = JSON.parse (JSON.stringify (arItemsBig)); 135 const cacheItemsSmall = JSON.parse (JSON.stringify (arItemsSmall)); 136 137 138 const destroyBreakpoint = globObj.breakpoints.md; 139 let currentScheme = checkScheme (destroyBreakpoint); 140 141 142 // СÐÐЫТÐЯ 143 144 // обÑабаÑÑваем ÑеÑайз 145 146 let resizeTimer; 147 148 $ (window).on ("resize", function (e) { 149 150 clearTimeout (resizeTimer); 151 resizeTimer = setTimeout (function () { 152 const newScheme = checkScheme (destroyBreakpoint); 153 154 if (currentScheme !== newScheme) { 155 destroySlider ((newScheme === "mobile"), (newScheme === "mobile") ? "desktopSlides:destroyed" : "mobileSlides:destroyed"); 156 currentScheme = newScheme; 157 } 158 }, 200); 159 160 }); 161 162 // ÑобÑÑÐ¸Ñ Ð¿Ð¾Ñле ÑниÑÑÐ¾Ð¶ÐµÐ½Ð¸Ñ ÑлайдеÑов 163 $carousel.on ("mobileSlides:destroyed", function (e) { 164 appendDesktopSets (JSON.parse (JSON.stringify (desktopSets)), "desktopSlides:ready"); 165 }); 166 167 $carousel.on ("desktopSlides:destroyed", function (e) { 168 $carousel.trigger ("mobileSlides:ready"); 169 }); 170 171 // ÑобÑÑÐ¸Ñ Ð¿Ð¾Ñле подгоÑовки Ñлайдов Ð´Ð»Ñ Ð¸Ð½Ð¸ÑиализаÑии ÑлайдеÑа 172 $carousel.on ("mobileSlides:ready", function (e) { 173 initSlider (false); 174 }); 175 176 $carousel.on ("desktopSlides:ready", function (e) { 177 initSlider (true); 178 }); 179 180 181 // ÐÐÐЦÐÐÐÐÐÐЦÐЯ 182 183 if (currentScheme === "mobile") { 184 $carousel.trigger ("mobileSlides:ready"); 185 186 } else { 187 appendDesktopSets (JSON.parse (JSON.stringify (desktopSets)), "desktopSlides:ready"); 188 } 189 190 191 // пÑовеÑка на ÑиÑÐ¸Ð½Ñ Ð²ÑÑпоÑÑа 192 193 function checkScheme (deskStart = 576) { 194 if ($ (window).width () > deskStart) 195 return "desktop"; 196 else 197 return "mobile"; 198 } 199 200 201 // Ð¸Ð½Ð¸Ñ ÑлайдеÑа 202 203 function initSlider (isDesktop = true) { 204 let settings; 205 206 if (isDesktop) { 207 settings = { 208 slidesToShow: 2, 209 slidesToScroll: 2, 210 arrows: true, 211 dots: false, 212 dotsClass: "b-carousel-footer", 213 touchThreshold: 10, 214 infinite: false, 215 216 responsive: [ 217 { 218 breakpoint: globObj.breakpoints.lg, 219 settings: { 220 arrows: false, 221 dots: true, 222 } 223 } 224 ] 225 }; 226 227 if ($prev.length > 0) { 228 settings.prevArrow = $prev; 229 } 230 231 if ($next.length > 0) { 232 settings.nextArrow = $next; 233 } 234 235 } else { 236 settings = { 237 mobileFirst: true, 238 rows: 2, 239 slidesToShow: 2, 240 slidesToScroll: 2,
241 arrows: false, 242 dots: true, 243 dotsClass: "b-carousel-footer", 244 touchThreshold: 10, 245 infinite: false 246 }; 247 } 248 249 $carousel.slick (settings); 250 } 251 252 253 // деÑÑÑой ÑлайдеÑа 254 255 function destroySlider (fromDesktop = false, triggerE = false) { 256 // еÑли иниÑиализиÑован slick, ÑазбиÑаем его 257 if ($carousel.is (".slick-initialized")) { 258 $carousel.slick ("unslick"); 259 } 260 261 let $items = $carousel.find (".js-compltns-rows__item"); 262 263 // еÑли Ð½ÐµÑ Ð°Ð¹Ñемов, ниÑего не делаем 264 if ($items.length === 0) return false; 265 266 // ÑобиÑаем индекÑÑ 267 let arIndexes = []; 268 269 $items.each (function (i, item) { 270 arIndexes.push ($ (item).data ("item-index")); 271 }); 272 273 // ÑоÑÑиÑÑем индекÑÑ Ð¿Ð¾ возÑаÑÑÐ°Ð½Ð¸Ñ 274 arIndexes.sort (function (a, b) { 275 return a - b; 276 }); 277 278 // возвÑаÑаем айÑÐµÐ¼Ñ Ð² деÑолÑнÑй поÑÑдок 279 $.each (arIndexes, function (i, index) { 280 $items.filter (`[data-item-index="${index}"]`).detach ().appendTo ($carousel); 281 }); 282 283 // ÑдалÑем ненÑжнÑе ÑлеменÑÑ Ñлайдов, иннеÑов и подобного 284 if (fromDesktop) { 285 $carousel.find (".js-compltns-rows__slide").remove (); 286 } 287 288 if (triggerE) { 289 $carousel.trigger (triggerE); 290 } 291 } 292 293 294 // ÑобÑаÑÑ Ð½Ð°Ð±Ð¾ÑÑ Ð°Ð¹Ñемов Ð´Ð»Ñ Ð´ÐµÑкÑопа 295 296 function combineDesktopSets (arSmall = [], arBig = []) { 297 298 // еÑли не пеÑÐµÐ´Ð°Ð½Ñ Ð°Ð¹ÑемÑ, возвÑаÑаем пÑÑÑой маÑÑив 299 if (arSmall.length === 0 && arBig.length === 0) return []; 300 301 let arSets = []; 302 let curSet = []; 303 304 // в каждом Ñлайде доÑÑÑпно 4 ÑлоÑа 305 // мелкий айÑем - 1 ÑÐ»Ð¾Ñ 306 // болÑÑой айÑем - 2 ÑлоÑа 307 let curSetAvailable = 4; 308 309 // оÑложеннÑе айÑÐµÐ¼Ñ (еÑли неÑÑÑное колиÑеÑÑво Ð¼ÐµÐ»ÐºÐ¸Ñ , пеÑеноÑим поÑледние в ÐºÐ¾Ð½ÐµÑ ÑлайдеÑа) 310 let deferredItem = []; 311 312 if (arSmall.length > 0 && arSmall.length % 2 !== 0) { 313 deferredItem.unshift (arSmall.pop ()); 314 } 315 316 317 // деÑолÑнÑе наÑÑÑойки
318 let prevBigPos = "top"; // пÑедÑдÑÑего болÑÑого в ÑÑÐ¾Ñ Ð¼Ð¾Ð¼ÐµÐ½Ñ Ð½ÐµÑ, но пÑиÑвоим topб ÑÑÐ¾Ð±Ñ Ð½Ð°ÑаÑÑ Ð¿Ð¾Ð·Ð¸ÑиониÑование болÑÑÐ¸Ñ Ñ bottom 319 let prevItemType = false; 320 let nextItemType = "small"; // наÑинаем Ñ Ð¼ÐµÐ»ÐºÐ¸Ñ Ñлайдов 321 let thisSetHasBig = false; 322 323 // еÑли Ð¼ÐµÐ»ÐºÐ¸Ñ Ð½ÐµÑ, Ñо наÑинаем Ñ Ð±Ð¾Ð»ÑÑÐ¸Ñ 324 if (arSmall.length === 0 && arBig.length > 0) { 325 nextItemType = "big"; 326 } 327 328 329 // запÑÑкаем Ñикл ÑбоÑа в ÑÐ»Ð°Ð¹Ð´Ñ 330 331 let sumLength = arSmall.length + arBig.length; 332 333 for (let index = 0; index < sumLength; index++) { 334 let curItem; 335 let curItemType; 336 337 // здеÑÑ nextItemType = Ñлайд, коÑоÑÑй беÑÑм на ÑÑом пÑÐ¾Ñ Ð¾Ð´Ðµ (коÑоÑÑй вÑбÑали на пÑоÑлом Ñаге) 338 switch (nextItemType) { 339 case "big": 340 curItem = arBig.shift (); 341 curSetAvailable -= 2; 342 curItemType = "big"; 343 thisSetHasBig = true; // болÑÑе в ÑÑÐ¾Ñ Ñлайд не беÑÑм болÑÑие айÑÐµÐ¼Ñ 344 prevBigPos = (prevBigPos === "bottom") ? "top" : "bottom"; // запоминаем положение болÑÑого айÑема Ð´Ð»Ñ Ñлед Ñлайдов 345 break; 346 347 case "small": 348 default: 349 curItem = arSmall.shift (); 350 curSetAvailable -= 1; 351 curItemType = "small"; 352 break; 353 } 354 355 // пÑÑим айÑем в ÑÐµÑ 356 curSet.push (JSON.parse (JSON.stringify (curItem))); 357 358 359 // еÑли поÑледний айÑем, пÑÑим Ñлайд, как еÑÑÑ 360 if (index === (sumLength - 1)) { 361 arSets.push (JSON.parse (JSON.stringify (curSet))); 362 363 } else { 364 // ÐÑбиÑаем, какой айÑем бÑаÑÑ ÑледÑÑÑим 365 // в завиÑимоÑÑи Ð¾Ñ Ð´Ð¾ÑÑÑпного меÑÑа в Ñлайде 366 367 // здеÑÑ nextItemType = Ñлайд, коÑоÑÑй беÑÑм на ÑледÑÑÑем пÑÐ¾Ñ Ð¾Ð´Ðµ 368 369 switch (curSetAvailable) { 370 case 3: 371 if (arSmall.length > 0) { 372 // в ÑÑом Ñикле Ð¼ÐµÐ»ÐºÐ¸Ñ Ð²Ñегда ÑÑÑное колиÑеÑÑво, поÑÑÐ¾Ð¼Ñ Ð·Ð´ÐµÑÑ Ð½ÐµÑÑÑнÑй оÑÑаÑок знаÑиÑ, ÑÑо они ÑоÑно еÑÑ ÐµÑÑÑ 373 nextItemType = "small"; 374 375 } else if (arBig.length > 0) { 376 nextItemType = "big"; 377 } 378 break; 379 380 case 2: 381 if (arSmall.length > 0) { 382 // оÑÑалиÑÑ Ð¼Ð°Ð»ÐµÐ½Ñкие 383 if (thisSetHasBig || arBig.length === 0) { 384 // пÑовеÑÑем на Ñо, ÑÑо Ñже бÑл болÑÑой айÑем в Ñлайде или Ð¸Ñ Ð±Ð¾Ð»ÑÑе Ð½ÐµÑ 385 nextItemType = "small"; 386 387 } else if (!thisSetHasBig && arBig.length > 0 && prevBigPos === "top") { 388 // еÑли болÑÑого еÑÑ Ð½Ðµ бÑло и они еÑÑÑ Ð¸ еÑли в пÑоÑлÑй болÑÑой бÑл в позиÑии top 389 nextItemType = "big"; 390 } 391 392 } else if (arBig.length > 0) { 393 // либо, еÑли маленÑÐºÐ¸Ñ Ð½ÐµÑ, ÑоÑно беÑÑм болÑÑие 394 nextItemType = "big"; 395 } 396 break; 397 398 case 1: 399 if (arSmall.length > 0) { 400 // в ÑÑом Ñикле Ð¼ÐµÐ»ÐºÐ¸Ñ Ð²Ñегда ÑÑÑное колиÑеÑÑво, поÑÑÐ¾Ð¼Ñ Ð·Ð´ÐµÑÑ Ð½ÐµÑÑÑнÑй оÑÑаÑок знаÑиÑ, ÑÑо они ÑоÑно еÑÑ ÐµÑÑÑ 401 nextItemType = "small"; 402 403 } else if (arBig.length > 0) { 404 nextItemType = "big"; 405 } 406 break; 407 408 case 0: 409 // пеÑÐµÑ Ð¾Ð´Ð¸Ð¼ на новÑй Ñлайд 410 arSets.push (JSON.parse (JSON.stringify (curSet))); 411 curSet = []; 412 curSetAvailable = 4; 413 thisSetHasBig = false;
414 415 // опÑеделÑем, Ñ ÐºÐ°ÐºÐ¾Ð³Ð¾ айÑема наÑаÑÑ Ð½Ð¾Ð²Ñй Ñлайд 416 if (arSmall.length > 0) { 417 if (arBig.length === 0 || prevBigPos === "top") { 418 nextItemType = "small"; 419 420 } else if (arBig.length > 0 && prevBigPos === "bottom") { 421 nextItemType = "big"; 422 } 423 424 } else if (arBig.length > 0) { 425 nextItemType = "big"; 426 } 427 break; 428 } 429 430 prevItemType = curItemType; 431 } 432 } 433 434 // еÑли еÑÑÑ Ð¾ÑложеннÑе, добавлÑем Ð¸Ñ Ð»Ð¸Ð±Ð¾ в поÑледний Ñлайд (еÑли Ñам еÑÑÑ Ð¼ÐµÑÑо), либо новÑм 435 if (!ignoreDeferred && deferredItem.length > 0) { 436 let lastSet = arSets[arSets.length - 1]; 437 let lastSize = 0; 438 439 $.each (lastSet, function (index, item) { 440 lastSize += ((item.type === "big") ? 2 : 1); 441 }); 442 443 if (lastSize < 4) { 444 lastSet.push (deferredItem[0]); 445 446 } else { 447 let newSet = []; 448 newSet.push (deferredItem[0]); 449 arSets.push (newSet); 450 } 451 452 } else if (ignoreDeferred) { 453 $.each (deferredItem, function (index, item) { 454 removeItem (item); 455 }); 456 } 457 458 return arSets; 459 } 460 461 462 // ÑбÑаÑÑ Ð½ÐµÐ½ÑжнÑе 463 464 function removeItem (item) { 465 $carousel 466 .find (`.js-compltns-rows__item[data-item-index="${item.index}"]`) 467 .remove (); 468 } 469 470 471 // вÑÑавиÑÑ Ð² html вÑÑÑÑÐºÑ Ñлайдов Ð´Ð»Ñ Ð´ÐµÑкÑопа 472 473 function appendDesktopSets (arSets = [], triggerE = false) { 474 if (arSets.length === 0) return false; 475 476 $.each (arSets, function (i, set) { 477 let $curSet = $ ( 478 "<div class=\"compltns-rows__slide js-compltns-rows__slide\">" + 479 " <div class=\"compltns-rows__slide-inner js-compltns-rows__slide-inner\">" + 480 "</div>" 481 ).appendTo ($carousel); 482 483 $.each (set, function (j, item) { 484 $curSet 485 .find (".js-compltns-rows__slide-inner") 486 .append ( 487 $carousel 488 .find (`.js-compltns-rows__item[data-item-index="${item.index}"]`) 489 .detach ()); 490 }); 491 }); 492 493 if (triggerE) { 494 $carousel.trigger (triggerE); 495 } 496 } 497 }); 498}); 499 500/* End */ 501; 502; /* Start:"a:4:{s:4:"full";s:51:"/assets/scriptMixes/posts.slider.js?177079596117537";s:6:"source";s:35:"/assets/scriptMixes/posts.slider.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 503'use strict'; 504 505// Ð´Ð»Ñ Ð¿Ð¾Ð´ÐºÐ»ÑÑÐµÐ½Ð¸Ñ Ð² ÑазнÑÑ ÑÐ°Ð±Ð»Ð¾Ð½Ð°Ñ ÑлайдеÑа /public/local/components/ab/posts.slider/ 506 507document.addEventListener('DOMContentLoaded', function() { 508 $ (".js-posts-rows").each (function () { 509 const $carousel = $ (this); 510 const $wrap = $carousel.parents ('[data-role="wrap"]'); 511 const $prev = $wrap.find ('[data-role="prev"]'); 512 const $next = $wrap.find ('[data-role="next"]'); 513 514 const $items = $carousel.find (".js-posts-rows__item"); 515 516 const ignoreDeferred = true; // оÑбÑаÑÑваÑÑ Ð»Ð¸Ñние ÑÐ»Ð°Ð¹Ð´Ñ 517 518 // еÑли Ð½ÐµÑ Ð°Ð¹Ñемов, ниÑего не делаем 519 if ($items.length === 0) return false; 520 521 522 // ÐÐÐÐÐТÐÐÐÐ 523 524 // нÑжнÑе набоÑÑ Ð°Ð¹Ñемов 525 526 let arItemsAll = []; 527 let arItemsBig = []; 528 let arItemsSmall = []; 529 530 $items.each (function (i, item) { 531 const type = $ (item).data ("item-type"); 532 const index = $ (item).data ("item-index"); 533 let itemObj = {index: index, type: type}; 534 535 arItemsAll.push (JSON.parse (JSON.stringify (itemObj))); 536 537 if (type === "big") { 538 arItemsBig.push (JSON.parse (JSON.stringify (itemObj))); 539 540 } else { 541 arItemsSmall.push (JSON.parse (JSON.stringify (itemObj))); 542 } 543 }); 544 545 // кÑÑиÑÑемÑÑ 546 547 const desktopSets = combineDesktopSets (JSON.parse (JSON.stringify (arItemsSmall)), JSON.parse (JSON.stringify (arItemsBig))); 548 const cacheItemsAll = JSON.parse (JSON.stringify (arItemsAll));
549 const cacheItemsBig = JSON.parse (JSON.stringify (arItemsBig)); 550 const cacheItemsSmall = JSON.parse (JSON.stringify (arItemsSmall)); 551 552 553 const destroyBreakpoint = globObj.breakpoints.md; 554 let currentScheme = checkScheme (destroyBreakpoint); 555 556 557 // СÐÐЫТÐЯ 558 559 // обÑабаÑÑваем ÑеÑайз 560 561 let resizeTimer; 562 563 $ (window).on ("resize", function (e) { 564 565 clearTimeout (resizeTimer); 566 resizeTimer = setTimeout (function () { 567 const newScheme = checkScheme (destroyBreakpoint); 568 569 if (currentScheme !== newScheme) { 570 destroySlider ((newScheme === "mobile"), (newScheme === "mobile") ? "desktopSlides:destroyed" : "mobileSlides:destroyed"); 571 currentScheme = newScheme; 572 } 573 }, 200); 574 575 }); 576 577 // ÑобÑÑÐ¸Ñ Ð¿Ð¾Ñле ÑниÑÑÐ¾Ð¶ÐµÐ½Ð¸Ñ ÑлайдеÑов 578 $carousel.on ("mobileSlides:destroyed", function (e) { 579 appendDesktopSets (JSON.parse (JSON.stringify (desktopSets)), "desktopSlides:ready"); 580 }); 581 582 $carousel.on ("desktopSlides:destroyed", function (e) { 583 $carousel.trigger ("mobileSlides:ready"); 584 }); 585 586 // ÑобÑÑÐ¸Ñ Ð¿Ð¾Ñле подгоÑовки Ñлайдов Ð´Ð»Ñ Ð¸Ð½Ð¸ÑиализаÑии ÑлайдеÑа 587 $carousel.on ("mobileSlides:ready", function (e) { 588 initSlider (false); 589 }); 590 591 $carousel.on ("desktopSlides:ready", function (e) { 592 initSlider (true); 593 }); 594 595 596 // ÐÐÐЦÐÐÐÐÐÐЦÐЯ 597 598 if (currentScheme === "mobile") { 599 $carousel.trigger ("mobileSlides:ready"); 600 601 } else { 602 appendDesktopSets (JSON.parse (JSON.stringify (desktopSets)), "desktopSlides:ready"); 603 } 604 605 606 // пÑовеÑка на ÑиÑÐ¸Ð½Ñ Ð²ÑÑпоÑÑа 607 608 function checkScheme (deskStart = 576) { 609 if ($ (window).width () > deskStart) 610 return "desktop"; 611 else 612 return "mobile"; 613 } 614 615 616 // Ð¸Ð½Ð¸Ñ ÑлайдеÑа 617 618 function initSlider (isDesktop = true) { 619 let settings; 620 621 if (isDesktop) { 622 settings = { 623 slidesToShow: 2, 624 slidesToScroll: 2, 625 arrows: true, 626 dots: false, 627 dotsClass: "b-carousel-footer", 628 touchThreshold: 10, 629 infinite: false, 630 631 responsive: [ 632 { 633 breakpoint: globObj.breakpoints.lg, 634 settings: { 635 arrows: false, 636 dots: true, 637 } 638 } 639 ] 640 }; 641 642 if ($prev.length > 0) { 643 settings.prevArrow = $prev; 644 } 645 646 if ($next.length > 0) { 647 settings.nextArrow = $next; 648 } 649 650 $carousel.slick (settings); 651 652 } else if ($items.length > 4) { 653 let i = 0; 654 $items.each (function () { 655 if (i >= 4) { 656 $ (this).addClass ("_hiddenMob"); 657 } 658 i++; 659 }); 660 661 $carousel.append (`<div class="b-posty-more js-posts-rows-showMore"><div class="b-posty-more__inner"><button class="b-btn _transp">ÐоказаÑÑ ÐµÑе</button></div></div>`); 662 } 663 } 664 665 666 // деÑÑÑой ÑлайдеÑа 667 668 function destroySlider (fromDesktop = false, triggerE = false) { 669 // еÑли иниÑиализиÑован slick, ÑазбиÑаем его 670 if ($carousel.is (".slick-initialized")) { 671 $carousel.slick ("unslick"); 672 } 673 674 let $items = $carousel.find (".js-posts-rows__item"); 675 676 // еÑли Ð½ÐµÑ Ð°Ð¹Ñемов, ниÑего не делаем 677 if ($items.length === 0) return false;
678 679 // ÑобиÑаем индекÑÑ 680 let arIndexes = []; 681 682 $items.each (function (i, item) { 683 arIndexes.push ($ (item).data ("item-index")); 684 }); 685 686 // ÑоÑÑиÑÑем индекÑÑ Ð¿Ð¾ возÑаÑÑÐ°Ð½Ð¸Ñ 687 arIndexes.sort (function (a, b) { 688 return a - b; 689 }); 690 691 // возвÑаÑаем айÑÐµÐ¼Ñ Ð² деÑолÑнÑй поÑÑдок 692 $.each (arIndexes, function (i, index) { 693 $items.filter (`[data-item-index="${index}"]`).detach ().appendTo ($carousel); 694 }); 695 696 // ÑдалÑем ненÑжнÑе ÑлеменÑÑ Ñлайдов, иннеÑов и подобного 697 if (fromDesktop) { 698 $carousel.find (".js-posts-rows__slide").remove (); 699 } 700 701 if (triggerE) { 702 $carousel.trigger (triggerE); 703 } 704 } 705 706 707 // ÑобÑаÑÑ Ð½Ð°Ð±Ð¾ÑÑ Ð°Ð¹Ñемов Ð´Ð»Ñ Ð´ÐµÑкÑопа 708 709 function combineDesktopSets (arSmall = [], arBig = []) { 710 711 // еÑли не пеÑÐµÐ´Ð°Ð½Ñ Ð°Ð¹ÑемÑ, возвÑаÑаем пÑÑÑой маÑÑив 712 if (arSmall.length === 0 && arBig.length === 0) return []; 713 714 let arSets = []; 715 let curSet = []; 716 717 // в каждом Ñлайде доÑÑÑпно 4 ÑлоÑа 718 // мелкий айÑем - 1 ÑÐ»Ð¾Ñ 719 // болÑÑой айÑем - 2 ÑлоÑа 720 let curSetAvailable = 4; 721 722 // оÑложеннÑе айÑÐµÐ¼Ñ (еÑли неÑÑÑное колиÑеÑÑво Ð¼ÐµÐ»ÐºÐ¸Ñ , пеÑеноÑим поÑледние в ÐºÐ¾Ð½ÐµÑ ÑлайдеÑа) 723 let deferredItem = []; 724 725 if (arSmall.length > 0 && arSmall.length % 2 !== 0) { 726 deferredItem.unshift (arSmall.pop ()); 727 } 728 729 730 // деÑолÑнÑе наÑÑÑойки 731 let prevBigPos = "bottom"; // пÑедÑдÑÑего болÑÑого в ÑÑÐ¾Ñ Ð¼Ð¾Ð¼ÐµÐ½Ñ Ð½ÐµÑ, но пÑиÑвоим bottom, ÑÑÐ¾Ð±Ñ Ð½Ð°ÑаÑÑ Ð¿Ð¾Ð·Ð¸ÑиониÑование болÑÑÐ¸Ñ Ñ top 732 let prevItemType = false;
733 let nextItemType = "big"; // наÑинаем Ñ Ð±Ð¾Ð»ÑÑого Ñлайда 734 let thisSetHasBig = false; 735 736 // еÑли Ð¼ÐµÐ»ÐºÐ¸Ñ Ð½ÐµÑ, Ñо наÑинаем Ñ Ð±Ð¾Ð»ÑÑÐ¸Ñ 737 if (arSmall.length === 0 && arBig.length > 0) { 738 nextItemType = "big"; 739 } 740 741 742 // запÑÑкаем Ñикл ÑбоÑа в ÑÐ»Ð°Ð¹Ð´Ñ 743 744 let sumLength = arSmall.length + arBig.length; 745 746 for (let index = 0; index < sumLength; index++) { 747 let curItem; 748 let curItemType; 749 750 // здеÑÑ nextItemType = Ñлайд, коÑоÑÑй беÑÑм на ÑÑом пÑÐ¾Ñ Ð¾Ð´Ðµ (коÑоÑÑй вÑбÑали на пÑоÑлом Ñаге) 751 switch (nextItemType) { 752 case "big": 753 curItem = arBig.shift (); 754 curSetAvailable -= 2; 755 curItemType = "big"; 756 thisSetHasBig = true; // болÑÑе в ÑÑÐ¾Ñ Ñлайд не беÑÑм болÑÑие айÑÐµÐ¼Ñ 757 prevBigPos = (prevBigPos === "bottom") ? "top" : "bottom"; // запоминаем положение болÑÑого айÑема Ð´Ð»Ñ Ñлед Ñлайдов 758 break; 759 760 case "small": 761 default: 762 curItem = arSmall.shift (); 763 curSetAvailable -= 1; 764 curItemType = "small"; 765 break; 766 } 767 768 // пÑÑим айÑем в ÑÐµÑ 769 curSet.push (JSON.parse (JSON.stringify (curItem))); 770 771 772 // еÑли поÑледний айÑем, пÑÑим Ñлайд, как еÑÑÑ 773 if (index === (sumLength - 1)) { 774 arSets.push (JSON.parse (JSON.stringify (curSet))); 775 776 } else { 777 // ÐÑбиÑаем, какой айÑем бÑаÑÑ ÑледÑÑÑим 778 // в завиÑимоÑÑи Ð¾Ñ Ð´Ð¾ÑÑÑпного меÑÑа в Ñлайде 779 780 // здеÑÑ nextItemType = Ñлайд, коÑоÑÑй беÑÑм на ÑледÑÑÑем пÑÐ¾Ñ Ð¾Ð´Ðµ 781 782 switch (curSetAvailable) { 783 case 3: 784 if (arSmall.length > 0) { 785 // в ÑÑом Ñикле Ð¼ÐµÐ»ÐºÐ¸Ñ Ð²Ñегда ÑÑÑное колиÑеÑÑво, поÑÑÐ¾Ð¼Ñ Ð·Ð´ÐµÑÑ Ð½ÐµÑÑÑнÑй оÑÑаÑок знаÑиÑ, ÑÑо они ÑоÑно еÑÑ ÐµÑÑÑ 786 nextItemType = "small"; 787 788 } else if (arBig.length > 0) { 789 nextItemType = "big"; 790 } 791 break; 792 793 case 2: 794 if (arSmall.length > 0) { 795 // оÑÑалиÑÑ Ð¼Ð°Ð»ÐµÐ½Ñкие 796 if (thisSetHasBig || arBig.length === 0) { 797 // пÑовеÑÑем на Ñо, ÑÑо Ñже бÑл болÑÑой айÑем в Ñлайде или Ð¸Ñ Ð±Ð¾Ð»ÑÑе Ð½ÐµÑ 798 nextItemType = "small"; 799 800 } else if (!thisSetHasBig && arBig.length > 0 && prevBigPos === "top") { 801 // еÑли болÑÑого еÑÑ Ð½Ðµ бÑло и они еÑÑÑ Ð¸ еÑли в пÑоÑлÑй болÑÑой бÑл в позиÑии top 802 nextItemType = "big"; 803 } 804 805 } else if (arBig.length > 0) { 806 // либо, еÑли маленÑÐºÐ¸Ñ Ð½ÐµÑ, ÑоÑно беÑÑм болÑÑие 807 nextItemType = "big"; 808 } 809 break; 810 811 case 1: 812 if (arSmall.length > 0) { 813 // в ÑÑом Ñикле Ð¼ÐµÐ»ÐºÐ¸Ñ Ð²Ñегда ÑÑÑное колиÑеÑÑво, поÑÑÐ¾Ð¼Ñ Ð·Ð´ÐµÑÑ Ð½ÐµÑÑÑнÑй оÑÑаÑок знаÑиÑ, ÑÑо они ÑоÑно еÑÑ ÐµÑÑÑ 814 nextItemType = "small"; 815 816 } else if (arBig.length > 0) { 817 nextItemType = "big"; 818 } 819 break; 820 821 case 0: 822 // пеÑÐµÑ Ð¾Ð´Ð¸Ð¼ на новÑй Ñлайд 823 arSets.push (JSON.parse (JSON.stringify (curSet))); 824 curSet = []; 825 curSetAvailable = 4; 826 thisSetHasBig = false;
827 828 // опÑеделÑем, Ñ ÐºÐ°ÐºÐ¾Ð³Ð¾ айÑема наÑаÑÑ Ð½Ð¾Ð²Ñй Ñлайд 829 if (arSmall.length > 0) { 830 if (arBig.length === 0 || prevBigPos === "top") { 831 nextItemType = "small"; 832 833 } else if (arBig.length > 0 && prevBigPos === "bottom") { 834 nextItemType = "big"; 835 } 836 837 } else if (arBig.length > 0) { 838 nextItemType = "big"; 839 } 840 break; 841 } 842 843 prevItemType = curItemType; 844 } 845 } 846 847 // еÑли еÑÑÑ Ð¾ÑложеннÑе, добавлÑем Ð¸Ñ Ð»Ð¸Ð±Ð¾ в поÑледний Ñлайд (еÑли Ñам еÑÑÑ Ð¼ÐµÑÑо), либо новÑм 848 if (!ignoreDeferred && deferredItem.length > 0) { 849 let lastSet = arSets[arSets.length - 1]; 850 let lastSize = 0; 851 852 $.each (lastSet, function (index, item) { 853 lastSize += ((item.type === "big") ? 2 : 1); 854 }); 855 856 if (lastSize < 4) { 857 lastSet.push (deferredItem[0]); 858 859 } else { 860 let newSet = []; 861 newSet.push (deferredItem[0]); 862 arSets.push (newSet); 863 } 864 865 } else if (ignoreDeferred) { 866 $.each (deferredItem, function (index, item) { 867 removeItem (item); 868 }); 869 } 870 871 return arSets; 872 } 873 874 875 // ÑбÑаÑÑ Ð½ÐµÐ½ÑжнÑе 876 877 function removeItem (item) { 878 $carousel 879 .find (`.js-posts-rows__item[data-item-index="${item.index}"]`) 880 .remove (); 881 } 882 883 884 // вÑÑавиÑÑ Ð² html вÑÑÑÑÐºÑ Ñлайдов Ð´Ð»Ñ Ð´ÐµÑкÑопа 885 886 function appendDesktopSets (arSets = [], triggerE = false) { 887 if (arSets.length === 0) return false; 888 889 $.each (arSets, function (i, set) { 890 let $curSet = $ ( 891 "<div class=\"posts-rows__slide js-posts-rows__slide\">" + 892 " <div class=\"posts-rows__slide-inner js-posts-rows__slide-inner\">" + 893 "</div>" 894 ).appendTo ($carousel); 895 896 $.each (set, function (j, item) { 897 $curSet 898 .find (".js-posts-rows__slide-inner") 899 .append ( 900 $carousel 901 .find (`.js-posts-rows__item[data-item-index="${item.index}"]`) 902 .detach ()); 903 }); 904 }); 905 906 if (triggerE) { 907 $carousel.trigger (triggerE); 908 } 909 } 910 911 $carousel.on ("click", ".js-posts-rows-showMore", function (e) { 912 e.preventDefault (); 913 $items.removeClass ("_hiddenMob"); 914 $(this).remove(); 915 }); 916 }); 917}); 918 919 920/* End */ 921; 922; /* Start:"a:4:{s:4:"full";s:61:"/assets/components/subscription/book/script.js?17707959551533";s:6:"source";s:46:"/assets/components/subscription/book/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 923document.addEventListener('DOMContentLoaded', function() { 924 925 $('.js-subscription-book-form').on({ 926 'is:captchaFail': function(event) { 927 const $form = $(event.target); 928 $form.find('.js-subscription-book-form__input, .subscription-book__legal').css('display', 'none'); 929 }, 930 'is:success': function(event, response, data) { 931 const $form = $(event.target); 932 933 // ТÑÐ¸Ð³Ð³ÐµÑ ÑобÑÑÐ¸Ñ Ð¿Ñи аналиÑиÑеÑком дейÑÑвии 934 const analyticsEvent = new CustomEvent('ab.analytics.event', { 935 bubbles: true, 936 cancelable: true, 937 detail: { 938 eventCode: 'subscriptionBookGift', 939 email: $form.find('.js-subscription-book-form__input-field').val() 940 } 941 }); 942 event.target.dispatchEvent(analyticsEvent); 943 944 // Ðоказ ÑÑпеÑно оÑпÑавленной ÑоÑÐ¼Ñ 945 setTimeout(() => { 946 $form.find('.js-subscription-book-form__default').css('display', 'none'); 947 $form.find('.js-subscription-book-form__success').addClass('subscription-book__success_shown'); 948 }, 100); 949 }, 950 'is:fail': function(event) { 951 $(document).trigger('is:errorModal'); 952 } 953 }); 954 955 $(document).on('offerchange', function(event, offer) { 956 $('.js-subscription-book-form input[name="product"]').val(offer.id); 957 }); 958}); 959 960/* End */ 961; 962; /* Start:"a:4:{s:4:"full";
962s:77:"/local/components/ab/book.of.week/templates/.default/script.js?17707959564954";s:6:"source";s:62:"/local/components/ab/book.of.week/templates/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 963document.addEventListener('DOMContentLoaded', function() { 964 965 // ÑÑонÑовÑй ÐºÐ¾Ð¼Ð¿Ð¾Ð½ÐµÐ½Ñ public/local/markup/src/component/section-book-big/ 966 967 $(".js-book-big-buy").each(function(){ 968 const $buyBlock = $(this); 969 const bookId = $buyBlock.data("book-id"); 970 const offerId = $buyBlock.data("offer-id"); 971 972 let inBasket = parseInt($buyBlock.data("in-basket")); 973 974 const $buy = $buyBlock.find(".js-book-big-buy__btn_buy"); 975 const $preorder = $buyBlock.find(".js-book-big-buy__btn_preorder"); 976 const $plusOne = $buyBlock.find(".js-book-big-buy__btn_plus"); 977 978 const $counterVal = $buyBlock.find(".js-book-big-buy__counter"); 979 980 // нажаÑие на "РкоÑзинÑ" 981 if ($buy.length > 0) { 982 $buy.on("click", function(e){ 983 e.preventDefault(); 984 985 const $card = $buy.closest (".js-book-big"); 986 let sendListVal = $buyBlock.length > 0 && $buyBlock.hasClass ("_default"); 987 const itemData = getBookData (inBasket + 1); 988 if (sendListVal) { 989 itemData.list = globalFunctions.escapeStr ($card.data ("book-list")); 990 itemData.position = globalFunctions.escapeStr ($card.data ("book-position")); 991 } 992 const func = globalApp.basket.itemChange; 993 if (globalFunctions.isFunction (func)) { 994 func (bookId, offerId, 1, false, itemData, (sendListVal) ? { 995 list: $card.closest (".js-book-big").data ("book-list"), 996 position: $card.closest (".js-book-big").data ("book-position") 997 } : false); 998 } 999 }); 1000 } 1001 1002 // нажаÑие на "+1 ÑÑ." 1003 if ($plusOne.length > 0) { 1004 $plusOne.on("click", function(e){ 1005 e.preventDefault(); 1006 1007 const func = globalApp.basket.itemChange; 1008 const itemData = getBookData (inBasket + 1); 1009 if (globalFunctions.isFunction(func)) { 1010 func(bookId, offerId, inBasket + 1, false, itemData); 1011 } 1012 }); 1013 } 1014 1015 // нажаÑие на "ÐÑедзаказ" 1016 if ($preorder.length > 0) { 1017 $preorder.click(function(e){ 1018 e.preventDefault(); 1019 1020 const $card = $buy.closest (".js-book-big"); 1021 let sendListVal = ($buyBlock.length > 0 && $buyBlock.hasClass ("_default")); 1022 const itemData = getBookData (1); 1023 if (sendListVal) { 1024 itemData.list = globalFunctions.escapeStr ($card.data ("book-list")); 1025 itemData.position = globalFunctions.escapeStr ($card.data ("book-position")); 1026 } 1027 const func = globalApp.basket.itemChange; 1028 if (globalFunctions.isFunction (func)) { 1029 func (bookId, offerId, 1, false, itemData, (sendListVal) ? { 1030 list: $card.closest (".js-book-big").data ("book-list"), 1031 position: $card.closest (".js-book-big").data ("book-position") 1032 } : false); 1033 } 1034 }); 1035 } 1036 1037 function getBookData (q) { 1038 const $card = $buy.closest (".js-book-big"); 1039 return { 1040 bookId: globalFunctions.escapeStr ($card.data ("book-id")), 1041 offerId: globalFunctions.escapeStr ($card.data ("book-offer-id")), 1042 name: globalFunctions.escapeStr ($card.data ("book-name")), 1043 quantity: globalFunctions.escapeStr (q), 1044 publisher: globalFunctions.escapeStr ($card.data("book-brand")), 1045 categoryName: globalFunctions.escapeStr ($card.data ("book-category")), 1046 variant: globalFunctions.escapeStr ($card.data ("book-variant")), 1047 sales: ($card.data ("book-sales")) ? globalFunctions.escapeStr ($card.data ("book-sales")) : "(not set)" 1048 }; 1049 } 1050 1051 1052 // ÑеагиÑÑем на изменение в коÑзине
1053 $(document).on("basketItemChange", function(e, changedBookId, changedOfferId, q){ 1054 if (changedBookId === bookId && changedOfferId === offerId) { 1055 if (q > 0) { 1056 if ($buyBlock.hasClass("_default")) { 1057 $buyBlock.removeClass("_default").addClass("_basket"); 1058 } 1059 } else if (q === 0) { 1060 if ($buyBlock.hasClass("_basket")) { 1061 $buyBlock.removeClass("_basket").addClass("_default"); 1062 } 1063 } 1064 1065 inBasket = parseInt(q); 1066 1067 // обновлÑем ÑÑÑÑÑик под Ñенами 1068 if ($counterVal.length > 0) { 1069 $counterVal.text(q); 1070 } 1071 } 1072 }); 1073 }); 1074}); 1075 1076/* End */ 1077;; /* /assets/components/banner/plus-main/script.js?1770795955491*/ 1078; /* /assets/components/product/preview/script.js?1770795955376*/ 1079; /* /assets/components/product/preview/lecture/script.js?17707959552099*/ 1080; /* /local/components/ab/collections.slider/templates/.default/script.js?177079595615891*/ 1081; /* /assets/scriptMixes/posts.slider.js?177079596117537*/ 1082; /* /assets/components/subscription/book/script.js?17707959551533*/ 1083; /* /local/components/ab/book.of.week/templates/.default/script.js?17707959564954*/
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.