Identities redesign

This commit is contained in:
RainLoop Team 2013-11-19 02:29:13 +04:00
parent df1c369a9d
commit 44241b859c
22 changed files with 267 additions and 183 deletions

View file

@ -263,8 +263,8 @@ module.exports = function (grunt) {
"dev/ViewModels/SettingsPaneViewModel.js", "dev/ViewModels/SettingsPaneViewModel.js",
"dev/Settings/General.js", "dev/Settings/General.js",
"dev/Settings/Personal.js",
"dev/Settings/Accounts.js", "dev/Settings/Accounts.js",
"dev/Settings/Identity.js",
"dev/Settings/Identities.js", "dev/Settings/Identities.js",
"dev/Settings/Social.js", "dev/Settings/Social.js",
"dev/Settings/ChangePassword.js", "dev/Settings/ChangePassword.js",

View file

@ -579,7 +579,7 @@ RainLoopApp.prototype.bootstart = function ()
if (this.settingsGet('AllowIdentities')) if (this.settingsGet('AllowIdentities'))
{ {
Utils.removeSettingsViewModel(SettingsPersonal); Utils.removeSettingsViewModel(SettingsIdentity);
} }
else else
{ {

View file

@ -7,12 +7,16 @@ function SettingsIdentities()
{ {
var oData = RL.data(); var oData = RL.data();
this.displayName = oData.displayName;
this.signature = oData.signature;
this.replyTo = oData.replyTo;
this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.identities = oData.identities; this.identities = oData.identities;
this.legent = ko.computed(function () {
return Utils.i18n('SETTINGS_IDENTITIES/LEGEND_IDENTITIES_FOR', {'EMAIL': oData.accountEmail()});
}, this);
this.processText = ko.computed(function () { this.processText = ko.computed(function () {
return oData.identitiesLoading() ? Utils.i18n('SETTINGS_IDENTITIES/LOADING_PROCESS') : ''; return oData.identitiesLoading() ? Utils.i18n('SETTINGS_IDENTITIES/LOADING_PROCESS') : '';
}, this); }, this);
@ -34,9 +38,6 @@ function SettingsIdentities()
} }
} }
]}); ]});
this.signature = oData.signature;
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
} }
Utils.addSettingsViewModel(SettingsIdentities, 'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities'); Utils.addSettingsViewModel(SettingsIdentities, 'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities');
@ -52,7 +53,6 @@ SettingsIdentities.prototype.editIdentity = function (oIdentity)
}; };
/** /**
*
* @param {IdentityModel} oIdentityToRemove * @param {IdentityModel} oIdentityToRemove
*/ */
SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove) SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove)
@ -96,11 +96,25 @@ SettingsIdentities.prototype.onBuild = function (oDom)
var var
oData = RL.data(), oData = RL.data(),
f1 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self) f1 = Utils.settingsSaveHelperSimpleFunction(self.displayNameTrigger, self),
f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self),
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
; ;
oData.signature.subscribe(function (sValue) { oData.displayName.subscribe(function (sValue) {
RL.remote().saveSettings(f1, { RL.remote().saveSettings(f1, {
'DisplayName': sValue
});
});
oData.replyTo.subscribe(function (sValue) {
RL.remote().saveSettings(f2, {
'ReplyTo': sValue
});
});
oData.signature.subscribe(function (sValue) {
RL.remote().saveSettings(f3, {
'Signature': sValue 'Signature': sValue
}); });
}); });

View file

@ -3,29 +3,29 @@
/** /**
* @constructor * @constructor
*/ */
function SettingsPersonal() function SettingsIdentity()
{ {
var oData = RL.data(); var oData = RL.data();
this.displayName = oData.displayName; this.displayName = oData.displayName;
this.replyTo = oData.replyTo;
this.signature = oData.signature; this.signature = oData.signature;
this.replyTo = oData.replyTo;
this.nameTrigger = ko.observable(Enums.SaveSettingsStep.Idle); this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle); this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle); this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
} }
Utils.addSettingsViewModel(SettingsPersonal, 'SettingsPersonal', 'SETTINGS_LABELS/LABEL_PERSONAL_NAME', 'personal'); Utils.addSettingsViewModel(SettingsIdentity, 'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
SettingsPersonal.prototype.onBuild = function () SettingsIdentity.prototype.onBuild = function ()
{ {
var self = this; var self = this;
_.delay(function () { _.delay(function () {
var var
oData = RL.data(), oData = RL.data(),
f1 = Utils.settingsSaveHelperSimpleFunction(self.nameTrigger, self), f1 = Utils.settingsSaveHelperSimpleFunction(self.displayNameTrigger, self),
f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self), f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self),
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self) f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
; ;

View file

@ -61,9 +61,9 @@
@import "AdminPlugin.less"; @import "AdminPlugin.less";
@import "Activate.less"; @import "Activate.less";
@import "Settings.less"; @import "Settings.less";
@import "SettingsPersonal.less";
@import "SettingsGeneral.less"; @import "SettingsGeneral.less";
@import "SettingsAccounts.less"; @import "SettingsAccounts.less";
@import "SettingsIdentity.less";
@import "SettingsIdentities.less"; @import "SettingsIdentities.less";
@import "SettingsFolders.less"; @import "SettingsFolders.less";
@import "SettingsThemes.less"; @import "SettingsThemes.less";

View file

@ -0,0 +1,4 @@
.b-settings-identity {
}

View file

@ -1,4 +0,0 @@
.b-settings-personal {
}

View file

@ -19,6 +19,7 @@ function PopupsComposeViewModel()
var var
self = this, self = this,
oRainLoopData = RL.data(),
fEmailArrayToStringLineHelper = function (aList) { fEmailArrayToStringLineHelper = function (aList) {
var var
@ -112,12 +113,21 @@ function PopupsComposeViewModel()
this.currentIdentityResultEmail = ko.observable(''); this.currentIdentityResultEmail = ko.observable('');
this.identitiesOptions = ko.computed(function () { this.identitiesOptions = ko.computed(function () {
return _.map(RL.data().identities(), function (oItem) {
return { var aList = [{
'optValue': oRainLoopData.accountEmail(),
'optText': this.formattedFrom(false)
}];
_.each(oRainLoopData.identities(), function (oItem) {
aList.push({
'optValue': oItem.id, 'optValue': oItem.id,
'optText': oItem.formattedNameForCompose() 'optText': oItem.formattedNameForCompose()
}; });
}); });
return aList;
}, this); }, this);
ko.computed(function () { ko.computed(function () {
@ -130,7 +140,7 @@ function PopupsComposeViewModel()
sID = this.currentIdentityID() sID = this.currentIdentityID()
; ;
if (this.bAllowIdentities && sID) if (this.bAllowIdentities && sID && sID !== RL.data().accountEmail())
{ {
oItem = _.find(aList, function (oItem) { oItem = _.find(aList, function (oItem) {
return oItem && sID === oItem['id']; return oItem && sID === oItem['id'];
@ -142,9 +152,11 @@ function PopupsComposeViewModel()
if ('' === sResult && aList[0]) if ('' === sResult && aList[0])
{ {
this.currentIdentityID(aList[0]['id']); this.currentIdentityID(aList[0]['id']);
return '';
} }
} }
else
if ('' === sResult)
{ {
sResult = this.formattedFrom(false); sResult = this.formattedFrom(false);
sResultEmail = this.formattedFrom(true); sResultEmail = this.formattedFrom(true);
@ -427,10 +439,8 @@ PopupsComposeViewModel.prototype.findIdentityIdByMessage = function (sComposeTyp
oIDs[oItem.email()] = oItem['id']; oIDs[oItem.email()] = oItem['id'];
}); });
} }
else
{ oIDs[RL.data().accountEmail()] = RL.data().accountEmail();
oIDs[RL.data().accountEmail()] = RL.data().accountEmail();
}
switch (sComposeType) switch (sComposeType)
{ {

View file

@ -1330,7 +1330,8 @@ class Actions
{ {
foreach ($aSubIdentities as $aItem) foreach ($aSubIdentities as $aItem)
{ {
if (isset($aItem['Id'], $aItem['Email'], $aItem['Name'], $aItem['ReplyTo'], $aItem['Bcc'])) if (isset($aItem['Id'], $aItem['Email'], $aItem['Name'], $aItem['ReplyTo'], $aItem['Bcc']) &&
$aItem['Id'] !== $oAccount->Email())
{ {
$oItem = \RainLoop\Identity::NewInstance($aItem['Id'], $aItem['Email'], $oItem = \RainLoop\Identity::NewInstance($aItem['Id'], $aItem['Email'],
$aItem['Name'], $aItem['ReplyTo'], $aItem['Bcc']); $aItem['Name'], $aItem['ReplyTo'], $aItem['Bcc']);
@ -1339,14 +1340,6 @@ class Actions
} }
} }
} }
if (0 === \count($aIdentities))
{
$aIdentities[] = \RainLoop\Identity::NewInstance($oAccount->Email(), $oAccount->Email(),
$oSettings->GetConf('DisplayName', ''),
$oSettings->GetConf('ReplyTo', '')
);
}
} }
return $aIdentities; return $aIdentities;
@ -1514,20 +1507,6 @@ class Actions
$sReplyTo = \trim($this->GetActionParam('ReplyTo', '')); $sReplyTo = \trim($this->GetActionParam('ReplyTo', ''));
$sBcc = \trim($this->GetActionParam('Bcc', '')); $sBcc = \trim($this->GetActionParam('Bcc', ''));
if ($sId === $oAccount->Email())
{
$sEmail = $oAccount->Email();
$oSettings = $this->SettingsProvider()->Load($oAccount);
if ($oSettings)
{
$oSettings->SetConf('DisplayName', $sName);
$oSettings->SetConf('ReplyTo', $sReplyTo);
$this->SettingsProvider()->Save($oAccount, $oSettings);
}
}
if (empty($sEmail)) if (empty($sEmail))
{ {
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError); throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError);
@ -1583,7 +1562,7 @@ class Actions
$oAccount = $this->getAccountFromToken(); $oAccount = $this->getAccountFromToken();
$sId = \trim($this->GetActionParam('IdToDelete', '')); $sId = \trim($this->GetActionParam('IdToDelete', ''));
if (empty($sId) || $sId === $oAccount->Email()) if (empty($sId))
{ {
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError); throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError);
} }

View file

@ -84,7 +84,7 @@
</label> </label>
<label data-bind="click: function () { allowIdentities(!allowIdentities()); }"> <label data-bind="click: function () { allowIdentities(!allowIdentities()); }">
<i data-bind="css: allowIdentities() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i> <i data-bind="css: allowIdentities() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
Allow identities Allow additional identities
</label> </label>
</div> </div>
</div> </div>

View file

@ -1,7 +1,39 @@
<div class="b-settings-identities"> <div class="b-settings-identities">
<div class="form-horizontal"> <div class="form-horizontal">
<div class="legend"> <div class="legend">
<span class="i18n" data-bind="text: legent"></span> <span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LEGEND_IDENTITY"></span>
</div>
<div class="control-group">
<label class="control-label">
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LABEL_DISPLAY_NAME"></span>
</label>
<div class="controls">
<input class="input-xlarge" type="text" data-bind="value: displayName, saveTrigger: displayNameTrigger" />
<div data-bind="saveTrigger: displayNameTrigger"></div>
</div>
</div>
<div class="control-group" style="display: none">
<label class="control-label">
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LABEL_REPLY_TO"></span>
</label>
<div class="controls">
<input class="input-xlarge" type="text" data-bind="value: replyTo" />
</div>
</div>
<div class="control-group">
<label class="control-label">
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LABEL_SIGNATURE"></span>
</label>
<div class="controls">
<textarea class="input-xxlarge" data-bind="value: signature, saveTrigger: signatureTrigger" rows="7" spellcheck="true"></textarea>
<div style="vertical-align: top;" data-bind="saveTrigger: signatureTrigger"></div>
</div>
</div>
</div>
<br />
<div class="form-horizontal">
<div class="legend">
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LEGEND_IDENTITIES"></span>
</div> </div>
</div> </div>
<a class="btn" data-bind="click: addNewIdentity"> <a class="btn" data-bind="click: addNewIdentity">
@ -39,15 +71,4 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<br />
<br />
<div class="form-horizontal">
<div class="legend">
<span class="i18n" data-i18n-text="SETTINGS_IDENTITIES/LEGEND_SIGNATURE"></span>
</div>
</div>
<div>
<textarea class="input-xxlarge" data-bind="value: signature, saveTrigger: signatureTrigger" rows="7" spellcheck="true"></textarea>
<div style="vertical-align: top;" data-bind="saveTrigger: signatureTrigger"></div>
</div>
</div> </div>

View file

@ -1,20 +1,20 @@
<div class="b-settings-personal"> <div class="b-settings-identity">
<div class="form-horizontal"> <div class="form-horizontal">
<div class="legend"> <div class="legend">
<span class="i18n" data-i18n-text="SETTINGS_PERSONAL/LEGEND_PERSONAL"></span> <span class="i18n" data-i18n-text="SETTINGS_IDENTITY/LEGEND_IDENTITY"></span>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label"> <label class="control-label">
<span class="i18n" data-i18n-text="SETTINGS_PERSONAL/LABEL_DISPLAY_NAME"></span> <span class="i18n" data-i18n-text="SETTINGS_IDENTITY/LABEL_DISPLAY_NAME"></span>
</label> </label>
<div class="controls"> <div class="controls">
<input class="input-xlarge" type="text" data-bind="value: displayName, saveTrigger: nameTrigger" /> <input class="input-xlarge" type="text" data-bind="value: displayName, saveTrigger: displayNameTrigger" />
<div data-bind="saveTrigger: nameTrigger"></div> <div data-bind="saveTrigger: displayNameTrigger"></div>
</div> </div>
</div> </div>
<div class="control-group" style="display: none"> <div class="control-group" style="display: none">
<label class="control-label"> <label class="control-label">
<span class="i18n" data-i18n-text="SETTINGS_PERSONAL/LABEL_REPLY_TO"></span> <span class="i18n" data-i18n-text="SETTINGS_IDENTITY/LABEL_REPLY_TO"></span>
</label> </label>
<div class="controls"> <div class="controls">
<input class="input-xlarge" type="text" data-bind="value: replyTo" /> <input class="input-xlarge" type="text" data-bind="value: replyTo" />
@ -22,7 +22,7 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label"> <label class="control-label">
<span class="i18n" data-i18n-text="SETTINGS_PERSONAL/LABEL_SIGNATURE"></span> <span class="i18n" data-i18n-text="SETTINGS_IDENTITY/LABEL_SIGNATURE"></span>
</label> </label>
<div class="controls"> <div class="controls">
<textarea class="input-xxlarge" data-bind="value: signature, saveTrigger: signatureTrigger" rows="7" spellcheck="true"></textarea> <textarea class="input-xxlarge" data-bind="value: signature, saveTrigger: signatureTrigger" rows="7" spellcheck="true"></textarea>

View file

@ -250,14 +250,15 @@ LABEL_PERSONAL_NAME = "Persönlich"
LABEL_GENERAL_NAME = "Allgemein" LABEL_GENERAL_NAME = "Allgemein"
LABEL_FOLDERS_NAME = "Ordner" LABEL_FOLDERS_NAME = "Ordner"
LABEL_ACCOUNTS_NAME = "Konten" LABEL_ACCOUNTS_NAME = "Konten"
LABEL_IDENTITY_NAME = "Identity"
LABEL_IDENTITIES_NAME = "Identities" LABEL_IDENTITIES_NAME = "Identities"
LABEL_SOCIAL_NAME = "Social" LABEL_SOCIAL_NAME = "Social"
LABEL_THEMES_NAME = "Vorlagen" LABEL_THEMES_NAME = "Vorlagen"
LABEL_CHANGE_PASSWORD_NAME = "Passwort" LABEL_CHANGE_PASSWORD_NAME = "Passwort"
BUTTON_BACK = "Zurück" BUTTON_BACK = "Zurück"
[SETTINGS_PERSONAL] [SETTINGS_IDENTITY]
LEGEND_PERSONAL = "Persönlich" LEGEND_IDENTITY = "Identity"
LABEL_DISPLAY_NAME = "Name" LABEL_DISPLAY_NAME = "Name"
LABEL_REPLY_TO = "Reply To" LABEL_REPLY_TO = "Reply To"
LABEL_SIGNATURE = "Signatur" LABEL_SIGNATURE = "Signatur"
@ -331,8 +332,11 @@ LOADING_PROCESS = "Liste der Konten wird geladen"
DELETING_ASK = "Sind Sie sicher?" DELETING_ASK = "Sind Sie sicher?"
[SETTINGS_IDENTITIES] [SETTINGS_IDENTITIES]
LEGEND_IDENTITIES_FOR = "Identities for \"%EMAIL%\"" LEGEND_IDENTITY = "Identity"
LEGEND_SIGNATURE = "Signature" LEGEND_IDENTITIES = "Additional Identities"
LABEL_DISPLAY_NAME = "Name"
LABEL_REPLY_TO = "Reply To"
LABEL_SIGNATURE = "Signatur"
BUTTON_ADD_IDENTITY = "Add Identity" BUTTON_ADD_IDENTITY = "Add Identity"
BUTTON_DELETE = "Delete" BUTTON_DELETE = "Delete"
LOADING_PROCESS = "Updating identity list" LOADING_PROCESS = "Updating identity list"

View file

@ -250,14 +250,15 @@ LABEL_PERSONAL_NAME = "Personal"
LABEL_GENERAL_NAME = "General" LABEL_GENERAL_NAME = "General"
LABEL_FOLDERS_NAME = "Folders" LABEL_FOLDERS_NAME = "Folders"
LABEL_ACCOUNTS_NAME = "Accounts" LABEL_ACCOUNTS_NAME = "Accounts"
LABEL_IDENTITY_NAME = "Identity"
LABEL_IDENTITIES_NAME = "Identities" LABEL_IDENTITIES_NAME = "Identities"
LABEL_SOCIAL_NAME = "Social" LABEL_SOCIAL_NAME = "Social"
LABEL_THEMES_NAME = "Themes" LABEL_THEMES_NAME = "Themes"
LABEL_CHANGE_PASSWORD_NAME = "Password" LABEL_CHANGE_PASSWORD_NAME = "Password"
BUTTON_BACK = "Back" BUTTON_BACK = "Back"
[SETTINGS_PERSONAL] [SETTINGS_IDENTITY]
LEGEND_PERSONAL = "Personal" LEGEND_IDENTITY = "Identity"
LABEL_DISPLAY_NAME = "Name" LABEL_DISPLAY_NAME = "Name"
LABEL_REPLY_TO = "Reply-To" LABEL_REPLY_TO = "Reply-To"
LABEL_SIGNATURE = "Signature" LABEL_SIGNATURE = "Signature"
@ -331,8 +332,11 @@ LOADING_PROCESS = "Updating account list"
DELETING_ASK = "Are you sure?" DELETING_ASK = "Are you sure?"
[SETTINGS_IDENTITIES] [SETTINGS_IDENTITIES]
LEGEND_IDENTITIES_FOR = "Identities for \"%EMAIL%\"" LEGEND_IDENTITY = "Identity"
LEGEND_SIGNATURE = "Signature" LEGEND_IDENTITIES = "Additional Identities"
LABEL_DISPLAY_NAME = "Name"
LABEL_REPLY_TO = "Reply-To"
LABEL_SIGNATURE = "Signature"
BUTTON_ADD_IDENTITY = "Add Identity" BUTTON_ADD_IDENTITY = "Add Identity"
BUTTON_DELETE = "Delete" BUTTON_DELETE = "Delete"
LOADING_PROCESS = "Updating identity list" LOADING_PROCESS = "Updating identity list"

View file

@ -250,14 +250,15 @@ LABEL_PERSONAL_NAME = "Personal"
LABEL_GENERAL_NAME = "General" LABEL_GENERAL_NAME = "General"
LABEL_FOLDERS_NAME = "Carpetas" LABEL_FOLDERS_NAME = "Carpetas"
LABEL_ACCOUNTS_NAME = "Cuentas" LABEL_ACCOUNTS_NAME = "Cuentas"
LABEL_IDENTITY_NAME = "Identity"
LABEL_IDENTITIES_NAME = "Identities" LABEL_IDENTITIES_NAME = "Identities"
LABEL_SOCIAL_NAME = "Social" LABEL_SOCIAL_NAME = "Social"
LABEL_THEMES_NAME = "Temas" LABEL_THEMES_NAME = "Temas"
LABEL_CHANGE_PASSWORD_NAME = "Contraseña" LABEL_CHANGE_PASSWORD_NAME = "Contraseña"
BUTTON_BACK = "Atrás" BUTTON_BACK = "Atrás"
[SETTINGS_PERSONAL] [SETTINGS_IDENTITY]
LEGEND_PERSONAL = "Personal" LEGEND_IDENTITY = "Identity"
LABEL_DISPLAY_NAME = "Nombre" LABEL_DISPLAY_NAME = "Nombre"
LABEL_REPLY_TO = "Responder a" LABEL_REPLY_TO = "Responder a"
LABEL_SIGNATURE = "Firma" LABEL_SIGNATURE = "Firma"
@ -331,8 +332,11 @@ LOADING_PROCESS = "Actualizando lista de cuentas"
DELETING_ASK = "Estas seguro?" DELETING_ASK = "Estas seguro?"
[SETTINGS_IDENTITIES] [SETTINGS_IDENTITIES]
LEGEND_IDENTITIES_FOR = "Identities for \"%EMAIL%\"" LEGEND_IDENTITY = "Identity"
LEGEND_SIGNATURE = "Signature" LEGEND_IDENTITIES = "Additional Identities"
LABEL_DISPLAY_NAME = "Nombre"
LABEL_REPLY_TO = "Responder a"
LABEL_SIGNATURE = "Firma"
BUTTON_ADD_IDENTITY = "Add Identity" BUTTON_ADD_IDENTITY = "Add Identity"
BUTTON_DELETE = "Delete" BUTTON_DELETE = "Delete"
LOADING_PROCESS = "Updating identity list" LOADING_PROCESS = "Updating identity list"

View file

@ -250,14 +250,15 @@ LABEL_PERSONAL_NAME = "Personnel"
LABEL_GENERAL_NAME = "Général" LABEL_GENERAL_NAME = "Général"
LABEL_FOLDERS_NAME = "Dossiers" LABEL_FOLDERS_NAME = "Dossiers"
LABEL_ACCOUNTS_NAME = "Comptes" LABEL_ACCOUNTS_NAME = "Comptes"
LABEL_IDENTITY_NAME = "Identity"
LABEL_IDENTITIES_NAME = "Identities" LABEL_IDENTITIES_NAME = "Identities"
LABEL_SOCIAL_NAME = "Social" LABEL_SOCIAL_NAME = "Social"
LABEL_THEMES_NAME = "Thèmes" LABEL_THEMES_NAME = "Thèmes"
LABEL_CHANGE_PASSWORD_NAME = "Mot de passe" LABEL_CHANGE_PASSWORD_NAME = "Mot de passe"
BUTTON_BACK = "Retour" BUTTON_BACK = "Retour"
[SETTINGS_PERSONAL] [SETTINGS_IDENTITY]
LEGEND_PERSONAL = "Personnel" LEGEND_IDENTITY = "Identity"
LABEL_DISPLAY_NAME = "Nom" LABEL_DISPLAY_NAME = "Nom"
LABEL_REPLY_TO = "Répondre à" LABEL_REPLY_TO = "Répondre à"
LABEL_SIGNATURE = "Signature" LABEL_SIGNATURE = "Signature"
@ -331,8 +332,11 @@ LOADING_PROCESS = "Mise à jour de la liste des comptes"
DELETING_ASK = "Êtes-vous sûr ?" DELETING_ASK = "Êtes-vous sûr ?"
[SETTINGS_IDENTITIES] [SETTINGS_IDENTITIES]
LEGEND_IDENTITIES_FOR = "Identitiés pour \"%EMAIL%\"" LEGEND_IDENTITY = "Identity"
LEGEND_SIGNATURE = "Signature" LEGEND_IDENTITIES = "Additional Identities"
LABEL_DISPLAY_NAME = "Nom"
LABEL_REPLY_TO = "Répondre à"
LABEL_SIGNATURE = "Signature"
BUTTON_ADD_IDENTITY = "Ajouter une identitié" BUTTON_ADD_IDENTITY = "Ajouter une identitié"
BUTTON_DELETE = "Supprimer" BUTTON_DELETE = "Supprimer"
LOADING_PROCESS = "Met à jour la liste d'identités" LOADING_PROCESS = "Met à jour la liste d'identités"

View file

@ -250,14 +250,15 @@ LABEL_PERSONAL_NAME = "Persónulegt"
LABEL_GENERAL_NAME = "Almennt" LABEL_GENERAL_NAME = "Almennt"
LABEL_FOLDERS_NAME = "Möppur" LABEL_FOLDERS_NAME = "Möppur"
LABEL_ACCOUNTS_NAME = "Aðgangar" LABEL_ACCOUNTS_NAME = "Aðgangar"
LABEL_IDENTITY_NAME = "Identity"
LABEL_IDENTITIES_NAME = "Identities" LABEL_IDENTITIES_NAME = "Identities"
LABEL_SOCIAL_NAME = "Félagsmiðlar" LABEL_SOCIAL_NAME = "Félagsmiðlar"
LABEL_THEMES_NAME = "Þemur" LABEL_THEMES_NAME = "Þemur"
LABEL_CHANGE_PASSWORD_NAME = "Lykilorð" LABEL_CHANGE_PASSWORD_NAME = "Lykilorð"
BUTTON_BACK = "Til baka" BUTTON_BACK = "Til baka"
[SETTINGS_PERSONAL] [SETTINGS_IDENTITY]
LEGEND_PERSONAL = "Persónulegt" LEGEND_IDENTITY = "Identity"
LABEL_DISPLAY_NAME = "Nafn" LABEL_DISPLAY_NAME = "Nafn"
LABEL_REPLY_TO = "Svara" LABEL_REPLY_TO = "Svara"
LABEL_SIGNATURE = "Undirskrift" LABEL_SIGNATURE = "Undirskrift"
@ -331,8 +332,11 @@ LOADING_PROCESS = "Uppfæri aðgangslista"
DELETING_ASK = "Ertu viss?" DELETING_ASK = "Ertu viss?"
[SETTINGS_IDENTITIES] [SETTINGS_IDENTITIES]
LEGEND_IDENTITIES_FOR = "Identities for \"%EMAIL%\"" LEGEND_IDENTITY = "Identity"
LEGEND_SIGNATURE = "Signature" LEGEND_IDENTITIES = "Additional Identities"
LABEL_DISPLAY_NAME = "Nafn"
LABEL_REPLY_TO = "Svara"
LABEL_SIGNATURE = "Undirskrift"
BUTTON_ADD_IDENTITY = "Add Identity" BUTTON_ADD_IDENTITY = "Add Identity"
BUTTON_DELETE = "Delete" BUTTON_DELETE = "Delete"
LOADING_PROCESS = "Updating identity list" LOADING_PROCESS = "Updating identity list"

View file

@ -250,14 +250,15 @@ LABEL_PERSONAL_NAME = "Personīgie"
LABEL_GENERAL_NAME = "Vispārējie" LABEL_GENERAL_NAME = "Vispārējie"
LABEL_FOLDERS_NAME = "Mapes" LABEL_FOLDERS_NAME = "Mapes"
LABEL_ACCOUNTS_NAME = "Konti" LABEL_ACCOUNTS_NAME = "Konti"
LABEL_IDENTITY_NAME = "Identity"
LABEL_IDENTITIES_NAME = "Identities" LABEL_IDENTITIES_NAME = "Identities"
LABEL_SOCIAL_NAME = "Sociālie" LABEL_SOCIAL_NAME = "Sociālie"
LABEL_THEMES_NAME = "Tēmas" LABEL_THEMES_NAME = "Tēmas"
LABEL_CHANGE_PASSWORD_NAME = "Parole" LABEL_CHANGE_PASSWORD_NAME = "Parole"
BUTTON_BACK = "Atpakaļ" BUTTON_BACK = "Atpakaļ"
[SETTINGS_PERSONAL] [SETTINGS_IDENTITY]
LEGEND_PERSONAL = "Personīgie" LEGEND_IDENTITY = "Identity"
LABEL_DISPLAY_NAME = "Vārds" LABEL_DISPLAY_NAME = "Vārds"
LABEL_REPLY_TO = "Atbildēt uz" LABEL_REPLY_TO = "Atbildēt uz"
LABEL_SIGNATURE = "Paraksts" LABEL_SIGNATURE = "Paraksts"
@ -331,8 +332,11 @@ LOADING_PROCESS = "Atjauno kontu sarakstu"
DELETING_ASK = "Tiešām?" DELETING_ASK = "Tiešām?"
[SETTINGS_IDENTITIES] [SETTINGS_IDENTITIES]
LEGEND_IDENTITIES_FOR = "Identities for \"%EMAIL%\"" LEGEND_IDENTITY = "Identity"
LEGEND_SIGNATURE = "Signature" LEGEND_IDENTITIES = "Additional Identities"
LABEL_DISPLAY_NAME = "Vārds"
LABEL_REPLY_TO = "Atbildēt uz"
LABEL_SIGNATURE = "Paraksts"
BUTTON_ADD_IDENTITY = "Add Identity" BUTTON_ADD_IDENTITY = "Add Identity"
BUTTON_DELETE = "Delete" BUTTON_DELETE = "Delete"
LOADING_PROCESS = "Updating identity list" LOADING_PROCESS = "Updating identity list"

View file

@ -250,14 +250,15 @@ LABEL_PERSONAL_NAME = "Persoonlijk"
LABEL_GENERAL_NAME = "Algemeen" LABEL_GENERAL_NAME = "Algemeen"
LABEL_FOLDERS_NAME = "Mappen" LABEL_FOLDERS_NAME = "Mappen"
LABEL_ACCOUNTS_NAME = "Accounts" LABEL_ACCOUNTS_NAME = "Accounts"
LABEL_IDENTITY_NAME = "Identity"
LABEL_IDENTITIES_NAME = "Identities" LABEL_IDENTITIES_NAME = "Identities"
LABEL_SOCIAL_NAME = "Social" LABEL_SOCIAL_NAME = "Social"
LABEL_THEMES_NAME = "Themes" LABEL_THEMES_NAME = "Themes"
LABEL_CHANGE_PASSWORD_NAME = "Paswoord" LABEL_CHANGE_PASSWORD_NAME = "Paswoord"
BUTTON_BACK = "Terug" BUTTON_BACK = "Terug"
[SETTINGS_PERSONAL] [SETTINGS_IDENTITY]
LEGEND_PERSONAL = "Persoonlijk" LEGEND_IDENTITY = "Identity"
LABEL_DISPLAY_NAME = "Naam" LABEL_DISPLAY_NAME = "Naam"
LABEL_REPLY_TO = "Antwoorden naar" LABEL_REPLY_TO = "Antwoorden naar"
LABEL_SIGNATURE = "Handtekening" LABEL_SIGNATURE = "Handtekening"
@ -331,8 +332,11 @@ LOADING_PROCESS = "Updating account lijst"
DELETING_ASK = "Ben je zeker?" DELETING_ASK = "Ben je zeker?"
[SETTINGS_IDENTITIES] [SETTINGS_IDENTITIES]
LEGEND_IDENTITIES_FOR = "Identities for \"%EMAIL%\"" LEGEND_IDENTITY = "Identity"
LEGEND_SIGNATURE = "Signature" LEGEND_IDENTITIES = "Additional Identities"
LABEL_DISPLAY_NAME = "Naam"
LABEL_REPLY_TO = "Antwoorden naar"
LABEL_SIGNATURE = "Handtekening"
BUTTON_ADD_IDENTITY = "Add Identity" BUTTON_ADD_IDENTITY = "Add Identity"
BUTTON_DELETE = "Delete" BUTTON_DELETE = "Delete"
LOADING_PROCESS = "Updating identity list" LOADING_PROCESS = "Updating identity list"

View file

@ -250,14 +250,15 @@ LABEL_PERSONAL_NAME = "Pessoal"
LABEL_GENERAL_NAME = "Geral" LABEL_GENERAL_NAME = "Geral"
LABEL_FOLDERS_NAME = "Pastas" LABEL_FOLDERS_NAME = "Pastas"
LABEL_ACCOUNTS_NAME = "Contas" LABEL_ACCOUNTS_NAME = "Contas"
LABEL_IDENTITY_NAME = "Identity"
LABEL_IDENTITIES_NAME = "Identities" LABEL_IDENTITIES_NAME = "Identities"
LABEL_SOCIAL_NAME = "Social" LABEL_SOCIAL_NAME = "Social"
LABEL_THEMES_NAME = "Temas" LABEL_THEMES_NAME = "Temas"
LABEL_CHANGE_PASSWORD_NAME = "Senha" LABEL_CHANGE_PASSWORD_NAME = "Senha"
BUTTON_BACK = "Voltar" BUTTON_BACK = "Voltar"
[SETTINGS_PERSONAL] [SETTINGS_IDENTITY]
LEGEND_PERSONAL = "Pessoal" LEGEND_IDENTITY = "Identity"
LABEL_DISPLAY_NAME = "Nome" LABEL_DISPLAY_NAME = "Nome"
LABEL_REPLY_TO = "Reenviar para" LABEL_REPLY_TO = "Reenviar para"
LABEL_SIGNATURE = "Assinatura" LABEL_SIGNATURE = "Assinatura"
@ -331,8 +332,11 @@ LOADING_PROCESS = "Atualizar a lista de contas"
DELETING_ASK = "Você tem certeza?" DELETING_ASK = "Você tem certeza?"
[SETTINGS_IDENTITIES] [SETTINGS_IDENTITIES]
LEGEND_IDENTITIES_FOR = "Identities for \"%EMAIL%\"" LEGEND_IDENTITY = "Identity"
LEGEND_SIGNATURE = "Signature" LEGEND_IDENTITIES = "Additional Identities"
LABEL_DISPLAY_NAME = "Nome"
LABEL_REPLY_TO = "Reenviar para"
LABEL_SIGNATURE = "Assinatura"
BUTTON_ADD_IDENTITY = "Add Identity" BUTTON_ADD_IDENTITY = "Add Identity"
BUTTON_DELETE = "Delete" BUTTON_DELETE = "Delete"
LOADING_PROCESS = "Updating identity list" LOADING_PROCESS = "Updating identity list"

View file

@ -250,14 +250,15 @@ LABEL_PERSONAL_NAME = "Персональные"
LABEL_GENERAL_NAME = "Основные" LABEL_GENERAL_NAME = "Основные"
LABEL_FOLDERS_NAME = "Папки" LABEL_FOLDERS_NAME = "Папки"
LABEL_ACCOUNTS_NAME = "Аккаунты" LABEL_ACCOUNTS_NAME = "Аккаунты"
LABEL_IDENTITY_NAME = "Профиль"
LABEL_IDENTITIES_NAME = "Профили" LABEL_IDENTITIES_NAME = "Профили"
LABEL_SOCIAL_NAME = "Социальные" LABEL_SOCIAL_NAME = "Социальные"
LABEL_THEMES_NAME = "Темы" LABEL_THEMES_NAME = "Темы"
LABEL_CHANGE_PASSWORD_NAME = "Пароль" LABEL_CHANGE_PASSWORD_NAME = "Пароль"
BUTTON_BACK = "Назад" BUTTON_BACK = "Назад"
[SETTINGS_PERSONAL] [SETTINGS_IDENTITY]
LEGEND_PERSONAL = "Персональные Настройки" LEGEND_IDENTITY = "Настройки профиля"
LABEL_DISPLAY_NAME = "Имя" LABEL_DISPLAY_NAME = "Имя"
LABEL_REPLY_TO = "Отвечать на" LABEL_REPLY_TO = "Отвечать на"
LABEL_SIGNATURE = "Подпись" LABEL_SIGNATURE = "Подпись"
@ -331,8 +332,11 @@ LOADING_PROCESS = "Обновление списка аккаунтов"
DELETING_ASK = "Точно?" DELETING_ASK = "Точно?"
[SETTINGS_IDENTITIES] [SETTINGS_IDENTITIES]
LEGEND_IDENTITIES_FOR = "Профили для \"%EMAIL%\"" LEGEND_IDENTITY = "Настройки основного профиля"
LEGEND_SIGNATURE = "Подпись" LEGEND_IDENTITIES = "Дополнительные профили"
LABEL_DISPLAY_NAME = "Имя"
LABEL_REPLY_TO = "Отвечать на"
LABEL_SIGNATURE = "Подпись"
BUTTON_ADD_IDENTITY = "Добавить профиль" BUTTON_ADD_IDENTITY = "Добавить профиль"
BUTTON_DELETE = "Удалить" BUTTON_DELETE = "Удалить"
LOADING_PROCESS = "Обновление списка профилей" LOADING_PROCESS = "Обновление списка профилей"

View file

@ -7501,6 +7501,7 @@ function PopupsComposeViewModel()
var var
self = this, self = this,
oRainLoopData = RL.data(),
fEmailArrayToStringLineHelper = function (aList) { fEmailArrayToStringLineHelper = function (aList) {
var var
@ -7594,12 +7595,21 @@ function PopupsComposeViewModel()
this.currentIdentityResultEmail = ko.observable(''); this.currentIdentityResultEmail = ko.observable('');
this.identitiesOptions = ko.computed(function () { this.identitiesOptions = ko.computed(function () {
return _.map(RL.data().identities(), function (oItem) {
return { var aList = [{
'optValue': oRainLoopData.accountEmail(),
'optText': this.formattedFrom(false)
}];
_.each(oRainLoopData.identities(), function (oItem) {
aList.push({
'optValue': oItem.id, 'optValue': oItem.id,
'optText': oItem.formattedNameForCompose() 'optText': oItem.formattedNameForCompose()
}; });
}); });
return aList;
}, this); }, this);
ko.computed(function () { ko.computed(function () {
@ -7612,7 +7622,7 @@ function PopupsComposeViewModel()
sID = this.currentIdentityID() sID = this.currentIdentityID()
; ;
if (this.bAllowIdentities && sID) if (this.bAllowIdentities && sID && sID !== RL.data().accountEmail())
{ {
oItem = _.find(aList, function (oItem) { oItem = _.find(aList, function (oItem) {
return oItem && sID === oItem['id']; return oItem && sID === oItem['id'];
@ -7624,9 +7634,11 @@ function PopupsComposeViewModel()
if ('' === sResult && aList[0]) if ('' === sResult && aList[0])
{ {
this.currentIdentityID(aList[0]['id']); this.currentIdentityID(aList[0]['id']);
return '';
} }
} }
else
if ('' === sResult)
{ {
sResult = this.formattedFrom(false); sResult = this.formattedFrom(false);
sResultEmail = this.formattedFrom(true); sResultEmail = this.formattedFrom(true);
@ -7909,10 +7921,8 @@ PopupsComposeViewModel.prototype.findIdentityIdByMessage = function (sComposeTyp
oIDs[oItem.email()] = oItem['id']; oIDs[oItem.email()] = oItem['id'];
}); });
} }
else
{ oIDs[RL.data().accountEmail()] = RL.data().accountEmail();
oIDs[RL.data().accountEmail()] = RL.data().accountEmail();
}
switch (sComposeType) switch (sComposeType)
{ {
@ -11557,57 +11567,6 @@ SettingsGeneral.prototype.selectLanguage = function ()
kn.showScreenPopup(PopupsLanguagesViewModel); kn.showScreenPopup(PopupsLanguagesViewModel);
}; };
/**
* @constructor
*/
function SettingsPersonal()
{
var oData = RL.data();
this.displayName = oData.displayName;
this.replyTo = oData.replyTo;
this.signature = oData.signature;
this.nameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
}
Utils.addSettingsViewModel(SettingsPersonal, 'SettingsPersonal', 'SETTINGS_LABELS/LABEL_PERSONAL_NAME', 'personal');
SettingsPersonal.prototype.onBuild = function ()
{
var self = this;
_.delay(function () {
var
oData = RL.data(),
f1 = Utils.settingsSaveHelperSimpleFunction(self.nameTrigger, self),
f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self),
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
;
oData.displayName.subscribe(function (sValue) {
RL.remote().saveSettings(f1, {
'DisplayName': sValue
});
});
oData.replyTo.subscribe(function (sValue) {
RL.remote().saveSettings(f2, {
'ReplyTo': sValue
});
});
oData.signature.subscribe(function (sValue) {
RL.remote().saveSettings(f3, {
'Signature': sValue
});
});
}, 50);
};
/** /**
* @constructor * @constructor
*/ */
@ -11674,6 +11633,57 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
} }
}; };
/**
* @constructor
*/
function SettingsIdentity()
{
var oData = RL.data();
this.displayName = oData.displayName;
this.signature = oData.signature;
this.replyTo = oData.replyTo;
this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
}
Utils.addSettingsViewModel(SettingsIdentity, 'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
SettingsIdentity.prototype.onBuild = function ()
{
var self = this;
_.delay(function () {
var
oData = RL.data(),
f1 = Utils.settingsSaveHelperSimpleFunction(self.displayNameTrigger, self),
f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self),
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
;
oData.displayName.subscribe(function (sValue) {
RL.remote().saveSettings(f1, {
'DisplayName': sValue
});
});
oData.replyTo.subscribe(function (sValue) {
RL.remote().saveSettings(f2, {
'ReplyTo': sValue
});
});
oData.signature.subscribe(function (sValue) {
RL.remote().saveSettings(f3, {
'Signature': sValue
});
});
}, 50);
};
/** /**
* @constructor * @constructor
*/ */
@ -11681,12 +11691,16 @@ function SettingsIdentities()
{ {
var oData = RL.data(); var oData = RL.data();
this.displayName = oData.displayName;
this.signature = oData.signature;
this.replyTo = oData.replyTo;
this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.identities = oData.identities; this.identities = oData.identities;
this.legent = ko.computed(function () {
return Utils.i18n('SETTINGS_IDENTITIES/LEGEND_IDENTITIES_FOR', {'EMAIL': oData.accountEmail()});
}, this);
this.processText = ko.computed(function () { this.processText = ko.computed(function () {
return oData.identitiesLoading() ? Utils.i18n('SETTINGS_IDENTITIES/LOADING_PROCESS') : ''; return oData.identitiesLoading() ? Utils.i18n('SETTINGS_IDENTITIES/LOADING_PROCESS') : '';
}, this); }, this);
@ -11708,9 +11722,6 @@ function SettingsIdentities()
} }
} }
]}); ]});
this.signature = oData.signature;
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
} }
Utils.addSettingsViewModel(SettingsIdentities, 'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities'); Utils.addSettingsViewModel(SettingsIdentities, 'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities');
@ -11726,7 +11737,6 @@ SettingsIdentities.prototype.editIdentity = function (oIdentity)
}; };
/** /**
*
* @param {IdentityModel} oIdentityToRemove * @param {IdentityModel} oIdentityToRemove
*/ */
SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove) SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove)
@ -11770,11 +11780,25 @@ SettingsIdentities.prototype.onBuild = function (oDom)
var var
oData = RL.data(), oData = RL.data(),
f1 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self) f1 = Utils.settingsSaveHelperSimpleFunction(self.displayNameTrigger, self),
f2 = Utils.settingsSaveHelperSimpleFunction(self.replyTrigger, self),
f3 = Utils.settingsSaveHelperSimpleFunction(self.signatureTrigger, self)
; ;
oData.signature.subscribe(function (sValue) { oData.displayName.subscribe(function (sValue) {
RL.remote().saveSettings(f1, { RL.remote().saveSettings(f1, {
'DisplayName': sValue
});
});
oData.replyTo.subscribe(function (sValue) {
RL.remote().saveSettings(f2, {
'ReplyTo': sValue
});
});
oData.signature.subscribe(function (sValue) {
RL.remote().saveSettings(f3, {
'Signature': sValue 'Signature': sValue
}); });
}); });
@ -15780,7 +15804,7 @@ RainLoopApp.prototype.bootstart = function ()
if (this.settingsGet('AllowIdentities')) if (this.settingsGet('AllowIdentities'))
{ {
Utils.removeSettingsViewModel(SettingsPersonal); Utils.removeSettingsViewModel(SettingsIdentity);
} }
else else
{ {