diff --git a/packages/ide/src/client.ts b/packages/ide/src/client.ts index 0b2ea2ef..4cc659b8 100644 --- a/packages/ide/src/client.ts +++ b/packages/ide/src/client.ts @@ -23,11 +23,10 @@ export abstract class IdeClient { public readonly upload = upload; private start: Time | undefined; - private readonly progressElement: HTMLElement | undefined; - private tasks: string[] = []; + private readonly tasks = []; private finishedTaskCount = 0; private readonly loadTime: Time; - private sharedProcessDataPromise: Promise; + private readonly sharedProcessDataPromise: Promise; public constructor() { logger.info("Loading IDE"); @@ -38,27 +37,6 @@ export abstract class IdeClient { client.onSharedProcessActive(resolve); }); - const overlay = document.getElementById("overlay"); - const logo = document.getElementById("logo"); - const msgElement = overlay - ? overlay.querySelector(".message") as HTMLElement - : undefined; - - if (overlay && logo) { - overlay.addEventListener("mousemove", (event) => { - const xPos = ((event.clientX - logo.offsetLeft) / 24).toFixed(2); - const yPos = ((logo.offsetTop - event.clientY) / 24).toFixed(2); - - logo.style.transform = `perspective(200px) rotateX(${yPos}deg) rotateY(${xPos}deg)`; - }); - } - - this.progressElement = typeof document !== "undefined" - ? document.querySelector("#fill") as HTMLElement - : undefined; - - require("path").posix = require("path"); - window.addEventListener("contextmenu", (event) => { event.preventDefault(); }); @@ -72,28 +50,9 @@ export abstract class IdeClient { this.uriFactory = this.createUriFactory(); this.initialize().then(() => { - if (overlay) { - overlay.style.opacity = "0"; - overlay.addEventListener("transitionend", () => { - overlay.remove(); - }); - } logger.info("Load completed", field("duration", this.loadTime)); }).catch((error) => { logger.error(error.message); - if (overlay) { - overlay.classList.add("error"); - } - if (msgElement) { - const button = document.createElement("div"); - button.className = "reload-button"; - button.innerText = "Reload"; - button.addEventListener("click", () => { - location.reload(); - }); - msgElement.innerText = `Failed to load: ${error.message}.`; - msgElement.parentElement!.appendChild(button); - } logger.warn("Load completed with errors", field("duration", this.loadTime)); }); } @@ -116,12 +75,6 @@ export abstract class IdeClient { if (!this.start) { this.start = time(1000); } - const updateProgress = (): void => { - if (this.progressElement) { - this.progressElement.style.width = `${Math.round((this.finishedTaskCount / (this.tasks.length + this.finishedTaskCount)) * 100)}%`; - } - }; - updateProgress(); let start: Time | undefined; try { @@ -135,7 +88,6 @@ export abstract class IdeClient { this.tasks.splice(index, 1); } ++this.finishedTaskCount; - updateProgress(); if (this.tasks.length === 0) { logger.info("Finished all queued tasks", field("duration", this.start), field("count", this.finishedTaskCount)); this.start = undefined; @@ -144,9 +96,6 @@ export abstract class IdeClient { return value; } catch (error) { logger.error(`Failed "${description}"`, field("duration", typeof start !== "undefined" ? start : "not started"), field("error", error)); - if (this.progressElement) { - this.progressElement.style.backgroundColor = "red"; - } throw error; } } diff --git a/packages/vscode/src/client.ts b/packages/vscode/src/client.ts index 1d57d254..98412764 100644 --- a/packages/vscode/src/client.ts +++ b/packages/vscode/src/client.ts @@ -1,3 +1,4 @@ +import "./fill/require"; import * as paths from "./fill/paths"; import "./fill/platform"; import "./fill/storageDatabase"; diff --git a/packages/vscode/src/fill/require.ts b/packages/vscode/src/fill/require.ts new file mode 100644 index 00000000..75053823 --- /dev/null +++ b/packages/vscode/src/fill/require.ts @@ -0,0 +1 @@ +require("path").posix = require("path"); diff --git a/packages/web/src/index.html b/packages/web/src/index.html index f1e85c42..f165bae2 100644 --- a/packages/web/src/index.html +++ b/packages/web/src/index.html @@ -1,48 +1,9 @@ - VS Code - -
- -
-
-
-
-
-
-
-
-
-