Fix remaining JS functions missing from window global scope

This commit is contained in:
Pontoporeia
2026-07-08 13:50:03 +02:00
parent 83287cdcd8
commit 402799a412
3 changed files with 13 additions and 7 deletions
@@ -14,19 +14,21 @@
var _pendingDeleteLinkId = null;
function _openDeleteLinkDialog(id) {
function openDeleteLinkDialog(id) {
_pendingDeleteLinkId = id;
document.getElementById("delete-link-dialog").showModal();
}
window.openDeleteLinkDialog = openDeleteLinkDialog;
function _executeDeleteLink() {
function executeDeleteLink() {
var form = document.getElementById(
`delete-link-form-${_pendingDeleteLinkId}`,
);
if (form) form.submit();
}
window.executeDeleteLink = executeDeleteLink;
function _copyUrl(id) {
function copyUrl(id) {
var input = document.getElementById(`url-${id}`);
navigator.clipboard.writeText(input.value).then(() => {
var btn = event.target.closest("button");
@@ -37,8 +39,9 @@ function _copyUrl(id) {
}, 1200);
});
}
window.copyUrl = copyUrl;
function _openPasswordDialog(id, hasPassword) {
function openPasswordDialog(id, hasPassword) {
document.getElementById("password-link-id").value = id;
var info = document.getElementById("password-current-info");
info.textContent = hasPassword
@@ -46,3 +49,4 @@ function _openPasswordDialog(id, hasPassword) {
: "Aucun mot de passe configuré.";
document.getElementById("password-dialog").showModal();
}
window.openPasswordDialog = openPasswordDialog;
@@ -3,12 +3,14 @@
*
* Provides: openApproveDialog, openRejectDialog.
*/
function _openApproveDialog(requestId) {
function openApproveDialog(requestId) {
document.getElementById("approve-request-id").value = requestId;
document.getElementById("approve-dialog").showModal();
}
window.openApproveDialog = openApproveDialog;
function _openRejectDialog(requestId) {
function openRejectDialog(requestId) {
document.getElementById("reject-request-id").value = requestId;
document.getElementById("reject-dialog").showModal();
}
window.openRejectDialog = openRejectDialog;