+ Category field on VideoMeta objects
This is basically just used to build url's for video links
This commit is contained in:
parent
e54314a629
commit
e9b2507ec5
@ -1,18 +1,21 @@
|
||||
class VideoMeta {
|
||||
name: string|null
|
||||
thumbnail: string|null
|
||||
category: string
|
||||
|
||||
constructor(raw: any) {
|
||||
this.name = raw['name']
|
||||
this.thumbnail = raw['thumbnail']
|
||||
}
|
||||
|
||||
let path = window.location.pathname
|
||||
this.category = path.substring(path.lastIndexOf('/')+1)
|
||||
}
|
||||
title_link() : HTMLHeadingElement {
|
||||
let container = document.createElement('h2')
|
||||
|
||||
let link = document.createElement('a')
|
||||
if(this.name) {
|
||||
link.href = `/clip/${this.name}`
|
||||
link.href = `/clip/${this.category}/${this.name}`
|
||||
link.text = this.name.replace('.', ' ').replace('-', ' ')
|
||||
} else {
|
||||
link.href = '#'
|
||||
|
Loading…
Reference in New Issue
Block a user