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 17 window.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 28 window.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 50 window.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 62 var 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 } 158 var 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 } 204 var 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 223 function 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 276 var css_browser_selector_ns = css_browser_selector_ns || ""; 277 // init 278 css_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 311 try { 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 333 Array.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 }); 344 var 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 */ 476 function 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 } 491 function 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')) isMobileTrans
656parent = 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 if ($mainHeader != null) { 730 mainHeader = $mainHeader.innerHTML; 731 $mainWrapper = document.querySelector('.main-wrapper'); 732 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')))) { 733 if (wwidth <= mediaQuery) { 734 $initBox.parentNode.insertBefore($mainHeader, $initBox.nextSibling); 735 } else { 736 $mainWrapper.parentNode.insertBefore($mainHeader, $mainWrapper.nextSibling); 737 } 738 $mainHeader.removeChild; 739 } 740 window.dispatchEvent(new Event('lateral_resize')); 741 } 742 }; 743 vRightMenu(); 744 window.addEventListener("resize", function () { 745 if (wwidth != vRightMenuw) { 746 clearRequestTimeout(setVrightMenu); 747 setVrightMenu = requestTimeout(function () { 748 vRightMenuw = wwidth; 749 vRightMenu(); 750 }, 100); 751 } 752 }); 753 }, 754 calculateMenuHeight = function (first) { 755 menuHeight = transmenuHeight = secmenuHeight = 0; 756 757 if (mastheadMobile != null) { 758 if (mastheadMobile.length === 2) { 759 if (wwidth > mediaQuery) { 760 UNCODE.menuMobileHeight = outerHeight(mastheadMobile[1]); 761 mastheadMobilePaddingTop = parseFloat(getComputedStyle(mastheadMobile[1]).paddingTop); 762 } else { 763 UNCODE.menuMobileHeight = outerHeight(mastheadMobile[0]); 764 mastheadMobilePaddingTop = parseFloat(getComputedStyle(mastheadMobile[0]).paddingTop); 765 } 766 } else { 767 UNCODE.menuMobileHeight = outerHeight(mastheadMobile); 768 mastheadMobilePaddingTop = parseFloat(getComputedStyle(mastheadMobile).paddingTop); 769 } 770 } 771 772 secmenu = document.querySelectorAll('.menu-secondary:not(.menu-primary)'); 773 if (wwidth > mediaQuery) { 774 for (var i = 0; i < mainmenu.length; i++) { 775 if (classie.hasClass(document.body, 'hmenu-center') && i === 1) continue; 776 if (!classie.hasClass(masthead, 'masthead-vertical')) { 777 menuHeight = menuHeight + outerHeight(mainmenu[i]); 778 if (classie.hasClass(document.body, 'hmenu-center') && document.getElementById("logo-container-mobile") != null) { 779 menuHeight = menuHeight + outerHeight(document.getElementById("logo-container-mobile")); 780 } 781 } else menuHeight = 0; 782 783 if (isIE && first) { 784 getDivChildren(mainmenu[i], '.menu-horizontal-inner', function (innerMenu, i) { 785 innerMenu.style.height = menuHeight + 'px'; 786 }); 787 } 788 789 if (classie.hasClass(mainmenu[i].parentNode, 'menu-transparent')) { 790 transmenuHeight += menuHeight; 791 } 792 } 793 794 for (var j = 0; j < secmenu.length; j++) {
795 secmenuHeight += outerHeight(secmenu[j]); 796 } 797 menuHeight += secmenuHeight; 798 } else { 799 menuHeight = UNCODE.menuMobileHeight; 800 if (isMobileTransparent) { 801 for (var i = 0; i < mainmenu.length; i++) { 802 if (classie.hasClass(mainmenu[i].parentNode, 'menu-transparent')) { 803 transmenuHeight += menuHeight; 804 } 805 } 806 } 807 var search_box = document.querySelectorAll('.search-icon .drop-menu'); 808 for (var i = 0; i < search_box.length; i++) { 809 search_box[i].removeAttribute('style'); 810 } 811 812 for (var j = 0; j < secmenu.length; j++) { 813 secmenuHeight += outerHeight(secmenu[j]); 814 } 815 menuHeight += secmenuHeight; 816 } 817 818 819 if (classie.hasClass(document.documentElement, 'admin-mode')) { 820 adminBar = document.getElementById("wpadminbar"); 821 if (wwidth > 600) { 822 if (adminBar != null) adminBarHeight = outerHeight(adminBar); 823 else { 824 if (wwidth > 782) adminBarHeight = 32; 825 else adminBarHeight = 46; 826 } 827 } else adminBarHeight = 0; 828 } 829 UNCODE.adminBarHeight = adminBarHeight; 830 UNCODE.menuHeight = menuHeight; 831 832 if (UNCODE.isFullPage && !UNCODE.isFrontEndEditor) { 833 if (UNCODE.adminBarHeight > 0) 834 document.body.style.marginTop = ((UNCODE.adminBarHeight + UNCODE.bodyBorder) * -1) + 'px'; 835 836 document.body.style.paddingTop = (UNCODE.adminBarHeight + UNCODE.bodyBorder) + 'px'; 837 } else { 838 document.body.style.marginTop = 0; 839 document.body.style.paddingTop = 0; 840 } 841 842 if (masthead != undefined) { 843 //masthead.parentNode.style.height = menuHeight + 'px'; 844 if (classie.hasClass(masthead, 'menu-transparent')) { 845 if (wwidth > mediaQuery) masthead.parentNode.style.height = '0px'; 846 } 847 } 848 849 if (typeof menuhide == 'object' && menuhide != null && mainmenu[0] != undefined) { 850 var sticky_element = (typeof mainmenu.item === 'undefined' ? ((wwidth > mediaQuery) ? mainmenu[0] : mainmenu[1]) : mainmenu[0]); 851 if (sticky_element.style.top != '') { 852 sticky_element.style.top = UNCODE.bodyBorder + 'px' 853 } 854 } 855 856 }, 857 centerSplitMenu = function () { 858 if (typeof mainNavMenu !== 'undefined' && mainNavMenu !== null) { 859 if (wwidth > mediaQuery && mainNavMenu) { 860 if (mainNavMenu.style.left == '') { 861 mainNavMenu.style.left = '0px'; 862 var logoPos = logo.parentNode.getBoundingClientRect(); 863 mainNavMenu.style.left = (wwidth / 2) - (logoPos.left + (logoPos.width / 2)) + 'px'; 864 mainNavWrapper.style.opacity = '1'; 865 } 866 mainNavWrapper.style.opacity = '1'; 867 } else { 868 mainNavMenu.style.left = ''; 869 } 870 } 871 }, 872 initHeader = function () { 873 pageHeader = document.getElementById("page-header"); 874 if (SiteParameters.dynamic_srcset_active === '1') { 875 UNCODE.adaptive_srcset_replace_bg(pageHeader); 876 } 877 UNCODE.adaptive(); 878 879 parallaxHeaders = document.querySelectorAll('.header-parallax > .header-bg-wrapper'); 880 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'); 881 headerWithOpacity = document.querySelectorAll('.header-scroll-opacity'); 882 if (typeof pageHeader === 'object' && pageHeader !== null) { 883 headerVideo = pageHeader.querySelectorAll('.uncode-video-container:not(.t-entry-drop)'); 884 kenburnsHeaders = pageHeader.querySelectorAll('.with-kburns > .header-bg-wrapper'); 885 backwashHeaders = pageHeader.querySelectorAll('.with-zoomout > .header-bg-wrapper'); 886 if (headerVideo.length) { 887 classie.addClass(pageHeader, 'has-video'); 888 } 889 } 890 if (pageHeader != undefined) { 891 var backs = pageHeader.querySelectorAll('.header-bg'), 892 backsCarousel = pageHeader.querySelectorAll('.header-uncode-block .background-inner'), 893 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; 894 if (backs.length == 0 && backsCarousel.length == 0) { 895 pageHeader.setAttribute('data-imgready', 'true'); 896 } else { 897 if (backsCarousel.length) { 898 for (var j = 0; j < backsCarousel.length; j++) { 899 if (j == 0) { 900 if (classie.hasClass(backsCarousel[j], 'lazyload')) { 901 pageHeader.setAttribute('data-imgready', 'true'); 902 } 903 904 if (!!backsCarousel[j].style.backgroundImage && backsCarousel[j].style.backgroundImage !== void 0) { 905 var url = (backsCarousel[j].style.backgroundImage).match(uri_pattern), 906 image = new Image(); 907 if (url === null) { 908 url = (backsCarousel[j].style.backgroundImage).slice(4, -1).replace(/"/g, ""); 909 } 910 image.onload = function () { 911 pageHeader.setAttribute('data-imgready', 'true'); 912 }; 913 image.src = url[0]; 914 } else { 915 pageHeader.setAttribute('data-imgready', 'true'); 916 } 917 } 918 } 919 } else { 920 for (var i = 0; i < backs.length; i++) { 921 if (i == 0) { 922 if (classie.hasClass(backs[i], 'lazyload')) { 923 pageHeader.setAttribute('data-imgready', 'true'); 924 } 925 926 if (!!backs[i].style.backgroundImage && backs[i].style.backgroundImage !== void 0) { 927 var url = (backs[i].style.backgroundImage).match(uri_pattern), 928 image = new Image(); 929 if (url === null) { 930 url = (backs[i].style.backgroundImage).slice(4, -1).replace(/"/g, ""); 931 } 932 image.onload = function () { 933 pageHeader.setAttribute('data-imgready', 'true'); 934 }; 935 image.src = url[0]; 936 } else { 937 pageHeader.setAttribute('data-imgready', 'true'); 938 } 939 } 940 } 941 } 942 } 943 } 944 945 if (masthead != undefined && !classie.hasClass(masthead, 'masthead-vert
945ical')) { 946 if (header.length) { 947 masthead.parentNode.style.height = (menuHeight - 1) + 'px'; 948 if (offcanvas_overlay_close != undefined) { 949 offcanvas_overlay_close.style.height = (menuHeight - 1) + 'px'; 950 offcanvas_overlay_close.style.lineHeight = (menuHeight - 5) + 'px'; 951 } 952 if (menuwrapper[0] != undefined) classie.addClass(menuwrapper[0], 'with-header'); 953 for (var j = 0; j < header.length; j++) { 954 var headerel = header[j], 955 closestStyle = getClosest(headerel, 'style-light'), 956 wcClosestStyle = getClosest(headerel, 'wc-parent-style-light'); 957 if (closestStyle != null && classie.hasClass(closestStyle, 'style-light')) { 958 switchColorsMenu(0, 'light'); 959 } else if (wcClosestStyle != null && classie.hasClass(wcClosestStyle, 'wc-parent-style-light')) { 960 switchColorsMenu(0, 'light'); 961 } else if (getClosest(headerel, 'style-dark') != null) { 962 switchColorsMenu(0, 'dark'); 963 } else if (getClosest(headerel, 'wc-parent-style-dark') != null) { 964 switchColorsMenu(0, 'dark'); 965 } else { 966 if (masthead.style.opacity !== 1) masthead.style.opacity = 1; 967 } 968 if (classie.hasClass(masthead, 'menu-transparent')) { 969 if (isMobileTransparent || wwidth > mediaQuery) { 970 masthead.parentNode.style.height = '0px'; 971 if (classie.hasClass(masthead, 'menu-add-padding')) { 972 var headerBlock = getClosest(headerel, 'header-uncode-block'); 973 if (headerBlock != null) { 974 var parentRow = headerBlock.querySelector('.vc_row'); 975 if (parentRow != null) { 976 var innerRows = parentRow.querySelectorAll('.column_parent > .uncol > .uncoltable > .uncell > .uncont, .uncode-slider .column_child > .uncol > .uncoltable > .uncell > .uncont'); 977 for (var k = 0; k < innerRows.length; k++) { 978 if (innerRows[k] != undefined) { 979 if (wwidth > mediaQuery) innerRows[k].style.paddingTop = transmenuHeight + 'px'; 980 else innerRows[k].style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px'; 981 } 982 } 983 } 984 } else { 985 getDivChildren(headerel, '.header-content', function (headerContent, i) { 986 if (wwidth > mediaQuery) headerContent.style.paddingTop = transmenuHeight + 'px'; 987 else headerContent.style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px'; 988 }); 989 } 990 } 991 } 992 } 993 if (classie.hasClass(headerel, 'uncoltable')) { 994 break; 995 } 996 } 997 } else { 998 if (menuwrapper[0] != undefined) classie.addClass(menuwrapper[0], 'no-header'); 999 classie.removeClass(masthead, 'menu-transparent'); 1000 transmenuHeight = 0; 1001 isMobileTransparent = false; 1002 } 1003 } else { 1004 isMobileTransparent = false; 1005 } 1006 if (typeof transmenuel === 'undefined' || !transmenuel.length) isMobileTransparent = false; 1007 bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop']; 1008 UNCODE.bodyTop = bodyTop; 1009 headerHeight('.header-wrapper'); 1010 if (!classie.hasClass(document.body, 'vmenu')) 1011 initBox(); 1012 scrollFunction(); 1013 showHideScrollup(bodyTop); 1014 1015 if (UNCODE.isMobile) { 1016 1017 var eventName = 'loadedmetadata'; 1018 eventName = eventName.replace(/^on/, ''); 1019 var elt = document.createElement('video'[eventName]); 1020 var eventIsSupported = ('on' + eventName in elt); 1021 elt = null; 1022 if (!eventIsSupported || (classie.hasClass(document.documentElement, 'firefox') && classie.hasClass(document.documentElement, 'android'))) { 1023 classie.addClass(document.body, 'video-not-supported'); 1024 } 1025 } 1026 1027 }, 1028 initRow = function (currentRow) { 1029 if (SiteParameters.dynamic_srcset_active === '1') { 1030 UNCODE.adaptive_srcset_replace_bg(currentRow); 1031 } 1032 UNCODE.adaptive(); 1033 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), 1034 rowParent = el.parentNode, 1035 rowInner = currentRow.parentNode, 1036 percentHeight = el.getAttribute("data-height-ratio"), 1037 minHeight = el.getAttribute("data-minheight"), 1038 calculateHeight, 1039 calculatePadding = 0, 1040 isHeader = false, 1041 isFirst = false, 1042 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; 1043 1044 /** Add class to the row when contains responsive column size */ 1045 getDivChildren(el.parentNode, '.column_parent, .column_child', function (obj, i, total) { 1046 if ((obj.className).indexOf("col-md-") > - 1) { 1047 classie.addClass(obj.parentNode, 'cols-md-responsive'); 1048 } 1049 obj.className = obj.className.replace(/vc_col-sm-(\d{1,2})/g, ""); 1050 if ((obj.className).indexOf("col-sm-") > - 1 && (obj.className).indexOf("col-sm-clear") == - 1) { 1051 classie.addClass(obj.parentNode, 'cols-sm-responsive'); 1052 } 1053 }); 1054 1055 setRowHeight(el); 1056 1057 var elements = 0; 1058 getDivChildren(el, '.row-internal .background-inner', function (obj, i, total) { 1059 elements++; 1060 if (i == 0) { 1061 if (!!obj.style.backgroundImage && obj.style.backgroundImage !== void 0) { 1062 var url = (obj.style.backgroundImage).match(uri_pattern), 1063 image = new Image(); 1064 if (url === null) { 1065 url = (obj.style.backgroundImage).slice(4, -1).replace(/"/g, ""); 1066 } 1067 image.onload = function () { 1068 el.setAttribute('data-imgready', 'true'); 1069 el.dispatchEvent(new CustomEvent('imgLoaded')); 1070 }; 1071 image.src = url[0]; 1072 } else { 1073 el.setAttribute('data-imgready', 'true'); 1074 el.dispatchEvent(new CustomEvent('imgLoaded')); 1075 } 1076 } 1077 }); 1078 if (elements == 0) { 1079 el.setAttribute('data-imgready', 'true'); 1080 } 1081 1082 // var $bgs = rowParent.querySelectorAll('.background-inner'); 1083 1084 // for (var i = 0; i < $bgs.length; i++) { 1085 // var $bg = $bgs[i]; 1086 // if ($bg.style.backgroundImage && $bg.style.backgroundImage !== '') { 1087 // var url = ($bg.style.backgroundImage).match(uri_pattern), 1088 // image = new Image(); 1089 // url = url[0]; 1090 // image.source = url; 1091 // image.el = $bg; 1092 // image.onload = function() { 1093 // var _this = this; 1094 // _this.el.setAttribute('data-imgloaded', 'true'); 1095 // }; 1096 // image.src = url; 1097 // } else { 1098 // $bg.setAttribute('data-imgloaded', 'true'); 1099 // } 1100 // } 1101 1102 /** init parallax is not mobile */ 1103 if (!UNCODE.isFullPage) { 1104 bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop']; 1105 kenburnsRows = el.parentNode.parentNode.querySelectorAll('.with-kburns > .row-background > .background-wrapper, .with-kburns > .uncode-multi-bgs > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 1106 kenburnsCols = el.querySelectorAll('.with-kburns > .column-background > .background-wrapper, .with-kburns > .uncode-multi-bgs > .column-background > .background-wrapper'); 1107 backwashRows = el.parentNode.parentNode.querySelectorAll('.with-zoomout > .row-background > .background-wrapper, .with-zoomout > .uncode-multi-bgs > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 1108 backwashCols = el.querySelectorAll('.with-zoomout > .column-background > .background-wrapper'); 1109 if (isMobileParallaxAllowed || !UNCODE.isMobile) {
1110 parallaxRows = el.parentNode.parentNode.querySelectorAll('.with-parallax > .row-background > .background-wrapper, .with-parallax > .uncode-multi-bgs > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 1111 parallaxCols = el.querySelectorAll('.with-parallax > .column-background > .background-wrapper, .with-parallax > .uncode-multi-bgs > .column-background > .background-wrapper'); 1112 visibleRows = el.parentNode.parentNode; 1113 parallaxRowCol(bodyTop); 1114 visibleRowCol(bodyTop); 1115 } else { 1116 if (UNCODE.isMobile) { 1117 kenburnsHeader(bodyTop); 1118 kenburnsRowCol(bodyTop); 1119 backwashHeader(bodyTop); 1120 backwashRowCol(bodyTop); 1121 } 1122 } 1123 } 1124 1125 shapeDivider(); 1126 1127 var wrapLinesWw = wwidth; 1128 1129 //Text animation, automatic lines and highlights 1130 var setWrap; 1131 1132 //Font style of grouped products 1133 function product_relative_font_style(el) { 1134 var $labels = el.querySelectorAll('.woocommerce-grouped-product-list-item__label, .woocommerce-grouped-product-list-item__price'); 1135 if ($labels.length) { 1136 var $main_price = el.querySelectorAll('.heading-text .woocommerce-Price-amount'); 1137 if ($main_price.length) { 1138 var $price_wrap = $main_price[0].closest('.heading-text'), 1139 $price_nest = $price_wrap.querySelector(':first-child'), 1140 font_class = $price_nest.getAttribute('class').split(' '), 1141 cli, labI; 1142 1143 for (labI = 0; labI < $labels.length; labI++) { 1144 for (cli = 0; cli < font_class.length; cli++) { 1145 if (font_class[cli].indexOf('font') !== -1 && font_class[cli].indexOf('fontsize') === -1) { 1146 classie.addClass($labels[labI], font_class[cli]); 1147 } 1148 } 1149 } 1150 1151 } 1152 } 1153 } 1154 product_relative_font_style(el) 1155 1156 function vc_row_full_width_size() { 1157 if (boxWidth != 0 && classie.hasClass(rowParent, 'vc_row-full-width')) { 1158 var vmenu = document.querySelector('.vmenu .vmenu-container'), 1159 vmenuW = 0; 1160 if (typeof vmenu == 'object' && vmenu != null && wwidth > mediaQuery) { 1161 vmenuW = vmenu.offsetWidth; 1162 } 1163 rowParent.style.maxWidth = (boxWidth - vmenuW) + 'px'; 1164 } 1165 } 1166 vc_row_full_width_size(); 1167 1168 window.addEventListener("resize", function () { 1169 vc_row_full_width_size(); 1170 }); 1171 1172 function heading_inline_images() { 1173 var $headings = currentRow.querySelectorAll('.heading-text'); 1174 for (var head_k = 0; head_k < $headings.length; head_k++) { 1175 var $heading = $headings[head_k], 1176 $imgs = $heading.querySelectorAll('.un-inline-image'); 1177 1178 for (var im = 0; im < $imgs.length; im++) { 1179 var $img = $imgs[im].querySelectorAll('img, video'), 1180 $span = $imgs[im].querySelectorAll('span'), 1181 ratio_att = $imgs[im].getAttribute('data-ratio'), 1182 // span_bound = $span[0].getBoundingClientRect(), 1183 // span_h = span_bound.height; 1184 span_h = $span[0].offsetHeight; 1185 1186 if (ratio_att != undefined) { 1187 var final_w = span_h * parseFloat(ratio_att); 1188 } else { 1189 if ($img.length) { 1190 // var img_bound = $img[0].getBoundingClientRect(), 1191 // img_w = img_bound.width, 1192 // img_h = img_bound.height, 1193 var img_w = $img[0].offsetWidth, 1194 img_h = $img[0].offsetHeight, 1195 img_r = img_w / img_h 1196 if (isNaN(img_r)) { 1197 img_w = parseFloat($img[0].getAttribute('width')); 1198 img_h = parseFloat($img[0].getAttribute('height')); 1199 img_r = img_w / img_h 1200 if (isNaN(img_r)) { 1201 img_r = 1; 1202 } 1203 } 1204 var final_w = span_h * img_r; 1205 $imgs[im].setAttribute('data-ratio', img_r); 1206 } 1207 } 1208 classie.addClass($imgs[im], 'inline-img-loaded'); 1209 $imgs[im].style.width = final_w + 'px'; 1210 } 1211 1212 if (span_h === 0 && $span[0].offsetParent !== null) { 1213 heading_inline_images(); 1214 } 1215 1216 } 1217 }; 1218 1219 heading_inline_images(); 1220 1221 1222 function word_for_lines(event, $parent_el) { 1223 1224 if (typeof $parent_el === 'undefined' || $parent_el === null) { 1225 $parent_el = document.body; 1226 } 1227 1228 var $headings = $parent_el.querySelectorAll('.heading-text'); 1229 1230 for (var head_k = 0; head_k < $headings.length; head_k++) { 1231 var $heading = $headings[head_k], 1232 heading_cont = $heading.innerHTML, 1233 $row = $heading.closest('.row-parent'), 1234 $owl_carousel = $heading.closest('.owl-carousel-wrapper'), 1235 $owl_item = $heading.closest('.owl-item'), 1236 $words = $heading.querySelectorAll('.split-word'); 1237 1238 if (!$words.length) { 1239 if ($owl_item !== null) 1240 continue; 1241 } 1242 1243 if ($owl_carousel === null && typeof event !== 'undefined' && event !== 'resize' && event !== false) { 1244 continue; 1245 } 1246 1247 if ($owl_carousel !== null) { 1248 if ( 1249 ($owl_item === null) 1250 || 1251 ($owl_item !== null && classie.hasClass($owl_item, 'active') && $owl_item.getAttribute('data-index') !== '1') 1252 || 1253 ($owl_item !== null && classie.hasClass($owl_item, 'active') && $owl_item.getAttribute('data-index') === '1' && $owl_item.getAttribute('data-already-reached') === 'true') 1254 ) { 1255 continue; 1256 } 1257 } 1258 1259 $heading.innerHTML = heading_cont; 1260 $words = $heading.querySelectorAll('.split-word, .heading-foreword'); 1261 var lineArray = [], 1262 lineIndex = 0, 1263 lineStart = true, 1264 lineEnd = false, 1265 $text_highlight = $heading.querySelectorAll('.heading-text-highlight'), 1266 $line_wraps = $heading.querySelectorAll('.heading-line-wrap'); 1267 1268 if ($line_wraps.length && typeof event === 'undefined') { 1269 continue; 1270 } 1271 1272 var lettering = function () { 1273 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'); 1274 1275 for (var i = 0; i < $wraps.length; i++) { 1276 var $wrap = $wraps[i], 1277 $lines = $wrap.querySelectorAll('.heading-line-wrap'), 1278 $words = $wrap.querySelectorAll('.split-word:not(.uncode-rotating-span)'), 1279 containerDelay = $wrap.getAttribute('data-delay'), 1280 containerSpeed = $wrap.getAttribute('data-speed'), 1281 containerSpeed_val = typeof containerSpeed !== 'undefined' && containerSpeed !== null ? parseFloat(containerSpeed) : 400, 1282 containerInterval = typeof $wrap.getAttribute('data-interval') !== 'undefined' && $wrap.getAttribute('data-interval') !== null ? $wrap.getAttribute('data-interval') : 0, 1283 $cloned = $wrap.closest('.cloned'), 1284 delayAttr = (containerDelay != undefined) ? containerDelay : 0; 1285 1286 if (classie.hasClass($wrap, 'already-animated')) { 1287 continue; 1288 } 1289 1290 if ($cloned !== null) { 1291 continue; 1292 } 1293 1294 if (classie.hasClass($wrap, 'curtain')) { 1295 1296 for (var il = 0; il < $lines.length; il++) { 1297 var $line = $lines[il], 1298 $spans = $line.querySelectorAll('.split-word-inner'); 1299 1300 for (var is = 0; is < $spans.length; is++) { 1301 1302 var $span = $spans[is]; 1303 1304 $span.setAttribute('data-delay', (parseFloat(delayAttr) + ((parseFloat(containerInterval) + 100) * il))); 1305 1306 if (typeof containerSpeed_val !== 'undefined') { 1307 $span.setAttribute('data-speed', containerSpeed_val); 1308 } 1309 1310 classie.addClass($span, 'animate_when_parent_almost_visible'); 1311 classie.addClass($span, 'text-bottom-t-top'); 1312 1313 if (is + 1 === $spans.length && il + 1 === $lines.length) { 1314 classie.addClass($span, 'anim-tot-checker'); 1315 } 1316 } 1317 1318 } 1319 1320 } else if (classie.hasClass($wrap, 'single-curtain')) { 1321 1322 var $spans = $wrap.querySelectorAll('.split-char'); 1323 1324 for (var is = 0; is < $spans.length; is++) { 1325 var $span = $spans[is]; 1326 1327 $span.setAttribute('data-delay', (parseFloat(delayAttr) + ((parseFloat(containerInterval) + 20) * is))); 1328 1329 if (typeof containerSpeed_val !== 'undefined') { 1330 $span.setAttribute('data-speed', containerSpeed_val); 1331 } 1332 1333 classie.addClass($span, 'animate_when_parent_almost_visible'); 1334 if (!classie.hasClass($span, 'un-inline-image')) { 1335 classie.addClass($span, 'text-bottom-t-top'); 1336 } 1337 1338 if (is + 1 == $spans.length) { 1339 classie.addClass($span, 'anim-tot-checker'); 1340 } 1341 }; 1342 1343 } else if (classie.hasClass($wrap, 'typewriter')) { 1344 1345 var $spans = $wrap.querySelectorAll('.split-char'); 1346 1347 for (var is = 0; is < $spans.length; is++) { 1348 var $span = $spans[is]; 1349 1350 $span.setAttribute('data-delay', (parseFloat(delayAttr) + ((parseFloat(containerInterval) + 20) * is))); 1351 1352 if (typeof containerSpeed_val !== 'undefined') { 1353 $span.setAttribute('data-speed', containerSpeed_val); 1354 } 1355 1356 classie.addClass($span, 'animate_when_parent_almost_visible'); 1357 classie.addClass($span, 'typewriter'); 1358 1359 if (is + 1 == $spans.length) { 1360 classie.addClass($span, 'anim-tot-checker'); 1361 } 1362 1363 } 1364 1365 } else if (classie.hasClass($wrap, 'single-slide')) { 1366 1367 var $spans = $wrap.querySelectorAll('.split-word-inner'); 1368 1369 for (var is = 0; is < $spans.length; is++) { 1370 var $span = $spans[is]; 1371 1372 $span.setAttribute('data-delay', (parseFloat(delayAttr) + ((parseFloat(containerInterval) + 50) * is))); 1373 1374 if (typeof containerSpeed_val !== 'undefined') { 1375 $span.setAttribute('data-speed', containerSpeed_val); 1376 } 1377 1378 classie.addClass($span, 'animate_when_parent_almost_visible'); 1379 if (classie.hasClass(document.body, 'rtl')) { 1380 classie.addClass($span, 'text-left-t-right'); 1381 } else { 1382 classie.addClass($span, 'text-right-t-left'); 1383 } 1384 1385 if (is + 1 == $spans.length) { 1386 classie.addClass($span, 'anim-tot-checker'); 1387 } 1388 } 1389 1390 } else if (classie.hasClass($wrap, 'single-slide-opposite')) { 1391 1392 var $spans = $wrap.querySelectorAll('.split-word-inner'); 1393 1394 for (var is = 0; is < $spans.length; is++) { 1395 var $span = $spans[is]; 1396 1397 $span.setAttribute('data-delay', (parseFloat(delayAttr) + ((parseFloat(containerInterval) + 50) * is))); 1398 1399 if (typeof containerSpeed_val !== 'undefined') { 1400 $span.setAttribute('data-speed', containerSpeed_val); 1401 } 1402 1403 classie.addClass($span, 'animate_when_parent_almost_visible'); 1404 if (classie.hasClass(document.body, 'rtl')) { 1405 classie.addClass($span, 'text-right-t-left'); 1406 } else { 1407 classie.addClass($span, 'text-left-t-right'); 1408 } 1409 1410 if (is + 1 == $spans.length) { 1411 classie.addClass($span, 'anim-tot-checker'); 1412 } 1413 } 1414 1415 } else if (classie.hasClass($wrap, 'curtain-words')) { 1416 1417 var $spans = $wrap.querySelectorAll('.split-word-inner'); 1418 1419 for (var is = 0; is < $spans.length; is++) { 1420 var $span = $spans[is]; 1421 1422 $span.setAttribute('data-delay', (parseFloat(delayAttr) + ((parseFloat(containerInterval) + 50) * is))); 1423 1424 if (typeof containerSpeed_val !== 'undefined') { 1425 $span.setAttribute('data-speed', containerSpeed_val); 1426 } 1427 1428 classie.addClass($span, 'animate_when_parent_almost_visible'); 1429 classie.addClass($span, 'text-bottom-t-top'); 1430 1431 if (is + 1 == $spans.length) { 1432 classie.addClass($span, 'anim-tot-checker'); 1433 } 1434 } 1435 } 1436 1437 } 1438 } 1439 1440 var removeOldLines = function () { 1441 for (var wrap_k = 0; wrap_k < $line_wraps.length; wrap_k++) { 1442 var $line_wrap = $line_wraps[wrap_k]; 1443 var $parent_wrap = $line_wrap.parentNode; 1444 if ($parent_wrap !== null) { 1445 while ($line_wrap.firstChild) { 1446 $parent_wrap.insertBefore($line_wrap.firstChild, $line_wrap); 1447 } 1448 $parent_wrap.removeChild($line_wrap); 1449 } 1450 } 1451 window.dispatchEvent(new CustomEvent('removeOldLines')); 1452 } 1453 1454 var createHighlightSpans = function () { 1455 for (var high_k = 0; high_k < $text_highlight.length; high_k++) { 1456 var $highlight = $text_highlight[high_k], 1457 atts = $highlight.getAttribute('data-atts'), 1458 objAtts, 1459 styleEl = '', 1460 classEl = '', 1461 animation = false, 1462 hexRe = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i, 1463 $h_words = $highlight.querySelectorAll('.split-word:not(.uncode-rotating-span)'); 1464 1465 if (typeof atts !== 'undefined' && atts != '') { 1466 objAtts = JSON.parse(atts); 1467 if (typeof objAtts.bg != 'undefined') { 1468 if (hexRe.test(objAtts.bg)) { 1469 styleEl += 'background-color:' + objAtts.bg + ';'; 1470 } else { 1471 classEl += ' ' + objAtts.bg; 1472 } 1473 } 1474 if (typeof objAtts.color != 'undefined') { 1475 if (hexRe.test(objAtts.color)) { 1476 styleEl += 'color:' + objAtts.color + ';'; 1477 } else {
1478 var classChild = objAtts.color; 1479 } 1480 } 1481 if (typeof objAtts.height != 'undefined') { 1482 styleEl += 'height:' + objAtts.height + ';'; 1483 } 1484 if (typeof objAtts.offset != 'undefined') { 1485 styleEl += 'bottom:' + objAtts.offset + ';'; 1486 } 1487 if (typeof objAtts.opacity != 'undefined') { 1488 styleEl += 'opacity:' + objAtts.opacity + ';'; 1489 } 1490 if (objAtts.animated == 'yes') { 1491 animation = true; 1492 } 1493 1494 } 1495 1496 for (var h_words_k = 0; h_words_k < $h_words.length; h_words_k++) { 1497 var $word = $h_words[h_words_k], 1498 $new_el = document.createElement('span'); 1499 1500 if (typeof classChild !== 'undefined') { 1501 classie.addClass($word, objAtts.color); 1502 } 1503 1504 if (h_words_k === 0) { 1505 classie.addClass($word, 'first-highlight'); 1506 } else if ((h_words_k + 1) === $h_words.length) { 1507 classie.addClass($word, 'last-highlight'); 1508 } 1509 1510 $new_el.className = 'heading-text-highlight-inner' + classEl; 1511 if (styleEl !== '') { 1512 $new_el.setAttribute('style', styleEl); 1513 } 1514 1515 if (animation) { 1516 $new_el.setAttribute('data-animated', 'yes'); 1517 } 1518 1519 $word.appendChild($new_el); 1520 1521 }; 1522 1523 var $parent_highlight = $highlight.parentNode; 1524 if ($parent_highlight != null) { 1525 while ($highlight.firstChild) { 1526 $parent_highlight.insertBefore($highlight.firstChild, $highlight); 1527 } 1528 $parent_highlight.removeChild($highlight); 1529 } 1530 } 1531 1532 } 1533 1534 var createNewLines = function () { 1535 for (var word_k = 0; word_k < $words.length; word_k++) { 1536 var $word = $words[word_k], 1537 top = $word.offsetTop, 1538 elH = $word.offsetHeight, 1539 $next = typeof $words[(word_k + 1)] !== 'undefined' ? $words[(word_k + 1)] : null, 1540 nextTop = $next !== null ? $next.offsetTop : null; 1541 1542 if (lineStart) { 1543 lineArray[lineIndex] = [word_k]; 1544 1545 if (nextTop !== null && elH > 0 && nextTop > (top + elH / 2)) {//tollerance 1546 lineArray[lineIndex].push(word_k); 1547 lineIndex++; 1548 lineStart = true; 1549 } else { 1550 lineStart = false;
1551 } 1552 } else { 1553 if (nextTop !== null && elH > 0 && nextTop > (top + elH / 2)) {//tollerance 1554 lineArray[lineIndex].push(word_k); 1555 lineIndex++; 1556 lineStart = true; 1557 } else if (nextTop === null) { 1558 lineArray[lineIndex].push(word_k); 1559 } 1560 } 1561 } 1562 1563 for (var i = 0; i < lineArray.length; i++) { 1564 var start = lineArray[i][0], 1565 end = lineArray[i][1] + 1; 1566 1567 var spanWrap = document.createElement('span'); 1568 spanWrap.className = 'heading-line-wrap'; 1569 1570 if (!end) { 1571 window.wrap(spanWrap, $words[start]); 1572 } else { 1573 for (var _i = start; _i < end; _i++) { 1574 if (typeof $words[_i] !== 'undefined' && $words[_i] !== null) { 1575 classie.addClass($words[_i], 'heading-temp'); 1576 $words[_i].style.zIndex = end - _i; 1577 } 1578 } 1579 var $towrap = $heading.querySelectorAll('.heading-temp'); 1580 if (typeof $towrap[0] !== 'undefined' && $towrap[0] !== null) { 1581 window.wrapAll(spanWrap, $towrap); 1582 for (var _i = 0; _i < $towrap.length; _i++) { 1583 classie.removeClass($towrap[_i], 'heading-temp'); 1584 } 1585 } 1586 } 1587 1588 if ((i + 1) == lineArray.length) { 1589 classie.addClass($row, 'loaded-split-word'); 1590 } 1591 1592 classie.addClass($heading, 'heading-lined'); 1593 } 1594 lettering(); 1595 1596 } 1597 1598 removeOldLines(); 1599 createHighlightSpans(); 1600 createNewLines(); 1601 1602 $parent_el.addEventListener("owl-carousel-changed", function () { 1603 removeOldLines(); 1604 createHighlightSpans(); 1605 createNewLines(); 1606 }); 1607 1608 if (event !== 'resize') { 1609 document.body.dispatchEvent(new CustomEvent('uncode_waypoints')); 1610 } 1611 1612 } 1613 } 1614 1615 var $h_markup = document.body.querySelectorAll('.font-obs'), 1616 fontArr = new Array(); 1617 1618 for (var i = 0; i < $h_markup.length; i++) { 1619 var font_to_check = $h_markup[i].getAttribute("data-font"); 1620 1621 if (font_to_check === null) { 1622 word_for_lines(false, el); 1623 } else { 1624 var font_weight = $h_markup[i].getAttribute("data-weight"); 1625 var font_style = $h_markup[i].getAttribute("data-style"); 1626 1627 if (font_weight === null) { 1628 font_weight = 'normal'; 1629 } 1630 1631 if (font_style === null) { 1632 font_style = 'normal'; 1633 } 1634 1635 font_to_check = font_to_check.split(','); 1636 1637 var font_val = font_to_check[0].replace(/['"]+/g, ''), 1638 font_key = '\'' + font_val + '_' + font_weight + '_' + font_style + '\''; 1639 1640 if (fontArr.indexOf(font_val + '_' + font_weight) === -1) { 1641 fontArr[font_key] = { 'family': font_val, 'weight': font_weight, 'style': font_style }; 1642 } 1643 } 1644 } 1645 1646 var counter = 0; 1647 1648 for (var key in fontArr) { 1649 if (fontArr.hasOwnProperty(key)) { 1650 var font = new FontFaceObserver(fontArr[key].family, { weight: fontArr[key].weight, style: fontArr[key].style }); 1651 1652 font.load(null, 10000).then(function (font) { 1653 counter++; 1654 if (counter == Object.keys(fontArr).length) { 1655 already_font = true; 1656 requestTimeout(function () { 1657 word_for_lines(false, el); 1658 heading_inline_images(); 1659 }, 10); 1660 } 1661 }, function (error) { 1662 word_for_lines(false, el); 1663 heading_inline_images(); 1664 }); 1665 } 1666 } 1667 1668 el.addEventListener("owl-carousel-initialized", function () { 1669 word_for_lines("owl-carousel-initialized", el); 1670 }); 1671 1672 el.addEventListener("vc-shortcodeView-updated", function () { 1673 heading_inline_images(); 1674 word_for_lines(false, el); 1675 }); 1676 1677 window.addEventListener("resize", function () { 1678 if (wwidth != wrapLinesWw) { 1679 clearRequestTimeout(setWrap); 1680 setWrap = requestTimeout(function () { 1681 wrapLinesWw = wwidth; 1682 word_for_lines('resize'); 1683 }, 100); 1684 } 1685 heading_inline_images(); 1686 }); 1687 1688 window.addEventListener("load", function () { 1689 if (!UNCODE.isFrontEndEditor && wwidth <= mediaQuery) { 1690 heading_inline_images(); 1691 } 1692 }); 1693 1694 scrollFunction(); 1695 1696 var videos = document.querySelectorAll('.wp-video-shortcode'); 1697 for (var i = 0; i < videos.length; i++) { 1698 var video = videos[i]; 1699 if (typeof video.getAttribute('autoplay') !== 'undefined' && video.getAttribute('autoplay') !== null && (typeof video.getAttribute('muted') === 'undefined' || video.getAttribute('muted') === null)) { 1700 video.oncanplay = function (e) { 1701 video.muted = true; 1702 video.play(); 1703 }; 1704 break; 1705 } 1706 } 1707 1708 // Single Product reviews counter on Page Builder module 1709 var singleProductReviewsCounter = function () { 1710 var $reviews = document.getElementById("reviews"), 1711 $comments = $reviews != undefined ? $reviews.querySelector(".commentlist") : undefined; 1712 if ($reviews != undefined && $comments != undefined) { 1713 var dataReviews = $reviews.getAttribute('data-reviewed'), 1714 comments = $comments.getAttribute('data-comment-amout'), 1715 count_review_class = comments > 0 ? '' : ' hidden'; 1716 if (typeof dataReviews == 'undefined' || dataReviews == null || dataReviews == '') { 1717 $reviews.setAttribute('data-reviewed', 'reviewed'); 1718 var $tabPane = getClosest($reviews, 'tab-pane'), 1719 $panel = getClosest($reviews, 'wpb_accordion_section'); 1720 if ($tabPane != undefined) { 1721 var revID = $tabPane.getAttribute('id'), 1722 $spanTxt = document.querySelector('[data-tab-id=' + revID + '] > a > span'); 1723 1724 if (typeof revID !== 'undefined' && revID !== '' && $spanTxt != null) { 1725 var $spanCount = $spanTxt.querySelector('span.review-count'); 1726 if ($spanCount != null) { 1727 $spanCount.innerHTML = comments; 1728 } else { 1729 var textReviews = $spanTxt.innerHTML; 1730 $spanTxt.innerHTML = textReviews + ' <span class="review-count' + count_review_class + '">' + comments + '</span>'; 1731 } 1732 } 1733 } 1734 if ($panel != undefined) { 1735 var $spanTxt = $panel.querySelector('.panel-title > a > span'); 1736 1737 if ($spanTxt != null) { 1738 var $spanTxt_0 = $spanTxt; 1739 if ($spanTxt[0] != undefined) { 1740 $spanTxt_0 = $spanTxt[0]; 1741 } 1742 var $spanCount = $spanTxt.querySelector('span.review-count'); 1743 if ($spanCount != null) { 1744 $spanCount.innerHTML = comments; 1745 } else { 1746 var textReviews = $spanTxt.innerHTML; 1747 $spanTxt.innerHTML = textReviews + ' <span class="review-count' + count_review_class + '">' + comments + '</span>'; 1748 } 1749 } 1750 } 1751 } 1752 } 1753 }; 1754 singleProductReviewsCounter(); 1755 window.addEventListener("vc_panel_title_edited", singleProductReviewsCounter); 1756 1757 //Check for empty additional info tabs 1758 var checkEmptyAdditionalInfo = function () { 1759 var $emptyAdditional = document.getElementById("no_additional_info"), 1760 $emptyPane, 1761 empty_pane_ID, 1762 $tabsParent, 1763 $emptyTab; 1764 if ($emptyAdditional != undefined) { 1765 $emptyPane = getClosest($emptyAdditional, 'tab-pane'); 1766 $tabsParent = getClosest($emptyAdditional, 'uncode-tabs'); 1767 if ($emptyPane == undefined) 1768 return false;
1769 empty_pane_ID = $emptyPane.getAttribute('id'); 1770 1771 $emptyTab = $tabsParent.querySelector('li[data-tab-id="' + empty_pane_ID + '"]'); 1772 $emptyTab.parentNode.removeChild($emptyTab); 1773 $emptyPane.parentNode.removeChild($emptyPane); 1774 } 1775 }; 1776 checkEmptyAdditionalInfo(); 1777 1778 var waitForSrcSetMedia = function () { 1779 var $thumbs = el.querySelectorAll('.srcset-lazy-animations'); 1780 1781 if ($thumbs.length) { 1782 $thumbs.forEach(function ($thumb) { 1783 var $media = $thumb.querySelectorAll('.srcset-auto'); 1784 1785 if ($media.length) { 1786 var $media_inside = $media[0].querySelectorAll('.srcset-sizes-done'); 1787 if (classie.hasClass($media[0], 'srcset-sizes-done') || $media_inside.length) { 1788 classie.removeClass($thumb, 'srcset-lazy-animations'); 1789 } 1790 } else { 1791 classie.removeClass($thumb, 'srcset-lazy-animations'); 1792 } 1793 }); 1794 } 1795 1796 var $posters = el.querySelectorAll('.no-control-lazy-poster'); 1797 1798 if ($posters.length) { 1799 1800 $posters.forEach(function ($thumb) { 1801 var $media = $thumb.querySelectorAll('.srcset-auto'); 1802 1803 var loadForPosters = function ($thumb, $media) { 1804 var url = ($media[0].getAttribute('src')), 1805 image = new Image(); 1806 if (url !== null) { 1807 image.onload = function () { 1808 setTimeout(function () { 1809 classie.removeClass($thumb, 'no-control-lazy-poster'); 1810 }, 200); 1811 }; 1812 image.src = url; 1813 } else { 1814 classie.removeClass($thumb, 'no-control-lazy-poster'); 1815 } 1816 }; 1817 1818 if ($media.length) { 1819 var $media_inside = $media[0].querySelectorAll('.srcset-sizes-done'); 1820 var checkSrcSetDone = function () { 1821 if (classie.hasClass($media[0], 'srcset-sizes-done') || $media_inside.length) { 1822 loadForPosters($thumb, $media); 1823 } else { 1824 setTimeout(checkSrcSetDone, 100); 1825 } 1826 } 1827 checkSrcSetDone(); 1828 } else { 1829 $media = $thumb.querySelectorAll('img[src]'); 1830 if ($media.length) { 1831 loadForPosters($thumb, $media); 1832 } else { 1833 classie.removeClass($thumb, 'no-control-lazy-poster'); 1834 } 1835 } 1836 }); 1837 } 1838 }; 1839 waitForSrcSetMedia(); 1840 window.addEventListener("uncode-ajax-filtered", waitForSrcSetMedia, { 1841 passive: true, 1842 once: true, 1843 }); 1844 window.addEventListener("uncode-more-items-loaded", waitForSrcSetMedia, { 1845 passive: true, 1846 once: false, 1847 }); 1848 1849 }, 1850 1851 initSection = function (currentSection) { 1852 if (SiteParameters.dynamic_srcset_active === '1') { 1853 UNCODE.adaptive_srcset_replace_bg(currentSection); 1854 } 1855 }, 1856 1857 setRowHeight = function(container, forced, resized) { 1858 var currentTallest = 0, 1859 percentHeight = 0, 1860 minHeight = 0, 1861 el, 1862 child, 1863 hasSubCols = false; 1864 if (container.length == undefined) { 1865 container = [container]; 1866 } 1867 // Loop for each container element to match their heights 1868 for (var i = 0; i < container.length; i++) { 1869 var el = container[i], 1870 $row = el, 1871 totalHeight = 0, 1872 colsArray = new Array(), 1873 calculatePadding = 0, 1874 $rowParent = $row.parentNode, 1875 isHeader = false, 1876 isFirst = false; 1877 $row.oversized = false; 1878 percentHeight = el.getAttribute("data-height-ratio"); 1879 minHeight = el.getAttribute("data-minheight"); 1880 // child = (el.firstElementChild || el.firstChild); 1881 child = (el.lastElementChild || el.lastChild); 1882 var childHeight = outerHeight(child); 1883 /** window height without header **/ 1884 if (!!percentHeight || !!minHeight || forced || (isIE && classie.hasClass(el, 'unequal')) ) { 1885 child.style.height = ''; 1886 if (!!percentHeight) { 1887 if (percentHeight == 'full') { 1888 currentTallest = parseInt(UNCODE.wheight); 1889 } else { 1890 currentTallest = parseInt((UNCODE.wheight * percentHeight) / 100); 1891 } 1892 } else { 1893 currentTallest = el.clientHeight; 1894 } 1895 1896 if (!!minHeight) { 1897 if (currentTallest < minHeight || currentTallest == undefined) currentTallest = parseInt(minHeight); 1898 } 1899 1900 if (getClosest(el, 'header-uncode-block') != null) { 1901 el.setAttribute('data-row-header', 'true'); 1902 isHeader = true; 1903 } else { 1904 if (pageHeader == null) { 1905 var prevRow = $rowParent.previousSibling; 1906 if (prevRow != null && prevRow.innerText == 'UNCODE.initHeader();') { 1907 isFirst = true; 1908 } 1909 } 1910 } 1911
1912 menuMobileTransparent = document.querySelector('.menu-absolute.menu-transparent'); 1913 if (classie.hasClass(el, 'row-slider')) { 1914 percentHeight = el.getAttribute("data-height-ratio"); 1915 minHeight = el.getAttribute("data-minheight"); 1916 if (percentHeight == 'full') { 1917 currentTallest = parseInt(UNCODE.wheight); 1918 } else { 1919 currentTallest = parseInt((UNCODE.wheight * percentHeight) / 100); 1920 } 1921 1922 var computedStyleRow = getComputedStyle(el), 1923 computedStyleRowParent = getComputedStyle($rowParent); 1924 calculatePadding -= (parseFloat(computedStyleRow.paddingTop) + parseFloat(computedStyleRowParent.paddingTop)); 1925 calculatePadding -= (parseFloat(computedStyleRow.paddingBottom) + parseFloat(computedStyleRowParent.paddingBottom)); 1926 1927 if (isHeader || isFirst) { 1928 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) { 1929 currentTallest -= menuHeight - transmenuHeight; 1930 } else { 1931 currentTallest -= menuHeight; 1932 } 1933 currentTallest += calculatePadding; 1934 } else { 1935 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) { 1936 currentTallest += calculatePadding; 1937 } else { 1938 currentTallest = 'auto'; 1939 } 1940 } 1941 1942 getDivChildren(el, '.owl-carousel', function(owl, i) { 1943 owl.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 1944 if (isIE) { 1945 getDivChildren(owl, '.owl-stage', function(owlIn, i) { 1946 owlIn.style.height = (currentTallest == 'auto' ? '100%' : currentTallest + 'px'); 1947 }); 1948 } 1949 }); 1950 if ( UNCODE.isFullPageSnap || classie.hasClass(masthead, 'menu-transparent') ) 1951 continue; 1952 else { 1953 if ( classie.hasClass(document.body, 'uncode-fp-menu-hide') ) { 1954 $rowParent.parentNode.style.paddingTop = menuHeight + 'px'; 1955 } 1956 } 1957 } else { 1958 if (isHeader || isFirst || UNCODE.isFullPage ) { 1959 if ( !( UNCODE.isFullPage && !classie.hasClass(masthead, 'menu-transparent') && classie.hasClass(document.body, 'uncode-fp-menu-hide') && !isHeader && !isFirst ) ) { 1960 if (isMobileTransparent || wwidth > mediaQuery) { 1961 currentTallest -= menuHeight - transmenuHeight; 1962 } else { 1963 currentTallest -= menuHeight - secmenuHeight; 1964 } 1965 } 1966 if ( UNCODE.isFullPage && classie.hasClass(document.body, 'uncode-scroll-safe-padding') && classie.hasClass(masthead, 'menu-transparent') && !classie.hasClass(document.body, 'uncode-fp-menu-hide') ) { 1967 var safeMenuHeight = parseFloat(document.body.getAttribute("data-additional-padding")) + parseFloat(menuHeight); 1968 if ( (" " + child.parentNode.className + " ").replace(/[\n\t]/g, " ").indexOf("-top-padding ") < 0 || classie.hasClass(child.parentNode, 'single-top-padding') ) { 1969 classie.addClass(child.parentNode, 'fp-safe-padding-top'); 1970 child.parentNode.style.paddingTop = safeMenuHeight + 'px'; 1971 } 1972 if ( (" " + child.parentNode.className + " ").replace(/[\n\t]/g, " ").indexOf("-bottom-padding ") < 0 || classie.hasClass(child.parentNode, 'single-bottom-padding') ) { 1973 classie.addClass(child.parentNode, 'fp-safe-padding-bottom'); 1974 child.parentNode.style.paddingBottom = safeMenuHeight + 'px'; 1975 } 1976 } 1977 if ( !classie.hasClass(masthead, 'menu-transparent') && classie.hasClass(document.body, 'uncode-fp-menu-hide') && ( isFirst || isHeader ) ) { 1978 $rowParent.parentNode.style.paddingTop = menuHeight + 'px'; 1979 } 1980 1981 var computedStyleRow = getComputedStyle(el), 1982 computedStyleRowParent = getComputedStyle($rowParent); 1983 calculatePadding -= (parseFloat(computedStyleRow.paddingTop) + parseFloat(computedStyleRowParent.paddingTop)); 1984 calculatePadding -= (parseFloat(computedStyleRow.paddingBottom) + parseFloat(computedStyleRowParent.paddingBottom)); 1985 1986 currentTallest += calculatePadding; 1987 1988 } else { 1989 1990 var computedStyleRow = getComputedStyle(el), 1991 computedStyleRowParent = getComputedStyle($rowParent); 1992 calculatePadding -= (parseFloat(computedStyleRow.paddingTop) + parseFloat(computedStyleRowParent.paddingTop)); 1993 calculatePadding -= (parseFloat(computedStyleRow.paddingBottom) + parseFloat(computedStyleRowParent.paddingBottom)); 1994 1995 if (wwidth > mediaQuery) currentTallest += calculatePadding; 1996 else currentTallest = 'auto'; 1997 1998 } 1999 } 2000 if ( UNCODE.isFullPage ) { 2001 currentTallest -= UNCODE.adminBarHeight; 2002 } 2003 if (!!minHeight) { 2004 if (currentTallest < minHeight || currentTallest == 'auto') currentTallest = parseInt(minHeight); 2005 } 2006 2007 if ( UNCODE.isFrontEndEditor && child !== null ) { 2008 var innerWrapper = child.querySelectorAll('.owl-carousel-wrapper.vc_uncode_slider'); 2009 if ( innerWrapper.length ) { 2010 getDivChildren(child, '.owl-carousel-wrapper.vc_uncode_slider', function(wrapper, i) { 2011 if ( wrapper !== null ) { 2012 wrapper.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 2013 } else { 2014 child.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 2015 } 2016 }); 2017 } else { 2018 child.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 2019 } 2020 } else { 2021 //here 2022 child.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px'); 2023 } 2024 2025 if ( wwidth < mediaQuery && classie.hasClass(child, 'auto-height-device') ) { 2026 child.style.height = 'auto'; 2027 } 2028 2029 } else { 2030 currentTallest = 0; 2031 if ( UNCODE.isFrontEndEditor && child !== null ) { 2032 2033 child.style.height = ''; 2034 2035 getDivChildren(el, '.owl-carousel', function(owl, i) { 2036 owl.style.height = ''; 2037 if (isIE) { 2038 getDivChildren(owl, '.owl-stage', function(owlIn, i) { 2039 owlIn.style.height = ''; 2040 }); 2041 } 2042 }); 2043 } 2044 } 2045 2046 if (wwidth > mediaQuery) { 2047 if ( ! classie.hasClass(el, 'unequal-flex') && ! classie.hasClass(el, 'wpb-content-wrapper') ) { 2048 getDivChildren(el, '.column_parent', function(col, i, total) { 2049 var $col = col, 2050 $colHeight = 0, 2051 $colDiff = 0, 2052 $colPercDiff = 100; 2053 $col.oversized = false;
2054 $col.forceHeight = currentTallest; 2055 currentTallest = child.clientHeight; 2056 if ((isHeader || isFirst) && currentTallest != 'auto') currentTallest -= transmenuHeight; 2057 var getFirstCol = null, 2058 getMargin = 0, 2059 getSubMargin = 0; 2060 getDivChildren(col, '.row-child', function(obj, i, total) { 2061 var $colChild = obj, 2062 $colParent = $colChild.parentNode, 2063 computedStyleCol = getComputedStyle($colParent); 2064 parseFloat(computedStyleCol.marginTop); 2065 getSubMargin += parseFloat(computedStyleCol.marginTop); 2066 }); 2067 currentTallest += getSubMargin; 2068 getDivChildren(col, '.row-child', function(obj, i, total) { 2069 var $colChild = obj, 2070 $colInner, 2071 $colParent = $colChild.parentNode, 2072 $uncont = $colParent.parentNode; 2073 for (var it = 0; it < $colChild.childNodes.length; it++) { 2074 if ( ! classie.hasClass($colChild.childNodes[it], 'uncode-divider-wrap') ) { 2075 $colInner = $colChild.childNodes[it]; 2076 break; 2077 } 2078 } 2079 if (i == 0 && total > 1) getFirstCol = $colInner; 2080 $colChild.oversized = false; 2081 percentHeight = $colChild.getAttribute("data-height"); 2082 minHeight = $colChild.getAttribute("data-minheight"); 2083 if (percentHeight != null || minHeight != null) { 2084 if ( ! classie.hasClass($colInner, 'uncode-divider-wrap') ) 2085 $colInner.style.height = ''; 2086 $colParent.style.height = 'auto'; 2087 $uncont.style.height = '100%'; 2088 $colChild.removeAttribute("style"); 2089 var newHeight = (percentHeight != null) ? Math.ceil((currentTallest) * (percentHeight / 100)) : parseInt(minHeight); 2090 var computedStyleCol = getComputedStyle($colParent); 2091 getMargin = parseFloat(computedStyleCol.marginTop); 2092 newHeight -= (getMargin); 2093 $colPercDiff -= (percentHeight != null) ? percentHeight : 0; 2094 if (currentTallest >= newHeight) { 2095 var getColHeight = outerHeight($colChild); 2096 if (getColHeight > newHeight) { 2097 $colHeight += getColHeight; 2098 $colDiff += getColHeight; 2099 $colChild.oversized = true; 2100 $col.oversized = true; 2101 $row.oversized = true; 2102 } else { 2103 $colHeight += newHeight; 2104 if ( ! classie.hasClass($colInner, 'uncode-divider-wrap') ) { 2105 $colInner.style.height = newHeight + 'px'; 2106 } 2107 } 2108 } 2109 } else { 2110 $colHeight += outerHeight($colChild); 2111 } 2112 }); 2113 if (getFirstCol != null) { 2114 getFirstCol.style.height = (parseFloat(getFirstCol.style.height) - getMargin) + 'px'; 2115 } 2116 colsArray.push({ 2117 colHeight: $colHeight, 2118 colDiv: $col 2119 }); 2120 $col.colDiff = $colDiff; 2121 $col.colPercDiff = $colPercDiff; 2122 2123 }); 2124 2125 if ($row.oversized) { 2126 child.style.height = ''; 2127 colsArray.sort(function(a, b) { 2128 if (a.colHeight < b.colHeight) return 1; 2129 if (a.colHeight > b.colHeight) return -1; 2130 return 0; 2131 }); 2132 var $totalHeight = 0; 2133 colsArray.forEach(function(col) { 2134 var $col = col.colDiv, 2135 $colHeight = col.colHeight; 2136 getDivChildren($col, '.row-child', function(obj, i, total) { 2137 var $colChild = obj, 2138 $colInner = $colChild.children[0], 2139 percentHeight = parseFloat($colChild.getAttribute("data-height")), 2140 $colParent = $colChild.parentNode, 2141 $uncont = $colParent.parentNode, 2142 newHeight; 2143 2144 $colHeight = $col.forceHeight - $col.colDiff; 2145 if (percentHeight != null) { 2146 if ($colHeight > 0) { 2147 if ($col.oversized) { 2148 if (!$colChild.oversized) { 2149 newHeight = Math.ceil(($colHeight) * (percentHeight / $col.colPercDiff)); 2150 if (i == total - 1 && total > 1) { 2151 $uncont.style.height = 'auto'; 2152 $colChild.style.display = 'none'; 2153 newHeight = outerHeight($col.parentNode) - outerHeight($uncont); 2154 $uncont.style.height = '100%'; 2155 $colChild.style.display = 'table'; 2156 }
2157 if (newHeight == 0) newHeight = Math.ceil(($col.forceHeight) * (percentHeight / 100)); 2158 $colInner.style.height = newHeight + 'px'; 2159 } 2160 } else { 2161 if ($totalHeight == 0) newHeight = Math.ceil(($colHeight) * (percentHeight / $col.colPercDiff)); 2162 else { 2163 newHeight = Math.ceil(($totalHeight) * (percentHeight / $col.colPercDiff)); 2164 } 2165 if (i == total - 1 && total > 1) { 2166 $uncont.style.height = 'auto'; 2167 $colChild.style.display = 'none'; 2168 newHeight = outerHeight($col.parentNode) - outerHeight($uncont); 2169 $uncont.style.height = '100%'; 2170 $colChild.style.display = 'table'; 2171 } 2172 $colInner.style.height = newHeight + 'px'; 2173 } 2174 } else { 2175 if ($colChild.oversized) { 2176 if ($totalHeight == 0) newHeight = Math.ceil(($colHeight) * (percentHeight / $col.colPercDiff)); 2177 else { 2178 if ($col.colPercDiff == 0) $col.colPercDiff = 100; 2179 newHeight = Math.ceil(($totalHeight) * (percentHeight / $col.colPercDiff)); 2180 } 2181 if (i == total - 1 && total > 1) { 2182 $uncont.style.height = 'auto'; 2183 $colChild.style.display = 'none'; 2184 newHeight = outerHeight($col.parentNode) - outerHeight($uncont); 2185 $uncont.style.height = '100%'; 2186 $colChild.style.display = 'table'; 2187 } 2188 //and here 2189 $colInner.style.height = newHeight + 'px'; 2190 } 2191 } 2192 } 2193 }); 2194 var uncell = $col.getElementsByClassName('uncell'); 2195 if (uncell[0] != undefined && $totalHeight == 0) $totalHeight = outerHeight(uncell[0]); 2196 }); 2197 } 2198 if (isFF) { 2199 getDivChildren(el, '.uncoltable', function(col, i, total) { 2200 if (col.style.minHeight != '') { 2201 col.style.height = ''; 2202 } 2203 }); 2204 } 2205 if (resized) { 2206 getDivChildren(el, '.row-child > .row-inner', function(obj, k, total) { 2207 if (obj.style.height == '') { 2208 if (wwidth > mediaQueryMobile) { 2209 var getStyle = (window.getComputedStyle((obj.parentNode), null)), 2210 getInnerHeight = (parseInt(obj.parentNode.clientHeight) - parseInt(getStyle.paddingTop) - parseInt(getStyle.paddingBottom)); 2211 obj.style.height = getInnerHeight + 'px'; 2212 //obj.style.marginBottom = '-1px'; 2213 } 2214 } 2215 }); 2216 getDivChildren(el, '.row-parent > .row-inner', function(obj, k, total) { 2217 if (obj.style.height != '') { 2218 var getStyle = (window.getComputedStyle((obj.parentNode), null)), 2219 getInnerHeight = (parseInt(obj.parentNode.clientHeight) - parseInt(getStyle.paddingTop) - parseInt(getStyle.paddingBottom)), 2220 getTempHeight = parseInt(obj.style.height); 2221 if (getInnerHeight > getTempHeight && ( obj.parentNode.parentNode == null || ! classie.hasClass(obj.parentNode.parentNode, 'pin-trigger') ) ) { 2222 obj.style.height = getInnerHeight + 'px'; 2223 //obj.style.marginBottom = '-1px'; 2224 } 2225 } 2226 }); 2227 } 2228 } 2229 } else { 2230 if (isFF) { 2231 getDivChildren(el, '.uncoltable', function(col, i, total) { 2232 if (col.style.minHeight != '') { 2233 col.style.height = ''; 2234 col.style.height = outerHeight(col.parentNode) + 'px'; 2235 } 2236 }); 2237 } 2238 if (isIE && (wwidth > mediaQueryMobile)) { 2239 if (child.style.height == 'auto') { 2240 child.style.height = outerHeight(child) + 'px'; 2241 } 2242 } 2243 } 2244 if (isFF) { 2245 var sliderColumnFix = document.querySelector('.uncode-slider .row-inner > .column_child:only-child'); 2246 if (sliderColumnFix != null) { 2247 if (wwidth > mediaQuery) { 2248 sliderColumnFix.style.setProperty("height", ""); 2249 } else { 2250 sliderColumnFix.style.setProperty("height", ""); 2251 sliderColumnFix.style.setProperty("height", outerHeight(sliderColumnFix.parentNode) + "px", "important"); 2252 } 2253 } 2254 } 2255 2256 //Flex Justify Equal Height 2257 if ( classie.hasClass( $row, 'unequal-flex') ) { 2258 var $cols = $row.querySelectorAll('.wpb_column.column_parent'), 2259 $colMds = $row.querySelectorAll('.wpb_column.column_parent[class*=col-md]:not(.col-md-100)'), 2260 maxMd = 0, 2261 $colSms = $row.querySelectorAll('.wpb_column.column_parent[class*=col-sm]:not(.col-sm-100)'), 2262 maxSm = 0; 2263 if ( $colSms.length || $colMds.length ) { 2264 if ( UNCODE.wwidth <= UNCODE.mediaQueryMobile && $colSms.length ) { 2265 for (var sMi = 0; sMi < $colSms.length; sMi++) { 2266 $colSms[sMi].style.height = ''; 2267 var colH = outerHeight($colSms[sMi]); 2268 if ( maxSm < colH ) { 2269 maxSm = colH; 2270 } 2271 } 2272 for (var sMi = 0; sMi < $colSms.length; sMi++) { 2273 $colSms[sMi].style.height = maxMd; 2274 } 2275 } else if ( UNCODE.wwidth <= UNCODE.mediaQuery && UNCODE.wwidth > UNCODE.mediaQueryMobile && $colMds.length ) { 2276 for (var mDi = 0; mDi < $colMds.length; mDi++) { 2277 $colMds[mDi].style.height = ''; 2278 var colH = outerHeight($colMds[mDi]); 2279 if ( maxMd < colH ) { 2280 maxMd = colH; 2281 } 2282 } 2283 for (var mDi = 0; mDi < $colMds.length; mDi++) { 2284 $colMds[mDi].style.height = maxMd + 'px'; 2285 } 2286 } else { 2287 for (var colI = 0; colI < $cols.length; colI++) { 2288 $cols[colI].style.height = ''; 2289 } 2290 } 2291 } 2292 } 2293 container[i].dispatchEvent(new CustomEvent('setResized')); 2294 }; 2295 if ( resized || UNCODE.isFrontEndEditor ) { 2296 window.scroll(0, scrollRowHeight_fix); 2297 } 2298 }, 2299 headerHeight = function(container) {
2300 menuMobileTransparent = document.querySelector('.menu-absolute.menu-transparent'); 2301 forEachElement(container, function(el, i) { 2302 var getHeight = parseFloat(el.getAttribute("data-height")), 2303 newHeight = ((wheight * getHeight) / 100); 2304 if (getHeight != 'fixed' && newHeight != 0) { 2305 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) newHeight -= menuHeight - transmenuHeight; 2306 else newHeight -= menuHeight - secmenuHeight; 2307 el.style.height = newHeight + 'px'; 2308 } 2309 }); 2310 if ( masthead == undefined ) { 2311 masthead = document.getElementById("masthead"); 2312 } 2313 if (masthead != undefined) { 2314 menuStickyMobile = UNCODE.isMobile ? document.querySelectorAll('.menu-sticky-mobile') : null; 2315 masthead.parentNode.style.height = (menuHeight-1) + 'px'; 2316 var $overlay = masthead.parentNode.parentNode.querySelector('div.overlay-menu'), 2317 $navbarmain; 2318 2319 if ( typeof $overlay == 'object' && $overlay != null ) { 2320 if ( menuStickyMobile !== null && menuStickyMobile.length ) { 2321 UNCODE.menuStickyMobileOverlay = true; 2322 $overlay.style.top = menuHeight + 'px'; 2323 } else { 2324 UNCODE.menuStickyMobileOverlay = false; 2325 $overlay.style.top = '0'; 2326 if ( isMobileTransparent && menuMobileTransparent !== null && !classie.hasClass(document.body, 'menu-mobile-off-canvas') ) { 2327 $navbarmain = $overlay.querySelector('div.navbar-main'); 2328 if (wwidth > mediaQuery) { 2329 $navbarmain.style.paddingTop = false; 2330 } else { 2331 $navbarmain.style.paddingTop = menuHeight + 'px'; 2332 } 2333 } 2334 } 2335 } 2336 if (header != undefined && header.length) { 2337 if (classie.hasClass(masthead, 'menu-transparent')) { 2338 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) { 2339 masthead.parentNode.style.height = '0px'; 2340 if (classie.hasClass(masthead, 'menu-add-padding')) { 2341 for (var j = 0; j < header.length; j++) { 2342 var headerel = header[j]; 2343 var headerBlock = getClosest(headerel, 'header-uncode-block'); 2344 if (headerBlock != null) { 2345 var parentRow = headerBlock.querySelector('.vc_row'), 2346 innerRows; 2347 if ( parentRow !== null ) { 2348 innerRows = parentRow.querySelectorAll('.column_parent > .uncol > .uncoltable > .uncell > .uncont, .uncode-slider .column_child > .uncol > .uncoltable > .uncell > .uncont'); 2349 } 2350 if ( innerRows != undefined && innerRows !== null ) { 2351 for (var k = 0; k < innerRows.length; k++) { 2352 if (innerRows[k] != undefined) { 2353 if (wwidth > mediaQuery) innerRows[k].style.paddingTop = transmenuHeight + 'px'; 2354 else innerRows[k].style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px'; 2355 } 2356 } 2357 } 2358 } else { 2359 getDivChildren(headerel, '.header-content', function(headerContent, i) { 2360 if (wwidth > mediaQuery) headerContent.style.paddingTop = transmenuHeight + 'px'; 2361 else headerContent.style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px'; 2362 }); 2363 } 2364 } 2365 } 2366 } 2367 } 2368 } 2369 } 2370 }, 2371 initVideoComponent = function(container, classTarget) { 2372 if ( UNCODE.isFrontEndEditor ) 2373 return; 2374 getDivChildren(container, classTarget, function(el, i) { 2375 if ( classie.hasClass(el, 'fluid-object') ) { 2376 return; 2377 } 2378 var width = outerWidth(el), 2379 pWidth, // player width, to be defined 2380 height = outerHeight(el), 2381 pHeight, // player height, tbd 2382 $tubularPlayer = (el.getElementsByTagName('iframe').length == 1) ? el.getElementsByTagName('iframe') : el.getElementsByTagName('video'), 2383 ratio = (el.getAttribute("data-ratio") != null) ? Number(el.getAttribute("data-ratio")) : typeof $tubularPlayer[0] !== 'undefined' ? $tubularPlayer[0].getAttribute("data-ratio") : '1.8', 2384 heightOffset = 80, 2385 widthOffset = heightOffset * ratio; 2386 // when screen aspect ratio differs from video, video must center and underlay one dimension 2387 if ($tubularPlayer[0] != undefined) {
2388 if (width / ratio < height) { // if new video height < window height (gap underneath) 2389 pWidth = Math.ceil((height + heightOffset) * ratio); // get new player width 2390 $tubularPlayer[0].style.width = pWidth + widthOffset + 'px'; 2391 $tubularPlayer[0].style.height = height + heightOffset + 'px'; 2392 $tubularPlayer[0].style.left = ((width - pWidth) / 2) - (widthOffset / 2) + 'px'; 2393 $tubularPlayer[0].style.top = '-' + (heightOffset / 2) + 'px'; 2394 $tubularPlayer[0].style.position = 'absolute'; 2395 } else { // new video width < window width (gap to right) 2396 pHeight = Math.ceil(width / ratio); // get new player height 2397 $tubularPlayer[0].style.width = width + widthOffset + 'px'; 2398 $tubularPlayer[0].style.height = pHeight + heightOffset + 'px'; 2399 $tubularPlayer[0].style.left = '-' + (widthOffset / 2) + 'px'; 2400 $tubularPlayer[0].style.top = ((height - pHeight) / 2) - (heightOffset / 2) + 'px'; 2401 $tubularPlayer[0].style.position = 'absolute'; 2402 } 2403 } 2404 }); 2405 }, 2406 init_overlay = function() { 2407 if ( UNCODE.isFrontEndEditor ) 2408 return; 2409 var triggerButton, 2410 globalBtnn, 2411 sequential = false, 2412 ddCloseBtn = false, 2413 closeButtons = new Array(); 2414 function toggleOverlay(btn) { 2415 if ( classie.hasClass(triggerButton, 'menu-button-offcanvas') || classie.hasClass(triggerButton, 'opening') || classie.hasClass(triggerButton, 'closing') ) { 2416 return true; 2417 } 2418 Array.prototype.forEach.call(document.querySelectorAll('div.overlay'), function(overlay) { 2419 if (btn.getAttribute('data-area') == overlay.getAttribute('data-area')) { 2420 var container = document.querySelector('div.' + btn.getAttribute('data-container')), 2421 menuCont = overlay.querySelector('.menu-container'), 2422 masthead = document.getElementById("masthead"), 2423 inputField = overlay.querySelector('.search-field'); 2424 if (classie.has(overlay, 'open')) { 2425 globalBtnn = false; 2426 window.dispatchEvent(menuClose); 2427 overlayOpened = false; 2428 classie.remove(overlay, 'open'); 2429 classie.remove(document.body, 'navbar-hover'); 2430 classie.remove(document.body, 'open-megamenu'); 2431 classie.add(overlay, 'close'); 2432 classie.remove(overlay, 'open-items'); 2433 classie.remove(document.body, 'menu-overlay-open'); 2434 classie.add(document.body, 'menu-dd-search-closing'); 2435 requestTimeout(function(){ 2436 if ( classie.has( masthead, 'style-dark-stop' ) ) { 2437 classie.remove( masthead, 'style-dark-stop' ); 2438 classie.remove( masthead, 'style-light-override' ); 2439 classie.add( masthead, 'style-dark-override' ); 2440 } else if ( classie.has( masthead, 'style-light-stop' ) ) { 2441 classie.remove( masthead, 'style-light-stop' ); 2442 classie.remove( masthead, 'style-dark-override' ); 2443 classie.add( masthead, 'style-light-override' ); 2444 } 2445 // if ( classie.has( masthead, 'is_stuck-stop' ) ) { 2446 // classie.remove( masthead, 'is_stuck-stop' ); 2447 // classie.add( masthead, 'is_stuck' ); 2448 // } 2449 classie.remove(document.documentElement, 'overlay-open'); 2450 classie.remove(document.body, 'menu-dd-search-open'); 2451 classie.remove(document.body, 'menu-dd-search-closing'); 2452 ddCloseBtn = false; 2453 }, 500); 2454 var onEndTransitionFn = function(ev) { 2455 if (transitionEvent) { 2456 if (ev.propertyName !== 'visibility') return; 2457 this.removeEventListener(transitionEvent, onEndTransitionFn); 2458 } 2459 classie.remove(overlay, 'close'); 2460 if ( sequential !== false ) { 2461 toggleOverlay(sequential); 2462 sequential = false; 2463 } 2464 }; 2465 if (transitionEvent) { 2466 overlay.addEventListener(transitionEvent, onEndTransitionFn); 2467 } else { 2468 onEndTransitionFn(); 2469 } 2470 } else if (!classie.has(overlay, 'close') && !classie.hasClass(btn, 'overlay-close')) { 2471 globalBtnn = btn; 2472 window.dispatchEvent(menuOpen); 2473 overlayOpened = true; 2474 classie.add(overlay, 'open'); 2475 if ( ( classie.hasClass(document.body, 'menu-dd-search') && wwidth > mediaQuery ) || classie.hasClass(document.body, 'menu-dd-search-mobile') ) { 2476 classie.add(document.body, 'navbar-hover'); 2477 ddCloseBtn = btn; 2478 } 2479 if ( ( classie.hasClass(document.body, 'menu-dd-search') && wwidth > mediaQuery ) ) { 2480 classie.add(document.body, 'menu-dd-search-open'); 2481 ddCloseBtn = btn; 2482 } 2483 classie.add(container, 'overlay-open'); 2484 if ( wwidth > mediaQuery && overlay.getAttribute('data-area') != 'search' ) { 2485 classie.add(document.documentElement, 'overlay-open'); 2486 classie.add(document.documentElement, 'menu-overlay-open'); 2487 } 2488 if ( classie.has( menuCont, 'style-light' ) ) { 2489 if ( classie.has( masthead, 'style-dark-override' ) && ! classie.has( masthead, 'style-light-override' ) ) { 2490 classie.remove( masthead, 'style-dark-override' ); 2491 classie.add( masthead, 'style-dark-stop' ); 2492 classie.add( masthead, 'style-light-override' ); 2493 } 2494 } else if ( classie.has( menuCont, 'style-dark' ) ) { 2495 if ( classie.has( masthead, 'style-light-override' ) && ! classie.has( masthead, 'style-dark-override' ) ) { 2496 classie.remove( masthead, 'style-light-override' ); 2497 classie.add( masthead, 'style-light-stop' ); 2498 classie.add( masthead, 'style-dark-override' ); 2499 } 2500 } 2501 // if ( classie.has( masthead, 'is_stuck' ) ) { 2502 // classie.remove( masthead, 'is_stuck' ); 2503 // classie.add( masthead, 'is_stuck-stop' ); 2504 // } 2505 if (jQuery('body.menu-overlay').length == 0 && inputField != null) { 2506 setTimeout(function() { 2507 inputField.focus(); 2508 }, 1000); 2509 } 2510 setTimeout(function() { 2511 if (classie.has(overlay, 'overlay-sequential')) classie.add(overlay, 'open-items'); 2512 }, 800); 2513 } 2514 } 2515 }); 2516 2517 if (classie.hasClass(btn, 'search-icon') || classie.hasClass(btn, 'menu-close-search') || classie.hasClass(btn, 'mobile-search-icon')) return; 2518 2519 if (classie.hasClass(triggerButton, 'close')) { 2520 UNCODE.menuOpened = false;
2521 classie.removeClass(triggerButton, 'close'); 2522 classie.addClass(triggerButton, 'closing'); 2523 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2524 if (!classie.hasClass(closeButton, 'menu-close-search')) { 2525 classie.removeClass(closeButton, 'close'); 2526 classie.addClass(closeButton, 'closing'); 2527 } 2528 }); 2529 setTimeout(function() { 2530 classie.removeClass(triggerButton, 'closing'); 2531 // triggerButton.style.opacity = 1; 2532 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2533 if (!classie.hasClass(closeButton, 'menu-close-search')) { 2534 classie.removeClass(closeButton, 'closing'); 2535 // closeButton.style.opacity = 0; 2536 } 2537 }); 2538 }, 1000); 2539 } else { 2540 UNCODE.menuOpened = true; 2541 // triggerButton.style.opacity = 0; 2542 var getBtnRect = !classie.hasClass(triggerButton, 'search-icon') ? triggerButton.getBoundingClientRect() : null; 2543 classie.addClass(triggerButton, 'opening'); 2544 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2545 if (!classie.hasClass(closeButton, 'menu-close-search')) { 2546 // classie.addClass(triggerButton, 'close'); 2547 // if (getBtnRect != null) closeButton.setAttribute('style', 'top:' + getBtnRect.top + 'px; left:'+ getBtnRect.left + 'px !important'); 2548 classie.addClass(closeButton, 'close'); 2549 classie.addClass(closeButton, 'opening'); 2550 // closeButton.style.opacity = 1; 2551 } 2552 }); 2553 setTimeout(function() { 2554 classie.removeClass(triggerButton, 'opening'); 2555 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2556 if (!classie.hasClass(closeButton, 'menu-close-search')) { 2557 classie.removeClass(closeButton, 'opening'); 2558 } 2559 }); 2560 }, 1000); 2561 window.addEventListener("resize", function() { 2562 positionCloseBtn(triggerButton, closeButtons); 2563 }); 2564 } 2565 } 2566 function positionCloseBtn(triggerButton, closeButtons){ 2567 var getBtnRect = !classie.hasClass(triggerButton, 'search-icon') ? triggerButton.getBoundingClientRect() : null; 2568 // Array.prototype.forEach.call(closeButtons, function(closeButton) { 2569 // if (!classie.hasClass(closeButton, 'menu-close-search')) { 2570 // if (getBtnRect != null) closeButton.setAttribute('style', 'top:' + getBtnRect.top + 'px; left:'+ getBtnRect.left + 'px !important'); 2571 // closeButton.style.opacity = 1; 2572 // } 2573 // }); 2574 } 2575 (function bindEscape() { 2576 document.onkeydown = function(evt) { 2577 evt = evt || window.event; 2578 var isEscape = false;
2579 if ("key" in evt) { 2580 isEscape = (evt.key == "Escape" || evt.key == "Esc"); 2581 } else { 2582 isEscape = (evt.keyCode == 27); 2583 } 2584 if (isEscape && overlayOpened) { 2585 Array.prototype.forEach.call(closeButtons, function(closeButton) { 2586 if (classie.hasClass(closeButton, 'overlay-close') && classie.hasClass(closeButton, 'menu-button-overlay')) { 2587 closeButton.click(); 2588 } 2589 }); 2590 } 2591 }; 2592 })(); 2593 Array.prototype.forEach.call(document.querySelectorAll('.trigger-overlay'), function(triggerBttn) { 2594 if ( UNCODE.menuOpened || ( (classie.hasClass(document.body, 'vmenu') || classie.hasClass(triggerBttn, 'menu-button-offcanvas')) && UNCODE.wwidth >= 960 ) ) return; 2595 triggerBttn.addEventListener('click', function(e) { 2596 triggerButton = e.currentTarget; 2597 // if (wwidth < mediaQuery && classie.hasClass(triggerButton, 'search-icon')) { 2598 if ( wwidth < mediaQuery && triggerButton.getAttribute('data-area') != 'search' ) { 2599 return true; 2600 } else { 2601 e.stopPropagation(); 2602 // if (wwidth > mediaQuery) toggleOverlay(triggerButton); 2603 // else { 2604 // if (classie.addClass(triggerButton, 'search-icon')) return true; 2605 // } 2606 if ( triggerButton.getAttribute('data-area') == 'search' ) { 2607 if ( globalBtnn !== undefined && globalBtnn !== false && globalBtnn !== triggerButton ) { 2608 sequential = triggerButton; 2609 globalBtnn.dispatchEvent(new Event("click")); 2610 } else { 2611 window.dispatchEvent(new CustomEvent('menuMobileTrigged')); 2612 toggleOverlay(triggerButton); 2613 } 2614 } else { 2615 window.dispatchEvent(new CustomEvent('menuMobileTrigged')); 2616 toggleOverlay(triggerButton); 2617 } 2618 e.preventDefault(); 2619 return false; 2620 } 2621 }, false); 2622 }); 2623 Array.prototype.forEach.call(document.querySelectorAll('.overlay-close, .menu-button-overlay'), function(closeBttn) { 2624 closeButtons.push(closeBttn); 2625 if ( classie.hasClass(closeBttn, 'menu-close-search') ) { 2626 closeBttn.addEventListener('click', function(e) { 2627 // if (wwidth > mediaQuery) toggleOverlay(closeBttn); 2628 toggleOverlay(closeBttn); 2629 e.preventDefault(); 2630 return false; 2631 }, false); 2632 } 2633 }); 2634 document.body.addEventListener('click', function(e) { 2635 if ( ddCloseBtn !== false ) { 2636 var close_overlay = getClosest( e.target, 'overlay-search'); 2637 if ( close_overlay === null ) { 2638 toggleOverlay(ddCloseBtn); 2639 } 2640 } 2641 }); 2642 document.addEventListener('keydown', function(e) { 2643 e = e || window.event; 2644 if ( ddCloseBtn !== false && ( e.key === "Escape" || e.key === "Esc" ) ) { 2645 toggleOverlay(ddCloseBtn); 2646 } 2647 }); 2648 }, 2649 /** All scrolling functions - Begin */ 2650 /** Shrink menu **/ 2651 shrinkMenu = function(bodyTop) { 2652 if ( UNCODE.isFrontEndEditor ) 2653 return; 2654 var logoShrink, 2655 offset = 100; 2656 for (var i = 0; i < logoel.length; i++) { 2657 if (((secmenuHeight == 0) ? bodyTop > menuHeight : bodyTop > secmenuHeight + offset) && !classie.hasClass(logoel[i], 'shrinked') && (wwidth > mediaQuery)) { 2658 classie.addClass(logoel[i], 'shrinked'); 2659 if (logoMinScale != undefined) { 2660 logoShrink = logolink.children; 2661 Array.prototype.forEach.call(logoShrink, function(singleLogo) { 2662 singleLogo.style.height = logoMinScale + 'px'; 2663 singleLogo.style.lineHeight = logoMinScale + 'px'; 2664 if (classie.hasClass(singleLogo, 'text-logo')) singleLogo.style.fontSize = logoMinScale + 'px'; 2665 }); 2666 } 2667 setTimeout(function() { 2668 calculateMenuHeight(false); 2669 //window.dispatchEvent(new Event('resize')); 2670 }, 300); 2671 } else if ((((secmenuHeight == 0) ? bodyTop == 0 : bodyTop <= secmenuHeight + offset) || (wwidth < mediaQuery)) && classie.hasClass(logoel[i], 'shrinked')) { 2672 classie.removeClass(logoel[i], 'shrinked'); 2673 if (logoMinScale != undefined) { 2674 logoShrink = logolink.children; 2675 Array.prototype.forEach.call(logoShrink, function(singleLogo) { 2676 singleLogo.style.height = singleLogo.getAttribute('data-maxheight') + 'px'; 2677 singleLogo.style.lineHeight = singleLogo.getAttribute('data-maxheight') + 'px'; 2678 if (classie.hasClass(singleLogo, 'text-logo')) singleLogo.style.fontSize = singleLogo.getAttribute('data-maxheight') + 'px'; 2679 }); 2680 } 2681 setTimeout(function() { 2682 calculateMenuHeight(false); 2683 //window.dispatchEvent(new Event('resize')); 2684 }, 300); 2685 } 2686 } 2687 }, 2688 /** Switch colors menu **/ 2689 switchColorsMenu = function(bodyTop, style) { 2690 for (var i = 0; i < transmenuel.length; i++) { 2691 if (masthead.style.opacity !== 1) masthead.style.opacity = 1;
2692 if ((secmenuHeight == 0) ? bodyTop > menuHeight / 2 : bodyTop > secmenuHeight) { 2693 if (classie.hasClass(masthead, 'style-dark-original')) { 2694 logo.className = logo.className.replace("style-light", "style-dark"); 2695 } 2696 if (classie.hasClass(masthead, 'style-light-original')) { 2697 logo.className = logo.className.replace("style-dark", "style-light"); 2698 } 2699 if (style != undefined) { 2700 if (style == 'dark') { 2701 classie.removeClass(transmenuel[i], 'style-light-override'); 2702 } 2703 if (style == 'light') { 2704 classie.removeClass(transmenuel[i], 'style-dark-override'); 2705 } 2706 classie.addClass(transmenuel[i], 'style-' + style + '-override'); 2707 } 2708 } else { 2709 if (style != undefined) { 2710 if (style == 'dark') { 2711 classie.removeClass(transmenuel[i], 'style-light-override'); 2712 } 2713 if (style == 'light') { 2714 classie.removeClass(transmenuel[i], 'style-dark-override'); 2715 } 2716 classie.addClass(transmenuel[i], 'style-' + style + '-override'); 2717 } 2718 } 2719 } 2720 if (pageHeader != undefined) { 2721 if (style != undefined) { 2722 if (classie.hasClass(pageHeader, 'header-style-dark')) { 2723 classie.removeClass(pageHeader, 'header-style-dark'); 2724 } 2725 if (classie.hasClass(pageHeader, 'header-style-light')) { 2726 classie.removeClass(pageHeader, 'header-style-light'); 2727 } 2728 classie.addClass(pageHeader, 'header-style-' + style); 2729 } 2730 } 2731 }, 2732 /** VisibleRows **/ 2733 visibleRowCol = function(bodyTop) { 2734 if ( typeof visibleRows == 'object') { 2735 for (var i = 0; i < visibleRows.length; i++) { 2736 var section = visibleRows[i], 2737 sectionHeight = outerHeight(section), 2738 offSetTop = bodyTop + ( section != null ? section.getBoundingClientRect().top : 0 ), 2739 offSetPosition = UNCODE.wheight + bodyTop - offSetTop; 2740 if (offSetPosition > 0 && offSetPosition < (sectionHeight + UNCODE.wheight)) { 2741 classie.addClass($kenburnsInner[0], 'uncode-scroll-visible'); 2742 visibleRows[i].dispatchEvent(new CustomEvent('enter-row')); 2743 } else { 2744 classie.removeClass($kenburnsInner[0], 'uncode-scroll-visible'); 2745 visibleRows[i].dispatchEvent(new CustomEvent('exit-row')); 2746 } 2747 } 2748 } 2749 }, 2750 /** KenBurns **/ 2751 kenburnsHeader = function(bodyTop) { 2752 var value; 2753 if ( typeof kenburnsHeaders == 'object' && kenburnsHeaders.length ) { 2754 for (var i = 0; i < kenburnsHeaders.length; i++) { 2755 var section = kenburnsHeaders[i].parentNode, 2756 sectionHeight = outerHeight(section), 2757 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2758 offSetPosition = UNCODE.wheight + bodyTop - offSetTop, 2759 $kenburnsInner = kenburnsHeaders[i].querySelectorAll('.header-bg'); 2760 if (classie.hasClass(kenburnsHeaders[i], 'header-carousel-wrapper')) { 2761 $kenburnsInner = kenburnsHeaders[i].querySelectorAll('.t-background-cover'); 2762 } 2763 if (offSetPosition > 0 && offSetPosition < (sectionHeight + UNCODE.wheight)) { 2764 for (var i = 0; i < $kenburnsInner.length; i++) { 2765 classie.addClass($kenburnsInner[i], 'uncode-kburns'); 2766 $kenburnsInner[i].dispatchEvent(new CustomEvent('enter-kburns')); 2767 } 2768 } else { 2769 for (var i = 0; i < $kenburnsInner.length; i++) { 2770 classie.removeClass($kenburnsInner[i], 'uncode-kburns'); 2771 $kenburnsInner[i].dispatchEvent(new CustomEvent('exit-kburns')); 2772 } 2773 } 2774 } 2775 } 2776 }, 2777 kenburnsRowCol = function(bodyTop) { 2778 var value; 2779 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2780 kenburnsRows = document.querySelectorAll('.with-kburns > .row-background > .background-wrapper, .with-kburns > .uncode-multi-bgs > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 2781 } 2782 if ( typeof kenburnsRows == 'object' && kenburnsRows.length ) { 2783 for (var i = 0; i < kenburnsRows.length; i++) { 2784 var section = kenburnsRows[i].parentNode, 2785 sectionHeight = outerHeight(section), 2786 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2787 offSetPosition = UNCODE.wheight + bodyTop - offSetTop, 2788 $kenburnsInner = kenburnsRows[i].querySelectorAll('.background-inner, .header-bg'); 2789 if (offSetPosition >
2789 0 && offSetPosition < (sectionHeight + UNCODE.wheight)) { 2790 classie.addClass($kenburnsInner[0], 'uncode-kburns'); 2791 $kenburnsInner[0].dispatchEvent(new CustomEvent('enter-kburns')); 2792 } else { 2793 classie.removeClass($kenburnsInner[0], 'uncode-kburns'); 2794 $kenburnsInner[0].dispatchEvent(new CustomEvent('exit-kburns')); 2795 } 2796 } 2797 } 2798 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2799 kenburnsCols = document.querySelectorAll('.with-kburns > .column-background > .background-wrapper, .with-kburns > .uncode-multi-bgs > .column-background > .background-wrapper'); 2800 } 2801 if ( typeof kenburnsCols == 'object' && kenburnsCols.length ) { 2802 for (var j = 0; j < kenburnsCols.length; j++) { 2803 var elm = kenburnsCols[j], 2804 $kenburnsInner = elm.querySelectorAll('.background-inner'); 2805 if (checkVisible(elm)) { 2806 classie.addClass($kenburnsInner[0], 'uncode-kburns'); 2807 $kenburnsInner[0].dispatchEvent(new CustomEvent('enter-kburns')); 2808 } else { 2809 classie.removeClass($kenburnsInner[0], 'uncode-kburns'); 2810 $kenburnsInner[0].dispatchEvent(new CustomEvent('exit-kburns')); 2811 } 2812 } 2813 } 2814 }, 2815 /** Zoom Out BackWash **/ 2816 backwashHeader = function(bodyTop) { 2817 var value; 2818 var onEndAnimationFn = function(ev){ 2819 if (animationEvent) { 2820 if (ev.animationName !== 'backwash') { 2821 return; 2822 } 2823 this.removeEventListener(animationEvent, onEndAnimationFn); 2824 } 2825 classie.addClass(ev.target, 'uncode-zoomout-already'); 2826 } 2827 if ( typeof backwashHeaders == 'object' && backwashHeaders.length ) { 2828 for (var i = 0; i < backwashHeaders.length; i++) { 2829 var section = backwashHeaders[i].parentNode, 2830 sectionHeight = outerHeight(section), 2831 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2832 offSetPosition = UNCODE.wheight + bodyTop - offSetTop, 2833 $backwashInner = backwashHeaders[i].querySelectorAll('.header-bg'); 2834 2835 if ( classie.hasClass($backwashInner[0], 'uncode-video-container') ) { 2836 continue; 2837 } 2838 2839 if (classie.hasClass(backwashHeaders[i], 'header-carousel-wrapper')) { 2840 $backwashInner = backwashHeaders[i].querySelectorAll('.t-background-cover'); 2841 } 2842 2843 if (offSetPosition > 0 && offSetPosition < (sectionHeight + UNCODE.wheight)) { 2844 for (var i = 0; i < $backwashInner.length; i++) { 2845 classie.addClass($backwashInner[i], 'uncode-zoomout'); 2846 $backwashInner[i].dispatchEvent(new CustomEvent('enter-zoomout')); 2847 } 2848 } else { 2849 for (var i = 0; i < $backwashInner.length; i++) { 2850 classie.removeClass($backwashInner[i], 'uncode-zoomout'); 2851 $backwashInner[i].dispatchEvent(new CustomEvent('exit-zoomout')); 2852 } 2853 } 2854 for (var i = 0; i < $backwashInner.length; i++) { 2855 $backwashInner[i].addEventListener(animationEvent, onEndAnimationFn); 2856 } 2857 } 2858 } 2859 }, 2860 backwashRowCol = function(bodyTop) { 2861 var value; 2862 var onEndAnimationFn = function(ev){ 2863 if (animationEvent) { 2864 if (ev.animationName !== 'backwash') { 2865 return; 2866 } 2867 this.removeEventListener(animationEvent, onEndAnimationFn); 2868 } 2869 classie.addClass(ev.target, 'uncode-zoomout-already'); 2870 } 2871 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2872 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'); 2873 } 2874 if ( typeof backwashRows == 'object' && backwashRows.length ) { 2875 for (var i = 0; i < backwashRows.length; i++) { 2876 var section = backwashRows[i].parentNode, 2877 sectionHeight = outerHeight(section), 2878 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2879 offSetPosition = UNCODE.wheight + bodyTop - offSetTop, 2880 $backwashInner = backwashRows[i].querySelectorAll('.background-inner'); 2881 2882 if ( classie.hasClass($backwashInner[0], 'uncode-video-container') ) { 2883 continue; 2884 } 2885 2886 if (offSetPosition >
2886 0 && offSetPosition < (sectionHeight + UNCODE.wheight) ) { 2887 classie.addClass($backwashInner[0], 'uncode-zoomout'); 2888 $backwashInner[0].dispatchEvent(new CustomEvent('enter-zoomout')); 2889 } else { 2890 classie.removeClass($backwashInner[0], 'uncode-zoomout'); 2891 $backwashInner[0].dispatchEvent(new CustomEvent('exit-zoomout')); 2892 } 2893 $backwashInner[0].addEventListener(animationEvent, onEndAnimationFn); 2894 } 2895 2896 } 2897 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2898 backwashCols = document.querySelectorAll('.with-zoomout > .column-background > .background-wrapper, .with-zoomout > .uncode-multi-bgs > .column-background > .background-wrapper'); 2899 } 2900 if ( typeof backwashCols == 'object' && backwashCols.length ) { 2901 for (var j = 0; j < backwashCols.length; j++) { 2902 var elm = backwashCols[j], 2903 $backwashInner = elm.querySelectorAll('.background-inner'); 2904 if (checkVisible(elm)) { 2905 classie.addClass($backwashInner[0], 'uncode-zoomout'); 2906 $backwashInner[0].dispatchEvent(new CustomEvent('enter-zoomout')); 2907 } else { 2908 classie.removeClass($backwashInner[0], 'uncode-zoomout'); 2909 $backwashInner[0].dispatchEvent(new CustomEvent('exit-zoomout')); 2910 } 2911 $backwashInner[0].addEventListener(animationEvent, onEndAnimationFn); 2912 } 2913 } 2914 }, 2915 /** Parallax Rows **/ 2916 parallaxRowCol = function(bodyTop) { 2917 var value; 2918 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2919 parallaxRows = document.querySelectorAll('.with-parallax > .row-background > .background-wrapper, .with-parallax > .uncode-multi-bgs > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 2920 } 2921 if (typeof parallaxRows == 'object') { 2922 for (var i = 0; i < parallaxRows.length; i++) { 2923 var section = parallaxRows[i].parentNode, 2924 thisHeight = outerHeight(parallaxRows[i]), 2925 sectionHeight = outerHeight(section), 2926 offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0), 2927 offSetPosition = UNCODE.wheight + bodyTop - offSetTop; 2928 if (offSetPosition > 0 && offSetPosition < (sectionHeight + UNCODE.wheight)) { 2929 value = ((offSetPosition - UNCODE.wheight) * speedDivider); 2930 if (Math.abs(value) < (thisHeight - sectionHeight)) {
2931 translateElement(parallaxRows[i], Math.floor(value)); 2932 } else { 2933 translateElement(parallaxRows[i], Math.floor(thisHeight - sectionHeight)); 2934 } 2935 } 2936 } 2937 } 2938 if ( UNCODE.isFrontEndEditor || UNCODE.isQuickView ) { 2939 parallaxCols = document.querySelectorAll('.with-parallax > .column-background > .background-wrapper, .with-parallax > .uncode-multi-bgs > .column-background > .background-wrapper'); 2940 } 2941 if (typeof parallaxCols == 'object') { 2942 for (var j = 0; j < parallaxCols.length; j++) { 2943 var section = parallaxCols[j].parentNode, 2944 thisHeight = outerHeight(parallaxCols[j]), 2945 sectionHeight = outerHeight(section), 2946 offSetTop = bodyTop + (section != null ? section.getBoundingClientRect().top : 0), 2947 offSetPosition = UNCODE.wheight + bodyTop - offSetTop; 2948 if (offSetPosition > 0 && offSetPosition < (sectionHeight + UNCODE.wheight)) { 2949 value = ((offSetPosition - UNCODE.wheight) * speedDivider); 2950 value *= .8; 2951 if (Math.abs(value) < (thisHeight - sectionHeight)) { 2952 translateElement(parallaxCols[j], Math.floor(value)); 2953 } else { 2954 translateElement(parallaxCols[j], Math.floor(thisHeight - sectionHeight)); 2955 } 2956 } 2957 } 2958 } 2959 }, 2960 /** Parallax Headers **/ 2961 parallaxHeader = function(bodyTop) { 2962 var value; 2963 if (typeof parallaxHeaders == 'object') { 2964 for (var i = 0; i < parallaxHeaders.length; i++) { 2965 var section = parallaxHeaders[i].parentNode, 2966 thisSibling = section.nextSibling, 2967 thisHeight, 2968 sectionHeight, 2969 offSetTop, 2970 offSetPosition; 2971 if (classie.hasClass(parallaxHeaders[i], 'header-carousel-wrapper')) { 2972 getDivChildren(parallaxHeaders[i], '.t-entry-visual-cont', function(item, l, total) { 2973 thisHeight = outerHeight(item); 2974 sectionHeight = outerHeight(section); 2975 offSetTop = bodyTop + section.getBoundingClientRect().top; 2976 offSetPosition = UNCODE.wheight + bodyTop - offSetTop; 2977 if (offSetPosition > 0 && offSetPosition < (sectionHeight + UNCODE.wheight)) { 2978 value = ((offSetPosition - UNCODE.wheight) * speedDivider); 2979 if (Math.abs(value) < (thisHeight - sectionHeight)) { 2980 translateElement(item, Math.floor(value)); 2981 } 2982 } 2983 }); 2984 } else { 2985 thisHeight = outerHeight(parallaxHeaders[i]); 2986 sectionHeight = outerHeight(section); 2987 offSetTop = bodyTop + section.getBoundingClientRect().top; 2988 offSetPosition = UNCODE.wheight + bodyTop - offSetTop; 2989 if (offSetPosition > 0 && offSetPosition < (sectionHeight + UNCODE.wheight)) { 2990 value = ((offSetPosition - UNCODE.wheight) * speedDivider); 2991 if (Math.abs(value) < (thisHeight - sectionHeight)) { 2992 translateElement(parallaxHeaders[i], Math.floor(value)); 2993 } 2994 } 2995 } 2996 } 2997 } 2998 }, 2999 /** Header opacity **/ 3000 headerOpacity = function(bodyTop) { 3001 if ( UNCODE.isFrontEndEditor ) { 3002 return; 3003 } 3004 if (headerWithOpacity && headerWithOpacity.length) { 3005 var thisHeight = outerHeight(headerWithOpacity[0]); 3006 if (bodyTop > thisHeight / 8) { 3007 if (pageHeader != undefined) classie.addClass(pageHeader, 'header-scrolled'); 3008 } else { 3009 if (pageHeader != undefined) classie.removeClass(pageHeader, 'header-scrolled'); 3010 } 3011 } 3012 }, 3013 /** Show hide scroll top arrow **/ 3014 showHideScrollup = function(bodyTop) { 3015 if ( bodyTop != 0 ) { 3016 if (bodyTop > UNCODE.wheight || ((bodyTop + UNCODE.wheight) >= docheight) && docheight > 0) { 3017 classie.addClass(document.body, 'window-scrolled'); 3018 classie.removeClass(document.body, 'hide-scrollup'); 3019 if (footerScroller && footerScroller[0] != undefined) { 3020 footerScroller[0].style.display = ''; 3021 } 3022 } else { 3023 if (classie.hasClass(document.body, 'window-scrolled')) classie.addClass(document.body, 'hide-scrollup'); 3024 classie.removeClass(document.body, 'window-scrolled'); 3025 } 3026 } 3027 }, 3028 /** Fix menu **/ 3029 fixMenu = function(){ 3030 if ( UNCODE.isFrontEndEditor ) 3031 return; 3032 menuwrapper = document.querySelectorAll(".menu-wrapper"); 3033 if ( ! classie.hasClass(document.body, 'vmenu') && UNCODE.isFullPage && !UNCODE.isFullPageSnap && classie.hasClass(document.body, 'uncode-fp-menu-hide') ) { 3034 menuwrapper = document.querySelector(".menu-wrapper"); 3035 pageHeader = document.getElementById("page-header"); 3036 menuwrapper.style.position = 'fixed'; 3037 menuwrapper.style.zIndex = '5'; 3038 } 3039 }, 3040 /** Hide Menu **/ 3041 hideMenu = function(bodyTop) { 3042 if ( UNCODE.isFrontEndEditor ) 3043 return; 3044 if (UNCODE.menuOpened || bodyTop < 0) return; 3045 if (classie.hasClass(document.body, 'vmenu')) { 3046 if (wwidth < mediaQuery) menuhide = document.querySelector('#masthead .menu-hide-vertical'); 3047 else menuhide = null; 3048 } else if (classie.hasClass(document.body, 'hmenu-center')) { 3049 if (wwidth > mediaQuery) menuhide = document.querySelector('#masthead .menu-hide'); 3050 else menuhide = document.querySelector('.menu-sticky-mobile .menu-hide'); 3051 } else { 3052 if (wwidth <= mediaQuery) menuhide = document.querySelector('.menu-sticky-mobile .menu-hide'); 3053 }
3054 menuMobileTransparent = document.querySelector('.menu-absolute.menu-transparent'); 3055 if (typeof menuhide == 'object' && menuhide != null && mainmenu[0] != undefined) { 3056 var translate, 3057 scrollingDown = true; 3058 /** fix for hmenu-center **/ 3059 var sticky_element = (typeof mainmenu.item === 'undefined' ? ((wwidth > mediaQuery) ? mainmenu[0] : mainmenu[1]) : mainmenu[0]); 3060 if (lastScrollValue == bodyTop) return; 3061 3062 if (lastScrollValue > bodyTop) scrollingDown = false; 3063 else scrollingDown = true; 3064 lastScrollValue = bodyTop; 3065 3066 if (!scrollingDown) { 3067 if (!UNCODE.scrolling) { 3068 if ((secmenuHeight == 0) ? bodyTop == 0 : bodyTop < secmenuHeight) { 3069 classie.removeClass(sticky_element.parentNode, 'is_stuck'); 3070 if (classie.hasClass(masthead, 'menu-transparent')) { 3071 if (( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) && !classie.hasClass(masthead.parentNode, 'no-header')) masthead.parentNode.style.height = '0px'; 3072 } 3073 if (wwidth < mediaQuery && secmenuHeight === 0) sticky_element.style.position = 'fixed'; 3074 else sticky_element.style.position = ''; 3075 hideMenuReset(sticky_element); 3076 clearTimeout(hidingTimer); 3077 } 3078 3079 if (classie.hasClass(menuhide, 'menu-hided')) { 3080 classie.removeClass(menuhide, 'menu-hided'); 3081 hidingTimer = setTimeout(function() { 3082 classie.addClass(sticky_element.parentNode, 'is_stuck'); 3083 hideMenuReset(sticky_element); 3084 }, 400); 3085 } 3086 } 3087 } else { 3088 if (menusticky.length == 0 && bodyTop < UNCODE.wheight / 3) { 3089 if (sticky_element.style.position == 'fixed') sticky_element.style.position = ''; 3090 } 3091 if (bodyTop > UNCODE.wheight / 2) { 3092 clearTimeout(hidingTimer); 3093 if (!classie.hasClass(menuhide, 'menu-hided')) { 3094 classie.addClass(menuhide, 'menu-hided'); 3095 classie.addClass(sticky_element.parentNode, 'is_stuck'); 3096 if (sticky_element.style.position != 'fixed') { 3097 sticky_element.style.visibility = 'hidden'; 3098 sticky_element.style.position = 'fixed'; 3099 sticky_element.style.top = '0px'; 3100 } 3101 translateElement(menuhide, -UNCODE.menuMobileHeight - 1); 3102 } 3103 } 3104 } 3105 } 3106 }, 3107 hideMenuReset = function(sticky_element) { 3108 var topOffset = 0; 3109 if (sticky_element.style.visibility == 'hidden') sticky_element.style.visibility = ''; 3110 if (bodyBorder > 0) topOffset += bodyBorder; 3111 if (adminBar != null && window.getComputedStyle(adminBar,null).getPropertyValue("position") != 'fixed') adminBarHeight = 0; 3112 if (adminBarHeight > 0) topOffset += adminBarHeight; 3113 //sticky_element.style.top = topOffset + 'px'; 3114 if (!classie.hasClass(document.body, 'boxed-width') && boxWidth > 0) sticky_element.style.width = boxWidth + 'px'; 3115 translateElement(menuhide, 0); 3116 }, 3117 /** Stick Menu **/ 3118 stickMenu = function(bodyTop) { 3119 if ( mainmenu[0] == undefined ) { 3120 mainmenu = document.querySelectorAll('.vmenu .vmenu-container, .menu-primary .menu-container'); 3121 } 3122 if (header && mainmenu[0] != undefined) { 3123 var stickyHeight = secmenuHeight; 3124 menuMobileTransparent = document.querySelector('.menu-absolute.menu-transparent'); 3125 if (classie.hasClass(mainmenu[0], 'vmenu-container') && wwidth > mediaQuery) return; 3126 /** fix for hmenu-center **/ 3127 var sticky_element = (typeof mainmenu.item === 'undefined' ? (( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) ? mainmenu[0] : mainmenu[1]) : mainmenu[0]); 3128 if ( classie.hasClass(document.body, 'hmenu-center') && document.getElementById("logo-container-mobile") != null ) { 3129 stickyHeight = secmenuHeight + outerHeight(document.getElementById("logo-container-mobile")); 3130 } 3131 3132 if ((stickyHeight == 0 && ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery)) ? bodyTop > (0 + adminBarHeight) : bodyTop > (stickyHeight + adminBarHeight)) { 3133 if (!classie.hasClass(sticky_element.parentNode, 'is_stuck')) { 3134 classie.addClass(sticky_element.parentNode, 'is_stuck'); 3135 sticky_element.style.position = 'fixed'; 3136 var getAnchorTop = bodyBorder; 3137 if (adminBar != null && window.getComputedStyle(adminBar,null).getPropertyValue("position") != 'fixed') adminBarHeight = 0; 3138 if (adminBarHeight > 0) getAnchorTop += adminBarHeight; 3139 sticky_element.style.top = getAnchorTop + 'px'; 3140 if (!classie.hasClass(document.body, 'boxed-width') && boxWidth > 0) sticky_element.style.width = boxWidth + 'px'; 3141 } 3142 } else { 3143 clearTimeout(hidingTimer); 3144 classie.removeClass(sticky_element.parentNode, 'is_stuck'); 3145 sticky_element.style.position = '';
3146 if ( ( isMobileTransparent && menuMobileTransparent !== null ) || wwidth > mediaQuery) sticky_element.style.position = ''; 3147 if (classie.hasClass(document.body, 'hmenu-center')) sticky_element.style.position = 'absolute'; 3148 sticky_element.style.top = ''; 3149 } 3150 } 3151 }, 3152 translateElement = function(element, valueY) { 3153 var translate = 'translate3d(0, ' + valueY + 'px' + ', 0)'; 3154 element.style['-webkit-transform'] = translate; 3155 element.style['-moz-transform'] = translate; 3156 element.style['-ms-transform'] = translate; 3157 element.style['-o-transform'] = translate; 3158 element.style['transform'] = translate; 3159 }, 3160 setScrollPosition, 3161 scrollFunction = function() { 3162 if ( ! UNCODE.isFullPage ) { 3163 menusticky = UNCODE.isMobile ? document.querySelectorAll('.menu-sticky-mobile') : document.querySelectorAll('.menu-sticky, .menu-sticky-vertical'); 3164 if (menusticky != undefined && menusticky.length) stickMenu(bodyTop); 3165 kenburnsHeader(bodyTop); 3166 kenburnsRowCol(bodyTop); 3167 backwashHeader(bodyTop); 3168 backwashRowCol(bodyTop); 3169 if (logoel != undefined && logoel.length && !isMobile) shrinkMenu(bodyTop); 3170 hideMenu(bodyTop); 3171 if (isMobileParallaxAllowed || !isMobile) { 3172 if (header && menusticky != undefined && menusticky.length) 3173 switchColorsMenu(bodyTop); 3174 parallaxRowCol(bodyTop); 3175 parallaxHeader(bodyTop); 3176 headerOpacity(bodyTop); 3177 visibleRowCol(bodyTop); 3178 } 3179 clearRequestTimeout(setScrollPosition); 3180 setScrollPosition = requestTimeout( function(){ 3181 scrollRowHeight_fix = window.pageYOffset; 3182 }, 100 ); 3183 } 3184 }, 3185 /** Custom Cursor **/ 3186 initCursor = function(){ 3187 var clientX, clientY; 3188 3189 var $customCursor = document.getElementById('uncode-custom-cursor'), 3190 $customPilot = document.getElementById('uncode-custom-cursor-pilot'), 3191 cursorType = 'auto', 3192 loadedCursor = false; 3193 3194 document.addEventListener("mousemove", function(e) { 3195 clientX = e.clientX; 3196 clientY = e.clientY; 3197 3198 if ( loadedCursor !== true ) { 3199 loadedCursor = true; 3200 classie.addClass($customCursor, 'loaded-cursor'); 3201 if ( $customPilot !== null ) { 3202 classie.addClass($customPilot, 'loaded-cursor'); 3203 } 3204 } 3205 }); 3206 3207 function render() { 3208 if ( $customCursor != null ) { 3209 $customCursor.style.transform = 'translate3d(' + clientX + 'px, ' + clientY + 'px, 0)'; 3210 if ( $customPilot !== null ) { 3211 $customPilot.style.transform = 'translate3d(' + clientX + 'px, ' + clientY + 'px, 0)'; 3212 } 3213 requestAnimationFrame(render); 3214 } 3215 }; 3216 requestAnimationFrame(render); 3217 }, 3218 3219 /** Shape Dividers **/ 3220 shapeDivider = function() { 3221 var $shape = '.uncode-divider-wrap'; 3222 3223 forEachElement($shape, function($el, i) { 3224 var elH = parseInt( $el.getAttribute('data-height') ), 3225 elHunit = $el.getAttribute('data-unit'), 3226 newEl, 3227 $parent = $el.parentNode, 3228 parentH, 3229 $svg = $el.getElementsByTagName('svg')[0]; 3230 3231 if ( elHunit == 'px' ) { 3232 3233 switch (true) { 3234 case (wwidth < 1500 && wwidth >= 1180): 3235 newEl = elH*0.8; 3236 break; 3237 3238 case (wwidth < 1180 && wwidth >= 960): 3239 newEl = elH*0.65; 3240 break; 3241 3242 case (wwidth < 960 && wwidth >= 570): 3243 newEl = elH*0.5; 3244 break; 3245 3246 case (wwidth < 570): 3247 newEl = elH*0.25; 3248 break; 3249 3250 default: 3251 newEl = elH; 3252 } 3253 3254 $el.style.height = newEl + elHunit; 3255 } 3256 3257 3258 if ( classie.hasClass($el, 'uncode-divider-preserve-ratio') && ( window.navigator.userAgent.indexOf('MSIE ') !== -1 || window.navigator.userAgent.indexOf('Trident/') !== -1 ) ) { 3259 3260 $svg.setAttribute('preserveAspectRatio','none'); 3261 3262 var sizes = $svg.getAttribute('viewBox').split(' '), 3263 svgW = sizes[2], 3264 svgH = sizes[3], 3265 newSvgW; 3266 3267 newSvgW = newEl * ( svgW / svgH ); 3268 3269 $svg.style.width = newSvgW + 'px'; 3270 3271 } 3272 }); 3273 }; 3274 if (!noScroll && document.body == null) { 3275 window.addEventListener('scroll', function(e) { 3276 if ( ! UNCODE.isFullPage ) { 3277 bodyTop = document.documentElement.scrollTop || document.body.scrollTop; 3278 scrollFunction(); 3279 showHideScrollup(bodyTop); 3280 } 3281 }, false); 3282 } 3283 window.addEventListener('uncode-quick-view-loaded', function() { 3284 document.getElementById('unmodal-content').addEventListener('scroll', function(e) { 3285 bodyTop = document.getElementById('unmodal-content').scrollTop; 3286 scrollFunction(); 3287 showHideScrollup(bodyTop); 3288 }, false); 3289 }, false); 3290 /** All scrolling functions - End */ 3291 /** help functions */ 3292 function getClosest(el, tag) { 3293 do { 3294 if (el.className != undefined && el.className.indexOf(tag) > -1) return el; 3295 } while (el = el.parentNode); 3296 // not found :( 3297 return null; 3298 } 3299 3300 function outerHeight(el, includeMargin) { 3301 if (el != null) { 3302 var height = el.offsetHeight; 3303 if (includeMargin) { 3304 var style = el.currentStyle || getComputedStyle(el); 3305 height += parseInt(style.marginTop) + parseInt(style.marginBottom); 3306 } 3307 return height; 3308 } 3309 } 3310 3311 function outerWidth(el, includeMargin) { 3312 var width = el.offsetWidth; 3313 if (includeMargin) { 3314 var style = el.currentStyle || getComputedStyle(el); 3315 width += parseInt(style.marginLeft) + parseInt(style.marginRight); 3316 } 3317 return width; 3318 } 3319 // Replicate jQuery .each method 3320 function forEachElement(selector, fn) { 3321 var elements = document.querySelectorAll(selector); 3322 for (var i = 0; i < elements.length; i++) fn(elements[i], i); 3323 } 3324 3325 function getDivChildren(containerId, selector, fn) { 3326 if (containerId !== null) { 3327 var elements = containerId.querySelectorAll(selector); 3328 for (var i = 0; i < elements.length; i++) fn(elements[i], i, elements.length); 3329 } 3330 } 3331 3332 function hideFooterScroll() { 3333 if (classie.hasClass(document.body, 'hide-scrollup')) footerScroller[0].style.display = "none"; 3334 } 3335 window.addEventListener("load", function(event) {
3336 if (SiteParameters.dynamic_srcset_active === '1') { 3337 UNCODE.adaptive_srcset_bg(); 3338 UNCODE.adaptive_srcset(false); 3339 } 3340 classie.addClass(document.body, 'uncode-loaded'); 3341 }); 3342 window.addEventListener("dynamic_srcset_load", function(event) { 3343 if (SiteParameters.dynamic_srcset_active === '1') { 3344 UNCODE.refresh_dynamic_srcset_size(false); 3345 } 3346 }); 3347 document.addEventListener("DOMContentLoaded", function(event) { 3348 UNCODE.adaptive(); 3349 boxWrapper = document.querySelectorAll('.box-wrapper'); 3350 docheight = boxWrapper[0] != undefined ? boxWrapper[0].offsetHeight : 0; 3351 // if (!classie.hasClass(document.body, 'vmenu') && !classie.hasClass(document.body, 'menu-offcanvas')) init_overlay(); 3352 init_overlay(); 3353 kenburnsRows = document.querySelectorAll('.with-kburns > .row-background > .background-wrapper, .with-kburns > .uncode-multi-bgs > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 3354 kenburnsCols = document.querySelectorAll('.with-kburns > .column-background > .background-wrapper, .with-kburns > .uncode-multi-bgs > .column-background > .background-wrapper'); 3355 backwashRows = document.querySelectorAll('.with-zoomout > .row-background > .background-wrapper, .with-zoomout > .uncode-multi-bgs > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .row-background > .background-wrapper, .with-zoomout > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 3356 backwashCols = document.querySelectorAll('.with-zoomout > .column-background > .background-wrapper, .with-zoomout > .uncode-multi-bgs > .column-background > .background-wrapper'); 3357 if (!UNCODE.isMobile || isMobileParallaxAllowed) { 3358 parallaxRows = document.querySelectorAll('.with-parallax > .row-background > .background-wrapper, .with-parallax > .uncode-multi-bgs > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper'); 3359 parallaxCols = document.querySelectorAll('.with-parallax > .column-background > .background-wrapper, .with-parallax > .uncode-multi-bgs > .column-background > .background-wrapper'); 3360 } 3361 footerScroller = document.querySelectorAll('.footer-scroll-top'); 3362 if (footerScroller && footerScroller[0] != undefined) { 3363 if (transitionEvent) { 3364 footerScroller[0].addEventListener(transitionEvent, hideFooterScroll); 3365 } 3366 } 3367 Array.prototype.forEach.call(document.querySelectorAll('.row-inner'), function(el) { 3368 el.style.height = ''; 3369 el.style.marginBottom = ''; 3370 }); 3371 setRowHeight(document.querySelectorAll('.page-wrapper .row-parent, footer .row-parent')); 3372 initVideoComponent(document.body, '.uncode-video-container.video:not(.drop-move):not(.fluid-object), .uncode-video-container.self-video:not(.drop-move)'); 3373 }); 3374 /** On resize events **/ 3375 window.addEventListener("vc-resize", function() { 3376 scrollRowHeight_fix = window.pageYOffset; 3377 Array.prototype.forEach.call(document.querySelectorAll('.row-inner'), function(el) { 3378 el.style.height = ''; 3379 el.style.marginBottom = ''; 3380 }); 3381 setRowHeight(document.querySelectorAll('.page-wrapper .row-parent, footer .row-parent'), false, true); 3382 }); 3383 var setIsScrolling; 3384 window.addEventListener("scroll", function() { 3385 UNCODE.setIsScrolling = true; 3386 clearRequestTimeout(setIsScrolling); 3387 3388 setIsScrolling = requestTimeout(function() { 3389 UNCODE.setIsScrolling = false; 3390 }, 66); 3391 }); 3392 window.addEventListener("resize", function(e) { 3393 scrollRowHeight_fix = window.pageYOffset; 3394 docheight = (boxWrapper != undefined && boxWrapper[0] != undefined) ? boxWrapper[0].offsetHeight : 0; 3395 var oldWidth = wwidth; 3396 UNCODE.wwidth = wwidth = window.innerWidth || document.documentElement.clientWidth; 3397 UNCODE.wheight = wheight = (window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2); 3398 if ( isSplitMenu && typeof resizeTimer_ === 'undefined' ) centerSplitMenu(); 3399 if (isMobile && (oldWidth == wwidth)) return false;
3400 calculateMenuHeight(false); 3401 initBox(); 3402 window.dispatchEvent(boxEvent); 3403 scrollFunction(); 3404 shapeDivider(); 3405 showHideScrollup(bodyTop); 3406 clearTimeout(resizeTimer_); 3407 resizeTimer_ = setTimeout(function() { 3408 if (isSplitMenu) centerSplitMenu(); 3409 }, 10); 3410 resizeThrottle( 3411 function() { 3412 if (SiteParameters.dynamic_srcset_active === '1') { 3413 UNCODE.refresh_dynamic_srcset_size(false); 3414 } 3415 UNCODE.isMobile = UNCODE.wwidth <= UNCODE.mediaQuery; 3416 menuOpacity(); 3417 headerHeight('.header-wrapper'); 3418 }, 100 3419 ); 3420 if ( UNCODE.setIsScrolling !== true ) { 3421 clearTimeout(resizeTimer); 3422 resizeTimer = setTimeout(function() { 3423 if ( UNCODE.setIsScrolling !== true ) { 3424 UNCODE.wheight = wheight = (window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2); 3425 Array.prototype.forEach.call(document.querySelectorAll('.row-inner'), function(el) { 3426 el.style.height = ''; 3427 el.style.marginBottom = ''; 3428 }); 3429 setRowHeight(document.querySelectorAll('.page-wrapper .row-parent, footer .row-parent'), false, true); 3430 } 3431 initVideoComponent(document.body, '.uncode-video-container.video:not(.drop-move):not(.fluid-object), .uncode-video-container.self-video:not(.drop-move)'); 3432 }, 500); 3433 } 3434 }); 3435 3436 window.addEventListener("lateral_resize", function(e) { 3437 fixMenuHeight(); 3438 calculateMenuHeight(false); 3439 scrollFunction(); 3440 headerHeight('.header-wrapper'); 3441 }); 3442 3443 var resizeThrottle = (function () { 3444 var timer = 0; 3445 return function (callback, ms) { 3446 clearTimeout(timer); 3447 timer = setTimeout(callback, ms); 3448 }; 3449 })(); 3450 3451 /** 3452 * On DOM ready 3453 */ 3454 window.addEventListener("load", function(){ 3455 if (!UNCODE.isMobile) { 3456 setTimeout(function() { 3457 // window.dispatchEvent(UNCODE.boxEvent); 3458 if (typeof Waypoint !== 'undefined') { 3459 Waypoint.refreshAll(); 3460 } 3461 }, 2000); 3462 } 3463 //repeat it for mobile since it changes layout on carousel after DOM loading 3464 if (UNCODE.isMobile && !isMobileParallaxAllowed) { 3465 kenburnsHeader(bodyTop); 3466 kenburnsRowCol(bodyTop); 3467 } 3468 backwashHeader(bodyTop); 3469 backwashRowCol(bodyTop); 3470 scrollFunction(); 3471 showHideScrollup(bodyTop); 3472 3473 // if (document.createEvent) { // W3C 3474 // var ev = document.createEvent('Event'); 3475 // ev.initEvent('resize', true, true); 3476 // window.dispatchEvent(ev); 3477 // } else { // IE 3478 // document.fireEvent('onresize'); 3479 // } 3480 3481 scrollRowHeight_fix = window.pageYOffset; 3482 docheight = (boxWrapper != undefined && boxWrapper[0] != undefined) ? boxWrapper[0].offsetHeight : 0; 3483 var oldWidth = wwidth; 3484 UNCODE.wwidth = wwidth = window.innerWidth || document.documentElement.clientWidth; 3485 UNCODE.wheight = wheight = (window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2); 3486 if ( isSplitMenu && typeof resizeTimer_ === 'undefined' ) { 3487 centerSplitMenu(); 3488 } 3489 calculateMenuHeight(false); 3490 headerHeight('.header-wrapper'); 3491 3492 }, false); 3493 3494 function localStorageAvailable() { 3495 try { 3496 var storage = window['localStorage'], 3497 x = '__storage_test__'; 3498 storage.setItem(x, x); 3499 storage.removeItem(x); 3500 return true; 3501 } catch(e) { 3502 return false; 3503 } 3504 } 3505 3506 /** 3507 * Print Dialog check 3508 */ 3509 window.addEventListener("beforeprint", function(event) { 3510 UNCODE.printDialogOpen = true; 3511 }); 3512 window.addEventListener("afterprint", function(event) { 3513 UNCODE.printDialogOpen = false; 3514 window.dispatchEvent(new Event('resize')); 3515 }); 3516 3517 var UNCODE = { 3518 bodyTop: bodyTop, 3519 boxEvent: boxEvent, 3520 bodyBorder: bodyBorder, 3521 initBox: initBox, 3522 adminBarHeight: 0, 3523 menuHeight: 0, 3524 menuMobileHeight: 0, 3525 menuOpacity: menuOpacity, 3526 fixMenuHeight: fixMenuHeight, 3527 verticalRightMenu: verticalRightMenu, 3528 initHeader: initHeader, 3529 initRow: initRow, 3530 initSection: initSection, 3531 initCursor: initCursor, 3532 setRowHeight: setRowHeight, 3533 switchColorsMenu: switchColorsMenu, 3534 isMobile: isMobile, 3535 scrolling: false, 3536 menuHiding: false, 3537 menuOpened: false, 3538 menuMobileTriggerEvent: menuMobileTriggerEvent, 3539 mediaQuery: mediaQuery, 3540 mediaQueryMobile: mediaQueryMobile, 3541 initVideoComponent: initVideoComponent, 3542 hideMenu: hideMenu, 3543 wwidth: wwidth, 3544 wheight: wheight, 3545 printDialogOpen: printDialogOpen,
3546 webp_lossy_supported: SiteParameters.force_webp ? true : localStorageAvailable() && localStorage.getItem('webp_lossy_supported') === 'true' ? true : false, 3547 webp_lossless_supported: SiteParameters.force_webp ? true : localStorageAvailable() && localStorage.getItem('webp_lossless_supported') === 'true' ? true : false, 3548 }; 3549 // transport 3550 if (typeof define === 'function' && define.amd) { 3551 // AMD 3552 define(UNCODE); 3553 } else { 3554 // browser global 3555 window.UNCODE = UNCODE; 3556 } 3557 3558 UNCODE.check_webp_support = function(feature, callback) { 3559 // https://developers.google.com/speed/webp/faq#in_your_own_javascript 3560 var kTestImages = { 3561 lossy: "UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", 3562 lossless: "UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==", 3563 alpha: "UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==", 3564 // animation: "UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA" 3565 }; 3566 var img = new Image(); 3567 img.onload = function () { 3568 var result = (img.width > 0) && (img.height > 0); 3569 callback(feature, result); 3570 }; 3571 img.onerror = function () { 3572 callback(feature, false); 3573 }; 3574 img.src = "data:image/webp;base64," + kTestImages[feature]; 3575 } 3576 3577 UNCODE.check_webp_support('lossy', function (feature, isSupported) { 3578 if (isSupported) { 3579 UNCODE.webp_lossy_supported = true; 3580 if (localStorageAvailable()) { 3581 localStorage.setItem('webp_lossy_supported', true); 3582 } 3583 } 3584 }); 3585 3586 UNCODE.check_webp_support('lossless', function (feature, isSupported) { 3587 if (isSupported) { 3588 UNCODE.webp_lossless_supported = true; 3589 if (localStorageAvailable()) { 3590 localStorage.setItem('webp_lossless_supported', true); 3591 } 3592 } 3593 }); 3594 3595 UNCODE.adaptive = function() { 3596 if (SiteParameters.dynamic_srcset_active === '1') { 3597 return; 3598 } 3599 3600 var images = new Array(), 3601 getImages = document.querySelectorAll('.adaptive-async:not(.adaptive-fetching)'); 3602 for (var i = 0; i < getImages.length; i++) { 3603 var imageObj = {}, 3604 el = getImages[i]; 3605 if (classie.hasClass(el, 'woocommerce-product-gallery__image-first__img')) { 3606 continue; 3607 } 3608 classie.addClass(el, 'adaptive-fetching'); 3609 imageObj.unique = el.getAttribute('data-uniqueid'); 3610 imageObj.url = el.getAttribute('data-guid'); 3611 imageObj.path = el.getAttribute('data-path'); 3612 imageObj.singlew = el.getAttribute('data-singlew'); 3613 imageObj.singleh = el.getAttribute('data-singleh'); 3614 imageObj.origwidth = el.getAttribute('data-width'); 3615 imageObj.origheight = el.getAttribute('data-height'); 3616 imageObj.crop = el.getAttribute('data-crop'); 3617 imageObj.fixed = el.getAttribute('data-fixed') == undefined ? null : el.getAttribute('data-fixed'); 3618 imageObj.screen = window.uncodeScreen; 3619 imageObj.images = window.uncodeImages; 3620 images.push(imageObj); 3621 } 3622 3623 var post_data = { 3624 images: JSON.stringify(images), 3625 action: 'get_adaptive_async', 3626 ai_breakpoints: SiteParameters.ai_breakpoints, 3627 resize_quality: SiteParameters.resize_quality, 3628 register_metadata: SiteParameters.register_metadata, 3629 nonce_adaptive_images: SiteParameters.nonce_adaptive_images 3630 }; 3631 3632 if (images.length > 0) { 3633 var xhr = new XMLHttpRequest(); 3634 xhr.open('POST', SiteParameters.ajax_url, true); 3635 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 3636 xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 3637 3638 xhr.onreadystatechange = function() { 3639 if (xhr.readyState == XMLHttpRequest.DONE) { 3640 if (xhr.status == 200 && xhr.responseText) { 3641 var jsonResponse = JSON.parse(xhr.responseText); 3642 3643 if (jsonResponse.success && jsonResponse.data.images) { 3644 var images = jsonResponse.data.images; 3645 3646 for (var i = 0; i < images.length; i++) { 3647 var val = images[i]; 3648 var processedImageID = val.id; 3649 var processedImageUniqueID = val.unique; 3650 var processedImageisNew = val.new_crop === true ? true : false;
3651 var getImage = document.querySelectorAll('[data-uniqueid="'+processedImageUniqueID+'"]'); 3652 3653 for (var j = 0; j < getImage.length; j++) { 3654 var attrScr = getImage[j].getAttribute('src'), 3655 replaceImg = new Image(); 3656 replaceImg.source = attrScr; 3657 replaceImg.el = getImage[j]; 3658 3659 classie.removeClass(getImage[j], 'adaptive-async'); 3660 classie.removeClass(getImage[j], 'adaptive-fetching'); 3661 3662 replaceImg.onload = function () { 3663 3664 var _this = this, 3665 parentNode = (_this.el).parentNode, 3666 placeH; 3667 3668 //Workaround for lazy-load flickering on Firefox 3669 if ( typeof parentNode.prepend == 'undefined') { 3670 if (_this.source !== null) { 3671 (_this.el).src = _this.src; 3672 } else { 3673 (_this.el).style.backgroundImage = 'url("'+_this.src+'")'; 3674 } 3675 3676 classie.addClass(_this.el, 'async-done'); 3677 _this.el.dispatchEvent(new CustomEvent("async-done")); 3678 } else { 3679 if (_this.source !== null) { 3680 placeH = document.createElement("IMG"); 3681 placeH.setAttribute('class', 'placeH'); 3682 placeH.src = _this.src; 3683 placeH.style.position = 'absolute'; 3684 placeH.style.opacity = '0'; 3685 } else { 3686 placeH = document.createElement("DIV"); 3687 placeH.setAttribute('style', _this.el.getAttribute('style')); 3688 placeH.setAttribute('class', 'placeH ' + _this.el.getAttribute('class')); 3689 placeH.style.backgroundImage = 'url("'+_this.src+'")'; 3690 placeH.style.backgroundSize = 'cover'; 3691 placeH.style.backgroundPosition = 'center'; 3692 placeH.style.position = 'absolute'; 3693 placeH.style.top = '0'; 3694 placeH.style.width = '100%'; 3695 placeH.style.height = '100%'; 3696 } 3697 3698 if ( !classie.hasClass( _this.el, 'box-wrapper') ) { 3699 parentNode.prepend(placeH); 3700 } 3701 3702 requestTimeout(function(){ 3703 if (_this.source !== null) { 3704 (_this.el).src = _this.src; 3705 } else { 3706 (_this.el).style.backgroundImage = 'url("'+_this.src+'")'; 3707 } 3708 if ( !classie.hasClass( _this.el, 'box-wrapper') ) { 3709 parentNode.removeChild(placeH); 3710 } 3711 classie.addClass(_this.el, 'async-done'); 3712 _this.el.dispatchEvent(new CustomEvent("async-done")); 3713 }, 250); 3714 } 3715 } 3716 replaceImg.src = val.url; 3717 } 3718 3719 if (processedImageisNew && SiteParameters.optimize_shortpixel_image == true) { 3720 UNCODE.process_shortpixel_image(processedImageID); 3721 } 3722 } 3723 3724 } else { 3725 if (SiteParameters.enable_debug == true) { 3726 // This console log is disabled by default 3727 // So nothing is printed in a typical installation 3728 // 3729 // It can be enabled for debugging purposes setting 3730 // the 'uncode_enable_debug_on_js_scripts' filter to true 3731 console.log('There was an error: bad response'); 3732 } 3733 } 3734 3735 } else if (xhr.status == 400) { 3736 if (SiteParameters.enable_debug == true) { 3737 // This console log is disabled by default 3738 // So nothing is printed in a typical installation 3739 // 3740 // It can be enabled for debugging purposes setting 3741 // the 'uncode_enable_debug_on_js_scripts' filter to true 3742 console.log('There was an error 400'); 3743 } 3744 } else { 3745 if (SiteParameters.enable_debug == true) { 3746 // This console log is disabled by default 3747 // So nothing is printed in a typical installation 3748 // 3749 // It can be enabled for debugging purposes setting 3750 // the 'uncode_enable_debug_on_js_scripts' filter to true 3751 console.log('Something else other than 200 was returned'); 3752 } 3753 } 3754 } 3755 } 3756 3757 // Serialize our data 3758 var queryString = "", 3759 arrayLength = Object.keys(post_data).length, 3760 arrayCounter = 0; 3761 3762 for (var key in post_data) { 3763 queryString += key + "=" + post_data[key]; 3764 3765 if (arrayCounter < arrayLength - 1) { 3766 queryString += "&"; 3767 } 3768 3769 arrayCounter++; 3770 } 3771 3772 xhr.send(queryString); 3773 } 3774 }; 3775 3776 UNCODE.adaptive_srcset_replace_bg = function (currentRow) { 3777 if (currentRow === null) { 3778 return; 3779 } 3780
3781 var mobileBreakpoint = SiteParameters.dynamic_srcset_bg_mobile_breakpoint ? parseInt(SiteParameters.dynamic_srcset_bg_mobile_breakpoint, 10) : 570; 3782 var images = currentRow.querySelectorAll('.srcset-bg-async:not(.srcset-bg-init)'); 3783 3784 for (var i = 0; i < images.length; i++) { 3785 var el = images[i]; 3786 classie.addClass(el, 'srcset-bg-init'); 3787 var bg_url = el.dataset.backgroundImage; 3788 var mobile_bg_url = el.dataset.mobileBackgroundImage; 3789 3790 if (SiteParameters.activate_webp && el.dataset.backgroundImageWebp) { 3791 if ((el.dataset.mime === 'png' && UNCODE.webp_lossless_supported) || (el.dataset.mime === 'jpeg' && UNCODE.webp_lossy_supported)) { 3792 bg_url = el.dataset.backgroundImageWebp; 3793 el.dataset.backgroundImage = bg_url; 3794 el.removeAttribute('data-background-image-webp'); 3795 } 3796 } 3797 3798 if (SiteParameters.activate_webp && el.dataset.mobileBackgroundImageWebp && mobile_bg_url) { 3799 if ((el.dataset.mime === 'png' && UNCODE.webp_lossless_supported) || (el.dataset.mime === 'jpeg' && UNCODE.webp_lossy_supported)) { 3800 mobile_bg_url = el.dataset.mobileBackgroundImageWebp; 3801 el.dataset.mobileBackgroundImage = mobile_bg_url; 3802 el.removeAttribute('data-mobile-background-image-webp'); 3803 } 3804 } 3805 3806 if (screenInfo.width <= mobileBreakpoint && mobile_bg_url) { 3807 el.style.backgroundImage = 'url("' + mobile_bg_url + '")'; 3808 } else { 3809 el.style.backgroundImage = 'url("' + bg_url + '")'; 3810 } 3811 3812 classie.addClass(el, 'srcset-bg-async'); 3813 } 3814 } 3815 3816 UNCODE.adaptive_srcset_bg = function() { 3817 var mobileSize = SiteParameters.dynamic_srcset_bg_mobile_size ? parseInt(SiteParameters.dynamic_srcset_bg_mobile_size, 10) : false; 3818 3819 if (!(mobileSize > 0)) { 3820 return; 3821 } 3822 3823 var images = new Array(); 3824 var getImages = document.querySelectorAll('.srcset-bg-generate-img:not(.adaptive-fetching)'); 3825 3826 for (var i = 0; i < getImages.length; i++) { 3827 var imageObj = {}; 3828 var el = getImages[i]; 3829 3830 classie.addClass(el, 'srcset-bg-fetching'); 3831 imageObj.unique = el.getAttribute('data-uniqueid'); 3832 imageObj.url = el.getAttribute('data-guid'); 3833 imageObj.path = el.getAttribute('data-path'); 3834 imageObj.origwidth = el.getAttribute('data-width'); 3835 imageObj.origheight = el.getAttribute('data-height'); 3836 3837 images.push(imageObj); 3838 } 3839 3840 if (images.length > 0) { 3841 var post_data = { 3842 images: JSON.stringify(images), 3843 action: 'regenerate_srcset_bg_async', 3844 resize_quality: SiteParameters.resize_quality, 3845 mobile_size: mobileSize, 3846 nonce_srcset_async: SiteParameters.nonce_srcset_async 3847 }; 3848 3849 var xhr = new XMLHttpRequest(); 3850 xhr.open('POST', SiteParameters.ajax_url, true); 3851 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 3852 xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 3853 3854 xhr.onreadystatechange = function() { 3855 if (xhr.readyState == XMLHttpRequest.DONE) { 3856 if (xhr.status == 200 && xhr.responseText) { 3857 var jsonResponse = JSON.parse(xhr.responseText); 3858 3859 if (jsonResponse.success && jsonResponse.data.images) { 3860 var processedImages = jsonResponse.data.images; 3861 3862 for (var i = 0; i < processedImages.length; i++) { 3863 var processedImageID = processedImages[i].id; 3864 var processedImageUniqueID = processedImages[i].unique; 3865 var processedImageisNew = processedImages[i].new_crop === true ? true : false; 3866 var getImage = document.querySelectorAll('[data-uniqueid="'+processedImageUniqueID+'"]'); 3867 3868 for (var j = 0; j < getImage.length; j++) { 3869 classie.removeClass(getImage[j], 'srcset-bg-fetching'); 3870 classie.addClass(getImage[j], 'srcset-bg-async-done'); 3871 getImage[j].dispatchEvent(new CustomEvent("async-done")); 3872 } 3873 3874 if (processedImageisNew && SiteParameters.optimize_shortpixel_image == true) { 3875 UNCODE.process_shortpixel_image(processedImageID); 3876 } 3877 } 3878 } else { 3879 if (SiteParameters.enable_debug == true) { 3880 // This console log is disabled by default 3881 // So nothing is printed in a typical installation 3882 // 3883 // It can be enabled for debugging purposes setting 3884 // the 'uncode_enable_debug_on_js_scripts' filter to true 3885 if (jsonResponse.success == false && jsonResponse.data.message) { 3886 console.log('There was an error: ' + jsonResponse.data.message); 3887 } else { 3888 console.log('There was an error: bad response'); 3889 } 3890 } 3891 } 3892 3893 } else if (xhr.status == 400) { 3894 if (SiteParameters.enable_debug == true) { 3895 // This console log is disabled by default 3896 // So nothing is printed in a typical installation 3897 // 3898 // It can be enabled for debugging purposes setting 3899 // the 'uncode_enable_debug_on_js_scripts' filter to true 3900 console.log('There was an error 400'); 3901 } 3902 } else { 3903 if (SiteParameters.enable_debug == true) { 3904 // This console log is disabled by default 3905 // So nothing is printed in a typical installation 3906 // 3907 // It can be enabled for debugging purposes setting 3908 // the 'uncode_enable_debug_on_js_scripts' filter to true 3909 console.log('Something else other than 200 was returned'); 3910 } 3911 } 3912 } 3913 } 3914 3915 // Serialize our data 3916 var queryString = "", 3917 arrayLength = Object.keys(post_data).length, 3918 arrayCounter = 0; 3919 3920 for (var key in post_data) { 3921 queryString += key + "=" + post_data[key]; 3922 3923 if (arrayCounter < arrayLength - 1) { 3924 queryString += "&"; 3925 } 3926 3927 arrayCounter++; 3928 } 3929 3930 xhr.send(queryString); 3931 } 3932 } 3933
3934 UNCODE.refresh_dynamic_srcset_size = function(container) { 3935 var parentSelector = container && container.length > 0 ? container[0] : document; 3936 // If 'container' is false, we assume that we are resizing generic images 3937 var images = container ? parentSelector.querySelectorAll('.srcset-auto') : parentSelector.querySelectorAll('.srcset-auto:not(.srcset-on-layout)'); 3938 3939 for (var i = 0; i < images.length; i++) { 3940 // Update srcset/sizes attributes 3941 UNCODE.set_dynamic_srcset_size(images[i]); 3942 } 3943 } 3944 3945 UNCODE.set_dynamic_srcset_size = function(el) { 3946 if (el.nodeName === 'PICTURE') { 3947 var picture_imgs = el.getElementsByTagName('img'); 3948 var picture_sources = el.getElementsByTagName('source'); 3949 if (picture_imgs.length > 0) { 3950 var picture_img = picture_imgs[0]; 3951 } 3952 if (picture_sources.length > 0 && picture_imgs.length > 0) { 3953 var picture_source = picture_sources[0]; 3954 var parent_width = el.clientWidth; 3955 var parent_height = el.clientHeight; 3956 var picture_img_width = parseInt(picture_img.getAttribute('width'), 10); 3957 var picture_img_height = parseInt(picture_img.getAttribute('height'), 10); 3958 var final_width = (picture_img_width * parent_height) / picture_img_height; 3959 picture_source.sizes = final_width + 'px'; 3960 classie.addClass(picture_source, 'srcset-sizes-done'); 3961 if (picture_source.dataset.srcset) { 3962 if (SiteParameters.activate_webp && picture_source.dataset.srcsetWebp && ((el.dataset.mime === 'png' && UNCODE.webp_lossless_supported) || (el.dataset.mime === 'jpeg' && UNCODE.webp_lossy_supported))) { 3963 picture_source.srcset = picture_source.dataset.srcsetWebp; 3964 picture_source.removeAttribute('data-srcset-webp'); 3965 } else { 3966 picture_source.srcset = picture_source.dataset.srcset; 3967 } 3968 picture_source.removeAttribute('data-srcset'); 3969 var $waitingThumb = getClosest( picture_source, 'srcset-lazy-animations'); 3970 if ( $waitingThumb != null ) { 3971 picture_img.onload = function(){ 3972 classie.removeClass( $waitingThumb, 'srcset-lazy-animations'); 3973 }; 3974 } 3975 } 3976 } 3977 if (picture_sources.length > 0 || picture_imgs.length > 0) { 3978 el.dispatchEvent(new CustomEvent("srcset-done")); 3979 } 3980 } else { 3981 if (typeof el.parentNode !== 'undefined') { 3982 if ( classie.hasClass(el.parentNode, 't-entry-drop') ) { 3983 var parent_width = el.parentNode.getAttribute('data-w'); 3984 if ( typeof parent_width !== 'undefined' && parent_width !== null ) {
3985 parent_width = UNCODE.wwidth / 12 * parseFloat( parent_width ); 3986 } 3987 } else { 3988 var parent_width = el.parentNode.parentElement.clientWidth; 3989 } 3990 if ( parseFloat(el.sizes) === parseFloat(parent_width) ) { 3991 return; 3992 } 3993 if ( parent_width === 0 ) { 3994 el.sizes = UNCODE.wwidth; 3995 } else { 3996 el.sizes = parent_width + 'px'; 3997 } 3998 classie.addClass(el, 'srcset-sizes-done'); 3999 if (el.dataset.srcset) { 4000 if (SiteParameters.activate_webp && el.dataset.srcsetWebp && ((el.dataset.mime === 'png' && UNCODE.webp_lossless_supported) || (el.dataset.mime === 'jpeg' && UNCODE.webp_lossy_supported))) { 4001 el.srcset = el.dataset.srcsetWebp; 4002 el.removeAttribute('data-srcset-webp'); 4003 } else { 4004 el.srcset = el.dataset.srcset; 4005 } 4006 el.removeAttribute('data-srcset'); 4007 var $waitingThumb = getClosest( el, 'srcset-lazy-animations'); 4008 if ( $waitingThumb != null ) { 4009 el.onload = function(){ 4010 classie.removeClass( $waitingThumb, 'srcset-lazy-animations'); 4011 }; 4012 } 4013 } 4014 el.dispatchEvent(new CustomEvent("srcset-done")); 4015 } 4016 } 4017 }; 4018 4019 UNCODE.adaptive_srcset = function(container) { 4020 var images = new Array(); 4021 var parentSelector = container ? container[0] : document; 4022 // If 'container' is false, we assume that this is a call on window load 4023 var isLoadingResize = container ? false : true; 4024 var getImages = parentSelector.querySelectorAll('.srcset-async:not(.srcset-fetching)'); 4025 var limit = SiteParameters.dynamic_srcset_bunch_limit ? parseInt(SiteParameters.dynamic_srcset_bunch_limit, 10) : 1; 4026 4027 for (var i = 0; i < getImages.length; i++) { 4028 var imageObj = {}; 4029 var el = getImages[i]; 4030 var missing_breakpoints = el.getAttribute('data-no-bp'); 4031 4032 if (isLoadingResize) { 4033 // Update srcset/sizes attributes 4034 // But skip images that are processed on other events 4035 // (isotope.onLayout for example) to avoid double calls 4036 if (!classie.hasClass(el, 'srcset-on-layout')) { 4037 UNCODE.set_dynamic_srcset_size(el); 4038 } 4039 } 4040 4041 if (missing_breakpoints) { 4042 classie.addClass(el, 'srcset-fetching'); 4043 imageObj.unique = el.getAttribute('data-uniqueid'); 4044 imageObj.url = el.getAttribute('data-guid'); 4045 imageObj.path = el.getAttribute('data-path'); 4046 imageObj.singlew = el.getAttribute('data-singlew'); 4047 imageObj.singleh = el.getAttribute('data-singleh'); 4048 imageObj.origwidth = el.getAttribute('data-width'); 4049 imageObj.origheight = el.getAttribute('data-height'); 4050 imageObj.crop = el.getAttribute('data-crop'); 4051 imageObj.fixed = el.getAttribute('data-fixed') == undefined ? null : el.getAttribute('data-fixed'); 4052 imageObj.missingbp = missing_breakpoints; 4053 4054 images.push(imageObj); 4055 } else { 4056 classie.removeClass(el, 'srcset-async'); 4057 } 4058 } 4059 4060 while (images.length > 0) { 4061 if (images.length >= limit) { 4062 var bunch_images = new Array(); 4063 for (var i = limit - 1; i >= 0; i--) { 4064 bunch_images.push(images[i]); 4065 images.splice(i, 1); 4066 } 4067 UNCODE.adaptive_srcset_async(parentSelector, bunch_images); 4068 } else { 4069 UNCODE.adaptive_srcset_async(parentSelector, images); 4070 break; 4071 } 4072 } 4073 }; 4074 4075 UNCODE.adaptive_srcset_async = function(parentSelector, images) { 4076 var post_data = { 4077 images: JSON.stringify(images), 4078 action: 'regenerate_srcset_async', 4079 resize_quality: SiteParameters.resize_quality, 4080 nonce_srcset_async: SiteParameters.nonce_srcset_async 4081 }; 4082 4083 var xhr = new XMLHttpRequest(); 4084 xhr.open('POST', SiteParameters.ajax_url, true); 4085 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 4086 xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 4087 4088 xhr.onreadystatechange = function() { 4089 if (xhr.readyState == XMLHttpRequest.DONE) { 4090 if (xhr.status == 200 && xhr.responseText) { 4091 var jsonResponse = JSON.parse(xhr.responseText); 4092 4093 if (jsonResponse.success && jsonResponse.data.images) { 4094 var processedImages = jsonResponse.data.images; 4095 4096 for (var i = 0; i < processedImages.length; i++) { 4097 var processedImageID = processedImages[i].id; 4098 var processedImageUniqueID = processedImages[i].unique; 4099 var processedImageisNew = processedImages[i].new_crop === true ? true : false;
4100 var getImage = parentSelector.querySelectorAll('[data-uniqueid="'+processedImageUniqueID+'"]'); 4101 4102 for (var j = 0; j < getImage.length; j++) { 4103 classie.removeClass(getImage[j], 'srcset-async'); 4104 classie.removeClass(getImage[j], 'srcset-fetching'); 4105 classie.addClass(getImage[j], 'srcset-async-done'); 4106 getImage[j].dispatchEvent(new CustomEvent("async-done")); 4107 } 4108 4109 if (processedImageisNew && SiteParameters.optimize_shortpixel_image == true) { 4110 UNCODE.process_shortpixel_image(processedImageID); 4111 } 4112 } 4113 } else { 4114 if (SiteParameters.enable_debug == true) { 4115 // This console log is disabled by default 4116 // So nothing is printed in a typical installation 4117 // 4118 // It can be enabled for debugging purposes setting 4119 // the 'uncode_enable_debug_on_js_scripts' filter to true 4120 if (jsonResponse.success == false && jsonResponse.data.message) { 4121 console.log('There was an error: ' + jsonResponse.data.message); 4122 } else { 4123 console.log('There was an error: bad response'); 4124 } 4125 } 4126 } 4127 4128 } else if (xhr.status == 400) { 4129 if (SiteParameters.enable_debug == true) { 4130 // This console log is disabled by default 4131 // So nothing is printed in a typical installation 4132 // 4133 // It can be enabled for debugging purposes setting 4134 // the 'uncode_enable_debug_on_js_scripts' filter to true 4135 console.log('There was an error 400'); 4136 } 4137 } else { 4138 if (SiteParameters.enable_debug == true) { 4139 // This console log is disabled by default 4140 // So nothing is printed in a typical installation 4141 // 4142 // It can be enabled for debugging purposes setting 4143 // the 'uncode_enable_debug_on_js_scripts' filter to true 4144 console.log('Something else other than 200 was returned'); 4145 } 4146 } 4147 } 4148 } 4149 4150 // Serialize our data 4151 var queryString = "", 4152 arrayLength = Object.keys(post_data).length, 4153 arrayCounter = 0; 4154 4155 for (var key in post_data) { 4156 queryString += key + "=" + post_data[key]; 4157 4158 if (arrayCounter < arrayLength - 1) { 4159 queryString += "&"; 4160 } 4161 4162 arrayCounter++; 4163 } 4164 4165 xhr.send(queryString); 4166 }; 4167 4168 })(window); 4169 4170 (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); 4171 iNoBounce.disable(); 4172 4173 /* 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)}} 4174 function 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)})}; 4175 function 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,
4175window.Promise.race=x,window.Promise.all=w,window.Promise.prototype.then=n.prototype.c,window.Promise.prototype["catch"]=n.prototype.g);}()); 4176 4177 (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;"; 4178 this.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)} 4179 function u(a,b){a.a.style.cssText="max-width:none;min-width:20px;min-height:20px;display: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} 4180 function 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(" ")} 4181 B.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)}, 4182 b)}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(""+ 4183 n+"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();
4183A(e,function(a){f=a;v()});u(e, 4184 L(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.