Update directory structure

This commit is contained in:
foxster-mp4
2023-11-23 23:08:55 -08:00
parent 326de11f38
commit 22e3bcec0f
40 changed files with 364 additions and 272 deletions

24
view/news/news.js Normal file
View File

@@ -0,0 +1,24 @@
//
// news.js
// altsource-viewer (https://github.com/therealFoxster/altsource-viewer)
//
// Copyright (c) 2023 Foxster.
// MIT License.
//
import { insertNavigationBar } from "../../common/modules/utilities.js";
import { NewsItem } from "../../common/components/NewsItem.js";
import { main } from "../../common/modules/main.js";
insertNavigationBar("All News");
main(json => {
// Set tab title
document.title = `News - ${json.name}`;
// Sort news by latest
json.news.sort((a, b) => (new Date(b.date)).valueOf() - (new Date(a.date)).valueOf());
// Create & insert news items
json.news.forEach(news => document.getElementById("news").insertAdjacentHTML("beforeend", NewsItem(news)));
});