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/main.entry.ts | |
| parent | 057952b0bacc6e963c74bb1bbebbcccd6174a75c (diff) | |
Remove old frontend
Diffstat (limited to 'src/scripts/main.entry.ts')
| -rw-r--r-- | src/scripts/main.entry.ts | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/scripts/main.entry.ts b/src/scripts/main.entry.ts deleted file mode 100644 index 84726ed4..00000000 --- a/src/scripts/main.entry.ts +++ /dev/null @@ -1,69 +0,0 @@ -///<reference path="../../typings/index.d.ts" /> -///<reference path="./views/mapview.ts" /> -import * as $ from "jquery"; -import {MapView} from "./views/mapview"; -import {APIController} from "./controllers/connection/api"; -window["$"] = $; -require("jquery-mousewheel"); -window["jQuery"] = $; - -require("./user-authentication"); - - -$(document).ready(function () { - new Display(); //tslint:disable-line:no-unused-expression -}); - - -/** - * Class responsible for launching the main view. - */ -class Display { - private stage: createjs.Stage; - private view: MapView; - - - /** - * Adjusts the canvas size to fit the window's initial dimensions (full expansion). - */ - private static fitCanvasSize() { - const canvas = $("#main-canvas"); - const parent = canvas.parent(); - parent.height($(window).height() - 50); - canvas.attr("width", parent.width()); - canvas.attr("height", parent.height()); - } - - constructor() { - // Check whether project has been selected before going to the app page - if (localStorage.getItem("simulationId") === null) { - window.location.replace("projects"); - return; - } - - Display.fitCanvasSize(); - this.stage = new createjs.Stage("main-canvas"); - - new APIController((api: APIController) => { - api.getSimulation(parseInt(localStorage.getItem("simulationId"))) - .then((simulationData: ISimulation) => { - if (simulationData.name !== "") { - document.title = simulationData.name + " | OpenDC"; - } - - api.getPathsBySimulation(simulationData.id) - .then((pathData: IPath[]) => { - simulationData.paths = pathData; - }).then(() => { - return api.getExperimentsBySimulation(simulationData.id); - }).then((experimentData: IExperiment[]) => { - $(".loading-overlay").hide(); - - simulationData.experiments = experimentData; - this.view = new MapView(simulationData, this.stage); - }); - }); - }); - - } -} |
