PageSourceSearch

https://arabicpost.net/wp-content/themes/arabicpost/deco-framework…/assets/js/search.js?ver=1790271363

js arabicpost.net collected 2026-09-24 17:39:21 UTC 2,560 bytes, 94 lines download raw bytes

1var Search_Page = {
2
3	search_input      : function (e) {
4		if (e.keyCode === 13) {
5			let obj = jQuery(this);
6			let search_text = obj.val();
7			if (search_text.length > 2) {
8				obj.val('');
9				jQuery('.preloader__js').addClass('active');
10				Search_Page.url_history(search_text);
11			}
12
13		}
14		// console.log(e.keyCode);
15	},
16	search_button_page: function () {
17		let search_text = jQuery('#js__search-input-page').val();
18		if (search_text.length > 2) {
19			Search_Page.url_history(search_text);
20		}
21
22	},
23	search_input_page : function (e) {
24		if (e.keyCode === 13) {
25			let search_text = jQuery(this).val();
26			if (search_text.length > 2) {
27				Search_Page.url_history(search_text);
28			}
29		}
30	},
31	url_history       : function (search_text) {
32		jQuery('.preloader__js').addClass('active');
33		history.pushState(null, null, '/search/' + search_text + '/');
34		location.href = '/search/' + search_text + '/';
35	},
36	apply_filter      : function () {
37		let period = jQuery('#filter_period option:selected').val();
38		let category = jQuery('#filter_category option:selected').val();
39		let posttype = jQuery('#filter_post_type option:selected').val();
40		let url = location.origin + location.pathname;
41		let url_params = [];
42
43
44		if (period) {
45			url_params.push('period=' + period);
46		}
47
48		if (category) {
49			url_params.push('catarticle=' + category);
50		}
51
52		if (posttype) {
53			url_params.push('typearticle=' + posttype);
54		}
55
56		if (!period && !category && !posttype) {
57			return false;
58		}
59		jQuery('.preloader__js').addClass('active');
60		location.href = url + '?' + url_params.join('&');
61		console.log(url_params);
62		// jQuery('#js__search_ajax_content').data('url');
63		//
64		// jQuery.ajax({
65		// 	type    : 'GET',
66		// 	url     : location.href,
67		// 	dataType: 'html',
68		// 	success : function (html) {
69		// 		let content = jQuery(html).find('#js__search_ajax_content').html();
70		// 		jQuery('#js__search_ajax_content').html(content);
71		// 	}
72		// });
73		return false;
74
75	},
76	init              : function () {
77		jQuery(document).ready(function () {
78			jQuery('.header_search_js').keyup(Search_Page.search_input);
79			jQuery('#js__search-button-page').on('click', Search_Page.search_button_page);
80			jQuery('#js__search-input-page').keyup(Search_Page.search_input_page);
81			jQuery('#js__apply_filter').on('click', Search_Page.apply_filter);
82			jQuery('.pagination a').on('click', function (e) {
83				jQuery('.pagination a').removeClass('active');
84				jQuery(this).addClass('active');
85				jQuery('.preloader__js').addClass('active');
86			});
87		});
88	}
89
90};
91
92
93Search_Page.init();
94

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.