PageSourceSearch

https://thepolisproject.com/wp-content/themes/PolisProject/js/custom.js?ver=1790936858

js thepolisproject.com collected 2026-10-02 10:28:20 UTC 10,608 bytes, 382 lines download raw bytes

1jQuery(document).ready(function($) {
2	
3	 jQuery('.wc_search_close').hide();
4    jQuery('.wc_search_section').hide();
5
6    jQuery('.wc_search_open .elementor-icon').click(function () {
7        jQuery('.wc_search_section').slideDown(300);
8        jQuery('.wc_search_open').hide();
9        jQuery('.wc_search_close').show();
10    });
11
12    jQuery('.wc_search_close .elementor-icon').click(function () {
13        jQuery('.wc_search_section').slideUp(300);
14        jQuery('.wc_search_close').hide();
15        jQuery('.wc_search_open').show();
16    });
17	
18	
19    /*Load more ajax for listen CPT */
20
21	$('button.load-more-btn').on('click', function() {	 
22		var page = $("button.load-more-btn").data('page');
23		var newPage = page + 1;
24		$('button.load-more-btn').hide();	
25		$('.no-posts-found').remove();	
26		$( "button.load-posts-btn" ).show();
27		$.ajax({
28			url: load.ajaxurl,
29			type: 'post',
30			data: {
31				page: page,
32				action: "load"
33			},
34			error: function(data) {
35				console.log(data);
36			},
37			success:function( data ) {	
38				if (data == 0) {
39					$('button.load-more-btn').hide();
40					$( "button.load-posts-btn" ).hide();	
41					$('button.load-more-btn').after('<p class="no-posts-found">No more posts found.</p>');
42				}
43				else
44				{
45					$("button.load-more-btn").data('page', newPage);
46					$('.home-post').append(data);
47					$( "button.load-posts-btn" ).hide();	
48					$('button.load-more-btn').show();	
49				}
50			},
51		});
52	});
53	
54	$(document).on("click","a.listen-podcast",function(e) {
55		e.preventDefault();
56		var ifr = $(this).parent().parent().parent().find('iframe').clone();	
57		$('.call-bak .modal-content').html(ifr);	
58		$('.modal').toggleClass('is-visible');
59	});
60	
61	
62	/*Load more post for read CPT*/
63	
64	$('button.read-more-btn').on('click', function() {
65		var page = $("button.read-more-btn").data('page');
66		var newPage = page + 1;
67		$('button.read-more-btn').hide();	
68		$('.no-posts-found').remove();	
69		$( "button.read-posts-btn" ).show();
70		$.ajax({
71			url: load.ajaxurl,
72			type: 'post',
73			data: {
74				page: page,
75				action: "read"
76			},
77			error: function(data) {
78				console.log(data);
79			},
80			success:function( data ) {	
81				if (data == 0) {
82					$('button.read-more-btn').hide();
83					$( "button.read-posts-btn" ).hide();	
84					$('button.read-more-btn').after('<p class="no-posts-found">No more posts found.</p>');
85				}
86				else
87				{
88					$("button.read-more-btn").data('page', newPage);
89					$('.home-post').append(data);
90					$( "button.read-posts-btn" ).hide();	
91					$('button.read-more-btn').show();	
92				}
93			},
94		});
95
96	});
97
98    /*Load more ajax for watch CPT */
99
100	$('button.watch-more-btn').on('click', function() {	 
101		var page = $("button.watch-more-btn").data('page');
102		var newPage = page + 1;
103		$('button.watch-more-btn').hide();	
104		$('.no-posts-found').remove();	
105		$( "button.watch-posts-btn" ).show();
106		$.ajax({
107			url: load.ajaxurl,
108			type: 'post',
109			data: {
110				page: page,
111				action: "watch"
112			},
113			error: function(data) {
114				console.log(data);
115			},
116			success:function( data ) {	
117				if (data == 0) {
118					$('button.watch-more-btn').hide();
119					$( "button.watch-posts-btn" ).hide();	
120					$('button.watch-more-btn').after('<p class="no-posts-found">No more posts found.</p>');
121				}
122				else
123				{
124					$("button.watch-more-btn").data('page', newPage);
125					$('.home-post').append(data);
126					$( "button.watch-posts-btn" ).hide();	
127					$('button.watch-more-btn').show();	
128				}
129			},
130		});
131	});
132
133	/*Load more post for research CPT*/
134	
135	$('button.research-more-btn').on('click', function() {
136		var page = $("button.research-more-btn").data('page');
137		var newPage = page + 1;
138		$('button.research-more-btn').hide();	
139		$('.no-posts-found').remove();	
140		$( "button.research-posts-btn" ).show();
141		$.ajax({
142			url: load.ajaxurl,
143			type: 'post',
144			data: {
145				page: page,
146				action: "research"
147			},
148			error: function(data) {
149				console.log(data);
150			},
151			success:function( data ) {	
152				if (data == 0) {
153					$('button.research-more-btn').hide();
154					$( "button.research-posts-btn" ).hide();	
155					$('button.research-more-btn').after('<p class="no-posts-found">No more posts found.</p>');
156				}
157				else
158				{
159					$("button.research-more-btn").data('page', newPage);
160					$('.home-post').append(data);
161					$( "button.research-posts-btn" ).hide();	
162					$('button.research-more-btn').show();	
163				}
164			},
165		});
166	});
167	
168
169	$("#article-ls-date input,#article-date input").on("change", function() {
170		this.setAttribute(
171			"data-date", 
172			moment(this.value, "YYYY-MM-DD")
173			.format( this.getAttribute("data-date-format"))
174			);
175	}).trigger("change");
176
177
178	$('div#article-media select#media').change(function() { 
179		var media = $(this).val();
180		var topic = $('select#topic').val();
181		var date =  $('input[type="date"]').attr('data-date'); 
182		$.ajax({
183			url: load.ajaxurl,
184			type: 'post',
185			data: {
186				media:media,
187				topic:topic,
188				date:date,
189				action: "article"
190			},
191			success:function( response ) {	
192				$(".article-results div").remove();
193				$(".show-rs-for").show();
194				$("span.s-rs-1").html(media);
195				$("span.s-rs-2").html(topic);
196				if(response) {
197					for(var i = 0 ;  i <= 2 ; i++) {
198						if(i <= 1){
199							var html = '<div class="items">'+
200							'<span class="article-type">'+response[i].type+':</span>'+
201							'<a href="'+response[i].title_link+'">'+response[i].title+'</a>'+
202							'<div class="publish-date">'+response[i].publish_date+':</div>'+
203							'</div>';
204							$(".article-results").append(html);
205						}
206						if(i == 2)
207						{
208							$(".load-rs").remove();
209							$(".article-results").after('<div class="load-rs"><a href="http://13.234.186.203/all-articles/'+response[2].link+'" target="_blank">View All</a></div>');
210						}
211					};
212				} 
213				else{
214					$(".article-results > div").remove();
215					$(".load-rs").remove();
216					$(".show-rs-for").hide();
217					$(".article-results").append('<div class="not-found-rs">
217No Results Found.</div>');
218				}
219			},
220
221		});
222	});
223
224
225	$('div#article-topic select#topic').change(function() { 
226		var topic = $(this).val();
227		var media = $('select#media').val();
228		var date =  $('input[type="date"]').attr('data-date');
229		$.ajax({
230			url: load.ajaxurl,
231			type: 'post',
232			data: {
233				media:media,
234				topic:topic,
235				date:date,
236				action: "article"
237			},
238			success:function( response ) {	
239				$(".article-results div").remove();
240				$(".show-rs-for").show();
241				$("span.s-rs-1").html(media);
242				$("span.s-rs-2").html(topic);
243				if(response) {
244					for(var i = 0 ;  i <= 2 ; i++) {
245						if(i <= 1){
246							var html = '<div class="items">'+
247							'<span class="article-type">'+response[i].type+':</span>'+
248							'<a href="'+response[i].title_link+'">'+response[i].title+'</a>'+
249							'<div class="publish-date">'+response[i].publish_date+':</div>'+
250							'</div>';
251							$(".article-results").append(html);
252						}
253						if(i == 2)
254						{
255							$(".load-rs").remove();
256							$(".article-results").after('<div class="load-rs"><a href="https://www.thepolisproject.com/all-articles/'+response[2].link+'" target="_blank">View All</a></div>');
257						}
258					};
259				} 
260				else{
261					$(".article-results > div").remove();
262					$(".load-rs").remove();
263					$(".show-rs-for").hide();
264					$(".article-results").append('<div class="not-found-rs">
264No Results Found.</div>');
265				}
266			},
267
268		});
269	});
270
271	var url = new URL(document.location);
272  // Get query parameters object
273	var params = url.searchParams;
274  // Get value of paper
275	var topic_params = params.get("topic");
276	var media_params = params.get("media");
277	var date_params =  params.get("date");
278	$("span.s-rs-1").html(topic_params);
279	$("span.s-rs-2").html(media_params);
280	if(date_params){
281		$(".article-filter input").attr("value",date_params);
282		$(".article-filter input").attr("data-date",moment(date_params, "YYYY-MM-DD").format('DD-MM-YYYY'));
283	}
284	if(topic_params){
285		$(".article-filter select option[value=" + topic_params + "]").prop("selected",true);
286	}
287	if(media_params){
288		$(".article-filter select option[value=" + media_params + "]").prop("selected",true);
289	}
290	$(".show-rs-for.show").show();
291	if ($(".not-found-rs").hasClass("sh")) {
292		$(".show-rs-for").hide();
293	}
294
295});
296jQuery(document).on("click", ".tabs-nav li", function() {
297	var tab = jQuery(this).data("tab");
298
299	jQuery(this).addClass("active").siblings().removeClass("active");
300	jQuery("#" + tab).show().siblings(".tab-content").hide();
301});
302
303
304/*
305$('.article-ls-btn .ls-submit').submit(function() { 
306	var topic = $('select#topic').val();
307	var media = $('select#media').val();
308	var date =  $('input[type="date"]').attr('data-date');
309		$.ajax({
310				url: load.ajaxurl,
311				type: 'post',
312				data: {
313					media:media,
314					topic:topic,
315					date:date,
316				action: "article"
317				},
318				success:function( response ) {	
319					$(".article-results div").remove();
320					
321					if(response) {
322						for(var i = 0 ;  i <= 2 ; i++) {
323								if(i <= 1){
324									var html = '<div class="">'+response[i].title+'</div>';
325							  		$(".article-results").append(html);
326								}
327								if(i == 2)
328								 {
329									 $(".load-rs").remove();
330									 $(".article-results").after('<div class="load-rs"><a href="http://13.234.186.203/article-filter/'+response[2].link+'" target="_blank">Load</a></div>');
331								 }
332						};
333					} 
334					else{
335						 $(".article-results > div").remove();
336						 $(".load-rs").remove();
337						 $(".article-results").append('<div class="not-found-rs">
337No Results Found.</div>');
338					}
339				},
340				
341			});
342});
343*//*
344$('div#article-date input[type="date"]').change(function() { 
345	var topic = $('select#topic').val();
346	var media = $('select#media').val();
347	var date =  $(this).attr('data-date');
348		$.ajax({
349				url: load.ajaxurl,
350				type: 'post',
351				data: {
352					media:media,
353					topic:topic,
354					date:date,
355				action: "article"
356				},
357				success:function( response ) {	
358					$(".article-results div").remove();
359					$("span.s-rs-1").html(media);
360					$("span.s-rs-2").html(topic);
361					if(response) {
362						for(var i = 0 ;  i <= 2 ; i++) {
363								if(i <= 1){
364									var html = '<div class="">'+response[i].title+'</div>';
365							  		$(".article-results").append(html);
366								}
367								if(i == 2)
368								 {
369									 $(".load-rs").remove();
370									 $(".article-results").after('<div class="load-rs"><a href="http://13.234.186.203/article-filter/'+response[2].link+'" target="_blank">Load</a></div>');
371								 }
372						};
373					} 
374					else{
375						 $(".article-results > div").remove();
376						 $(".load-rs").remove();
377						 $(".article-results").append('<div class="not-found-rs">
377No Results Found.</div>');
378					}
379				},
380				
381			});
382});*/

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.