forked from RainLoop/rainloop-webmail
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.js
More file actions
73 lines (51 loc) · 1.63 KB
/
Copy pathbootstrap.js
File metadata and controls
73 lines (51 loc) · 1.63 KB
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
import window from 'window';
import {killCtrlACtrlS, detectDropdownVisibility, createCommandLegacy, domReady} from 'Common/Utils';
import {$win, $html, data as GlobalsData, bMobileDevice} from 'Common/Globals';
import * as Enums from 'Common/Enums';
import * as Plugins from 'Common/Plugins';
import {i18n} from 'Common/Translator';
import {EmailModel} from 'Model/Email';
export default (App) => {
GlobalsData.__APP__ = App;
$win
.on('keydown', killCtrlACtrlS)
.on('unload', () => {
GlobalsData.bUnload = true;
});
$html
.addClass(bMobileDevice ? 'mobile' : 'no-mobile')
.on('click.dropdown.data-api', detectDropdownVisibility);
const rl = window.rl || {};
rl.i18n = i18n;
rl.createCommand = createCommandLegacy;
rl.addSettingsViewModel = Plugins.addSettingsViewModel;
rl.addSettingsViewModelForAdmin = Plugins.addSettingsViewModelForAdmin;
rl.addHook = Plugins.addHook;
rl.settingsGet = Plugins.mainSettingsGet;
rl.pluginSettingsGet = Plugins.settingsGet;
rl.pluginRemoteRequest = Plugins.remoteRequest;
rl.EmailModel = EmailModel;
rl.Enums = Enums;
window.rl = rl;
window.__APP_BOOT = (fErrorCallback) => {
domReady(() => {
window.setTimeout(() => {
if (window.rainloopTEMPLATES && window.rainloopTEMPLATES[0])
{
window.document.getElementById('rl-templates').innerHTML = window.rainloopTEMPLATES[0];
window.setTimeout(() => {
$html
.removeClass('no-js rl-booted-trigger')
.addClass('rl-booted');
App.bootstart();
}, Enums.Magics.Time10ms);
}
else
{
fErrorCallback();
}
window.__APP_BOOT = null;
}, Enums.Magics.Time10ms);
});
};
};