PageSourceSearch

https://noordboek.nl/wp-content/themes/nbsvhlbm-child/assets/js/mm…?ver=9750f27bc8806f3bf35aecdbc2fd55c2

js noordboek.nl collected 2026-10-02 04:04:42 UTC 3,764 bytes, 158 lines download raw bytes

1jQuery(function($){
2	// add a new toggle element after the parent category anchor
3	$( "<div class='woo-cat-toggle'></div>" ).insertAfter( "#secondary .widget_product_categories .product-categories > .cat-item.cat-parent > a" );
4	// when the new toggle element is clicked, add/remove the class that controls visibility of children
5	$( "#secondary .widget_product_categories .product-categories .woo-cat-toggle" ).click(function () {
6		$(this).toggleClass("cat-popped");
7	});
8	// if the parent category is the current category or a parent of an active child, then show the children categories too
9	$('#secondary .widget_product_categories .product-categories > .cat-item.cat-parent').each(function(){
10		if($(this).is('.current-cat, .current-cat-parent')) {
11			$(this).children('.woo-cat-toggle').toggleClass("cat-popped");
12		}
13	});
14});
15
16var timeout;
17
18jQuery(function($)
19{
20	if ($('div.widget_product_categories'))
21	{
22		var url = window.location.href;
23		var qs = url.split('?')[1];
24
25		if (qs && qs.length > 0)
26		{
27			var new_qs = [];
28			var parts = qs.split('&');
29			$.each(parts, function(i, val)
30			{
31				if ((val.indexOf('s=') == -1) && (val.indexOf('post_type') == -1))
32				{
33					new_qs.push(val);
34				}
35			});
36
37			if (new_qs.length > 0)
38			{
39				$('div.widget_product_categories li.cat-item a').each(function(i, el)
40				{
41					var href = $(el).attr('href');
42					$(el).attr('href', href + '?' + new_qs.join('&'));
43				});
44			}
45
46
47		}
48	}
49
50	$('.woocommerce').on('change', 'input.qty', function(){
51
52		if ( timeout !== undefined ) {
53			clearTimeout( timeout );
54		}
55
56		timeout = setTimeout(function() {
57			$("[name='update_cart']").trigger("click");
58		}, 300 ); // 1 second delay, half a second (500) seems comfortable too
59
60	});
61
62	var small = false;
63	if ($(window).width() < 768)
64	{
65		var small = true;
66	}
67
68	$('#secondary div.widget-head a').each(function(i, el)
69	{
70		if (small)
71		{
72			$(el).trigger('click');
73		}
74		else
75		{
76			if (!$(el).parent().parent().hasClass('widget_product_categories'))
77			{
78				if (!$(el).parent().parent().hasClass('widget_price_filter') && !$(el).parent().parent().hasClass('widget_text'))
79				{
80					$(el).trigger('click');
81				}
82			}
83		}
84
85	});
86
87	if ($('div.authors'))
88	{
89		$('.authors_search_btn').on('click', function()
90		{
91			var root = $(this).parent().parent().parent().parent();
92			search_authors(root);
93			console.log('hier');
94		});
95
96		$('.authors_reset_btn').on('click', function()
97		{
98			var root = $(this).parent().parent();
99			root.find('input.author_search_text').val('');
100			root.find($('input[type=checkbox]')).prop('checked', false);
101
102			$('.authors_search_btn').trigger('click');
103		});
104	}
105
106	function search_authors(root)
107	{
108		root.find('div.authors_search_overlay').removeClass('d-none');
109		var searchval = root.find('input.author_search_text').val();
110
111		var genres = [];
112		root.find($('div.authors_filter_genre input[type=checkbox]:checked')).each(function(i)
113		{
114			genres[i] = $(this).val();
115        });
116
117		root.find('div.author').each(function(i, el)
118		{
119			var show = true;
120
121			if(searchval.length > 0)
122			{
123				if ($(el).find('.author_title').text().toLowerCase().indexOf(searchval) == -1)
124				{
125					show = false;
126				}
127			}
128
129			if (show && genres.length > 0)
130			{
131				show = false;
132				for (var i = 0; i < genres.length; i++)
133				{
134					if ($(el).hasClass('genre_'+genres[i]))
135					{
136						show = true;
137						break;
138					}
139				}
140			}
141
142			if (show)
143			{
144				$(el).removeClass('d-none');
145			}
146			else
147			{
148				$(el).addClass('d-none');
149			}
150		});
151
152		setTimeout(function()
153		{
154			root.find('div.authors_search_overlay').addClass('d-none');
155		}, 250);
156	}
157
158});

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.