PageSourceSearch

https://www.suicideinfo.ca/wp-content/themes/cfsp-child/assets/js/myAjaxScript.js?ver=1790208267

js suicideinfo.ca collected 2026-09-24 17:20:02 UTC 4,457 bytes, 119 lines download raw bytes

1jQuery(document).ready(function($){
2	
3	$(".button-close").click(function(event){
4		event.preventDefault();
5		$('.overlay_content_wrapper').css('visibility','hidden');
6	 	$('.overlay_content_wrapper').css('opacity',0);
7	});
8	$(".close_button").click(function(event){
9		event.preventDefault();
10	     $('.overlay_content_wrapper').css('visibility','hidden');
11		 $('.overlay_content_wrapper').css('opacity',0);
12		 if($(this).attr('data-reload')=='active'){
13			if($(this).attr('data-reload-url')){
14				window.location.href = $(this).attr('data-reload-url');
15			}else{
16				location.reload(true);
17			}
18	       
19		 }
20	 
21	});
22$(".workshop_action_confirmation,.workshop_action_trigger").click(function(event){
23	event.preventDefault();
24var validate = true;
25//var days_left = $(this).attr('data-days-left');
26var action_type = $(this).attr('data-action-type');
27var reg_id = $(this).attr('data-reg-id');
28var action_title = $(this).attr('data-action-title');
29var checked_cohort = $(".selected_cohort[name='selected_cohort']:checked").val();
30if(checked_cohort){
31	var cohort_id = checked_cohort;
32}else{
33var cohort_id = $(this).attr('data-cohort-id');
34}
35var cohort_price = $(this).attr('data-cohort-price');
36$('.overlay_content_wrapper').css('visibility','hidden');
37$('.overlay_content_wrapper').css('opacity',0);
38//alert(cohort_id);
39var triggerName = $(this).attr("href");
40triggerName = triggerName.replace('#', '');
41$('#'+triggerName+' .popup_inner_wrapper > h2').text(action_title);
42$('#'+triggerName).css('visibility','visible');
43$('#'+triggerName).css('opacity',1); 
44$('#'+triggerName +' .content_wrapper').empty();
45$('#'+triggerName +' .content_wrapper').text('Loading...');
46	if(validate){
47	$.ajax({
48		type: 'POST',
49    dataType: 'JSON',
50  //  contentType: 'application/json',
51		url: participantajaxObj.ajax_url,
52		data: {
53			"action": "participantItemAJAX_callback",
54			"nonce": participantajaxObj.nonce,
55			"action_type": action_type,
56			"cohort_id": cohort_id,
57			"cohort_price": cohort_price,
58			'reg_id':reg_id
59		}, //CLOSE DATA
60		success: function (response) {
61			var result = response['data'];
62			var error_msg = result['error_msg'];
63			var success_msg = result['success_msg'];
64			var action_type = result['action_type'];
65			var title = result['next_step'];
66				title = 'Workshop ' + title;
67			$('#'+triggerName +' .modal-footer .close_button').attr('data-reload',result['close_reload']);
68			$('#'+triggerName +' .modal-footer .close_button').attr('data-reload-url',result['reload_url']);
69			$('#'+triggerName +' .modal-footer .confirm_button').attr('data-cohort-id',result['unique_id']);
70			$('#'+triggerName +' .modal-footer .confirm_button').attr('data-cohort-price',result['cohort_price']);
71			$('#'+triggerName +' .modal-footer .confirm_button').attr('data-action-title',title);
72			$('#'+triggerName +' .modal-footer .confirm_button').attr('data-action-type',result['next_step']);
73			$('#'+triggerName +' .modal-footer .confirm_button').attr('href',result['next_popup']);
74
75			// Toggle submit button visibility based on server response
76			if (result['hide_submit']) {
77				$('#'+triggerName +' .modal-footer .confirm_button').hide();
78			} else {
79				$('#'+triggerName +' .modal-footer .confirm_button').show();
80			}
81
82			console.log(response);
83      
84			if(response['success'] == false){
85				
86                if((error_msg) && (action_type == action_type)){	
87					if( action_type == 'reschedule_validate' && result['next_step'] == 'reschedule'){
88						$('#'+triggerName +' .modal-footer .confirm_button').removeClass('workshop_action_confirmation');
89					}
90					$('#'+triggerName +' .content_wrapper').empty();
91					$('#'+triggerName ).addClass('error_message');
92                    $('#'+triggerName +' .content_wrapper').html(error_msg);
93				}
94				
95			}
96			else if(response['success'] == true ){
97				available_cohort_list = result['available_cohort_list'];
98				if(available_cohort_list){
99					$('#'+triggerName +' .load_dynamic_content').empty();
100					$('#'+triggerName +' .load_dynamic_content').html(available_cohort_list);
101					
102				}
103				
104                if((success_msg) && (action_type == action_type)){	
105					
106					$('#'+triggerName +' .content_wrapper').empty();
107					$('#'+triggerName ).addClass('success_message');
108                    $('#'+triggerName +' .content_wrapper').html(success_msg);
109				}
110			}
111
112		},
113       error: function(xhr, ajaxOptions, thrownError){
114                    console.log(ajaxOptions);
115                }
116	});
117}
118	});
119	});

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.