PageSourceSearch

https://web.girona.cat/o/frontend-js-web/liferay/lazy_load.js

js girona.cat collected 2026-09-24 09:05:57 UTC 1,299 bytes, 60 lines download raw bytes

1/**
2 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
3 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
4 */
5
6(function () {
7	Liferay.lazyLoad = function () {
8		let failureCallback;
9
10		const isFunction = function (val) {
11			return typeof val === 'function';
12		};
13
14		let modules;
15		let successCallback;
16
17		if (Array.isArray(arguments[0])) {
18			modules = arguments[0];
19
20			successCallback = isFunction(arguments[1]) ? arguments[1] : null;
21			failureCallback = isFunction(arguments[2]) ? arguments[2] : null;
22		}
23		else {
24			modules = [];
25
26			for (let i = 0; i < arguments.length; ++i) {
27				if (typeof arguments[i] === 'string') {
28					modules[i] = arguments[i];
29				}
30				else if (isFunction(arguments[i])) {
31					successCallback = arguments[i];
32					failureCallback = isFunction(arguments[++i])
33						? arguments[i]
34						: null;
35					break;
36				}
37			}
38		}
39
40		return function () {
41			const args = [];
42
43			for (let i = 0; i < arguments.length; ++i) {
44				args.push(arguments[i]);
45			}
46
47			Liferay.Loader.require(
48				modules,
49				function () {
50					for (let i = 0; i < arguments.length; ++i) {
51						args.splice(i, 0, arguments[i]);
52					}
53
54					successCallback.apply(successCallback, args);
55				},
56				failureCallback
57			);
58		};
59	};
60})();

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.