Source
this.form.querySelector('#manualinput_validator').parentNode.style.display = is_input_type_string ? '' : 'none';
<?php declare(strict_types = 0);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* @var CView $this
*/
?>
window.script_edit_popup = new class {
init({script}) {
this.overlay = overlays_stack.getById('script-form');
this.dialogue = this.overlay.$dialogue[0];
this.form = this.overlay.$dialogue.$body[0].querySelector('form');
this.script = script;
this.scriptid = script.scriptid;
this.#loadView(script);
this.#initActions();
for (const parameter of script.parameters) {
this.#addParameter(parameter);
}
new CFormFieldsetCollapsible(document.getElementById('advanced-configuration'));
}
#initActions() {
this.form.querySelector('#scope').dispatchEvent(new Event('change'));
this.form.querySelector('#type').dispatchEvent(new Event('change'));
this.form.querySelector('#enable_confirmation').dispatchEvent(new Event('change'));
this.form.querySelector('.js-parameter-add').addEventListener('click', () => {
const template = new Template(this.form.querySelector('#script-parameter-template').innerHTML);
this.form
.querySelector('#parameters-table tbody')
.insertAdjacentHTML('beforeend', template.evaluate({}));
});
this.dialogue.addEventListener('click', (e) => {
if (e.target.classList.contains('js-remove')) {
e.target.closest('tr').remove();
}
});
}
/**
* Adds a new row to the Parameters table with the given parameter data (name, value).
*