PageSourceSearch

https://avtoshkolaspb.ru/templates/Flow/js/uniform.js

js avtoshkolaspb.ru collected 2026-10-04 23:59:55 UTC 2,210 bytes, 96 lines download raw bytes

1/*!
2 * DLE UniForm — унверсальные формы для DLE
3 *
4 * @author     ПафНутиЙ <[email protected]>
5 * @link       http://pafnuty.name/
6 * @link       https://twitter.com/pafnuty_name
7 */
8
9var doc = $(document);
10
11var laddaLoad;
12
13doc
14	// ajax-отправка формы + эффекты
15	.on('submit', '[data-uf-form]', function () {
16		var $this   = $(this);
17		var options = {
18			beforeSubmit: ufStart,
19			success: ufDone,
20		};
21
22		$this.ajaxSubmit(options);
23
24		return false;
25	})
26	// Открытие ajax-окна с формой
27	.on('click', '[data-uniform]', function () {
28		var $this = $(this);
29		var data  = $this.data('uniform');
30		data.mod = 'uniform';
31
32		$.magnificPopup.open({
33			items: {
34				src: '/index.php?controller=ajax',
35			},
36			focus: '.uf-input-first',
37			type: 'ajax',
38			ajax: {
39				settings: {
40					data: data
41				}
42			}
43		});
44		return false;
45	})
46	// Убираем класс с из инпута с ошибочным заполнением
47	.on('keyup input', '.uf-input-error', function (e) {
48		var $this = $(this);
49		if (e.type === 'input') {
50			doc.off('keyup', '.uf-input-error');
51		}
52		if ($this.val().length) {
53			$this.removeClass('uf-input-error');
54		}
55	});
56
57// Функция, выполняемая перед отправкой формы
58function ufStart(formData, jqForm) {
59	laddaLoad = jqForm.find('.ladda-button').ladda();
60	laddaLoad.ladda('start');
61
62	return true;
63}
64
65// Функция, выполняемая после удачной отправки формы
66function ufDone(responseText, statusText, xhr, $form) {
67
68	var $responseText  = $(responseText);
69	var responseResult = ($responseText.is('form')) ? $responseText.html() : responseText;
70
71	if (statusText === 'success') {
72		laddaLoad.ladda('stop');
73		$form.html(responseResult);
74	}
75}
76
77jQuery(document).ready(function ($) {
78	var $inlineUniform = $('[data-uniform-inline]');
79
80	if ($inlineUniform.length) {
81		$.each($inlineUniform, function () {
82			var $this = $(this);
83			var data  = $this.data('uniformInline');
84			data.mod = 'uniform';
85
86			$.ajax({
87				url: '/index.php?controller=ajax',
88				data: data,
89			})
90				.done(function (data) {
91					$this.html(data);
92				});
93
94		});
95	}
96});

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.