aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-06 15:36:44 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commit830b4faff15fb9c81d88e8e69fcdf94aad32bef8 (patch)
tree53de6c9e30ce88734b4bdda62016e0498fe78491 /client/src/app/videos
parentd4c9f45b31eda0b7a391ddc83eb290ca5cba311f (diff)
downloadPeerTube-830b4faff15fb9c81d88e8e69fcdf94aad32bef8.tar.gz
PeerTube-830b4faff15fb9c81d88e8e69fcdf94aad32bef8.tar.zst
PeerTube-830b4faff15fb9c81d88e8e69fcdf94aad32bef8.zip
Add/update/delete/list my playlists
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.html8
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.module.ts2
-rw-r--r--client/src/app/videos/+video-edit/shared/video-image.component.html9
-rw-r--r--client/src/app/videos/+video-edit/shared/video-image.component.scss18
-rw-r--r--client/src/app/videos/+video-edit/shared/video-image.component.ts69
-rw-r--r--client/src/app/videos/video-list/video-overview.component.scss3
6 files changed, 6 insertions, 103 deletions
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html
index 1be1084ad..99695204d 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.html
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html
@@ -188,17 +188,17 @@
188 <div class="row advanced-settings"> 188 <div class="row advanced-settings">
189 <div class="col-md-12 col-xl-8"> 189 <div class="col-md-12 col-xl-8">
190 <div class="form-group"> 190 <div class="form-group">
191 <my-video-image 191 <my-image-upload
192 i18n-inputLabel inputLabel="Upload thumbnail" inputName="thumbnailfile" formControlName="thumbnailfile" 192 i18n-inputLabel inputLabel="Upload thumbnail" inputName="thumbnailfile" formControlName="thumbnailfile"
193 previewWidth="200px" previewHeight="110px" 193 previewWidth="200px" previewHeight="110px"
194 ></my-video-image> 194 ></my-image-upload>
195 </div> 195 </div>
196 196
197 <div class="form-group"> 197 <div class="form-group">
198 <my-video-image 198 <my-image-upload
199 i18n-inputLabel inputLabel="Upload preview" inputName="previewfile" formControlName="previewfile" 199 i18n-inputLabel inputLabel="Upload preview" inputName="previewfile" formControlName="previewfile"
200 previewWidth="360px" previewHeight="200px" 200 previewWidth="360px" previewHeight="200px"
201 ></my-video-image> 201 ></my-image-upload>
202 </div> 202 </div>
203 203
204 <div class="form-group"> 204 <div class="form-group">
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.module.ts b/client/src/app/videos/+video-edit/shared/video-edit.module.ts
index f441d3fde..39b6daa93 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.module.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.module.ts
@@ -2,7 +2,6 @@ import { NgModule } from '@angular/core'
2import { TagInputModule } from 'ngx-chips' 2import { TagInputModule } from 'ngx-chips'
3import { SharedModule } from '../../../shared/' 3import { SharedModule } from '../../../shared/'
4import { VideoEditComponent } from './video-edit.component' 4import { VideoEditComponent } from './video-edit.component'
5import { VideoImageComponent } from './video-image.component'
6import { CalendarModule } from 'primeng/components/calendar/calendar' 5import { CalendarModule } from 'primeng/components/calendar/calendar'
7import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' 6import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
8 7
@@ -16,7 +15,6 @@ import { VideoCaptionAddModalComponent } from './video-caption-add-modal.compone
16 15
17 declarations: [ 16 declarations: [
18 VideoEditComponent, 17 VideoEditComponent,
19 VideoImageComponent,
20 VideoCaptionAddModalComponent 18 VideoCaptionAddModalComponent
21 ], 19 ],
22 20
diff --git a/client/src/app/videos/+video-edit/shared/video-image.component.html b/client/src/app/videos/+video-edit/shared/video-image.component.html
deleted file mode 100644
index c09c862c4..000000000
--- a/client/src/app/videos/+video-edit/shared/video-image.component.html
+++ /dev/null
@@ -1,9 +0,0 @@
1<div class="root">
2 <my-reactive-file
3 [inputName]="inputName" [inputLabel]="inputLabel" [extensions]="videoImageExtensions" [maxFileSize]="maxVideoImageSize"
4 (fileChanged)="onFileChanged($event)"
5 ></my-reactive-file>
6
7 <img *ngIf="imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" [src]="imageSrc" class="preview" />
8 <div *ngIf="!imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" class="preview no-image"></div>
9</div>
diff --git a/client/src/app/videos/+video-edit/shared/video-image.component.scss b/client/src/app/videos/+video-edit/shared/video-image.component.scss
deleted file mode 100644
index b63963bca..000000000
--- a/client/src/app/videos/+video-edit/shared/video-image.component.scss
+++ /dev/null
@@ -1,18 +0,0 @@
1@import '_variables';
2@import '_mixins';
3
4.root {
5 height: auto;
6 display: flex;
7 align-items: center;
8
9 .preview {
10 border: 2px solid grey;
11 border-radius: 4px;
12 margin-left: 50px;
13
14 &.no-image {
15 background-color: #ececec;
16 }
17 }
18}
diff --git a/client/src/app/videos/+video-edit/shared/video-image.component.ts b/client/src/app/videos/+video-edit/shared/video-image.component.ts
deleted file mode 100644
index a604cde90..000000000
--- a/client/src/app/videos/+video-edit/shared/video-image.component.ts
+++ /dev/null
@@ -1,69 +0,0 @@
1import { Component, forwardRef, Input } from '@angular/core'
2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
3import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
4import { ServerService } from '@app/core'
5
6@Component({
7 selector: 'my-video-image',
8 styleUrls: [ './video-image.component.scss' ],
9 templateUrl: './video-image.component.html',
10 providers: [
11 {
12 provide: NG_VALUE_ACCESSOR,
13 useExisting: forwardRef(() => VideoImageComponent),
14 multi: true
15 }
16 ]
17})
18export class VideoImageComponent implements ControlValueAccessor {
19 @Input() inputLabel: string
20 @Input() inputName: string
21 @Input() previewWidth: string
22 @Input() previewHeight: string
23
24 imageSrc: SafeResourceUrl
25
26 private file: File
27
28 constructor (
29 private sanitizer: DomSanitizer,
30 private serverService: ServerService
31 ) {}
32
33 get videoImageExtensions () {
34 return this.serverService.getConfig().video.image.extensions
35 }
36
37 get maxVideoImageSize () {
38 return this.serverService.getConfig().video.image.size.max
39 }
40
41 onFileChanged (file: File) {
42 this.file = file
43
44 this.propagateChange(this.file)
45 this.updatePreview()
46 }
47
48 propagateChange = (_: any) => { /* empty */ }
49
50 writeValue (file: any) {
51 this.file = file
52 this.updatePreview()
53 }
54
55 registerOnChange (fn: (_: any) => void) {
56 this.propagateChange = fn
57 }
58
59 registerOnTouched () {
60 // Unused
61 }
62
63 private updatePreview () {
64 if (this.file) {
65 const url = URL.createObjectURL(this.file)
66 this.imageSrc = this.sanitizer.bypassSecurityTrustResourceUrl(url)
67 }
68 }
69}
diff --git a/client/src/app/videos/video-list/video-overview.component.scss b/client/src/app/videos/video-list/video-overview.component.scss
index aff45c072..42b542233 100644
--- a/client/src/app/videos/video-list/video-overview.component.scss
+++ b/client/src/app/videos/video-list/video-overview.component.scss
@@ -1,5 +1,6 @@
1@import '_variables'; 1@import '_variables';
2@import '_mixins'; 2@import '_mixins';
3@import '_miniature';
3 4
4.section { 5.section {
5 padding-top: 10px; 6 padding-top: 10px;
@@ -50,4 +51,4 @@
50 .section { 51 .section {
51 @include video-miniature-small-screen; 52 @include video-miniature-small-screen;
52 } 53 }
53} \ No newline at end of file 54}