Home Variable not defined in JS file, problems with SSL
Reply: 0

Variable not defined in JS file, problems with SSL

Ed Dias
1#
Ed Dias Published in 2017-12-04 19:10:23Z

I am having a problem in a Wordpress site when I use SSL, there is a .js file on which the Element Inspection reports this error message:

theme.min.js: 1 Uncaught ReferenceError: grove_theme_url is not defined

I believe "grove_theme_url" should be a variable but I do not know how to declare variables in JavaScript.

I can not make the site open with SSL if I do not fix this error.

Can anyone help me solve this? Here is the content of the file "theme.min.js":

(function($){var Core={initialized:false,affix_offset_top:0,initialize:function(){if(this.initialized){return}this.initialized=true;this.build();this.events()},loaded:function(){$(".portfolio-wrapper").imagesLoaded(function(){Core.menu_left_wrapper_content_height(false)})},build:function(){Core.owlCarousel();Core.jplayer();Core.masonry();setTimeout(function(){Core.masonry()},1000);this.mega_menu(true);this.affix_header(true);Core.infinitescroll();window.setTimeout(Core.waypoint,1500);Core.processCategory();Core.progress_bar();Core.tooltip();Core.page_animsition();Core.process_like_button();Core.blog_date_time()},events:function(){Core.windowResize();Core.loadMore();$(".wpb_map_wraper").on("click",Core.onMapClickHandler);Core.windowScroll();Core.goTop();jQuery("a[data-hash]").on("click",function(e){e.preventDefault();Core.anchorsPosition(this);return false});Core.like_button();Core.process_product()},anchorsPosition:function(obj,time){var header=jQuery("header"),headerHeight=header.height(),target=jQuery(obj).attr("href"),$this=jQuery(obj),main=jQuery("main"),header_affix=jQuery("header.affix"),header_sticky=jQuery('header[data-spy="affix"]');if(time==undefined){time=600}if(jQuery(target).length>0){var _scrollTop=jQuery(target).offset().top-jQuery("#wpadminbar").height();if(header_sticky.length>0){_scrollTop=_scrollTop-headerHeight}if(!jQuery("header").hasClass("affix")&&!jQuery("header").hasClass("float")){_scrollTop-=jQuery("header").height()}_scrollTop-=70;if(_scrollTop<main.offset().top){_scrollTop=0}jQuery("html,body").animate({scrollTop:_scrollTop},time,"swing",function(){if(header_affix.length==0&&header_sticky.length>0){Core.anchorsPosition(obj,50)}})}},afterInit_testimonial:function(visibleItems,id){if(visibleItems.length==4){var firstItem=visibleItems[0]+1;jQuery("#testimonials-"+id+" [data-current_item="+firstItem+"]").addClass("testimonials-first-item");var lastItem=visibleItems[3]+1;jQuery("#testimonials-"+id+" [data-current_item="+lastItem+"]").addClass("testimonials-last-item")}jQuery("#testimonials-"+id+" .testimonials-text-mask").html(jQuery("#testimonials-"+id+" .owl-item:first-child .testimonials-text").html());jQuery("#testimonials-"+id+" .owl-item:first-child .testimonials-info").show();jQuery("#testimonials-"+id+" .owl-item:first-child img").css("opacity",1);jQuery("#testimonials-"+id+" .testimonials-item").hover(function(){jQuery("#testimonials-"+id+" img").removeAttr("style");jQuery("#testimonials-"+id+" .testimonials-text-mask").html(jQuery(".testimonials-text",this).html());jQuery("#testimonials-"+id+" .testimonials-info").hide();jQuery("img",this).css("opacity",1);jQuery(".testimonials-info",this).show()})},afterMove_testimonial:function(visibleItems,id){jQuery("#testimonials-"+id+" [data-current_item]").removeClass("testimonials-first-item");jQuery("#testimonials-"+id+" [data-current_item]").removeClass("testimonials-last-item");var currentItem=visibleItems[0]+1;if(visibleItems.length==4){var firstItem=visibleItems[0]+1;jQuery("#testimonials-"+id+" [data-current_item="+firstItem+"]").addClass("testimonials-first-item");var lastItem=visibleItems[3]+1;jQuery("#testimonials-"+id+" [data-current_item="+lastItem+"]").addClass("testimonials-last-item")}jQuery("#testimonials-"+id+" img").removeAttr("style");jQuery("#testimonials-"+id+" .testimonials-text-mask").html(jQuery("#testimonials-"+id+" [data-current_item="+currentItem+"] .testimonials-text").html());jQuery("#testimonials-"+id+" .testimonials-info").hide();jQuery("#testimonials-"+id+" [data-current_item="+currentItem+"] img").css("opacity",1);jQuery("#testimonials-"+id+" [data-current_item="+currentItem+"] .testimonials-info").show()},progress_bar:function(){$(".vc_progress_bar .vc_single_bar").each(function(){var title=$(".vc_label",this).contents().get(0).nodeValue.trim();var value=$(".vc_label_units",this).html();$(this).append("<div class='progress-bar-title'>"+title+"</div>");if(value){$(this).append("<div class='progress-bar-value'>"+value+"</div>")}$(".vc_label",this).html("")})},owlCarousel:function(){$("div.owl-carousel:not(.manual)").each(function(){var slider=$(this);var defaults={items:5,itemsCustom:false,itemsDesktop:[1199,4],itemsDesktopSmall:[980,3],itemsTablet:[768,2],itemsTabletSmall:false,itemsMobile:[479,1],singleItem:false,itemsScaleUp:false,slideSpeed:200,paginationSpeed:800,rewindSpeed:1000,autoPlay:false,stopOnHover:false,navigation:false,navigationText:["<i class='fa fa-angle-left'></i>","<i class='fa fa-angle-right'></i>"],rewindNav:true,scrollPerPage:false,pagination:true,paginationNumbers:false,responsive:true,responsiveRefreshRate:200,responsiveBaseWidth:window,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:false,lazyFollow:true,lazyEffect:"fade",autoHeight:false,jsonPath:false,jsonSuccess:false,dragBeforeAnimFinish:true,mouseDrag:true,touchDrag:true,transitionStyle:false,addClassActive:false,beforeUpdate:false,afterUpdate:false,beforeInit:false,afterInit:false,beforeMove:false,afterMove:false,afterAction:false,startDragging:false,afterLazyLoad:false};var config=$.extend({},defaults,slider.data("plugin-options"));var fucStr_afterInit=config.afterInit;var fuc_afterInit=function(){eval(fucStr_afterInit)};if(config.afterInit!=false){config.afterInit=fuc_afterInit}var fucStr_afterMove=config.afterMove;var fuc_afterMove=function(){eval(fucStr_afterMove)};if(config.afterMove!=false){config.afterMove=fuc_afterMove}slider.owlCarousel(config)})},jplayer:function(){$(".jp-jplayer").each(function(){var $this=$(this),url=$this.data("audio"),title=$this.data("title"),type=url.substr(url.lastIndexOf(".")+1),player="#"+$this.data("player"),audio={};audio[type]=url;audio.title=title;$this.jPlayer({ready:function(){$this.jPlayer("setMedia",audio)},swfPath:"../plugins/jquery.jPlayer",cssSelectorAncestor:player})});Core.processWidthAudioPlayer()},processWidthAudioPlayer:function(){setTimeout(function(){$(".jp-audio").each(function(){var _width=$(this).outerWidth()-$(".jp-play-pause",this).outerWidth()-$(".jp-volume",this).outerWidth()-46;$(".jp-progress",this).width(_width)})},100)},windowResize:function(){$(window).resize(function(){Core.processWidthAudioPlayer();Core.masonry();Core.blog_date_time();Core.mega_menu(false)})},masonry:function(){var $blog_masonry=$(".blog-masonry").imagesLoaded(function(){$blog_masonry.isotope({itemSelector:"article",layoutMode:"masonry",getSortData:{date:"[data-date]"}})});var $blog_masonry_full_width=$(".blog-masonry-full-width").imagesLoaded(function(){$blog_masonry_full_width.isotope({itemSelector:"article",layoutMode:"masonry",getSortData:{date:"[data-date]"}})})},loadMore:function(){$(".blog-load-more").on("click",function(event){event.preventDefault();var $this=$(this).button("loading");var link=$(this).attr("data-href");var contentWrapper=".blog-wrapper";var element="article";if($("body").hasClass("search-results")){contentWrapper=".search-results-wrapper";element=".s-post"}$.get(link,function(data){var content=$(contentWrapper,data).wrapInner("").html();var next_href=$(".blog-load-more",data).attr("data-href");var $newElems=$(element,data).css({opacity:0});$(contentWrapper).append($newElems);$newElems.imagesLoaded(function(){Core.owlCarousel();Core.jplayer();Core.process_like_button();Core.blog_date_time();if($(contentWrapper).hasClass("blog-time-line")){$(element+'[style*="opacity: 0"]',contentWrapper).each(function(i){var article=$(this);setTimeout(function(){article.animate({opacity:1});G5_TimeLine.setGrid()},i*300)})}else{$newElems.animate({opacity:1});if($(contentWrapper).hasClass("blog-masonry")||$(contentWrapper).hasClass("blog-masonry-full-width")){$(contentWrapper).isotope("appended",$newElems);setTimeout(function(){$(contentWrapper).isotope("layout")},400)}}});if(typeof(next_href)=="undefined"){$this.hide()}else{$this.button("reset");$this.attr("data-href",next_href)}})})},mega_menu:function(isInit){if(isInit){jQuery(".main-menu b.caret").click(function(event){event.preventDefault();if($(this).hasClass("expand")){$(this).removeClass("expand");$(this).next(".dropdown-menu").slideUp()}else{$(this).addClass("expand");$(this).next(".dropdown-menu").slideDown()}});jQuery(".navbar-toggle.navbar-toggle-right").click(function(){jQuery(".navbar-toggle.navbar-toggle-left").trigger("click")});jQuery('.main-menu a[data-hash="true"]').click(function(){if(jQuery(window).outerWidth()<=1024){jQuery(".header .navbar-toggle").trigger("click")}})}setTimeout(function(){jQuery(".menu-item",".main-menu").each(function(){if($("body").hasClass("header-left")||$("body").hasClass("header-right")){return}if(jQuery(this).hasClass("mega-menu")){var dropdown_width=0;if(jQuery("> ul.dropdown-menu",this).hasClass("not-auto-size")){dropdown_width=jQuery("> ul.dropdown-menu",this).outerWidth()}else{dropdown_width=jQuery(".yamm-content > .row > .menu-item",this).length*160}if(jQuery(this).hasClass("drop-to-left")&&!jQuery(this).hasClass("yamm-fw")){if(jQuery(this).width()+jQuery(this).position().left<dropdown_width){if(jQuery(".header nav > .container").outerWidth()-jQuery(this).position().left<dropdown_width){jQuery("> ul",this).css("right","auto");jQuery("> ul",this).css("left","15px")}else{var left=jQuery(this).position().left+15;jQuery("> ul",this).css("right","auto");jQuery("> ul",this).css("left",left+"px")}}else{var right=(jQuery(".main-menu").hasClass("navbar-right")?jQuery(".header nav > .container").outerWidth():jQuery(".header nav > .container").width())-jQuery(this).width()-jQuery(this).position().left-25;jQuery("> ul",this).css("left","auto");jQuery("> ul",this).css("right",right+"px")}}if(jQuery(this).hasClass("drop-to-right")&&!jQuery(this).hasClass("yamm-fw")){if(jQuery(".header nav > .container").outerWidth()-jQuery(this).position().left<dropdown_width){if(jQuery(this).width()+jQuery(this).position().left<dropdown_width){jQuery("> ul",this).css("left","auto");jQuery("> ul",this).css("right","15px")}else{var right=(jQuery(".main-menu").hasClass("navbar-right")?jQuery(".header nav > .container").outerWidth():jQuery(".header nav > .container").width())-jQuery(this).width()-jQuery(this).position().left-25;jQuery("> ul",this).css("left","auto");jQuery("> ul",this).css("right",right+"px")}}else{var left=jQuery(this).position().left+15;jQuery("> ul",this).css("right","auto");jQuery("> ul",this).css("left",left+"px")}}}else{jQuery(this).css("position","relative");if(jQuery(this).hasClass("drop-to-right")){jQuery("> ul",this).css("right","auto");jQuery("> ul",this).css("left","15px")}if(!jQuery(this).parent().hasClass("main-menu")){jQuery("> ul",this).css("top","0");if(jQuery(this).hasClass("drop-to-right")){jQuery("> ul",this).css("right","auto");jQuery("> ul",this).css("left","100%")}else{jQuery("> ul",this).css("left","auto");jQuery("> ul",this).css("right","100%")}}}if(!isInit){return}if(jQuery("> .dropdown-menu",this).length){jQuery(this).off("hover").hover(function(){var srollHeight=window.scrollMaxY>0?17:0;if(jQuery(window).outerWidth()>1024-srollHeight){jQuery("> .dropdown-menu",this).stop().fadeIn();jQuery(this).addClass("menu-hover")}},function(){var srollHeight=window.scrollMaxY>0?17:0;if(jQuery(window).outerWidth()>1024-srollHeight){jQuery("> .dropdown-menu",this).stop().fadeOut();jQuery(this).removeClass("menu-hover")}});jQuery("> a > b",this).off("click").click(function(event){if(jQuery("> ul",jQuery(this).parent().parent()).css("display")=="block"){jQuery("> ul",jQuery(this).parent().parent()).stop().fadeOut()}else{jQuery("> ul",jQuery(this).parent().parent()).stop().fadeIn()}event.preventDefault()})}})},500)},menu_left_wrapper_content_height:function(isDone){var header_height=jQuery("header .header > nav").outerHeight();if(jQuery("#wrapper-content").outerHeight()<header_height){jQuery("#wrapper-content").height(header_height)}if(jQuery("header").hasClass("left")){var menu_left_height=jQuery("#wrapper-content").height();jQuery(".header").height(menu_left_height);var menu_bar_height=0;if(jQuery("#wpadminbar").length>0){menu_bar_height=jQuery("#wpadminbar").outerHeight()}if(jQuery(".quick-menu").length>0){menu_bar_height+=jQuery(".quick-menu").outerHeight()+20}var navHeightFix=jQuery(".header").height()-jQuery(".navbar-header").outerHeight()-24-menu_bar_height;jQuery(".navbar-collapse").attr("style","max-height:"+navHeightFix+"px!important");jQuery(".navbar-collapse").perfectScrollbar()}},affix_header:function(isInit){if($("header").hasClass("float")){if(isInit){setTimeout(function(){if((jQuery("#wpadminbar").length>0)){jQuery("header").css("top",(jQuery("header").position().top+jQuery("#wpadminbar").outerHeight())+"px")}},100)}if(jQuery(window).scrollTop()>0){jQuery("header").removeClass("affix-top");jQuery("header").addClass("affix")}else{jQuery("header").removeClass("affix");jQuery("header").addClass("affix-top")}return}if(isInit){jQuery("header").addClass("affix-top");setTimeout(function(){jQuery("header").attr("data-header-offset-top",jQuery("header").offset().top);var data_offset_top=72;if(jQuery(window).outerWidth()<=1024){data_offset_top=116}if(jQuery(window).outerWidth()<=767){data_offset_top=74}if(jQuery("body").hasClass("admin-bar")&&(jQuery(window).outerWidth()>600)){data_offset_top+=32}jQuery("body").attr("data-offset",data_offset_top)},50)}else{var header_pos_top=jQuery(window).scrollTop()-parseInt(jQuery("header").attr("data-header-offset-top"));if((header_pos_top<=0)&&(jQuery("header").hasClass("affix"))){jQuery("header").removeClass("affix");jQuery("header").addClass("affix-top");jQuery("body").css("margin-top","0px")}if((header_pos_top>0)&&(jQuery("header").hasClass("affix-top"))){jQuery("header").removeClass("affix-top");jQuery("header").addClass("affix");if((!jQuery("body").hasClass("header-left")&&jQuery("body").hasClass("header-right"))&&!jQuery("header").hasClass("logo-top")){jQuery("body").css("margin-top","70px")}if((jQuery("#wpadminbar").length>0)&&(jQuery(window).outerWidth()>600)){jQuery("header").css("top",jQuery("#wpadminbar").outerHeight()+"px")}else{jQuery("header").css("top","0")}}}},infinitescroll:function(){$(".paging-infinite-scroll").imagesLoaded(function(){setTimeout(function(){$(".paging-infinite-scroll").infinitescroll({navSelector:"#infinite_scroll_button",nextSelector:"#infinite_scroll_button a",itemSelector:"article",loading:{selector:"#infinite_scroll_loading",img:grove_theme_url+"assets/images/ajax-loader.gif",msgText:"",finishedMsg:""}},function(newElements){var $newElems=$(newElements).css({opacity:0});$newElems.imagesLoaded(function(){Core.owlCarousel();Core.jplayer();Core.process_like_button();Core.blog_date_time();if($(".blog-wrapper").hasClass("blog-time-line")){$('article[style*="opacity: 0"]',".blog-wrapper").each(function(i){var article=$(this);setTimeout(function(){article.animate({opacity:1});G5_TimeLine.setGrid()},i*300)})}else{$newElems.animate({opacity:1});if($(".blog-wrapper").hasClass("blog-masonry")||$(".blog-wrapper").hasClass("blog-masonry-full-width")){$(".blog-wrapper").isotope("appended",$newElems);setTimeout(function(){$(".blog-wrapper").isotope("layout")},400)}}})})},5000)})},waypoint:function(){$(".wpb_animate_when_almost_visible:not(.wpb_start_animation)").waypoint(function(){$(this).addClass("wpb_start_animation")},{offset:"85%"})},processCategory:function(){$("li",".primary-sidebar .widget_nav_menu").each(function(){if($(this).children("ul.sub-menu").length>0){if($(this).hasClass("current-menu-parent")){$(this).prepend('<span class="icon-plus-menu"><i class="icon icon-minus"></i></span>')}else{$(this).prepend('<span class="icon-plus-menu"><i class="icon icon-plus"></i></span>')}}else{$(this).prepend('<span class="icon-plus-menu"><i class="icon icon-right-open-mini icon-plus"></i></span>')}});$(document).on("click",".icon-plus-menu",function(){if($(this).parent().children("ul").is(":hidden")){$(this).parent().children("ul").slideDown(250,"linear");$(this).children("i").removeClass("icon-plus").addClass("icon-minus")}else{$(this).parent().children("ul").slideUp(250,"linear");$(this).children("i").removeClass("icon-minus").addClass("icon-plus")}});$(document).on("click",".icon-plus-category",function(){if($(this).parent().parent().children("ul").is(":hidden")){$(this).parent().parent().children("ul").slideDown(250,"linear");$(this).children("i").removeClass("icon-plus").addClass("icon-minus")}else{$(this).parent().parent().children("ul").slideUp(250,"linear");$(this).children("i").removeClass("icon-minus").addClass("icon-plus")}});$("li",".product-categories").each(function(){if($(this).children("ul.children").length>0){if($(this).hasClass("current-cat")||$(this).hasClass("current-cat-parent")){$(this).prepend('<span class="icon-plus-menu"><i class="icon icon-minus"></i></span>')}else{$(this).prepend('<span class="icon-plus-menu"><i class="icon icon-plus"></i></span>')}}else{$(this).prepend('<span class="icon-plus-menu"><i class="icon icon-right-open-mini icon-plus"></i></span>')}})},onMapMouseleaveHandler:function(event){var that=jQuery(this);that.on("click",Core.onMapClickHandler);that.off("mouseleave",Core.onMapMouseleaveHandler);that.find("iframe").css("pointer-events","none")},onMapClickHandler:function(event){var that=jQuery(this);that.off("click",Core.onMapClickHandler);that.find("iframe").css("pointer-events","auto");that.on("mouseleave",Core.onMapMouseleaveHandler)},tooltip:function(){if(jQuery().tooltip){jQuery('[data-toggle="tooltip"]').tooltip()}},windowScroll:function(){$(window).on("scroll",function(event){if($(window).scrollTop()>$(window).height()/2){$("#go-top").addClass("in")}else{$("#go-top").removeClass("in")}})},goTop:function(){$("#go-top").click(function(){$("html,body").animate({scrollTop:"0px"},800);return false})},page_animsition:function(){$(".animsition").animsition({inClass:"fade-in",outClass:"fade-out",inDuration:1500,outDuration:800,linkElement:'.animsition-link:not([href^=#]):not([target="_blank"]):not([href^=javascript])',loading:true,loadingParentElement:"body",loadingClass:"animsition-loading",unSupportCss:["animation-duration","-webkit-animation-duration","-o-animation-duration"],overlay:false,overlayClass:"animsition-overlay-slide",overlayParentElement:"body"})},process_like_button:function(){var grove_liked=$.cookie("grove_liked");if(typeof(grove_liked)!="undefined"&&grove_liked!=null){var arrLiked=grove_liked.split("|");for(var i=0;i<arrLiked.length;i++){var id=parseInt(arrLiked[i],10);if(isNaN(id)){continue}$('a[data-id="'+id+'"]',".entry-meta-like").addClass("liked")}}},like_button:function(){$(document).on("click",'a[data-like="true"]:not(".liked")',function(event){event.preventDefault();var $this=$(this);var id=$(this).data("id");var grove_liked=$.cookie("grove_liked");if(typeof(grove_liked)!="undefined"&&grove_liked.indexOf("|"+id+"|")>=0){return}$("i",$this).addClass("animated");$.ajax({url:grove_ajax_url,data:{action:"blog_like",id:id},success:function(data){var grove_liked=$.cookie("grove_liked");if(typeof(grove_liked)=="undefined"){grove_liked="|"+id+"|"}else{grove_liked+=id+"|"}$.cookie("grove_liked",grove_liked,{path:"/"});$this.addClass("liked");$("i",$this).removeClass("animated");$("label",$this).text(data)}})})},blog_date_time:function(){$("article",".blog-wrapper").each(function(){var $this=$(this);var _date=$(".entry-date",$this);if(_date.length>0&&_date.is(":visible")){$(".entry-meta-time",$this).fadeIn();$(".entry-meta-date",$this).fadeOut()}else{$(".entry-meta-date",$this).fadeIn();$(".entry-meta-time",$this).fadeOut()}})},process_product:function(){Core.add_cart_quantity();Core.checkout()},add_cart_quantity:function(){$(document).off("click",".quantity .btn-number").on("click",".quantity .btn-number",function(event){event.preventDefault();var type=$(this).data("type");var input=$("input",$(this).parent());var current_value=parseInt(input.val());var max=input.attr("max");if(typeof(max)=="undefined"){max=100}var min=input.attr("min");if(typeof(min)=="undefined"){min=0}if(!isNaN(current_value)){if(type=="minus"){if(current_value>min){input.val(current_value-1).change()}if(parseInt(input.val())==min){$(this).attr("disabled",true)}}if(type=="plus"){if(current_value<max){input.val(current_value+1).change()}if(parseInt(input.val())==max){$(this).attr("disabled",true)}}}else{input.val(0)}});$("input",".quantity").focusin(function(){$(this).data("oldValue",$(this).val())});$("input",".quantity").on("change",function(){var input=$(this);var max=input.attr("max");if(typeof(max)=="undefined"){max=100}var min=input.attr("min");if(typeof(min)=="undefined"){min=0}var current_value=parseInt(input.val());if(current_value>=min){$(".btn-number[data-type='minus']",$(this).parent()).removeAttr("disabled")}else{alert("Sorry, the minimum value was reached");$(this).val($(this).data("oldValue"))}if(current_value<=max){$(".btn-number[data-type='plus']",$(this).parent()).removeAttr("disabled")}else{alert("Sorry, the maximum value was reached");$(this).val($(this).data("oldValue"))}})},checkout:function(){setTimeout(function(){$("form.checkout_coupon").show()},300);$("#accordion").on("show.bs.collapse",function(){$("#accordion .in").collapse("hide")});$('input[name="checkout-method"]').on("change",function(){var checkout_method=$(this).val();if(checkout_method=="guest"){$("#heading-create-account").parent().fadeOut();$("#button_create_account_continue").attr("href","#billing-address")}else{$("#heading-create-account").parent().fadeIn();$("#button_create_account_continue").attr("href","#create-account")}});$('a[data-toggle="collapse"]',".woocommerce-checkout").on("click",function(){var tab=$('a[href="'+$(this).attr("href")+'"]',".panel-heading");var tab_panel=tab.parent().next();setTimeout(function(){if(tab_panel.hasClass("in")){tab.attr("aria-expanded","true")}else{tab.attr("aria-expanded","false")}},400)})}};var G5Plus_Search_Ajax={timeOutSearch:null,htmlTag:{wrapper:".ajax-search-wrapper"},close:function(){jQuery(G5Plus_Search_Ajax.htmlTag.wrapper).removeClass("active");jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).removeClass("fa-times");jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).addClass("fa-search");jQuery('input[type="text"]',G5Plus_Search_Ajax.htmlTag.wrapper).val("");jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).html("");jQuery(".quick-menu").css("position","relative");jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).attr("style","")},open:function(){jQuery(G5Plus_Search_Ajax.htmlTag.wrapper).addClass("active");jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).removeClass("fa-search");jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).addClass("fa-times");jQuery('input[type="text"]',G5Plus_Search_Ajax.htmlTag.wrapper).val("");jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).html("");jQuery('input[type="text"]',G5Plus_Search_Ajax.htmlTag.wrapper).focus();jQuery(".quick-menu").css("position","static");jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).attr("style","right:30px");if(jQuery("header").hasClass("left")&&jQuery("#wpadminbar").length>0){if(jQuery(window).width()>1024){jQuery(G5Plus_Search_Ajax.htmlTag.wrapper).css("top",jQuery("#wpadminbar").outerHeight()+"px")}}},ready:function(){if(typeof(g5plus_disable_search_icon)=="undefined"){jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).click(function(){if(jQuery(G5Plus_Search_Ajax.htmlTag.wrapper).hasClass("active")){G5Plus_Search_Ajax.close()}else{G5Plus_Search_Ajax.open()}})}jQuery('input[type="text"]',G5Plus_Search_Ajax.htmlTag.wrapper).on("keyup",function(event){if(event.altKey||event.ctrlKey||event.shiftKey||event.metaKey){return}var keys=["Control","Alt","Shift"];if(keys.indexOf(event.key)!=-1){return}switch(event.which){case 27:G5Plus_Search_Ajax.close();break;case 38:G5Plus_Search_Ajax.up();break;case 40:G5Plus_Search_Ajax.down();break;case 13:var $item=jQuery("li.selected a",G5Plus_Search_Ajax.htmlTag.wrapper);if($item.length==0){event.preventDefault();return false}G5Plus_Search_Ajax.enter();break;default:clearTimeout(G5Plus_Search_Ajax.timeOutSearch);G5Plus_Search_Ajax.timeOutSearch=setTimeout(G5Plus_Search_Ajax.search,500);break}})},enter:function(){var $item=jQuery("li.selected a",G5Plus_Search_Ajax.htmlTag.wrapper);window.location=$item.attr("href")},up:function(){var $item=jQuery("li.selected",G5Plus_Search_Ajax.htmlTag.wrapper);if(jQuery("li",G5Plus_Search_Ajax.htmlTag.wrapper).length<2){return}var $prev=$item.prev();$item.removeClass("selected");if($prev.length){$prev.addClass("selected")}else{jQuery("li:last",G5Plus_Search_Ajax.htmlTag.wrapper).addClass("selected");$prev=jQuery("li:last",G5Plus_Search_Ajax.htmlTag.wrapper)}if($prev.position().top<jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).scrollTop()){jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).scrollTop($prev.position().top)}else{if($prev.position().top+$prev.outerHeight()>jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).scrollTop()+jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).height()){jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).scrollTop($prev.position().top-jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).height()+$prev.outerHeight())}}},down:function(){var $item=jQuery("li.selected",G5Plus_Search_Ajax.htmlTag.wrapper);if(jQuery("li",G5Plus_Search_Ajax.htmlTag.wrapper).length<2){return}var $next=$item.next();$item.removeClass("selected");if($next.length){$next.addClass("selected")}else{jQuery("li:first",G5Plus_Search_Ajax.htmlTag.wrapper).addClass("selected");$next=jQuery("li:first",G5Plus_Search_Ajax.htmlTag.wrapper)}if($next.position().top<jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).scrollTop()){jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).scrollTop($next.position().top)}else{if($next.position().top+$next.outerHeight()>jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).scrollTop()+jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).height()){jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).scrollTop($next.position().top-jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).height()+$next.outerHeight())}}},search:function(){var keyword=jQuery('input[type="text"]',G5Plus_Search_Ajax.htmlTag.wrapper).val();if(keyword.length<3){jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).html("");return}jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).addClass("fa-spinner fa-spin");jQuery.ajax({type:"POST",data:"action=result_search&keyword="+keyword,url:grove_ajax_url,success:function(data){jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).removeClass("fa-spinner fa-spin");var html="";if(data){html+="<ul>";var items=jQuery.parseJSON(data);if(items.length){jQuery.each(items,function(index){if(index==0){html+='<li class="selected">'}else{html+="<li>"}if(this["title"]==null||this["title"]==""){html+='<a href="'+this["guid"]+'">'+this["date"]+"</a>"}else{html+='<a href="'+this["guid"]+'">'+this["title"]+"</a>";html+="<span>"+this["date"]+" </span>"}html+="</li>"})}else{html+="<li>"+grove_search_not_found+"</li>"}html+="</ul>"}jQuery(".ajax-search-result",G5Plus_Search_Ajax.htmlTag.wrapper).html(html)},error:function(data){jQuery(".ajax-search-icon",G5Plus_Search_Ajax.htmlTag.wrapper).removeClass("fa-spinner fa-spin")}})}};$(document).ready(function(){Core.initialize();$(window).scroll(function(){Core.affix_header(false)});Core.loaded();G5Plus_Search_Ajax.ready();jQuery(document).on("click",function(e){if(jQuery(e.target).closest(".ajax-search-wrapper").length===0){G5Plus_Search_Ajax.close()}});jQuery(".ajax-search-wrapper").submit(function(event){event.preventDefault()})})})(jQuery);
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.418295 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO