summaryrefslogtreecommitdiff
path: root/src/scripts/profile.entry.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts/profile.entry.ts')
-rw-r--r--src/scripts/profile.entry.ts40
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");
- });
-});