// noinspection JSUnresolvedVariable const {$, doAfterLoad, stringToHtml} = window.fwdekker; /** * Transforms the given (nested) entry into a list item to be displayed in HTML. * * @param entry the entry to transform * @returns {string} the HTML form of the given entry */ const unpackEntry = (entry) => { const subEntries = entry.entries.length === 0 ? "" : ``; return `
  • ${entry.name}${subEntries}
  • `; }; doAfterLoad(() => { fetch("https://fwdekker.com/api/nav/") .then(it => it.json()) .then(json => { const toolEntries = json.entries.find(it => it.name === "Tools").entries; const entryHtml = stringToHtml(``, "ul"); $("#listing").append(entryHtml); $("main").classList.remove("hidden"); }); });