Small fixes

Utf8 clear supports icon unicode
This commit is contained in:
RainLoop Team 2015-02-25 19:29:34 +04:00
parent e6725198c4
commit 19f089d0bf
15 changed files with 141 additions and 62 deletions

View file

@ -244,9 +244,7 @@
*/
Utils.encodeHtml = function (sText)
{
return Utils.isNormal(sText) ? sText.toString()
.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
.replace(/"/g, '&quot;').replace(/'/g, '&#039;') : '';
return Utils.isNormal(sText) ? _.escape(sText.toString()) : '';
};
/**
@ -512,7 +510,7 @@
/**
* @param {?} oEvent
*/
Utils.killCtrlAandS = function (oEvent)
Utils.kill_CtrlA_CtrlS = function (oEvent)
{
oEvent = oEvent || window.event;
if (oEvent && oEvent.ctrlKey && !oEvent.shiftKey && !oEvent.altKey)
@ -944,7 +942,7 @@
fixAttibuteValue = function () {
return (arguments && 1 < arguments.length) ?
'' + arguments[1] + arguments[2].replace(/</g, '&lt;').replace(/>/g, '&gt;') : '';
'' + arguments[1] + _.escape(arguments[2]) : '';
},
convertLinks = function () {
@ -1550,6 +1548,36 @@
}
};
/**
* @param {string} sStr
* @return {string}
*/
Utils.FullHtmlEncode = function (sStr)
{
var
iIndex = 0,
sChr = '',
iChrCode = 0,
sResult = '';
;
for (iIndex = 0; iIndex < sStr.length; iIndex++)
{
sChr = sStr[iIndex];
if (-1 < Utils.inArray(sChr, ['&', '<', '>', '"', '`', '\'']))
{
sResult += _.escape(sChr);
}
else
{
iChrCode = sChr.charCodeAt(0);
sResult += (iChrCode > 128) ? '&#' + iChrCode + ';' : sChr;
}
}
return sResult;
};
/**
* @param {Object|Array} mObjectOrObjects
*/