PageSourceSearch

https://www.cabourg.fr/wp-content/themes/cabourg/assets/js/functions.js?ver=1715588449

js cabourg.fr collected 2026-10-02 11:20:37 UTC 860 bytes, 47 lines download raw bytes

1/*
2* throttle
3*/
4function throttle( callback, delay ) {
5	var last;
6	var timer;
7	return function () {
8		var context = this;
9		var now = +new Date();
10		var args = arguments;
11		if ( last && now < last + delay ) {
12			clearTimeout( timer );
13			timer = setTimeout( function () {
14				last = now;
15				callback.apply( context, args );
16			}, delay );
17		} else {
18			last = now;
19			callback.apply( context, args );
20		}
21	};
22}
23
24
25/*
26* debounce
27*/
28function debounce( callback, delay ) {
29	var timer;
30	return function () {
31		var args = arguments;
32		var context = this;
33		clearTimeout( timer );
34		timer = setTimeout( function () {
35			callback.apply( context, args );
36		}, delay );
37	};
38}
39
40
41/*
42* Detect if is front page
43* based on the 'home' added class on the body
44*/
45function is_front_page() {
46	return document.getElementsByTagName( 'body' )[ 0 ].classList.contains( 'home' );
47}

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.