From eac815eaa7e6e613f055c39ecc1ce5fe50164f43 Mon Sep 17 00:00:00 2001 From: JoelHMikael Date: Thu, 30 Dec 2021 11:18:51 +0200 Subject: Help icon Added a (reusable) help icon that shows additional info about what to do on hover. --- server.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index 39c3a38..2f45e95 100644 --- a/server.js +++ b/server.js @@ -12,7 +12,8 @@ async function init() const build = { "./index.html": buildMain, "./index.css": buildDefault, - "./404/index.css": buildDefault + "./404/index.css": buildDefault, + "./help.png": buildImage }; const errorPath = "./404/index.html"; @@ -80,7 +81,6 @@ async function buildMain(args) { const path = args["path"]; const query = args["query"]; - console.log(query); const foods = args["foods"]; let index; if (typeof query.index === "string") @@ -172,6 +172,13 @@ async function buildDefault(args) return data.toString("utf-8"); } +async function buildImage(args) +{ + const path = args["path"]; + const data = await openFile(path); + return data; +} + function build_replace(s, dict) { -- cgit v1.2.3