Small JS rewrite
Slightly rewrote the JavaScript on the main page.
I didn't like how it looked before. Then again, I don't think I'm happy with having to rely on JavaScript at all right now.
By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.
Slightly rewrote the JavaScript on the main page.
I didn't like how it looked before. Then again, I don't think I'm happy with having to rely on JavaScript at all right now.
steve0greatness,
created on Monday, 8 July 2024, 13:11:00 (1720444260),
received on Tuesday, 9 July 2024, 19:02:10 (1720551730)
Author identity: Steve0Greatness <steve0greatnessiscool@gmail.com>
7cbedf8c5263ccffb0ab1e2e0c146c3afb1af904
</li> </template> <script>(async function() {<script type="text/javascript"> const ThemeListElementTemplate = document.querySelector("#ThemeListElement"); const HTMLThemeList = document.querySelector("#ThemeList");const ThemeList = await fetch("themes.xml").then(res => res.text()).then(txt => {const parser = new DOMParser();const doc = parser.parseFromString(txt, "text/xml");return doc;});const ThemeListElementTemplate = document.querySelector("#ThemeListElement");const HTMLThemeList = document.querySelector("#ThemeList");ListThemes();async function ListThemes() { const ThemeList = await GetXMLDoc("themes.xml"); const themes = ThemeList.querySelectorAll("theme"); for (let index = 0; index < themes.length; index++) { const theme = themes[index]; const ThemeIndex = CreateThemeListElement( title = theme.querySelector("title").textContent, authorname = theme.querySelector("author").textContent, authorlink = theme.querySelector("author").getAttribute("uri"), path = theme.querySelector("uri").textContent ); HTMLThemeList.appendChild(ThemeIndex); } }const title = theme.querySelector("title").textContent;const author = theme.querySelector("author");const path = theme.querySelector("uri").textContent;function CreateThemeListElement(title, authorname, authorlink, path) { const ListEl = ThemeListElementTemplate.content.cloneNode(true); ListEl.querySelector(".theme-name").textContent = title; ListEl.querySelector(".download").href = "themes/" + path;const ListEl = ThemeListElementTemplate.content.cloneNode(true);ListEl.querySelector(".theme-name").textContent = title;ListEl.querySelector(".download").href = "themes/" + path;const Author = ListEl.querySelector(".author-url"); Author.textContent = authorname; Author.href = authorlink;const Author = ListEl.querySelector(".author-url");Author.href = author.getAttribute("uri");Author.textContent = author.textContent;HTMLThemeList.appendChild(ListEl);}return ListEl; }})();function GetXMLDoc(path) { return new Promise(async (resolve, reject) => { const PlaintextXML = await fetch(path).then(response => response.text()); const XML_DOM = new DOMParser().parseFromString(PlaintextXML, "text/xml"); resolve(XML_DOM); }); }</script> </body>