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 --- client/package.json | 2 +- .../following-add/following-add.component.scss | 2 +- .../my-account-video-channel-edit.ts | 2 +- client/src/app/app.module.ts | 2 -- .../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 +- client/src/sass/application.scss | 24 ++-------------------- client/src/sass/include/_mixins.scss | 4 ++-- client/src/sass/include/_variables.scss | 2 +- client/yarn.lock | 15 ++++++++++---- 13 files changed, 44 insertions(+), 45 deletions(-) diff --git a/client/package.json b/client/package.json index e9c74787c..ef0e8c03f 100644 --- a/client/package.json +++ b/client/package.json @@ -65,7 +65,7 @@ "@types/jschannel": "^1.0.0", "@types/linkifyjs": "^2.1.2", "@types/lodash-es": "^4.17.0", - "@types/markdown-it": "^0.0.5", + "@types/markdown-it": "^0.0.9", "@types/node": "^10.9.2", "@types/sanitize-html": "1.18.0", "@types/socket.io-client": "^1.4.32", diff --git a/client/src/app/+admin/follows/following-add/following-add.component.scss b/client/src/app/+admin/follows/following-add/following-add.component.scss index 1baddc95f..df104c14e 100644 --- a/client/src/app/+admin/follows/following-add/following-add.component.scss +++ b/client/src/app/+admin/follows/following-add/following-add.component.scss @@ -7,7 +7,7 @@ textarea { .form-control { &, &:focus { - background-color: var(--inputColor); + background-color: var(--inputBackgroundColor); color: var(--mainForegroundColor); } } diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.ts index 7479442d1..355cb4f55 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.ts +++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.ts @@ -9,7 +9,7 @@ export abstract class MyAccountVideoChannelEdit extends FormReactive { abstract isCreation (): boolean abstract getFormButtonTitle (): string - // FIXME: We need this method so angular does not complain in the child template + // We need this method so angular does not complain in child template that doesn't need this onAvatarChange (formData: FormData) { /* empty */ } // Should be implemented by the child diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index dda705811..62915ec54 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts @@ -48,8 +48,6 @@ export function metaFactory (serverService: ServerService): MetaLoader { ], imports: [ BrowserModule, - // FIXME: https://github.com/maxisam/ngx-clipboard/issues/133 - ClipboardModule, CoreModule, SharedModule, 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 @@
- +