"); if(!isGBR) { elt.append(submenu); ul.append(elt); } else { ul.removeClass("search-grid-results") ul.addClass("search-grid-no-results") ul.css("display", "flex"); } currentCategory = item.type; } else if ( item.type == 'product') { var elt = $j(`
"); elt.append(submenu); ul.append(elt); //temporary fix to expand the product search results area for GBR since we turned off the display name search results. if (isGBR){ ul.removeClass("search-grid-results") ul.addClass("search-grid-no-results") ul.css("display", "flex"); } currentCategory = item.type; } } submenuUl = ul.find("."+item.type+" ul"); if (item.type == 'no-results') { ul.removeClass("search-grid-results") ul.addClass("search-grid-no-results") ul.css("display", "flex"); let li = prepareNotFoundMessage(item); li.attr('name', item.name); li.attr('value', item.name); ul.append(li); return false; } li = suggestion < maxResults ? that._renderItem(submenuUl, item ) : $j('
'); li.attr( "aria-label", item.type + " : " + item.type ); if (item.type == 'display_name') { suggestion++; highlightCriteria = item.criteria.split(/\s+/); let div = li.find("div"); div.addClass("search-result-text kibble-typography paragraph kibble-font-size-400 kibble-font-weight-600"); $j.each(highlightCriteria,function(k,term) { div.highlight(term, "body"); }); li.click(() => { $j("#searchCriteria").val(item.data); $j("#searchForm").submit(); }); } else if ( item.type == 'product' ) { li = that._renderItemData(submenuUl, item ); count++; let shouldShow = productsVisible(); if(count == shouldShow + 1) { prepareViewAllButton(li).appendTo('.li-products'); } if (count <= shouldShow) { let thumbnail = prepareThumbnail(item); li.append(thumbnail) } } }); } }); } /** * It provides the quantity of products should display depending the screen size media. * @returns {quantity} of products that should display. */ let productsVisible = () => { if($j(window).innerWidth() >= 650 && $j(window).innerWidth() <= 900) { return 6; } else if($j(window).innerWidth() >= 900 && $j(window).innerWidth() <= 1200){ if ($j(window).innerHeight() <= 950){ return 2; } else { return 4; } } else if($j(window).innerWidth() >= 1200){ if ($j(window).innerHeight() <= 950){ return 4; } else { return 6; } }else { return 0; } } /** * It prepares a element to see the button 'View All' on search component. * @param element to prepare. * @returns { element} with styles and behaviours. */ let prepareViewAllButton = (li) => { li.addClass('ui-autocomplete-category view-all-products-search'); li.html('View All'); li.click(() => { $j("#searchForm").submit(); }); li.css("cursor", "pointer"); return li; } /** * It prepares a thumbnail of a product item. * @param item whit a product information * @returns { element} with image, description, price and * redirect to product detail. */ let prepareThumbnail = (item) => { let divContainer = $j('
', { click: () => location.replace(itemUrl + item.id), class: 'search-product-container' }); let img = $j(' ', { src: item.img, class: 'search-product-image', onerror:`javascript:this.src='/images/ecom/na150x150.gif'` }); let description = $j('
', { html: item.name, class: 'search-product-description' }); let price = $j('
', { html: lang.currencyRange(item.price), class: 'search-product-price' }); divContainer.append(img, description, price); return divContainer; } /** * It prepares a elemanet
with Not found message. * @param item whit message information. * @returns { element} Not found message. */ let prepareNotFoundMessage = (item) => { let li = $j(' ', { class: 'ui-autocomplete-not-results', 'aria-label': item.type + " : " + item.type }); li.on('click', function(event) { event.preventDefault(); $j("#searchForm").submit(); }); li.addClass('ui-autocomplete-not-results'); li.attr('aria-label', item.type + " : " + item.type); let div = $j('', { class: 'ui-autocomplete-not-results' }); let noResultsTitle = $j('', { class: 'ui-autocomplete-not-results-title', html: item.title + ' "' + item.term + '" ' }); let noResultsSubtitle = $j('', { class: 'ui-autocomplete-not-results-subtitle', html: item.subtitle }); div.append(noResultsTitle, noResultsSubtitle); li.append(div) return li; } var searchButtonClicked = function(event) { event.preventDefault(); $j("#searchForm").submit(); } var sortOrder = "&sort=score desc"; var handleMobileBindings = function(mobile) { var searchForm = $j("#searchForm").detach(); if (mobile) { searchForm.appendTo("#mobile-search"); $j("#searchCriteria").removeClass("gSearch"); $j("#searchCriteria").catcomplete('widget').off('mouseenter'); $j("#hierarchyFilter").hide(); $j("#searchButton").on('mousedown', function(e) { searchButtonClicked(e); }); $j("#company_logo a, .m-acc-link").click(function() { event.preventDefault(); }); var loc = ecomController.getLocation(); var filterLocs = ["search","category"]; var showFilter = filterLocs.indexOf(loc)!=-1; $j("#mobileFiltersButton").html("Filters"); } else { searchForm.appendTo("#desktop-search"); $j("#searchCriteria").addClass("gSearch"); $j("#searchCriteria").catcomplete( {width: $j("#searchCriteria").width()}); $j("#hierarchyFilter").show(); $j("#mobileFiltersButton").hide(); $j("#facet-column").show(); $j("#company_logo,#content_container").show(); } ecomController.refreshAdSlots(mobile); } let updatePlaceholder = function() { if ($j(window).innerWidth() > 901 && $j(window).innerWidth() <= 950) { $j("#searchCriteria").attr("placeholder","Search"); } else { $j("#searchCriteria").attr("placeholder","Search"); } } /** * It takes the control over width size of the search bar component {.ui-autocomplete}. * @returns if windows width size is less than 1000 px hidde the search bar component {.ui-autocomplete}. * Otherwise adjust search bar component according to the input search terms {#searchCriteria}. */ $j(window).resize(function() { let position = $j("#kb-search-bar-content").offset(); let width = $j("#kb-search-bar-content").width(); let windows = $j(window).width(); let properties = { left: position.left, top: position.top, width: width }; if (windows <= 1000) { $j(".ui-autocomplete").css({ display: 'none' }) updatePlaceholder(); } }); $j(document).ready(function() { initAutoCompleteRenderer(); $j("#searchForm").submit(function(event) { event.preventDefault(); var c = $j("#searchCriteria"); var hc= $j("#categorySearchCriteria").val(); if (!isEmpty(hc) && hc.length>0) { var url = hdUrl + "?hierarchy="+buildHierarchy(hc)+sortOrder; location.replace(url); return; } c.val(c.val().replace("#","")); if (c.val().length>0) { var hf = $j("#hierarchyFilter"); var hierarchyFilter = hf.val(); var url = hdUrl + "?s="+encodeURIComponent(c.val())+"&hierarchy="+hierarchyFilter+sortOrder+"&pre=true"; location.replace(url); } }); $j("#searchButton").click(searchButtonClicked); var searchDefs = { source: function(request, response) { lastType = null; ecomController.searchSolr(request, response); }, max: isMobile ? 5 : 10, response: function (event, ui) { const suggestions = ui.content.filter(suggestion => suggestion.type == 'display_name'); const products = ui.content.filter(item => item.type == 'product'); let shouldReturnProducts = isMobile ? false : products.length == 0; if (suggestions.length == 0 || shouldReturnProducts) { let noResults = { label: "no-results", data: "no-results", type: "no-results", title: "Search", term: ui.content[0].label, subtitle: "", value: "" }; ui.content.length = 0; ui.content.push(noResults); } else if (suggestions.length == 0) { let noResultsSuggestions = { type: "no-results-suggestions", }; ui.content.push(noResultsSuggestions); } else if (products) { let noResultsProducts = { type: "no-results-products", }; ui.content.push(noResultsProducts); } }, minLength: 1, focus: function(event,ui) { if (ui.item === undefined) { return; } switch (ui.item.type) { case "category_name": event.preventDefault(); $j("#categorySearchCriteria").val(ui.item.data); $j("#searchCriteria").val(ui.item.label); break; default: $j("#categorySearchCriteria").val(''); break; } }, open: function() { let searchBar = document.querySelector('.kb-search-bar').getBoundingClientRect() const dropdownResults = $j('.ui-autocomplete') dropdownResults.css('width',($j('.kb-search-bar').width())); } } $j("#searchCriteria").catcomplete(searchDefs); updatePlaceholder(); handleMobileBindings(checkMobileTablet()); }); //
Contact Us Warren County Veterinary Clinic
4310 RIVERMONT DRIVE
8506 Winchester Road
FRONT ROYAL, Virginia22630
United States
Interactive MapsGoogle /Mapquest /Yahoo!
Article information
Author : Moshe Kshlerin
Last Updated : 2024-07-08T06:08:21+07:00
Views : 6164
Rating : 4.7 / 5 (77 voted)
Reviews : 92% of readers found this page helpful
Author information
Name : Moshe Kshlerin
Birthday : 1994-01-25
Address : Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697
Phone : +2424755286529
Job : District Education Designer
Hobby : Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling
Introduction : My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.