1/* UItoTop jQuery Plugin | Matt Varone | http://www.mattvarone.com/web-design/uitotop-jquery-plugin */ ! function(n) { 2 n.fn.UItoTop = function(o) { 3 var e = { 4 text: "To Top", 5 min: 200, 6 inDelay: 600, 7 outDelay: 400, 8 containerID: "toTop", 9 containerHoverID: "toTopHover", 10 scrollSpeed: 1200, 11 easingType: "linear" 12 }, 13 t = n.extend(e, o), 14 i = "#" + t.containerID, 15 a = "#" + t.containerHoverID; 16 n("body").append('<a href="#" id="' + t.containerID + '"><span>' + t.text + "</span></a>"), n(i).hide().on("click.UItoTop", function() { 17 return n("html, body").animate({ 18 scrollTop: 0 19 }, t.scrollSpeed, t.easingType), n("#" + t.containerHoverID, this).stop().animate({ 20 opacity: 0 21 }, t.inDelay, t.easingType), !1 22 }).hover(function() { 23 n(a, this).stop().animate({ 24 opacity: 1 25 }, 600, "linear") 26 }, function() { 27 n(a, this).stop().animate({ 28 opacity: 0 29 }, 700, "linear") 30 }), n(window).scroll(function() { 31 var o = n(window).scrollTop(); 32 "undefined" == typeof document.body.style.maxHeight && n(i).css({ 33 position: "absolute", 34 top: o + n(window).height() - 50 35 }), o > t.min ? n(i).fadeIn(t.inDelay) : n(i).fadeOut(t.Outdelay) 36 }) 37 } 38}(jQuery); 39/* jquery.stickup.min.js */ 40! function(t) { 41 t.fn.stickUp = function(e) { 42 function o() { 43 a = parseInt(n.offset().top), d = parseInt(n.css("margin-top")), u = parseInt(n.outerHeight(!0)), c.pseudo && (t('<div class="pseudoStickyBlock"></div>').insertAfter(n), i = t(".pseudoStickyBlock"), i.css({ 44 position: "relative", 45 display: "block" 46 })), c.active && s(), n.addClass("stuckMenu") 47 } 48 49 function s() { 50 p.on("scroll.stickUp", function() { 51 r = t(this).scrollTop(), S = r > k ? "down" : "up", k = r, 0 != h.length ? correctionValue = h.outerHeight(!0) : correctionValue = 0, f = parseInt(l.scrollTop()), a - correctionValue < f ? (n.addClass("isStuck"), v.addClass("isStuck"), c.pseudo ? (n.css({ 52 position: "fixed", 53 top: correctionValue 54 }), i.css({ 55 height: u 56 })) : n.css({ 57 position: "fixed", 58 top: correctionValue 59 })) : (n.removeClass("isStuck"), v.removeClass("isStuck"), c.pseudo ? (n.css({ 60 position: "relative", 61 top: 0 62 }), i.css({ 63 height: 0 64 })) : n.css({ 65 position: "absolute", 66 top: 0 67 })) 68 }).trigger("scroll.stickUp"), p.on("resize", function() { 69 n.hasClass("isStuck") ? a != parseInt(i.offset().top) && (a = parseInt(i.offset().top)) : a != parseInt(n.offset().top) && (a = parseInt(n.offset().top)) 70 }) 71 } 72 var c = { 73 correctionSelector: ".correctionSelector", 74 listenSelector: ".listenSelector", 75 active: !1, 76 pseudo: !0 77 }; 78 t.extend(c, e); 79 var i, r, n = t(this), 80 l = t(window), 81 p = t(document), 82 a = 0, 83 u = 0, 84 d = 0, 85 f = 0, 86 k = 0, 87 S = "", 88 h = t(c.correctionSelector), 89 v = t(c.listenSelector); 90 0 != n.length && o() 91 } 92}(jQuery); 93/* super-guacamole.min.js */ 94! function(e, t) { 95 function n(t) { 96 var n, i, r = this; 97 n = { 98 id: "", 99 href: "", 100 title: "···", 101 children: {}, 102 templates: {},
103 container: null 104 }, i = e.extend(n, t), r.id = i.id, r.href = i.href, r.title = i.title, r.children = i.children, r.templates = i.templates, r.$container = i.container, r.node = null, r.attachedNode = null, r.options = {}, r.visible = !0 105 } 106 var i = { 107 menu: '<li class="%1$s"><a href="%2$s">%3$s</a>%4$s</li>', 108 child_wrap: "<ul>%s</ul>", 109 child: '<li class="%1$s" id="%5$s"><a href="%2$s">%3$s</a><ul class="sub-menu">%4$s</ul></li>' 110 }; 111 n.prototype.set = function(e) { 112 if (!1 == e instanceof n) throw new Error("Invalid argument type"); 113 return this.children[e.id] = e, this 114 }, n.prototype.push = function(e) { 115 return this.set(e) 116 }, n.prototype.get = function(e) { 117 var t = null; 118 return this.map(e, function(e, n) { 119 return t = n, n 120 }), t 121 }, n.prototype.map = function(e, t, n) { 122 var i = { 123 id: e 124 }, 125 r = this; 126 return "string" != typeof e && (i = e), n = n || this.children, 0 >= n.length ? i : (Object.keys(n).forEach(function(e) { 127 child = n[e], i.id === child.id ? n[i.id] = t(child) : child.children && 0 < Object.keys(child.children).length && (i = r.map(i, t, child.children)) 128 }), i) 129 }, n.prototype.has = function(e) { 130 return t !== this.children[e] 131 }, n.prototype.isVisible = function() { 132 return this.visible 133 }, n.prototype.forEach = function(e) { 134 return this.children.forEach(e) 135 }, n.prototype.countVisibleAttachedNodes = function() { 136 var t = this, 137 n = -1; 138 return Object.keys(t.children).forEach(function(i) { 139 e(t.children[i].getAttachedNode()).attr("hidden") || n++ 140 }), n 141 }, n.prototype.countVisibleNodes = function() { 142 var t, n = this, 143 i = 0; 144 return Object.keys(n.children).forEach(function(r) { 145 t = n.children[r], e(t.getNode()).attr("hidden") || i++ 146 }), i 147 }, n.prototype.countVisible = function() { 148 var e = this, 149 t = 0; 150 return Object.keys(e.children).forEach(function(n) { 151 e.children[n].isVisible() && t++ 152 }), t 153 }, n.prototype.getNode = function() { 154 return this.node 155 }, n.prototype.getAttachedNode = function() { 156 return this.attachedNode 157 }, n.prototype.setNode = function(e) { 158 this.node = e 159 }, n.prototype.attachNode = function(e) { 160 this.attachedNode = e 161 }, n.prototype.setOptions = function(e) { 162 return this.options = e, this 163 }, n.prototype.getOptions = function() { 164 return this.options 165 }, n.prototype.render = function() { 166 function t(e, n, i) { 167 var r = e.replace(new RegExp("\\%" + n + "\\$s", "g"), i); 168 return pipes = { 169 replace: function(e, n) { 170 return t(r, e, n), pipes 171 }, 172 get: function() { 173 return r 174 } 175 }, pipes 176 } 177 178 function n(e, i, r) { 179 var o = "", 180 a = Object.keys(i.children); 181 return r = r || !1, a.forEach(function(e) { 182 o += n("super-guacamole__menu__child", i.children[e]) 183 }), t(r ? d : c, 1, e + " menu-item" + (0 < a.length ? " menu-item-has-children" : "")).replace(2, i.href).replace(3, i.title).replace(4, 0 < a.length ? o : "").replace(5, i.id).get().replace('<ul class="sub-menu"></ul>', "") 184 } 185 186 function i(e) { 187 var t = ""; 188 return Object.keys(e).forEach(function(i) { 189 t += n("super-guacamole__menu", e[i]) 190 }), t 191 } 192 var r, o = this, 193 c = o.templates.menu, 194 d = o.templates.child, 195 a = o.$container; 196 o.options.$menu; 197 return 0 < a.length && (a.append(i([o])), a.find(".super-guacamole__menu__child").each(function() { 198 $current_el = e(this), id = e(this).attr("id"), r = a.find("#" + id.replace("sg-", "")), 0 === r.length && (r = a.find("." + id.replace("sg-", ""))), 0 < r.length && o.map(id, function(e) { 199 return e.attachNode(r), e.setNode($current_el), e 200 }) 201 })), this 202 }, n.extract = function(t) { 203 function i(e) { 204 var t = "", 205 n = null, 206 i = /menu\-item\-[0-9]+/i; 207 return e.attr("class").split(" ").forEach(function(e) { 208 n = i.exec(e), null !== n && (t = n[0]) 209 }), t 210 } 211 var r, o, c, d, a = {}; 212 return t.each(function(t, u) { 213 r = e(u), o = r.find("a:first"), menuId = r.attr("id"), "undefined" == typeof menuId && (menuId = i(r)), c = new n({ 214 id: "sg-" + menuId, 215 href: o.attr("href"), 216 title: o.get(0).childNodes[0].data 217 }), c.attachNode(r), -1 < r.children(".sub-menu").length && (subMenu = n.extract(r.children(".sub-menu").children(".menu-item")), Object.keys(subMenu).forEach(function(e) { 218 d = subMenu[e], c.set(d) 219 })), a[c.id] = c 220 }), a 221 }, n.prototype.attachedNodesFit = function() { 222 var t, n, i = this, 223 r = 0, 224 o = 0, 225 c = e(e(".header-container > .container").length > 0 ? ".header-container > .container" : ".header-container > div"), 226 d = i.$container.outerWidth(!0) - i.$container.find(".super-guacamole__menu").outerWidth(!0) - (parseInt(c.css("padding-left"), 10) + parseInt(c.css("padding-right"), 10)) / 2;
227 return Object.keys(i.children).forEach(function(r) { 228 n = i.children[r], $attachedNode = e(n.getAttachedNode()), t = e(n.getNode()), $attachedNode.removeAttr("hidden"), t.attr("hidden", !0) 229 }), Object.keys(i.children).forEach(function(c) { 230 n = n = i.children[c], $attachedNode = e(n.getAttachedNode()), t = e(n.getNode()), o = $attachedNode.outerWidth(!0), o > 0 && $attachedNode.data("width", o), r += $attachedNode.data("width"), r > d && ($attachedNode.attr("hidden", !0), t.removeAttr("hidden")) 231 }), !0 232 }, n.prototype.menuFit = function(t) { 233 var n, i = this, 234 r = { 235 removeAttr: function(e, t) { 236 return e.removeAttr(t) 237 }, 238 attr: function(e, t) { 239 return e.attr(t, !0) 240 } 241 }, 242 o = "removeAttr", 243 c = i.options.threshold || 768; 244 return t = t || !1, 0 === i.countVisibleNodes() && (o = "attr"), e(window).width() <= c - 1 && (o = "attr", Object.keys(i.children).forEach(function(t) { 245 n = i.children[t], $attachedNode = e(n.getAttachedNode()), $node = e(n.getNode()), $attachedNode.removeAttr("hidden"), $node.attr("hidden", !0) 246 })), t || r[o](i.$container.find(".super-guacamole__menu"), "hidden"), "removeAttr" === o 247 }, n.prototype.watch = function(t) { 248 function n() { 249 r.attachedNodesFit(), r.menuFit() 250 } 251 252 function i(e) { 253 var t; 254 return function(i) { 255 function r() { 256 n(), timeout = null 257 } 258 t && clearTimeout(t), t = setTimeout(r, e) 259 } 260 } 261 var r = this; 262 return (t = t || !1) ? (n(), r) : (e(window).on("resize", i(10)), e(window).on("orientationchange", i(10)), r) 263 }, e.fn.superGuacamole = function(t) { 264 var r, o, c, d, a = e(this), 265 u = a.find("#main-menu"); 266 r = { 267 threshold: 544, 268 minChildren: 3, 269 childrenFilter: "li", 270 menuTitle: "···", 271 menuUrl: "#", 272 templates: i 273 }, o = e.extend(r, t), c = u.children(o.childrenFilter + ":not(.super-guacamole__menu):not(.super-guacamole__menu__child)"), d = new n({ 274 title: o.menuTitle, 275 href: o.menuUrl, 276 templates: o.templates, 277 children: n.extract(c), 278 container: u 279 }), o.$menu = u, d.setOptions(o).render().watch(!0).watch() 280 } 281}(jQuery); 282 283(function($) { 284 "use strict"; 285 286 CherryJsCore.utilites.namespace('theme_script'); 287 CherryJsCore.theme_script = { 288 init: function() { 289 // Document ready event check 290 if (CherryJsCore.status.is_ready) { 291 this.document_ready_render(); 292 } else { 293 CherryJsCore.variable.$document.on('ready', this.document_ready_render.bind(this)); 294 } 295 296 // Windows load event check 297 if (CherryJsCore.status.on_load) { 298 this.window_load_render(); 299 } else { 300 CherryJsCore.variable.$window.on('load', this.window_load_render.bind(this)); 301 } 302 }, 303 304 document_ready_render: function() { 305 this.smart_slider_init(this); 306 this.swiper_carousel_init(this); 307 this.post_formats_custom_init(this); 308 this.navbar_init(this); 309 this.main_menu(this, $('.main-navigation')); 310 this.mega_menu(this); 311 this.to_top_init(this); 312 this.playlist_slider_widget_init(this); 313 this.news_smart_box_init(this); 314 this.header_search(this); 315 this.mobile_menu(this); 316 this.vertical_menu_init(this); 317 this.add_project_inline_style(this); 318 this.anchor_navigation(this); 319 this.anchor_scrolling_navigation(this); 320 this.ofi_init(this); 321 this.replyLinkScroll(this); 322 }, 323 324 window_load_render: function() { 325 this.page_preloader_init(this); 326 }, 327 328 anchor_navigation: function(self) { 329 $('.page-template-landing div:not(.woocommerce-tabs) a[href*=#]:not([href=#])').on('click', function() { 330 331 var $window = CherryJsCore.variable.$window, 332 width = $window.outerWidth(true), 333 $menuToggle = $('.main-menu-toggle[aria-controls="main-menu"]'); 334 335 if (768 > width) { 336 $menuToggle.trigger('click.mobileMenuToggle'); 337 } 338 339 if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') || location.hostname === this.hostname) { 340 var target = $(this.hash), 341 targetLink = this.hash, 342 $correctionSelector = (768 <= width) ? $('#main-menu') : $('.mobile-panel'), 343 menuHeight = $correctionSelector.outerHeight(true); 344 345 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 346 347 if (target.length) { 348 $('html, body').animate({ 349 scrollTop: target.offset().top - menuHeight 350 }, 1000); 351 352 return false;
353 } 354 } 355 }); 356 }, 357 358 anchor_scrolling_navigation: function(self) { 359 360 var $document = $(document), 361 top = null, 362 changed = false, 363 currentHash = null, 364 sections = null, 365 timeout = null, 366 interval = null, 367 menuHeight = $('#main-menu').outerHeight(true), 368 $sections = $('.tm_pb_anchor'); 369 370 sections = getSections(); 371 372 373 $(window).on('scroll.cherry_anchor_navigation', function() { 374 var newTop = $document.scrollTop(); 375 376 changed = newTop != top; 377 378 if (changed) { 379 top = newTop; 380 } 381 }); 382 383 $(window).on('resize.cherry_anchor_navigation', function() { 384 sections = getSections(); 385 }); 386 387 function getSections() { 388 sections = $.map($sections, function(event) { 389 var $event = $(event), 390 position = $event.position(); 391 392 return { 393 top: position.top - menuHeight, 394 bottom: position.top + $event.outerHeight(true) - menuHeight, 395 hash: $event.attr('id') 396 }; 397 }); 398 399 return sections; 400 401 } 402 403 function iteration() { 404 405 var sectionsLength = sections.length, 406 section, 407 scrollTop; 408 409 while (section = sections[--sectionsLength]) { 410 411 if (section.top >= top || section.bottom <= top) { 412 continue; 413 } 414 415 if (currentHash == section.hash) { 416 break; 417 } 418 419 currentHash = section.hash; 420 history.pushState(null, null, '#' + section.hash); 421 } 422 } 423 424 timeout = setTimeout(function() { 425 interval = setInterval(iteration, 250); 426 }, 250); 427 }, 428 429 smart_slider_init: function(self) { 430 $('.happyones-smartslider').each(function() { 431 var slider = $(this), 432 sliderId = slider.data('id'), 433 sliderWidth = slider.data('width'), 434 sliderHeight = slider.data('height'), 435 sliderOrientation = slider.data('orientation'), 436 slideDistance = slider.data('slide-distance'), 437 slideDuration = slider.data('slide-duration'), 438 sliderFade = slider.data('slide-fade'), 439 sliderNavigation = slider.data('navigation'), 440 sliderFadeNavigation = slider.data('fade-navigation'), 441 sliderPagination = slider.data('pagination'), 442 sliderAutoplay = slider.data('autoplay'), 443 sliderFullScreen = slider.data('fullscreen'), 444 sliderShuffle = slider.data('shuffle'), 445 sliderLoop = slider.data('loop'), 446 sliderThumbnailsArrows = slider.data('thumbnails-arrows'), 447 sliderThumbnailsPosition = slider.data('thumbnails-position'), 448 sliderThumbnailsWidth = slider.data('thumbnails-width'), 449 sliderThumbnailsHeight = slider.data('thumbnails-height'); 450 451 if ($('.smart-slider__items', '#' + sliderId).length > 0) { 452 $('#' + sliderId).sliderPro({ 453 width: sliderWidth, 454 height: sliderHeight, 455 orientation: sliderOrientation, 456 slideDistance: slideDistance, 457 slideAnimationDuration: slideDuration, 458 fade: sliderFade, 459 arrows: sliderNavigation, 460 fadeArrows: sliderFadeNavigation, 461 buttons: sliderPagination, 462 autoplay: sliderAutoplay, 463 fullScreen: sliderFullScreen, 464 shuffle: sliderShuffle, 465 loop: sliderLoop, 466 waitForLayers: false, 467 thumbnailArrows: sliderThumbnailsArrows, 468 thumbnailsPosition: sliderThumbnailsPosition, 469 thumbnailWidth: sliderThumbnailsWidth, 470 thumbnailHeight: sliderThumbnailsHeight, 471 init: function() { 472 $(this).resize(); 473 }, 474 sliderResize: function(event) { 475 var thisSlider = $('#' + sliderId), 476 slides = $('.sp-slide', thisSlider); 477 478 slides.each(function() { 479 480 if ($('.sp-title a', this).width() > $(this).width()) { 481 $(this).addClass('text-wrapped'); 482 } else { 483 $(this).removeClass('text-wrapped'); 484 } 485 486 }); 487 }, 488 breakpoints: { 489 991: { 490 height: parseFloat(sliderHeight) * 0.75 491 }, 492 767: { 493 height: parseFloat(sliderHeight) * 0.5, 494 thumbnailsPosition: ('top' === this.thumbnailsPosition) ? 'top' : 'bottom', 495 thumbnailHeight: parseFloat(sliderThumbnailsHeight) * 0.75, 496 thumbnailWidth: parseFloat(sliderThumbnailsWidth) * 0.75 497 } 498 } 499 }); 500 } 501 }); //each end 502 }, 503 504 swiper_carousel_init: function(self) { 505 506 // Enable swiper carousels 507 jQuery('.happyones-carousel').each(function() { 508 var swiper = null, 509 uniqId = jQuery(this).data('uniq-id'), 510 slidesPerView = parseFloat(jQuery(this).data('slides-per-view')), 511 slidesPerGroup = parseFloat(jQuery(this).data('slides-per-group')), 512 slidesPerColumn = parseFloat(jQuery(this).data('slides-per-column')), 513 spaceBetweenSlides = parseFloat(jQuery(this).data('space-between-slides')), 514 durationSpeed = parseFloat(jQuery(this).data('duration-speed')), 515 swiperLoop = jQuery(this).data('swiper-loop'), 516 freeMode = jQuery(this).data('free-mode'), 517 grabCursor = jQuery(this).data('grab-cursor'), 518 mouseWheel = jQuery(this).data('mouse-wheel'), 519 breakpointsSettings = { 520 1199: {
521 slidesPerView: Math.floor(slidesPerView * 0.75), 522 spaceBetween: Math.floor(spaceBetweenSlides * 0.75) 523 }, 524 991: { 525 slidesPerView: Math.floor(slidesPerView * 0.5), 526 spaceBetween: Math.floor(spaceBetweenSlides * 0.5) 527 }, 528 767: { 529 slidesPerView: (0 !== Math.floor(slidesPerView * 0.25)) ? Math.floor(slidesPerView * 0.25) : 1 530 } 531 }; 532 533 if (1 == slidesPerView) { 534 breakpointsSettings = {} 535 } 536 537 var swiper = new Swiper('#' + uniqId, { 538 slidesPerView: slidesPerView, 539 slidesPerGroup: slidesPerGroup, 540 slidesPerColumn: slidesPerColumn, 541 spaceBetween: spaceBetweenSlides, 542 speed: durationSpeed, 543 loop: swiperLoop, 544 freeMode: freeMode, 545 grabCursor: grabCursor, 546 mousewheelControl: mouseWheel, 547 paginationClickable: true, 548 nextButton: '#' + uniqId + '-next', 549 prevButton: '#' + uniqId + '-prev', 550 pagination: '#' + uniqId + '-pagination', 551 onInit: function() { 552 $('#' + uniqId + '-next').css({ 553 'display': 'block' 554 }); 555 $('#' + uniqId + '-prev').css({ 556 'display': 'block' 557 }); 558 }, 559 breakpoints: breakpointsSettings 560 }); 561 }); 562 }, 563 564 post_formats_custom_init: function(self) { 565 CherryJsCore.variable.$document.on('cherry-post-formats-custom-init', function(event) { 566 567 if ('slider' !== event.object) { 568 return; 569 } 570 571 var uniqId = '#' + event.item.attr('id'), 572 swiper = new Swiper(uniqId, { 573 pagination: uniqId + ' .swiper-pagination', 574 paginationClickable: true, 575 nextButton: uniqId + ' .swiper-button-next', 576 prevButton: uniqId + ' .swiper-button-prev', 577 spaceBetween: 0, 578 onInit: function() { 579 $(uniqId + ' .swiper-button-next').css({ 580 'display': 'block' 581 }); 582 $(uniqId + ' .swiper-button-prev').css({ 583 'display': 'block' 584 }); 585 } 586 }); 587 588 event.item.data('initalized', true); 589 }); 590 591 var items = []; 592 593 $('.mini-gallery .post-thumbnail__link').on('click', function(event) { 594 event.preventDefault(); 595 596 $(this).parents('.mini-gallery').find('.post-gallery__slides > a[href]').each(function() { 597 items.push({ 598 src: $(this).attr('href'), 599 type: 'image' 600 }); 601 }); 602 603 $.magnificPopup.open({ 604 items: items, 605 gallery: { 606 enabled: true 607 } 608 }); 609 }); 610 }, 611 612 navbar_init: function(self) { 613 614 $(window).load(function() { 615 616 var $layout = window.happyones.labels.header_layout, 617 $navbar = ('style-3' === $layout || 'style-7' === $layout) ? $('.vertical-menu-toggle-holder') : $('#main-menu'); 618 619 if (!$.isFunction(jQuery.fn.stickUp) || undefined === window.happyones.stickUp || !$navbar.length) { 620 return !1; 621 } 622 623 $navbar.stickUp({ 624 correctionSelector: '#wpadminbar', 625 listenSelector: '.listenSelector', 626 pseudo: true, 627 active: true 628 }); 629 CherryJsCore.variable.$document.trigger('scroll.stickUp'); 630 631 }); 632 }, 633 634 isMegaMenuEnabled: function() { 635 636 if (undefined === window.happyones.megaMenu) { 637 return false; 638 } 639 640 if (true === window.happyones.megaMenu.isActive && 'main' == window.happyones.megaMenu.location) { 641 return true; 642 } 643 644 return false; 645 }, 646 647 main_menu: function(self, $mainNavigation) { 648 649 if (self.isMegaMenuEnabled()) { 650 //return; 651 } 652 653 var transitionend = 'transitionend oTransitionEnd webkitTransitionEnd', 654 moreMenuContent = '···', 655 imgurl = '', 656 srcset = '', 657 hasimg = false, 658 hasicon = false, 659 hasprop = Object.prototype.hasOwnProperty, 660 $menuToggle = $('.main-menu-toggle[aria-controls="main-menu"]', $mainNavigation), 661 liWithChildren = 'li.menu-item-has-children, li.page_item_has_children', 662 $body = $('body'), 663 $parentNode, 664 menuItem, 665 subMenu, 666 index = -1, 667 $layout = window.happyones.labels.header_layout; 668 669 if (hasprop.call(window, 'happyones') && 670 hasprop.call(window.happyones, 'more_button_options') && 671 hasprop.call(window.happyones.more_button_options, 'more_button_type')) { 672 switch (window.happyones.more_button_options.more_button_type) { 673 case 'image': 674 imgurl = window.happyones.more_button_options.more_button_image_url; 675 if (window.happyones.more_button_options.retina_more_button_image_url) { 676 srcset = ' srcset="' + window.happyones.more_button_options.retina_more_button_image_url + ' 2x"'; 677 } 678 moreMenuContent = '<img src="' + imgurl + '"' + srcset + ' alt="' + moreMenuContent + '">'; 679 hasimg = true; 680 break; 681 case 'icon': 682 moreMenuContent = '<i class="fa ' + window.happyones.more_button_options.more_button_icon + '"></i>'; 683 hasicon = true; 684 break; 685 case 'text': 686 default: 687 moreMenuContent = window.happyones.more_button_options.more_button_text || moreMenuContent; 688 hasimg = false;
689 hasicon = false; 690 break; 691 } 692 } 693 694 if ('style-3' !== $layout && 'style-7' !== $layout) { 695 $mainNavigation.superGuacamole({ 696 threshold: 768, // Minimal menu width, when this plugin activates 697 minChildren: 3, // Minimal visible children count 698 childrenFilter: '.menu-item:not(.wpml-ls-item):not([class*="pll-"]):not(.lang-item)', // Child elements selector 699 menuTitle: moreMenuContent, // Menu title 700 menuUrl: '#', 701 templates: { 702 menu: '<li id="%5$s" class="%1$s' + (hasimg ? ' super-guacamole__menu-with-image' : '') + 703 (hasicon ? ' super-guacamole__menu-with-icon' : '') + '"><a href="%2$s">%3$s</a><ul class="sub-menu">%4$s</ul></li>', 704 child_wrap: '<ul class="%1$s">%2$s</ul>', 705 child: '<li id="%5$s" class="%1$s"><a href="%2$s">%3$s</a><ul class="sub-menu">%4$s</ul></li>' 706 } 707 }); 708 } 709 710 function hideSubMenu(menuItem, $event) { 711 var subMenus = menuItem.find('.sub-menu'), 712 subMenu = menuItem.children('.sub-menu').first(); 713 714 menuItem 715 .removeData('index') 716 .removeClass('menu-hover'); 717 718 subMenus.addClass('in-transition'); 719 720 subMenus 721 .one(transitionend, function() { 722 subMenus.removeClass('in-transition'); 723 }); 724 } 725 726 function handleMenuItemHover($event) { 727 if ($('html').hasClass('mobile-menu-active')) { 728 return; 729 } 730 menuItem = $($event.target).parents('.menu-item'); 731 subMenu = menuItem.children('.sub-menu').first(); 732 733 var subMenus = menuItem.find('.sub-menu'); 734 735 if (!menuItem.hasClass('menu-item-has-children')) { 736 menuItem = $event.target.tagName === 'LI' ? 737 $($event.target) : 738 $($event.target).parents().filter('.menu-item'); 739 } 740 741 switch ($event.type) { 742 case 'mouseenter': 743 case 'mouseover': 744 if (0 < subMenu.length) { 745 var maxWidth = $body.outerWidth(true), 746 subMenuOffset = subMenu.offset().left + subMenu.outerWidth(true); 747 748 menuItem.addClass('menu-hover'); 749 subMenus.addClass('in-transition'); 750 751 if ($('body').hasClass('rtl')) { 752 if (0 > subMenu.offset().left) { 753 subMenu.addClass('inverse-side'); 754 subMenu.find('.sub-menu').addClass('inverse-side'); 755 } else if (maxWidth <= subMenuOffset) { 756 subMenu.removeClass('inverse-side'); 757 subMenu.find('.sub-menu').removeClass('inverse-side'); 758 } 759 760 } else { 761 if (maxWidth <= subMenuOffset) { 762 subMenu.addClass('inverse-side'); 763 subMenu.find('.sub-menu').addClass('inverse-side'); 764 } else if (0 > subMenu.offset().left) { 765 subMenu.removeClass('inverse-side'); 766 subMenu.find('.sub-menu').removeClass('inverse-side'); 767 } 768 } 769 770 subMenus 771 .one(transitionend, function() { 772 subMenus.removeClass('in-transition'); 773 }); 774 } 775 break; 776 case 'mouseleave': 777 case 'mouseout': 778 hideSubMenu(menuItem, $event); 779 break; 780 } 781 } 782 783 CherryJsCore.variable.$window.on('orientationchange resize', function() { 784 if ($('html').hasClass('mobile-menu-active')) { 785 return; 786 } 787 $mainNavigation.find('.menu-item').removeClass('menu-hover'); 788 $mainNavigation.find('.sub-menu.inverse-side').removeClass('inverse-side'); 789 }); 790 791 $(liWithChildren).hoverIntent({ 792 over: function() {}, 793 out: function() {}, 794 timeout: 300, 795 selector: '.menu-item' 796 }); 797 798 $mainNavigation.on('mouseenter mouseover mouseleave mouseout', '.menu-item', handleMenuItemHover); 799 800 function doubleClickMenu($jqEvent) { 801 $parentNode = $(this); 802 803 if ($('html').hasClass('mobile-menu-active')) { 804 return true; 805 } 806 807 var menuIndex = $parentNode.index(); 808 809 if (menuIndex !== parseInt($parentNode.data('index'), 10)) { 810 $jqEvent.preventDefault(); 811 } 812 813 $parentNode.data('index', menuIndex); 814 } 815 816 // Check if touch events supported 817 if ('ontouchend' in window) { 818 819 // Attach event listener for double click 820 $(liWithChildren, $mainNavigation) 821 .on('click', doubleClickMenu); 822 823 // Reset index on touchend event 824 CherryJsCore.variable.$document.on('touchend', function($jqEvent) { 825 if (!$('html').hasClass('mobile-menu-active')) { 826 $parentNode = $($jqEvent.target).parents().filter('.menu-item:first'); 827 828 if ($parentNode.hasClass('menu-hover') === false) { 829 hideSubMenu($parentNode, $jqEvent); 830 831 index = $parentNode.data('index'); 832 833 if (index) { 834 $parentNode.data('index', parseInt(index, 10) - 1); 835 } 836 } 837 } 838 }); 839 } 840 841 $menuToggle.on('click', function($event) { 842 $event.preventDefault(); 843 $mainNavigation.toggleClass('toggled'); 844 }); 845 }, 846 847 mega_menu: function(self) { 848 849 /** 850 * Mega-menu mobile SubMenu Toggled. 851 */ 852 function megaMenuSubMenuToggled() { 853 $(this).toggleClass('active'); 854 } 855 856 // ADD to Mega-menu sub-menu toggle active class. 857 $('.mega-menu-mobile-arrow').on('click', megaMenuSubMenuToggled); 858 }, 859 860 mobile_menu: function(self) { 861 862 var $mainNavigation = $('.main-navigation'), 863 $menuToggle = $('.main-menu-toggle[aria-controls="main-menu"]'); 864 865 $mainNavigation 866 .find('li.menu-item-has-children > a')
867 .append('<span class="sub-menu-toggle"></span>'); 868 869 /** 870 * Debounce the function call 871 * 872 * @param {number} threshold The delay. 873 * @param {Function} callback The function. 874 */ 875 function debounce(threshold, callback) { 876 var timeout; 877 878 return function debounced($event) { 879 function delayed() { 880 callback.call(this, $event); 881 timeout = null; 882 } 883 884 if (timeout) { 885 clearTimeout(timeout); 886 } 887 888 timeout = setTimeout(delayed, threshold); 889 }; 890 } 891 892 /** 893 * Resize event handler. 894 * 895 * @param {jqEvent} jQuery event. 896 */ 897 function resizeHandler($event) { 898 var $window = CherryJsCore.variable.$window, 899 width = $window.outerWidth(true); 900 901 if (768 <= width) { 902 $mainNavigation.removeClass('mobile-menu'); 903 } else { 904 $mainNavigation.addClass('mobile-menu'); 905 } 906 } 907 908 /** 909 * Toggle sub-menus. 910 * 911 * @param {jqEvent} $event jQuery event. 912 */ 913 function toggleSubMenuHandler($event) { 914 915 $event.preventDefault(); 916 917 $(this).toggleClass('active'); 918 $(this).parents().filter('li:first').toggleClass('sub-menu-open'); 919 } 920 921 /** 922 * Toggle menu. 923 * 924 * @param {jqEvent} $event jQuery event. 925 */ 926 function toggleMenuHandler($event) { 927 var $toggle = $('.sub-menu-toggle'); 928 929 if (!$event.isDefaultPrevented()) { 930 $event.preventDefault(); 931 } 932 933 setTimeout(function() { 934 if (!$mainNavigation.hasClass('animate')) { 935 $mainNavigation.addClass('animate'); 936 } 937 $mainNavigation.toggleClass('show'); 938 $('html').toggleClass('mobile-menu-active'); 939 }, 10); 940 941 $menuToggle.toggleClass('toggled'); 942 $menuToggle.attr('aria-expanded', !$menuToggle.hasClass('toggled')); 943 944 if ($toggle.hasClass('active')) { 945 $toggle.removeClass('active'); 946 $mainNavigation.find('.sub-menu-open').removeClass('sub-menu-open'); 947 } 948 } 949 950 resizeHandler(); 951 CherryJsCore.variable.$window.on('resize orientationchange', debounce(500, resizeHandler)); 952 $('.sub-menu-toggle', $mainNavigation).on('click', toggleSubMenuHandler); 953 $menuToggle.on('click.mobileMenuToggle', toggleMenuHandler); 954 }, 955 956 page_preloader_init: function(self) { 957 958 if ($('.page-preloader-cover')[0]) { 959 $('.page-preloader-cover').delay(500).fadeTo(500, 0, function() { 960 $(this).remove(); 961 }); 962 } 963 }, 964 965 to_top_init: function(self) { 966 if ($.isFunction(jQuery.fn.UItoTop) && undefined !== window.happyones.toTop) { 967 $().UItoTop({ 968 text: happyones.labels.totop_button, 969 scrollSpeed: 600 970 }); 971 } 972 }, 973 974 ofi_init: function(self) { 975 if ($('body').hasClass('ie') && 'undefined' !== typeof objectFitImages) { 976 objectFitImages(); 977 } 978 }, 979 980 playlist_slider_widget_init: function(self) { 981 $('.widget-playlist-slider .playlist-slider').each(function() { 982 var $this = $(this), 983 settings = $this.data('settings'), 984 breakpoints = JSON.parse(settings.breakpoints); 985 986 $this.sliderPro({ 987 autoplay: false, 988 width: settings['width'], 989 height: parseInt(settings['height']), 990 orientation: 'vertical', 991 waitForLayers: false, 992 touchSwipe: false, 993 updateHash: false, 994 arrows: settings['arrows'], 995 buttons: settings['buttons'], 996 thumbnailArrows: settings['thumbnailArrows'], 997 thumbnailsPosition: settings['thumbnailsPosition'], 998 thumbnailPointer: true, 999 thumbnailWidth: settings['thumbnailWidth'], 1000 thumbnailHeight: settings['thumbnailHeight'], 1001 breakpoints: breakpoints, 1002 init: function() { 1003 $this.resize().fadeTo(0, 1); 1004 }, 1005 gotoSlideComplete: function(event) { 1006 var prevSlide = $('.sp-slide', $this).eq(event.previousIndex), 1007 iframe = prevSlide.find('iframe'), 1008 html5Video = prevSlide.find('video'); 1009 1010 if (iframe[0]) { 1011 var iframeSrc = iframe.attr('src'); 1012 1013 iframe.attr('src', iframeSrc); 1014 } else if (html5Video[0]) { 1015 html5Video[0].stop(); 1016 } 1017 } 1018 }); 1019 }); 1020 }, 1021 news_smart_box_init: function(self) { 1022 jQuery('.news-smart-box__instance').each(function() { 1023 var uniqId = $(this).data('uniq-id'), 1024 instanceSettings = $(this).data('instance-settings'), 1025 instance = $('#' + uniqId), 1026 $termItem = $('.news-smart-box__navigation-terms-list-item', instance), 1027 $currentTerm = $('.news-smart-box__navigation-title', instance), 1028 $listContainer = $('.news-smart-box__wrapper', instance), 1029 $ajaxPreloader = $('.nsb-spinner', instance), 1030 $termsList = $('.news-smart-box__navigation-terms-list', instance), 1031 $menuToggle = $('.menu-toggle', instance), 1032 ajaxGetNewInstance = null, 1033 ajaxGetNewInstanceSuccess = true, 1034 showNewItems = null; 1035 1036 $termItem.each(function() { 1037 var slug = $(this).data('slug'); 1038
1039 if ('category' === instanceSettings.terms_type) { 1040 if (slug === instanceSettings.current_category) { 1041 $(this).addClass('is-active'); 1042 } 1043 } else { 1044 if (slug === instanceSettings.current_tag) { 1045 $(this).addClass('is-active'); 1046 } 1047 } 1048 }); 1049 1050 $menuToggle.on('click', function($jqEvent) { 1051 $jqEvent.preventDefault(); 1052 $menuToggle.toggleClass('news-smart-box__navigation-toggle--open'); 1053 $termsList.toggleClass('news-smart-box__navigation-terms-list--open'); 1054 }); 1055 1056 $termItem.on('click', function() { 1057 var slug = $(this).data('slug'), 1058 data = { 1059 action: 'new_smart_box_instance', 1060 nonce: happyones.new_smart_box_nonce, 1061 value_slug: slug, 1062 instance_settings: instanceSettings 1063 }, 1064 currentTermName = $(this).text(), 1065 counter = 0; 1066 1067 if (!$(this).hasClass('is-active')) { 1068 $termItem.removeClass('is-active'); 1069 $(this).addClass('is-active'); 1070 } 1071 1072 $currentTerm.html(currentTermName); 1073 1074 if (ajaxGetNewInstance !== null) { 1075 ajaxGetNewInstance.abort(); 1076 } 1077 ajaxGetNewInstance = $.ajax({ 1078 type: 'GET', 1079 url: happyones.ajaxurl, 1080 data: data, 1081 cache: false, 1082 beforeSend: function() { 1083 ajaxGetNewInstanceSuccess = false; 1084 $ajaxPreloader.css({ 1085 'display': 'block' 1086 }).fadeTo(300, 1); 1087 }, 1088 success: function(response) { 1089 ajaxGetNewInstanceSuccess = true; 1090 1091 $ajaxPreloader.fadeTo(300, 0, function() { 1092 $(this).css({ 1093 'display': 'none' 1094 }); 1095 }); 1096 1097 $('.news-smart-box__listing', $listContainer).html(response); 1098 1099 counter = 0; 1100 $('.news-smart-box__item-inner', $listContainer).addClass('animate-cycle-sh
1100ow'); 1101 $('.news-smart-box__item', $listContainer).each(function() { 1102 showItem($(this), 100 * parseInt(counter) + 200); 1103 counter++; 1104 }) 1105 1106 } 1107 }); 1108 1109 }); 1110 1111 var showItem = function(itemList, delay) { 1112 var timeOutInterval = setTimeout(function() { 1113 $('.news-smart-box__item-inner', itemList).removeClass('animate-cycle-show'); 1114 }, delay); 1115 } 1116 }); 1117 }, 1118 header_search: function(self) { 1119 var $header = $('.site-header'), 1120 $searchToggle = $('.search-form__toggle, .search-form__close', $header), 1121 $headerSearch = $('.header-search', $header), 1122 $searchInput = $('.search-form__field', $headerSearch), 1123 searchHandler = function(event) { 1124 $header.toggleClass('search-active'); 1125 if ($header.hasClass('search-active')) { 1126 $searchInput.focus(); 1127 } 1128 }, 1129 removeActiveClass = function(event) { 1130 if ($(event.target).closest($searchToggle).length || $(event.target).closest($headerSearch).length) { 1131 return; 1132 } 1133 1134 if ($header.hasClass('search-active')) { 1135 $header.removeClass('search-active'); 1136 } 1137 1138 event.stopPropagation(); 1139 }; 1140 1141 $searchToggle.on('click', searchHandler); 1142 CherryJsCore.variable.$document.on('click', removeActiveClass); 1143 1144 }, 1145 vertical_menu_init: function(self) { 1146 var $mainNavigation = $('.main-navigation.vertical-menu'), 1147 $mainMenu = $('.menu', $mainNavigation), 1148 $back = $('.back', $mainNavigation), 1149 $close = $('.close', $mainNavigation), 1150 currentTranslate = parseInt($mainMenu.css('transform')), 1151 isAnimate = false, 1152 offset = 300; 1153 1154 resizeHandler(); 1155 CherryJsCore.variable.$window.on('resize', resizeHandler); 1156 1157 function resizeHandler(event) { 1158 var $window = CherryJsCore.variable.$window, 1159 width = $window.outerWidth(true); 1160 1161 if (768 > width) { 1162 $mainNavigation.removeClass('vertical-menu'); 1163 1164 $('.vertical-menu-toggle').off('click.open', openHandler); 1165 $('.menu-item-has-children > a', $mainNavigation).off('click.active', clickHandler); 1166 $back.off('click.back', backHandler); 1167 $close.off('click.close', closeHandler); 1168 $mainMenu.removeClass('scroll'); 1169 1170 $('.main-navigation .menu').css('transform', 'translateX(0)'); 1171 1172 } else { 1173 $mainNavigation.addClass('vertical-menu'); 1174 $('.vertical-menu-toggle').off('click.open', openHandler).on('click.open', openHandler); 1175 $('.menu-item-has-children > a', $mainNavigation).off('click.active', clickHandler).on('click.active', clickHandler); 1176 $back.on('click.back', backHandler); 1177 $close.on('click.close', closeHandler); 1178 $mainMenu.addClass('scroll'); 1179 } 1180 } 1181 1182 $('.menu-item-has-children', $mainNavigation).each(function() { 1183 var $li = $(this), 1184 $link = $('>a', $li), 1185 linkText = $link.html(), 1186 linkHref = $link[0].cloneNode(true), 1187 $subMenu = $('> .sub-menu', $li); 1188 $subMenu.prepend('<li class="parent-title"><a href="' + linkHref + '">' + linkText + '</a></li>'); 1189 }); 1190 1191 function openHandler(event) { 1192 $(this).toggleClass('toggled'); 1193 if ($mainNavigation.hasClass('menu-open')) { 1194 closeHandler(); 1195 return false; 1196 } 1197 $mainNavigation.toggleClass('menu-open'); 1198 } 1199 1200 function backHandler(event) { 1201 var currentTranslate = parseInt(($mainMenu.css('transform').replace(/,/g, "")).split(" ")[4]), 1202 translate = currentTranslate + offset, 1203 $active = $('.active', $mainMenu), 1204 $lastActive = $($active[$active.length - 1]); 1205 1206 if (isAnimate) { 1207 return false; 1208 } 1209 1210 if (currentTranslate < 0) { 1211 isAnimate = true; 1212 $mainMenu.css('transform', 'translateX(' + translate + 'px)'); 1213 1214 if (translate >= 0) { 1215 translate = 0; 1216 $(this).addClass('hide'); 1217 $close.removeClass('hide'); 1218 } 1219 1220 setTimeout(function() { 1221 $lastActive.removeClass('active'); 1222 $lastActive.siblings().toggleClass('hide'); 1223 $('>a', $lastActive).removeClass('hide'); 1224 $lastActive.parent().addClass('scroll'); 1225 isAnimate = false; 1226 }, 250); 1227 1228 } 1229 return false; 1230 } 1231 1232 function closeHandler(event) { 1233 if (!isAnimate) { 1234 $('.active', $mainMenu).removeClass('active'); 1235 $('.hide', $mainMenu).removeClass('hide'); 1236 $('.close.hide', $mainNavigation).removeClass('hide'); 1237 $back.addClass('hide'); 1238 $mainNavigation.removeClass('menu-open'); 1239 $mainMenu.css('transform', 'translateX(0)'); 1240 } 1241 1242 $('.vertical-menu-toggle').removeClass('toggled'); 1243 return false;
1244 } 1245 1246 function clickHandler(event) { 1247 var $_target = $(event.currentTarget), 1248 $mainMenu = $_target.closest('.menu'), 1249 deep = $_target.parents('ul').length, 1250 translate = deep * offset; 1251 1252 $mainMenu.css('transform', 'translateX(' + -translate + 'px)'); 1253 1254 setTimeout(function() { 1255 $_target.parent().addClass('active'); 1256 $_target.parent().siblings().toggleClass('hide'); 1257 $_target.parents('.active').find('> a').addClass('hide'); 1258 $_target.siblings('ul').addClass('scroll'); 1259 $_target.parents('ul').removeClass('scroll'); 1260 }, 250); 1261 1262 $back.removeClass('hide'); 1263 $close.addClass('hide'); 1264 1265 return false; 1266 } 1267 }, 1268 1269 add_project_inline_style: function(self) { 1270 var $projectGridContainer = $('.projects-container.grid-layout'), 1271 $projectJustifiedContainer = $('.projects-container.justified-layout'), 1272 $projectGridTermsContainer = $('.projects-terms-container.grid-layout'), 1273 $projectContainer = $('.projects-container'), 1274 1275 addInlineStyle = function() { 1276 var $this = $(this), 1277 $projectsSettings = $this.data('settings'), 1278 $projectItemIndent = Math.ceil(+$projectsSettings['item-margin']); 1279 1280 $this.css({ 1281 'margin-left': -$projectItemIndent / 2 + 'px', 1282 'margin-right': -$projectItemIndent / 2 + 'px' 1283 }); 1284 }, 1285 1286 addTemplateClass = function() { 1287 var $this = $(this), 1288 $projectsSettings = $this.data('settings'), 1289 $projectsTemplate = $projectsSettings['template']; 1290 1291 if ($projectsTemplate) { 1292 $this.addClass($projectsTemplate.replace('.', '-')); 1293 } 1294 }; 1295 1296 $projectGridContainer.each(addInlineStyle); 1297 $projectJustifiedContainer.each(addInlineStyle); 1298 $projectGridTermsContainer.each(addInlineStyle); 1299 1300 $projectContainer.each(addTemplateClass); 1301 }, 1302 1303 replyLinkScroll: function() { 1304 var $replyLink = $('.comment-reply-link'), 1305 $respondForm = $('#respond'); 1306 1307 if ($replyLink[0] && $respondForm[0]) { 1308 $replyLink.each(function() { 1309 $(this).on('click', function(event) { 1310 $('html, body').animate({ 1311 scrollTop: $respondForm.offset().top 1312 }, 500) 1313 }); 1314 }) 1315 } 1316 } 1317 }; 1318 CherryJsCore.theme_script.init(); 1319 1320}(jQuery));
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.