diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-22 18:32:31 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-22 18:32:31 +0100 |
commit | 8a8e02a43e346b9b777c8192a7c5cbdccb928b11 (patch) | |
tree | 9ffb8992f98b1354da9b522104d8d4289cf8e8d9 /client/src/app/shared/misc/help.component.ts | |
parent | 81c263c86fe2a030f09e942e118551727f145b6d (diff) | |
download | PeerTube-8a8e02a43e346b9b777c8192a7c5cbdccb928b11.tar.gz PeerTube-8a8e02a43e346b9b777c8192a7c5cbdccb928b11.tar.zst PeerTube-8a8e02a43e346b9b777c8192a7c5cbdccb928b11.zip |
Add help tooltip
Diffstat (limited to 'client/src/app/shared/misc/help.component.ts')
-rw-r--r-- | client/src/app/shared/misc/help.component.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/client/src/app/shared/misc/help.component.ts b/client/src/app/shared/misc/help.component.ts new file mode 100644 index 000000000..b8530e1d4 --- /dev/null +++ b/client/src/app/shared/misc/help.component.ts | |||
@@ -0,0 +1,46 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | ||
2 | |||
3 | @Component({ | ||
4 | selector: 'my-help', | ||
5 | styleUrls: [ './help.component.scss' ], | ||
6 | templateUrl: './help.component.html' | ||
7 | }) | ||
8 | |||
9 | export class HelpComponent implements OnInit { | ||
10 | @Input() preHtml = '' | ||
11 | @Input() postHtml = '' | ||
12 | @Input() customHtml = '' | ||
13 | @Input() helpType: 'custom' | 'markdownText' | 'markdownEnhanced' = 'custom' | ||
14 | |||
15 | mainHtml = '' | ||
16 | |||
17 | ngOnInit () { | ||
18 | if (this.helpType === 'custom') { | ||
19 | this.mainHtml = this.customHtml | ||
20 | return | ||
21 | } | ||
22 | |||
23 | if (this.helpType === 'markdownText') { | ||
24 | this.mainHtml = 'Markdown compatible.<br /><br />' + | ||
25 | 'Supports:' + | ||
26 | '<ul>' + | ||
27 | '<li>Links</li>' + | ||
28 | '<li>Lists</li>' + | ||
29 | '<li>Emphasis</li>' + | ||
30 | '</ul>' | ||
31 | return | ||
32 | } | ||
33 | |||
34 | if (this.helpType === 'markdownEnhanced') { | ||
35 | this.mainHtml = 'Markdown compatible.<br /><br />' + | ||
36 | 'Supports:' + | ||
37 | '<ul>' + | ||
38 | '<li>Links</li>' + | ||
39 | '<li>Lists</li>' + | ||
40 | '<li>Emphasis</li>' + | ||
41 | '<li>Images</li>' + | ||
42 | '</ul>' | ||
43 | return | ||
44 | } | ||
45 | } | ||
46 | } | ||