2012-10-30 Sergio Martin <sergio.martin@artica.es>

* include/javascript/pandora_alerts.js
	godmode/alerts/configure_alert_action.php: Fix some bugs in
	the action form (jquery headache)



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7116 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-10-30 16:52:56 +00:00
parent 8aefac438f
commit 14c9b69e3f
3 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2012-10-30 Sergio Martin <sergio.martin@artica.es>
* include/javascript/pandora_alerts.js
godmode/alerts/configure_alert_action.php: Fix some bugs in
the action form (jquery headache)
2012-10-30 Vanessa Gil <vanessa.gil@artica.es>
* include/functions_reporting.php: Changed agent

View File

@ -157,7 +157,7 @@ $(document).ready (function () {
$command = io_safe_output($command);
echo addslashes($command);
?>";
render_command_preview ();
render_command_preview (original_command);
command_description = "<?php echo str_replace("\r\n","<br>",addslashes(io_safe_output(alerts_get_alert_command_description ($id_command)))); ?>";
render_command_description(command_description);
@ -189,6 +189,10 @@ $(document).ready (function () {
$('#table1-field'+i).replaceWith(data["fields_rows"][i]);
$("[name=field"+i+"_value]").val(old_value);
}
$(".fields").keyup (function() {
render_command_preview(original_command)
});
},
"json"
);
@ -196,7 +200,6 @@ $(document).ready (function () {
// Charge the fields of the
$("#id_command").trigger('change');
$(".fields").keyup (render_command_preview);
});
</script>

View File

@ -3,6 +3,10 @@ var original_command = "";
function parse_alert_command (command) {
var nfield = 1;
$('.fields').each(function() {
// Only render values different from ''
if($(this).val() == '') {
return;
}
var field = '_field'+nfield+'_';
nfield++;
var regex = new RegExp(field,"gi");
@ -12,7 +16,7 @@ function parse_alert_command (command) {
return command;
}
function render_command_preview () {
function render_command_preview (original_command) {
$("#textarea_command_preview").text (parse_alert_command (original_command));
}
function render_command_description (command_description) {