Remove signature trimming (fixed #62)

This commit is contained in:
RainLoop Team 2014-02-04 00:19:11 +04:00
parent 74ad0e2ca1
commit b23551406e
4 changed files with 24 additions and 10 deletions

View file

@ -565,10 +565,17 @@ PopupsComposeViewModel.prototype.onHide = function ()
kn.routeOn(); kn.routeOn();
}; };
/**
* @param {string} sSignature
* @param {string=} sFrom
* @return {string}
*/
PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom) PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom)
{ {
if ('' !== sSignature) if ('' !== sSignature)
{ {
sSignature = sSignature.replace(/[\r]/, '');
sFrom = Utils.pString(sFrom); sFrom = Utils.pString(sFrom);
if ('' !== sFrom) if ('' !== sFrom)
{ {
@ -576,10 +583,10 @@ PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom)
} }
else else
{ {
sSignature = sSignature.replace(/{{IF:FROM}}[\s\S]+{{\/IF:FROM}}/gm, ''); sSignature = sSignature.replace(/{{IF:FROM}}[\s\S]+{{\/IF:FROM}}[\n]?/gm, '');
} }
sSignature = "\r\n" + Utils.trim(sSignature.replace(/{{FROM}}/, '').replace(/{{IF:FROM}}/, '').replace(/{{\/IF:FROM}}/, '')); sSignature = sSignature.replace(/{{FROM}}[\n]?/, '').replace(/{{IF:FROM}}[\n]?/, '').replace(/{{\/IF:FROM}}[\n]?/, '');
} }
return sSignature; return sSignature;

View file

@ -2,7 +2,7 @@
"name": "RainLoop", "name": "RainLoop",
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"version": "1.6.2", "version": "1.6.2",
"release": "663", "release": "664",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net", "homepage": "http://rainloop.net",
"main": "Gruntfile.js", "main": "Gruntfile.js",

View file

@ -8632,10 +8632,17 @@ PopupsComposeViewModel.prototype.onHide = function ()
kn.routeOn(); kn.routeOn();
}; };
/**
* @param {string} sSignature
* @param {string=} sFrom
* @return {string}
*/
PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom) PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom)
{ {
if ('' !== sSignature) if ('' !== sSignature)
{ {
sSignature = sSignature.replace(/[\r]/, '');
sFrom = Utils.pString(sFrom); sFrom = Utils.pString(sFrom);
if ('' !== sFrom) if ('' !== sFrom)
{ {
@ -8643,10 +8650,10 @@ PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom)
} }
else else
{ {
sSignature = sSignature.replace(/{{IF:FROM}}[\s\S]+{{\/IF:FROM}}/gm, ''); sSignature = sSignature.replace(/{{IF:FROM}}[\s\S]+{{\/IF:FROM}}[\n]?/gm, '');
} }
sSignature = "\r\n" + Utils.trim(sSignature.replace(/{{FROM}}/, '').replace(/{{IF:FROM}}/, '').replace(/{{\/IF:FROM}}/, '')); sSignature = sSignature.replace(/{{FROM}}[\n]?/, '').replace(/{{IF:FROM}}[\n]?/, '').replace(/{{\/IF:FROM}}[\n]?/, '');
} }
return sSignature; return sSignature;

File diff suppressed because one or more lines are too long