Use angular 9 clipboard cdk
authorChocobozzz <me@florianbigard.com>
Mon, 10 Feb 2020 13:37:15 +0000 (14:37 +0100)
committerChocobozzz <chocobozzz@cpy.re>
Mon, 10 Feb 2020 15:39:28 +0000 (16:39 +0100)
client/package.json
client/src/app/+accounts/accounts.component.html
client/src/app/+video-channels/video-channels.component.html
client/src/app/menu/menu.component.html
client/src/app/shared/forms/input-readonly-copy.component.html
client/src/app/shared/shared.module.ts
client/src/app/shared/video/modals/video-download.component.html
client/yarn.lock

index 9da34e4e89655e8186c21850ce5feb439172d8e3..9715b3716a9b60e150e83eb043cd60539426acd5 100644 (file)
     "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",
index 85f7dd30ccf20d673f3846ddb90a8a2b564d89b0..915bee0a2383c64caa17114b71bb46b8d0b3a767 100644 (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>
index f0bb083ca03de4a96176d5124d86deb77c789743..debda9948bab78755ed45c3d78c828e70facee3d 100644 (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>
index 675fb597d672450a096ba013385639f346467395..b99c7308e0116f03375f0aaa4ec819c2f39e77b0 100644 (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">
index 27571b63f4f6c0115e36d46c47ac58a9daff2560..b6a56ec441dfca1d0824dbdfb1f72b1ebff2e205 100644 (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>
index f39a889e9363c040f1b8ba42134e7dfd98f666ef..759de7020f979b5bab60cbeffeecb29ecea11647 100644 (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: [
index 8cca985b1076a9c4b6ee7598c1cf1cddb0f0b4e6..976da03f3d641fb4f5e20b08b47d95aacb91f451 100644 (file)
           <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>
index a891b4dbdd2f12f4484ba524acc960589a0acb2f..c2f33bc553c790a515d04dca693e01ebea937645 100644 (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"