aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/misc/help.component.ts
blob: b8530e1d4739c2db3ffb95022996808033cc638c (plain) (blame)
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
36
37
38
39
40
41
42
43
44
45
46
import { Component, Input, OnInit } from '@angular/core'

@Component({
  selector: 'my-help',
  styleUrls: [ './help.component.scss' ],
  templateUrl: './help.component.html'
})

export class HelpComponent implements OnInit {
  @Input() preHtml = ''
  @Input() postHtml = ''
  @Input() customHtml = ''
  @Input() helpType: 'custom' | 'markdownText' | 'markdownEnhanced' = 'custom'

  mainHtml = ''

  ngOnInit () {
    if (this.helpType === 'custom') {
      this.mainHtml = this.customHtml
      return
    }

    if (this.helpType === 'markdownText') {
      this.mainHtml = 'Markdown compatible.<br /><br />' +
        'Supports:' +
        '<ul>' +
        '<li>Links</li>' +
        '<li>Lists</li>' +
        '<li>Emphasis</li>' +
        '</ul>'
      return
    }

    if (this.helpType === 'markdownEnhanced') {
      this.mainHtml = 'Markdown compatible.<br /><br />' +
        'Supports:' +
        '<ul>' +
        '<li>Links</li>' +
        '<li>Lists</li>' +
        '<li>Emphasis</li>' +
        '<li>Images</li>' +
        '</ul>'
      return
    }
  }
}