From 8fa283f60651dfaee70e767367026c2f7adbb172 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 10 Oct 2021 13:24:46 -0700 Subject: [PATCH] * Moving frontend TS to its own root dir Knowing that some pepople(myself) don't like JS this is to keep any potential JS as non-hidden as possible --- frontend/static/favicon.png | 3 -- frontend/ts/collection.ts | 59 ------------------------------- {frontend/ts => ts}/index.ts | 0 {frontend/ts => ts}/package.json | 0 {frontend/ts => ts}/tsconfig.json | 2 +- 5 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 frontend/static/favicon.png delete mode 100644 frontend/ts/collection.ts rename {frontend/ts => ts}/index.ts (100%) rename {frontend/ts => ts}/package.json (100%) rename {frontend/ts => ts}/tsconfig.json (93%) diff --git a/frontend/static/favicon.png b/frontend/static/favicon.png deleted file mode 100644 index 56a6400..0000000 --- a/frontend/static/favicon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0cfdedb04d45802c1c008c9610bda2df8e3482f195bd254c11ebe07205e2bd5d -size 8560 diff --git a/frontend/ts/collection.ts b/frontend/ts/collection.ts deleted file mode 100644 index 8225b44..0000000 --- a/frontend/ts/collection.ts +++ /dev/null @@ -1,59 +0,0 @@ -// This module takes care of pulling down videos for the given category -class Video { - title: string - category: string - thumbnail_b64: string|null - constructor(raw: any) { - this.title = raw['name'] - this.category = raw['category'] - this.thumbnail_b64 = raw['thumbnail'] - } - - title_link() : HTMLHeadingElement { - let container = document.createElement('h2') - - let link = document.createElement('a') - link.href = `/video?c=${this.category}&v=${this.title}` - link.text = this.title - - container.appendChild(link) - - return container - } -} - -function get_category() : string|null { - // Used to modify the DOM - let params = (new URL(document.location.toString())).searchParams; - return params.get('c') -} -function base_url() : string { - const loc = document.location - return loc.protocol + '//' + loc.host -} - -function fetch_videos() : Array