2
0
forked from Wavyzz/dolibarr

NEW Enhance framework so we can use html/icons into SELECT options.

This commit is contained in:
Laurent Destailleur
2017-10-26 20:06:23 +02:00
parent 0a1b381bc5
commit a1f862eba6
5 changed files with 42 additions and 8 deletions

View File

@@ -427,6 +427,28 @@ function urlencode(s) {
return news;
}
/*
* =================================================================
* Purpose: Clean string to have it url encoded
* Input: s
* Author: Laurent Destailleur
* Licence: GPL
* ==================================================================
*/
function htmlEntityDecodeJs(inp){
var replacements = {'&lt;':'<','&gt;':'>','&sol;':'/','&quot;':'"','&apos;':'\'','&amp;':'&','&nbsp;':' '};
if (inp)
{
for(var r in replacements){
inp = inp.replace(new RegExp(r,'g'),replacements[r]);
}
return inp.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
}
else { return ''; }
}
/*
* =================================================================