From 14aa85562cb83559d20105b4ddb4bf8b2340578a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 Jan 2020 16:00:28 +0100 Subject: Cleanup some client FIXME --- .../src/app/shared/buttons/button.component.scss | 23 ++++++++++++++++++---- .../app/shared/menu/top-menu-dropdown.component.ts | 3 +-- client/src/app/shared/renderer/markdown.service.ts | 4 ++-- .../shared/video/infinite-scroller.directive.ts | 4 ++-- .../shared/video/video-miniature.component.html | 2 +- 5 files changed, 25 insertions(+), 11 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/buttons/button.component.scss b/client/src/app/shared/buttons/button.component.scss index 2a8cfc748..3ccfefd7e 100644 --- a/client/src/app/shared/buttons/button.component.scss +++ b/client/src/app/shared/buttons/button.component.scss @@ -10,11 +10,26 @@ my-small-loader ::ng-deep .root { .action-button { @include peertube-button-link; @include button-with-icon(21px, 0, -2px); +} - // FIXME: Firefox does not apply global .orange-button icon color - &.orange-button { - @include apply-svg-color(#fff) - } +.orange-button { + @include peertube-button; + @include orange-button; +} + +.orange-button-link { + @include peertube-button-link; + @include orange-button; +} + +.grey-button { + @include peertube-button; + @include grey-button; +} + +.grey-button-link { + @include peertube-button-link; + @include grey-button; } // In a table, try to minimize the space taken by this button diff --git a/client/src/app/shared/menu/top-menu-dropdown.component.ts b/client/src/app/shared/menu/top-menu-dropdown.component.ts index 5ccdafb54..24a083654 100644 --- a/client/src/app/shared/menu/top-menu-dropdown.component.ts +++ b/client/src/app/shared/menu/top-menu-dropdown.component.ts @@ -49,8 +49,7 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy { e => e.children && e.children.some(c => !!c.iconName) ) - // FIXME: We have to set body for the container to avoid because of scroll overflow on mobile view - // But this break our hovering system + // We have to set body for the container to avoid scroll overflow on mobile view if (this.screen.isInMobileView()) { this.container = 'body' } diff --git a/client/src/app/shared/renderer/markdown.service.ts b/client/src/app/shared/renderer/markdown.service.ts index 0d3fde537..f0c87326f 100644 --- a/client/src/app/shared/renderer/markdown.service.ts +++ b/client/src/app/shared/renderer/markdown.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core' -import { MarkdownIt } from 'markdown-it' import { buildVideoLink } from '../../../assets/player/utils' import { HtmlRendererService } from '@app/shared/renderer/html-renderer.service' +import * as MarkdownIt from 'markdown-it' type MarkdownParsers = { textMarkdownIt: MarkdownIt @@ -100,7 +100,7 @@ export class MarkdownService { } private async createMarkdownIt (config: MarkdownConfig) { - // FIXME: import('...') returns a struct module, containing a "default" field corresponding to our sanitizeHtml function + // FIXME: import('...') returns a struct module, containing a "default" field const MarkdownItClass: typeof import ('markdown-it') = (await import('markdown-it') as any).default const markdownIt = new MarkdownItClass('zero', { linkify: true, breaks: true, html: config.html }) diff --git a/client/src/app/shared/video/infinite-scroller.directive.ts b/client/src/app/shared/video/infinite-scroller.directive.ts index 9f613c5fa..f09c3d1fc 100644 --- a/client/src/app/shared/video/infinite-scroller.directive.ts +++ b/client/src/app/shared/video/infinite-scroller.directive.ts @@ -1,4 +1,4 @@ -import { distinctUntilChanged, filter, map, share, startWith, tap, throttleTime } from 'rxjs/operators' +import { distinctUntilChanged, filter, map, share, startWith, throttleTime } from 'rxjs/operators' import { AfterContentChecked, Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core' import { fromEvent, Observable, Subscription } from 'rxjs' @@ -53,7 +53,7 @@ export class InfiniteScrollerDirective implements OnInit, OnDestroy, AfterConten const scrollableElement = this.onItself ? this.container : window const scrollObservable = fromEvent(scrollableElement, 'scroll') .pipe( - startWith(null as string), // FIXME: typings + startWith(true), throttleTime(200, undefined, throttleOptions), map(() => this.getScrollInfo()), distinctUntilChanged((o1, o2) => o1.current === o2.current), diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/video/video-miniature.component.html index 46c49c15b..819be6d48 100644 --- a/client/src/app/shared/video/video-miniature.component.html +++ b/client/src/app/shared/video/video-miniature.component.html @@ -50,7 +50,7 @@
- +