mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Found more JSON properties to change into JavaScript camelCase
This commit is contained in:
parent
b9ef8ae2c9
commit
974350ebee
45 changed files with 361 additions and 412 deletions
|
|
@ -79,7 +79,7 @@ export class AppUser extends AbstractApp {
|
|||
(currentTime > (lastTime + interval + 1000))
|
||||
&& Remote.request('Version',
|
||||
iError => (100 < iError) && location.reload(),
|
||||
{ Version: Settings.app('version') }
|
||||
{ version: Settings.app('version') }
|
||||
);
|
||||
lastTime = currentTime;
|
||||
}, interval);
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ folderInformationMultiply = (boot = false) => {
|
|||
boot && setTimeout(() => folderInformationMultiply(true), 2000);
|
||||
}
|
||||
}, {
|
||||
Folders: folders
|
||||
folders: folders
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
@ -226,11 +226,11 @@ messagesMoveHelper = (fromFolderFullName, toFolderFullName, uidsForMove) => {
|
|||
Remote.abort('MessageList').request('MessageMove',
|
||||
moveOrDeleteResponseHelper,
|
||||
{
|
||||
FromFolder: fromFolderFullName,
|
||||
ToFolder: toFolderFullName,
|
||||
Uids: [...uidsForMove].join(','),
|
||||
MarkAsRead: (isSpam || FolderUserStore.trashFolder() === toFolderFullName) ? 1 : 0,
|
||||
Learning: isSpam ? 'SPAM' : isHam ? 'HAM' : ''
|
||||
fromFolder: fromFolderFullName,
|
||||
toFolder: toFolderFullName,
|
||||
uids: [...uidsForMove].join(','),
|
||||
markAsRead: (isSpam || FolderUserStore.trashFolder() === toFolderFullName) ? 1 : 0,
|
||||
learning: isSpam ? 'SPAM' : isHam ? 'HAM' : ''
|
||||
}
|
||||
);
|
||||
},
|
||||
|
|
@ -240,7 +240,7 @@ messagesDeleteHelper = (sFromFolderFullName, aUidForRemove) => {
|
|||
moveOrDeleteResponseHelper,
|
||||
{
|
||||
folder: sFromFolderFullName,
|
||||
Uids: [...aUidForRemove].join(',')
|
||||
uids: [...aUidForRemove].join(',')
|
||||
}
|
||||
);
|
||||
},
|
||||
|
|
@ -259,9 +259,9 @@ moveMessagesToFolder = (sFromFolderFullName, oUids, sToFolderFullName, bCopy) =>
|
|||
if (oFromFolder && oToFolder) {
|
||||
bCopy
|
||||
? Remote.request('MessageCopy', null, {
|
||||
FromFolder: oFromFolder.fullName,
|
||||
ToFolder: oToFolder.fullName,
|
||||
Uids: [...oUids].join(',')
|
||||
fromFolder: oFromFolder.fullName,
|
||||
toFolder: oToFolder.fullName,
|
||||
uids: [...oUids].join(',')
|
||||
})
|
||||
: messagesMoveHelper(oFromFolder.fullName, oToFolder.fullName, oUids);
|
||||
|
||||
|
|
@ -283,7 +283,7 @@ dropFilesInFolder = (sFolderFullName, files) => {
|
|||
++count;
|
||||
let data = new FormData;
|
||||
data.append('folder', sFolderFullName);
|
||||
data.append('AppendFile', file);
|
||||
data.append('appendFile', file);
|
||||
data.XToken = Settings.app('token');
|
||||
fetch(serverRequest('Append'), {
|
||||
method: 'POST',
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { SettingsUserStore } from 'Stores/User/Settings';
|
|||
import * as Local from 'Storage/Client';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
import { attachmentDownload } from 'Common/Links';
|
||||
|
||||
export const
|
||||
|
||||
|
|
@ -42,6 +43,28 @@ download = (link, name = "") => {
|
|||
}
|
||||
},
|
||||
|
||||
downloadZip = (hashes, onError, fTrigger, folder) => {
|
||||
if (hashes.length) {
|
||||
let params = {
|
||||
target: 'zip',
|
||||
hashes: hashes
|
||||
};
|
||||
if (!onError) {
|
||||
onError = () => alert('Download failed');
|
||||
}
|
||||
if (folder) {
|
||||
params.folder = folder;
|
||||
// params.uids = uids;
|
||||
}
|
||||
Remote.post('AttachmentsActions', fTrigger || null, params)
|
||||
.then(result => {
|
||||
let hash = result?.Result?.fileHash;
|
||||
hash ? download(attachmentDownload(hash), hash+'.zip') : onError();
|
||||
})
|
||||
.catch(onError);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns {function}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -301,8 +301,8 @@ export class FolderModel extends AbstractModel {
|
|||
this.exists = true;
|
||||
|
||||
this.hash = '';
|
||||
// this.id = null;
|
||||
this.uidNext = null;
|
||||
this.id = 0;
|
||||
this.uidNext = 0;
|
||||
|
||||
addObservablesTo(this, {
|
||||
name: '',
|
||||
|
|
|
|||
|
|
@ -44,9 +44,9 @@ const
|
|||
}
|
||||
}, {
|
||||
folder: message.folder,
|
||||
Uids: message.uid,
|
||||
Keyword: keyword,
|
||||
SetAction: isSet ? 0 : 1
|
||||
uids: message.uid,
|
||||
keyword: keyword,
|
||||
setAction: isSet ? 0 : 1
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -59,10 +59,10 @@ export class AdminSettingsAbout /*extends AbstractViewSettings*/ {
|
|||
this.coreChecking(false);
|
||||
if (!iError && data?.Result) {
|
||||
this.coreReal(true);
|
||||
this.coreUpdatable(!!data.Result.Updatable);
|
||||
this.coreWarning(!!data.Result.Warning);
|
||||
this.coreVersion(data.Result.Version || '');
|
||||
this.coreVersionCompare(data.Result.VersionCompare);
|
||||
this.coreUpdatable(!!data.Result.updatable);
|
||||
this.coreWarning(!!data.Result.warning);
|
||||
this.coreVersion(data.Result.version || '');
|
||||
this.coreVersionCompare(data.Result.versionCompare);
|
||||
} else {
|
||||
this.coreReal(false);
|
||||
this.coreWarning(false);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export class AdminSettingsDomains /*extends AbstractViewSettings*/ {
|
|||
}
|
||||
},
|
||||
{
|
||||
username: this.username()
|
||||
username: this.username
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -41,15 +41,15 @@ export class AdminSettingsDomains /*extends AbstractViewSettings*/ {
|
|||
deleteDomain(domain) {
|
||||
DomainAdminStore.remove(domain);
|
||||
Remote.request('AdminDomainDelete', DomainAdminStore.fetch, {
|
||||
Name: domain.name
|
||||
name: domain.name
|
||||
});
|
||||
}
|
||||
|
||||
disableDomain(domain) {
|
||||
domain.disabled(!domain.disabled());
|
||||
Remote.request('AdminDomainDisable', DomainAdminStore.fetch, {
|
||||
Name: domain.name,
|
||||
Disabled: domain.disabled() ? 1 : 0
|
||||
name: domain.name,
|
||||
disabled: domain.disabled() ? 1 : 0
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ export class AdminSettingsDomains /*extends AbstractViewSettings*/ {
|
|||
el && ko.dataFor(el) && Remote.request('AdminDomainLoad',
|
||||
(iError, oData) => iError || showScreenPopup(DomainPopupView, [oData.Result]),
|
||||
{
|
||||
Name: ko.dataFor(el).name
|
||||
name: ko.dataFor(el).name
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export class AdminSettingsPackages extends AbstractViewSettings {
|
|||
data && Remote.request('AdminPluginLoad',
|
||||
(iError, data) => iError || showScreenPopup(PluginPopupView, [data.Result]),
|
||||
{
|
||||
Id: data.id
|
||||
id: data.id
|
||||
}
|
||||
);
|
||||
// disablePlugin
|
||||
|
|
@ -84,7 +84,7 @@ export class AdminSettingsPackages extends AbstractViewSettings {
|
|||
Remote.request('AdminPackageDelete',
|
||||
this.requestHelper(packageToDelete, false),
|
||||
{
|
||||
Id: packageToDelete.id
|
||||
id: packageToDelete.id
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -96,9 +96,9 @@ export class AdminSettingsPackages extends AbstractViewSettings {
|
|||
Remote.request('AdminPackageInstall',
|
||||
this.requestHelper(packageToInstall, true),
|
||||
{
|
||||
Id: packageToInstall.id,
|
||||
Type: packageToInstall.type,
|
||||
File: packageToInstall.file
|
||||
id: packageToInstall.id,
|
||||
type: packageToInstall.type,
|
||||
file: packageToInstall.file
|
||||
},
|
||||
60000
|
||||
);
|
||||
|
|
@ -120,8 +120,8 @@ export class AdminSettingsPackages extends AbstractViewSettings {
|
|||
}
|
||||
// PackageAdminStore.fetch();
|
||||
}, {
|
||||
Id: plugin.id,
|
||||
Disabled: disable ? 1 : 0
|
||||
id: plugin.id,
|
||||
disabled: disable ? 1 : 0
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,10 +102,10 @@ export class AdminSettingsSecurity extends AbstractViewSettings {
|
|||
this.weakPassword(!!data.Result.Weak);
|
||||
}
|
||||
}, {
|
||||
'Login': this.adminLogin(),
|
||||
'Password': this.adminPassword(),
|
||||
'NewPassword': this.adminPasswordNew(),
|
||||
'TOTP': this.adminTOTP()
|
||||
Login: this.adminLogin(),
|
||||
Password: this.adminPassword(),
|
||||
newPassword: this.adminPasswordNew(),
|
||||
TOTP: this.adminTOTP()
|
||||
});
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ export class UserSettingsAccounts /*extends AbstractViewSettings*/ {
|
|||
rl.app.accountsAndIdentities();
|
||||
}
|
||||
}, {
|
||||
EmailToDelete: accountToRemove.email
|
||||
emailToDelete: accountToRemove.email
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ export class UserSettingsAccounts /*extends AbstractViewSettings*/ {
|
|||
this.identityForDeletion(null);
|
||||
IdentityUserStore.remove(oIdentity => identityToRemove === oIdentity);
|
||||
Remote.request('IdentityDelete', () => rl.app.accountsAndIdentities(), {
|
||||
IdToDelete: identityToRemove.id()
|
||||
idToDelete: identityToRemove.id()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,8 +160,8 @@ export class UserSettingsFolders /*extends AbstractViewSettings*/ {
|
|||
// TODO: append '.default' ?
|
||||
Remote.request('FolderSetMetadata', null, {
|
||||
folder: folder.fullName,
|
||||
Key: FolderMetadataKeys.KolabFolderType,
|
||||
Value: type
|
||||
key: FolderMetadataKeys.KolabFolderType,
|
||||
value: type
|
||||
});
|
||||
folder.kolabType(type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@ DomainAdminStore.fetch = () => {
|
|||
);
|
||||
}
|
||||
}, {
|
||||
IncludeAliases: 1
|
||||
includeAliases: 1
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ export const GnuPGUserStore = new class {
|
|||
}, {
|
||||
keyId: key.id,
|
||||
isPrivate: isPrivate,
|
||||
Passphrase: pass
|
||||
passphrase: pass
|
||||
}
|
||||
);
|
||||
if (isPrivate) {
|
||||
|
|
@ -115,7 +115,7 @@ export const GnuPGUserStore = new class {
|
|||
}
|
||||
callback?.(iError, oData);
|
||||
}, {
|
||||
Key: key
|
||||
key: key
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -181,10 +181,10 @@ export const GnuPGUserStore = new class {
|
|||
uid: message.uid,
|
||||
partId: pgpInfo.PartId,
|
||||
keyId: key.id,
|
||||
Passphrase: await askPassphrase(key, 'BUTTON_DECRYPT'),
|
||||
Data: '' // message.plain() optional
|
||||
passphrase: await askPassphrase(key, 'BUTTON_DECRYPT'),
|
||||
data: '' // message.plain() optional
|
||||
}
|
||||
if (null !== params.Passphrase) {
|
||||
if (null !== params.passphrase) {
|
||||
const result = await Remote.post('GnupgDecrypt', null, params);
|
||||
if (result?.Result && false !== result.Result.data) {
|
||||
return result.Result;
|
||||
|
|
@ -202,9 +202,9 @@ export const GnuPGUserStore = new class {
|
|||
// let mode = await this.hasPublicKeyForEmails([sender]);
|
||||
data.folder = message.folder;
|
||||
data.uid = message.uid;
|
||||
if (data.BodyPart) {
|
||||
data.BodyPart = data.BodyPart.raw;
|
||||
data.SigPart = data.SigPart.body;
|
||||
if (data.bodyPart) {
|
||||
data.bodyPart = data.bodyPart.raw;
|
||||
data.sigPart = data.sigPart.body;
|
||||
}
|
||||
let response = await Remote.post('MessagePgpVerify', null, data);
|
||||
if (response?.Result) {
|
||||
|
|
|
|||
|
|
@ -331,8 +331,8 @@ MessagelistUserStore.setAction = (sFolderFullName, iSetAction, messages) => {
|
|||
}
|
||||
Remote.request('MessageSetSeen', null, {
|
||||
folder: sFolderFullName,
|
||||
Uids: rootUids.join(','),
|
||||
SetAction: iSetAction == MessageSetAction.SetSeen ? 1 : 0
|
||||
uids: rootUids.join(','),
|
||||
setAction: iSetAction == MessageSetAction.SetSeen ? 1 : 0
|
||||
});
|
||||
break;
|
||||
|
||||
|
|
@ -340,8 +340,8 @@ MessagelistUserStore.setAction = (sFolderFullName, iSetAction, messages) => {
|
|||
case MessageSetAction.UnsetFlag:
|
||||
Remote.request('MessageSetFlagged', null, {
|
||||
folder: sFolderFullName,
|
||||
Uids: rootUids.join(','),
|
||||
SetAction: iSetAction == MessageSetAction.SetFlag ? 1 : 0
|
||||
uids: rootUids.join(','),
|
||||
setAction: iSetAction == MessageSetAction.SetFlag ? 1 : 0
|
||||
});
|
||||
break;
|
||||
// no default
|
||||
|
|
|
|||
|
|
@ -219,12 +219,13 @@ export const OpenPGPUserStore = new class {
|
|||
if (data && publicKey) {
|
||||
data.folder = message.folder;
|
||||
data.uid = message.uid;
|
||||
data.GnuPG = 0;
|
||||
data.tryGnuPG = 0;
|
||||
let response;
|
||||
if (data.sigPartId) {
|
||||
response = await Remote.post('MessagePgpVerify', null, data);
|
||||
} else if (data.BodyPart) {
|
||||
response = { Result: { text: data.BodyPart.raw, signature: data.SigPart.body } };
|
||||
} else if (data.bodyPart) {
|
||||
// MimePart
|
||||
response = { Result: { text: data.bodyPart.raw, signature: data.sigPart.body } };
|
||||
} else {
|
||||
response = { Result: { text: message.plain(), signature: null } };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export class AccountPopupView extends AbstractViewPopup {
|
|||
submitForm(form) {
|
||||
if (!this.submitRequest() && form.reportValidity()) {
|
||||
const data = new FormData(form);
|
||||
data.set('New', this.isNew() ? 1 : 0);
|
||||
data.set('new', this.isNew() ? 1 : 0);
|
||||
this.submitRequest(true);
|
||||
Remote.request('AccountSetup', (iError, data) => {
|
||||
this.submitRequest(false);
|
||||
|
|
|
|||
|
|
@ -1482,7 +1482,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
signature.body = await OpenPGPUserStore.sign(data.toString(), sign[1], 1);
|
||||
signed.children.push(signature);
|
||||
params.signed = signed.toString();
|
||||
params.Boundary = signed.boundary;
|
||||
params.boundary = signed.boundary;
|
||||
data = signed;
|
||||
} else if ('gnupg' == sign[0]) {
|
||||
// TODO: sign in PHP fails
|
||||
|
|
|
|||
|
|
@ -104,10 +104,10 @@ export class ContactsPopupView extends AbstractViewPopup {
|
|||
const contacts = this.contactsCheckedOrSelected();
|
||||
if (contacts.length) {
|
||||
let selectorContact = this.selectorContact(),
|
||||
Uids = [],
|
||||
uids = [],
|
||||
count = 0;
|
||||
contacts.forEach(contact => {
|
||||
Uids.push(contact.id());
|
||||
uids.push(contact.id());
|
||||
if (selectorContact && selectorContact.id() === contact.id()) {
|
||||
this.selectorContact(selectorContact = null);
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ export class ContactsPopupView extends AbstractViewPopup {
|
|||
}
|
||||
this.reloadContactList();
|
||||
}, {
|
||||
Uids: Uids.join(',')
|
||||
uids: uids.join(',')
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,13 +14,64 @@ import { AskPopupView } from 'View/Popup/Ask';
|
|||
|
||||
const
|
||||
capitalize = string => string.charAt(0).toUpperCase() + string.slice(1),
|
||||
domainDefaults = {
|
||||
enableSmartPorts: false,
|
||||
|
||||
savingError: '',
|
||||
|
||||
name: '',
|
||||
|
||||
imapHost: '',
|
||||
imapPort: 143,
|
||||
imapType: 0,
|
||||
imapTimeout: 300,
|
||||
imapShortLogin: false,
|
||||
// SSL
|
||||
imapSslVerify_peer: false,
|
||||
imapSslAllow_self_signed: false,
|
||||
// Options
|
||||
imapDisable_list_status: false,
|
||||
imapDisable_metadata: false,
|
||||
imapDisable_move: false,
|
||||
imapDisable_sort: false,
|
||||
imapDisable_thread: false,
|
||||
imapExpunge_all_on_delete: false,
|
||||
imapFast_simple_search: true,
|
||||
imapFetch_new_messages: true,
|
||||
imapForce_select: false,
|
||||
imapFolder_list_limit: 200,
|
||||
imapMessage_all_headers: false,
|
||||
imapMessage_list_limit: 0,
|
||||
imapSearch_filter: '',
|
||||
|
||||
sieveEnabled: false,
|
||||
sieveHost: '',
|
||||
sievePort: 4190,
|
||||
sieveType: 0,
|
||||
sieveTimeout: 10,
|
||||
|
||||
smtpHost: '',
|
||||
smtpPort: 25,
|
||||
smtpType: 0,
|
||||
smtpTimeout: 60,
|
||||
smtpShortLogin: false,
|
||||
smtpUseAuth: true,
|
||||
smtpSetSender: false,
|
||||
smtpUsePhpMail: false,
|
||||
// SSL
|
||||
smtpSslVerify_peer: false,
|
||||
smtpSslAllow_self_signed: false,
|
||||
|
||||
whiteList: '',
|
||||
aliasName: ''
|
||||
},
|
||||
domainToParams = oDomain => ({
|
||||
Name: oDomain.name(),
|
||||
name: oDomain.name,
|
||||
IMAP: {
|
||||
host: oDomain.imapHost(),
|
||||
port: oDomain.imapPort(),
|
||||
host: oDomain.imapHost,
|
||||
port: oDomain.imapPort,
|
||||
secure: pInt(oDomain.imapType()),
|
||||
timeout: oDomain.imapTimeout(),
|
||||
timeout: oDomain.imapTimeout,
|
||||
shortLogin: !!oDomain.imapShortLogin(),
|
||||
ssl: {
|
||||
verify_peer: !!oDomain.imapSslVerify_peer(),
|
||||
|
|
@ -44,10 +95,10 @@ const
|
|||
*/
|
||||
},
|
||||
SMTP: {
|
||||
host: oDomain.smtpHost(),
|
||||
port: oDomain.smtpPort(),
|
||||
host: oDomain.smtpHost,
|
||||
port: oDomain.smtpPort,
|
||||
secure: pInt(oDomain.smtpType()),
|
||||
timeout: oDomain.smtpTimeout(),
|
||||
timeout: oDomain.smtpTimeout,
|
||||
shortLogin: !!oDomain.smtpShortLogin(),
|
||||
ssl: {
|
||||
verify_peer: !!oDomain.smtpSslVerify_peer(),
|
||||
|
|
@ -60,10 +111,10 @@ const
|
|||
},
|
||||
Sieve: {
|
||||
enabled: !!oDomain.sieveEnabled(),
|
||||
host: oDomain.sieveHost(),
|
||||
port: oDomain.sievePort(),
|
||||
host: oDomain.sieveHost,
|
||||
port: oDomain.sievePort,
|
||||
secure: pInt(oDomain.sieveType()),
|
||||
timeout: oDomain.sieveTimeout(),
|
||||
timeout: oDomain.sieveTimeout,
|
||||
shortLogin: !!oDomain.imapShortLogin(),
|
||||
ssl: {
|
||||
verify_peer: !!oDomain.imapSslVerify_peer(),
|
||||
|
|
@ -71,14 +122,14 @@ const
|
|||
allow_self_signed: !!oDomain.imapSslAllow_self_signed()
|
||||
}
|
||||
},
|
||||
whiteList: oDomain.whiteList()
|
||||
whiteList: oDomain.whiteList
|
||||
});
|
||||
|
||||
export class DomainPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super('Domain');
|
||||
|
||||
addObservablesTo(this, this.getDefaults());
|
||||
addObservablesTo(this, domainDefaults);
|
||||
addObservablesTo(this, {
|
||||
edit: false,
|
||||
|
||||
|
|
@ -99,21 +150,11 @@ export class DomainPopupView extends AbstractViewPopup {
|
|||
headerText: () => {
|
||||
const name = this.name(),
|
||||
aliasName = this.aliasName();
|
||||
|
||||
let result = '';
|
||||
|
||||
if (this.edit()) {
|
||||
result = i18n('POPUPS_DOMAIN/TITLE_EDIT_DOMAIN', { NAME: name });
|
||||
if (aliasName) {
|
||||
result += ' ⫘ ' + aliasName;
|
||||
}
|
||||
} else {
|
||||
result = name
|
||||
? i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN_WITH_NAME', { NAME: name })
|
||||
: i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN');
|
||||
}
|
||||
|
||||
return result;
|
||||
return this.edit()
|
||||
? i18n('POPUPS_DOMAIN/TITLE_EDIT_DOMAIN', { NAME: name }) + (aliasName ? ' ⫘ ' + aliasName : '')
|
||||
: (name
|
||||
? i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN_WITH_NAME', { NAME: name })
|
||||
: i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN'));
|
||||
},
|
||||
|
||||
domainDesc: () => {
|
||||
|
|
@ -213,7 +254,7 @@ export class DomainPopupView extends AbstractViewPopup {
|
|||
}
|
||||
},
|
||||
Object.assign(domainToParams(this), {
|
||||
Create: this.edit() ? 0 : 1
|
||||
create: this.edit() ? 0 : 1
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
@ -260,7 +301,9 @@ export class DomainPopupView extends AbstractViewPopup {
|
|||
onShow(oDomain) {
|
||||
this.saving(false);
|
||||
this.clearTesting();
|
||||
this.clearForm();
|
||||
this.edit(false);
|
||||
forEachObjectEntry(domainDefaults, (key, value) => this[key](value));
|
||||
this.enableSmartPorts(true);
|
||||
if (oDomain) {
|
||||
this.enableSmartPorts(false);
|
||||
this.edit(true);
|
||||
|
|
@ -284,64 +327,4 @@ export class DomainPopupView extends AbstractViewPopup {
|
|||
this.enableSmartPorts(true);
|
||||
}
|
||||
}
|
||||
|
||||
getDefaults() {
|
||||
return {
|
||||
enableSmartPorts: false,
|
||||
|
||||
savingError: '',
|
||||
|
||||
name: '',
|
||||
|
||||
imapHost: '',
|
||||
imapPort: 143,
|
||||
imapType: 0,
|
||||
imapTimeout: 300,
|
||||
imapShortLogin: false,
|
||||
// SSL
|
||||
imapSslVerify_peer: false,
|
||||
imapSslAllow_self_signed: false,
|
||||
// Options
|
||||
imapDisable_list_status: false,
|
||||
imapDisable_metadata: false,
|
||||
imapDisable_move: false,
|
||||
imapDisable_sort: false,
|
||||
imapDisable_thread: false,
|
||||
imapExpunge_all_on_delete: false,
|
||||
imapFast_simple_search: true,
|
||||
imapFetch_new_messages: true,
|
||||
imapForce_select: false,
|
||||
imapFolder_list_limit: 200,
|
||||
imapMessage_all_headers: false,
|
||||
imapMessage_list_limit: 0,
|
||||
imapSearch_filter: '',
|
||||
|
||||
sieveEnabled: false,
|
||||
sieveHost: '',
|
||||
sievePort: 4190,
|
||||
sieveType: 0,
|
||||
sieveTimeout: 10,
|
||||
|
||||
smtpHost: '',
|
||||
smtpPort: 25,
|
||||
smtpType: 0,
|
||||
smtpTimeout: 60,
|
||||
smtpShortLogin: false,
|
||||
smtpUseAuth: true,
|
||||
smtpSetSender: false,
|
||||
smtpUsePhpMail: false,
|
||||
// SSL
|
||||
smtpSslVerify_peer: false,
|
||||
smtpSslAllow_self_signed: false,
|
||||
|
||||
whiteList: '',
|
||||
aliasName: ''
|
||||
};
|
||||
}
|
||||
|
||||
clearForm() {
|
||||
this.edit(false);
|
||||
forEachObjectEntry(this.getDefaults(), (key, value) => this[key](value));
|
||||
this.enableSmartPorts(true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,21 +46,15 @@ export class DomainAliasPopupView extends AbstractViewPopup {
|
|||
this.close();
|
||||
}
|
||||
}, {
|
||||
Name: this.name(),
|
||||
Alias: this.alias()
|
||||
name: this.name,
|
||||
alias: this.alias
|
||||
});
|
||||
}
|
||||
|
||||
onShow() {
|
||||
this.clearForm();
|
||||
}
|
||||
|
||||
clearForm() {
|
||||
this.saving(false);
|
||||
this.savingError('');
|
||||
|
||||
this.name('');
|
||||
|
||||
this.alias('');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,19 +41,19 @@ export class PluginPopupView extends AbstractViewPopup {
|
|||
|
||||
saveCommand() {
|
||||
const oConfig = {
|
||||
Id: this.id(),
|
||||
Settings: {}
|
||||
id: this.id,
|
||||
settings: {}
|
||||
},
|
||||
setItem = item => {
|
||||
let value = item.value();
|
||||
if (false === value || true === value) {
|
||||
value = value ? 1 : 0;
|
||||
}
|
||||
oConfig.Settings[item.Name] = value;
|
||||
oConfig.settings[item.name] = value;
|
||||
};
|
||||
|
||||
this.config.forEach(oItem => {
|
||||
if (7 == oItem.Type) {
|
||||
if (7 == oItem.type) {
|
||||
// Group
|
||||
oItem.config.forEach(oSubItem => setItem(oSubItem));
|
||||
} else {
|
||||
|
|
@ -76,15 +76,15 @@ export class PluginPopupView extends AbstractViewPopup {
|
|||
this.config([]);
|
||||
|
||||
if (oPlugin) {
|
||||
this.id(oPlugin.Id);
|
||||
this.name(oPlugin.Name);
|
||||
this.readme(oPlugin.Readme);
|
||||
this.id(oPlugin.id);
|
||||
this.name(oPlugin.name);
|
||||
this.readme(oPlugin.readme);
|
||||
|
||||
const config = oPlugin.Config;
|
||||
const config = oPlugin.config;
|
||||
if (arrayLength(config)) {
|
||||
this.config(
|
||||
config.map(item => {
|
||||
if (7 == item.Type) {
|
||||
if (7 == item.type) {
|
||||
// Group
|
||||
item.config.forEach(subItem => {
|
||||
subItem.value = ko.observable(subItem.value);
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ import { doc,
|
|||
} from 'Common/Globals';
|
||||
|
||||
import { arrayLength } from 'Common/Utils';
|
||||
import { computedPaginatorHelper, showMessageComposer, populateMessageBody, download, moveAction } from 'Common/UtilsUser';
|
||||
import { computedPaginatorHelper, showMessageComposer, populateMessageBody, downloadZip, moveAction } from 'Common/UtilsUser';
|
||||
import { FileInfo } from 'Common/File';
|
||||
import { isFullscreen, toggleFullscreen } from 'Common/Fullscreen';
|
||||
|
||||
import { mailBox, attachmentDownload } from 'Common/Links';
|
||||
import { mailBox } from 'Common/Links';
|
||||
import { Selector } from 'Common/Selector';
|
||||
|
||||
import { i18n } from 'Common/Translator';
|
||||
|
|
@ -367,23 +367,7 @@ export class MailMessageList extends AbstractViewRight {
|
|||
let hashes = []/*, uids = []*/;
|
||||
// MessagelistUserStore.forEach(message => message.checked() && uids.push(message.uid));
|
||||
MessagelistUserStore.forEach(message => message.checked() && hashes.push(message.requestHash));
|
||||
if (hashes.length) {
|
||||
Remote.post('AttachmentsActions', null, {
|
||||
Do: 'Zip',
|
||||
folder: MessagelistUserStore().folder,
|
||||
// Uids: uids,
|
||||
Hashes: hashes
|
||||
})
|
||||
.then(result => {
|
||||
let hash = result?.Result?.fileHash;
|
||||
if (hash) {
|
||||
download(attachmentDownload(hash), hash+'.zip');
|
||||
} else {
|
||||
alert('Download failed');
|
||||
}
|
||||
})
|
||||
.catch(() => alert('Download failed'));
|
||||
}
|
||||
downloadZip(hashes, null, null, MessagelistUserStore().folder);
|
||||
}
|
||||
|
||||
downloadAttachCommand() {
|
||||
|
|
@ -397,21 +381,7 @@ export class MailMessageList extends AbstractViewRight {
|
|||
});
|
||||
}
|
||||
});
|
||||
if (hashes.length) {
|
||||
Remote.post('AttachmentsActions', null, {
|
||||
Do: 'Zip',
|
||||
Hashes: hashes
|
||||
})
|
||||
.then(result => {
|
||||
let hash = result?.Result?.fileHash;
|
||||
if (hash) {
|
||||
download(attachmentDownload(hash), hash+'.zip');
|
||||
} else {
|
||||
alert('Download failed');
|
||||
}
|
||||
})
|
||||
.catch(() => alert('Download failed'));
|
||||
}
|
||||
downloadZip(hashes);
|
||||
}
|
||||
|
||||
deleteWithoutMoveCommand() {
|
||||
|
|
@ -505,8 +475,8 @@ export class MailMessageList extends AbstractViewRight {
|
|||
|
||||
Remote.request('MessageSetSeenToAll', null, {
|
||||
folder: sFolderFullName,
|
||||
SetAction: 1,
|
||||
ThreadUids: uids.join(',')
|
||||
setAction: 1,
|
||||
threadUids: uids.join(',')
|
||||
});
|
||||
|
||||
MessagelistUserStore.reloadFlagsAndCachedMessage();
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@ import {
|
|||
} from 'Common/Globals';
|
||||
|
||||
import { arrayLength } from 'Common/Utils';
|
||||
import { download, mailToHelper, showMessageComposer, moveAction } from 'Common/UtilsUser';
|
||||
import { download, downloadZip, mailToHelper, showMessageComposer, moveAction } from 'Common/UtilsUser';
|
||||
import { isFullscreen, exitFullscreen, toggleFullscreen } from 'Common/Fullscreen';
|
||||
|
||||
import { SMAudio } from 'Common/Audio';
|
||||
|
||||
import { i18n } from 'Common/Translator';
|
||||
import { attachmentDownload } from 'Common/Links';
|
||||
|
||||
import { MessageFlagsCache } from 'Common/Cache';
|
||||
|
||||
|
|
@ -486,21 +485,10 @@ export class MailMessageView extends AbstractViewRight {
|
|||
const hashes = (currentMessage()?.attachments || [])
|
||||
.map(item => item?.checked() /*&& !item?.isLinked()*/ ? item.download : '')
|
||||
.filter(v => v);
|
||||
if (hashes.length) {
|
||||
Remote.post('AttachmentsActions', this.downloadAsZipLoading, {
|
||||
Do: 'Zip',
|
||||
Hashes: hashes
|
||||
})
|
||||
.then(result => {
|
||||
let hash = result?.Result?.fileHash;
|
||||
if (hash) {
|
||||
download(attachmentDownload(hash), hash+'.zip');
|
||||
} else {
|
||||
this.downloadAsZipError(true);
|
||||
}
|
||||
})
|
||||
.catch(() => this.downloadAsZipError(true));
|
||||
}
|
||||
downloadZip(hashes,
|
||||
() => this.downloadAsZipError(true),
|
||||
this.downloadAsZipLoading
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue