forked from Wavyzz/dolibarr
NEW Enhance framework so we can use html/icons into SELECT options.
This commit is contained in:
@@ -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 = {'<':'<','>':'>','/':'/','"':'"',''':'\'','&':'&',' ':' '};
|
||||
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 ''; }
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* =================================================================
|
||||
|
||||
Reference in New Issue
Block a user