Файловый менеджер - Редактировать - /home/neurocs/www/wp-content/themes/mediclinic/assets/js/modules.js
Назад
(function($) { "use strict"; window.mkdf = {}; mkdf.modules = {}; mkdf.scroll = 0; mkdf.window = $(window); mkdf.document = $(document); mkdf.windowWidth = $(window).width(); mkdf.windowHeight = $(window).height(); mkdf.body = $('body'); mkdf.html = $('html, body'); mkdf.htmlEl = $('html'); mkdf.menuDropdownHeightSet = false; mkdf.defaultHeaderStyle = ''; mkdf.minVideoWidth = 1500; mkdf.videoWidthOriginal = 1280; mkdf.videoHeightOriginal = 720; mkdf.videoRatio = 1.61; mkdf.mkdfOnDocumentReady = mkdfOnDocumentReady; mkdf.mkdfOnWindowLoad = mkdfOnWindowLoad; mkdf.mkdfOnWindowResize = mkdfOnWindowResize; mkdf.mkdfOnWindowScroll = mkdfOnWindowScroll; $(document).ready(mkdfOnDocumentReady); $(window).on('load', mkdfOnWindowLoad); $(window).resize(mkdfOnWindowResize); $(window).scroll(mkdfOnWindowScroll); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdf.scroll = $(window).scrollTop(); //set global variable for header style which we will use in various functions if(mkdf.body.hasClass('mkdf-dark-header')){ mkdf.defaultHeaderStyle = 'mkdf-dark-header';} if(mkdf.body.hasClass('mkdf-light-header')){ mkdf.defaultHeaderStyle = 'mkdf-light-header';} } /* All functions to be called on $(window).load() should be in this function */ function mkdfOnWindowLoad() { } /* All functions to be called on $(window).resize() should be in this function */ function mkdfOnWindowResize() { mkdf.windowWidth = $(window).width(); mkdf.windowHeight = $(window).height(); } /* All functions to be called on $(window).scroll() should be in this function */ function mkdfOnWindowScroll() { mkdf.scroll = $(window).scrollTop(); } //set boxed layout width variable for various calculations switch(true){ case mkdf.body.hasClass('mkdf-grid-1300'): mkdf.boxedLayoutWidth = 1350; break; case mkdf.body.hasClass('mkdf-grid-1200'): mkdf.boxedLayoutWidth = 1250; break; case mkdf.body.hasClass('mkdf-grid-1000'): mkdf.boxedLayoutWidth = 1050; break; case mkdf.body.hasClass('mkdf-grid-800'): mkdf.boxedLayoutWidth = 850; break; default : mkdf.boxedLayoutWidth = 1150; break; } })(jQuery); (function($) { "use strict"; var common = {}; mkdf.modules.common = common; common.mkdfFluidVideo = mkdfFluidVideo; common.mkdfEnableScroll = mkdfEnableScroll; common.mkdfDisableScroll = mkdfDisableScroll; common.mkdfOwlSlider = mkdfOwlSlider; common.mkdfInitParallax = mkdfInitParallax; common.mkdfPrettyPhoto = mkdfPrettyPhoto; common.mkdfInitSelfHostedVideoPlayer = mkdfInitSelfHostedVideoPlayer; common.mkdfSelfHostedVideoSize = mkdfSelfHostedVideoSize; common.getLoadMoreData = getLoadMoreData; common.setLoadMoreAjaxData = setLoadMoreAjaxData; common.mkdfRowScrollingText = mkdfRowScrollingText; common.mkdfOnDocumentReady = mkdfOnDocumentReady; common.mkdfOnWindowLoad = mkdfOnWindowLoad; common.mkdfOnWindowResize = mkdfOnWindowResize; common.mkdfOnWindowScroll = mkdfOnWindowScroll; $(document).ready(mkdfOnDocumentReady); $(window).on('load', mkdfOnWindowLoad); $(window).resize(mkdfOnWindowResize); $(window).scroll(mkdfOnWindowScroll); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfIconWithHover().init(); mkdfIEversion(); mkdfDisableSmoothScrollForMac(); mkdfInitAnchor().init(); mkdfInitBackToTop(); mkdfBackButtonShowHide(); mkdfInitSelfHostedVideoPlayer(); mkdfSelfHostedVideoSize(); mkdfFluidVideo(); mkdfOwlSlider(); mkdfPreloadBackgrounds(); mkdfPrettyPhoto(); mkdfRowScrollingText(); } /* All functions to be called on $(window).load() should be in this function */ function mkdfOnWindowLoad() { mkdfInitParallax(); mkdfSmoothTransition(); } /* All functions to be called on $(window).resize() should be in this function */ function mkdfOnWindowResize() { mkdfSelfHostedVideoSize(); } /* All functions to be called on $(window).scroll() should be in this function */ function mkdfOnWindowScroll() { } /* * IE version */ function mkdfIEversion() { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0) { var version = parseInt(ua.substring(msie + 5, ua.indexOf(".", msie))); mkdf.body.addClass('mkdf-ms-ie'+version); } return false; } /* ** Disable smooth scroll for mac if smooth scroll is enabled */ function mkdfDisableSmoothScrollForMac() { var os = navigator.appVersion.toLowerCase(); if (os.indexOf('mac') > -1 && mkdf.body.hasClass('mkdf-smooth-scroll')) { mkdf.body.removeClass('mkdf-smooth-scroll'); } } function mkdfDisableScroll() { if (window.addEventListener) { window.addEventListener('DOMMouseScroll', mkdfWheel, false); } window.onmousewheel = document.onmousewheel = mkdfWheel; document.onkeydown = mkdfKeydown; } function mkdfEnableScroll() { if (window.removeEventListener) { window.removeEventListener('DOMMouseScroll', mkdfWheel, false); } window.onmousewheel = document.onmousewheel = document.onkeydown = null; } function mkdfWheel(e) { mkdfPreventDefaultValue(e); } function mkdfKeydown(e) { var keys = [37, 38, 39, 40]; for (var i = keys.length; i--;) { if (e.keyCode === keys[i]) { mkdfPreventDefaultValue(e); return; } } } function mkdfPreventDefaultValue(e) { e = e || window.event; if (e.preventDefault) { e.preventDefault(); } e.returnValue = false; } /* ** Anchor functionality */ var mkdfInitAnchor = function() { /** * Set active state on clicked anchor * @param anchor, clicked anchor */ var setActiveState = function(anchor){ $('.mkdf-main-menu .mkdf-active-item, .mkdf-mobile-nav .mkdf-active-item, .mkdf-fullscreen-menu .mkdf-active-item').removeClass('mkdf-active-item'); anchor.parent().addClass('mkdf-active-item'); $('.mkdf-main-menu a, .mkdf-mobile-nav a, .mkdf-fullscreen-menu a').removeClass('current'); anchor.addClass('current'); }; /** * Check anchor active state on scroll */ var checkActiveStateOnScroll = function(){ $('[data-mkdf-anchor]').waypoint( function(direction) { if(direction === 'down') { setActiveState($("a[href='"+window.location.href.split('#')[0]+"#"+$(this.element).data("mkdf-anchor")+"']")); } }, { offset: '50%' }); $('[data-mkdf-anchor]').waypoint( function(direction) { if(direction === 'up') { setActiveState($("a[href='"+window.location.href.split('#')[0]+"#"+$(this.element).data("mkdf-anchor")+"']")); } }, { offset: function(){ return -($(this.element).outerHeight() - 150); } }); }; /** * Check anchor active state on load */ var checkActiveStateOnLoad = function(){ var hash = window.location.hash.split('#')[1]; if(hash !== "" && $('[data-mkdf-anchor="'+hash+'"]').length > 0){ anchorClickOnLoad(hash); } }; /** * Handle anchor on load */ var anchorClickOnLoad = function($this) { var scrollAmount; var anchor = $('a'); var hash = $this; if(hash !== "" && $('[data-mkdf-anchor="' + hash + '"]').length > 0 ) { var anchoredElementOffset = $('[data-mkdf-anchor="' + hash + '"]').offset().top; scrollAmount = $('[data-mkdf-anchor="' + hash + '"]').offset().top - headerHeihtToSubtract(anchoredElementOffset) - mkdfGlobalVars.vars.mkdfAddForAdminBar; setActiveState(anchor); mkdf.html.stop().animate({ scrollTop: Math.round(scrollAmount) }, 1000, function() { //change hash tag in url if(history.pushState) { history.pushState(null, null, '#'+hash); } }); return false; } }; /** * Calculate header height to be substract from scroll amount * @param anchoredElementOffset, anchorded element offest */ var headerHeihtToSubtract = function(anchoredElementOffset){ if(mkdf.modules.stickyHeader.behaviour === 'mkdf-sticky-header-on-scroll-down-up') { mkdf.modules.stickyHeader.isStickyVisible = (anchoredElementOffset > mkdf.modules.header.stickyAppearAmount); } if(mkdf.modules.stickyHeader.behaviour === 'mkdf-sticky-header-on-scroll-up') { if((anchoredElementOffset > mkdf.scroll)){ mkdf.modules.stickyHeader.isStickyVisible = false; } } var headerHeight = mkdf.modules.stickyHeader.isStickyVisible ? mkdfGlobalVars.vars.mkdfStickyHeaderTransparencyHeight : mkdfPerPageVars.vars.mkdfHeaderTransparencyHeight; if(mkdf.windowWidth < 1025) { headerHeight = 0; } return headerHeight; }; /** * Handle anchor click */ var anchorClick = function() { mkdf.document.on("click", ".mkdf-main-menu a, .mkdf-fullscreen-menu a, .mkdf-btn, .mkdf-anchor, .mkdf-mobile-nav a", function() { var scrollAmount; var anchor = $(this); var hash = anchor.prop("hash").split('#')[1]; if(hash !== "" && $('[data-mkdf-anchor="' + hash + '"]').length > 0 ) { var anchoredElementOffset = $('[data-mkdf-anchor="' + hash + '"]').offset().top; scrollAmount = $('[data-mkdf-anchor="' + hash + '"]').offset().top - headerHeihtToSubtract(anchoredElementOffset) - mkdfGlobalVars.vars.mkdfAddForAdminBar; setActiveState(anchor); mkdf.html.stop().animate({ scrollTop: Math.round(scrollAmount) }, 1000, function() { //change hash tag in url if(history.pushState) { history.pushState(null, null, '#'+hash); } }); return false; } }); }; return { init: function() { if($('[data-mkdf-anchor]').length) { anchorClick(); checkActiveStateOnScroll(); $(window).on('load', function() { checkActiveStateOnLoad(); }); } } }; }; function mkdfInitBackToTop(){ var backToTopButton = $('#mkdf-back-to-top'); backToTopButton.on('click',function(e){ e.preventDefault(); mkdf.html.animate({scrollTop: 0}, mkdf.window.scrollTop()/3, 'linear'); }); } function mkdfBackButtonShowHide(){ mkdf.window.scroll(function () { var b = $(this).scrollTop(); var c = $(this).height(); var d; if (b > 0) { d = b + c / 2; } else { d = 1; } if (d < 1e3) { mkdfToTopButton('off'); } else { mkdfToTopButton('on'); } }); } function mkdfToTopButton(a) { var b = $("#mkdf-back-to-top"); b.removeClass('off on'); if (a === 'on') { b.addClass('on'); } else { b.addClass('off'); } } function mkdfInitSelfHostedVideoPlayer() { var players = $('.mkdf-self-hosted-video'); if(players.length) { players.mediaelementplayer({ audioWidth: '100%' }); } } function mkdfSelfHostedVideoSize(){ var selfVideoHolder = $('.mkdf-self-hosted-video-holder .mkdf-video-wrap'); if(selfVideoHolder.length) { selfVideoHolder.each(function(){ var thisVideo = $(this), videoWidth = thisVideo.closest('.mkdf-self-hosted-video-holder').outerWidth(), videoHeight = videoWidth / mkdf.videoRatio; if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ thisVideo.parent().width(videoWidth); thisVideo.parent().height(videoHeight); } thisVideo.width(videoWidth); thisVideo.height(videoHeight); thisVideo.find('video, .mejs-overlay, .mejs-poster').width(videoWidth); thisVideo.find('video, .mejs-overlay, .mejs-poster').height(videoHeight); }); } } function mkdfFluidVideo() { fluidvids.init({ selector: ['iframe'], players: ['www.youtube.com', 'player.vimeo.com'] }); } function mkdfSmoothTransition() { if (mkdf.body.hasClass('mkdf-smooth-page-transitions')) { //check for preload animation if (mkdf.body.hasClass('mkdf-smooth-page-transitions-preloader')) { var loader = $('body > .mkdf-smooth-transition-loader.mkdf-mimic-ajax'); loader.fadeOut(500); $(window).on('pageshow', function (event) { if (event.originalEvent.persisted) { loader.fadeOut(500); } }); } // if back button is pressed, than show content to avoid state where content is on display:none window.addEventListener( "pageshow", function ( event ) { var historyPath = event.persisted || ( typeof window.performance != "undefined" && window.performance.navigation.type === 2 ); if ( historyPath ) { $('.mkdf-wrapper-inner').show(); } }); //check for fade out animation if (mkdf.body.hasClass('mkdf-smooth-page-transitions-fadeout')) { var linkItem = $('a'); linkItem.on('click',function (e) { var a = $(this); if ((a.parents('.mkdf-shopping-cart-dropdown').length || a.parent('.product-remove').length) && a.hasClass('remove')) { return; } if ( e.which == 1 && // check if the left mouse button has been pressed a.attr('href').indexOf(window.location.host) >= 0 && // check if the link is to the same domain (typeof a.data('rel') === 'undefined') && //Not pretty photo link (typeof a.attr('rel') === 'undefined') && //Not VC pretty photo link (typeof a.attr('target') === 'undefined' || a.attr('target') === '_self') && // check if the link opens in the same window (a.attr('href').split('#')[0] !== window.location.href.split('#')[0]) // check if it is an anchor aiming for a different page ) { e.preventDefault(); $('.mkdf-wrapper-inner').fadeOut(1000, function () { window.location = a.attr('href'); }); } }); } } } /* * Preload background images for elements that have 'mkdf-preload-background' class */ function mkdfPreloadBackgrounds(){ var preloadBackHolder = $('.mkdf-preload-background'); if(preloadBackHolder.length) { preloadBackHolder.each(function() { var preloadBackground = $(this); if(preloadBackground.css("background-image") !== "" && preloadBackground.css("background-image") != "none") { var bgUrl = preloadBackground.attr('style'); bgUrl = bgUrl.match(/url\(["']?([^'")]+)['"]?\)/); bgUrl = bgUrl ? bgUrl[1] : ""; if (bgUrl) { var backImg = new Image(); backImg.src = bgUrl; $(backImg).load(function(){ preloadBackground.removeClass('mkdf-preload-background'); }); } } else { $(window).on('load', function(){ preloadBackground.removeClass('mkdf-preload-background'); }); //make sure that mkdf-preload-background class is removed from elements with forced background none in css } }); } } function mkdfPrettyPhoto() { /*jshint multistr: true */ var markupWhole = '<div class="pp_pic_holder"> \ <div class="ppt"> </div> \ <div class="pp_top"> \ <div class="pp_left"></div> \ <div class="pp_middle"></div> \ <div class="pp_right"></div> \ </div> \ <div class="pp_content_container"> \ <div class="pp_left"> \ <div class="pp_right"> \ <div class="pp_content"> \ <div class="pp_loaderIcon"></div> \ <div class="pp_fade"> \ <a href="#" class="pp_expand" title="Expand the image">Expand</a> \ <div class="pp_hoverContainer"> \ <a class="pp_next" href="#"><span class="fa fa-angle-right"></span></a> \ <a class="pp_previous" href="#"><span class="fa fa-angle-left"></span></a> \ </div> \ <div id="pp_full_res"></div> \ <div class="pp_details"> \ <div class="pp_nav"> \ <a href="#" class="pp_arrow_previous">Previous</a> \ <p class="currentTextHolder">0/0</p> \ <a href="#" class="pp_arrow_next">Next</a> \ </div> \ <p class="pp_description"></p> \ {pp_social} \ <a class="pp_close" href="#">Close</a> \ </div> \ </div> \ </div> \ </div> \ </div> \ </div> \ <div class="pp_bottom"> \ <div class="pp_left"></div> \ <div class="pp_middle"></div> \ <div class="pp_right"></div> \ </div> \ </div> \ <div class="pp_overlay"></div>'; $("a[data-rel^='prettyPhoto']").prettyPhoto({ hook: 'data-rel', animation_speed: 'normal', /* fast/slow/normal */ slideshow: false, /* false OR interval time in ms */ autoplay_slideshow: false, /* true/false */ opacity: 0.80, /* Value between 0 and 1 */ show_title: true, /* true/false */ allow_resize: true, /* Resize the photos bigger than viewport. true/false */ horizontal_padding: 0, default_width: 960, default_height: 540, counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */ theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */ hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */ wmode: 'opaque', /* Set the flash wmode attribute */ autoplay: true, /* Automatically start videos: True/False */ modal: false, /* If set to true, only the close button will close the window */ overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */ keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */ deeplinking: false, custom_markup: '', social_tools: false, markup: markupWhole }); } /** * Initializes load more data params * @param container with defined data params * return array */ function getLoadMoreData(container){ var dataList = container.data(), returnValue = {}; for (var property in dataList) { if (dataList.hasOwnProperty(property)) { if (typeof dataList[property] !== 'undefined' && dataList[property] !== false) { returnValue[property] = dataList[property]; } } } return returnValue; } /** * Sets load more data params for ajax function * @param container with defined data params * return array */ function setLoadMoreAjaxData(container, action){ var returnValue = { action: action }; for (var property in container) { if (container.hasOwnProperty(property)) { if (typeof container[property] !== 'undefined' && container[property] !== false) { returnValue[property] = container[property]; } } } return returnValue; } /** * Object that represents icon with hover data * @returns {{init: Function}} function that initializes icon's functionality */ var mkdfIconWithHover = function() { //get all icons on page var icons = $('.mkdf-icon-has-hover'); /** * Function that triggers icon hover color functionality */ var iconHoverColor = function(icon) { if(typeof icon.data('hover-color') !== 'undefined') { var changeIconColor = function(event) { event.data.icon.css('color', event.data.color); }; var hoverColor = icon.data('hover-color'), originalColor = icon.css('color'); if(hoverColor !== '') { icon.on('mouseenter', {icon: icon, color: hoverColor}, changeIconColor); icon.on('mouseleave', {icon: icon, color: originalColor}, changeIconColor); } } }; return { init: function() { if(icons.length) { icons.each(function() { iconHoverColor($(this)); }); } } }; }; /* ** Init text marquee */ function mkdfRowScrollingText(){ var element = $('.mkdf-marquee-holder'); element.each(function() { var holder = $(this); var inner = $(this).find('.mkdf-marquee'); holder.scrollForever({ placeholder: 0, speed: 1000, delayTime: 0, continuous: true, num: 1 }); holder.animate({opacity: "1"}, 300); }); } /* ** Init vc parallax */ function mkdfInitParallax(){ var parallaxHolder = $('.mkdf-parallax-row-holder'); if(parallaxHolder.length){ parallaxHolder.each(function() { var parallaxElement = $(this), image = parallaxElement.data('parallax-bg-image'), speed = parallaxElement.data('parallax-bg-speed') * 0.4, height = 0; if (typeof parallaxElement.data('parallax-bg-height') !== 'undefined' && parallaxElement.data('parallax-bg-height') !== false) { height = parseInt(parallaxElement.data('parallax-bg-height')); } parallaxElement.css({'background-image': 'url('+image+')'}); if(height > 0) { parallaxElement.css({'min-height': height+'px', 'height': height+'px'}); } parallaxElement.parallax('50%', speed); }); } } /** * Init Owl Carousel */ function mkdfOwlSlider() { var sliders = $('.mkdf-owl-slider'); if (sliders.length) { sliders.each(function(){ var slider = $(this), slideItemsNumber = slider.children().length, numberOfItems = 1, loop = true, autoplay = true, autoplayHoverPause = true, sliderSpeed = 5000, sliderSpeedAnimation = 600, margin = 0, center = false, autoWidth = false, animateInClass = false, // keyframe css animation animateOut = false, // keyframe css animation navigation = true, pagination = false, sliderIsPortfolio = !!slider.hasClass('mkdf-pl-is-slider'), sliderDataHolder = sliderIsPortfolio ? slider.parent() : slider; // this is condition for portfolio slider if (typeof slider.data('number-of-items') !== 'undefined' && slider.data('number-of-items') !== false && !sliderIsPortfolio) { numberOfItems = slider.data('number-of-items'); } if (typeof sliderDataHolder.data('number-of-columns') !== 'undefined' && sliderDataHolder.data('number-of-columns') !== false && sliderIsPortfolio) { numberOfItems = sliderDataHolder.data('number-of-columns'); } if (sliderDataHolder.data('enable-loop') === 'no') { loop = false; } if (sliderDataHolder.data('enable-autoplay') === 'no') { autoplay = false; } if (sliderDataHolder.data('enable-autoplay-hover-pause') === 'no') { autoplayHoverPause = false; } if (typeof sliderDataHolder.data('slider-speed') !== 'undefined' && sliderDataHolder.data('slider-speed') !== false) { sliderSpeed = sliderDataHolder.data('slider-speed'); } if (typeof sliderDataHolder.data('slider-speed-animation') !== 'undefined' && sliderDataHolder.data('slider-speed-animation') !== false) { sliderSpeedAnimation = sliderDataHolder.data('slider-speed-animation'); } if (typeof sliderDataHolder.data('slider-margin') !== 'undefined' && sliderDataHolder.data('slider-margin') !== false) { margin = sliderDataHolder.data('slider-margin'); } if(slider.parent().hasClass('mkdf-normal-space')) { margin = 30; } else if (slider.parent().hasClass('mkdf-small-space')) { margin = 20; } else if (slider.parent().hasClass('mkdf-tiny-space')) { margin = 10; } if (sliderDataHolder.data('enable-center') === 'yes') { center = true; } if (sliderDataHolder.data('enable-auto-width') === 'yes') { autoWidth = true; } if (typeof sliderDataHolder.data('slider-animate-in') !== 'undefined' && sliderDataHolder.data('slider-animate-in') !== false) { animateInClass = sliderDataHolder.data('slider-animate-in'); } if (typeof sliderDataHolder.data('slider-animate-out') !== 'undefined' && sliderDataHolder.data('slider-animate-out') !== false) { animateOut = sliderDataHolder.data('slider-animate-out'); } if (sliderDataHolder.data('enable-navigation') === 'no') { navigation = false; } if (sliderDataHolder.data('enable-pagination') === 'yes') { pagination = true; } if(navigation && pagination) { slider.addClass('mkdf-slider-has-both-nav'); } if (slideItemsNumber <= 1) { loop = false; autoplay = false; navigation = false; pagination = false; } var responsiveNumberOfItems1 = 1, responsiveNumberOfItems2 = 2, responsiveNumberOfItems3 = 3, responsiveNumberOfItems4 = numberOfItems; if (numberOfItems < 3) { responsiveNumberOfItems2 = numberOfItems; responsiveNumberOfItems3 = numberOfItems; } if (numberOfItems > 4) { responsiveNumberOfItems4 = 4; } slider.owlCarousel({ items: numberOfItems, loop: loop, autoplay: autoplay, autoplayHoverPause: autoplayHoverPause, autoplayTimeout: sliderSpeed, smartSpeed: sliderSpeedAnimation, margin: margin, center: center, autoWidth: autoWidth, animateInClass : animateInClass, animateOut : animateOut, dots: pagination, nav: navigation, navText: [ '<span class="mkdf-prev-icon"><span class="mkdf-icon-arrow ion-ios-arrow-left"></span></span>', '<span class="mkdf-next-icon"><span class="mkdf-icon-arrow ion-ios-arrow-right"></span></span>' ], responsive: { 0: { items: responsiveNumberOfItems1, margin: 0, center: false, autoWidth: false }, 681: { items: responsiveNumberOfItems2 }, 769: { items: responsiveNumberOfItems3 }, 1025: { items: responsiveNumberOfItems4 }, 1281: { items: numberOfItems } }, onInitialize: function () { slider.css('visibility', 'visible'); mkdfInitParallax(); } }); }); } } })(jQuery); (function($) { 'use strict'; var like = {}; like.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /** * All functions to be called on $(document).ready() should be in this function **/ function mkdfOnDocumentReady() { mkdfLikes(); } function mkdfLikes() { $(document).on('click','.mkdf-like', function() { var likeLink = $(this), id = likeLink.attr('id'), type; if ( likeLink.hasClass('liked') ) { return false; } if (typeof likeLink.data('type') !== 'undefined') { type = likeLink.data('type'); } var dataToPass = { action: 'mediclinic_mikado_like', likes_id: id, type: type }; var like = $.post(mkdfGlobalVars.vars.mkdfAjaxUrl, dataToPass, function( data ) { likeLink.html(data).addClass('liked').attr('title', 'You already like this!'); }); return false; }); } })(jQuery); (function($) { "use strict"; var blog = {}; mkdf.modules.blog = blog; blog.mkdfOnDocumentReady = mkdfOnDocumentReady; blog.mkdfOnWindowLoad = mkdfOnWindowLoad; blog.mkdfOnWindowResize = mkdfOnWindowResize; blog.mkdfOnWindowScroll = mkdfOnWindowScroll; $(document).ready(mkdfOnDocumentReady); $(window).on('load', mkdfOnWindowLoad); $(window).resize(mkdfOnWindowResize); $(window).scroll(mkdfOnWindowScroll); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitAudioPlayer(); } /* All functions to be called on $(window).load() should be in this function */ function mkdfOnWindowLoad() { mkdfInitBlogPagination().init(); mkdfInitBlogListShortcodePagination().init(); } /* All functions to be called on $(window).resize() should be in this function */ function mkdfOnWindowResize() { } /* All functions to be called on $(window).scroll() should be in this function */ function mkdfOnWindowScroll() { mkdfInitBlogPagination().scroll(); mkdfInitBlogListShortcodePagination().scroll(); } /** * Init audio player for Blog list and single pages */ function mkdfInitAudioPlayer() { var players = $('audio.mkdf-blog-audio'); players.mediaelementplayer({ audioWidth: '100%' }); } /** * Init Resize Blog Items */ function mkdfResizeBlogItems(size,container){ if(container.hasClass('mkdf-masonry-images-fixed')) { var padding = parseInt(container.find('article').css('padding-left')), defaultMasonryItem = container.find('.mkdf-post-size-default'), largeWidthMasonryItem = container.find('.mkdf-post-size-large-width'), largeHeightMasonryItem = container.find('.mkdf-post-size-large-height'), largeWidthHeightMasonryItem = container.find('.mkdf-post-size-large-width-height'); if (mkdf.windowWidth > 680) { defaultMasonryItem.css('height', size - 2 * padding); largeHeightMasonryItem.css('height', Math.round(2 * size) - 2 * padding); largeWidthHeightMasonryItem.css('height', Math.round(2 * size) - 2 * padding); largeWidthMasonryItem.css('height', size - 2 * padding); } else { defaultMasonryItem.css('height', size); largeHeightMasonryItem.css('height', size); largeWidthHeightMasonryItem.css('height', size); largeWidthMasonryItem.css('height', Math.round(size / 2)); } } } /** * Initializes blog pagination functions */ function mkdfInitBlogPagination(){ var holder = $('.mkdf-blog-holder'); var initLoadMorePagination = function(thisHolder) { var loadMoreButton = thisHolder.find('.mkdf-blog-pag-load-more a'); loadMoreButton.on('click', function(e) { e.preventDefault(); e.stopPropagation(); initMainPagFunctionality(thisHolder); }); }; var initInifiteScrollPagination = function(thisHolder) { var blogListHeight = thisHolder.outerHeight(), blogListTopOffest = thisHolder.offset().top, blogListPosition = blogListHeight + blogListTopOffest - mkdfGlobalVars.vars.mkdfAddForAdminBar; if(!thisHolder.hasClass('mkdf-blog-pagination-infinite-scroll-started') && mkdf.scroll + mkdf.windowHeight > blogListPosition) { initMainPagFunctionality(thisHolder); } }; var initMainPagFunctionality = function(thisHolder) { var thisHolderInner = thisHolder.children('.mkdf-blog-holder-inner'), nextPage, maxNumPages; if (typeof thisHolder.data('max-num-pages') !== 'undefined' && thisHolder.data('max-num-pages') !== false) { maxNumPages = thisHolder.data('max-num-pages'); } if(thisHolder.hasClass('mkdf-blog-pagination-infinite-scroll')) { thisHolder.addClass('mkdf-blog-pagination-infinite-scroll-started'); } var loadMoreDatta = mkdf.modules.common.getLoadMoreData(thisHolder), loadingItem = thisHolder.find('.mkdf-blog-pag-loading'); nextPage = loadMoreDatta.nextPage; if(nextPage <= maxNumPages){ loadingItem.addClass('mkdf-showing'); var ajaxData = mkdf.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'mediclinic_mikado_blog_load_more'); $.ajax({ type: 'POST', data: ajaxData, url: mkdfGlobalVars.vars.mkdfAjaxUrl, success: function (data) { nextPage++; thisHolder.data('next-page', nextPage); var response = $.parseJSON(data), responseHtml = response.html; thisHolder.waitForImages(function(){ if(thisHolder.hasClass('mkdf-blog-type-masonry')){ mkdfInitAppendIsotopeNewContent(thisHolderInner, loadingItem, responseHtml); mkdfResizeBlogItems(thisHolderInner.find('.mkdf-blog-masonry-grid-sizer').width(), thisHolder); } else { mkdfInitAppendGalleryNewContent(thisHolderInner, loadingItem, responseHtml); } setTimeout(function() { mkdfInitAudioPlayer(); mkdf.modules.common.mkdfOwlSlider(); mkdf.modules.common.mkdfFluidVideo(); mkdf.modules.common.mkdfInitSelfHostedVideoPlayer(); mkdf.modules.common.mkdfSelfHostedVideoSize(); }, 400); }); if(thisHolder.hasClass('mkdf-blog-pagination-infinite-scroll-started')) { thisHolder.removeClass('mkdf-blog-pagination-infinite-scroll-started'); } } }); } if(nextPage === maxNumPages){ thisHolder.find('.mkdf-blog-pag-load-more').hide(); } }; var mkdfInitAppendIsotopeNewContent = function(thisHolderInner, loadingItem, responseHtml) { thisHolderInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'}); loadingItem.removeClass('mkdf-showing'); setTimeout(function() { thisHolderInner.isotope('layout'); }, 400); }; var mkdfInitAppendGalleryNewContent = function(thisHolderInner, loadingItem, responseHtml) { loadingItem.removeClass('mkdf-showing'); thisHolderInner.append(responseHtml); }; return { init: function() { if(holder.length) { holder.each(function() { var thisHolder = $(this); if(thisHolder.hasClass('mkdf-blog-pagination-load-more')) { initLoadMorePagination(thisHolder); } if(thisHolder.hasClass('mkdf-blog-pagination-infinite-scroll')) { initInifiteScrollPagination(thisHolder); } }); } }, scroll: function() { if(holder.length) { holder.each(function() { var thisHolder = $(this); if(thisHolder.hasClass('mkdf-blog-pagination-infinite-scroll')) { initInifiteScrollPagination(thisHolder); } }); } } }; } /** * Init blog list shortcode pagination functions */ function mkdfInitBlogListShortcodePagination(){ var holder = $('.mkdf-blog-list-holder'); var initStandardPagination = function(thisHolder) { var standardLink = thisHolder.find('.mkdf-bl-standard-pagination li'); if(standardLink.length) { standardLink.each(function(){ var thisLink = $(this).children('a'), pagedLink = 1; thisLink.on('click', function(e) { e.preventDefault(); e.stopPropagation(); if (typeof thisLink.data('paged') !== 'undefined' && thisLink.data('paged') !== false) { pagedLink = thisLink.data('paged'); } initMainPagFunctionality(thisHolder, pagedLink); }); }); } }; var initLoadMorePagination = function(thisHolder) { var loadMoreButton = thisHolder.find('.mkdf-blog-pag-load-more a'); loadMoreButton.on('click', function(e) { e.preventDefault(); e.stopPropagation(); initMainPagFunctionality(thisHolder); }); }; var initInifiteScrollPagination = function(thisHolder) { var blogListHeight = thisHolder.outerHeight(), blogListTopOffest = thisHolder.offset().top, blogListPosition = blogListHeight + blogListTopOffest - mkdfGlobalVars.vars.mkdfAddForAdminBar; if(!thisHolder.hasClass('mkdf-bl-pag-infinite-scroll-started') && mkdf.scroll + mkdf.windowHeight > blogListPosition) { initMainPagFunctionality(thisHolder); } }; var initMainPagFunctionality = function(thisHolder, pagedLink) { var thisHolderInner = thisHolder.find('.mkdf-blog-list'), nextPage, maxNumPages; if (typeof thisHolder.data('max-num-pages') !== 'undefined' && thisHolder.data('max-num-pages') !== false) { maxNumPages = thisHolder.data('max-num-pages'); } if(thisHolder.hasClass('mkdf-bl-pag-standard-blog-list')) { thisHolder.data('next-page', pagedLink); } if(thisHolder.hasClass('mkdf-bl-pag-infinite-scroll')) { thisHolder.addClass('mkdf-bl-pag-infinite-scroll-started'); } var loadMoreDatta = mkdf.modules.common.getLoadMoreData(thisHolder), loadingItem = thisHolder.find('.mkdf-blog-pag-loading'); nextPage = loadMoreDatta.nextPage; if(nextPage <= maxNumPages){ if(thisHolder.hasClass('mkdf-bl-pag-standard-blog-list')) { loadingItem.addClass('mkdf-showing mkdf-standard-pag-trigger'); thisHolder.addClass('mkdf-bl-pag-standard-blog-list-animate'); } else { loadingItem.addClass('mkdf-showing'); } var ajaxData = mkdf.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'mediclinic_mikado_blog_shortcode_load_more'); $.ajax({ type: 'POST', data: ajaxData, url: mkdfGlobalVars.vars.mkdfAjaxUrl, success: function (data) { if(!thisHolder.hasClass('mkdf-bl-pag-standard-blog-list')) { nextPage++; } thisHolder.data('next-page', nextPage); var response = $.parseJSON(data), responseHtml = response.html; if(thisHolder.hasClass('mkdf-bl-pag-standard-blog-list')) { mkdfInitStandardPaginationLinkChanges(thisHolder, maxNumPages, nextPage); thisHolder.waitForImages(function(){ if(thisHolder.hasClass('mkdf-bl-masonry')){ mkdfInitHtmlIsotopeNewContent(thisHolder, thisHolderInner, loadingItem, responseHtml); } else { mkdfInitHtmlGalleryNewContent(thisHolder, thisHolderInner, loadingItem, responseHtml); } }); } else { thisHolder.waitForImages(function(){ if(thisHolder.hasClass('mkdf-bl-masonry')){ mkdfInitAppendIsotopeNewContent(thisHolderInner, loadingItem, responseHtml); } else { mkdfInitAppendGalleryNewContent(thisHolderInner, loadingItem, responseHtml); } }); } if(thisHolder.hasClass('mkdf-bl-pag-infinite-scroll-started')) { thisHolder.removeClass('mkdf-bl-pag-infinite-scroll-started'); } } }); } if(nextPage === maxNumPages){ thisHolder.find('.mkdf-blog-pag-load-more').hide(); } }; var mkdfInitStandardPaginationLinkChanges = function(thisHolder, maxNumPages, nextPage) { var standardPagHolder = thisHolder.find('.mkdf-bl-standard-pagination'), standardPagNumericItem = standardPagHolder.find('li.mkdf-bl-pag-number'), standardPagPrevItem = standardPagHolder.find('li.mkdf-bl-pag-prev a'), standardPagNextItem = standardPagHolder.find('li.mkdf-bl-pag-next a'); standardPagNumericItem.removeClass('mkdf-bl-pag-active'); standardPagNumericItem.eq(nextPage-1).addClass('mkdf-bl-pag-active'); standardPagPrevItem.data('paged', nextPage-1); standardPagNextItem.data('paged', nextPage+1); if(nextPage > 1) { standardPagPrevItem.css({'opacity': '1'}); } else { standardPagPrevItem.css({'opacity': '0'}); } if(nextPage === maxNumPages) { standardPagNextItem.css({'opacity': '0'}); } else { standardPagNextItem.css({'opacity': '1'}); } }; var mkdfInitHtmlIsotopeNewContent = function(thisHolder, thisHolderInner, loadingItem, responseHtml) { thisHolderInner.html(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'}); loadingItem.removeClass('mkdf-showing mkdf-standard-pag-trigger'); thisHolder.removeClass('mkdf-bl-pag-standard-blog-list-animate'); setTimeout(function() { thisHolderInner.isotope('layout'); }, 400); }; var mkdfInitHtmlGalleryNewContent = function(thisHolder, thisHolderInner, loadingItem, responseHtml) { loadingItem.removeClass('mkdf-showing mkdf-standard-pag-trigger'); thisHolder.removeClass('mkdf-bl-pag-standard-blog-list-animate'); thisHolderInner.html(responseHtml); }; var mkdfInitAppendIsotopeNewContent = function(thisHolderInner, loadingItem, responseHtml) { thisHolderInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'}); loadingItem.removeClass('mkdf-showing'); setTimeout(function() { thisHolderInner.isotope('layout'); }, 400); }; var mkdfInitAppendGalleryNewContent = function(thisHolderInner, loadingItem, responseHtml) { loadingItem.removeClass('mkdf-showing'); thisHolderInner.append(responseHtml); }; return { init: function() { if(holder.length) { holder.each(function() { var thisHolder = $(this); if(thisHolder.hasClass('mkdf-bl-pag-standard-blog-list')) { initStandardPagination(thisHolder); } if(thisHolder.hasClass('mkdf-bl-pag-load-more')) { initLoadMorePagination(thisHolder); } if(thisHolder.hasClass('mkdf-bl-pag-infinite-scroll')) { initInifiteScrollPagination(thisHolder); } }); } }, scroll: function() { if(holder.length) { holder.each(function() { var thisHolder = $(this); if(thisHolder.hasClass('mkdf-bl-pag-infinite-scroll')) { initInifiteScrollPagination(thisHolder); } }); } } }; } })(jQuery); (function($) { "use strict"; var header = {}; mkdf.modules.header = header; header.mkdfSetDropDownMenuPosition = mkdfSetDropDownMenuPosition; header.mkdfSetDropDownWideMenuPosition = mkdfSetDropDownWideMenuPosition; header.mkdfOnDocumentReady = mkdfOnDocumentReady; header.mkdfOnWindowLoad = mkdfOnWindowLoad; header.mkdfOnWindowResize = mkdfOnWindowResize; header.mkdfOnWindowScroll = mkdfOnWindowScroll; $(document).ready(mkdfOnDocumentReady); $(window).on('load', mkdfOnWindowLoad); $(window).resize(mkdfOnWindowResize); $(window).scroll(mkdfOnWindowScroll); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfSetDropDownMenuPosition(); mkdfDropDownMenu(); mkdfSearch(); mkdfSideArea(); mkdfSideAreaScroll(); mkdfMenuUnderline(); } /* All functions to be called on $(window).load() should be in this function */ function mkdfOnWindowLoad() { mkdfSetDropDownWideMenuPosition(); } /* All functions to be called on $(window).resize() should be in this function */ function mkdfOnWindowResize() { } /* All functions to be called on $(window).scroll() should be in this function */ function mkdfOnWindowScroll() { } /** * Set dropdown position */ function mkdfSetDropDownMenuPosition() { var menuItems = $('.mkdf-drop-down > ul > li.narrow.menu-item-has-children'); if (menuItems.length) { menuItems.each(function (i) { var thisItem = $(this), menuItemPosition = thisItem.offset().left, dropdownHolder = thisItem.find('.second'), dropdownMenuItem = dropdownHolder.find('.inner ul'), dropdownMenuWidth = dropdownMenuItem.outerWidth(), menuItemFromLeft = mkdf.windowWidth - menuItemPosition; if (mkdf.body.hasClass('mkdf-boxed')) { menuItemFromLeft = mkdf.boxedLayoutWidth - (menuItemPosition - (mkdf.windowWidth - mkdf.boxedLayoutWidth ) / 2); } var dropDownMenuFromLeft; //has to stay undefined beacuse 'dropDownMenuFromLeft < dropdownMenuWidth' condition will be true if (thisItem.find('li.sub').length > 0) { dropDownMenuFromLeft = menuItemFromLeft - dropdownMenuWidth; } dropdownHolder.removeClass('right'); dropdownMenuItem.removeClass('right'); if (menuItemFromLeft < dropdownMenuWidth || dropDownMenuFromLeft < dropdownMenuWidth) { dropdownHolder.addClass('right'); dropdownMenuItem.addClass('right'); } }); } } /** * Set dropdown wide position */ function mkdfSetDropDownWideMenuPosition(){ var menuItems = $(".mkdf-drop-down > ul > li.wide"); if(menuItems.length) { menuItems.each( function(i) { var menuItemSubMenu = $(menuItems[i]).find('.second'); if(menuItemSubMenu.length && !menuItemSubMenu.hasClass('left_position') && !menuItemSubMenu.hasClass('right_position')) { menuItemSubMenu.css('left', 0); var left_position = menuItemSubMenu.offset().left; if(mkdf.body.hasClass('mkdf-boxed')) { var boxedWidth = $('.mkdf-boxed .mkdf-wrapper .mkdf-wrapper-inner').outerWidth(); left_position = left_position - (mkdf.windowWidth - boxedWidth) / 2; menuItemSubMenu.css('left', -left_position); menuItemSubMenu.css('width', boxedWidth); } else { menuItemSubMenu.css('left', -left_position); menuItemSubMenu.css('width', mkdf.windowWidth); } } }); } } function mkdfDropDownMenu() { var menu_items = $('.mkdf-drop-down > ul > li'); menu_items.each(function(i) { if($(menu_items[i]).find('.second').length > 0) { var thisItem = $(menu_items[i]), dropDownSecondDiv = thisItem.find('.second'); if(thisItem.hasClass('wide')) { //set columns to be same height - start var tallest = 0, dropDownSecondItem = $(this).find('.second > .inner > ul > li'); dropDownSecondItem.each(function() { var thisHeight = $(this).height(); if(thisHeight > tallest) { tallest = thisHeight; } }); dropDownSecondItem.css('height', ''); // delete old inline css - via resize dropDownSecondItem.height(tallest); //set columns to be same height - end } if(!mkdf.menuDropdownHeightSet) { thisItem.data('original_height', dropDownSecondDiv.height() + 'px'); dropDownSecondDiv.height(0); } if(navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { thisItem.on("touchstart mouseenter", function() { dropDownSecondDiv.css({ 'height': thisItem.data('original_height'), 'overflow': 'visible', 'visibility': 'visible', 'opacity': '1' }); }).on("mouseleave", function() { dropDownSecondDiv.css({ 'height': '0px', 'overflow': 'hidden', 'visibility': 'hidden', 'opacity': '0' }); }); } else { if(mkdf.body.hasClass('mkdf-dropdown-animate-height')) { thisItem.mouseenter(function() { dropDownSecondDiv.css({ 'visibility': 'visible', 'height': '0px', 'opacity': '0' }); dropDownSecondDiv.stop().animate({ 'height': thisItem.data('original_height'), opacity: 1 }, 300, function() { dropDownSecondDiv.css('overflow', 'visible'); }); }).mouseleave(function() { dropDownSecondDiv.stop().animate({ 'height': '0px' }, 150, function() { dropDownSecondDiv.css({ 'overflow': 'hidden', 'visibility': 'hidden' }); }); }); } else { var config = { interval: 0, over: function() { setTimeout(function() { dropDownSecondDiv.addClass('mkdf-drop-down-start'); dropDownSecondDiv.stop().css({'height': thisItem.data('original_height')}); }, 150); }, timeout: 150, out: function() { dropDownSecondDiv.stop().css({'height': '0px'}); dropDownSecondDiv.removeClass('mkdf-drop-down-start'); } }; thisItem.hoverIntent(config); } } } }); $('.mkdf-drop-down ul li.wide ul li a').on('click', function(e) { if (e.which == 1){ var $this = $(this); setTimeout(function() { $this.mouseleave(); }, 500); } }); mkdf.menuDropdownHeightSet = true; } /** * Init Search Types */ function mkdfSearch() { var searchOpener = $('a.mkdf-search-opener'), searchForm, searchClose; if ( searchOpener.length > 0 ) { //Check for type of search if ( mkdf.body.hasClass( 'mkdf-fullscreen-search' ) ) { searchClose = $( '.mkdf-fullscreen-search-close' ); mkdfFullscreenSearch(); } else if ( mkdf.body.hasClass( 'mkdf-slide-from-header-bottom' ) ) { mkdfSearchSlideFromHeaderBottom(); } else if ( mkdf.body.hasClass( 'mkdf-search-covers-header' ) ) { mkdfSearchCoversHeader(); } else if ( mkdf.body.hasClass( 'mkdf-search-slides-from-window-top' ) ) { searchForm = $('.mkdf-search-slide-window-top'); searchClose = $('.mkdf-swt-search-close'); mkdfSearchWindowTop(); } } /** * Fullscreen search fade */ function mkdfFullscreenSearch() { var searchHolder = $('.mkdf-fullscreen-search-holder'); searchOpener.on('click',function (e) { e.preventDefault(); if (searchHolder.hasClass('mkdf-animate')) { mkdf.body.removeClass('mkdf-fullscreen-search-opened mkdf-search-fade-out'); mkdf.body.removeClass('mkdf-search-fade-in'); searchHolder.removeClass('mkdf-animate'); setTimeout(function () { searchHolder.find('.mkdf-search-field').val(''); searchHolder.find('.mkdf-search-field').blur(); }, 300); mkdf.modules.common.mkdfEnableScroll(); } else { mkdf.body.addClass('mkdf-fullscreen-search-opened mkdf-search-fade-in'); mkdf.body.removeClass('mkdf-search-fade-out'); searchHolder.addClass('mkdf-animate'); setTimeout(function () { searchHolder.find('.mkdf-search-field').focus(); }, 900); mkdf.modules.common.mkdfDisableScroll(); } searchClose.on('click',function (e) { e.preventDefault(); mkdf.body.removeClass('mkdf-fullscreen-search-opened mkdf-search-fade-in'); mkdf.body.addClass('mkdf-search-fade-out'); searchHolder.removeClass('mkdf-animate'); setTimeout(function () { searchHolder.find('.mkdf-search-field').val(''); searchHolder.find('.mkdf-search-field').blur(); }, 300); mkdf.modules.common.mkdfEnableScroll(); }); //Close on click away $(document).mouseup(function (e) { var container = $(".mkdf-form-holder-inner"); if (!container.is(e.target) && container.has(e.target).length === 0) { e.preventDefault(); mkdf.body.removeClass('mkdf-fullscreen-search-opened mkdf-search-fade-in'); mkdf.body.addClass('mkdf-search-fade-out'); searchHolder.removeClass('mkdf-animate'); setTimeout(function () { searchHolder.find('.mkdf-search-field').val(''); searchHolder.find('.mkdf-search-field').blur(); }, 300); mkdf.modules.common.mkdfEnableScroll(); } }); //Close on escape $(document).keyup(function (e) { if (e.keyCode == 27) { //KeyCode for ESC button is 27 mkdf.body.removeClass('mkdf-fullscreen-search-opened mkdf-search-fade-in'); mkdf.body.addClass('mkdf-search-fade-out'); searchHolder.removeClass('mkdf-animate'); setTimeout(function () { searchHolder.find('.mkdf-search-field').val(''); searchHolder.find('.mkdf-search-field').blur(); }, 300); mkdf.modules.common.mkdfEnableScroll(); } }); }); //Text input focus change var inputSearchField = $('.mkdf-fullscreen-search-holder .mkdf-search-field'), inputSearchLine = $('.mkdf-fullscreen-search-holder .mkdf-field-holder .mkdf-line'); inputSearchField.focus(function () { inputSearchLine.css('width', '100%'); }); inputSearchField.blur(function () { inputSearchLine.css('width', '0'); }); } /** * Search covers header type of search */ function mkdfSearchCoversHeader() { searchOpener.on('click',function (e) { e.preventDefault(); var thisSearchOpener = $(this), searchFormHeight, searchFormHeaderHolder = $('.mkdf-page-header'), searchFormTopHeaderHolder = $('.mkdf-top-bar'), searchFormFixedHeaderHolder = searchFormHeaderHolder.find('.mkdf-fixed-wrapper.fixed'), searchFormMobileHeaderHolder = $('.mkdf-mobile-header'), searchForm = $('.mkdf-search-cover'), searchFormIsInTopHeader = !!thisSearchOpener.parents('.mkdf-top-bar').length, searchFormIsInFixedHeader = !!thisSearchOpener.parents('.mkdf-fixed-wrapper.fixed').length, searchFormIsInStickyHeader = !!thisSearchOpener.parents('.mkdf-sticky-header').length, searchFormIsInMobileHeader = !!thisSearchOpener.parents('.mkdf-mobile-header').length; searchForm.removeClass('mkdf-is-active'); //Find search form position in header and height if (searchFormIsInTopHeader) { searchFormHeight = mkdfGlobalVars.vars.mkdfTopBarHeight; searchFormTopHeaderHolder.find('.mkdf-search-cover').addClass('mkdf-is-active'); } else if (searchFormIsInFixedHeader) { searchFormHeight = searchFormFixedHeaderHolder.outerHeight(); searchFormHeaderHolder.children('.mkdf-search-cover').addClass('mkdf-is-active'); } else if (searchFormIsInStickyHeader) { searchFormHeight = mkdfGlobalVars.vars.mkdfStickyHeaderHeight; searchFormHeaderHolder.children('.mkdf-search-cover').addClass('mkdf-is-active'); } else if (searchFormIsInMobileHeader) { if(searchFormMobileHeaderHolder.hasClass('mobile-header-appear')) { searchFormHeight = searchFormMobileHeaderHolder.children('.mkdf-mobile-header-inner').outerHeight(); } else { searchFormHeight = searchFormMobileHeaderHolder.outerHeight(); } searchFormMobileHeaderHolder.find('.mkdf-search-cover').addClass('mkdf-is-active'); } else { searchFormHeight = searchFormHeaderHolder.outerHeight(); searchFormHeaderHolder.children('.mkdf-search-cover').addClass('mkdf-is-active'); } if(searchForm.hasClass('mkdf-is-active')) { searchForm.height(searchFormHeight).stop(true).fadeIn(600).find('input[type="text"]').focus(); } searchForm.find('.mkdf-search-close').on('click',function (e) { e.preventDefault(); searchForm.stop(true).fadeOut(450); }); searchForm.blur(function () { searchForm.stop(true).fadeOut(450); }); $(window).scroll(function(){ searchForm.stop(true).fadeOut(450); }); }); } /** * Search slides from window top type of search */ function mkdfSearchWindowTop() { searchOpener.on('click', function(e) { e.preventDefault(); if ( searchForm.height() === 0) { $('.mkdf-search-slide-window-top input[type="text"]').focus(); //Push header bottom mkdf.body.addClass('mkdf-search-open'); } else { mkdf.body.removeClass('mkdf-search-open'); } $(window).scroll(function() { if ( searchForm.height() !== 0 && mkdf.scroll > 50 ) { mkdf.body.removeClass('mkdf-search-open'); } }); searchClose.on('click',function(e){ e.preventDefault(); mkdf.body.removeClass('mkdf-search-open'); }); }); } /** * Search slide from header bottom type of search */ function mkdfSearchSlideFromHeaderBottom() { searchOpener.on('click', function(e) { e.preventDefault(); var thisSearchOpener = $(this), searchIconPosition = parseInt(mkdf.windowWidth - thisSearchOpener.offset().left - thisSearchOpener.outerWidth()); if(mkdf.body.hasClass('mkdf-boxed') && mkdf.windowWidth > 1024) { searchIconPosition -= parseInt((mkdf.windowWidth - $('.mkdf-boxed .mkdf-wrapper .mkdf-wrapper-inner').outerWidth()) / 2); } var searchFormHeaderHolder = $('.mkdf-page-header'), searchFormTopOffset = '100%', searchFormTopHeaderHolder = $('.mkdf-top-bar'), searchFormFixedHeaderHolder = searchFormHeaderHolder.find('.mkdf-fixed-wrapper.fixed'), searchFormMobileHeaderHolder = $('.mkdf-mobile-header'), searchForm = $('.mkdf-slide-from-header-bottom-holder'), searchFormIsInTopHeader = !!thisSearchOpener.parents('.mkdf-top-bar').length, searchFormIsInFixedHeader = !!thisSearchOpener.parents('.mkdf-fixed-wrapper.fixed').length, searchFormIsInStickyHeader = !!thisSearchOpener.parents('.mkdf-sticky-header').length, searchFormIsInMobileHeader = !!thisSearchOpener.parents('.mkdf-mobile-header').length; searchForm.removeClass('mkdf-is-active'); //Find search form position in header and height if (searchFormIsInTopHeader) { searchFormTopHeaderHolder.find('.mkdf-slide-from-header-bottom-holder').addClass('mkdf-is-active'); } else if (searchFormIsInFixedHeader) { searchFormTopOffset = searchFormFixedHeaderHolder.outerHeight() + mkdfGlobalVars.vars.mkdfAddForAdminBar;; searchFormHeaderHolder.children('.mkdf-slide-from-header-bottom-holder').addClass('mkdf-is-active'); } else if (searchFormIsInStickyHeader) { searchFormTopOffset = mkdfGlobalVars.vars.mkdfStickyHeaderHeight + mkdfGlobalVars.vars.mkdfAddForAdminBar;; searchFormHeaderHolder.children('.mkdf-slide-from-header-bottom-holder').addClass('mkdf-is-active'); } else if (searchFormIsInMobileHeader) { if(searchFormMobileHeaderHolder.hasClass('mobile-header-appear')) { searchFormTopOffset = searchFormMobileHeaderHolder.children('.mkdf-mobile-header-inner').outerHeight() + mkdfGlobalVars.vars.mkdfAddForAdminBar; } searchFormMobileHeaderHolder.find('.mkdf-slide-from-header-bottom-holder').addClass('mkdf-is-active'); } else { searchFormHeaderHolder.children('.mkdf-slide-from-header-bottom-holder').addClass('mkdf-is-active'); } if(searchForm.hasClass('mkdf-is-active')) { searchForm.css({'right': searchIconPosition, 'top': searchFormTopOffset}).stop(true).slideToggle(300, 'easeOutBack'); } //Close on escape $(document).keyup(function(e){ if (e.keyCode == 27 ) { //KeyCode for ESC button is 27 searchForm.stop(true).fadeOut(0); } }); $(window).scroll(function(){ searchForm.stop(true).fadeOut(0); }); }); } } /** * Show/hide side area */ function mkdfSideArea() { var wrapper = $('.mkdf-wrapper'), sideMenuButtonOpen = $('a.mkdf-side-menu-button-opener'), cssClass = 'mkdf-right-side-menu-opened'; wrapper.prepend('<div class="mkdf-cover"/>'); $('a.mkdf-side-menu-button-opener, a.mkdf-close-side-menu').on('click', function(e) { e.preventDefault(); if(!sideMenuButtonOpen.hasClass('opened')) { sideMenuButtonOpen.addClass('opened'); mkdf.body.addClass(cssClass); $('.mkdf-wrapper .mkdf-cover').on('click',function() { mkdf.body.removeClass('mkdf-right-side-menu-opened'); sideMenuButtonOpen.removeClass('opened'); }); var currentScroll = $(window).scrollTop(); $(window).scroll(function() { if(Math.abs(mkdf.scroll - currentScroll) > 400){ mkdf.body.removeClass(cssClass); sideMenuButtonOpen.removeClass('opened'); } }); } else { sideMenuButtonOpen.removeClass('opened'); mkdf.body.removeClass(cssClass); } }); } /* ** Smooth scroll functionality for Side Area */ function mkdfSideAreaScroll(){ var sideMenu = $('.mkdf-side-menu'); if(sideMenu.length){ sideMenu.perfectScrollbar({ wheelSpeed: 0.6, suppressScrollX: true }); } } function mkdfMenuUnderline() { //first level menu var firstLevelMenus = $('.mkdf-main-menu > ul'); if (firstLevelMenus.length) { firstLevelMenus.each(function () { var mainMenu = $(this); mainMenu.append('<li class="mkdf-main-menu-line bottom"></li>'); var menuLine = mainMenu.find('.mkdf-main-menu-line'), menuItems = mainMenu.find('> li.menu-item'), initialOffset, scrolling = false, minusWidth; if (menuItems.filter('.mkdf-active-item').length) { var minusWidth = menuItems.filter('.mkdf-active-item').outerWidth() - menuItems.filter('.mkdf-active-item').find('.item_text').width(); } else { var minusWidth = menuItems.first().outerWidth() - menuItems.first().find('.item_text').width(); } if (menuItems.filter('.mkdf-active-item').length) { initialOffset = menuItems.filter('.mkdf-active-item').offset().left + minusWidth / 2; menuLine.css('width', menuItems.filter('.mkdf-active-item').outerWidth() - minusWidth); } else { initialOffset = menuItems.first().offset().left + minusWidth / 2; menuLine.css('width', menuItems.first().outerWidth() - minusWidth); } //initial positioning menuLine.css('left', initialOffset - mainMenu.offset().left); //fx on menuItems.mouseenter(function () { if (!scrolling) { var menuItem = $(this), menuItemWidth = menuItem.outerWidth() - minusWidth, mainMenuOffset = mainMenu.offset().left - minusWidth / 2, menuItemOffset = menuItem.offset().left - mainMenuOffset; menuLine.css('width', menuItemWidth); menuLine.css('left', menuItemOffset); } }); //fx off mainMenu.mouseleave(function () { if (menuItems.filter('.mkdf-active-item').length) { menuLine.css('width', menuItems.filter('.mkdf-active-item').outerWidth() - minusWidth); initialOffset = menuItems.filter('.mkdf-active-item').offset().left + minusWidth / 2; } else { menuLine.css('width', menuItems.first().outerWidth() - minusWidth); } menuLine.css('left', initialOffset - mainMenu.offset().left); }); }); } } })(jQuery); (function($) { "use strict"; var mobileHeader = {}; mkdf.modules.mobileHeader = mobileHeader; mobileHeader.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitMobileNavigation(); mkdfMobileHeaderBehavior(); } function mkdfInitMobileNavigation() { var mobileHeader = $('.mkdf-mobile-header'); var navigationOpener = $('.mkdf-mobile-header .mkdf-mobile-menu-opener'); var navigationHolder = $('.mkdf-mobile-header .mkdf-mobile-nav'); var dropdownOpener = $('.mkdf-mobile-nav .mobile_arrow, .mkdf-mobile-nav h6, .mkdf-mobile-nav a.mkdf-mobile-no-link'); var animationSpeed = 200; //whole mobile menu opening / closing if(navigationOpener.length && navigationHolder.length) { navigationOpener.on('tap click', function(e) { e.stopPropagation(); e.preventDefault(); if(navigationHolder.is(':visible')) { navigationHolder.slideUp(animationSpeed); navigationOpener.removeClass("mkdf-mobile-menu-opened"); } else { navigationHolder.slideDown(animationSpeed); navigationOpener.addClass("mkdf-mobile-menu-opened"); } }); } //init scrollable menu var mobileHeaderHeight = mobileHeader.length ? mobileHeader.height() : 0; var scrollHeight = navigationHolder.outerHeight() - mobileHeaderHeight > mkdf.windowHeight ? mkdf.windowHeight - mobileHeaderHeight - 100 : navigationHolder.height(); navigationHolder.height(scrollHeight); navigationHolder.perfectScrollbar({ wheelSpeed: 0.6, suppressScrollX: true }); //dropdown opening / closing if (dropdownOpener.length) { dropdownOpener.each(function () { var thisItem = $(this), initialNavHeight = navigationHolder.outerHeight(); thisItem.on('tap click', function (e) { var thisItemParent = thisItem.parent('li'), thisItemParentSiblingsWithDrop = thisItemParent.siblings('.menu-item-has-children'); if (thisItemParent.hasClass('has_sub')) { var submenu = thisItemParent.find('> ul.sub_menu'); if (submenu.is(':visible')) { submenu.slideUp(450, 'easeInOutQuint'); thisItemParent.removeClass('mkdf-opened'); navigationHolder.stop().animate({'height': initialNavHeight}, 300); } else { thisItemParent.addClass('mkdf-opened'); if (thisItemParentSiblingsWithDrop.length === 0) { thisItemParent.find('.sub_menu').slideUp(400, 'easeInOutQuint', function () { submenu.slideDown(400, 'easeInOutQuint'); navigationHolder.stop().animate({'height': initialNavHeight + 50}, 300); }); } else { thisItemParent.siblings().removeClass('mkdf-opened').find('.sub_menu').slideUp(400, 'easeInOutQuint', function () { submenu.slideDown(400, 'easeInOutQuint'); navigationHolder.stop().animate({'height': initialNavHeight + 50}, 300); }); } } } }); }); } $('.mkdf-mobile-nav a, .mkdf-mobile-logo-wrapper a').on('click tap', function(e) { if($(this).attr('href') !== 'http://#' && $(this).attr('href') !== '#') { navigationHolder.slideUp(animationSpeed); navigationOpener.removeClass("mkdf-mobile-menu-opened"); } }); } function mkdfMobileHeaderBehavior() { if(mkdf.body.hasClass('mkdf-sticky-up-mobile-header')) { var stickyAppearAmount, mobileHeader = $('.mkdf-mobile-header'), mobileMenuOpener = mobileHeader.find('.mkdf-mobile-menu-opener'), mobileHeaderHeight = mobileHeader.length ? mobileHeader.height() : 0, adminBar = $('#wpadminbar'); var docYScroll1 = $(document).scrollTop(); stickyAppearAmount = mobileHeaderHeight + mkdfGlobalVars.vars.mkdfAddForAdminBar; $(window).scroll(function() { var docYScroll2 = $(document).scrollTop(); if(docYScroll2 > stickyAppearAmount) { mobileHeader.addClass('mkdf-animate-mobile-header'); } else { mobileHeader.removeClass('mkdf-animate-mobile-header'); } if((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount && !mobileMenuOpener.hasClass('mkdf-mobile-menu-opened')) || (docYScroll2 < stickyAppearAmount)) { mobileHeader.removeClass('mobile-header-appear'); mobileHeader.css('margin-bottom', 0); if(adminBar.length) { mobileHeader.find('.mkdf-mobile-header-inner').css('top', 0); } } else { mobileHeader.addClass('mobile-header-appear'); mobileHeader.css('margin-bottom', stickyAppearAmount); } docYScroll1 = $(document).scrollTop(); }); } } })(jQuery); (function($) { "use strict"; var stickyHeader = {}; mkdf.modules.stickyHeader = stickyHeader; stickyHeader.isStickyVisible = false; stickyHeader.stickyAppearAmount = 0; stickyHeader.behaviour = ''; stickyHeader.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { if(mkdf.windowWidth > 1024) { mkdfHeaderBehaviour(); } } /* ** Show/Hide sticky header on window scroll */ function mkdfHeaderBehaviour() { var header = $('.mkdf-page-header'), stickyHeader = $('.mkdf-sticky-header'), fixedHeaderWrapper = $('.mkdf-fixed-wrapper'), fixedMenuArea = fixedHeaderWrapper.children('.mkdf-menu-area'), fixedMenuAreaHeight = fixedMenuArea.outerHeight(), sliderHolder = $('.mkdf-slider'), revSliderHeight = sliderHolder.length ? sliderHolder.outerHeight() : 0, stickyAppearAmount, headerAppear; var headerMenuAreaOffset = fixedHeaderWrapper.length ? fixedHeaderWrapper.offset().top - mkdfGlobalVars.vars.mkdfAddForAdminBar : 0; switch(true) { // sticky header that will be shown when user scrolls up case mkdf.body.hasClass('mkdf-sticky-header-on-scroll-up'): mkdf.modules.stickyHeader.behaviour = 'mkdf-sticky-header-on-scroll-up'; var docYScroll1 = $(document).scrollTop(); stickyAppearAmount = parseInt(mkdfGlobalVars.vars.mkdfTopBarHeight) + parseInt(mkdfGlobalVars.vars.mkdfLogoAreaHeight) + parseInt(mkdfGlobalVars.vars.mkdfMenuAreaHeight) + parseInt(mkdfGlobalVars.vars.mkdfStickyHeaderHeight); headerAppear = function(){ var docYScroll2 = $(document).scrollTop(); if((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount) || (docYScroll2 < stickyAppearAmount)) { mkdf.modules.stickyHeader.isStickyVisible = false; stickyHeader.removeClass('header-appear').find('.mkdf-main-menu .second').removeClass('mkdf-drop-down-start'); mkdf.body.removeClass('mkdf-sticky-header-appear'); } else { mkdf.modules.stickyHeader.isStickyVisible = true; stickyHeader.addClass('header-appear'); mkdf.body.addClass('mkdf-sticky-header-appear'); } docYScroll1 = $(document).scrollTop(); }; headerAppear(); $(window).scroll(function() { headerAppear(); }); break; // sticky header that will be shown when user scrolls both up and down case mkdf.body.hasClass('mkdf-sticky-header-on-scroll-down-up'): mkdf.modules.stickyHeader.behaviour = 'mkdf-sticky-header-on-scroll-down-up'; if(mkdfPerPageVars.vars.mkdfStickyScrollAmount !== 0){ mkdf.modules.stickyHeader.stickyAppearAmount = parseInt(mkdfPerPageVars.vars.mkdfStickyScrollAmount); } else { mkdf.modules.stickyHeader.stickyAppearAmount = parseInt(mkdfGlobalVars.vars.mkdfTopBarHeight) + parseInt(mkdfGlobalVars.vars.mkdfLogoAreaHeight) + parseInt(mkdfGlobalVars.vars.mkdfMenuAreaHeight) + parseInt(revSliderHeight); } headerAppear = function(){ if(mkdf.scroll < mkdf.modules.stickyHeader.stickyAppearAmount) { mkdf.modules.stickyHeader.isStickyVisible = false; stickyHeader.removeClass('header-appear').find('.mkdf-main-menu .second').removeClass('mkdf-drop-down-start'); mkdf.body.removeClass('mkdf-sticky-header-appear'); }else{ mkdf.modules.stickyHeader.isStickyVisible = true; stickyHeader.addClass('header-appear'); mkdf.body.addClass('mkdf-sticky-header-appear'); } }; headerAppear(); $(window).scroll(function() { headerAppear(); }); break; // on scroll down, part of header will be sticky case mkdf.body.hasClass('mkdf-fixed-on-scroll'): mkdf.modules.stickyHeader.behaviour = 'mkdf-fixed-on-scroll'; var headerFixed = function(){ if(mkdf.scroll <= headerMenuAreaOffset) { fixedHeaderWrapper.removeClass('fixed'); mkdf.body.removeClass('mkdf-fixed-header-appear'); fixedMenuArea.css({'height': fixedMenuAreaHeight + 'px'}); header.css('margin-bottom', '0'); } else { fixedHeaderWrapper.addClass('fixed'); mkdf.body.addClass('mkdf-fixed-header-appear'); fixedMenuArea.css({'height': fixedMenuAreaHeight + 'px'}); header.css('margin-bottom', fixedMenuAreaHeight + 'px'); } }; headerFixed(); $(window).scroll(function() { headerFixed(); }); break; } } })(jQuery); (function($) { "use strict"; var title = {}; mkdf.modules.title = title; title.mkdfOnDocumentReady = mkdfOnDocumentReady; title.mkdfOnWindowResize = mkdfOnWindowResize; $(document).ready(mkdfOnDocumentReady); $(window).resize(mkdfOnWindowResize); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { initTitleFullHeight(); mkdfParallaxTitle(); } /* All functions to be called on $(window).resize() should be in this function */ function mkdfOnWindowResize() { initTitleFullHeight(); } /* ** Title image with parallax effect */ function mkdfParallaxTitle(){ var parallaxBackground = $('.mkdf-title.mkdf-has-parallax-background'); if(parallaxBackground.length > 0 && $('.touch').length === 0){ var parallaxBackgroundWithZoomOut = $('.mkdf-title.mkdf-has-parallax-background.mkdf-zoom-out'); var backgroundSizeWidth = parseInt(parallaxBackground.data('background-width').match(/\d+/)); var titleHolderHeight = parallaxBackground.data('height'); var titleRate = (titleHolderHeight / 10000) * 7; var titleYPos = -(mkdf.scroll * titleRate); //set position of background on doc ready parallaxBackground.css({'background-position': 'center '+ (titleYPos+mkdfGlobalVars.vars.mkdfAddForAdminBar) +'px' }); parallaxBackgroundWithZoomOut.css({'background-size': backgroundSizeWidth-mkdf.scroll + 'px auto'}); //set position of background on window scroll $(window).scroll(function() { titleYPos = -(mkdf.scroll * titleRate); parallaxBackground.css({'background-position': 'center ' + (titleYPos+mkdfGlobalVars.vars.mkdfAddForAdminBar) + 'px' }); parallaxBackgroundWithZoomOut.css({'background-size': backgroundSizeWidth-mkdf.scroll + 'px auto'}); }); } } function initTitleFullHeight() { var title = $('.mkdf-title'); if(title.length > 0 && title.hasClass('mkdf-title-full-height')) { var titleHolder = title.find('.mkdf-title-holder'); var titleMargin = parseInt($('.mkdf-content').css('margin-top')); var titleHolderPadding = parseInt(titleHolder.css('padding-top')); if(mkdf.windowWidth > 1024) { if(titleMargin < 0) { title.css("height", mkdf.windowHeight); title.attr("data-height", mkdf.windowHeight); titleHolder.css("height", mkdf.windowHeight); if(titleHolderPadding > 0) { titleHolder.css("height", mkdf.windowHeight - mkdfGlobalVars.vars.mkdfMenuAreaHeight); } } else { title.css("height", mkdf.windowHeight - mkdfGlobalVars.vars.mkdfMenuAreaHeight); title.attr("data-height", mkdf.windowHeight - mkdfGlobalVars.vars.mkdfMenuAreaHeight); titleHolder.css("height", mkdf.windowHeight - mkdfGlobalVars.vars.mkdfMenuAreaHeight); } } else { title.css("height", mkdf.windowHeight - mkdfGlobalVars.vars.mkdfMobileHeaderHeight); title.attr("data-height", mkdf.windowHeight - mkdfGlobalVars.vars.mkdfMobileHeaderHeight); titleHolder.css("height", mkdf.windowHeight - mkdfGlobalVars.vars.mkdfMobileHeaderHeight); } } } })(jQuery); (function($) { 'use strict'; var accordions = {}; mkdf.modules.accordions = accordions; accordions.mkdfInitAccordions = mkdfInitAccordions; accordions.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitAccordions(); } /** * Init accordions shortcode */ function mkdfInitAccordions(){ var accordion = $('.mkdf-accordion-holder'); if(accordion.length){ accordion.each(function(){ var thisAccordion = $(this); if(thisAccordion.hasClass('mkdf-accordion')){ thisAccordion.accordion({ animate: "swing", collapsible: true, heightStyle: "content", active: 0, icons: "" }); } if(thisAccordion.hasClass('mkdf-toggle')){ var toggleAccordion = $(this), toggleAccordionTitle = toggleAccordion.find('.mkdf-title-holder'), toggleAccordionContent = toggleAccordionTitle.next(); toggleAccordion.addClass("accordion ui-accordion ui-accordion-icons ui-widget ui-helper-reset"); toggleAccordionTitle.addClass("ui-accordion-header ui-state-default ui-corner-top ui-corner-bottom"); toggleAccordionContent.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(); toggleAccordionTitle.each(function(){ var thisTitle = $(this); thisTitle.on('mouseenter mouseleave',function(){ thisTitle.toggleClass("ui-state-hover"); }); thisTitle.on('click',function(){ thisTitle.toggleClass('ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom'); thisTitle.next().toggleClass('ui-accordion-content-active').slideToggle(400); }); }); } }); } } })(jQuery); (function($) { 'use strict'; var animationHolder = {}; mkdf.modules.animationHolder = animationHolder; animationHolder.mkdfInitAnimationHolder = mkdfInitAnimationHolder; animationHolder.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitAnimationHolder(); } /* * Init animation holder shortcode */ function mkdfInitAnimationHolder(){ var elements = $('.mkdf-grow-in, .mkdf-fade-in-down, .mkdf-element-from-fade, .mkdf-element-from-left, .mkdf-element-from-right, .mkdf-element-from-top, .mkdf-element-from-bottom, .mkdf-flip-in, .mkdf-x-rotate, .mkdf-z-rotate, .mkdf-y-translate, .mkdf-fade-in, .mkdf-fade-in-left-x-rotate'), animationClass, animationData, animationDelay; if(elements.length){ elements.each(function(){ var thisElement = $(this); thisElement.appear(function() { animationData = thisElement.data('animation'); animationDelay = parseInt(thisElement.data('animation-delay')); if(typeof animationData !== 'undefined' && animationData !== '') { animationClass = animationData; var newClass = animationClass+'-on'; setTimeout(function(){ thisElement.addClass(newClass); },animationDelay); } },{accX: 0, accY: mkdfGlobalVars.vars.mkdfElementAppearAmount}); }); } } })(jQuery); (function($) { 'use strict'; var button = {}; mkdf.modules.button = button; button.mkdfButton = mkdfButton; button.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfButton().init(); } /** * Button object that initializes whole button functionality * @type {Function} */ var mkdfButton = function() { //all buttons on the page var buttons = $('.mkdf-btn'); /** * Initializes button hover color * @param button current button */ var buttonHoverColor = function(button) { if(typeof button.data('hover-color') !== 'undefined') { var changeButtonColor = function(event) { event.data.button.css('color', event.data.color); }; var originalColor = button.css('color'); var hoverColor = button.data('hover-color'); button.on('mouseenter', { button: button, color: hoverColor }, changeButtonColor); button.on('mouseleave', { button: button, color: originalColor }, changeButtonColor); } }; /** * Initializes button hover background color * @param button current button */ var buttonHoverBgColor = function(button) { if(typeof button.data('hover-bg-color') !== 'undefined') { var changeButtonBg = function(event) { event.data.button.css('background-color', event.data.color); }; var changeIconBgColor = function(event) { event.data.icon.css('background-color', event.data.color); }; var originalBgColor = button.css('background-color'); var hoverBgColor = button.data('hover-bg-color'); button.on('mouseenter', { button: button, color: hoverBgColor }, changeButtonBg); button.on('mouseleave', { button: button, color: originalBgColor }, changeButtonBg); if(button.hasClass('mkdf-btn-solid') && button.hasClass('mkdf-btn-icon')) { var icon = button.find('.mkdf-btn-icon-holder'); var originalIconBgColor = icon.css('background-color'); button.on('mouseenter', { icon: icon, color: hoverBgColor }, changeIconBgColor); button.on('mouseleave', { icon: icon, color: originalIconBgColor }, changeIconBgColor); } } }; /** * Initializes button border color * @param button */ var buttonHoverBorderColor = function(button) { if(typeof button.data('hover-border-color') !== 'undefined') { var changeBorderColor = function(event) { event.data.button.css('border-color', event.data.color); }; var changeIconBorderColor = function(event) { event.data.icon.css('border-left-color', event.data.color); }; var originalBorderColor = button.css('borderTopColor'); //take one of the four sides var hoverBorderColor = button.data('hover-border-color'); button.on('mouseenter', { button: button, color: hoverBorderColor }, changeBorderColor); button.on('mouseleave', { button: button, color: originalBorderColor }, changeBorderColor); if(button.hasClass('mkdf-btn-outline') && button.hasClass('mkdf-btn-icon')) { var icon = button.find('.mkdf-btn-icon-holder'); button.on('mouseenter', { icon: icon, color: hoverBorderColor }, changeIconBorderColor); button.on('mouseleave', { icon: icon, color: originalBorderColor }, changeIconBorderColor); } } }; return { init: function() { if(buttons.length) { buttons.each(function() { buttonHoverColor($(this)); buttonHoverBgColor($(this)); buttonHoverBorderColor($(this)); }); } } }; }; })(jQuery); (function($) { 'use strict'; var countdown = {}; mkdf.modules.countdown = countdown; countdown.mkdfInitCountdown = mkdfInitCountdown; countdown.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitCountdown(); } /** * Countdown Shortcode */ function mkdfInitCountdown() { var countdowns = $('.mkdf-countdown'), date = new Date(), currentMonth = date.getMonth(), year, month, day, hour, minute, timezone, monthLabel, dayLabel, hourLabel, minuteLabel, secondLabel; if (countdowns.length) { countdowns.each(function(){ //Find countdown elements by id-s var countdownId = $(this).attr('id'), countdown = $('#'+countdownId), digitFontSize, labelFontSize; //Get data for countdown year = countdown.data('year'); month = countdown.data('month'); day = countdown.data('day'); hour = countdown.data('hour'); minute = countdown.data('minute'); timezone = countdown.data('timezone'); monthLabel = countdown.data('month-label'); dayLabel = countdown.data('day-label'); hourLabel = countdown.data('hour-label'); minuteLabel = countdown.data('minute-label'); secondLabel = countdown.data('second-label'); digitFontSize = countdown.data('digit-size'); labelFontSize = countdown.data('label-size'); if( currentMonth != month ) { month = month - 1; } //Initialize countdown countdown.countdown({ until: new Date(year, month, day, hour, minute, 44), labels: ['Years', monthLabel, 'Weeks', dayLabel, hourLabel, minuteLabel, secondLabel], format: 'ODHMS', timezone: timezone, padZeroes: true, onTick: setCountdownStyle }); function setCountdownStyle() { countdown.find('.countdown-amount').css({ 'font-size' : digitFontSize+'px', 'line-height' : digitFontSize+'px' }); countdown.find('.countdown-period').css({ 'font-size' : labelFontSize+'px' }); } }); } } })(jQuery); (function($) { 'use strict'; var counter = {}; mkdf.modules.counter = counter; counter.mkdfInitCounter = mkdfInitCounter; counter.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitCounter(); } /** * Counter Shortcode */ function mkdfInitCounter() { var counterHolder = $('.mkdf-counter-holder'); if (counterHolder.length) { counterHolder.each(function() { var thisCounterHolder = $(this), thisCounter = thisCounterHolder.find('.mkdf-counter'); thisCounterHolder.appear(function() { thisCounterHolder.css('opacity', '1'); //Counter zero type if (thisCounter.hasClass('mkdf-zero-counter')) { var max = parseFloat(thisCounter.text()); thisCounter.countTo({ from: 0, to: max, speed: 1500, refreshInterval: 100 }); } else { thisCounter.absoluteCounter({ speed: 2000, fadeInDelay: 1000 }); } },{accX: 0, accY: mkdfGlobalVars.vars.mkdfElementAppearAmount}); }); } } })(jQuery); (function($) { 'use strict'; var customFont = {}; mkdf.modules.customFont = customFont; customFont.mkdfCustomFontResize = mkdfCustomFontResize; customFont.mkdfOnDocumentReady = mkdfOnDocumentReady; customFont.mkdfOnWindowResize = mkdfOnWindowResize; $(document).ready(mkdfOnDocumentReady); $(window).resize(mkdfOnWindowResize); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfCustomFontResize(); } /* All functions to be called on $(window).resize() should be in this function */ function mkdfOnWindowResize() { mkdfCustomFontResize(); } /* ** Custom Font resizing */ function mkdfCustomFontResize(){ var customFont = $('.mkdf-custom-font-holder'); if (customFont.length){ customFont.each(function(){ var thisCustomFont = $(this); var fontSize; var lineHeight; var coef1 = 1; var coef2 = 1; if (mkdf.windowWidth < 1480){ coef1 = 0.8; } if (mkdf.windowWidth < 1200){ coef1 = 0.7; } if (mkdf.windowWidth < 768){ coef1 = 0.55; coef2 = 0.65; } if (mkdf.windowWidth < 600){ coef1 = 0.45; coef2 = 0.55; } if (mkdf.windowWidth < 480){ coef1 = 0.4; coef2 = 0.5; } if (typeof thisCustomFont.data('font-size') !== 'undefined' && thisCustomFont.data('font-size') !== false) { fontSize = parseInt(thisCustomFont.data('font-size')); if (fontSize > 70) { fontSize = Math.round(fontSize*coef1); } else if (fontSize > 35) { fontSize = Math.round(fontSize*coef2); } thisCustomFont.css('font-size',fontSize + 'px'); } if (typeof thisCustomFont.data('line-height') !== 'undefined' && thisCustomFont.data('line-height') !== false) { lineHeight = parseInt(thisCustomFont.data('line-height')); if (lineHeight > 70 && mkdf.windowWidth < 1440) { lineHeight = '1.2em'; } else if (lineHeight > 35 && mkdf.windowWidth < 768) { lineHeight = '1.2em'; } else { lineHeight += 'px'; } thisCustomFont.css('line-height', lineHeight); } }); } } })(jQuery); /** * Init Elliptical slider shortcode */ (function($) { 'use strict'; var ellipticalSlider = {}; mkdf.modules.ellipticalSlider = ellipticalSlider; ellipticalSlider.mkdfInitEllipticalSlider = mkdfInitEllipticalSlider; ellipticalSlider.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitEllipticalSlider(); } /* ** Init Elliptical slider shortcode */ function mkdfInitEllipticalSlider(){ var ellipticalSliders = $('.mkdf-elliptical-slider'); if(ellipticalSliders.length){ ellipticalSliders.each(function(){ var thisEllipticalSlider = $(this); var interval = 5000; var controlNav = true; var directionNav = false; var animationSpeed = 600; var animationLoop = true; if(typeof thisEllipticalSlider.data('animation-speed') !== 'undefined' && thisEllipticalSlider.data('animation-speed') !== false) { animationSpeed = thisEllipticalSlider.data('animation-speed'); } thisEllipticalSlider.flexslider({ selector: ".mkdf-elliptical-slider-slides > .mkdf-elliptical-slide", animationLoop: animationLoop, controlNav: controlNav, directionNav: directionNav, useCSS: false, pauseOnAction: false, pauseOnHover: false, slideshow: true, animationSpeed: animationSpeed, slideshowSpeed: interval, touch: true }); }); } } })(jQuery); (function($) { 'use strict'; var googleMap = {}; mkdf.modules.googleMap = googleMap; googleMap.mkdfShowGoogleMap = mkdfShowGoogleMap; googleMap.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfShowGoogleMap(); } /* ** Show Google Map */ function mkdfShowGoogleMap(){ var googleMap = $('.mkdf-google-map'); if(googleMap.length){ googleMap.each(function(){ var element = $(this); var customMapStyle; if(typeof element.data('custom-map-style') !== 'undefined') { customMapStyle = element.data('custom-map-style'); } var colorOverlay; if(typeof element.data('color-overlay') !== 'undefined' && element.data('color-overlay') !== false) { colorOverlay = element.data('color-overlay'); } var saturation; if(typeof element.data('saturation') !== 'undefined' && element.data('saturation') !== false) { saturation = element.data('saturation'); } var lightness; if(typeof element.data('lightness') !== 'undefined' && element.data('lightness') !== false) { lightness = element.data('lightness'); } var zoom; if(typeof element.data('zoom') !== 'undefined' && element.data('zoom') !== false) { zoom = element.data('zoom'); } var pin; if(typeof element.data('pin') !== 'undefined' && element.data('pin') !== false) { pin = element.data('pin'); } var mapHeight; if(typeof element.data('height') !== 'undefined' && element.data('height') !== false) { mapHeight = element.data('height'); } var uniqueId; if(typeof element.data('unique-id') !== 'undefined' && element.data('unique-id') !== false) { uniqueId = element.data('unique-id'); } var scrollWheel; if(typeof element.data('scroll-wheel') !== 'undefined') { scrollWheel = element.data('scroll-wheel'); } var addresses; if(typeof element.data('addresses') !== 'undefined' && element.data('addresses') !== false) { addresses = element.data('addresses'); } var map = "map_"+ uniqueId; var geocoder = "geocoder_"+ uniqueId; var holderId = "mkdf-map-"+ uniqueId; mkdfInitializeGoogleMap(customMapStyle, colorOverlay, saturation, lightness, scrollWheel, zoom, holderId, mapHeight, pin, map, geocoder, addresses); }); } } /* ** Init Google Map */ function mkdfInitializeGoogleMap(customMapStyle, color, saturation, lightness, wheel, zoom, holderId, height, pin, map, geocoder, data){ if(typeof google !== 'object') { return; } var mapStyles = [ { stylers: [ {hue: color }, {saturation: saturation}, {lightness: lightness}, {gamma: 1} ] } ]; var googleMapStyleId; if(customMapStyle === 'yes'){ googleMapStyleId = 'mkdf-style'; } else { googleMapStyleId = google.maps.MapTypeId.ROADMAP; } if(wheel === 'yes'){ wheel = true; } else { wheel = false; } var qoogleMapType = new google.maps.StyledMapType(mapStyles, {name: "Mikado Google Map"}); geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(-34.397, 150.644); if (!isNaN(height)){ height = height + 'px'; } var myOptions = { zoom: zoom, scrollwheel: wheel, center: latlng, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.RIGHT_CENTER }, scaleControl: false, scaleControlOptions: { position: google.maps.ControlPosition.LEFT_CENTER }, streetViewControl: false, streetViewControlOptions: { position: google.maps.ControlPosition.LEFT_CENTER }, panControl: false, panControlOptions: { position: google.maps.ControlPosition.LEFT_CENTER }, mapTypeControl: false, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'mkdf-style'], style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.LEFT_CENTER }, mapTypeId: googleMapStyleId }; map = new google.maps.Map(document.getElementById(holderId), myOptions); map.mapTypes.set('mkdf-style', qoogleMapType); var index; for (index = 0; index < data.length; ++index) { mkdfInitializeGoogleAddress(data[index], pin, map, geocoder); } var holderElement = document.getElementById(holderId); holderElement.style.height = height; } /* ** Init Google Map Addresses */ function mkdfInitializeGoogleAddress(data, pin, map, geocoder){ if (data === '') { return; } var contentString = '<div id="content">'+ '<div id="siteNotice">'+ '</div>'+ '<div id="bodyContent">'+ '<p>'+data+'</p>'+ '</div>'+ '</div>'; var infowindow = new google.maps.InfoWindow({ content: contentString }); geocoder.geocode( { 'address': data}, function(results, status) { if (status === google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, icon: pin, title: data.store_title }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); google.maps.event.addDomListener(window, 'resize', function() { map.setCenter(results[0].geometry.location); }); } }); } })(jQuery); (function($) { 'use strict'; var horizontalTimeline = {}; mkdf.modules.horizontalTimeline = horizontalTimeline; horizontalTimeline.mkdfInitHorizontalTimeline = mkdfInitHorizontalTimeline; horizontalTimeline.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitHorizontalTimeline(); } /** * Counter Shortcode */ function mkdfInitHorizontalTimeline() { var timelines = $('.mkdf-horizontal-timeline'); var eventsMinDistance = 120; if(mkdf.windowWidth > 1024) eventsMinDistance = 120; else if (mkdf.windowWidth > 600) eventsMinDistance = 60; else if (mkdf.windowWidth < 600) eventsMinDistance = 120; else eventsMinDistance = 105; (timelines.length > 0) && initTimeline(timelines); function initTimeline(timelines) { timelines.each(function(){ var timeline = $(this), timelineComponents = {}; //cache timeline components timelineComponents['timelineWrapper'] = timeline.find('.mkdf-events-wrapper'); timelineComponents['eventsWrapper'] = timelineComponents['timelineWrapper'].children('.mkdf-events'); timelineComponents['fillingLine'] = timelineComponents['eventsWrapper'].children('.mkdf-filling-line'); timelineComponents['timelineEvents'] = timelineComponents['eventsWrapper'].find('a'); timelineComponents['timelineDates'] = parseDate(timelineComponents['timelineEvents']); timelineComponents['eventsMinLapse'] = minLapse(timelineComponents['timelineDates']); timelineComponents['timelineNavigation'] = timeline.find('.mkdf-timeline-navigation'); timelineComponents['eventsContent'] = timeline.children('.mkdf-events-content'); timelineComponents['eventsWrapper'].find('ol li:first-child a').addClass('selected'); timelineComponents['eventsContent'].find('ol li:first-child').addClass('selected'); //assign a left postion to the single events along the timeline setDatePosition(timelineComponents, eventsMinDistance, timeline); //assign a width to the timeline var timelineTotWidth = setTimelineWidth(timelineComponents, eventsMinDistance, timeline); //the timeline has been initialize - show it timeline.addClass('loaded'); //detect click on the next arrow timelineComponents['timelineNavigation'].on('click', '.mkdf-next', function(event){ event.preventDefault(); updateSlide(timelineComponents, timelineTotWidth, 'next'); }); //detect click on the prev arrow timelineComponents['timelineNavigation'].on('click', '.mkdf-prev', function(event){ event.preventDefault(); updateSlide(timelineComponents, timelineTotWidth, 'prev'); }); //detect click on the a single event - show new event content timelineComponents['eventsWrapper'].on('click', 'a', function(event){ event.preventDefault(); timelineComponents['timelineEvents'].removeClass('selected'); $(this).addClass('selected'); updateOlderEvents($(this)); updateFilling($(this), timelineComponents['fillingLine'], timelineTotWidth); updateVisibleContent($(this), timelineComponents['eventsContent']); }); //on swipe, show next/prev event content timelineComponents['eventsContent'].on('swipeleft', function(){ var mq = checkMQ(); ( mq == 'mobile' ) && showNewContent(timelineComponents, timelineTotWidth, 'next'); }); timelineComponents['eventsContent'].on('swiperight', function(){ var mq = checkMQ(); ( mq == 'mobile' ) && showNewContent(timelineComponents, timelineTotWidth, 'prev'); }); //keyboard navigation $(document).keyup(function(event){ if(event.which=='37' && elementInViewport(timeline.get(0)) ) { showNewContent(timelineComponents, timelineTotWidth, 'prev'); } else if( event.which=='39' && elementInViewport(timeline.get(0))) { showNewContent(timelineComponents, timelineTotWidth, 'next'); } }); }); } function updateSlide(timelineComponents, timelineTotWidth, string) { //retrieve translateX value of timelineComponents['eventsWrapper'] var translateValue = getTranslateValue(timelineComponents['eventsWrapper']), wrapperWidth = Number(timelineComponents['timelineWrapper'].css('width').replace('px', '')); //translate the timeline to the left('next')/right('prev') (string == 'next') ? translateTimeline(timelineComponents, translateValue - wrapperWidth + eventsMinDistance, wrapperWidth - timelineTotWidth) : translateTimeline(timelineComponents, translateValue + wrapperWidth - eventsMinDistance); } function showNewContent(timelineComponents, timelineTotWidth, string) { //go from one event to the next/previous one var visibleContent = timelineComponents['eventsContent'].find('.selected'), newContent = ( string == 'next' ) ? visibleContent.next() : visibleContent.prev(); if ( newContent.length > 0 ) { //if there's a next/prev event - show it var selectedDate = timelineComponents['eventsWrapper'].find('.selected'), newEvent = ( string == 'next' ) ? selectedDate.parent('li').next('li').children('a') : selectedDate.parent('li').prev('li').children('a'); updateFilling(newEvent, timelineComponents['fillingLine'], timelineTotWidth); updateVisibleContent(newEvent, timelineComponents['eventsContent']); newEvent.addClass('selected'); selectedDate.removeClass('selected'); updateOlderEvents(newEvent); updateTimelinePosition(string, newEvent, timelineComponents); } } function updateTimelinePosition(string, event, timelineComponents) { //translate timeline to the left/right according to the position of the selected event var eventStyle = window.getComputedStyle(event.get(0), null), eventLeft = Number(eventStyle.getPropertyValue("left").replace('px', '')), timelineWidth = Number(timelineComponents['timelineWrapper'].css('width').replace('px', '')), timelineTotWidth = Number(timelineComponents['eventsWrapper'].css('width').replace('px', '')); var timelineTranslate = getTranslateValue(timelineComponents['eventsWrapper']); if( (string == 'next' && eventLeft > timelineWidth - timelineTranslate) || (string == 'prev' && eventLeft < - timelineTranslate) ) { translateTimeline(timelineComponents, - eventLeft + timelineWidth/2, timelineWidth - timelineTotWidth); } } function translateTimeline(timelineComponents, value, totWidth) { var eventsWrapper = timelineComponents['eventsWrapper'].get(0); value = (value > 0) ? 0 : value; //only negative translate value value = ( !(typeof totWidth === 'undefined') && value < totWidth ) ? totWidth : value; //do not translate more than timeline width setTransformValue(eventsWrapper, 'translateX', value+'px'); //update navigation arrows visibility (value == 0 ) ? timelineComponents['timelineNavigation'].find('.mkdf-prev').addClass('inactive') : timelineComponents['timelineNavigation'].find('.mkdf-prev').removeClass('inactive'); (value == totWidth ) ? timelineComponents['timelineNavigation'].find('.mkdf-next').addClass('inactive') : timelineComponents['timelineNavigation'].find('.mkdf-next').removeClass('inactive'); } function disableTranslateTimeline(timelineComponents) { timelineComponents['timelineNavigation'].find('.mkdf-prev').addClass('inactive'); timelineComponents['timelineNavigation'].find('.mkdf-next').addClass('inactive'); } function updateFilling(selectedEvent, filling, totWidth) { //change .filling-line length according to the selected event var eventStyle = window.getComputedStyle(selectedEvent.get(0), null), eventLeft = eventStyle.getPropertyValue("left"), eventWidth = eventStyle.getPropertyValue("width"); eventLeft = Number(eventLeft.replace('px', '')) + Number(eventWidth.replace('px', ''))/2; var scaleValue = eventLeft/totWidth; setTransformValue(filling.get(0), 'scaleX', scaleValue); } function setDatePosition(timelineComponents, min, timeline) { var shorten = false; for (var i = 0; i < timelineComponents['timelineDates'].length; i++) { var distance = daydiff(timelineComponents['timelineDates'][0], timelineComponents['timelineDates'][i]), distanceNorm = Math.round(distance/timelineComponents['eventsMinLapse']) + 1; /* 24 is width of circles placed in link :after element */ timelineComponents['timelineEvents'].eq(i).css('left', distanceNorm*min-24+'px'); /* 80 is width of 2*40 margins on mkdf-events-wrapper */ if(distanceNorm*min < timeline.outerWidth() - 80) { shorten = true; } else { shorten = false; } } if(shorten) { disableTranslateTimeline(timelineComponents); /* 80 is width of 2*40 margins on mkdf-events-wrapper, 24 is width of circles placed in link :after element */ var minDistance = (timeline.outerWidth() - 80 - (timelineComponents['timelineDates'].length - 1) * 24) / (timelineComponents['timelineDates'].length + 1); for (var i = 0; i < timelineComponents['timelineDates'].length; i++) { timelineComponents['timelineEvents'].eq(i).css('left', (i+1)*minDistance+'px'); } } } function setTimelineWidth(timelineComponents, width, timeline) { var timeSpan = daydiff(timelineComponents['timelineDates'][0], timelineComponents['timelineDates'][timelineComponents['timelineDates'].length-1]), timeSpanNorm = timeSpan/timelineComponents['eventsMinLapse'], timeSpanNorm = Math.round(timeSpanNorm) + 2, totalWidth = timeSpanNorm*width; /* 80 is width of 2*40 margins on mkdf-events-wrapper */ if(totalWidth < timeline.outerWidth() - 80) { totalWidth = timeline.outerWidth() - 80; } timelineComponents['eventsWrapper'].css('width', totalWidth+"px"); updateFilling(timelineComponents['eventsWrapper'].find('a.selected'), timelineComponents['fillingLine'], totalWidth); updateTimelinePosition('next', timelineComponents['eventsWrapper'].find('a.selected'), timelineComponents); return totalWidth; } function updateVisibleContent(event, eventsContent) { var eventDate = event.data('date'), visibleContent = eventsContent.find('.selected'), selectedContent = eventsContent.find('[data-date="'+ eventDate +'"]'), selectedContentHeight = selectedContent.height(); if (selectedContent.index() > visibleContent.index()) { var classEnetering = 'selected mkdf-enter-right', classLeaving = 'mkdf-leave-left'; } else { var classEnetering = 'selected mkdf-enter-left', classLeaving = 'mkdf-leave-right'; } selectedContent.attr('class', classEnetering); visibleContent.attr('class', classLeaving).one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(){ visibleContent.removeClass('mkdf-leave-right mkdf-leave-left'); selectedContent.removeClass('mkdf-enter-left mkdf-enter-right'); }); eventsContent.css('height', selectedContentHeight+'px'); } function updateOlderEvents(event) { event.parent('li').prevAll('li').children('a').addClass('older-event').end().end().nextAll('li').children('a').removeClass('older-event'); } function getTranslateValue(timeline) { var timelineStyle = window.getComputedStyle(timeline.get(0), null), timelineTranslate = timelineStyle.getPropertyValue("-webkit-transform") || timelineStyle.getPropertyValue("-moz-transform") || timelineStyle.getPropertyValue("-ms-transform") || timelineStyle.getPropertyValue("-o-transform") || timelineStyle.getPropertyValue("transform"); if( timelineTranslate.indexOf('(') >=0 ) { var timelineTranslate = timelineTranslate.split('(')[1]; timelineTranslate = timelineTranslate.split(')')[0]; timelineTranslate = timelineTranslate.split(','); var translateValue = timelineTranslate[4]; } else { var translateValue = 0; } return Number(translateValue); } function setTransformValue(element, property, value) { element.style["-webkit-transform"] = property+"("+value+")"; element.style["-moz-transform"] = property+"("+value+")"; element.style["-ms-transform"] = property+"("+value+")"; element.style["-o-transform"] = property+"("+value+")"; element.style["transform"] = property+"("+value+")"; } //based on http://stackoverflow.com/questions/542938/how-do-i-get-the-number-of-days-between-two-dates-in-javascript function parseDate(events) { var dateArrays = []; events.each(function(){ var singleDate = $(this), dateComp = singleDate.data('date').split('T'); if( dateComp.length > 1 ) { //both DD/MM/YEAR and time are provided var dayComp = dateComp[0].split('/'), timeComp = dateComp[1].split(':'); } else if( dateComp[0].indexOf(':') >=0 ) { //only time is provide var dayComp = ["2000", "0", "0"], timeComp = dateComp[0].split(':'); } else { //only DD/MM/YEAR var dayComp = dateComp[0].split('/'), timeComp = ["0", "0"]; } var newDate = new Date(dayComp[2], dayComp[1]-1, dayComp[0], timeComp[0], timeComp[1]); dateArrays.push(newDate); }); return dateArrays; } function daydiff(first, second) { return Math.round((second-first)); } function minLapse(dates) { //determine the minimum distance among events var dateDistances = []; for (var i = 1; i < dates.length; i++) { var distance = daydiff(dates[i-1], dates[i]); dateDistances.push(distance); } return Math.min.apply(null, dateDistances); } /* How to tell if a DOM element is visible in the current viewport? http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport */ function elementInViewport(el) { var top = el.offsetTop; var left = el.offsetLeft; var width = el.offsetWidth; var height = el.offsetHeight; while(el.offsetParent) { el = el.offsetParent; top += el.offsetTop; left += el.offsetLeft; } return ( top < (window.pageYOffset + window.innerHeight) && left < (window.pageXOffset + window.innerWidth) && (top + height) > window.pageYOffset && (left + width) > window.pageXOffset ); } function checkMQ() { //check if mobile or desktop device return window.getComputedStyle(document.querySelector('.mkdf-horizontal-timeline'), '::before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, ""); } } })(jQuery); (function($) { 'use strict'; var elementsHolder = {}; mkdf.modules.elementsHolder = elementsHolder; elementsHolder.mkdfInitElementsHolderResponsiveStyle = mkdfInitElementsHolderResponsiveStyle; elementsHolder.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitElementsHolderResponsiveStyle(); } /* ** Elements Holder responsive style */ function mkdfInitElementsHolderResponsiveStyle(){ var elementsHolder = $('.mkdf-elements-holder'); if(elementsHolder.length){ elementsHolder.each(function() { var thisElementsHolder = $(this), elementsHolderItem = thisElementsHolder.children('.mkdf-eh-item'), style = '', responsiveStyle = ''; elementsHolderItem.each(function() { var thisItem = $(this), itemClass = '', largeLaptop = '', smallLaptop = '', ipadLandscape = '', ipadPortrait = '', mobileLandscape = '', mobilePortrait = ''; if (typeof thisItem.data('item-class') !== 'undefined' && thisItem.data('item-class') !== false) { itemClass = thisItem.data('item-class'); } if (typeof thisItem.data('1280-1600') !== 'undefined' && thisItem.data('1280-1600') !== false) { largeLaptop = thisItem.data('1280-1600'); } if (typeof thisItem.data('1024-1280') !== 'undefined' && thisItem.data('1024-1280') !== false) { smallLaptop = thisItem.data('1024-1280'); } if (typeof thisItem.data('768-1024') !== 'undefined' && thisItem.data('768-1024') !== false) { ipadLandscape = thisItem.data('768-1024'); } if (typeof thisItem.data('600-768') !== 'undefined' && thisItem.data('600-768') !== false) { ipadPortrait = thisItem.data('600-768'); } if (typeof thisItem.data('480-600') !== 'undefined' && thisItem.data('480-600') !== false) { mobileLandscape = thisItem.data('480-600'); } if (typeof thisItem.data('480') !== 'undefined' && thisItem.data('480') !== false) { mobilePortrait = thisItem.data('480'); } if(largeLaptop.length || smallLaptop.length || ipadLandscape.length || ipadPortrait.length || mobileLandscape.length || mobilePortrait.length) { if(largeLaptop.length) { responsiveStyle += "@media only screen and (min-width: 1280px) and (max-width: 1600px) {.mkdf-eh-item-content."+itemClass+" { padding: "+largeLaptop+" !important; } }"; } if(smallLaptop.length) { responsiveStyle += "@media only screen and (min-width: 1024px) and (max-width: 1280px) {.mkdf-eh-item-content."+itemClass+" { padding: "+smallLaptop+" !important; } }"; } if(ipadLandscape.length) { responsiveStyle += "@media only screen and (min-width: 768px) and (max-width: 1024px) {.mkdf-eh-item-content."+itemClass+" { padding: "+ipadLandscape+" !important; } }"; } if(ipadPortrait.length) { responsiveStyle += "@media only screen and (min-width: 600px) and (max-width: 768px) {.mkdf-eh-item-content."+itemClass+" { padding: "+ipadPortrait+" !important; } }"; } if(mobileLandscape.length) { responsiveStyle += "@media only screen and (min-width: 480px) and (max-width: 600px) {.mkdf-eh-item-content."+itemClass+" { padding: "+mobileLandscape+" !important; } }"; } if(mobilePortrait.length) { responsiveStyle += "@media only screen and (max-width: 480px) {.mkdf-eh-item-content."+itemClass+" { padding: "+mobilePortrait+" !important; } }"; } } }); if(responsiveStyle.length) { style = '<style type="text/css" data-type="mediclinic_mikado_eh_shortcodes_custom_css">'+responsiveStyle+'</style>'; } if(style.length) { $('head').append(style); } }); } } })(jQuery); (function($) { 'use strict'; var icon = {}; mkdf.modules.icon = icon; icon.mkdfIcon = mkdfIcon; icon.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfIcon().init(); } /** * Object that represents icon shortcode * @returns {{init: Function}} function that initializes icon's functionality */ var mkdfIcon = function() { var icons = $('.mkdf-icon-shortcode'); /** * Function that triggers icon animation and icon animation delay */ var iconAnimation = function(icon) { if(icon.hasClass('mkdf-icon-animation')) { icon.appear(function() { icon.parent('.mkdf-icon-animation-holder').addClass('mkdf-icon-animation-show'); }, {accX: 0, accY: mkdfGlobalVars.vars.mkdfElementAppearAmount}); } }; /** * Function that triggers icon hover color functionality */ var iconHoverColor = function(icon) { if(typeof icon.data('hover-color') !== 'undefined') { var changeIconColor = function(event) { event.data.icon.css('color', event.data.color); }; var iconElement = icon.find('.mkdf-icon-element'); var hoverColor = icon.data('hover-color'); var originalColor = iconElement.css('color'); if(hoverColor !== '') { icon.on('mouseenter', {icon: iconElement, color: hoverColor}, changeIconColor); icon.on('mouseleave', {icon: iconElement, color: originalColor}, changeIconColor); } } }; /** * Function that triggers icon holder background color hover functionality */ var iconHolderBackgroundHover = function(icon) { if(typeof icon.data('hover-background-color') !== 'undefined') { var changeIconBgColor = function(event) { event.data.icon.css('background-color', event.data.color); }; var hoverBackgroundColor = icon.data('hover-background-color'); var originalBackgroundColor = icon.css('background-color'); if(hoverBackgroundColor !== '') { icon.on('mouseenter', {icon: icon, color: hoverBackgroundColor}, changeIconBgColor); icon.on('mouseleave', {icon: icon, color: originalBackgroundColor}, changeIconBgColor); } } }; /** * Function that initializes icon holder border hover functionality */ var iconHolderBorderHover = function(icon) { if(typeof icon.data('hover-border-color') !== 'undefined') { var changeIconBorder = function(event) { event.data.icon.css('border-color', event.data.color); }; var hoverBorderColor = icon.data('hover-border-color'); var originalBorderColor = icon.css('border-color'); if(hoverBorderColor !== '') { icon.on('mouseenter', {icon: icon, color: hoverBorderColor}, changeIconBorder); icon.on('mouseleave', {icon: icon, color: originalBorderColor}, changeIconBorder); } } }; return { init: function() { if(icons.length) { icons.each(function() { iconAnimation($(this)); iconHoverColor($(this)); iconHolderBackgroundHover($(this)); iconHolderBorderHover($(this)); }); } } }; }; })(jQuery); /** * Init Icon box shortcode Overlapping icon type */ (function($) { 'use strict'; var iconBox = {}; mkdf.modules.iconBox = iconBox; iconBox.mkdfInitIconBox = mkdfInitIconBox; iconBox.mkdfOnWindowLoad = mkdfOnWindowLoad; $(window).on('load', mkdfOnWindowLoad); iconBox.mkdfOnWindowResize = mkdfOnWindowResize; $(window).resize(mkdfOnWindowResize); /* All functions to be called on $(window).load() should be in this function */ function mkdfOnWindowLoad() { mkdfInitIconBox(); } /* All functions to be called on $(window).resize() should be in this function */ function mkdfOnWindowResize() { mkdfInitIconBox(); } /* ** Init Overlapping icon type */ function mkdfInitIconBox() { var infoBox = $('.mkdf-icon-box-holder.overlapping-icon'); if(infoBox.length > 0){ infoBox.each(function(){ var thisInfoBox = $(this); var contentHeight; var content = thisInfoBox.find('.mkdf-icon-box-content'); var visibleInfo = thisInfoBox.find('.mkdf-icon-box-visible-content'); var hiddenInfo = thisInfoBox.find('.mkdf-icon-box-invisible-content'); var visibleHeight = visibleInfo.height(); var hiddenHeight = hiddenInfo.height(); contentHeight = visibleHeight + hiddenHeight; content.height(contentHeight); thisInfoBox.css('opacity', 1); thisInfoBox.on('mouseenter', function () { visibleInfo.css('transform', 'translateY('+ -hiddenHeight/2 +'px)'); }); thisInfoBox.on('mouseleave ', function () { visibleInfo.css('transform', 'translateY(0)'); }); }); } } })(jQuery); (function($) { 'use strict'; var iconListItem = {}; mkdf.modules.iconListItem = iconListItem; iconListItem.mkdfInitIconList = mkdfInitIconList; iconListItem.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitIconList().init(); } /** * Button object that initializes icon list with animation * @type {Function} */ var mkdfInitIconList = function() { var iconList = $('.mkdf-animate-list'); /** * Initializes icon list animation * @param list current slider */ var iconListInit = function(list) { setTimeout(function(){ list.appear(function(){ list.addClass('mkdf-appeared'); },{accX: 0, accY: mkdfGlobalVars.vars.mkdfElementAppearAmount}); },30); }; return { init: function() { if(iconList.length) { iconList.each(function() { iconListInit($(this)); }); } } }; }; })(jQuery); (function($) { 'use strict'; var tabs = {}; mkdf.modules.tabs = tabs; tabs.mkdfInitTabs = mkdfInitTabs; tabs.mkdfInitTabIcons =mkdfInitTabIcons; tabs.mkdfTabsNavUnderline = mkdfTabsNavUnderline; tabs.mkdfOnDocumentReady = mkdfOnDocumentReady; tabs.mkdfOnWindowLoad = mkdfOnWindowLoad; $(document).ready(mkdfOnDocumentReady); $(window).on('load', mkdfOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitTabs(); mkdfInitTabIcons(); } /* All functions to be called on $(window).load() should be in this function */ function mkdfOnWindowLoad() { mkdfTabsNavUnderline(); } /* ** Init tabs shortcode */ function mkdfInitTabs(){ var tabs = $('.mkdf-icon-tabs'); if(tabs.length){ tabs.each(function(){ var thisTabs = $(this); thisTabs.children('.mkdf-icon-tab-container').each(function(index){ index = index + 1; var that = $(this), link = that.attr('id'), navItem = that.parent().find('.mkdf-icon-tabs-nav li:nth-child('+index+') a'), navLink = navItem.attr('href'); link = '#'+link; if(link.indexOf(navLink) > -1) { navItem.attr('href',link); } }); thisTabs.tabs(); }); } } /* ** Generate icons in tabs navigation */ function mkdfInitTabIcons(){ var tabContent = $('.mkdf-icon-tab-container'); if(tabContent.length){ tabContent.each(function(){ var thisTabContent = $(this); var id = thisTabContent.attr('id'); var icon = ''; if(typeof thisTabContent.data('icon-html') !== 'undefined' || thisTabContent.data('icon-html') !== 'false') { icon = thisTabContent.data('icon-html'); } var tabNav = thisTabContent.parents('.mkdf-icon-tabs').find('.mkdf-icon-tabs-nav > li > a[href="#'+id+'"]'); if(typeof(tabNav) !== 'undefined') { tabNav.prepend(icon); } }); } } function mkdfTabsNavUnderline() { var tabs = $('.mkdf-icon-tabs'); if(tabs.length) { tabs.each(function(){ var tabNav = $(this), tabNavs = tabNav.find('.mkdf-icon-tabs-nav'), navItemActive = tabNavs.find('.ui-state-active'), navLine = tabNav.find('.mkdf-tabs-nav-line'), navItems = tabNavs.find('> li'); var navLineParams = function() { var navItemActive = tabNavs.find('.ui-state-active'); navLine.css('width', navItemActive.outerWidth() - 60); navLine.css('left', navItemActive.offset().left - tabNavs.offset().left + 30); navLine.css('opacity', 1); }; if( navItemActive.length ) { navLineParams(); } else { navLine.css('left', navItems.first().offset().left - tabNavs.offset().left + 30); } navItems.each(function(){ var navItem = $(this), navItemWidth = navItem.outerWidth() - 60, navMenuOffset = tabNavs.offset().left, navItemOffset = navItem.offset().left - navMenuOffset + 30; navItem.mouseenter(function(){ navLine.css('width', navItemWidth); navLine.css('left', navItemOffset); }); }); tabNavs.mouseleave(function(){ navLineParams(); }); }); } } })(jQuery); (function($) { 'use strict'; var imageGallery = {}; mkdf.modules.imageGallery = imageGallery; imageGallery.mkdfInitImageGalleryMasonry = mkdfInitImageGalleryMasonry; imageGallery.mkdfOnWindowLoad = mkdfOnWindowLoad; $(window).on('load', mkdfOnWindowLoad); /* ** All functions to be called on $(window).load() should be in this function */ function mkdfOnWindowLoad() { mkdfInitImageGalleryMasonry(); } /* ** Init Image Gallery shortcode - Masonry layout */ function mkdfInitImageGalleryMasonry(){ var holder = $('.mkdf-image-gallery.mkdf-ig-masonry-type'); if(holder.length){ holder.each(function(){ var thisHolder = $(this), masonry = thisHolder.find('.mkdf-ig-masonry'); masonry.waitForImages(function() { masonry.isotope({ layoutMode: 'packery', itemSelector: '.mkdf-ig-image', percentPosition: true, packery: { gutter: '.mkdf-ig-grid-gutter', columnWidth: '.mkdf-ig-grid-sizer' } }); setTimeout(function() { masonry.isotope('layout'); }, 800); masonry.css('opacity', '1'); }); }); } } })(jQuery); (function($) { 'use strict'; var pieChart = {}; mkdf.modules.pieChart = pieChart; pieChart.mkdfInitPieChart = mkdfInitPieChart; pieChart.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitPieChart(); } /** * Init Pie Chart shortcode */ function mkdfInitPieChart() { var pieChartHolder = $('.mkdf-pie-chart-holder'); if (pieChartHolder.length) { pieChartHolder.each(function () { var thisPieChartHolder = $(this), pieChart = thisPieChartHolder.children('.mkdf-pc-percentage'), barColor = '#25abd1', trackColor = '#f7f7f7', lineWidth = 3, size = 176; if(typeof pieChart.data('size') !== 'undefined' && pieChart.data('size') !== '') { size = pieChart.data('size'); } if(typeof pieChart.data('bar-color') !== 'undefined' && pieChart.data('bar-color') !== '') { barColor = pieChart.data('bar-color'); } if(typeof pieChart.data('track-color') !== 'undefined' && pieChart.data('track-color') !== '') { trackColor = pieChart.data('track-color'); } pieChart.appear(function() { initToCounterPieChart(pieChart); thisPieChartHolder.css('opacity', '1'); pieChart.easyPieChart({ barColor: barColor, trackColor: trackColor, scaleColor: false, lineCap: 'butt', lineWidth: lineWidth, animate: 1500, size: size }); },{accX: 0, accY: mkdfGlobalVars.vars.mkdfElementAppearAmount}); }); } } /* ** Counter for pie chart number from zero to defined number */ function initToCounterPieChart(pieChart){ var counter = pieChart.find('.mkdf-pc-percent'), max = parseFloat(counter.text()); counter.countTo({ from: 0, to: max, speed: 1500, refreshInterval: 50 }); } })(jQuery); (function($) { 'use strict'; var pricingTable = {}; mkdf.modules.pricingTable = pricingTable; pricingTable.mkdfInitPricingTable = mkdfInitPricingTable; pricingTable.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitPricingTable(); } /** * Init Pricing Table badge animation */ function mkdfInitPricingTable() { var pricingTables = $('.mkdf-pricing-tables'); if(pricingTables.length) { pricingTables.each(function () { pricingTables.appear(function() { pricingTables.find('.mkdf-active-text').addClass('active'); },{accX: 0, accY: mkdfGlobalVars.vars.mkdfElementAppearAmount}); }); } } })(jQuery); (function($) { 'use strict'; var process = {}; mkdf.modules.process = process; process.mkdfInitProcessAnimation = mkdfInitProcessAnimation; process.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitProcessAnimation(); } /* * Process Animation */ function mkdfInitProcessAnimation() { var processAnimationHolders = $('.mkdf-animate-process-items-yes'); if (processAnimationHolders.length && !mkdf.htmlEl.hasClass('touch')) { processAnimationHolders.appear(function(){ var processAnimationHolder = $(this), processItems = processAnimationHolder.find('.mkdf-process-item-holder'), processBgrnd = processAnimationHolder.find('.mkdf-process-bg-holder'); processItems.each(function(i){ var currentItem = $(this); setTimeout(function(){ currentItem.addClass('mkdf-appeared'); if (i == processItems.length - 1) { processBgrnd.addClass('mkdf-appeared'); } }, i*200); }); },{accX: 0, accY: mkdfGlobalVars.vars.mkdfElementAppearAmount}); } } })(jQuery); (function($) { 'use strict'; var progressBar = {}; mkdf.modules.progressBar = progressBar; progressBar.mkdfInitProgressBars = mkdfInitProgressBars; progressBar.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitProgressBars(); } /* ** Horizontal progress bars shortcode */ function mkdfInitProgressBars(){ var progressBar = $('.mkdf-progress-bar'); if(progressBar.length){ progressBar.each(function() { var thisBar = $(this), thisBarContent = thisBar.find('.mkdf-pb-content'), percentage = thisBarContent.data('percentage'); thisBar.appear(function() { mkdfInitToCounterProgressBar(thisBar, percentage); thisBarContent.css('width', '0%'); thisBarContent.animate({'width': percentage+'%'}, 2000); }); }); } } /* ** Counter for horizontal progress bars percent from zero to defined percent */ function mkdfInitToCounterProgressBar(progressBar, $percentage){ var percentage = parseFloat($percentage), percent = progressBar.find('.mkdf-pb-percent'); if(percent.length) { percent.each(function() { var thisPercent = $(this); thisPercent.css('opacity', '1'); thisPercent.countTo({ from: 0, to: percentage, speed: 2000, refreshInterval: 50 }); }); } } })(jQuery); (function($) { 'use strict'; var tabs = {}; mkdf.modules.tabs = tabs; tabs.mkdfInitTabs = mkdfInitTabs; tabs.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitTabs(); } /* ** Init tabs shortcode */ function mkdfInitTabs(){ var tabs = $('.mkdf-tabs'); if(tabs.length){ tabs.each(function(){ var thisTabs = $(this); thisTabs.children('.mkdf-tab-container').each(function(index){ index = index + 1; var that = $(this), link = that.attr('id'), navItem = that.parent().find('.mkdf-tabs-nav li:nth-child('+index+') a'), navLink = navItem.attr('href'); link = '#'+link; if(link.indexOf(navLink) > -1) { navItem.attr('href',link); } }); thisTabs.tabs(); }); } } })(jQuery); (function($) { 'use strict'; var team = {}; mkdf.modules.team = team; team.mkdfBookingForm = mkdfBookingForm; team.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfBookingForm(); } /** * Testimonials Shortcode */ function mkdfBookingForm() { var bookNow = $('.mkdf-book-now'); bookNow.each(function() { var book = $(this); book.on('click',function(){ $(".mkdf-booking-form ").slideToggle(); }); }) var bookingForms = $('.mkdf-booking-form'); bookingForms.each(function(index) { var form = $(this); var formItself = form.find('form'); var responseDiv = formItself.find('.mkdf-bf-form-response-holder'); var workDays = form.data('workdays'); var startTime = form.data('start-time'); var endTime = form.data('end-time'); var bookingPeriod = form.data('period'); var timesArray = []; for(var xh=startTime;xh<=endTime-1;xh++){ for(var xm=0;xm<60;xm+=bookingPeriod){ var time = ("0"+xh).slice(-2)+':'+("0"+xm).slice(-2); timesArray.push(time); } } form.find('.mkdf-bf-input-date').datetimepicker({ timepicker: false, minDate: 0, format: 'Y-m-d', disabledWeekDays: workDays }); form.find('.mkdf-bf-input-time').datetimepicker({ datepicker: false, allowTimes: timesArray, step: bookingPeriod, format: 'H:i' }); formItself.submit(function(e) { e.preventDefault(); var enquiryData = { doctor: formItself.find('input.mkdf-bf-input-doctor').val(), date: formItself.find('input.mkdf-bf-input-date').val(), time: formItself.find('input.mkdf-bf-input-time').val(), name: formItself.find('input.mkdf-bf-input-name').val(), contact: formItself.find('input.mkdf-bf-input-contact').val(), message: formItself.find('textarea.mkdf-bf-input-request').val(), nonce: formItself.find('.nonce input:first-child').val() }; var requestData = { action: 'mkdf_action_send_booking_form', data: enquiryData }; $.ajax({ type: 'POST', data: requestData, url: MikadoAjaxUrl, success: function( response ) { responseDiv.html(response.data).slideDown(300); setTimeout(function() { responseDiv.slideUp(300, function() { responseDiv.html(''); }); }, 3000); } }); }); }); } })(jQuery); (function($) { 'use strict'; var testimonials = {}; mkdf.modules.testimonials = testimonials; testimonials.mkdfInitTestimonials = mkdfInitTestimonials; testimonials.mkdfOnDocumentReady = mkdfOnDocumentReady; $(document).ready(mkdfOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitTestimonials(); } /** * Testimonials Shortcode */ function mkdfInitTestimonials(){ var testimonial = $('.mkdf-owl-testimonials'); if (testimonial.length) { testimonial.each(function () { var theseTestimonials = $(this).filter(':not(.mkdf-single-testimonial)'), testimonialsHolder = $(this).closest('.mkdf-testimonials-holder'), numberOfItems, numberOfItemsTablet, numberOfItemsMobile, numberOfItemsLaptop, itemMargin, animationSpeed = 400, dragGrab, touchDrag = true, allowFlag = true, dotsNavigation = false, arrowsNavigation = false; // slider if (theseTestimonials.hasClass('mkdf-testimonials-slider')) { numberOfItems = 1; numberOfItemsLaptop = 1; numberOfItemsTablet = 1; numberOfItemsMobile = 1; itemMargin = 0; dragGrab = false; touchDrag = false; } // carousel if (theseTestimonials.hasClass('mkdf-testimonials-carousel')) { if (typeof theseTestimonials.data('visible-items') !== 'undefined' && theseTestimonials.data('visible-items') !== false) { numberOfItems = theseTestimonials.data('visible-items'); } else { numberOfItems = 3; } numberOfItemsLaptop = 3; numberOfItemsTablet = 2; numberOfItemsMobile = 1; itemMargin = 34; dragGrab = true; } // get animation speed if (theseTestimonials.hasClass('mkdf-testimonials-slider')) { animationSpeed = 850; } if (typeof theseTestimonials.data('animation-speed') !== 'undefined' && theseTestimonials.data('animation-speed') !== false) { animationSpeed = theseTestimonials.data('animation-speed'); } if (theseTestimonials.hasClass('mkdf-testimonials-navigation')) { // Go to the next item theseTestimonials.parent().parent().parent().find('.mkdf-tes-nav-next').on('click',function (e) { e.preventDefault(); if(allowFlag) { allowFlag = false; owl.trigger('next.owl.carousel'); // only for slider if (theseTestimonials.hasClass('mkdf-testimonials-slider')) { owlImageDots.trigger('next.owl.carousel'); } setTimeout(function(){ allowFlag = true; }, 900); } }); // Go to the previous item theseTestimonials.parent().parent().parent().find('.mkdf-tes-nav-prev').on('click',function (e) { e.preventDefault(); if(allowFlag) { allowFlag = false; owl.trigger('prev.owl.carousel'); // only for slider if (theseTestimonials.hasClass('mkdf-testimonials-slider')) { owlImageDots.trigger('prev.owl.carousel'); } setTimeout(function(){ allowFlag = true; }, 900); } }); } if (theseTestimonials.hasClass('mkdf-testimonials-pagination')) { theseTestimonials.parent().parent().parent().find('.mkdf-tes-dot').on('click',function (e) { var bullet = $(this); owl.trigger('to.owl.carousel', [bullet.index(), 0, true]); bullet.siblings().removeClass('active'); bullet.addClass('active'); if (theseTestimonials.hasClass('mkdf-testimonials-slider')) { owlImageDots.trigger('to.owl.carousel', [bullet.index(), 0, true]); } }); } if (theseTestimonials.hasClass('mkdf-testimonials-light')) { theseTestimonials.parent().parent().parent().find('.mkdf-tes-nav').addClass('light'); } if (theseTestimonials.hasClass('mkdf-testimonials-dark')) { theseTestimonials.parent().parent().parent().find('.mkdf-tes-nav').addClass('dark'); } // get navigation var autoplay = true; var enableLoop = true; var sliderSpeed = 5000; if( testimonial.data('enable-autoplay')== 'no'){ autoplay = false; } if( testimonial.data('enable-loop')== 'no'){ enableLoop = false; } if( testimonial.data('enable-pagination')== 'yes'){ dotsNavigation = true; } if( testimonial.data('enable-navigation')== 'yes'){ arrowsNavigation = true; } if( testimonial.data('slider-speed') !== ''){ sliderSpeed = testimonial.data('slider-speed'); } var owl = theseTestimonials.owlCarousel({ responsiveClass: true, responsive: { 0: { items: numberOfItemsMobile }, 768: { items: numberOfItemsTablet }, 1260: { items: numberOfItemsLaptop }, 1441: { items: numberOfItems } }, margin: itemMargin, autoplay: autoplay, autoplayTimeout: sliderSpeed, smartSpeed: animationSpeed, loop: enableLoop, info: true, dots: dotsNavigation, nav: false, mouseDrag: dragGrab, touchDrag: touchDrag, autoplayHoverPause: false, onInitialized: function () { mkdfAppear(); } }); if (theseTestimonials.hasClass('mkdf-testimonials-slider')) { owl.on('changed.owl.carousel', function (event) { owlImageDots.trigger('to.owl.carousel', [event.item.index - 3, 0, true]); }); } // callback function to show testimonials function mkdfAppear() { testimonialsHolder.css('visibility', 'visible'); testimonialsHolder.animate({opacity: 1}, 300); } //carousel additional image slider if (theseTestimonials.hasClass('mkdf-testimonials-slider')) { var imageDots = $('.mkdf-tes-image-nav'); var owlImageDots = imageDots.owlCarousel({ autoplay: autoplay, autoplayTimeout: sliderSpeed, smartSpeed: animationSpeed, center: true, loop: enableLoop, mouseDrag: dragGrab, autoplayHoverPause: false, touchDrag: touchDrag, responsive:{ 480:{ items:3 }, 0:{ items:1 } } }); } }); mkdf.modules.common.mkdfInitParallax; } } })(jQuery); (function($) { 'use strict'; var woocommerce = {}; mkdf.modules.woocommerce = woocommerce; woocommerce.mkdfOnDocumentReady = mkdfOnDocumentReady; woocommerce.mkdfOnWindowLoad = mkdfOnWindowLoad; woocommerce.mkdfOnWindowResize = mkdfOnWindowResize; woocommerce.mkdfOnWindowScroll = mkdfOnWindowScroll; $(document).ready(mkdfOnDocumentReady); $(window).on('load', mkdfOnWindowLoad); $(window).resize(mkdfOnWindowResize); $(window).scroll(mkdfOnWindowScroll); /* All functions to be called on $(document).ready() should be in this function */ function mkdfOnDocumentReady() { mkdfInitQuantityButtons(); mkdfInitSelect2(); mkdfPaginationClass(); mkdfInitSingleProductLightbox(); } /* All functions to be called on $(window).load() should be in this function */ function mkdfOnWindowLoad() { } /* All functions to be called on $(window).resize() should be in this function */ function mkdfOnWindowResize() { } /* All functions to be called on $(window).scroll() should be in this function */ function mkdfOnWindowScroll() {} /* ** Init quantity buttons to increase/decrease products for cart */ function mkdfInitQuantityButtons() { $(document).on( 'click', '.mkdf-quantity-minus, .mkdf-quantity-plus', function(e) { e.stopPropagation(); var button = $(this), inputField = button.siblings('.mkdf-quantity-input'), step = parseFloat(inputField.data('step')), max = parseFloat(inputField.data('max')), minus = false, inputValue = parseFloat(inputField.val()), newInputValue; if (button.hasClass('mkdf-quantity-minus')) { minus = true; } if (minus) { newInputValue = inputValue - step; if (newInputValue >= 1) { inputField.val(newInputValue); } else { inputField.val(0); } } else { newInputValue = inputValue + step; if ( max === undefined ) { inputField.val(newInputValue); } else { if ( newInputValue >= max ) { inputField.val(max); } else { inputField.val(newInputValue); } } } inputField.trigger( 'change' ); }); } /* ** Init select2 script for select html dropdowns */ function mkdfInitSelect2() { var orderByDropDown = $('.woocommerce-ordering .orderby'); if (orderByDropDown.length) { orderByDropDown.select2({ minimumResultsForSearch: Infinity }); } var shippingCountryCalc = $('#calc_shipping_country'); if(shippingCountryCalc.length) { shippingCountryCalc.select2(); } var shippingStateCalc = $('.cart-collaterals .shipping select#calc_shipping_state'); if(shippingStateCalc.length) { shippingStateCalc.select2(); } } /* ** Init Product Single Pretty Photo attributes */ function mkdfInitSingleProductLightbox() { var item = $('.mkdf-woo-single-page .mkdf-single-product-content .woocommerce-product-gallery__image'); if(item.length) { item.each(function() { var thisItem = $(this).children('a'); thisItem.attr('data-rel', 'prettyPhoto[woo_single_pretty_photo]'); if (typeof mkdf.modules.common.mkdfPrettyPhoto === "function") { mkdf.modules.common.mkdfPrettyPhoto(); } }); } } /* ** Add current class for pagination */ function mkdfPaginationClass() { var pagination = $('.woocommerce-pagination .page-numbers'); if (pagination.length){ pagination.find('li span.current').parent().addClass('current'); } } })(jQuery);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка