mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
CommonJS (research/4)
This commit is contained in:
parent
06bb124379
commit
8d73c7b1b2
127 changed files with 1893 additions and 1085 deletions
|
|
@ -1,9 +1,8 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
'use strict';
|
||||
|
||||
(function (module) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
$ = require('../External/jquery.js'),
|
||||
_ = require('../External/underscore.js'),
|
||||
|
|
@ -19,7 +18,6 @@
|
|||
|
||||
AppSettings = require('../Storages/AppSettings.js'),
|
||||
|
||||
kn = require('../Knoin/Knoin.js'),
|
||||
KnoinAbstractBoot = require('../Knoin/KnoinAbstractBoot.js')
|
||||
;
|
||||
|
||||
|
|
@ -143,6 +141,7 @@
|
|||
AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose)
|
||||
{
|
||||
var
|
||||
kn = require('../Knoin/Knoin.js'),
|
||||
sCustomLogoutLink = Utils.pString(AppSettings.settingsGet('CustomLogoutLink')),
|
||||
bInIframe = !!AppSettings.settingsGet('InIframe')
|
||||
;
|
||||
|
|
@ -192,19 +191,10 @@
|
|||
window.history.back();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} sQuery
|
||||
* @param {Function} fCallback
|
||||
*/
|
||||
AbstractApp.prototype.getAutocomplete = function (sQuery, fCallback)
|
||||
{
|
||||
fCallback([], sQuery);
|
||||
};
|
||||
|
||||
AbstractApp.prototype.bootstart = function ()
|
||||
{
|
||||
Events.pub('rl.bootstart');
|
||||
|
||||
|
||||
var ssm = require('../External/ssm.js');
|
||||
|
||||
Utils.initOnStartOrLangChange(function () {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
'use strict';
|
||||
|
||||
(function (module) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('../External/ko.js'),
|
||||
_ = require('../External/underscore.js'),
|
||||
window = require('../External/window.js'),
|
||||
|
||||
|
||||
Enums = require('../Common/Enums.js'),
|
||||
Utils = require('../Common/Utils.js'),
|
||||
LinkBuilder = require('../Common/LinkBuilder.js'),
|
||||
|
|
@ -18,7 +17,7 @@
|
|||
AppSettings = require('../Storages/AppSettings.js'),
|
||||
Data = require('../Storages/AdminDataStorage.js'),
|
||||
Remote = require('../Storages/AdminAjaxRemoteStorage.js'),
|
||||
|
||||
|
||||
AdminSettingsScreen = require('../Screens/AdminSettingsScreen.js'),
|
||||
AdminLoginScreen = require('../Screens/AdminLoginScreen.js'),
|
||||
|
||||
|
|
@ -97,14 +96,14 @@
|
|||
|
||||
kn.addSettingsViewModel(AdminSettingsAbout,
|
||||
'AdminSettingsAbout', 'About', 'about');
|
||||
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
AdminApp.prototype.reloadDomainList = function ()
|
||||
{
|
||||
Data.domainsLoading(true);
|
||||
|
||||
|
||||
Remote.domainList(function (sResult, oData) {
|
||||
Data.domainsLoading(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
|
|
@ -128,7 +127,7 @@
|
|||
Remote.pluginList(function (sResult, oData) {
|
||||
|
||||
Data.pluginsLoading(false);
|
||||
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
var aList = _.map(oData.Result, function (oItem) {
|
||||
|
|
|
|||
|
|
@ -1,29 +1,29 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
'use strict';
|
||||
|
||||
(function (module) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
window = require('../External/window.js'),
|
||||
_ = require('../External/underscore.js'),
|
||||
$ = require('../External/jquery.js'),
|
||||
$window = require('../External/$window.js'),
|
||||
$html = require('../External/$html.js'),
|
||||
|
||||
|
||||
Globals = require('../Common/Globals.js'),
|
||||
Plugins = require('../Common/Plugins.js'),
|
||||
Utils = require('../Common/Utils.js')
|
||||
;
|
||||
|
||||
module.exports = function (RL) {
|
||||
module.exports = function (App) {
|
||||
|
||||
Globals.__RL = RL;
|
||||
Globals.__RL = App;
|
||||
|
||||
RL.setupSettings();
|
||||
App.setupSettings();
|
||||
|
||||
Plugins.__boot = RL;
|
||||
Plugins.__remote = RL.remote();
|
||||
Plugins.__data = RL.data();
|
||||
Plugins.__boot = App;
|
||||
Plugins.__remote = App.remote();
|
||||
Plugins.__data = App.data();
|
||||
|
||||
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
|
||||
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
_.delay(function () {
|
||||
|
||||
RL.bootstart();
|
||||
App.bootstart();
|
||||
$html.removeClass('no-js rl-booted-trigger').addClass('rl-booted');
|
||||
|
||||
}, 50);
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
'use strict';
|
||||
|
||||
(function (module) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
window = require('../External/window.js'),
|
||||
$ = require('../External/jquery.js'),
|
||||
_ = require('../External/underscore.js'),
|
||||
moment = require('../External/moment.js'),
|
||||
|
||||
|
||||
Enums = require('../Common/Enums.js'),
|
||||
Globals = require('../Common/Globals.js'),
|
||||
Consts = require('../Common/Consts.js'),
|
||||
|
|
@ -26,11 +25,13 @@
|
|||
Cache = require('../Storages/WebMailCacheStorage.js'),
|
||||
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
|
||||
|
||||
EmailModel = require('../Models/EmailModel.js'),
|
||||
FolderModel = require('../Models/FolderModel.js'),
|
||||
MessageModel = require('../Models/MessageModel.js'),
|
||||
AccountModel = require('../Models/AccountModel.js'),
|
||||
IdentityModel = require('../Models/IdentityModel.js'),
|
||||
|
||||
IdentityModel = require('../Models/IdentityModel.js'),
|
||||
OpenPgpKeyModel = require('../Models/OpenPgpKeyModel.js'),
|
||||
|
||||
PopupsFolderSystemViewModel = require('../ViewModels/Popups/PopupsAskViewModel.js'),
|
||||
PopupsAskViewModel = require('../ViewModels/Popups/PopupsAskViewModel.js'),
|
||||
PopupsComposeViewModel = require('../ViewModels/Popups/PopupsComposeViewModel.js'),
|
||||
|
|
@ -90,6 +91,7 @@
|
|||
}, 60000 * 5);
|
||||
|
||||
$.wakeUp(function () {
|
||||
|
||||
Remote.jsVersion(function (sResult, oData) {
|
||||
if (Enums.StorageResultType.Success === sResult && oData && !oData.Result)
|
||||
{
|
||||
|
|
@ -103,6 +105,7 @@
|
|||
}
|
||||
}
|
||||
}, self.settingsGet('Version'));
|
||||
|
||||
}, {}, 60 * 60 * 1000);
|
||||
|
||||
|
||||
|
|
@ -176,9 +179,9 @@
|
|||
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
|
||||
}
|
||||
|
||||
if (!AppSettings.settingsGet('AllowGoogleSocial') &&
|
||||
!AppSettings.settingsGet('AllowFacebookSocial') &&
|
||||
!AppSettings.settingsGet('AllowTwitterSocial'))
|
||||
if (AppSettings.settingsGet('AllowGoogleSocial') ||
|
||||
AppSettings.settingsGet('AllowFacebookSocial') ||
|
||||
AppSettings.settingsGet('AllowTwitterSocial'))
|
||||
{
|
||||
kn.addSettingsViewModel(SettingsSocial,
|
||||
'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
|
||||
|
|
@ -204,7 +207,7 @@
|
|||
kn.addSettingsViewModel(SettingsOpenPGP,
|
||||
'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
|
@ -272,7 +275,7 @@
|
|||
|
||||
RainLoopApp.prototype.reloadMessageListHelper = function (bEmptyList)
|
||||
{
|
||||
self.reloadMessageList(bEmptyList);
|
||||
this.reloadMessageList(bEmptyList);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1081,6 +1084,7 @@
|
|||
RainLoopApp.prototype.folderResponseParseRec = function (sNamespace, aFolders)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
iIndex = 0,
|
||||
iLen = 0,
|
||||
oFolder = null,
|
||||
|
|
@ -1110,10 +1114,7 @@
|
|||
|
||||
if (oCacheFolder)
|
||||
{
|
||||
if (Globals.__RL)
|
||||
{
|
||||
oCacheFolder.collapsed(!Globals.__RL.isFolderExpanded(oCacheFolder.fullNameHash));
|
||||
}
|
||||
oCacheFolder.collapsed(!self.isFolderExpanded(oCacheFolder.fullNameHash));
|
||||
|
||||
if (oFolder.Extended)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue