PageSourceSearch

https://anapa-official.ru/bitrix/templates/simai.framework/compone…/template1/script.js?16588275684163

js anapa-official.ru collected 2026-10-02 04:56:05 UTC 4,163 bytes, 146 lines download raw bytes

1		/*
2		*	1 - Функция которая будет выполнена
3		*	2 - код клавиши которая должна сработать
4		*	3 - вторая клавиша в сочетании с первой
5		*	4 - третья клавиша в сочетании с первой и второй
6		*	
7		*	Функция для обработки любого сочетания клавиш.
8		*	Количество клавиш при нажатии которых будет выполнена функция
9		*	неограничено.
10		*/
11		function bodyEvent(func)
12		{
13			var codes = [].slice.call(arguments, 1);
14			var pressed = {};
15			
16			document.onkeydown = function(e) {
17			  e = e || window.event;
18
19			  pressed[e.keyCode] = true;
20
21			  for (var i = 0; i < codes.length; i++) { // проверить, все ли клавиши нажаты
22				if (!pressed[codes[i]]) {
23				  return;
24				}
25			  }
26
27			  pressed = {};
28
29			  func();
30
31			};
32
33			document.onkeyup = function(e)
34			{
35			  e = e || window.event;
36
37			  delete pressed[e.keyCode];
38			};
39		}
40		
41		
42		function closeModalWindow()
43		{
44			var modalWin = document.getElementById("modal-window-home-id");
45			modalWin.style.display = "none";
46			//modalWin.parentNode.removeChild(modalWin);
47		}
48
49
50
51		
52		function modalWindow()
53		{
54			var modalW = document.getElementsByClassName("modal-window-home").length;
55			if(modalW <= 1)
56			{	
57				var formElem = document.getElementById('elem-form');
58				var elemStr = '<textarea class="form-sm-element message-text-submit" id="text-form" name="error_desc"' +
59					'placeholder="Пожалуйста, опишите ошибку"></textarea>' +
60							'<input type="hidden" name="error_message" value="' + copySelectionText() + '">' +
61							'<input type="hidden" name="error_url" value="' + window.location + '">' +
62							'<input type="hidden" name="error_referer" value="' + document.referrer + '">' +
63							'<input type="hidden" name="error_useragent" value="' + navigator.userAgent + '">';
64				formElem.innerHTML = elemStr;
65
66				var modalFormMess = document.getElementById('mess');
67				var hideFormText = document.getElementById('error_message');
68				var submitButton = document.getElementById('send');
69				var textForm = document.getElementById('text-form');
70				console.log(String(textForm));
71
72				var hideText = copySelectionText();
73				if(hideText != '') {
74					var str = '';
75					if(String(hideText).length >= 120)
76						str = '...';
77					modalFormMess.innerHTML = String(hideText).substring(0,120) + str;
78					submitButton.style.display = 'block';
79					textForm.style.display = 'block';
80					modalFormMess.style.color = 'rgba(0,0,0,.54)';
81				}
82				else {
83					modalFormMess.innerHTML = 'Текст с ошибкой не выделен. Пожалуйста выделите текст с ошибкой и нажмите Ctrl+Enter';
84					textForm.style.display = 'none';				
85					submitButton.style.display = 'none';
86					modalFormMess.style.color = 'rgba(255,0,0,.87)';				
87				}
88				var modWindow = document.getElementById("modal-window-home-id");
89				modWindow.style.display = "flex";
90			}
91		}
92		
93		
94		bodyEvent(modalWindow,"17","13");
95		
96		/*
97		*	ФУНКЦИЯ modalWindowEsc ЗАКРЫВАЮЩАЯ МОДАЛЬНОЕ ОКНО
98		*	ПРИ НАЖАТИИ НА КЛАВИШУ ESC
99		*
100		*/
101		
102		function modalWindowEsc(e)
103		{
104			if(e.keyCode == 27)
105				closeModalWindow();
106		}	
107		
108		addEventListener("keydown", modalWindowEsc);
109
110
111
112		function handlerEvents(e) {
113			var flagObjHandler = e.target.hasAttribute('params');
114			if(flagObjHandler) {
115				var objHandler = e.target.getAttribute('params');
116				switch(objHandler) {
117					case 'close':
118						closeModalWindow();
119						break;
120				}
121			}
122		}
123
124
125
126
127		window.onload = function() {
128			document.body.addEventListener('click',handlerEvents);
129		}
130
131		function copySelectionText()
132		{
133			if(window.getSelection)
134				strText = window.getSelection();
135			else if(document.getSelection)
136				strText = document.getSelection();
137			else if(document.selection)
138				strText = document.CDATA_SECTION_NODE.createRange().text;
139			else return;
140
141			return strText;
142		}
143
144		function text() {
145			
146		}

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.