PageSourceSearch

https://prowizard.store/bitrix/templates/universe_s1/js/components.js

js prowizard.store collected 2026-10-08 15:00:12 UTC 3,044 bytes, 106 lines download raw bytes

1universe.components = (function (universe, $, api) {
2    var self = {},
3        popup;
4
5    /**
6     *
7     * @param options
8     * @option component Component name
9     * @option template Template of component
10     * @option parameters Parameters of component
11     * @param callback Callback function when given form code
12     */
13    self.get = function (options, callback) {
14        options = api.extend({
15            'component': null,
16            'template': null,
17            'parameters': null
18        }, options);
19
20        universe.page('components.get', {
21            component: options.component,
22            template: options.template,
23            parameters: options.parameters
24        }, {}, callback);
25    };
26
27    /**
28     *
29     * @param options Component name
30     * @option component Component name
31     * @option template Template of component
32     * @option parameters Parameters of component
33     * @option settings
34     * Object like:
35     * {
36     *     title: 'Title of popup',
37     *     parameters: {Parameters of BX.PopupWindow}
38     * }
39     * @param callback Callback function when end
40     * Callback variables:
41     * - this - BX.PopupWindow instance
42     * - options - Options object
43     * - fields - Fields object
44     * - parameters - Parameters object of BX.PopupWindow
45     */
46    self.show = function (options, callback) {
47        self.get(options, function (response) {
48            var container;
49            var settings;
50            var parameters;
51            var abjuster;
52
53            if (popup) {
54                popup.destroy();
55            }
56
57            settings = api.extend({}, options.settings);
58            options.settings = undefined;
59
60            container = $('<div>', {
61                'style': 'display: none'
62            }).append(response).appendTo($('body'));
63            container = container.get(0);
64
65            parameters = api.extend({
66                content: container,
67                closeIcon: {},
68                zIndex: 0,
69                offsetLeft: 0,
70                offsetTop: 0,
71                width: 450,
72                overlay: true
73            }, settings.parameters);
74
75            if (settings.width)
76                parameters.width = settings.width;
77
78            if (settings.title) {
79                parameters.titleBar = {
80                    content: BX.create('span', {
81                        html: settings.title,
82                        props: {
83                            className: 'access-title-bar'
84                        }
85                    })
86                }
87            }
88
89            popup = new BX.PopupWindow('UniverseComponent', null, parameters);
90            popup.show();
91
92            setTimeout(function () {
93                popup.adjustPosition();
94            }, 50);
95
96            setTimeout(function () {
97                popup.adjustPosition();
98            }, 250);
99
100            if (api.isFunction(callback))
101                callback.call(popup, options, settings);
102        });
103    };
104
105    return self;
106})(universe, jQuery, intec);

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.