From 3a1fed11c52705002cbf2a17294509fb5a89237c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 Dec 2019 10:05:00 +0100 Subject: [PATCH] Support playlists in share modal --- .../forms/input-readonly-copy.component.html | 9 + .../forms/input-readonly-copy.component.scss | 3 + .../forms/input-readonly-copy.component.ts | 21 ++ client/src/app/shared/shared.module.ts | 3 + .../modal/video-share.component.html | 261 +++++++++--------- .../modal/video-share.component.scss | 16 +- .../modal/video-share.component.ts | 28 +- .../+video-watch/video-watch.component.html | 2 +- client/src/assets/player/utils.ts | 2 + 9 files changed, 204 insertions(+), 141 deletions(-) create mode 100644 client/src/app/shared/forms/input-readonly-copy.component.html create mode 100644 client/src/app/shared/forms/input-readonly-copy.component.scss create mode 100644 client/src/app/shared/forms/input-readonly-copy.component.ts diff --git a/client/src/app/shared/forms/input-readonly-copy.component.html b/client/src/app/shared/forms/input-readonly-copy.component.html new file mode 100644 index 000000000..27571b63f --- /dev/null +++ b/client/src/app/shared/forms/input-readonly-copy.component.html @@ -0,0 +1,9 @@ +
+ + +
+ +
+
diff --git a/client/src/app/shared/forms/input-readonly-copy.component.scss b/client/src/app/shared/forms/input-readonly-copy.component.scss new file mode 100644 index 000000000..8dc4f113c --- /dev/null +++ b/client/src/app/shared/forms/input-readonly-copy.component.scss @@ -0,0 +1,3 @@ +input.readonly { + font-size: 15px; +} diff --git a/client/src/app/shared/forms/input-readonly-copy.component.ts b/client/src/app/shared/forms/input-readonly-copy.component.ts new file mode 100644 index 000000000..7528fb7a1 --- /dev/null +++ b/client/src/app/shared/forms/input-readonly-copy.component.ts @@ -0,0 +1,21 @@ +import { Component, Input } from '@angular/core' +import { Notifier } from '@app/core' +import { I18n } from '@ngx-translate/i18n-polyfill' + +@Component({ + selector: 'my-input-readonly-copy', + templateUrl: './input-readonly-copy.component.html', + styleUrls: [ './input-readonly-copy.component.scss' ] +}) +export class InputReadonlyCopyComponent { + @Input() value = '' + + constructor ( + private notifier: Notifier, + private i18n: I18n + ) { } + + activateCopiedMessage () { + this.notifier.success(this.i18n('Copied')) + } +} diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts index 8cbb15bfa..29ddf7b81 100644 --- a/client/src/app/shared/shared.module.ts +++ b/client/src/app/shared/shared.module.ts @@ -95,6 +95,7 @@ import { ClipboardModule } from 'ngx-clipboard' import { FollowService } from '@app/shared/instance/follow.service' import { MultiSelectModule } from 'primeng/multiselect' import { FeatureBooleanComponent } from '@app/shared/instance/feature-boolean.component' +import { InputReadonlyCopyComponent } from '@app/shared/forms/input-readonly-copy.component' @NgModule({ imports: [ @@ -155,6 +156,7 @@ import { FeatureBooleanComponent } from '@app/shared/instance/feature-boolean.co ReactiveFileComponent, PeertubeCheckboxComponent, TimestampInputComponent, + InputReadonlyCopyComponent, SubscribeButtonComponent, RemoteSubscribeComponent, @@ -220,6 +222,7 @@ import { FeatureBooleanComponent } from '@app/shared/instance/feature-boolean.co InfiniteScrollerDirective, TextareaAutoResizeDirective, HelpComponent, + InputReadonlyCopyComponent, ReactiveFileComponent, PeertubeCheckboxComponent, diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.html b/client/src/app/videos/+video-watch/modal/video-share.component.html index e0be9f265..549a9f30e 100644 --- a/client/src/app/videos/+video-watch/modal/video-share.component.html +++ b/client/src/app/videos/+video-watch/modal/video-share.component.html @@ -4,167 +4,176 @@ +