Completion and preparation contacts to release.

This commit is contained in:
RainLoop Team 2013-12-10 04:40:21 +04:00
parent 45d34e64f4
commit eeda3dbb85
24 changed files with 505 additions and 236 deletions

View file

@ -5638,6 +5638,9 @@ html.no-rgba .modal {
.inputosaurus-container li a:hover {
color: #666;
}
.inputosaurus-container li span {
padding-right: 3px;
}
.inputosaurus-container li.inputosaurus-required {
padding-rigth: 5px;
}
@ -6334,7 +6337,7 @@ html.rl-no-preview-pane .messageList.message-selected {
}
.messageList .b-footer .e-quota {
display: inline-block;
margin-left: 10px;
margin-top: 5px;
font-size: 18px;
cursor: help;
}

File diff suppressed because one or more lines are too long

View file

@ -3483,6 +3483,9 @@ html.no-rgba .modal {
.inputosaurus-container li a:hover {
color: #666;
}
.inputosaurus-container li span {
padding-right: 3px;
}
.inputosaurus-container li.inputosaurus-required {
padding-rigth: 5px;
}
@ -4179,7 +4182,7 @@ html.rl-no-preview-pane .messageList.message-selected {
}
.messageList .b-footer .e-quota {
display: inline-block;
margin-left: 10px;
margin-top: 5px;
font-size: 18px;
cursor: help;
}

View file

@ -1013,9 +1013,10 @@ Utils.removeSelection = function ()
/**
* @param {string} sPrefix
* @param {string} sSubject
* @param {boolean=} bFixLongSubject = true
* @return {string}
*/
Utils.replySubjectAdd = function (sPrefix, sSubject)
Utils.replySubjectAdd = function (sPrefix, sSubject, bFixLongSubject)
{
var
oMatch = null,
@ -1037,7 +1038,47 @@ Utils.replySubjectAdd = function (sPrefix, sSubject)
sResult = sPrefix + ': ' + sSubject;
}
return sResult;
sResult = sResult.replace(/[\s]+/g, ' ');
return (Utils.isUnd(bFixLongSubject) ? true : bFixLongSubject) ? Utils.fixLongSubject(sResult) : sResult;
};
/**
* @param {string} sSubject
* @return {string}
*/
Utils.fixLongSubject = function (sSubject)
{
var
iCounter = 0,
oMatch = null
;
sSubject = Utils.trim(sSubject.replace(/[\s]+/, ' '));
do
{
oMatch = /^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/ig.exec(sSubject);
window.console.log(sSubject);
window.console.log(oMatch);
if (!oMatch || Utils.isUnd(oMatch[0]))
{
oMatch = null;
}
if (oMatch)
{
iCounter = 0;
iCounter += Utils.isUnd(oMatch[2]) ? 1 : 0 + Utils.pInt(oMatch[2]);
iCounter += Utils.isUnd(oMatch[4]) ? 1 : 0 + Utils.pInt(oMatch[4]);
sSubject = sSubject.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi, 'Re' + (0 < iCounter ? '[' + iCounter + ']' : '') + ':');
}
}
while (oMatch);
sSubject = sSubject.replace(/[\s]+/, ' ');
return sSubject;
};
/**
@ -5216,10 +5257,52 @@ function AdminContacts()
this.pdoDsnTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.pdoUserTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.pdoPasswordTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.testing = ko.observable(false);
this.testContactsSuccess = ko.observable(false);
this.testContactsError = ko.observable(false);
this.testContactsCommand = Utils.createCommand(this, function () {
this.testContactsSuccess(false);
this.testContactsError(false);
this.testing(true);
RL.remote().testContacts(this.onTestContactsResponse, {
'ContactsPdoDsn': this.pdoDsn(),
'ContactsPdoUser': this.pdoUser(),
'ContactsPdoPassword': this.pdoPassword()
});
}, function () {
return '' !== this.pdoDsn() && '' !== this.pdoUser();
});
this.onTestContactsResponse = _.bind(this.onTestContactsResponse, this);
}
Utils.addSettingsViewModel(AdminContacts, 'AdminSettingsContacts', 'Contacts', 'contacts');
AdminContacts.prototype.onTestContactsResponse = function (sResult, oData)
{
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
this.testContactsSuccess(true);
}
else
{
this.testContactsError(true);
}
this.testing(false);
};
AdminContacts.prototype.onShow = function ()
{
this.testContactsSuccess(false);
this.testContactsError(false);
};
AdminContacts.prototype.onBuild = function ()
{
var self = this;
@ -5371,8 +5454,6 @@ function AdminSecurity()
this.adminPasswordUpdateSuccess(false);
}, this);
this.onNewAdminPasswordResponse = _.bind(this.onNewAdminPasswordResponse, this);
this.saveNewAdminPasswordCommand = Utils.createCommand(this, function () {
this.adminPasswordUpdateError(false);
@ -5386,6 +5467,8 @@ function AdminSecurity()
}, function () {
return '' !== this.adminPassword() && '' !== this.adminPasswordNew();
});
this.onNewAdminPasswordResponse = _.bind(this.onNewAdminPasswordResponse, this);
}
Utils.addSettingsViewModel(AdminSecurity, 'AdminSettingsSecurity', 'Security', 'security');
@ -6371,6 +6454,15 @@ AdminAjaxRemoteStorage.prototype.testConnectionForDomain = function (fCallback,
});
};
/**
* @param {?Function} fCallback
* @param {?} oData
*/
AdminAjaxRemoteStorage.prototype.testContacts = function (fCallback, oData)
{
this.defaultRequest(fCallback, 'AdminContactsTest', oData);
};
/**
* @param {?Function} fCallback
* @param {?} oData

File diff suppressed because one or more lines are too long

View file

@ -1013,9 +1013,10 @@ Utils.removeSelection = function ()
/**
* @param {string} sPrefix
* @param {string} sSubject
* @param {boolean=} bFixLongSubject = true
* @return {string}
*/
Utils.replySubjectAdd = function (sPrefix, sSubject)
Utils.replySubjectAdd = function (sPrefix, sSubject, bFixLongSubject)
{
var
oMatch = null,
@ -1037,7 +1038,47 @@ Utils.replySubjectAdd = function (sPrefix, sSubject)
sResult = sPrefix + ': ' + sSubject;
}
return sResult;
sResult = sResult.replace(/[\s]+/g, ' ');
return (Utils.isUnd(bFixLongSubject) ? true : bFixLongSubject) ? Utils.fixLongSubject(sResult) : sResult;
};
/**
* @param {string} sSubject
* @return {string}
*/
Utils.fixLongSubject = function (sSubject)
{
var
iCounter = 0,
oMatch = null
;
sSubject = Utils.trim(sSubject.replace(/[\s]+/, ' '));
do
{
oMatch = /^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/ig.exec(sSubject);
window.console.log(sSubject);
window.console.log(oMatch);
if (!oMatch || Utils.isUnd(oMatch[0]))
{
oMatch = null;
}
if (oMatch)
{
iCounter = 0;
iCounter += Utils.isUnd(oMatch[2]) ? 1 : 0 + Utils.pInt(oMatch[2]);
iCounter += Utils.isUnd(oMatch[4]) ? 1 : 0 + Utils.pInt(oMatch[4]);
sSubject = sSubject.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi, 'Re' + (0 < iCounter ? '[' + iCounter + ']' : '') + ':');
}
}
while (oMatch);
sSubject = sSubject.replace(/[\s]+/, ' ');
return sSubject;
};
/**

File diff suppressed because one or more lines are too long