From: Chocobozzz Date: Thu, 22 Feb 2018 17:32:31 +0000 (+0100) Subject: Add help tooltip X-Git-Tag: v0.0.27-alpha~9 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=8a8e02a43e346b9b777c8192a7c5cbdccb928b11;p=github%2FChocobozzz%2FPeerTube.git Add help tooltip --- diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 8dca9bc04..4aef2ef6b 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html @@ -1,6 +1,6 @@
Update PeerTube configuration
-
+
Instance
@@ -16,7 +16,7 @@
- +
- +
- + diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/misc/help.component.html new file mode 100644 index 000000000..956095996 --- /dev/null +++ b/client/src/app/shared/misc/help.component.html @@ -0,0 +1,15 @@ + + +

+
+
+ +

+ + +
+

+
+
+ + diff --git a/client/src/app/shared/misc/help.component.scss b/client/src/app/shared/misc/help.component.scss new file mode 100644 index 000000000..5fe6b7366 --- /dev/null +++ b/client/src/app/shared/misc/help.component.scss @@ -0,0 +1,33 @@ +@import '_variables'; +@import '_mixins'; + +.help-tooltip-button { + @include icon(17px); + + position: relative; + top: -2px; + background-image: url('../../../assets/images/global/help.svg'); + background-color: #fff; + border: none; +} + +/deep/ { + .help-tooltip { + opacity: 1 !important; + + .tooltip-inner { + text-align: left; + padding: 10px; + + font-size: 13px; + font-family: $main-fonts; + background-color: #fff; + color: #000; + box-shadow: 0 0 6px rgba(0, 0, 0, 0.5); + } + + ul { + padding-left: 20px; + } + } +} 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 @@ +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.

' + + 'Supports:' + + '
    ' + + '
  • Links
  • ' + + '
  • Lists
  • ' + + '
  • Emphasis
  • ' + + '
' + return + } + + if (this.helpType === 'markdownEnhanced') { + this.mainHtml = 'Markdown compatible.

' + + 'Supports:' + + '
    ' + + '
  • Links
  • ' + + '
  • Lists
  • ' + + '
  • Emphasis
  • ' + + '
  • Images
  • ' + + '
' + return + } + } +} diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts index b1dfdd747..eb50d45a9 100644 --- a/client/src/app/shared/shared.module.ts +++ b/client/src/app/shared/shared.module.ts @@ -4,12 +4,14 @@ import { NgModule } from '@angular/core' import { FormsModule, ReactiveFormsModule } from '@angular/forms' import { RouterModule } from '@angular/router' import { MarkdownTextareaComponent } from '@app/shared/forms/markdown-textarea.component' +import { HelpComponent } from '@app/shared/misc/help.component' import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive' import { MarkdownService } from '@app/videos/shared' import { BsDropdownModule } from 'ngx-bootstrap/dropdown' import { ModalModule } from 'ngx-bootstrap/modal' import { TabsModule } from 'ngx-bootstrap/tabs' +import { TooltipModule } from 'ngx-bootstrap/tooltip' import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes' import { SharedModule as PrimeSharedModule } from 'primeng/components/common/shared' @@ -38,6 +40,7 @@ import { VideoService } from './video/video.service' BsDropdownModule.forRoot(), ModalModule.forRoot(), TabsModule.forRoot(), + TooltipModule.forRoot(), PrimeSharedModule, NgPipesModule @@ -52,7 +55,8 @@ import { VideoService } from './video/video.service' NumberFormatterPipe, FromNowPipe, MarkdownTextareaComponent, - InfiniteScrollerDirective + InfiniteScrollerDirective, + HelpComponent ], exports: [ @@ -65,6 +69,7 @@ import { VideoService } from './video/video.service' BsDropdownModule, ModalModule, TabsModule, + TooltipModule, PrimeSharedModule, BytesPipe, KeysPipe, @@ -76,6 +81,7 @@ import { VideoService } from './video/video.service' EditButtonComponent, MarkdownTextareaComponent, InfiniteScrollerDirective, + HelpComponent, NumberFormatterPipe, FromNowPipe diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html index bf2204013..f88abcbf8 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html @@ -20,7 +20,7 @@
- +
@@ -127,7 +127,7 @@
- + + + + + + + + + + + + \ No newline at end of file diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss index f04aef85d..f998096ae 100644 --- a/client/src/sass/application.scss +++ b/client/src/sass/application.scss @@ -19,7 +19,7 @@ $FontPathSourceSansPro: '../../node_modules/npm-font-source-sans-pro/fonts'; } body { - font-family: 'Source Sans Pro', sans-serif; + font-family: $main-fonts; font-weight: $font-regular; color: #000; } diff --git a/client/src/sass/include/_variables.scss b/client/src/sass/include/_variables.scss index e7bed418e..95b4b166e 100644 --- a/client/src/sass/include/_variables.scss +++ b/client/src/sass/include/_variables.scss @@ -1,3 +1,4 @@ +$main-fonts: 'Source Sans Pro', sans-serif; $font-regular: 400; $font-semibold: 600; $font-bold: 700;