mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-13 02:55:24 +08:00
27d4bd74ad
Code refactoring
77 lines
No EOL
1.7 KiB
JavaScript
77 lines
No EOL
1.7 KiB
JavaScript
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
module.exports = function (App) {
|
|
|
|
var
|
|
window = require('window'),
|
|
_ = require('_'),
|
|
$ = require('$'),
|
|
|
|
Globals = require('Common/Globals'),
|
|
Plugins = require('Common/Plugins'),
|
|
Utils = require('Common/Utils'),
|
|
Enums = require('Common/Enums'),
|
|
|
|
EmailModel = require('Model:Email')
|
|
;
|
|
|
|
Globals.__APP = App;
|
|
|
|
Plugins.__boot = App;
|
|
Plugins.__remote = App.remote();
|
|
Plugins.__data = App.data();
|
|
|
|
Globals.$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
|
|
|
|
Globals.$win.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS);
|
|
|
|
Globals.$win.unload(function () {
|
|
Globals.bUnload = true;
|
|
});
|
|
|
|
Globals.$html.on('click.dropdown.data-api', function () {
|
|
Utils.detectDropdownVisibility();
|
|
});
|
|
|
|
// export
|
|
window['rl'] = window['rl'] || {};
|
|
window['rl']['addHook'] = _.bind(Plugins.addHook, Plugins);
|
|
window['rl']['settingsGet'] = _.bind(Plugins.mainSettingsGet, Plugins);
|
|
window['rl']['remoteRequest'] = _.bind(Plugins.remoteRequest, Plugins);
|
|
window['rl']['pluginSettingsGet'] = _.bind(Plugins.settingsGet, Plugins);
|
|
window['rl']['createCommand'] = Utils.createCommand;
|
|
|
|
window['rl']['EmailModel'] = EmailModel;
|
|
window['rl']['Enums'] = Enums;
|
|
|
|
window['__APP_BOOT'] = function (fCall) {
|
|
|
|
// boot
|
|
$(function () {
|
|
|
|
if (window['rainloopTEMPLATES'] && window['rainloopTEMPLATES'][0])
|
|
{
|
|
$('#rl-templates').html(window['rainloopTEMPLATES'][0]);
|
|
|
|
_.delay(function () {
|
|
|
|
App.bootstart();
|
|
Globals.$html.removeClass('no-js rl-booted-trigger').addClass('rl-booted');
|
|
|
|
}, 10);
|
|
}
|
|
else
|
|
{
|
|
fCall(false);
|
|
}
|
|
|
|
window['__APP_BOOT'] = null;
|
|
});
|
|
};
|
|
|
|
};
|
|
|
|
}()); |