2013-11-16 06:21:12 +08:00
|
|
|
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
|
|
|
|
2014-08-20 23:03:12 +08:00
|
|
|
(function (module) {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var
|
2014-08-21 23:08:34 +08:00
|
|
|
Enums = require('../Common/Enums.js'),
|
2014-08-22 23:08:56 +08:00
|
|
|
Utils = require('../Common/Utils.js'),
|
|
|
|
|
|
|
|
AppSettings = require('./AppSettings.js')
|
2014-08-20 23:03:12 +08:00
|
|
|
;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
function AbstractData()
|
|
|
|
{
|
|
|
|
Utils.initDataConstructorBySettings(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
AbstractData.prototype.populateDataOnStart = function()
|
|
|
|
{
|
|
|
|
var
|
2014-08-22 23:08:56 +08:00
|
|
|
mLayout = Utils.pInt(AppSettings.settingsGet('Layout')),
|
|
|
|
aLanguages = AppSettings.settingsGet('Languages'),
|
|
|
|
aThemes = AppSettings.settingsGet('Themes')
|
2014-08-20 23:03:12 +08:00
|
|
|
;
|
|
|
|
|
|
|
|
if (Utils.isArray(aLanguages))
|
2014-04-08 06:36:38 +08:00
|
|
|
{
|
2014-08-20 23:03:12 +08:00
|
|
|
this.languages(aLanguages);
|
2014-04-08 06:36:38 +08:00
|
|
|
}
|
2014-08-20 23:03:12 +08:00
|
|
|
|
|
|
|
if (Utils.isArray(aThemes))
|
2014-04-08 06:36:38 +08:00
|
|
|
{
|
2014-08-20 23:03:12 +08:00
|
|
|
this.themes(aThemes);
|
2014-04-08 06:36:38 +08:00
|
|
|
}
|
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.mainLanguage(AppSettings.settingsGet('Language'));
|
|
|
|
this.mainTheme(AppSettings.settingsGet('Theme'));
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.capaAdditionalAccounts(AppSettings.capa(Enums.Capa.AdditionalAccounts));
|
|
|
|
this.capaAdditionalIdentities(AppSettings.capa(Enums.Capa.AdditionalIdentities));
|
|
|
|
this.capaGravatar(AppSettings.capa(Enums.Capa.Gravatar));
|
|
|
|
this.determineUserLanguage(!!AppSettings.settingsGet('DetermineUserLanguage'));
|
|
|
|
this.determineUserDomain(!!AppSettings.settingsGet('DetermineUserDomain'));
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.capaThemes(AppSettings.capa(Enums.Capa.Themes));
|
|
|
|
this.allowLanguagesOnLogin(!!AppSettings.settingsGet('AllowLanguagesOnLogin'));
|
|
|
|
this.allowLanguagesOnSettings(!!AppSettings.settingsGet('AllowLanguagesOnSettings'));
|
|
|
|
this.useLocalProxyForExternalImages(!!AppSettings.settingsGet('UseLocalProxyForExternalImages'));
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.editorDefaultType(AppSettings.settingsGet('EditorDefaultType'));
|
|
|
|
this.showImages(!!AppSettings.settingsGet('ShowImages'));
|
|
|
|
this.contactsAutosave(!!AppSettings.settingsGet('ContactsAutosave'));
|
|
|
|
this.interfaceAnimation(AppSettings.settingsGet('InterfaceAnimation'));
|
2014-05-16 23:57:50 +08:00
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.mainMessagesPerPage(AppSettings.settingsGet('MPP'));
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.desktopNotifications(!!AppSettings.settingsGet('DesktopNotifications'));
|
|
|
|
this.useThreads(!!AppSettings.settingsGet('UseThreads'));
|
|
|
|
this.replySameFolder(!!AppSettings.settingsGet('ReplySameFolder'));
|
|
|
|
this.useCheckboxesInList(!!AppSettings.settingsGet('UseCheckboxesInList'));
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-20 23:03:12 +08:00
|
|
|
this.layout(Enums.Layout.SidePreview);
|
|
|
|
if (-1 < Utils.inArray(mLayout, [Enums.Layout.NoPreview, Enums.Layout.SidePreview, Enums.Layout.BottomPreview]))
|
|
|
|
{
|
|
|
|
this.layout(mLayout);
|
|
|
|
}
|
2014-08-22 23:08:56 +08:00
|
|
|
this.facebookSupported(!!AppSettings.settingsGet('SupportedFacebookSocial'));
|
|
|
|
this.facebookEnable(!!AppSettings.settingsGet('AllowFacebookSocial'));
|
|
|
|
this.facebookAppID(AppSettings.settingsGet('FacebookAppID'));
|
|
|
|
this.facebookAppSecret(AppSettings.settingsGet('FacebookAppSecret'));
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.twitterEnable(!!AppSettings.settingsGet('AllowTwitterSocial'));
|
|
|
|
this.twitterConsumerKey(AppSettings.settingsGet('TwitterConsumerKey'));
|
|
|
|
this.twitterConsumerSecret(AppSettings.settingsGet('TwitterConsumerSecret'));
|
2014-06-26 06:40:26 +08:00
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.googleEnable(!!AppSettings.settingsGet('AllowGoogleSocial'));
|
|
|
|
this.googleClientID(AppSettings.settingsGet('GoogleClientID'));
|
|
|
|
this.googleClientSecret(AppSettings.settingsGet('GoogleClientSecret'));
|
|
|
|
this.googleApiKey(AppSettings.settingsGet('GoogleApiKey'));
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.dropboxEnable(!!AppSettings.settingsGet('AllowDropboxSocial'));
|
|
|
|
this.dropboxApiKey(AppSettings.settingsGet('DropboxApiKey'));
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-22 23:08:56 +08:00
|
|
|
this.contactsIsAllowed(!!AppSettings.settingsGet('ContactsIsAllowed'));
|
2014-08-20 23:03:12 +08:00
|
|
|
};
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-20 23:03:12 +08:00
|
|
|
module.exports = AbstractData;
|
2013-11-16 06:21:12 +08:00
|
|
|
|
2014-08-20 23:03:12 +08:00
|
|
|
}(module));
|