mirror of
https://github.com/thomiceli/opengist.git
synced 2025-06-13 05:47:12 +02:00
Create invitations for closed registrations (#233)
This commit is contained in:
@ -5,6 +5,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
registerDomSetting(elem as HTMLElement)
|
||||
})
|
||||
}
|
||||
|
||||
let copyInviteButtons = Array.from(document.getElementsByClassName("copy-invitation-link"));
|
||||
for (let button of copyInviteButtons) {
|
||||
button.addEventListener('click', () => {
|
||||
navigator.clipboard.writeText((button as HTMLElement).dataset.link).catch((err) => {
|
||||
console.error('Could not copy text: ', err);
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
const setSetting = (key: string, value: string) => {
|
||||
|
@ -53,6 +53,22 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
e.innerHTML = dayjs.unix(parseInt(e.innerHTML)).format('DD/MM/YYYY HH:mm');
|
||||
});
|
||||
|
||||
document.querySelectorAll('form').forEach((form: HTMLFormElement) => {
|
||||
form.onsubmit = () => {
|
||||
form.querySelectorAll('input[type=datetime-local]').forEach((input: HTMLInputElement) => {
|
||||
console.log(dayjs(input.value).unix());
|
||||
const hiddenInput = document.createElement('input');
|
||||
hiddenInput.type = 'hidden';
|
||||
hiddenInput.name = 'expiredAtUnix'
|
||||
hiddenInput.value = dayjs(input.value).unix().toString();
|
||||
form.appendChild(hiddenInput);
|
||||
});
|
||||
return true;
|
||||
};
|
||||
})
|
||||
|
||||
|
||||
|
||||
const rev = document.querySelector<HTMLElement>('.revision-text');
|
||||
if (rev) {
|
||||
const fullRev = rev.innerHTML;
|
||||
|
Reference in New Issue
Block a user