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:
parent
c577bf6020
commit
6b38ca71f7
|
@ -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>
|
2010-03-06 SAncho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* install.php: Fixed width of textarea, too small.
|
* install.php: Fixed width of textarea, too small.
|
||||||
|
|
|
@ -663,7 +663,7 @@ $(document).ready (function () {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#id_agent_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
$('#id_agent_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
||||||
jQuery.each (data, function (i, val) {
|
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').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
|
||||||
});
|
});
|
||||||
$('#id_agent_module').enable();
|
$('#id_agent_module').enable();
|
||||||
|
|
|
@ -113,7 +113,7 @@ $(document).ready (function () {
|
||||||
jQuery.get ("ajax.php",
|
jQuery.get ("ajax.php",
|
||||||
values,
|
values,
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
original_command = html_entity_decode (data["command"]);
|
original_command = js_html_entity_decode (data["command"]);
|
||||||
render_command_preview (original_command);
|
render_command_preview (original_command);
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
|
|
|
@ -678,7 +678,7 @@ function agent_changed () {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
||||||
jQuery.each (data, function (i, val) {
|
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').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
|
||||||
});
|
});
|
||||||
$('#id_module').fadeIn ('normal');
|
$('#id_module').fadeIn ('normal');
|
||||||
|
@ -735,7 +735,7 @@ $(document).ready (function () {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
||||||
jQuery.each (data, function (i, val) {
|
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').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
|
||||||
});
|
});
|
||||||
$('#id_module').fadeIn ('normal');
|
$('#id_module').fadeIn ('normal');
|
||||||
|
|
|
@ -597,7 +597,7 @@ $(document).ready (function () {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
$('#module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
||||||
jQuery.each (data, function (i, val) {
|
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').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
|
||||||
});
|
});
|
||||||
$('#module').fadeIn ('normal');
|
$('#module').fadeIn ('normal');
|
||||||
|
@ -724,7 +724,7 @@ $(document).ready (function () {
|
||||||
$('#module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
$('#module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
||||||
jQuery.each (data, function (i, val) {
|
jQuery.each (data, function (i, val) {
|
||||||
var val_id_agente_modulo = parseInt(val['id_agente_modulo']);
|
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 = $("<option></option>");
|
||||||
option.attr ('value', val['id_agente_modulo']).text (s);
|
option.attr ('value', val['id_agente_modulo']).text (s);
|
||||||
|
|
|
@ -605,7 +605,7 @@ function refresh_table () {
|
||||||
// success: function (data) {
|
// success: function (data) {
|
||||||
// $('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
// $('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
||||||
// jQuery.each (data, function (i, val) {
|
// 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').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s.toLowerCase()));
|
||||||
// });
|
// });
|
||||||
// $('#id_module').fadeIn ('normal');
|
// $('#id_module').fadeIn ('normal');
|
||||||
|
@ -705,7 +705,7 @@ $(document).ready (function () {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
||||||
jQuery.each (data, function (i, val) {
|
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').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s.toLowerCase()));
|
||||||
});
|
});
|
||||||
$('#id_module').fadeIn ('normal');
|
$('#id_module').fadeIn ('normal');
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
config.callbackPre ();
|
config.callbackPre ();
|
||||||
option = $("<option></option>")
|
option = $("<option></option>")
|
||||||
.attr ("value", value['id_agente_modulo'])
|
.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.callbackPost (i, value, option);
|
||||||
$(config.moduleSelect).append (option);
|
$(config.moduleSelect).append (option);
|
||||||
});
|
});
|
||||||
|
@ -151,8 +151,8 @@
|
||||||
config.callbackPre ();
|
config.callbackPre ();
|
||||||
option = $("<option></option>")
|
option = $("<option></option>")
|
||||||
.attr ("value", value['id'])
|
.attr ("value", value['id'])
|
||||||
.html (html_entity_decode (value['template']['name']))
|
.html (js_html_entity_decode (value['template']['name']))
|
||||||
.append (" ("+html_entity_decode (value['module_name'])+")");
|
.append (" ("+js_html_entity_decode (value['module_name'])+")");
|
||||||
config.callbackPost (i, value, option);
|
config.callbackPost (i, value, option);
|
||||||
$(config.alertSelect).append (option);
|
$(config.alertSelect).append (option);
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,16 +26,17 @@ function open_help (help_id) {
|
||||||
*
|
*
|
||||||
* @retval str with entities decoded
|
* @retval str with entities decoded
|
||||||
*/
|
*/
|
||||||
function html_entity_decode (str) {
|
function js_html_entity_decode (str) {
|
||||||
if (! str)
|
if (! str)
|
||||||
return "";
|
return "";
|
||||||
var ta = document.createElement ("textarea");
|
|
||||||
ta.innerHTML = str.replace (/</g, "<").
|
str2 = str.replace (/</g, "<").
|
||||||
replace (/>/g,">").replace(/</g,'<').replace(/>/g,'>')
|
replace (/>/g,">").replace(/</g,'<').replace(/>/g,'>')
|
||||||
.replace(/\/g,'\\').replace(/"/g,'\"').replace(/'/g,'\'')
|
.replace(/\/g,'\\').replace(/"/g,'\"').replace(/'/g,'\'')
|
||||||
.replace(/&/g,'&');
|
.replace(/&/g,'&')
|
||||||
|
.replace(/ /g, '\r').replace(/ /g, '\n');
|
||||||
return ta.value;
|
|
||||||
|
return str2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,7 +78,7 @@ function agent_changed (event, id_agent, selected) {
|
||||||
$('#module').empty ();
|
$('#module').empty ();
|
||||||
$('#module').append ($('<option></option>').html ("<?php echo __('Any')?>").attr ("value", 0));
|
$('#module').append ($('<option></option>').html ("<?php echo __('Any')?>").attr ("value", 0));
|
||||||
jQuery.each (data, function (i, val) {
|
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').append ($('<option></option>').html (s).attr ("value", val['id_agente_modulo']));
|
||||||
$('#module').fadeIn ('normal');
|
$('#module').fadeIn ('normal');
|
||||||
});
|
});
|
||||||
|
|
|
@ -68,10 +68,10 @@ function configure_modules_form () {
|
||||||
"id_module_component" : this.value
|
"id_module_component" : this.value
|
||||||
},
|
},
|
||||||
function (data, status) {
|
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"]));
|
$("#text-name").attr ("value", js_html_entity_decode (data["name"]));
|
||||||
$("#textarea_description").attr ("value", html_entity_decode (data["description"]));
|
$("#textarea_description").attr ("value", js_html_entity_decode (data["description"]));
|
||||||
$("#textarea_configuration_data").attr ("value", configuration_data);
|
$("#textarea_configuration_data").attr ("value", configuration_data);
|
||||||
$("#component_loading").hide ();
|
$("#component_loading").hide ();
|
||||||
|
|
||||||
|
@ -126,24 +126,24 @@ function configure_modules_form () {
|
||||||
"id_module_component" : this.value
|
"id_module_component" : this.value
|
||||||
},
|
},
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
$("#text-name").attr ("value", html_entity_decode (data["name"]));
|
$("#text-name").attr ("value", js_html_entity_decode (data["name"]));
|
||||||
$("#textarea_description").attr ("value", html_entity_decode (data["description"]));
|
$("#textarea_description").attr ("value", js_html_entity_decode (data["description"]));
|
||||||
$("#id_module_type option[value="+data["type"]+"]").select (1);
|
$("#id_module_type option[value="+data["type"]+"]").select (1);
|
||||||
$("#text-max").attr ("value", data["max"]);
|
$("#text-max").attr ("value", data["max"]);
|
||||||
$("#text-min").attr ("value", data["min"]);
|
$("#text-min").attr ("value", data["min"]);
|
||||||
$("#text-module_interval").attr ("value", data["module_interval"]);
|
$("#text-module_interval").attr ("value", data["module_interval"]);
|
||||||
$("#text-tcp_port").attr ("value", data["tcp_port"]);
|
$("#text-tcp_port").attr ("value", data["tcp_port"]);
|
||||||
$("#textarea_tcp_send").attr ("value", html_entity_decode (data["tcp_send"]));
|
$("#textarea_tcp_send").attr ("value", js_html_entity_decode (data["tcp_send"]));
|
||||||
$("#textarea_tcp_rcv").attr ("value", html_entity_decode (data["tcp_rcv"]));
|
$("#textarea_tcp_rcv").attr ("value", js_html_entity_decode (data["tcp_rcv"]));
|
||||||
$("#text-snmp_community").attr ("value", html_entity_decode (data["snmp_community"]));
|
$("#text-snmp_community").attr ("value", js_html_entity_decode (data["snmp_community"]));
|
||||||
$("#text-snmp_oid").attr ("value", html_entity_decode (data["snmp_oid"])).show ();
|
$("#text-snmp_oid").attr ("value", js_html_entity_decode (data["snmp_oid"])).show ();
|
||||||
$("#oid, img#edit_oid").hide ();
|
$("#oid, img#edit_oid").hide ();
|
||||||
$("#id_module_group option["+data["id_group"]+"]").select (1);
|
$("#id_module_group option["+data["id_group"]+"]").select (1);
|
||||||
$("#max_timeout").attr ("value", data["max_timeout"]);
|
$("#max_timeout").attr ("value", data["max_timeout"]);
|
||||||
$("#id_plugin option[value="+data["id_plugin"]+"]").select (1);
|
$("#id_plugin option[value="+data["id_plugin"]+"]").select (1);
|
||||||
$("#text-plugin_user").attr ("value", html_entity_decode (data["plugin_user"]));
|
$("#text-plugin_user").attr ("value", js_html_entity_decode (data["plugin_user"]));
|
||||||
$("#password-plugin_pass").attr ("value", html_entity_decode (data["plugin_pass"]));
|
$("#password-plugin_pass").attr ("value", js_html_entity_decode (data["plugin_pass"]));
|
||||||
$("#text-plugin_parameter").attr ("value", html_entity_decode (data["plugin_parameter"]));
|
$("#text-plugin_parameter").attr ("value", js_html_entity_decode (data["plugin_parameter"]));
|
||||||
if (data["history_data"])
|
if (data["history_data"])
|
||||||
$("#checkbox-history_data").check ();
|
$("#checkbox-history_data").check ();
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue