diff --git a/package-lock.json b/package-lock.json index 74407b9..8305eea 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index 4b8b5e6..6319cbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fwdekker.com", - "version": "0.40.6", + "version": "0.40.7", "description": "The source code of [my personal website](https://fwdekker.com/).", "author": "Felix W. Dekker", "browser": "dist/bundle.js", @@ -24,27 +24,27 @@ }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", - "@types/chai": "^4.2.16", + "@types/chai": "^4.2.17", "@types/js-cookie": "^2.2.6", "@types/mocha": "^8.2.2", "@types/semver": "^6.2.1", "chai": "^4.3.4", - "grunt": "^1.3.0", + "grunt": "^1.4.0", "grunt-cli": "^1.4.2", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-watch": "^1.1.0", "grunt-focus": "^1.0.0", "grunt-text-replace": "^0.4.0", - "grunt-webpack": "^4.0.2", + "grunt-webpack": "^4.0.3", "jsdom": "^16.5.3", "jsdom-global": "^3.0.2", "mocha": "^8.3.2", "nyc": "^15.1.0", - "ts-loader": "^8.1.0", + "ts-loader": "^9.1.2", "ts-node": "^9.1.1", "typescript": "^4.2.4", - "webpack": "^5.32.0", - "webpack-cli": "^4.6.0" + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" } } diff --git a/src/main/js/Commands.ts b/src/main/js/Commands.ts index d541051..0d3d597 100644 --- a/src/main/js/Commands.ts +++ b/src/main/js/Commands.ts @@ -649,7 +649,9 @@ return new Command( const target = josh.util.isStandalone() ? \`target="_blank"\` : ""; streams.out.writeLine( \`The source code of this website is ${n} - available on git. + available on git. ${n} + This website also has a privacy policy to assure you I won't + steal your data. List of commands \${commandEntries.join("\\n")} diff --git a/src/main/js/FileSystem.ts b/src/main/js/FileSystem.ts index 0ce519c..4d39f81 100644 --- a/src/main/js/FileSystem.ts +++ b/src/main/js/FileSystem.ts @@ -8,52 +8,12 @@ import {HashProvider, User} from "./UserList"; * A file system. */ export class FileSystem { - /** - * The root of the directory structure defined by the navigation API of fwdekker.com. - * - * This value is initialized only if `Persistence.hasFileSystem` returns false when the application is loaded. - */ - static navRoot: Directory; /** * The root directory. */ readonly root: Directory; - /** - * Loads the contents of my home directory based on the navigation API of fwdekker.com. - * - * @return an empty promise :'( - */ - static async loadNavApi(): Promise { - await fetch("https://fwdekker.com/api/nav/") - .then(it => it.json()) - .then(json => this.navRoot = this.unpack(json)[1] as Directory) - .catch(e => { - console.error("Failed to fetch navigation elements", e); - this.navRoot = new Directory(); - }); - } - - /** - * Unpacks the given entry from the navigation API. - * - * @param entry the entry to unpack - * @return the name and the (traversed and filled) node unpacked from the given entry - * @private - */ - private static unpack(entry: any): [string, Node] { - const name = entry.name?.toLowerCase()?.replace(/ /g, "-") ?? ""; - - if (entry.entries.length === 0) - return [`${name}.lnk`, new File(entry.link)]; - - const dir = new Directory(); - entry.entries.forEach((child: any) => dir.add(...(this.unpack(child)))); - return [name, dir]; - } - - /** * Constructs a new file system. * @@ -86,18 +46,16 @@ export class FileSystem { }), "home": new Directory({ "felix": new Directory({ - "pgp.pub": new File("https://fwdkr.co/pgp", "lnk"), - "privacy.lnk": new File("https://fwdekker.com/privacy/"), + "pgp-key.pub": new File("https://fwdkr.co/pgp", "lnk"), + "privacy-policy.lnk": new File("https://fwdekker.com/privacy/"), "resume.pdf": new File("https://fwdkr.co/cv", "lnk"), + "source-code.lnk": new File("https://git.fwdekker.com/FWDekker/fwdekker.com"), }), }), "root": new Directory({ "password.txt": new File("root: g9PjKu"), }), }); - - const home = this.get(new Path("home", "felix")) as Directory; - Object.keys(FileSystem.navRoot.nodes).forEach(name => home.add(name, FileSystem.navRoot.get(name)!)); } diff --git a/src/main/js/Main.ts b/src/main/js/Main.ts index 12aa254..5e65f94 100644 --- a/src/main/js/Main.ts +++ b/src/main/js/Main.ts @@ -1,7 +1,6 @@ import * as semver from "semver"; // @ts-ignore const {$, doAfterLoad, nav} = window.fwdekker; -import {FileSystem} from "./FileSystem"; import {Persistence} from "./Persistence"; import {ExpectedGoodbyeError} from "./Shared"; import {Terminal} from "./Terminal"; @@ -63,8 +62,6 @@ doAfterLoad(() => { */ doAfterLoad(async () => { $("#nav").appendChild(nav("/")); - if (!Persistence.hasFileSystem()) - await FileSystem.loadNavApi(); window.terminal = new Terminal( $("#terminal"),