Files
ESP3D-WEBUI/www/js/inputdlg.js
Luc b715e543cc fix miising </table> Thanks @MirkoUgoliniDev
use js-beautify to beautify code
2019-07-11 12:44:41 +02:00

22 lines
763 B
JavaScript

//input dialog
function inputdlg(titledlg, textdlg, closefunc, preset) {
var modal = setactiveModal('inputdlg.html', closefunc);
if (modal == null) return;
var title = modal.element.getElementsByClassName("modal-title")[0];
var body = modal.element.getElementsByClassName("modal-text")[0];
title.innerHTML = titledlg;
body.innerHTML = textdlg;
if (typeof preset !== 'undefined') document.getElementById('inputldg_text').value = preset;
else document.getElementById('inputldg_text').value = "";
showModal();
}
function closeInputModal(response) {
var answer = "";
if (response == "ok") {
var input = document.getElementById('inputldg_text').value;
answer = input.trim();
}
closeModal(answer);
}