]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Put feed url as link
authorChocobozzz <me@florianbigard.com>
Fri, 15 Jan 2021 09:19:12 +0000 (10:19 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 15 Jan 2021 09:23:40 +0000 (10:23 +0100)
client/src/app/+videos/video-list/video-user-subscriptions.component.ts
client/src/app/shared/shared-video-miniature/abstract-video-list.html
client/src/app/shared/shared-video-miniature/abstract-video-list.ts

index 6d19707df7baa36e3cefffa29be15e0003ebd6f8..62d862ec92c45ebc95d4c54e1cf1954122bda437 100644 (file)
@@ -60,22 +60,24 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
         tokens => {
           const feeds = this.videoService.getVideoSubscriptionFeedUrls(user.account.id, tokens.feedToken)
           feedUrl = feedUrl + feeds.find(f => f.format === FeedFormat.RSS).url
+
+          this.actions.unshift({
+            label: $localize`Copy feed URL`,
+            iconName: 'syndication',
+            justIcon: true,
+            href: feedUrl,
+            click: e => {
+              e.preventDefault()
+              copyToClipboard(feedUrl)
+              this.activateCopiedMessage()
+            }
+          })
         },
 
         err => {
           this.notifier.error(err.message)
         }
       )
-
-    this.actions.unshift({
-      label: $localize`Feed`,
-      iconName: 'syndication',
-      justIcon: true,
-      click: () => {
-        copyToClipboard(feedUrl)
-        this.activateCopiedMessage()
-      }
-    })
   }
 
   ngOnDestroy () {
index 18294513fde18a3b9d04f00e8773285e5114fcb1..368a7d70e6fab8bb6d66c97026f1f6220537c160 100644 (file)
         <a *ngIf="action.routerLink" class="ml-2" [routerLink]="action.routerLink" routerLinkActive="active">
           <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container>
         </a>
-        <a *ngIf="!action.routerLink && action.click && !action.clipboard" class="ml-2" (click)="action.click()" (key.enter)="action.click()">
-          <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container>
-        </a>
-        <a *ngIf="!action.routerLink && !action.click && action.clipboard" class="ml-2" [cdkCopyToClipboard]="action.clipboard">
+
+        <a *ngIf="!action.routerLink && !action.href && action.click" class="ml-2" (click)="action.click($event)" (key.enter)="action.click($event)">
           <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container>
         </a>
-        <a *ngIf="!action.routerLink && action.click && action.clipboard" class="ml-2" (click)="action.click()" (key.enter)="action.click()" [cdkCopyToClipboard]="action.clipboard">
+
+        <a *ngIf="!action.routerLink && action.href && action.click" class="ml-2" (click)="action.click($event)" (key.enter)="action.click($event)" [href]="action.href">
           <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container>
         </a>
 
index c55e85afefc8e97c4f7f7b99cc74691dfa0d7e2b..a5f22585dda61e1a6b314f91be4027f595b7e294 100644 (file)
@@ -74,8 +74,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
     label: string
     justIcon?: boolean
     routerLink?: string
-    click?: Function
-    clipboard?: string
+    href?: string
+    click?: (e: Event) => void
   }[] = []
 
   onDataSubject = new Subject<any[]>()