PageSourceSearch

https://www.cnss.tn/html/js/liferay/liferay.js?t=1423298253487

js cnss.tn collected 2026-10-03 17:37:09 UTC 3,872 bytes, 171 lines download raw bytes

1Liferay = window.Liferay || {};
2
3Liferay.namespace = AUI().namespace;
4
5AUI().mix(
6	AUI.defaults.io,
7	{
8		dataFormatter: function(data) {
9			return AUI().Lang.toQueryString(data);
10		},
11		method: 'POST',
12		uriFormatter: function(value) {
13			return Liferay.Util.getURLWithSessionId(value);
14		}
15	},
16	true
17);
18
19Liferay.Service = {
20	actionUrl: themeDisplay.getPathMain() + '/portal/json_service',
21
22	tunnelUrl: themeDisplay.getPathContext() + '/tunnel-web/secure/json',
23
24	classNameSuffix: 'ServiceUtil',
25
26	ajax: function(options, callback) {
27		var instance = this;
28
29		var type = 'POST';
30
31		if (Liferay.PropsValues.NTLM_AUTH_ENABLED && Liferay.Browser.isIe()) {
32			type = 'GET';
33		}
34
35		var serviceUrl = instance.actionUrl;
36
37		var tunnelEnabled = (Liferay.ServiceAuth && Liferay.ServiceAuth.header);
38
39		if (tunnelEnabled) {
40			serviceUrl = instance.tunnelUrl;
41		}
42
43		options.serviceParameters = Liferay.Service.getParameters(options);
44		options.doAsUserId = themeDisplay.getDoAsUserIdEncoded();
45
46		var config = {
47			cache: false,
48			data: options,
49			dataType: 'json',
50			on: {}
51		};
52
53		var xHR = null;
54
55		if (Liferay.PropsValues.NTLM_AUTH_ENABLED && Liferay.Browser.isIe()) {
56			config.method = 'GET';
57		}
58
59		if (callback) {
60			config.on.success = function(event, id, obj) {
61				callback.call(this, this.get('responseData'), obj);
62			};
63
64			if (tunnelEnabled) {
65				config.headers = {
66					Authorization: Liferay.ServiceAuth.header
67				};
68			}
69		}
70		else {
71			config.on.success = function(event, id, obj) {
72				xHR = obj;
73			};
74
75			config.sync = true;
76		}
77
78		AUI().io.request(serviceUrl, config);
79
80		if (xHR) {
81			return eval('(' + xHR.responseText + ')');
82		}
83	},
84
85	getParameters: function(options) {
86		var instance = this;
87
88		var serviceParameters = [];
89
90		for (var key in options) {
91			if ((key != 'serviceClassName') && (key != 'serviceMethodName') && (key != 'serviceParameterTypes')) {
92				serviceParameters.push(key);
93			}
94		}
95
96		return instance._getJSONParser().stringify(serviceParameters);
97	},
98
99	namespace: function(namespace) {
100		var curLevel = Liferay || {};
101
102		if (typeof namespace == 'string') {
103			var levels = namespace.split('.');
104
105			for (var i = (levels[0] == 'Liferay') ? 1 : 0; i < levels.length; i++) {
106		 		curLevel[levels[i]] = curLevel[levels[i]] || {};
107				curLevel = curLevel[levels[i]];
108			}
109		}
110		else {
111			curLevel = namespace || {};
112		}
113
114		return curLevel;
115	},
116
117	register: function(serviceName, servicePackage) {
118		var module = Liferay.Service.namespace(serviceName);
119
120		module.servicePackage = servicePackage.replace(/[.]$/, '') + '.';
121
122		return module;
123	},
124
125	registerClass: function(serviceName, className, prototype) {
126		var module = serviceName || {};
127		var moduleClassName = module[className] = {};
128
129		moduleClassName.serviceClassName = module.servicePackage + className + Liferay.Service.classNameSuffix;
130
131		var Lang = AUI().Lang;
132
133		AUI().Object.each(
134			prototype,
135			function(item, index, collection) {
136				var handler = item;
137
138				if (!Lang.isFunction(handler)) {
139					handler = function(params, callback) {
140						params.serviceClassName = moduleClassName.serviceClassName;
141						params.serviceMethodName = index;
142
143						return Liferay.Service.ajax(params, callback);
144					};
145				}
146
147				moduleClassName[index] = handler;
148			}
149		);
150	},
151
152	_getJSONParser: function() {
153		var instance = this;
154
155		if (!instance._JSONParser) {
156			var A = AUI();
157
158			if (!A.JSON) {
159				A = AUI({}).use('json');
160			}
161
162			instance._JSONParser = A.JSON;
163		}
164
165		return instance._JSONParser;
166	}
167};
168
169Liferay.Template = {
170	PORTLET: '<div class="portlet"><div class="portlet-topper"><div class="portlet-title"></div></div><div class="portlet-content"></div><div class="forbidden-action"></div></div>'
171}

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.