aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-13 14:18:37 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-13 14:23:11 +0200
commit230809efa1e7e81ce60cd65f8b398f01a27d525b (patch)
treeddbd0cee82bd2d35d01a1307a2905a467f51ca6b /client
parentbc503c2a62dcf9aed6b8d90b68f0f27a7755ac01 (diff)
downloadPeerTube-230809efa1e7e81ce60cd65f8b398f01a27d525b.tar.gz
PeerTube-230809efa1e7e81ce60cd65f8b398f01a27d525b.tar.zst
PeerTube-230809efa1e7e81ce60cd65f8b398f01a27d525b.zip
Update to Angular RC 1
Diffstat (limited to 'client')
-rw-r--r--client/.gitignore2
-rw-r--r--client/angular/app/app.component.ts6
-rw-r--r--client/angular/friends/services/friends.service.ts4
-rw-r--r--client/angular/main.ts (renamed from client/angular/bootstrap.ts)2
-rw-r--r--client/angular/users/components/login/login.component.ts4
-rw-r--r--client/angular/users/services/auth.service.ts4
-rw-r--r--client/angular/videos/components/add/videos-add.component.ts4
-rw-r--r--client/angular/videos/components/list/videos-list.component.ts4
-rw-r--r--client/angular/videos/components/watch/videos-watch.component.ts6
-rw-r--r--client/angular/videos/services/videos.service.ts4
-rw-r--r--client/index.html37
-rw-r--r--client/package.json26
-rw-r--r--client/systemjs.bundle.js15
-rw-r--r--client/systemjs.config.js47
-rw-r--r--client/tsconfig.json2
-rw-r--r--client/typings.json5
-rw-r--r--client/typings/typings.d.ts13
17 files changed, 132 insertions, 53 deletions
diff --git a/client/.gitignore b/client/.gitignore
index 4bb21ebab..24129f7c5 100644
--- a/client/.gitignore
+++ b/client/.gitignore
@@ -1,5 +1,7 @@
1typings 1typings
2!typings/typings.d.ts
2angular/**/*.js 3angular/**/*.js
3angular/**/*.map 4angular/**/*.map
4angular/**/*.css 5angular/**/*.css
5stylesheets/index.css 6stylesheets/index.css
7bundles
diff --git a/client/angular/app/app.component.ts b/client/angular/app/app.component.ts
index 83a4f3310..359d7128e 100644
--- a/client/angular/app/app.component.ts
+++ b/client/angular/app/app.component.ts
@@ -1,6 +1,6 @@
1import { Component } from 'angular2/core'; 1import { Component } from '@angular/core';
2import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from 'angular2/router'; 2import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from '@angular/router-deprecated';
3import { HTTP_PROVIDERS } from 'angular2/http'; 3import { HTTP_PROVIDERS } from '@angular/http';
4 4
5import { VideosAddComponent } from '../videos/components/add/videos-add.component'; 5import { VideosAddComponent } from '../videos/components/add/videos-add.component';
6import { VideosListComponent } from '../videos/components/list/videos-list.component'; 6import { VideosListComponent } from '../videos/components/list/videos-list.component';
diff --git a/client/angular/friends/services/friends.service.ts b/client/angular/friends/services/friends.service.ts
index 4eb1fc67b..cb34323e4 100644
--- a/client/angular/friends/services/friends.service.ts
+++ b/client/angular/friends/services/friends.service.ts
@@ -1,5 +1,5 @@
1import { Injectable } from 'angular2/core'; 1import { Injectable } from '@angular/core';
2import { Http, Response } from 'angular2/http'; 2import { Http, Response } from '@angular/http';
3import { Observable } from 'rxjs/Rx'; 3import { Observable } from 'rxjs/Rx';
4 4
5@Injectable() 5@Injectable()
diff --git a/client/angular/bootstrap.ts b/client/angular/main.ts
index d0f524f4a..e35f7dbdf 100644
--- a/client/angular/bootstrap.ts
+++ b/client/angular/main.ts
@@ -1,4 +1,4 @@
1import { bootstrap } from 'angular2/platform/browser'; 1import { bootstrap } from '@angular/platform-browser-dynamic';
2import { AppComponent } from './app/app.component'; 2import { AppComponent } from './app/app.component';
3 3
4bootstrap(AppComponent); 4bootstrap(AppComponent);
diff --git a/client/angular/users/components/login/login.component.ts b/client/angular/users/components/login/login.component.ts
index cecf5d2fd..d339353ef 100644
--- a/client/angular/users/components/login/login.component.ts
+++ b/client/angular/users/components/login/login.component.ts
@@ -1,5 +1,5 @@
1import { Component } from 'angular2/core'; 1import { Component } from '@angular/core';
2import { Router } from 'angular2/router'; 2import { Router } from '@angular/router-deprecated';
3 3
4import { AuthService } from '../../services/auth.service'; 4import { AuthService } from '../../services/auth.service';
5import { AuthStatus } from '../../models/authStatus'; 5import { AuthStatus } from '../../models/authStatus';
diff --git a/client/angular/users/services/auth.service.ts b/client/angular/users/services/auth.service.ts
index fc5048d8a..099563d43 100644
--- a/client/angular/users/services/auth.service.ts
+++ b/client/angular/users/services/auth.service.ts
@@ -1,5 +1,5 @@
1import { Injectable } from 'angular2/core'; 1import { Injectable } from '@angular/core';
2import { Http, Response, Headers, URLSearchParams, RequestOptions } from 'angular2/http'; 2import { Http, Response, Headers, URLSearchParams, RequestOptions } from '@angular/http';
3import { Observable, Subject } from 'rxjs/Rx'; 3import { Observable, Subject } from 'rxjs/Rx';
4 4
5import { AuthStatus } from '../models/authStatus'; 5import { AuthStatus } from '../models/authStatus';
diff --git a/client/angular/videos/components/add/videos-add.component.ts b/client/angular/videos/components/add/videos-add.component.ts
index bc7b4057c..f801cecbb 100644
--- a/client/angular/videos/components/add/videos-add.component.ts
+++ b/client/angular/videos/components/add/videos-add.component.ts
@@ -1,5 +1,5 @@
1import { Component, ElementRef, OnInit } from 'angular2/core'; 1import { Component, ElementRef, OnInit } from '@angular/core';
2import { Router } from 'angular2/router'; 2import { Router } from '@angular/router-deprecated';
3 3
4import { AuthService } from '../../../users/services/auth.service'; 4import { AuthService } from '../../../users/services/auth.service';
5import { User } from '../../../users/models/user'; 5import { User } from '../../../users/models/user';
diff --git a/client/angular/videos/components/list/videos-list.component.ts b/client/angular/videos/components/list/videos-list.component.ts
index b081522c7..6ff0b2afb 100644
--- a/client/angular/videos/components/list/videos-list.component.ts
+++ b/client/angular/videos/components/list/videos-list.component.ts
@@ -1,5 +1,5 @@
1import { Component, OnInit } from 'angular2/core'; 1import { Component, OnInit } from '@angular/core';
2import { ROUTER_DIRECTIVES, RouteParams } from 'angular2/router'; 2import { ROUTER_DIRECTIVES, RouteParams } from '@angular/router-deprecated';
3 3
4import { AuthService } from '../../../users/services/auth.service'; 4import { AuthService } from '../../../users/services/auth.service';
5import { User } from '../../../users/models/user'; 5import { User } from '../../../users/models/user';
diff --git a/client/angular/videos/components/watch/videos-watch.component.ts b/client/angular/videos/components/watch/videos-watch.component.ts
index b996ad882..6ac2787ed 100644
--- a/client/angular/videos/components/watch/videos-watch.component.ts
+++ b/client/angular/videos/components/watch/videos-watch.component.ts
@@ -1,6 +1,6 @@
1import { Component, OnInit, ElementRef } from 'angular2/core'; 1import { Component, OnInit, ElementRef } from '@angular/core';
2import { RouteParams, CanDeactivate, ComponentInstruction } from 'angular2/router'; 2import { RouteParams, CanDeactivate, ComponentInstruction } from '@angular/router-deprecated';
3import { BytesPipe } from 'angular-pipes/math'; 3import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
4 4
5// TODO import it with systemjs 5// TODO import it with systemjs
6declare var WebTorrent: any; 6declare var WebTorrent: any;
diff --git a/client/angular/videos/services/videos.service.ts b/client/angular/videos/services/videos.service.ts
index 74b6a1ddc..d08548339 100644
--- a/client/angular/videos/services/videos.service.ts
+++ b/client/angular/videos/services/videos.service.ts
@@ -1,5 +1,5 @@
1import { Injectable } from 'angular2/core'; 1import { Injectable } from '@angular/core';
2import { Http, Response } from 'angular2/http'; 2import { Http, Response } from '@angular/http';
3import { Observable } from 'rxjs/Rx'; 3import { Observable } from 'rxjs/Rx';
4 4
5import { Video } from '../models/video'; 5import { Video } from '../models/video';
diff --git a/client/index.html b/client/index.html
index 49a448c2c..c9bc7adb2 100644
--- a/client/index.html
+++ b/client/index.html
@@ -1,47 +1,34 @@
1<html> 1<html>
2 <head> 2 <head>
3 <base href="/">
4
3 <title>PeerTube</title> 5 <title>PeerTube</title>
6
7 <meta charset="UTF-8">
4 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 <meta name="viewport" content="width=device-width, initial-scale=1">
9
5 <link rel="stylesheet" href="/app/stylesheets/index.css"> 10 <link rel="stylesheet" href="/app/stylesheets/index.css">
6 11
7 <!-- 1. Load libraries --> 12 <!-- 1. Load libraries -->
8 <!-- IE required polyfills, in this exact order --> 13 <!-- IE required polyfills, in this exact order -->
9 <script src="/app/node_modules/es6-shim/es6-shim.min.js"></script> 14 <script src="/app/node_modules/es6-shim/es6-shim.min.js"></script>
10 <script src="/app/node_modules/systemjs/dist/system-polyfills.js"></script> 15 <script src="/app/node_modules/zone.js/dist/zone.js"></script>
11 <script src="/app/node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script> 16 <script src="/app/node_modules/reflect-metadata/Reflect.js"></script>
12
13 <script src="/app/node_modules/angular2/bundles/angular2-polyfills.js"></script>
14 <script src="/app/node_modules/systemjs/dist/system.src.js"></script> 17 <script src="/app/node_modules/systemjs/dist/system.src.js"></script>
15 <script src="/app/node_modules/rxjs/bundles/Rx.js"></script> 18
16 <script src="/app/node_modules/angular2/bundles/angular2.dev.js"></script>
17 <script src="/app/node_modules/angular2/bundles/router.dev.js"></script>
18 <script src="/app/node_modules/angular2/bundles/http.dev.js"></script>
19 <script src="/app/node_modules/jquery/dist/jquery.js"></script> 19 <script src="/app/node_modules/jquery/dist/jquery.js"></script>
20 <script src="/app/node_modules/jquery.ui.widget/jquery.ui.widget.js"></script> 20 <script src="/app/node_modules/jquery.ui.widget/jquery.ui.widget.js"></script>
21 <script src="/app/node_modules/blueimp-file-upload/js/jquery.fileupload.js"></script> 21 <script src="/app/node_modules/blueimp-file-upload/js/jquery.fileupload.js"></script>
22
22 <script src="/app/node_modules/webtorrent/webtorrent.min.js"></script> 23 <script src="/app/node_modules/webtorrent/webtorrent.min.js"></script>
23 24
25 <!-- <script src="/app/angular/angular-rxjs.bundle.js"></script> -->
24 26
25 <!-- 2. Configure SystemJS --> 27 <!-- 2. Configure SystemJS -->
28 <script src="/app/systemjs.config.js"></script>
26 <script> 29 <script>
27 System.config({ 30 System.import('app').catch(function(err){ console.error(err); });
28 packages: {
29 '/app': {
30 components: {
31 format: 'register',
32 defaultExtension: 'js'
33 }
34 }
35 },
36 map: {
37 'angular-pipes/math': '/app/node_modules/angular-pipes/math.js'
38 }
39 });
40 System.import('/app/angular/bootstrap')
41 .then(null, console.error.bind(console));
42 </script> 31 </script>
43
44 <base href="/">
45 </head> 32 </head>
46 33
47 <!-- 3. Display the application --> 34 <!-- 3. Display the application -->
diff --git a/client/package.json b/client/package.json
index db93ac681..5a103ceb7 100644
--- a/client/package.json
+++ b/client/package.json
@@ -17,28 +17,42 @@
17 "tsc:w": "tsc -w", 17 "tsc:w": "tsc -w",
18 "typings": "typings", 18 "typings": "typings",
19 "postinstall": "typings install", 19 "postinstall": "typings install",
20 "test": "tslint -c ./tslint.json angular/**/*.ts angular/**/**/*.ts angular/**/**/**/*.ts" 20 "test": "standard && tslint -c ./tslint.json angular/**/*.ts angular/**/**/*.ts angular/**/**/**/*.ts"
21 }, 21 },
22 "license": "ISC", 22 "license": "GPLv3",
23 "dependencies": { 23 "dependencies": {
24 "angular-pipes": "^1.5.0", 24 "angular-pipes": "^2.0.0",
25 "angular2": "2.0.0-beta.17", 25 "@angular/common": "2.0.0-rc.1",
26 "@angular/compiler": "2.0.0-rc.1",
27 "@angular/core": "2.0.0-rc.1",
28 "@angular/http": "2.0.0-rc.1",
29 "@angular/platform-browser-dynamic": "2.0.0-rc.1",
30 "@angular/platform-browser": "2.0.0-rc.1",
31 "@angular/router-deprecated": "2.0.0-rc.1",
26 "blueimp-file-upload": "^9.12.1", 32 "blueimp-file-upload": "^9.12.1",
27 "bootstrap-sass": "^3.3.6", 33 "bootstrap-sass": "^3.3.6",
28 "es6-promise": "^3.0.2", 34 "es6-promise": "^3.0.2",
29 "es6-shim": "^0.35.0", 35 "es6-shim": "^0.35.0",
30 "jquery": "^2.2.3", 36 "jquery": "^2.2.3",
31 "jquery.ui.widget": "^1.10.3", 37 "jquery.ui.widget": "^1.10.3",
32 "reflect-metadata": "0.1.2", 38 "reflect-metadata": "0.1.3",
33 "rxjs": "5.0.0-beta.6", 39 "rxjs": "5.0.0-beta.6",
34 "systemjs": "0.19.26", 40 "systemjs": "0.19.27",
35 "webtorrent": "^0.89.0", 41 "webtorrent": "^0.89.0",
36 "zone.js": "0.6.12" 42 "zone.js": "0.6.12"
37 }, 43 },
38 "devDependencies": { 44 "devDependencies": {
39 "codelyzer": "0.0.18", 45 "codelyzer": "0.0.18",
46 "standard": "^7.0.1",
47 "systemjs-builder": "^0.15.16",
40 "tslint": "^3.7.4", 48 "tslint": "^3.7.4",
41 "typescript": "^1.8.10", 49 "typescript": "^1.8.10",
42 "typings": "^0.8.1" 50 "typings": "^0.8.1"
51 },
52 "standard": {
53 "ignore": [
54 "angular/",
55 "bundles/"
56 ]
43 } 57 }
44} 58}
diff --git a/client/systemjs.bundle.js b/client/systemjs.bundle.js
new file mode 100644
index 000000000..2fd45156a
--- /dev/null
+++ b/client/systemjs.bundle.js
@@ -0,0 +1,15 @@
1var SystemBuilder = require('systemjs-builder')
2var builder = new SystemBuilder('node_modules', 'systemjs.config.js')
3
4var toBundle = [
5 'rxjs/Rx',
6 '@angular/common',
7 '@angular/compiler',
8 '@angular/core',
9 '@angular/http',
10 '@angular/platform-browser',
11 '@angular/platform-browser-dynamic',
12 '@angular/router-deprecated'
13]
14
15builder.bundle(toBundle.join(' + '), 'bundles/angular-rxjs.bundle.js')
diff --git a/client/systemjs.config.js b/client/systemjs.config.js
new file mode 100644
index 000000000..6b284ec63
--- /dev/null
+++ b/client/systemjs.config.js
@@ -0,0 +1,47 @@
1;(function (global) {
2 var map = {
3 'app': 'app/angular',
4 'angular-pipes': 'app/node_modules/angular-pipes',
5 'angular-rxjs.bundle': 'app/bundles/angular-rxjs.bundle.js'
6 }
7
8 var packages = {
9 'app': { main: 'main.js', defaultExtension: 'js' },
10 'rxjs': { defaultExtension: 'js' }
11 }
12 var packageNames = [
13 '@angular/common',
14 '@angular/compiler',
15 '@angular/core',
16 '@angular/http',
17 '@angular/platform-browser',
18 '@angular/platform-browser-dynamic',
19 '@angular/router-deprecated',
20 'angular-pipes'
21 ]
22
23 packageNames.forEach(function (pkgName) {
24 packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }
25 })
26
27 var config = {
28 map: map,
29 packages: packages,
30 bundles: {
31 'angular-rxjs.bundle': [
32 'rxjs',
33 '@angular/common/index.js',
34 '@angular/compiler/index.js',
35 '@angular/core/index.js',
36 '@angular/http/index.js',
37 '@angular/platform-browser/index.js',
38 '@angular/platform-browser-dynamic/index.js',
39 '@angular/router-deprecated/index.js'
40 ]
41 }
42 }
43
44 // filterSystemConfig - index.html's chance to modify config before we register it.
45 if (global.filterSystemConfig) global.filterSystemConfig(config)
46 System.config(config)
47})(this)
diff --git a/client/tsconfig.json b/client/tsconfig.json
index ca58ddb89..3e4648cf7 100644
--- a/client/tsconfig.json
+++ b/client/tsconfig.json
@@ -1,7 +1,7 @@
1{ 1{
2 "compilerOptions": { 2 "compilerOptions": {
3 "target": "es5", 3 "target": "es5",
4 "module": "system", 4 "module": "commonjs",
5 "moduleResolution": "node", 5 "moduleResolution": "node",
6 "sourceMap": true, 6 "sourceMap": true,
7 "emitDecoratorMetadata": true, 7 "emitDecoratorMetadata": true,
diff --git a/client/typings.json b/client/typings.json
index c06bb4d72..b5324f419 100644
--- a/client/typings.json
+++ b/client/typings.json
@@ -1,6 +1,7 @@
1{ 1{
2 "ambientDependencies": { 2 "ambientDependencies": {
3 "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd", 3 "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
4 "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd" 4 "jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
5 "node": "registry:dt/node#4.0.0+20160509154515"
5 } 6 }
6} 7}
diff --git a/client/typings/typings.d.ts b/client/typings/typings.d.ts
new file mode 100644
index 000000000..579c9a586
--- /dev/null
+++ b/client/typings/typings.d.ts
@@ -0,0 +1,13 @@
1/**
2 * Declares the 'commonjs' format module object that identifies the "module id" for the current module.
3 * Set a component's `moduleId` metadata property to `module.id` for module-relative urls
4 * when the generated module format is 'commonjs'.
5 */
6declare var module: {id: string};
7
8/**
9 * Declares the 'system' format string that identifies the "module id" for the current module.
10 * Set a component's `moduleId` metadata property to `__moduleName` for module-relative urls
11 * when the generated module format is 'system'.
12 */
13declare var __moduleName: string;