1jQuery(function($) { 2 3 // Add custom script here. Please backup the file before editing/modifying. Thanks 4 5 6 // Run the script once the document is ready 7 $(document).ready(function() { 8 // $('#main-mobile-nav .dropdown-toggle').on('mouseenter', function(event) { 9 10 // $('#menu-mobile-menu .menu-item').each(function() { 11 // $(this).find('.dropdown-menu').removeClass('stay-showed'); 12 // }); 13 14 // $(this).siblings('.dropdown-menu').addClass('stay-showed'); 15 // }); 16 17 // $('#main-mobile-nav a.nav-link:not(.dropdown-toggle)').on('mouseenter', function(event) { 18 // $('#menu-mobile-menu .menu-item').each(function() { 19 // $(this).find('.dropdown-menu').removeClass('stay-showed'); 20 // }); 21 // }); 22 23 // $('#main-mobile-nav').on('mouseleave', function(event) { 24 // $('#menu-mobile-menu .menu-item').each(function() { 25 // $(this).find('.dropdown-menu').removeClass('stay-showed'); 26 // }); 27 // }); 28 29// screen.orientation.addEventListener("change", (event) => { 30// const type = event.target.type; 31 32// if(type.includes('landscape')) { 33// var header_height = $('#masthead > .container-fluid > .row').outerHeight(); 34// var window_height = $(window).outerHeight(); 35// var usable_height = (window_height - header_height) - 10; 36 37// $('#main-mobile-nav').outerHeight(usable_height); 38// $('#main-mobile-nav').css('overflow', 'scroll'); 39 40// if($('#main-mobile-nav').hasClass('show')) { 41// $('body').css('overflow', 'hidden'); 42// } 43// } else { 44// $('#main-mobile-nav').outerHeight('inherit'); 45// $('#main-mobile-nav').css('overflow', 'auto'); 46 47// $('body').css('overflow', 'auto'); 48// } 49 50// }); 51 52// if($(window).width() <= 575) { 53// var height_header = $('#masthead > .container-fluid > .row').outerHeight(); 54 55// $('#content').css('padding-top', height_header + 10); 56// } 57 58// $(window).on('resize', function() { 59// if($(window).width() <= 575) { 60// var height_header = $('#masthead > .container-fluid > .row').outerHeight(); 61 62// $('#content').css('padding-top', height_header + 10); 63// } else { 64// $('#content').css('padding-top', 'inherit'); 65// } 66 67// }); 68 69 70 $('.navbar-toggler').on('click', function() { 71 $('body').toggleClass('open-menu'); 72 }); 73 74 75 76 77 $('a').on( "mouseenter mouseleave", function() { 78 if($(this).attr('href') == undefined) { 79 $(this).css('cursor', 'default'); 80 } 81 }); 82 83 $('.woocommerce-Tabs-panel--description *').each(function() { 84 if($(this).html() === ' ') { 85 $(this).hide(); 86 } 87 }); 88 89 if(/Edg/.test(navigator.userAgent)) { 90 } else { 91 $( ".tml-pwd-wrap input" ).wrapAll( "<div class='login-password-wrap' />"); 92 93 $('<div class="password-eye-icon"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"/></svg></div>').appendTo('.tml-pwd-wrap .login-password-wrap'); 94 } 95 96 $('.password-eye-icon').on('click', function() { 97 if($('.tml-pwd-wrap input').attr('type') === 'password') { 98 $('.tml-pwd-wrap input').attr('type', 'text'); 99 100 $('.password-eye-icon').html('<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 640 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"/></svg>'); 101 } else { 102 $('.tml-pwd-wrap input').attr('type', 'password'); 103 104 $('.password-eye-icon').html('<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"/></svg>'); 105 } 106 }); 107 108 109// const togglePassword = document.querySelector('#togglePassword'); 110// const password = $('.tml-pwd-wrap input'); 111 112// togglePassword.addEventListener('click', function (e) { 113// // toggle the type attribute 114// const type = password.getAttribute('type') === 'password' ? 'text' : 'password'; 115// password.setAttribute('type', type); 116// // toggle the eye slash icon 117// this.classList.toggle('fa-eye-slash'); 118// }); 119 120 121 122 123 124 $('<span class="confirmation-notice notice"></span>').appendTo($('#billing_email_field')); 125 $('#billing_email').on('change', function() { 126 var data = { 127 action: 'check_user_for_membership', 128 user_email: $(this).val() 129 }; 130 131 $.ajax({ 132 type: 'POST', 133 url: ajaxurl, 134 data: data, 135 beforeSend: function() { 136 $('#billing_email_field .confirmation-notice').html('').removeClass('confirm').addClass('notice'); 137// $('<span class="confirmation-notice notice">Confirming membership...</span>').appendTo($('#billing_email_field')); 138 $('#billing_email_field .confirmation-notice').html('Confirming membership'); 139 140 }, 141 success: function(res) { 142 if(res) { 143 if(res.membership_type == 'guest') { 144 var html = 'Confirmed, customer is currently not a member of Kinslow System'; 145 } else { 146 var html = 'Confirmed, customer is currently member of Kinslow System. Please login to avail of membership discounts.'; 147 } 148 149 $('#billing_email_field .confirmation-notice').removeClass('notice').addClass('confirm').html(html); 150 $('#membership-type').val(res.membership_type); 151 } 152 } 153 }); 154 }); 155 156 157 158 159 160 161 162 163 164 //If Page banner exist, add class 165 if ( $(".page-banner, .home")[0]) { 166 $('#masthead').addClass('fixed-top'); 167 } else { 168 $('#masthead').removeClass('fixed-top'); 169 } 170 171 $('.page-template-blog #categories-4 .cat-item-144 > ul').after($('.page-template-blog #categories-4 .cat-item-144 > a')); 172 173 //Homepage: Product Carousel, Event Carousel & Related products Carousel
174 $('.product-carousel, .events-list, .related.products .products').slick({ 175 dots: false, 176 arrows: true, 177 infinite: true, 178 speed: 1000, 179 slidesToShow: 4, 180 slidesToScroll: 4, 181 autoplay: true, 182 autoplaySpeed: 5000, 183 draggable: false, 184 responsive: [ 185 { 186 breakpoint: 1400, 187 settings: { 188 slidesToShow: 3, 189 slidesToScroll: 3, 190 draggable: true, 191 } 192 }, 193 { 194 breakpoint: 1024, 195 settings: { 196 slidesToShow: 2, 197 slidesToScroll: 2, 198 } 199 }, 200 { 201 breakpoint: 500, 202 settings: { 203 slidesToShow: 1, 204 slidesToScroll: 1, 205 } 206 } 207 ] 208 }); 209 210 $('.up-sells .products').slick({ 211 dots: false, arrows: true, infinite: true, speed: 1000, slidesToShow: 3, slidesToScroll: 1, autoplay: true, draggable: false, responsive: [ 212 213 { 214 breakpoint: 1024, 215 settings: { 216 slidesToShow: 2, 217 slidesToScroll: 2, 218 } 219 }, 220 { 221 breakpoint: 500, 222 settings: { 223 slidesToShow: 1, 224 slidesToScroll: 1, 225 } 226 } 227 ] 228 }); 229 230 //Home Testimonial Text Carousel 231 $.fn.testimonial_carousel_text_function = function () { 232 $('.testimonial-carousel.text').slick({ 233 dots: false, 234 arrows: true, 235 infinite: true, 236 speed: 1000, 237 slidesToShow: 3, 238 slidesToScroll: 1, 239 autoplay: true, 240 autoplaySpeed: 8000, 241 draggable: false, 242 responsive: [ 243 { 244 breakpoint: 1400, 245 settings: { 246 slidesToShow: 3, 247 slidesToScroll: 3, 248 } 249 }, 250 { 251 breakpoint: 1024, 252 settings: { 253 slidesToShow: 2, 254 slidesToScroll: 1, 255 } 256 }, 257 { 258 breakpoint: 500, 259 settings: { 260 slidesToShow: 1, 261 slidesToScroll: 1, 262 } 263 } 264 ] 265 }); 266 return true; 267 }; 268 $(".testimonial-carousel.text").testimonial_carousel_text_function(); 269 270 //Home Testimonial Video Carousel 271 $.fn.testimonial_carousel_video_function = function () { 272 $('.testimonial-carousel.videos').slick({ 273 dots: false, arrows: true, infinite: true, speed: 1000, slidesToShow: 4, slidesToScroll: 1, autoplay: true, autoplaySpeed: 8000, draggable: false, responsive: [ 274 { 275 breakpoint: 1400, 276 settings: { 277 slidesToShow: 3, 278 slidesToScroll: 3, 279 } 280 }, 281 { 282 breakpoint: 1024, 283 settings: { 284 slidesToShow: 2, 285 slidesToScroll: 1, 286 } 287 }, 288 { 289 breakpoint: 500, 290 settings: { 291 slidesToShow: 1, 292 slidesToScroll: 1, 293 } 294 } 295 ] 296 }); 297 return true; 298 }; 299 $(".testimonial-carousel.videos").testimonial_carousel_video_function(); 300 301 //If page has a banner section 302 if( $('.archive #page-banner')[0] ){ 303 console.log('has banner'); 304 $('#content.site-content').css('padding-top', '0'); 305 } 306 307 //show dropdown menu on hover 308 $('.navbar-nav:not(#menu-mobile-menu) .menu-item-has-children a') 309 .mouseover( 310 function(){ 311 $(this).parents('.menu-item-has-children').find('.dropdown-menu').addClass('show'); 312 }).mouseout(function(){ 313 $(this).parents('.menu-item-has-children').find('.dropdown-menu').removeClass('show'); 314 }); 315 316 $('#menu-mobile-menu .menu-item-has-children > a').on('click', function(e) { 317 e.preventDefault(); 318 319 var this_element = $(this).parents('.menu-item-has-children'); 320 321 $('#menu-mobile-menu .menu-item-has-children').each(function() { 322 if(!$(this).is(this_element)) { 323 $(this).find('.dropdown-menu').removeClass('show'); 324 } else { 325 this_element.find('.dropdown-menu').addClass('show'); 326 } 327 328 }); 329 330 331 }); 332 333 //Pop up modal stop video player when the popup is close 334 $('.modal').on('hidden.bs.modal', function () { 335 $(".modal iframe").attr("src", $(".modal iframe").attr("src")); 336 }); 337 338 //equal div height 339 $('.grid-item .post-content, .testimonial-carousel.text .testimonial-item').matchHeight(); 340 341 //Replace bootstrap toggle menu to hover menu 342 $(window).on("load resize", function() { 343 $('.navbar-collapse .dropdown-toggle').removeAttr('data-toggle'); 344 }); 345 346 //Add header class when scrolled 347 $(window).scroll(function(){ 348 if ($(this).scrollTop() > 50) { 349 $('#masthead').addClass('scrolled'); 350 } else { 351 $('#masthead').removeClass('scrolled'); 352 } 353 }); 354 355 /** Homepage - Ajax **/ 356 //Product Carousel
357 $(".cat-list .cat-link").click(function(){ 358 $(".cat-list .cat-link").removeClass('active'); 359 $(this).addClass('active'); 360 $('.ajax-filter').fadeTo( "fast", 0.33 ); 361 362 $.ajax({ 363 type: 'POST', 364 url: ajaxurl, 365 dataType: 'html', 366 data: { 367 action: 'filter_products', 368 category: $(this).data('slug'), 369 }, 370 371 success: function(res) { 372 $('.ajax-filter').html(res); 373 $('.ajax-filter').fadeTo( "slow", 1 ); 374 375 $('.product-carousel').slick({ 376 dots: false,arrows: true,infinite: true,speed: 1000,slidesToShow: 4,slidesToScroll: 4,autoplay: true, autoplaySpeed: 5000, draggable: false, 377 responsive: [ 378 { 379 breakpoint: 1400, 380 settings: { 381 slidesToShow: 3, 382 slidesToScroll: 3, 383 draggable: true, 384 } 385 }, 386 { 387 breakpoint: 1024, 388 settings: { 389 slidesToShow: 2, 390 slidesToScroll: 2, 391 } 392 }, 393 { 394 breakpoint: 500, 395 settings: { 396 slidesToShow: 1, 397 slidesToScroll: 1, 398 } 399 } 400 ] 401 }); 402 } 403 }); 404 405 }); 406 407 //Testimonial Carousel 408 $(".testimonial-type .nav-link").click(function(){ 409 $(".testimonial-type .nav-link").removeClass('active'); 410 $(this).addClass('active'); 411 $('.ajax-testimonial-carousel').fadeTo( "fast", 0.33 ); 412 413 $.ajax({ 414 type: 'POST', 415 url: ajaxurl, 416 dataType: 'html', 417 data: { 418 action: 'filter_featured_testimonial', 419 meta_key: $(this).data('slug'), 420 }, 421 422 success: function(res) { 423 $('.ajax-testimonial-carousel').html(res); 424 $('.ajax-testimonial-carousel').fadeTo("slow", 1); 425 $(".testimonial-carousel.text").testimonial_carousel_text_function(); 426 $(".testimonial-carousel.videos").testimonial_carousel_video_function(); 427 } 428 }); 429 430 }); 431 /** End of Homepage - Ajax Loop **/ 432 433 /**Archive Testimonials**/ 434 $('#testimonial_filter').on('change', function(){ 435 $(this).submit(); 436 }); 437 438 $('#sidebarCollapse').on('click', function () { 439 $('#sidebar-left').toggleClass('active'); 440 $('.collapse.in').toggleClass('in'); 441 $('a[aria-expanded=true]').attr('aria-expanded', 'false'); 442 }); 443 $('#closeCollapse').on('click', function () { 444 $('#sidebar-left').removeClass('active'); 445 }); 446 447 /**End of Archive Testimonials**/ 448 449 /**Publisher page */ 450 $('.publisher-listing .publisher-item:lt(8)').show(); 451 $('#showLess').hide(); 452 var items = $('.publisher-listing .publisher-item').length; 453 var shown = 8; 454 $('#loadMore').click(function () { 455 $('#showLess').show(); 456 shown = $('.publisher-listing .publisher-item:visible').size()+8; 457 if(shown< items) { 458 $('.publisher-listing .publisher-item:lt('+shown+')').show(500); 459 $('#showLess').hide(); 460 } 461 else { 462 $('.publisher-listing .publisher-item:lt('+items+')').show(500); 463 $('#loadMore').hide(); 464 $('#showLess').show(); 465 } 466 }); 467 $('#showLess').click(function () { 468 $('.publisher-listing .publisher-item').not(':lt(8)').hide(500); 469 $('#loadMore').show(); 470 $('#showLess').hide(); 471 }); 472 /**End of Publisher page */ 473 474 }); //End of $(document).ready 475 476 /** About us page **/ 477 $('.nav-tab .nav-item:first-child a').tab('show'); 478 479 //FAQ toggle 480 $('.faq-item').click(function () { 481 $('.faq-item').not(this).removeClass('active'); 482 $(this).toggleClass('active'); 483 }); 484 485 // store the currently selected tab in the hash value 486 $(".nav-tab a").on("shown.bs.tab", function(e) { 487 var id = $(e.target).attr("href").substr(1); 488 window.location.hash = id; 489 }); 490 491 // on load of the page: switch to the currently selected tab 492 var hash = window.location.hash; 493 $('.nav-tab a[href="' + hash + '"]').tab('show'); 494 495 /** End of About us page **/ 496 497 498}); //End of jQuery(function($) {
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.