mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Uploading and preparing the repository to the dev version.
Original unminified source code (dev folder - js, css, less) (fixes #6) Grunt build system Multiple identities correction (fixes #9) Compose html editor (fixes #12) New general settings - Loading Description New warning about default admin password Split general and login screen settings
This commit is contained in:
parent
afad45137e
commit
4cc2207513
846 changed files with 99453 additions and 2123 deletions
122
dev/Admin/General.js
Normal file
122
dev/Admin/General.js
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminGeneral()
|
||||
{
|
||||
var oData = RL.data();
|
||||
|
||||
this.mainLanguage = oData.mainLanguage;
|
||||
this.mainTheme = oData.mainTheme;
|
||||
|
||||
this.language = oData.language;
|
||||
this.theme = oData.theme;
|
||||
|
||||
this.allowThemes = oData.allowThemes;
|
||||
this.allowCustomTheme = oData.allowCustomTheme;
|
||||
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
||||
this.allowAdditionalAccounts = oData.allowAdditionalAccounts;
|
||||
this.allowIdentities = oData.allowIdentities;
|
||||
|
||||
this.title = ko.observable(RL.settingsGet('Title'));
|
||||
this.loadingDesc = ko.observable(RL.settingsGet('LoadingDescription'));
|
||||
|
||||
this.themesOptions = ko.computed(function () {
|
||||
return _.map(oData.themes(), function (sTheme) {
|
||||
return {
|
||||
'optValue': sTheme,
|
||||
'optText': Utils.convertThemeName(sTheme)
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
this.languagesOptions = ko.computed(function () {
|
||||
return _.map(oData.languages(), function (sLanguage) {
|
||||
return {
|
||||
'optValue': sLanguage,
|
||||
'optText': Utils.convertLangName(sLanguage)
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
this.contactsSupported = RL.settingsGet('ContactsIsSupported');
|
||||
this.contactsIsAllowed = RL.settingsGet('ContactsIsAllowed');
|
||||
this.weakPassword = !!RL.settingsGet('WeakPassword');
|
||||
|
||||
this.titleTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.languageTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.loadingDescTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
Utils.addSettingsViewModel(AdminGeneral, 'AdminSettingsGeneral', 'General', 'general', true);
|
||||
|
||||
AdminGeneral.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
_.delay(function () {
|
||||
|
||||
var
|
||||
f1 = Utils.settingsSaveHelperSimpleFunction(self.titleTrigger, self),
|
||||
f2 = Utils.settingsSaveHelperSimpleFunction(self.languageTrigger, self),
|
||||
f3 = Utils.settingsSaveHelperSimpleFunction(self.themeTrigger, self),
|
||||
f4 = Utils.settingsSaveHelperSimpleFunction(self.loadingDescTrigger, self)
|
||||
;
|
||||
|
||||
self.title.subscribe(function (sValue) {
|
||||
RL.remote().saveAdminConfig(f1, {
|
||||
'Title': Utils.trim(sValue)
|
||||
});
|
||||
});
|
||||
|
||||
self.loadingDesc.subscribe(function (sValue) {
|
||||
RL.remote().saveAdminConfig(f4, {
|
||||
'LoadingDescription': Utils.trim(sValue)
|
||||
});
|
||||
});
|
||||
|
||||
self.language.subscribe(function (sValue) {
|
||||
RL.remote().saveAdminConfig(f2, {
|
||||
'Language': Utils.trim(sValue)
|
||||
});
|
||||
});
|
||||
|
||||
self.theme.subscribe(function (sValue) {
|
||||
RL.remote().saveAdminConfig(f3, {
|
||||
'Theme': Utils.trim(sValue)
|
||||
});
|
||||
});
|
||||
|
||||
self.allowCustomTheme.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'AllowCustomTheme': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
self.allowAdditionalAccounts.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'AllowAdditionalAccounts': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
self.allowIdentities.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'AllowIdentities': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
self.allowThemes.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'AllowThemes': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
self.allowLanguagesOnSettings.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'AllowLanguagesOnSettings': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
}, 50);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue