From 4a6995be18b15de1834a39c8921a0e4109671bb6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Jun 2016 22:08:03 +0200 Subject: First draft to use webpack instead of systemjs --- client/app/videos/video-add/index.ts | 1 - .../app/videos/video-add/video-add.component.html | 41 ------------- .../app/videos/video-add/video-add.component.scss | 33 ----------- client/app/videos/video-add/video-add.component.ts | 69 ---------------------- 4 files changed, 144 deletions(-) delete mode 100644 client/app/videos/video-add/index.ts delete mode 100644 client/app/videos/video-add/video-add.component.html delete mode 100644 client/app/videos/video-add/video-add.component.scss delete mode 100644 client/app/videos/video-add/video-add.component.ts (limited to 'client/app/videos/video-add') diff --git a/client/app/videos/video-add/index.ts b/client/app/videos/video-add/index.ts deleted file mode 100644 index 79488e851..000000000 --- a/client/app/videos/video-add/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './video-add.component'; diff --git a/client/app/videos/video-add/video-add.component.html b/client/app/videos/video-add/video-add.component.html deleted file mode 100644 index 80d229cb8..000000000 --- a/client/app/videos/video-add/video-add.component.html +++ /dev/null @@ -1,41 +0,0 @@ -

Upload a video

- -
-
- - -
- Name is required -
-
- -
-
- Select the video... - -
- - {{ fileToUpload.name }} -
- -
- - -
- A description is required -
-
- -
- {{ progressBar.value | bytes }} / {{ progressBar.max | bytes }} -
- - -
diff --git a/client/app/videos/video-add/video-add.component.scss b/client/app/videos/video-add/video-add.component.scss deleted file mode 100644 index 01195f017..000000000 --- a/client/app/videos/video-add/video-add.component.scss +++ /dev/null @@ -1,33 +0,0 @@ -.btn-file { - position: relative; - overflow: hidden; -} - -.btn-file input[type=file] { - position: absolute; - top: 0; - right: 0; - min-width: 100%; - min-height: 100%; - font-size: 100px; - text-align: right; - filter: alpha(opacity=0); - opacity: 0; - outline: none; - background: white; - cursor: inherit; - display: block; -} - -.name_file { - display: inline-block; - margin-left: 10px; -} - -.form-group { - margin-bottom: 10px; -} - -#progress { - margin-bottom: 10px; -} diff --git a/client/app/videos/video-add/video-add.component.ts b/client/app/videos/video-add/video-add.component.ts deleted file mode 100644 index e17b1b0f6..000000000 --- a/client/app/videos/video-add/video-add.component.ts +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// - -import { Component, ElementRef, OnInit } from '@angular/core'; -import { Router } from '@angular/router-deprecated'; - -import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; -import { PROGRESSBAR_DIRECTIVES } from 'ng2-bootstrap/components/progressbar'; - -import { AuthService, User } from '../../shared/index'; - -@Component({ - selector: 'my-videos-add', - styleUrls: [ 'client/app/videos/video-add/video-add.component.css' ], - templateUrl: 'client/app/videos/video-add/video-add.component.html', - directives: [ PROGRESSBAR_DIRECTIVES ], - pipes: [ BytesPipe ] -}) - -export class VideoAddComponent implements OnInit { - fileToUpload: any; - progressBar: { value: number; max: number; } = { value: 0, max: 0 }; - user: User; - - private form: any; - - constructor( - private authService: AuthService, - private elementRef: ElementRef, - private router: Router - ) {} - - ngOnInit() { - this.user = User.load(); - jQuery(this.elementRef.nativeElement).find('#videofile').fileupload({ - url: '/api/v1/videos', - dataType: 'json', - singleFileUploads: true, - multipart: true, - autoUpload: false, - - add: (e, data) => { - this.form = data; - this.fileToUpload = data['files'][0]; - }, - - progressall: (e, data) => { - this.progressBar.value = data.loaded; - // The server is a little bit slow to answer (has to seed the video) - // So we add more time to the progress bar (+10%) - this.progressBar.max = data.total + (0.1 * data.total); - }, - - done: (e, data) => { - this.progressBar.value = this.progressBar.max; - console.log('Video uploaded.'); - - // Print all the videos once it's finished - this.router.navigate(['VideosList']); - } - }); - } - - uploadFile() { - this.form.formData = jQuery(this.elementRef.nativeElement).find('form').serializeArray(); - this.form.headers = this.authService.getRequestHeader().toJSON(); - this.form.submit(); - } -} -- cgit v1.2.3