PageSourceSearch

https://www.airistaflow.com/wp-content/themes/airista_site/library/js/scripts.js?ver=7.0.5

js airistaflow.com collected 2026-10-01 00:34:02 UTC 3,465 bytes, 111 lines download raw bytes

1function updateViewportDimensions() {
2	var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;
3	return { width:x,height:y };
4}
5// setting the viewport width
6var viewport = updateViewportDimensions();
7
8function initialize_mobile_menu(){
9	var hasChildrenItem = document.getElementsByClassName('menu-item-has-children');
10	Array.from(hasChildrenItem).forEach(menuItem=>{
11		console.log(menuItem);
12		menuItem.addEventListener('click', (e)=>{
13			if(!e.target.href){
14				e.preventDefault();
15				console.log(e.target);
16				if(e.target.classList.contains('active')){
17					e.target.classList.remove('active');
18				}else{
19					e.target.classList.add('active');
20				}
21			}
22		})
23	})
24}
25
26initialize_mobile_menu();
27
28document.addEventListener('DOMContentLoaded', function () {
29	var searchForm = document.getElementsByClassName('search-form');
30	if (!searchForm.length) {
31		return;
32	}
33
34	var searchInput = searchForm[0];
35	searchInput.addEventListener('keyup', function (event) {
36		if (event.keyCode === 13 && typeof searchInput.submit === 'function') {
37			searchInput.submit();
38		}
39	});
40  }, false);
41
42document.addEventListener('DOMContentLoaded', function () {
43	var resourcesFilterDiv = document.querySelector('.resources-filter:not(.news-filter)');
44	var resourcesContainer = document.getElementById('resources-container');
45
46	if (!resourcesFilterDiv || !resourcesContainer) return;
47
48	var nonce = resourcesFilterDiv.getAttribute('data-nonce');
49	var term = resourcesFilterDiv.getAttribute('data-term') || 'all';
50	var searchInput = resourcesFilterDiv.querySelector('input[name="search"]');
51
52	if (!searchInput) return;
53
54	function runResourceSearch() {
55		var search = searchInput.value;
56		resourcesContainer.style.opacity = '0.5';
57
58		var data = new FormData();
59		data.append('action', 'airista_filter_resources');
60		data.append('nonce', nonce);
61		data.append('term', term);
62		data.append('search', search);
63
64		fetch(airistaAjax.ajaxurl, { method: 'POST', body: data })
65			.then(function (r) { return r.json(); })
66			.then(function (result) {
67				if (result.success) { resourcesContainer.innerHTML = result.data.html; }
68				resourcesContainer.style.opacity = '1';
69			})
70			.catch(function () {
71				resourcesContainer.style.opacity = '1';
72			});
73	}
74
75	searchInput.addEventListener('keydown', function (event) {
76		if (event.key === 'Enter') {
77			event.preventDefault();
78			runResourceSearch();
79		}
80	});
81});
82
83document.addEventListener('DOMContentLoaded', function () {
84	var newsFilterDiv = document.querySelector('.news-filter');
85	var newsContainer = document.getElementById('news-container');
86
87	if (!newsFilterDiv || !newsContainer) return;
88
89	var nonce = newsFilterDiv.getAttribute('data-nonce');
90	var debounceTimer;
91
92	newsFilterDiv.querySelector('input[name="search"]').addEventListener('input', function () {
93		var search = this.value;
94		clearTimeout(debounceTimer);
95		debounceTimer = setTimeout(function () {
96			newsContainer.style.opacity = '0.5';
97
98			var data = new FormData();
99			data.append('action', 'airista_filter_news');
100			data.append('nonce', nonce);
101			data.append('search', search);
102
103			fetch(airistaAjax.ajaxurl, { method: 'POST', body: data })
104				.then(function (r) { return r.json(); })
105				.then(function (result) {
106					if (result.success) { newsContainer.innerHTML = result.data.html; }
107					newsContainer.style.opacity = '1';
108				});
109		}, 300);
110	});
111});

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.