PageSourceSearch

https://www.timelesswines.com/ext/jquery/jQuery.gridlist.js

js timelesswines.com collected 2026-09-24 13:20:53 UTC 7,597 bytes, 245 lines download raw bytes

1/**
2 * @Project: clients-timelesswines.com
3 * @Filename: ext/jquery/jQuery.gridlist.js
4 * @Date:   2020-05-17 14:36:12 -07:00 (1589751372)
5 * @Author: Nate Hyson <CLDMV>
6 * @Email:  [email protected]
7 * -----
8 * @Last modified by:   Nate Hyson <CLDMV> ([email protected])
9 * @Last modified time: 2020-06-16 00:25:58 -07:00 (1592292358)
10 * -----
11 * @Copyright: Copyright (c) 2013-2020 Catalyzed Motivation Inc. All rights reserved.
12 */
13
14jQuery(".contentContainer").addClass("clearfix");
15function display(view) {
16	if (view == "list") {
17		// jQuery('.product-grid').attr('class', 'product-list');
18		jQuery(".product-grid").toggleClass("product-list").toggleClass("product-grid");
19
20		jQuery(".product-list > div").each(function (index, element) {
21			html = '<div class="right">';
22			// html += '  <div class="cart">' + $(element).find('.cart').html() + '</div>';
23			// html += '  <div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
24			// html += '  <div class="compare">' + $(element).find('.compare').html() + '</div>';
25			html += "</div>";
26
27			html += '<div class="left">';
28
29			var number = jQuery(element).find(".number").html();
30
31			if (number != null) {
32				html += '<div class="number">' + number + "</div>";
33			}
34
35			var fsg = "";
36			var image = jQuery(element).find(".image").html();
37
38			if (image != null) {
39				fsg += image;
40			}
41			if (jQuery(element).find(".freeshippingground").length > 0) {
42				fsg += '<div class="freeshippingground"></div>';
43			}
44			if (jQuery(element).find(".freeshippinggroundFiller").length > 0) {
45				fsg += '<div class="freeshippinggroundFiller"></div>';
46			}
47
48			if (fsg != "") {
49				html += '<div class="image">' + fsg + "</div>";
50			}
51
52			html += '  <div class="name">' + jQuery(element).find(".name").html() + "</div>";
53
54			var rating = jQuery(element).find(".rating").html();
55
56			if (rating != null) {
57				html += '<div class="rating">' + rating + "</div>";
58			}
59			var winerating = jQuery(element).find(".wineratings").html();
60
61			if (winerating != null) {
62				html += '<div class="wineratings">' + winerating + "</div>";
63			}
64
65			var price = jQuery(element).find(".price").html();
66
67			if (price != null) {
68				html += '<div class="price">' + price + "</div>";
69			}
70
71			html += '  <div class="description">' + jQuery(element).find(".description").html() + "</div>";
72
73			html += "</div>";
74
75			jQuery(element).html(html).attr("style", "");
76		});
77
78		jQuery(".display").html(
79			"<b>" + window.text_display + "</b> " + window.text_list + " <b>/</b>
79 <a onclick=\"display('grid');\">" + window.text_grid + "</a>"
80		);
81
82		jQuery.totalStorage("display", "list");
83	} else {
84		// jQuery('.product-list').attr('class', 'product-grid');
85		jQuery(".product-list").toggleClass("product-grid").toggleClass("product-list");
86		var row = 0;
87		jQuery(".product-grid > div").each(function (index, element) {
88			if ((index + 1) % 3 == 1) {
89				row++;
90			}
91			jQuery(this)
92				.addClass("row-" + row)
93				.attr("data-row", row);
94			html = "";
95
96			var number = jQuery(element).find(".number").html();
97
98			if (number != null) {
99				html += '<div class="number">' + number + "</div>";
100			}
101
102			var image = jQuery(element).find(".image").html();
103
104			if (image != null) {
105				html += '<div class="image">' + image + "</div>";
106			}
107
108			html += '<div class="name nm">' + jQuery(element).find(".name").html() + "</div>";
109
110			if (jQuery(element).find(".freeshippingground, .image .freeshippingground").length > 0) {
111				html += '<div class="freeshippingground"></div>';
112			}
113			if (jQuery(element).find(".freeshippinggroundFiller, .image .freeshippinggroundFiller").length > 0) {
114				html += '<div class="freeshippinggroundFiller"></div>';
115			}
116
117			html += '<div class="description">' + jQuery(element).find(".description").html() + "</div>";
118
119			var price = jQuery(element).find(".price").html();
120
121			if (price != null) {
122				html += '<div class="price">' + price + "</div>";
123			}
124
125			var rating = jQuery(element).find(".rating").html();
126
127			if (rating != null) {
128				html += '<div class="rating">' + rating + "</div>";
129			}
130			var winerating = jQuery(element).find(".wineratings").html();
131
132			if (winerating != null) {
133				html += '<div class="wineratings">' + winerating + "</div>";
134			}
135
136			// html += '<div class="cart">' + $(element).find('.cart').html() + '</div>';
137			// html += '<div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
138			// html += '<div class="compare">' + $(element).find('.compare').html() + '</div>';
139
140			jQuery(element).html(html);
141			jQuery(element).find(".image .freeshippingground, .image .freeshippinggroundFiller").remove();
142		});
143
144		jQuery('.product-grid > div[class*="row-"]').each(function () {
145			if (jQuery(this).attr("data-row")) {
146				var maxheight = 0;
147				var namemaxheight = 0;
148				var hasfgs = 0;
149				// remove fillers if need be
150				jQuery(this)
151					.parent()
152					.find(".row-" + jQuery(this).attr("data-row"))
153					.each(function () {
154						jQuery(this)
155							.find(".freeshippingground")
156							.each(function () {
157								hasfgs++;
158							});
159					});
160				jQuery(this)
161					.parent()
162					.find(".row-" + jQuery(this).attr("data-row"))
163					.each(function () {
164						if (hasfgs == 0) {
165							jQuery(this).find(".freeshippinggroundFiller").hide();
166						}
167					});
168
169				// max name height check
170				// jQuery(this).parent().find('.row-'+jQuery(this).attr('data-row')).each(function(){
171				// jQuery(this).find('.name').each(function(){
172				// if (jQuery(this).outerHeight() > namemaxheight){
173				// namemaxheight = jQuery(this).outerHeight();
174				// }
175				// });
176				// });
177				// jQuery(this).parent().find('.row-'+jQuery(this).attr('data-row')).each(function(){
178				// jQuery(this).find('.name').css('height',namemaxheight+'px').css('min-height',namemaxheight+'px');
179				// });
180
181				// max height check
182				/* jQuery(this).parent().find('.row-'+jQuery(this).attr('data-row')).each(function(){
183				  // var lheight = 0;
184				  // $(this).children('div:visible').each(function(){
185					// lheight = lheight + $(this).outerHeight(true);
186					// $(this).attr('data-height',$(this).outerHeight(true));
187				  // });
188				  var lheight = jQuery(this).innerHeight();
189				  if (lheight > maxheight){
190					// maxheight = lheight;
191					maxheight = lheight;
192				  }
193				});
194				jQuery(this).parent().find('.row-'+jQuery(this).attr('data-row')).each(function(){
195				  jQuery(this).removeAttr('data-row').attr('data-innerHeight',jQuery(this).innerHeight()).css('height',maxheight+'px').css('min-height',maxheight+'px');
196				}); */
197			}
198		});
199
200		jQuery(".display").html(
201			"<b>" + window.text_display + "</b>
201 <a onclick=\"display('list');\">" + window.text_list + "</a> <b>/</b> " + window.text_grid + ""
202		);
203
204		jQuery.totalStorage("display", "grid");
205		responsiveSameHeight();
206	}
207	changeFireGrid();
208}
209
210function changeFireGrid() {
211	// responsiveSameHeight();
212	jQuery(".tooltipster").each(function () {
213		var title = jQuery(this).attr("data-title");
214		jQuery(this).attr("title", title);
215	});
216	jQuery(".tooltipster").tooltipster({
217		theme: "tooltipster-shadow-tw"
218	});
219}
220
221function responsiveSameHeight() {
222	jQuery(".nm").sameheight();
223	jQuery(".pm").sameheight();
224	if (jQuery(window).width() > 480) {
225		jQuery(".product-grid").find(".dm").sameheight();
226	}
227}
228view = jQuery.totalStorage("display");
229
230jQuery(window).resize(function () {
231	responsiveSameHeight();
232});
233
234jQuery(document).ready(function () {
235	if (!jQuery("body").hasClass("skip-grid-js")) {
236		if (view) {
237			display(view);
238		} else {
239			display("grid");
240		}
241	} else {
242		responsiveSameHeight();
243		changeFireGrid();
244	}
245});

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.