mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 03:29:20 +03:00
Code refactoring
This commit is contained in:
parent
78ce33e77c
commit
2545ce3cd9
17 changed files with 946 additions and 1034 deletions
|
|
@ -92,7 +92,7 @@
|
|||
sString = Utils.trim(sString);
|
||||
|
||||
var
|
||||
mRegex = /(?:"([^"]+)")? ?<?(.*?@[^>,]+)>?,? ?/g,
|
||||
mRegex = /(?:"([^"]+)")? ?[<]?(.*?@[^>,]+)>?,? ?/g,
|
||||
mMatch = mRegex.exec(sString)
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -210,8 +210,8 @@
|
|||
};
|
||||
|
||||
RemoteAdminStorage.prototype.createOrUpdateDomain = function (fCallback,
|
||||
bCreate, sName, sIncHost, iIncPort, sIncSecure, bIncVerifySsl, bIncShortLogin,
|
||||
sOutHost, iOutPort, sOutSecure, bOutShortLogin, bOutVerifySsl, bOutAuth, sWhiteList)
|
||||
bCreate, sName, sIncHost, iIncPort, sIncSecure, bIncShortLogin,
|
||||
sOutHost, iOutPort, sOutSecure, bOutShortLogin, bOutAuth, sWhiteList)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminDomainSave', {
|
||||
'Create': bCreate ? '1' : '0',
|
||||
|
|
@ -219,12 +219,10 @@
|
|||
'IncHost': sIncHost,
|
||||
'IncPort': iIncPort,
|
||||
'IncSecure': sIncSecure,
|
||||
'IncVerifySsl': bIncVerifySsl ? '1' : '0',
|
||||
'IncShortLogin': bIncShortLogin ? '1' : '0',
|
||||
'OutHost': sOutHost,
|
||||
'OutPort': iOutPort,
|
||||
'OutSecure': sOutSecure,
|
||||
'OutVerifySsl': bOutVerifySsl ? '1' : '0',
|
||||
'OutShortLogin': bOutShortLogin ? '1' : '0',
|
||||
'OutAuth': bOutAuth ? '1' : '0',
|
||||
'WhiteList': sWhiteList
|
||||
|
|
@ -232,19 +230,16 @@
|
|||
};
|
||||
|
||||
RemoteAdminStorage.prototype.testConnectionForDomain = function (fCallback, sName,
|
||||
sIncHost, iIncPort, sIncSecure, bIncVerifySsl,
|
||||
sOutHost, iOutPort, sOutSecure, bOutVerifySsl, bOutAuth)
|
||||
sIncHost, iIncPort, sIncSecure, sOutHost, iOutPort, sOutSecure, bOutAuth)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminDomainTest', {
|
||||
'Name': sName,
|
||||
'IncHost': sIncHost,
|
||||
'IncPort': iIncPort,
|
||||
'IncSecure': sIncSecure,
|
||||
'IncVerifySsl': bIncVerifySsl ? '1' : '0',
|
||||
'OutHost': sOutHost,
|
||||
'OutPort': iOutPort,
|
||||
'OutSecure': sOutSecure,
|
||||
'OutVerifySsl': bOutVerifySsl ? '1' : '0',
|
||||
'OutAuth': bOutAuth ? '1' : '0'
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -63,12 +63,10 @@
|
|||
this.imapServer = ko.observable('');
|
||||
this.imapPort = ko.observable('' + Consts.Values.ImapDefaulPort);
|
||||
this.imapSecure = ko.observable(Enums.ServerSecure.None);
|
||||
this.imapVerifySsl = ko.observable(false);
|
||||
this.imapShortLogin = ko.observable(false);
|
||||
this.smtpServer = ko.observable('');
|
||||
this.smtpPort = ko.observable('' + Consts.Values.SmtpDefaulPort);
|
||||
this.smtpSecure = ko.observable(Enums.ServerSecure.None);
|
||||
this.smtpVerifySsl = ko.observable(false);
|
||||
this.smtpShortLogin = ko.observable(false);
|
||||
this.smtpAuth = ko.observable(true);
|
||||
this.whiteList = ko.observable('');
|
||||
|
|
@ -106,12 +104,10 @@
|
|||
this.imapServer(),
|
||||
Utils.pInt(this.imapPort()),
|
||||
this.imapSecure(),
|
||||
this.imapVerifySsl(),
|
||||
this.imapShortLogin(),
|
||||
this.smtpServer(),
|
||||
Utils.pInt(this.smtpPort()),
|
||||
this.smtpSecure(),
|
||||
this.smtpVerifySsl(),
|
||||
this.smtpShortLogin(),
|
||||
this.smtpAuth(),
|
||||
this.whiteList()
|
||||
|
|
@ -130,11 +126,9 @@
|
|||
this.imapServer(),
|
||||
Utils.pInt(this.imapPort()),
|
||||
this.imapSecure(),
|
||||
this.imapVerifySsl(),
|
||||
this.smtpServer(),
|
||||
Utils.pInt(this.smtpPort()),
|
||||
this.smtpSecure(),
|
||||
this.smtpVerifySsl(),
|
||||
this.smtpAuth()
|
||||
);
|
||||
}, this.canBeTested);
|
||||
|
|
@ -289,12 +283,10 @@
|
|||
this.imapServer(Utils.trim(oDomain.IncHost));
|
||||
this.imapPort('' + Utils.pInt(oDomain.IncPort));
|
||||
this.imapSecure(Utils.trim(oDomain.IncSecure));
|
||||
this.imapVerifySsl(!!oDomain.IncVerifySsl);
|
||||
this.imapShortLogin(!!oDomain.IncShortLogin);
|
||||
this.smtpServer(Utils.trim(oDomain.OutHost));
|
||||
this.smtpPort('' + Utils.pInt(oDomain.OutPort));
|
||||
this.smtpSecure(Utils.trim(oDomain.OutSecure));
|
||||
this.smtpVerifySsl(!!oDomain.OutVerifySsl);
|
||||
this.smtpShortLogin(!!oDomain.OutShortLogin);
|
||||
this.smtpAuth(!!oDomain.OutAuth);
|
||||
this.whiteList(Utils.trim(oDomain.WhiteList));
|
||||
|
|
@ -325,12 +317,10 @@
|
|||
this.imapServer('');
|
||||
this.imapPort('' + Consts.Values.ImapDefaulPort);
|
||||
this.imapSecure(Enums.ServerSecure.None);
|
||||
this.imapVerifySsl(false);
|
||||
this.imapShortLogin(false);
|
||||
this.smtpServer('');
|
||||
this.smtpPort('' + Consts.Values.SmtpDefaulPort);
|
||||
this.smtpSecure(Enums.ServerSecure.None);
|
||||
this.smtpVerifySsl(false);
|
||||
this.smtpShortLogin(false);
|
||||
this.smtpAuth(true);
|
||||
this.whiteList('');
|
||||
|
|
|
|||
|
|
@ -189,7 +189,8 @@
|
|||
this.facebookCommand = Utils.createCommand(this, function () {
|
||||
|
||||
window.open(Links.socialFacebook(), 'Facebook',
|
||||
'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
'left=200,top=100,width=650,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
|
||||
return true;
|
||||
|
||||
}, function () {
|
||||
|
|
@ -201,7 +202,8 @@
|
|||
this.googleCommand = Utils.createCommand(this, function () {
|
||||
|
||||
window.open(Links.socialGoogle(), 'Google',
|
||||
'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
'left=200,top=100,width=650,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
|
||||
return true;
|
||||
|
||||
}, function () {
|
||||
|
|
@ -213,7 +215,7 @@
|
|||
this.twitterCommand = Utils.createCommand(this, function () {
|
||||
|
||||
window.open(Links.socialTwitter(), 'Twitter',
|
||||
'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
'left=200,top=100,width=650,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
|
||||
return true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue