-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathTimestamp.ts
More file actions
35 lines (32 loc) · 1.04 KB
/
Timestamp.ts
File metadata and controls
35 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import * as dto from './dto';
import * as html from './html';
import * as moment from 'moment';
import ComponentsArray from './ComponentsArray';
import Countdown from './Countdown';
import UiComponent from './UiComponent';
import TwitchPlayer from './TwitchPlayer';
import copyToClipboard from './util/copyToClipboard';
export default class Timestamp implements UiComponent {
constructor(private _timestamp: string) {
}
onCopyClick = () => {
copyToClipboard(this._timestamp)
}
appendTo(entry: HTMLElement | null): void {
new html.Div(
new ComponentsArray([
new html.Href(
`#_${this._timestamp}`,
new html.Text(`${this._timestamp}`)
),
new html.Tag(
"i",
new html.Empty(),
{"class": "copy fas fa-copy fa-lg"},
{"click": this.onCopyClick}
)
]),
{"class": "timestamp"}
).appendTo(entry);
}
}