PageSourceSearch

https://www.gammonvillage.com/shop/assets/js/main3.js?ver=20260424

js gammonvillage.com collected 2026-09-24 10:15:44 UTC 7,519 bytes, 263 lines download raw bytes

1document.addEventListener("touchstart", function () {}, false);
2document.onload = () => main3jsloader();
3
4document.addEventListener('click', event => {
5	if (event.target.classList.contains('promo-code')) {
6	  if (document.selection) {
7		var range = document.body.createTextRange();
8		range.moveToElementText(event.target);
9		range.select().createTextRange();
10		document.execCommand("copy");
11	  } else if (window.getSelection) {
12		var range = document.createRange();
13		range.selectNodeContents(event.target);
14		window.getSelection().removeAllRanges();
15		window.getSelection().addRange(range);
16		document.execCommand("copy");
17	  }
18  
19	  alert("Discount code " + event.target.innerHTML + ' copied to clipboard');
20	}
21});
22
23
24main3jsloader();
25
26function main3jsloader() {
27
28	function movePaymentBlock() {
29		if( jQuery("#negative-margin") === null) {
30	//		jQuery('.payment-block').css('margin-top', "30px");
31		} else {
32			var upsheight = jQuery("#negative-margin").height();
33			var lastproductheight = jQuery(".last-product-block").height();
34			var negativemargin = upsheight - lastproductheight - 30;
35
36			if (negativemargin < 0) {
37				jQuery('.payment-block').css('margin-top', "30px");
38			} else {
39				jQuery('.payment-block').css('margin-top', "-" + negativemargin + "px");
40			}
41		}
42	}
43
44
45	jQuery(document).ready(function () {
46
47		var show = function () {
48			if(jQuery('#welcome')) {
49				jQuery('#welcome').modal('show');
50			}
51		};
52
53		var upspopup = function () {
54			if(jQuery('#ups-popup')) {
55				jQuery('#ups-popup').modal('show');
56			}
57		};
58
59		var timerShow = window.setTimeout(show, 200);
60		var timerPopup = window.setTimeout(upspopup, 200);
61
62		var window_width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
63		if (window_width < 900) {
64			jQuery('.payment-block').css('margin-top', "0px");
65		} else {
66			movePaymentBlock();
67		}
68
69		if(jQuery(".view-cart-table input")) {
70			jQuery(".view-cart-table input").focus(function () {
71				jQuery(this).next(".update-cart").fadeIn('fast');
72				jQuery(".payment-options").fadeTo("fast", .2);
73				jQuery(".payment-options a").css("cursor", "not-allowed");
74			}).blur(function () {
75				jQuery(this).next(".update-cart").fadeOut('fast');
76				jQuery(".payment-options").fadeTo("fast", 1);
77				jQuery(".payment-options a").css("cursor", "pointer");
78			})
79		}
80
81		if(jQuery('input, textarea')) {
82			jQuery('input, textarea').each(function() {
83				jQuery(this).data('holder', jQuery(this).attr('placeholder'));
84			});
85
86			jQuery('input, textarea').focusin(function () {
87				jQuery(this).attr('placeholder', '');
88			});
89
90			jQuery('input, textarea').focusout(function () {
91				jQuery(this).attr('placeholder', jQuery(this).data('holder'));
92			});
93		}
94
95		if(jQuery('.same-address input')) {
96			jQuery('.same-address input').click(function () {
97				if (jQuery(this).is(':checked')) {
98					jQuery(".disable-address").fadeTo("fast", .3);
99				} else {
100					jQuery(".disable-address").fadeTo("fast", 1);
101
102				}
103			});
104		}
105
106		if (parseInt(jQuery(".max-width").css("max-width"), 10) <= 600) {
107			jQuery(".totals td").each(function (index, value) {
108				if (jQuery(this).attr('colspan') > 1) {
109					jQuery(this).removeAttr("colspan");
110				}
111			})
112		}
113
114		if(jQuery('.thumbs')) {
115			if (parseInt(jQuery(".max-width").css("max-width"), 10) <= 480) {
116				jQuery('.thumbs').addClass('mobile');
117				jQuery('.thumbs').css("display", "none");
118			} else {
119				jQuery('.thumbs').removeClass('mobile');
120				jQuery('.thumbs').css("display", "block");
121			}
122		}
123
124		jQuery(window).resize(function() {
125			if(jQuery('.thumbs')) {
126				if (parseInt(jQuery(".max-width").css("max-width"), 10) <= 480) {
127					jQuery('.thumbs').addClass('mobile');
128					jQuery('.thumbs').css("display", "none");
129				} else {
130					jQuery('.thumbs').removeClass('mobile');
131					jQuery('.thumbs').css("display", "block");
132				}
133			}
134
135			var window_width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
136			if (window_width < 900) {
137				jQuery('.payment-block').css('margin-top', "0px");
138			} else {
139				movePaymentBlock();
140			}
141		});
142
143		if(jQuery(".reveal-thumbs")) {
144			jQuery(".reveal-thumbs").click(function() {
145				event.preventDefault();
146				jQuery(".thumbs.mobile").slideToggle();
147			});
148		}
149
150		if(jQuery(".email-wishlist-btn")) {
151			jQuery(".email-wishlist-btn").click(function() {
152				event.preventDefault();
153				jQuery(".email-wishlist").slideToggle();
154			});
155		}
156
157		if(jQuery(".close-wishlist-btn")) {
158			jQuery(".close-wishlist-btn").click(function () {
159				event.preventDefault();
160				jQuery(".email-wishlist").slideUp();
161			});
162		}
163
164		jQuery('.fpgridboxes > .category-tile').click(function(){
165			link = jQuery(this).attr('data-link');
166			window.location = link;
167		});
168
169		/*
170		var maxHeight = -1;
171		if(jQuery('.category-content')) {
172			jQuery('.category-content').each(function () {
173				maxHeight = maxHeight > jQuery(this).height() ? maxHeight : jQuery(this).height();
174			});
175
176			jQuery('.category-content').each(function () {
177				jQuery(this).height(maxHeight);
178			});
179
180			var paragraphMaxHeight = 36;
181			jQuery('.category-content p').each(function () {
182				paragraphMaxHeight = paragraphMaxHeight > jQuery(this).height() ? maxHeight : jQuery(this).height();
183				jQuery('.category-content p').each(function () {
184					jQuery(this).height(paragraphMaxHeight);
185				});
186			});
187		}
188		*/
189
190		jQuery(".product-info .grey-highlight").click(function () {
191			jQuery(this).find(".collapse-tab").toggleClass("hide");
192			jQuery(this).find(".expand-tab").toggleClass("show");
193			jQuery(this).next(".product-tab").slideToggle(500, function () {});
194		});
195
196		jQuery(".collapse-tab").click(function () {
197			jQuery(".banner-collapsed").slideToggle(200);
198			jQuery(".banner-tall").slideToggle(200, function () {});
199		});
200
201		jQuery(".search-btn").click(function (e) {
202			e.preventDefault();
203			jQuery(".mobile-search").slideToggle();
204		});
205
206		//Check to see if the window is top if not then display button
207		jQuery(window).scroll(function () {
208			if (jQuery(this).scrollTop() > 200) {
209				jQuery('.scrollToTop').fadeIn();
210			} else {
211				jQuery('.scrollToTop').fadeOut();
212			}
213		});
214
215		//Click event to scroll to top
216		jQuery('.scrollToTop').click(function () {
217			jQuery('html, body').animate({
218				scrollTop: 0
219			}, 800);
220			return false;
221		});
222
223		jQuery(".boutique-section-link").each(function () {
224
225			var txt = jQuery(this).text(),
226				charCount = txt.length,
227				wordCount = txt.replace(/[^\w ]/g, "").split(/\s+/).length;
228			// jQuery( this ).text( "The text had " + charCount + " characters and " + wordCount +" words" );
229
230			if (wordCount > 2) {
231				var html = jQuery(this).html().split(" ");
232
233				html = html.slice(0, 2).join(" ") + "<br>" + html.slice(2).join(" ");
234				jQuery(this).html(html);
235			} else {
236				var html = jQuery(this).html().split(" ");
237				html = html[0] + "<br>" + html.slice(1).join(" ");
238				jQuery(this).html(html);
239			}
240
241
242		});
243
244		function getHeights() {
245			// Get an array of all element heights
246			var elementHeights = jQuery('.boutique .col-sm-4').map(function () {
247				return jQuery(this).height();
248			}).get();
249
250			// Math.max takes a variable number of arguments
251			// `apply` is equivalent to passing each height as an argument
252			var maxHeight = Math.max.apply(null, elementHeights);
253
254			// Set each height to the max height
255			jQuery('.boutique .col-sm-4').height(maxHeight);
256		}
257
258		if(jQuery('.boutique .col-sm-4').length) {
259			// wait xx ms before changing height of page elements
260			setTimeout(getHeights, 100);
261		}
262	});
263}

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.