mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 06:58:27 +03:00
*.jsx -> *.js
This commit is contained in:
parent
0a2b826f71
commit
e88c193334
98 changed files with 341 additions and 340 deletions
76
dev/bootstrap.js
vendored
Normal file
76
dev/bootstrap.js
vendored
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
|
||||
import window from 'window';
|
||||
import $ from '$';
|
||||
import {killCtrlACtrlS, detectDropdownVisibility, createCommand} 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 = createCommand;
|
||||
|
||||
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) => {
|
||||
|
||||
$(() => {
|
||||
|
||||
window.setTimeout(() => {
|
||||
|
||||
if (window.rainloopTEMPLATES && window.rainloopTEMPLATES[0])
|
||||
{
|
||||
$('#rl-templates').html(window.rainloopTEMPLATES[0]);
|
||||
|
||||
window.setTimeout(() => {
|
||||
|
||||
$html
|
||||
.removeClass('no-js rl-booted-trigger')
|
||||
.addClass('rl-booted');
|
||||
|
||||
App.bootstart();
|
||||
|
||||
}, 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
fErrorCallback();
|
||||
}
|
||||
|
||||
window.__APP_BOOT = null;
|
||||
|
||||
}, 10);
|
||||
|
||||
});
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue