PageSourceSearch

https://hitmachinery.ru/wp-content/themes/hitmachinery-Child-Theme/js/hitmachinery.js?ver=1.3.1

js hitmachinery.ru collected 2026-10-05 07:36:37 UTC 4,698 bytes, 149 lines download raw bytes

1(function ($) {
2	document.addEventListener(
3		"wpcf7mailsent",
4		function (event) {
5			$(".hidecform").addClass("hide");
6			$(".success-message").addClass("show");
7			if (typeof generalPixel !== "undefined" && generalPixel.postClick) {
8				generalPixel.postClick("a8");
9				console.log("pixel a8");
10			}
11			/*$(".wpcf7 .hidecform").after(
12            '<div class="success-message"><div class="message-header"><i class="fa fa-lg fa-check"></i> Ваша заявка успешно отправлена.</div> Благодарим за обращение в нашу компанию!</div>'*/
13		},
14		false,
15	);
16	$(".btn-modal").click(function () {
17		$(".hidecform").removeClass("hide");
18		$(".success-message").removeClass("show");
19	});
20})(jQuery);
21
22function cFormToggle(formId, title, check ) {
23	let $ = window.jQuery || jQuery;
24	if (!$) {
25		console.error("Ошибка: jQuery не загружен на этой странице!");
26		return;
27	}
28
29	let targetContainer = $("#" + formId);
30	let formCard = $("#single-form-contact-card");
31
32	if (check && targetContainer.length === 0) {
33		console.error(
34			"Рендер сорвался: Блок с ID '" + formId + "' не найден на странице!",
35		);
36		return;
37	}
38
39	if (check && formCard.length === 0) {
40		console.error(
41			"Рендер сорвался: Форма '#single-form-contact-card' отсутствует в DOM!",
42		);
43		return;
44	}
45
46	if (title) {
47		$('.contact-form-cards-custom input[name="dynamictext-709"]').val(title);
48	}
49
50	if (check) {
51		$(".contact-form-cards-custom").addClass("hide-form");
52		formCard.detach().appendTo(targetContainer);
53	}
54
55	if (targetContainer.hasClass("hide-form")) {
56		targetContainer.removeClass("hide-form");
57	} else {
58		targetContainer.addClass("hide-form");
59	}
60}
61
62window.addEventListener("load", function () {
63	if (window.ct) {
64		window.ct("modules", "widgets", "subscribeToEvent", [
65			{
66				object: "button",
67				action: "click",
68				callback: function (event) {
69					if (typeof generalPixel !== "undefined" && generalPixel.postClick) {
70						generalPixel.postClick("a2");
71						console.log("pixel a2");
72					}
73				},
74			},
75			{
76				object: "request",
77				action: "create",
78				callback: function (event) {
79					if (event.data.widgetType == "callback") {
80						if (typeof generalPixel !== "undefined" && generalPixel.postClick) {
81							generalPixel.postClick("a3");
82							console.log("pixel a3");
83						}
84					}
85					if (event.data.widgetType == "request") {
86						if (typeof generalPixel !== "undefined" && generalPixel.postClick) {
87							generalPixel.postClick("a4");
88							console.log("pixel a4");
89						}
90					}
91				},
92			},
93		]);
94	}
95	document.querySelectorAll(".product").forEach((element) => {
96		let badges = element.querySelectorAll(".product-badge");
97		let buttonModalForm = element.querySelector(".product__modal-form");
98		/* HM_DISCOUNT_HOME_CTA_JS_20260810 */
99const hmDiscountHomeCard = document.body.classList.contains("home") &&
100    badge.closest(".post-22939, .post-22954, .post-22956, .post-22957, .post-22959, .post-22961, .post-10806");
101let buttonText = hmDiscountHomeCard ? "ЗАПРОСИТЬ КП" : "УЗНАТЬ ЦЕНУ";
102		let count = 0;
103		badges.forEach((badge) => {
104			if (badge.innerHTML == "под заказ") {
105				buttonText = "УЗНАТЬ СРОКИ ПОСТАВКИ";
106			}
107
108			buttonModalForm.addEventListener("click", () => {
109				if (count !== 1) {
110					if (badge.innerHTML == "под заказ") {
111						if (typeof generalPixel !== "undefined" && generalPixel.postClick) {
112							generalPixel.postClick("a7");
113							console.log("pixel a7");
114						}
115					}
116					if (typeof generalPixel !== "undefined" && generalPixel.postClick) {
117						generalPixel.postClick("a5");
118						console.log("pixel a5");
119					}
120					count = 1;
121				}
122			});
123
124			if (badge.innerHTML.indexOf("субсидия") !== -1) {
125				let subsidy = badge.getAttribute("data-subsidy") ?? "500 000";
126				let div = document.createElement("div");
127				div.classList.add("plate_product_subsidy");
128				div.innerHTML =
129					"Субсидия " +
130					subsidy +
131					' р. предоставляется юр. лицам, подавшим заявку. <a href="/offers/xit-finans-vash-shans-na-vygodu/" target="_blank">Подробнее</a>';
132				badge.style.position = "relative";
133				badge.style.cursor = "pointer";
134				badge.append(div);
135				badge.addEventListener("mouseout", () => {
136					div.classList.remove("active");
137				});
138				badge.addEventListener("mouseover", () => {
139					div.classList.add("active");
140				});
141				//  badge.addEventListener('click', ()=>{
142				//      div.classList.toggle('active');
143				//  })
144			}
145		});
146
147		buttonModalForm.innerHTML = buttonText;
148	});
149});

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.