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