1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-06-02 07:37:48 +02:00
jfa-go/ts/pwr.ts
Harvey Tindall 9370913ace
add password reset link option
When enabled (in Settings > Password Resets), a magic link will be sent
instead of a PIN when the user tries reset their password. By doing
this the user doesn't have to keep the Jellyfin tab open to enter the
code.
2021-03-30 22:41:28 +01:00

25 lines
838 B
TypeScript

import { toClipboard, notificationBox } from "./modules/common.js";
const pin = document.getElementById("pin") as HTMLSpanElement;
if (pin) {
// Load this individual string into the DOM, so we don't have to load the whole language file.
const copy = document.getElementById("copy-notification");
const copyString = copy.textContent;
copy.remove();
window.notifications = new notificationBox(document.getElementById("notification-box") as HTMLDivElement, 5);
pin.onclick = () => {
toClipboard(pin.textContent);
window.notifications.customPositive("copied", "", copyString);
pin.classList.add("~positive");
pin.classList.remove("~urge");
setTimeout(() => {
pin.classList.add("~urge");
pin.classList.remove("~positive");
}, 5000);
};
}