mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Cleanup and better rename settings screens to match template names
This commit is contained in:
parent
30116c183f
commit
4dd58f7c36
83 changed files with 267 additions and 323 deletions
|
|
@ -26,17 +26,14 @@ export class AbstractScreen {
|
|||
* @returns {void}
|
||||
*/
|
||||
onStart() {
|
||||
if (!this.__started) {
|
||||
this.__started = true;
|
||||
const routes = this.routes();
|
||||
if (arrayLength(routes)) {
|
||||
let route = new Crossroads(),
|
||||
fMatcher = (this.onRoute || (()=>0)).bind(this);
|
||||
const routes = this.routes();
|
||||
if (arrayLength(routes)) {
|
||||
let route = new Crossroads(),
|
||||
fMatcher = (this.onRoute || (()=>0)).bind(this);
|
||||
|
||||
routes.forEach(item => item && route && (route.addRoute(item[0], fMatcher).rules = item[1]));
|
||||
routes.forEach(item => item && route && (route.addRoute(item[0], fMatcher).rules = item[1]));
|
||||
|
||||
this.__cross = route;
|
||||
}
|
||||
this.__cross = route;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class AbstractView {
|
|||
constructor(templateID, type)
|
||||
{
|
||||
// Object.defineProperty(this, 'viewModelTemplateID', { value: templateID });
|
||||
// this.viewModelTemplateID = this.constructor.name;
|
||||
this.viewModelTemplateID = templateID;
|
||||
this.viewType = type;
|
||||
this.viewModelDom = null;
|
||||
|
|
|
|||
|
|
@ -278,7 +278,12 @@ export const
|
|||
}
|
||||
});
|
||||
|
||||
forEachObjectValue(SCREENS, vmScreen => vmScreen.onStart());
|
||||
forEachObjectValue(SCREENS, vmScreen => {
|
||||
if (!vmScreen.__started) {
|
||||
vmScreen.onStart();
|
||||
vmScreen.__started = true;
|
||||
}
|
||||
});
|
||||
|
||||
const cross = new Crossroads();
|
||||
cross.addRoute(/^([a-zA-Z0-9-]*)\/?(.*)$/, screenOnRoute);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export class AbstractSettingsScreen extends AbstractScreen {
|
|||
);
|
||||
|
||||
if (RoutedSettingsViewModel) {
|
||||
if (RoutedSettingsViewModel.__builded && RoutedSettingsViewModel.__vm) {
|
||||
if (RoutedSettingsViewModel.__vm) {
|
||||
settingsScreen = RoutedSettingsViewModel.__vm;
|
||||
} else {
|
||||
const vmPlace = elementById('rl-settings-subscreen');
|
||||
|
|
@ -43,7 +43,6 @@ export class AbstractSettingsScreen extends AbstractScreen {
|
|||
settingsScreen.viewModelDom = viewModelDom;
|
||||
|
||||
RoutedSettingsViewModel.__dom = viewModelDom;
|
||||
RoutedSettingsViewModel.__builded = true;
|
||||
RoutedSettingsViewModel.__vm = settingsScreen;
|
||||
|
||||
ko.applyBindingAccessorsToNode(
|
||||
|
|
@ -132,11 +131,12 @@ export class AbstractSettingsScreen extends AbstractScreen {
|
|||
* @returns {void}
|
||||
*/
|
||||
export function settingsAddViewModel(SettingsViewModelClass, template, labelName, route, isDefault = false) {
|
||||
let name = SettingsViewModelClass.name.replace(/(User|Admin)Settings/, '');
|
||||
SettingsViewModelClass.__rlSettingsData = {
|
||||
label: labelName,
|
||||
route: route,
|
||||
label: labelName || 'SETTINGS_LABELS/LABEL_' + name.toUpperCase() + '_NAME',
|
||||
route: route || name.toLowerCase(),
|
||||
selected: ko.observable(false),
|
||||
template: template,
|
||||
template: template || SettingsViewModelClass.name,
|
||||
isDefault: !!isDefault
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@ import { runSettingsViewModelHooks } from 'Common/Plugins';
|
|||
|
||||
import { AbstractSettingsScreen, settingsAddViewModel } from 'Screen/AbstractSettings';
|
||||
|
||||
import { GeneralAdminSettings } from 'Settings/Admin/General';
|
||||
import { DomainsAdminSettings } from 'Settings/Admin/Domains';
|
||||
import { LoginAdminSettings } from 'Settings/Admin/Login';
|
||||
import { ContactsAdminSettings } from 'Settings/Admin/Contacts';
|
||||
import { SecurityAdminSettings } from 'Settings/Admin/Security';
|
||||
import { PackagesAdminSettings } from 'Settings/Admin/Packages';
|
||||
import { AboutAdminSettings } from 'Settings/Admin/About';
|
||||
import { BrandingAdminSettings } from 'Settings/Admin/Branding';
|
||||
import { ConfigAdminSettings } from 'Settings/Admin/Config';
|
||||
import { AdminSettingsGeneral } from 'Settings/Admin/General';
|
||||
import { AdminSettingsDomains } from 'Settings/Admin/Domains';
|
||||
import { AdminSettingsLogin } from 'Settings/Admin/Login';
|
||||
import { AdminSettingsContacts } from 'Settings/Admin/Contacts';
|
||||
import { AdminSettingsSecurity } from 'Settings/Admin/Security';
|
||||
import { AdminSettingsPackages } from 'Settings/Admin/Packages';
|
||||
import { AdminSettingsAbout } from 'Settings/Admin/About';
|
||||
import { AdminSettingsBranding } from 'Settings/Admin/Branding';
|
||||
import { AdminSettingsConfig } from 'Settings/Admin/Config';
|
||||
|
||||
import { MenuSettingsAdminView } from 'View/Admin/Settings/Menu';
|
||||
import { PaneSettingsAdminView } from 'View/Admin/Settings/Pane';
|
||||
|
|
@ -19,30 +19,18 @@ export class SettingsAdminScreen extends AbstractSettingsScreen {
|
|||
constructor() {
|
||||
super([MenuSettingsAdminView, PaneSettingsAdminView]);
|
||||
|
||||
settingsAddViewModel(
|
||||
GeneralAdminSettings,
|
||||
'AdminSettingsGeneral',
|
||||
'TABS_LABELS/LABEL_GENERAL_NAME',
|
||||
'general',
|
||||
true
|
||||
);
|
||||
|
||||
[
|
||||
[DomainsAdminSettings, 'Domains'],
|
||||
[LoginAdminSettings, 'Login'],
|
||||
[BrandingAdminSettings, 'Branding'],
|
||||
[ContactsAdminSettings, 'Contacts'],
|
||||
[SecurityAdminSettings, 'Security'],
|
||||
[PackagesAdminSettings, 'Packages'],
|
||||
[ConfigAdminSettings, 'Config'],
|
||||
[AboutAdminSettings, 'About'],
|
||||
].forEach(item =>
|
||||
settingsAddViewModel(
|
||||
item[0],
|
||||
'AdminSettings'+item[1],
|
||||
'TABS_LABELS/LABEL_'+item[1].toUpperCase()+'_NAME',
|
||||
item[1].toLowerCase()
|
||||
)
|
||||
AdminSettingsGeneral,
|
||||
AdminSettingsDomains,
|
||||
AdminSettingsLogin,
|
||||
AdminSettingsBranding,
|
||||
AdminSettingsContacts,
|
||||
AdminSettingsSecurity,
|
||||
AdminSettingsPackages,
|
||||
AdminSettingsConfig,
|
||||
AdminSettingsAbout
|
||||
].forEach((item, index) =>
|
||||
settingsAddViewModel(item, 0, 0, 0, 0 === index)
|
||||
);
|
||||
|
||||
runSettingsViewModelHooks(true);
|
||||
|
|
|
|||
|
|
@ -82,20 +82,18 @@ export class MailBoxUserScreen extends AbstractScreen {
|
|||
* @returns {void}
|
||||
*/
|
||||
onStart() {
|
||||
if (!this.__started) {
|
||||
super.onStart();
|
||||
super.onStart();
|
||||
|
||||
addEventListener('mailbox.inbox-unread-count', e => {
|
||||
FolderUserStore.foldersInboxUnreadCount(e.detail);
|
||||
/* // Disabled in SystemDropDown.html
|
||||
const email = AccountUserStore.email();
|
||||
AccountUserStore.accounts.forEach(item =>
|
||||
item && email === item.email && item.count(e.detail)
|
||||
);
|
||||
addEventListener('mailbox.inbox-unread-count', e => {
|
||||
FolderUserStore.foldersInboxUnreadCount(e.detail);
|
||||
/* // Disabled in SystemDropDown.html
|
||||
const email = AccountUserStore.email();
|
||||
AccountUserStore.accounts.forEach(item =>
|
||||
item && email === item.email && item.count(e.detail)
|
||||
);
|
||||
*/
|
||||
this.updateWindowTitle();
|
||||
});
|
||||
}
|
||||
this.updateWindowTitle();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,14 +9,13 @@ import { ThemeStore } from 'Stores/Theme';
|
|||
|
||||
import { AbstractSettingsScreen, settingsAddViewModel } from 'Screen/AbstractSettings';
|
||||
|
||||
import { GeneralUserSettings } from 'Settings/User/General';
|
||||
import { ContactsUserSettings } from 'Settings/User/Contacts';
|
||||
import { AccountsUserSettings } from 'Settings/User/Accounts';
|
||||
import { FiltersUserSettings } from 'Settings/User/Filters';
|
||||
import { SecurityUserSettings } from 'Settings/User/Security';
|
||||
import { FoldersUserSettings } from 'Settings/User/Folders';
|
||||
import { ThemesUserSettings } from 'Settings/User/Themes';
|
||||
import { OpenPgpUserSettings } from 'Settings/User/OpenPgp';
|
||||
import { UserSettingsGeneral } from 'Settings/User/General';
|
||||
import { UserSettingsContacts } from 'Settings/User/Contacts';
|
||||
import { UserSettingsAccounts } from 'Settings/User/Accounts';
|
||||
import { UserSettingsFilters } from 'Settings/User/Filters';
|
||||
import { UserSettingsSecurity } from 'Settings/User/Security';
|
||||
import { UserSettingsFolders } from 'Settings/User/Folders';
|
||||
import { UserSettingsThemes } from 'Settings/User/Themes';
|
||||
|
||||
import { SystemDropDownUserView } from 'View/User/SystemDropDown';
|
||||
import { MenuSettingsUserView } from 'View/User/Settings/Menu';
|
||||
|
|
@ -26,40 +25,35 @@ export class SettingsUserScreen extends AbstractSettingsScreen {
|
|||
constructor() {
|
||||
super([SystemDropDownUserView, MenuSettingsUserView, PaneSettingsUserView]);
|
||||
|
||||
settingsAddViewModel(GeneralUserSettings, 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||
const views = [
|
||||
UserSettingsGeneral
|
||||
];
|
||||
|
||||
if (AppUserStore.allowContacts()) {
|
||||
settingsAddViewModel(ContactsUserSettings, 'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
views.push(UserSettingsContacts);
|
||||
}
|
||||
|
||||
if (SettingsCapa('AdditionalAccounts') || SettingsCapa('Identities')) {
|
||||
settingsAddViewModel(
|
||||
AccountsUserSettings,
|
||||
'SettingsAccounts',
|
||||
SettingsCapa('AdditionalAccounts')
|
||||
? 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME'
|
||||
: 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME',
|
||||
'accounts'
|
||||
);
|
||||
views.push(UserSettingsAccounts);
|
||||
}
|
||||
|
||||
if (SettingsCapa('Sieve')) {
|
||||
settingsAddViewModel(FiltersUserSettings, 'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
|
||||
views.push(UserSettingsFilters);
|
||||
}
|
||||
|
||||
if (SettingsCapa('AutoLogout')) {
|
||||
settingsAddViewModel(SecurityUserSettings, 'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
|
||||
if (SettingsCapa('AutoLogout') || SettingsCapa('OpenPGP') || SettingsCapa('GnuPG')) {
|
||||
views.push(UserSettingsSecurity);
|
||||
}
|
||||
|
||||
settingsAddViewModel(FoldersUserSettings, 'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders');
|
||||
views.push(UserSettingsFolders);
|
||||
|
||||
if (SettingsCapa('Themes')) {
|
||||
settingsAddViewModel(ThemesUserSettings, 'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
||||
views.push(UserSettingsThemes);
|
||||
}
|
||||
|
||||
if (SettingsCapa('OpenPGP') || SettingsCapa('GnuPG')) {
|
||||
settingsAddViewModel(OpenPgpUserSettings, 'SettingsOpenPGP', 'OpenPGP', 'openpgp');
|
||||
}
|
||||
views.forEach((item, index) =>
|
||||
settingsAddViewModel(item, item.name.replace('User', ''), 0, 0, 0 === index)
|
||||
);
|
||||
|
||||
runSettingsViewModelHooks(false);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
|||
import { Settings } from 'Common/Globals';
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
export class AboutAdminSettings /*extends AbstractViewSettings*/ {
|
||||
export class AdminSettingsAbout /*extends AbstractViewSettings*/ {
|
||||
constructor() {
|
||||
this.version = Settings.app('version');
|
||||
this.phpextensions = ko.observableArray();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
||||
|
||||
export class BrandingAdminSettings extends AbstractViewSettings {
|
||||
export class AdminSettingsBranding extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
this.addSetting('Title');
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
|||
import Remote from 'Remote/Admin/Fetch';
|
||||
import { forEachObjectEntry } from 'Common/Utils';
|
||||
|
||||
export class ConfigAdminSettings /*extends AbstractViewSettings*/ {
|
||||
export class AdminSettingsConfig /*extends AbstractViewSettings*/ {
|
||||
|
||||
constructor() {
|
||||
this.config = ko.observableArray();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import Remote from 'Remote/Admin/Fetch';
|
|||
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||
import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
||||
|
||||
export class ContactsAdminSettings extends AbstractViewSettings {
|
||||
export class AdminSettingsContacts extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
this.defaultOptionsAfterRender = defaultOptionsAfterRender;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import Remote from 'Remote/Admin/Fetch';
|
|||
import { DomainPopupView } from 'View/Popup/Domain';
|
||||
import { DomainAliasPopupView } from 'View/Popup/DomainAlias';
|
||||
|
||||
export class DomainsAdminSettings /*extends AbstractViewSettings*/ {
|
||||
export class AdminSettingsDomains /*extends AbstractViewSettings*/ {
|
||||
constructor() {
|
||||
this.domains = DomainAdminStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import { ThemeStore } from 'Stores/Theme';
|
|||
import { LanguageStore } from 'Stores/Language';
|
||||
import { LanguagesPopupView } from 'View/Popup/Languages';
|
||||
|
||||
export class GeneralAdminSettings extends AbstractViewSettings {
|
||||
export class AdminSettingsGeneral extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
||||
|
||||
export class LoginAdminSettings extends AbstractViewSettings {
|
||||
export class AdminSettingsLogin extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
this.addSetting('LoginDefaultDomain');
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { PluginPopupView } from 'View/Popup/Plugin';
|
|||
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||
import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
||||
|
||||
export class PackagesAdminSettings extends AbstractViewSettings {
|
||||
export class AdminSettingsPackages extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import Remote from 'Remote/Admin/Fetch';
|
|||
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||
import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
||||
|
||||
export class SecurityAdminSettings extends AbstractViewSettings {
|
||||
export class AdminSettingsSecurity extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { showScreenPopup } from 'Knoin/Knoin';
|
|||
import { AccountPopupView } from 'View/Popup/Account';
|
||||
import { IdentityPopupView } from 'View/Popup/Identity';
|
||||
|
||||
export class AccountsUserSettings /*extends AbstractViewSettings*/ {
|
||||
export class UserSettingsAccounts /*extends AbstractViewSettings*/ {
|
||||
constructor() {
|
||||
this.allowAdditionalAccount = SettingsCapa('AdditionalAccounts');
|
||||
this.allowIdentities = SettingsCapa('Identities');
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { SettingsGet } from 'Common/Globals';
|
|||
import { ContactUserStore } from 'Stores/User/Contact';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
export class ContactsUserSettings /*extends AbstractViewSettings*/ {
|
||||
export class UserSettingsContacts /*extends AbstractViewSettings*/ {
|
||||
constructor() {
|
||||
this.contactsAutosave = ko.observable(!!SettingsGet('ContactsAutosave'));
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { showScreenPopup } from 'Knoin/Knoin';
|
|||
|
||||
import { SieveScriptPopupView } from 'View/Popup/SieveScript';
|
||||
|
||||
export class FiltersUserSettings /*extends AbstractViewSettings*/ {
|
||||
export class UserSettingsFilters /*extends AbstractViewSettings*/ {
|
||||
constructor() {
|
||||
this.scripts = SieveUserStore.scripts;
|
||||
this.loading = ko.observable(false).extend({ debounce: 200 });
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import { loadFolders } from 'Model/FolderCollection';
|
|||
|
||||
const folderForDeletion = ko.observable(null).askDeleteHelper();
|
||||
|
||||
export class FoldersUserSettings /*extends AbstractViewSettings*/ {
|
||||
export class UserSettingsFolders /*extends AbstractViewSettings*/ {
|
||||
constructor() {
|
||||
this.showKolab = koComputable(() => FolderUserStore.hasCapability('METADATA') && SettingsCapa('Kolab'));
|
||||
this.defaultOptionsAfterRender = defaultOptionsAfterRender;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import Remote from 'Remote/User/Fetch';
|
|||
import { IdentityPopupView } from 'View/Popup/Identity';
|
||||
import { LanguagesPopupView } from 'View/Popup/Languages';
|
||||
|
||||
export class GeneralUserSettings extends AbstractViewSettings {
|
||||
export class UserSettingsGeneral extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
import { GnuPGUserStore } from 'Stores/User/GnuPG';
|
||||
import { OpenPGPUserStore } from 'Stores/User/OpenPGP';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
import { OpenPgpImportPopupView } from 'View/Popup/OpenPgpImport';
|
||||
import { OpenPgpGeneratePopupView } from 'View/Popup/OpenPgpGenerate';
|
||||
|
||||
import { SettingsCapa } from 'Common/Globals';
|
||||
|
||||
export class OpenPgpUserSettings /*extends AbstractViewSettings*/ {
|
||||
constructor() {
|
||||
this.gnupgPublicKeys = GnuPGUserStore.publicKeys;
|
||||
this.gnupgPrivateKeys = GnuPGUserStore.privateKeys;
|
||||
|
||||
this.openpgpkeysPublic = OpenPGPUserStore.publicKeys;
|
||||
this.openpgpkeysPrivate = OpenPGPUserStore.privateKeys;
|
||||
|
||||
this.canOpenPGP = SettingsCapa('OpenPGP');
|
||||
this.canGnuPG = GnuPGUserStore.isSupported();
|
||||
this.canMailvelope = !!window.mailvelope;
|
||||
|
||||
this.allowDraftAutosave = SettingsUserStore.allowDraftAutosave;
|
||||
|
||||
this.allowDraftAutosave.subscribe(value => Remote.saveSetting('AllowDraftAutosave', value))
|
||||
}
|
||||
|
||||
addOpenPgpKey() {
|
||||
showScreenPopup(OpenPgpImportPopupView);
|
||||
}
|
||||
|
||||
generateOpenPgpKey() {
|
||||
showScreenPopup(OpenPgpGeneratePopupView);
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
/**
|
||||
* Create an iframe to display the Mailvelope keyring settings.
|
||||
* The iframe will be injected into the container identified by selector.
|
||||
*/
|
||||
window.mailvelope && mailvelope.createSettingsContainer('#mailvelope-settings'/*[, keyring], options*/);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,17 @@ import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
|||
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
|
||||
export class SecurityUserSettings extends AbstractViewSettings {
|
||||
import { GnuPGUserStore } from 'Stores/User/GnuPG';
|
||||
import { OpenPGPUserStore } from 'Stores/User/OpenPGP';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
import { OpenPgpImportPopupView } from 'View/Popup/OpenPgpImport';
|
||||
import { OpenPgpGeneratePopupView } from 'View/Popup/OpenPgpGenerate';
|
||||
|
||||
export class UserSettingsSecurity extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -33,5 +43,35 @@ export class SecurityUserSettings extends AbstractViewSettings {
|
|||
if (this.capaAutoLogout) {
|
||||
this.addSetting('AutoLogout');
|
||||
}
|
||||
|
||||
this.gnupgPublicKeys = GnuPGUserStore.publicKeys;
|
||||
this.gnupgPrivateKeys = GnuPGUserStore.privateKeys;
|
||||
|
||||
this.openpgpkeysPublic = OpenPGPUserStore.publicKeys;
|
||||
this.openpgpkeysPrivate = OpenPGPUserStore.privateKeys;
|
||||
|
||||
this.canOpenPGP = SettingsCapa('OpenPGP');
|
||||
this.canGnuPG = GnuPGUserStore.isSupported();
|
||||
this.canMailvelope = !!window.mailvelope;
|
||||
|
||||
this.allowDraftAutosave = SettingsUserStore.allowDraftAutosave;
|
||||
|
||||
this.allowDraftAutosave.subscribe(value => Remote.saveSetting('AllowDraftAutosave', value))
|
||||
}
|
||||
|
||||
addOpenPgpKey() {
|
||||
showScreenPopup(OpenPgpImportPopupView);
|
||||
}
|
||||
|
||||
generateOpenPgpKey() {
|
||||
showScreenPopup(OpenPgpGeneratePopupView);
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
/**
|
||||
* Create an iframe to display the Mailvelope keyring settings.
|
||||
* The iframe will be injected into the container identified by selector.
|
||||
*/
|
||||
window.mailvelope && mailvelope.createSettingsContainer('#mailvelope-settings'/*[, keyring], options*/);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ addObservablesTo(themeBackground, {
|
|||
error: ''
|
||||
});
|
||||
|
||||
export class ThemesUserSettings /*extends AbstractViewSettings*/ {
|
||||
export class UserSettingsThemes /*extends AbstractViewSettings*/ {
|
||||
constructor() {
|
||||
this.theme = ThemeStore.theme;
|
||||
this.themes = ThemeStore.themes;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue