furizon_webint/res/scripts/roomManager.js

31 lines
1.3 KiB
JavaScript
Raw Normal View History

function confirmAction (intent, sender) {
if (['rename', 'unconfirm', 'delete'].includes (intent) == false) return
let href = sender.getAttribute('action')
let intentTitle = document.querySelector("#intentText")
let intentEdit = document.querySelector("#intentRename")
let intentEditPanel = document.querySelector("#intentEditPanel")
let intentFormAction = document.querySelector("#intentFormAction")
let intentSend = document.querySelector("#intentSend")
// Resetting ui
2024-01-13 13:58:06 +00:00
intentEdit.removeAttribute('required')
intentEdit.removeAttribute('minlength')
intentFormAction.setAttribute('method', 'GET')
intentEditPanel.style.display = 'none';
intentTitle.innerText = intent + ' room'
intentFormAction.setAttribute('action', href)
switch (intent){
case 'rename':
intentEditPanel.style.display = 'block';
intentEdit.setAttribute('required', true)
2024-01-13 13:58:06 +00:00
intentEdit.setAttribute('minlength', 4)
intentFormAction.setAttribute('method', 'POST')
2024-01-08 22:07:59 +00:00
document.getElementById("intentRename").value = sender.parentElement.parentElement.querySelector("span").innerText;
break
case 'unconfirm':
break
case 'delete':
break
}
document.getElementById('modalRoomconfirm').setAttribute('open', 'true');
}