diff options
Diffstat (limited to 'client/src/app/videos')
6 files changed, 11 insertions, 35 deletions
diff --git a/client/src/app/videos/video-add/video-add.component.ts b/client/src/app/videos/video-add/video-add.component.ts index 900ef1da3..f0695d768 100644 --- a/client/src/app/videos/video-add/video-add.component.ts +++ b/client/src/app/videos/video-add/video-add.component.ts | |||
@@ -1,20 +1,15 @@ | |||
1 | import { Validators } from '@angular/common'; | ||
2 | import { Component, ElementRef, OnInit } from '@angular/core'; | 1 | import { Component, ElementRef, OnInit } from '@angular/core'; |
3 | import { FormControl, FormGroup, REACTIVE_FORM_DIRECTIVES } from '@angular/forms'; | 2 | import { FormControl, FormGroup, Validators } from '@angular/forms'; |
4 | import { Router } from '@angular/router'; | 3 | import { Router } from '@angular/router'; |
5 | 4 | ||
6 | import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; | 5 | import { FileUploader } from 'ng2-file-upload/ng2-file-upload'; |
7 | import { PROGRESSBAR_DIRECTIVES } from 'ng2-bootstrap/components/progressbar'; | ||
8 | import { FileSelectDirective, FileUploader } from 'ng2-file-upload/ng2-file-upload'; | ||
9 | 6 | ||
10 | import { AuthService } from '../../shared'; | 7 | import { AuthService } from '../../shared'; |
11 | 8 | ||
12 | @Component({ | 9 | @Component({ |
13 | selector: 'my-videos-add', | 10 | selector: 'my-videos-add', |
14 | styles: [ require('./video-add.component.scss') ], | 11 | styles: [ require('./video-add.component.scss') ], |
15 | template: require('./video-add.component.html'), | 12 | template: require('./video-add.component.html') |
16 | directives: [ FileSelectDirective, PROGRESSBAR_DIRECTIVES, REACTIVE_FORM_DIRECTIVES ], | ||
17 | pipes: [ BytesPipe ] | ||
18 | }) | 13 | }) |
19 | 14 | ||
20 | export class VideoAddComponent implements OnInit { | 15 | export class VideoAddComponent implements OnInit { |
diff --git a/client/src/app/videos/video-list/video-list.component.ts b/client/src/app/videos/video-list/video-list.component.ts index 9a9ffe29f..fa8e497aa 100644 --- a/client/src/app/videos/video-list/video-list.component.ts +++ b/client/src/app/videos/video-list/video-list.component.ts | |||
@@ -1,27 +1,19 @@ | |||
1 | import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; | 1 | import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; |
2 | import { AsyncPipe } from '@angular/common'; | 2 | import { ActivatedRoute, Router } from '@angular/router'; |
3 | import { ActivatedRoute, Router, ROUTER_DIRECTIVES } from '@angular/router'; | ||
4 | import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | 3 | import { BehaviorSubject } from 'rxjs/BehaviorSubject'; |
5 | 4 | ||
6 | import { PAGINATION_DIRECTIVES } from 'ng2-bootstrap/components/pagination'; | ||
7 | |||
8 | import { | 5 | import { |
9 | LoaderComponent, | ||
10 | SortField, | 6 | SortField, |
11 | Video, | 7 | Video, |
12 | VideoService | 8 | VideoService |
13 | } from '../shared'; | 9 | } from '../shared'; |
14 | import { AuthService, AuthUser, RestPagination, Search, SearchField } from '../../shared'; | 10 | import { AuthService, AuthUser, RestPagination, Search, SearchField } from '../../shared'; |
15 | import { VideoMiniatureComponent } from './video-miniature.component'; | ||
16 | import { VideoSortComponent } from './video-sort.component'; | ||
17 | import { SearchService } from '../../shared'; | 11 | import { SearchService } from '../../shared'; |
18 | 12 | ||
19 | @Component({ | 13 | @Component({ |
20 | selector: 'my-videos-list', | 14 | selector: 'my-videos-list', |
21 | styles: [ require('./video-list.component.scss') ], | 15 | styles: [ require('./video-list.component.scss') ], |
22 | pipes: [ AsyncPipe ], | 16 | template: require('./video-list.component.html') |
23 | template: require('./video-list.component.html'), | ||
24 | directives: [ LoaderComponent, PAGINATION_DIRECTIVES, ROUTER_DIRECTIVES, VideoMiniatureComponent, VideoSortComponent ] | ||
25 | }) | 17 | }) |
26 | 18 | ||
27 | export class VideoListComponent implements OnInit, OnDestroy { | 19 | export class VideoListComponent implements OnInit, OnDestroy { |
diff --git a/client/src/app/videos/video-list/video-miniature.component.ts b/client/src/app/videos/video-list/video-miniature.component.ts index 84bab950e..38317f832 100644 --- a/client/src/app/videos/video-list/video-miniature.component.ts +++ b/client/src/app/videos/video-list/video-miniature.component.ts | |||
@@ -1,6 +1,4 @@ | |||
1 | import { DatePipe } from '@angular/common'; | ||
2 | import { Component, Input, Output, EventEmitter } from '@angular/core'; | 1 | import { Component, Input, Output, EventEmitter } from '@angular/core'; |
3 | import { ROUTER_DIRECTIVES } from '@angular/router'; | ||
4 | 2 | ||
5 | import { SortField, Video, VideoService } from '../shared'; | 3 | import { SortField, Video, VideoService } from '../shared'; |
6 | import { User } from '../../shared'; | 4 | import { User } from '../../shared'; |
@@ -8,9 +6,7 @@ import { User } from '../../shared'; | |||
8 | @Component({ | 6 | @Component({ |
9 | selector: 'my-video-miniature', | 7 | selector: 'my-video-miniature', |
10 | styles: [ require('./video-miniature.component.scss') ], | 8 | styles: [ require('./video-miniature.component.scss') ], |
11 | template: require('./video-miniature.component.html'), | 9 | template: require('./video-miniature.component.html') |
12 | directives: [ ROUTER_DIRECTIVES ], | ||
13 | pipes: [ DatePipe ] | ||
14 | }) | 10 | }) |
15 | 11 | ||
16 | export class VideoMiniatureComponent { | 12 | export class VideoMiniatureComponent { |
diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts index d260e55c7..2a60e9327 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts | |||
@@ -1,18 +1,13 @@ | |||
1 | import { Component, ElementRef, NgZone, OnDestroy, OnInit } from '@angular/core'; | 1 | import { Component, ElementRef, NgZone, OnDestroy, OnInit } from '@angular/core'; |
2 | import { ActivatedRoute } from '@angular/router'; | 2 | import { ActivatedRoute } from '@angular/router'; |
3 | 3 | ||
4 | import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; | 4 | import { Video, VideoService } from '../shared'; |
5 | |||
6 | import { LoaderComponent, Video, VideoService } from '../shared'; | ||
7 | import { WebTorrentService } from './webtorrent.service'; | 5 | import { WebTorrentService } from './webtorrent.service'; |
8 | 6 | ||
9 | @Component({ | 7 | @Component({ |
10 | selector: 'my-video-watch', | 8 | selector: 'my-video-watch', |
11 | template: require('./video-watch.component.html'), | 9 | template: require('./video-watch.component.html'), |
12 | styles: [ require('./video-watch.component.scss') ], | 10 | styles: [ require('./video-watch.component.scss') ] |
13 | providers: [ WebTorrentService ], | ||
14 | directives: [ LoaderComponent ], | ||
15 | pipes: [ BytesPipe ] | ||
16 | }) | 11 | }) |
17 | 12 | ||
18 | export class VideoWatchComponent implements OnInit, OnDestroy { | 13 | export class VideoWatchComponent implements OnInit, OnDestroy { |
diff --git a/client/src/app/videos/videos.component.ts b/client/src/app/videos/videos.component.ts index 76252afbb..591e7523d 100644 --- a/client/src/app/videos/videos.component.ts +++ b/client/src/app/videos/videos.component.ts | |||
@@ -1,9 +1,7 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | ||
3 | 2 | ||
4 | @Component({ | 3 | @Component({ |
5 | template: '<router-outlet></router-outlet>', | 4 | template: '<router-outlet></router-outlet>' |
6 | directives: [ ROUTER_DIRECTIVES ] | ||
7 | }) | 5 | }) |
8 | 6 | ||
9 | export class VideosComponent { | 7 | export class VideosComponent { |
diff --git a/client/src/app/videos/videos.routes.ts b/client/src/app/videos/videos.routes.ts index 1f088b376..074f96596 100644 --- a/client/src/app/videos/videos.routes.ts +++ b/client/src/app/videos/videos.routes.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { RouterConfig } from '@angular/router'; | 1 | import { Routes } from '@angular/router'; |
2 | 2 | ||
3 | import { VideoAddComponent } from './video-add'; | 3 | import { VideoAddComponent } from './video-add'; |
4 | import { VideoListComponent } from './video-list'; | 4 | import { VideoListComponent } from './video-list'; |
5 | import { VideosComponent } from './videos.component'; | 5 | import { VideosComponent } from './videos.component'; |
6 | import { VideoWatchComponent } from './video-watch'; | 6 | import { VideoWatchComponent } from './video-watch'; |
7 | 7 | ||
8 | export const VideosRoutes: RouterConfig = [ | 8 | export const VideosRoutes: Routes = [ |
9 | { | 9 | { |
10 | path: 'videos', | 10 | path: 'videos', |
11 | component: VideosComponent, | 11 | component: VideosComponent, |