Remove reply counter (Closes #227, Closes #221, Closes #202)

This commit is contained in:
RainLoop Team 2014-07-17 17:45:57 +04:00
parent cb58103c23
commit cf80b8f21b
5 changed files with 85 additions and 7 deletions

View file

@ -433,12 +433,38 @@ Utils.removeSelection = function ()
};
/**
* @param {string} sPrefix
* @param {string} sSubject
* @return {string}
*/
Utils.replySubjectAdd = function (sPrefix, sSubject)
{
var
oMatch = null,
sResult = Utils.trim(sSubject)
;
if (null !== (oMatch = (new window.RegExp('^' + sPrefix + '[\\s]?\\:(.*)$', 'gi')).exec(sSubject)) && !Utils.isUnd(oMatch[1]) ||
null !== (oMatch = (new window.RegExp('^' + sPrefix + '[\\s]?[\\[\\(][\\d]+[\\]\\)][\\s]?\\:(.*)$', 'gi')).exec(sSubject)) && !Utils.isUnd(oMatch[1]))
{
sResult = sPrefix + ': ' + Utils.trim(oMatch[1]);
}
else
{
sResult = sPrefix + ': ' + sSubject;
}
return sResult.replace(/[\s]+/g, ' ');
};
/**
* @deprecated
* @param {string} sPrefix
* @param {string} sSubject
* @param {boolean=} bFixLongSubject = true
* @return {string}
*/
Utils.replySubjectAdd = function (sPrefix, sSubject, bFixLongSubject)
Utils._replySubjectAdd_ = function (sPrefix, sSubject, bFixLongSubject)
{
var
oMatch = null,

View file

@ -1231,12 +1231,38 @@ Utils.removeSelection = function ()
};
/**
* @param {string} sPrefix
* @param {string} sSubject
* @return {string}
*/
Utils.replySubjectAdd = function (sPrefix, sSubject)
{
var
oMatch = null,
sResult = Utils.trim(sSubject)
;
if (null !== (oMatch = (new window.RegExp('^' + sPrefix + '[\\s]?\\:(.*)$', 'gi')).exec(sSubject)) && !Utils.isUnd(oMatch[1]) ||
null !== (oMatch = (new window.RegExp('^' + sPrefix + '[\\s]?[\\[\\(][\\d]+[\\]\\)][\\s]?\\:(.*)$', 'gi')).exec(sSubject)) && !Utils.isUnd(oMatch[1]))
{
sResult = sPrefix + ': ' + Utils.trim(oMatch[1]);
}
else
{
sResult = sPrefix + ': ' + sSubject;
}
return sResult.replace(/[\s]+/g, ' ');
};
/**
* @deprecated
* @param {string} sPrefix
* @param {string} sSubject
* @param {boolean=} bFixLongSubject = true
* @return {string}
*/
Utils.replySubjectAdd = function (sPrefix, sSubject, bFixLongSubject)
Utils._replySubjectAdd_ = function (sPrefix, sSubject, bFixLongSubject)
{
var
oMatch = null,

File diff suppressed because one or more lines are too long

View file

@ -1234,12 +1234,38 @@ Utils.removeSelection = function ()
};
/**
* @param {string} sPrefix
* @param {string} sSubject
* @return {string}
*/
Utils.replySubjectAdd = function (sPrefix, sSubject)
{
var
oMatch = null,
sResult = Utils.trim(sSubject)
;
if (null !== (oMatch = (new window.RegExp('^' + sPrefix + '[\\s]?\\:(.*)$', 'gi')).exec(sSubject)) && !Utils.isUnd(oMatch[1]) ||
null !== (oMatch = (new window.RegExp('^' + sPrefix + '[\\s]?[\\[\\(][\\d]+[\\]\\)][\\s]?\\:(.*)$', 'gi')).exec(sSubject)) && !Utils.isUnd(oMatch[1]))
{
sResult = sPrefix + ': ' + Utils.trim(oMatch[1]);
}
else
{
sResult = sPrefix + ': ' + sSubject;
}
return sResult.replace(/[\s]+/g, ' ');
};
/**
* @deprecated
* @param {string} sPrefix
* @param {string} sSubject
* @param {boolean=} bFixLongSubject = true
* @return {string}
*/
Utils.replySubjectAdd = function (sPrefix, sSubject, bFixLongSubject)
Utils._replySubjectAdd_ = function (sPrefix, sSubject, bFixLongSubject)
{
var
oMatch = null,

File diff suppressed because one or more lines are too long