diff options
author | kimsible <kimsible@users.noreply.github.com> | 2020-08-07 19:00:51 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-08-14 15:03:38 +0200 |
commit | 3c176894bae9de7958605fe432bff770b9232807 (patch) | |
tree | bb3d526c08ec84138a01bda75f5e24485b566c54 /client/src/app/shared | |
parent | cb54210c192bdbedab5d3333cc2602df8e23a38a (diff) | |
download | PeerTube-3c176894bae9de7958605fe432bff770b9232807.tar.gz PeerTube-3c176894bae9de7958605fe432bff770b9232807.tar.zst PeerTube-3c176894bae9de7958605fe432bff770b9232807.zip |
Add markown compatible help icon in comment textarea
Diffstat (limited to 'client/src/app/shared')
4 files changed, 11 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-icons/global-icon.component.ts b/client/src/app/shared/shared-icons/global-icon.component.ts index ffd217cc7..99efcd599 100644 --- a/client/src/app/shared/shared-icons/global-icon.component.ts +++ b/client/src/app/shared/shared-icons/global-icon.component.ts | |||
@@ -4,6 +4,7 @@ import { HooksService } from '@app/core/plugins/hooks.service' | |||
4 | const icons = { | 4 | const icons = { |
5 | // misc icons | 5 | // misc icons |
6 | 'npm': require('!!raw-loader?!../../../assets/images/misc/npm.svg').default, | 6 | 'npm': require('!!raw-loader?!../../../assets/images/misc/npm.svg').default, |
7 | 'markdown': require('!!raw-loader?!../../../assets/images/misc/markdown.svg').default, | ||
7 | 'language': require('!!raw-loader?!../../../assets/images/misc/language.svg').default, | 8 | 'language': require('!!raw-loader?!../../../assets/images/misc/language.svg').default, |
8 | 'video-lang': require('!!raw-loader?!../../../assets/images/misc/video-lang.svg').default, | 9 | 'video-lang': require('!!raw-loader?!../../../assets/images/misc/video-lang.svg').default, |
9 | 'support': require('!!raw-loader?!../../../assets/images/misc/support.svg').default, | 10 | 'support': require('!!raw-loader?!../../../assets/images/misc/support.svg').default, |
diff --git a/client/src/app/shared/shared-main/misc/help.component.html b/client/src/app/shared/shared-main/misc/help.component.html index 9a6d3e48e..b2d58a828 100644 --- a/client/src/app/shared/shared-main/misc/help.component.html +++ b/client/src/app/shared/shared-main/misc/help.component.html | |||
@@ -26,8 +26,8 @@ | |||
26 | role="button" | 26 | role="button" |
27 | class="help-tooltip-button" | 27 | class="help-tooltip-button" |
28 | container="body" | 28 | container="body" |
29 | title="Get help" | 29 | [title]="title" |
30 | i18n-title | 30 | tabindex=0 |
31 | popoverClass="help-popover" | 31 | popoverClass="help-popover" |
32 | [attr.aria-pressed]="isPopoverOpened" | 32 | [attr.aria-pressed]="isPopoverOpened" |
33 | [ngbPopover]="tooltipTemplate" | 33 | [ngbPopover]="tooltipTemplate" |
@@ -36,5 +36,5 @@ | |||
36 | (onHidden)="onPopoverHidden()" | 36 | (onHidden)="onPopoverHidden()" |
37 | (onShown)="onPopoverShown()" | 37 | (onShown)="onPopoverShown()" |
38 | > | 38 | > |
39 | <my-global-icon iconName="help"></my-global-icon> | 39 | <my-global-icon [iconName]="iconName"></my-global-icon> |
40 | </span> | 40 | </span> |
diff --git a/client/src/app/shared/shared-main/misc/help.component.scss b/client/src/app/shared/shared-main/misc/help.component.scss index 1e7fb4fc6..ccc91ffab 100644 --- a/client/src/app/shared/shared-main/misc/help.component.scss +++ b/client/src/app/shared/shared-main/misc/help.component.scss | |||
@@ -5,14 +5,17 @@ | |||
5 | cursor: pointer; | 5 | cursor: pointer; |
6 | border: none; | 6 | border: none; |
7 | 7 | ||
8 | margin: 5px; | ||
9 | |||
8 | my-global-icon { | 10 | my-global-icon { |
9 | width: 17px; | 11 | width: 17px; |
10 | position: relative; | 12 | position: relative; |
11 | top: -1px; | 13 | top: -1px; |
12 | margin: 5px; | ||
13 | 14 | ||
14 | @include apply-svg-color(pvar(--greyForegroundColor)) | 15 | @include apply-svg-color(pvar(--greyForegroundColor)) |
15 | } | 16 | } |
17 | |||
18 | @include disable-outline; | ||
16 | } | 19 | } |
17 | 20 | ||
18 | ::ng-deep { | 21 | ::ng-deep { |
diff --git a/client/src/app/shared/shared-main/misc/help.component.ts b/client/src/app/shared/shared-main/misc/help.component.ts index ebc965a88..bcbb464f3 100644 --- a/client/src/app/shared/shared-main/misc/help.component.ts +++ b/client/src/app/shared/shared-main/misc/help.component.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core' | 1 | import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core' |
2 | import { MarkdownService } from '@app/core' | 2 | import { MarkdownService } from '@app/core' |
3 | import { GlobalIconName } from '@app/shared/shared-icons' | ||
3 | import { PeerTubeTemplateDirective } from '../angular' | 4 | import { PeerTubeTemplateDirective } from '../angular' |
4 | 5 | ||
5 | @Component({ | 6 | @Component({ |
@@ -11,6 +12,8 @@ import { PeerTubeTemplateDirective } from '../angular' | |||
11 | export class HelpComponent implements OnInit, OnChanges, AfterContentInit { | 12 | export class HelpComponent implements OnInit, OnChanges, AfterContentInit { |
12 | @Input() helpType: 'custom' | 'markdownText' | 'markdownEnhanced' = 'custom' | 13 | @Input() helpType: 'custom' | 'markdownText' | 'markdownEnhanced' = 'custom' |
13 | @Input() tooltipPlacement = 'right auto' | 14 | @Input() tooltipPlacement = 'right auto' |
15 | @Input() iconName: GlobalIconName = 'help' | ||
16 | @Input() title = $localize`Get help` | ||
14 | 17 | ||
15 | @ContentChildren(PeerTubeTemplateDirective) templates: QueryList<PeerTubeTemplateDirective<'preHtml' | 'customHtml' | 'postHtml'>> | 18 | @ContentChildren(PeerTubeTemplateDirective) templates: QueryList<PeerTubeTemplateDirective<'preHtml' | 'customHtml' | 'postHtml'>> |
16 | 19 | ||