From 0bdad52fbbad81e7654adc495088da56a00437df Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 20 Jul 2020 11:37:06 +0200 Subject: Fix issues with external links in search page --- .../video-thumbnail.component.html | 15 ++++++++----- .../shared-thumbnail/video-thumbnail.component.ts | 7 ++++-- .../video-miniature.component.html | 12 ++++++----- .../video-miniature.component.ts | 25 +++++++++++++--------- ...video-playlist-element-miniature.component.html | 2 +- 5 files changed, 38 insertions(+), 23 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html index fe5510c56..0cb0f321b 100644 --- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html +++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html @@ -1,7 +1,12 @@ - + + + + + + + + +
@@ -30,4 +35,4 @@
- + diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts index 3ff45d9b7..812c7a508 100644 --- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts +++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts @@ -11,8 +11,11 @@ import { Video } from '../shared-main' export class VideoThumbnailComponent { @Input() video: Video @Input() nsfw = false - @Input() routerLink: any[] + + @Input() videoRouterLink: any[] @Input() queryParams: { [ p: string ]: any } + @Input() videoHref: string + @Input() videoTarget: string @Input() displayWatchLaterPlaylist: boolean @Input() inWatchLaterPlaylist: boolean @@ -49,7 +52,7 @@ export class VideoThumbnailComponent { } getVideoRouterLink () { - if (this.routerLink) return this.routerLink + if (this.videoRouterLink) return this.videoRouterLink return [ '/videos/watch', this.video.uuid ] } diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html index e5d91e69a..a88b3bc9e 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html @@ -1,6 +1,6 @@
Unlisted @@ -15,10 +15,12 @@
- {{ video.name }} + + {{ video.name }} diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts index e1adbb6ad..f434550dd 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts @@ -29,6 +29,7 @@ export type MiniatureDisplayOptions = { blacklistInfo?: boolean nsfw?: boolean } +export type VideoLinkType = 'internal' | 'lazy-load' | 'external' @Component({ selector: 'my-video-miniature', @@ -55,7 +56,7 @@ export class VideoMiniatureComponent implements OnInit { @Input() displayVideoActions = true @Input() fitWidth = false - @Input() useLazyLoadUrl = false + @Input() videoLinkType: VideoLinkType = 'internal' @Output() videoBlocked = new EventEmitter() @Output() videoUnblocked = new EventEmitter() @@ -85,7 +86,9 @@ export class VideoMiniatureComponent implements OnInit { playlistElementId?: number } - videoLink: any[] = [] + videoRouterLink: any[] = [] + videoHref: string + videoTarget: string private ownerDisplayTypeChosen: 'account' | 'videoChannel' @@ -125,18 +128,20 @@ export class VideoMiniatureComponent implements OnInit { } buildVideoLink () { - if (this.useLazyLoadUrl && this.video.url) { - const remoteUriConfig = this.serverConfig.search.remoteUri - - // Redirect on the external instance if not allowed to fetch remote data - const externalRedirect = (!this.authService.isLoggedIn() && !remoteUriConfig.anonymous) || !remoteUriConfig.users - const fromPath = window.location.pathname + window.location.search + if (this.videoLinkType === 'internal' || !this.video.url) { + this.videoRouterLink = [ '/videos/watch', this.video.uuid ] + return + } - this.videoLink = [ '/search/lazy-load-video', { url: this.video.url, externalRedirect, fromPath } ] + if (this.videoLinkType === 'external') { + this.videoRouterLink = null + this.videoHref = this.video.url + this.videoTarget = '_blank' return } - this.videoLink = [ '/videos/watch', this.video.uuid ] + // Lazy load + this.videoRouterLink = [ '/search/lazy-load-video', { url: this.video.url } ] } displayOwnerAccount () { diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html index e3f7ef017..473fdc102 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html @@ -8,7 +8,7 @@
-- cgit v1.2.3 From b5366b3c7e1e2036624d6e7e2784ad8fc4700fac Mon Sep 17 00:00:00 2001 From: kimsible Date: Mon, 20 Jul 2020 14:52:14 +0200 Subject: Correct maximized icon padding since new icons set implemented --- client/src/app/shared/shared-forms/markdown-textarea.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-forms/markdown-textarea.component.scss b/client/src/app/shared/shared-forms/markdown-textarea.component.scss index f2c76f7a1..39e72b5bc 100644 --- a/client/src/app/shared/shared-forms/markdown-textarea.component.scss +++ b/client/src/app/shared/shared-forms/markdown-textarea.component.scss @@ -43,7 +43,7 @@ $input-border-radius: 3px; } .grey-button { - padding: 0 12px 0 12px; + padding: 0 7px 0 12px; } } } -- cgit v1.2.3 From cd801c69072327eddab0eb0e9a7c1f97cbd6601d Mon Sep 17 00:00:00 2001 From: kimsible Date: Mon, 20 Jul 2020 14:45:43 +0200 Subject: Correct action button selection mode styles --- .../shared-video-miniature/videos-selection.component.scss | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.scss b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss index d3cbabf23..c33e11889 100644 --- a/client/src/app/shared/shared-video-miniature/videos-selection.component.scss +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss @@ -10,14 +10,13 @@ position: fixed; .action-button { - display: inline-block; + display: block; + margin-left: 55px; } .action-button-cancel-selection { @include peertube-button; @include grey-button; - - margin-right: 10px; } } } @@ -54,4 +53,8 @@ margin-top: 10px; } } + + .action-selection-mode { + display: none; // disable for small screens + } } -- cgit v1.2.3 From 2170f1db6ee40531f9d08b711d8b7b00254c0031 Mon Sep 17 00:00:00 2001 From: kimsible Date: Mon, 20 Jul 2020 14:12:00 +0200 Subject: Fix accessibility action buttons and display on imports and followers list --- client/src/app/shared/shared-main/buttons/button.component.html | 2 +- client/src/app/shared/shared-main/buttons/delete-button.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-main/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html index a7dd4bb10..8eccd5c3c 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.html +++ b/client/src/app/shared/shared-main/buttons/button.component.html @@ -1,4 +1,4 @@ - + diff --git a/client/src/app/shared/shared-main/buttons/delete-button.component.html b/client/src/app/shared/shared-main/buttons/delete-button.component.html index 398b6db1e..6643e6013 100644 --- a/client/src/app/shared/shared-main/buttons/delete-button.component.html +++ b/client/src/app/shared/shared-main/buttons/delete-button.component.html @@ -1,4 +1,4 @@ - + {{ label }} -- cgit v1.2.3