1/** 2 * Load utils - BEGIN 3 */ 4/* 5 CSS Browser Selector 1.0 6 Originally written by Rafael Lima (http://rafael.adm.br) 7 http://rafael.adm.br/css_browser_selector 8 License: http://creativecommons.org/licenses/by/2.5/ 9 10 Co-maintained by: 11 https://github.com/ridjohansen/css_browser_selector 12 https://github.com/wbruno/css_browser_selector 13 */ 14 15"use strict"; 16 17window.requestAnimFrame = (function() { 18 return window.requestAnimationFrame || 19 window.webkitRequestAnimationFrame || 20 window.mozRequestAnimationFrame || 21 window.oRequestAnimationFrame || 22 window.msRequestAnimationFrame || 23 function(/* function */ callback, /* DOMElement */ element){ 24 window.setTimeout(callback, 1000 / 60); 25 }; 26})(); 27 28window.requestTimeout = function(fn, delay) { 29 if( !window.requestAnimationFrame && 30 !window.webkitRequestAnimationFrame && 31 !(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support 32 !window.oRequestAnimationFrame && 33 !window.msRequestAnimationFrame) 34 return window.setTimeout(fn, delay); 35 36 var start = new Date().getTime(), 37 handle = new Object(); 38 39 function loop(){ 40 var current = new Date().getTime(), 41 delta = current - start; 42 43 delta >= delay ? fn.call() : handle.value = requestAnimFrame(loop); 44 }; 45 46 handle.value = requestAnimFrame(loop); 47 return handle; 48}; 49 50window.clearRequestTimeout = function(handle) { 51 if ( typeof handle !== 'undefined' ) { 52 window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) : 53 window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) : 54 window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */ 55 window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) : 56 window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) : 57 window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) : 58 clearTimeout(handle); 59 } 60}; 61 62var uaInfo = { 63 ua: '', 64 is: function(t) { 65 return RegExp(t, "i").test(uaInfo.ua); 66 }, 67 version: function(p, n) { 68 n = n.replace(".", "_"); 69 var i = n.indexOf('_'), 70 ver = ""; 71 while (i > 0) { 72 ver += " " + p + n.substring(0, i); 73 i = n.indexOf('_', i + 1); 74 } 75 ver += " " + p + n; 76 return ver; 77 }, 78 getBrowser: function() { 79 var g = 'gecko', 80 w = 'webkit', 81 c = 'chrome', 82 f = 'firefox', 83 s = 'safari', 84 o = 'opera', 85 a = 'android', 86 bb = 'blackberry', 87 dv = 'device_', 88 ua = uaInfo.ua, 89 is = uaInfo.is; 90 return [ 91 (!(/opera|webtv/i.test(ua)) && /msie\s(\d+)/.test(ua)) ? ('ie ie' + (/trident\/4\.0/.test(ua) ? '8' : RegExp.$1)) 92 : is('edge\/') ? 'edge ie' + (/edge\/(\d+)\.(\d+)/.test(ua) ? RegExp.$1 + ' ie' + RegExp.$1 + '_' + RegExp.$2 : '') // IE Edge 93 : is('trident\/') ? 'ie ie'+ (/trident\/.+rv:(\d+)/i.test(ua) ? RegExp.$1 : '') //ie11+ 94 : is('firefox/') ? g + " " + f + (/firefox\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua) ? ' ' + f + RegExp.$2 + ' ' + f + RegExp.$2 + "_" + RegExp.$4 : '') 95 : is('gecko/') ? g 96 : is('opera') ? o + (/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua) ? ' ' + o + RegExp.$2 + ' ' + o + RegExp.$2 + "_" + RegExp.$4 : (/opera(\s|\/)(\d+)\.(\d+)/.test(ua) ? ' ' + o + RegExp.$2 + " " + o + RegExp.$2 + "_" + RegExp.$3 : '')) 97 : is('konqueror') ? 'konqueror' 98 : is('blackberry') ? (bb + (/Version\/(\d+)(\.(\d+)+)/i.test(ua) ? " " + bb + RegExp.$1 + " " + bb + RegExp.$1 + RegExp.$2.replace('.', '_') : (/Blackberry ?(([0-9]+)([a-z]?))[\/|;]/gi.test(ua) ? ' ' + bb + RegExp.$2 + (RegExp.$3 ? ' ' + bb + RegExp.$2 + RegExp.$3 : '') : ''))) // blackberry 99 : is('android') ? (a + (/Version\/(\d+)(\.(\d+))+/i.test(ua) ? " " + a + RegExp.$1 + " " + a + RegExp.$1 + RegExp.$2.replace('.', '_') : '') + (/Android (.+); (.+) Build/i.test(ua) ? ' ' + dv + ((RegExp.$2).replace(/ /g, "_")).replace(/-/g, "_") : '')) //android 100 : is('chrome') ? w + ' ' + c + (/chrome\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua) ? ' ' + c + RegExp.$2 + ((RegExp.$4 > 0) ? ' ' + c + RegExp.$2 + "_" + RegExp.$4 : '') : '') 101 : is('iron') ? w + ' iron' 102 : is('applewebkit/') ? (w + ' ' + s + (/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua) ? ' ' + s + RegExp.$2 + " " + s + RegExp.$2 + RegExp.$3.replace('.', '_') : (/ Safari\/(\d+)/i.test(ua) ? ((RegExp.$1 == "419" || RegExp.$1 == "417" || RegExp.$1 == "416" || RegExp.$1 == "412") ? ' ' + s + '2_0' : RegExp.$1 == "312" ? ' ' + s + '1_3' : RegExp.$1 == "125" ? ' ' + s + '1_2' : RegExp.$1 == "85" ? ' ' + s + '1_0' : '') : ''))) //applewebkit 103 : is('mozilla/') ? g : '' 104 ]; 105 }, 106 getPlatform : function() { 107 var wp = 'winphone', 108 a = 'android', 109 bb = 'blackberry', 110 dv = 'device_', 111 112 ua = uaInfo.ua, 113 version = uaInfo.version, 114 is = uaInfo.is; 115 116 return [ 117 is('j2me') ? 'j2me' 118 :is('windows phone') ? (wp + (/Windows Phone (\d+)(\.(\d+))+/i.test(ua) ? " " + wp + RegExp.$1 + " " + wp + RegExp.$1 + RegExp.$2.replace('.', '_') : (/Windows Phone OS (\d+)(\.(\d+))+/i.test(ua) ? " " + wp + RegExp.$1 + " " + wp + RegExp.$1 + RegExp.$2.replace('.', '_') : ''))) // Windows Phone 119 :is('blackberry') ? (bb + (/Version\/(\d+)(\.(\d+)+)/i.test(ua) ? " " + bb + RegExp.$1 + " " + bb + RegExp.$1 + RegExp.$2.replace('.', '_') : (/Blackberry ?(([0-9]+)([a-z]?))[\/|;]/gi.test(ua) ? ' ' + bb + RegExp.$2 + (RegExp.$3 ? ' ' + bb + RegExp.$2 + RegExp.$3 : '') : ''))) // blackberry 120 :is('android') ? (a + (/Version\/(\d+)(\.(\d+))+/i.test(ua) ? " " + a + RegExp.$1 + " " + a + RegExp.$1 + RegExp.$2.replace('.', '_') : '') + (/Android (.+); (.+) Build/i.test(ua) ? ' ' + dv + ((RegExp.$2).replace(/ /g, "_")).replace(/-/g, "_") : '')) //android 121 :is('ipad|ipod|iphone') ? ( 122 (/CPU( iPhone)? OS (\d+[_|\.]\d+([_|\.]\d+)*)/i.test(ua) ? 'ios' + version('ios', RegExp.$2) : '') + ' ' + (/(ip(ad|od|hone))/gi.test(ua) ? RegExp.$1 : "")) //'iphone' 123 //:is('ipod')?'ipod' 124 //:is('ipad')?'ipad' 125 :is('playbook') ? 'playbook' 126 :is('kindle|silk') ? 'kindle' 127 :is('playbook') ? 'playbook' 128 :is('mac') ? 'mac' + (/mac os x ((\d+)[.|_](\d+))/.test(ua) ? (' mac'
128+ (RegExp.$2) + ' mac' + (RegExp.$1).replace('.', "_")) : '') 129 :is('win') ? 'win' + (is('windows nt 10.0') ? ' win10' 130 :is('windows nt 6.3') ? ' win8_1' 131 :is('windows nt 6.2') ? ' win8' 132 :is('windows nt 6.1') ? ' win7' 133 :is('windows nt 6.0') ? ' vista' 134 :is('windows nt 5.2') || is('windows nt 5.1') ? ' win_xp' 135 :is('windows nt 5.0') ? ' win_2k' 136 :is('windows nt 4.0') || is('WinNT4.0') ? ' win_nt' : '') 137 :is('freebsd') ? 'freebsd' 138 :is('x11|linux') ? 'linux' : '' 139 ]; 140 }, 141 getMobile: function() { 142 var is = uaInfo.is; 143 return [ 144 is("android|mobi|mobile|j2me|iphone|ipod|ipad|blackberry|playbook|kindle|silk") ? 'mobile' : '' 145 ]; 146 }, 147 getIpadApp: function() { 148 var is = uaInfo.is; 149 return [ 150 (is('ipad|iphone|ipod') && !is('safari')) ? 'ipad_app' : '' 151 ]; 152 }, 153 getLang: function() { 154 var ua = uaInfo.ua; 155 return [/[; |\[](([a-z]{2})(\-[a-z]{2})?)[)|;|\]]/i.test(ua) ? ('lang_' + RegExp.$2).replace("-", "_") + (RegExp.$3 != '' ? (' ' + 'lang_' + RegExp.$1).replace("-", "_") : '') : '']; 156 } 157} 158var screenInfo = { 159 width: document.documentElement.clientWidth ? document.documentElement.clientWidth + 15 : window.outerWidth, 160 height: document.documentElement.clientHeight || window.outerHeight, 161 screens: [ 162 [340, 'screen-xxs'], 163 [570, 'screen-xs'], 164 [960, 'screen-sm'], 165 [1500, 'screen-md'], 166 [1700, 'screen-lg'], 167 ], 168 screenSize: function() { 169 screenInfo.width = document.documentElement.clientWidth ? document.documentElement.clientWidth + 15 : window.outerWidth; 170 screenInfo.height = document.documentElement.clientHeight || window.outerHeight; 171 var screens = screenInfo.screens, 172 i = screens.length, 173 arr = []; 174 175 while (i--) { 176 if (screenInfo.width >= screens[i][0]) { 177 arr.push(screens[i][1]); 178 } 179 } 180 181 return arr; 182 }, 183 getOrientation: function() { 184 return screenInfo.width < screenInfo.height ? ["orientation_portrait"] : ["orientation_landscape"]; 185 }, 186 getInfo: function() { 187 var arr = []; 188 arr = arr.concat(screenInfo.screenSize()); 189 arr = arr.concat(screenInfo.getOrientation()); 190 return arr; 191 }, 192 getPixelRatio: function() { 193 var arr = [], 194 pixelRatio = window.devicePixelRatio ? window.devicePixelRatio : 1; 195 if (pixelRatio > 1) { 196 arr.push('retina_' + parseInt(pixelRatio) + 'x'); 197 arr.push('hidpi'); 198 } else { 199 arr.push('no-hidpi'); 200 } 201 return arr; 202 } 203} 204var dataUriInfo = { 205 data: new Image(), 206 div: document.createElement("div"), 207 isIeLessThan9: false, 208 getImg: function() { 209 dataUriInfo.data.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="; 210 dataUriInfo.div.innerHTML = "<!--[if lt IE 9]><i></i><![endif]-->"; 211 dataUriInfo.isIeLessThan9 = dataUriInfo.div.getElementsByTagName("i").length == 1; 212 return dataUriInfo.data; 213 }, 214 checkSupport: function() { 215 if (dataUriInfo.data.width != 1 || dataUriInfo.data.height != 1 || dataUriInfo.isIeLessThan9) { 216 return ["no-datauri"]; 217 } else { 218 return ["datauri"]; 219 } 220 } 221} 222 223function css_browser_selector(u, ns) { 224 var html = document.documentElement, 225 b = [] 226 ns = ns ? ns : ""; 227 /* ua */ 228 uaInfo.ua = u.toLowerCase(); 229 var browser = uaInfo.getBrowser(); 230 if (browser == 'gecko') browser = (!(window.ActiveXObject) && "ActiveXObject" in window) ? 'ie ie11' : browser; 231 var pattTouch = /no-touch/g; 232 if (pattTouch.test(html.className)) b = b.concat('no-touch'); 233 else b = b.concat('touch'); 234 var pattAdmin = /admin-mode/g; 235 if (pattAdmin.test(html.className)) b = b.concat('admin-mode'); 236 b = b.concat(browser); 237 b = b.concat(uaInfo.getPlatform()); 238 b = b.concat(uaInfo.getMobile()); 239 b = b.concat(uaInfo.getIpadApp()); 240 b = b.concat(uaInfo.getLang()); 241 /* js */ 242 b = b.concat(['js']); 243 /* no animations */ 244 var noAnimations = /no-cssanimations/g; 245 if (noAnimations.test(html.className)) { 246 b = b.concat('no-cssanimations'); 247 } 248 /* pixel ratio */ 249 b = b.concat(screenInfo.getPixelRatio()); 250 /* screen */ 251 b = b.concat(screenInfo.getInfo()); 252 var updateScreen = function() { 253 html.className = html.className.replace(/ ?orientation_\w+/g, "").replace(/ [min|max|cl]+[w|h]_\d+/g, ""); 254 html.className = html.className.replace(/ ?screen-\w+/g, ""); 255 html.className = html.className + ' ' + screenInfo.getInfo().join(' '); 256 } 257 if (SiteParameters.listen_for_screen_update) { 258 window.addEventListener('resize', updateScreen); 259 window.addEventListener('orientationchange', updateScreen); 260 } 261 /* dataURI */ 262 var data = dataUriInfo.getImg(); 263 data.onload = data.onerror = function() { 264 html.className += ' ' + dataUriInfo.checkSupport().join(' '); 265 }
266 /* removendo itens invalidos do array */ 267 b = b.filter(function(e) { 268 return e; 269 }); 270 /* prefixo do namespace */ 271 b[0] = ns ? ns + b[0] : b[0]; 272 html.className = b.join(' ' + ns); 273 return html.className; 274 } 275 // define css_browser_selector_ns before loading this script to assign a namespace 276var css_browser_selector_ns = css_browser_selector_ns || ""; 277// init 278css_browser_selector(navigator.userAgent, css_browser_selector_ns); 279/** 280 * skip-link-focus-fix.js 281 * 282 * Helps with accessibility for keyboard only users. 283 * 284 * Learn more: https://github.com/Automattic/_s/pull/136 285 */ 286(function() { 287 var is_webkit = navigator.userAgent.toLowerCase().indexOf('webkit') > -1, 288 is_opera = navigator.userAgent.toLowerCase().indexOf('opera') > -1, 289 is_ie = navigator.userAgent.toLowerCase().indexOf('msie') > -1; 290 if ((is_webkit || is_opera || is_ie) && document.getElementById && window.addEventListener) { 291 window.addEventListener('hashchange', function() { 292 var id = location.hash.substring(1), 293 element; 294 if (!(/^[A-z0-9_-]+$/.test(id))) { 295 return; 296 } 297 element = document.getElementById(id); 298 if (element) { 299 if (!(/^(?:a|select|input|button|textarea)$/i.test(element.tagName))) { 300 element.tabIndex = -1; 301 } 302 element.focus(); 303 } 304 }, false); 305 } 306})(); 307// Polyfill for creating CustomEvents on IE9/10/11 308// code pulled from: 309// https://github.com/d4tocchini/customevent-polyfill 310// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill 311try { 312 new CustomEvent("test"); 313} catch (e) { 314 var CustomEvent = function(event, params) { 315 var evt; 316 params = params || { 317 bubbles: false, 318 cancelable: false, 319 detail: undefined 320 }; 321 evt = document.createEvent("CustomEvent"); 322 evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); 323 return evt; 324 }; 325 CustomEvent.prototype = window.Event.prototype; 326 window.CustomEvent = CustomEvent; // expose definition to window 327} 328// Evento - v1.0.0 329// by Erik Royall <[email protected]> (http://erikroyall.github.io) 330// Dual licensed under MIT and GPL 331// Array.prototype.indexOf shim 332// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf 333Array.prototype.indexOf || (Array.prototype.indexOf = function(n) { 334 "use strict"; 335 if (null == this) throw new TypeError; 336 var t, e, o = Object(this), 337 r = o.length >>> 0; 338 if (0 === r) return -1; 339 if (t = 0, arguments.length > 1 && (t = Number(arguments[1]), t != t ? t = 0 : 0 != t && 1 / 0 != t && t != -1 / 0 && (t = (t > 0 || -1) * Math.floor(Math.abs(t)))), t >= r) return -1; 340 for (e = t >= 0 ? t : Math.max(r - Math.abs(t), 0); r > e; e++) 341 if (e in o && o[e] === n) return e; 342 return -1 343}); 344var evento = function(n) { 345 var t, e, o, r = n, 346 i = r.document, 347 f = {}; 348 return t = function() { 349 return "function" == typeof i.addEventListener ? function(n, t, e) { 350 n.addEventListener(t, e, !1), f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t].push(e) 351 } : "function" == typeof i.attachEvent ? function(n, t, e) { 352 n.attachEvent(t, e), f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t].push(e) 353 } : function(n, t, e) { 354 n["on" + t] = e, f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t].push(e) 355 } 356 }(), e = function() { 357 return "function" == typeof i.removeEventListener ? function(n, t, e) { 358 n.removeEventListener(t, e, !1), Helio.each(f[n][t], function(o) { 359 o === e && (f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t][f[n][t].indexOf(o)] = void 0) 360 }) 361 } : "function" == typeof i.detachEvent ? function(n, t, e) { 362 n.detachEvent(t, e), Helio.each(f[n][t], function(o) { 363 o === e && (f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t][f[n][t].indexOf(o)] = void 0) 364 }) 365 } : function(n, t, e) { 366 n["on" + t] = void 0, Helio.each(f[n][t], function(o) { 367 o === e && (f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t][f[n][t].indexOf(o)] = void 0) 368 }) 369 } 370 }(), o = function(n, t) { 371 f[n] = f[n] || {}, f[n][t] = f[n][t] || []; 372 for (var e = 0, o = f[n][t].length; o > e; e += 1) f[n][t][e]() 373 }, { 374 add: t, 375 remove: e, 376 trigger: o, 377 _handlers: f 378 } 379}(this); 380// DOM class helper 381(function(window) { 382 'use strict'; 383 // class helper functions from bonzo https://github.com/ded/bonzo 384 function classReg(className) { 385 return new RegExp("(^|\\s+)" + className + "(\\s+|$)"); 386 } 387 // classList support for class management 388 // altho to be fair, the api sucks because it won't accept multiple classes at once 389 var hasClass, addClass, removeClass; 390 if ('classList' in document.documentElement) { 391 hasClass = function(elem, c) { 392 if ( elem !== null && typeof elem !== 'undefined' && typeof elem.classList !== 'undefined' ) return elem.classList.contains(c); 393 }; 394 addClass = function(elem, c) { 395 if ( elem !== null && typeof elem !== 'undefined' && typeof elem.classList !== 'undefined' ) elem.classList.add(c); 396 }; 397 removeClass = function(elem, c) { 398 if ( elem !== null && typeof elem !== 'undefined' && typeof elem.classList !== 'undefined' ) elem.classList.remove(c); 399 }; 400 } else { 401 hasClass = function(elem, c) { 402 if (elem !== null) return classReg(c).test(elem.className); 403 }; 404 addClass = function(elem, c) { 405 if (!hasClass(elem, c)) { 406 if (elem !== null) elem.className = elem.className + ' ' + c; 407 } 408 }; 409 removeClass = function(elem, c) { 410 if (elem !== null) elem.className = elem.className.replace(classReg(c), ' '); 411 }; 412 } 413 414 function toggleClass(elem, c) { 415 var fn = hasClass(elem, c) ? removeClass : addClass; 416 fn(elem, c); 417 } 418 var classie = { 419 // full names 420 hasClass: hasClass, 421 addClass: addClass, 422 removeClass: removeClass, 423 toggleClass: toggleClass, 424 // short names 425 has: hasClass, 426 add: addClass, 427 remove: removeClass, 428 toggle: toggleClass 429 }; 430 // transport 431 if (typeof define === 'function' && define.amd) { 432 // AMD 433 define(classie); 434 } else { 435 // browser global 436 window.classie = classie; 437 } 438 439 window.wrap = function(wrapper, elms) { 440 if (!elms.length) { 441 elms = [elms]; 442 } 443 444 for (var i = elms.length - 1; i >= 0; i--) { 445 var child = (i > 0) ? wrapper.cloneNode(true) : wrapper; 446 var el = elms[i]; 447 448 var parent = el.parentNode; 449 var sibling = el.nextSibling; 450 451 child.appendChild(el); 452 453 if (sibling) { 454 parent.insertBefore(child, sibling); 455 } else { 456 parent.appendChild(child); 457 } 458 } 459 }; 460 461 window.wrapAll = function(wrapper, nodes) { 462 var parent = nodes[0].parentNode; 463 var previousSibling = nodes[0].previousSibling; 464 465 for (var i = 0; nodes.length - i;
465 wrapper.firstChild === nodes[0] && i++) { 466 wrapper.appendChild(nodes[i]); 467 } 468 469 var nextSibling = previousSibling ? previousSibling.nextSibling : parent.firstChild; 470 parent.insertBefore(wrapper, nextSibling); 471 472 return wrapper; 473 }; 474})(window); 475/* From Modernizr */ 476function whichTransitionEvent() { 477 var t; 478 var el = document.createElement('fakeelement'); 479 var transitions = { 480 'transition': 'transitionend', 481 'OTransition': 'oTransitionEnd', 482 'MozTransition': 'transitionend', 483 'WebkitTransition': 'webkitTransitionEnd' 484 } 485 for (t in transitions) { 486 if (el.style[t] !== undefined) { 487 return transitions[t]; 488 } 489 } 490 } 491function whichAnimationEvent() { 492 var t; 493 var el = document.createElement('fakeelement'); 494 var animations = { 495 'animation': 'animationend', 496 'OAnimation': 'oAnimationEnd', 497 'MozAnimation': 'animationend', 498 'WebkitAnimation': 'webkitAnimationEnd' 499 } 500 for (t in animations) { 501 if (el.style[t] !== undefined) { 502 return animations[t]; 503 } 504 } 505 } 506/** 507 * Load utils - END 508 */ 509 510/** 511 * Start main js 512 */ 513(function(window, undefined) { 514 'use strict'; 515 516 // Init variables 517 var bodyTop, 518 scrollbarWidth = false, 519 noScroll = false, 520 boxEvent = new CustomEvent('boxResized'), 521 menuClose = new CustomEvent('menuClose'), 522 menuOpen = new CustomEvent('menuOpen'), 523 bodyBorder = 0, 524 adminBarHeight = 0, 525 boxWidth = 0, 526 boxLeft = 0, 527 parallaxRows, 528 parallaxCols, 529 parallaxHeaders, 530 kenburnsHeaders, 531 kenburnsRows, 532 kenburnsCols, 533 backwashHeaders, 534 backwashRows, 535 backwashCols, 536 visibleRows, 537 headerWithOpacity, 538 speedDivider = SiteParameters.parallax_factor, 539 adminBar, 540 pageHeader, 541 headerVideo, 542 masthead, 543 mastheadMobile, 544 menuMobileTransparent, 545 mastheadMobilePaddingTop = 0, 546 offcanvas_overlay_close, 547 maincontainer, 548 menuwrapper, 549 menuhide, 550 $mainHeader, 551 mainHeader, 552 $mainWrapper, 553 $initBox, 554 menusticky, 555 menuStickyMobile, 556 menuHeight = 0, 557 menuMobileHeight = 0, 558 mainmenu = new Array(), 559 secmenu = new Array(),
560 secmenuHeight = 0, 561 transmenuHeight = 0, 562 header, 563 transmenuel, 564 logo, 565 logoel, 566 logolink, 567 logoMinScale, 568 lastScrollValue = 0, 569 wwidth = uaInfo.getIpadApp() == 'ipad_app' ? document.documentElement.clientWidth : window.innerWidth || document.documentElement.clientWidth, 570 wheight = uaInfo.getIpadApp() == 'ipad_app' ? document.documentElement.clientHeight : window.innerHeight || document.documentElement.clientHeight, 571 mediaQuery = 959, 572 mediaQueryMobile = 569, 573 printDialogOpen = false, 574 isScrolling = false, 575 boxWrapper, 576 docheight = 0, 577 isMobile = wwidth <= mediaQuery, 578 isIE = classie.hasClass(document.documentElement, 'ie') || classie.hasClass(document.documentElement, 'opera12') ? true : false, 579 isFF = classie.hasClass(document.documentElement, 'firefox') ? true : false, 580 isFullPage, 581 isFullPageSnap, 582 isFrontEndEditor, 583 transitionEvent = whichTransitionEvent(), 584 animationEvent = whichAnimationEvent(), 585 footerScroller = false, 586 menuOpened = false, 587 overlayOpened = false, 588 menuMobileTriggerEvent = new CustomEvent('menuMobileTrigged'), 589 resizeTimer_, 590 resizeTimer, 591 hidingTimer, 592 isSplitMenu = false, 593 mainNavMenu, 594 mainNavWrapper, 595 isMobileTransparent = false, 596 isMobileParallaxAllowed = SiteParameters.mobile_parallax_allowed, 597 loadedFonts = new Array(), 598 already_font = false, 599 scrollRowHeight_fix = window.pageYOffset, 600 isQuickView = false, 601 menuStickyMobileOverlay = false, 602 603 checkVisible = function( elm ) { 604 var rect = elm.getBoundingClientRect(); 605 var viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight); 606 return !(rect.bottom < 0 || rect.top - viewHeight >= 0); 607 }, 608 initBox = function() { 609 var bodyBorderDiv = document.querySelectorAll('.body-borders .top-border'); 610 if (bodyBorderDiv.length) { 611 bodyBorder = outerHeight(bodyBorderDiv[0]); 612 } else bodyBorder = 0; 613 UNCODE.isRTL = classie.hasClass(document.body, 'rtl') ? true : false, 614 UNCODE.bodyBorder = bodyBorder; 615 UNCODE.isFrontEndEditor = classie.hasClass(document.body, 'compose-mode') && classie.hasClass(document.body, 'vc_editor'); 616 UNCODE.isFullPage = !UNCODE.isFrontEndEditor && classie.hasClass(document.body, 'uncode-fullpage-slide') && !( UNCODE.isMobile && classie.hasClass(document.body, 'uncode-fp-mobile-disable') && window.innerWidth < 570 ); 617 UNCODE.isFullPageSnap = !UNCODE.isFrontEndEditor && classie.hasClass(document.body, 'uncode-scroll-snap'); 618 if (bodyBorder != 0) { 619 if ( !UNCODE.isFullPage ) { 620 document.documentElement.style.paddingTop = bodyBorder + 'px'; 621 } 622 wheight = (uaInfo.getIpadApp() == 'ipad_app' ? document.documentElement.clientWidth : window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2); 623 } 624 if (!isMobile && !scrollbarWidth) { 625 // Create the measurement node 626 var scrollDiv = document.createElement("div"); 627 scrollDiv.className = "scrollbar-measure"; 628 var dombody = document.body; 629 if (dombody != null) { 630 dombody.appendChild(scrollDiv); 631 // Get the scrollbar width 632 scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; 633 // Delete the DIV 634 dombody.removeChild(scrollDiv); 635 } 636 } 637 if (!isMobile) { 638 forEachElement('.box-container', function(el, i) { 639 if (!classie.hasClass(el, 'limit-width')) { 640 var elWidth = outerWidth(el), 641 newWidth = 12 * Math.ceil((wwidth - scrollbarWidth) / 12); 642 boxWidth = newWidth - (bodyBorder * 2); 643 boxLeft = (wwidth - boxWidth - scrollbarWidth) / 2; 644 el.style.width = boxWidth + 'px'; 645 if ( UNCODE.isRTL ) 646 el.style.marginRight = boxLeft + 'px'; 647 else 648 el.style.marginLeft = boxLeft + 'px'; 649 if (mainmenu != undefined && mainmenu[0] != undefined) { 650 mainmenu[0].style.width = boxWidth + 'px'; 651 } 652 } 653 }); 654 } 655 656 if (classie.hasClass(document.body, 'menu-mobile-transparent') && !classie.hasClass(document.body, 'hmenu-center')) isMobileTransparent = true; 657 658 if (!isMobileTransparent) { 659 if (wwidth > mediaQuery && classie.hasClass(document.body, 'menu-force-opacity')) classie.removeClass(document.body, 'menu-force-opacity'); 660 if (wwidth <= mediaQuery && !classie.hasClass(document.body, 'menu-force-opacity')) classie.addClass(document.body, 'menu-force-opacity'); 661 } 662 663 UNCODE.isQuickView = isQuickView; 664 665 }, 666 fixMenuHeight = function() { 667 if (!classie.hasClass(document.body, 'vmenu')) noScroll = true; 668 669 menuwrapper = document.querySelectorAll(".menu-wrapper"); 670 masthead = document.getElementById("masthead"); 671 offcanvas_overlay_close = document.querySelector('.uncode-close-offcanvas-overlay'); 672 if (classie.hasClass(document.body, 'hmenu-center-split') && document.getElementById("logo-container-mobile") != null && document.getElementById("main-logo") != null ) { 673 mastheadMobile = new Array(document.getElementById("logo-container-mobile"), document.getElementById("main-logo").parentNode); 674 } else mastheadMobile = document.getElementById("logo-container-mobile"); 675 menuhide = document.querySelector('#masthead .menu-hide, .main-header .menu-hide, #masthead .menu-hide-vertical');
676 menusticky = document.querySelectorAll('.menu-sticky, .menu-sticky-vertical'); 677 transmenuel = document.querySelectorAll('.menu-transparent:not(.vmenu-container)'); 678 var menuItemsButton = document.querySelectorAll('.menu-item-button .menu-btn-table'); 679 logo = document.querySelector('#main-logo'); 680 if (logo != undefined) logolink = (logo.firstElementChild || logo.firstChild); 681 if (logolink != undefined) logoMinScale = logolink.getAttribute("data-minheight"); 682 logoel = document.querySelectorAll('.menu-shrink .logo-container'); 683 mainmenu = document.querySelectorAll('.vmenu .vmenu-container, .menu-primary .menu-container'); 684 if (classie.hasClass(document.body, 'hmenu-center')) { 685 var mainmenucenter = document.querySelectorAll('.hmenu-center .menu-container-mobile'); 686 var first_array = Array.prototype.slice.call(mainmenu); 687 var second_array = Array.prototype.slice.call(mainmenucenter); 688 mainmenu = first_array.concat(second_array); 689 } 690 secmenu = document.querySelectorAll('.menu-secondary'); 691 calculateMenuHeight(true); 692 for (var k = 0;
692 k < menuItemsButton.length; k++) { 693 var a_item = menuItemsButton[k].parentNode, 694 buttonHeight = outerHeight(menuItemsButton[k]); 695 a_item.style.height = buttonHeight + 'px'; 696 } 697 if (classie.hasClass(document.body, 'hmenu-center-split')) { 698 mainNavMenu = document.querySelector('#masthead .navbar-main .menu-primary-inner'); 699 mainNavWrapper = document.querySelector('#masthead > .menu-container'); 700 isSplitMenu = true; 701 } 702 703 var $secondary_menu_html = document.getElementById("secondary-menu-html"); 704 if ( (classie.hasClass(document.body, 'vmenu') || classie.hasClass(document.body, 'menu-offcanvas')) && $secondary_menu_html == null ) { 705 classie.addClass(document.body, 'menu-offcanvas-additional-text') 706 } 707 708 fixMenu(); 709 menuOpacity(); 710 }, 711 menuOpacity = function(){ 712 transmenuel = document.querySelectorAll('.menu-transparent:not(.vmenu-container)'); 713 if (typeof transmenuel === 'undefined' || !transmenuel.length) { 714 return false; 715 } 716 if (wwidth > mediaQuery && classie.hasClass(transmenuel[0], 'menu-desktop-transparent')) { 717 classie.removeClass(transmenuel[0], 'menu-desktop-transparent'); 718 classie.addClass(transmenuel[0], 'menu-desktop-transparent'); 719 } else if (wwidth <= mediaQuery && classie.hasClass(transmenuel[0], 'menu-desktop-transparent')) { 720 classie.removeClass(transmenuel[0], 'menu-desktop-transparent'); 721 classie.addClass(transmenuel[0], 'menu-desktop-transparent'); 722 } 723 }, 724 verticalRightMenu = function() { 725 var setVrightMenu, vRightMenuw; 726 var vRightMenu = function(){ 727 $initBox = document.getElementById("initBox"); 728 $mainHeader = document.querySelector('.main-header'); 729 mainHeader = $mainHeader.innerHTML; 730 $mainWrapper = document.querySelector('.main-wrapper'); 731 if ( classie.hasClass(document.body, 'vmenu') && ( ( classie.hasClass(document.body, 'vmenu-position-right') && ! classie.hasClass(document.body, 'rtl') ) || ( classie.hasClass(document.body, 'vmenu-position-left') && classie.hasClass(document.body, 'rtl') ) ) ) { 732 if ( wwidth <= mediaQuery ) { 733 $initBox.parentNode.insertBefore($mainHeader, $initBox.nextSibling); 734 } else { 735 $mainWrapper.parentNode.insertBefore($mainHeader, $mainWrapper.nextSibling); 736 } 737 $mainHeader.removeChild; 738 } 739 window.dispatchEvent(new Event('lateral_resize')); 740 }; 741 vRightMenu(); 742 window.addEventListener("resize", function() { 743 if ( wwidth != vRightMenuw ) { 744 clearRequestTimeout(setVrightMenu); 745 setVrightMenu = requestTimeout( function(){ 746 vRightMenuw = wwidth; 747 vRightMenu(); 748 }, 100 ); 749 } 750 }); 751 }, 752 calculateMenuHeight = function(first) { 753 menuHeight = transmenuHeight = secmenuHeight = 0; 754 755 if (mastheadMobile != null) { 756 if (mastheadMobile.length === 2) { 757 if (wwidth > mediaQuery) { 758 UNCODE.menuMobileHeight = outerHeight(mastheadMobile[1]); 759 mastheadMobilePaddingTop = parseFloat(getComputedStyle(mastheadMobile[1]).paddingTop); 760 } else { 761 UNCODE.menuMobileHeight = outerHeight(mastheadMobile[0]); 762 mastheadMobilePaddingTop = parseFloat(getComputedStyle(mastheadMobile[0]).paddingTop); 763 } 764 } else { 765 UNCODE.menuMobileHeight = outerHeight(mastheadMobile); 766 mastheadMobilePaddingTop = parseFloat(getComputedStyle(mastheadMobile).paddingTop); 767 } 768 } 769 770 if (wwidth > mediaQuery) { 771 for (var i = 0; i < mainmenu.length; i++) { 772 if (classie.hasClass(document.body, 'hmenu-center') && i === 1) continue; 773 if (!classie.hasClass(masthead, 'masthead-vertical')) { 774 menuHeight = menuHeight + outerHeight(mainmenu[i]); 775 } else menuHeight = 0; 776 777 if (isIE && first) { 778 getDivChildren(mainmenu[i], '.menu-horizontal-inner', function(innerMenu, i) { 779 innerMenu.style.height = menuHeight + 'px'; 780 }); 781 } 782 783 if (classie.hasClass(mainmenu[i].parentNode, 'menu-transparent')) { 784 transmenuHeight += menuHeight; 785 } 786 } 787 788 for (var j = 0; j < secmenu.length; j++) { 789 secmenuHeight += outerHeight(secmenu[j]); 790 } 791 menuHeight += secmenuHeight; 792 } else { 793 secmenu = document.querySelectorAll('.menu-secondary:not(.menu-primary)'); 794 menuHeight = UNCODE.menuMobileHeight;
795 if (isMobileTransparent) { 796 for (var i = 0; i < mainmenu.length; i++) { 797 if (classie.hasClass(mainmenu[i].parentNode, 'menu-transparent')) { 798 transmenuHeight += menuHeight; 799 } 800 } 801 } 802 var search_box = document.querySelectorAll('.search-icon .drop-menu'); 803 for (var i = 0; i < search_box.length; i++) { 804 search_box[i].removeAttribute('style'); 805 } 806 807 for (var j = 0; j < secmenu.length; j++) { 808 secmenuHeight += outerHeight(secmenu[j]); 809 } 810 menuHeight += secmenuHeight; 811 } 812 813 814 if (classie.hasClass(document.documentElement, 'admin-mode')) { 815 adminBar = document.getElementById("wpadminbar"); 816 if (wwidth > 600) { 817 if (adminBar != null) adminBarHeight = outerHeight(adminBar); 818 else { 819 if (wwidth > 782) adminBarHeight = 32; 820 else adminBarHeight = 46; 821 } 822 } else adminBarHeight = 0; 823 } 824 UNCODE.adminBarHeight = adminBarHeight; 825 UNCODE.menuHeight = menuHeight; 826 827 if ( UNCODE.isFullPage && ! UNCODE.isFrontEndEditor ) { 828 if ( UNCODE.adminBarHeight > 0 ) 829 document.body.style.marginTop = ( ( UNCODE.adminBarHeight + UNCODE.bodyBorder ) * -1 ) + 'px'; 830 831 document.body.style.paddingTop = ( UNCODE.adminBarHeight + UNCODE.bodyBorder ) + 'px'; 832 } else { 833 document.body.style.marginTop = 0; 834 document.body.style.paddingTop = 0; 835 } 836 837 if (masthead != undefined) { 838 //masthead.parentNode.style.height = menuHeight + 'px'; 839 if (classie.hasClass(masthead, 'menu-transparent')) { 840 if (wwidth > mediaQuery) masthead.parentNode.style.height = '0px'; 841 } 842 } 843 844 if (typeof menuhide == 'object' && menuhide != null && mainmenu[0] != undefined) { 845 var sticky_element = (typeof mainmenu.item === 'undefined' ? ((wwidth > mediaQuery) ? mainmenu[0] : mainmenu[1]) : mainmenu[0]); 846 if (sticky_element.style.top != '') { 847 sticky_element.style.top = UNCODE.bodyBorder + 'px' 848 } 849 } 850 851 }, 852 centerSplitMenu = function() { 853 if (wwidth > mediaQuery && mainNavMenu) { 854 if (mainNavMenu.style.left == '') { 855 mainNavMenu.style.left = '0px'; 856 var logoPos = logo.parentNode.getBoundingClientRect(); 857 mainNavMenu.style.left = (wwidth / 2) - (logoPos.left + (logoPos.width / 2) ) + 'px'; 858 mainNavWrapper.style.opacity = '1'; 859 } 860 mainNavWrapper.style.opacity = '1'; 861 } else { 862 mainNavMenu.style.left = ''; 863 } 864 }, 865 initHeader = function() { 866 pageHeader = document.getElementById("page-header"); 867 if (SiteParameters.dynamic_srcset_active === '1') { 868 UNCODE.adaptive_srcset_replace_bg(pageHeader); 869 } 870 UNCODE.adaptive(); 871 872 parallaxHeaders = document.querySelectorAll('.header-parallax > .header-bg-wrapper'); 873 header = document.querySelectorAll('.header-wrapper.header-uncode-block, .header-wrapper.header-revslider, .header-wrapper.header-layerslider, .header-basic .header-wrapper, .header-uncode-block > .row-container:first-child > .row > .row-inner > .col-lg-12 > .uncol, .header-uncode-block .uncode-slider .owl-carousel > .row-container:first-child .column_child .uncoltable'); 874 headerWithOpacity = document.querySelectorAll('.header-scroll-opacity'); 875 if ( typeof pageHeader === 'object' && pageHeader !== null ) { 876 headerVideo = pageHeader.querySelectorAll('.uncode-video-container:not(.t-entry-drop)'); 877 kenburnsHeaders = pageHeader.querySelectorAll('.with-kburns > .header-bg-wrapper'); 878 backwashHeaders = pageHeader.querySelectorAll('.with-zoomout > .header-bg-wrapper'); 879 if ( headerVideo.length ) { 880 classie.addClass(pageHeader, 'has-video'); 881 } 882 } 883 if (pageHeader != undefined) { 884 var backs = pageHeader.querySelectorAll('.header-bg'), 885 backsCarousel = pageHeader.querySelectorAll('.header-uncode-block .background-inner'), 886 uri_pattern = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»ââââ]))/ig; 887 if (backs.length == 0 && backsCarousel.length == 0) { 888 pageHeader.setAttribute('data-imgready', 'true'); 889 } else { 890 if (backsCarousel.length) { 891 for (var j = 0; j < backsCarousel.length; j++) { 892 if (j == 0) { 893 if (!!backsCarousel[j].style.backgroundImage && backsCarousel[j].style.backgroundImage !== void 0) { 894 var url = (backsCarousel[j].style.backgroundImage).match(uri_pattern), 895 image = new Image(); 896 if ( url === null ) { 897 url = (backsCarousel[j].style.backgroundImage).slice(4, -1).replace(/"/g, ""); 898 } 899 image.onload = function() { 900 pageHeader.setAttribute('data-imgready', 'true'); 901 }; 902 image.src = url[0]; 903 } else { 904 pageHeader.setAttribute('data-imgready', 'true'); 905 } 906 } 907 } 908 } else { 909 for (var i = 0; i < backs.length; i++) { 910 if (i == 0) { 911 if (!!backs[i].style.backgroundImage && backs[i].style.backgroundImage !== void 0) { 912 var url = (backs[i].style.backgroundImage).match(uri_pattern), 913 image = new Image(); 914 if ( url === null ) { 915 url = (backs[i].style.backgroundImage).slice(4, -1).replace(/"/g, ""); 916 } 917 image.onload = function() { 918 pageHeader.setAttribute('data-imgready', 'true'); 919 }; 920 image.src = url[0]; 921 } else { 922 pageHeader.setAttribute('data-imgready', 'true'); 923 } 924 } 925 } 926 } 927 } 928 } 929 930 if (masthead != undefined && !classie.hasClass(masthead, 'masthead-vert
930ical')) { 931 if (header.length) { 932 masthead.parentNode.style.height = (menuHeight-1) + 'px'; 933 if ( offcanvas_overlay_close != undefined ) { 934 offcanvas_overlay_close.style.height = (menuHeight-1) + 'px'; 935 offcanvas_overlay_close.style.lineHeight = (menuHeight-5) + 'px'; 936 } 937 if (menuwrapper[0] != undefined) classie.addClass(menuwrapper[0], 'with-header'); 938 for (var j = 0; j < header.length; j++) { 939 var headerel = header[j], 940 closestStyle = getClosest(headerel, 'style-light'), 941 wcClosestStyle = getClosest(headerel, 'wc-parent-style-light'); 942 if (closestStyle != null && classie.hasClass(closestStyle, 'style-light')) { 943 switchColorsMenu(0, 'light'); 944 } else if (wcClosestStyle != null && classie.hasClass(wcClosestStyle, 'wc-parent-style-light')) { 945 switchColorsMenu(0, 'light'); 946 } else if (getClosest(headerel, 'style-dark') != null) { 947 switchColorsMenu(0, 'dark'); 948 } else if (getClosest(headerel, 'wc-parent-style-dark') != null) { 949 switchColorsMenu(0, 'dark'); 950 } else { 951 if (masthead.style.opacity !== 1) masthead.style.opacity = 1; 952 } 953 if (classie.hasClass(masthead, 'menu-transparent')) { 954 if (isMobileTransparent || wwidth > mediaQuery) { 955 masthead.parentNode.style.height = '0px'; 956 if (classie.hasClass(masthead, 'menu-add-padding')) { 957 var headerBlock = getClosest(headerel, 'header-uncode-block'); 958 if (headerBlock != null) { 959 var parentRow = headerBlock.querySelector('.vc_row'); 960 if (parentRow != null) { 961 var innerRows = parentRow.querySelectorAll('.column_parent > .uncol > .uncoltable > .uncell > .uncont, .uncode-slider .column_child > .uncol > .uncoltable > .uncell > .uncont'); 962 for (var k = 0; k < innerRows.length; k++) { 963 if (innerRows[k] != undefined) { 964 if (wwidth > mediaQuery) innerRows[k].style.paddingTop = transmenuHeight + 'px'; 965 else innerRows[k].style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px'; 966 } 967 } 968 } 969 } else { 970 getDivChildren(headerel, '.header-content', function(headerContent, i) { 971 if (wwidth > mediaQuery) headerContent.style.paddingTop = transmenuHeight + 'px'; 972 else headerContent.style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px'; 973 }); 974 } 975 } 976 } 977 } 978 if (classie.hasClass(headerel, 'uncoltable')) { 979 break; 980 } 981 } 982 } else { 983 if (menuwrapper[0] != undefined) classie.addClass(menuwrapper[0], 'no-header'); 984 classie.removeClass(masthead, 'menu-transparent'); 985 transmenuHeight = 0; 986 isMobileTransparent = false; 987 } 988 } else { 989 isMobileTransparent = false; 990 } 991 if (typeof transmenuel === 'undefined' || !transmenuel.length) isMobileTransparent = false; 992 bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop']; 993 UNCODE.bodyTop = bodyTop; 994 headerHeight('.header-wrapper'); 995 if (!classie.hasClass(document.body, 'vmenu')) 996 initBox(); 997 scrollFunction(); 998 showHideScrollup(bodyTop); 999 1000 if ( UNCODE.isMobile ) { 1001 1002 var eventName = 'loadedmetadata'; 1003 eventName = eventName.replace(/^on/, ''); 1004 var elt = document.createElement('video'[eventName]); 1005 var eventIsSupported = ('on'+eventName in elt); 1006 elt = null; 1007 if ( ! eventIsSupported || ( classie.hasClass(document.documentElement, 'firefox') && classie.hasClass(document.documentElement, 'android') ) ) { 1008 classie.addClass(document.body, 'video-not-supported'); 1009 } 1010 } 1011 1012 }, 1013 initRow = function(currentRow) { 1014 if (SiteParameters.dynamic_srcset_active === '1') { 1015 UNCODE.adaptive_srcset_replace_bg(currentRow); 1016 } 1017 UNCODE.adaptive(); 1018 var el = typeof currentRow.parentNode !== 'undefined' && currentRow.parentNode.parentNode.getAttribute("data-parent") == 'true' ? currentRow.parentNode : ( currentRow.getAttribute("data-parent") == 'true' ? currentRow.querySelector('.row-parent') : currentRow.parentNode.parentNode ), 1019 rowParent = el.parentNode, 1020 rowInner = currentRow.parentNode, 1021 percentHeight = el.getAttribute("data-height-ratio"), 1022 minHeight = el.getAttribute("data-minheight"), 1023 calculateHeight, 1024 calculatePadding = 0, 1025 isHeader = false, 1026 isFirst = false, 1027 uri_pattern = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»ââââ]))/ig; 1028 1029 /** Add class to the row when contains responsive column size */ 1030 getDivChildren(el.parentNode, '.column_parent, .column_child', function(obj, i, total) { 1031 if ((obj.className).indexOf("col-md-") > - 1) { 1032 classie.addClass(obj.parentNode, 'cols-md-responsive'); 1033 } 1034 obj.className = obj.className.replace(/vc_col-sm-(\d{1,2})/g, ""); 1035 if ((obj.className).indexOf("col-sm-") > - 1 && (obj.className).indexOf("col-sm-clear") == - 1) { 1036 classie.addClass(obj.parentNode, 'cols-sm-responsive'); 1037 } 1038 }); 1039 1040 setRowHeight(el); 1041 1042 var elements = 0; 1043 getDivChildren(el, '.row-internal .background-inner', function(obj, i, total) { 1044 elements++; 1045 if (i == 0) { 1046 if (!!obj.style.backgroundImage && obj.style.backgroundImage !== void 0) { 1047 var url = (obj.style.backgroundImage).match(uri_pattern), 1048 image = new Image(); 1049 if ( url === null ) { 1050 url = (obj.style.backgroundImage).slice(4, -1).replace(/"/g, ""); 1051 } 1052 image.onload = function() { 1053 el.setAttribute('data-imgready', 'true'); 1054 el.dispatchEvent(new CustomEvent('imgLoaded')); 1055 }; 1056 image.src = url[0]; 1057 } else { 1058 el.setAttribute('data-imgready', 'true'); 1059 el.dispatchEvent(new CustomEvent('imgLoaded')); 1060 } 1061 } 1062 }); 1063 if (elements == 0) { 1064 el.setAttribute('data-imgready', 'true'); 1065 } 1066 1067 // var $bgs = rowParent.querySelectorAll('.background-inner'); 1068 1069 // for (var i = 0; i < $bgs.length; i++) { 1070 // var $bg = $bgs[i]; 1071 // if ($bg.style.backgroundImage && $bg.style.backgroundImage !== '') { 1072 // var url = ($bg.style.backgroundImage).match(uri_pattern), 1073 // image = new Image(); 1074 // url = url[0]; 1075 // image.source = url; 1076 // image.el = $bg; 1077 // image.onload = function() { 1078 // var _this = this; 1079 // _this.el.setAttribute('data-imgloaded', 'true'); 1080 // }; 1081 // image.src = url; 1082 // } else { 1083 // $bg.setAttribute('data-imgloaded', 'true'); 1084 // } 1085 // } 1086 1087 /** init parallax is not mobile */ 1088 if ( ! UNCODE.isFullPage ) { 1089 bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop']; 1090 kenburnsRows = el.parentNode.parentNode.querySelectorAll('.with-kburns > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 1091 kenburnsCols = el.querySelectorAll('.with-kburns > .column-background > .background-wrapper'); 1092 backwashRows = el.parentNode.parentNode.querySelectorAll('.with-zoomout > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 1093 backwashCols = el.querySelectorAll('.with-zoomout > .column-background > .background-wrapper'); 1094 if (isMobileParallaxAllowed || !UNCODE.isMobile) {
1095 parallaxRows = el.parentNode.parentNode.querySelectorAll('.with-parallax > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 1096 parallaxCols = el.querySelectorAll('.with-parallax > .column-background > .background-wrapper'); 1097 visibleRows = el.parentNode.parentNode; 1098 parallaxRowCol(bodyTop); 1099 visibleRowCol(bodyTop); 1100 } else { 1101 if (UNCODE.isMobile) { 1102 kenburnsHeader(bodyTop); 1103 kenburnsRowCol(bodyTop); 1104 backwashHeader(bodyTop); 1105 backwashRowCol(bodyTop); 1106 } 1107 } 1108 } 1109 1110 shapeDivider(); 1111 1112 var wrapLinesWw = wwidth; 1113 1114 //Text animation, automatic lines and highlights 1115 var setWrap; 1116 1117 //Font style of grouped products 1118 function product_relative_font_style(el){ 1119 var $labels = el.querySelectorAll('.woocommerce-grouped-product-list-item__label, .woocommerce-grouped-product-list-item__price'); 1120 if ( $labels.length ) { 1121 var $main_price = el.querySelectorAll('.heading-text .woocommerce-Price-amount'); 1122 if ( $main_price.length ) { 1123 var $price_wrap = $main_price[0].closest('.heading-text'), 1124 $price_nest = $price_wrap.querySelector(':first-child'), 1125 font_class = $price_nest.getAttribute('class').split(' '), 1126 cli, labI; 1127 1128 for ( labI = 0; labI < $labels.length; labI++ ) { 1129 for ( cli = 0; cli < font_class.length; cli++ ) { 1130 if ( font_class[cli].indexOf('font') !== -1 && font_class[cli].indexOf('fontsize') === -1 ) { 1131 classie.addClass($labels[labI], font_class[cli]); 1132 } 1133 } 1134 } 1135 1136 } 1137 } 1138 } 1139 product_relative_font_style(el) 1140 1141 function vc_row_full_width_size(){ 1142 if (boxWidth != 0 && classie.hasClass(rowParent, 'vc_row-full-width')) { 1143 var vmenu = document.querySelector('.vmenu .vmenu-container'), 1144 vmenuW = 0; 1145 if (typeof vmenu == 'object' && vmenu != null && wwidth > mediaQuery ) { 1146 vmenuW = vmenu.offsetWidth; 1147 } 1148 rowParent.style.maxWidth = ( boxWidth - vmenuW ) + 'px'; 1149 } 1150 } 1151 vc_row_full_width_size(); 1152 1153 window.addEventListener("resize", function() { 1154 vc_row_full_width_size(); 1155 }); 1156 1157 function word_for_lines(event, $parent_el){ 1158 1159 if ( typeof $parent_el === 'undefined' || $parent_el === null ) { 1160 $parent_el = document.body; 1161 } 1162 1163 var $headings = $parent_el.querySelectorAll('.heading-text'); 1164 1165 for (var head_k = 0; head_k < $headings.length; head_k++) { 1166 var $heading = $headings[head_k], 1167 heading_cont = $heading.innerHTML, 1168 $row = $heading.closest('.row-parent'), 1169 $owl_carousel = $heading.closest('.owl-carousel-wrapper'), 1170 $owl_item = $heading.closest('.owl-item'), 1171 $words = $heading.querySelectorAll('.split-word'), 1172 setWrap; 1173 1174 if ( ! $words.length ) { 1175 if ( $owl_item !== null ) 1176 continue; 1177 } 1178 1179 if ( $owl_carousel === null && typeof event !== 'undefined' && event !== 'resize' && event !== false ) { 1180 continue; 1181 } 1182 1183 if ( $owl_carousel !== null ) { 1184 if ( 1185 ( $owl_item === null ) 1186 || 1187 ( $owl_item !== null && classie.hasClass($owl_item, 'active') && $owl_item.getAttribute('data-index') !== '1' ) 1188 || 1189 ( $owl_item !== null && classie.hasClass($owl_item, 'active') && $owl_item.getAttribute('data-index') === '1' && $owl_item.getAttribute('data-already-reached') === 'true' ) 1190 ) { 1191 continue; 1192 } 1193 } 1194 1195 $heading.innerHTML = heading_cont; 1196 $words = $heading.querySelectorAll('.split-word'); 1197 var lineArray = [], 1198 lineIndex = 0, 1199 lineStart = true, 1200 lineEnd = false, 1201 $text_highlight = $heading.querySelectorAll('.heading-text-highlight'), 1202 $line_wraps = $heading.querySelectorAll('.heading-line-wrap'); 1203 1204 if ( $line_wraps.length && typeof event === 'undefined' ) { 1205 continue; 1206 } 1207 1208 var lettering = function(){ 1209 var $wraps = $parent_el.querySelectorAll('.animate_inner_when_almost_visible.curtain, .animate_inner_when_almost_visible.curtain-words, .animate_inner_when_almost_visible.typewriter, .animate_inner_when_almost_visible.single-curtain, .animate_inner_when_almost_visible.single-slide, .animate_inner_when_almost_visible.single-slide-opposite'); 1210 1211 for (var i = 0; i < $wraps.length; i++) { 1212 var $wrap = $wraps[i], 1213 $lines = $wrap.querySelectorAll('.heading-line-wrap'), 1214 $words = $wrap.querySelectorAll('.split-word:not(.uncode-rotating-span)'), 1215 containerDelay = $wrap.getAttribute('data-delay'), 1216 containerSpeed = $wrap.getAttribute('data-speed'), 1217 containerSpeed_val = typeof containerSpeed !== 'undefined' && containerSpeed !== null ? parseFloat(containerSpeed) : 400, 1218 containerInterval = typeof $wrap.getAttribute('data-interval') !== 'undefined' && $wrap.getAttribute('data-interval') !== null ? $wrap.getAttribute('data-interval') : 0, 1219 delayAttr = (containerDelay != undefined) ? containerDelay : 0; 1220 1221 if ( classie.hasClass($wrap, 'already-animated') ) { 1222 continue; 1223 } 1224 1225 if ( classie.hasClass($wrap, 'curtain') ) { 1226 1227 for (var il = 0; il < $lines.length; il++) { 1228 var $line = $lines[il], 1229 $spans = $line.querySelectorAll('.split-word-inner'); 1230 1231 for (var is = 0; is < $spans.length; is++) { 1232 1233 var $span = $spans[is]; 1234 1235 $span.setAttribute('data-delay', ( parseFloat(delayAttr) + ( ( parseFloat(containerInterval) + 100 ) * il ) ) ); 1236 1237 if (typeof containerSpeed_val !== 'undefined' ) { 1238 $span.setAttribute('data-speed', containerSpeed_val); 1239 } 1240 1241 classie.addClass($span, 'animate_when_parent_almost_visible'); 1242 classie.addClass($span, 'text-bottom-t-top'); 1243 1244 if ( is+1 === $spans.length && il+1 === $lines.length ) { 1245 classie.addClass($span, 'anim-tot-checker'); 1246 } 1247 } 1248 1249 } 1250 1251 } else if ( classie.hasClass($wrap, 'single-curtain') ) { 1252 1253 var $spans = $wrap.querySelectorAll('.split-char'); 1254 1255 for (var is = 0; is < $spans.length; is++) { 1256 var $span = $spans[is]; 1257 1258 $span.setAttribute('data-delay', ( parseFloat(delayAttr) + ( ( parseFloat(containerInterval) + 20 ) * is ) ) ); 1259 1260 if (typeof containerSpeed_val !== 'undefined' ) { 1261 $span.setAttribute('data-speed', containerSpeed_val); 1262 } 1263 1264 classie.addClass($span, 'animate_when_parent_almost_visible'); 1265 classie.addClass($span, 'text-bottom-t-top'); 1266 1267 if ( is+1 == $spans.length ) { 1268 classie.addClass($span, 'anim-tot-checker'); 1269 } 1270 }; 1271 1272 } else if ( classie.hasClass($wrap, 'typewriter') ) { 1273 1274 var $spans = $wrap.querySelectorAll('.split-char'); 1275 1276 for (var is = 0; is < $spans.length; is++) { 1277 var $span = $spans[is]; 1278 1279 $span.setAttribute('data-delay', ( parseFloat(delayAttr) + ( ( parseFloat(containerInterval) + 20 ) * is ) ) ); 1280 1281 if (typeof containerSpeed_val !== 'undefined' ) { 1282 $span.setAttribute('data-speed', containerSpeed_val); 1283 } 1284 1285 classie.addClass($span, 'animate_when_parent_almost_visible'); 1286 classie.addClass($span, 'typewriter'); 1287 1288 if ( is+1 == $spans.length ) { 1289 classie.addClass($span, 'anim-tot-checker'); 1290 } 1291 1292 } 1293 1294 } else if ( classie.hasClass($wrap, 'single-slide') ) { 1295 1296 var $spans = $wrap.querySelectorAll('.split-word-inner'); 1297 1298 for (var is = 0; is < $spans.length; is++) { 1299 var $span = $spans[is]; 1300 1301 $span.setAttribute('data-delay', ( parseFloat(delayAttr) + ( ( parseFloat(containerInterval) + 50 ) * is ) ) ); 1302 1303 if (typeof containerSpeed_val !== 'undefined' ) { 1304 $span.setAttribute('data-speed', containerSpeed_val); 1305 } 1306 1307 classie.addClass($span, 'animate_when_parent_almost_visible'); 1308 if ( classie.hasClass(document.body, 'rtl') ) { 1309 classie.addClass($span, 'text-left-t-right'); 1310 } else { 1311 classie.addClass($span, 'text-right-t-left'); 1312 } 1313 1314 if ( is+1 == $spans.length ) { 1315 classie.addClass($span, 'anim-tot-checker'); 1316 } 1317 } 1318 1319 } else if ( classie.hasClass($wrap, 'single-slide-opposite') ) { 1320 1321 var $spans = $wrap.querySelectorAll('.split-word-inner'); 1322 1323 for (var is = 0; is < $spans.length; is++) { 1324 var $span = $spans[is]; 1325 1326 $span.setAttribute('data-delay', ( parseFloat(delayAttr) + ( ( parseFloat(containerInterval) + 50 ) * is ) ) ); 1327 1328 if (typeof containerSpeed_val !== 'undefined' ) { 1329 $span.setAttribute('data-speed', containerSpeed_val); 1330 } 1331 1332 classie.addClass($span, 'animate_when_parent_almost_visible'); 1333 if ( classie.hasClass(document.body, 'rtl') ) { 1334 classie.addClass($span, 'text-right-t-left'); 1335 } else { 1336 classie.addClass($span, 'text-left-t-right'); 1337 } 1338 1339 if ( is+1 == $spans.length ) { 1340 classie.addClass($span, 'anim-tot-checker'); 1341 } 1342 } 1343 1344 } else if ( classie.hasClass($wrap, 'curtain-words') ) { 1345 1346 var $spans = $wrap.querySelectorAll('.split-word-inner'); 1347 1348 for (var is = 0; is < $spans.length; is++) { 1349 var $span = $spans[is]; 1350 1351 $span.setAttribute('data-delay', ( parseFloat(delayAttr) + ( ( parseFloat(containerInterval) + 50 ) * is ) ) ); 1352 1353 if (typeof containerSpeed_val !== 'undefined' ) { 1354 $span.setAttribute('data-speed', containerSpeed_val); 1355 } 1356 1357 classie.addClass($span, 'animate_when_parent_almost_visible'); 1358 classie.addClass($span, 'text-bottom-t-top'); 1359 1360 if ( is+1 == $spans.length ) { 1361 classie.addClass($span, 'anim-tot-checker'); 1362 } 1363 } 1364 } 1365 1366 } 1367 } 1368 1369 var removeOldLines = function(){ 1370 for (var wrap_k = 0; wrap_k < $line_wraps.length; wrap_k++) { 1371 var $line_wrap = $line_wraps[wrap_k]; 1372 var $parent_wrap = $line_wrap.parentNode; 1373 if ( $parent_wrap !== null ) { 1374 while ( $line_wrap.firstChild ) { 1375 $parent_wrap.insertBefore($line_wrap.firstChild, $line_wrap); 1376 } 1377 $parent_wrap.removeChild($line_wrap); 1378 } 1379 } 1380 window.dispatchEvent(new CustomEvent('removeOldLines')); 1381 } 1382 1383 var createHighlightSpans = function(){ 1384 for (var high_k = 0; high_k < $text_highlight.length; high_k++) { 1385 var $highlight = $text_highlight[high_k], 1386 atts = $highlight.getAttribute('data-atts'), 1387 objAtts, 1388 styleEl = '', 1389 classEl = '', 1390 animation = false, 1391 hexRe = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i, 1392 $h_words = $highlight.querySelectorAll('.split-word:not(.uncode-rotating-span)'); 1393 1394 if ( typeof atts !== 'undefined' && atts != '' ) { 1395 objAtts = JSON.parse(atts); 1396 if ( typeof objAtts.bg != 'undefined' ) { 1397 if ( hexRe.test(objAtts.bg)) { 1398 styleEl += 'background-color:' + objAtts.bg + ';'; 1399 } else { 1400 classEl += ' ' + objAtts.bg; 1401 } 1402 } 1403 if ( typeof objAtts.color != 'undefined' ) { 1404 if ( hexRe.test(objAtts.color)) { 1405 styleEl += 'color:' + objAtts.color + ';'; 1406 } else {
1407 var classChild = objAtts.color; 1408 } 1409 } 1410 if ( typeof objAtts.height != 'undefined' ) { 1411 styleEl += 'height:' + objAtts.height + ';'; 1412 } 1413 if ( typeof objAtts.offset != 'undefined' ) { 1414 styleEl += 'bottom:' + objAtts.offset + ';'; 1415 } 1416 if ( typeof objAtts.opacity != 'undefined' ) { 1417 styleEl += 'opacity:' + objAtts.opacity + ';'; 1418 } 1419 if ( objAtts.animated == 'yes' ) { 1420 animation = true; 1421 } 1422 1423 } 1424 1425 for (var h_words_k = 0; h_words_k < $h_words.length; h_words_k++) { 1426 var $word = $h_words[h_words_k], 1427 $new_el = document.createElement('span'); 1428 1429 if ( typeof classChild !== 'undefined' ) { 1430 classie.addClass($word, objAtts.color); 1431 } 1432 1433 if ( h_words_k === 0 ) { 1434 classie.addClass($word, 'first-highlight'); 1435 } else if ( (h_words_k+1) === $h_words.length ) { 1436 classie.addClass($word, 'last-highlight'); 1437 } 1438 1439 $new_el.className = 'heading-text-highlight-inner' + classEl; 1440 if ( styleEl !== '' ) { 1441 $new_el.setAttribute('style', styleEl); 1442 } 1443 1444 if ( animation ) { 1445 $new_el.setAttribute('data-animated', 'yes'); 1446 } 1447 1448 $word.appendChild($new_el); 1449 1450 }; 1451 1452 var $parent_highlight = $highlight.parentNode; 1453 if ( $parent_highlight != null ) { 1454 while ( $highlight.firstChild ) { 1455 $parent_highlight.insertBefore($highlight.firstChild, $highlight); 1456 } 1457 $parent_highlight.removeChild($highlight); 1458 } 1459 } 1460 1461 } 1462 1463 var createNewLines = function(){ 1464 for (var word_k = 0; word_k < $words.length; word_k++) { 1465 var $word = $words[word_k], 1466 top = $word.offsetTop, 1467 elH = $word.offsetHeight, 1468 $next = typeof $words[(word_k+1)] !== 'undefined' ? $words[(word_k+1)] : null, 1469 nextTop = $next !== null ? $next.offsetTop : null; 1470 1471 if (lineStart) { 1472 lineArray[lineIndex] = [word_k]; 1473 1474 if (nextTop !== null && elH > 0 && nextTop > (top + elH/2)) {//tollerance 1475 lineArray[lineIndex].push(word_k); 1476 lineIndex++; 1477 lineStart = true; 1478 } else { 1479 lineStart = false;
1480 } 1481 } else { 1482 if (nextTop !== null && elH > 0 && nextTop > (top + elH/2)) {//tollerance 1483 lineArray[lineIndex].push(word_k); 1484 lineIndex++; 1485 lineStart = true; 1486 } else if ( nextTop === null ) { 1487 lineArray[lineIndex].push(word_k); 1488 } 1489 } 1490 } 1491 1492 for (var i = 0; i < lineArray.length; i++) { 1493 var start = lineArray[i][0], 1494 end = lineArray[i][1] + 1; 1495 1496 var spanWrap = document.createElement('span'); 1497 spanWrap.className = 'heading-line-wrap'; 1498 1499 if (!end) { 1500 window.wrap(spanWrap, $words[start]); 1501 } else { 1502 for (var _i = start; _i < end; _i++) { 1503 if ( typeof $words[_i] !== 'undefined' && $words[_i] !== null ) { 1504 classie.addClass($words[_i], 'heading-temp'); 1505 $words[_i].style.zIndex = end - _i; 1506 } 1507 } 1508 var $towrap = $heading.querySelectorAll('.heading-temp'); 1509 if ( typeof $towrap[0] !== 'undefined' && $towrap[0] !== null ) { 1510 window.wrapAll(spanWrap, $towrap); 1511 for (var _i = 0; _i < $towrap.length; _i++) { 1512 classie.removeClass($towrap[_i], 'heading-temp'); 1513 } 1514 } 1515 } 1516 1517 if ( (i+1) == lineArray.length ) { 1518 classie.addClass($row, 'loaded-split-word'); 1519 } 1520 1521 classie.addClass($heading, 'heading-lined'); 1522 } 1523 lettering(); 1524 1525 } 1526 1527 removeOldLines(); 1528 createHighlightSpans(); 1529 createNewLines(); 1530 1531 $parent_el.addEventListener("owl-carousel-changed", function() { 1532 removeOldLines(); 1533 createHighlightSpans(); 1534 createNewLines(); 1535 }); 1536 1537 if ( event !== 'resize' ) { 1538 document.body.dispatchEvent(new CustomEvent('uncode_waypoints')); 1539 } 1540 1541 } 1542 } 1543 1544 var $h_markup = document.body.querySelectorAll('.font-obs'), 1545 fontArr = new Array(); 1546 1547 for (var i = 0; i < $h_markup.length; i++) { 1548 var font_to_check = $h_markup[i].getAttribute("data-font"); 1549 1550 if ( font_to_check === null ) { 1551 word_for_lines(false, el); 1552 } else { 1553 var font_weight = $h_markup[i].getAttribute("data-weight"); 1554 var font_style = $h_markup[i].getAttribute("data-style"); 1555 1556 if ( font_weight === null ) { 1557 font_weight = 'normal'; 1558 } 1559 1560 if ( font_style === null ) { 1561 font_style = 'normal'; 1562 } 1563 1564 font_to_check = font_to_check.split(','); 1565 1566 var font_val = font_to_check[0].replace(/['"]+/g, ''), 1567 font_key = '\''+font_val+'_'+font_weight+'_'+font_style+'\''; 1568 1569 if ( fontArr.indexOf( font_val+'_'+font_weight ) === -1 ) { 1570 fontArr[font_key] = {'family':font_val,'weight':font_weight,'style':font_style }; 1571 } 1572 } 1573 } 1574 1575 var counter = 0; 1576 1577 for (var key in fontArr) { 1578 if (fontArr.hasOwnProperty(key)) { 1579 var font = new FontFaceObserver(fontArr[key].family, { weight: fontArr[key].weight, style: fontArr[key].style } ); 1580 1581 font.load(null, 10000).then(function (font) { 1582 counter++; 1583 if ( counter == Object.keys(fontArr).length ) { 1584 already_font = true; 1585 requestTimeout(function(){ 1586 word_for_lines(false, el); 1587 }, 10); 1588 } 1589 }, function (error) { 1590 word_for_lines(false, el); 1591 }); 1592 } 1593 } 1594 1595 el.addEventListener("owl-carousel-initialized", function() { 1596 word_for_lines("owl-carousel-initialized", el); 1597 }); 1598 1599 el.addEventListener("vc-shortcodeView-updated", function() { 1600 word_for_lines(false, el); 1601 }); 1602 1603 window.addEventListener("resize", function() { 1604 if ( wwidth != wrapLinesWw ) { 1605 clearRequestTimeout(setWrap); 1606 setWrap = requestTimeout( function(){ 1607 wrapLinesWw = wwidth; 1608 word_for_lines('resize'); 1609 }, 100 ); 1610 } 1611 }); 1612 1613 scrollFunction(); 1614 1615 var videos = document.querySelectorAll('.wp-video-shortcode'); 1616 for (var i = 0; i < videos.length; i++) { 1617 var video = videos[i]; 1618 if ( typeof video.getAttribute('autoplay') !== 'undefined' && video.getAttribute('autoplay') !== null && ( typeof video.getAttribute('muted') === 'undefined' || video.getAttribute('muted') === null ) ) { 1619 video.oncanplay = function(e) { 1620 video.muted = true; 1621 video.play(); 1622 }; 1623 break; 1624 } 1625 } 1626 1627 // Single Product reviews counter on Page Builder module 1628 var singleProductReviewsCounter = function(){ 1629 var $reviews = document.getElementById("reviews"), 1630 $comments = $reviews != undefined ? $reviews.querySelector(".commentlist") : undefined; 1631 if ( $reviews != undefined && $comments != undefined ) { 1632 var dataReviews = $reviews.getAttribute('data-reviewed'), 1633 comments = $comments.getAttribute('data-comment-amout'), 1634 count_review_class = comments > 0 ? '' : ' hidden'; 1635 if ( typeof dataReviews == 'undefined' || dataReviews == null || dataReviews == '' ) { 1636 $reviews.setAttribute('data-reviewed', 'reviewed'); 1637 var $tabPane = getClosest($reviews, 'tab-pane'), 1638 $panel = getClosest($reviews, 'wpb_accordion_section'); 1639 if ( $tabPane != undefined) { 1640 var revID = $tabPane.getAttribute('id'), 1641 $spanTxt = document.querySelector('[data-tab-id=' + revID + '] > a > span'); 1642 1643 if ( typeof revID !== 'undefined' && revID !== '' && $spanTxt != null ) { 1644 var $spanCount = $spanTxt.querySelector('span.review-count'); 1645 if ( $spanCount != null ) { 1646 $spanCount.innerHTML = comments; 1647 } else { 1648 var textReviews = $spanTxt.innerHTML; 1649 $spanTxt.innerHTML = textReviews + ' <span class="review-count' + count_review_class + '">' + comments + '</span>'; 1650 } 1651 } 1652 } 1653 if ( $panel != undefined ) { 1654 var $spanTxt = $panel.querySelector('.panel-title > a > span'); 1655 1656 if ( $spanTxt != null ) { 1657 var $spanTxt_0 = $spanTxt; 1658 if ( $spanTxt[0] != undefined ) { 1659 $spanTxt_0 = $spanTxt[0]; 1660 } 1661 var $spanCount = $spanTxt.querySelector('span.review-count'); 1662 if ( $spanCount != null ) { 1663 $spanCount.innerHTML = comments; 1664 } else { 1665 var textReviews = $spanTxt.innerHTML; 1666 $spanTxt.innerHTML = textReviews + ' <span class="review-count' + count_review_class + '">' + comments + '</span>'; 1667 } 1668 } 1669 } 1670 } 1671 } 1672 }; 1673 singleProductReviewsCounter(); 1674 window.addEventListener( "vc_panel_title_edited", singleProductReviewsCounter ); 1675 1676 //Check for empty additional info tabs 1677 var checkEmptyAdditionalInfo = function(){ 1678 var $emptyAdditional = document.getElementById("no_additional_info"), 1679 $emptyPane, 1680 empty_pane_ID, 1681 $tabsParent, 1682 $emptyTab; 1683 if ( $emptyAdditional != undefined ) { 1684 $emptyPane = getClosest($emptyAdditional, 'tab-pane'); 1685 $tabsParent = getClosest($emptyAdditional, 'uncode-tabs'); 1686 if ( $emptyPane == undefined ) 1687 return false;
1688 empty_pane_ID = $emptyPane.getAttribute('id'); 1689 1690 $emptyTab = $tabsParent.querySelector('li[data-tab-id="' + empty_pane_ID + '"]'); 1691 $emptyTab.parentNode.removeChild($emptyTab); 1692 $emptyPane.parentNode.removeChild($emptyPane); 1693 } 1694 }; 1695 checkEmptyAdditionalInfo(); 1696 1697 var waitForSrcSetMedia = function(){ 1698 var $thumbs = el.querySelectorAll('.srcset-lazy-animations'); 1699 1700 if ( $thumbs.length ) { 1701 $thumbs.forEach(function($thumb) { 1702 var $media = $thumb.querySelectorAll('.srcset-auto'); 1703 1704 if ( $media.length ) { 1705 var $media_inside = $media[0].querySelectorAll('.srcset-sizes-done'); 1706 if ( classie.hasClass($media[0], 'srcset-sizes-done') || $media_inside.length ) { 1707 classie.removeClass($thumb, 'srcset-lazy-animations'); 1708 } 1709 } else { 1710 classie.removeClass($thumb, 'srcset-lazy-animations'); 1711 } 1712 }); 1713 } 1714 1715 var $posters = el.querySelectorAll('.no-control-lazy-poster'); 1716 1717 if ( $posters.length ) { 1718 1719 $posters.forEach(function($thumb) { 1720 var $media = $thumb.querySelectorAll('.srcset-auto'); 1721 1722 var loadForPosters = function( $thumb, $media ){ 1723 var url = ($media[0].getAttribute('src')), 1724 image = new Image(); 1725 if ( url !== null ) { 1726 image.onload = function() { 1727 setTimeout(function(){ 1728 classie.removeClass($thumb, 'no-control-lazy-poster'); 1729 }, 200); 1730 }; 1731 image.src = url; 1732 } else { 1733 classie.removeClass($thumb, 'no-control-lazy-poster'); 1734 } 1735 }; 1736 1737 if ( $media.length ) { 1738 var $media_inside = $media[0].querySelectorAll('.srcset-sizes-done'); 1739 var checkSrcSetDone = function(){ 1740 if ( classie.hasClass($media[0], 'srcset-sizes-done') || $media_inside.length ) { 1741 loadForPosters($thumb, $media); 1742 } else { 1743 setTimeout(checkSrcSetDone, 100); 1744 } 1745 } 1746 checkSrcSetDone(); 1747 } else { 1748 $media = $thumb.querySelectorAll('img[src]'); 1749 if ( $media.length ) { 1750 loadForPosters($thumb, $media); 1751 } else { 1752 classie.removeClass($thumb, 'no-control-lazy-poster'); 1753 } 1754 } 1755 }); 1756 } 1757 1758 }; 1759 waitForSrcSetMedia(); 1760 1761 }, 1762 1763 setRowHeight = function(container, forced, resized) { 1764 var currentTallest = 0, 1765 percentHeight = 0, 1766 minHeight = 0, 1767 el, 1768 child, 1769 hasSubCols = false; 1770 if (container.length == undefined) { 1771 container = [container]; 1772 } 1773 // Loop for each container element to match their heights 1774 for (var i = 0; i < container.length; i++) { 1775 var el = container[i], 1776 $row = el, 1777 totalHeight = 0, 1778 colsArray = new Array(), 1779 calculatePadding = 0, 1780 $rowParent = $row.parentNode, 1781 isHeader = false, 1782 isFirst = false; 1783 $row.oversized = false; 1784 percentHeight = el.getAttribute("data-height-ratio"); 1785 minHeight = el.getAttribute("data-minheight"); 1786 // child = (el.firstElementChild || el.firstChild); 1787 child = (el.lastElementChild || el.lastChild); 1788 var childHeight = outerHeight(child); 1789 /** window height without header **/ 1790 if (!!percentHeight || !!minHeight || forced || (isIE && classie.hasClass(el, 'unequal')) ) { 1791 child.style.height = ''; 1792 if (!!percentHeight) { 1793 if (percentHeight == 'full') { 1794 currentTallest = parseInt(wheight); 1795 } else { 1796 currentTallest = parseInt((wheight * percentHeight) / 100); 1797 } 1798 } else { 1799 currentTallest = el.clientHeight; 1800 } 1801 1802 if (!!minHeight) { 1803 if (currentTallest < minHeight || currentTallest == undefined) currentTallest = parseInt(minHeight); 1804 } 1805 1806 if (getClosest(el, 'header-uncode-block') != null) { 1807 el.setAttribute('data-row-header', 'true'); 1808 isHeader = true; 1809 } else { 1810 if (pageHeader == null) { 1811 var prevRow = $rowParent.previousSibling; 1812 if (prevRow != null && prevRow.innerText == 'UNCODE.initHeader();') { 1813 isFirst = true; 1814 } 1815 } 1816 } 1817 1818 menuMobileTransparent = document.querySelector('.menu-absolute.menu-transparent'); 1819 if (classie.hasClass(el, 'row-slider')) { 1820 percentHeight = el.getAttribute("data-height-ratio"); 1821 minHeight = el.getAttribute("data-minheight"); 1822 if (percentHeight == 'full') { 1823 currentTallest = parseInt(wheight); 1824 } else { 1825 currentTallest = parseInt((wheight * percentHeight) / 100); 1826 } 1827 1828 var computedStyleRow = getComputedStyle(el), 1829 computedStyleRowParent = getComputedStyle($rowParent); 1830 calculatePadding -= (parseFloat(computedStyleRow.paddingTop) + parseFloat(computedStyleRowParent.paddingTop)); 1831 calculatePadding -= (parseFloat(computedStyleRow.paddingBottom) + parseFloat(computedStyleRowParent.paddingBottom)); 1832 1833 if (isHeader || isFirst) {
1834 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) { 1835 currentTallest -= menuHeight - transmenuHeight; 1836 } else { 1837 currentTallest -= menuHeight; 1838 } 1839 currentTallest += calculatePadding; 1840 } else { 1841 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) { 1842 currentTallest += calculatePadding; 1843 } else { 1844 currentTallest = 'auto'; 1845 } 1846 } 1847 1848 getDivChildren(el, '.owl-carousel', function(owl, i) { 1849 owl.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 1850 if (isIE) { 1851 getDivChildren(owl, '.owl-stage', function(owlIn, i) { 1852 owlIn.style.height = (currentTallest == 'auto' ? '100%' : currentTallest + 'px'); 1853 }); 1854 } 1855 }); 1856 if ( UNCODE.isFullPageSnap || classie.hasClass(masthead, 'menu-transparent') ) 1857 continue; 1858 else { 1859 if ( classie.hasClass(document.body, 'uncode-fp-menu-hide') ) { 1860 $rowParent.parentNode.style.paddingTop = menuHeight + 'px'; 1861 } 1862 } 1863 } else { 1864 if (isHeader || isFirst || UNCODE.isFullPage ) { 1865 if ( !( UNCODE.isFullPage && !classie.hasClass(masthead, 'menu-transparent') && classie.hasClass(document.body, 'uncode-fp-menu-hide') && !isHeader && !isFirst ) ) { 1866 if (isMobileTransparent || wwidth > mediaQuery) currentTallest -= menuHeight - transmenuHeight; 1867 else currentTallest -= menuHeight - secmenuHeight; 1868 } 1869 if ( UNCODE.isFullPage && classie.hasClass(document.body, 'uncode-scroll-safe-padding') && classie.hasClass(masthead, 'menu-transparent') && !classie.hasClass(document.body, 'uncode-fp-menu-hide') ) { 1870 var safeMenuHeight = parseFloat(document.body.getAttribute("data-additional-padding")) + parseFloat(menuHeight); 1871 if ( (" " + child.parentNode.className + " ").replace(/[\n\t]/g, " ").indexOf("-top-padding ") < 0 || classie.hasClass(child.parentNode, 'single-top-padding') ) { 1872 classie.addClass(child.parentNode, 'fp-safe-padding-top'); 1873 child.parentNode.style.paddingTop = safeMenuHeight + 'px'; 1874 } 1875 if ( (" " + child.parentNode.className + " ").replace(/[\n\t]/g, " ").indexOf("-bottom-padding ") < 0 || classie.hasClass(child.parentNode, 'single-bottom-padding') ) { 1876 classie.addClass(child.parentNode, 'fp-safe-padding-bottom'); 1877 child.parentNode.style.paddingBottom = safeMenuHeight + 'px'; 1878 } 1879 } 1880 if ( !classie.hasClass(masthead, 'menu-transparent') && classie.hasClass(document.body, 'uncode-fp-menu-hide') && ( isFirst || isHeader ) ) 1881 $rowParent.parentNode.style.paddingTop = menuHeight + 'px'; 1882 1883 var computedStyleRow = getComputedStyle(el), 1884 computedStyleRowParent = getComputedStyle($rowParent); 1885 calculatePadding -= (parseFloat(computedStyleRow.paddingTop) + parseFloat(computedStyleRowParent.paddingTop)); 1886 calculatePadding -= (parseFloat(computedStyleRow.paddingBottom) + parseFloat(computedStyleRowParent.paddingBottom)); 1887 1888 currentTallest += calculatePadding; 1889 1890 } else { 1891 1892 var computedStyleRow = getComputedStyle(el), 1893 computedStyleRowParent = getComputedStyle($rowParent); 1894 calculatePadding -= (parseFloat(computedStyleRow.paddingTop) + parseFloat(computedStyleRowParent.paddingTop)); 1895 calculatePadding -= (parseFloat(computedStyleRow.paddingBottom) + parseFloat(computedStyleRowParent.paddingBottom)); 1896 1897 if (wwidth > mediaQuery) currentTallest += calculatePadding; 1898 else currentTallest = 'auto'; 1899 1900 } 1901 } 1902 if ( UNCODE.isFullPage ) { 1903 currentTallest -= UNCODE.adminBarHeight; 1904 } 1905 if (!!minHeight) { 1906 if (currentTallest < minHeight || currentTallest == 'auto') currentTallest = parseInt(minHeight); 1907 } 1908 1909 if ( UNCODE.isFrontEndEditor && child !== null ) { 1910 var innerWrapper = child.querySelectorAll('.owl-carousel-wrapper.vc_uncode_slider'); 1911 if ( innerWrapper.length ) { 1912 getDivChildren(child, '.owl-carousel-wrapper.vc_uncode_slider', function(wrapper, i) { 1913 if ( wrapper !== null ) { 1914 wrapper.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 1915 } else { 1916 child.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 1917 } 1918 }); 1919 } else { 1920 child.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 1921 } 1922 } else { 1923 //here 1924 child.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 1925 } 1926 1927 if ( wwidth < mediaQuery && classie.hasClass(child, 'auto-height-device') ) { 1928 child.style.height = 'auto'; 1929 } 1930 1931 } else { 1932 currentTallest = 0; 1933 if ( UNCODE.isFrontEndEditor && child !== null ) { 1934 1935 child.style.height = ''; 1936 1937 getDivChildren(el, '.owl-carousel', function(owl, i) { 1938 owl.style.height = ''; 1939 if (isIE) { 1940 getDivChildren(owl, '.owl-stage', function(owlIn, i) { 1941 owlIn.style.height = ''; 1942 }); 1943 } 1944 }); 1945 } 1946 } 1947 1948 if (wwidth > mediaQuery) { 1949 1950 getDivChildren(el, '.column_parent', function(col, i, total) { 1951 var $col = col, 1952 $colHeight = 0, 1953 $colDiff = 0, 1954 $colPercDiff = 100; 1955 $col.oversized = false;
1956 $col.forceHeight = currentTallest; 1957 currentTallest = child.clientHeight; 1958 if ((isHeader || isFirst) && currentTallest != 'auto') currentTallest -= transmenuHeight; 1959 var getFirstCol = null, 1960 getMargin = 0, 1961 getSubMargin = 0; 1962 getDivChildren(col, '.row-child', function(obj, i, total) { 1963 var $colChild = obj, 1964 $colParent = $colChild.parentNode, 1965 computedStyleCol = getComputedStyle($colParent); 1966 parseFloat(computedStyleCol.marginTop); 1967 getSubMargin += parseFloat(computedStyleCol.marginTop); 1968 }); 1969 currentTallest += getSubMargin; 1970 getDivChildren(col, '.row-child', function(obj, i, total) { 1971 var $colChild = obj, 1972 $colInner, 1973 $colParent = $colChild.parentNode, 1974 $uncont = $colParent.parentNode; 1975 for (var it = 0; it < $colChild.childNodes.length; it++) { 1976 if ( ! classie.hasClass($colChild.childNodes[it], 'uncode-divider-wrap') ) { 1977 $colInner = $colChild.childNodes[it]; 1978 break; 1979 } 1980 } 1981 if (i == 0 && total > 1) getFirstCol = $colInner; 1982 $colChild.oversized = false; 1983 percentHeight = $colChild.getAttribute("data-height"); 1984 minHeight = $colChild.getAttribute("data-minheight"); 1985 if (percentHeight != null || minHeight != null) { 1986 if ( ! classie.hasClass($colInner, 'uncode-divider-wrap') ) 1987 $colInner.style.height = ''; 1988 $colParent.style.height = 'auto'; 1989 $uncont.style.height = '100%'; 1990 $colChild.removeAttribute("style"); 1991 var newHeight = (percentHeight != null) ? Math.ceil((currentTallest) * (percentHeight / 100)) : parseInt(minHeight); 1992 var computedStyleCol = getComputedStyle($colParent); 1993 getMargin = parseFloat(computedStyleCol.marginTop); 1994 newHeight -= (getMargin); 1995 $colPercDiff -= (percentHeight != null) ? percentHeight : 0; 1996 if (currentTallest > newHeight) { 1997 var getColHeight = outerHeight($colChild); 1998 if (getColHeight > newHeight) { 1999 $colHeight += getColHeight; 2000 $colDiff += getColHeight; 2001 $colChild.oversized = true; 2002 $col.oversized = true; 2003 $row.oversized = true; 2004 } else { 2005 $colHeight += newHeight; 2006 if ( ! classie.hasClass($colInner, 'uncode-divider-wrap') ) { 2007 $colInner.style.height = newHeight + 'px'; 2008 } 2009 } 2010 } 2011 } else { 2012 $colHeight += outerHeight($colChild); 2013 } 2014 }); 2015 if (getFirstCol != null) { 2016 getFirstCol.style.height = (parseFloat(getFirstCol.style.height) - getMargin) + 'px'; 2017 } 2018 colsArray.push({ 2019 colHeight: $colHeight, 2020 colDiv: $col 2021 }); 2022 $col.colDiff = $colDiff; 2023 $col.colPercDiff = $colPercDiff; 2024 2025 }); 2026 2027 if ($row.oversized) { 2028 child.style.height = ''; 2029 colsArray.sort(function(a, b) { 2030 if (a.colHeight < b.colHeight) return 1; 2031 if (a.colHeight > b.colHeight) return -1; 2032 return 0; 2033 }); 2034 var $totalHeight = 0; 2035 colsArray.forEach(function(col) { 2036 var $col = col.colDiv, 2037 $colHeight = col.colHeight; 2038 getDivChildren($col, '.row-child', function(obj, i, total) { 2039 var $colChild = obj, 2040 $colInner = $colChild.children[0], 2041 percentHeight = parseFloat($colChild.getAttribute("data-height")), 2042 $colParent = $colChild.parentNode, 2043 $uncont = $colParent.parentNode, 2044 newHeight; 2045 2046 $colHeight = $col.forceHeight - $col.colDiff; 2047 if (percentHeight != null) { 2048 if ($colHeight > 0) { 2049 if ($col.oversized) { 2050 if (!$colChild.oversized) { 2051 newHeight = Math.ceil(($colHeight) * (percentHeight / $col.colPercDiff)); 2052 if (i == total - 1 && total > 1) { 2053 $uncont.style.height = 'auto'; 2054 $colChild.style.display = 'none'; 2055 newHeight = outerHeight($col.parentNode) - outerHeight($uncont); 2056 $uncont.style.height = '100%'; 2057 $colChild.style.display = 'table'; 2058 }
2059 if (newHeight == 0) newHeight = Math.ceil(($col.forceHeight) * (percentHeight / 100)); 2060 $colInner.style.height = newHeight + 'px'; 2061 } 2062 } else { 2063 if ($totalHeight == 0) newHeight = Math.ceil(($colHeight) * (percentHeight / $col.colPercDiff)); 2064 else { 2065 newHeight = Math.ceil(($totalHeight) * (percentHeight / $col.colPercDiff)); 2066 } 2067 if (i == total - 1 && total > 1) { 2068 $uncont.style.height = 'auto'; 2069 $colChild.style.display = 'none'; 2070 newHeight = outerHeight($col.parentNode) - outerHeight($uncont); 2071 $uncont.style.height = '100%'; 2072 $colChild.style.display = 'table'; 2073 } 2074 $colInner.style.height = newHeight + 'px'; 2075 } 2076 } else { 2077 if ($colChild.oversized) { 2078 if ($totalHeight == 0) newHeight = Math.ceil(($colHeight) * (percentHeight / $col.colPercDiff)); 2079 else { 2080 if ($col.colPercDiff == 0) $col.colPercDiff = 100; 2081 newHeight = Math.ceil(($totalHeight) * (percentHeight / $col.colPercDiff)); 2082 } 2083 if (i == total - 1 && total > 1) { 2084 $uncont.style.height = 'auto'; 2085 $colChild.style.display = 'none'; 2086 newHeight = outerHeight($col.parentNode) - outerHeight($uncont); 2087 $uncont.style.height = '100%'; 2088 $colChild.style.display = 'table'; 2089 } 2090 //and here 2091 $colInner.style.height = newHeight + 'px'; 2092 } 2093 } 2094 } 2095 }); 2096 var uncell = $col.getElementsByClassName('uncell'); 2097 if (uncell[0] != undefined && $totalHeight == 0) $totalHeight = outerHeight(uncell[0]); 2098 }); 2099 } 2100 if (isFF) { 2101 getDivChildren(el, '.uncoltable', function(col, i, total) { 2102 if (col.style.minHeight != '') { 2103 col.style.height = ''; 2104 } 2105 }); 2106 } 2107 if (resized) { 2108 getDivChildren(el, '.row-child > .row-inner', function(obj, k, total) { 2109 if (obj.style.height == '') { 2110 if (wwidth > mediaQueryMobile) { 2111 var getStyle = (window.getComputedStyle((obj.parentNode), null)), 2112 getInnerHeight = (parseInt(obj.parentNode.clientHeight) - parseInt(getStyle.paddingTop) - parseInt(getStyle.paddingBottom)); 2113 obj.style.height = getInnerHeight + 'px'; 2114 //obj.style.marginBottom = '-1px'; 2115 } 2116 } 2117 }); 2118 getDivChildren(el, '.row-parent > .row-inner', function(obj, k, total) { 2119 if (obj.style.height != '') { 2120 var getStyle = (window.getComputedStyle((obj.parentNode), null)), 2121 getInnerHeight = (parseInt(obj.parentNode.clientHeight) - parseInt(getStyle.paddingTop) - parseInt(getStyle.paddingBottom)), 2122 getTempHeight = parseInt(obj.style.height); 2123 if (getInnerHeight > getTempHeight && ( obj.parentNode.parentNode == null || ! classie.hasClass(obj.parentNode.parentNode, 'pin-trigger') ) ) { 2124 obj.style.height = getInnerHeight + 'px'; 2125 //obj.style.marginBottom = '-1px'; 2126 } 2127 } 2128 }); 2129 } 2130 } else { 2131 if (isFF) { 2132 getDivChildren(el, '.uncoltable', function(col, i, total) { 2133 if (col.style.minHeight != '') { 2134 col.style.height = ''; 2135 col.style.height = outerHeight(col.parentNode) + 'px'; 2136 } 2137 }); 2138 } 2139 if (isIE && (wwidth > mediaQueryMobile)) { 2140 if (child.style.height == 'auto') { 2141 child.style.height = outerHeight(child) + 'px'; 2142 } 2143 } 2144 } 2145 if (isFF) { 2146 var sliderColumnFix = document.querySelector('.uncode-slider .row-inner > .column_child:only-child'); 2147 if (sliderColumnFix != null) { 2148 if (wwidth > mediaQuery) { 2149 sliderColumnFix.style.setProperty("height", ""); 2150 } else { 2151 sliderColumnFix.style.setProperty("height", ""); 2152 sliderColumnFix.style.setProperty("height", outerHeight(sliderColumnFix.parentNode) + "px", "important"); 2153 } 2154 } 2155 } 2156 container[i].dispatchEvent(new CustomEvent('setResized')); 2157 }; 2158 if ( resized || UNCODE.isFrontEndEditor ) { 2159 window.scroll(0, scrollRowHeight_fix); 2160 } 2161 }, 2162 headerHeight = function(container) {
2163 menuMobileTransparent = document.querySelector('.menu-absolute.menu-transparent'); 2164 forEachElement(container, function(el, i) { 2165 var getHeight = parseFloat(el.getAttribute("data-height")), 2166 newHeight = ((wheight * getHeight) / 100); 2167 if (getHeight != 'fixed' && newHeight != 0) { 2168 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) newHeight -= menuHeight - transmenuHeight; 2169 else newHeight -= menuHeight - secmenuHeight; 2170 el.style.height = newHeight + 'px'; 2171 } 2172 }); 2173 if ( masthead == undefined ) { 2174 masthead = document.getElementById("masthead"); 2175 } 2176 if (masthead != undefined) { 2177 menuStickyMobile = UNCODE.isMobile ? document.querySelectorAll('.menu-sticky-mobile') : null; 2178 masthead.parentNode.style.height = (menuHeight-1) + 'px'; 2179 var $overlay = masthead.parentNode.parentNode.querySelector('div.overlay-menu'), 2180 $navbarmain; 2181 2182 if ( typeof $overlay == 'object' && $overlay != null ) { 2183 if ( menuStickyMobile !== null && menuStickyMobile.length ) { 2184 UNCODE.menuStickyMobileOverlay = true; 2185 $overlay.style.top = menuHeight + 'px'; 2186 } else { 2187 UNCODE.menuStickyMobileOverlay = false; 2188 $overlay.style.top = '0'; 2189 if ( isMobileTransparent && menuMobileTransparent !== null && !classie.hasClass(document.body, 'menu-mobile-off-canvas') ) { 2190 $navbarmain = $overlay.querySelector('div.navbar-main'); 2191 if (wwidth > mediaQuery) { 2192 $navbarmain.style.paddingTop = false; 2193 } else { 2194 $navbarmain.style.paddingTop = menuHeight + 'px'; 2195 } 2196 } 2197 } 2198 } 2199 if (header != undefined && header.length) { 2200 if (classie.hasClass(masthead, 'menu-transparent')) { 2201 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) { 2202 masthead.parentNode.style.height = '0px'; 2203 if (classie.hasClass(masthead, 'menu-add-padding')) { 2204 for (var j = 0; j < header.length; j++) { 2205 var headerel = header[j]; 2206 var headerBlock = getClosest(headerel, 'header-uncode-block'); 2207 if (headerBlock != null) { 2208 var parentRow = headerBlock.querySelector('.vc_row'), 2209 innerRows; 2210 if ( parentRow !== null ) { 2211 innerRows = parentRow.querySelectorAll('.column_parent > .uncol > .uncoltable > .uncell > .uncont, .uncode-slider .column_child > .uncol > .uncoltable > .uncell > .uncont'); 2212 } 2213 if ( innerRows != undefined && innerRows !== null ) { 2214 for (var k = 0; k < innerRows.length; k++) { 2215 if (innerRows[k] != undefined) { 2216 if (wwidth > mediaQuery) innerRows[k].style.paddingTop = transmenuHeight + 'px'; 2217 else innerRows[k].style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px'; 2218 } 2219 } 2220 } 2221 } else { 2222 getDivChildren(headerel, '.header-content', function(headerContent, i) { 2223 if (wwidth > mediaQuery) headerContent.style.paddingTop = transmenuHeight + 'px'; 2224 else headerContent.style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px'; 2225 }); 2226 } 2227 } 2228 } 2229 } 2230 } 2231 } 2232 } 2233 }, 2234 initVideoComponent = function(container, classTarget) { 2235 if ( UNCODE.isFrontEndEditor ) 2236 return; 2237 getDivChildren(container, classTarget, function(el, i) { 2238 if ( classie.hasClass(el, 'fluid-object') ) { 2239 return; 2240 } 2241 var width = outerWidth(el), 2242 pWidth, // player width, to be defined 2243 height = outerHeight(el), 2244 pHeight, // player height, tbd 2245 $tubularPlayer = (el.getElementsByTagName('iframe').length == 1) ? el.getElementsByTagName('iframe') : el.getElementsByTagName('video'), 2246 ratio = (el.getAttribute("data-ratio") != null) ? Number(el.getAttribute("data-ratio")) : typeof $tubularPlayer[0] !== 'undefined' ? $tubularPlayer[0].getAttribute("data-ratio") : '1.8', 2247 heightOffset = 80, 2248 widthOffset = heightOffset * ratio; 2249 // when screen aspect ratio differs from video, video must center and underlay one dimension 2250 if ($tubularPlayer[0] != undefined) {
2251 if (width / ratio < height) { // if new video height < window height (gap underneath) 2252 pWidth = Math.ceil((height + heightOffset) * ratio); // get new player width 2253 $tubularPlayer[0].style.width = pWidth + widthOffset + 'px'; 2254 $tubularPlayer[0].style.height = height + heightOffset + 'px'; 2255 $tubularPlayer[0].style.left = ((width - pWidth) / 2) - (widthOffset / 2) + 'px'; 2256 $tubularPlayer[0].style.top = '-' + (heightOffset / 2) + 'px'; 2257 $tubularPlayer[0].style.position = 'absolute'; 2258 } else { // new video width < window width (gap to right) 2259 pHeight = Math.ceil(width / ratio); // get new player height 2260 $tubularPlayer[0].style.width = width + widthOffset + 'px'; 2261 $tubularPlayer[0].style.height = pHeight + heightOffset + 'px'; 2262 $tubularPlayer[0].style.left = '-' + (widthOffset / 2) + 'px'; 2263 $tubularPlayer[0].style.top = ((height - pHeight) / 2) - (heightOffset / 2) + 'px'; 2264 $tubularPlayer[0].style.position = 'absolute'; 2265 } 2266 } 2267 }); 2268 }, 2269 init_overlay = function() { 2270 if ( UNCODE.isFrontEndEditor ) 2271 return; 2272 var triggerButton, 2273 globalBtnn, 2274 sequential = false, 2275 ddCloseBtn = false, 2276 closeButtons = new Array(); 2277 function toggleOverlay(btn) { 2278 if ( classie.hasClass(triggerButton, 'menu-button-offcanvas') || classie.hasClass(triggerButton, 'opening') || classie.hasClass(triggerButton, 'closing') ) { 2279 return true; 2280 } 2281 Array.prototype.forEach.call(document.querySelectorAll('div.overlay'), function(overlay) { 2282 if (btn.getAttribute('data-area') == overlay.getAttribute('data-area')) { 2283 var container = document.querySelector('div.' + btn.getAttribute('data-container')), 2284 menuCont = overlay.querySelector('.menu-container'), 2285 masthead = document.getElementById("masthead"), 2286 inputField = overlay.querySelector('.search-field'); 2287 if (classie.has(overlay, 'open')) { 2288 globalBtnn = false; 2289 window.dispatchEvent(menuClose); 2290 overlayOpened = false; 2291 classie.remove(overlay, 'open'); 2292 classie.remove(document.body, 'navbar-hover'); 2293 classie.remove(document.body, 'open-megamenu'); 2294 classie.add(overlay, 'close'); 2295 classie.remove(overlay, 'open-items'); 2296 classie.remove(document.body, 'menu-overlay-open'); 2297 classie.add(document.body, 'menu-dd-search-closing'); 2298 requestTimeout(function(){ 2299 if ( classie.has( masthead, 'style-dark-stop' ) ) { 2300 classie.remove( masthead, 'style-dark-stop' ); 2301 classie.remove( masthead, 'style-light-override' ); 2302 classie.add( masthead, 'style-dark-override' ); 2303 } else if ( classie.has( masthead, 'style-light-stop' ) ) { 2304 classie.remove( masthead, 'style-light-stop' ); 2305 classie.remove( masthead, 'style-dark-override' ); 2306 classie.add( masthead, 'style-light-override' ); 2307 } 2308 // if ( classie.has( masthead, 'is_stuck-stop' ) ) { 2309 // classie.remove( masthead, 'is_stuck-stop' ); 2310 // classie.add( masthead, 'is_stuck' ); 2311 // } 2312 classie.remove(document.documentElement, 'overlay-open'); 2313 classie.remove(document.body, 'menu-dd-search-open'); 2314 classie.remove(document.body, 'menu-dd-search-closing'); 2315 ddCloseBtn = false; 2316 }, 500); 2317 var onEndTransitionFn = function(ev) { 2318 if (transitionEvent) { 2319 if (ev.propertyName !== 'visibility') return; 2320 this.removeEventListener(transitionEvent, onEndTransitionFn); 2321 } 2322 classie.remove(overlay, 'close'); 2323 if ( sequential !== false ) { 2324 toggleOverlay(sequential); 2325 sequential = false; 2326 } 2327 }; 2328 if (transitionEvent) { 2329 overlay.addEventListener(transitionEvent, onEndTransitionFn); 2330 } else { 2331 onEndTransitionFn(); 2332 } 2333 } else if (!classie.has(overlay, 'close') && !classie.hasClass(btn, 'overlay-close')) { 2334 globalBtnn = btn; 2335 window.dispatchEvent(menuOpen); 2336 overlayOpened = true; 2337 classie.add(overlay, 'open'); 2338 if ( ( classie.hasClass(document.body, 'menu-dd-search') && wwidth > mediaQuery ) || classie.hasClass(document.body, 'menu-dd-search-mobile') ) { 2339 classie.add(document.body, 'navbar-hover'); 2340 ddCloseBtn = btn; 2341 } 2342 if ( ( classie.hasClass(document.body, 'menu-dd-search') && wwidth > mediaQuery ) ) { 2343 classie.add(document.body, 'menu-dd-search-open'); 2344 ddCloseBtn = btn; 2345 } 2346 classie.add(container, 'overlay-open'); 2347 if ( wwidth > mediaQuery && overlay.getAttribute('data-area') != 'search' ) { 2348 classie.add(document.documentElement, 'overlay-open'); 2349 classie.add(document.documentElement, 'menu-overlay-open'); 2350 } 2351 if ( classie.has( menuCont, 'style-light' ) ) { 2352 if ( classie.has( masthead, 'style-dark-override' ) && ! classie.has( masthead, 'style-light-override' ) ) { 2353 classie.remove( masthead, 'style-dark-override' ); 2354 classie.add( masthead, 'style-dark-stop' ); 2355 classie.add( masthead, 'style-light-override' ); 2356 } 2357 } else if ( classie.has( menuCont, 'style-dark' ) ) { 2358 if ( classie.has( masthead, 'style-light-override' ) && ! classie.has( masthead, 'style-dark-override' ) ) { 2359 classie.remove( masthead, 'style-light-override' ); 2360 classie.add( masthead, 'style-light-stop' ); 2361 classie.add( masthead, 'style-dark-override' ); 2362 } 2363 } 2364 // if ( classie.has( masthead, 'is_stuck' ) ) { 2365 // classie.remove( masthead, 'is_stuck' ); 2366 // classie.add( masthead, 'is_stuck-stop' ); 2367 // } 2368 if (jQuery('body.menu-overlay').length == 0 && inputField != null) { 2369 setTimeout(function() { 2370 inputField.focus(); 2371 }, 1000); 2372 } 2373 setTimeout(function() { 2374 if (classie.has(overlay, 'overlay-sequential')) classie.add(overlay, 'open-items'); 2375 }, 800); 2376 } 2377 } 2378 }); 2379 2380 if (classie.hasClass(btn, 'search-icon') || classie.hasClass(btn, 'menu-close-search') || classie.hasClass(btn, 'mobile-search-icon')) return; 2381 2382 if (classie.hasClass(triggerButton, 'close')) { 2383 UNCODE.menuOpened = false;
2384 classie.removeClass(triggerButton, 'close'); 2385 classie.addClass(triggerButton, 'closing'); 2386 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2387 if (!classie.hasClass(closeButton, 'menu-close-search')) { 2388 classie.removeClass(closeButton, 'close'); 2389 classie.addClass(closeButton, 'closing'); 2390 } 2391 }); 2392 setTimeout(function() { 2393 classie.removeClass(triggerButton, 'closing'); 2394 // triggerButton.style.opacity = 1; 2395 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2396 if (!classie.hasClass(closeButton, 'menu-close-search')) { 2397 classie.removeClass(closeButton, 'closing'); 2398 // closeButton.style.opacity = 0; 2399 } 2400 }); 2401 }, 1000); 2402 } else { 2403 UNCODE.menuOpened = true; 2404 // triggerButton.style.opacity = 0; 2405 var getBtnRect = !classie.hasClass(triggerButton, 'search-icon') ? triggerButton.getBoundingClientRect() : null; 2406 classie.addClass(triggerButton, 'opening'); 2407 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2408 if (!classie.hasClass(closeButton, 'menu-close-search')) { 2409 // classie.addClass(triggerButton, 'close'); 2410 // if (getBtnRect != null) closeButton.setAttribute('style', 'top:' + getBtnRect.top + 'px; left:'+ getBtnRect.left + 'px !important'); 2411 classie.addClass(closeButton, 'close'); 2412 classie.addClass(closeButton, 'opening'); 2413 // closeButton.style.opacity = 1; 2414 } 2415 }); 2416 setTimeout(function() { 2417 classie.removeClass(triggerButton, 'opening'); 2418 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2419 if (!classie.hasClass(closeButton, 'menu-close-search')) { 2420 classie.removeClass(closeButton, 'opening'); 2421 } 2422 }); 2423 }, 1000); 2424 window.addEventListener("resize", function() { 2425 positionCloseBtn(triggerButton, closeButtons); 2426 }); 2427 } 2428 } 2429 function positionCloseBtn(triggerButton, closeButtons){ 2430 var getBtnRect = !classie.hasClass(triggerButton, 'search-icon') ? triggerButton.getBoundingClientRect() : null; 2431 // Array.prototype.forEach.call(closeButtons, function(closeButton) { 2432 // if (!classie.hasClass(closeButton, 'menu-close-search')) { 2433 // if (getBtnRect != null) closeButton.setAttribute('style', 'top:' + getBtnRect.top + 'px; left:'+ getBtnRect.left + 'px !important'); 2434 // closeButton.style.opacity = 1; 2435 // } 2436 // }); 2437 } 2438 (function bindEscape() { 2439 document.onkeydown = function(evt) { 2440 evt = evt || window.event; 2441 var isEscape = false;
2442 if ("key" in evt) { 2443 isEscape = (evt.key == "Escape" || evt.key == "Esc"); 2444 } else { 2445 isEscape = (evt.keyCode == 27); 2446 } 2447 if (isEscape && overlayOpened) { 2448 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2449 if (classie.hasClass(closeButton, 'overlay-close') && classie.hasClass(closeButton, 'menu-button-overlay')) { 2450 closeButton.click(); 2451 } 2452 }); 2453 } 2454 }; 2455 })(); 2456 Array.prototype.forEach.call(document.querySelectorAll('.trigger-overlay'), function(triggerBttn) { 2457 if ( UNCODE.menuOpened || ( (classie.hasClass(document.body, 'vmenu') || classie.hasClass(triggerBttn, 'menu-button-offcanvas')) && UNCODE.wwidth >= 960 ) ) return; 2458 triggerBttn.addEventListener('click', function(e) { 2459 triggerButton = e.currentTarget; 2460 // if (wwidth < mediaQuery && classie.hasClass(triggerButton, 'search-icon')) { 2461 if ( wwidth < mediaQuery && triggerButton.getAttribute('data-area') != 'search' ) { 2462 return true; 2463 } else { 2464 e.stopPropagation(); 2465 // if (wwidth > mediaQuery) toggleOverlay(triggerButton); 2466 // else { 2467 // if (classie.addClass(triggerButton, 'search-icon')) return true; 2468 // } 2469 if ( triggerButton.getAttribute('data-area') == 'search' ) { 2470 if ( globalBtnn !== undefined && globalBtnn !== false && globalBtnn !== triggerButton ) { 2471 sequential = triggerButton; 2472 globalBtnn.dispatchEvent(new Event("click")); 2473 } else { 2474 window.dispatchEvent(new CustomEvent('menuMobileTrigged')); 2475 toggleOverlay(triggerButton); 2476 } 2477 } else { 2478 window.dispatchEvent(new CustomEvent('menuMobileTrigged')); 2479 toggleOverlay(triggerButton); 2480 } 2481 e.preventDefault(); 2482 return false; 2483 } 2484 }, false); 2485 }); 2486 Array.prototype.forEach.call(document.querySelectorAll('.overlay-close, .menu-button-overlay'), function(closeBttn) { 2487 closeButtons.push(closeBttn); 2488 if ( classie.hasClass(closeBttn, 'menu-close-search') ) { 2489 closeBttn.addEventListener('click', function(e) { 2490 // if (wwidth > mediaQuery) toggleOverlay(closeBttn); 2491 toggleOverlay(closeBttn); 2492 e.preventDefault(); 2493 return false; 2494 }, false); 2495 } 2496 }); 2497 document.body.addEventListener('click', function(e) { 2498 if ( ddCloseBtn !== false ) { 2499 var close_overlay = getClosest( e.target, 'overlay-search'); 2500 if ( close_overlay === null ) { 2501 toggleOverlay(ddCloseBtn); 2502 } 2503 } 2504 }); 2505 document.addEventListener('keydown', function(e) { 2506 e = e || window.event; 2507 if ( ddCloseBtn !== false && ( e.key === "Escape" || e.key === "Esc" ) ) { 2508 toggleOverlay(ddCloseBtn); 2509 } 2510 }); 2511 }, 2512 /** All scrolling functions - Begin */ 2513 /** Shrink menu **/ 2514 shrinkMenu = function(bodyTop) { 2515 if ( UNCODE.isFrontEndEditor ) 2516 return; 2517 var logoShrink, 2518 offset = 100; 2519 for (var i = 0; i < logoel.length; i++) { 2520 if (((secmenuHeight == 0) ? bodyTop > menuHeight : bodyTop > secmenuHeight + offset) && !classie.hasClass(logoel[i], 'shrinked') && (wwidth > mediaQuery)) { 2521 classie.addClass(logoel[i], 'shrinked'); 2522 if (logoMinScale != undefined) { 2523 logoShrink = logolink.children; 2524 Array.prototype.forEach.call(logoShrink, function(singleLogo) { 2525 singleLogo.style.height = logoMinScale + 'px'; 2526 singleLogo.style.lineHeight = logoMinScale + 'px'; 2527 if (classie.hasClass(singleLogo, 'text-logo')) singleLogo.style.fontSize = logoMinScale + 'px'; 2528 }); 2529 } 2530 setTimeout(function() { 2531 calculateMenuHeight(false); 2532 //window.dispatchEvent(new Event('resize')); 2533 }, 300); 2534 } else if ((((secmenuHeight == 0) ? bodyTop == 0 : bodyTop <= secmenuHeight + offset) || (wwidth < mediaQuery)) && classie.hasClass(logoel[i], 'shrinked')) { 2535 classie.removeClass(logoel[i], 'shrinked'); 2536 if (logoMinScale != undefined) { 2537 logoShrink = logolink.children; 2538 Array.prototype.forEach.call(logoShrink, function(singleLogo) { 2539 singleLogo.style.height = singleLogo.getAttribute('data-maxheight') + 'px'; 2540 singleLogo.style.lineHeight = singleLogo.getAttribute('data-maxheight') + 'px'; 2541 if (classie.hasClass(singleLogo, 'text-logo')) singleLogo.style.fontSize = singleLogo.getAttribute('data-maxheight') + 'px'; 2542 }); 2543 } 2544 setTimeout(function() { 2545 calculateMenuHeight(false); 2546 //window.dispatchEvent(new Event('resize')); 2547 }, 300); 2548 } 2549 } 2550 }, 2551 /** Switch colors menu **/ 2552 switchColorsMenu = function(bodyTop, style) { 2553 for (var i = 0; i < transmenuel.length; i++) { 2554 if (masthead.style.opacity !== 1) masthead.style.opacity = 1;
2555 if ((secmenuHeight == 0) ? bodyTop > menuHeight / 2 : bodyTop > secmenuHeight) { 2556 if (classie.hasClass(masthead, 'style-dark-original')) { 2557 logo.className = logo.className.replace("style-light", "style-dark"); 2558 } 2559 if (classie.hasClass(masthead, 'style-light-original')) { 2560 logo.className = logo.className.replace("style-dark", "style-light"); 2561 } 2562 if (style != undefined) { 2563 if (style == 'dark') { 2564 classie.removeClass(transmenuel[i], 'style-light-override'); 2565 } 2566 if (style == 'light') { 2567 classie.removeClass(transmenuel[i], 'style-dark-override'); 2568 } 2569 classie.addClass(transmenuel[i], 'style-' + style + '-override'); 2570 } 2571 } else { 2572 if (style != undefined) { 2573 if (style == 'dark') { 2574 classie.removeClass(transmenuel[i], 'style-light-override'); 2575 } 2576 if (style == 'light') { 2577 classie.removeClass(transmenuel[i], 'style-dark-override'); 2578 } 2579 classie.addClass(transmenuel[i], 'style-' + style + '-override'); 2580 } 2581 } 2582 } 2583 if (pageHeader != undefined) { 2584 if (style != undefined) { 2585 if (classie.hasClass(pageHeader, 'header-style-dark')) { 2586 classie.removeClass(pageHeader, 'header-style-dark'); 2587 } 2588 if (classie.hasClass(pageHeader, 'header-style-light')) { 2589 classie.removeClass(pageHeader, 'header-style-light'); 2590 } 2591 classie.addClass(pageHeader, 'header-style-' + style); 2592 } 2593 } 2594 }, 2595 /** VisibleRows **/ 2596 visibleRowCol = function(bodyTop) { 2597 if ( typeof visibleRows == 'object') { 2598 for (var i = 0; i < visibleRows.length; i++) { 2599 var section = visibleRows[i], 2600 sectionHeight = outerHeight(section), 2601 offSetTop = bodyTop + ( section != null ? section.getBoundingClientRect().top : 0 ), 2602 offSetPosition = wheight + bodyTop - offSetTop; 2603 if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) { 2604 classie.addClass($kenburnsInner[0], 'uncode-scroll-visible'); 2605 visibleRows[i].dispatchEvent(new CustomEvent('enter-row')); 2606 } else { 2607 classie.removeClass($kenburnsInner[0], 'uncode-scroll-visible'); 2608 visibleRows[i].dispatchEvent(new CustomEvent('exit-row')); 2609 } 2610 } 2611 } 2612 }, 2613 /** KenBurns **/ 2614 kenburnsHeader = function(bodyTop) { 2615 var value; 2616 if ( typeof kenburnsHeaders == 'object' && kenburnsHeaders.length ) { 2617 for (var i = 0; i < kenburnsHeaders.length; i++) { 2618 var section = kenburnsHeaders[i].parentNode, 2619 sectionHeight = outerHeight(section), 2620 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2621 offSetPosition = wheight + bodyTop - offSetTop, 2622 $kenburnsInner = kenburnsHeaders[i].querySelectorAll('.header-bg'); 2623 if (classie.hasClass(kenburnsHeaders[i], 'header-carousel-wrapper')) { 2624 $kenburnsInner = kenburnsHeaders[i].querySelectorAll('.t-background-cover'); 2625 } 2626 if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) { 2627 for (var i = 0; i < $kenburnsInner.length; i++) { 2628 classie.addClass($kenburnsInner[i], 'uncode-kburns'); 2629 $kenburnsInner[i].dispatchEvent(new CustomEvent('enter-kburns')); 2630 } 2631 } else { 2632 for (var i = 0; i < $kenburnsInner.length; i++) { 2633 classie.removeClass($kenburnsInner[i], 'uncode-kburns'); 2634 $kenburnsInner[i].dispatchEvent(new CustomEvent('exit-kburns')); 2635 } 2636 } 2637 } 2638 } 2639 }, 2640 kenburnsRowCol = function(bodyTop) { 2641 var value; 2642 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2643 kenburnsRows = document.querySelectorAll('.with-kburns > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 2644 } 2645 if ( typeof kenburnsRows == 'object' && kenburnsRows.length ) { 2646 for (var i = 0; i < kenburnsRows.length; i++) { 2647 var section = kenburnsRows[i].parentNode, 2648 sectionHeight = outerHeight(section), 2649 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2650 offSetPosition = wheight + bodyTop - offSetTop, 2651 $kenburnsInner = kenburnsRows[i].querySelectorAll('.background-inner, .header-bg'); 2652 if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) { 2653 classie.addClass($kenburnsInner[0], 'uncode-kburns'); 2654 $kenburnsInner[0].dispatchEvent(new CustomEvent('enter-kburns')); 2655 } else { 2656 classie.removeClass($kenburnsInner[0], 'uncode-kburns'); 2657 $kenburnsInner[0].dispatchEvent(new CustomEvent('exit-kburns')); 2658 } 2659 } 2660 } 2661 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2662 kenburnsCols = document.querySelectorAll('.with-kburns > .column-background > .background-wrapper'); 2663 } 2664 if ( typeof kenburnsCols == 'object' && kenburnsCols.length ) { 2665 for (var j = 0; j < kenburnsCols.length; j++) { 2666 var elm = kenburnsCols[j], 2667 $kenburnsInner = elm.querySelectorAll('.background-inner'); 2668 if (checkVisible(elm)) { 2669 classie.addClass($kenburnsInner[0], 'uncode-kburns'); 2670 $kenburnsInner[0].dispatchEvent(new CustomEvent('enter-kburns')); 2671 } else { 2672 classie.removeClass($kenburnsInner[0], 'uncode-kburns'); 2673 $kenburnsInner[0].dispatchEvent(new CustomEvent('exit-kburns')); 2674 } 2675 } 2676 } 2677 }, 2678 /** Zoom Out BackWash **/ 2679 backwashHeader = function(bodyTop) { 2680 var value; 2681 var onEndAnimationFn = function(ev){ 2682 if (animationEvent) { 2683 if (ev.animationName !== 'backwash') { 2684 return; 2685 } 2686 this.removeEventListener(animationEvent, onEndAnimationFn); 2687 } 2688 classie.addClass(ev.target, 'uncode-zoomout-already'); 2689 } 2690 if ( typeof backwashHeaders == 'object' && backwashHeaders.length ) { 2691 for (var i = 0; i < backwashHeaders.length; i++) { 2692 var section = backwashHeaders[i].parentNode, 2693 sectionHeight = outerHeight(section), 2694 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2695 offSetPosition = wheight + bodyTop - offSetTop, 2696 $backwashInner = backwashHeaders[i].querySelectorAll('.header-bg'); 2697 2698 if ( classie.hasClass($backwashInner[0], 'uncode-video-container') ) { 2699 continue; 2700 } 2701 2702 if (classie.hasClass(backwashHeaders[i], 'header-carousel-wrapper')) { 2703 $backwashInner = backwashHeaders[i].querySelectorAll('.t-background-cover'); 2704 } 2705 2706 if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) { 2707 for (var i = 0; i < $backwashInner.length; i++) { 2708 classie.addClass($backwashInner[i], 'uncode-zoomout'); 2709 $backwashInner[i].dispatchEvent(new CustomEvent('enter-zoomout')); 2710 } 2711 } else { 2712 for (var i = 0; i < $backwashInner.length; i++) { 2713 classie.removeClass($backwashInner[i], 'uncode-zoomout'); 2714 $backwashInner[i].dispatchEvent(new CustomEvent('exit-zoomout')); 2715 } 2716 } 2717 for (var i = 0; i < $backwashInner.length; i++) { 2718 $backwashInner[i].addEventListener(animationEvent, onEndAnimationFn); 2719 } 2720 } 2721 } 2722 }, 2723 backwashRowCol = function(bodyTop) { 2724 var value; 2725 var onEndAnimationFn = function(ev){ 2726 if (animationEvent) { 2727 if (ev.animationName !== 'backwash') { 2728 return; 2729 } 2730 this.removeEventListener(animationEvent, onEndAnimationFn); 2731 } 2732 classie.addClass(ev.target, 'uncode-zoomout-already'); 2733 } 2734 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2735 backwashRows = document.querySelectorAll('.with-zoomout > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 2736 } 2737 if ( typeof backwashRows == 'object' && backwashRows.length ) { 2738 for (var i = 0; i < backwashRows.length; i++) { 2739 var section = backwashRows[i].parentNode, 2740 sectionHeight = outerHeight(section), 2741 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2742 offSetPosition = wheight + bodyTop - offSetTop, 2743 $backwashInner = backwashRows[i].querySelectorAll('.background-inner'); 2744 2745 if ( classie.hasClass($backwashInner[0], 'uncode-video-container') ) { 2746 continue; 2747 } 2748 2749 if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight) ) { 2750 classie.addClass($backwashInner[0], 'uncode-zoomout'); 2751 $backwashInner[0].dispatchEvent(new CustomEvent('enter-zoomout')); 2752 } else { 2753 classie.removeClass($backwashInner[0], 'uncode-zoomout'); 2754 $backwashInner[0].dispatchEvent(new CustomEvent('exit-zoomout')); 2755 } 2756 $backwashInner[0].addEventListener(animationEvent, onEndAnimationFn); 2757 } 2758 2759 } 2760 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2761 backwashCols = document.querySelectorAll('.with-zoomout > .column-background > .background-wrapper'); 2762 } 2763 if ( typeof backwashCols == 'object' && backwashCols.length ) { 2764 for (var j = 0; j < backwashCols.length; j++) { 2765 var elm = backwashCols[j], 2766 $backwashInner = elm.querySelectorAll('.background-inner'); 2767 if (checkVisible(elm)) { 2768 classie.addClass($backwashInner[0], 'uncode-zoomout'); 2769 $backwashInner[0].dispatchEvent(new CustomEvent('enter-zoomout')); 2770 } else { 2771 classie.removeClass($backwashInner[0], 'uncode-zoomout'); 2772 $backwashInner[0].dispatchEvent(new CustomEvent('exit-zoomout')); 2773 } 2774 $backwashInner[0].addEventListener(animationEvent, onEndAnimationFn); 2775 } 2776 } 2777 }, 2778 /** Parallax Rows **/
2779 parallaxRowCol = function(bodyTop) { 2780 var value; 2781 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2782 parallaxRows = document.querySelectorAll('.with-parallax > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 2783 } 2784 if (typeof parallaxRows == 'object') { 2785 for (var i = 0; i < parallaxRows.length; i++) { 2786 var section = parallaxRows[i].parentNode, 2787 thisHeight = outerHeight(parallaxRows[i]), 2788 sectionHeight = outerHeight(section), 2789 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2790 offSetPosition = wheight + bodyTop - offSetTop; 2791 if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) { 2792 value = ((offSetPosition - wheight) * speedDivider); 2793 if (Math.abs(value) < (thisHeight - sectionHeight)) {
2794 translateElement(parallaxRows[i], Math.floor(value)); 2795 } else { 2796 translateElement(parallaxRows[i], Math.floor(thisHeight - sectionHeight)); 2797 } 2798 } 2799 } 2800 } 2801 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2802 parallaxCols = document.querySelectorAll('.with-parallax > .column-background > .background-wrapper'); 2803 } 2804 if (typeof parallaxCols == 'object') { 2805 for (var j = 0; j < parallaxCols.length; j++) { 2806 var section = parallaxCols[j].parentNode, 2807 thisHeight = outerHeight(parallaxCols[j]), 2808 sectionHeight = outerHeight(section), 2809 offSetTop = bodyTop + (section != null ? section.getBoundingClientRect().top : 0), 2810 offSetPosition = wheight + bodyTop - offSetTop; 2811 if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) { 2812 value = ((offSetPosition - wheight) * speedDivider); 2813 value *= .8; 2814 if (Math.abs(value) < (thisHeight - sectionHeight)) { 2815 translateElement(parallaxCols[j], Math.floor(value)); 2816 } else { 2817 translateElement(parallaxCols[j], Math.floor(thisHeight - sectionHeight)); 2818 } 2819 } 2820 } 2821 } 2822 }, 2823 /** Parallax Headers **/ 2824 parallaxHeader = function(bodyTop) { 2825 var value; 2826 if (typeof parallaxHeaders == 'object') { 2827 for (var i = 0; i < parallaxHeaders.length; i++) { 2828 var section = parallaxHeaders[i].parentNode, 2829 thisSibling = section.nextSibling, 2830 thisHeight, 2831 sectionHeight, 2832 offSetTop, 2833 offSetPosition; 2834 if (classie.hasClass(parallaxHeaders[i], 'header-carousel-wrapper')) { 2835 getDivChildren(parallaxHeaders[i], '.t-entry-visual-cont', function(item, l, total) { 2836 thisHeight = outerHeight(item); 2837 sectionHeight = outerHeight(section); 2838 offSetTop = bodyTop + section.getBoundingClientRect().top; 2839 offSetPosition = wheight + bodyTop - offSetTop; 2840 if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) { 2841 value = ((offSetPosition - wheight) * speedDivider); 2842 if (Math.abs(value) < (thisHeight - sectionHeight)) { 2843 translateElement(item, Math.floor(value)); 2844 } 2845 } 2846 }); 2847 } else { 2848 thisHeight = outerHeight(parallaxHeaders[i]); 2849 sectionHeight = outerHeight(section); 2850 offSetTop = bodyTop + section.getBoundingClientRect().top; 2851 offSetPosition = wheight + bodyTop - offSetTop; 2852 if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) { 2853 value = ((offSetPosition - wheight) * speedDivider); 2854 if (Math.abs(value) < (thisHeight - sectionHeight)) { 2855 translateElement(parallaxHeaders[i], Math.floor(value)); 2856 } 2857 } 2858 } 2859 } 2860 } 2861 }, 2862 /** Header opacity **/ 2863 headerOpacity = function(bodyTop) { 2864 if ( UNCODE.isFrontEndEditor ) { 2865 return; 2866 } 2867 if (headerWithOpacity && headerWithOpacity.length) { 2868 var thisHeight = outerHeight(headerWithOpacity[0]); 2869 if (bodyTop > thisHeight / 8) { 2870 if (pageHeader != undefined) classie.addClass(pageHeader, 'header-scrolled'); 2871 } else { 2872 if (pageHeader != undefined) classie.removeClass(pageHeader, 'header-scrolled'); 2873 } 2874 } 2875 }, 2876 /** Show hide scroll top arrow **/ 2877 showHideScrollup = function(bodyTop) { 2878 if ( bodyTop != 0 ) { 2879 if (bodyTop > wheight || ((bodyTop + wheight) >= docheight) && docheight > 0) { 2880 classie.addClass(document.body, 'window-scrolled'); 2881 classie.removeClass(document.body, 'hide-scrollup'); 2882 if (footerScroller && footerScroller[0] != undefined) { 2883 footerScroller[0].style.display = ''; 2884 } 2885 } else { 2886 if (classie.hasClass(document.body, 'window-scrolled')) classie.addClass(document.body, 'hide-scrollup'); 2887 classie.removeClass(document.body, 'window-scrolled'); 2888 } 2889 } 2890 }, 2891 /** Fix menu **/ 2892 fixMenu = function(){ 2893 if ( UNCODE.isFrontEndEditor ) 2894 return; 2895 menuwrapper = document.querySelectorAll(".menu-wrapper"); 2896 if ( ! classie.hasClass(document.body, 'vmenu') && UNCODE.isFullPage && !UNCODE.isFullPageSnap && classie.hasClass(document.body, 'uncode-fp-menu-hide') ) { 2897 menuwrapper = document.querySelector(".menu-wrapper"); 2898 pageHeader = document.getElementById("page-header"); 2899 menuwrapper.style.position = 'fixed'; 2900 menuwrapper.style.zIndex = '5'; 2901 } 2902 }, 2903 /** Hide Menu **/ 2904 hideMenu = function(bodyTop) { 2905 if ( UNCODE.isFrontEndEditor ) 2906 return; 2907 if (UNCODE.menuOpened || bodyTop < 0) return; 2908 if (classie.hasClass(document.body, 'vmenu')) { 2909 if (wwidth < mediaQuery) menuhide = document.querySelector('#masthead .menu-hide-vertical'); 2910 else menuhide = null; 2911 } else if (classie.hasClass(document.body, 'hmenu-center')) { 2912 if (wwidth > mediaQuery) menuhide = document.querySelector('#masthead .menu-hide'); 2913 else menuhide = document.querySelector('.menu-sticky-mobile .menu-hide'); 2914 } else { 2915 if (wwidth <= mediaQuery) menuhide = document.querySelector('.menu-sticky-mobile .menu-hide'); 2916 }
2917 menuMobileTransparent = document.querySelector('.menu-absolute.menu-transparent'); 2918 if (typeof menuhide == 'object' && menuhide != null && mainmenu[0] != undefined) { 2919 var translate, 2920 scrollingDown = true; 2921 /** fix for hmenu-center **/ 2922 var sticky_element = (typeof mainmenu.item === 'undefined' ? ((wwidth > mediaQuery) ? mainmenu[0] : mainmenu[1]) : mainmenu[0]); 2923 if (lastScrollValue == bodyTop) return; 2924 2925 if (lastScrollValue > bodyTop) scrollingDown = false; 2926 else scrollingDown = true; 2927 lastScrollValue = bodyTop; 2928 2929 if (!scrollingDown) { 2930 if (!UNCODE.scrolling) { 2931 if ((secmenuHeight == 0) ? bodyTop == 0 : bodyTop < secmenuHeight) { 2932 classie.removeClass(sticky_element.parentNode, 'is_stuck'); 2933 if (classie.hasClass(masthead, 'menu-transparent')) { 2934 if (( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) && !classie.hasClass(masthead.parentNode, 'no-header')) masthead.parentNode.style.height = '0px'; 2935 } 2936 if (wwidth < mediaQuery && secmenuHeight === 0) sticky_element.style.position = 'fixed'; 2937 else sticky_element.style.position = ''; 2938 hideMenuReset(sticky_element); 2939 clearTimeout(hidingTimer); 2940 } 2941 2942 if (classie.hasClass(menuhide, 'menu-hided')) { 2943 classie.removeClass(menuhide, 'menu-hided'); 2944 hidingTimer = setTimeout(function() { 2945 classie.addClass(sticky_element.parentNode, 'is_stuck'); 2946 hideMenuReset(sticky_element); 2947 }, 400); 2948 } 2949 } 2950 } else { 2951 if (menusticky.length == 0 && bodyTop < wheight / 3) { 2952 if (sticky_element.style.position == 'fixed') sticky_element.style.position = ''; 2953 } 2954 if (bodyTop > wheight / 2) { 2955 clearTimeout(hidingTimer); 2956 if (!classie.hasClass(menuhide, 'menu-hided')) { 2957 classie.addClass(menuhide, 'menu-hided'); 2958 classie.addClass(sticky_element.parentNode, 'is_stuck'); 2959 if (sticky_element.style.position != 'fixed') { 2960 sticky_element.style.visibility = 'hidden'; 2961 sticky_element.style.position = 'fixed'; 2962 sticky_element.style.top = '0px'; 2963 } 2964 translateElement(menuhide, -UNCODE.menuMobileHeight - 1); 2965 } 2966 } 2967 } 2968 } 2969 }, 2970 hideMenuReset = function(sticky_element) { 2971 var topOffset = 0; 2972 if (sticky_element.style.visibility == 'hidden') sticky_element.style.visibility = ''; 2973 if (bodyBorder > 0) topOffset += bodyBorder; 2974 if (adminBar != null && window.getComputedStyle(adminBar,null).getPropertyValue("position") != 'fixed') adminBarHeight = 0; 2975 if (adminBarHeight > 0) topOffset += adminBarHeight; 2976 //sticky_element.style.top = topOffset + 'px'; 2977 if (!classie.hasClass(document.body, 'boxed-width') && boxWidth > 0) sticky_element.style.width = boxWidth + 'px'; 2978 translateElement(menuhide, 0); 2979 }, 2980 /** Stick Menu **/ 2981 stickMenu = function(bodyTop) { 2982 if ( mainmenu[0] == undefined ) { 2983 mainmenu = document.querySelectorAll('.vmenu .vmenu-container, .menu-primary .menu-container'); 2984 } 2985 if (header && mainmenu[0] != undefined) { 2986 menuMobileTransparent = document.querySelector('.menu-absolute.menu-transparent'); 2987 if (classie.hasClass(mainmenu[0], 'vmenu-container') && wwidth > mediaQuery) return; 2988 /** fix for hmenu-center **/ 2989 var sticky_element = (typeof mainmenu.item === 'undefined' ? (( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) ? mainmenu[0] : mainmenu[1]) : mainmenu[0]); 2990 if ((secmenuHeight == 0 && ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery)) ? bodyTop > (0 + adminBarHeight) : bodyTop > (secmenuHeight + adminBarHeight)) { 2991 if (!classie.hasClass(sticky_element.parentNode, 'is_stuck')) { 2992 classie.addClass(sticky_element.parentNode, 'is_stuck'); 2993 sticky_element.style.position = 'fixed'; 2994 var getAnchorTop = bodyBorder; 2995 if (adminBar != null && window.getComputedStyle(adminBar,null).getPropertyValue("position") != 'fixed') adminBarHeight = 0; 2996 if (adminBarHeight > 0) getAnchorTop += adminBarHeight; 2997 sticky_element.style.top = getAnchorTop + 'px'; 2998 if (!classie.hasClass(document.body, 'boxed-width') && boxWidth > 0) sticky_element.style.width = boxWidth + 'px'; 2999 } 3000 } else { 3001 clearTimeout(hidingTimer); 3002 classie.removeClass(sticky_element.parentNode, 'is_stuck'); 3003 sticky_element.style.position = '';
3004 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) sticky_element.style.position = ''; 3005 if (classie.hasClass(document.body, 'hmenu-center')) sticky_element.style.position = 'absolute'; 3006 sticky_element.style.top = ''; 3007 } 3008 } 3009 }, 3010 translateElement = function(element, valueY) { 3011 var translate = 'translate3d(0, ' + valueY + 'px' + ', 0)'; 3012 element.style['-webkit-transform'] = translate; 3013 element.style['-moz-transform'] = translate; 3014 element.style['-ms-transform'] = translate; 3015 element.style['-o-transform'] = translate; 3016 element.style['transform'] = translate; 3017 }, 3018 setScrollPosition, 3019 scrollFunction = function() { 3020 if ( ! UNCODE.isFullPage ) { 3021 menusticky = UNCODE.isMobile ? document.querySelectorAll('.menu-sticky-mobile') : document.querySelectorAll('.menu-sticky, .menu-sticky-vertical'); 3022 if (menusticky != undefined && menusticky.length) stickMenu(bodyTop); 3023 kenburnsHeader(bodyTop); 3024 kenburnsRowCol(bodyTop); 3025 backwashHeader(bodyTop); 3026 backwashRowCol(bodyTop); 3027 if (logoel != undefined && logoel.length && !isMobile) shrinkMenu(bodyTop); 3028 hideMenu(bodyTop); 3029 if (isMobileParallaxAllowed || !isMobile) { 3030 if (header && menusticky != undefined && menusticky.length) 3031 switchColorsMenu(bodyTop); 3032 parallaxRowCol(bodyTop); 3033 parallaxHeader(bodyTop); 3034 headerOpacity(bodyTop); 3035 visibleRowCol(bodyTop); 3036 } 3037 clearRequestTimeout(setScrollPosition); 3038 setScrollPosition = requestTimeout( function(){ 3039 scrollRowHeight_fix = window.pageYOffset; 3040 }, 100 ); 3041 } 3042 }, 3043 /** Custom Cursor **/ 3044 initCursor = function(){ 3045 var clientX, clientY; 3046 3047 var $customCursor = document.getElementById('uncode-custom-cursor'), 3048 $customPilot = document.getElementById('uncode-custom-cursor-pilot'), 3049 cursorType = 'auto', 3050 loadedCursor = false; 3051 3052 document.addEventListener("mousemove", function(e) { 3053 clientX = e.clientX; 3054 clientY = e.clientY; 3055 3056 if ( loadedCursor !== true ) { 3057 loadedCursor = true; 3058 classie.addClass($customCursor, 'loaded-cursor'); 3059 if ( $customPilot !== null ) { 3060 classie.addClass($customPilot, 'loaded-cursor'); 3061 } 3062 } 3063 }); 3064 3065 function render() { 3066 if ( $customCursor != null ) { 3067 $customCursor.style.transform = 'translate3d(' + clientX + 'px, ' + clientY + 'px, 0)'; 3068 if ( $customPilot !== null ) { 3069 $customPilot.style.transform = 'translate3d(' + clientX + 'px, ' + clientY + 'px, 0)'; 3070 } 3071 requestAnimationFrame(render); 3072 } 3073 }; 3074 requestAnimationFrame(render); 3075 }, 3076 3077 /** Shape Dividers **/ 3078 shapeDivider = function() { 3079 var $shape = '.uncode-divider-wrap'; 3080 3081 forEachElement($shape, function($el, i) { 3082 var elH = parseInt( $el.getAttribute('data-height') ), 3083 elHunit = $el.getAttribute('data-unit'), 3084 newEl, 3085 $parent = $el.parentNode, 3086 parentH, 3087 $svg = $el.getElementsByTagName('svg')[0]; 3088 3089 if ( elHunit == 'px' ) { 3090 3091 switch (true) { 3092 case (wwidth < 1500 && wwidth >= 1180): 3093 newEl = elH*0.8; 3094 break; 3095 3096 case (wwidth < 1180 && wwidth >= 960): 3097 newEl = elH*0.65; 3098 break; 3099 3100 case (wwidth < 960 && wwidth >= 570): 3101 newEl = elH*0.5; 3102 break; 3103 3104 case (wwidth < 570): 3105 newEl = elH*0.25; 3106 break; 3107 3108 default: 3109 newEl = elH; 3110 } 3111 3112 $el.style.height = newEl + elHunit; 3113 } 3114 3115 3116 if ( classie.hasClass($el, 'uncode-divider-preserve-ratio') && ( window.navigator.userAgent.indexOf('MSIE ') !== -1 || window.navigator.userAgent.indexOf('Trident/') !== -1 ) ) { 3117 3118 $svg.setAttribute('preserveAspectRatio','none'); 3119 3120 var sizes = $svg.getAttribute('viewBox').split(' '), 3121 svgW = sizes[2], 3122 svgH = sizes[3], 3123 newSvgW; 3124 3125 newSvgW = newEl * ( svgW / svgH ); 3126 3127 $svg.style.width = newSvgW + 'px'; 3128 3129 } 3130 }); 3131 }; 3132 if (!noScroll && document.body == null) { 3133 window.addEventListener('scroll', function(e) { 3134 if ( ! UNCODE.isFullPage ) { 3135 bodyTop = document.documentElement.scrollTop || document.body.scrollTop; 3136 scrollFunction(); 3137 showHideScrollup(bodyTop); 3138 } 3139 }, false); 3140 } 3141 window.addEventListener('uncode-quick-view-loaded', function() { 3142 document.getElementById('unmodal-content').addEventListener('scroll', function(e) { 3143 bodyTop = document.getElementById('unmodal-content').scrollTop; 3144 scrollFunction(); 3145 showHideScrollup(bodyTop); 3146 }, false); 3147 }, false); 3148 /** All scrolling functions - End */ 3149 /** help functions */ 3150 function getClosest(el, tag) { 3151 do { 3152 if (el.className != undefined && el.className.indexOf(tag) > -1) return el; 3153 } while (el = el.parentNode); 3154 // not found :( 3155 return null; 3156 } 3157 3158 function outerHeight(el, includeMargin) { 3159 if (el != null) { 3160 var height = el.offsetHeight; 3161 if (includeMargin) { 3162 var style = el.currentStyle || getComputedStyle(el); 3163 height += parseInt(style.marginTop) + parseInt(style.marginBottom); 3164 } 3165 return height; 3166 } 3167 } 3168 3169 function outerWidth(el, includeMargin) { 3170 var width = el.offsetWidth; 3171 if (includeMargin) { 3172 var style = el.currentStyle || getComputedStyle(el); 3173 width += parseInt(style.marginLeft) + parseInt(style.marginRight); 3174 } 3175 return width; 3176 } 3177 // Replicate jQuery .each method 3178 function forEachElement(selector, fn) { 3179 var elements = document.querySelectorAll(selector); 3180 for (var i = 0; i < elements.length; i++) fn(elements[i], i); 3181 } 3182 3183 function getDivChildren(containerId, selector, fn) { 3184 if (containerId !== null) { 3185 var elements = containerId.querySelectorAll(selector); 3186 for (var i = 0; i < elements.length; i++) fn(elements[i], i, elements.length); 3187 } 3188 } 3189 3190 function hideFooterScroll() { 3191 if (classie.hasClass(document.body, 'hide-scrollup')) footerScroller[0].style.display = "none"; 3192 } 3193 window.addEventListener("load", function(event) {
3194 if (SiteParameters.dynamic_srcset_active === '1') { 3195 UNCODE.adaptive_srcset_bg(); 3196 UNCODE.adaptive_srcset(false); 3197 } 3198 classie.addClass(document.body, 'uncode-loaded'); 3199 }); 3200 window.addEventListener("dynamic_srcset_load", function(event) { 3201 if (SiteParameters.dynamic_srcset_active === '1') { 3202 UNCODE.refresh_dynamic_srcset_size(false); 3203 } 3204 }); 3205 document.addEventListener("DOMContentLoaded", function(event) { 3206 UNCODE.adaptive(); 3207 boxWrapper = document.querySelectorAll('.box-wrapper'); 3208 docheight = boxWrapper[0] != undefined ? boxWrapper[0].offsetHeight : 0; 3209 // if (!classie.hasClass(document.body, 'vmenu') && !classie.hasClass(document.body, 'menu-offcanvas')) init_overlay(); 3210 init_overlay(); 3211 kenburnsRows = document.querySelectorAll('.with-kburns > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 3212 kenburnsCols = document.querySelectorAll('.with-kburns > .column-background > .background-wrapper'); 3213 backwashRows = document.querySelectorAll('.with-zoomout > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 3214 backwashCols = document.querySelectorAll('.with-zoomout > .column-background > .background-wrapper'); 3215 if (!UNCODE.isMobile || isMobileParallaxAllowed) { 3216 parallaxRows = document.querySelectorAll('.with-parallax > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 3217 parallaxCols = document.querySelectorAll('.with-parallax > .column-background > .background-wrapper'); 3218 } 3219 footerScroller = document.querySelectorAll('.footer-scroll-top'); 3220 if (footerScroller && footerScroller[0] != undefined) { 3221 if (transitionEvent) { 3222 footerScroller[0].addEventListener(transitionEvent, hideFooterScroll); 3223 } 3224 } 3225 Array.prototype.forEach.call(document.querySelectorAll('.row-inner'), function(el) { 3226 el.style.height = ''; 3227 el.style.marginBottom = ''; 3228 }); 3229 setRowHeight(document.querySelectorAll('.page-wrapper .row-parent, footer .row-parent')); 3230 initVideoComponent(document.body, '.uncode-video-container.video:not(.drop-move):not(.fluid-object), .uncode-video-container.self-video:not(.drop-move)'); 3231 }); 3232 /** On resize events **/ 3233 window.addEventListener("vc-resize", function() { 3234 scrollRowHeight_fix = window.pageYOffset; 3235 Array.prototype.forEach.call(document.querySelectorAll('.row-inner'), function(el) { 3236 el.style.height = ''; 3237 el.style.marginBottom = ''; 3238 }); 3239 setRowHeight(document.querySelectorAll('.page-wrapper .row-parent, footer .row-parent'), false, true); 3240 }); 3241 var setIsScrolling; 3242 window.addEventListener("scroll", function() { 3243 UNCODE.setIsScrolling = true; 3244 clearRequestTimeout(setIsScrolling); 3245 3246 setIsScrolling = requestTimeout(function() { 3247 UNCODE.setIsScrolling = false; 3248 }, 66); 3249 }); 3250 window.addEventListener("resize", function(e) { 3251 scrollRowHeight_fix = window.pageYOffset; 3252 docheight = (boxWrapper != undefined && boxWrapper[0] != undefined) ? boxWrapper[0].offsetHeight : 0; 3253 var oldWidth = wwidth; 3254 UNCODE.wwidth = wwidth = window.innerWidth || document.documentElement.clientWidth; 3255 UNCODE.wheight = wheight = (window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2); 3256 if ( isSplitMenu && typeof resizeTimer_ === 'undefined' ) centerSplitMenu(); 3257 if (isMobile && (oldWidth == wwidth)) return false; 3258 calculateMenuHeight(false); 3259 initBox(); 3260 window.dispatchEvent(boxEvent); 3261 scrollFunction(); 3262 shapeDivider(); 3263 showHideScrollup(bodyTop); 3264 clearTimeout(resizeTimer_); 3265 resizeTimer_ = setTimeout(function() { 3266 if (isSplitMenu) centerSplitMenu(); 3267 }, 10); 3268 resizeThrottle( 3269 function() { 3270 if (SiteParameters.dynamic_srcset_active === '1') {
3271 UNCODE.refresh_dynamic_srcset_size(false); 3272 } 3273 UNCODE.isMobile = UNCODE.wwidth <= UNCODE.mediaQuery; 3274 menuOpacity(); 3275 headerHeight('.header-wrapper'); 3276 }, 100 3277 ); 3278 if ( UNCODE.setIsScrolling !== true ) { 3279 clearTimeout(resizeTimer); 3280 resizeTimer = setTimeout(function() { 3281 if ( UNCODE.setIsScrolling !== true ) { 3282 UNCODE.wheight = wheight = (window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2); 3283 Array.prototype.forEach.call(document.querySelectorAll('.row-inner'), function(el) { 3284 el.style.height = ''; 3285 el.style.marginBottom = ''; 3286 }); 3287 setRowHeight(document.querySelectorAll('.page-wrapper .row-parent, footer .row-parent'), false, true); 3288 } 3289 initVideoComponent(document.body, '.uncode-video-container.video:not(.drop-move):not(.fluid-object), .uncode-video-container.self-video:not(.drop-move)'); 3290 }, 500); 3291 } 3292 }); 3293 3294 window.addEventListener("lateral_resize", function(e) { 3295 fixMenuHeight(); 3296 calculateMenuHeight(false); 3297 scrollFunction(); 3298 headerHeight('.header-wrapper'); 3299 }); 3300 3301 var resizeThrottle = (function () { 3302 var timer = 0; 3303 return function (callback, ms) { 3304 clearTimeout(timer); 3305 timer = setTimeout(callback, ms); 3306 }; 3307 })(); 3308 3309 /** 3310 * On DOM ready 3311 */ 3312 window.addEventListener("load", function(){ 3313 if (!UNCODE.isMobile) { 3314 setTimeout(function() { 3315 // window.dispatchEvent(UNCODE.boxEvent); 3316 if (typeof Waypoint !== 'undefined') { 3317 Waypoint.refreshAll(); 3318 } 3319 }, 2000); 3320 } 3321 //repeat it for mobile since it changes layout on carousel after DOM loading 3322 if (UNCODE.isMobile && !isMobileParallaxAllowed) { 3323 kenburnsHeader(bodyTop); 3324 kenburnsRowCol(bodyTop); 3325 } 3326 backwashHeader(bodyTop); 3327 backwashRowCol(bodyTop); 3328 scrollFunction(); 3329 showHideScrollup(bodyTop); 3330 3331 // if (document.createEvent) { // W3C 3332 // var ev = document.createEvent('Event'); 3333 // ev.initEvent('resize', true, true); 3334 // window.dispatchEvent(ev); 3335 // } else { // IE 3336 // document.fireEvent('onresize'); 3337 // } 3338 3339 scrollRowHeight_fix = window.pageYOffset; 3340 docheight = (boxWrapper != undefined && boxWrapper[0] != undefined) ? boxWrapper[0].offsetHeight : 0; 3341 var oldWidth = wwidth; 3342 UNCODE.wwidth = wwidth = window.innerWidth || document.documentElement.clientWidth; 3343 UNCODE.wheight = wheight = (window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2); 3344 if ( isSplitMenu && typeof resizeTimer_ === 'undefined' ) { 3345 centerSplitMenu(); 3346 } 3347 3348 }, false); 3349 3350 function localStorageAvailable() { 3351 try { 3352 var storage = window['localStorage'], 3353 x = '__storage_test__'; 3354 storage.setItem(x, x); 3355 storage.removeItem(x); 3356 return true; 3357 } catch(e) { 3358 return false; 3359 } 3360 } 3361 3362 /** 3363 * Print Dialog check 3364 */ 3365 window.addEventListener("beforeprint", function(event) { 3366 UNCODE.printDialogOpen = true; 3367 }); 3368 window.addEventListener("afterprint", function(event) { 3369 UNCODE.printDialogOpen = false; 3370 window.dispatchEvent(new Event('resize')); 3371 }); 3372 3373 var UNCODE = { 3374 bodyTop: bodyTop, 3375 boxEvent: boxEvent, 3376 bodyBorder: bodyBorder, 3377 initBox: initBox, 3378 adminBarHeight: 0, 3379 menuHeight: 0, 3380 menuMobileHeight: 0, 3381 menuOpacity: menuOpacity, 3382 fixMenuHeight: fixMenuHeight, 3383 verticalRightMenu: verticalRightMenu, 3384 initHeader: initHeader, 3385 initRow: initRow, 3386 initCursor: initCursor, 3387 setRowHeight: setRowHeight, 3388 switchColorsMenu: switchColorsMenu, 3389 isMobile: isMobile, 3390 scrolling: false, 3391 menuHiding: false, 3392 menuOpened: false, 3393 menuMobileTriggerEvent: menuMobileTriggerEvent, 3394 mediaQuery: mediaQuery, 3395 mediaQueryMobile: mediaQueryMobile, 3396 initVideoComponent: initVideoComponent, 3397 hideMenu: hideMenu, 3398 wwidth: wwidth, 3399 wheight: wheight, 3400 printDialogOpen: printDialogOpen, 3401 webp_lossy_supported: SiteParameters.force_webp ? true : localStorageAvailable() && localStorage.getItem('webp_lossy_supported') === 'true' ? true : false, 3402 webp_lossless_supported: SiteParameters.force_webp ? true : localStorageAvailable() && localStorage.getItem('webp_lossless_supported') === 'true' ? true : false, 3403 }; 3404 // transport 3405 if (typeof define === 'function' && define.amd) { 3406 // AMD 3407 define(UNCODE); 3408 } else { 3409 // browser global 3410 window.UNCODE = UNCODE; 3411 } 3412
3413 UNCODE.check_webp_support = function(feature, callback) { 3414 // https://developers.google.com/speed/webp/faq#in_your_own_javascript 3415 var kTestImages = { 3416 lossy: "UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", 3417 lossless: "UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==", 3418 alpha: "UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==", 3419 // animation: "UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA" 3420 }; 3421 var img = new Image(); 3422 img.onload = function () { 3423 var result = (img.width > 0) && (img.height > 0); 3424 callback(feature, result); 3425 }; 3426 img.onerror = function () { 3427 callback(feature, false); 3428 }; 3429 img.src = "data:image/webp;base64," + kTestImages[feature]; 3430 } 3431 3432 UNCODE.check_webp_support('lossy', function (feature, isSupported) { 3433 if (isSupported) { 3434 UNCODE.webp_lossy_supported = true; 3435 if (localStorageAvailable()) { 3436 localStorage.setItem('webp_lossy_supported', true); 3437 } 3438 } 3439 }); 3440 3441 UNCODE.check_webp_support('lossless', function (feature, isSupported) { 3442 if (isSupported) { 3443 UNCODE.webp_lossless_supported = true; 3444 if (localStorageAvailable()) { 3445 localStorage.setItem('webp_lossless_supported', true); 3446 } 3447 } 3448 }); 3449 3450 UNCODE.adaptive = function() { 3451 if (SiteParameters.dynamic_srcset_active === '1') { 3452 return; 3453 } 3454 3455 var images = new Array(), 3456 getImages = document.querySelectorAll('.adaptive-async:not(.adaptive-fetching)'); 3457 for (var i = 0; i < getImages.length; i++) { 3458 var imageObj = {}, 3459 el = getImages[i]; 3460 if (classie.hasClass(el, 'woocommerce-product-gallery__image-first__img')) { 3461 continue; 3462 } 3463 classie.addClass(el, 'adaptive-fetching'); 3464 imageObj.unique = el.getAttribute('data-uniqueid'); 3465 imageObj.url = el.getAttribute('data-guid'); 3466 imageObj.path = el.getAttribute('data-path'); 3467 imageObj.singlew = el.getAttribute('data-singlew'); 3468 imageObj.singleh = el.getAttribute('data-singleh'); 3469 imageObj.origwidth = el.getAttribute('data-width'); 3470 imageObj.origheight = el.getAttribute('data-height'); 3471 imageObj.crop = el.getAttribute('data-crop'); 3472 imageObj.fixed = el.getAttribute('data-fixed') == undefined ? null : el.getAttribute('data-fixed'); 3473 imageObj.screen = window.uncodeScreen; 3474 imageObj.images = window.uncodeImages; 3475 images.push(imageObj); 3476 } 3477 3478 var post_data = { 3479 images: JSON.stringify(images), 3480 action: 'get_adaptive_async', 3481 ai_breakpoints: SiteParameters.ai_breakpoints, 3482 resize_quality: SiteParameters.resize_quality, 3483 register_metadata: SiteParameters.register_metadata, 3484 nonce_adaptive_images: SiteParameters.nonce_adaptive_images 3485 }; 3486 3487 if (images.length > 0) { 3488 var xhr = new XMLHttpRequest(); 3489 xhr.open('POST', SiteParameters.ajax_url, true); 3490 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 3491 xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 3492 3493 xhr.onreadystatechange = function() { 3494 if (xhr.readyState == XMLHttpRequest.DONE) { 3495 if (xhr.status == 200 && xhr.responseText) { 3496 var jsonResponse = JSON.parse(xhr.responseText); 3497 3498 if (jsonResponse.success && jsonResponse.data.images) { 3499 var images = jsonResponse.data.images; 3500 3501 for (var i = 0; i < images.length; i++) { 3502 var val = images[i]; 3503 var processedImageID = val.id; 3504 var processedImageUniqueID = val.unique; 3505 var processedImageisNew = val.new_crop === true ? true : false; 3506 var getImage = document.querySelectorAll('[data-uniqueid="'+processedImageUniqueID+'"]'); 3507 3508 for (var j = 0; j < getImage.length; j++) { 3509 var attrScr = getImage[j].getAttribute('src'), 3510 replaceImg = new Image(); 3511 replaceImg.source = attrScr; 3512 replaceImg.el = getImage[j]; 3513 3514 classie.removeClass(getImage[j], 'adaptive-async'); 3515 classie.removeClass(getImage[j], 'adaptive-fetching'); 3516 3517 replaceImg.onload = function () { 3518 3519 var _this = this, 3520 parentNode = (_this.el).parentNode, 3521 placeH; 3522 3523 //Workaround for lazy-load flickering on Firefox 3524 if ( typeof parentNode.prepend == 'undefined') { 3525 if (_this.source !== null) { 3526 if (SiteParameters.lazyload_type === 'rocket' && window.lazyLoadOptions) { 3527 (_this.el).lazySrc = _this.src; 3528 3529 if (classie.hasClass((_this.el), 'lazyloaded') || classie.hasClass((_this.el), 'lazyloading')) { 3530 (_this.el).src = _this.src; 3531 (_this.el).removeAttribute('data-lazy-src'); 3532 } 3533 } else { 3534 (_this.el).src = _this.src; 3535 } 3536 } else { 3537 if (SiteParameters.lazyload_type === 'rocket' && window.lazyLoadOptions) { 3538 (_this.el).dataset.bg = _this.src; 3539 3540 if (classie.hasClass((_this.el), 'lazyloaded') || classie.hasClass((_this.el), 'lazyloading')) { 3541 (_this.el).style.backgroundImage = 'url("'+_this.src+'")'; 3542 (_this.el).removeAttribute('data-bg'); 3543 } 3544 } else { 3545 (_this.el).style.backgroundImage = 'url("'+_this.src+'")'; 3546 } 3547 } 3548 3549 classie.addClass(_this.el, 'async-done'); 3550 _this.el.dispatchEvent(new CustomEvent("async-done")); 3551 } else { 3552 if (_this.source !== null) { 3553 placeH = document.createElement("IMG"); 3554 placeH.setAttribute('class', 'placeH'); 3555 if (SiteParameters.lazyload_type === 'rocket' && window.lazyLoadOptions) { 3556 placeH.dataset.lazySrc = _this.src; 3557 3558 if (classie.hasClass(placeH, 'lazyloaded') || classie.hasClass(placeH, 'lazyloading')) { 3559 placeH.src = _this.src; 3560 placeH.removeAttribute('data-lazy-src'); 3561 } 3562 } else { 3563 placeH.src = _this.src; 3564 } 3565 placeH.style.position = 'absolute'; 3566 placeH.style.opacity = '0'; 3567 } else { 3568 placeH = document.createElement("DIV"); 3569 placeH.setAttribute('style', _this.el.getAttribute('style')); 3570 placeH.setAttribute('class', 'placeH ' + _this.el.getAttribute('class')); 3571 if (SiteParameters.lazyload_type === 'rocket' && window.lazyLoadOptions) { 3572 placeH.dataset.bg = _this.src; 3573 3574 if (classie.hasClass(placeH, 'lazyloaded') || classie.hasClass(placeH, 'lazyloading')) { 3575 placeH.style.backgroundImage = 'url("'+_this.src+'")'; 3576 placeH.removeAttribute('data-bg'); 3577 } 3578 } else { 3579 placeH.style.backgroundImage = 'url("'+_this.src+'")'; 3580 } 3581 placeH.style.backgroundSize = 'cover'; 3582 placeH.style.backgroundPosition = 'center'; 3583 placeH.style.position = 'absolute'; 3584 placeH.style.top = '0'; 3585 placeH.style.width = '100%'; 3586 placeH.style.height = '100%'; 3587 } 3588 3589 if ( !classie.hasClass( _this.el, 'box-wrapper') ) { 3590 parentNode.prepend(placeH); 3591 } 3592 3593 requestTimeout(function(){ 3594 if (_this.source !== null) { 3595 if (SiteParameters.lazyload_type === 'rocket' && window.lazyLoadOptions) { 3596 (_this.el).dataset.lazySrc = _this.src; 3597 3598 if (classie.hasClass(_this.el, 'lazyloaded') || classie.hasClass(_this.el, 'lazyloading')) { 3599 (_this.el).src = _this.src; 3600 (_this.el).removeAttribute('data-lazy-src'); 3601 } 3602 } else { 3603 (_this.el).src = _this.src; 3604 } 3605 } else { 3606 if (SiteParameters.lazyload_type === 'rocket' && window.lazyLoadOptions) { 3607 (_this.el).dataset.bg = _this.src; 3608 3609 if (classie.hasClass(_this.el, 'lazyloaded') || classie.hasClass(_this.el, 'lazyloading')) { 3610 (_this.el).style.backgroundImage = 'url("'+_this.src+'")'; 3611 (_this.el).removeAttribute('data-bg'); 3612 } 3613 } else { 3614 (_this.el).style.backgroundImage = 'url("'+_this.src+'")'; 3615 } 3616 } 3617 if ( !classie.hasClass( _this.el, 'box-wrapper') ) { 3618 parentNode.removeChild(placeH); 3619 } 3620 classie.addClass(_this.el, 'async-done'); 3621 _this.el.dispatchEvent(new CustomEvent("async-done")); 3622 }, 250); 3623 } 3624 } 3625 replaceImg.src = val.url; 3626 } 3627 3628 if (processedImageisNew && SiteParameters.optimize_shortpixel_image == true) { 3629 UNCODE.process_shortpixel_image(processedImageID); 3630 } 3631 } 3632 3633 } else { 3634 if (SiteParameters.enable_debug == true) { 3635 // This console log is disabled by default 3636 // So nothing is printed in a typical installation 3637 // 3638 // It can be enabled for debugging purposes setting 3639 // the 'uncode_enable_debug_on_js_scripts' filter to true 3640 console.log('There was an error: bad response'); 3641 } 3642 } 3643 3644 } else if (xhr.status == 400) { 3645 if (SiteParameters.enable_debug == true) { 3646 // This console log is disabled by default 3647 // So nothing is printed in a typical installation 3648 // 3649 // It can be enabled for debugging purposes setting 3650 // the 'uncode_enable_debug_on_js_scripts' filter to true 3651 console.log('There was an error 400'); 3652 } 3653 } else { 3654 if (SiteParameters.enable_debug == true) { 3655 // This console log is disabled by default 3656 // So nothing is printed in a typical installation 3657 // 3658 // It can be enabled for debugging purposes setting 3659 // the 'uncode_enable_debug_on_js_scripts' filter to true 3660 console.log('Something else other than 200 was returned'); 3661 } 3662 } 3663 } 3664 } 3665 3666 // Serialize our data 3667 var queryString = "", 3668 arrayLength = Object.keys(post_data).length, 3669 arrayCounter = 0; 3670 3671 for (var key in post_data) { 3672 queryString += key + "=" + post_data[key]; 3673 3674 if (arrayCounter < arrayLength - 1) { 3675 queryString += "&"; 3676 } 3677 3678 arrayCounter++; 3679 } 3680 3681 xhr.send(queryString); 3682 } 3683 }; 3684 3685 UNCODE.adaptive_srcset_replace_bg = function(currentRow) { 3686 if (currentRow === null) { 3687 return; 3688 } 3689
3690 var mobileBreakpoint = SiteParameters.dynamic_srcset_bg_mobile_breakpoint ? parseInt(SiteParameters.dynamic_srcset_bg_mobile_breakpoint, 10) : 570; 3691 var images = currentRow.querySelectorAll('.srcset-bg-async'); 3692 3693 for (var i = 0; i < images.length; i++) { 3694 var el = images[i]; 3695 var bg_url = el.dataset.backgroundImage; 3696 var mobile_bg_url = el.dataset.mobileBackgroundImage; 3697 3698 if (SiteParameters.activate_webp && el.dataset.backgroundImageWebp) { 3699 if ((el.dataset.mime === 'png' && UNCODE.webp_lossless_supported) || (el.dataset.mime === 'jpeg' && UNCODE.webp_lossy_supported)) { 3700 bg_url = el.dataset.backgroundImageWebp; 3701 el.dataset.backgroundImage = bg_url; 3702 el.removeAttribute('data-background-image-webp'); 3703 } 3704 } 3705 3706 if (SiteParameters.activate_webp && el.dataset.mobileBackgroundImageWebp && mobile_bg_url) { 3707 if ((el.dataset.mime === 'png' && UNCODE.webp_lossless_supported) || (el.dataset.mime === 'jpeg' && UNCODE.webp_lossy_supported)) { 3708 mobile_bg_url = el.dataset.mobileBackgroundImageWebp; 3709 el.dataset.mobileBackgroundImage = mobile_bg_url; 3710 el.removeAttribute('data-mobile-background-image-webp'); 3711 } 3712 } 3713 3714 if (screenInfo.width <= mobileBreakpoint && mobile_bg_url) { 3715 el.style.backgroundImage = 'url("' + mobile_bg_url + '")'; 3716 } else { 3717 el.style.backgroundImage = 'url("' + bg_url + '")'; 3718 } 3719 3720 classie.addClass(el, 'srcset-bg-async'); 3721 } 3722 } 3723 3724 UNCODE.adaptive_srcset_bg = function() { 3725 var mobileSize = SiteParameters.dynamic_srcset_bg_mobile_size ? parseInt(SiteParameters.dynamic_srcset_bg_mobile_size, 10) : false; 3726 3727 if (!(mobileSize > 0)) { 3728 return; 3729 } 3730 3731 var images = new Array(); 3732 var getImages = document.querySelectorAll('.srcset-bg-generate-img:not(.adaptive-fetching)'); 3733 3734 for (var i = 0; i < getImages.length; i++) { 3735 var imageObj = {}; 3736 var el = getImages[i]; 3737 3738 classie.addClass(el, 'srcset-bg-fetching'); 3739 imageObj.unique = el.getAttribute('data-uniqueid'); 3740 imageObj.url = el.getAttribute('data-guid'); 3741 imageObj.path = el.getAttribute('data-path'); 3742 imageObj.origwidth = el.getAttribute('data-width'); 3743 imageObj.origheight = el.getAttribute('data-height'); 3744 3745 images.push(imageObj); 3746 } 3747 3748 if (images.length > 0) { 3749 var post_data = { 3750 images: JSON.stringify(images), 3751 action: 'regenerate_srcset_bg_async', 3752 resize_quality: SiteParameters.resize_quality, 3753 mobile_size: mobileSize, 3754 nonce_srcset_async: SiteParameters.nonce_srcset_async 3755 }; 3756 3757 var xhr = new XMLHttpRequest(); 3758 xhr.open('POST', SiteParameters.ajax_url, true); 3759 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 3760 xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 3761 3762 xhr.onreadystatechange = function() { 3763 if (xhr.readyState == XMLHttpRequest.DONE) { 3764 if (xhr.status == 200 && xhr.responseText) { 3765 var jsonResponse = JSON.parse(xhr.responseText); 3766 3767 if (jsonResponse.success && jsonResponse.data.images) { 3768 var processedImages = jsonResponse.data.images; 3769 3770 for (var i = 0; i < processedImages.length; i++) { 3771 var processedImageID = processedImages[i].id; 3772 var processedImageUniqueID = processedImages[i].unique; 3773 var processedImageisNew = processedImages[i].new_crop === true ? true : false; 3774 var getImage = document.querySelectorAll('[data-uniqueid="'+processedImageUniqueID+'"]'); 3775 3776 for (var j = 0; j < getImage.length; j++) { 3777 classie.removeClass(getImage[j], 'srcset-bg-fetching'); 3778 classie.addClass(getImage[j], 'srcset-bg-async-done'); 3779 getImage[j].dispatchEvent(new CustomEvent("async-done")); 3780 } 3781 3782 if (processedImageisNew && SiteParameters.optimize_shortpixel_image == true) { 3783 UNCODE.process_shortpixel_image(processedImageID); 3784 } 3785 } 3786 } else { 3787 if (SiteParameters.enable_debug == true) { 3788 // This console log is disabled by default 3789 // So nothing is printed in a typical installation 3790 // 3791 // It can be enabled for debugging purposes setting 3792 // the 'uncode_enable_debug_on_js_scripts' filter to true 3793 if (jsonResponse.success == false && jsonResponse.data.message) { 3794 console.log('There was an error: ' + jsonResponse.data.message); 3795 } else { 3796 console.log('There was an error: bad response'); 3797 } 3798 } 3799 } 3800 3801 } else if (xhr.status == 400) { 3802 if (SiteParameters.enable_debug == true) { 3803 // This console log is disabled by default 3804 // So nothing is printed in a typical installation 3805 // 3806 // It can be enabled for debugging purposes setting 3807 // the 'uncode_enable_debug_on_js_scripts' filter to true 3808 console.log('There was an error 400'); 3809 } 3810 } else { 3811 if (SiteParameters.enable_debug == true) { 3812 // This console log is disabled by default 3813 // So nothing is printed in a typical installation 3814 // 3815 // It can be enabled for debugging purposes setting 3816 // the 'uncode_enable_debug_on_js_scripts' filter to true 3817 console.log('Something else other than 200 was returned'); 3818 } 3819 } 3820 } 3821 } 3822 3823 // Serialize our data 3824 var queryString = "", 3825 arrayLength = Object.keys(post_data).length, 3826 arrayCounter = 0; 3827 3828 for (var key in post_data) { 3829 queryString += key + "=" + post_data[key]; 3830 3831 if (arrayCounter < arrayLength - 1) { 3832 queryString += "&"; 3833 } 3834 3835 arrayCounter++; 3836 } 3837 3838 xhr.send(queryString); 3839 } 3840 } 3841
3842 UNCODE.refresh_dynamic_srcset_size = function(container) { 3843 var parentSelector = container && container.length > 0 ? container[0] : document; 3844 // If 'container' is false, we assume that we are resizing generic images 3845 var images = container ? parentSelector.querySelectorAll('.srcset-auto') : parentSelector.querySelectorAll('.srcset-auto:not(.srcset-on-layout)'); 3846 3847 for (var i = 0; i < images.length; i++) { 3848 // Update srcset/sizes attributes 3849 UNCODE.set_dynamic_srcset_size(images[i]); 3850 } 3851 } 3852 3853 UNCODE.set_dynamic_srcset_size = function(el) { 3854 if (el.nodeName === 'PICTURE') { 3855 var picture_imgs = el.getElementsByTagName('img'); 3856 var picture_sources = el.getElementsByTagName('source'); 3857 if (picture_imgs.length > 0) { 3858 var picture_img = picture_imgs[0]; 3859 } 3860 if (picture_sources.length > 0 && picture_imgs.length > 0) { 3861 var picture_source = picture_sources[0]; 3862 var parent_width = el.clientWidth; 3863 var parent_height = el.clientHeight; 3864 var picture_img_width = parseInt(picture_img.getAttribute('width'), 10); 3865 var picture_img_height = parseInt(picture_img.getAttribute('height'), 10); 3866 var final_width = (picture_img_width * parent_height) / picture_img_height; 3867 picture_source.sizes = final_width + 'px'; 3868 classie.addClass(picture_source, 'srcset-sizes-done'); 3869 if (picture_source.dataset.srcset) { 3870 if (SiteParameters.activate_webp && picture_source.dataset.srcsetWebp && ((el.dataset.mime === 'png' && UNCODE.webp_lossless_supported) || (el.dataset.mime === 'jpeg' && UNCODE.webp_lossy_supported))) { 3871 picture_source.srcset = picture_source.dataset.srcsetWebp; 3872 picture_source.removeAttribute('data-srcset-webp'); 3873 } else { 3874 picture_source.srcset = picture_source.dataset.srcset; 3875 } 3876 picture_source.removeAttribute('data-srcset'); 3877 var $waitingThumb = getClosest( picture_source, 'srcset-lazy-animations'); 3878 if ( $waitingThumb != null ) { 3879 picture_img.onload = function(){ 3880 classie.removeClass( $waitingThumb, 'srcset-lazy-animations'); 3881 }; 3882 } 3883 } 3884 } 3885 if (picture_sources.length > 0 || picture_imgs.length > 0) { 3886 el.dispatchEvent(new CustomEvent("srcset-done")); 3887 } 3888 } else { 3889 if (typeof el.parentNode !== 'undefined') { 3890 if ( classie.hasClass(el.parentNode, 't-entry-drop') ) { 3891 var parent_width = el.parentNode.getAttribute('data-w'); 3892 if ( typeof parent_width !== 'undefined' && parent_width !== null ) {
3893 parent_width = UNCODE.wwidth / 12 * parseFloat( parent_width ); 3894 } 3895 } else { 3896 var parent_width = el.parentNode.parentElement.clientWidth; 3897 } 3898 el.sizes = parent_width + 'px'; 3899 classie.addClass(el, 'srcset-sizes-done'); 3900 if (el.dataset.srcset) { 3901 if (SiteParameters.activate_webp && el.dataset.srcsetWebp && ((el.dataset.mime === 'png' && UNCODE.webp_lossless_supported) || (el.dataset.mime === 'jpeg' && UNCODE.webp_lossy_supported))) { 3902 el.srcset = el.dataset.srcsetWebp; 3903 el.removeAttribute('data-srcset-webp'); 3904 } else { 3905 el.srcset = el.dataset.srcset; 3906 } 3907 el.removeAttribute('data-srcset'); 3908 var $waitingThumb = getClosest( el, 'srcset-lazy-animations'); 3909 if ( $waitingThumb != null ) { 3910 el.onload = function(){ 3911 classie.removeClass( $waitingThumb, 'srcset-lazy-animations'); 3912 }; 3913 } 3914 } 3915 el.dispatchEvent(new CustomEvent("srcset-done")); 3916 } 3917 } 3918 }; 3919 3920 UNCODE.adaptive_srcset = function(container) { 3921 var images = new Array(); 3922 var parentSelector = container ? container[0] : document; 3923 // If 'container' is false, we assume that this is a call on window load 3924 var isLoadingResize = container ? false : true; 3925 var getImages = parentSelector.querySelectorAll('.srcset-async:not(.srcset-fetching)'); 3926 var limit = SiteParameters.dynamic_srcset_bunch_limit ? parseInt(SiteParameters.dynamic_srcset_bunch_limit, 10) : 1; 3927 3928 for (var i = 0; i < getImages.length; i++) { 3929 var imageObj = {}; 3930 var el = getImages[i]; 3931 var missing_breakpoints = el.getAttribute('data-no-bp'); 3932 3933 if (isLoadingResize) { 3934 // Update srcset/sizes attributes 3935 // But skip images that are processed on other events 3936 // (isotope.onLayout for example) to avoid double calls 3937 if (!classie.hasClass(el, 'srcset-on-layout')) { 3938 UNCODE.set_dynamic_srcset_size(el); 3939 } 3940 } 3941 3942 if (missing_breakpoints) { 3943 classie.addClass(el, 'srcset-fetching'); 3944 imageObj.unique = el.getAttribute('data-uniqueid'); 3945 imageObj.url = el.getAttribute('data-guid'); 3946 imageObj.path = el.getAttribute('data-path'); 3947 imageObj.singlew = el.getAttribute('data-singlew'); 3948 imageObj.singleh = el.getAttribute('data-singleh'); 3949 imageObj.origwidth = el.getAttribute('data-width'); 3950 imageObj.origheight = el.getAttribute('data-height'); 3951 imageObj.crop = el.getAttribute('data-crop'); 3952 imageObj.fixed = el.getAttribute('data-fixed') == undefined ? null : el.getAttribute('data-fixed'); 3953 imageObj.missingbp = missing_breakpoints; 3954 3955 images.push(imageObj); 3956 } else { 3957 classie.removeClass(el, 'srcset-async'); 3958 } 3959 } 3960 3961 while (images.length > 0) { 3962 if (images.length >= limit) { 3963 var bunch_images = new Array(); 3964 for (var i = limit - 1; i >= 0; i--) { 3965 bunch_images.push(images[i]); 3966 images.splice(i, 1); 3967 } 3968 UNCODE.adaptive_srcset_async(parentSelector, bunch_images); 3969 } else { 3970 UNCODE.adaptive_srcset_async(parentSelector, images); 3971 break; 3972 } 3973 } 3974 }; 3975 3976 UNCODE.adaptive_srcset_async = function(parentSelector, images) { 3977 var post_data = { 3978 images: JSON.stringify(images), 3979 action: 'regenerate_srcset_async', 3980 resize_quality: SiteParameters.resize_quality, 3981 nonce_srcset_async: SiteParameters.nonce_srcset_async 3982 }; 3983 3984 var xhr = new XMLHttpRequest(); 3985 xhr.open('POST', SiteParameters.ajax_url, true); 3986 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 3987 xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 3988 3989 xhr.onreadystatechange = function() { 3990 if (xhr.readyState == XMLHttpRequest.DONE) { 3991 if (xhr.status == 200 && xhr.responseText) { 3992 var jsonResponse = JSON.parse(xhr.responseText); 3993 3994 if (jsonResponse.success && jsonResponse.data.images) { 3995 var processedImages = jsonResponse.data.images; 3996 3997 for (var i = 0; i < processedImages.length; i++) { 3998 var processedImageID = processedImages[i].id; 3999 var processedImageUniqueID = processedImages[i].unique; 4000 var processedImageisNew = processedImages[i].new_crop === true ? true : false; 4001 var getImage = parentSelector.querySelectorAll('[data-uniqueid="'+processedImageUniqueID+'"]'); 4002 4003 for (var j = 0; j < getImage.length; j++) { 4004 classie.removeClass(getImage[j], 'srcset-async'); 4005 classie.removeClass(getImage[j], 'srcset-fetching'); 4006 classie.addClass(getImage[j], 'srcset-async-done'); 4007 getImage[j].dispatchEvent(new CustomEvent("async-done")); 4008 } 4009 4010 if (processedImageisNew && SiteParameters.optimize_shortpixel_image == true) { 4011 UNCODE.process_shortpixel_image(processedImageID); 4012 } 4013 } 4014 } else { 4015 if (SiteParameters.enable_debug == true) { 4016 // This console log is disabled by default 4017 // So nothing is printed in a typical installation 4018 // 4019 // It can be enabled for debugging purposes setting 4020 // the 'uncode_enable_debug_on_js_scripts' filter to true 4021 if (jsonResponse.success == false && jsonResponse.data.message) { 4022 console.log('There was an error: ' + jsonResponse.data.message); 4023 } else { 4024 console.log('There was an error: bad response'); 4025 } 4026 } 4027 } 4028 4029 } else if (xhr.status == 400) { 4030 if (SiteParameters.enable_debug == true) { 4031 // This console log is disabled by default 4032 // So nothing is printed in a typical installation 4033 // 4034 // It can be enabled for debugging purposes setting 4035 // the 'uncode_enable_debug_on_js_scripts' filter to true 4036 console.log('There was an error 400'); 4037 } 4038 } else { 4039 if (SiteParameters.enable_debug == true) { 4040 // This console log is disabled by default 4041 // So nothing is printed in a typical installation 4042 // 4043 // It can be enabled for debugging purposes setting 4044 // the 'uncode_enable_debug_on_js_scripts' filter to true 4045 console.log('Something else other than 200 was returned'); 4046 } 4047 } 4048 } 4049 } 4050 4051 // Serialize our data 4052 var queryString = "", 4053 arrayLength = Object.keys(post_data).length, 4054 arrayCounter = 0; 4055 4056 for (var key in post_data) { 4057 queryString += key + "=" + post_data[key]; 4058
4059 if (arrayCounter < arrayLength - 1) { 4060 queryString += "&"; 4061 } 4062 4063 arrayCounter++; 4064 } 4065 4066 xhr.send(queryString); 4067 }; 4068 4069})(window); 4070 4071(function(global){var startY=0;var enabled=false;var supportsPassiveOption=false;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassiveOption=true}});window.addEventListener("test",null,opts)}catch(e){}var handleTouchmove=function(evt){var el=evt.target;while(el!==document.body&&el!==document){var style=window.getComputedStyle(el);if(!style){break}if(el.nodeName==="INPUT"&&el.getAttribute("type")==="range"){return}var scrolling=style.getPropertyValue("-webkit-overflow-scrolling");var overflowY=style.getPropertyValue("overflow-y");var height=parseInt(style.getPropertyValue("height"),10);var isScrollable=scrolling==="touch"&&(overflowY==="auto"||overflowY==="scroll");var canScroll=el.scrollHeight>el.offsetHeight;if(isScrollable&&canScroll){var curY=evt.touches?evt.touches[0].screenY:evt.screenY;var isAtTop=startY<=curY&&el.scrollTop===0;var isAtBottom=startY>=curY&&el.scrollHeight-el.scrollTop===height;if(isAtTop||isAtBottom){evt.preventDefault()}return}el=el.parentNode}evt.preventDefault()};var handleTouchstart=function(evt){startY=evt.touches?evt.touches[0].screenY:evt.screenY};var enable=function(){window.addEventListener("touchstart",handleTouchstart,supportsPassiveOption?{passive:false}:false);window.addEventListener("touchmove",handleTouchmove,supportsPassiveOption?{passive:false}:false);enabled=true};var disable=function(){window.removeEventListener("touchstart",handleTouchstart,false);window.removeEventListener("touchmove",handleTouchmove,false);enabled=false};var isEnabled=function(){return enabled};var testDiv=document.createElement("div");document.documentElement.appendChild(testDiv);testDiv.style.WebkitOverflowScrolling="touch";var scrollSupport="getComputedStyle"in window&&window.getComputedStyle(testDiv)["-webkit-overflow-scrolling"]==="touch";document.documentElement.removeChild(testDiv);if(scrollSupport){enable()}var iNoBounce={enable:enable,disable:disable,isEnabled:isEnabled};if(typeof module!=="undefined"&&module.exports){module.exports=iNoBounce}if(typeof global.define==="function"){(function(define){define("iNoBounce",[],function(){return iNoBounce})})(global.define)}else{global.iNoBounce=iNoBounce}})(this); 4072iNoBounce.disable(); 4073 4074/* Font Face Observer v2.1.0 - © Bram Stein. License: BSD-3-Clause */(function(){'use strict';var f,g=[];function l(a){g.push(a);1==g.length&&f()}function m(){for(;g.length;)g[0](),g.shift()}f=function(){setTimeout(m)};function n(a){this.a=p;this.b=void 0;this.f=[];var b=this;try{a(function(a){q(b,a)},function(a){r(b,a)})}catch(c){r(b,c)}}var p=2;function t(a){return new n(function(b,c){c(a)})}function u(a){return new n(function(b){b(a)})}function q(a,b){if(a.a==p){if(b==a)throw new TypeError;var c=!1;try{var d=b&&b.then;if(null!=b&&"object"==typeof b&&"function"==typeof d){d.call(b,function(b){c||q(a,b);c=!0},function(b){c||r(a,b);c=!0});return}}catch(e){c||r(a,e);return}a.a=0;a.b=b;v(a)}} 4075function r(a,b){if(a.a==p){if(b==a)throw new TypeError;a.a=1;a.b=b;v(a)}}function v(a){l(function(){if(a.a!=p)for(;a.f.length;){var b=a.f.shift(),c=b[0],d=b[1],e=b[2],b=b[3];try{0==a.a?"function"==typeof c?e(c.call(void 0,a.b)):e(a.b):1==a.a&&("function"==typeof d?e(d.call(void 0,a.b)):b(a.b))}catch(h){b(h)}}})}n.prototype.g=function(a){return this.c(void 0,a)};n.prototype.c=function(a,b){var c=this;return new n(function(d,e){c.f.push([a,b,d,e]);v(c)})}; 4076function w(a){return new n(function(b,c){function d(c){return function(d){h[c]=d;e+=1;e==a.length&&b(h)}}var e=0,h=[];0==a.length&&b(h);for(var k=0;k<a.length;k+=1)u(a[k]).c(d(k),c)})}function x(a){return new n(function(b,c){for(var d=0;d<a.length;d+=1)u(a[d]).c(b,c)})};window.Promise||(window.Promise=n,window.Promise.resolve=u,window.Promise.reject=t,window.Promise.race=x,window.Promise.all=w,window.Promise.prototype.then=n.prototype.c,window.Promise.prototype["catch"]=n.prototype.g);}()); 4077 4078(function(){function l(a,b){document.addEventListener?a.addEventListener("scroll",b,!1):a.attachEvent("scroll",b)}function m(a){document.body?a():document.addEventListener?document.addEventListener("DOMContentLoaded",function c(){document.removeEventListener("DOMContentLoaded",c);a()}):document.attachEvent("onreadystatechange",function k(){if("interactive"==document.readyState||"complete"==document.readyState)document.detachEvent("onreadystatechange",k),a()})};function t(a){this.a=document.createElement("div");this.a.setAttribute("aria-hidden","true");this.a.appendChild(document.createTextNode(a));this.b=document.createElement("span");this.c=document.createElement("span");this.h=document.createElement("span");this.f=document.createElement("span");this.g=-1;this.b.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;";this.c.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;"; 4079this.f.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;";this.h.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;";this.b.appendChild(this.h);this.c.appendChild(this.f);this.a.appendChild(this.b);this.a.appendChild(this.c)} 4080function u(a,b){a.a.style.cssText="max-width:none;min-width:20px;min-height:20px;
4080display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+b+";"}function z(a){var b=a.a.offsetWidth,c=b+100;a.f.style.width=c+"px";a.c.scrollLeft=c;a.b.scrollLeft=a.b.scrollWidth+100;return a.g!==b?(a.g=b,!0):!1}function A(a,b){function c(){var a=k;z(a)&&a.a.parentNode&&b(a.g)}var k=a;l(a.b,c);l(a.c,c);z(a)};function B(a,b){var c=b||{};this.family=a;this.style=c.style||"normal";this.weight=c.weight||"normal";this.stretch=c.stretch||"normal"}var C=null,D=null,E=null,F=null;function G(){if(null===D)if(J()&&/Apple/.test(window.navigator.vendor)){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent);D=!!a&&603>parseInt(a[1],10)}else D=!1;return D}function J(){null===F&&(F=!!document.fonts);return F} 4081function K(){if(null===E){var a=document.createElement("div");try{a.style.font="condensed 100px sans-serif"}catch(b){}E=""!==a.style.font}return E}function L(a,b){return[a.style,a.weight,K()?a.stretch:"","100px",b].join(" ")} 4082B.prototype.load=function(a,b){var c=this,k=a||"BESbswy",r=0,n=b||3E3,H=(new Date).getTime();return new Promise(function(a,b){if(J()&&!G()){var M=new Promise(function(a,b){function e(){(new Date).getTime()-H>=n?b(Error(""+n+"ms timeout exceeded")):document.fonts.load(L(c,'"'+c.family+'"'),k).then(function(c){1<=c.length?a():setTimeout(e,25)},b)}e()}),N=new Promise(function(a,c){r=setTimeout(function(){c(Error(""+n+"ms timeout exceeded"))},n)});Promise.race([N,M]).then(function(){clearTimeout(r);a(c)}, 4083b)}else m(function(){function v(){var b;if(b=-1!=f&&-1!=g||-1!=f&&-1!=h||-1!=g&&-1!=h)(b=f!=g&&f!=h&&g!=h)||(null===C&&(b=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),C=!!b&&(536>parseInt(b[1],10)||536===parseInt(b[1],10)&&11>=parseInt(b[2],10))),b=C&&(f==w&&g==w&&h==w||f==x&&g==x&&h==x||f==y&&g==y&&h==y)),b=!b;b&&(d.parentNode&&d.parentNode.removeChild(d),clearTimeout(r),a(c))}function I(){if((new Date).getTime()-H>=n)d.parentNode&&d.parentNode.removeChild(d),b(Error(""+ 4084n+"ms timeout exceeded"));else{var a=document.hidden;if(!0===a||void 0===a)f=e.a.offsetWidth,g=p.a.offsetWidth,h=q.a.offsetWidth,v();r=setTimeout(I,50)}}var e=new t(k),p=new t(k),q=new t(k),f=-1,g=-1,h=-1,w=-1,x=-1,y=-1,d=document.createElement("div");d.dir="ltr";u(e,L(c,"sans-serif"));u(p,L(c,"serif"));u(q,L(c,"monospace"));d.appendChild(e.a);d.appendChild(p.a);d.appendChild(q.a);document.body.appendChild(d);w=e.a.offsetWidth;x=p.a.offsetWidth;y=q.a.offsetWidth;I();A(e,function(a){f=a;v()});u(e, 4085L(c,'"'+c.family+'",sans-serif'));A(p,function(a){g=a;v()});u(p,L(c,'"'+c.family+'",serif'));A(q,function(a){h=a;v()});u(q,L(c,'"'+c.family+'",monospace'))})})};"object"===typeof module?module.exports=B:(window.FontFaceObserver=B,window.FontFaceObserver.prototype.load=B.prototype.load);}());
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.