PageSourceSearch

https://performinglifebolivia.org/wp-content/themes/enfold/config-…/contact/contact_ver-4.9.26.js

js performinglifebolivia.org collected 2026-09-27 08:56:29 UTC 8,535 bytes, 312 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10// -------------------------------------------------------------------------------------------
11// contact form ajax
12// -------------------------------------------------------------------------------------------
13
14(function($)
15{
16	$.fn.avia_ajax_form = function(variables)
17	{	
18		var defaults =
19		{
20			sendPath: 'send.php',
21			responseContainer: '.ajaxresponse'
22		};
23
24		var options = $.extend(defaults, variables);
25
26		return this.each(function()
27		{
28			var form = $(this),
29				form_sent = false,
30				send =
31				{
32					formElements: form.find('textarea, select, input[type=text], input[type=checkbox], input[type=hidden]'),
33					validationError:false,
34					button : form.find('input:submit'),
35					dataObj : {}
36				},
37
38				responseContainer = form.next(options.responseContainer+":eq(0)");
39
40				send.button.on('click', checkElements);
41				
42				
43				//change type of email forms on mobile so the e-mail keyboard with @ sign is used
44				if($.avia_utilities.isMobile)
45				{
46					send.formElements.each(function(i)
47					{
48						var currentElement = $(this), is_email = currentElement.hasClass('is_email');
49						if(is_email) currentElement.attr('type','email');
50					});
51				}
52			
53
54			function checkElements( e )
55			{
56				// reset validation var and send data
57				send.validationError = false;
58				send.datastring = 'ajax=true';
59
60				send.formElements.each(function(i)
61				{
62					var currentElement = $(this),
63						surroundingElement = currentElement.parent(),
64						value = currentElement.val(),
65						name = currentElement.attr('name'),
66					 	classes = currentElement.attr('class'),
67					 	nomatch = true;
68
69					 	if(currentElement.is(':checkbox'))
70					 	{
71					 		if(currentElement.is(':checked')) { value = true } else {value = ''}
72					 	}
73					 	
74					 	send.dataObj[name] = encodeURIComponent(value);
75
76					 	if(classes && classes.match(/is_empty/))
77						{
78							if(value == '' || value == null)
79							{
80								surroundingElement.removeClass("valid error ajax_alert").addClass("error");
81								send.validationError = true;
82							}
83							else
84							{
85								surroundingElement.removeClass("valid error ajax_alert").addClass("valid");
86							}
87							nomatch = false;
88						}
89
90						if(classes && classes.match(/is_email/))
91						{
92							if(!value.match(/^[\w|\.|\-]+@\w[\w|\.|\-]*\.[a-zA-Z]{2,20}$/))
93							{
94								surroundingElement.removeClass("valid error ajax_alert").addClass("error");
95								send.validationError = true;
96							}
97							else
98							{
99								surroundingElement.removeClass("valid error ajax_alert").addClass("valid");
100							}
101							nomatch = false;
102						}
103						
104						if(classes && classes.match(/is_ext_email/))
105						{
106							//  also allowed would be: ! # $ % & ' * + - / = ? ^ _ ` { | } ~
107							if( ! value.match( /^[\w|\.|\-|ÄÖÜäöü]+@\w[\w|\.|\-|ÄÖÜäöü]*\.[a-zA-Z]{2,20}$/ ) )
108							{
109								surroundingElement.removeClass("valid error ajax_alert").addClass("error");
110								send.validationError = true;
111							}
112							else
113							{
114								surroundingElement.removeClass("valid error ajax_alert").addClass("valid");
115							}
116							nomatch = false;
117						}
118						
119						if(classes && classes.match(/is_phone/))
120						{
121							if(!value.match(/^(\d|\s|\-|\/|\(|\)|\[|\]|e|x|t|ension|\.|\+|\_|\,|\:|\;){3,}$/))
122							{
123								surroundingElement.removeClass("valid error ajax_alert").addClass("error");
124								send.validationError = true;
125							}
126							else
127							{
128								surroundingElement.removeClass("valid error ajax_alert").addClass("valid");
129							}
130							nomatch = false;
131						}
132
133						if(classes && classes.match(/is_number/))
134						{
135							if(!($.isNumeric(value)) || value == "")
136							{
137								surroundingElement.removeClass("valid error ajax_alert").addClass("error");
138								send.validationError = true;
139							}
140							else
141							{
142								surroundingElement.removeClass("valid error ajax_alert").addClass("valid");
143							}
144							nomatch = false;
145						}
146
147						if(classes && classes.match(/captcha/))
148						{
149							var verifier 	= form.find("#" + name + "_verifier").val(),
150								lastVer		= verifier.charAt(verifier.length-1),
151								finalVer	= verifier.charAt(lastVer);
152
153							if(value != finalVer)
154							{
155								surroundingElement.removeClass("valid error ajax_alert").addClass("error");
156								send.validationError = true;
157							}
158							else
159							{
160								surroundingElement.removeClass("valid error ajax_alert").addClass("valid");
161							}
162							nomatch = false;
163						}
164
165						if(nomatch && value != '')
166						{
167							surroundingElement.removeClass("valid error ajax_alert").addClass("valid");
168						}
169				});
170
171				if(send.validationError == false)
172				{
173					if(form.data('av-custom-send'))
174					{
175						mailchimp_send();	
176					}
177					else
178					{
179						send_ajax_form();
180					}
181				}
182				
183				return false;
184			}
185			
186			
187			function send_ajax_form()
188			{
189				if(form_sent){ return false; }
190
191				form_sent = true;
192				send.button.addClass('av-sending-button');
193				send.button.val(send.button.data('sending-label'));
194				
195				var redirect_to = form.data('avia-redirect') || false,
196					action		= form.attr('action');
197				
198				responseContainer.load(action+' '+options.responseContainer, send.dataObj, function()
199				{
200					if(redirect_to && action != redirect_to)
201					{
202						form.attr('action', redirect_to);
203						location.href = redirect_to;
204						// form.submit();
205					}
206					else
207					{
208						responseContainer.removeClass('hidden').css({display:"block"});
209						form.slideUp(400, function(){responseContainer.slideDown(400, function(){ $('body').trigger('av_resize_finished'); }); send.formElements.val('');});
210					}
211				});
212			}
213			
214			
215			function mailchimp_send()
216			{
217				if(form_sent){ return false; }
218
219				form_sent = true;
220				
221				var original_label = send.button.val();
222
223				send.button.addClass('av-sending-button');
224				send.button.val(send.button.data('sending-label'));
225				send.dataObj.ajax_mailchimp = true;
226				
227				var redirect_to 		= form.data('avia-redirect') || false,
228					action				= form.attr('action'),
229					error_msg_container = form.find('.av-form-error-container'),
230					form_id 			= form.data('avia-form-id'); 
231				
232				$.ajax({
233					url: action,
234					type: "POST",
235					data:send.dataObj,
236					beforeSend: function()
237					{
238						if(error_msg_container.length)
239						{
240							error_msg_container.slideUp(400, function()
241							{
242								error_msg_container.remove();
243								$('body').trigger('av_resize_finished');
244							});
245						}
246					},
247					success: function(responseText)
248					{
249						var response	= jQuery("<div>").append(jQuery.parseHTML(responseText)),
250							error		= response.find('.av-form-error-container');	
251						
252						if(error.length)
253						{
254							form_sent = false;
255							form.prepend(error);
256							error.css({display:"none"}).slideDown(400, function()
257							{
258								$('body').trigger('av_resize_finished');
259							});
260
261							send.button.removeClass('av-sending-button');
262							send.button.val(original_label);
263						}
264						else
265						{
266							if(redirect_to && action != redirect_to)
267							{
268								form.attr('action', redirect_to);
269								location.href = redirect_to;
270								// form.submit();
271							}
272							else
273							{
274								var success_text = response.find(options.responseContainer + "_" + form_id);
275								
276								responseContainer.html(success_text).removeClass('hidden').css({display:"block"});
277								
278								form.slideUp(400, function()
279								{
280									responseContainer.slideDown(400, function()
281									{ 
282										$('body').trigger('av_resize_finished'); 
283									});
284									
285								send.formElements.val('');
286							});
287							}
288						}
289						
290					},
291					error: function()
292					{
293						
294					},
295					complete: function()
296					{
297					    
298					}
299				});
300
301			}
302			
303			
304		});
305	};
306})(jQuery);
307
308
309
310
311
312}

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.