1/*_____ scripts/pi.helpers.js*/ 2/* Aura version: 1.8.6 */ 3 4 5//region getViewportSize 6function getViewportSize() { 7 var e = window, 8 a = 'inner'; 9 if (!('innerWidth' in window)) { 10 a = 'client'; 11 e = document.documentElement || document.body; 12 } 13 return { 14 width: e[a + 'Width'], 15 height: e[a + 'Height'] 16 }; 17} 18//endregion 19 20//region old IE rgba backgrounds fix 21function fixIE8rgba() { 22 var $ = jQuery; 23 24 if (isOldIE() === 8) { 25 var selectors = [ 26 '.pi-tooltip' 27 ], 28 $elements = $(selectors.join(',')); 29 $elements.each(function () { 30 var $el = $(this), 31 bg = $el.css('background'), 32 rgba = bg.match(/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d{1,3})\)/), 33 hex = rgba ? rgba2hex(rgba[1], rgba[2], rgba[3], rgba[4]) : '#000000'; 34 if (rgba && hex) { 35 $el.css('background', 'filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=' + hex + ', EndColorStr=' + hex + ')') 36 } 37 }); 38 } 39} 40//endregion 41 42//region old IE detection 43function isOldIE() { 44 var version = navigator.appVersion.match(/MSIE (\d)\.\d*/); 45 if (version) { 46 return version[1]; 47 } 48 return false; 49} 50//endregion 51 52//region RGB -> HEX 53var hexDigits = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"); 54 55function rgb2hex(rgb) { 56 if (!rgb) { 57 rgb = 'rgb(0,0,0)'; 58 } 59 rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); 60 return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); 61} 62 63function hex(x) { 64 return isNaN(x) ? "00" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16]; 65} 66//endregion 67 68//region RGBA -> HEX 69function rgba2hex(r, g, b, a) { 70 if (r > 255 || g > 255 || b > 255 || a > 255) 71 throw "Invalid color component"; 72 return (256 + r).toString(16).substr(1) + ((1 << 24) + (g << 16) | (b << 8) | a).toString(16).substr(1); 73} 74//endregion 75 76function getElementHeight($el) { 77 var $ = jQuery, 78 h = 0, 79 vis = $el.css('visibility'), 80 display = $el.css('display'); 81 82 if (display == 'none' || display == 'none !important') { 83 $el.css({ 84 visibility: 'hidden', 85 display: 'block' 86 }); 87 h = $el.outerHeight(); 88 $el.css({ 89 visibility: vis, 90 display: display 91 }); 92 } else { 93 h = $el.outerHeight(); 94 } 95 return h; 96} 97 98 99/*_____ scripts/pi.boundManager.js*/ 100/* Aura version: 1.8.6 */ 101 102var piBounds = { 103 lg: 1140, 104 md: 992, 105 sm: 768, 106 xs: 480, 107 xs2: 320 108}; 109 110jQuery(function ($) { 111 112 var $w = $(window), 113 $d = $(document), 114 resizeTMT; 115 116 window.piViewportSize = getViewportSize(); 117 window.piViewportWidth = window.piViewportSize.width; 118 window.piViewportHeight = window.piViewportSize.height; 119 window.piCurrentBound = piBounds[0]; 120 121 function checkBound() { 122 123 var previousBound = window.piCurrentBound; 124 125 window.piViewportSize = getViewportSize(); 126 window.piViewportWidth = window.piViewportSize.width; 127 window.piViewportHeight = window.piViewportSize.height; 128 129 if (window.piViewportWidth >= piBounds.lg && window.piCurrentBound != 'lg') { 130 window.piCurrentBound = 'lg'; 131 } else if (window.piViewportWidth >= piBounds.md && window.piViewportWidth < piBounds.lg && window.piCurrentBound != 'md') { 132 window.piCurrentBound = 'md'; 133 } else if (window.piViewportWidth >= piBounds.sm && window.piViewportWidth < piBounds.md && window.piCurrentBound != 'sm') { 134 window.piCurrentBound = 'sm'; 135 } else if (window.piViewportWidth >= piBounds.xs && window.piViewportWidth < piBounds.sm && window.piCurrentBound != 'xs') { 136 window.piCurrentBound = 'xs'; 137 } else if (window.piViewportWidth >= piBounds.xs2 && window.piViewportWidth < piBounds.xs && window.piCurrentBound != '2xs') { 138 window.piCurrentBound = '2xs'; 139 } else if (window.piViewportWidth < piBounds.xs2 && window.piCurrentBound != '3xs') { 140 window.piCurrentBound = '3xs'; 141 } 142 if (previousBound != window.piCurrentBound) { 143 $d.trigger('piBoundChanged'); 144 } 145 146 } 147 148 $w.resize(function () { 149 clearTimeout(resizeTMT); 150 resizeTMT = setTimeout(function () { 151 checkBound(); 152 }, 10); 153 }); 154 155 $w.trigger('resize'); 156 157 158}); 159 160 161/*_____ scripts/pi.imagesLoader.js*/ 162/* Aura version: 1.8.6 */ 163 164function PiImagesLoader($el, callback, delay) { 165 166 var o = {}, 167 $ = jQuery; 168 169 o.$el = $el ? typeof ($el) == 'string' ? jQuery($el) : $el : 0; 170 o.$imgs = o.$el.find('img'); 171 o.imgsQ = o.$imgs.length; 172 o.imgsQ_loaded = 0; 173 o.delay = delay ? delay : 0; 174 o.started = 0; 175 o.loaderShown = 0; 176 o.$loadingAnimation = 0; 177 o.$dots = 0; 178 179 o.s = { 180 c: {} 181 }; 182 o.s.dotDistance = 14; 183 o.s.dotQuantity = 3; 184 o.s.dotAnimationSpeed = 100; 185 o.s.c.loading = 'pi-loader'; 186 o.s.c.dot = 'pi-loader-dot'; 187 o.s.c.dotActive = 'pi-loader-dot-active'; 188 o.callback = (callback && (typeof (callback) == 'function')) ? callback : function () {}; 189 190 o.addLoadingAnimation = function () { 191 192 o.loaderShown = true; 193 194 var appendHtml = '<span class="' + o.s.c.loading + '"><span><span>'; 195 196 for (var i = 0; i < o.s.dotQuantity; i++) { 197 appendHtml += '<span class="' + o.s.c.dot + '"></span>'; 198 } 199 200 appendHtml += '</span></span></span>'; 201 202 $(appendHtml).appendTo(o.$el); 203 204 o.$loadingAnimation = o.$el.find('.' + o.s.c.loading); 205 o.$dots = o.$loadingAnimation.find('.' + o.s.c.dot); 206 207 o.activeDotNum = 0; 208 209 requestAnimationFrame(o.loadingDotsAnimate, o.$el); 210 211 } 212 213 o.hideLoadingAnimation = function () { 214 o.loaderShown = 0; 215 o.$dots.each(function () { 216 $(this).removeClass(o.s.c.dotActive); 217 }); 218 o.$loadingAnimation.remove(); 219 } 220 221 o.loadingDotsAnimate = function (time) { 222 223 if (!o.$loadingAnimation) { 224 return; 225 } 226 if (!o.loadingAnimationStartTime) { 227 o.loadingAnimationStartTime = time; 228 } 229 230 var needToRedraw = (time - o.loadingAnimationStartTime) >= 200 ? 1 : 0; 231 232 if (needToRedraw) { 233 234 o.loadingAnimationStartTime = time; 235 236 var $currentDot = o.$dots.eq(o.activeDotNum), 237 $previousDot = $currentDot.prev(); 238 239 if (!$previousDot.get(0)) { 240 $previousDot = o.$dots.eq(o.s.dotQuantity - 1); 241 } 242 243 $currentDot.addClass(o.s.c.dotActive); 244 $previousDot.removeClass(o.s.c.dotActive); 245 246 o.activeDotNum++; 247 248 if (o.activeDotNum >= o.s.dotQuantity + 1) { 249 o.activeDotNum = 0; 250 } 251 } 252 requestAnimationFrame(o.loadingDotsAnimate); 253 254 } 255 256 o.check_images_states = function () { 257 258 o.$imgs.each(function () { 259 260 var oldImg = new Image(), 261 newImg = new Image(), 262 imgSrc = $(this).attr('src'); 263 264 oldImg.src = imgSrc; 265 266 if (oldImg.complete) { 267 o.image_was_loaded(); 268 } else { 269 270 jQuery(newImg).load(function () { 271 o.image_was_loaded(); 272 }).error(function () { 273 o.image_was_loaded(); 274 }); 275 276 newImg.src = imgSrc; 277 278 } 279 280 }); 281 282 o.addLoadingAnimation(); 283 284 } 285 286 o.image_was_loaded = function () { 287 o.imgsQ_loaded++; 288 o.check_ready_state(); 289 } 290 291 o.check_ready_state = function () { 292 293 if (o.imgsQ == o.imgsQ_loaded && !o.started) { 294 295 o.started = true; 296 297 setTimeout(function () { 298 o.callback(); 299 if (o.loaderShown) { 300 o.hideLoadingAnimation(); 301 } 302 }, o.delay); 303 304 } 305 306 } 307 308 o.init = function () { 309 if (o.imgsQ > 0) { 310 o.check_images_states(); 311 } else { 312 o.callback(); 313 } 314 } 315 316 o.init(); 317} 318 319 320/*_____ scripts/pi.ddMenu.js*/ 321/* Aura version: 1.8.6 */ 322 323jQuery(function ($) { 324 325 var $w = $(window), 326 $mainWrapperWidth = $('#pi-all').width(), 327 mainWrapDifference = (window.piViewportWidth - $mainWrapperWidth) / 2, 328 classLeftSide = 'pi-submenu-left-side'; 329 330 //region Menu DD side fix 331 function checkMenus($submenu, initialOffset) { 332 var offset = $submenu.offset().left - mainWrapDifference, 333 width = $submenu.width(); 334 if ($mainWrapperWidth - offset < width) { 335 $submenu.addClass(classLeftSide); 336 } else if ($mainWrapperWidth - initialOffset > width) { 337 $submenu.removeClass(classLeftSide); 338 } 339 } 340 341 $('.pi-submenu').each(function () { 342 343 var $el = $(this), 344 initialOffset = $el.offset().left - mainWrapDifference, 345 timer; 346 347 $w.on('resize', function () { 348 clearTimeout(timer); 349 timer = setTimeout(function () { 350 $mainWrapperWidth = $('#pi-all').width(); 351 mainWrapDifference = (window.piViewportWidth - $mainWrapperWidth) / 2; 352 checkMenus($el, initialOffset); 353 }, 200); 354 }); 355 checkMenus($el, initialOffset); 356 357 }); 358 //endregion 359 360}); 361 362 363/*_____ scripts/pi.init.removeLastElMargin.js*/ 364/* Aura version: 1.8.6 */ 365 366jQuery(function ($) { 367 368 //region Remove Last Header Element Margin 369 var $w = $(window), 370 $hrs = $('.pi-section-header'), 371 clsFloatRight = 'pi-pull-right', 372 clsHeaderBlock = 'pi-row-block', 373 tmt, 374 hrObjects = []; 375 376 $hrs.each(function () { 377 var $curHr = $(this), 378 $blocks = $curHr.find('.' + clsHeaderBlock).filter('.' + clsFloatRight); 379 hrObjects.push({ 380 $hr: $curHr, 381 $blocks: $blocks, 382 currentBlock: false 383 }); 384 }); 385 386 function checkHeaderBlocks() { 387 for (var i = 0; i < hrObjects.length; i++) { 388 389 var $curHr = hrObjects[i], 390 $firstVisibleBlock = $curHr.$blocks.not(':hidden').first(); 391
392 if ($firstVisibleBlock.length < 1) { 393 continue; 394 } 395 396 if (!$curHr.currentBlock || ($curHr.currentBlock.get(0) != $firstVisibleBlock.get(0))) { 397 398 if ($curHr.currentBlock) { 399 $curHr.currentBlock.css({ 400 marginRight: $curHr.currentBlock.get(0).initialMarginRight + 'px' 401 }); 402 } 403 404 $curHr.currentBlock = $firstVisibleBlock; 405 if (!$curHr.currentBlock.get(0).initialMarginRight) { 406 $curHr.currentBlock.get(0).initialMarginRight = parseInt($firstVisibleBlock.css('margin-right'), 10); 407 } 408 409 $firstVisibleBlock.css({ 410 marginRight: 0 411 }); 412 413 } 414 415 } 416 } 417 418 $w.resize(function () { 419 420 clearTimeout(tmt); 421 422 tmt = setTimeout(function () { 423 424 checkHeaderBlocks(); 425 426 }, 300); 427 428 }); 429 430 checkHeaderBlocks(); 431 432 //endregion 433 434}); 435 436 437/*_____ scripts/pi.init.sectionHigh.js*/ 438/* Aura version: 1.8.6 */ 439 440jQuery(function ($) { 441 442 //region Section Full Height 443 var $w = $(window), 444 $sections = $('.pi-section-high, .pi-block-high'), 445 resizeTMT; 446 447 $w.resize(function () { 448 clearTimeout(resizeTMT); 449 resizeTMT = setTimeout(function () { 450 setSectionHeight(); 451 }, 100); 452 }); 453 454 setSectionHeight(); 455 456 function setSectionHeight() { 457 $sections.each(function () { 458 var $el = $(this); 459 $el.height(window.piViewportHeight); 460 }); 461 } 462 463 //endregion 464 465}); 466 467 468/*_____ scripts/pi.fixedHeader.js*/ 469/* Aura version: 1.8.6 */ 470 471jQuery(function ($) { 472 473 //region Fixed header 474 var $w = $(window), 475 $b = $('body'), 476 classRow = 'pi-section-w', 477 ÑlassFixedRow = 'pi-header-row-fixed', 478 ÑlassFixedRows = 'pi-header-rows-fixed', 479 ÑlassFixed = '', 480 classReducible = 'pi-row-reducible', 481 classReduced = 'pi-row-reduced', 482 $stickyHeader = $('.pi-header-sticky'), 483 $reducibleRow = $stickyHeader.find('.' + classReducible), 484 rowsQuantity = $stickyHeader.find('.' + classRow).length, 485 reduceTreshold = 400, 486 stateFixed = 'default', 487 stateReduce = 'default', 488 headerTopOffset = 0, 489 scrollTop = 0; 490 491 if ($stickyHeader.length) { 492 init(); 493 checkHeader(); 494 } 495 496 function init() { 497 498 scrollTop = $w.scrollTop(); 499 headerTopOffset += $stickyHeader.offset().top; 500 501 ÑlassFixed = rowsQuantity > 1 ? ÑlassFixedRows : ÑlassFixedRow; 502 503 $w.scroll(function () { 504 scrollTop = $w.scrollTop(); 505 checkHeader(); 506 }); 507 } 508 509 function checkHeader() { 510 fixHeader(); 511 if ($reducibleRow.length) { 512 reduceHeader(); 513 } 514 } 515 516 function fixHeader() { 517 if (scrollTop >= headerTopOffset) { 518 if (stateFixed == 'default') { 519 requestAnimationFrame(function () { 520 $b.addClass(ÑlassFixed); 521 }); 522 stateFixed = 'fixed'; 523 } 524 } else { 525 if (stateFixed == 'fixed') { 526 requestAnimationFrame(function () { 527 $b.removeClass(ÑlassFixed); 528 }); 529 stateFixed = 'default'; 530 } 531 } 532 } 533 534 function reduceHeader() { 535 var scrollTopExcess = scrollTop - headerTopOffset; 536 537 if (scrollTopExcess > reduceTreshold && stateReduce != 'reduced') { 538 requestAnimationFrame(function () { 539 $reducibleRow.addClass(classReduced); 540 }); 541 stateReduce = 'reduced'; 542 } else if (scrollTopExcess <= reduceTreshold && stateReduce != 'default') { 543 requestAnimationFrame(function () { 544 $reducibleRow.removeClass(classReduced); 545 }); 546 stateReduce = 'default'; 547 } 548 549 } 550 551 //endregion 552 553}); 554 555 556/*_____ scripts/pi.mobileMenu.js*/ 557/* Aura version: 1.8.6 */ 558 559jQuery(function ($) { 560 561 //region Mobile menus 562 var $d = $(document), 563 $w = $(window), 564 resizeTmt; 565 566 new MobileMenus(); 567 568 function MobileMenus() { 569 570 var mobileMenus = [], 571 settings = { 572 classMenuItemHasSubmenu: 'pi-has-dropdown', 573 classParentRowWrapper: 'pi-header-row-sticky', 574 classOpen: 'pi-menu-open', 575 classParentRow: 'pi-section-header-w', 576 classMenuWrapper: 'pi-section-menu-mobile-w', 577 classMenu: 'pi-menu-mobile' 578 }; 579 580 function init() { 581 582 //remove targetting from regular menu in tablet wide mode. 583 $('.' + settings.classMenuItemHasSubmenu).each(function () { 584 $(this).find(' > a').on('click', function (e) { 585 if (window.piCurrentBound != 'lg') { 586 e.preventDefault(); 587 } 588 }); 589 }); 590 591 $('.pi-mobile-menu-toggler').each(function () { 592 var $el = $(this); 593 594 if ($el.get(0).piMenuWasInitialized) { 595 return; 596 } 597 598 $el.get(0).piMenuWasInitialized = 1; 599 600 var mobileMenu = { 601 $parentRowWrapper: null, 602 $toggler: $el, 603 $wrapper: null, 604 $menu: null, 605 height: null, 606 top: null, 607 state: 0 608 }; 609 610 mobileMenu.$parentRowWrapper = $(mobileMenu.$toggler.parents('.' + settings.classParentRowWrapper)); 611 mobileMenu.$wrapper = $(mobileMenu.$toggler.data('target')); 612 mobileMenu.$menu = mobileMenu.$wrapper.find('.' + settings.classMenu); 613 mobileMenu.$menuElements = mobileMenu.$menu.find('li'); 614 615 mobileMenu.height = mobileMenu.$menu.outerHeight(); 616 617 mobileMenu.$toggler.click(function () { 618 console.log('here' + mobileMenu.$menu.outerHeight()); 619 toggleMenu(mobileMenu); 620 }); 621 622 mobileMenu.$menuElements.each(function () { 623 var $li = $(this); 624 625 $li.get(0).$link = $li.find(' > a'); 626 $li.get(0).$siblings = $li.siblings(); 627 $li.get(0).$list = $li.find(' > ul'); 628 629 if ($li.get(0).$list.length) { 630 $li.get(0).$link.click(function (e) { 631 toggleSubmenu(mobileMenu, $li); 632 e.preventDefault(); 633 }); 634 } else { 635 if (mobileMenu.$menu.data('onepageMenu') && mobileMenu.$menu.data('onepageMenu') == 'yes') { 636 $li.get(0).$link.click(function () { 637 toggleMenu(mobileMenu); 638 }); 639 } 640 } 641 }); 642 643 $d.bind('piBoundChanged', function () { 644 if (mobileMenu.state && mobileMenu.$toggler.is(':hidden')) { 645 toggleMenu(mobileMenu); 646 } 647 }); 648 649 mobileMenus.push(mobileMenu); 650 651 }); 652 653 $w.resize(function () { 654 clearTimeout(resizeTmt); 655 resizeTmt = setTimeout(function () { 656 checkMobileSubmenuHeight(); 657 }, 100); 658 }); 659 660 checkMobileSubmenuHeight(); 661 662 }; 663 664 function toggleSubmenu(mobileMenu, $li) { 665 if ($li.get(0).$list.hasClass('pi-active')) { 666 mobileMenu.height = mobileMenu.height - $li.get(0).listHeight; 667 mobileMenu.$wrapper.height(mobileMenu.height); 668 $li.get(0).$list.removeClass('pi-active'); 669 $li.get(0).$list.animate({ 670 height: 0 671 }, 500, function () { 672 changeParentsListHeight($li, $li.get(0).listHeight, 'take'); 673 }); 674 } else { 675 mobileMenu.height = mobileMenu.height + $li.get(0).listHeight; 676 mobileMenu.$wrapper.height(mobileMenu.height); 677 $li.get(0).$list.addClass('pi-active'); 678 $li.get(0).$list.animate({ 679 height: $li.get(0).listHeight 680 }, 500, function () { 681 changeParentsListHeight($li, $li.get(0).listHeight, 'add'); 682 $(this).height('auto'); 683 }); 684 $li.get(0).$siblings.each(function () { 685 if ($(this).find(' > ul.pi-active').length) { 686 toggleSubmenu(mobileMenu, $(this)); 687 } 688 }); 689 } 690 } 691 692 function changeParentsListHeight($li, h, action) { 693 var parentLI = $li.parents('li').length ? $li.parents('li').eq(0) : null; 694 if (parentLI && parentLI.get(0).listHeight) { 695 if (action == 'add') { 696 parentLI.get(0).listHeight += h; 697 } else { 698 parentLI.get(0).listHeight -= h; 699 } 700 changeParentsListHeight(parentLI, h, action); 701 } 702 } 703 704 function checkMobileSubmenuHeight() { 705 for (var i = 0; i < mobileMenus.length; i++) { 706 mobileMenus[i].$menuElements.each(function () { 707 var $li = $(this); 708 if ($li.get(0).$list.length) { 709 var initH = getElementHeight($li.get(0).$list); 710 if (initH != 0) { 711 $li.get(0).listHeight = initH; 712 } else { 713 $li.get(0).$list.height('auto'); 714 $li.get(0).listHeight = getElementHeight($li.get(0).$list); 715 $li.get(0).$list.height(initH); 716 } 717 } 718 }); 719 } 720 } 721 722 function toggleMenu(m) { 723 m.$wrapper.toggleClass(settings.classOpen); 724 if (!m.$wrapper.hasClass(settings.classOpen)) { 725 m.$wrapper.height(0); 726 m.$wrapper.css({ 727 overflow: 'none' 728 }); 729 m.state = 0; 730 } else { 731 m.$wrapper.height(m.height); 732 m.$wrapper.css({ 733 overflow: 'auto' 734 }); 735 m.state = 1; 736 } 737 } 738 739 init(); 740 741 return mobileMenus; 742 } 743 744 //endregion 745 746}); 747 748 749/*_____ scripts/pi.columnFix.js*/ 750/* Aura version: 1.8.6 */ 751 752jQuery(function ($) { 753 754 //region Columns fix 755 var $w = $(window), 756 $galleries = $('.pi-gallery.pi-column-fix'), 757 $liquidGalleries = $galleries.filter('[class*=pi-liquid-col]'); 758 759 $liquidGalleries.each(function () { 760 761 var $g = $(this), 762 $gItems = $g.find('.pi-gallery-item'), 763 isStacked = $g.hasClass('pi-stacked'), 764 itemsWidthRejected = 0; 765 766 detectColumnSizeNumber($g, 'gallery'); 767 768 $w.load(function () { 769 var tmt; 770 771 $w.resize(function () { 772 if (!itemsWidthRejected) { 773 itemsWidthRejected = 1; 774 $gItems.each(function (i) { 775 var $el = $(this); 776 $el.css('width', ''); 777 }); 778 } 779 }); 780 781 $w.resize(function () { 782 clearTimeout(tmt); 783 tmt = setTimeout(function () { 784 785 itemsWidthRejected = 0; 786 787 if (isStacked) { 788 $g.css('cssText', 'margin-right: 0 !important'); 789 } 790 791 var cols = $g.data('width-' + window.piCurrentBound), 792 galleryWidth = $g.width(), 793 galleryItemPadding = parseInt($gItems.eq(0).css('padding-left'), 10) + parseInt($gItems.eq(0).css('padding-right'), 10), 794 galleryWidthWithoutPadding = galleryWidth - cols * galleryItemPadding, 795 itemWidthExcess = galleryWidthWithoutPadding % cols, 796 galleryItemWidth = (galleryWidthWithoutPadding - itemWidthExcess) / cols; 797 798 if (itemWidthExcess && isStacked) { 799 galleryItemWidth++; 800 $g.css('cssText', 'margin-right: -' + cols + 'px !important'); 801 } else if (isStacked) { 802 $g.css('cssText', 'margin-right: 0 !important'); 803 } 804 805 $gItems.each(function (i) { 806 var $el = $(this); 807 $el.width(galleryItemWidth); 808 }); 809 810 }, 100); 811 812 }); 813 $w.trigger('resize'); 814 }); 815 816 }); 817 818 var $colsToFix = $('.pi-column-fix').filter('[class*=pi-col-]'); 819 820 if ($colsToFix.length) { 821 822 $w.load(function () { 823 824 var tmt; 825 826 $colsToFix.each(function () { 827 detectColumnSizeNumber($(this), 'grid'); 828 }); 829 830 $w.resize(function () { 831 832 clearTimeout(tmt); 833 834 tmt = setTimeout(function () { 835 836 $colsToFix.each(function () { 837 838 var $el = $(this), 839 elPadding = parseInt($el.css('padding-left'), 10) + parseInt($el.css('padding-right'), 10), 840 newWidth = Math.floor($el.parent().width() / 12 * $el.data('width-' + window.piCurrentBound)) - elPadding; 841 842 $(this).width(newWidth); 843 844 }); 845 846 }, 100); 847 }); 848 849 $w.trigger('resize'); 850 }); 851 852 } 853 854 function detectColumnSizeNumber($el, gridType) { 855 856 var classesList = $el.attr('class'), 857 gClasses = classesList.match(/pi-liquid-col-\d?\D\D-\d/g) || classesList.match(/pi-col-\d?\D\D-\d/g), 858 bounds = {}; 859 860 for (var i = 0; i < gClasses.length; i++) { 861 var bound = gClasses[i].match(/pi-liquid-col-(\d?\D\D)-(\d)/i) || gClasses[i].match(/pi-col-(\d?\D\D)-(\d)/i); 862 if (bound) { 863 bounds[bound[1]] = bound[2]; 864 } 865 } 866 867 if (gridType == 'gallery') { 868 if (!bounds['3xs']) { 869 bounds['3xs'] = 1; 870 } 871 } else { 872 if (!bounds['3xs']) { 873 bounds['3xs'] = 12; 874 } 875 } 876 877 if (!bounds['2xs']) { 878 bounds['2xs'] = bounds['3xs']; 879 } 880 if (!bounds['xs']) { 881 bounds['xs'] = bounds['2xs']; 882 } 883 if (!bounds['sm']) { 884 bounds['sm'] = bounds['xs']; 885 } 886 if (!bounds['md']) { 887 bounds['md'] = bounds['sm']; 888 } 889 if (!bounds['lg']) { 890 bounds['lg'] = bounds['md']; 891 } 892 893 for (var bound in bounds) { 894 $el.data('width-' + bound, bounds[bound]); 895 } 896 } 897 //endregion 898 899}); 900 901 902/*_____ scripts/pi.alert.js*/ 903/* Aura version: 1.8.6 */ 904 905/* ======================================================================== 906 * PI: pi.alert.js v1.0.0 907 * BASED ON: bootstrap-alert.js v2.3.2 908 * http://getbootstrap.com/2.3.2/javascript.html#alerts 909 * ========================================================== 910 * Copyright 2013 Twitter, Inc. 911 * 912 * Licensed under the Apache License, Version 2.0 (the "License");
913 * you may not use this file except in compliance with the License. 914 * You may obtain a copy of the License at 915 * 916 * http://www.apache.org/licenses/LICENSE-2.0 917 * 918 * Unless required by applicable law or agreed to in writing, software 919 * distributed under the License is distributed on an "AS IS" BASIS, 920 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 921 * See the License for the specific language governing permissions and 922 * limitations under the License. 923 * ========================================================== */ 924 925 926! function ($) { 927 928 "use strict"; // jshint ;_; 929 930 931 /* ALERT CLASS DEFINITION 932 * ====================== */ 933 934 var dismiss = '[data-dismiss="alert"]', 935 Alert = function (el) { 936 $(el).on('click', dismiss, this.close); 937 } 938 939 Alert.prototype.close = function (e) { 940 var $this = $(this), 941 selector = $this.attr('data-target'), 942 $parent; 943 944 if (!selector) { 945 selector = $this.attr('href'); 946 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); //strip for ie7 947 } 948 949 $parent = $(selector); 950 951 e && e.preventDefault(); 952 953 $parent.length || ($parent = $this.hasClass('pi-alert') ? $this : $this.parent()); 954 955 $parent.trigger(e = $.Event('close')); 956 957 if (e.isDefaultPrevented()) return; 958 959 $parent.removeClass('in'); 960 961 function removeElement() { 962 $parent 963 .trigger('closed') 964 .remove(); 965 } 966 967 if ($.support.transition && $parent.hasClass('fade')) { 968 $this.on($.support.transition.end, function (e) { 969 e.stopPropagation(); 970 }); 971 $parent.on($.support.transition.end, removeElement); 972 } else { 973 removeElement(); 974 } 975 976 } 977 978 979 /* ALERT PLUGIN DEFINITION 980 * ======================= */ 981 982 var old = $.fn.alert 983 984 $.fn.alert = function (option) { 985 return this.each(function () { 986 var $this = $(this), 987 data = $this.data('alert'); 988 if (!data) $this.data('alert', (data = new Alert(this))); 989 if (typeof option == 'string') data[option].call($this); 990 }); 991 } 992 993 $.fn.alert.Constructor = Alert; 994 995 996 /* ALERT NO CONFLICT 997 * ================= */ 998 999 $.fn.alert.noConflict = function () { 1000 $.fn.alert = old; 1001 return this; 1002 } 1003 1004 1005 /* ALERT DATA-API 1006 * ============== */ 1007 1008 $(document).on('click.alert.data-api', dismiss, Alert.prototype.close); 1009 1010}(window.jQuery); 1011 1012 1013/*_____ scripts/pi.init.formsBlurClasses.js*/ 1014/* Aura version: 1.8.6 */ 1015 1016jQuery(function ($) { 1017 1018 //region Input blur styles 1019 var $b = $('body'), 1020 cls = { 1021 changed: 'pi-form-control-changed', 1022 focused: 'pi-form-control-focused', 1023 withIcon: 'pi-input-with-icon' 1024 }; 1025 $b.delegate('.form-control', 'keyup', function () { 1026 var $el = $(this), 1027 val = $el.val(); 1028 if (val !== 'placeholder' && $.trim(val)) { 1029 $el.addClass(cls.changed); 1030 $el.parents('form').addClass(cls.changed); 1031 } else { 1032 $el.removeClass(cls.changed); 1033 $el.parents('form').removeClass(cls.changed); 1034 } 1035 }).delegate('.form-control', 'focus', function () { 1036 var $el = $(this); 1037 $el.parents('form').addClass(cls.focused); 1038 $el.parents('.' + cls.withIcon).addClass(cls.focused); 1039 }).delegate('.form-control', 'blur', function () { 1040 var $el = $(this); 1041 $el.parents('form').removeClass(cls.focused); 1042 $el.parents('.' + cls.withIcon).removeClass(cls.focused); 1043 }); 1044 //endregion 1045 1046}); 1047 1048 1049/*_____ scripts/pi.init.placeholder.js*/ 1050/* Aura version: 1.8.6 */ 1051 1052jQuery(function ($) { 1053 1054 //region form placeholder 1055 if ($.fn.placeholder) { 1056 $('input, textarea').placeholder(); 1057 } 1058 //endregion 1059 1060}); 1061 1062 1063/*_____ scripts/pi.init.jqueryScrollTo.js*/ 1064/* Aura version: 1.8.6 */ 1065 1066jQuery(function ($) { 1067 1068 //region Scroll To 1069 if ($.fn.scrollTo) { 1070 1071 var $w = $(window), 1072 defaultOffset = -100, 1073 defaultOffsetMin = -20, 1074 defaultDuration = 750, 1075 defaultEasing = 'easeOutExpo'; 1076 1077 $('[data-scroll-to]').each(function () { 1078 1079 var $el = $(this), 1080 target = $el.data('scrollTo'), 1081 duration = $el.data('scrollToDuration') || defaultDuration, 1082 offset = $el.data('scrollToOffset') || defaultOffset, 1083 initialOffset = offset, 1084 easing = $el.data('scrollToEasing') || defaultEasing; 1085 1086 target = $(target).length ? $(target) : target; 1087 1088 $el.bind('click', function (e) { 1089 1090 //$.scrollTo.window().stop(true); 1091 1092 if (window.piCurrentBound != 'lg') { 1093 offset = defaultOffsetMin; 1094 } else { 1095 offset = initialOffset; 1096 } 1097 1098 $w.scrollTo(target, duration, { 1099 offset: offset, 1100 easing: easing 1101 }); 1102 1103 e.preventDefault(); 1104 1105 }); 1106 1107 }); 1108 } 1109 //endregion 1110 1111}); 1112 1113 1114/*_____ scripts/pi.scrollTopArrow.js*/ 1115/* Aura version: 1.8.6 */ 1116 1117jQuery(function ($) { 1118 1119 //region Scroll Top Arrow logic 1120 1121 var $w = $(window), 1122 $d = $(document), 1123 $arrow = $('.pi-scroll-top-arrow'), 1124 classActive = 'pi-active', 1125 classBottom = 'pi-scroll-top-arrow-footer', 1126 footerHeight = 100, 1127 treshold = 400, 1128 scrollCheckTmt; 1129 1130 if ($arrow.length) { 1131 $w.on('scroll resize', function () { 1132 clearTimeout(scrollCheckTmt); 1133 scrollCheckTmt = setTimeout(function () { 1134 checkArrow(); 1135 }, 100); 1136 }); 1137 1138 $arrow.on('click', function () { 1139 $arrow.removeClass(classActive); 1140 }); 1141 } 1142 1143 function checkArrow() { 1144 var scrollTop = $w.scrollTop(), 1145 documentHeight = $d.height(),
1146 nearFooter = (window.piViewportHeight + scrollTop) >= documentHeight - footerHeight; 1147 1148 if (scrollTop >= treshold) { 1149 $arrow.addClass(classActive); 1150 } else { 1151 $arrow.removeClass(classActive); 1152 } 1153 1154 if (nearFooter && window.piCurrentBound != 'lg') { 1155 $arrow.addClass(classBottom); 1156 } else { 1157 $arrow.removeClass(classBottom); 1158 } 1159 1160 } 1161 1162 //endregion 1163 1164}); 1165 1166 1167/*_____ scripts/pi.init.social.js*/ 1168/* Aura version: 1.8.6 */ 1169 1170jQuery(function ($) { 1171 1172 //region Socials jumps 1173 $('.pi-jump a, .pi-jump-bg a').each(function () { 1174 var $el = $(this); 1175 if ($el.find('i').length <= 1) { 1176 $el.append($el.find('i').clone()); 1177 } 1178 }); 1179 1180 $('.pi-social-icons-big a i').wrap('<span></span>'); 1181 //endregion 1182 1183}); 1184 1185 1186/*_____ scripts/pi.init.caption.js*/ 1187/* Aura version: 1.8.6 */ 1188 1189jQuery(function ($) { 1190 1191 //region Captions animations 1192 $('.pi-overlay-slide:not(.pi-caption-opened)').each(function () { 1193 var $caption = $(this), 1194 $parent = $caption.parents('.pi-img-w'), 1195 height = $caption.outerHeight(true); 1196 1197 if ($caption.hasClass('pi-show-heading')) { 1198 height -= $caption.find('h2,h3,h4,h5,h6').eq(0).outerHeight(true) + parseInt($caption.css('padding-top'), 10); 1199 } 1200 1201 $caption.css({ 1202 bottom: -height, 1203 visibility: 'visible' 1204 }); 1205 1206 $parent.hover(function () { 1207 $caption.css({ 1208 bottom: 0 1209 }) 1210 }, function () { 1211 $caption.css({ 1212 bottom: -height 1213 }) 1214 }); 1215 1216 }); 1217 //endregion 1218 1219}); 1220 1221 1222/*_____ scripts/pi.init.submitFormContact.js*/ 1223/* Aura version: 1.8.6 */ 1224 1225jQuery(function ($) { 1226 1227 //region Init Footer Form submit 1228 $('.pi-contact-form').submit(function () { 1229 1230 var $form = $(this), 1231 $error = $form.find('.pi-error-container'), 1232 action = $form.attr('action'); 1233 1234 $error.slideUp(750, function () { 1235 $error.hide(); 1236 1237 var $name = $form.find('.form-control-name'), 1238 $email = $form.find('.form-control-email'), 1239 $companyName = $form.find('.form-control-company-name'), 1240 $phone = $form.find('.form-control-phone'), 1241 $budjet = $form.find('.form-control-budjet'), 1242 $comments = $form.find('.form-control-comments'), 1243 $legge = $form.find('.form-control-legge'), 1244 $captcha = $form.find('.g-recaptcha'), 1245 $captchaResponse = $form.find('[name="g-recaptcha-response"]'); 1246 $('.wait').fadeIn('slow').html('<img src="/img/loader.gif" alt="caricamento..." />'); 1247 1248 $.post(action, { 1249 name: $name.val(), 1250 email: $email.val(), 1251 companyName: $companyName.val(), 1252 phone: $phone.val(), 1253 budjet: $budjet.val(), 1254 comments: $comments.val(), 1255 legge: $legge.val(), 1256 captcha_enabled: $captcha.length > 0 ? 1 : 0, 1257 captcha_response: $captchaResponse.length > 0 ? $captchaResponse.val() : 0, 1258 // aggiungi queste tre righe sotto 1259 controllo: $('input[name="controllo"]').val(), 1260 form_ts: $('input[name="form_ts"]').val(), 1261 form_token: $('input[name="form_token"]').val() 1262 }, 1263 function (data) { 1264 $('.wait').hide(); 1265 $error.html(data); 1266 $error.slideDown('slow'); 1267 1268 if (data.match('success') != null) { 1269 $name.val(''); 1270 $email.val(''); 1271 $companyName.val(''); 1272 $phone.val(''); 1273 $budjet.val(''); 1274 $comments.val(''); 1275 $legge.val(''); 1276 } 1277 } 1278 ); 1279 1280 }); 1281 1282 return false; 1283 1284 }); 1285 //endregion 1286 1287}); 1288 1289 1290/*_____ scripts/pi.init.colorbox.js*/ 1291/* Aura version: 1.8.6 */ 1292 1293jQuery(function ($) { 1294 1295 //region colorbox 1296 if ($.fn.colorbox) { 1297 1298 var $d = $(document), 1299 $w = $(window), 1300 $colorboxLinks = $('.pi-colorbox'), 1301 //Breakpoints could be 3xs, 2xs, xs, sm, md, lg 1302 breakpoints = [ 1303 'sm', 1304 'md', 1305 'lg' 1306 ], 1307 colorboxState = 0, 1308 colorboxNeeded = 0; 1309 1310 1311 function piColorboxInit() { 1312 1313 colorboxNeeded = 0; 1314 1315 for (var i in breakpoints) { 1316 if (breakpoints[i] == window.piCurrentBound) { 1317 colorboxNeeded = 1; 1318 break; 1319 } 1320 } 1321 1322 if (colorboxNeeded && !colorboxState) { 1323 $colorboxLinks.each(function () { 1324 var $el = $(this), 1325 videoData = $el.data('videoSize'), 1326 videoSize = videoData ? videoData.split(',') : 0, 1327 groupFromData = $el.data('colorboxGroup'), 1328 group = groupFromData ? groupFromData : 'pi-group'; 1329 1330 if (videoSize[0]) { 1331 videoSize[0] = parseInt(videoSize[0], 10); 1332 videoSize[1] = parseInt(videoSize[1], 10); 1333 if (typeof (videoSize[0]) == 'number' && typeof (videoSize[1]) == 'number') { 1334 $el.colorbox({ 1335 rel: group, 1336 iframe: true, 1337 innerWidth: videoSize[0], 1338 innerHeight: videoSize[1], 1339 maxWidth: '95%', 1340 maxHeight: '95%' 1341 }); 1342 } 1343 } else { 1344 $el.colorbox({ 1345 rel: group, 1346 maxWidth: '95%', 1347 maxHeight: '95%' 1348 }); 1349 } 1350 1351 }); 1352 colorboxState = 1; 1353 } else if (!colorboxNeeded && colorboxState) {
1354 $colorboxLinks.colorbox.remove(); 1355 colorboxState = 0; 1356 } 1357 } 1358 1359 $d.bind('piBoundChanged', piColorboxInit); 1360 piColorboxInit(); 1361 1362 } 1363 //endregion 1364 1365});
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.