mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 07:11:18 +02:00
Fix remaining JS functions missing from window global scope
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<p>Supprimer ce lien ? Les soumissions via ce lien seront bloquées.</p>
|
||||
</div>
|
||||
<div class="admin-dialog__footer">
|
||||
<button type="button" class="btn btn--danger" onclick="this.closest('dialog').close(); _executeDeleteLink()">Supprimer</button>
|
||||
<button type="button" class="btn btn--danger" onclick="this.closest('dialog').close(); executeDeleteLink()">Supprimer</button>
|
||||
<button type="button" class="btn btn--secondary" onclick="this.closest('dialog').close()">Annuler</button>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
Reference in New Issue
Block a user