From 100d9ce23bb7c5186132607e4c444f9cba5002a4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 29 Mar 2021 15:56:01 +0200 Subject: Add support button in channel page --- .../modal/video-support.component.html | 15 ----------- .../modal/video-support.component.scss | 3 --- .../+video-watch/modal/video-support.component.ts | 31 ---------------------- .../+video-watch/video-watch.component.html | 2 +- .../+videos/+video-watch/video-watch.component.ts | 6 ++--- .../app/+videos/+video-watch/video-watch.module.ts | 6 ++--- 6 files changed, 7 insertions(+), 56 deletions(-) delete mode 100644 client/src/app/+videos/+video-watch/modal/video-support.component.html delete mode 100644 client/src/app/+videos/+video-watch/modal/video-support.component.scss delete mode 100644 client/src/app/+videos/+video-watch/modal/video-support.component.ts (limited to 'client/src/app/+videos/+video-watch') diff --git a/client/src/app/+videos/+video-watch/modal/video-support.component.html b/client/src/app/+videos/+video-watch/modal/video-support.component.html deleted file mode 100644 index 935656d23..000000000 --- a/client/src/app/+videos/+video-watch/modal/video-support.component.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - diff --git a/client/src/app/+videos/+video-watch/modal/video-support.component.scss b/client/src/app/+videos/+video-watch/modal/video-support.component.scss deleted file mode 100644 index 184e09027..000000000 --- a/client/src/app/+videos/+video-watch/modal/video-support.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.action-button-cancel { - margin-right: 0 !important; -} diff --git a/client/src/app/+videos/+video-watch/modal/video-support.component.ts b/client/src/app/+videos/+video-watch/modal/video-support.component.ts deleted file mode 100644 index bd5290a72..000000000 --- a/client/src/app/+videos/+video-watch/modal/video-support.component.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Component, Input, ViewChild } from '@angular/core' -import { MarkdownService } from '@app/core' -import { VideoDetails } from '@app/shared/shared-main' -import { NgbModal } from '@ng-bootstrap/ng-bootstrap' - -@Component({ - selector: 'my-video-support', - templateUrl: './video-support.component.html', - styleUrls: [ './video-support.component.scss' ] -}) -export class VideoSupportComponent { - @Input() video: VideoDetails = null - - @ViewChild('modal', { static: true }) modal: NgbModal - - videoHTMLSupport = '' - - constructor ( - private markdownService: MarkdownService, - private modalService: NgbModal - ) { } - - show () { - const modalRef = this.modalService.open(this.modal, { centered: true }) - - this.markdownService.enhancedMarkdownToHTML(this.video.support) - .then(r => this.videoHTMLSupport = r) - - return modalRef - } -} diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html index b17f898ce..07f7ab7e3 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html @@ -313,6 +313,6 @@ - + diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts index ce115dfab..571d1e99a 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -21,6 +21,7 @@ import { RedirectService } from '@app/core/routing/redirect.service' import { isXPercentInViewport, scrollToTop } from '@app/helpers' import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main' import { VideoShareComponent } from '@app/shared/shared-share-modal' +import { SupportModalComponent } from '@app/shared/shared-support-modal' import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' import { VideoActionsDisplayType, VideoDownloadComponent } from '@app/shared/shared-video-miniature' import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' @@ -39,7 +40,6 @@ import { } from '../../../assets/player/peertube-player-manager' import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils' import { environment } from '../../../environments/environment' -import { VideoSupportComponent } from './modal/video-support.component' import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' type URLOptions = CustomizationOptions & { playerMode: PlayerMode } @@ -54,7 +54,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { @ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent @ViewChild('videoShareModal') videoShareModal: VideoShareComponent - @ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent + @ViewChild('supportModal') supportModal: SupportModalComponent @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent @@ -282,7 +282,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.pausePlayer() - const modalRef = this.videoSupportModal.show() + const modalRef = this.supportModal.show() modalRef.result.then(() => { if (isVideoPlaying) { diff --git a/client/src/app/+videos/+video-watch/video-watch.module.ts b/client/src/app/+videos/+video-watch/video-watch.module.ts index fbda9b9c4..d65cf8d68 100644 --- a/client/src/app/+videos/+video-watch/video-watch.module.ts +++ b/client/src/app/+videos/+video-watch/video-watch.module.ts @@ -4,6 +4,7 @@ import { SharedGlobalIconModule } from '@app/shared/shared-icons' import { SharedMainModule } from '@app/shared/shared-main' import { SharedModerationModule } from '@app/shared/shared-moderation' import { SharedShareModal } from '@app/shared/shared-share-modal' +import { SharedSupportModal } from '@app/shared/shared-support-modal' import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' import { SharedVideoModule } from '@app/shared/shared-video' import { SharedVideoCommentModule } from '@app/shared/shared-video-comment' @@ -13,7 +14,6 @@ import { VideoCommentService } from '../../shared/shared-video-comment/video-com import { VideoCommentAddComponent } from './comment/video-comment-add.component' import { VideoCommentComponent } from './comment/video-comment.component' import { VideoCommentsComponent } from './comment/video-comments.component' -import { VideoSupportComponent } from './modal/video-support.component' import { RecommendationsModule } from './recommendations/recommendations.module' import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive' import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' @@ -34,14 +34,14 @@ import { VideoWatchComponent } from './video-watch.component' SharedGlobalIconModule, SharedVideoCommentModule, SharedShareModal, - SharedVideoModule + SharedVideoModule, + SharedSupportModal ], declarations: [ VideoWatchComponent, VideoWatchPlaylistComponent, - VideoSupportComponent, VideoCommentsComponent, VideoCommentAddComponent, VideoCommentComponent, -- cgit v1.2.3