2010-03-08 Miguel de Dios <miguel.dedios@artica.es>

* include/javascript/pandora.js: change the code into function
	"html_entity_decode" for fix the decode in IE6 and rename the function to
	"js_html_entity_decode" for clean source code.
	
	* include/javascript/jquery.pandora.controls.js,
	include/javascript/pandora_modules.js, godmode/alerts/alert_list.php,
	godmode/alerts/configure_alert_action.php,
	godmode/reporting/reporting_builder.php, godmode/reporting/map_builder.php,
	godmode/reporting/graph_builder.php: use the rewrite new function javascript
	js_html_entity_decode.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2483 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2010-03-08 12:49:49 +00:00
parent c577bf6020
commit 6b38ca71f7
9 changed files with 46 additions and 32 deletions

View File

@ -1,3 +1,16 @@
2010-03-08 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora.js: change the code into function
"html_entity_decode" for fix the decode in IE6 and rename the function to
"js_html_entity_decode" for clean source code.
* include/javascript/jquery.pandora.controls.js,
include/javascript/pandora_modules.js, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_action.php,
godmode/reporting/reporting_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php: use the rewrite new function javascript
js_html_entity_decode.
2010-03-06 SAncho Lerena <slerena@artica.es>
* install.php: Fixed width of textarea, too small.

View File

@ -663,7 +663,7 @@ $(document).ready (function () {
success: function (data) {
$('#id_agent_module').append ($('<option></option>').attr ('value', 0).text ("--"));
jQuery.each (data, function (i, val) {
s = html_entity_decode (val['nombre']);
s = js_html_entity_decode (val['nombre']);
$('#id_agent_module').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
});
$('#id_agent_module').enable();

View File

@ -113,7 +113,7 @@ $(document).ready (function () {
jQuery.get ("ajax.php",
values,
function (data, status) {
original_command = html_entity_decode (data["command"]);
original_command = js_html_entity_decode (data["command"]);
render_command_preview (original_command);
},
"json"

View File

@ -678,7 +678,7 @@ function agent_changed () {
success: function (data) {
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
jQuery.each (data, function (i, val) {
s = html_entity_decode (val['nombre']);
s = js_html_entity_decode (val['nombre']);
$('#id_module').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
});
$('#id_module').fadeIn ('normal');
@ -735,7 +735,7 @@ $(document).ready (function () {
success: function (data) {
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
jQuery.each (data, function (i, val) {
s = html_entity_decode (val['nombre']);
s = js_html_entity_decode (val['nombre']);
$('#id_module').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
});
$('#id_module').fadeIn ('normal');

View File

@ -597,7 +597,7 @@ $(document).ready (function () {
success: function (data) {
$('#module').append ($('<option></option>').attr ('value', 0).text ("--"));
jQuery.each (data, function (i, val) {
s = html_entity_decode (val['nombre']);
s = js_html_entity_decode (val['nombre']);
$('#module').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
});
$('#module').fadeIn ('normal');
@ -724,7 +724,7 @@ $(document).ready (function () {
$('#module').append ($('<option></option>').attr ('value', 0).text ("--"));
jQuery.each (data, function (i, val) {
var val_id_agente_modulo = parseInt(val['id_agente_modulo']);
s = html_entity_decode (val['nombre']);
s = js_html_entity_decode (val['nombre']);
option = $("<option></option>");
option.attr ('value', val['id_agente_modulo']).text (s);

View File

@ -605,7 +605,7 @@ function refresh_table () {
// success: function (data) {
// $('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
// jQuery.each (data, function (i, val) {
// s = html_entity_decode (val['nombre']);
// s = js_html_entity_decode (val['nombre']);
// $('#id_module').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s.toLowerCase()));
// });
// $('#id_module').fadeIn ('normal');
@ -705,7 +705,7 @@ $(document).ready (function () {
success: function (data) {
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
jQuery.each (data, function (i, val) {
s = html_entity_decode (val['nombre']);
s = js_html_entity_decode (val['nombre']);
$('#id_module').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s.toLowerCase()));
});
$('#id_module').fadeIn ('normal');

View File

@ -97,7 +97,7 @@
config.callbackPre ();
option = $("<option></option>")
.attr ("value", value['id_agente_modulo'])
.html (html_entity_decode (value['nombre']));
.html (js_html_entity_decode (value['nombre']));
config.callbackPost (i, value, option);
$(config.moduleSelect).append (option);
});
@ -151,8 +151,8 @@
config.callbackPre ();
option = $("<option></option>")
.attr ("value", value['id'])
.html (html_entity_decode (value['template']['name']))
.append (" ("+html_entity_decode (value['module_name'])+")");
.html (js_html_entity_decode (value['template']['name']))
.append (" ("+js_html_entity_decode (value['module_name'])+")");
config.callbackPost (i, value, option);
$(config.alertSelect).append (option);
});

View File

@ -26,16 +26,17 @@ function open_help (help_id) {
*
* @retval str with entities decoded
*/
function html_entity_decode (str) {
function js_html_entity_decode (str) {
if (! str)
return "";
var ta = document.createElement ("textarea");
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;
str2 = 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,'&')
.replace(/&#13;/g, '\r').replace(/&#10;/g, '\n');
return str2;
}
/**
@ -77,7 +78,7 @@ function agent_changed (event, id_agent, selected) {
$('#module').empty ();
$('#module').append ($('<option></option>').html ("<?php echo __('Any')?>").attr ("value", 0));
jQuery.each (data, function (i, val) {
s = html_entity_decode (val['nombre']);
s = js_html_entity_decode (val['nombre']);
$('#module').append ($('<option></option>').html (s).attr ("value", val['id_agente_modulo']));
$('#module').fadeIn ('normal');
});

View File

@ -68,10 +68,10 @@ function configure_modules_form () {
"id_module_component" : this.value
},
function (data, status) {
configuration_data = html_entity_decode (data['data']);
configuration_data = js_html_entity_decode (data['data']);
$("#text-name").attr ("value", html_entity_decode (data["name"]));
$("#textarea_description").attr ("value", html_entity_decode (data["description"]));
$("#text-name").attr ("value", js_html_entity_decode (data["name"]));
$("#textarea_description").attr ("value", js_html_entity_decode (data["description"]));
$("#textarea_configuration_data").attr ("value", configuration_data);
$("#component_loading").hide ();
@ -126,24 +126,24 @@ function configure_modules_form () {
"id_module_component" : this.value
},
function (data, status) {
$("#text-name").attr ("value", html_entity_decode (data["name"]));
$("#textarea_description").attr ("value", html_entity_decode (data["description"]));
$("#text-name").attr ("value", js_html_entity_decode (data["name"]));
$("#textarea_description").attr ("value", js_html_entity_decode (data["description"]));
$("#id_module_type option[value="+data["type"]+"]").select (1);
$("#text-max").attr ("value", data["max"]);
$("#text-min").attr ("value", data["min"]);
$("#text-module_interval").attr ("value", data["module_interval"]);
$("#text-tcp_port").attr ("value", data["tcp_port"]);
$("#textarea_tcp_send").attr ("value", html_entity_decode (data["tcp_send"]));
$("#textarea_tcp_rcv").attr ("value", html_entity_decode (data["tcp_rcv"]));
$("#text-snmp_community").attr ("value", html_entity_decode (data["snmp_community"]));
$("#text-snmp_oid").attr ("value", html_entity_decode (data["snmp_oid"])).show ();
$("#textarea_tcp_send").attr ("value", js_html_entity_decode (data["tcp_send"]));
$("#textarea_tcp_rcv").attr ("value", js_html_entity_decode (data["tcp_rcv"]));
$("#text-snmp_community").attr ("value", js_html_entity_decode (data["snmp_community"]));
$("#text-snmp_oid").attr ("value", js_html_entity_decode (data["snmp_oid"])).show ();
$("#oid, img#edit_oid").hide ();
$("#id_module_group option["+data["id_group"]+"]").select (1);
$("#max_timeout").attr ("value", data["max_timeout"]);
$("#id_plugin option[value="+data["id_plugin"]+"]").select (1);
$("#text-plugin_user").attr ("value", html_entity_decode (data["plugin_user"]));
$("#password-plugin_pass").attr ("value", html_entity_decode (data["plugin_pass"]));
$("#text-plugin_parameter").attr ("value", html_entity_decode (data["plugin_parameter"]));
$("#text-plugin_user").attr ("value", js_html_entity_decode (data["plugin_user"]));
$("#password-plugin_pass").attr ("value", js_html_entity_decode (data["plugin_pass"]));
$("#text-plugin_parameter").attr ("value", js_html_entity_decode (data["plugin_parameter"]));
if (data["history_data"])
$("#checkbox-history_data").check ();
else