forked from azproduction/lmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-prod.ru.js
165 lines (140 loc) · 5.18 KB
/
index-prod.ru.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// This file was automatically generated from "index.lmd.json" using mixins "prod.lmd.json", "ru.lmd.json"
(function (global, main, modules, modules_options, options) {
var initialized_modules = {},
global_eval = function (code) {
return global.Function('return ' + code)();
},
global_document = global.document,
local_undefined,
/**
* @param {String} moduleName module name or path to file
* @param {*} module module content
*
* @returns {*}
*/
register_module = function (moduleName, module) {
lmd_trigger('lmd-register:before-register', moduleName, module);
// Predefine in case of recursive require
var output = {'exports': {}};
initialized_modules[moduleName] = 1;
modules[moduleName] = output.exports;
if (!module) {
// if undefined - try to pick up module from globals (like jQuery)
// or load modules from nodejs/worker environment
module = lmd_trigger('js:request-environment-module', moduleName, module)[1] || global[moduleName];
} else if (typeof module === 'function') {
// Ex-Lazy LMD module or unpacked module ("pack": false)
var module_require = lmd_trigger('lmd-register:decorate-require', moduleName, lmd_require)[1];
// Make sure that sandboxed modules cant require
if (modules_options[moduleName] &&
modules_options[moduleName].sandbox &&
typeof module_require === 'function') {
module_require = local_undefined;
}
module = module(module_require, output.exports, output) || output.exports;
}
module = lmd_trigger('lmd-register:after-register', moduleName, module)[1];
return modules[moduleName] = module;
},
/**
* List of All lmd Events
*
* @important Do not rename it!
*/
lmd_events = {},
/**
* LMD event trigger function
*
* @important Do not rename it!
*/
lmd_trigger = function (event, data, data2, data3) {
var list = lmd_events[event],
result;
if (list) {
for (var i = 0, c = list.length; i < c; i++) {
result = list[i](data, data2, data3) || result;
if (result) {
// enable decoration
data = result[0] || data;
data2 = result[1] || data2;
data3 = result[2] || data3;
}
}
}
return result || [data, data2, data3];
},
/**
* LMD event register function
*
* @important Do not rename it!
*/
lmd_on = function (event, callback) {
if (!lmd_events[event]) {
lmd_events[event] = [];
}
lmd_events[event].push(callback);
},
/**
* @param {String} moduleName module name or path to file
*
* @returns {*}
*/
lmd_require = function (moduleName) {
var module = modules[moduleName];
var replacement = lmd_trigger('*:rewrite-shortcut', moduleName, module);
if (replacement) {
moduleName = replacement[0];
module = replacement[1];
}
lmd_trigger('*:before-check', moduleName, module);
// Already inited - return as is
if (initialized_modules[moduleName] && module) {
return module;
}
lmd_trigger('*:before-init', moduleName, module);
// Lazy LMD module not a string
if (typeof module === 'string' && module.indexOf('(function(') === 0) {
module = global_eval(module);
}
return register_module(moduleName, module);
},
output = {'exports': {}},
/**
* Sandbox object for plugins
*
* @important Do not rename it!
*/
sandbox = {
'global': global,
'modules': modules,
'modules_options': modules_options,
'options': options,
'eval': global_eval,
'register': register_module,
'require': lmd_require,
'initialized': initialized_modules,
'document': global_document,
'on': lmd_on,
'trigger': lmd_trigger,
'undefined': local_undefined
};
for (var moduleName in modules) {
// reset module init flag in case of overwriting
initialized_modules[moduleName] = 0;
}
main(lmd_trigger('lmd-register:decorate-require', 'main', lmd_require)[1], output.exports, output);
})/*DO NOT ADD ; !*/
(this,(function (require, exports, module) { /* wrapped by builder */
/**
* LMD glob example
*/
$(function () {
});
}),{
"locale": {
"hi": "Привет"
},
"options": {
"host": "http://prod.host/"
}
},{},{});