1ACC.refinements = { 2 3 _autoload: [ 4 ["bindMoreLessToggles", $(".js-facet-form").length != 0], 5 ["bindMoreStoresToggles", $(".js-facet-form").length != 0], 6 ["init", $(".js-facet-form").length != 0], 7 ["bindSearch", $(".js-facet-form").length != 0], 8 ], 9 10 11 coords:{}, 12 storeSearchData:{}, 13 14 15 init:function(){ 16 navigator.geolocation.getCurrentPosition( 17 function (position){ 18 ACC.refinements.coords = position.coords; 19 }, 20 function (error) 21 { 22 console.log("An error occurred... The error code and message are: " + error.code + "/" + error.message); 23 } 24 ); 25 26 }, 27 28 29 bindSearch:function(){ 30 31 $(document).on("submit",'#user_location_form', function(e){ 32 e.preventDefault() 33 var q = $(".js-shop-stores-facet .js-shop-store-search-input").val(); 34 if(q.length>0){ 35 ACC.refinements.getInitStoreData(q); 36 } 37 }) 38 39 40 $(document).on("click",'#findStoresNearMeAjax', function(e){ 41 e.preventDefault() 42 ACC.refinements.getInitStoreData(null,ACC.refinements.coords.latitude,ACC.refinements.coords.longitude); 43 }) 44 45 46 }, 47 48 49 getInitStoreData: function(q,latitude,longitude){ 50 $(".alert").remove(); 51 data ={ 52 "q":"" , 53 "page":"0" 54 } 55 56 if(q != null){ 57 data.q = q; 58 } 59 60 61 if(latitude != null){ 62 data.latitude = latitude; 63 } 64 65 if(longitude != null){ 66 data.longitude = longitude; 67 } 68 69 ACC.refinements.storeSearchData = data; 70 ACC.refinements.getStoreData(); 71 }, 72 73 74 getStoreData: function(){ 75 url= $(".js-facet-form").data("url"); 76 $.ajax({ 77 url: url, 78 data: ACC.refinements.storeSearchData, 79 type: "get", 80 success: function (response){ 81 window.location.reload(); 82 } 83 }); 84 }, 85 86 bindMoreLessToggles: function (){ 87 88 $(document).on("click",".js-shop-stores-facet .js-facet-change-link",function(e){ 89 e.preventDefault(); 90 $(".js-shop-stores-facet .js-facet-container").hide(); 91 $(".js-shop-stores-facet .js-facet-form").show(); 92 }) 93 94 95 $(document).on("change",".js-product-facet .js-facet-checkbox",function(){ 96 $(this).parents("form").submit(); 97 }) 98 99 $(document).on("click",".js-product-facet .js-more-facet-values-link",function(e){ 100 e.preventDefault(); 101 $(this).parents(".js-facet").find(".js-facet-top-values").hide(); 102 $(this).parents(".js-facet").find(".js-facet-list-hidden").show(); 103 104 $(this).parents(".js-facet").find(".js-more-facet-values").hide(); 105 $(this).parents(".js-facet").find(".js-less-facet-values").show(); 106 }) 107 108 $(document).on("click",".js-product-facet .js-less-facet-values-link",function(e){ 109 e.preventDefault(); 110 $(this).parents(".js-facet").find(".js-facet-top-values").show(); 111 $(this).parents(".js-facet").find(".js-facet-list-hidden").hide(); 112 113 $(this).parents(".js-facet").find(".js-more-facet-values").show(); 114 $(this).parents(".js-facet").find(".js-less-facet-values").hide(); 115 }) 116 117 }, 118 119 bindMoreStoresToggles: function () 120 { 121 $(document).on("click",".js-shop-stores-facet .js-more-stores-facet-values",function(e){ 122 e.preventDefault(); 123 $(".js-shop-stores-facet ul.js-facet-list li.hidden").slice(0, 5).removeClass('hidden').first().find('.js-facet-checkbox').focus(); 124 if($(".js-shop-stores-facet ul.js-facet-list li.hidden").length==0){ 125 $(".js-shop-stores-facet .js-more-stores-facet-values").hide() 126 } 127 }) 128 129 } 130};
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.