From f683bfde9fdb3bc26a0a0f864646ff3be312cab5 Mon Sep 17 00:00:00 2001 From: Stefan Gaiselmann Date: Wed, 28 Jun 2023 10:48:07 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ae3b237..02cd9cb 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,42 @@ ```html -
-

Headline

- +
+

Neuerscheinungen

+
    + +
``` ```js -let content = document.getElementById('content') -let dynamicValue = document.createTextNode("Dynamic content value") -content.appendChild(dynamicValue) +let items = ["Allgemeines, Umweltschutz, Spielfilme", + "Theologie, Philosophie, Ethik, Psychologie", + "Pädagogik", + "Germanistik, Sprach- und Literaturwissenschaft"] +let books = document.getElementById('books') + +items.forEach(buildLink) + +// create new li element and text node +// append it to list element +function buildLink(value, index) { + + const zeroPad = (num, places) => String(num).padStart(places, '0') + const d = new Date() + let year = d.getFullYear() + let month = d.getMonth() + let link = "https://fhnw.swisscovery.slsp.ch/discovery/search?query=any,contains,(" + + "ENE60" + year + zeroPad(month + 1, 2) + zeroPad(index + 1, 2) + + "+OR+ENE60" + year + zeroPad(month, 2) + zeroPad(index + 1, 2) + + "+OR+ENE60" + year + zeroPad(month - 1, 2) + zeroPad(index + 1, 2) + + ")&tab=41SLSP_FHNW_MyInst_and_CI&search_scope=MyInst_and_CI" + + "&vid=41SLSP_FNW:VU1&offset=0" + + let item = document.createElement("li") + let aElement = document.createElement("a") + let content = document.createTextNode(value) + aElement.appendChild(content) + aElement.setAttribute("href", link) + item.appendChild(aElement) + books.appendChild(item) +} ``` \ No newline at end of file