2009-09-29 Miguel de Dios <miguel.dedios@artica.es>

* include/javascript/pandora_mod, include/javascript/pandora.js: cleanup
	the sourcecode and add more funcionality to funciton "html_entity_decode".



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1990 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2009-09-29 19:50:59 +00:00
parent 6e5ea3f84c
commit 6d09c7030e
2 changed files with 5 additions and 4 deletions

View File

@ -30,7 +30,10 @@ function html_entity_decode (str) {
if (! str)
return "";
var ta = document.createElement ("textarea");
ta.innerHTML = str.replace (/</g, "&lt;").replace (/>/g,"&gt;");
ta.innerHTML = str.replace (/</g, "&lt;").
replace (/>/g,"&gt;").replace(/&lt;/g,'<').replace(/&gt;/g,'>')
.replace(/&#92;/g,'\\').replace(/&quot;/g,'\"').replace(/&#039;/g,'\'')
.replace(/&amp;/g,'&');
return ta.value;
}

View File

@ -68,9 +68,7 @@ function configure_modules_form () {
"id_module_component" : this.value
},
function (data, status) {
configuration_data = data['data']
.replace(/&lt;/g,'<').replace(/&gt;/g,'>')
.replace(/&#92;/g,'\\').replace(/&quot;/g,'\"').replace(/&#039;/g,'\'').replace(/&amp;/g,'&');
configuration_data = html_entity_decode (data['data']);
$("#text-name").attr ("value", html_entity_decode (data["name"]));
$("#textarea_description").attr ("value", html_entity_decode (data["description"]));