Use angular 9 clipboard cdk

pull/2473/head
Chocobozzz 2020-02-10 14:37:15 +01:00 committed by Chocobozzz
parent be27ef3b46
commit 7811819b1a
8 changed files with 8 additions and 22 deletions

View File

@ -103,7 +103,6 @@
"lodash-es": "^4.17.4",
"markdown-it": "^9.0.1",
"ngx-chips": "2.1.0",
"ngx-clipboard": "12.3.0",
"ngx-pipes": "^2.6.0",
"node-sass": "^4.9.3",
"npm-font-source-sans-pro": "^1.0.2",

View File

@ -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>

View File

@ -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>

View File

@ -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">

View File

@ -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>

View File

@ -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: [

View File

@ -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>

View File

@ -7584,14 +7584,6 @@ ngx-chips@2.1.0:
ng2-material-dropdown "0.11.0"
tslib "^1.9.0"
ngx-clipboard@12.3.0:
version "12.3.0"
resolved "https://registry.yarnpkg.com/ngx-clipboard/-/ngx-clipboard-12.3.0.tgz#8e61a894ff57249db64b733d26f9a0b98c08829f"
integrity sha512-ToSsuDv9I1L0g+TcthePcZ4B859/MpoarlHVr2KnHWy3pR8SxfJlNyP2i9STYRQkJ5bSEg65RFErW4tx52lHYQ==
dependencies:
ngx-window-token "^2.0.0"
tslib "^1.9.0"
ngx-pipes@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/ngx-pipes/-/ngx-pipes-2.6.0.tgz#8aec62de477067ef2726f2b87086a169bcf41b8a"
@ -7599,13 +7591,6 @@ ngx-pipes@^2.6.0:
dependencies:
tslib "^1.9.0"
ngx-window-token@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/ngx-window-token/-/ngx-window-token-2.0.1.tgz#8f91221af4116aa9f49bb3f7a6f1111639884fba"
integrity sha512-rvqdqJEfnWXQFU5fyfYt06E10tR/UtFOYdF3QebfcOh5VIJhnTKiprX8e4B9OrX7WEVFm9BT8uV72xXcEgsaKA==
dependencies:
tslib "^1.9.0"
nice-try@^1.0.4:
version "1.0.5"
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"