aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/angular/videos/components/add
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-14 22:16:43 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-14 22:16:43 +0100
commit98b01bac2c2c4536aa97d826b61516657f4d15f5 (patch)
tree75fe2d75f1c58c6897127f03cfb7d8b654545227 /client/angular/videos/components/add
parentdc8bc31be517a53e8fbe7100cfe45cd73f596de0 (diff)
downloadPeerTube-98b01bac2c2c4536aa97d826b61516657f4d15f5.tar.gz
PeerTube-98b01bac2c2c4536aa97d826b61516657f4d15f5.tar.zst
PeerTube-98b01bac2c2c4536aa97d826b61516657f4d15f5.zip
Angular 2 : draft 2
Diffstat (limited to 'client/angular/videos/components/add')
-rw-r--r--client/angular/videos/components/add/videos-add.component.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/client/angular/videos/components/add/videos-add.component.ts b/client/angular/videos/components/add/videos-add.component.ts
index 97e3bb3b5..8ff6cfec8 100644
--- a/client/angular/videos/components/add/videos-add.component.ts
+++ b/client/angular/videos/components/add/videos-add.component.ts
@@ -1,9 +1,10 @@
1import {Component, ElementRef, Inject, OnInit} from 'angular2/core'; 1import { Component, ElementRef, Inject, OnInit } from 'angular2/core';
2import {Router} from 'angular2/router'; 2import { Router } from 'angular2/router';
3import {NgForm} from 'angular2/common'; 3import { NgForm } from 'angular2/common';
4 4
5import {Video} from '../../models/video'; 5import { Video } from '../../models/video';
6 6
7// TODO: import it with systemjs
7declare var jQuery:any; 8declare var jQuery:any;
8 9
9@Component({ 10@Component({
@@ -22,9 +23,10 @@ export class VideosAddComponent implements OnInit {
22 23
23 ngOnInit() { 24 ngOnInit() {
24 jQuery(this._elementRef.nativeElement).find('#input_video').fileupload({ 25 jQuery(this._elementRef.nativeElement).find('#input_video').fileupload({
26 url: '/api/v1/videos',
27 dataType: 'json',
25 singleFileUploads: true, 28 singleFileUploads: true,
26 multipart: true, 29 multipart: true,
27 url: '/api/v1/videos',
28 autoupload: false, 30 autoupload: false,
29 31
30 add: (e, data) => { 32 add: (e, data) => {
@@ -38,7 +40,8 @@ export class VideosAddComponent implements OnInit {
38 }, 40 },
39 41
40 done: (e, data) => { 42 done: (e, data) => {
41 console.log('finished'); 43 console.log('Video uploaded.');
44
42 // Print all the videos once it's finished 45 // Print all the videos once it's finished
43 this._router.navigate(['VideosList']); 46 this._router.navigate(['VideosList']);
44 } 47 }