PageSourceSearch

https://parcoscientificocapannori.it/wp-content/plugins/booked/inc…/frontend-agents/js/functions.js?ver=2.3

js parcoscientificocapannori.it collected 2026-09-26 02:51:08 UTC 4,685 bytes, 178 lines download raw bytes

1;(function($, window, document, undefined) {
2
3	var $win = $(window);
4
5	$win.on('load', function() {
6		
7		var ajaxRequests = [];
8		
9		// Add Pending Count to Tab
10		$('.booked-tabs').find('li a div.counter').each(function(){
11			var thisCounter = $(this),
12				thisTabName = $(this).parent().attr('href');
13				thisTabName = thisTabName.split('#');
14				thisTabName = thisTabName[1];
15				totalAppointments = $('#profile-'+thisTabName).find('.appt-block').length;
16			
17			if (totalAppointments > 0){
18				thisCounter.html(totalAppointments).fadeIn('fast');
19			}
20		});
21		
22		// User Info Click
23		$('.booked-fea-appt-list').on('click', '.user', function(e) {
24
25			e.preventDefault();
26
27			var $thisLink 		= $(this),
28				user_id			= $thisLink.attr('data-user-id'),
29				appt_id			= $thisLink.parent().attr('data-appt-id'),
30				booked_ajaxURL	= booked_fea_vars.ajax_url;
31
32			create_booked_modal();
33			
34			$.ajax({
35				url: booked_ajaxURL,
36				type: 'post',
37				data: {
38					action: 'booked_fea_user_info_modal',
39					user_id: user_id,
40					appt_id: appt_id
41				},
42				success: function( html ) {
43					
44					$('.bm-window').html( html );
45					
46					var bookedModal = $('.booked-modal');
47					var bmWindow = bookedModal.find('.bm-window');
48					bmWindow.css({'visibility':'hidden'});
49					bookedModal.removeClass('bm-loading');
50					resize_booked_modal();
51					bmWindow.hide();
52					
53					setTimeout(function(){
54						bmWindow.css({'visibility':'visible'});
55						bmWindow.show();
56					},50);
57					
58				}
59			});
60			
61			return false;
62
63		});
64		
65		// Show Additional Information
66		$('.booked-fea-appt-list').on('click', '.booked-show-cf', function(e) {
67		
68			e.preventDefault();
69			var hiddenBlock = $(this).parent().find('.cf-meta-values-hidden');
70		
71			if(hiddenBlock.is(':visible')){
72				hiddenBlock.hide();
73			} else {
74				hiddenBlock.show();
75			}
76		
77			return false;
78		
79		});
80		
81		// Approve Appointment from Appointment List
82		$('.booked-fea-appt-list').on('click', '.appt-block .approve', function(e) {
83
84			e.preventDefault();
85
86			var $button 		= $(this),
87				$thisParent		= $button.parents('.appt-block'),
88				appt_id			= $thisParent.attr('data-appt-id'),
89				booked_ajaxURL	= booked_fea_vars.ajax_url;
90
91			confirm_appt_approve = confirm(booked_fea_vars.i18n_confirm_appt_approve);
92			if (confirm_appt_approve == true){
93
94				var currentApptCount = parseInt($button.parents('.booked-fea-appt-list').find('h4 span.count').html());
95				currentApptCount = parseInt(currentApptCount - 1);
96				$button.parents('.booked-fea-appt-list').find('h4 span.count').html(currentApptCount);
97				
98				if ($button.parents('#profile-fea_pending').length){
99					if (currentApptCount < 1){
100						$('.booked-tabs').find('li a[href="#fea_pending"] .counter').remove();
101					} else {
102						$('.booked-tabs').find('li a[href="#fea_pending"] .counter').html(currentApptCount);
103					}
104				}
105				
106				$('.appt-block').animate({'opacity':0.4},0);
107				$button.remove();
108
109		  		$.ajax({
110					'method' : 'post',
111					'url' : booked_ajaxURL,
112					'data': {
113						'action'     	: 'booked_fea_approve_appt',
114						'appt_id'     	: appt_id
115					},
116					success: function(data) {
117						$('.appt-block').animate({'opacity':1},150);
118					}
119				});
120
121			}
122
123			return false;
124
125		});
126		
127		// Delete Appointment from Appointment List
128		$('.booked-fea-appt-list').on('click', '.appt-block .delete', function(e) {
129
130			e.preventDefault();
131
132			var $button 		= $(this),
133				$thisParent		= $button.parents('.appt-block'),
134				appt_id			= $thisParent.attr('data-appt-id'),
135				booked_ajaxURL	= booked_fea_vars.ajax_url;
136
137			confirm_appt_delete = confirm(booked_fea_vars.i18n_confirm_appt_delete);
138			if (confirm_appt_delete == true){
139
140				var currentApptCount = parseInt($button.parents('.booked-fea-appt-list').find('h4 span.count').html());
141				currentApptCount = parseInt(currentApptCount - 1);
142				$button.parents('.booked-fea-appt-list').find('h4 span.count').html(currentApptCount);
143				
144				if ($button.parents('#profile-fea_pending').length){
145					if (currentApptCount < 1){
146						$('.booked-tabs').find('li a[href="#fea_pending"] .counter').remove();
147					} else {
148						$('.booked-tabs').find('li a[href="#fea_pending"] .counter').html(currentApptCount);
149					}
150				}
151				
152				$('.appt-block').animate({'opacity':0.4},0);
153								
154				$thisParent.slideUp('fast',function(){
155					$(this).remove();
156				});
157
158				$.ajax({
159					'method' : 'post',
160					'url' : booked_ajaxURL,
161					'data': {
162						'action'     	: 'booked_fea_delete_appt',
163						'appt_id'     	: appt_id
164					},
165					success: function(data) {
166						$('.appt-block').animate({'opacity':1},150);
167					}
168				});
169
170			}
171
172			return false;
173
174		});
175		
176	});
177	
178})(jQuery, window, document);

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.