Source
xxxxxxxxxx
* @param string params.dialogueid (optional) Unique dialogue identifier to reuse existing overlay dialog
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
function check_target(e, type) {
// If type is expression.
if (type == 0) {
var targets = document.getElementsByName('expr_target_single');
}
// Type is recovery expression.
else {
var targets = document.getElementsByName('recovery_expr_target_single');
}
for (var i = 0; i < targets.length; ++i) {
targets[i].checked = targets[i] == e;
}
}
/**
* Remove part of expression.
*
* @param string id Expression temporary ID.
* @param number type Expression (type = 0) or recovery expression (type = 1).
*/
function delete_expression(id, type) {
// If type is expression.
if (type == 0) {
jQuery('#remove_expression').val(id);
}
// Type is recovery expression.
else {
jQuery('#remove_recovery_expression').val(id);
}
}
/**
* Insert expression part into input field.
*
* @param string id Expression temporary ID.
* @param number type Expression (type = 0) or recovery expression (type = 1).
*/
function copy_expression(id, type) {
// If type is expression.
if (type == 0) {
var element = document.getElementsByName('expr_temp')[0];
}
// Type is recovery expression.
else {
var element = document.getElementsByName('recovery_expr_temp')[0];
}
if (element.value.length > 0 && !confirm(t('Do you wish to replace the conditional expression?'))) {
return null;
}
var src = document.getElementById(id);
if (typeof src.textContent != 'undefined') {
element.value = src.textContent;
}
else {
element.value = src.innerText;
}
}
function testUserSound(idx) {
var element = document.getElementById(idx);
var sound = element.options[element.selectedIndex].value;
element = document.getElementById('messages_sounds.repeat');
var repeat = element.options[element.selectedIndex].value;
if (repeat == 1) {
AudioControl.playOnce(sound);
}
else if (repeat > 1) {