diff options
Diffstat (limited to 'client/src/app/videos')
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' | |||
2 | import { TagInputModule } from 'ngx-chips' | 2 | import { TagInputModule } from 'ngx-chips' |
3 | import { SharedModule } from '../../../shared/' | 3 | import { SharedModule } from '../../../shared/' |
4 | import { VideoEditComponent } from './video-edit.component' | 4 | import { VideoEditComponent } from './video-edit.component' |
5 | import { VideoImageComponent } from './video-image.component' | ||
6 | import { CalendarModule } from 'primeng/components/calendar/calendar' | 5 | import { CalendarModule } from 'primeng/components/calendar/calendar' |
7 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' | 6 | import { 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 @@ | |||
1 | import { Component, forwardRef, Input } from '@angular/core' | ||
2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' | ||
3 | import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser' | ||
4 | import { 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 | }) | ||
18 | export 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 | } |