-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
account creation dialog in webclient
- Loading branch information
Showing
6 changed files
with
123 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/*************************************************************************** | ||
* (C) Copyright 2015-2023 - Faiumoni e. V. * | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU Affero General Public License as * | ||
* published by the Free Software Foundation; either version 3 of the * | ||
* License, or (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
import { ui } from "../UI"; | ||
import { DialogContentComponent } from "../toolkit/DialogContentComponent"; | ||
import { LoginDialog } from "./LoginDialog"; | ||
|
||
declare var marauroa: any; | ||
|
||
/** | ||
* a dialog to enter username and password | ||
*/ | ||
export class CreateAccountDialog extends DialogContentComponent { | ||
|
||
constructor() { | ||
super("createaccountdialog-template"); | ||
this.child("input[type=submit]")!.addEventListener("click", (event: Event) => { | ||
event.preventDefault(); | ||
let username = (this.child("#username") as HTMLInputElement).value; | ||
let password = (this.child("#password") as HTMLInputElement).value; | ||
let passwordRepeat = (this.child("#passwordrepeat") as HTMLInputElement).value; | ||
let email = (this.child("#email") as HTMLInputElement).value; | ||
if (!username || !password || !passwordRepeat) { | ||
alert("Please fill in all required fields."); | ||
return; | ||
} | ||
if (password != passwordRepeat) { | ||
alert("Password and password repetition do not match."); | ||
return; | ||
} | ||
marauroa.clientFramework.createAccount(username, password, email); | ||
}); | ||
|
||
this.child("a")!.addEventListener("click", (event: Event) => { | ||
event.preventDefault(); | ||
this.close(); | ||
ui.createSingletonFloatingWindow( | ||
"Login", | ||
new LoginDialog(), | ||
100, 50); | ||
}); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters