diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 09:48:38 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 09:48:38 +0200 |
| commit | 09596c3c5a6a2a44675f170106bb38746229e02a (patch) | |
| tree | 763d1b710dc5f2fcab920ac6ab2c555cee4d6342 /src/scripts/profile.entry.ts | |
| parent | 057952b0bacc6e963c74bb1bbebbcccd6174a75c (diff) | |
Remove old frontend
Diffstat (limited to 'src/scripts/profile.entry.ts')
| -rw-r--r-- | src/scripts/profile.entry.ts | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/scripts/profile.entry.ts b/src/scripts/profile.entry.ts deleted file mode 100644 index 0cb77f50..00000000 --- a/src/scripts/profile.entry.ts +++ /dev/null @@ -1,40 +0,0 @@ -///<reference path="../../typings/index.d.ts" /> -import * as $ from "jquery"; -import {APIController} from "./controllers/connection/api"; -import {removeUserInfo} from "./user-authentication"; -window["jQuery"] = $; - - -$(document).ready(() => { - const api = new APIController(() => { - }); - - $("#delete-account").on("click", () => { - const modalDialog = <any>$("#confirm-delete-account"); - - // Function called on delete confirmation - const callback = () => { - api.deleteUser(parseInt(localStorage.getItem("userId"))).then(() => { - removeUserInfo(); - gapi.auth2.getAuthInstance().signOut().then(() => { - window.location.href = "/"; - }); - }, (reason: any) => { - modalDialog.find("button.confirm").off(); - modalDialog.modal("hide"); - - const alert = $(".account-delete-alert"); - alert.find("code").text(reason.code + ": " + reason.description); - - alert.slideDown(200); - - setTimeout(() => { - alert.slideUp(200); - }, 5000); - }); - }; - - modalDialog.find("button.confirm").on("click", callback); - modalDialog.modal("show"); - }); -}); |
