Release fixes

This commit is contained in:
RainLoop Team 2015-02-04 22:26:33 +04:00
parent 6576eee3c8
commit 44566aad4b
9 changed files with 51 additions and 71 deletions

View file

@ -140,7 +140,10 @@
if (this.editor)
{
this.modeToggle(true);
this.editor.setData(sHtml);
try {
this.editor.setData(sHtml);
} catch (e) {}
if (bFocus)
{
@ -160,7 +163,9 @@
}
else
{
this.editor.setData(sPlain);
try {
this.editor.setData(sPlain);
} catch (e) {}
}
if (bFocus)
@ -273,7 +278,9 @@
{
if (this.editor)
{
this.editor.focus();
try {
this.editor.focus();
} catch (e) {}
}
};

View file

@ -30,7 +30,6 @@
this.displayName = AccountStore.displayName;
this.signature = AccountStore.signature;
this.signatureToAll = AccountStore.signatureToAll;
this.replyTo = AccountStore.replyTo;
this.signatureDom = ko.observable(null);
@ -219,12 +218,6 @@
});
});
AccountStore.signatureToAll.subscribe(function (bValue) {
Remote.saveSettings(null, {
'SignatureToAll': bValue ? '1' : '0'
});
});
}, 50);
};

View file

@ -25,7 +25,6 @@
this.displayName = AccountStore.displayName;
this.signature = AccountStore.signature;
this.signatureToAll = AccountStore.signatureToAll;
this.replyTo = AccountStore.replyTo;
this.signatureDom = ko.observable(null);
@ -90,12 +89,6 @@
});
});
AccountStore.signatureToAll.subscribe(function (bValue) {
Remote.saveSettings(null, {
'SignatureToAll': bValue ? '1' : '0'
});
});
}, 50);
};

View file

@ -24,7 +24,6 @@
this.displayName = ko.observable('');
this.replyTo = ko.observable('');
this.signature = ko.observable('');
this.signatureToAll = ko.observable(false);
this.accounts = ko.observableArray([]);
this.accounts.loading = ko.observable(false).extend({'throttle': 100});
@ -74,7 +73,6 @@
this.displayName(Settings.settingsGet('DisplayName'));
this.replyTo(Settings.settingsGet('ReplyTo'));
this.signature(Settings.settingsGet('Signature'));
this.signatureToAll(!!Settings.settingsGet('SignatureToAll'));
};
module.exports = new AccountUserStore();

View file

@ -758,13 +758,13 @@
};
/**
* @param {string} sInputText
* @param {string} sSignature
* @param {string=} sFrom
* @param {string=} sData
* @param {string=} sComposeType
* @return {string}
*/
ComposePopupView.prototype.convertSignature = function (sSignature, sFrom, sData, sComposeType)
ComposePopupView.prototype.convertSignature = function (sInputText, sSignature, sFrom, sComposeType)
{
var bHtml = false, bData = false;
if ('' !== sSignature)
@ -801,35 +801,51 @@
sSignature = sSignature.replace(/{{DATE}}/g, moment().format('llll'));
}
if (sData && Enums.ComposeType.Empty === sComposeType &&
-1 < sSignature.indexOf('{{BODY}}'))
// Enums.ComposeType.Empty === sComposeType
if (-1 < sSignature.indexOf('{{BODY}}'))
{
bData = true;
sSignature = sSignature.replace('{{BODY}}', sData);
if (sInputText)
{
bData = true;
sSignature = bHtml ? sSignature : Utils.plainToHtml(sSignature, true);
sSignature = sSignature.replace('{{BODY}}', sInputText);
}
else
{
sSignature = sSignature.replace(/[\n]?{{BODY}}[\n]?/g, '{{BODY}}');
sSignature = sSignature.replace(/{{BODY}}/g, '');
sSignature = bHtml ? sSignature : Utils.plainToHtml(sSignature, true);
}
}
sSignature = sSignature.replace(/{{BODY}}/g, '');
if (!bHtml)
else
{
sSignature = Utils.plainToHtml(sSignature, true);
sSignature = bHtml ? sSignature : Utils.plainToHtml(sSignature, true);
}
}
if (sData && !bData)
if (!bData)
{
switch (sComposeType)
if (sSignature)
{
case Enums.ComposeType.Empty:
sSignature = sData + '<br />' + sSignature;
break;
default:
sSignature = sSignature + '<br />' + sData;
break;
switch (sComposeType)
{
case Enums.ComposeType.Empty:
sInputText = sInputText + '<br />' + sSignature;
break;
default:
sInputText = sSignature + '<br />' + sInputText;
break;
}
}
}
else
{
sInputText = sSignature;
}
return sSignature;
return sInputText;
};
ComposePopupView.prototype.editor = function (fOnInit)
@ -951,7 +967,6 @@
oIdResult = null,
mEmail = AccountStore.email(),
sSignature = AccountStore.signature(),
bSignatureToAll = AccountStore.signatureToAll(),
aDownloads = [],
aDraftInfo = null,
oMessage = null,
@ -1134,10 +1149,10 @@
break;
}
if (bSignatureToAll && '' !== sSignature &&
if ('' !== sSignature &&
Enums.ComposeType.EditAsNew !== sComposeType && Enums.ComposeType.Draft !== sComposeType)
{
sText = this.convertSignature(sSignature, fEmailArrayToStringLineHelper(oMessage.from, true), sText, sComposeType);
sText = this.convertSignature(sText, sSignature, fEmailArrayToStringLineHelper(oMessage.from, true), sComposeType);
}
this.editor(function (oEditor) {
@ -1154,10 +1169,9 @@
this.subject(Utils.isNormal(sCustomSubject) ? '' + sCustomSubject : '');
sText = Utils.isNormal(sCustomPlainText) ? '' + sCustomPlainText : '';
if (bSignatureToAll && '' !== sSignature)
if ('' !== sSignature)
{
sText = this.convertSignature(sSignature, '',
Utils.plainToHtml(sText, true), sComposeType);
sText = this.convertSignature(Utils.plainToHtml(sText, true), sSignature, '', sComposeType);
}
this.editor(function (oEditor) {

View file

@ -2,7 +2,7 @@
"name": "RainLoop",
"title": "RainLoop Webmail",
"version": "1.8.0",
"release": "250",
"release": "251",
"description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net",
"main": "gulpfile.js",

View file

@ -1451,7 +1451,6 @@ class Actions
$aResult['DisplayName'] = '';
$aResult['ReplyTo'] = '';
$aResult['Signature'] = '';
$aResult['SignatureToAll'] = false;
$aResult['EnableTwoFactor'] = false;
$aResult['ParentEmail'] = '';
$aResult['InterfaceAnimation'] = true;
@ -1497,7 +1496,6 @@ class Actions
$aResult['DisplayName'] = $oSettings->GetConf('DisplayName', $aResult['DisplayName']);
$aResult['ReplyTo'] = $oSettings->GetConf('ReplyTo', $aResult['ReplyTo']);
$aResult['Signature'] = $oSettings->GetConf('Signature', $aResult['Signature']);
$aResult['SignatureToAll'] = !!$oSettings->GetConf('SignatureToAll', $aResult['SignatureToAll']);
$aResult['EnableTwoFactor'] = !!$oSettings->GetConf('EnableTwoFactor', $aResult['EnableTwoFactor']);
$aResult['ParentEmail'] = $oAccount->ParentEmail();
@ -4363,7 +4361,6 @@ class Actions
$this->setSettingsFromParams($oSettings, 'DisplayName', 'string');
$this->setSettingsFromParams($oSettings, 'ReplyTo', 'string');
$this->setSettingsFromParams($oSettings, 'Signature', 'string');
$this->setSettingsFromParams($oSettings, 'SignatureToAll', 'bool');
$this->setSettingsFromParams($oSettings, 'EnableTwoFactor', 'bool');
return $this->DefaultResponse(__FUNCTION__,

View file

@ -62,17 +62,6 @@
}"></div>
</div>
</div>
<div class="control-group g-ui-user-select-none">
<div class="controls">
<div data-bind="component: {
name: 'Checkbox',
params: {
label: 'SETTINGS_IDENTITIES/LABEL_ADD_SIGNATURE_TO_ALL',
value: signatureToAll
}
}"></div>
</div>
</div>
</div>
<br />
<div class="form-horizontal g-ui-user-select-none">

View file

@ -45,16 +45,5 @@
}"></div>
</div>
</div>
<div class="control-group g-ui-user-select-none">
<div class="controls">
<div data-bind="component: {
name: 'Checkbox',
params: {
label: 'SETTINGS_IDENTITIES/LABEL_ADD_SIGNATURE_TO_ALL',
value: signatureToAll
}
}"></div>
</div>
</div>
</div>
</div>