From 7811819b1a942c99a80e36eb93cc3a8b0e7fc5f2 Mon Sep 17 00:00:00 2001 From: Chocobozzz <me@florianbigard.com> Date: Mon, 10 Feb 2020 14:37:15 +0100 Subject: Use angular 9 clipboard cdk --- client/src/app/+accounts/accounts.component.html | 2 +- client/src/app/+video-channels/video-channels.component.html | 2 +- client/src/app/menu/menu.component.html | 2 +- client/src/app/shared/forms/input-readonly-copy.component.html | 2 +- client/src/app/shared/shared.module.ts | 2 +- client/src/app/shared/video/modals/video-download.component.html | 4 +++- 6 files changed, 8 insertions(+), 6 deletions(-) (limited to 'client/src') diff --git a/client/src/app/+accounts/accounts.component.html b/client/src/app/+accounts/accounts.component.html index 85f7dd30c..915bee0a2 100644 --- a/client/src/app/+accounts/accounts.component.html +++ b/client/src/app/+accounts/accounts.component.html @@ -9,7 +9,7 @@ <div class="actor-display-name">{{ account.displayName }}</div> <div class="actor-name">{{ account.nameWithHost }} - <button ngxClipboard [cbContent]="account.nameWithHostForced" (click)="activateCopiedMessage()" + <button [cdkCopyToClipboard]="account.nameWithHostForced" (click)="activateCopiedMessage()" class="btn btn-outline-secondary btn-sm copy-button" > <span class="glyphicon glyphicon-copy"></span> diff --git a/client/src/app/+video-channels/video-channels.component.html b/client/src/app/+video-channels/video-channels.component.html index f0bb083ca..debda9948 100644 --- a/client/src/app/+video-channels/video-channels.component.html +++ b/client/src/app/+video-channels/video-channels.component.html @@ -8,7 +8,7 @@ <div class="actor-names"> <div class="actor-display-name">{{ videoChannel.displayName }}</div> <div class="actor-name">{{ videoChannel.nameWithHost }} - <button ngxClipboard [cbContent]="videoChannel.nameWithHost" (click)="activateCopiedMessage()" + <button [cdkCopyToClipboard]="videoChannel.nameWithHost" (click)="activateCopiedMessage()" class="btn btn-outline-secondary btn-sm copy-button" > <span class="glyphicon glyphicon-copy"></span> diff --git a/client/src/app/menu/menu.component.html b/client/src/app/menu/menu.component.html index 675fb597d..b99c7308e 100644 --- a/client/src/app/menu/menu.component.html +++ b/client/src/app/menu/menu.component.html @@ -8,7 +8,7 @@ <a *ngIf="user.account" [routerLink]="[ '/accounts', user.account.nameWithHost ]" class="logged-in-display-name">{{ user.account?.displayName }}</a> <a *ngIf="!user.account" routerLink="/my-account/settings" class="logged-in-display-name">{{ user.account?.displayName }}</a> - <div ngxClipboard [cbContent]="user.account?.nameWithHost" class="logged-in-username">{{ user.username }}</div> + <div class="logged-in-username">{{ user.username }}</div> </div> <div class="logged-in-more" ngbDropdown placement="bottom-right auto"> diff --git a/client/src/app/shared/forms/input-readonly-copy.component.html b/client/src/app/shared/forms/input-readonly-copy.component.html index 27571b63f..b6a56ec44 100644 --- a/client/src/app/shared/forms/input-readonly-copy.component.html +++ b/client/src/app/shared/forms/input-readonly-copy.component.html @@ -2,7 +2,7 @@ <input #urlInput (click)="urlInput.select()" type="text" class="form-control readonly" readonly [value]="value" /> <div class="input-group-append"> - <button [ngxClipboard]="urlInput" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> + <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> <span class="glyphicon glyphicon-copy"></span> </button> </div> diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts index f39a889e9..759de7020 100644 --- a/client/src/app/shared/shared.module.ts +++ b/client/src/app/shared/shared.module.ts @@ -93,12 +93,12 @@ import { VideoActionsDropdownComponent } from '@app/shared/video/video-actions-d import { VideoBlacklistComponent } from '@app/shared/video/modals/video-blacklist.component' import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component' import { VideoReportComponent } from '@app/shared/video/modals/video-report.component' -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' import { RedundancyService } from '@app/shared/video/redundancy.service' +import { ClipboardModule } from '@angular/cdk/clipboard' @NgModule({ imports: [ diff --git a/client/src/app/shared/video/modals/video-download.component.html b/client/src/app/shared/video/modals/video-download.component.html index 8cca985b1..976da03f3 100644 --- a/client/src/app/shared/video/modals/video-download.component.html +++ b/client/src/app/shared/video/modals/video-download.component.html @@ -23,13 +23,15 @@ <select *ngIf="type === 'video'" [(ngModel)]="resolutionId"> <option *ngFor="let file of getVideoFiles()" [value]="file.resolution.id">{{ file.resolution.label }}</option> </select> + <select *ngIf="type === 'subtitles'" [(ngModel)]="subtitleLanguageId"> <option *ngFor="let caption of videoCaptions" [value]="caption.language.id">{{ caption.language.label }}</option> </select> </div> + <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> <div class="input-group-append"> - <button [ngxClipboard]="urlInput" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> + <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> <span class="glyphicon glyphicon-copy"></span> </button> </div> -- cgit v1.2.3