PageSourceSearch

https://voenchast.ru/bitrix/components/bitrix/socialnetwork.admin.set/templates/.default/script.js

js voenchast.ru collected 2026-10-09 22:41:02 UTC 2,527 bytes, 122 lines download raw bytes

1var waitDiv = null;
2var waitPopup = null;
3var waitTimeout = null;
4var waitTime = 500;
5
6function __SASSetAdmin()
7{
8	__SASShowWait();
9	BX.ajax({
10		url: '/bitrix/components/bitrix/socialnetwork.admin.set/ajax.php',
11		method: 'POST',
12		dataType: 'json',
13		data: {'ACTION': 'SET', 'sessid': BX.bitrix_sessid(), 'site': BX.util.urlencode(BX.message('SASSiteId'))},
14		onsuccess: function(data) { __SASProcessAJAXResponse(data); }
15	});
16}
17
18function __SASProcessAJAXResponse(data)
19{
20	if (data["SUCCESS"] != "undefined" && data["SUCCESS"] == "Y")
21	{
22		BX.reload();
23		return false;
24	}
25	else if (data["ERROR"] != "undefined" && data["ERROR"].length > 0)
26	{
27		if (data["ERROR"].indexOf("SESSION_ERROR", 0) === 0)
28		{
29			__SASShowError(BX.message('SASErrorSessionWrong'));
30			BX.reload();
31		}
32		else if (data["ERROR"].indexOf("CURRENT_USER_NOT_ADMIN", 0) === 0)
33		{
34			__SASShowError(BX.message('SASErrorNotAdmin'));
35			return false;
36		}
37		else if (data["ERROR"].indexOf("CURRENT_USER_NOT_AUTH", 0) === 0)
38		{
39			__SASShowError(BX.message('SASErrorCurrentUserNotAuthorized'));
40			return false;
41		}
42		else if (data["ERROR"].indexOf("SONET_MODULE_NOT_INSTALLED", 0) === 0)
43		{
44			__SASShowError(BX.message('SASErrorModuleNotInstalled'));
45			return false;
46		}
47		else
48		{
49			__SASShowError(data["ERROR"]);
50			return false;		
51		}
52	}
53}
54				
55function __SASShowError(errorText) 
56{
57	__SASCloseWait();
58
59	var errorPopup = new BX.PopupWindow('sas-error' + Math.random(), window, {
60		autoHide: true,
61		lightShadow: false,
62		zIndex: 2,
63		content: BX.create('DIV', {props: {'className': 'sonet-adminset-error-text-block'}, html: errorText}),
64		closeByEsc: true,
65		closeIcon: true
66	});
67	errorPopup.show();
68
69}
70
71function __SASShowWait(timeout)
72{
73	if (timeout !== 0)
74	{
75		return (waitTimeout = setTimeout(function(){
76			__SASShowWait(0)
77		}, 50));
78	}
79
80	if (!waitPopup)
81	{
82		waitPopup = new BX.PopupWindow('sas_wait', window, {
83			autoHide: true,
84			lightShadow: true,
85			zIndex: 2,
86			content: BX.create('DIV', {
87				props: {
88					className: 'sonet-adminset-wait-cont'
89				},
90				children: [
91					BX.create('DIV', {
92						props: {
93							className: 'sonet-adminset-wait-icon'
94						}
95					}),
96					BX.create('DIV', {
97						props: {
98							className: 'sonet-adminset-wait-text'
99						},
100						html: BX.message('SASWaitTitle')
101					})
102				]
103			})
104		});
105	}
106	else
107		waitPopup.setBindElement(window);
108
109	waitPopup.show();
110}
111
112function __SASCloseWait()
113{
114	if (waitTimeout)
115	{
116		clearTimeout(waitTimeout);
117		waitTimeout = null;
118	}
119
120	if (waitPopup)
121		waitPopup.close();
122}

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.