PageSourceSearch

https://www.orangepippin.com/js/scripts.js

js orangepippin.com collected 2026-10-02 03:41:53 UTC 4,906 bytes, 228 lines download raw bytes

1function VarietySearch() {
2
3	$("#varietyac").autocomplete({
4
5		minLength: 2,
6
7		position: { my: "right top", at: "right bottom", collision: "fit" },
8		source: function (request, response) {
9			$.ajax({
10				url: $('#jshomeurl').val() + "ajax.aspx",
11				cache: false,
12				dataType: "json",
13				data: { rq: 2, q: request.term },
14
15				success: function (data) {
16					response($.map(data.varieties, function (item) {
17						return {
18							label: item.fruittypedescr + "  <b>" + item.varietyname + "</b> ",
19							value: item.varietyname,
20							id: "varieties/" + item.varietyurl
21						};
22					}
23					));
24				}
25			});
26
27		},
28
29
30		select: function (event, ui) {
31			if (ui.item) {
32				location.href = $('#jshomeurl').val() + ui.item.id;
33			}
34		}
35
36	})
37
38
39	.data("ui-autocomplete")._renderItem = function (ul, item) {
40			return $("<li>")
41				.data("item.autocomplete", item)
42				.append("<a>" + item.label + "</a>")
43				.appendTo(ul);
44	};
45
46}
47
48function VarietySearchMyAccount() {
49	$("#varietymyaccountac").autocomplete({
50		minLength: 2,
51
52		position: { my: "right top", at: "right bottom", collision: "fit" },
53		source: function (request, response) {
54			$.ajax({
55				url: $('#jshomeurl').val() + "ajax.aspx",
56				cache: false,
57				dataType: "json",
58				data: { rq: 2, q: request.term },
59
60				success: function (data) {
61					response($.map(data.varieties, function (item) {
62						return {
63							label: item.fruittypedescr + "  <b>" + item.varietyname + "</b> ",
64							value: item.varietyname,
65							id: item.varietyid
66
67						};
68					}
69					));
70				}
71			});
72
73		},
74
75
76		select: function (event, ui) {
77			$("#addvarietyid").val(ui.item.id);
78		}
79
80	})
81
82
83	.data("ui-autocomplete")._renderItem = function (ul, item) {
84		return $("<li>")
85			.data("item.autocomplete", item)
86			.append("<a>" + item.label + "</a>")
87			.appendTo(ul);
88		};
89}
90
91function VarietyPollinationSearch() {
92
93// Need to get the name of the ID field we are going to use to store the result. Perhaps as a data asttribute.
94
95	$(".varietypsearch").autocomplete({
96		minLength: 2,
97		position: { my: "right top", at: "right bottom", collision: "fit" },
98		source: function (request, response) {
99			$.ajax({
100				url:  "ajax.aspx",
101				cache: false,
102				dataType: "json",
103				data: {
104					rq: 11,
105					q: request.term
106				},
107
108				success: function (data) {
109					response($.map(data.varieties, function (item) {
110						return {
111							label: item.fruittypedescr + ' - ' + item.varietyname,
112							value: item.varietyname,
113							id: item.cvid
114
115						};
116					}
117					));
118				}
119			});
120
121		},
122
123
124		select: function (event, ui) {
125			$("#cvid" + $(this).attr('data-id')  ).val(ui.item.id);
126
127		}
128
129	})
130}
131
132
133
134function OrchardSearch() {
135	$("#orchardac").autocomplete({
136
137		minLength: 2,
138
139//		position: { my: "right top", at: "right bottom", collision: "fit" },
140		source: function (request, response) {
141			$.ajax({
142				url: $('#jshomeurl').val() + "ajax.aspx",
143				cache: false,
144				dataType: "json",
145				data: { rq: 4, q: request.term },
146
147				success: function (data) {
148					response($.map(data.orchards, function (item) {
149						return {
150							label: item.orchardname + " - " + item.city + ", " + item.statename,
151							value: item.orchardname,
152							id: item.orchardurl
153						};
154					}
155					));
156				}
157			});
158
159		},
160
161
162		select: function (event, ui) {
163			if (ui.item) {
164				location.href = $('#jshomeurl').val() + "orchards/" + ui.item.id;
165			}
166		}
167
168	})
169
170
171	.data("ui-autocomplete")._renderItem = function (ul, item) {
172			return $("<li>")
173				.data("item.autocomplete", item)
174				.append("<a>" + item.label + "</a>")
175				.appendTo(ul);
176	};
177
178}
179
180
181function DownloadUrl(url, callback) {
182	var request = window.ActiveXObject ?
183		new ActiveXObject('Microsoft.XMLHTTP') :
184		new XMLHttpRequest;
185
186	request.onreadystatechange = function () {
187		if (request.readyState === 4) {
188			request.onreadystatechange = doNothing;
189			callback(request.responseText, request.status);
190		}
191	};
192	request.open('GET', url, true);
193	request.send(null);
194}
195
196function ParseXml(str) {
197	if (window.ActiveXObject) {
198		var doc = new ActiveXObject('Microsoft.XMLDOM');
199		doc.loadXML(str);
200		return doc;
201	} else if (window.DOMParser) {
202		return (new DOMParser).parseFromString(str, 'text/xml');
203	}
204}
205
206
207function ActivateReviewsTab() {
208	$('#varietytab li:nth-child(2) a').tab('show');
209}
210
211
212function FClick(aid, rid, sg) {
213	location.href = 'search.aspx?aid=' + aid + '&rid=' + rid + '&sg=' + sg + '&st=' + $(window).scrollTop();
214}
215
216function CopyToClipboard() {
217	$('.copylink').click(function () {
218		var copyText = $(this).attr('href');
219		navigator.clipboard.writeText(copyText);
220
221		const toast = new bootstrap.Toast($('#searchtoast'));
222		toast.show();
223
224		return false;
225	});
226}
227
228function doNothing() { }

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.