jQuery(function($){var adminbarHeight=$('#wpadminbar').length>0?$('#wpadminbar').height():0;var siteheaderHeight=$('.site-header').length>0?$('.site-header').height():0;$(window).resize(function(){adminbarHeight=$('#wpadminbar').length>0?$('#wpadminbar').height():0;siteheaderHeight=$('.site-header').length>0?$('.site-header').height():0});$('.site-nav-toggler').on('click',function(){if($('body').hasClass('open-site-nav')){$('body').removeClass('open-site-nav').css('overflow','');$('.site-overlay').remove()}else{$('body').addClass('open-site-nav').css('overflow','hidden');$('.site-nav').css('top',adminbarHeight);$('.site-nav').after('
')}});$('body').on('click','.site-nav-closer, .site-overlay',function(e){e.stopPropagation();$('body').removeClass('open-site-nav').css('overflow','');$('.site-overlay').remove()});$('.site-nav li.menu-item-has-children').on('click',function(e){e.stopPropagation();$(this).siblings().children('.sub-menu').slideUp(300);$(this).toggleClass('active').children('.sub-menu').slideToggle(300)});$('.site-nav a').on('click',function(e){e.stopPropagation()});if($('.table-of-contents').length>0){$('.entry-content h2, .entry-content h3').each(function(){$(this).attr('id',convertToSlug($(this).text()));if($(this).is('h2')){$('.table-of-contents .links').append(''+$(this).text()+'')}else if($(this).is('h3')){$('.table-of-contents .links').append(''+$(this).text()+'')}})} $('.table-of-contents a').on('click',function(e){e.preventDefault();var hash=this.hash;location.hash=hash;$('html, body').animate({scrollTop:$(hash).offset().top-adminbarHeight-siteheaderHeight},0)});if(location.hash){var hash=location.hash;if($('.table-of-contents a[href="'+hash+'"]').length>0){$('.tab-nav a').removeClass('active');$('.tab-pane').removeClass('active show');var id=$(hash).parents('.tab-pane').attr('id');$('a[href="#'+id+'"]').trigger('click');setTimeout(function(){$('html, body').animate({scrollTop:$(hash).offset().top-adminbarHeight-siteheaderHeight},300)},2000)}} $('.schema-faq-section').on('click',function(){$('.schema-faq-section.active').find('.schema-faq-answer').slideUp(100);if($(this).hasClass('active')){$('.schema-faq-section.active').removeClass('active');$(this).find('.schema-faq-answer').slideUp(100)}else{$('.schema-faq-section.active').removeClass('active');$(this).addClass('active');$(this).find('.schema-faq-answer').slideDown(100)}});$('.rating').rateYo({starWidth:'20px',fullStar:!0,onSet:function(rating,rateYoInstance){var $this=$(this);var post_id=$this.data('post_id');$.ajax({type:'POST',url:ajax.ajax_url,data:{'action':'k_rating','post_id':post_id,'rating':rating,},success:function(data,textStatus,jqXHR){if(data.status==!0){$this.rateYo('option','readOnly',!0)}else{alert(data.message)}},error:function(jqXHR,textStatus,errorThrown){alert(jqXHR.responseText)}})}});$('.form-comment').on('submit',function(e){e.preventDefault();$form=$(this);$form.find('[type="submit"]').append('');$form.find('.alert').remove();$.ajax({type:'POST',url:ajax.ajax_url,data:$form.serialize(),success:function(data,textStatus,jqXHR){$form.find('[type="submit"]').find('.icon').remove();if(data.status==!0){$form.append('
'+data.message+'
');$form.find('.form-control').val('');if(data.redirect){window.location.href=data.redirect}}else{$form.append('
'+data.message+'
')}},error:function(jqXHR,textStatus,errorThrown){alert(errorThrown)}})});$('.comment .reply').on('click',function(){$('.form-comment').find('input[name="parent"]').remove();$('.form-comment').prepend('');$('.form-comment').find('[name="comment"]').focus();$('html, body').animate({scrollTop:$('.form-comment').offset().top-adminbarHeight-siteheaderHeight},600)});if($('#download-loading').length>0){var timeleft=4;var downloadTimer=setInterval(function(){timeleft-=1;if(timeleft<=0){clearInterval(downloadTimer);$('#download-loading').css('display','none');$('#download').css('display','block')}},1000)}});function convertToSlug(Text){return Text.toLowerCase().replace(/[^\w ]+/g,'').replace(/ +/g,'-')} jQuery(document).ready(function($){$(".btn-animation").click(function(){var $button=$(this);$button.addClass("clicked");setTimeout(function(){$button.removeClass("clicked")},200)})})