PageSourceSearch

https://jesnordby.dk/images/skins/Gotham/js/scripts.070721.js

js jesnordby.dk collected 2026-10-06 13:15:05 UTC 11,145 bytes, 421 lines download raw bytes

1//$(document).ready(function() {
2	
3	var pageBody = $('body');
4    
5
6
7    $('.printwishlist').on('click',function(e) {
8        e.preventDefault();
9        $('article > div.content').printThis();
10    });
11    /* SEARCH */
12	//var searchForm = $('#Search_Form');
13    //searchForm.find('.SearchField_SearchPage').attr('placeholder', searchForm.find('.SearchTitle_SearchPage').text());
14	
15
16    /* GENERAL AND MISC */
17    $('.Heading_Terms_Wrapper, .Heading_Favorites_Wrapper').next('br').remove();
18    $('.Heading_ProductList, .Heading_Profile_Wrapper').next('br').remove();
19    $('.BackgroundColor1_Profile > tbody > tr > td > table').attr('cellspacing','0');
20    $('.BackgroundColor1_Terms').find('table').eq(0).attr('cellspacing','0');
21    $('.Text1_FrontPage, .Text2_FrontPage, .Photo1_Frontpage').nextAll('br').remove();
22    $('.VariantGroup').attr('cellpadding','0').attr('cellspacing','0');
23	$('footer li.menu').append($('header ul.TopMenu_MenuItems').clone());
24	
25    
26    var basketcount = parseFloat($.trim($('.totalproducts').text()));
27    $('.topbar li.basket .count').html(basketcount);
28
29
30    if ($(window).outerWidth() <= 880) { // mobile
31        //var li = $('<li class="mobilebasket"></li>');
32        
33    }
34
35
36    /* FRONTPAGE */
37	if (pageBody.hasClass('webshop-frontpage')) {
38		
39
40    	//$('article').before($('.slider-wrapper').eq(0));
41		/*
42		if ($('.mostviewed-products .product').length > 0) {
43			
44			$('.mostviewed-products').slick({
45				 infinite: true,
46				 slidesToShow: 6,
47				 slidesToScroll: 1,
48				 autoplay: true,
49				 autoplaySpeed: 2000,
50				 responsive: [
51					{
52					  breakpoint: 1000,
53					  settings: {
54						slidesToShow: 4,
55						slidesToScroll: 4,
56						infinite: true,
57					  }
58					},
59					{
60					  breakpoint: 700,
61					  settings: {
62						slidesToShow: 2,
63						slidesToScroll: 2,
64						centerMode: true,
65						variableWidth: false
66					  }
67					}
68				]
69			});
70			
71			$('.mostviewed-header').addClass('active');
72			
73			
74		}
75		
76		if ($('.mostsold-products .product').length > 0) {
77			
78			$('.mostsold-products').slick({
79				 infinite: true,
80				 slidesToShow: 6,
81				 slidesToScroll: 1,
82				 autoplay: true,
83				 autoplaySpeed: 2000,
84				 responsive: [
85					{
86					  breakpoint: 1000,
87					  settings: {
88						slidesToShow: 4,
89						slidesToScroll: 4,
90						infinite: true
91					  }
92					},
93					{
94					  breakpoint: 700,
95					  settings: {
96						slidesToShow: 2,
97						slidesToScroll: 2,
98						centerMode: true,
99						variableWidth: false
100					  }
101					}
102				]
103			});
104			
105			$('.mostsold-header').addClass('active');
106		}
107        */
108	}
109
110    if (pageBody.hasClass('webshop-favorites')) {
111        $('img[src*="btnWishlistRemove.png"]').replaceWith('×');
112    }
113	
114	
115	/* BREADCRUMB */
116	/*
117	if ($('span.SubCats_BreadCrumb a, div.breadcrumb a').length > 0) {
118		var breadcrumb = $('span.SubCats_BreadCrumb, div.breadcrumb');
119		$('nav.productmenu').after($('<div class="breadcrumb-container"></div>').append(breadcrumb.addClass('active')));
120		pageBody.addClass('breadcrumb');
121	}
122	*/
123	
124	
125	/* PRODUCTLIST */
126	if (pageBody.hasClass('webshop-productlist')) {
127		
128		
129		
130		var categoryDescription = $.trim($('.category-description .CmsPageStyle').text());
131		if (categoryDescription !== "") {
132			$('.category-description').show();
133		}
134		
135		
136		
137		var noProducts = $('span.no-procucts-found-on-empty-list');
138		if (noProducts.length > 0) {
139			$('ul.ProductList_Custom_UL').before(noProducts).remove();
140			$('div.sort-container').remove();
141		}
142				
143		
144				
145	}
146	
147	
148	
149	
150	
151
152    /* CHECKOUT */
153	if (pageBody.hasClass('webshop-checkout')) {
154		
155		var giftcardInput = $('#payment-giftcertificateinfo > p').text();
156		$('#checkout-giftcertificate-cardnumber').attr('placeholder',giftcardInput);
157		var cardNumberInput = $('label[for="txtCardNumber"]').text();
158		$('#txtCardNumber').attr('placeholder',cardNumberInput);
159		var carcCvcInput = $('label[for="txtCardCvv"]').text();
160		$('#txtCardCvv').attr('placeholder',carcCvcInput);
161		
162		$('label.showfield-all').each(function() {
163			var text = $(this).text();
164			$(this).find('input,textarea').attr('placeholder',text);
165			$(this).contents().filter(function () {
166				 return this.nodeType === 3; 
167			}).remove();
168		});
169		
170		$('label[for="checkout_use_alternative_delivery_address"]').closest('div.checkout-row').addClass('altdev');
171		
172		
173	}
174	
175	
176	/* RELATED PRODUCTS */
177	if ($('ul.Related_Custom_UL li').length > 0) {
178		$('.related').addClass('active');
179	}
180	
181	if ($('ul.CustomersAlsoBought_Custom_UL li').length > 0) {
182		$('.alsobought').addClass('active');
183	}
184
185    /* PRODUCTCARD */
186	if (pageBody.hasClass('webshop-productinfo')) {
187		
188		var productId = $.trim($('.product-number > span').text());
189		if (productId !== "") {
190			$('.product-number').addClass('active');
191		}
192		
193		
194		/* SPECS */
195        var hasspecs = false;
196		$('#specs > li').each(function() {
197			var text = $.trim($(this).find("div").eq(1).text());
198			if (text !== "") {
199				hasspecs = true;
200			}
201            else {
202                $(this).remove();
203            }
204		});
205		if (hasspecs) {
206			$('#specs').show();
207		}
208		
209		/* DETAILS */
210		$('ul.details > li').each(function() {
211			var text = $.trim($(this).find('span').text());
212			if (text !== "") {
213				$(this).addClass('active');
214			}
215		});
216		if ($('ul.details > li.active').length > 0) {
217			$('ul.details').addClass('active');
218			$('ul.details > li.active').last().addClass('last');
219		}
220		
221		
222		if ($('div.StockEmailNotificationWrapper').length > 0) {
223			$('.productcard ul.details').after($('div.StockEmailNotificationWrapper'));
224		}
225		
226	}
227
228
229	/* SMALL BASKET */
230	var basket = $('.basket');
231	basket.on('click',function() { 
232		location.href = ShowBasketUrl;
233	});
234    var creditcardsdiv = basket.find('.creditcards');
235	$('#ProductmenuContainer_DIV').append(creditcardsdiv);
236	
237	
238	/* SHOW BASKET */
239	if (pageBody.hasClass('webshop-showbasket')) {
240		var productsCount = parseInt($.trim(basket.find('.totalproducts').text()));
241		if (productsCount < 1) {
242			pageBody.addClass('basketEmpty');
243		}
244		
245		$('table.showbasket.body').each(function() {
246			if ($(this).find('.amountContainer').find('img').length < 1) {
247				$(this).addClass('noamount');
248			}
249		});
250		
251		
252	}
253	
254	
255	
256	
257
258
259	/* PRODUCTMENU */
260
261    var productmenu = $('#ProductMenu_List');
262    productmenu.prepend($('<li class="menutitle"></li>').append($('.Heading_ProductMenu a')));
263    $('.extralinks > a').each(function() {
264        var a = $(this);
265        productmenu.append($('<li></li>').append(a));
266    });
267
268    productmenu.append($('<li class="menutitle"></li>').append($('.gallerytitle')));
269    $('.gallerylinks > a').each(function() {
270        var a = $(this);
271        productmenu.append($('<li></li>').append(a));
272    });
273
274    productmenu.append($('<li class="menutitle"></li>').append($('<span></span>').append($('.misctitle').text())));
275    $('.misclinks > a').each(function() {
276        var a = $(this);
277        productmenu.append($('<li></li>').append(a));
278    });
279    
280
281
282    // productmenu mobile		
283    $('#btn-menu').on('click', function() {
284        if (!$('.mobileMenu').length) {
285            var mobileMenuUl = productmenu.clone().removeAttr('id').addClass('mobileMenuUl');
286            var mobileMenuInner = $('<div class="mobileMenuInner"></div>').append(mobileMenuUl,creditcardsdiv.clone());
287            var mobileMenuContainer = $('<div class="mobileMenuContainer"></div>').append(mobileMenuInner);
288            var mobileMenu = $('<div class="mobileMenu"></div>').append(mobileMenuContainer);
289
290            $('body').append(mobileMenu);
291
292            var mobileMenuActiveGroup = mobileMenuUl.find('a.Activ_ProductMenu');
293            mobileMenuActiveGroup.parentsUntil('.mobileMenuUl').addClass('open').show();
294            mobileMenuActiveGroup.next('ul.dropdown').show();
295
296            mobileMenuUl.find('li.has-dropdown').each(function() {
297                var li = $(this);
298                var subLiLength = li.children('ul').children('li').length;
299                var toggler = $('<div class="toggler"></div>');
300                if (subLiLength) {
301                    li.addClass('hasSubcat');
302                    li.children('a:not(#ActiveCategory_A)').append(toggler);
303                    toggler.on('click', (function() {
304                        li.children('ul.dropdown').slideToggle();
305                        toggler.closest('li').toggleClass('open');
306                        return false;
307                    }));
308                }
309            });
310
311            openMobileMenu();
312
313            mobileMenu.on('click', (function(e) {
314                if (e.target !== this) {
315                  return;
316                }
317                else {
318                    closeMobileMenu();
319                }
320            }));
321
322        }
323        else {
324            openMobileMenu();
325        }
326
327    });
328
329    function openMobileMenu() {
330        $('.mobileMenu').fadeIn(200, function() {
331            $('.mobileMenuContainer').animate({left: '0'}, 200);
332        });
333    }
334    function closeMobileMenu() {
335        $('.mobileMenuContainer').animate({left: '-400px'}, 200, function() {
336            $('.mobileMenu').fadeOut(200);
337        });
338    }
339
340    
341/*
342	var productMenu = $('#ProductMenu_List');
343	var productMenuMobile = productMenu.clone().attr('id','productMenuMobile');
344	$('#my-menu').append(productMenuMobile.hide());
345	$('#my-menu').mmenu({
346		header: {
347			add:true,
348			update:true,
349			title:$('.Heading_ProductMenu').text()
350		},
351		labels: {
352			fixed: true
353		}
354	});
355	productMenuMobile.show();
356	  
357	var btnMenu = $('<div id="btn-menu"></div>');
358	$('header > section').append(btnMenu);
359	
360	
361	btnMenu.on('click', function() {
362		$('#my-menu').trigger('open');
363	});
364    */
365	
366	var activeGroup = productmenu.find('a.Activ_ProductMenu');
367	activeGroup.next('ul').show();
368	activeGroup.parentsUntil('#ProductMenu_List').show().addClass('open');
369    
370	
371	
372	
373	//transformProductlist();
374	
375//});
376
377
378function transformProductlist() {	
379	
380	$('li .product:not(.transformed)').each(function() {
381		var product = $(this);
382		product.addClass('transformed');
383		
384	});
385	
386}
387
388function filteredListLoaded() {
389    //transformProductlist();
390}
391
392function filteredListLoadedAfterRender() {
393	/*
394	var title = $('aside .product-filter-headertext-container').text();
395	$('aside #ProductFilter-Container').show();
396	if ($('#btn-filter').length < 1) {
397		$('article').prepend($('<div id="btn-filter">' + title + '</div>'));
398		$('#btn-filter').on('click', function() {
399			$('aside').slideToggle();
400		});
401	}
402	*/
403	
404}
405
406function printDiv() 
407{
408
409  var divToPrint=document.getElementById('DivIdToPrint');
410
411  var newWin=window.open('','Print-Window');
412
413  newWin.document.open();
414
415  newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
416
417  newWin.document.close();
418
419  setTimeout(function(){newWin.close();},10);
420
421}

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.