PageSourceSearch

https://www.discountschoolsupply.com/_ui/responsive/common/js/acc.refinements.js?v=S530

js discountschoolsupply.com collected 2026-09-25 18:18:33 UTC 4,016 bytes, 142 lines download raw bytes

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

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.