working on state
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<title>Slop Farmer</title>
|
<title>Slop Farmer</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="signup">
|
<div id="signup" style="visibility: collapse;"
|
||||||
<form id="signup-form">
|
<form id="signup-form">
|
||||||
<label for="email">email</label>
|
<label for="email">email</label>
|
||||||
<input type="email" name="email" required />
|
<input type="email" name="email" required />
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="login">
|
<div id="login" style="visibility: collapse;">
|
||||||
<h1>Log in to enable slop checking and reporting</h1>
|
<h1>Log in to enable slop checking and reporting</h1>
|
||||||
<form id="login-form">
|
<form id="login-form">
|
||||||
<label for="email" id="username">username</label>
|
<label for="email" id="username">username</label>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<h2 style="visibility: collapse;" id="login-status">You're logged in.</h2>
|
<h2 style="visibility: collapse;" id="login-status">You're logged in.</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="report">
|
<div id="report" style="visibility: collapse;">
|
||||||
<button>Report this page</button>
|
<button>Report this page</button>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
@@ -1,10 +1,5 @@
|
|||||||
import { API_URL, send_message_to_background } from "./common.js"
|
import { API_URL, send_message_to_background } from "./common.js"
|
||||||
|
|
||||||
const login_form = document.getElementById("login-form") as HTMLFormElement
|
|
||||||
const login_status = document.getElementById("login-status")
|
|
||||||
|
|
||||||
const signup_form = document.getElementById("signup-form") as HTMLFormElement
|
|
||||||
|
|
||||||
class PopupState {
|
class PopupState {
|
||||||
logged_in: boolean
|
logged_in: boolean
|
||||||
|
|
||||||
@@ -74,3 +69,20 @@ async function submit_signup_form() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initialize_popup() {
|
||||||
|
const login_form = document.getElementById("login-form") as HTMLFormElement
|
||||||
|
const login_status = document.getElementById("login-status")
|
||||||
|
const signup_form = document.getElementById("signup-form") as HTMLFormElement
|
||||||
|
|
||||||
|
const signup_section = document.getElementById("signup")
|
||||||
|
const login_section = document.getElementById("login")
|
||||||
|
const report_section = document.getElementById("report")
|
||||||
|
|
||||||
|
const page_sections = new Map()
|
||||||
|
page_sections.set("signup", signup_section)
|
||||||
|
page_sections.set("login", login_section)
|
||||||
|
page_sections.set("report", report_section)
|
||||||
|
|
||||||
|
const popup_state = new PopupState(false, page_sections, "signup_section")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user