initial 2FA support

This commit is contained in:
MathMan05 2024-08-09 18:54:34 -05:00
parent c27a9af9bd
commit 13c896d756
6 changed files with 262 additions and 11 deletions

View file

@ -1,6 +1,7 @@
import { Permissions } from "./permissions.js";
import { SnowFlake } from "./snowflake.js";
import { Role } from "./role.js";
//future me stuff
class Buttons {
name;
buttons;
@ -175,6 +176,35 @@ class TextInput {
this.onSubmit(this.textContent);
}
}
class ButtonInput {
label;
owner;
onClick;
textContent;
constructor(label, textContent, onClick, owner, {} = {}) {
this.label = label;
this.owner = owner;
this.onClick = onClick;
this.textContent = textContent;
}
generateHTML() {
const div = document.createElement("div");
const span = document.createElement("span");
span.textContent = this.label;
div.append(span);
const button = document.createElement("button");
button.textContent = this.textContent;
button.onclick = this.onClickEvent.bind(this);
div.append(button);
return div;
}
onClickEvent(ev) {
console.log("here :3");
this.onClick();
}
watchForChange() { }
submit() { }
}
class ColorInput {
label;
owner;
@ -443,6 +473,11 @@ class Options {
this.options.push(htmlarea);
return htmlarea;
}
addButtonInput(label, textContent, onSubmit) {
const button = new ButtonInput(label, textContent, onSubmit, this);
this.options.push(button);
return button;
}
generateHTML() {
const div = document.createElement("div");
div.classList.add("titlediv");