mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29: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
|
|
@ -70,6 +70,44 @@ ko.bindingHandlers.tooltip2 = {
|
|||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers.tooltip3 = {
|
||||
'init': function (oElement) {
|
||||
|
||||
var $oEl = $(oElement);
|
||||
|
||||
$oEl.tooltip({
|
||||
'container': 'body',
|
||||
'trigger': 'hover manual',
|
||||
'title': function () {
|
||||
return $oEl.data('tooltip3-data') || '';
|
||||
}
|
||||
});
|
||||
|
||||
Globals.dropdownVisibility.subscribe(function (bValue) {
|
||||
if (bValue)
|
||||
{
|
||||
$oEl.tooltip('hide');
|
||||
}
|
||||
});
|
||||
|
||||
$document.click(function () {
|
||||
$oEl.tooltip('hide');
|
||||
});
|
||||
|
||||
},
|
||||
'update': function (oElement, fValueAccessor) {
|
||||
var sValue = ko.utils.unwrapObservable(fValueAccessor());
|
||||
if ('' === sValue)
|
||||
{
|
||||
$(oElement).data('tooltip3-data', '').tooltip('hide');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(oElement).data('tooltip3-data', sValue).tooltip('show');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers.registrateBootstrapDropdown = {
|
||||
'init': function (oElement) {
|
||||
BootstrapDropdowns.push($(oElement));
|
||||
|
|
|
|||
|
|
@ -319,12 +319,13 @@ Selector.prototype.init = function (oContentVisible, oContentScrollable, sKeySco
|
|||
;
|
||||
|
||||
key('enter', sKeyScope, function () {
|
||||
if (self.focusedItem())
|
||||
if (self.focusedItem() && !self.focusedItem().selected())
|
||||
{
|
||||
self.actionClick(self.focusedItem());
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
|
||||
key('ctrl+up, command+up, ctrl+down, command+down', sKeyScope, function () {
|
||||
|
|
|
|||
|
|
@ -999,6 +999,7 @@ Utils.createMomentDate = function (oObject)
|
|||
Utils.createMomentShortDate = function (oObject)
|
||||
{
|
||||
return ko.computed(function () {
|
||||
|
||||
var
|
||||
sResult = '',
|
||||
oMomentNow = moment(),
|
||||
|
|
@ -1022,7 +1023,6 @@ Utils.createMomentShortDate = function (oObject)
|
|||
'TIME': oMoment.format('LT')
|
||||
});
|
||||
}
|
||||
|
||||
else if (oMomentNow.year() === oMoment.year())
|
||||
{
|
||||
sResult = oMoment.format('D MMM.');
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@
|
|||
.btn {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/*
|
||||
.button-new-message {
|
||||
margin-left: 8px;
|
||||
}
|
||||
.button-delete {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
.b-list-toopbar {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ html.ssm-state-desktop-large {
|
|||
}
|
||||
|
||||
.b-contacts-content.modal {
|
||||
width: 1000px;
|
||||
width: 800px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ html.ssm-state-desktop {
|
|||
}
|
||||
|
||||
.b-contacts-content.modal {
|
||||
width: 1000px;
|
||||
width: 800px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -211,6 +211,10 @@ select {
|
|||
color: #555;
|
||||
}
|
||||
|
||||
.popover {
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
html.no-rgba .modal {
|
||||
border-width: 0px !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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