2009-01-12 16:17:19 +01:00
|
|
|
var original_command = "";
|
|
|
|
|
|
|
|
function parse_alert_command (command) {
|
|
|
|
value = $("#text-field1").attr ("value");
|
|
|
|
re = /_FIELD1_/gi;
|
2012-02-13 11:23:30 +01:00
|
|
|
command = command.replace (re, value);
|
2009-01-12 16:17:19 +01:00
|
|
|
|
|
|
|
value = $("#text-field2").attr ("value");
|
|
|
|
re = /_FIELD2_/gi;
|
2012-02-13 11:23:30 +01:00
|
|
|
command = command.replace (re, value);
|
2009-01-12 16:17:19 +01:00
|
|
|
|
2009-09-15 16:51:09 +02:00
|
|
|
value = $("#textarea_field3").val();
|
2009-01-12 16:17:19 +01:00
|
|
|
re = /_FIELD3_/gi;
|
2012-02-13 11:23:30 +01:00
|
|
|
command = command.replace (re, value);
|
2009-01-12 16:17:19 +01:00
|
|
|
|
|
|
|
return command;
|
|
|
|
}
|
|
|
|
|
|
|
|
function render_command_preview () {
|
|
|
|
$("#textarea_command_preview").text (parse_alert_command (original_command));
|
|
|
|
}
|
2012-05-21 12:28:35 +02:00
|
|
|
function render_command_description (command_description) {
|
|
|
|
if(command_description != '') {
|
|
|
|
command_description = '<br>'+command_description;
|
|
|
|
}
|
|
|
|
$("#command_description").html(command_description);
|
|
|
|
}
|