mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 11:39:21 +03:00
Interface optimizations
moment js update
This commit is contained in:
parent
be8c186f87
commit
f36cb72b82
104 changed files with 5869 additions and 1180 deletions
|
|
@ -136,7 +136,7 @@ function LoginViewModel()
|
|||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this), this.email(), this.login(), this.password(), !!this.signMe(),
|
||||
}, this), this.email(), this.allowCustomLogin() ? this.login() : '', this.password(), !!this.signMe(),
|
||||
this.bSendLanguage ? this.mainLanguage() : '',
|
||||
this.additionalCode.visibility() ? this.additionalCode() : '',
|
||||
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function PopupsAddAccountViewModel()
|
|||
this.passwordError(false);
|
||||
}, this);
|
||||
|
||||
this.allowCustomLogin = ko.observable(false);
|
||||
this.allowCustomLogin = RL.data().allowCustomLogin;
|
||||
|
||||
this.submitRequest = ko.observable(false);
|
||||
this.submitError = ko.observable('');
|
||||
|
|
@ -68,7 +68,7 @@ function PopupsAddAccountViewModel()
|
|||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this), this.email(), this.login(), this.password());
|
||||
}, this), this.email(), this.allowCustomLogin() ? this.login() : '', this.password());
|
||||
|
||||
return true;
|
||||
|
||||
|
|
@ -111,8 +111,3 @@ PopupsAddAccountViewModel.prototype.onFocus = function ()
|
|||
{
|
||||
this.emailFocus(true);
|
||||
};
|
||||
|
||||
PopupsAddAccountViewModel.prototype.onBuild = function ()
|
||||
{
|
||||
this.allowCustomLogin(!!RL.settingsGet('AllowCustomLogin'));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -600,12 +600,11 @@ PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom)
|
|||
{
|
||||
sSignature = sSignature.replace(/{{FROM}}/, sFrom);
|
||||
}
|
||||
else
|
||||
{
|
||||
sSignature = sSignature.replace(/{{IF:FROM}}[\s\S]+{{\/IF:FROM}}[\n]?/gm, '');
|
||||
}
|
||||
|
||||
sSignature = sSignature.replace(/{{FROM}}[\n]?/, '').replace(/{{IF:FROM}}[\n]?/, '').replace(/{{\/IF:FROM}}[\n]?/, '');
|
||||
sSignature = sSignature.replace(/[\s]{1,2}{{FROM}}/, '{{FROM}}');
|
||||
|
||||
sSignature = sSignature.replace(/{{FROM}}/, '');
|
||||
sSignature = sSignature.replace(/{{DATE}}/, moment().format('llll'));
|
||||
|
||||
if (!bHtml)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -54,6 +54,10 @@ function PopupsContactsViewModel()
|
|||
return Enums.ContactPropertyType.Email === oProperty.type();
|
||||
});
|
||||
|
||||
this.viewPropertiesWeb = this.viewProperties.filter(function(oProperty) {
|
||||
return Enums.ContactPropertyType.Web === oProperty.type();
|
||||
});
|
||||
|
||||
this.viewHasNonEmptyRequaredProperties = ko.computed(function() {
|
||||
|
||||
var
|
||||
|
|
@ -85,6 +89,11 @@ function PopupsContactsViewModel()
|
|||
return '' === Utils.trim(oProperty.value()) && !bF;
|
||||
});
|
||||
|
||||
this.viewPropertiesWebEmptyAndOnFocused = this.viewPropertiesWeb.filter(function(oProperty) {
|
||||
var bF = oProperty.focused();
|
||||
return '' === Utils.trim(oProperty.value()) && !bF;
|
||||
});
|
||||
|
||||
this.viewPropertiesEmailsEmptyAndOnFocused.subscribe(function(aList) {
|
||||
fFastClearEmptyListHelper(aList);
|
||||
});
|
||||
|
|
@ -93,6 +102,10 @@ function PopupsContactsViewModel()
|
|||
fFastClearEmptyListHelper(aList);
|
||||
});
|
||||
|
||||
this.viewPropertiesWebEmptyAndOnFocused.subscribe(function(aList) {
|
||||
fFastClearEmptyListHelper(aList);
|
||||
});
|
||||
|
||||
this.viewSaving = ko.observable(false);
|
||||
|
||||
this.useCheckboxesInList = RL.data().useCheckboxesInList;
|
||||
|
|
@ -318,6 +331,11 @@ PopupsContactsViewModel.prototype.addNewPhone = function ()
|
|||
this.addNewProperty(Enums.ContactPropertyType.Phone, 'Mobile');
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewWeb = function ()
|
||||
{
|
||||
this.addNewProperty(Enums.ContactPropertyType.Web);
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.exportVcf = function ()
|
||||
{
|
||||
RL.download(RL.link().exportContactsVcf());
|
||||
|
|
@ -489,8 +507,8 @@ PopupsContactsViewModel.prototype.populateViewContact = function (oContact)
|
|||
this.viewReadOnly(!!oContact.readOnly);
|
||||
}
|
||||
|
||||
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.LastName, '', sLastName, !oContact, 'CONTACTS/PLACEHOLDER_ENTER_LAST_NAME'));
|
||||
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.FirstName, '', sFirstName, false, 'CONTACTS/PLACEHOLDER_ENTER_FIRST_NAME'));
|
||||
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.LastName, '', sLastName, false, 'CONTACTS/PLACEHOLDER_ENTER_LAST_NAME'));
|
||||
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.FirstName, '', sFirstName, !oContact, 'CONTACTS/PLACEHOLDER_ENTER_FIRST_NAME'));
|
||||
|
||||
this.viewID(sId);
|
||||
this.viewProperties([]);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,25 @@ function PopupsDomainViewModel()
|
|||
this.testingDone = ko.observable(false);
|
||||
this.testingImapError = ko.observable(false);
|
||||
this.testingSmtpError = ko.observable(false);
|
||||
this.testingImapErrorDesc = ko.observable('');
|
||||
this.testingSmtpErrorDesc = ko.observable('');
|
||||
|
||||
this.testingImapError.subscribe(function (bValue) {
|
||||
if (!bValue)
|
||||
{
|
||||
this.testingImapErrorDesc('');
|
||||
}
|
||||
}, this);
|
||||
|
||||
this.testingSmtpError.subscribe(function (bValue) {
|
||||
if (!bValue)
|
||||
{
|
||||
this.testingSmtpErrorDesc('');
|
||||
}
|
||||
}, this);
|
||||
|
||||
this.testingImapErrorDesc = ko.observable('');
|
||||
this.testingSmtpErrorDesc = ko.observable('');
|
||||
|
||||
this.imapServerFocus = ko.observable(false);
|
||||
this.smtpServerFocus = ko.observable(false);
|
||||
|
|
@ -171,8 +190,18 @@ PopupsDomainViewModel.prototype.onTestConnectionResponse = function (sResult, oD
|
|||
if (Enums.StorageResultType.Success === sResult && oData.Result)
|
||||
{
|
||||
this.testingDone(true);
|
||||
this.testingImapError(false === oData.Result.Imap);
|
||||
this.testingSmtpError(false === oData.Result.Smtp);
|
||||
this.testingImapError(true !== oData.Result.Imap);
|
||||
this.testingSmtpError(true !== oData.Result.Smtp);
|
||||
|
||||
if (this.testingImapError() && oData.Result.Imap)
|
||||
{
|
||||
this.testingImapErrorDesc(oData.Result.Imap);
|
||||
}
|
||||
|
||||
if (this.testingSmtpError() && oData.Result.Smtp)
|
||||
{
|
||||
this.testingSmtpErrorDesc(oData.Result.Smtp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue