Sieve test connection

This commit is contained in:
RainLoop Team 2015-01-28 20:27:23 +04:00
parent b563528be7
commit 63a286a6b6
5 changed files with 88 additions and 12 deletions

7
dev/External/ko.js vendored
View file

@ -114,6 +114,13 @@
else
{
$(oElement).data('tooltip3-data', sValue).tooltip('show');
_.delay(function () {
if ($(oElement).is(':visible'))
{
$(oElement).tooltip('show');
}
}, 100);
}
}
};

View file

@ -30,14 +30,14 @@
}
.testing-done {
.imap-header, .smtp-header {
&.imap-header, &.sieve-header, &.smtp-header {
color: green;
font-weight: bold;
}
}
.testing-error {
.imap-header, .smtp-header {
&.imap-header, &.sieve-header, &.smtp-header {
color: red;
}
}

View file

@ -36,8 +36,10 @@
this.testing = ko.observable(false);
this.testingDone = ko.observable(false);
this.testingImapError = ko.observable(false);
this.testingSieveError = ko.observable(false);
this.testingSmtpError = ko.observable(false);
this.testingImapErrorDesc = ko.observable('');
this.testingSieveErrorDesc = ko.observable('');
this.testingSmtpErrorDesc = ko.observable('');
this.testingImapError.subscribe(function (bValue) {
@ -47,6 +49,13 @@
}
}, this);
this.testingSieveError.subscribe(function (bValue) {
if (!bValue)
{
this.testingSieveErrorDesc('');
}
}, this);
this.testingSmtpError.subscribe(function (bValue) {
if (!bValue)
{
@ -54,9 +63,6 @@
}
}, this);
this.testingImapErrorDesc = ko.observable('');
this.testingSmtpErrorDesc = ko.observable('');
this.imapServerFocus = ko.observable(false);
this.sieveServerFocus = ko.observable(false);
this.smtpServerFocus = ko.observable(false);
@ -147,7 +153,6 @@
this.testConnectionCommand = Utils.createCommand(this, function () {
this.page('main');
this.sieveSettings(false);
this.testingDone(false);
this.testingImapError(false);
@ -277,12 +282,19 @@
this.testing(false);
if (Enums.StorageResultType.Success === sResult && oData.Result)
{
var
bImap = false,
bSieve = false
;
this.testingDone(true);
this.testingImapError(true !== oData.Result.Imap);
this.testingSmtpError(true !== oData.Result.Smtp);
this.testingSieveError(true !== oData.Result.Sieve);
if (this.testingImapError() && oData.Result.Imap)
{
bImap = true;
this.testingImapErrorDesc(oData.Result.Imap);
}
@ -290,11 +302,28 @@
{
this.testingSmtpErrorDesc(oData.Result.Smtp);
}
if (this.testingSieveError() && oData.Result.Sieve)
{
bSieve = true;
this.testingSieveErrorDesc(oData.Result.Sieve);
}
if (bImap)
{
this.sieveSettings(false);
}
else if (bSieve)
{
this.sieveSettings(true);
}
}
else
{
this.testingImapError(true);
this.testingSmtpError(true);
this.testingSieveError(true);
this.sieveSettings(false);
}
};
@ -325,6 +354,7 @@
this.testingDone(false);
this.testingImapError(false);
this.testingSmtpError(false);
this.testingSieveError(false);
};
DomainPopupView.prototype.onHide = function ()