PageSourceSearch

https://www.tanger-experience.com/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=4.1.2

js tanger-experience.com collected 2026-10-02 11:58:06 UTC 11,192 bytes, 414 lines download raw bytes

1(function($) {
2
3	if (typeof _wpcf7 == 'undefined' || _wpcf7 === null)
4		_wpcf7 = {};
5
6	_wpcf7 = $.extend({ cached: 0 }, _wpcf7);
7
8	$(function() {
9		_wpcf7.supportHtml5 = $.wpcf7SupportHtml5();
10		$('div.wpcf7 > form').wpcf7InitForm();
11	});
12
13	$.fn.wpcf7InitForm = function() {
14		this.ajaxForm({
15			beforeSubmit: function(arr, $form, options) {
16				$form.wpcf7ClearResponseOutput();
17				$form.find('[aria-invalid]').attr('aria-invalid', 'false');
18				$form.find('img.ajax-loader').css({ visibility: 'visible' });
19				return true;
20			},
21			beforeSerialize: function($form, options) {
22				$form.find('[placeholder].placeheld').each(function(i, n) {
23					$(n).val('');
24				});
25				return true;
26			},
27			data: { '_wpcf7_is_ajax_call': 1 },
28			dataType: 'json',
29			success: $.wpcf7AjaxSuccess,
30			error: function(xhr, status, error, $form) {
31				var e = $('<div class="ajax-error"></div>').text(error.message);
32				$form.after(e);
33			}
34		});
35
36		if (_wpcf7.cached)
37			this.wpcf7OnloadRefill();
38
39		this.wpcf7ToggleSubmit();
40
41		this.find('.wpcf7-submit').wpcf7AjaxLoader();
42
43		this.find('.wpcf7-acceptance').click(function() {
44			$(this).closest('form').wpcf7ToggleSubmit();
45		});
46
47		this.find('.wpcf7-exclusive-checkbox').wpcf7ExclusiveCheckbox();
48
49		this.find('.wpcf7-list-item.has-free-text').wpcf7ToggleCheckboxFreetext();
50
51		this.find('[placeholder]').wpcf7Placeholder();
52
53		if (_wpcf7.jqueryUi && ! _wpcf7.supportHtml5.date) {
54			this.find('input.wpcf7-date[type="date"]').each(function() {
55				$(this).datepicker({
56					dateFormat: 'yy-mm-dd',
57					minDate: new Date($(this).attr('min')),
58					maxDate: new Date($(this).attr('max'))
59				});
60			});
61		}
62
63		if (_wpcf7.jqueryUi && ! _wpcf7.supportHtml5.number) {
64			this.find('input.wpcf7-number[type="number"]').each(function() {
65				$(this).spinner({
66					min: $(this).attr('min'),
67					max: $(this).attr('max'),
68					step: $(this).attr('step')
69				});
70			});
71		}
72
73		this.find('.wpcf7-character-count').wpcf7CharacterCount();
74
75		this.find('.wpcf7-validates-as-url').change(function() {
76			$(this).wpcf7NormalizeUrl();
77		});
78	};
79
80	$.wpcf7AjaxSuccess = function(data, status, xhr, $form) {
81		if (! $.isPlainObject(data) || $.isEmptyObject(data))
82			return;
83
84		var $responseOutput = $form.find('div.wpcf7-response-output');
85
86		$form.wpcf7ClearResponseOutput();
87
88		$form.find('.wpcf7-form-control').removeClass('wpcf7-not-valid');
89		$form.removeClass('invalid spam sent failed');
90
91		if (data.captcha)
92			$form.wpcf7RefillCaptcha(data.captcha);
93
94		if (data.quiz)
95			$form.wpcf7RefillQuiz(data.quiz);
96
97		if (data.invalids) {
98			$.each(data.invalids, function(i, n) {
99				$form.find(n.into).wpcf7NotValidTip(n.message);
100				$form.find(n.into).find('.wpcf7-form-control').addClass('wpcf7-not-valid');
101				$form.find(n.into).find('[aria-invalid]').attr('aria-invalid', 'true');
102			});
103
104			$responseOutput.addClass('wpcf7-validation-errors');
105			$form.addClass('invalid');
106
107			$(data.into).trigger('invalid.wpcf7');
108
109		} else if (1 == data.spam) {
110			$responseOutput.addClass('wpcf7-spam-blocked');
111			$form.addClass('spam');
112
113			$(data.into).trigger('spam.wpcf7');
114
115		} else if (1 == data.mailSent) {
116			$responseOutput.addClass('wpcf7-mail-sent-ok');
117			$form.addClass('sent');
118
119			if (data.onSentOk)
120				$.each(data.onSentOk, function(i, n) { eval(n) });
121
122			$(data.into).trigger('mailsent.wpcf7');
123
124		} else {
125			$responseOutput.addClass('wpcf7-mail-sent-ng');
126			$form.addClass('failed');
127
128			$(data.into).trigger('mailfailed.wpcf7');
129		}
130
131		if (data.onSubmit)
132			$.each(data.onSubmit, function(i, n) { eval(n) });
133
134		$(data.into).trigger('submit.wpcf7');
135
136		if (1 == data.mailSent)
137			$form.resetForm();
138
139		$form.find('[placeholder].placeheld').each(function(i, n) {
140			$(n).val($(n).attr('placeholder'));
141		});
142
143		$responseOutput.append(data.message).slideDown('fast');
144		$responseOutput.attr('role', 'alert');
145
146		$.wpcf7UpdateScreenReaderResponse($form, data);
147	};
148
149	$.fn.wpcf7ExclusiveCheckbox = function() {
150		return this.find('input:checkbox').click(function() {
151			var name = $(this).attr('name');
152			$(this).closest('form').find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false);
153		});
154	};
155
156	$.fn.wpcf7Placeholder = function() {
157		if (_wpcf7.supportHtml5.placeholder)
158			return this;
159
160		return this.each(function() {
161			$(this).val($(this).attr('placeholder'));
162			$(this).addClass('placeheld');
163
164			$(this).focus(function() {
165				if ($(this).hasClass('placeheld'))
166					$(this).val('').removeClass('placeheld');
167			});
168
169			$(this).blur(function() {
170				if ('' == $(this).val()) {
171					$(this).val($(this).attr('placeholder'));
172					$(this).addClass('placeheld');
173				}
174			});
175		});
176	};
177
178	$.fn.wpcf7AjaxLoader = function() {
179		return this.each(function() {
180			var loader = $('<img class="ajax-loader" />')
181				.attr({ src: _wpcf7.loaderUrl, alt: _wpcf7.sending })
182				.css('visibility', 'hidden');
183
184			$(this).after(loader);
185		});
186	};
187
188	$.fn.wpcf7ToggleSubmit = function() {
189		return this.each(function() {
190			var form = $(this);
191			if (this.tagName.toLowerCase() != 'form')
192				form = $(this).find('form').first();
193
194			if (form.hasClass('wpcf7-acceptance-as-validation'))
195				return;
196
197			var submit = form.find('input:submit');
198			if (! submit.length) return;
199
200			var acceptances = form.find('input:checkbox.wpcf7-acceptance');
201			if (! acceptances.length) return;
202
203			submit.removeAttr('disabled');
204			acceptances.each(function(i, n) {
205				n = $(n);
206				if (n.hasClass('wpcf7-invert') && n.is(':checked')
207				|| ! n.hasClass('wpcf7-invert') && ! n.is(':checked'))
208					submit.attr('disabled', 'disabled');
209			});
210		});
211	};
212
213	$.fn.wpcf7ToggleCheckboxFreetext = function() {
214		return this.each(function() {
215			var $wrap = $(this).closest('.wpcf7-form-control');
216
217			if ($(this).find(':checkbox, :radio').is(':checked')) {
218				$(this).find(':input.wpcf7-free-text').prop('disabled', false);
219			} else {
220				$(this).find(':input.wpcf7-free-text').prop('disabled', true);
221			}
222
223			$wrap.find(':checkbox, :radio').change(function() {
224				var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio');
225				var $freetext = $(':input.wpcf7-free-text', $wrap);
226
227				if ($cb.is(':checked')) {
228					$freetext.prop('disabled', false).focus();
229				} else {
230					$freetext.prop('disabled', true);
231				}
232			});
233		});
234	};
235
236	$.fn.wpcf7CharacterCount = function() {
237		return this.each(function() {
238			var $count = $(this);
239			var name = $count.attr('data-target-name');
240			var down = $count.hasClass('down');
241			var starting = parseInt($count.attr('data-starting-value'), 10);
242			var maximum = parseInt($count.attr('data-maximum-value'), 10);
243			var minimum = parseInt($count.attr('data-minimum-value'), 10);
244
245			var updateCount = function($target) {
246				var length = $target.val().length;
247				var count = down ? starting - length : length;
248				$count.attr('data-current-value', count);
249				$count.text(count);
250
251				if (maximum && maximum < length) {
252					$count.addClass('too-long');
253				} else {
254					$count.removeClass('too-long');
255				}
256
257				if (minimum && length < minimum) {
258					$count.addClass('too-short');
259				} else {
260					$count.removeClass('too-short');
261				}
262			};
263
264			$count.closest('form').find(':input[name="' + name + '"]').each(function() {
265				updateCount($(this));
266
267				$(this).keyup(function() {
268					updateCount($(this));
269				});
270			});
271		});
272	};
273
274	$.fn.wpcf7NormalizeUrl = function() {
275		return this.each(function() {
276			var val = $.trim($(this).val());
277
278			if (! val.match(/^[a-z][a-z0-9.+-]*:/i)) { // check the scheme part
279				val = val.replace(/^\/+/, '');
280				val = 'http://' + val;
281			}
282
283			$(this).val(val);
284		});
285	};
286
287	$.fn.wpcf7NotValidTip = function(message) {
288		return this.each(function() {
289			var $into = $(this);
290
291			$into.find('span.wpcf7-not-valid-tip').remove();
292			$into.append('<span role="alert" class="wpcf7-not-valid-tip">' + message + '</span>');
293
294			if ($into.is('.use-floating-validation-tip *')) {
295				$('.wpcf7-not-valid-tip', $into).mouseover(function() {
296					$(this).wpcf7FadeOut();
297				});
298
299				$(':input', $into).focus(function() {
300					$('.wpcf7-not-valid-tip', $into).not(':hidden').wpcf7FadeOut();
301				});
302			}
303		});
304	};
305
306	$.fn.wpcf7FadeOut = function() {
307		return this.each(function() {
308			$(this).animate({
309				opacity: 0
310			}, 'fast', function() {
311				$(this).css({'z-index': -100});
312			});
313		});
314	};
315
316	$.fn.wpcf7OnloadRefill = function() {
317		return this.each(function() {
318			var url = $(this).attr('action');
319			if (0 < url.indexOf('#'))
320				url = url.substr(0, url.indexOf('#'));
321
322			var id = $(this).find('input[name="_wpcf7"]').val();
323			var unitTag = $(this).find('input[name="_wpcf7_unit_tag"]').val();
324
325			$.getJSON(url,
326				{ _wpcf7_is_ajax_call: 1, _wpcf7: id, _wpcf7_request_ver: $.now() },
327				function(data) {
328					if (data && data.captcha)
329						$('#' + unitTag).wpcf7RefillCaptcha(data.captcha);
330
331					if (data && data.quiz)
332						$('#' + unitTag).wpcf7RefillQuiz(data.quiz);
333				}
334			);
335		});
336	};
337
338	$.fn.wpcf7RefillCaptcha = function(captcha) {
339		return this.each(function() {
340			var form = $(this);
341
342			$.each(captcha, function(i, n) {
343				form.find(':input[name="' + i + '"]').clearFields();
344				form.find('img.wpcf7-captcha-' + i).attr('src', n);
345				var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n);
346				form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]);
347			});
348		});
349	};
350
351	$.fn.wpcf7RefillQuiz = function(quiz) {
352		return this.each(function() {
353			var form = $(this);
354
355			$.each(quiz, function(i, n) {
356				form.find(':input[name="' + i + '"]').clearFields();
357				form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]);
358				form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]);
359			});
360		});
361	};
362
363	$.fn.wpcf7ClearResponseOutput = function() {
364		return this.each(function() {
365			$(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked').removeAttr('role');
366			$(this).find('span.wpcf7-not-valid-tip').remove();
367			$(this).find('img.ajax-loader').css({ visibility: 'hidden' });
368		});
369	};
370
371	$.wpcf7UpdateScreenReaderResponse = function($form, data) {
372		$('.wpcf7 .screen-reader-response').html('').attr('role', '');
373
374		if (data.message) {
375			var $response = $form.siblings('.screen-reader-response').first();
376			$response.append(data.message);
377
378			if (data.invalids) {
379				var $invalids = $('<ul></ul>');
380
381				$.each(data.invalids, function(i, n) {
382					if (n.idref) {
383						var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message));
384					} else {
385						var $li = $('<li></li>').append(n.message);
386					}
387
388					$invalids.append($li);
389				});
390
391				$response.append($invalids);
392			}
393
394			$response.attr('role', 'alert').focus();
395		}
396	};
397
398	$.wpcf7SupportHtml5 = function() {
399		var features = {};
400		var input = document.createElement('input');
401
402		features.placeholder = 'placeholder' in input;
403
404		var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date'];
405
406		$.each(inputTypes, function(index, value) {
407			input.setAttribute('type', value);
408			features[value] = input.type !== 'text';
409		});
410
411		return features;
412	};
413
414})(jQuery);

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.