1jQuery.noConflict(); 2jQuery(document).ready(function($){ 3 "use strict"; 4 5 /** 6 * Keyboard navigation links 7 */ 8 if( $("ul.wdt-primary-nav").length ) { 9 var $children = $("ul.wdt-primary-nav").find(".menu-item-has-children a"); 10 var $sub_menu = $("ul.wdt-primary-nav").find(".sub-menu a"); 11 var $a = $("ul.wdt-primary-nav > li > a"); 12 13 $( $a ).focus(function() { 14 $(this).parent("li").addClass('focus'); 15 }).blur(function(){ 16 $(this).parent("li").removeClass('focus'); 17 }); 18 19 $( $children ).focus(function(){ 20 $(this).parents(".menu-item-has-children").addClass('focus'); 21 }).blur(function(){ 22 $(this).parents(".menu-item-has-children").removeClass('focus'); 23 }); 24 25 $( $sub_menu ).focus(function(){ 26 $(this).parent("li").addClass('focus'); 27 }).blur(function(){ 28 $(this).parent("li").removeClass('focus'); 29 }); 30 } 31 32 jQuery(document).on('keydown', function( event ) { 33 34 if(!jQuery('body').hasClass('nav-is-visible')) { 35 return; 36 } 37 38 var tabKey = event.keyCode === 9; 39 var shiftKey = event.shiftKey; 40 var escKey = event.keyCode === 27; 41 42 if(escKey) { 43 jQuery('.mobile-menu-overlay').trigger('click'); 44 } 45 46 var activeItem = jQuery(':focus'); 47 if(activeItem.parent().hasClass('menu-item')) { 48 49 if( shiftKey && tabKey ) { 50 51 var activeMenuItem = activeItem.parent('.menu-item'); 52 if(activeMenuItem.prev().hasClass('menu-item-has-children')) { 53 event.preventDefault(); 54 activeMenuItem.prev().find('a:first').focus(); 55 } 56 57 } else if( !shiftKey && tabKey ) { 58 59 var activeMenuItem = activeItem.parent('.menu-item'); 60 if(activeMenuItem.next().hasClass('menu-item-has-children')) { 61 event.preventDefault(); 62 activeMenuItem.next().find('a:first').focus(); 63 } else if(activeMenuItem.hasClass('menu-item-has-children')) { 64 event.preventDefault(); 65 activeMenuItem.next().find('a:first').focus(); 66 } else if(activeMenuItem.attr('class') == jQuery('.mobile-menu .menu-item:last').attr('class')) { 67 event.preventDefault(); 68 jQuery('.mobile-menu').find('.close-nav:first a').focus(); 69 } else if(activeMenuItem.attr('class') == activeMenuItem.parent('.sub-menu').find('.menu-item:last').attr('class')) { 70 event.preventDefault(); 71 activeMenuItem.parent('.sub-menu').find('.close-nav:first a').focus(); 72 } 73 74 } 75 76 } else { 77 78 if( shiftKey && tabKey ) { 79 80 if(activeItem.parent('li').hasClass('close-nav')){ 81 event.preventDefault(); 82 if(activeItem.closest('.sub-menu').length){ 83 activeItem.closest('.sub-menu').find('.menu-item:last a').focus(); 84 } else { 85 jQuery('.mobile-menu .menu-item-depth-0:last a').focus(); 86 } 87 } 88 89 } 90 91 } 92 93 }); 94 95 /** 96 * Desktop Menu Animation 97 */ 98 99 $('.animate-menu-item').parents('.menu-item').find('a') 100 .mouseenter(function() { 101 var animation_class = $(this).parents('.menu-item').find('.animate-menu-item').attr('data-animation'); 102 $(this).parents('.menu-item').find('.animate-menu-item').addClass(animation_class); 103 }) 104 .mouseleave(function() { 105 var animation_class = $(this).parents('.menu-item').find('.animate-menu-item').attr('data-animation'); 106 $(this).parents('.menu-item').find('.animate-menu-item').removeClass(animation_class); 107 }); 108 109 /** 110 * Mobile Menu 111 */ 112 113 var clicked = "false"; 114 $('.menu-trigger').on('click', function( event ){ 115 event.preventDefault(); 116 if (clicked == "false") { 117 $('html, body').css('overflow', 'hidden'); 118 clicked = "true"; 119 120 var menuItem = $(this).parents('.wdt-header-menu').find('.wdt-primary-nav:not(.wdt-secondary-nav)').clone(); 121 122 // Remove animation Class 123 $('[data-animation]', menuItem ).each(function(ix, ele ){ 124 $(ele).removeClass('animate-menu-item'); 125 }); 126 127 $('<div class="mobile-menu" />').appendTo( $("body") ); 128 menuItem.appendTo('.mobile-menu'); 129 $('<div class="mobile-menu-overlay"></div>').appendTo( $("body") ); 130 131 $('.mobile-menu').toggleClass('nav-is-visible'); 132 $('.mobile-menu-overlay').toggleClass('is-visible'); 133 $('body').toggleClass('nav-is-visible'); 134 135 $('.mobile-menu').find('.close-nav:first a').focus(); 136 137 // Initializing mobile nav 138 initializeMobileNav(); 139 140 } else { 141 closeMobNav(); 142 } 143 });
144 145 // Closing Mobile Nav 146 function closeMobNav() { 147 var scrollPos = $(window).scrollTop(); 148 $('html, body').css('overflow', 'auto'); 149 clicked = "false"; 150 $('.mobile-menu, .mobile-menu-overlay').removeClass('is-visible'); 151 $('body').removeClass('nav-is-visible'); 152 153 $('.mobile-menu').remove(); 154 $('.mobile-menu-overlay').remove(); 155 156 $('.menu-trigger').focus(); 157 $(window).scrollTop(scrollPos); 158 } 159 160 // Initialize mobile nav 161 function initializeMobileNav() { 162 163 $('li.close-nav').on('click', function(event) { 164 closeMobNav(); 165 }); 166 167 $('.mobile-menu-overlay').on('click', function(event) { 168 closeMobNav(); 169 }); 170 171 // Sub Menu in Mobile Menu 172 $('.menu-item-has-children > a, .page_item_has_children > a').on('click', function(event) { 173 if ( $('body').hasClass('nav-is-visible') ) { 174 event.preventDefault(); 175 var a = $(this).clone(); 176 $(this).next('.sub-menu').find('.see-all').html(a); 177 } 178 179 var selected = $(this); 180 if( selected.next('ul').hasClass('is-hidden') ) { 181 selected.next('ul.sub-menu').removeClass('is-hidden'); 182 } else { 183 selected.next('ul.sub-menu').addClass('is-hidden'); 184 } 185 }); 186 187 $('.menu-item-has-children > a, .page_item_has_children > a').on('click', function(event) { 188 189 var selected = $(this); 190 selected.next('.sub-menu:not(.is-hidden)').find('a:first').focus(); 191 192 }); 193 194 // Go Back in Mobile Menu 195 $('.go-back').on('click', function(event) { 196 $(this).parent('ul:not(.menu)').addClass('is-hidden'); 197 event.preventDefault(); 198 $(this).parents('.menu-item').find('a:first').focus(); 199 }); 200 201 } 202 203 // For Video Post 204 if( $("div.wdt-video-wrap").length ) { 205 $("div.wdt-video-wrap").fitVids(); 206 } 207 208 // Smart Resize 209 $(window).on("resize", function() { 210 // Blog Isotope 211 if( $(".apply-isotope").length ) { 212 $(".apply-isotope").isotope({itemSelector : '.column',transformsEnabled:false,masonry: { columnWidth: '.grid-sizer' } }); 213 } 214 }); 215 216 if( $('.single .entry-thumb.single-preview-img a.mag-pop, a.lightbox-preview-img').length ) { 217 $('.single .entry-thumb.single-preview-img a.mag-pop, a.lightbox-preview-img').magnificPopup({ 218 type: 'image', 219 closeOnContentClick: false, 220 closeBtnInside: false, 221 mainClass: 'mfp-with-zoom mfp-img-mobile', 222 image: { 223 verticalFit: true, 224 titleSrc: function(item) { 225 return item.el.attr('title') + ' · <a class="image-source-link" href="'+item.el.attr('href')+'" target="_blank">image source</a>'; 226 } 227 }, 228 zoom: { 229 enabled: true, 230 duration: 300, // don't foget to change the duration also in CSS 231 opener: function(element) { 232 return element.find('img'); 233 } 234 } 235 }); 236 } 237 238 $("select:not(.dt-select-service,.dt-select-staff,.start-time,.end-time,.wdt-sf-field)").each(function() { 239 $(this).select2(); 240 }); 241 242}); 243 244/* Live Search*/ 245jQuery( 'body' ).delegate( '.text_input', 'keypress', function(e) { 246 247 if (jQuery('.text_input').is(":focus")) { 248 249 var this_item = jQuery(this), 250 search_val = this_item.val(); 251 if(search_val == "" ){ 252 jQuery('.quick_search_results').html(""); 253 jQuery('.quick_search_results').removeClass('active'); 254 } else { 255 jQuery.ajax({ 256 type:"POST", 257 url: aimax_urls.ajaxurl, 258 data: { 259 action:'aimax_search_data_fetch', 260 search_val:search_val, 261 ajax_call: true, 262 function_call: 'aimax_search_data_fetch', 263 }, 264 success:function(data){ 265 jQuery('.quick_search_results').addClass('active'); 266 jQuery('.quick_search_results').html(data); 267 } 268 }); 269 } 270 } 271}); 272 273(function ($) { 274 $(window).on('load', function() { 275 276 // Gallery Post Slider 277 if( ($("ul.entry-gallery-post-slider").length) && ( $("ul.entry-gallery-post-slider li").length > 1 ) ){ 278 $("ul.entry-gallery-post-slider").bxSlider({mode: 'fade', auto:false, video:true, pager:'', autoHover:true, adaptiveHeight:false, responsive: true });
279 } 280 281 // Blog Isotope 282 if( $(".apply-isotope").length ) { 283 $(".apply-isotope").isotope({itemSelector : '.column',transformsEnabled:false,masonry: { columnWidth: '.grid-sizer' } }); 284 } 285 286 // Blog Equal Height 287 if( $('.tpl-blog-holder.apply-equal-height').length ) { 288 $(".tpl-blog-holder.apply-equal-height article").matchHeight({ property:"min-height" }); 289 } 290 }); 291})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.