1/*! 2 * Bowser - a browser detector 3 * https://github.com/ded/bowser 4 * MIT License | (c) Dustin Diaz 2015 5 */ 6 7!function (name, definition) { 8 if (typeof module != 'undefined' && module.exports) module.exports = definition() 9 else if (typeof define == 'function' && define.amd) define(name, definition) 10 else this[name] = definition() 11}('bowser', function () { 12 /** 13 * See useragents.js for examples of navigator.userAgent 14 */ 15 16 var t = true 17 18 function detect(ua) { 19 20 function getFirstMatch(regex) { 21 var match = ua.match(regex); 22 return (match && match.length > 1 && match[1]) || ''; 23 } 24 25 function getSecondMatch(regex) { 26 var match = ua.match(regex); 27 return (match && match.length > 1 && match[2]) || ''; 28 } 29 30 var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() 31 , likeAndroid = /like android/i.test(ua) 32 , android = !likeAndroid && /android/i.test(ua) 33 , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) 34 , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) 35 , chromeos = /CrOS/.test(ua) 36 , silk = /silk/i.test(ua) 37 , sailfish = /sailfish/i.test(ua) 38 , tizen = /tizen/i.test(ua) 39 , webos = /(web|hpw)os/i.test(ua) 40 , windowsphone = /windows phone/i.test(ua) 41 , windows = !windowsphone && /windows/i.test(ua) 42 , mac = !iosdevice && !silk && /macintosh/i.test(ua) 43 , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) 44 , edgeVersion = getFirstMatch(/edge\/(\d+(\.\d+)?)/i) 45 , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) 46 , tablet = /tablet/i.test(ua) 47 , mobile = !tablet && /[^-]mobi/i.test(ua) 48 , xbox = /xbox/i.test(ua) 49 , result 50 51 if (/opera|opr|opios/i.test(ua)) { 52 result = { 53 name: 'Opera' 54 , opera: t 55 , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) 56 } 57 } 58 else if (/coast/i.test(ua)) { 59 result = { 60 name: 'Opera Coast' 61 , coast: t 62 , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) 63 } 64 } 65 else if (/yabrowser/i.test(ua)) { 66 result = { 67 name: 'Yandex Browser' 68 , yandexbrowser: t 69 , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) 70 } 71 } 72 else if (/ucbrowser/i.test(ua)) { 73 result = { 74 name: 'UC Browser' 75 , ucbrowser: t 76 , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) 77 } 78 } 79 else if (/mxios/i.test(ua)) { 80 result = { 81 name: 'Maxthon' 82 , maxthon: t 83 , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) 84 } 85 } 86 else if (/epiphany/i.test(ua)) { 87 result = { 88 name: 'Epiphany' 89 , epiphany: t 90 , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) 91 } 92 } 93 else if (/puffin/i.test(ua)) { 94 result = { 95 name: 'Puffin' 96 , puffin: t 97 , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) 98 } 99 } 100 else if (/sleipnir/i.test(ua)) { 101 result = { 102 name: 'Sleipnir' 103 , sleipnir: t 104 , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) 105 } 106 } 107 else if (/k-meleon/i.test(ua)) { 108 result = { 109 name: 'K-Meleon' 110 , kMeleon: t 111 , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) 112 } 113 } 114 else if (windowsphone) { 115 result = { 116 name: 'Windows Phone' 117 , windowsphone: t 118 } 119 if (edgeVersion) { 120 result.msedge = t 121 result.version = edgeVersion 122 } 123 else { 124 result.msie = t 125 result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i) 126 } 127 } 128 else if (/msie|trident/i.test(ua)) { 129 result = { 130 name: 'Internet Explorer' 131 , msie: t 132 , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) 133 } 134 } else if (chromeos) { 135 result = { 136 name: 'Chrome' 137 , chromeos: t 138 , chromeBook: t 139 , chrome: t 140 , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) 141 } 142 } else if (/chrome.+? edge/i.test(ua)) { 143 result = { 144 name: 'Microsoft Edge' 145 , msedge: t 146 , version: edgeVersion 147 } 148 } 149 else if (/vivaldi/i.test(ua)) { 150 result = { 151 name: 'Vivaldi' 152 , vivaldi: t 153 , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier 154 } 155 } 156 else if (sailfish) { 157 result = { 158 name: 'Sailfish' 159 , sailfish: t 160 , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) 161 } 162 } 163 else if (/seamonkey\//i.test(ua)) { 164 result = { 165 name: 'SeaMonkey' 166 , seamonkey: t 167 , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) 168 } 169 } 170 else if (/firefox|iceweasel|fxios/i.test(ua)) { 171 result = { 172 name: 'Firefox' 173 , firefox: t 174 , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) 175 } 176 if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { 177 result.firefoxos = t 178 } 179 } 180 else if (silk) { 181 result = { 182 name: 'Amazon Silk' 183 , silk: t 184 , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) 185 } 186 } 187 else if (/phantom/i.test(ua)) { 188 result = { 189 name: 'PhantomJS' 190 , phantom: t 191 , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) 192 } 193 } 194 else if (/slimerjs/i.test(ua)) { 195 result = { 196 name: 'SlimerJS' 197 , slimer: t 198 , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) 199 } 200 } 201 else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { 202 result = { 203 name: 'BlackBerry' 204 , blackberry: t 205 , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) 206 } 207 } 208 else if (webos) { 209 result = { 210 name: 'WebOS' 211 , webos: t 212 , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) 213 }; 214 if( /touchpad\//i.test(ua) ){ 215 result.touchpad = t; 216 } 217 } 218 else if (/bada/i.test(ua)) { 219 result = { 220 name: 'Bada' 221 , bada: t 222 , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) 223 }; 224 } 225 else if (tizen) { 226 result = { 227 name: 'Tizen' 228 , tizen: t 229 , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier 230 }; 231 } 232 else if (/qupzilla/i.test(ua)) { 233 result = { 234 name: 'QupZilla' 235 , qupzilla: t 236 , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier 237 } 238 } 239 else if (/chromium/i.test(ua)) { 240 result = { 241 name: 'Chromium' 242 , chromium: t 243 , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier 244 } 245 } 246 else if (/chrome|crios|crmo/i.test(ua)) { 247 result = { 248 name: 'Chrome' 249 , chrome: t 250 , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) 251 } 252 } 253 else if (android) { 254 result = { 255 name: 'Android' 256 , version: versionIdentifier 257 } 258 } 259 else if (/safari|applewebkit/i.test(ua)) { 260 result = { 261 name: 'Safari' 262 , safari: t 263 } 264 if (versionIdentifier) { 265 result.version = versionIdentifier 266 } 267 } 268 else if (iosdevice) { 269 result = { 270 name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' 271 } 272 // WTF: version is not part of user agent in web apps 273 if (versionIdentifier) { 274 result.version = versionIdentifier 275 } 276 } 277 else if(/googlebot/i.test(ua)) { 278 result = { 279 name: 'Googlebot' 280 , googlebot: t 281 , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier 282 } 283 } 284 else { 285 result = { 286 name: getFirstMatch(/^(.*)\/(.*) /), 287 version: getSecondMatch(/^(.*)\/(.*) /) 288 }; 289 } 290 291 // set webkit or gecko flag for browsers based on these engines 292 if (!result.msedge && /(apple)?webkit/i.test(ua)) { 293 if (/(apple)?webkit\/537\.36/i.test(ua)) { 294 result.name = result.name || "Blink" 295 result.blink = t 296 } else { 297 result.name = result.name || "Webkit" 298 result.webkit = t 299 } 300 if (!result.version && versionIdentifier) { 301 result.version = versionIdentifier 302 } 303 } else if (!result.opera && /gecko\//i.test(ua)) { 304 result.name = result.name || "Gecko" 305 result.gecko = t 306 result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i) 307 } 308 309 // set OS flags for platforms that have multiple browsers 310 if (!result.msedge && (android || result.silk)) { 311 result.android = t 312 } else if (iosdevice) { 313 result[iosdevice] = t 314 result.ios = t 315 } else if (mac) { 316 result.mac = t 317 } else if (xbox) { 318 result.xbox = t 319 } else if (windows) { 320 result.windows = t 321 } else if (linux) { 322 result.linux = t 323 } 324 325 // OS version extraction 326 var osVersion = ''; 327 if (result.windowsphone) { 328 osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); 329 } else if (iosdevice) { 330 osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); 331 osVersion = osVersion.replace(/[_\s]/g, '.'); 332 } else if (android) { 333 osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); 334 } else if (result.webos) { 335 osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); 336 } else if (result.blackberry) { 337 osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); 338 } else if (result.bada) { 339 osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); 340 } else if (result.tizen) { 341 osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); 342 } 343 if (osVersion) { 344 result.osversion = osVersion; 345 } 346 347 // device type extraction 348 var osMajorVersion = osVersion.split('.')[0]; 349 if ( 350 tablet 351 || nexusTablet 352 || iosdevice == 'ipad' 353 || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) 354 || result.silk 355 ) { 356 result.tablet = t 357 } else if ( 358 mobile 359 || iosdevice == 'iphone' 360 || iosdevice == 'ipod' 361 || android 362 || nexusMobile 363 || result.blackberry 364 || result.webos 365 || result.bada 366 ) { 367 result.mobile = t 368 } 369 370 // Graded Browser Support
371 // http://developer.yahoo.com/yui/articles/gbs 372 if (result.msedge || 373 (result.msie && result.version >= 10) || 374 (result.yandexbrowser && result.version >= 15) || 375 (result.vivaldi && result.version >= 1.0) || 376 (result.chrome && result.version >= 20) || 377 (result.firefox && result.version >= 20.0) || 378 (result.safari && result.version >= 6) || 379 (result.opera && result.version >= 10.0) || 380 (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || 381 (result.blackberry && result.version >= 10.1) 382 || (result.chromium && result.version >= 20) 383 ) { 384 result.a = t; 385 } 386 else if ((result.msie && result.version < 10) || 387 (result.chrome && result.version < 20) || 388 (result.firefox && result.version < 20.0) || 389 (result.safari && result.version < 6) || 390 (result.opera && result.version < 10.0) || 391 (result.ios && result.osversion && result.osversion.split(".")[0] < 6) 392 || (result.chromium && result.version < 20) 393 ) { 394 result.c = t 395 } else result.x = t 396 397 return result 398 } 399 400 var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent : '') 401 402 bowser.test = function (browserList) { 403 for (var i = 0; i < browserList.length; ++i) { 404 var browserItem = browserList[i]; 405 if (typeof browserItem=== 'string') { 406 if (browserItem in bowser) { 407 return true; 408 } 409 } 410 } 411 return false; 412 } 413 414 /** 415 * Get version precisions count 416 * 417 * @example 418 * getVersionPrecision("1.10.3") // 3 419 * 420 * @param {string} version 421 * @return {number} 422 */ 423 function getVersionPrecision(version) { 424 return version.split(".").length; 425 } 426 427 /** 428 * Array::map polyfill 429 * 430 * @param {Array} arr 431 * @param {Function} iterator 432 * @return {Array} 433 */ 434 function map(arr, iterator) { 435 var result = [], i; 436 if (Array.prototype.map) { 437 return Array.prototype.map.call(arr, iterator); 438 } 439 for (i = 0; i < arr.length; i++) { 440 result.push(iterator(arr[i])); 441 } 442 return result; 443 } 444 445 /** 446 * Calculate browser version weight 447 * 448 * @example 449 * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 450 * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 451 * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 452 * compareVersions(['1.10.2.1', '1.0800.2']); // -1 453 * 454 * @param {Array<String>} versions versions to compare 455 * @return {Number} comparison result 456 */ 457 function compareVersions(versions) { 458 // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 459 var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); 460 var chunks = map(versions, function (version) { 461 var delta = precision - getVersionPrecision(version); 462 463 // 2) "9" -> "9.0" (for precision = 2) 464 version = version + new Array(delta + 1).join(".0"); 465 466 // 3) "9.0" -> ["000000000"", "000000009"] 467 return map(version.split("."), function (chunk) { 468 return new Array(20 - chunk.length).join("0") + chunk; 469 }).reverse(); 470 }); 471 472 // iterate in reverse order by reversed chunks array 473 while (--precision >= 0) { 474 // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) 475 if (chunks[0][precision] > chunks[1][precision]) { 476 return 1; 477 } 478 else if (chunks[0][precision] === chunks[1][precision]) { 479 if (precision === 0) { 480 // all version chunks are same 481 return 0; 482 } 483 } 484 else { 485 return -1; 486 } 487 } 488 } 489 490 /** 491 * Check if browser is unsupported 492 * 493 * @example 494 * bowser.isUnsupportedBrowser({ 495 * msie: "10", 496 * firefox: "23", 497 * chrome: "29", 498 * safari: "5.1", 499 * opera: "16", 500 * phantom: "534" 501 * }); 502 * 503 * @param {Object} minVersions map of minimal version to browser 504 * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map 505 * @param {String} [ua] user agent string 506 * @return {Boolean} 507 */ 508 function isUnsupportedBrowser(minVersions, strictMode, ua) { 509 var _bowser = bowser; 510 511 // make strictMode param optional with ua param usage 512 if (typeof strictMode === 'string') { 513 ua = strictMode;
514 strictMode = void(0); 515 } 516 517 if (strictMode === void(0)) { 518 strictMode = false; 519 } 520 if (ua) { 521 _bowser = detect(ua); 522 } 523 524 var version = "" + _bowser.version; 525 for (var browser in minVersions) { 526 if (minVersions.hasOwnProperty(browser)) { 527 if (_bowser[browser]) { 528 // browser version and min supported version. 529 return compareVersions([version, minVersions[browser]]) < 0; 530 } 531 } 532 } 533 534 return strictMode; // not found 535 } 536 537 /** 538 * Check if browser is supported 539 * 540 * @param {Object} minVersions map of minimal version to browser 541 * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map 542 * @param {String} [ua] user agent string 543 * @return {Boolean} 544 */ 545 function check(minVersions, strictMode, ua) { 546 return !isUnsupportedBrowser(minVersions, strictMode, ua); 547 } 548 549 bowser.isUnsupportedBrowser = isUnsupportedBrowser; 550 bowser.compareVersions = compareVersions; 551 bowser.check = check; 552 553 /* 554 * Set our detect method to the main bowser object so we can 555 * reuse it to test other user agents. 556 * This is needed to implement future tests. 557 */ 558 bowser._detect = detect; 559 560 return bowser 561}); 562 563(function($){ 564 UABBTrigger = { 565 566 /** 567 * Trigger a hook. 568 * 569 * @since 1.1.0.3 570 * @method triggerHook 571 * @param {String} hook The hook to trigger. 572 * @param {Array} args An array of args to pass to the hook. 573 */ 574 triggerHook: function( hook, args ) 575 { 576 $( 'body' ).trigger( 'uabb-trigger.' + hook, args ); 577 }, 578 579 /** 580 * Add a hook. 581 * 582 * @since 1.1.0.3 583 * @method addHook 584 * @param {String} hook The hook to add. 585 * @param {Function} callback A function to call when the hook is triggered. 586 */ 587 addHook: function( hook, callback ) 588 { 589 $( 'body' ).on( 'uabb-trigger.' + hook, callback ); 590 }, 591 592 /** 593 * Remove a hook. 594 * 595 * @since 1.1.0.3 596 * @method removeHook 597 * @param {String} hook The hook to remove. 598 * @param {Function} callback The callback function to remove. 599 */ 600 removeHook: function( hook, callback ) 601 { 602 $( 'body' ).off( 'uabb-trigger.' + hook, callback ); 603 }, 604 }; 605})(jQuery); 606 607jQuery(document).ready(function( $ ) { 608 609 if( typeof bowser !== 'undefined' && bowser !== null ) { 610 611 var uabb_browser = bowser.name, 612 uabb_browser_v = bowser.version, 613 uabb_browser_class = uabb_browser.replace(/\s+/g, '-').toLowerCase(), 614 uabb_browser_v_class = uabb_browser_class + parseInt( uabb_browser_v ); 615 616 $('html').addClass(uabb_browser_class).addClass(uabb_browser_v_class); 617 618 } 619 620 $('.uabb-row-separator').parents('html').css('overflow-x', 'hidden'); 621}); 622var wpAjaxUrl = 'https://www.anera.org/wp-admin/admin-ajax.php';var flBuilderUrl = 'https://www.anera.org/wp-content/plugins/bb-plugin/';var FLBuilderLayoutConfig = { 623 anchorLinkAnimations : { 624 duration : 1000, 625 easing : 'swing', 626 offset : 100 627 }, 628 paths : { 629 pluginUrl : 'https://www.anera.org/wp-content/plugins/bb-plugin/', 630 wpAjaxUrl : 'https://www.anera.org/wp-admin/admin-ajax.php' 631 }, 632 breakpoints : { 633 small : 768, 634 medium : 992, 635 large : 1200 }, 636 waypoint: { 637 offset: 80 638 }, 639 emptyColWidth: '0%', 640 i18n : { 641 opensInNewTab : '(opens in new tab)' 642 } 643}; 644(function($){ 645 646 if(typeof FLBuilderLayout != 'undefined') { 647 return; 648 } 649 650 /** 651 * Helper class with generic logic for a builder layout. 652 * 653 * @class FLBuilderLayout 654 * @since 1.0 655 */ 656 FLBuilderLayout = { 657 658 /** 659 * Initializes a builder layout. 660 * 661 * @since 1.0 662 * @method init 663 */ 664 init: function() 665 { 666 // Destroy existing layout events. 667 FLBuilderLayout._destroy(); 668 669 // Init CSS classes. 670 FLBuilderLayout._initClasses(); 671 672 // Init backgrounds.
673 FLBuilderLayout._initBackgrounds(); 674 675 // Init buttons. 676 FLBuilderLayout._initButtons(); 677 678 // Init row shape layer height. 679 FLBuilderLayout._initRowShapeLayerHeight(); 680 681 // Init the new tab notice on links opening in a new tab. 682 FLBuilderLayout._initLinkNotices(); 683 684 // Only init if the builder isn't active. 685 if ( 0 === $('.fl-builder-edit').length ) { 686 687 // Init anchor links. 688 FLBuilderLayout._initAnchorLinks(); 689 690 // Init the browser hash. 691 FLBuilderLayout._initHash(); 692 693 // Init forms. 694 FLBuilderLayout._initForms(); 695 696 FLBuilderLayout._reorderMenu(); 697 } 698 else { 699 FLBuilderLayout._initNestedColsWidth(); 700 } 701 $('body').removeClass( 'fl-no-js' ); 702 }, 703 704 /** 705 * Public method for refreshing Wookmark or MosaicFlow galleries 706 * within an element. 707 * 708 * @since 1.7.4 709 * @method refreshGalleries 710 */ 711 refreshGalleries: function( element ) 712 { 713 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ), 714 mfContent = $element.find( '.fl-mosaicflow-content' ), 715 wmContent = $element.find( '.fl-gallery' ), 716 mfObject = null; 717 718 if ( mfContent ) { 719 720 mfObject = mfContent.data( 'mosaicflow' ); 721 722 if ( mfObject ) { 723 mfObject.columns = $( [] ); 724 mfObject.columnsHeights = []; 725 mfContent.data( 'mosaicflow', mfObject ); 726 mfContent.mosaicflow( 'refill' ); 727 } 728 } 729 if ( wmContent ) { 730 wmContent.trigger( 'refreshWookmark' ); 731 } 732 }, 733 734 /** 735 * Public method for refreshing Masonry within an element 736 * 737 * @since 1.8.1 738 * @method refreshGridLayout 739 */ 740 refreshGridLayout: function( element ) 741 { 742 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ), 743 msnryContent = $element.find('.masonry'); 744 745 if ( msnryContent.length ) { 746 msnryContent.masonry('layout'); 747 } 748 }, 749 750 /** 751 * Public method for reloading BxSlider within an element 752 * 753 * @since 1.8.1 754 * @method reloadSlider 755 */ 756 reloadSlider: function( content ) 757 { 758 var $content = 'undefined' == typeof content ? $('body') : $(content); 759 760 // reload sliders. 761 if ($content.find('.bx-viewport > div').length > 0) { 762 $.each($content.find('.bx-viewport > div'), function (key, slider) { 763 setTimeout(function () { 764 $(slider).data('bxSlider').reloadSlider(); 765 }, 100); 766 }); 767 } 768 }, 769 770 /** 771 * Public method for resizing WP audio player 772 * 773 * @since 1.8.2 774 * @method resizeAudio 775 */ 776 resizeAudio: function( element ) 777 { 778 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ), 779 audioPlayers = $element.find('.wp-audio-shortcode.mejs-audio'), 780 player = null, 781 mejsPlayer = null, 782 rail = null, 783 railWidth = 400; 784 785 if ( audioPlayers.length && typeof mejs !== 'undefined' ) { 786 audioPlayers.each(function(){ 787 player = $(this); 788 mejsPlayer = mejs.players[player.attr('id')]; 789 rail = player.find('.mejs-controls .mejs-time-rail'); 790 var innerMejs = player.find('.mejs-inner'), 791 total = player.find('.mejs-controls .mejs-time-total'); 792 793 if ( typeof mejsPlayer !== 'undefined' ) { 794 railWidth = Math.ceil(player.width() * 0.8); 795 796 if ( innerMejs.length ) { 797 798 rail.css('width', railWidth +'px!important'); 799 //total.width(rail.width() - 10); 800 801 mejsPlayer.options.autosizeProgress = true; 802 803 // webkit has trouble doing this without a delay 804 setTimeout(function () { 805 mejsPlayer.setControlsSize(); 806 }, 50); 807 808 player.find('.mejs-inner').css({ 809 visibility: 'visible', 810 height: 'inherit' 811 }); 812 } 813 } 814 }); 815 } 816 }, 817 818 /** 819 * Public method for preloading WP audio player when it's inside the hidden element 820 * 821 * @since 1.8.2 822 * @method preloadAudio 823 */ 824 preloadAudio: function(element) 825 { 826 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ), 827 contentWrap = $element.closest('.fl-accordion-item'), 828 audioPlayers = $element.find('.wp-audio-shortcode.mejs-audio'); 829 830 if ( ! contentWrap.hasClass('fl-accordion-item-active') && audioPlayers.find('.mejs-inner').length ) { 831 audioPlayers.find('.mejs-inner').css({ 832 visibility : 'hidden', 833 height: 0 834 }); 835 } 836 }, 837 838 /** 839 * Public method for resizing slideshow momdule within the tab 840 * 841 * @since 1.10.5 842 * @method resizeSlideshow 843 */ 844 resizeSlideshow: function(){ 845 if(typeof YUI !== 'undefined') { 846 YUI().use('node-event-simulate', function(Y) { 847 Y.one(window).simulate("resize"); 848 }); 849 } 850 }, 851 852 /** 853 * Public method for reloading an embedded Google Map within the tabs or hidden element. 854 * 855 * @since 2.2 856 * @method reloadGoogleMap 857 */ 858 reloadGoogleMap: function(element){ 859 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ),
860 googleMap = $element.find( 'iframe[src*="google.com/maps"]' ); 861 862 if ( googleMap.length ) { 863 googleMap.attr( 'src', function(i, val) { 864 return val; 865 }); 866 } 867 }, 868 869 /** 870 * Unbinds builder layout events. 871 * 872 * @since 1.0 873 * @access private 874 * @method _destroy 875 */ 876 _destroy: function() 877 { 878 var win = $(window); 879 880 win.off('scroll.fl-bg-parallax'); 881 win.off('resize.fl-bg-video'); 882 }, 883 884 /** 885 * Checks to see if the current device has touch enabled. 886 * 887 * @since 1.0 888 * @access private 889 * @method _isTouch 890 * @return {Boolean} 891 */ 892 _isTouch: function() 893 { 894 if(('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch)) { 895 return true; 896 } 897 898 return false; 899 }, 900 901 /** 902 * Checks to see if the current device is mobile. 903 * 904 * @since 1.7 905 * @access private 906 * @method _isMobile 907 * @return {Boolean} 908 */ 909 _isMobile: function() 910 { 911 return /Mobile|Android|Silk\/|Kindle|BlackBerry|Opera Mini|Opera Mobi|webOS/i.test( navigator.userAgent ); 912 }, 913 914 /** 915 * Initializes builder body classes. 916 * 917 * @since 1.0 918 * @access private 919 * @method _initClasses 920 */ 921 _initClasses: function() 922 { 923 var body = $( 'body' ), 924 ua = navigator.userAgent; 925 926 // Add the builder body class (skip on block-only frontend to avoid layout break). 927 if ( ! body.hasClass( 'fl-builder-blocks-only' ) && ! body.hasClass( 'archive' ) && $( '.fl-builder-content-primary' ).length > 0 ) { 928 body.addClass('fl-builder'); 929 } 930 931 // Add the builder touch body class. 932 if(FLBuilderLayout._isTouch()) { 933 body.addClass('fl-builder-touch'); 934 } 935 936 // Add the builder mobile body class. 937 if(FLBuilderLayout._isMobile()) { 938 body.addClass('fl-builder-mobile'); 939 } 940 941 if ( $(window).width() < FLBuilderLayoutConfig.breakpoints.small ) { 942 body.addClass( 'fl-builder-breakpoint-small' ); 943 } 944 945 if ( $(window).width() > FLBuilderLayoutConfig.breakpoints.small && $(window).width() < FLBuilderLayoutConfig.breakpoints.medium ) { 946 body.addClass( 'fl-builder-breakpoint-medium' ); 947 } 948 949 if ( $(window).width() > FLBuilderLayoutConfig.breakpoints.medium && $(window).width() < FLBuilderLayoutConfig.breakpoints.large ) { 950 body.addClass( 'fl-builder-breakpoint-large' ); 951 } 952 953 if ( $(window).width() > FLBuilderLayoutConfig.breakpoints.large ) { 954 body.addClass( 'fl-builder-breakpoint-default' ); 955 } 956 957 // IE11 body class. 958 if ( ua.indexOf( 'Trident/7.0' ) > -1 && ua.indexOf( 'rv:11.0' ) > -1 ) { 959 body.addClass( 'fl-builder-ie-11' ); 960 } 961 }, 962 963 /** 964 * Initializes builder node backgrounds that require 965 * additional JavaScript logic such as parallax. 966 * 967 * @since 1.1.4 968 * @access private
969 * @method _initBackgrounds 970 */ 971 _initBackgrounds: function() 972 { 973 var win = $(window); 974 975 // Init parallax backgrounds. 976 if($('.fl-row-bg-parallax').length > 0 && !FLBuilderLayout._isMobile()) { 977 FLBuilderLayout._scrollParallaxBackgrounds(); 978 FLBuilderLayout._initParallaxBackgrounds(); 979 win.on('resize.fl-bg-parallax', FLBuilderLayout._initParallaxBackgrounds); 980 win.on('scroll.fl-bg-parallax', FLBuilderLayout._scrollParallaxBackgrounds); 981 } 982 983 // Init video backgrounds. 984 if($('.fl-bg-video').length > 0) { 985 FLBuilderLayout._initBgVideos(); 986 FLBuilderLayout._resizeBgVideos(); 987 988 // Ensure FLBuilderLayout._resizeBgVideos() is only called once on window resize. 989 var resizeBGTimer = null; 990 win.on('resize.fl-bg-video', function(e){ 991 clearTimeout( resizeBGTimer ); 992 resizeBGTimer = setTimeout(function() { 993 FLBuilderLayout._resizeBgVideos(e); 994 }, 100 ); 995 }); 996 } 997 }, 998 999 /** 1000 * Initializes all buttons in a layout. 1001 * 1002 * @since 2.10 1003 * @access private 1004 * @method _initButtons 1005 */ 1006 _initButtons: function() 1007 { 1008 // Trigger click event on Enter or Space key press for deprecated button markup. 1009 $('a.fl-button[role="button"]').on('keydown', function(event) { 1010 if (event.key === 'Enter' || event.key === ' ') { 1011 // Necessary to prevent the default behavior of the space key from scrolling the page 1012 event.preventDefault(); 1013 $(this).trigger('click'); 1014 } 1015 }); 1016 }, 1017 1018 /** 1019 * Initializes all parallax backgrounds in a layout. 1020 * 1021 * @since 1.1.4 1022 * @access private 1023 * @method _initParallaxBackgrounds 1024 */ 1025 _initParallaxBackgrounds: function() 1026 { 1027 $('.fl-row-bg-parallax').each(FLBuilderLayout._initParallaxBackground); 1028 }, 1029 1030 /** 1031 * Initializes a single parallax background. 1032 * 1033 * @since 1.1.4 1034 * @access private 1035 * @method _initParallaxBackgrounds 1036 */ 1037 _initParallaxBackground: function() 1038 { 1039 var row = $(this), 1040 content = row.find('> .fl-row-content-wrap'), 1041 winWidth = $(window).width(), 1042 screenSize = '', 1043 imageSrc = { 1044 default: '', 1045 medium: '', 1046 responsive: '', 1047 }; 1048 1049 imageSrc.default = row.data('parallax-image') || ''; 1050 imageSrc.medium = row.data('parallax-image-medium') || imageSrc.default; 1051 imageSrc.responsive = row.data('parallax-image-responsive') || imageSrc.medium; 1052 1053 if (winWidth > FLBuilderLayoutConfig.breakpoints.medium) { 1054 screenSize = 'default'; 1055 } else if (winWidth > FLBuilderLayoutConfig.breakpoints.small && winWidth <= FLBuilderLayoutConfig.breakpoints.medium ) { 1056 screenSize = 'medium'; 1057 } else if (winWidth <= FLBuilderLayoutConfig.breakpoints.small) { 1058 screenSize = 'responsive'; 1059 } 1060 1061 content.css('background-image', 'url(' + imageSrc[screenSize] + ')'); 1062 row.data('current-image-loaded', screenSize ); 1063 1064 }, 1065 1066 /** 1067 * Fires when the window is scrolled to adjust 1068 * parallax backgrounds. 1069 * 1070 * @since 1.1.4 1071 * @access private 1072 * @method _scrollParallaxBackgrounds 1073 */ 1074 _scrollParallaxBackgrounds: function() 1075 { 1076 $('.fl-row-bg-parallax').each(FLBuilderLayout._scrollParallaxBackground); 1077 }, 1078 1079 /** 1080 * Fires when the window is scrolled to adjust 1081 * a single parallax background. 1082 * 1083 * @since 1.1.4 1084 * @access private 1085 * @method _scrollParallaxBackground 1086 */ 1087 _scrollParallaxBackground: function() 1088 { 1089 var win = $(window), 1090 row = $(this), 1091 content = row.find('> .fl-row-content-wrap'), 1092 speed = row.data('parallax-speed'), 1093 offset = content.offset(), 1094 yPos = -((win.scrollTop() - offset.top) / speed), 1095 initialOffset = ( row.data('parallax-offset') != null ) ? row.data('parallax-offset') : 0, 1096 totalOffset = yPos - initialOffset; 1097 1098 content.css('background-position', 'center ' + totalOffset + 'px'); 1099 }, 1100 1101 /** 1102 * Initializes all video backgrounds. 1103 * 1104 * @since 1.6.3.3 1105 * @access private 1106 * @method _initBgVideos 1107 */ 1108 _initBgVideos: function() 1109 { 1110 $('.fl-bg-video').each(FLBuilderLayout._initBgVideo); 1111 }, 1112 1113 /** 1114 * Initializes a video background. 1115 * 1116 * @since 1.6.3.3 1117 * @access private 1118 * @method _initBgVideo 1119 */ 1120 _initBgVideo: function() 1121 { 1122 var wrap = $( this ), 1123 width = wrap.data( 'width' ), 1124 height = wrap.data( 'height' ), 1125 mp4 = wrap.data( 'mp4' ), 1126 youtube = wrap.data( 'youtube'), 1127 vimeo = wrap.data( 'vimeo'), 1128 mp4Type = wrap.data( 'mp4-type' ), 1129 webm = wrap.data( 'webm' ), 1130 webmType = wrap.data( 'webm-type' ), 1131 fallback = wrap.data( 'fallback' ), 1132 loaded = wrap.data( 'loaded' ), 1133 videoMobile = wrap.data( 'video-mobile' ), 1134 playPauseButton = wrap.find('.fl-bg-video-play-pause-control'), 1135 fallbackTag = '', 1136 videoTag = null, 1137 mp4Tag = null, 1138 webmTag = null; 1139 1140 // Return if the video has been loaded for this row. 1141 if ( loaded ) { 1142 return; 1143 } 1144
1145 videoTag = $( '<video autoplay loop muted playsinline></video>' ); 1146 1147 /** 1148 * Add poster image (fallback image) 1149 */ 1150 if( 'undefined' != typeof fallback && '' != fallback ) { 1151 videoTag.attr( 'poster', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' ) 1152 videoTag.css({ 1153 backgroundImage: 'url("' + fallback + '")', 1154 backgroundColor: 'transparent', 1155 backgroundRepeat: 'no-repeat', 1156 backgroundSize: 'cover', 1157 backgroundPosition: 'center center', 1158 }) 1159 } 1160 1161 // MP4 Source Tag 1162 if ( 'undefined' != typeof mp4 && '' != mp4 ) { 1163 1164 mp4Tag = $( '<source />' ); 1165 mp4Tag.attr( 'src', mp4 ); 1166 mp4Tag.attr( 'type', mp4Type ); 1167 1168 videoTag.append( mp4Tag ); 1169 } 1170 // WebM Source Tag 1171 if ( 'undefined' != typeof webm && '' != webm ) { 1172 1173 webmTag = $( '<source />' ); 1174 webmTag.attr( 'src', webm ); 1175 webmTag.attr( 'type', webmType ); 1176 1177 videoTag.append( webmTag ); 1178 } 1179 1180 // This is either desktop, or mobile is enabled. 1181 if ( ! FLBuilderLayout._isMobile() || ( FLBuilderLayout._isMobile() && "yes" == videoMobile ) ) { 1182 if ( 'undefined' != typeof youtube ) { 1183 FLBuilderLayout._initYoutubeBgVideo.apply( this ); 1184 } 1185 else if ( 'undefined' != typeof vimeo ) { 1186 FLBuilderLayout._initVimeoBgVideo.apply( this ); 1187 } 1188 else { 1189 wrap.append( videoTag ); 1190 1191 if ( playPauseButton.length > 0 ) { 1192 var video = videoTag[0]; 1193 1194 playPauseButton.on( 'click', { video: video }, function(e) { 1195 var video = e.data.video; 1196 1197 if ( video.paused ) { 1198 video.play(); 1199 } else { 1200 video.pause(); 1201 } 1202 } ); 1203 1204 $( video ).on( 'play playing', function () { 1205 playPauseButton.removeClass( 'fa-play' ).addClass( 'fa-pause' ); 1206 } ); 1207 1208 $( video ).on( 'pause ended waiting', function () { 1209 playPauseButton.removeClass( 'fa-pause' ).addClass( 'fa-play' ); 1210 } ); 1211 } 1212 } 1213 } 1214 else { 1215 // if we are here, it means we are on mobile and NO is set so remove video src and use fallback 1216 videoTag.attr('src', '') 1217 wrap.append( videoTag ); 1218 } 1219 1220 // Mark this video as loaded. 1221 wrap.data('loaded', true); 1222 }, 1223 1224 /** 1225 * Initializes Youtube video background 1226 * 1227 * @since 1.9 1228 * @access private 1229 * @method _initYoutubeBgVideo 1230 */ 1231 _initYoutubeBgVideo: function() 1232 { 1233 var playerWrap = $(this), 1234 videoId = playerWrap.data('video-id'), 1235 videoPlayer = playerWrap.find('.fl-bg-video-player'), 1236 enableAudio = playerWrap.data('enable-audio'), 1237 audioButton = playerWrap.find('.fl-bg-video-audio'), 1238 playPauseButton = playerWrap.find('.fl-bg-video-play-pause-control'), 1239 startTime = 'undefined' !== typeof playerWrap.data('start') ? playerWrap.data('start') : 0, 1240 startTime = 'undefined' !== typeof playerWrap.data('t') && startTime === 0 ? playerWrap.data('t') : startTime, 1241 endTime = 'undefined' !== typeof playerWrap.data('end') ? playerWrap.data('end') : 0, 1242 loop = 'undefined' !== typeof playerWrap.data('loop') ? playerWrap.data('loop') : 1, 1243 stateCount = 0, 1244 player,fallback_showing; 1245 1246 if ( videoId ) { 1247 fallback = playerWrap.data('fallback') || false 1248 if( fallback ) { 1249 playerWrap.find('iframe').remove() 1250 fallbackTag = $( '<div></div>' ); 1251 fallbackTag.addClass( 'fl-bg-video-fallback' ); 1252 fallbackTag.css( 'background-image', 'url(' + playerWrap.data('fallback') + ')' ); 1253 fallbackTag.css( 'background-size', 'cover' ); 1254 fallbackTag.css( 'transition', 'background-image 1s') 1255 playerWrap.append( fallbackTag ); 1256 fallback_showing = true; 1257 } 1258 FLBuilderLayout._onYoutubeApiReady( function( YT ) { 1259 setTimeout( function() { 1260 1261 player = new YT.Player( videoPlayer[0], { 1262 videoId: videoId, 1263 events: { 1264 onReady: function(event) { 1265 if ( "no" === enableAudio || FLBuilderLayout._isMobile() ) { 1266 event.target.mute(); 1267 } 1268 else if ( "yes" === enableAudio && event.target.isMuted ) { 1269 event.target.unMute(); 1270 } 1271 1272 // Store an instance to a parent 1273 playerWrap.data('YTPlayer', player); 1274 FLBuilderLayout._resizeYoutubeBgVideo.apply(playerWrap); 1275 1276 // Queue the video. 1277 event.target.playVideo(); 1278 1279 if ( audioButton.length > 0 && ! FLBuilderLayout._isMobile() ) {
1280 audioButton.on( 'click', {button: audioButton, player: player}, FLBuilderLayout._toggleBgVideoAudio ); 1281 } 1282 1283 if ( playPauseButton.length > 0 ) { 1284 playPauseButton.on( 'click', {player: player}, function(e) { 1285 var player = e.data.player; 1286 1287 if ( 1 === player.getPlayerState() ) { 1288 player.pauseVideo(); 1289 } else { 1290 player.playVideo(); 1291 } 1292 }); 1293 } 1294 }, 1295 onStateChange: function( event ) { 1296 1297 if ( event.data === 1 ) { 1298 if ( fallback_showing ) { 1299 $( '.fl-bg-video-fallback' ).css( 'background-image', 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)' ) 1300 } 1301 } 1302 // Manual check if video is not playable in some browsers. 1303 // StateChange order: [-1, 3, -1] 1304 if ( stateCount < 4 ) { 1305 stateCount++; 1306 } 1307 1308 // Comply with the audio policy in some browsers like Chrome and Safari. 1309 if ( stateCount > 1 && -1 === event.data && "yes" === enableAudio ) { 1310 player.mute(); 1311 player.playVideo(); 1312 audioButton.show(); 1313 } 1314 1315 if ( event.data === YT.PlayerState.ENDED && 1 === loop ) { 1316 if ( startTime > 0 ) { 1317 player.seekTo( startTime ); 1318 } 1319 else { 1320 player.playVideo(); 1321 } 1322 } 1323 1324 if ( event.data === YT.PlayerState.PLAYING ) { 1325 playPauseButton.removeClass( 'fa-play' ).addClass( 'fa-pause' ); 1326 } else if ( event.data === YT.PlayerState.PAUSED ) { 1327 playPauseButton.removeClass( 'fa-pause' ).addClass( 'fa-play' ); 1328 } else if ( event.data === YT.PlayerState.BUFFERING ) { 1329 playPauseButton.removeClass( 'fa-play' ).addClass( 'fa-pause' ); 1330 } else if ( event.data === YT.PlayerState.CUED ) { 1331 playPauseButton.removeClass( 'fa-pause' ).addClass( 'fa-play' ); 1332 } else if ( event.data === YT.PlayerState.ENDED ) { 1333 playPauseButton.removeClass( 'fa-pause' ).addClass( 'fa-play' ); 1334 } 1335 }, 1336 onError: function(event) { 1337 console.info('YT Error: ' + event.data) 1338 FLBuilderLayout._onErrorYoutubeVimeo(playerWrap) 1339 } 1340 }, 1341 playerVars: { 1342 playsinline: FLBuilderLayout._isMobile() ? 1 : 0, 1343 controls: 0, 1344 showinfo: 0, 1345 rel : 0, 1346 start: startTime, 1347 end: endTime, 1348 } 1349 } ); 1350 }, 1 ); 1351 } ); 1352 } 1353 }, 1354 1355 /** 1356 * On youtube or vimeo error show the fallback image if available. 1357 * @since 2.0.7 1358 */ 1359 _onErrorYoutubeVimeo: function(playerWrap) { 1360 1361 fallback = playerWrap.data('fallback') || false 1362 if( ! fallback ) { 1363 return false; 1364 } 1365 playerWrap.find('iframe').remove() 1366 fallbackTag = $( '<div></div>' ); 1367 fallbackTag.addClass( 'fl-bg-video-fallback' ); 1368 fallbackTag.css( 'background-image', 'url(' + playerWrap.data('fallback') + ')' ); 1369 playerWrap.append( fallbackTag ); 1370 }, 1371 1372 /** 1373 * Check if Youtube API has been downloaded 1374 * 1375 * @since 1.9 1376 * @access private 1377 * @method _onYoutubeApiReady 1378 * @param {Function} callback Method to call when YT API has been loaded 1379 */ 1380 _onYoutubeApiReady: function( callback ) { 1381 if ( window.YT && YT.loaded ) { 1382 callback( YT ); 1383 } else { 1384 // If not ready check again by timeout.. 1385 setTimeout( function() { 1386 FLBuilderLayout._onYoutubeApiReady( callback ); 1387 }, 350 ); 1388 } 1389 }, 1390 1391 /** 1392 * Initializes Vimeo video background 1393 * 1394 * @since 1.9 1395 * @access private 1396 * @method _initVimeoBgVideo 1397 */ 1398 _initVimeoBgVideo: function() 1399 { 1400 var playerWrap = $(this), 1401 videoId = playerWrap.data('video-id'), 1402 videoHash = playerWrap.data('video-hash'), 1403 videoPlayer = playerWrap.find('.fl-bg-video-player'), 1404 enableAudio = playerWrap.data('enable-audio'), 1405 audioButton = playerWrap.find('.fl-bg-video-audio'), 1406 playPauseButton = playerWrap.find('.fl-bg-video-play-pause-control'), 1407 playerState = '', 1408 player, 1409 width = playerWrap.outerWidth(), 1410 ua = navigator.userAgent; 1411 1412 if ( typeof Vimeo !== 'undefined' && videoId ) { 1413 1414 const vimOptions = { 1415 loop : true, 1416 title : false, 1417 portrait : false, 1418 background : true, 1419 autopause : false, 1420 muted : true, 1421 }; 1422 1423 if ( videoHash.length ) { 1424 vimOptions.url = `https://player.vimeo.com/video/${ videoId }?h=${ videoHash }`; 1425 } else { 1426 vimOptions.id = videoId; 1427 } 1428 1429 player = new Vimeo.Player(videoPlayer[0], vimOptions ); 1430 playerWrap.data('VMPlayer', player); 1431 if ( "no" === enableAudio ) { 1432 player.setVolume(0); 1433 } 1434 else if ("yes" === enableAudio ) { 1435 // Chrome, Safari, Firefox have audio policy restrictions for autoplay videos. 1436 if ( ua.indexOf("Safari") > -1 || ua.indexOf("Chrome") > -1 || ua.indexOf("Firefox") > -1 ) { 1437 player.setVolume(0); 1438 audioButton.show(); 1439 } 1440 else { 1441 player.setVolume(1); 1442 } 1443 } 1444 1445 player.play().catch(function(error) { 1446 FLBuilderLayout._onErrorYoutubeVimeo(playerWrap) 1447 }); 1448 1449 if ( audioButton.length > 0 ) {
1450 audioButton.on( 'click', {button: audioButton, player: player}, FLBuilderLayout._toggleBgVideoAudio ); 1451 } 1452 1453 player.on( 'play', function() { 1454 playerState = 'play'; 1455 playPauseButton.removeClass( 'fa-play' ).addClass( 'fa-pause' ); 1456 } ); 1457 player.on( 'pause', function() { 1458 playerState = 'pause'; 1459 playPauseButton.removeClass( 'fa-pause' ).addClass( 'fa-play' ); 1460 } ); 1461 player.on( 'ended', function() { 1462 playerState = 'ended'; 1463 playPauseButton.removeClass( 'fa-pause' ).addClass( 'fa-play' ); 1464 } ); 1465 player.on( 'bufferstart', function() { 1466 playerState = 'bufferstart'; 1467 playPauseButton.removeClass( 'fa-play' ).addClass( 'fa-pause' ); 1468 } ); 1469 1470 if ( playPauseButton.length > 0 ) { 1471 playPauseButton.on( 'click', { player: player }, function( e ) { 1472 var player = e.data.player; 1473 1474 if ( playerState === 'play' ) { 1475 player.pause(); 1476 } else { 1477 player.play(); 1478 } 1479 } ); 1480 } 1481 } 1482 }, 1483 1484 /** 1485 * Mute / unmute audio on row's video background. 1486 * It works for both Youtube and Vimeo. 1487 * 1488 * @since 2.1.3 1489 * @access private 1490 * @method _toggleBgVideoAudio 1491 * @param {Object} e Method arguments 1492 */ 1493 _toggleBgVideoAudio: function( e ) { 1494 var player = e.data.player, 1495 control = e.data.button.find('.fl-audio-control'); 1496 1497 if ( control.hasClass( 'fa-volume-off' ) ) { 1498 // Unmute 1499 control 1500 .removeClass( 'fa-volume-off' ) 1501 .addClass( 'fa-volume-up' ); 1502 e.data.button.find( '.fa-times' ).hide(); 1503 1504 if ( 'function' === typeof player.unMute ) { 1505 player.unMute(); 1506 } 1507 else { 1508 player.setVolume( 1 ); 1509 } 1510 } 1511 else { 1512 // Mute 1513 control 1514 .removeClass( 'fa-volume-up' ) 1515 .addClass( 'fa-volume-off' ); 1516 e.data.button.find( '.fa-times' ).show(); 1517 1518 if ( 'function' === typeof player.unMute ) { 1519 player.mute(); 1520 } 1521 else { 1522 player.setVolume( 0 ); 1523 } 1524 } 1525 }, 1526 1527 /** 1528 * Fires when there is an error loading a video 1529 * background source and shows the fallback. 1530 * 1531 * @since 1.6.3.3 1532 * @access private 1533 * @method _videoBgSourceError 1534 * @param {Object} e An event object 1535 * @deprecated 2.0.3 1536 */ 1537 _videoBgSourceError: function( e ) 1538 { 1539 var source = $( e.target ), 1540 wrap = source.closest( '.fl-bg-video' ), 1541 vid = wrap.find( 'video' ), 1542 fallback = wrap.data( 'fallback' ), 1543 fallbackTag = ''; 1544 source.remove(); 1545 1546 if ( vid.find( 'source' ).length ) { 1547 // Don't show the fallback if we still have other sources to check. 1548 return; 1549 } else if ( '' !== fallback ) { 1550 fallbackTag = $( '<div></div>' ); 1551 fallbackTag.addClass( 'fl-bg-video-fallback' ); 1552 fallbackTag.css( 'background-image', 'url(' + fallback + ')' ); 1553 wrap.append( fallbackTag ); 1554 vid.remove(); 1555 } 1556 }, 1557 1558 /** 1559 * Fires when the window is resized to resize 1560 * all video backgrounds. 1561 * 1562 * @since 1.1.4 1563 * @access private 1564 * @method _resizeBgVideos 1565 */ 1566 _resizeBgVideos: function() 1567 { 1568 $('.fl-bg-video').each( function() { 1569 1570 FLBuilderLayout._resizeBgVideo.apply( this ); 1571 1572 if ( $( this ).parent().find( 'img' ).length > 0 ) { 1573 $( this ).parent().imagesLoaded( $.proxy( FLBuilderLayout._resizeBgVideo, this ) ); 1574 } 1575 } ); 1576 }, 1577 1578 /** 1579 * Fires when the window is resized to resize 1580 * a single video background. 1581 * 1582 * @since 1.1.4 1583 * @access private 1584 * @method _resizeBgVideo 1585 */ 1586 _resizeBgVideo: function() 1587 { 1588 if ( 0 === $( this ).find( 'video' ).length && 0 === $( this ).find( 'iframe' ).length ) { 1589 return; 1590 } 1591 1592 var wrap = $(this), 1593 wrapHeight = wrap.outerHeight(), 1594 wrapWidth = wrap.outerWidth(), 1595 vid = wrap.find('video'), 1596 vidHeight = wrap.data('height'), 1597 vidWidth = wrap.data('width'), 1598 newWidth = wrapWidth, 1599 newHeight = Math.round(vidHeight * wrapWidth/vidWidth), 1600 newLeft = 0, 1601 newTop = 0, 1602 iframe = wrap.find('iframe'), 1603 isRowFullHeight = $(this).closest('.fl-row-bg-video').hasClass('fl-row-full-height'), 1604 vidCSS = { 1605 top: '50%', 1606 left: '50%', 1607 transform: 'translate(-50%,-50%)', 1608 }; 1609 1610 if ( vid.length ) { 1611 if(vidHeight === '' || typeof vidHeight === 'undefined' || vidWidth === '' || typeof vidWidth === 'undefined') { 1612 vid.css({ 1613 'left' : '0px', 1614 'top' : '0px', 1615 'width' : newWidth + 'px' 1616 }); 1617 1618 // Try to set the actual video dimension on 'loadedmetadata' when using URL as video source 1619 vid.on('loadedmetadata', FLBuilderLayout._resizeOnLoadedMeta); 1620 1621 return; 1622 } 1623 1624 if ( ! isRowFullHeight ) { 1625 if ( newHeight < wrapHeight ) { 1626 newHeight = wrapHeight; 1627 newWidth = vidHeight ? Math.round(vidWidth * wrapHeight/vidHeight) : newWidth; 1628 newLeft = -((newWidth - wrapWidth) / 2); 1629 } 1630 else { 1631 newTop = -((newHeight - wrapHeight)/2); 1632 } 1633 vidCSS = { 1634 left : newLeft + 'px', 1635 top : newTop + 'px', 1636 height : newHeight + 'px', 1637 width : newWidth + 'px', 1638 } 1639 } 1640 1641 vid.css( vidCSS ); 1642 1643 } 1644 else if ( iframe.length ) { 1645 1646 // Resize Youtube video player within iframe tag 1647 if ( typeof wrap.data('youtube') !== 'undefined' ) { 1648 FLBuilderLayout._resizeYoutubeBgVideo.apply(this); 1649 } 1650 } 1651 }, 1652 1653 /** 1654 * Fires when video meta has been loaded. 1655 * This will be Triggered when width/height attributes were not specified during video background resizing. 1656 * 1657 * @since 1.8.5 1658 * @access private 1659 * @method _resizeOnLoadedMeta 1660 */ 1661 _resizeOnLoadedMeta: function(){ 1662 var video = $(this), 1663 wrapHeight = video.parent().outerHeight(), 1664 wrapWidth = video.parent().outerWidth(), 1665 vidWidth = video[0].videoWidth, 1666 vidHeight = video[0].videoHeight, 1667 newHeight = Math.round(vidHeight * wrapWidth/vidWidth), 1668 newWidth = wrapWidth, 1669 newLeft = 0, 1670 newTop = 0; 1671 1672 if(newHeight < wrapHeight) { 1673 newHeight = wrapHeight; 1674 newWidth = Math.round(vidWidth * wrapHeight/vidHeight); 1675 newLeft = -((newWidth - wrapWidth)/2); 1676 } 1677 else { 1678 newTop = -((newHeight - wrapHeight)/2); 1679 } 1680 1681 video.parent().data('width', vidWidth); 1682 video.parent().data('height', vidHeight); 1683 1684 video.css({ 1685 'left' : newLeft + 'px', 1686 'top' : newTop + 'px', 1687 'width' : newWidth + 'px', 1688 'height' : newHeight + 'px' 1689 }); 1690 }, 1691 1692 /** 1693 * Fires when the window is resized to resize 1694 * a single Youtube video background. 1695 * 1696 * @since 1.9 1697 * @access private 1698 * @method _resizeYoutubeBgVideo 1699 */ 1700 _resizeYoutubeBgVideo: function() 1701 { 1702 var wrap = $(this), 1703 wrapWidth = wrap.outerWidth(), 1704 wrapHeight = wrap.outerHeight(), 1705 player = wrap.data('YTPlayer'), 1706 video = player ? player.getIframe() : null, 1707 aspectRatioSetting = '16:9', // Medium 1708 aspectRatioArray = aspectRatioSetting.split( ':' ),
1709 aspectRatio = aspectRatioArray[0] / aspectRatioArray[1], 1710 ratioWidth = wrapWidth / aspectRatio, 1711 ratioHeight = wrapHeight * aspectRatio, 1712 isWidthFixed = wrapWidth / wrapHeight > aspectRatio, 1713 width = isWidthFixed ? wrapWidth : ratioHeight, 1714 height = isWidthFixed ? ratioWidth : wrapHeight; 1715 1716 if ( video ) { 1717 $(video).width( width ).height( height ); 1718 } 1719 }, 1720 1721 /** 1722 * Opens a tab or accordion item if the browser hash is set 1723 * to the ID of one on the page. 1724 * 1725 * @since 1.6.0 1726 * @access private 1727 * @method _initHash 1728 */ 1729 _initHash: function() 1730 { 1731 var hash = window.location.hash.replace( '#', '' ).split( '/' ).shift(), 1732 element = null, 1733 tabs = null, 1734 responsiveLabel = null, 1735 tabIndex = null, 1736 label = null; 1737 1738 if ( '' !== hash ) { 1739 1740 try { 1741 1742 element = $( '#' + hash ); 1743 1744 if ( element.length > 0 ) { 1745 1746 if ( element.hasClass( 'fl-accordion-item' ) ) { 1747 setTimeout( function() { 1748 element.find( '.fl-accordion-button' ).trigger( 'click' ); 1749 }, 100 ); 1750 } 1751 if ( element.hasClass( 'fl-tabs-panel' ) ) { 1752 setTimeout( function() { 1753 tabs = element.closest( '.fl-tabs' ); 1754 responsiveLabel = element.find( '.fl-tabs-panel-label' ); 1755 tabIndex = responsiveLabel.data( 'index' ); 1756 label = tabs.find( '.fl-tabs-labels .fl-tabs-label[data-index=' + tabIndex + ']' ); 1757 1758 label[0].click(); 1759 FLBuilderLayout._scrollToElement(element); 1760 }, 100 ); 1761 } 1762 } 1763 } 1764 catch( e ) {} 1765 } 1766 }, 1767 1768 /** 1769 * Adds a visually-hidden "(opens in new tab)" notice to links 1770 * inside a builder layout that target a new tab, and removes it 1771 * from ones that don't. Runs on the live DOM only, across every 1772 * module, so the notice is never part of any saved content. Covers 1773 * both real anchors (`target` attribute) and non-anchor elements 1774 * like the Box module's `role="link"` div, which carries the same 1775 * intent via a `data-link-target` attribute instead. 1776 * 1777 * @since 2.12 1778 * @access private 1779 * @method _initLinkNotices 1780 */ 1781 _initLinkNotices: function() 1782 { 1783 $( '.fl-builder-content a[target], .fl-builder-content [role="link"][data-link-target]' ).each( function() { 1784 var link = $( this ), 1785 notice = link.children( 'span.fl-new-tab-notice' ), 1786 target = link.attr( 'target' ) || link.attr( 'data-link-target' ); 1787 1788 if ( '_blank' === target ) { 1789 if ( 0 === notice.length ) { 1790 link.append( '<span class="fl-new-tab-notice sr-only">' + FLBuilderLayoutConfig.i18n.opensInNewTab + '</span>' ); 1791 } 1792 } else if ( notice.length > 0 ) { 1793 notice.remove(); 1794 } 1795 }); 1796 }, 1797 1798 /** 1799 * Initializes all anchor links on the page for smooth scrolling. 1800 * 1801 * @since 1.4.9 1802 * @access private 1803 * @method _initAnchorLinks 1804 */ 1805 _initAnchorLinks: function() 1806 { 1807 $( 'a, [role="link"]' ).each( FLBuilderLayout._initAnchorLink ); 1808 }, 1809 1810 /** 1811 * Initializes a single anchor link for smooth scrolling. 1812 * 1813 * @since 1.4.9 1814 * @access private 1815 * @method _initAnchorLink 1816 */ 1817 _initAnchorLink: function() 1818 { 1819 var link = $( this ), 1820 href = link.data( 'url' ) ? link.data( 'url' ) : link.attr( 'href' ), 1821 target = link.data( 'url' ) ? new URL( href, window.location.href ) : this, 1822 loc = window.location, 1823 id = null, 1824 element = null, 1825 flNode = false; 1826 1827 if ( 'undefined' != typeof href && href.indexOf( '#' ) > -1 && link.closest('svg').length < 1 ) { 1828 1829 if ( loc.pathname.replace( /^\//, '' ) == target.pathname.replace( /^\//, '' ) && loc.hostname == target.hostname ) { 1830 1831 try { 1832 1833 id = href.split( '#' ).pop(); 1834 // If there is no ID then we have nowhere to look 1835 // Fixes a quirk in jQuery and FireFox 1836 if( ! id ) { 1837 return; 1838 } 1839 element = $( '#' + id ); 1840 1841 if ( element.length > 0 ) { 1842 flNode = element.hasClass( 'fl-row' ) || element.hasClass( 'fl-col' ) || element.hasClass( 'fl-module' ); 1843 if ( !element.hasClass( 'fl-no-scroll' ) && ( link.hasClass( 'fl-scroll-link' ) || flNode ) ) { 1844 $( link ).on( 'click', FLBuilderLayout._scrollToElementOnLinkClick ); 1845 } 1846 if ( element.hasClass( 'fl-accordion-item' ) ) { 1847 $( link ).on( 'click', FLBuilderLayout._scrollToAccordionOnLinkClick ); 1848 } 1849 if ( element.hasClass( 'fl-tabs-panel' ) ) { 1850 $( link ).on( 'click', FLBuilderLayout._scrollToTabOnLinkClick ); 1851 } 1852 } 1853 } 1854 catch( e ) {} 1855 } 1856 } 1857 }, 1858 1859 /** 1860 * Scrolls to an element when an anchor link is clicked. 1861 * 1862 * @since 1.4.9 1863 * @access private 1864 * @method _scrollToElementOnLinkClick 1865 * @param {Object} e An event object. 1866 * @param {Function} callback A function to call when the scroll is complete. 1867 */ 1868 _scrollToElementOnLinkClick: function( e, callback ) 1869 { 1870 var attribute = $( this ).data( 'url' ) ? $( this ).data( 'url' ) : $( this ).attr( 'href' ); 1871 var element = $( '#' + attribute.split( '#' ).pop() ); 1872 1873 FLBuilderLayout._scrollToElement( element, callback ); 1874 1875 e.preventDefault(); 1876 }, 1877 1878 /** 1879 * Scrolls to an element. 1880 * 1881 * @since 1.6.4.5 1882 * @access private 1883 * @method _scrollToElement 1884 * @param {Object} element The element to scroll to. 1885 * @param {Function} callback A function to call when the scroll is complete. 1886 */ 1887 _scrollToElement: function( element, callback ) 1888 { 1889 var config = FLBuilderLayoutConfig.anchorLinkAnimations, 1890 dest = 0, 1891 win = $( window ), 1892 doc = $( document ); 1893 1894 if ( element.length > 0 ) { 1895 1896 if ( 'fixed' === element.css('position') || 'fixed' === element.parent().css('position') ) { 1897 dest = element.position().top; 1898 } 1899 else if ( element.offset().top > doc.height() - win.height() ) { 1900 dest = doc.height() - win.height(); 1901 } 1902 else { 1903 dest = element.offset().top - config.offset; 1904 } 1905 1906 $( 'html, body' ).stop( true ).animate( { scrollTop: dest }, config.duration, config.easing, function() { 1907 1908 if ( 'undefined' != typeof callback ) { 1909 callback(); 1910 } 1911 1912 if ( undefined != element.attr( 'id' ) && window.location.hash !== '#' + element.attr( 'id' ) ) { 1913 1914 var firefox_version = window.navigator.userAgent.match( /Firefox\/(\d+)\./ ), 1915 firefox_version = firefox_version ? parseInt( firefox_version[1], 10 ) : null; 1916 1917 if ( firefox_version !== null && firefox_version < 135 ) { 1918 window.location.hash = element.attr( 'id' ); 1919 } else { 1920 if ( history.pushState ) { 1921 history.pushState( null, null, '#' + element.attr( 'id' ) ); 1922 } else { 1923 window.location.hash = element.attr( 'id' ); 1924 } 1925 } 1926 } 1927 } ); 1928 } 1929 }, 1930 1931 /** 1932 * Scrolls to an accordion item when a link is clicked. 1933 * 1934 * @since 1.5.9 1935 * @access private 1936 * @method _scrollToAccordionOnLinkClick 1937 * @param {Object} e An event object. 1938 */ 1939 _scrollToAccordionOnLinkClick: function( e ) 1940 { 1941 var element = $( '#' + $( this ).attr( 'href' ).split( '#' ).pop() ); 1942 1943 if ( element.length > 0 ) { 1944 1945 var callback = function() { 1946 if ( element ) { 1947 element.find( '.fl-accordion-button' ).trigger( 'click' ); 1948 element = false;
1949 } 1950 }; 1951 1952 FLBuilderLayout._scrollToElementOnLinkClick.call( this, e, callback ); 1953 } 1954 }, 1955 1956 /** 1957 * Scrolls to a tab panel when a link is clicked. 1958 * 1959 * @since 1.5.9 1960 * @access private 1961 * @method _scrollToTabOnLinkClick 1962 * @param {Object} e An event object. 1963 */ 1964 _scrollToTabOnLinkClick: function( e ) 1965 { 1966 var element = $( '#' + $( this ).attr( 'href' ).split( '#' ).pop() ), 1967 tabs = null, 1968 label = null, 1969 responsiveLabel = null; 1970 1971 if ( element.length > 0 ) { 1972 1973 tabs = element.closest( '.fl-tabs' ); 1974 responsiveLabel = element.find( '.fl-tabs-panel-label' ); 1975 tabIndex = responsiveLabel.data( 'index' ); 1976 label = tabs.find( '.fl-tabs-labels .fl-tabs-label[data-index=' + tabIndex + ']' ); 1977 1978 if ( responsiveLabel.is( ':visible' ) ) { 1979 1980 var callback = function() { 1981 if ( element ) { 1982 responsiveLabel.trigger( $.Event( 'click', { which: 1 } ) ); 1983 } 1984 }; 1985 1986 FLBuilderLayout._scrollToElementOnLinkClick.call( this, e, callback ); 1987 } 1988 else { 1989 label[0].click(); 1990 FLBuilderLayout._scrollToElement( element ); 1991 } 1992 1993 e.preventDefault(); 1994 } 1995 }, 1996 1997 /** 1998 * Initializes all builder forms on a page. 1999 * 2000 * @since 1.5.4 2001 * @access private 2002 * @method _initForms 2003 */ 2004 _initForms: function() 2005 { 2006 if ( ! FLBuilderLayout._hasPlaceholderSupport ) { 2007 $( '.fl-form-field input' ).each( FLBuilderLayout._initFormFieldPlaceholderFallback ); 2008 } 2009 2010 $( '.fl-form-field input' ).on( 'focus', FLBuilderLayout._clearFormFieldError ); 2011 }, 2012 2013 /** 2014 * Checks to see if the current device has HTML5 2015 * placeholder support. 2016 * 2017 * @since 1.5.4 2018 * @access private 2019 * @method _hasPlaceholderSupport 2020 * @return {Boolean} 2021 */ 2022 _hasPlaceholderSupport: function() 2023 { 2024 var input = document.createElement( 'input' ); 2025 2026 return 'undefined' != input.placeholder; 2027 }, 2028 2029 /** 2030 * Initializes the fallback for when placeholders aren't supported. 2031 * 2032 * @since 1.5.4 2033 * @access private 2034 * @method _initFormFieldPlaceholderFallback 2035 */ 2036 _initFormFieldPlaceholderFallback: function() 2037 { 2038 var field = $( this ), 2039 val = field.val(), 2040 placeholder = field.attr( 'placeholder' ); 2041 2042 if ( 'undefined' != placeholder && '' === val ) { 2043 field.val( placeholder ); 2044 field.on( 'focus', FLBuilderLayout._hideFormFieldPlaceholderFallback ); 2045 field.on( 'blur', FLBuilderLayout._showFormFieldPlaceholderFallback ); 2046 } 2047 }, 2048 2049 /** 2050 * Hides a fallback placeholder on focus. 2051 * 2052 * @since 1.5.4 2053 * @access private 2054 * @method _hideFormFieldPlaceholderFallback 2055 */ 2056 _hideFormFieldPlaceholderFallback: function() 2057 { 2058 var field = $( this ), 2059 val = field.val(), 2060 placeholder = field.attr( 'placeholder' ); 2061 2062 if ( val == placeholder ) { 2063 field.val( '' ); 2064 } 2065 }, 2066 2067 /** 2068 * Shows a fallback placeholder on blur. 2069 * 2070 * @since 1.5.4 2071 * @access private 2072 * @method _showFormFieldPlaceholderFallback 2073 */ 2074 _showFormFieldPlaceholderFallback: function() 2075 { 2076 var field = $( this ), 2077 val = field.val(), 2078 placeholder = field.attr( 'placeholder' ); 2079 2080 if ( '' === val ) { 2081 field.val( placeholder ); 2082 } 2083 }, 2084 2085 /** 2086 * Clears a form field error message. 2087 * 2088 * @since 1.5.4 2089 * @access private 2090 * @method _clearFormFieldError 2091 */ 2092 _clearFormFieldError: function() 2093 { 2094 var field = $( this ); 2095 2096 field.removeAttr( 'aria-invalid' ); 2097 field.removeClass( 'fl-form-error' ); 2098 const message = field.attr('aria-describedby'); 2099 message ? $( '#' + message ).hide() : field.siblings( '.fl-form-error-message' ).hide(); 2100 }, 2101 2102 /** 2103 * Init Row Shape Layer's height. 2104 * 2105 * @since 2.5.3 2106 * @access private 2107 * @method _initRowShapeLayerHeight 2108 */ 2109 _initRowShapeLayerHeight: function () { 2110 FLBuilderLayout._adjustRowShapeLayerHeight(); 2111 $( window ).on( 'resize', FLBuilderLayout._adjustRowShapeLayerHeight ); 2112 }, 2113 2114 /** 2115 * Set parent column width of nested columns when it's zero or blank. 2116 * 2117 * @since 2.7.4 2118 * @access private 2119 * @method _initNestedColsWidth 2120 */ 2121 _initNestedColsWidth: function() 2122 { 2123 var nestedCols = $( '.fl-col-has-cols' ); 2124 2125 if ( nestedCols.length <= 0 ) { 2126 return; 2127 } 2128 2129 $( nestedCols ).each( function(index, col ){ 2130 if ( $( col ).width() <= 0 ) { 2131 $( col ).css( 'width', FLBuilderLayoutConfig.emptyColWidth ); 2132 } 2133 }); 2134 }, 2135 2136 /** 2137 * Adjust Row Shape Layer's height to fix to remove the fine line that appears on certain screen sizes. 2138 * 2139 * @since 2.5.3 2140 * @access private 2141 * @method _adjustRowShapeLayerHeight 2142 */
2143 _adjustRowShapeLayerHeight: function() { 2144 var rowShapeLayers = $('.fl-builder-shape-layer'); 2145 2146 $( rowShapeLayers ).each(function (index) { 2147 var rowShapeLayer = $(this), 2148 shape = $(rowShapeLayer).find('svg'), 2149 height = shape.height(), 2150 excludeShapes = '.fl-builder-shape-circle, .fl-builder-shape-dot-cluster, .fl-builder-shape-topography, .fl-builder-shape-rect'; 2151 2152 if ( ! rowShapeLayer.is( excludeShapes ) ) { 2153 $(shape).css('height', Math.ceil( height ) ); 2154 } 2155 }); 2156 }, 2157 _string_to_slug: function( str ) { 2158 str = str.replace(/^\s+|\s+$/g, ''); // trim 2159 if ( 'undefined' == typeof window._fl_string_to_slug_regex ) { 2160 regex = new RegExp('[^a-zA-Z0-9\'":() !.,-_|]', 'g'); 2161 } else { 2162 regex = new RegExp('[^' + window._fl_string_to_slug_regex + '\'":\(\) !.,-_|\\\p{Letter}]', 'ug'); 2163 } 2164 str = str.replace(regex, '') // remove invalid chars 2165 .replace(/\s+/g, ' '); // collapse whitespace and replace by a space 2166 return str; 2167 }, 2168 _reorderMenu: function() { 2169 if ( $('#wp-admin-bar-fl-builder-frontend-edit-link-default li').length > 1 ) { 2170 $( '#wp-admin-bar-fl-builder-frontend-duplicate-link' ) 2171 .appendTo('#wp-admin-bar-fl-builder-frontend-edit-link-default') 2172 .css( 'padding-top', '5px' ) 2173 .css( 'border-top', '2px solid #1D2125' ) 2174 .css( 'margin-top', '5px' ) 2175 } 2176 } 2177 }; 2178 2179 /* Initializes the builder layout. */ 2180 $(function(){ 2181 FLBuilderLayout.init(); 2182 }); 2183 2184})(jQuery); 2185(function($){ 2186 2187 if(typeof FLBuilderLayoutModules !== 'undefined') { 2188 return; 2189 } 2190 2191 /** 2192 * Helper class with generic logic for builder modules. 2193 * If generic module code needs to work in both the block 2194 * editor and builder, it should go here. Otherwise, it 2195 * should go on FLBuilderLayout. 2196 * 2197 * @since 2.9 2198 */ 2199 FLBuilderLayoutModules = { 2200 2201 /** 2202 * Initializes builder module logic. 2203 * 2204 * @since 2.9 2205 * @method init 2206 */ 2207 init: function() 2208 { 2209 // Only init if the builder isn't active. 2210 if ( 0 === $('.fl-builder-edit').length ) { 2211 2212 // Init module animations. 2213 FLBuilderLayoutModules._initModuleAnimations(); 2214 } 2215 }, 2216 2217 /** 2218 * Initializes module animations. 2219 * 2220 * @since 1.1.9 2221 * @access private 2222 * @method _initModuleAnimations 2223 */ 2224 _initModuleAnimations: function() 2225 { 2226 if(typeof jQuery.fn.waypoint !== 'undefined') { 2227 $('.fl-animation').each( function() { 2228 var node = $( this ), 2229 nodeTop = node.offset().top, 2230 winHeight = $( window ).height(), 2231 bodyHeight = $( 'body' ).height(), 2232 waypoint = FLBuilderLayoutConfig.waypoint, 2233 offset = '80%'; 2234 2235 if ( typeof waypoint.offset !== undefined ) { 2236 offset = FLBuilderLayoutConfig.waypoint.offset + '%'; 2237 } 2238 2239 if ( bodyHeight - nodeTop < winHeight * 0.2 ) { 2240 offset = '100%'; 2241 } 2242 2243 node.waypoint({ 2244 offset: offset, 2245 handler: FLBuilderLayoutModules._doModuleAnimation 2246 }); 2247 } ); 2248 } 2249 }, 2250 2251 /** 2252 * Runs a module animation. 2253 * 2254 * @since 1.1.9 2255 * @access private 2256 * @method _doModuleAnimation 2257 */ 2258 _doModuleAnimation: function() 2259 { 2260 var module = 'undefined' == typeof this.element ? $(this) : $(this.element), 2261 delay = parseFloat(module.data('animation-delay')), 2262 duration = parseFloat(module.data('animation-duration')); 2263 2264 if ( ! isNaN( duration ) ) { 2265 module.css( 'animation-duration', duration + 's' ); 2266 } 2267 2268 if(!isNaN(delay) && delay > 0) { 2269 setTimeout(function(){ 2270 module.addClass('fl-animated'); 2271 }, delay * 1000); 2272 } else { 2273 setTimeout(function(){ 2274 module.addClass('fl-animated'); 2275 }, 1); 2276 } 2277 } 2278 }; 2279 2280 /* Initializes builder module logic. */ 2281 $(function(){ 2282 FLBuilderLayoutModules.init(); 2283 }); 2284 2285})(jQuery); 2286 2287/* Start Global JS */ 2288 2289/* End Global JS */ 2290 2291 2292;/* eslint-disable no-undef */ 2293(function($) { 2294 2295 FLBuilderPostGrid = function(settings) 2296 { 2297 this.settings = settings; 2298 this.nodeClass = '.fl-node-' + settings.id; 2299 this.matchHeight = settings.matchHeight; 2300 2301 if ( 'columns' == this.settings.layout ) { 2302 this.wrapperClass = this.nodeClass + ' .fl-post-grid'; 2303 this.postClass = this.nodeClass + ' .fl-post-column'; 2304 } 2305 else { 2306 this.wrapperClass = this.nodeClass + ' .fl-post-' + this.settings.layout; 2307 this.postClass = this.wrapperClass + '-post'; 2308 } 2309 2310 if(this._hasPosts()) { 2311 this._initLayout(); 2312 this._initInfiniteScroll(); 2313 } 2314 }; 2315 2316 FLBuilderPostGrid.prototype = { 2317 2318 settings : {}, 2319 nodeClass : '', 2320 wrapperClass : '', 2321 postClass : '', 2322 gallery : null, 2323 currPage : 1, 2324 totalPages : 1, 2325 2326 _hasPosts: function() 2327 { 2328 return $(this.postClass).length > 0; 2329 }, 2330 2331 _initLayout: function() 2332 { 2333 switch(this.settings.layout) { 2334 2335 case 'columns': 2336 this._columnsLayout(); 2337 break; 2338
2339 case 'grid': 2340 this._gridLayout(); 2341 break; 2342 2343 case 'gallery': 2344 this._galleryLayout(); 2345 break; 2346 } 2347 2348 $(this.postClass).css('visibility', 'visible'); 2349 2350 FLBuilderLayout._scrollToElement( $( this.nodeClass + ' .fl-paged-scroll-to' ) ); 2351 }, 2352 2353 _columnsLayout: function() 2354 { 2355 $(this.wrapperClass).imagesLoaded( $.proxy( function() { 2356 this._gridLayoutMatchHeight(); 2357 }, this ) ); 2358 2359 $( window ).on( 'resize', $.proxy( function(){ 2360 $(this.wrapperClass).imagesLoaded( $.proxy( function() { 2361 this._gridLayoutMatchHeight(); 2362 }, this ) ); 2363 }, this ) ); 2364 }, 2365 2366 _gridLayout: function() 2367 { 2368 var wrap = $(this.wrapperClass); 2369 2370 wrap.masonry({ 2371 columnWidth : this.nodeClass + ' .fl-post-grid-sizer', 2372 gutter : parseInt(this.settings.postSpacing), 2373 isFitWidth : true, 2374 itemSelector : this.postClass, 2375 transitionDuration : 0, 2376 isRTL : this.settings.isRTL 2377 }); 2378 2379 wrap.imagesLoaded( $.proxy( function() { 2380 this._gridLayoutMatchHeight(); 2381 wrap.masonry(); 2382 }, this ) ); 2383 2384 $(window).scroll($.debounce( 25, function(){ 2385 wrap.masonry() 2386 })); 2387 2388 }, 2389 2390 _gridLayoutMatchHeight: function() 2391 { 2392 var highestBox = 0; 2393 2394 if ( ! this._isMatchHeight() ) { 2395 $(this.nodeClass + ' .fl-post-grid-post').css('height', ''); 2396 return; 2397 } 2398 2399 $(this.nodeClass + ' .fl-post-grid-post').css('height', '').each(function(){ 2400 2401 if($(this).height() > highestBox) { 2402 highestBox = $(this).height(); 2403 } 2404 }); 2405 2406 $(this.nodeClass + ' .fl-post-grid-post').height(highestBox); 2407 }, 2408 2409 _isMatchHeight: function(){ 2410 var width = $( window ).width(), 2411 breakpoints = FLBuilderLayoutConfig.breakpoints, 2412 matchLarge = '' != this.matchHeight.large ? this.matchHeight.large : this.matchHeight.default, 2413 matchMedium = '' != this.matchHeight.medium ? this.matchHeight.medium : this.matchHeight.default, 2414 matchSmall = '' != this.matchHeight.responsive ? this.matchHeight.responsive : this.matchHeight.default; 2415 2416 return (width > breakpoints.medium && 1 == this.matchHeight.default) // Must check medium here for backwards compat 2417 || (width > breakpoints.medium && width <= breakpoints.large && 1 == matchLarge) 2418 || (width > breakpoints.small && width <= breakpoints.medium && 1 == matchMedium) 2419 || (width <= breakpoints.small && 1 == matchSmall); 2420 }, 2421 2422 _galleryLayout: function() 2423 { 2424 this.gallery = new FLBuilderGalleryGrid({ 2425 'wrapSelector' : this.wrapperClass, 2426 'itemSelector' : '.fl-post-gallery-post', 2427 'isRTL' : this.settings.isRTL 2428 }); 2429 }, 2430 2431 _initInfiniteScroll: function() 2432 { 2433 var isScroll = 'scroll' == this.settings.pagination || 'load_more' == this.settings.pagination, 2434 pages = $( this.nodeClass + ' .fl-builder-pagination' ).find( 'li .page-numbers:not(.next)' ); 2435 2436 if( pages.length > 1) { 2437 total = pages.last().text().replace( /\D/g, '' ) 2438 this.totalPages = parseInt( total ); 2439 } 2440 2441 if( isScroll && this.totalPages > 1 && 'undefined' === typeof FLBuilder ) { 2442 this._infiniteScroll(); 2443 2444 if( 'load_more' == this.settings.pagination ) { 2445 this._infiniteScrollLoadMore(); 2446 } 2447 } 2448 }, 2449 2450 _infiniteScroll: function() 2451 { 2452 var path = $(this.nodeClass + ' .fl-builder-pagination a.next').attr('href'), 2453 pagePattern = /(.*?(\/|&|\?)paged-[0-9]{1,}(\/|=))([0-9]{1,})+(.*)/, 2454 wpPattern = /^(.*?\/?page\/?)(?:\d+)(.*?$)/, 2455 pageMatched = null, 2456 scrollData = { 2457 navSelector : this.nodeClass + ' .fl-builder-pagination', 2458 nextSelector : this.nodeClass + ' .fl-builder-pagination a.next', 2459 itemSelector : this.postClass, 2460 prefill : true, 2461 bufferPx : 200, 2462 loading : { 2463 msgText : this.settings.loadingText, 2464 finishedMsg : '', 2465 img : FLBuilderLayoutConfig.paths.pluginUrl + 'img/ajax-loader-grey.gif', 2466 speed : 1 2467 } 2468 }; 2469 // Define path since Infinitescroll incremented our custom pagination '/paged-2/2/' to '/paged-3/2/'. 2470 if ( pagePattern.test( path ) ) { 2471 scrollData.path = function( currPage ){ 2472 pageMatched = path.match( pagePattern ); 2473 path = pageMatched[1] + currPage + pageMatched[5]; 2474 return path; 2475 } 2476 } 2477 else if ( wpPattern.test( path ) ) { 2478 scrollData.path = path.match( wpPattern ).slice( 1 ); 2479 } 2480 2481 $(this.postClass).first().parent().infinitescroll( scrollData, $.proxy(this._infiniteScrollComplete, this) ); 2482 2483 setTimeout(function(){ 2484 $(window).trigger('resize'); 2485 }, 100); 2486 }, 2487 2488 _infiniteScrollComplete: function(elements) 2489 { 2490 var wrap = $(this.wrapperClass); 2491 2492 elements = $(elements); 2493 2494 if(this.settings.layout == 'columns') { 2495 wrap.imagesLoaded( $.proxy( function() { 2496 $( '#infscr-loading' ).remove(); 2497 this._gridLayoutMatchHeight(); 2498 elements.css('visibility', 'visible'); 2499 }, this ) ); 2500 } 2501 else if(this.settings.layout == 'grid') { 2502 wrap.imagesLoaded( $.proxy( function() { 2503 this._gridLayoutMatchHeight(); 2504 wrap.masonry('appended', elements); 2505 wrap.masonry(); 2506 elements.css('visibility', 'visible'); 2507 }, this ) ); 2508 } 2509 else if(this.settings.layout == 'gallery') { 2510 this.gallery.resize(); 2511 elements.css('visibility', 'visible'); 2512 } 2513 2514 if( 'load_more' == this.settings.pagination ) { 2515 $( this.wrapperClass + ' .fl-post-grid-sizer.masonry-brick' ).appendTo( this.wrapperClass ); 2516 $( '#infscr-loading' ).appendTo( this.wrapperClass ); 2517 } 2518 2519 this.currPage++; 2520 2521 this._removeLoadMoreButton(); 2522 2523 // trigger an event 2524 node = $(wrap).closest('.fl-module-post-grid').data('node') 2525 $('.fl-node-' + node).trigger( 'gridScrollComplete', this ); 2526 }, 2527 2528 _infiniteScrollLoadMore: function() 2529 { 2530 var wrap = $( this.postClass ).first().parent(); 2531 2532 $( window ).unbind( '.infscr' ); 2533
2534 $(this.nodeClass + ' .fl-builder-pagination-load-more .fl-button').on( 'click', function(){ 2535 if( $( '#infscr-loading' ).length ) { 2536 $( '#infscr-loading' ).remove(); 2537 } 2538 2539 wrap.infinitescroll( 'retrieve' ); 2540 return false; 2541 }); 2542 }, 2543 2544 _removeLoadMoreButton: function() 2545 { 2546 if ( 'load_more' == this.settings.pagination && this.totalPages == this.currPage ) { 2547 $( this.nodeClass + ' .fl-builder-pagination-load-more' ).remove(); 2548 } 2549 } 2550 }; 2551 2552})(jQuery); 2553(function($) { 2554 2555 $(function() { 2556 2557 new FLBuilderPostGrid({ 2558 id: '5a3953da2068b', 2559 layout: 'feed', 2560 pagination: 'numbers', 2561 postSpacing: '60', 2562 postWidth: '300', 2563 matchHeight: { 2564 default : '0', 2565 large : '', 2566 medium : '', 2567 responsive : '' 2568 }, 2569 isRTL: false, 2570 loadingText: 'Loading...' 2571 }); 2572 2573 }); 2574 2575})(jQuery); 2576 2577;(function($) { 2578 2579 UABBSpacerGap = function( settings ) 2580 { 2581 this.settings = settings; 2582 this.node = settings.id; 2583 this.desktop_space = settings.desktop_space; 2584 this.medium_device = settings.medium_device; 2585 this.small_device = settings.small_device; 2586 this.nodeClass = '.fl-node-' + settings.id; 2587 this._init(); 2588 2589 2590 }; 2591 2592 UABBSpacerGap.prototype = { 2593 2594 settings : {}, 2595 node : '', 2596 nodeClass : '', 2597 2598 _init: function() 2599 { 2600 this._spacerGapHeightHandler(); 2601 }, 2602 2603 /** 2604 * Initializes all anchor links on the page for smooth scrolling. 2605 * 2606 * @since 1.6.7 2607 * @access private 2608 * @method _initAnchorLinks 2609 */ 2610 _spacerGapHeightHandler: function() 2611 { 2612 var nodeClass = jQuery(this.nodeClass); 2613 var node_id = nodeClass.data( 'node' ); 2614 var node = '.fl-node-'+node_id+' '; 2615 2616 if( jQuery('body').hasClass('fl-builder-edit') && this.desktop_space < 30 ) { 2617 jQuery('body').find(node).addClass("uabb-desktop-spacer-height-adjustment"); 2618 } 2619 if( jQuery('body').hasClass('fl-builder-edit') && this.medium_device < 30 ) { 2620 jQuery('body').find( node ).addClass('uabb-tab-spacer-height-adjustment'); 2621 } 2622 if( jQuery('body').hasClass('fl-builder-edit') && this.small_device < 30 ) { 2623 jQuery('body').find( node ).addClass('uabb-mobile-spacer-height-adjustment'); 2624 } 2625 }, 2626 }; 2627 2628})(jQuery);jQuery(document).ready(function(){ 2629 new UABBSpacerGap({ 2630 id: '5a3953da20859', 2631 desktop_space: '100', 2632 medium_device: '50', 2633 small_device: '25', 2634 }); 2635}); 2636jQuery(document).ready(function(){ 2637 new UABBSpacerGap({ 2638 id: '5a3953da2097b', 2639 desktop_space: '', 2640 medium_device: '', 2641 small_device: '', 2642 }); 2643}); 2644jQuery(document).ready(function(){ 2645 new UABBSpacerGap({ 2646 id: '5a3953da207ac', 2647 desktop_space: '100', 2648 medium_device: '50', 2649 small_device: '25', 2650 }); 2651}); 2652 2653/* Start Global Node Custom JS */ 2654 2655/* End Global Node Custom JS */ 2656 2657 2658/* Start Layout Custom JS */ 2659 2660/* End Layout Custom JS */ 2661 2662 2663/*! 2664 * Bowser - a browser detector 2665 * https://github.com/ded/bowser 2666 * MIT License | (c) Dustin Diaz 2015 2667 */ 2668 2669!function (name, definition) { 2670 if (typeof module != 'undefined' && module.exports) module.exports = definition() 2671 else if (typeof define == 'function' && define.amd) define(name, definition) 2672 else this[name] = definition() 2673}('bowser', function () { 2674 /** 2675 * See useragents.js for examples of navigator.userAgent 2676 */ 2677 2678 var t = true 2679 2680 function detect(ua) { 2681 2682 function getFirstMatch(regex) { 2683 var match = ua.match(regex); 2684 return (match && match.length > 1 && match[1]) || ''; 2685 } 2686 2687 function getSecondMatch(regex) { 2688 var match = ua.match(regex); 2689 return (match && match.length > 1 && match[2]) || ''; 2690 } 2691 2692 var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() 2693 , likeAndroid = /like android/i.test(ua) 2694 , android = !likeAndroid && /android/i.test(ua) 2695 , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) 2696 , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) 2697 , chromeos = /CrOS/.test(ua) 2698 , silk = /silk/i.test(ua) 2699 , sailfish = /sailfish/i.test(ua) 2700 , tizen = /tizen/i.test(ua) 2701 , webos = /(web|hpw)os/i.test(ua) 2702 , windowsphone = /windows phone/i.test(ua) 2703 , windows = !windowsphone && /windows/i.test(ua) 2704 , mac = !iosdevice && !silk && /macintosh/i.test(ua) 2705 , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) 2706 , edgeVersion = getFirstMatch(/edge\/(\d+(\.\d+)?)/i) 2707 , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) 2708 , tablet = /tablet/i.test(ua) 2709 , mobile = !tablet && /[^-]mobi/i.test(ua) 2710 , xbox = /xbox/i.test(ua) 2711 , result 2712 2713 if (/opera|opr|opios/i.test(ua)) { 2714 result = { 2715 name: 'Opera' 2716 , opera: t 2717 , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) 2718 } 2719 } 2720 else if (/coast/i.test(ua)) { 2721 result = { 2722 name: 'Opera Coast' 2723 , coast: t 2724 , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) 2725 } 2726 } 2727 else if (/yabrowser/i.test(ua)) { 2728 result = { 2729 name: 'Yandex Browser' 2730 , yandexbrowser: t 2731 , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) 2732 } 2733 } 2734 else if (/ucbrowser/i.test(ua)) { 2735 result = { 2736 name: 'UC Browser' 2737 , ucbrowser: t 2738 , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) 2739 } 2740 } 2741 else if (/mxios/i.test(ua)) { 2742 result = { 2743 name: 'Maxthon' 2744 , maxthon: t 2745 , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) 2746 } 2747 } 2748 else if (/epiphany/i.test(ua)) { 2749 result = { 2750 name: 'Epiphany' 2751 , epiphany: t 2752 , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) 2753 } 2754 } 2755 else if (/puffin/i.test(ua)) { 2756 result = { 2757 name: 'Puffin' 2758 , puffin: t 2759 , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) 2760 } 2761 } 2762 else if (/sleipnir/i.test(ua)) { 2763 result = { 2764 name: 'Sleipnir' 2765 , sleipnir: t 2766 , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) 2767 } 2768 } 2769 else if (/k-meleon/i.test(ua)) { 2770 result = { 2771 name: 'K-Meleon' 2772 , kMeleon: t 2773 , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) 2774 } 2775 } 2776 else if (windowsphone) { 2777 result = { 2778 name: 'Windows Phone' 2779 , windowsphone: t 2780 } 2781 if (edgeVersion) { 2782 result.msedge = t 2783 result.version = edgeVersion 2784 } 2785 else { 2786 result.msie = t 2787 result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i) 2788 } 2789 } 2790 else if (/msie|trident/i.test(ua)) { 2791 result = { 2792 name: 'Internet Explorer' 2793 , msie: t 2794 , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) 2795 } 2796 } else if (chromeos) { 2797 result = { 2798 name: 'Chrome' 2799 , chromeos: t 2800 , chromeBook: t 2801 , chrome: t 2802 , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) 2803 } 2804 } else if (/chrome.+? edge/i.test(ua)) { 2805 result = { 2806 name: 'Microsoft Edge' 2807 , msedge: t 2808 , version: edgeVersion 2809 } 2810 } 2811 else if (/vivaldi/i.test(ua)) { 2812 result = { 2813 name: 'Vivaldi' 2814 , vivaldi: t 2815 , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier 2816 } 2817 } 2818 else if (sailfish) { 2819 result = { 2820 name: 'Sailfish' 2821 , sailfish: t 2822 , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) 2823 } 2824 } 2825 else if (/seamonkey\//i.test(ua)) { 2826 result = { 2827 name: 'SeaMonkey' 2828 , seamonkey: t 2829 , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) 2830 } 2831 } 2832 else if (/firefox|iceweasel|fxios/i.test(ua)) { 2833 result = { 2834 name: 'Firefox' 2835 , firefox: t 2836 , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) 2837 } 2838 if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { 2839 result.firefoxos = t 2840 } 2841 } 2842 else if (silk) { 2843 result = { 2844 name: 'Amazon Silk' 2845 , silk: t 2846 , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) 2847 } 2848 } 2849 else if (/phantom/i.test(ua)) { 2850 result = { 2851 name: 'PhantomJS' 2852 , phantom: t 2853 , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) 2854 } 2855 } 2856 else if (/slimerjs/i.test(ua)) { 2857 result = { 2858 name: 'SlimerJS' 2859 , slimer: t 2860 , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) 2861 } 2862 } 2863 else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { 2864 result = { 2865 name: 'BlackBerry' 2866 , blackberry: t 2867 , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) 2868 } 2869 } 2870 else if (webos) { 2871 result = { 2872 name: 'WebOS' 2873 , webos: t 2874 , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) 2875 }; 2876 if( /touchpad\//i.test(ua) ){ 2877 result.touchpad = t; 2878 } 2879 } 2880 else if (/bada/i.test(ua)) { 2881 result = { 2882 name: 'Bada' 2883 , bada: t 2884 , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) 2885 }; 2886 } 2887 else if (tizen) { 2888 result = { 2889 name: 'Tizen' 2890 , tizen: t 2891 , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier 2892 }; 2893 } 2894 else if (/qupzilla/i.test(ua)) { 2895 result = { 2896 name: 'QupZilla' 2897 , qupzilla: t 2898 , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier 2899 } 2900 } 2901 else if (/chromium/i.test(ua)) { 2902 result = { 2903 name: 'Chromium' 2904 , chromium: t 2905 , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier 2906 } 2907 } 2908 else if (/chrome|crios|crmo/i.test(ua)) { 2909 result = { 2910 name: 'Chrome' 2911 , chrome: t 2912 , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) 2913 } 2914 } 2915 else if (android) { 2916 result = { 2917 name: 'Android' 2918 , version: versionIdentifier 2919 } 2920 } 2921 else if (/safari|applewebkit/i.test(ua)) { 2922 result = { 2923 name: 'Safari' 2924 , safari: t 2925 } 2926 if (versionIdentifier) { 2927 result.version = versionIdentifier 2928 } 2929 } 2930 else if (iosdevice) { 2931 result = { 2932 name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' 2933 } 2934 // WTF: version is not part of user agent in web apps 2935 if (versionIdentifier) { 2936 result.version = versionIdentifier 2937 } 2938 } 2939 else if(/googlebot/i.test(ua)) { 2940 result = { 2941 name: 'Googlebot' 2942 , googlebot: t 2943 , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier 2944 } 2945 } 2946 else { 2947 result = { 2948 name: getFirstMatch(/^(.*)\/(.*) /), 2949 version: getSecondMatch(/^(.*)\/(.*) /) 2950 }; 2951 } 2952 2953 // set webkit or gecko flag for browsers based on these engines 2954 if (!result.msedge && /(apple)?webkit/i.test(ua)) { 2955 if (/(apple)?webkit\/537\.36/i.test(ua)) { 2956 result.name = result.name || "Blink" 2957 result.blink = t 2958 } else { 2959 result.name = result.name || "Webkit" 2960 result.webkit = t 2961 } 2962 if (!result.version && versionIdentifier) { 2963 result.version = versionIdentifier 2964 } 2965 } else if (!result.opera && /gecko\//i.test(ua)) { 2966 result.name = result.name || "Gecko" 2967 result.gecko = t 2968 result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i) 2969 } 2970 2971 // set OS flags for platforms that have multiple browsers 2972 if (!result.msedge && (android || result.silk)) { 2973 result.android = t 2974 } else if (iosdevice) { 2975 result[iosdevice] = t 2976 result.ios = t 2977 } else if (mac) { 2978 result.mac = t 2979 } else if (xbox) { 2980 result.xbox = t 2981 } else if (windows) { 2982 result.windows = t 2983 } else if (linux) { 2984 result.linux = t 2985 } 2986 2987 // OS version extraction 2988 var osVersion = ''; 2989 if (result.windowsphone) { 2990 osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); 2991 } else if (iosdevice) { 2992 osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); 2993 osVersion = osVersion.replace(/[_\s]/g, '.'); 2994 } else if (android) { 2995 osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); 2996 } else if (result.webos) { 2997 osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); 2998 } else if (result.blackberry) { 2999 osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); 3000 } else if (result.bada) { 3001 osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); 3002 } else if (result.tizen) { 3003 osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); 3004 } 3005 if (osVersion) { 3006 result.osversion = osVersion; 3007 } 3008 3009 // device type extraction 3010 var osMajorVersion = osVersion.split('.')[0]; 3011 if ( 3012 tablet 3013 || nexusTablet 3014 || iosdevice == 'ipad' 3015 || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) 3016 || result.silk 3017 ) { 3018 result.tablet = t 3019 } else if ( 3020 mobile 3021 || iosdevice == 'iphone' 3022 || iosdevice == 'ipod' 3023 || android 3024 || nexusMobile 3025 || result.blackberry 3026 || result.webos 3027 || result.bada 3028 ) { 3029 result.mobile = t 3030 } 3031 3032 // Graded Browser Support
3033 // http://developer.yahoo.com/yui/articles/gbs 3034 if (result.msedge || 3035 (result.msie && result.version >= 10) || 3036 (result.yandexbrowser && result.version >= 15) || 3037 (result.vivaldi && result.version >= 1.0) || 3038 (result.chrome && result.version >= 20) || 3039 (result.firefox && result.version >= 20.0) || 3040 (result.safari && result.version >= 6) || 3041 (result.opera && result.version >= 10.0) || 3042 (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || 3043 (result.blackberry && result.version >= 10.1) 3044 || (result.chromium && result.version >= 20) 3045 ) { 3046 result.a = t; 3047 } 3048 else if ((result.msie && result.version < 10) || 3049 (result.chrome && result.version < 20) || 3050 (result.firefox && result.version < 20.0) || 3051 (result.safari && result.version < 6) || 3052 (result.opera && result.version < 10.0) || 3053 (result.ios && result.osversion && result.osversion.split(".")[0] < 6) 3054 || (result.chromium && result.version < 20) 3055 ) { 3056 result.c = t 3057 } else result.x = t 3058 3059 return result 3060 } 3061 3062 var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent : '') 3063 3064 bowser.test = function (browserList) { 3065 for (var i = 0; i < browserList.length; ++i) { 3066 var browserItem = browserList[i]; 3067 if (typeof browserItem=== 'string') { 3068 if (browserItem in bowser) { 3069 return true; 3070 } 3071 } 3072 } 3073 return false; 3074 } 3075 3076 /** 3077 * Get version precisions count 3078 * 3079 * @example 3080 * getVersionPrecision("1.10.3") // 3 3081 * 3082 * @param {string} version 3083 * @return {number} 3084 */ 3085 function getVersionPrecision(version) { 3086 return version.split(".").length; 3087 } 3088 3089 /** 3090 * Array::map polyfill 3091 * 3092 * @param {Array} arr 3093 * @param {Function} iterator 3094 * @return {Array} 3095 */ 3096 function map(arr, iterator) { 3097 var result = [], i; 3098 if (Array.prototype.map) { 3099 return Array.prototype.map.call(arr, iterator); 3100 } 3101 for (i = 0; i < arr.length; i++) { 3102 result.push(iterator(arr[i])); 3103 } 3104 return result; 3105 } 3106 3107 /** 3108 * Calculate browser version weight 3109 * 3110 * @example 3111 * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 3112 * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 3113 * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 3114 * compareVersions(['1.10.2.1', '1.0800.2']); // -1 3115 * 3116 * @param {Array<String>} versions versions to compare 3117 * @return {Number} comparison result 3118 */ 3119 function compareVersions(versions) { 3120 // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 3121 var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); 3122 var chunks = map(versions, function (version) { 3123 var delta = precision - getVersionPrecision(version); 3124 3125 // 2) "9" -> "9.0" (for precision = 2) 3126 version = version + new Array(delta + 1).join(".0"); 3127 3128 // 3) "9.0" -> ["000000000"", "000000009"] 3129 return map(version.split("."), function (chunk) { 3130 return new Array(20 - chunk.length).join("0") + chunk; 3131 }).reverse(); 3132 }); 3133 3134 // iterate in reverse order by reversed chunks array 3135 while (--precision >= 0) { 3136 // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) 3137 if (chunks[0][precision] > chunks[1][precision]) { 3138 return 1; 3139 } 3140 else if (chunks[0][precision] === chunks[1][precision]) { 3141 if (precision === 0) { 3142 // all version chunks are same 3143 return 0; 3144 } 3145 } 3146 else { 3147 return -1; 3148 } 3149 } 3150 } 3151 3152 /** 3153 * Check if browser is unsupported 3154 * 3155 * @example 3156 * bowser.isUnsupportedBrowser({ 3157 * msie: "10", 3158 * firefox: "23", 3159 * chrome: "29", 3160 * safari: "5.1", 3161 * opera: "16", 3162 * phantom: "534" 3163 * }); 3164 * 3165 * @param {Object} minVersions map of minimal version to browser 3166 * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map 3167 * @param {String} [ua] user agent string 3168 * @return {Boolean} 3169 */ 3170 function isUnsupportedBrowser(minVersions, strictMode, ua) { 3171 var _bowser = bowser; 3172 3173 // make strictMode param optional with ua param usage 3174 if (typeof strictMode === 'string') { 3175 ua = strictMode;
3176 strictMode = void(0); 3177 } 3178 3179 if (strictMode === void(0)) { 3180 strictMode = false; 3181 } 3182 if (ua) { 3183 _bowser = detect(ua); 3184 } 3185 3186 var version = "" + _bowser.version; 3187 for (var browser in minVersions) { 3188 if (minVersions.hasOwnProperty(browser)) { 3189 if (_bowser[browser]) { 3190 // browser version and min supported version. 3191 return compareVersions([version, minVersions[browser]]) < 0; 3192 } 3193 } 3194 } 3195 3196 return strictMode; // not found 3197 } 3198 3199 /** 3200 * Check if browser is supported 3201 * 3202 * @param {Object} minVersions map of minimal version to browser 3203 * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map 3204 * @param {String} [ua] user agent string 3205 * @return {Boolean} 3206 */ 3207 function check(minVersions, strictMode, ua) { 3208 return !isUnsupportedBrowser(minVersions, strictMode, ua); 3209 } 3210 3211 bowser.isUnsupportedBrowser = isUnsupportedBrowser; 3212 bowser.compareVersions = compareVersions; 3213 bowser.check = check; 3214 3215 /* 3216 * Set our detect method to the main bowser object so we can 3217 * reuse it to test other user agents. 3218 * This is needed to implement future tests. 3219 */ 3220 bowser._detect = detect; 3221 3222 return bowser 3223}); 3224 3225(function($){ 3226 UABBTrigger = { 3227 3228 /** 3229 * Trigger a hook. 3230 * 3231 * @since 1.1.0.3 3232 * @method triggerHook 3233 * @param {String} hook The hook to trigger. 3234 * @param {Array} args An array of args to pass to the hook. 3235 */ 3236 triggerHook: function( hook, args ) 3237 { 3238 $( 'body' ).trigger( 'uabb-trigger.' + hook, args ); 3239 }, 3240 3241 /** 3242 * Add a hook. 3243 * 3244 * @since 1.1.0.3 3245 * @method addHook 3246 * @param {String} hook The hook to add. 3247 * @param {Function} callback A function to call when the hook is triggered. 3248 */ 3249 addHook: function( hook, callback ) 3250 { 3251 $( 'body' ).on( 'uabb-trigger.' + hook, callback ); 3252 }, 3253 3254 /** 3255 * Remove a hook. 3256 * 3257 * @since 1.1.0.3 3258 * @method removeHook 3259 * @param {String} hook The hook to remove. 3260 * @param {Function} callback The callback function to remove. 3261 */ 3262 removeHook: function( hook, callback ) 3263 { 3264 $( 'body' ).off( 'uabb-trigger.' + hook, callback ); 3265 }, 3266 }; 3267})(jQuery); 3268 3269jQuery(document).ready(function( $ ) { 3270 3271 if( typeof bowser !== 'undefined' && bowser !== null ) { 3272 3273 var uabb_browser = bowser.name, 3274 uabb_browser_v = bowser.version, 3275 uabb_browser_class = uabb_browser.replace(/\s+/g, '-').toLowerCase(), 3276 uabb_browser_v_class = uabb_browser_class + parseInt( uabb_browser_v ); 3277 3278 $('html').addClass(uabb_browser_class).addClass(uabb_browser_v_class); 3279 3280 } 3281 3282 $('.uabb-row-separator').parents('html').css('overflow-x', 'hidden'); 3283}); 3284 3285;(function($) { 3286 3287 PPAdvancedMenu = function( settings ) { 3288 3289 // set params 3290 this.settingsId = settings.id; 3291 this.nodeClass = '.fl-node-' + settings.id; 3292 this.wrapperClass = this.nodeClass + ' .pp-advanced-menu'; 3293 this.type = settings.type; 3294 this.mobileToggle = settings.mobile; 3295 this.mobileBelowRow = 'below' === settings.menuPosition; 3296 this.breakpoints = settings.breakpoints; 3297 this.mobileBreakpoint = settings.mobileBreakpoint; 3298 this.mediaBreakpoint = settings.mediaBreakpoint; 3299 this.mobileMenuType = settings.mobileMenuType; 3300 this.offCanvasDirection = settings.offCanvasDirection; 3301 this.submenuRevealTrigger = settings.submenuRevealTrigger === 'click' ? 'click' : 'hover'; 3302 this.postId = bb_powerpack.post_id; 3303 this.isBuilderActive = settings.isBuilderActive; 3304 this.currentBrowserWidth = window.innerWidth; 3305 this.fullScreenMenu = null; 3306 this.offCanvasMenu = null; 3307 this.$submenus = null; 3308 3309 // initialize the menu 3310 $( this._initMenu.bind( this ) ); 3311 3312 // check if viewport is resizing 3313 $( window ).on( 'resize', function( e ) { 3314 3315 var width = window.innerWidth; 3316 3317 // if screen width is resized, reload the menu 3318 if( width != this.currentBrowserWidth ) { 3319 3320 this._initMenu(); 3321 this._clickOrHover(); 3322 this.currentBrowserWidth = width; 3323 } 3324 3325 }.bind( this ) ); 3326 3327 $( 'body' ).on( 'click', function( e ) { 3328 if ( 'undefined' !== typeof FLBuilderConfig ){ 3329 return; 3330 } 3331 3332 if ( $( this.wrapperClass ).find( '.pp-advanced-menu-mobile-toggle' ).hasClass( 'pp-active' ) && ( 'expanded' !== this.mobileToggle ) ) { 3333 if ( $( e.target ).parents('.fl-module-pp-advanced-menu').length > 0 ) { 3334 return; 3335 } 3336 if ( $( e.target ).is( 'input' ) && $( e.target ).parents('.pp-advanced-menu').length > 0 ) { 3337 return; 3338 } 3339 if ( $( e.target ).hasClass( 'pp-menu-close-btn' ) ) { 3340 return; 3341 } 3342 $( this.wrapperClass ).find( '.pp-advanced-menu-mobile-toggle' ).trigger( 'click' ); 3343 } 3344 3345 $( this.wrapperClass ).find( '.pp-has-submenu' ).each( function() { 3346 if ( ! $( this ).find( '> .sub-menu' ).is( ':visible' ) ) { 3347 $( this ).removeClass( 'pp-active' ); 3348 } 3349 } ); 3350 $( this.wrapperClass ).find( '.pp-has-submenu' ).removeClass( 'focus' ); 3351 $( this.wrapperClass ).find( '.pp-has-submenu .sub-menu' ).removeClass( 'focus' ); 3352 $( this.wrapperClass ).find( '.pp-has-submenu-container' ).removeClass( 'focus' ); 3353 $( this.wrapperClass ).find( '.pp-menu-toggle' ).attr( 'aria-expanded', false ); 3354 3355 }.bind( this ) ); 3356 3357 // Esc key to close open submenus. 3358 $( document ).on( 'keyup', function( e ) { 3359 if ( 27 == e.which || 'Escape' === e.key ) { 3360 var $wrapper = $( this.wrapperClass ); 3361 var isDesktopLayout = this.type == 'horizontal' || this.type == 'vertical'; 3362 var isDesktopClickReveal = isDesktopLayout && 'click' === this.submenuRevealTrigger && ! this._isMenuToggle(); 3363 3364 if ( this._isMenuToggle() || this.type == 'accordion' || isDesktopClickReveal ) {
3365 $wrapper.find( '.sub-menu' ).stop( true, true ).slideUp( 'normal' ); 3366 } else { 3367 $wrapper.find( '.sub-menu' ).stop( true, true ).css( { 3368 'display': '', 3369 'opacity': '' 3370 } ); 3371 } 3372 3373 $wrapper.find( '.pp-has-submenu' ).removeClass( 'pp-active focus' ); 3374 $wrapper.find( '.pp-has-submenu .sub-menu' ).removeClass( 'focus' ); 3375 $wrapper.find( '.pp-has-submenu-container' ).removeClass( 'focus first-click' ); 3376 $wrapper.find( '.pp-menu-toggle' ).attr( 'aria-expanded', false ); 3377 } 3378 }.bind( this ) ); 3379 3380 }; 3381 3382 PPAdvancedMenu.prototype = { 3383 nodeClass : '', 3384 wrapperClass : '', 3385 type : '', 3386 breakpoints : {}, 3387 $submenus : null, 3388 fullScreenMenu : null, 3389 offCanvasMenu : null, 3390 3391 /** 3392 * Check if the screen size fits a mobile viewport. 3393 * 3394 * @since 1.6.1 3395 * @return bool 3396 */ 3397 _isMobile: function() { 3398 return window.innerWidth <= this.breakpoints.small ? true : false; 3399 }, 3400 3401 /** 3402 * Check if the screen size fits a medium viewport. 3403 * 3404 * @since 1.10.5 3405 * @return bool 3406 */ 3407 _isMedium: function() { 3408 return window.innerWidth <= this.breakpoints.medium ? true : false; 3409 }, 3410 3411 /** 3412 * Check if the screen size fits a large viewport. 3413 * 3414 * @since 1.10.5 3415 * @return bool 3416 */ 3417 _isLarge: function() { 3418 return window.innerWidth <= this.breakpoints.large ? true : false; 3419 }, 3420 3421 /** 3422 * Check if the screen size fits a custom viewport. 3423 * 3424 * @since 1.10.5 3425 * @return bool 3426 */ 3427 _isCustom: function() { 3428 return window.innerWidth <= this.breakpoints.custom ? true : false; 3429 }, 3430 3431 _isTouch: function() { 3432 var prefixes = ' -webkit- -moz- -o- -ms- '.split(' '); 3433 var mq = function(query) { 3434 return window.matchMedia(query).matches; 3435 } 3436 3437 if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { 3438 return true; 3439 } 3440 3441 // include the 'heartz' as a way to have a non matching MQ to help terminate the join 3442 // https://git.io/vznFH 3443 var query = ['(', prefixes.join('touch-enabled),('), 'heartz', ')'].join(''); 3444 return mq(query); 3445 }, 3446 3447 _isIOS: function() { 3448 return [ 3449 'iPad Simulator', 3450 'iPhone Simulator', 3451 'iPod Simulator', 3452 'iPad', 3453 'iPhone', 3454 'iPod' 3455 ].includes(navigator.platform) 3456 // This explicitly catches modern iPads mimicking desktop Macs: 3457 || (navigator.userAgent.includes("Mac") && navigator.maxTouchPoints > 1); 3458 }, 3459 3460 /** 3461 * Check if the menu should toggle for the current viewport base on the selected breakpoint 3462 * 3463 * @see this._isMobile() 3464 * @see this._isMedium() 3465 * @since 1.10.5 3466 * @return bool 3467 */ 3468 _isMenuToggle: function() { 3469 if ( ( 'always' == this.mobileBreakpoint 3470 || ( this._isMobile() && 'mobile' == this.mobileBreakpoint ) 3471 || ( this._isMedium() && 'medium-mobile' == this.mobileBreakpoint ) 3472 || ( this._isCustom() && 'custom' == this.mobileBreakpoint ) 3473 ) && ( $( this.nodeClass ).find( '.pp-advanced-menu-mobile-toggle' ).is(':visible') || 'expanded' == this.mobileToggle ) ) { 3474 return true; 3475 } 3476 3477 return false; 3478 }, 3479 3480 _bindSettingsFormEvents: function() 3481 { 3482 // $('body').on( 'change', '.fl-builder-settings select[name="offcanvas_direction"]', function() { 3483 // $('html').removeClass('pp-off-canvas-menu-open'); 3484 // } ); 3485 }, 3486 3487 /** 3488 * Initialize the toggle logic for the menu. 3489 * 3490 * @see this._isMobile() 3491 * @see this._menuOnCLick() 3492 * @see this._clickOrHover() 3493 * @see this._submenuOnRight() 3494 * @see this._submenuRowZindexFix() 3495 * @see this._toggleForMobile() 3496 * @since 1.6.1 3497 * @return void 3498 */ 3499 _initMenu: function() { 3500 var isDesktopLayout = this.type == 'horizontal' || this.type == 'vertical'; 3501 var isDesktopClickReveal = isDesktopLayout && 'click' === this.submenuRevealTrigger && ! this._isMenuToggle(); 3502 3503 if ( this.mobileToggle != 'expanded' ) { 3504 this._initOffCanvas(); 3505 this._initFullScreen(); 3506 } 3507 3508 this._setupSubmenu(); 3509 if ( isDesktopClickReveal ) { 3510 $( this.wrapperClass ).off( 'mouseenter.pp-advanced-menu-hover mouseleave.pp-advanced-menu-hover', 'li.menu-item' ); 3511 $( this.wrapperClass ).find( 'li.menu-item' ).removeClass( 'hover' ); 3512 } else { 3513 this._menuOnHover(); 3514 } 3515 this._menuOnFocus(); 3516 this._submenuOnClick(); 3517 3518 if ( $( this.nodeClass ).length && this.type == 'horizontal' ) { 3519 this._initMegaMenus(); 3520 } 3521 3522 if ( isDesktopLayout ) { 3523 var self = this; 3524 $( this.wrapperClass ) 3525 .off( 'click.pp-advanced-menu-first-click', '.pp-has-submenu-container' ) 3526 .on( 'click.pp-advanced-menu-first-click', '.pp-has-submenu-container', function( e ) { 3527 if ( self.mobileMenuType !== 'off-canvas' && self.mobileMenuType !== 'full-screen' ) { 3528 if ( self._isTouch() ) { 3529 if ( ! $(this).hasClass('first-click') ) { 3530 e.preventDefault(); 3531 $(this).addClass('first-click'); 3532 } 3533 } 3534 } 3535 } ); 3536 3537 // Keyboard nav support for submenu toggle. 3538 $( this.wrapperClass ).on( 'keydown.pp-menu', 'a, .pp-has-submenu-container > .pp-menu-toggle', function(e) { 3539 var $current = $(e.target); 3540 3541 var key = e.key || e.which; 3542 3543 // Normalize keys 3544 var KEYS = { 3545 LEFT: 'ArrowLeft', 3546 RIGHT: 'ArrowRight', 3547 UP: 'ArrowUp', 3548 DOWN: 'ArrowDown',
3549 ENTER: 'Enter', 3550 SPACE: ' ', 3551 }; 3552 3553 function isKey(match) { 3554 return key === match || key === { 3555 ArrowLeft: 37, 3556 ArrowUp: 38, 3557 ArrowRight: 39, 3558 ArrowDown: 40, 3559 Enter: 13, 3560 ' ': 32 3561 }[match]; 3562 } 3563 3564 var $item = $current.closest('li'); 3565 var $parentItem = $current.closest('li.pp-has-submenu'); 3566 var $submenu = $current.closest('ul.sub-menu'); 3567 var isTopLevel = $current.closest('.sub-menu').length === 0; 3568 3569 /* ========================= 3570 TOGGLE HANDLING 3571 ========================= */ 3572 3573 function toggleSubmenu($el) { 3574 var $li = $el.closest('li.pp-has-submenu'); 3575 var $btn = $li.find('> .pp-has-submenu-container > .pp-menu-toggle'); 3576 3577 $li.toggleClass('pp-active'); 3578 3579 var isOpen = $li.hasClass('pp-active'); 3580 3581 if ($btn.length) { 3582 $btn.attr('aria-expanded', isOpen); 3583 } 3584 } 3585 3586 // Button toggle 3587 if ($current.hasClass('pp-menu-toggle')) { 3588 if (isKey(KEYS.ENTER) || isKey(KEYS.SPACE)) { 3589 e.preventDefault(); 3590 e.stopPropagation(); 3591 toggleSubmenu($current); 3592 return; 3593 } 3594 } 3595 3596 /* ========================= 3597 TOP LEVEL NAV (â â) 3598 ========================= */ 3599 3600 if (isTopLevel && (isKey(KEYS.LEFT) || isKey(KEYS.RIGHT))) { 3601 e.preventDefault(); 3602 e.stopPropagation(); 3603 3604 if (isKey(KEYS.LEFT)) { 3605 if ( $current.is( '.pp-menu-toggle' ) ) { 3606 $current.prev('a').focus(); 3607 } else { 3608 var $prev = $item.prev(); 3609 if ($prev.length) { 3610 var $target = $prev.find('> .pp-has-submenu-container > .pp-menu-toggle:visible'); 3611 ($target.length ? $target : $prev.find('a')).first().focus(); 3612 } 3613 } 3614 } 3615 3616 if (isKey(KEYS.RIGHT)) { 3617 if ( $current.next().is( '.pp-menu-toggle:visible' ) ) { 3618 $current.next().focus(); 3619 } else { 3620 var $next = $item.next(); 3621 if ($next.length) { 3622 $next.find('a').first().focus(); 3623 } 3624 } 3625 } 3626 3627 return; 3628 } 3629 3630 // NESTED submenu navigation (LEFT / RIGHT) 3631 if (!isTopLevel && (isKey(KEYS.RIGHT) || isKey(KEYS.LEFT))) { 3632 3633 var $parentItem = $current.closest('li.pp-has-submenu'); 3634 3635 // RIGHT â go into child submenu 3636 if (isKey(KEYS.RIGHT)) { 3637 var $childSubmenu = $parentItem.children('.sub-menu'); 3638 3639 if ($childSubmenu.length) { 3640 e.preventDefault(); 3641 e.stopPropagation(); 3642 3643 // Ensure open state 3644 $parentItem.addClass('pp-active'); 3645 3646 var $toggle = $parentItem.find('> .pp-has-submenu-container > .pp-menu-toggle:visible'); 3647 if ($toggle.length) { 3648 $toggle.attr('aria-expanded', true); 3649 } else { 3650 $parentItem.find('> .pp-has-submenu-container > a').attr('aria-expanded', true); 3651 } 3652 3653 // Focus first item in child submenu 3654 $childSubmenu.find('a, .pp-menu-toggle:visible').first().focus(); 3655 } 3656 return; 3657 } 3658 3659 // LEFT â go back to parent menu item 3660 if (isKey(KEYS.LEFT)) { 3661 var $currentSubmenu = $current.closest('ul.sub-menu'); 3662 var $parentItem = $currentSubmenu.parent('li'); 3663 3664 if ($parentItem.length) { 3665 e.preventDefault(); 3666 e.stopPropagation(); 3667 3668 // CLOSE submenu 3669 $parentItem.removeClass('pp-active'); 3670 3671 var $toggle = $parentItem.find('> .pp-has-submenu-container > .pp-menu-toggle:visible'); 3672 3673 if ($toggle.length) { 3674 $toggle.attr('aria-expanded', false); 3675 $toggle.focus(); 3676 } else { 3677 $parentItem.find('> .pp-has-submenu-container > a').attr('aria-expanded', false).focus(); 3678 } 3679 } 3680 return; 3681 } 3682 } 3683 3684 /* ========================= 3685 SUBMENU NAV (â â) 3686 ========================= */ 3687 3688 // DOWN from toggle â first submenu item 3689 if (isKey(KEYS.DOWN) && isTopLevel && $parentItem.length) { 3690 e.preventDefault(); 3691 e.stopPropagation(); 3692 3693 var $submenu = $parentItem.children('.sub-menu'); 3694 3695 if ($submenu.length) { 3696 // ensure open state 3697 if (!$parentItem.hasClass('pp-active')) { 3698 $parentItem.addClass('pp-active'); 3699 3700 var $toggle = $parentItem.find('> .pp-has-submenu-container > .pp-menu-toggle:visible'); 3701 if ($toggle.length) { 3702 $toggle.attr('aria-expanded', true); 3703 } else { 3704 $parentItem.find('> .pp-has-submenu-container > a').attr('aria-expanded', true); 3705 } 3706 } 3707 3708 // move focus into submenu 3709 $submenu.find('a, .pp-menu-toggle:visible').first().focus(); 3710 } 3711 3712 return; 3713 } 3714 3715 if (!$submenu.length) { 3716 return; 3717 } 3718 3719 var $items = $submenu.find('a, .pp-menu-toggle').filter(':visible'); 3720 var index = $items.index($current); 3721 3722 if (index === -1) return; 3723 3724 // DOWN â 3725 if (isKey(KEYS.DOWN)) { 3726 e.preventDefault(); 3727 e.stopPropagation(); 3728 3729 var next = index + 1; 3730 if (next < $items.length) { 3731 $items.eq(next).focus(); 3732 } 3733 return; 3734 } 3735 3736 // UP â 3737 if (isKey(KEYS.UP)) { 3738 e.preventDefault(); 3739 e.stopPropagation(); 3740 3741 if (index === 0 && ! $current.closest('.sub-menu').parents('.sub-menu').length) { 3742 var $currentSubmenu = $current.closest('ul.sub-menu'); 3743 var $parentItem = $currentSubmenu.parent('li'); 3744 var $toggle = $parentItem.find('> .pp-has-submenu-container > .pp-menu-toggle:visible'); 3745 if ($toggle.length) { 3746 $toggle.focus(); 3747 } else { 3748 $parentItem.find('> .pp-has-submenu-container > a').focus(); 3749 } 3750 return; 3751 } 3752 3753 // Don't loop back to the last item if we're on the first item of a submenu 3754 if ( index === 0 ) { 3755 $items.eq(index).focus(); 3756 return; 3757 } 3758 3759 $items.eq(index - 1).focus(); 3760 return; 3761 } 3762 3763 }.bind( this ) ); 3764 } 3765 3766 if ( this._isMenuToggle() || this.type == 'accordion' || isDesktopClickReveal ) { 3767 $( this.wrapperClass ).off( 'mouseenter.pp-advanced-menu-hover mouseleave.pp-advanced-menu-hover', 'li.menu-item' ); 3768 this._menuOnClick(); 3769 this._clickOrHover(); 3770 } else { 3771 $( this.wrapperClass ).off( 'click.pp-advanced-menu keyup', '.pp-has-submenu-container' ); 3772 this._submenuOnRight(); 3773 this._submenuRowZindexFix(); 3774 } 3775 3776 if ( this.mobileToggle != 'expanded' ) { 3777 this._toggleForMobile(); 3778 } 3779 3780 $(this.wrapperClass).find('li:not(.menu-item-has-children)').on('click', 'a', function (e) { 3781 if ( $(e.target).closest( '.pp-menu-search-item' ).length > 0 ) { 3782 return; 3783 } 3784 3785 $(this.nodeClass).find('.pp-advanced-menu').removeClass('menu-open'); 3786 $(this.nodeClass).find('.pp-advanced-menu').addClass('menu-close'); 3787 $('html').removeClass('pp-off-canvas-menu-open'); 3788 $('html').removeClass('pp-full-screen-menu-open'); 3789 3790 }.bind( this ) ); 3791 3792 if ( $( this.wrapperClass ).find( '.pp-menu-search-item' ).length ) { 3793 this._toggleMenuSearch(); 3794 } 3795 3796 if ( $( this.wrapperClass ).find( '.pp-menu-cart-item').length ) { 3797 this._wooUpdateParams(); 3798 } 3799 }, 3800 3801 /** 3802 * Initializes submenu dropdowns. 3803 * 3804 * @since 2.33.x 3805 * @return void 3806 */ 3807 _setupSubmenu: function() { 3808 // $( this.wrapperClass + ' ul.sub-menu' ).each( function(){ 3809 // $( this ).closest( 'li' ).attr( 'aria-haspopup', 'true' ); 3810 // }); 3811 }, 3812 3813 _menuOnHover: function() { 3814 $( this.wrapperClass ) 3815 .off( 'mouseenter.pp-advanced-menu-hover mouseleave.pp-advanced-menu-hover', 'li.menu-item' ) 3816 .on( 'mouseenter.pp-advanced-menu-hover', 'li.menu-item', function() { 3817 $(this).addClass( 'hover' ); 3818 } ).on( 'mouseleave.pp-advanced-menu-hover', 'li.menu-item', function() { 3819 $(this).removeClass( 'hover' ); 3820 } ); 3821 }, 3822 3823 /** 3824 * Adds a focus class to menu elements similar to be used similar to CSS :hover psuedo event 3825 * 3826 * @since 1.9.0 3827 * @return void 3828 */ 3829 _menuOnFocus: function() { 3830 $( this.nodeClass ).off('focus', 'a').on( 'focus', 'a', function( e ) { 3831 var $menuItem = $( e.target ).parents( '.menu-item' ).first(), 3832 $parents = $( e.target ).parentsUntil( this.wrapperClass ); 3833 3834 $('.pp-advanced-menu .focus:not(.pp-menu-toggle)').removeClass('focus'); 3835 3836 $menuItem.addClass('focus'); 3837 $parents.addClass('focus'); 3838 3839 }.bind( this ) ).on( 'focusout', 'a', function( e ) { 3840 if ( $('.pp-advanced-menu .focus').hasClass('pp-has-submenu') ) { 3841 $( e.target ).parentsUntil( this.wrapperClass ).find('.pp-has-submenu-container').removeClass('first-click'); 3842 } 3843 }.bind( this ) ); 3844 3845 $( this.nodeClass ).off('focus', '.pp-menu-toggle').on( 'focus', '.pp-menu-toggle', function( e ) { 3846 $(e.target).addClass( 'focus' ); 3847 }.bind( this ) ).off('blur', '.pp-menu-toggle').on( 'blur', '.pp-menu-toggle', function( e ) { 3848 if ( $(e.target).parents( 'li.pp-has-submenu.pp-active' ).length === 0 || $(e.target).parents( 'li.pp-has-submenu.pp-active' ).parent( 'ul.menu' ).length === 0 ) { 3849 $(e.target).removeClass( 'focus' ); 3850 } 3851 }.bind( this ) ); 3852 }, 3853 3854 /** 3855 * Logic for submenu toggling on accordions or mobile menus (vertical, horizontal) 3856 * 3857 * @since 1.6.1 3858 * @return void 3859 */ 3860 _menuOnClick: function() { 3861 var self = this; 3862 var $mainItem = ''; 3863 3864 $( this.wrapperClass ) 3865 .off( 'click.pp-advanced-menu keyup', '.pp-has-submenu-container' ) 3866 .on( 'click.pp-advanced-menu keyup', '.pp-has-submenu-container', function( e ) { 3867 var isValidEvent = e.which == 1 || e.which == 13 || e.which == undefined; // click or enter key press. 3868 if ( ! isValidEvent ) { 3869 return; 3870 } 3871 if ( e.which == 13 && ! $(e.target).hasClass( 'pp-menu-toggle' ) ) { // prevent event bubbling. 3872 return; 3873 } 3874 if ( self._isTouch() ) { 3875 if ( ! $(this).hasClass('first-click') ) { 3876 e.preventDefault(); 3877 $(this).addClass('first-click'); 3878 } 3879 } 3880 3881 e.stopPropagation(); 3882 3883 var isMainEl = $(e.target).parents('.menu-item').parent().parent().hasClass('pp-advanced-menu'); 3884 3885 if (isMainEl && $mainItem === '') { 3886 $mainItem = $(e.target).parents('.menu-item'); 3887 } 3888 3889 var $link = $( e.target ).parents( '.pp-has-submenu' ).first(), 3890 $subMenu = $link.children( '.sub-menu' ).first(), 3891 $href = $link.children('.pp-has-submenu-container').first().find('> a').attr('href'), 3892 $subMenuParents = $( e.target ).parents( '.sub-menu' ), 3893 $activeParent = $( e.target ).closest( '.pp-has-submenu.pp-active' ), 3894 toggleSpeed = $link.closest( '.off-canvas' ).length || $link.closest( '.full-screen' ).length ? 200 : 100; 3895 toggleEffect = $link.closest( '.off-canvas' ).length || $link.closest( '.full-screen' ).length ? 'slideToggle' : 'fadeToggle'; 3896 3897 if ( $activeParent.length > 0 ) { 3898 $activeParent.find( '.pp-menu-toggle' ).first().attr('aria-expanded', true); 3899 } else { 3900 $activeParent.find( '.pp-menu-toggle' ).first().attr('aria-expanded', false); 3901 } 3902 3903 if( !$subMenu.is(':visible') || $(e.target).hasClass('pp-menu-toggle') 3904 || ($subMenu.is(':visible') && (typeof $href === 'undefined' || $href == '#')) ) { 3905 if ( ! $(this.wrapperClass).hasClass('pp-advanced-menu-accordion-collapse') ) { 3906 e.preventDefault(); 3907 } 3908 if ( $(e.target).hasClass('pp-menu-toggle') ) { 3909 e.stopPropagation(); 3910 e.preventDefault(); 3911 } 3912 } 3913 else { 3914 e.stopPropagation(); 3915 window.location.href = $href; 3916 return; 3917 } 3918 3919 if ($(this.wrapperClass).hasClass('pp-advanced-menu-accordion-collapse')) { 3920 3921 if ( $link.parents('.menu-item').length && !$link.parents('.menu-item').hasClass('pp-active') ) { 3922 $('.menu .pp-active', this.wrapperClass).not($link).removeClass('pp-active'); 3923 } 3924 else if ($link.parents('.menu-item').hasClass('pp-active') && $link.parent('.sub-menu').length) { 3925 $('.menu .pp-active', this.wrapperClass).not($link).not($activeParent).removeClass('pp-active'); 3926 } 3927 3928 $('.sub-menu', this.wrapperClass).not($subMenu).not($subMenuParents).slideUp('normal'); 3929 } 3930 3931 // Parent menu toggle icon was being reversed on collapsing its submenu, 3932 // so here is the workaround to fix this behavior. 3933 if ($(self.wrapperClass).find('.sub-menu:visible').length > 0) { 3934 $(self.wrapperClass).find('.sub-menu:visible').parent().addClass('pp-active'); 3935 } 3936 3937 $subMenu[toggleEffect](toggleSpeed, function() { 3938 // Reset previously opened sub-menu toggle icon. 3939 $(e.target).parents('.pp-has-submenu-container').parent().parent().find('> .menu-item.pp-active').removeClass('pp-active'); 3940 3941 if ($mainItem !== '') { 3942 $mainItem.parent().find('.menu-item.pp-active').removeClass('pp-active'); 3943 $(self.wrapperClass).find('.sub-menu').parent().removeClass('pp-active'); 3944 3945 if ($(self.wrapperClass).find('.sub-menu:visible').length > 0) { 3946 $(self.wrapperClass).find('.sub-menu:visible').parent().addClass('pp-active'); 3947 } else { 3948 $link.toggleClass('pp-active'); 3949 $mainItem.removeClass('pp-active'); 3950 } 3951 } else { 3952 $link.toggleClass('pp-active'); 3953 } 3954 if (!$subMenu.is(':visible')) { 3955 $subMenu.parent().removeClass('pp-active'); 3956 $subMenu.parent().find('> .pp-has-submenu-container .pp-menu-toggle').attr('aria-expanded', false); 3957 } else { 3958 $subMenu.parent().find('> .pp-has-submenu-container .pp-menu-toggle').attr('aria-expanded', true); 3959 } 3960 }); 3961 3962 }.bind( this ) ); 3963 3964 }, 3965 3966 /** 3967 * Logic for submenu items click event 3968 * 3969 * @since 1.3.1 3970 * @return void 3971 */ 3972 _submenuOnClick: function(){ 3973 $( 'body' ).off( 'click', this.wrapperClass + ' .sub-menu a' ).on( 'click', this.wrapperClass + ' .sub-menu a', function( e ){ 3974 if ( $( e.target ).parent().hasClass('focus') ) { 3975 $( e.target ).parentsUntil( this.wrapperClass ).removeClass( 'focus' ); 3976 } 3977 }.bind( this ) ); 3978 }, 3979 3980 /** 3981 * Changes general styling and behavior of menus based on mobile / desktop viewport. 3982 * 3983 * @see this._isMobile() 3984 * @since 1.6.1 3985 * @return void 3986 */ 3987 _clickOrHover: function() { 3988 this.$submenus = this.$submenus || $( this.wrapperClass ).find( '.sub-menu' ); 3989 var $wrapper = $( this.wrapperClass ), 3990 $menu = $wrapper.find( '.menu' ); 3991 $li = $wrapper.find( '.pp-has-submenu' ); 3992 3993 if( this._isMenuToggle() ) { 3994 $li.each( function() { 3995 if( !$(this).hasClass('pp-active') ) { 3996 $(this).find( '.sub-menu' ).hide(); 3997 } 3998 } ); 3999 } else { 4000 $li.each( function() { 4001 if( !$(this).hasClass('pp-active') ) { 4002 $(this).find( '.sub-menu' ).css( { 4003 'display' : '', 4004 'opacity' : '' 4005 } ); 4006 } 4007 } ); 4008 } 4009 }, 4010 4011 /** 4012 * Logic to prevent submenus to go outside viewport boundaries. 4013 * 4014 * @since 1.6.1 4015 * @return void 4016 */ 4017 _submenuOnRight: function() { 4018 4019 $( this.wrapperClass ) 4020 .on( 'mouseenter focus', '.pp-has-submenu', function( e ) { 4021 4022 if( $ ( e.currentTarget ).find('.sub-menu').length === 0 ) { 4023 return; 4024 } 4025 4026 var $link = $( e.currentTarget ), 4027 $parent = $link.parent(), 4028 $subMenu = $link.find( '.sub-menu' ), 4029 subMenuWidth = $subMenu.width(), 4030 subMenuPos = 0, 4031 winWidth = window.innerWidth; 4032 4033 if( $link.closest( '.pp-menu-submenu-right' ).length !== 0) { 4034 4035 $link.addClass( 'pp-menu-submenu-right' ); 4036 4037 } else if( $( 'body' ).hasClass( 'rtl' ) ) { 4038 4039 subMenuPos = $parent.is( '.sub-menu' ) ? 4040 $parent.offset().left - subMenuWidth: 4041 $link.offset().left - subMenuWidth; 4042 4043 if( subMenuPos <= 0 ) { 4044 $link.addClass( 'pp-menu-submenu-right' ); 4045 } 4046 4047 } else { 4048 4049 subMenuPos = $parent.is( '.sub-menu' ) ? 4050 $parent.offset().left + $parent.width() + subMenuWidth : 4051 $link.offset().left + subMenuWidth; 4052 4053 if( subMenuPos > winWidth ) { 4054 $link.addClass('pp-menu-submenu-right'); 4055 } 4056 } 4057 }.bind( this ) ) 4058 .on( 'mouseleave', '.pp-has-submenu', function( e ) { 4059 $( e.currentTarget ).removeClass( 'pp-menu-submenu-right' ); 4060 }.bind( this ) ); 4061 4062 }, 4063 4064 /** 4065 * Logic to prevent submenus to go behind the next overlay row. 4066 * 4067 * @since 2.2 4068 * @return void 4069 */ 4070 _submenuRowZindexFix: function (e) { 4071 4072 $(this.wrapperClass) 4073 .on('mouseenter', 'ul.menu > .pp-has-submenu', function (e) { 4074 4075 if ($(e.currentTarget).find('.sub-menu').length === 0) { 4076 return; 4077 } 4078 4079 $(this.nodeClass) 4080 .closest('.fl-row') 4081 .find(
4081'.fl-row-content') 4082 .css('z-index', '10'); 4083 4084 }.bind( this ) ) 4085 .on('mouseleave', 'ul.menu > .pp-has-submenu', function (e) { 4086 4087 $(this.nodeClass) 4088 .closest('.fl-row') 4089 .find('.fl-row-content') 4090 .css('z-index', ''); 4091 4092 }.bind( this ) ); 4093 }, 4094 4095 /** 4096 * Logic for the mobile menu button. 4097 * 4098 * @since 1.6.1 4099 * @return void 4100 */ 4101 _toggleForMobile: function() { 4102 4103 var $wrapper = null, 4104 $menu = null, 4105 self = this; 4106 4107 if ( this._isMenuToggle() ) { 4108 $wrapper = $(this.wrapperClass); 4109 if ( this._isMobileBelowRowEnabled() ) { 4110 this._placeMobileMenuBelowRow(); 4111 $menu = $(this.nodeClass + '-clone'); 4112 $menu.find('ul.menu').show(); 4113 } else { 4114 $menu = $wrapper.find('.menu'); 4115 } 4116 4117 if( !$wrapper.find( '.pp-advanced-menu-mobile-toggle' ).hasClass( 'pp-active' ) && this.mobileMenuType === 'default' ) { 4118 $menu.css({ display: 'none' }); 4119 } 4120 4121 $wrapper 4122 .off( 'click.pp-mobile-menu-toggle', '.pp-advanced-menu-mobile-toggle' ) 4123 .on( 'click.pp-mobile-menu-toggle', '.pp-advanced-menu-mobile-toggle', function( e ) { 4124 e.stopPropagation(); 4125 $(this).toggleClass( 'pp-active' ); 4126 if ( $(this).hasClass('pp-active') ) { 4127 $(this).attr('aria-expanded', 'true'); 4128 $menu.addClass( 'pp-menu-visible' ); 4129 } else { 4130 $(this).attr('aria-expanded', 'false'); 4131 $menu.removeClass( 'pp-menu-visible' ); 4132 } 4133 $menu.slideToggle(); 4134 } ); 4135 4136 $menu.on( 'click', '.menu-item > a[href*="#"]', function(e) { 4137 var $href = $(this).attr('href'), 4138 $targetID = ''; 4139 4140 if ( $href !== '#' ) { 4141 $targetID = $href.split('#')[1]; 4142 4143 if ( $('body').find('#'+ $targetID).length > 0 ) { 4144 e.preventDefault(); 4145 $( this ).toggleClass( 'pp-active' ); 4146 setTimeout(function() { 4147 $('html, body').animate({ 4148 scrollTop: $('#'+ $targetID).offset().top 4149 }, 1000, function() { 4150 window.location.hash = $targetID; 4151 }); 4152 }, 500); 4153 4154 if ( ! self._isMenuToggle() ) { 4155 $menu.slideToggle(); 4156 } 4157 } 4158 } 4159 }); 4160 } 4161 else { 4162 4163 if ( this._isMobileBelowRowEnabled() ) { 4164 this._removeMenuFromBelowRow(); 4165 } 4166 4167 $wrapper = $( this.wrapperClass ), 4168 $menu = $wrapper.children( '.menu' ); 4169 $wrapper.find( '.pp-advanced-menu-mobile-toggle' ).removeClass( 'pp-active' ); 4170 $menu.css({ display: '' }); 4171 } 4172 }, 4173 4174 /** 4175 * Init any mega menus that exist. 4176 * 4177 * @see this._isMenuToggle() 4178 * @since 1.10.4 4179 * @return void 4180 */ 4181 _initMegaMenus: function() { 4182 4183 var module = $( this.nodeClass ), 4184 rowContent = module.closest( '.fl-row-content' ), 4185 rowWidth = rowContent.width(), 4186 megas = module.find( '.mega-menu' ), 4187 disabled = module.find( '.mega-menu-disabled' ), 4188 isToggle = this._isMenuToggle(); 4189 4190 if ( isToggle ) { 4191 megas.removeClass( 'mega-menu' ).addClass( 'mega-menu-disabled' ); 4192 module.find( 'li.mega-menu-disabled > ul.sub-menu' ).css( 'width', '' ); 4193 rowContent.css( 'position', '' ); 4194 } else { 4195 disabled.removeClass( 'mega-menu-disabled' ).addClass( 'mega-menu' ); 4196 module.find( 'li.mega-menu > ul.sub-menu' ).css( 'width', rowWidth + 'px' ); 4197 rowContent.css( 'position', 'relative' ); 4198 } 4199 }, 4200 4201 /** 4202 * Init off-canvas menu. 4203 * 4204 * @since 1.2.8 4205 * @return void 4206 */ 4207 _initOffCanvas: function() { 4208 if ( this.mobileMenuType !== 'off-canvas' ) { 4209 return; 4210 } 4211 $('html').addClass('pp-off-canvas-menu-module'); 4212 $('html').addClass('pp-off-canvas-menu-' + this.offCanvasDirection); 4213 4214 if ( $(this.nodeClass).find( '#pp-menu-' + this.settingsId ).length === 0 ) { 4215 return; 4216 } 4217 4218 var menuHTML = $(this.nodeClass).find( '#pp-menu-' + this.settingsId ).html(); 4219 4220 if ( null === this.offCanvasMenu ) { 4221 this.offCanvasMenu = $('<div id="pp-advanced-menu-off-canvas-'+this.settingsId+'" class="fl-node-'+this.settingsId+' pp-menu-off-canvas" />').html( menuHTML ); 4222 } 4223 if ( $('#pp-advanced-menu-off-canvas-'+this.settingsId).length === 0 && null !== this.offCanvasMenu && ! this.isBuilderActive ) { 4224 this.offCanvasMenu.appendTo( 'body' ); 4225 } 4226 4227 $(this.nodeClass).trigger('pp-advanced-menu-off-canvas-init', [this.offCanvasMenu]); 4228 4229 this._toggleMenu(); 4230 }, 4231 4232 /** 4233 * Init full-screen overlay menu. 4234 * 4235 * @since 1.2.8 4236 * @return void 4237 */ 4238 _initFullScreen: function() { 4239 if ( this.mobileMenuType !== 'full-screen' ) { 4240 return; 4241 } 4242 4243 $('html').addClass('pp-full-screen-menu-module'); 4244 4245 if ( $(this.nodeClass).find( '#pp-menu-' + this.settingsId ).length === 0 ) { 4246 return; 4247 } 4248 4249 var menuHTML = $(this.nodeClass).find( '#pp-menu-' + this.settingsId ).html(); 4250 4251 if ( null === this.fullScreenMenu ) {
4252 this.fullScreenMenu = $('<div id="pp-advanced-menu-full-screen-'+this.settingsId+'" class="fl-node-'+this.settingsId+' pp-menu-full-screen" />').html( menuHTML ); 4253 } 4254 if ( $('#pp-advanced-menu-full-screen-'+this.settingsId).length === 0 && null !== this.fullScreenMenu && ! this.isBuilderActive ) { 4255 this.fullScreenMenu.appendTo( 'body' ); 4256 } 4257 4258 $(this.nodeClass).trigger('pp-advanced-menu-full-screen-init', [this.fullScreenMenu]); 4259 4260 this._toggleMenu(); 4261 }, 4262 4263 /** 4264 * Trigger the toggle event for off-canvas 4265 * and full-screen overlay menus. 4266 * 4267 * @since 1.2.8 4268 * @return void 4269 */ 4270 _toggleMenu: function() { 4271 var self = this; 4272 var singleInstance = true; 4273 if( self.mobileMenuType === 'full-screen' ) { 4274 var winHeight = window.innerHeight; 4275 $(self.nodeClass).find('.pp-menu-overlay').css('height', winHeight + 'px'); 4276 $(window).on('resize', function() { 4277 winHeight = window.innerHeight; 4278 $(self.nodeClass).find('.pp-menu-overlay').css('height', winHeight + 'px'); 4279 }); 4280 } 4281 4282 // Toggle Click 4283 var toggleEvent = ('ontouchend' in window) && this._isIOS() ? 'touchend' : 'click'; 4284 $(self.nodeClass).find('.pp-advanced-menu-mobile-toggle' ).off(toggleEvent).on( toggleEvent, function() { 4285 if ( singleInstance ) { 4286 if ( $('.pp-advanced-menu.menu-open').length > 0 ) { 4287 $('.pp-advanced-menu').removeClass('menu-open'); 4288 $('html').removeClass('pp-full-screen-menu-open'); 4289 } 4290 } 4291 if( $(self.nodeClass).find('.pp-advanced-menu').hasClass('menu-open') ) { 4292 $(self.nodeClass).find('.pp-advanced-menu').removeClass('menu-open'); 4293 $(self.nodeClass).find('.pp-advanced-menu').addClass('menu-close'); 4294 $('html').removeClass('pp-off-canvas-menu-open'); 4295 $('html').removeClass('pp-full-screen-menu-open'); 4296 } else { 4297 $(self.nodeClass).find('.pp-advanced-menu').addClass('menu-open'); 4298 if( self.mobileMenuType === 'off-canvas' ) { 4299 $('html').addClass('pp-off-canvas-menu-open'); 4300 self.offCanvasMenu.find('nav').attr('tabindex', '0').trigger( 'focus' ); 4301 $(this).attr( 'tabindex', '-1' ).trigger( 'blur' ); 4302 } 4303 if( self.mobileMenuType === 'full-screen' ) { 4304 $('html').addClass('pp-full-screen-menu-open'); 4305 self.fullScreenMenu.find('nav').attr('tabindex', '0').trigger( 'focus' ); 4306 $(this).attr( 'tabindex', '-1' ).trigger( 'blur' ); 4307 } 4308 } 4309 4310 if ( '0' == $(this).attr('tabindex') ) { 4311 $(this).attr('aria-expanded', 'false'); 4312 } else { 4313 $(this).attr('aria-expanded', 'true'); 4314 } 4315 } ); 4316 4317 // iOS Safari "hover" fix. 4318 // This is needed to ensure the click event works properly on iOS devices since they treat the first tap as a hover event, 4319 // which can interfere with the intended toggle behavior of the menu. 4320 // $(self.nodeClass).find('.pp-advanced-menu-mobile-toggle' ).on( 'touchstart', function(e) { 4321 // e.preventDefault(); 4322 // e.stopPropagation(); 4323 // $(this).trigger('click'); 4324 // } ); 4325 4326 // Keyboard navigation. 4327 $(self.nodeClass).find('.pp-advanced-menu-mobile-toggle').on('keyup', function(e) { 4328 if ( 13 === e.keyCode || 13 === e.which ) { 4329 $(this).trigger('click'); 4330 } 4331 }); 4332 4333 // Close button click 4334 $(self.nodeClass).find('.pp-advanced-menu .pp-menu-close-btn, .pp-clear').on( 'click', function() { 4335 $(self.nodeClass).find('.pp-advanced-menu').removeClass('menu-open'); 4336 $(self.nodeClass).find('.pp-advanced-menu').addClass('menu-close'); 4337 $('html').removeClass('pp-off-canvas-menu-open'); 4338 $('html').removeClass('pp-full-screen-menu-open'); 4339 4340 if ( $(self.nodeClass).find('.pp-advanced-menu-mobile-toggle' ).is( ':visible' ) ) { 4341 setTimeout(function() { 4342 $(self.nodeClass).find('.pp-advanced-menu-mobile-toggle' ) 4343 .attr( 'tabindex', 0 ) 4344 .attr( 'aria-expanded', 'false' ) 4345 .trigger( 'focus' ); 4346 }, 120); 4347 } 4348 4349 if ( self.offCanvasMenu && self.offCanvasMenu.length > 0 ) { 4350 self.offCanvasMenu.find('nav').attr('tabindex', '-1').trigger( 'blur' ); 4351 } 4352 if ( self.fullScreenMenu && self.fullScreenMenu.length > 0 ) { 4353 self.fullScreenMenu.find('nav').attr('tabindex', '-1').trigger( 'blur' ); 4354 } 4355 } ); 4356 4357 if ( this.isBuilderActive ) { 4358 setTimeout(function() {
4359 if ( $('.fl-builder-settings[data-node="'+self.settingsId+'"]').length > 0 ) { 4360 $('.pp-advanced-menu').removeClass('menu-open'); 4361 $(self.nodeClass).find('.pp-advanced-menu-mobile-toggle').trigger('click'); 4362 } 4363 }, 600); 4364 4365 FLBuilder.addHook('settings-form-init', function() { 4366 if ( ! $('.fl-builder-settings[data-node="'+self.settingsId+'"]').length > 0 ) { 4367 return; 4368 } 4369 if ( ! $(self.nodeClass).find('.pp-advanced-menu').hasClass('menu-open') ) { 4370 $('.pp-advanced-menu').removeClass('menu-open'); 4371 $(self.nodeClass).find('.pp-advanced-menu-mobile-toggle').trigger('click'); 4372 } 4373 }); 4374 4375 if ( $('html').hasClass('pp-full-screen-menu-open') && ! $(self.nodeClass).find('.pp-advanced-menu').hasClass('menu-open') ) { 4376 $('html').removeClass('pp-full-screen-menu-open'); 4377 } 4378 if ( $('html').hasClass('pp-off-canvas-menu-open') && ! $(self.nodeClass).find('.pp-advanced-menu').hasClass('menu-open') ) { 4379 $('html').removeClass('pp-off-canvas-menu-open'); 4380 } 4381 } 4382 }, 4383 4384 /** 4385 * Check to see if Below Row should be enabled. 4386 * 4387 * @since 2.8.0 4388 * @return boolean 4389 */ 4390 _isMobileBelowRowEnabled: function() { 4391 if (this.mobileMenuType === 'default') { 4392 return this.mobileBelowRow && $( this.nodeClass ).closest( '.fl-col' ).length; 4393 } 4394 return false; 4395 }, 4396 4397 /** 4398 * Logic for putting the mobile menu below the menu's 4399 * column so it spans the full width of the page. 4400 * 4401 * @since 2.2 4402 * @return void 4403 */ 4404 _placeMobileMenuBelowRow: function () { 4405 4406 if ($(this.nodeClass + '-clone').length) { 4407 return; 4408 } 4409 // if ( $('html').hasClass( 'fl-builder-edit' ) ) { 4410 // return; 4411 // } 4412 4413 var module = $(this.nodeClass), 4414 clone = null, 4415 row = module.closest('.fl-row-content'); 4416 4417 if ( module.length < 1 ) { 4418 return; 4419 } 4420 4421 clone = ( module.length > 1 ) ? $( module[0] ).clone() : module.clone(); 4422 module.find('.pp-menu-nav').remove(); 4423 clone.addClass((this.nodeClass + '-clone').replace('.', '')); 4424 clone.addClass('pp-menu-mobile-clone'); 4425 clone.find('.pp-advanced-menu-mobile').remove(); 4426 row.append(clone); 4427 4428 // Removes animation when enabled. 4429 if ( module.hasClass( 'fl-animation' ) ) { 4430 clone.removeClass( 'fl-animation' ); 4431 } 4432 4433 this._menuOnClick(); 4434 }, 4435 4436 /** 4437 * Logic for removing the mobile menu from below the menu's 4438 * column and putting it back in the main wrapper. 4439 * 4440 * @since 2.2 4441 * @return void 4442 */ 4443 _removeMenuFromBelowRow: function () { 4444 4445 if (!$(this.nodeClass + '-clone').length) { 4446 return; 4447 } 4448 4449 var module = $(this.nodeClass), 4450 clone = $(this.nodeClass + '-clone'), 4451 menu = clone.find('.pp-menu-nav'); 4452 4453 module.find('.pp-advanced-menu-mobile').after(menu); 4454 module.find('.pp-advanced-menu-mobile-toggle').attr( 'aria-expanded', false ); 4455 clone.remove(); 4456 }, 4457 4458 _toggleMenuSearch: function() { 4459 var items = $( this.wrapperClass ).find( '.pp-menu-search-item' ), 4460 self = this; 4461 4462 items.each( function() { 4463 var item = $(this); 4464 var button = item.find( '> a' ), 4465 form = item.find( '.pp-search-form' ), 4466 input = item.find('.pp-search-form__input'); 4467 4468 button.on( 'click', function(e) { 4469 e.preventDefault(); 4470 item.toggleClass( 'pp-search-active' ); 4471 if ( item.hasClass( 'pp-search-active' ) ) { 4472 setTimeout( function() { 4473 input.focus(); 4474 self._focusMenuSearch( input ); 4475 }, 100 ); 4476 } 4477 4478 $('body').on( 'click.pp-menu-search', self._hideMenuSearch.bind( self ) ); 4479 } ); 4480 4481 input.on( 'focus', function() { 4482 form.addClass( 'pp-search-form--focus' ); 4483 } ).on( 'blur', function() { 4484 form.removeClass( 'pp-search-form--focus' ); 4485 } ); 4486 4487 // Close search form on ESC key press. 4488 input.on( 'keyup', function(e) { 4489 if ( e.key === 'Escape' || e.keyCode === 27 ) { 4490 item.removeClass( 'pp-search-active' ); 4491 $('body').off('click.pp-menu-search'); 4492 button.delay(100).focus(); 4493 } 4494 } ); 4495 } ); 4496 }, 4497 4498 _hideMenuSearch: function(e) { 4499 if (e !== undefined) { 4500 if ($(e.target).closest('.pp-menu-search-item').length > 0) { 4501 return; 4502 } 4503 } 4504 4505 $( this.wrapperClass ).find( '.pp-menu-search-item' ).removeClass( 'pp-search-active' ); 4506 $('body').off('click.pp-menu-search'); 4507 }, 4508 4509 _focusMenuSearch: function( $el ) { 4510 // If this function exists... (IE 9+) 4511 if ( $el[0].setSelectionRange ) { 4512 // Double the length because Opera is inconsistent about whether a carriage return is one character or tw
4512o. 4513 var len = $el.val().length * 2; 4514 4515 // Timeout seems to be required for Blink 4516 setTimeout(function() { 4517 $el[0].setSelectionRange( len, len ); 4518 }, 1); 4519 } else { 4520 // As a fallback, replace the contents with itself 4521 // Doesn't work in Chrome, but Chrome supports setSelectionRange 4522 $el.val( $el.val() ); 4523 } 4524 }, 4525 4526 /** 4527 * Adds menu node and post ID to WooCommerce ajax URL requests. 4528 * 4529 * @since 2.20 4530 * @return void 4531 */ 4532 _wooUpdateParams: function() { 4533 if ( 'undefined' !== typeof wc_cart_fragments_params ) { 4534 wc_cart_fragments_params.wc_ajax_url += '&pp-advanced-menu-node='+ this.settingsId +'&post-id='+ this.postId; 4535 } 4536 if ( 'undefined' !== typeof wc_add_to_cart_params ) { 4537 wc_add_to_cart_params.wc_ajax_url += '&pp-advanced-menu-node='+ this.settingsId +'&post-id='+ this.postId; 4538 } 4539 }, 4540 4541 _validClick: function(e) { 4542 return (e.which == 1 || e.which == 13 || e.which == 32 || e.which == undefined) ? true : false; 4543 } 4544 4545 }; 4546 4547})(jQuery); 4548 4549var pp_menu_c9ebyd4kjs36; 4550(function($) { 4551 4552 pp_menu_c9ebyd4kjs36 = new PPAdvancedMenu({ 4553 id: 'c9ebyd4kjs36', 4554 type: 'horizontal', 4555 mobile: 'expanded', 4556 menuPosition: 'below', 4557 breakpoints: { 4558 large: 1200, 4559 medium: 992, 4560 small: 768, 4561 custom: 768 }, 4562 mobileBreakpoint: 'mobile', 4563 mediaBreakpoint: '768', 4564 mobileMenuType: 'default', 4565 offCanvasDirection: 'left', 4566 submenuRevealTrigger: 'hover', 4567 fullScreenAnimation: '', 4568 isBuilderActive: false }); 4569 4570})(jQuery); 4571 4572/* Start Layout Custom JS */ 4573 4574/* End Layout Custom JS */ 4575 4576 4577/*! 4578 * Bowser - a browser detector 4579 * https://github.com/ded/bowser 4580 * MIT License | (c) Dustin Diaz 2015 4581 */ 4582 4583!function (name, definition) { 4584 if (typeof module != 'undefined' && module.exports) module.exports = definition() 4585 else if (typeof define == 'function' && define.amd) define(name, definition) 4586 else this[name] = definition() 4587}('bowser', function () { 4588 /** 4589 * See useragents.js for examples of navigator.userAgent 4590 */ 4591 4592 var t = true 4593 4594 function detect(ua) { 4595 4596 function getFirstMatch(regex) { 4597 var match = ua.match(regex); 4598 return (match && match.length > 1 && match[1]) || ''; 4599 } 4600 4601 function getSecondMatch(regex) { 4602 var match = ua.match(regex); 4603 return (match && match.length > 1 && match[2]) || ''; 4604 } 4605 4606 var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() 4607 , likeAndroid = /like android/i.test(ua) 4608 , android = !likeAndroid && /android/i.test(ua) 4609 , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) 4610 , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) 4611 , chromeos = /CrOS/.test(ua) 4612 , silk = /silk/i.test(ua) 4613 , sailfish = /sailfish/i.test(ua) 4614 , tizen = /tizen/i.test(ua) 4615 , webos = /(web|hpw)os/i.test(ua) 4616 , windowsphone = /windows phone/i.test(ua) 4617 , windows = !windowsphone && /windows/i.test(ua) 4618 , mac = !iosdevice && !silk && /macintosh/i.test(ua) 4619 , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) 4620 , edgeVersion = getFirstMatch(/edge\/(\d+(\.\d+)?)/i) 4621 , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) 4622 , tablet = /tablet/i.test(ua) 4623 , mobile = !tablet && /[^-]mobi/i.test(ua) 4624 , xbox = /xbox/i.test(ua) 4625 , result 4626 4627 if (/opera|opr|opios/i.test(ua)) { 4628 result = { 4629 name: 'Opera' 4630 , opera: t 4631 , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) 4632 } 4633 } 4634 else if (/coast/i.test(ua)) { 4635 result = { 4636 name: 'Opera Coast' 4637 , coast: t 4638 , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) 4639 } 4640 } 4641 else if (/yabrowser/i.test(ua)) { 4642 result = { 4643 name: 'Yandex Browser' 4644 , yandexbrowser: t 4645 , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) 4646 } 4647 } 4648 else if (/ucbrowser/i.test(ua)) { 4649 result = { 4650 name: 'UC Browser' 4651 , ucbrowser: t 4652 , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) 4653 } 4654 } 4655 else if (/mxios/i.test(ua)) { 4656 result = { 4657 name: 'Maxthon' 4658 , maxthon: t 4659 , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) 4660 } 4661 } 4662 else if (/epiphany/i.test(ua)) { 4663 result = { 4664 name: 'Epiphany' 4665 , epiphany: t 4666 , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) 4667 } 4668 } 4669 else if (/puffin/i.test(ua)) { 4670 result = { 4671 name: 'Puffin' 4672 , puffin: t 4673 , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) 4674 } 4675 } 4676 else if (/sleipnir/i.test(ua)) { 4677 result = { 4678 name: 'Sleipnir' 4679 , sleipnir: t 4680 , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) 4681 } 4682 } 4683 else if (/k-meleon/i.test(ua)) { 4684 result = { 4685 name: 'K-Meleon' 4686 , kMeleon: t 4687 , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) 4688 } 4689 } 4690 else if (windowsphone) { 4691 result = { 4692 name: 'Windows Phone' 4693 , windowsphone: t 4694 } 4695 if (edgeVersion) { 4696 result.msedge = t 4697 result.version = edgeVersion 4698 } 4699 else { 4700 result.msie = t 4701 result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i) 4702 } 4703 } 4704 else if (/msie|trident/i.test(ua)) { 4705 result = { 4706 name: 'Internet Explorer' 4707 , msie: t 4708 , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) 4709 } 4710 } else if (chromeos) { 4711 result = { 4712 name: 'Chrome' 4713 , chromeos: t 4714 , chromeBook: t 4715 , chrome: t 4716 , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) 4717 } 4718 } else if (/chrome.+? edge/i.test(ua)) { 4719 result = { 4720 name: 'Microsoft Edge' 4721 , msedge: t 4722 , version: edgeVersion 4723 } 4724 } 4725 else if (/vivaldi/i.test(ua)) { 4726 result = { 4727 name: 'Vivaldi' 4728 , vivaldi: t 4729 , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier 4730 } 4731 } 4732 else if (sailfish) { 4733 result = { 4734 name: 'Sailfish' 4735 , sailfish: t 4736 , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) 4737 } 4738 } 4739 else if (/seamonkey\//i.test(ua)) { 4740 result = { 4741 name: 'SeaMonkey' 4742 , seamonkey: t 4743 , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) 4744 } 4745 } 4746 else if (/firefox|iceweasel|fxios/i.test(ua)) { 4747 result = { 4748 name: 'Firefox' 4749 , firefox: t 4750 , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) 4751 } 4752 if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { 4753 result.firefoxos = t 4754 } 4755 } 4756 else if (silk) { 4757 result = { 4758 name: 'Amazon Silk' 4759 , silk: t 4760 , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) 4761 } 4762 } 4763 else if (/phantom/i.test(ua)) { 4764 result = { 4765 name: 'PhantomJS' 4766 , phantom: t 4767 , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) 4768 } 4769 } 4770 else if (/slimerjs/i.test(ua)) { 4771 result = { 4772 name: 'SlimerJS' 4773 , slimer: t 4774 , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) 4775 } 4776 } 4777 else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { 4778 result = { 4779 name: 'BlackBerry' 4780 , blackberry: t 4781 , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) 4782 } 4783 } 4784 else if (webos) { 4785 result = { 4786 name: 'WebOS' 4787 , webos: t 4788 , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) 4789 }; 4790 if( /touchpad\//i.test(ua) ){ 4791 result.touchpad = t; 4792 } 4793 } 4794 else if (/bada/i.test(ua)) { 4795 result = { 4796 name: 'Bada' 4797 , bada: t 4798 , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) 4799 }; 4800 } 4801 else if (tizen) { 4802 result = { 4803 name: 'Tizen' 4804 , tizen: t 4805 , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier 4806 }; 4807 } 4808 else if (/qupzilla/i.test(ua)) { 4809 result = { 4810 name: 'QupZilla' 4811 , qupzilla: t 4812 , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier 4813 } 4814 } 4815 else if (/chromium/i.test(ua)) { 4816 result = { 4817 name: 'Chromium' 4818 , chromium: t 4819 , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier 4820 } 4821 } 4822 else if (/chrome|crios|crmo/i.test(ua)) { 4823 result = { 4824 name: 'Chrome' 4825 , chrome: t 4826 , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) 4827 } 4828 } 4829 else if (android) { 4830 result = { 4831 name: 'Android' 4832 , version: versionIdentifier 4833 } 4834 } 4835 else if (/safari|applewebkit/i.test(ua)) { 4836 result = { 4837 name: 'Safari' 4838 , safari: t 4839 } 4840 if (versionIdentifier) { 4841 result.version = versionIdentifier 4842 } 4843 } 4844 else if (iosdevice) { 4845 result = { 4846 name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' 4847 } 4848 // WTF: version is not part of user agent in web apps 4849 if (versionIdentifier) { 4850 result.version = versionIdentifier 4851 } 4852 } 4853 else if(/googlebot/i.test(ua)) { 4854 result = { 4855 name: 'Googlebot' 4856 , googlebot: t 4857 , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier 4858 } 4859 } 4860 else { 4861 result = { 4862 name: getFirstMatch(/^(.*)\/(.*) /), 4863 version: getSecondMatch(/^(.*)\/(.*) /) 4864 }; 4865 } 4866 4867 // set webkit or gecko flag for browsers based on these engines 4868 if (!result.msedge && /(apple)?webkit/i.test(ua)) { 4869 if (/(apple)?webkit\/537\.36/i.test(ua)) { 4870 result.name = result.name || "Blink" 4871 result.blink = t 4872 } else { 4873 result.name = result.name || "Webkit" 4874 result.webkit = t 4875 } 4876 if (!result.version && versionIdentifier) { 4877 result.version = versionIdentifier 4878 } 4879 } else if (!result.opera && /gecko\//i.test(ua)) { 4880 result.name = result.name || "Gecko" 4881 result.gecko = t 4882 result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i) 4883 } 4884 4885 // set OS flags for platforms that have multiple browsers 4886 if (!result.msedge && (android || result.silk)) { 4887 result.android = t 4888 } else if (iosdevice) { 4889 result[iosdevice] = t 4890 result.ios = t 4891 } else if (mac) { 4892 result.mac = t 4893 } else if (xbox) { 4894 result.xbox = t 4895 } else if (windows) { 4896 result.windows = t 4897 } else if (linux) { 4898 result.linux = t 4899 } 4900 4901 // OS version extraction 4902 var osVersion = ''; 4903 if (result.windowsphone) { 4904 osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); 4905 } else if (iosdevice) { 4906 osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); 4907 osVersion = osVersion.replace(/[_\s]/g, '.'); 4908 } else if (android) { 4909 osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); 4910 } else if (result.webos) { 4911 osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); 4912 } else if (result.blackberry) { 4913 osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); 4914 } else if (result.bada) { 4915 osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); 4916 } else if (result.tizen) { 4917 osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); 4918 } 4919 if (osVersion) { 4920 result.osversion = osVersion; 4921 } 4922 4923 // device type extraction 4924 var osMajorVersion = osVersion.split('.')[0]; 4925 if ( 4926 tablet 4927 || nexusTablet 4928 || iosdevice == 'ipad' 4929 || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) 4930 || result.silk 4931 ) { 4932 result.tablet = t 4933 } else if ( 4934 mobile 4935 || iosdevice == 'iphone' 4936 || iosdevice == 'ipod' 4937 || android 4938 || nexusMobile 4939 || result.blackberry 4940 || result.webos 4941 || result.bada 4942 ) { 4943 result.mobile = t 4944 } 4945 4946 // Graded Browser Support
4947 // http://developer.yahoo.com/yui/articles/gbs 4948 if (result.msedge || 4949 (result.msie && result.version >= 10) || 4950 (result.yandexbrowser && result.version >= 15) || 4951 (result.vivaldi && result.version >= 1.0) || 4952 (result.chrome && result.version >= 20) || 4953 (result.firefox && result.version >= 20.0) || 4954 (result.safari && result.version >= 6) || 4955 (result.opera && result.version >= 10.0) || 4956 (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || 4957 (result.blackberry && result.version >= 10.1) 4958 || (result.chromium && result.version >= 20) 4959 ) { 4960 result.a = t; 4961 } 4962 else if ((result.msie && result.version < 10) || 4963 (result.chrome && result.version < 20) || 4964 (result.firefox && result.version < 20.0) || 4965 (result.safari && result.version < 6) || 4966 (result.opera && result.version < 10.0) || 4967 (result.ios && result.osversion && result.osversion.split(".")[0] < 6) 4968 || (result.chromium && result.version < 20) 4969 ) { 4970 result.c = t 4971 } else result.x = t 4972 4973 return result 4974 } 4975 4976 var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent : '') 4977 4978 bowser.test = function (browserList) { 4979 for (var i = 0; i < browserList.length; ++i) { 4980 var browserItem = browserList[i]; 4981 if (typeof browserItem=== 'string') { 4982 if (browserItem in bowser) { 4983 return true; 4984 } 4985 } 4986 } 4987 return false; 4988 } 4989 4990 /** 4991 * Get version precisions count 4992 * 4993 * @example 4994 * getVersionPrecision("1.10.3") // 3 4995 * 4996 * @param {string} version 4997 * @return {number} 4998 */ 4999 function getVersionPrecision(version) { 5000 return version.split(".").length; 5001 } 5002 5003 /** 5004 * Array::map polyfill 5005 * 5006 * @param {Array} arr 5007 * @param {Function} iterator 5008 * @return {Array} 5009 */ 5010 function map(arr, iterator) { 5011 var result = [], i; 5012 if (Array.prototype.map) { 5013 return Array.prototype.map.call(arr, iterator); 5014 } 5015 for (i = 0; i < arr.length; i++) { 5016 result.push(iterator(arr[i])); 5017 } 5018 return result; 5019 } 5020 5021 /** 5022 * Calculate browser version weight 5023 * 5024 * @example 5025 * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 5026 * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 5027 * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 5028 * compareVersions(['1.10.2.1', '1.0800.2']); // -1 5029 * 5030 * @param {Array<String>} versions versions to compare 5031 * @return {Number} comparison result 5032 */ 5033 function compareVersions(versions) { 5034 // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 5035 var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); 5036 var chunks = map(versions, function (version) { 5037 var delta = precision - getVersionPrecision(version); 5038 5039 // 2) "9" -> "9.0" (for precision = 2) 5040 version = version + new Array(delta + 1).join(".0"); 5041 5042 // 3) "9.0" -> ["000000000"", "000000009"] 5043 return map(version.split("."), function (chunk) { 5044 return new Array(20 - chunk.length).join("0") + chunk; 5045 }).reverse(); 5046 }); 5047 5048 // iterate in reverse order by reversed chunks array 5049 while (--precision >= 0) { 5050 // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) 5051 if (chunks[0][precision] > chunks[1][precision]) { 5052 return 1; 5053 } 5054 else if (chunks[0][precision] === chunks[1][precision]) { 5055 if (precision === 0) { 5056 // all version chunks are same 5057 return 0; 5058 } 5059 } 5060 else { 5061 return -1; 5062 } 5063 } 5064 } 5065 5066 /** 5067 * Check if browser is unsupported 5068 * 5069 * @example 5070 * bowser.isUnsupportedBrowser({ 5071 * msie: "10", 5072 * firefox: "23", 5073 * chrome: "29", 5074 * safari: "5.1", 5075 * opera: "16", 5076 * phantom: "534" 5077 * }); 5078 * 5079 * @param {Object} minVersions map of minimal version to browser 5080 * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map 5081 * @param {String} [ua] user agent string 5082 * @return {Boolean} 5083 */ 5084 function isUnsupportedBrowser(minVersions, strictMode, ua) { 5085 var _bowser = bowser; 5086 5087 // make strictMode param optional with ua param usage 5088 if (typeof strictMode === 'string') { 5089 ua = strictMode;
5090 strictMode = void(0); 5091 } 5092 5093 if (strictMode === void(0)) { 5094 strictMode = false; 5095 } 5096 if (ua) { 5097 _bowser = detect(ua); 5098 } 5099 5100 var version = "" + _bowser.version; 5101 for (var browser in minVersions) { 5102 if (minVersions.hasOwnProperty(browser)) { 5103 if (_bowser[browser]) { 5104 // browser version and min supported version. 5105 return compareVersions([version, minVersions[browser]]) < 0; 5106 } 5107 } 5108 } 5109 5110 return strictMode; // not found 5111 } 5112 5113 /** 5114 * Check if browser is supported 5115 * 5116 * @param {Object} minVersions map of minimal version to browser 5117 * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map 5118 * @param {String} [ua] user agent string 5119 * @return {Boolean} 5120 */ 5121 function check(minVersions, strictMode, ua) { 5122 return !isUnsupportedBrowser(minVersions, strictMode, ua); 5123 } 5124 5125 bowser.isUnsupportedBrowser = isUnsupportedBrowser; 5126 bowser.compareVersions = compareVersions; 5127 bowser.check = check; 5128 5129 /* 5130 * Set our detect method to the main bowser object so we can 5131 * reuse it to test other user agents. 5132 * This is needed to implement future tests. 5133 */ 5134 bowser._detect = detect; 5135 5136 return bowser 5137}); 5138 5139(function($){ 5140 UABBTrigger = { 5141 5142 /** 5143 * Trigger a hook. 5144 * 5145 * @since 1.1.0.3 5146 * @method triggerHook 5147 * @param {String} hook The hook to trigger. 5148 * @param {Array} args An array of args to pass to the hook. 5149 */ 5150 triggerHook: function( hook, args ) 5151 { 5152 $( 'body' ).trigger( 'uabb-trigger.' + hook, args ); 5153 }, 5154 5155 /** 5156 * Add a hook. 5157 * 5158 * @since 1.1.0.3 5159 * @method addHook 5160 * @param {String} hook The hook to add. 5161 * @param {Function} callback A function to call when the hook is triggered. 5162 */ 5163 addHook: function( hook, callback ) 5164 { 5165 $( 'body' ).on( 'uabb-trigger.' + hook, callback ); 5166 }, 5167 5168 /** 5169 * Remove a hook. 5170 * 5171 * @since 1.1.0.3 5172 * @method removeHook 5173 * @param {String} hook The hook to remove. 5174 * @param {Function} callback The callback function to remove. 5175 */ 5176 removeHook: function( hook, callback ) 5177 { 5178 $( 'body' ).off( 'uabb-trigger.' + hook, callback ); 5179 }, 5180 }; 5181})(jQuery); 5182 5183jQuery(document).ready(function( $ ) { 5184 5185 if( typeof bowser !== 'undefined' && bowser !== null ) { 5186 5187 var uabb_browser = bowser.name, 5188 uabb_browser_v = bowser.version, 5189 uabb_browser_class = uabb_browser.replace(/\s+/g, '-').toLowerCase(), 5190 uabb_browser_v_class = uabb_browser_class + parseInt( uabb_browser_v ); 5191 5192 $('html').addClass(uabb_browser_class).addClass(uabb_browser_v_class); 5193 5194 } 5195 5196 $('.uabb-row-separator').parents('html').css('overflow-x', 'hidden'); 5197}); 5198 5199var pp_menu_6yl378jgm9ev; 5200(function($) { 5201 5202 pp_menu_6yl378jgm9ev = new PPAdvancedMenu({ 5203 id: '6yl378jgm9ev', 5204 type: 'horizontal', 5205 mobile: 'hamburger', 5206 menuPosition: 'below', 5207 breakpoints: { 5208 large: 1200, 5209 medium: 992, 5210 small: 768, 5211 custom: 768 }, 5212 mobileBreakpoint: 'mobile', 5213 mediaBreakpoint: '768', 5214 mobileMenuType: 'default', 5215 offCanvasDirection: 'left', 5216 submenuRevealTrigger: 'hover', 5217 fullScreenAnimation: '', 5218 isBuilderActive: false }); 5219 5220})(jQuery); 5221 5222jQuery(function($) { 5223 $(function() { 5224 $( '.fl-node-a0s58muelj1n .uabb-photo-img' ) 5225 .on( 'mouseenter', function( e ) { 5226 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 5227 } ) 5228 .on( 'mouseleave', function( e ){ 5229 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 5230 } ); 5231 }); 5232}); 5233 5234/* Start Layout Custom JS */ 5235 5236/* End Layout Custom JS */ 5237 5238(function($){ 5239 5240 /** 5241 * Helper class for header layout logic. 5242 * 5243 * @since 1.0 5244 * @class FLThemeBuilderHeaderLayout 5245 */ 5246 FLThemeBuilderHeaderLayout = { 5247 5248 /** 5249 * A reference to the window object for this page. 5250 * 5251 * @since 1.0 5252 * @property {Object} win 5253 */ 5254 win : null, 5255 5256 /** 5257 * A reference to the body object for this page. 5258 * 5259 * @since 1.0 5260 * @property {Object} body 5261 */ 5262 body : null, 5263 5264 /** 5265 * A reference to the header object for this page. 5266 * 5267 * @since 1.0 5268 * @property {Object} header 5269 */ 5270 header : null, 5271 5272 /** 5273 * Whether this header overlays the content or not. 5274 * 5275 * @since 1.0 5276 * @property {Boolean} overlay 5277 */ 5278 overlay : false, 5279 5280 /** 5281 * Whether the page has the WP admin bar or not. 5282 * 5283 * @since 1.0 5284 * @property {Boolean} hasAdminBar 5285 */ 5286 hasAdminBar : false, 5287 5288 /** 5289 * Breakpoint for when the sticky header should apply. 5290 * 5291 * @since 1.4 5292 * @property {String} stickyOn 5293 */ 5294 stickyOn: '', 5295 5296 /** 5297 * A reference of the sticky and shrink header breakpoint. 5298 * 5299 * @since 1.2.5 5300 * @property {Number} breakpointWidth 5301 */ 5302 breakpointWidth: 0, 5303 5304 /** 5305 * Whether this header can be pinned from page load. 5306 * 5307 * @since 1.6.1 5308 * @property {Boolean} pinnable 5309 */ 5310 pinnable : false, 5311 5312 /** 5313 * Initializes header layout logic. 5314 * 5315 * @since 1.0 5316 * @method init 5317 */ 5318 init: function() 5319 {
5320 var editing = $( 'html.fl-builder-edit' ).length, 5321 header = $( '.fl-builder-content[data-type=header]' ), 5322 menuModule = header.find( '.fl-module-menu' ), 5323 breakpoint = null, 5324 adminBarHeight = 0; 5325 5326 if ( ! editing && header.length ) { 5327 5328 header.imagesLoaded( $.proxy( function() { 5329 5330 this.win = $( window ); 5331 this.body = $( 'body' ); 5332 this.header = header.eq( 0 ); 5333 this.overlay = !! Number( header.attr( 'data-overlay' ) ); 5334 this.hasAdminBar = !! $( 'body.admin-bar' ).length; 5335 this.stickyOn = this.header.data( 'sticky-on' ); 5336 breakpoint = this.header.data( 'sticky-breakpoint' ); 5337 5338 if ( '' == this.stickyOn ) { 5339 if ( typeof FLBuilderLayoutConfig.breakpoints[ breakpoint ] !== undefined ) { 5340 this.breakpointWidth = FLBuilderLayoutConfig.breakpoints[ breakpoint ]; 5341 } 5342 else { 5343 this.breakpointWidth = FLBuilderLayoutConfig.breakpoints.medium; 5344 } 5345 } 5346 5347 if ( Number( header.attr( 'data-sticky' ) ) ) { 5348 5349 this.header.data( 'original-top', this.header.offset().top ); 5350 5351 // The pin decision is made once here, while the header offset and the admin bar height are read from the same layout. 5352 adminBarHeight = $( '#wpadminbar' ).length ? $( '#wpadminbar' ).outerHeight() : 0; 5353 this.pinnable = this.overlay && this.header.data( 'original-top' ) <= adminBarHeight; 5354 5355 this.win.on( 'resize', $.throttle( 500, $.proxy( this._initSticky, this ) ) ); 5356 this._initSticky(); 5357 5358 } 5359 5360 }, this ) ); 5361 } 5362 }, 5363 5364 /** 5365 * Initializes sticky logic for a header. 5366 * 5367 * @since 1.0 5368 * @access private 5369 * @method _initSticky 5370 */ 5371 _initSticky: function( e ) 5372 { 5373 var header = $('.fl-builder-content[data-type=header]'), 5374 windowSize = this.win.width(), 5375 makeSticky = false; 5376 5377 makeSticky = this._makeWindowSticky( windowSize ); 5378 if ( makeSticky || ( this.breakpointWidth > 0 && windowSize >= this.breakpointWidth ) ) { 5379 this.win.on( 'scroll.fl-theme-builder-header-sticky', $.proxy( this._doSticky, this ) ); 5380 this._initPin(); 5381
5382 // Apply the sticky state on initial load when the page is 5383 // already scrolled past the header â e.g. when the browser 5384 // restores the scroll position on refresh. Overlay headers are 5385 // out of scope here; this mirrors the shrink-on-load behavior 5386 // in _initShrink(). 5387 if ( ! e && ! this.overlay && ! this.header.hasClass( 'fl-theme-builder-header-sticky' ) ) { 5388 var loadWinTop = this.win.scrollTop(), 5389 loadHeaderTop = Math.floor( this.header.data( 'original-top' ) ); 5390 5391 if ( this.hasAdminBar && windowSize > 600 ) { 5392 loadWinTop += Math.floor( $( '#wpadminbar' ).outerHeight() ); 5393 } 5394 5395 if ( loadWinTop > loadHeaderTop ) { 5396 this.header.addClass( 'fl-theme-builder-header-sticky' ); 5397 this.header.addClass( 'fl-theme-builder-header-scrolled' ); 5398 this._adjustHeaderHeight(); 5399 this._adjustStickyHeaderWidth(); 5400 } 5401 } 5402 5403 // 5404 // Check if Event Type is 'resize' then invoke this._doSticky() 5405 // only if the 'fl-theme-builder-header-sticky' class is already present. 5406 // 5407 if ( e && 'resize' === e.type ) { 5408 if ( this.header.hasClass( 'fl-theme-builder-header-sticky' ) ) { 5409 this._doSticky( e ); 5410 } 5411 this._adjustStickyHeaderWidth(); 5412 } 5413 5414 if ( Number( header.attr( 'data-shrink' ) ) ) { 5415 this.header.data( 'original-height', this.header.outerHeight() ); 5416 this.win.on( 'resize', $.throttle( 500, $.proxy( this._initShrink, this ) ) ); 5417 this._initShrink(); 5418 } 5419 5420 this._initFlyoutMenuFix( e ); 5421 } else { 5422 this.win.off( 'scroll.fl-theme-builder-header-sticky' ); 5423 this.win.off( 'resize.fl-theme-builder-header-sticky' ); 5424 5425 this.header.removeClass( 'fl-theme-builder-header-sticky' ); 5426 this.header.removeClass( 'fl-theme-builder-header-pinned' ); 5427 this.header.removeAttr( 'style' ); 5428 this.header.parent().css( 'padding-top', '0' ); 5429 } 5430 }, 5431 5432 /** 5433 * Pins an overlay header with fixed positioning from page load, avoiding a position change that a scroll handler cannot apply before the compositor paints. 5434 * 5435 * @since 1.6.1 5436 * @access private 5437 * @method _initPin 5438 */ 5439 _initPin: function() 5440 { 5441 this.header.toggleClass( 'fl-theme-builder-header-pinned', this.pinnable ); 5442 5443 if ( ! this.pinnable ) { 5444 return; 5445 } 5446 5447 // Fixed positioning resolves the width against the viewport, so boxed layouts require their maximum width immediately. 5448 this._adjustStickyHeaderWidth(); 5449 5450 // The header is visible from the first paint, so the scrolled state must reflect any restored scroll position. 5451 if ( this.win.scrollTop() > Math.floor( this.header.data( 'original-top' ) ) ) { 5452 this.header.addClass( 'fl-theme-builder-header-scrolled' ); 5453 } 5454 }, 5455 5456 /** 5457 * Check if Header should be sticky at a particular Window size. 5458 * 5459 * @since 1.4 5460 * @access private 5461 * @param widowSize 5462 * @method _makeWindowSticky 5463 */ 5464 _makeWindowSticky: function ( windowSize ) 5465 { 5466 var makeSticky = false; 5467 5468 switch (this.stickyOn) { 5469 case 'xl': 5470 makeSticky = windowSize > FLBuilderLayoutConfig.breakpoints['large']; 5471 break; 5472 case '': // Default 5473 case 'desktop': 5474 makeSticky = windowSize >= FLBuilderLayoutConfig.breakpoints['medium']; 5475 break; 5476 case 'desktop-medium': 5477 makeSticky = windowSize > FLBuilderLayoutConfig.breakpoints['small']; 5478 break; 5479 case 'large': 5480 makeSticky = windowSize > FLBuilderLayoutConfig.breakpoints['medium'] && windowSize <= FLBuilderLayoutConfig.breakpoints['large']; 5481 break; 5482 case 'large-medium': 5483 makeSticky = windowSize > FLBuilderLayoutConfig.breakpoints['small'] && windowSize <= FLBuilderLayoutConfig.breakpoints['large']; 5484 break; 5485 case 'medium': 5486 makeSticky = ( windowSize <= FLBuilderLayoutConfig.breakpoints['medium'] && windowSize > FLBuilderLayoutConfig.breakpoints['small'] ); 5487 break; 5488 case 'medium-mobile': 5489 makeSticky = (windowSize <= FLBuilderLayoutConfig.breakpoints['medium']); 5490 break; 5491 case 'mobile': 5492 makeSticky = (windowSize <= FLBuilderLayoutConfig.breakpoints['small']); 5493 break; 5494 case 'all':
5495 makeSticky = true; 5496 break; 5497 } 5498 5499 return makeSticky; 5500 }, 5501 5502 /** 5503 * Sticks the header when the page is scrolled. 5504 * 5505 * @since 1.0 5506 * @access private 5507 * @method _doSticky 5508 */ 5509 _doSticky: function( e ) 5510 { 5511 var winTop = Math.floor( this.win.scrollTop() ), 5512 headerTop = Math.floor( this.header.data( 'original-top' ) ), 5513 hasStickyClass = this.header.hasClass( 'fl-theme-builder-header-sticky' ), 5514 hasScrolledClass = this.header.hasClass( 'fl-theme-builder-header-scrolled' ), 5515 beforeHeader = this.header.prevAll( '.fl-builder-content' ), 5516 bodyTopPadding = parseInt( jQuery('body').css('padding-top') ), 5517 winBarHeight = $('#wpadminbar').length ? $('#wpadminbar').outerHeight() : 0, 5518 headerHeight = 0; 5519 5520 if ( isNaN( bodyTopPadding ) ) { 5521 bodyTopPadding = 0; 5522 } 5523 5524 if ( this.hasAdminBar && this.win.width() > 600 ) { 5525 winTop += Math.floor( winBarHeight ); 5526 } 5527 5528 if ( winTop > headerTop ) { 5529 if ( ! hasStickyClass ) { 5530 if ( e && ( 'scroll' === e.type || 'smartscroll' === e.type ) ) { 5531 this.header.addClass( 'fl-theme-builder-header-sticky' ); 5532 if ( this.overlay && beforeHeader.length ) { 5533 this.header.css( 'top', winBarHeight); 5534 } 5535 } 5536 5537 if ( ! this.overlay ) { 5538 this._adjustHeaderHeight(); 5539 } 5540 } 5541 } 5542 else if ( hasStickyClass ) { 5543 this.header.removeClass( 'fl-theme-builder-header-sticky' ); 5544 this.header.removeAttr( 'style' ); 5545 this.header.parent().css( 'padding-top', '0' ); 5546 } 5547 5548 this._adjustStickyHeaderWidth(); 5549 5550 if ( winTop > headerTop ) { 5551 if ( ! hasScrolledClass ) { 5552 this.header.addClass( 'fl-theme-builder-header-scrolled' ); 5553 } 5554 } else if ( hasScrolledClass ) { 5555 this.header.removeClass( 'fl-theme-builder-header-scrolled' ); 5556 } 5557 5558 this._flyoutMenuFix( e ); 5559 }, 5560 5561 /** 5562 * Initializes flyout menu fixes on sticky header. 5563 * 5564 * @since 1.4.1 5565 * @method _initFlyoutMenuFix 5566 */ 5567 _initFlyoutMenuFix: function( e ) { 5568 var header = this.header, 5569 menuModule = header.closest( '.fl-menu' ), 5570 flyoutMenu = menuModule.find( '.fl-menu-mobile-flyout' ), 5571 isPushMenu = menuModule.hasClass( 'fl-menu-responsive-flyout-push' ) || menuModule.hasClass( 'fl-menu-responsive-flyout-push-opacity' ), 5572 isOverlay = menuModule.hasClass( 'fl-menu-responsive-flyout-overlay' ), 5573 flyoutPos = menuModule.hasClass( 'fl-flyout-right' ) ? 'right' : 'left', 5574 flyoutParent = header.parent().is( 'header' ) ? header.parent().parent() : header.parent(); 5575 isFullWidth = this.win.width() === header.width(), 5576 flyoutLayout = '', 5577 activePos = 250, 5578 headerPos = 0; 5579 5580 if ( ! flyoutMenu.length ) { 5581 return; 5582 } 5583 5584 if ( this.win.width() > header.parent().width() ) { 5585 headerPos = ( this.win.width() - header.width() ) / 2; 5586 } 5587 5588 if ( isOverlay ) { 5589 activePos = headerPos; 5590 } 5591 else if ( isPushMenu ) { 5592 activePos = activePos + headerPos; 5593 } 5594 flyoutMenu.data( 'activePos', activePos ); 5595 5596 if ( isPushMenu ) { 5597 flyoutLayout = 'push-' + flyoutPos; 5598 } 5599 else if ( isOverlay ) { 5600 flyoutLayout = 'overlay-' + flyoutPos; 5601 } 5602 5603 if ( isPushMenu && ! $( 'html' ).hasClass( 'fl-theme-builder-has-flyout-menu' ) ) { 5604 $( 'html' ).addClass( 'fl-theme-builder-has-flyout-menu' ); 5605 } 5606 5607 if ( ! flyoutParent.hasClass( 'fl-theme-builder-flyout-menu-' + flyoutLayout ) ) { 5608 flyoutParent.addClass( 'fl-theme-builder-flyout-menu-' + flyoutLayout ); 5609 } 5610 5611 if ( ! header.hasClass( 'fl-theme-builder-flyout-menu-overlay' ) && isOverlay ) { 5612 header.addClass( 'fl-theme-builder-flyout-menu-overlay' ); 5613 } 5614 5615 if ( ! header.hasClass( 'fl-theme-builder-header-full-width' ) && isFullWidth ) { 5616 header.addClass( 'fl-theme-builder-header-full-width' ); 5617 } 5618 else if ( ! isFullWidth ) { 5619 header.removeClass( 'fl-theme-builder-header-full-width' ); 5620 } 5621 5622 menuModule.on( 'click', '.fl-menu-mobile-toggle', $.proxy( function( event ){ 5623 if ( menuModule.find( '.fl-menu-mobile-toggle.fl-active' ).length ) {
5624 $( 'html' ).addClass( 'fl-theme-builder-flyout-menu-active' ); 5625 event.stopImmediatePropagation(); 5626 } 5627 else { 5628 $( 'html' ).removeClass( 'fl-theme-builder-flyout-menu-active' ); 5629 } 5630 5631 this._flyoutMenuFix( event ); 5632 }, this ) ); 5633 }, 5634 5635 /** 5636 * Fix flyout menu inside the sticky header. 5637 * 5638 * @since 1.4.1 5639 * @method _flyoutMenuFix 5640 */ 5641 _flyoutMenuFix: function( e ){ 5642 var header = this.header, 5643 menuModule = $( e.target ).closest( '.fl-menu' ), 5644 flyoutMenu = menuModule.find( '.fl-menu-mobile-flyout' ), 5645 flyoutPos = menuModule.hasClass( 'fl-flyout-right' ) ? 'right' : 'left', 5646 menuOpacity = menuModule.find( '.fl-menu-mobile-opacity' ), 5647 isScroll = 'undefined' !== typeof e && 'scroll' === e.handleObj.type, 5648 activePos = 'undefined' !== typeof flyoutMenu.data( 'activePos' ) ? flyoutMenu.data( 'activePos' ) : 0, 5649 headerPos = ( this.win.width() - header.width() ) / 2, 5650 inactivePos = headerPos > 0 ? activePos + 4 : 254; 5651 5652 if ( ! flyoutMenu.length ) { 5653 return; 5654 } 5655 5656 if ( this.overlay ) { 5657 return; 5658 } 5659 5660 if( $( '.fl-theme-builder-flyout-menu-active' ).length ) { 5661 5662 if ( isScroll && ! flyoutMenu.hasClass( 'fl-menu-disable-transition' ) ) { 5663 flyoutMenu.addClass( 'fl-menu-disable-transition' ); 5664 } 5665 5666 if ( header.hasClass( 'fl-theme-builder-header-sticky' ) ) { 5667 if ( ! isScroll ) { 5668 setTimeout( $.proxy( function(){ 5669 flyoutMenu.css( flyoutPos, '-' + activePos + 'px' ); 5670 }, this ), 1 ); 5671 } 5672 else { 5673 flyoutMenu.css( flyoutPos, '-' + activePos + 'px' ); 5674 } 5675 } 5676 else { 5677 flyoutMenu.css( flyoutPos, '0px' ); 5678 } 5679 } 5680 else { 5681 if ( flyoutMenu.hasClass( 'fl-menu-disable-transition' ) ) { 5682 flyoutMenu.removeClass( 'fl-menu-disable-transition' ); 5683 } 5684 5685 if ( header.hasClass( 'fl-theme-builder-flyout-menu-overlay' ) && headerPos > 0 && headerPos < 250 ) { 5686 if ( header.hasClass( 'fl-theme-builder-header-sticky' ) ) { 5687 inactivePos = headerPos + 254; 5688 } 5689 else { 5690 inactivePos = 254; 5691 } 5692 } 5693 5694 if ( e && e.type === 'resize' ) { 5695 inactivePos = headerPos + 254; 5696 } 5697 5698 flyoutMenu.css( flyoutPos, '-' + inactivePos + 'px' ); 5699 } 5700 5701 if ( e && menuModule.is('.fl-menu-responsive-flyout-overlay') && $.infinitescroll ) { 5702 e.stopImmediatePropagation(); 5703 } 5704 5705 if( menuOpacity.length ) { 5706 if ( header.hasClass( 'fl-theme-builder-header-sticky' ) ) { 5707 if ( '0px' === menuOpacity.css( 'left' ) ) { 5708 menuOpacity.css( 'left', '-' + headerPos + 'px' ); 5709 } 5710 } 5711 else { 5712 menuOpacity.css( 'left', '' ); 5713 } 5714 } 5715 }, 5716 5717 /** 5718 * Adjust sticky header width if BB Theme Boxed Layout is used. 5719 * 5720 * @since 1.4 5721 * @access private 5722 * @method _adjustStickyHeaderWidth 5723 */ 5724 _adjustStickyHeaderWidth: function () { 5725 if ( $('body').hasClass( 'fl-fixed-width' ) ) { 5726 var parentWidth = this.header.parent().width(); 5727 5728 // Better if this is set in the stylesheet file. 5729 if ( this.win.width() >= 992 ) { 5730 this.header.css({ 5731 'margin': '0 auto', 5732 'max-width': parentWidth, 5733 }); 5734 } 5735 else { 5736 this.header.css({ 5737 'margin': '', 5738 'max-width': '', 5739 }); 5740 } 5741 } 5742 }, 5743 5744 /** 5745 * Adjust Sticky Header Height 5746 * 5747 * @since 1.4 5748 * @access private 5749 * @method _adjustHeaderHeight 5750 */ 5751 _adjustHeaderHeight: function () { 5752 var beforeHeader = this.header.prevAll('.fl-builder-content'), 5753 beforeHeaderHeight = 0, 5754 beforeHeaderFix = 0, 5755 headerHeight = Math.floor( this.header.outerHeight() ), 5756 bodyTopPadding = parseInt( $( 'body' ).css( 'padding-top' ) ), 5757 wpAdminBarHeight = 0, 5758 totalHeaderHeight = 0; 5759 5760 if ( isNaN( bodyTopPadding ) ) { 5761 bodyTopPadding = 0; 5762 } 5763 5764 if ( beforeHeader.length ) { 5765 $.each( beforeHeader, function() { 5766 beforeHeaderHeight += Math.floor( $(this).outerHeight() ); 5767 }); 5768 // Subtract this value from the header parent's top padding. 5769 beforeHeaderFix = 2; 5770 } 5771 5772 if ( this.hasAdminBar && this.win.width() <= 600 ) { 5773 wpAdminBarHeight = Math.floor( $('#wpadminbar').outerHeight() ); 5774 } 5775 5776 totalHeaderHeight = Math.floor( beforeHeaderHeight + headerHeight); 5777 5778 if ( headerHeight > 0 ) { 5779 var headerParent = this.header.parent(), 5780 headerParentTopPadding = 0; 5781 5782 // If the header's parent container is the BODY tag ignore its top padding. 5783 if ( $( headerParent ).is('body') ) { 5784 headerParentTopPadding = Math.floor( headerHeight - wpAdminBarHeight ); 5785 } else { 5786 headerParentTopPadding = Math.floor( headerHeight - bodyTopPadding - wpAdminBarHeight ); 5787 } 5788 5789 $( headerParent ).css( 'padding-top', ( headerParentTopPadding - beforeHeaderFix ) + 'px' ); 5790 5791 this.header.css({ 5792 '-webkit-transform': 'translate(0px, -' + totalHeaderHeight + 'px)', 5793 '-ms-transform': 'translate(0px, -' + totalHeaderHeight + 'px)', 5794 'transform': 'translate(0px, -' + totalHeaderHeight + 'px)' 5795 }); 5796 5797 } 5798 5799 }, 5800 5801 /** 5802 * Initializes shrink logic for a header. 5803 * 5804 * @since 1.0 5805 * @access private 5806 * @method _initShrink 5807 */ 5808 _initShrink: function( e ) 5809 { 5810 if ( this.win.width() >= this.breakpointWidth ) {
5811 this.win.on( 'scroll.fl-theme-builder-header-shrink', $.proxy( this._doShrink, this ) ); 5812 this._setImageMaxHeight(); 5813 5814 if ( this.win.scrollTop() > 0 ){ 5815 this._doShrink(); 5816 } 5817 5818 } else { 5819 this.header.parent().css( 'padding-top', '0' ); 5820 this.win.off( 'scroll.fl-theme-builder-header-shrink' ); 5821 this._removeShrink(); 5822 this._removeImageMaxHeight(); 5823 } 5824 }, 5825 5826 /** 5827 * Shrinks the header when the page is scrolled. 5828 * 5829 * @since 1.0 5830 * @access private 5831 * @method _doShrink 5832 */ 5833 _doShrink: function( e ) 5834 { 5835 var winTop = this.win.scrollTop(), 5836 headerTop = this.header.data('original-top'), 5837 headerHeight = this.header.data('original-height'), 5838 shrinkImageHeight = this.header.data('shrink-image-height'), 5839 windowSize = this.win.width(), 5840 makeSticky = this._makeWindowSticky( windowSize ), 5841 hasClass = this.header.hasClass( 'fl-theme-builder-header-shrink' ); 5842 5843 5844 if ( this.hasAdminBar ) { 5845 winTop += 32; 5846 } 5847 5848 if ( makeSticky && ( winTop > headerTop + headerHeight ) ) { 5849 if ( ! hasClass ) { 5850 5851 this.header.addClass( 'fl-theme-builder-header-shrink' ); 5852 5853 // Shrink images but don't include lightbox and menu images. 5854 this.header.find('img').each( function( i ) { 5855 var image = $( this ), 5856 maxMegaMenu = image.closest( '.max-mega-menu' ).length, 5857 imageInLightbox = image.closest( '.fl-button-lightbox-content' ).length, 5858 imageInNavMenu = image.closest( 'li.menu-item' ).length; 5859 5860 if ( ! ( imageInLightbox || imageInNavMenu || maxMegaMenu ) ) { 5861 image.css( 'max-height', shrinkImageHeight ); 5862 } 5863 5864 }); 5865 5866 this.header.find( '.fl-row-content-wrap' ).each( function() { 5867 5868 var row = $( this ); 5869 5870 if ( parseInt( row.css( 'padding-bottom' ) ) > 5 ) { 5871 row.addClass( 'fl-theme-builder-header-shrink-row-bottom' ); 5872 } 5873 5874 if ( parseInt( row.css( 'padding-top' ) ) > 5 ) { 5875 row.addClass( 'fl-theme-builder-header-shrink-row-top' ); 5876 } 5877 } ); 5878 5879 this.header.find( '.fl-module' ).each( function() { 5880 5881 var module = $( this ).find( '.fl-module-content' ).length ? $( this ).find( '.fl-module-content' ) : $( this ); 5882 5883 if ( parseInt( module.css( 'margin-bottom' ) ) > 5 ) { 5884 module.addClass( 'fl-theme-builder-header-shrink-module-bottom' ); 5885 } 5886 5887 if ( parseInt( module.css( 'margin-top' ) ) > 5 ) { 5888 module.addClass( 'fl-theme-builder-header-shrink-module-top' ); 5889 } 5890 } ); 5891 } 5892 } else if (hasClass) { 5893 this.header.find( 'img' ).css( 'max-height', '' ); 5894 this._removeShrink(); 5895 } 5896 5897 // Fixes Shrink header issue with BB Theme when window is scrolled then resized and back. 5898 if ( 'undefined' === typeof( e ) && $('body').hasClass( 'fl-fixed-width' ) ) { 5899 if ( ! this.overlay ) { 5900 this._adjustHeaderHeight(); 5901 } 5902 } 5903 5904 }, 5905 5906 /** 5907 * Removes the header shrink effect. 5908 * 5909 * @since 1.0 5910 * @access private 5911 * @method _removeShrink 5912 */ 5913 _removeShrink: function() 5914 { 5915 var rows = this.header.find( '.fl-row-content-wrap' ), 5916 modules = this.header.find('.fl-module, .fl-module-content'); 5917 5918 rows.removeClass( 'fl-theme-builder-header-shrink-row-bottom' ); 5919 rows.removeClass( 'fl-theme-builder-header-shrink-row-top' ); 5920 modules.removeClass( 'fl-theme-builder-header-shrink-module-bottom' ); 5921 modules.removeClass( 'fl-theme-builder-header-shrink-module-top' ); 5922 this.header.removeClass( 'fl-theme-builder-header-shrink' ); 5923 }, 5924 5925 /** 5926 * Adds max height to images in modules for smooth scrolling. 5927 * 5928 * @since 1.1.1 5929 * @access private 5930 * @method _setImageMaxHeight 5931 */ 5932 _setImageMaxHeight: function() 5933 { 5934 var head = $( 'head' ), 5935 stylesId = 'fl-header-styles-' + this.header.data( 'post-id' ), 5936 styles = '', 5937 images = this.header.find( '.fl-module img' ); 5938 5939 if ( $( '#' + stylesId ).length ) { 5940 return; 5941 } 5942 5943 images.each( function( i ) { 5944 var image = $( this ), 5945 height = image.height(), 5946 node = image.closest( '.fl-module' ).data( 'node' ), 5947 className = 'fl-node-' + node + '-img-' + i, 5948 maxMegaMenu = image.closest( '.max-mega-menu' ).length, 5949 imageInLightbox = image.closest( '.fl-button-lightbox-content' ).length, 5950 imageInNavMenu = image.closest( 'li.menu-item' ).length; 5951 5952 if ( ! ( imageInLightbox || imageInNavMenu || maxMegaMenu ) ) { 5953 image.addClass( className ); 5954 styles += '.' + className + ' { max-height: ' + ( height ? height : image[0].height ) + 'px }'; 5955 } 5956 5957 } ); 5958
5959 if ( '' !== styles ) { 5960 head.append( '<style id="' + stylesId + '">' + styles + '</style>' ); 5961 } 5962 }, 5963 5964 /** 5965 * Removes max height on images in modules for smooth scrolling. 5966 * 5967 * @since 1.1.1 5968 * @access private 5969 * @method _removeImageMaxHeight 5970 */ 5971 _removeImageMaxHeight: function() 5972 { 5973 $( '#fl-header-styles-' + this.header.data( 'post-id' ) ).remove(); 5974 }, 5975 }; 5976 5977 $( function() { FLThemeBuilderHeaderLayout.init(); } ); 5978 5979})(jQuery); 5980 5981/*! 5982 * Bowser - a browser detector 5983 * https://github.com/ded/bowser 5984 * MIT License | (c) Dustin Diaz 2015 5985 */ 5986 5987!function (name, definition) { 5988 if (typeof module != 'undefined' && module.exports) module.exports = definition() 5989 else if (typeof define == 'function' && define.amd) define(name, definition) 5990 else this[name] = definition() 5991}('bowser', function () { 5992 /** 5993 * See useragents.js for examples of navigator.userAgent 5994 */ 5995 5996 var t = true 5997 5998 function detect(ua) { 5999 6000 function getFirstMatch(regex) { 6001 var match = ua.match(regex); 6002 return (match && match.length > 1 && match[1]) || ''; 6003 } 6004 6005 function getSecondMatch(regex) { 6006 var match = ua.match(regex); 6007 return (match && match.length > 1 && match[2]) || ''; 6008 } 6009 6010 var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() 6011 , likeAndroid = /like android/i.test(ua) 6012 , android = !likeAndroid && /android/i.test(ua) 6013 , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) 6014 , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) 6015 , chromeos = /CrOS/.test(ua) 6016 , silk = /silk/i.test(ua) 6017 , sailfish = /sailfish/i.test(ua) 6018 , tizen = /tizen/i.test(ua) 6019 , webos = /(web|hpw)os/i.test(ua) 6020 , windowsphone = /windows phone/i.test(ua) 6021 , windows = !windowsphone && /windows/i.test(ua) 6022 , mac = !iosdevice && !silk && /macintosh/i.test(ua) 6023 , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) 6024 , edgeVersion = getFirstMatch(/edge\/(\d+(\.\d+)?)/i) 6025 , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) 6026 , tablet = /tablet/i.test(ua) 6027 , mobile = !tablet && /[^-]mobi/i.test(ua) 6028 , xbox = /xbox/i.test(ua) 6029 , result 6030 6031 if (/opera|opr|opios/i.test(ua)) { 6032 result = { 6033 name: 'Opera' 6034 , opera: t 6035 , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) 6036 } 6037 } 6038 else if (/coast/i.test(ua)) { 6039 result = { 6040 name: 'Opera Coast' 6041 , coast: t 6042 , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) 6043 } 6044 } 6045 else if (/yabrowser/i.test(ua)) { 6046 result = { 6047 name: 'Yandex Browser' 6048 , yandexbrowser: t 6049 , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) 6050 } 6051 } 6052 else if (/ucbrowser/i.test(ua)) { 6053 result = { 6054 name: 'UC Browser' 6055 , ucbrowser: t 6056 , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) 6057 } 6058 } 6059 else if (/mxios/i.test(ua)) { 6060 result = { 6061 name: 'Maxthon' 6062 , maxthon: t 6063 , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) 6064 } 6065 } 6066 else if (/epiphany/i.test(ua)) { 6067 result = { 6068 name: 'Epiphany' 6069 , epiphany: t 6070 , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) 6071 } 6072 } 6073 else if (/puffin/i.test(ua)) { 6074 result = { 6075 name: 'Puffin' 6076 , puffin: t 6077 , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) 6078 } 6079 } 6080 else if (/sleipnir/i.test(ua)) { 6081 result = { 6082 name: 'Sleipnir' 6083 , sleipnir: t 6084 , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) 6085 } 6086 } 6087 else if (/k-meleon/i.test(ua)) { 6088 result = { 6089 name: 'K-Meleon' 6090 , kMeleon: t 6091 , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) 6092 } 6093 } 6094 else if (windowsphone) { 6095 result = { 6096 name: 'Windows Phone' 6097 , windowsphone: t 6098 } 6099 if (edgeVersion) { 6100 result.msedge = t 6101 result.version = edgeVersion 6102 } 6103 else { 6104 result.msie = t 6105 result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i) 6106 } 6107 } 6108 else if (/msie|trident/i.test(ua)) { 6109 result = { 6110 name: 'Internet Explorer' 6111 , msie: t 6112 , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) 6113 } 6114 } else if (chromeos) { 6115 result = { 6116 name: 'Chrome' 6117 , chromeos: t 6118 , chromeBook: t 6119 , chrome: t 6120 , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) 6121 } 6122 } else if (/chrome.+? edge/i.test(ua)) { 6123 result = { 6124 name: 'Microsoft Edge' 6125 , msedge: t 6126 , version: edgeVersion 6127 } 6128 } 6129 else if (/vivaldi/i.test(ua)) { 6130 result = { 6131 name: 'Vivaldi' 6132 , vivaldi: t 6133 , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier 6134 } 6135 } 6136 else if (sailfish) { 6137 result = { 6138 name: 'Sailfish' 6139 , sailfish: t 6140 , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) 6141 } 6142 } 6143 else if (/seamonkey\//i.test(ua)) { 6144 result = { 6145 name: 'SeaMonkey' 6146 , seamonkey: t 6147 , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) 6148 } 6149 } 6150 else if (/firefox|iceweasel|fxios/i.test(ua)) { 6151 result = { 6152 name: 'Firefox' 6153 , firefox: t 6154 , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) 6155 } 6156 if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { 6157 result.firefoxos = t 6158 } 6159 } 6160 else if (silk) { 6161 result = { 6162 name: 'Amazon Silk' 6163 , silk: t 6164 , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) 6165 } 6166 } 6167 else if (/phantom/i.test(ua)) { 6168 result = { 6169 name: 'PhantomJS' 6170 , phantom: t 6171 , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) 6172 } 6173 } 6174 else if (/slimerjs/i.test(ua)) { 6175 result = { 6176 name: 'SlimerJS' 6177 , slimer: t 6178 , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) 6179 } 6180 } 6181 else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { 6182 result = { 6183 name: 'BlackBerry' 6184 , blackberry: t 6185 , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) 6186 } 6187 } 6188 else if (webos) { 6189 result = { 6190 name: 'WebOS' 6191 , webos: t 6192 , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) 6193 }; 6194 if( /touchpad\//i.test(ua) ){ 6195 result.touchpad = t; 6196 } 6197 } 6198 else if (/bada/i.test(ua)) { 6199 result = { 6200 name: 'Bada' 6201 , bada: t 6202 , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) 6203 }; 6204 } 6205 else if (tizen) { 6206 result = { 6207 name: 'Tizen' 6208 , tizen: t 6209 , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier 6210 }; 6211 } 6212 else if (/qupzilla/i.test(ua)) { 6213 result = { 6214 name: 'QupZilla' 6215 , qupzilla: t 6216 , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier 6217 } 6218 } 6219 else if (/chromium/i.test(ua)) { 6220 result = { 6221 name: 'Chromium' 6222 , chromium: t 6223 , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier 6224 } 6225 } 6226 else if (/chrome|crios|crmo/i.test(ua)) { 6227 result = { 6228 name: 'Chrome' 6229 , chrome: t 6230 , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) 6231 } 6232 } 6233 else if (android) { 6234 result = { 6235 name: 'Android' 6236 , version: versionIdentifier 6237 } 6238 } 6239 else if (/safari|applewebkit/i.test(ua)) { 6240 result = { 6241 name: 'Safari' 6242 , safari: t 6243 } 6244 if (versionIdentifier) { 6245 result.version = versionIdentifier 6246 } 6247 } 6248 else if (iosdevice) { 6249 result = { 6250 name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' 6251 } 6252 // WTF: version is not part of user agent in web apps 6253 if (versionIdentifier) { 6254 result.version = versionIdentifier 6255 } 6256 } 6257 else if(/googlebot/i.test(ua)) { 6258 result = { 6259 name: 'Googlebot' 6260 , googlebot: t 6261 , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier 6262 } 6263 } 6264 else { 6265 result = { 6266 name: getFirstMatch(/^(.*)\/(.*) /), 6267 version: getSecondMatch(/^(.*)\/(.*) /) 6268 }; 6269 } 6270 6271 // set webkit or gecko flag for browsers based on these engines 6272 if (!result.msedge && /(apple)?webkit/i.test(ua)) { 6273 if (/(apple)?webkit\/537\.36/i.test(ua)) { 6274 result.name = result.name || "Blink" 6275 result.blink = t 6276 } else { 6277 result.name = result.name || "Webkit" 6278 result.webkit = t 6279 } 6280 if (!result.version && versionIdentifier) { 6281 result.version = versionIdentifier 6282 } 6283 } else if (!result.opera && /gecko\//i.test(ua)) { 6284 result.name = result.name || "Gecko" 6285 result.gecko = t 6286 result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i) 6287 } 6288 6289 // set OS flags for platforms that have multiple browsers 6290 if (!result.msedge && (android || result.silk)) { 6291 result.android = t 6292 } else if (iosdevice) { 6293 result[iosdevice] = t 6294 result.ios = t 6295 } else if (mac) { 6296 result.mac = t 6297 } else if (xbox) { 6298 result.xbox = t 6299 } else if (windows) { 6300 result.windows = t 6301 } else if (linux) { 6302 result.linux = t 6303 } 6304 6305 // OS version extraction 6306 var osVersion = ''; 6307 if (result.windowsphone) { 6308 osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); 6309 } else if (iosdevice) { 6310 osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); 6311 osVersion = osVersion.replace(/[_\s]/g, '.'); 6312 } else if (android) { 6313 osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); 6314 } else if (result.webos) { 6315 osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); 6316 } else if (result.blackberry) { 6317 osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); 6318 } else if (result.bada) { 6319 osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); 6320 } else if (result.tizen) { 6321 osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); 6322 } 6323 if (osVersion) { 6324 result.osversion = osVersion; 6325 } 6326 6327 // device type extraction 6328 var osMajorVersion = osVersion.split('.')[0]; 6329 if ( 6330 tablet 6331 || nexusTablet 6332 || iosdevice == 'ipad' 6333 || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) 6334 || result.silk 6335 ) { 6336 result.tablet = t 6337 } else if ( 6338 mobile 6339 || iosdevice == 'iphone' 6340 || iosdevice == 'ipod' 6341 || android 6342 || nexusMobile 6343 || result.blackberry 6344 || result.webos 6345 || result.bada 6346 ) { 6347 result.mobile = t 6348 } 6349 6350 // Graded Browser Support
6351 // http://developer.yahoo.com/yui/articles/gbs 6352 if (result.msedge || 6353 (result.msie && result.version >= 10) || 6354 (result.yandexbrowser && result.version >= 15) || 6355 (result.vivaldi && result.version >= 1.0) || 6356 (result.chrome && result.version >= 20) || 6357 (result.firefox && result.version >= 20.0) || 6358 (result.safari && result.version >= 6) || 6359 (result.opera && result.version >= 10.0) || 6360 (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || 6361 (result.blackberry && result.version >= 10.1) 6362 || (result.chromium && result.version >= 20) 6363 ) { 6364 result.a = t; 6365 } 6366 else if ((result.msie && result.version < 10) || 6367 (result.chrome && result.version < 20) || 6368 (result.firefox && result.version < 20.0) || 6369 (result.safari && result.version < 6) || 6370 (result.opera && result.version < 10.0) || 6371 (result.ios && result.osversion && result.osversion.split(".")[0] < 6) 6372 || (result.chromium && result.version < 20) 6373 ) { 6374 result.c = t 6375 } else result.x = t 6376 6377 return result 6378 } 6379 6380 var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent : '') 6381 6382 bowser.test = function (browserList) { 6383 for (var i = 0; i < browserList.length; ++i) { 6384 var browserItem = browserList[i]; 6385 if (typeof browserItem=== 'string') { 6386 if (browserItem in bowser) { 6387 return true; 6388 } 6389 } 6390 } 6391 return false; 6392 } 6393 6394 /** 6395 * Get version precisions count 6396 * 6397 * @example 6398 * getVersionPrecision("1.10.3") // 3 6399 * 6400 * @param {string} version 6401 * @return {number} 6402 */ 6403 function getVersionPrecision(version) { 6404 return version.split(".").length; 6405 } 6406 6407 /** 6408 * Array::map polyfill 6409 * 6410 * @param {Array} arr 6411 * @param {Function} iterator 6412 * @return {Array} 6413 */ 6414 function map(arr, iterator) { 6415 var result = [], i; 6416 if (Array.prototype.map) { 6417 return Array.prototype.map.call(arr, iterator); 6418 } 6419 for (i = 0; i < arr.length; i++) { 6420 result.push(iterator(arr[i])); 6421 } 6422 return result; 6423 } 6424 6425 /** 6426 * Calculate browser version weight 6427 * 6428 * @example 6429 * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 6430 * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 6431 * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 6432 * compareVersions(['1.10.2.1', '1.0800.2']); // -1 6433 * 6434 * @param {Array<String>} versions versions to compare 6435 * @return {Number} comparison result 6436 */ 6437 function compareVersions(versions) { 6438 // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 6439 var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); 6440 var chunks = map(versions, function (version) { 6441 var delta = precision - getVersionPrecision(version); 6442 6443 // 2) "9" -> "9.0" (for precision = 2) 6444 version = version + new Array(delta + 1).join(".0"); 6445 6446 // 3) "9.0" -> ["000000000"", "000000009"] 6447 return map(version.split("."), function (chunk) { 6448 return new Array(20 - chunk.length).join("0") + chunk; 6449 }).reverse(); 6450 }); 6451 6452 // iterate in reverse order by reversed chunks array 6453 while (--precision >= 0) { 6454 // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) 6455 if (chunks[0][precision] > chunks[1][precision]) { 6456 return 1; 6457 } 6458 else if (chunks[0][precision] === chunks[1][precision]) { 6459 if (precision === 0) { 6460 // all version chunks are same 6461 return 0; 6462 } 6463 } 6464 else { 6465 return -1; 6466 } 6467 } 6468 } 6469 6470 /** 6471 * Check if browser is unsupported 6472 * 6473 * @example 6474 * bowser.isUnsupportedBrowser({ 6475 * msie: "10", 6476 * firefox: "23", 6477 * chrome: "29", 6478 * safari: "5.1", 6479 * opera: "16", 6480 * phantom: "534" 6481 * }); 6482 * 6483 * @param {Object} minVersions map of minimal version to browser 6484 * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map 6485 * @param {String} [ua] user agent string 6486 * @return {Boolean} 6487 */ 6488 function isUnsupportedBrowser(minVersions, strictMode, ua) { 6489 var _bowser = bowser; 6490 6491 // make strictMode param optional with ua param usage 6492 if (typeof strictMode === 'string') { 6493 ua = strictMode;
6494 strictMode = void(0); 6495 } 6496 6497 if (strictMode === void(0)) { 6498 strictMode = false; 6499 } 6500 if (ua) { 6501 _bowser = detect(ua); 6502 } 6503 6504 var version = "" + _bowser.version; 6505 for (var browser in minVersions) { 6506 if (minVersions.hasOwnProperty(browser)) { 6507 if (_bowser[browser]) { 6508 // browser version and min supported version. 6509 return compareVersions([version, minVersions[browser]]) < 0; 6510 } 6511 } 6512 } 6513 6514 return strictMode; // not found 6515 } 6516 6517 /** 6518 * Check if browser is supported 6519 * 6520 * @param {Object} minVersions map of minimal version to browser 6521 * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map 6522 * @param {String} [ua] user agent string 6523 * @return {Boolean} 6524 */ 6525 function check(minVersions, strictMode, ua) { 6526 return !isUnsupportedBrowser(minVersions, strictMode, ua); 6527 } 6528 6529 bowser.isUnsupportedBrowser = isUnsupportedBrowser; 6530 bowser.compareVersions = compareVersions; 6531 bowser.check = check; 6532 6533 /* 6534 * Set our detect method to the main bowser object so we can 6535 * reuse it to test other user agents. 6536 * This is needed to implement future tests. 6537 */ 6538 bowser._detect = detect; 6539 6540 return bowser 6541}); 6542 6543(function($){ 6544 UABBTrigger = { 6545 6546 /** 6547 * Trigger a hook. 6548 * 6549 * @since 1.1.0.3 6550 * @method triggerHook 6551 * @param {String} hook The hook to trigger. 6552 * @param {Array} args An array of args to pass to the hook. 6553 */ 6554 triggerHook: function( hook, args ) 6555 { 6556 $( 'body' ).trigger( 'uabb-trigger.' + hook, args ); 6557 }, 6558 6559 /** 6560 * Add a hook. 6561 * 6562 * @since 1.1.0.3 6563 * @method addHook 6564 * @param {String} hook The hook to add. 6565 * @param {Function} callback A function to call when the hook is triggered. 6566 */ 6567 addHook: function( hook, callback ) 6568 { 6569 $( 'body' ).on( 'uabb-trigger.' + hook, callback ); 6570 }, 6571 6572 /** 6573 * Remove a hook. 6574 * 6575 * @since 1.1.0.3 6576 * @method removeHook 6577 * @param {String} hook The hook to remove. 6578 * @param {Function} callback The callback function to remove. 6579 */ 6580 removeHook: function( hook, callback ) 6581 { 6582 $( 'body' ).off( 'uabb-trigger.' + hook, callback ); 6583 }, 6584 }; 6585})(jQuery); 6586 6587jQuery(document).ready(function( $ ) { 6588 6589 if( typeof bowser !== 'undefined' && bowser !== null ) { 6590 6591 var uabb_browser = bowser.name, 6592 uabb_browser_v = bowser.version, 6593 uabb_browser_class = uabb_browser.replace(/\s+/g, '-').toLowerCase(), 6594 uabb_browser_v_class = uabb_browser_class + parseInt( uabb_browser_v ); 6595 6596 $('html').addClass(uabb_browser_class).addClass(uabb_browser_v_class); 6597 6598 } 6599 6600 $('.uabb-row-separator').parents('html').css('overflow-x', 'hidden'); 6601}); 6602 6603;var UABBNumber; 6604 6605(function($) { 6606 6607 /** 6608 * Class for Number Counter Module 6609 * 6610 * @since 1.6.1 6611 */ 6612 UABBNumber = function( settings ){ 6613 6614 // set params 6615 this.nodeClass = '.fl-node-' + settings.id; 6616 this.wrapperClass = this.nodeClass + ' .uabb-number'; 6617 this.layout = settings.layout; 6618 this.type = settings.type; 6619 this.number = settings.number; 6620 this.numberFormat = settings.numberFormat; 6621 this.locale = settings.locale; 6622 this.max = settings.max; 6623 this.speed = settings.speed; 6624 this.delay = settings.delay; 6625 this.breakPoints = settings.breakPoints; 6626 this.currentBrowserWidth = $( window ).width(); 6627 // initialize the menu 6628 this._initNumber(); 6629 6630 }; 6631 6632 UABBNumber.addCommas = function( n ){ 6633 6634 var rgx = /(\d+)(\d{3})/; 6635 n += ''; 6636 x = n.split('.'); 6637 x1 = x[0]; 6638 x2 = x.length > 1 ? '.' + x[1] : ''; 6639 6640 while (rgx.test(x1)) { 6641 x1 = x1.replace(rgx, '$1' + ',' + '$2'); 6642 } 6643 return x1 + x2; 6644 }; 6645 6646 UABBNumber.prototype = { 6647 nodeClass : '', 6648 wrapperClass : '', 6649 layout : '', 6650 type : '', 6651 number : 0, 6652 numberFormat : '', 6653 locale : '', 6654 max : 0, 6655 speed : 0, 6656 delay : 0, 6657 6658 _initNumber: function(){ 6659 //alert(); 6660 var self = this; 6661 6662 if( typeof jQuery.fn.waypoint !== 'undefined' ) { 6663 $( self.wrapperClass ).waypoint({ 6664 offset: '100%', 6665 triggerOnce: true, 6666 handler: function( direction ){ 6667 self._initCount(); 6668 } 6669 }); 6670 }else { 6671 self._initCount(); 6672 } 6673 6674 }, 6675 6676 _initCount: function(){ 6677 6678 var self = this, 6679 $number = $( self.wrapperClass ).find( '.uabb-number-string' ); 6680 6681 if( !isNaN( self.delay ) && self.delay > 0 ) { 6682 setTimeout( function(){ 6683 if( self.layout == 'circle' ){ 6684 self._triggerCircle(); 6685 } else if( self.layout == 'bars' ){ 6686 self._triggerBar(); 6687 } else if( self.layout == 'semi-circle' ){ 6688 self._triggerSemiCircle(); 6689 } 6690 self._countNumber(); 6691 }.bind( self ), self.delay * 1000 ); 6692 } 6693 else { 6694 if( self.layout == 'circle' ){ 6695 self._triggerCircle(); 6696 } else if( self.layout == 'bars' ){ 6697 self._triggerBar(); 6698 } else if( self.layout == 'semi-circle' ){ 6699 self._triggerSemiCircle(); 6700 } 6701 self._countNumber(); 6702 } 6703 }, 6704 6705 _countNumber: function(){ 6706 6707 var self = this, 6708 $number = $( self.wrapperClass ).find( '.uabb-number-string' ), 6709 $string = $number.find( '.uabb-number-int' ), 6710 $counter_number = self.number; 6711 current = 0; 6712 6713 var sAgent = window.navigator.userAgent; 6714 var Idx = sAgent.indexOf("MSIE"); 6715 6716 if (Idx > 0 || !!navigator.userAgent.match(/Trident\/7\./) ) { 6717 Number.isInteger = Number.isInteger || function(value) { 6718 return typeof value === "number" && 6719 isFinite(value) && 6720 Math.floor(value) === value; 6721 }; 6722 } 6723 6724 if( Number.isInteger( $counter_number ) ) { 6725 var digits = 0; 6726 } else { 6727 var digits = $counter_number.toString().split(".")[1].length; 6728 } 6729
6730 if ( ! $number.hasClass( 'uabb-number-animated') ) { 6731 6732 var $numFormat = self.numberFormat; 6733 var $locale = self.locale.replace(/_/,'-'); 6734 6735 $string.prop( 'Counter',0 ).animate({ 6736 Counter: self.number 6737 }, { 6738 duration: self.speed, 6739 easing: 'swing', 6740 step: function ( now ) { 6741 6742 if($numFormat == 'locale') { 6743 var $counter = now.toLocaleString($locale, { minimumFractionDigits: digits, maximumFractionDigits:digits }); 6744 } else if($numFormat == 'none') { 6745 var $counter = now.toFixed(digits); 6746 } else { 6747 var $counter = UABBNumber.addCommas( now.toFixed(digits) ); 6748 } 6749 $string.text( $counter ); 6750 } 6751 }); 6752 $number.addClass('uabb-number-animated'); 6753 } 6754 6755 }, 6756 6757 _triggerCircle: function(){ 6758 6759 var self = this, 6760 $bar = $( self.wrapperClass ).find( '.uabb-bar' ), 6761 r = $bar.attr('r'), 6762 circle = Math.PI*(r*2), 6763 val = self.number, 6764 max = self.type == 'percent' ? 100 : self.max; 6765 6766 if (val < 0) { val = 0;} 6767 if (val > max) { val = max;} 6768 6769 if( self.type == 'percent' ){ 6770 var pct = ( ( 100 - val ) /100) * circle; 6771 } else { 6772 var pct = ( 1 - ( val / max ) ) * circle; 6773 } 6774 6775 $bar.animate({ 6776 strokeDashoffset: pct 6777 }, { 6778 duration: self.speed, 6779 easing: 'swing' 6780 }); 6781 6782 }, 6783 6784 _triggerSemiCircle: function(){ 6785 6786 var self = this, 6787 $bar = $( self.wrapperClass ).find( '.uabb-bar' ), 6788 r = $bar.attr('r'), 6789 circle = Math.PI*(r*2)/2, 6790 val = self.number, 6791 max = self.type == 'percent' ? 100 : self.max; 6792 6793 if (val < 0) { val = 0;} 6794 if (val > max) { val = max;} 6795 6796 if( self.type == 'percent' ){ 6797 var pct = ( ( 100 - val ) /100) * circle; 6798 } else { 6799 var pct = ( 1 - ( val / max ) ) * circle; 6800 } 6801 6802 $bar.animate({ 6803 strokeDashoffset: pct 6804 }, { 6805 duration: self.speed, 6806 easing: 'swing' 6807 }); 6808 6809 }, 6810 6811 _triggerBar: function(){ 6812 6813 var self = this, 6814 $bar = $( self.wrapperClass ).find( '.uabb-number-bar' ); 6815 6816 if( self.type == 'percent' ){ 6817 var number = self.number > 100 ? 100 : self.number; 6818 } else { 6819 var number = ( ( self.number / self.max ) * 100 ); 6820 } 6821 6822 $bar.animate({ 6823 width: number + '%' 6824 }, { 6825 duration: self.speed, 6826 easing: 'swing' 6827 }); 6828 6829 } 6830 6831 }; 6832 6833})(jQuery); 6834(function($) { 6835 6836 $(function() { 6837 6838 new UABBNumber({ 6839 id: 'fg051huvnmqz', 6840 layout: 'default', 6841 type: 'standard', 6842 number: 171, 6843 numberFormat: 'comma', 6844 locale: 'en_US', 6845 max: 171, 6846 speed: 1000, 6847 delay: 1, 6848 }); 6849 6850 /* Accordion Click Trigger */ 6851 UABBTrigger.addHook( 'uabb-accordion-click', function( argument, selector ) { 6852 new UABBNumber({ 6853 id: 'fg051huvnmqz', 6854 layout: 'default', 6855 type: 'standard', 6856 number: 171, 6857 max: 171, 6858 speed: 1000, 6859 delay: 1, 6860 }); 6861 }); 6862 6863 /* Tab Click Trigger */ 6864 UABBTrigger.addHook( 'uabb-tab-click', function( argument, selector ) { 6865 new UABBNumber({ 6866 id: 'fg051huvnmqz', 6867 layout: 'default', 6868 type: 'standard', 6869 number: 171, 6870 max: 171, 6871 speed: 1000, 6872 delay: 1, 6873 }); 6874 }); 6875 6876 /* Modal Click Trigger */ 6877 UABBTrigger.addHook( 'uabb-modal-click', function( argument, selector ) { 6878 new UABBNumber({ 6879 id: 'fg051huvnmqz', 6880 layout: 'default', 6881 type: 'standard', 6882 number: 171, 6883 max: 171, 6884 speed: 1000, 6885 delay: 1, 6886 }); 6887 }); 6888 6889 }); 6890 6891})(jQuery); 6892 6893var pp_menu_0iz8vm462cf7; 6894(function($) { 6895 6896 pp_menu_0iz8vm462cf7 = new PPAdvancedMenu({ 6897 id: '0iz8vm462cf7', 6898 type: 'vertical', 6899 mobile: 'expanded', 6900 menuPosition: 'below', 6901 breakpoints: { 6902 large: 1200, 6903 medium: 992, 6904 small: 768, 6905 custom: 0 }, 6906 mobileBreakpoint: 'custom', 6907 mediaBreakpoint: '768', 6908 mobileMenuType: 'default', 6909 offCanvasDirection: 'left', 6910 submenuRevealTrigger: 'hover', 6911 fullScreenAnimation: '', 6912 isBuilderActive: false }); 6913 6914})(jQuery); 6915 6916var pp_menu_d60c3m4uehtf; 6917(function($) { 6918 6919 pp_menu_d60c3m4uehtf = new PPAdvancedMenu({ 6920 id: 'd60c3m4uehtf', 6921 type: 'vertical', 6922 mobile: 'expanded', 6923 menuPosition: 'below', 6924 breakpoints: { 6925 large: 1200, 6926 medium: 992, 6927 small: 768, 6928 custom: 768 }, 6929 mobileBreakpoint: 'mobile', 6930 mediaBreakpoint: '768', 6931 mobileMenuType: 'default', 6932 offCanvasDirection: 'left', 6933 submenuRevealTrigger: 'hover', 6934 fullScreenAnimation: '', 6935 isBuilderActive: false }); 6936 6937})(jQuery); 6938 6939;jQuery(document).ready(function( $ ) {
6940 if ( ! $('html').hasClass('fl-builder-edit') ){ 6941 6942 $('.uabb-modal-parent-wrapper').each(function(){ 6943 $(this).appendTo(document.body); 6944 }); 6945 } 6946 6947 /** Accessibility to close the modal on tab of close icon */ 6948 6949 var $modal = jQuery('.uabb-modal.uabb-modal-content'); // Get the modal element 6950 var modalId = $modal.attr('id'); // Fetch the modal ID dynamically 6951 6952 var $closeButton = $('.uabb-modal-close'); 6953 6954 function closeModal() { 6955 $modal.removeClass('uabb-show'); 6956 $modal.attr('aria-hidden', 'true'); 6957 $closeButton.blur(); // Remove focus from close button 6958 } 6959 6960 // Click event to close modal 6961 $closeButton.on('click', function () { 6962 closeModal(); 6963 }); 6964 6965 // Keyboard accessibility: Enter or Space on close button 6966 $closeButton.on('keydown', function (e) { 6967 if (e.key === 'Enter' || e.key === ' ') { 6968 e.preventDefault(); // Prevent page scroll on spacebar 6969 closeModal(); 6970 } 6971 }); 6972 6973 // Pressing ESC key closes the modal 6974 $(document).on('keydown', function (e) { 6975 if (e.key === 'Escape') { 6976 closeModal(); 6977 } 6978 }); 6979}); 6980 6981(function($) { 6982 UABBModalPopup = function( settings ) 6983 { 6984 this.settings = settings; 6985 this.node = settings.id; 6986 this.modal_on = settings.modal_on; 6987 this.modal_custom = settings.modal_custom; 6988 this.modal_content = settings.modal_content; 6989 this.video_autoplay = settings.video_autoplay; 6990 this.enable_cookies = settings.enable_cookies; 6991 this.expire_cookie = settings.expire_cookie; 6992 this.esc_keypress = settings.esc_keypress; 6993 this.overlay_click = settings.overlay_click; 6994 this.responsive_display = settings.responsive_display; 6995 this.medium_device = settings.medium_device; 6996 this.small_device = settings.small_device; 6997 6998 this._initModalPopup(); 6999 this._initModalPopupVideo(); 7000 7001 var modal_resize = this; 7002 7003 $( window ).resize(function() { 7004 modal_resize._centerModal(); 7005 modal_resize._resizeModalPopup(); 7006 }); 7007 7008 }; 7009 7010 UABBModalPopup.prototype = { 7011 7012 settings : {}, 7013 node : '', 7014 modal_trigger : '', 7015 overlay : '', 7016 modal_popup : '', 7017 modal_on : '', 7018 modal_custom : '', 7019 modal_content : '', 7020 enable_cookies : '', 7021 expire_cookie : '', 7022 esc_keypress : '', 7023 overlay_click : '', 7024 video_autoplay : 'no', 7025 responsive_display : '', 7026 medium_device : '', 7027 small_device : '', 7028 7029 /** 7030 * Initiate animation. 7031 * 7032 * @since 1.1.0.2 7033 * @access private 7034 * @method _initAnimations 7035 */ 7036 7037 _initModalPopup: function() { 7038 7039 $this = this; 7040 $node_module = $( '.fl-node-'+$this.node ); 7041 $popup_id = $( '.uamodal-'+$this.node ); 7042 7043 if ( ( $('html').hasClass('uabb-active-live-preview') || ! $('html').hasClass('fl-builder-edit') ) && this.modal_on == 'custom' && this.modal_custom != '' ) { 7044 var custom_wrap = $(this.modal_custom); 7045 7046 if ( custom_wrap.length ) { 7047 custom_wrap.addClass("uabb-modal-action uabb-trigger"); 7048 var data_modal = 'modal-'+this.node; 7049 custom_wrap.attr( 'data-modal', data_modal ); 7050 7051 $this.modal_trigger = custom_wrap; 7052 $this.modal_popup = $( '#modal-' + $this.node ); 7053 var modal_trigger = custom_wrap, 7054 modal_close = $popup_id.find( '.uabb-modal-close' ), 7055 modal_popup = $( '#modal-' + $this.node ); 7056 7057 7058 modal_trigger.bind("click", function(){return false;}); 7059 modal_trigger.on( "click", $.proxy( $this._showModalPopup, $this ) ); 7060 7061 modal_close.on( "click", $.proxy( $this._removeModalHandler, $this ) ); 7062 7063 $popup_id.find('.uabb-modal').on( "click", function( e ) { 7064 if( e.target == this ){ 7065 modal_close.trigger( "click" ); 7066 } 7067 } ); 7068 } 7069 }else if( this.modal_on == 'automatic' ) { 7070 this.modal_popup = $('#modal-' + this.node ); 7071 7072 var refresh_cookies_name = 'refresh-modal-' + this.node, 7073 cookies_status = this.enable_cookies; 7074 7075 if ( cookies_status != 1 && Cookies.get( refresh_cookies_name ) == 'true' ) { 7076 Cookies.remove( refresh_cookies_name ); 7077 } 7078 } 7079 7080 this.overlay = $popup_id.find( '.uabb-overlay' ); 7081 7082 $node_module.find( '.uabb-trigger' ).each(function( index ) { 7083 $this.modal_trigger = $(this); 7084 $this.modal_popup = $( '#modal-' + $this.node ); 7085 var modal_trigger = $(this), 7086 modal_close = $popup_id.find( '.uabb-modal-close' ), 7087 modal_popup = $( '#modal-' + $this.node ); 7088 7089 7090 modal_trigger.bind("click", function(){return false;}); 7091 modal_trigger.on( "click", $.proxy( $this._showModalPopup, $this ) ); 7092 7093 modal_close.on( "click", $.proxy( $this._removeModalHandler, $this ) ) 7094 7095 $popup_id.find('.uabb-modal').on( "click", function( e ) { 7096 if( e.target == this ){ 7097 modal_close.trigger( "click" ); 7098 } 7099 } ); 7100 /*function() { 7101 $this._showModalPopup( this ); 7102 }); 7103 */ 7104 7105 }); 7106 7107 this._centerModal(); 7108 this._iphonecursorfix(); 7109 }, 7110 _showAutomaticModalPopup: function() { 7111 7112 if( ! this._isShowModal() ) { 7113 return; 7114 } 7115 7116 var cookies_name = 'modal-' + this.node, 7117 refresh_cookies_name = 'refresh-modal-' + this.node, 7118 cookies_status = this.enable_cookies, 7119 show_modal = true; 7120 7121 if ( cookies_status == 1 ) { 7122 if ( Cookies.get( cookies_name ) == 'true' ) { 7123 show_modal = false;
7124 } 7125 }else{ 7126 if ( Cookies.get( refresh_cookies_name ) == 'true' ) { 7127 show_modal = false; 7128 } 7129 if ( Cookies.get( cookies_name ) == 'true' ) { 7130 Cookies.remove( cookies_name ); 7131 } 7132 } 7133 7134 if ( show_modal == true ) { 7135 7136 var parent_wrap = $('.fl-node-' + this.node ), 7137 popup_wrap = $('.uamodal-' + this.node ), 7138 trigger_args = '.uamodal-' + this.node + ' .uabb-modal-content-data', 7139 close = popup_wrap.find('.uabb-modal-close' ), 7140 cookies_days = parseInt( $this.expire_cookie ), 7141 current_this = this; 7142 7143 if ( popup_wrap.find( '.uabb-content' ).outerHeight() > $(window).height() ) { 7144 $('html').addClass('uabb-html-modal'); 7145 popup_wrap.find('.uabb-modal').addClass('uabb-modal-scroll'); 7146 } 7147 7148 var modal = this.modal_popup; 7149 7150 if( this.modal_content == 'youtube' || this.modal_content == 'vimeo' ) { 7151 setTimeout( function() { modal.addClass('uabb-show' ); }, 300 ); 7152 } else { 7153 modal.addClass('uabb-show' ); 7154 } 7155 7156 this._videoAutoplay(); 7157 7158 if ( this.esc_keypress == 1 ) { 7159 $(document).on('keyup.uabb-modal',function(e) { 7160 if (e.keyCode == 27) { 7161 current_this.modal_popup.removeClass( 'uabb-show' ); 7162 $('html').removeClass('uabb-html-modal'); 7163 current_this._stopVideo(); 7164 $(document).unbind('keyup.uabb-modal'); 7165 if ( cookies_status == 1 ) { 7166 Cookies.set( cookies_name, 'true', { expires: cookies_days }); 7167 }else{ 7168 Cookies.set( refresh_cookies_name, 'true' ); 7169 } 7170 7171 UABBTrigger.triggerHook( 'uabb-modal-after-close', popup_wrap ); 7172 } 7173 }); 7174 7175 } 7176 7177 7178 if ( this.overlay_click == 1 ) { 7179 7180 this.overlay.on( 'click', function( ev ) { 7181 current_this.modal_popup.removeClass( 'uabb-show' ); 7182 $('html').removeClass('uabb-html-modal'); 7183 current_this._stopVideo(); 7184 if ( cookies_status == 1 ) { 7185 Cookies.set( cookies_name, 'true', { expires: cookies_days }); 7186 }else{ 7187 Cookies.set( refresh_cookies_name, 'true' ); 7188 } 7189 7190 UABBTrigger.triggerHook( 'uabb-modal-after-close', popup_wrap ); 7191 } ); 7192 7193 } 7194 /*$this.overlay.addEventListener( 'click', function( ev ) { 7195 classie.remove( $this.modal_popup, 'uabb-show' ); 7196 });*/ 7197 7198 close.on( 'click', function( ev ) { 7199 ev.preventDefault(); 7200 current_this.modal_popup.removeClass( 'uabb-show' ); 7201 current_this._stopVideo(); 7202 7203 if ( popup_wrap.find( '.uabb-content' ).outerHeight() > $(window).height() ) { 7204 setTimeout(function() { 7205 $('html').removeClass('uabb-html-modal'); 7206 popup_wrap.find('.uabb-modal').removeClass('uabb-modal-scroll'); 7207 }, 300); 7208 } 7209 if ( cookies_status == 1 ) { 7210 Cookies.set( cookies_name, 'true', { expires: cookies_days }); 7211 }else{ 7212 Cookies.set( refresh_cookies_name, 'true' ); 7213 } 7214 7215 UABBTrigger.triggerHook( 'uabb-modal-after-close', popup_wrap ); 7216 } ); 7217 7218 inner_content_close = popup_wrap.find( '.uabb-close-modal' ); 7219 if ( inner_content_close.length ) { 7220 inner_content_close.on( 'click',function(){ 7221 current_this.modal_popup.removeClass( 'uabb-show' ); 7222 current_this._stopVideo(); 7223 if ( cookies_status == 1 ) { 7224 Cookies.set( cookies_name, 'true', { expires: cookies_days }); 7225 }else{ 7226 Cookies.set( refresh_cookies_name, 'true' ); 7227 } 7228 7229 UABBTrigger.triggerHook( 'uabb-modal-after-close', popup_wrap ); 7230 }); 7231 } 7232 7233 /*close.addEventListener( 'click', function( ev ) { 7234 //console.log( hasPerspective ); 7235 7236 classie.remove( $this.modal_popup, 'uabb-show' ); 7237 // console.log( 'Close frontend' ); 7238 7239 7240 });*/ 7241 UABBTrigger.triggerHook( 'uabb-modal-click', trigger_args ); 7242 } 7243 }, 7244 _showModalPopup: function() { 7245 7246 if ( $('html').hasClass('fl-builder-edit') && !$('html').hasClass('uabb-active-live-preview') ) { 7247 return; 7248 } 7249 7250 if( ! this._isShowModal() ) { 7251 return; 7252 } 7253 7254 this._videoAutoplay(); 7255 7256 var active_modal = $('.fl-node-' + this.node ), 7257 active_popup = $('.uamodal-' + this.node ), 7258 trigger_args = '.uamodal-' + this.node + ' .uabb-modal-content-data'; 7259 7260 if ( active_popup.find( '.uabb-content' ).outerHeight() > $(window).height() ) { 7261 $('html').addClass('uabb-html-modal'); 7262 active_popup.find('.uabb-modal').addClass('uabb-modal-scroll'); 7263 } 7264 7265 jQuery(".uabb-modal-title-wrap").siblings(".uabb-modal-close").css("top", "0"); 7266 7267 var modal = $( '#modal-' + this.node ); 7268 7269 if( this.modal_content == 'youtube' || this.modal_content == 'vimeo' ) { 7270 setTimeout( function() { modal.addClass('uabb-show' ); }, 300 ); 7271 } else { 7272 modal.addClass('uabb-show' ); 7273 } 7274 7275 if ( this.overlay_click == 1) { 7276 this.overlay.on( 'click',$.proxy( this._removeModalHandler, this ) ); 7277 } 7278 //this.overlay.addEventListener( 'click', this._removeModalHandler ); 7279 current_this = this; 7280 if( this.modal_trigger.hasClass('uabb-setperspective' ) ) { 7281 setTimeout( function() { 7282 current_this.modal_trigger.addClass('uabb-perspective' ); 7283 }, 25 ); 7284 } 7285 if ( this.esc_keypress == 1 ) { 7286 $(document).on('keyup.uabb-modal',function(e) { 7287 7288 if ( e.keyCode == 27) { 7289 current_this._removeModalHandler(); 7290 } 7291 }); 7292 } 7293 7294 inner_content_close = active_popup.find( '.uabb-close-modal' ); 7295 if ( inner_content_close.length ) { 7296 inner_content_close.on( 'click',$.proxy( this._removeModalHandler, this ) ); 7297 } 7298 7299 UABBTrigger.triggerHook( 'uabb-modal-click', trigger_args ); 7300 }, 7301 _removeModal: function( hasPerspective ) { 7302 var active_modal = $('.fl-node-' + this.node ), 7303 active_popup = $('.uamodal-' + this.node ) ; 7304 7305 this.modal_popup.removeClass('uabb-show' ); 7306 7307 this._stopVideo(); 7308 /*if ( this.modal_content == 'youtube' || this.modal_content == 'vimeo' || this.modal_content == 'video' ) { 7309 7310 var modal_iframe = active_popup.find( 'iframe' ), 7311 modal_src = modal_iframe.attr( "src" ).replace("&autoplay=1", ""); 7312 7313 modal_iframe.attr( "src", '' ); 7314 modal_iframe.attr( "src", modal_src ); 7315 }*/ 7316 7317 if( hasPerspective ) { 7318 this.modal_trigger.removeClass( 'uabb-perspective' ); 7319 } 7320 7321 setTimeout(function() { 7322 $('html').removeClass('uabb-html-modal'); 7323 active_popup.find('.uabb-modal').removeClass('uabb-modal-scroll'); 7324 }, 300); 7325 7326 $(document).unbind('keyup.uabb-modal'); 7327 7328 UABBTrigger.triggerHook( 'uabb-modal-after-close', active_popup ); 7329 7330 }, 7331 _removeModalHandler: function( ev ) { 7332 this._removeModal( this.modal_trigger.hasClass('uabb-setperspective' ) ); 7333 }, 7334 _resizeModalPopup: function() { 7335 var active_modal = $('.fl-node-' + this.node ), 7336 active_popup = $('.uamodal-' + this.node ); 7337 if ( active_popup.find('.uabb-modal').hasClass('uabb-show') ) { 7338 if ( active_popup.find( '.uabb-content' ).outerHeight() > $(window).height() ) { 7339 $('html').addClass('uabb-html-modal'); 7340 active_popup.find('.uabb-modal').addClass('uabb-modal-scroll'); 7341 }else{ 7342 $('html').removeClass('uabb-html-modal'); 7343 active_popup.find('.uabb-modal').removeClass('uabb-modal-scroll'); 7344 } 7345 } 7346 }, 7347 _videoAutoplay: function() { 7348 var active_modal = $('.fl-node-' + this.node ), 7349 active_popup = $('.uamodal-' + this.node ); 7350
7351 if ( this.video_autoplay === 'yes' && ( this.modal_content === 'youtube' || this.modal_content === 'vimeo' ) ) { 7352 7353 var vid_id = $( '#modal-' + this.node ).find( '.uabb-video-player' ).data( 'id' ); 7354 7355 if( 0 === $( '#modal-' + this.node ).find( '.uabb-video-player iframe' ).length ) { 7356 7357 $( '#modal-' + this.node ).find( '.uabb-video-player div[data-id=' + vid_id + ']' ).trigger( 'click' ); 7358 7359 } 7360 else{ 7361 var modal_iframe = active_popup.find( 'iframe' ), 7362 modal_src = modal_iframe.attr( "src" ) + '&autoplay=1'; 7363 7364 modal_iframe.attr( "src", modal_src ); 7365 } 7366 7367 } 7368 if ( 'iframe' === this.modal_content ) { 7369 7370 if( active_popup.find( '.uabb-modal-content-data iframe' ).length === 0 ) { 7371 7372 var src = active_popup.find( '.uabb-modal-content-type-iframe' ).data( 'src' ); 7373 7374 var iframe = document.createElement( "iframe" ); 7375 iframe.setAttribute( "src", src ); 7376 iframe.setAttribute( "style", "display:none;" ); 7377 iframe.setAttribute( "frameborder", "0" ); 7378 iframe.setAttribute( "allowfullscreen", "1" ); 7379 iframe.setAttribute( "width", "100%" ); 7380 iframe.setAttribute( "height", "100%" ); 7381 iframe.setAttribute( "class", "uael-content-iframe" ); 7382 7383 active_popup.find( '.uabb-modal-content-data' ).html( iframe ); 7384 active_popup.find( '.uabb-modal-content-data' ).append( '<div class="uabb-loader"><div class="uabb-loader-1"></div><div class="uabb-loader-2"></div><div class="uabb-loader-3"></div></div>' ); 7385 7386 var id = this.node; 7387 7388 iframe.onload = function() { 7389 window.parent.jQuery( document ).find('#modal-' + id + ' .uabb-loader' ).fadeOut(); 7390 this.style.display='block'; 7391 }; 7392 7393 } 7394 } 7395 }, 7396 _stopVideo: function() { 7397 var active_modal = $('.fl-node-' + this.node ), 7398 active_popup = $('.uamodal-' + this.node ), 7399 autoplay_modal = active_popup.find( '.uabb-modal' ).data( 'autoplay-stop' ); 7400 7401 if ( this.modal_content != 'photo' ) { 7402 7403 var modal_iframe = active_popup.find( 'iframe' ), 7404 modal_video_tag = active_popup.find( 'video' ), 7405 modal_audio_tag = active_popup.find( '.mejs-mediaelement audio' ); 7406 7407 if( autoplay_modal !== 1 ) { 7408 if ( modal_iframe.length ) { 7409 var modal_src = modal_iframe.attr( "src" ).replace("&autoplay=1", ""); 7410 modal_iframe.attr( "src", '' ); 7411 modal_iframe.attr( "src", modal_src ); 7412 }else if ( modal_video_tag.length ) { 7413 modal_video_tag[0].pause(); 7414 modal_video_tag[0].currentTime = 0; 7415 } 7416 if ( modal_audio_tag.length ) { 7417 modal_audio_tag[0].player.pause(); 7418 } 7419 } 7420 } 7421 }, 7422 _isShowModal: function() { 7423 7424 if ( this.responsive_display != '' ) { 7425 7426 var responsive_display = this.responsive_display, 7427 current_window_size = $(window).width(), 7428 medium_device = parseInt( this.medium_device ), 7429 small_device = parseInt( this.small_device ); 7430 7431 if ( ( responsive_display == 'desktop' || responsive_display.includes("desktop") ) && current_window_size > medium_device ) { 7432 7433 return true; 7434 }else if( ( responsive_display == 'desktop-medium' || responsive_display.includes("large") ) && current_window_size > small_device ){ 7435 7436 return true; 7437 }else if( ( responsive_display == 'medium' || responsive_display.includes("medium") ) && current_window_size < medium_device && current_window_size > small_device ){ 7438 7439 return true; 7440 }else if( ( responsive_display == 'medium-mobile' || responsive_display.includes("mobile") ) && current_window_size < medium_device ){ 7441 7442 return true; 7443 }else if( ( responsive_display == 'mobile' || responsive_display.includes("mobile") ) && current_window_size < small_device ){ 7444 7445 return true; 7446 }else{ 7447 7448 return false; 7449 } 7450 } 7451 7452 return true; 7453 }, 7454 _centerModal: function () { 7455 7456 $this = this; 7457 popup_wrap = $('.uamodal-' + this.node ); 7458 modal_popup = '#modal-' + $this.node; 7459 node = '.uamodal-' + $this.node; 7460 7461 if ( $( '#modal-' + this.node ).hasClass('uabb-center-modal') ) { 7462 $( '#modal-' + this.node ).removeClass('uabb-center-modal'); 7463 7464 } 7465 7466 if( $( '#modal-' + this.node + '.uabb-show' ).outerHeight() != null ) { 7467 7468 var top_pos = (($(window).height() - $( '#modal-' + this.node + '.uabb-show' ).outerHeight()) / 2); 7469 7470 if ( popup_wrap.find( '.uabb-content' ).outerHeight() > $(window).height() ) {
7471 $(node).find( modal_popup ).css( 'top', '0' ); 7472 $(node).find( modal_popup ).css( 'transform', 'none' ); 7473 } else { 7474 $(node).find( modal_popup ).css( 'top', + top_pos +'px' ); 7475 $(node).find( modal_popup ).css( 'transform', 'none' ); 7476 } 7477 7478 } else { 7479 7480 if ( popup_wrap.find( '.uabb-content' ).outerHeight() > $(window).height() ) { 7481 $(node).find( modal_popup ).css( 'top', '0' ); 7482 $(node).find( modal_popup ).css( 'transform', 'none' ); 7483 } else { 7484 $(node).find( modal_popup ).css( 'top', '50%' ); 7485 $(node).find( modal_popup ).css( 'transform', 'translateY(-50%)' ); 7486 } 7487 } 7488 7489 }, 7490 _iphonecursorfix: function () { 7491 7492 $this = this; 7493 popup_wrap = $('.uamodal-' + this.node ); 7494 modal_popup = '#modal-' + $this.node; 7495 node = '.uamodal-' + $this.node; 7496 7497 iphone = (( navigator.userAgent.match(/iPhone/i) == 'iPhone' ) ? 'iphone' : '' ); 7498 ipod = (( navigator.userAgent.match(/iPod/i) == 'iPod' ) ? 'ipod' : '' ); 7499 7500 jQuery('html').addClass(iphone).addClass(ipod); 7501 jQuery( 'html.iphone .uabb-modal-action-wrap .uabb-module-content .uabb-button.uabb-trigger, html.ipod .uabb-modal-action-wrap .uabb-module-content .uabb-button.uabb-trigger' ).click ( function() { 7502 jQuery('body').css( 'position', '' ); 7503 }); 7504 7505 if( this.overlay_click == 1 ) { 7506 jQuery(document).on('click', '.uabb-overlay', function() { 7507 if( jQuery('html').hasClass('iphone') || jQuery('html').hasClass('ipod') ) { 7508 jQuery('body').css( 'position', 'relative' ); 7509 } 7510 }); 7511 } 7512 7513 jQuery(document).on('click', '.uabb-modal-close', function() { 7514 if( jQuery('html').hasClass('iphone') || jQuery('html').hasClass('ipod') ) { 7515 jQuery('body').css( 'position', 'relative' ); 7516 } 7517 }); 7518 }, 7519 _initModalPopupVideo : function(){ 7520 7521 var play_icon = 'far fa-play-circle'; 7522 7523 if ( this.modal_content === 'youtube' || this.modal_content === 'vimeo' ) { 7524 7525 if( 0 === $( '.uabb-video-player iframe' ).length ){ 7526 7527 $( '.uabb-video-player' ).each( function( index, value ) { 7528 7529 var div = $( "<div/>" ); 7530 div.attr( 'data-id', $( this ).data( 'id' ) ); 7531 div.attr( 'data-src', $( this ).data( 'src' ) ); 7532 div.attr( 'data-append', $( this ).data( 'append' ) ); 7533 div.html( '<img src="' + $( this ).data( 'thumb' ) + '"><div class="play ' + play_icon + '"></div>' ); 7534 7535 div.on( "click",function(){ 7536 7537 var iframe = document.createElement( "iframe" ); 7538 var src = this.dataset.src; 7539 var append = this.dataset.append; 7540 var url = ''; 7541 7542 if ( 'youtube' === src ) { 7543 url = 'https://www.youtube.com/embed/' + this.dataset.id + this.dataset.append + '&autoplay=1'; 7544 } else { 7545 url = 'https://player.vimeo.com/video/' + this.dataset.id + this.dataset.append + '&autoplay=1'; 7546 } 7547 iframe.setAttribute( "src", url ); 7548 iframe.setAttribute( "frameborder", "0" ); 7549 iframe.setAttribute( "allowfullscreen", "1" ); 7550 this.parentNode.replaceChild( iframe, this ); 7551 }); 7552 $( this ).html( div ); 7553 }); 7554 } 7555 } 7556 } 7557 7558 } 7559 7560})(jQuery); 7561 7562jQuery(document).ready(function($){ 7563 if( 'function' === typeof UABBModalPopup ) { 7564 var UABBModalPopup_h3fr76q1xgvk = new UABBModalPopup({ 7565 id: 'h3fr76q1xgvk', 7566 modal_on: 'automatic', 7567 modal_custom: 'anera-modal-footer', 7568 modal_content: 'saved_rows', 7569 video_autoplay: 'no', 7570 enable_cookies: '1', 7571 expire_cookie: '3', 7572 esc_keypress: '1', 7573 overlay_click: '1', 7574 responsive_display: 'desktop,large,medium,mobile', 7575 medium_device: '992', 7576 small_device: '768', 7577 }); 7578 7579 7580 /**/ 7581 7582 $(this).on('mouseleave', function(e){ 7583 if( e.clientY < 0 ) { 7584 UABBModalPopup_h3fr76q1xgvk._showAutomaticModalPopup(); 7585 } 7586 }); 7587 7588 } 7589}); 7590 7591/* Start Layout Custom JS */ 7592 7593/* End Layout Custom JS */ 7594 7595
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.