1/*! 2 * Theme Function 3 * 4 * Js custom theme 5 */ 6 7jQuery(document).ready(function ($) { 8 $("#wpsl-search-btn").on("click", function () { 9 console.log("working.........."); 10 $("li.wpsl-preloader").attr("role", "status"); 11 }); 12}); 13 14(function ($) { 15 "use strict"; 16 17 function headingClass() { 18 $("li.more-heading").each(function () { 19 var headingClass = $(this).hasClass("more-heading"); 20 if (headingClass) { 21 $(".more-heading > a").wrap("<h2></h2>"); 22 } 23 }); 24 } 25 function addAtrBtn() { 26 jQuery(".page-template-templates button.tingle-modal__close").attr( 27 "aria-label", 28 "close lightbox" 29 ); 30 } 31 function addSelected() { 32 jQuery(".elmntl-menu .sub-terms-list li button").on("click", function () { 33 if (jQuery(this).parent().hasClass("filter-active")) { 34 jQuery(this).append('<span class="sr-only">Selected</span>'); 35 } else { 36 jQuery( 37 ".elmntl-menu .sub-terms-list li.filter-active span.sr-only" 38 ).remove(); 39 jQuery(this).append('<span class="sr-only">Selected</span>'); 40 } 41 }); 42 jQuery(".elmntl-menu .main-terms-list li").on("click", function () { 43 jQuery(".elmntl-menu .sub-terms-list li span.sr-only").remove(); 44 jQuery(".elmntl-menu .sub-terms-list li.filter-all span").append( 45 '<span class="sr-only">Selected</span>' 46 ); 47 }); 48 } 49 jQuery(window).load(function () { 50 if (jQuery("#wpsl-wrap").find("#wpsl-stores ul li").length > 0) { 51 var len = jQuery("#wpsl-wrap").find("#wpsl-stores ul li").length; 52 jQuery("#wpsl-search-wrap").after( 53 "<div id='custom-status' status='role' style='display:none;'>" + 54 len + 55 " Results Available</div>" 56 ); 57 } 58 59 jQuery(".ss-list").each(function () { 60 jQuery(this).attr("aria-expanded", "false"); 61 }); 62 setTimeout(function () { 63 $(".ss-option").attr("aria-selected", "false"); 64 }, 1000); 65 $(".ss-option").each(function () { 66 if ($(this).hasClass("ss-option-selected")) { 67 setTimeout(function () { 68 $(".ss-option.ss-option-selected").attr("aria-selected", "true"); 69 }, 2000); 70 } 71 }); 72 73 jQuery("#input_5_5").attr("role", "combobox"); 74 jQuery("#input_5_5").attr("aria-controls", "input_5_5_location"); 75 jQuery("#input_5_5").attr("aria-autocomplete", "list"); 76 var classid5 = $("#input_5_5").data("ssid"); 77 if ( 78 $("." + classid5) 79 .next() 80 .find("ss-content") 81 ) { 82 $("." + classid5 + " .ss-content .ss-list").attr( 83 "id", 84 "input_5_5_location" 85 ); 86 } 87 88 jQuery("#input_5_7").attr("role", "combobox"); 89 jQuery("#input_5_7").attr("aria-controls", "input_5_7_subject"); 90 jQuery("#input_5_7").attr("aria-autocomplete", "list"); 91 var classid7 = $("#input_5_7").data("ssid"); 92 if ( 93 $("." + classid7) 94 .next() 95 .find("ss-content") 96 ) { 97 $("." + classid7 + " .ss-content .ss-list").attr( 98 "id", 99 "input_5_7_subject" 100 ); 101 } 102 103 var classid5 = jQuery("#input_5_5").attr("data-ssid"); 104 setInterval(function () { 105 var count = 1; 106 jQuery(".ss-option").each(function () { 107 jQuery(this).attr("id", "location_" + count); 108 count = count + 1; 109 }); 110 if (jQuery("." + classid5).find(".ss-highlighted")) { 111 var d = jQuery("." + classid5) 112 .find(".ss-option.ss-highlighted") 113 .attr("id"); 114 jQuery("#input_5_5").attr("aria-activedescendant", d); 115 } 116 }, 2000); 117 var classid7 = jQuery("#input_5_7").attr("data-ssid"); 118 setInterval(function () { 119 var count2 = 1; 120 jQuery(".ss-option").each(function () { 121 jQuery(this).attr("id", "subject_" + count2); 122 count2 = count2 + 1; 123 }); 124 if (jQuery("." + classid7).find(".ss-highlighted")) { 125 var d2 = jQuery("." + classid7) 126 .find(".ss-option.ss-highlighted") 127 .attr("id"); 128 jQuery("#input_5_7").attr("aria-activedescendant", d2); 129 } 130 }, 2000); 131 }); 132 133 $(document).ready(function () { 134 headingClass(); 135 addAtrBtn(); 136 addSelected(); 137 138 setInterval(function () { 139 if ($("#wpsl-wrap").hasClass("wpsl-no-results")) { 140 $("#custom-status").text("0 Results Available"); 141 } else { 142 if ($("#wpsl-wrap").find("#wpsl-stores ul li").length > 1) { 143 var len = $("#wpsl-wrap").find("#wpsl-stores ul li").length; 144 $("#custom-status").text(len + " Results Available"); 145 } 146 } 147 }, 100); 148 149 $(document).on("click", ".popup-click", function () { 150 var arialabelData = $(this).siblings().attr("aria-label"); 151 $(".tingle-modal--visible") 152 .find(".order-button-wrapper a") 153 .attr("aria-label", arialabelData); 154 }); 155 }); 156 157 $(document).on("click", ".ss-single-selected", function () { 158 if ($(this).next().hasClass("ss-open")) { 159 $(".ss-open .ss-list").attr("aria-expanded", "true"); 160 } 161 }); 162 $(document).on("change", "#input_5_5", function () { 163 var classid = $("#input_5_5").data("ssid"); 164 if ( 165 $("." + classid) 166 .next() 167 .find("ss-content") 168 ) { 169 $("." + classid + " .ss-content .ss-list").attr("aria-expanded", "true"); 170 171 $("." + classid + " .ss-content .ss-list .ss-option").each(function () { 172 setTimeout(function () { 173 $("." + classid + " .ss-content .ss-list .ss-option").attr( 174 "aria-selected", 175 "false" 176 ); 177 }, 1000); 178 if ($(this).hasClass("ss-option-selected")) { 179 setTimeout(function () { 180 $(".ss-option-selected").attr("aria-selected", "true"); 181 }, 2000); 182 } 183 }); 184 $("." + classid + " .ss-content .ss-list").attr("aria-expanded", "false"); 185 } 186 }); 187 188 $(document).on("change", "#input_5_7", function () { 189 var classid = $("#input_5_7").data("ssid"); 190 if ( 191 $("." + classid) 192 .next() 193 .find("ss-content") 194 ) { 195 $("." + classid + " .ss-content .ss-list").attr("aria-expanded", "true"); 196 197 $("." + classid + " .ss-content .ss-list .ss-option").each(function () { 198 setTimeout(function () { 199 $("." + classid + " .ss-content .ss-list .ss-option").attr( 200 "aria-selected", 201 "false" 202 ); 203 }, 1000); 204 if ($(this).hasClass("ss-option-selected")) { 205 setTimeout(function () { 206 $( 207 "." + 208 classid + 209 " .ss-content .ss-list .ss-option.ss-option-selected" 210 ).attr("aria-selected", "true"); 211 }, 2000); 212 } 213 }); 214 $("." + classid + " .ss-content .ss-list").attr("aria-expanded", "false"); 215 } 216 }); 217})(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.